File: chown.2

package info (click to toggle)
manpages-ja 0.5.0.0.20050315-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 18,620 kB
  • ctags: 4
  • sloc: sh: 12,675; perl: 157; makefile: 106
file content (202 lines) | stat: -rw-r--r-- 6,294 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
194
195
196
197
198
199
200
201
202
.\" 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 1993-07-21 by Rik Faith <faith@cs.unc.edu>
.\" Modified 1996-07-09 by Andries Brouwer <aeb@cwi.nl>
.\" Modified 1996-11-06 by Eric S. Raymond <esr@thyrsus.com>
.\" Modified 1997-05-18 by Michael Haardt <michael@cantor.informatik.rwth-aachen.de>
.\" Modified 2004-06-23 by Michael Kerrisk <mtk-manpages@gmx.net>
.\"
.\"
.\" 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>
.\" Modified Sun Feb 29 15:33:50 JST 2004
.\"         by Yuichi SATO <ysato444@yahoo.co.jp>
.\" Updated & Modified Wed Dec 29 06:48:16 JST 2004 by Yuichi SATO
.\"
.TH CHOWN 2 2004-06-23 "Linux 2.6.7" "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) ȥ롼פѹ롣
øĥץ (Linux Ǥ
.B CAP_CHOWN
ѥӥƥ (capability) ĥץ) 
եνͭԤѹǤ롣
եνͭԤϡνͭԤ°Ƥ륰롼פΤ줫
եΥ롼פѹ뤳ȤǤ롣
ø (Linux Ǥ
.BR CAP_CHOWN )
ĥץϡǤդΥ롼פѹǤ롣

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

ѡ桼ʳˤäƼ¹ԥեνͭԤޤϥ롼פ
ѹ줿 S_ISUID  ISGID ⡼ɥӥåȤϥꥢ롣
POSIX Ϥư롼Ȥ
.I chown 
ԤʤäˤĤƤä˻ꤵƤʤ
Linux ˤưϥͥΥС˰¸롣
.\" Linux 2.0 ͥǤϡѡ桼Ǥư
.\" ¾Υ桼ξƱǤä
.\" 2.2 Ǥϡ2.2.12 ޤǤϡѡ桼ξˤ
.\" ΥӥåȤϥꥢʤʤä
.\" 2.2.13 ʹߤǤϡѡ桼Ǥư
.\" Ƥ¾Υ桼ξƱˤʤä
󥰥롼׼¹ԥե (S_IXGRP ӥåȤꤵƤʤ) ξˤ
S_ISGID ӥåȤ϶å (mandatory locking) ̣Ƥ롣
Ƥ 
.I chown 
ǤϥꥢǤʤ

.SH ֤
ȡ0 ֤
Ԥȡ\-1 ֤
.I errno
Ŭڤͤꤹ롣
.SH 顼
ե륷ƥˤäƤ¾Υ顼֤롣
.B chmod
ǰŪʥ顼ʲ˵󤲤롣
.TP
.B EACCES
.I path
ιǤ˸ (search permission) ʤ
.RB ( path_resolution (2)
⻲)
.TP
.B EFAULT
.I path
Ƥ줿ɥ쥹ֳؤƤ롣
.TP
.B ELOOP
.I path
褹ݤܥå󥯤¿᤮롣
.TP
.B ENAMETOOLONG
.I path
Ĺ᤮롣
.TP
.B ENOENT
ե뤬¸ߤʤ
.TP
.B ENOMEM
ͥ˽ʬʥ꤬ʤ
.TP
.B ENOTDIR
.I path
ιǤǥ쥯ȥǤʤ
.TP
.B EPERM
ƤӽФץ˽ͭԤޤϥ롼 (⤷Ϥξ) ѹ뤿
׵ᤵ (嵭򻲾) ʤ
.TP
.B EROFS
ꤷե뤬ɤ߹ (read-only) Υե롦ƥˤ롣
.PP
.B fchown
ǰŪʥ顼ʲ˵󤲤:
.TP
.B EBADF
ǥץͭǤʤ
.TP
.B EIO
i Ρ (inode) ѹݤ٥ I/O 顼ȯ
.TP
.B ENOENT
嵭򻲾ȡ
.TP
.B EPERM
嵭򻲾ȡ
.TP
.B EROFS
嵭򻲾ȡ
.SH 
Linux  2.1.81 ΥС (ä 2.1.46 ) Ǥϡ
.B chown
ϥܥå󥯤פʤ
Linux 2.1.81 ʹߤǤ
.B chown
ϥܥå󥯤פʥƥࡦ
.B lchown
ϥܥå󥯤פʤ
Linux 2.1.86 ʹߤǤϤο (Ť
.B 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),
.BR path_resolution (2)