File: chown.2

package info (click to toggle)
manpages-ja 0.4.0.0.20020315-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 14,808 kB
  • ctags: 4
  • sloc: sh: 9,595; perl: 157; makefile: 62
file content (193 lines) | stat: -rw-r--r-- 5,855 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
.\" Hey Emacs! This file is -*- nroff -*- source.
.\"
.\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992
.\" Copyright (c) 1998 Andries Brouwer (aeb@cwi.nl)
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one
.\" 
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date.  The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein.  The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\" 
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.\" Modified by Michael Haardt <michael@moria.de>
.\" Modified Wed Jul 21 21:53:01 1993 by Rik Faith (faith@cs.unc.edu)
.\" Modified Tue Jul  9 13:59:51 1996 by Andries Brouwer <aeb@cwi.nl>
.\" Modified Wed Nov  6 03:49:07 1996 by Eric S. Raymond <esr@thyrsus.com>
.\" Modified Sun May 18 10:34:09 1997 by Michael Haardt <michael@cantor.informatik.rwth-aachen.de>
.\"
.\"
.\" Japanese Version Copyright (c) 1996 Yosiaki Yanagihara
.\"         all rights reserved.
.\" Translated Mon Jun 24 14:29:55 JST 1996
.\"         by Yosiaki Yanagihara <yosiaki@bsd2.kbnes.nec.co.jp>
.\" Modified Mon May 11 15:26:34 JST 1998
.\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
.\"
.TH CHOWN 2 "May 18, 1997" "Linux 2.1.81" "Linux Programmer's Manual"
.SH ̾
chown, fchown, lchown \- եνͭԤѹ
.SH 
.B #include <sys/types.h>
.br
.B #include <unistd.h>
.sp
.BI "int chown(const char *" path ", uid_t " owner ", gid_t " group );
.br
.BI "int fchown(int " fd ", uid_t " owner ", gid_t " group );
.br
.BI "int lchown(const char *" path ", uid_t " owner ", gid_t " group );
.SH 
.I path
ޤϡ
.I fd
ǻꤵ줿եνͭ(owner)ѹ롣
ѡ桼եνͭԤѹǤ롣
եνͭԤϡνͭԤ°Ƥ륰롼פΤ줫
եΥ롼פѹ뤳ȤǤ롣
ѡ桼ϡǤդΥ롼פѹǤ롣

.I owner
ޤ
.I group
 \-1 ꤵ줿硢IDѹʤ

When the owner or group of an executable file are changed by a non-super-user,
the S_ISUID and S_ISGID mode bits are cleared. POSIX does not specify whether
this also should happen when root does the
.IR chown ;
the Linux behaviour depends on the kernel version.

ѡ桼ʳˤäƼ¹ԥեνͭԤޤϥ롼פ
ѹ줿 S_ISUID  ISGID ⡼ɥӥåȤϥꥢ롣
POSIX Ϥư롼Ȥ
.IR chown 
ԤʤäˤĤƤä˻ꤵƤʤ
󥰥롼׼¹ԥե(S_IXGRP ӥåȤꤵƤʤ)ξˤ
S_ISGID ӥåȤ϶å(mandatory locking)̣Ƥ롣
Ƥ 
.IR chown 
ǤϥꥢǤʤ

.SH ֤
ȡ0֤
Ԥȡ\-1֤
.I errno
Ŭڤͤꤹ롣
.SH 顼
ե륷ƥˤäƤ¾Υ顼֤롣
.B chmod
ǰŪʥ顼ʲ˵󤲤:

.TP
.B EPERM
¸/(effective)UIDեνͭԤȰפ
Ǥʤ
ޤϡ
.I owner
ޤ
.I group
ꤵƤʤ
.TP
.B EROFS
ꤷե뤬ɤ߹(read-only)Υե롦ƥˤ롣
.TP
.B EFAULT
.I path
Ƥ줿ɥ쥹ֳؤƤ롣
.TP
.B ENAMETOOLONG
.I path
Ĺ᤮롣
.TP
.B ENOENT
ե뤬¸ߤʤ
.TP
.B ENOMEM
ͥ˽ʬʥ꤬ʤ
.TP
.B ENOTDIR
.I path
ιǤǥ쥯ȥǤʤ
.TP
.B EACCES
.I path
ιǤ˸(search permission)ʤ
.TP
.B ELOOP
.I path
褹ݤܥå󥯤¿᤮롣
.PP
.B fchown
ǰŪʥ顼ʲ˵󤲤:
.TP
.B EBADF
ǥץͭǤʤ
.TP
.B ENOENT
嵭򻲾ȡ
.TP
.B EPERM
嵭򻲾ȡ
.TP
.B EROFS
嵭򻲾ȡ
.TP
.B EIO
iΡ(inode)ݤ٥ I/O 顼ȯ
.SH 
Linux  2.1.81 ΥС (ä 2.1.46) Ǥϡ
.B chown
ϥܥå󥯤פʤ
Linux 2.1.81 ʹߤǤ
.B chown
ϥܥå󥯤פʥƥࡦ
.B lchown
ϥܥå󥯤פʤ
Linux 2.1.86 ʹߤǤϤο(Ť
.BR chown 
ƱưԤʤ)Ʊƥॳֹ
.B chown
ϿƳ줿ֹġ
.LP
.B fchown

.B _BSD_SOURCE
ƤΤѤǤ롣
(Ūˤ⤷ϰۤ _POSIX_SOURCE -ansi ե饰
ꤷƥѥ뤷ʤ _BSD_SOURCE ưŪ)
.SH 
.B chown
 SVr4, SVID, POSIX, X/OPEN ȸߴ롣4.4BSD ǤǤ
ѡ桼ΤߤѤǤ롣
SVr4 ˤ EINVAL, EINTR, ENOLINK, EMULTIHOP ֤ȵҤƤ뤬
ENOMEM ϤʤPOSIX.1 ˤ ENOMEM, ELOOP ˤĤƵҤϤʤ
.PP
.B fchown
 4.4BSD, SVr4 ȸߴ롣
SVr4 ˤ¾ EINVAL, EIO, EINTR, ENOLINK 顼֤ˤĤƤεҤ롣
.SH 
\fBchown\fP()  UID ޥåԥ󥰤Ѥ NFS ե롦ƥ
롣˥եƤ˥ƤΥƥࡦ
롣 \fBchown\fP() ˥ץ󤵤줿եФ
򤿤˼äȤˤ롣饤¦Υåˤ
ͭѹƥ桼Υȡºݤ¾
饤Ȥǥ桼ˤäƥե˥ǤȤδ֤
ֺ뤫⤷ʤ
.SH Ϣ
.BR chmod (2),
.BR flock (2)