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
|
.\" Copyright (C), 1994, Graeme W. Wilford (Wilf).
.\"
.\" 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.
.\"
.\" Fri Jul 29th 12:56:44 BST 1994 Wilf. <G.Wilford@ee.surrey.ac.uk>
.\" Changes inspired by patch from Richard Kettlewell
.\" <richard@greenend.org.uk>, aeb 970616.
.\" Modified, 27 May 2004, Michael Kerrisk <mtk-manpages@gmx.net>
.\" Added notes on capability requirements
.\"
.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
.\" all rights reserved.
.\" Translated Sat Mar 1 16:32:11 JST 1997
.\" by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
.\" Modified Sun Sep 28 20:26:49 JST 1997
.\" by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
.\" Updated & Modified Sat May 22 18:21:45 JST 2004
.\" by Yuichi SATO <ysato444@yahoo.co.jp>
.\" Updated & Modified Wed Jan 5 00:51:28 JST 2005 by Yuichi SATO
.\"
.\"WORD: identity
.\"WORD: effective user ID ¸桼ID
.\"WORD: real user ID ¥桼ID
.\"WORD: saved user ID ¸桼ID
.\"WORD: implement
.\"WORD: root 롼
.\"WORD: super-user ѡ桼
.\"
.TH SETUID 2 2004-05-27 "Linux 2.6.6" "Linux Programmer's Manual"
.SH ̾
setuid \- 桼 (identity) ꤹ
.SH
.B #include <sys/types.h>
.br
.B #include <unistd.h>
.sp
.BI "int setuid(uid_t " uid );
.SH
.B setuid
ϸߤΥץμ¸ (effective) 桼 ID ꤹ롣
⤷ƤӽФץμ¸桼 ID root ʤС
(real) 桼 ID ¸ (saved) 桼 ID ꤵ롣
.PP
Linux Ǥϡ
.B setuid
_POSIX_SAVED_IDS ä POSIX ǤΤ褦˼Ƥ롣
(롼Ȱʳ) setuid ץˤΥ桼ø
ͿøɬפʤŻμ¸桼 ID
ˡǺƤ᤹Ȥ
.PP
桼롼 (root) ޤϥץब롼Ȥ setuid ƤʤС
̤դʧ롣
.B setuid
ؿϸƤӽФԤμ¸桼 ID å
줬ѡ桼ʤС
ץ˴ϢƤΥ桼 ID
.I uid
ꤹ롣
줬Ԥʤ줿ˤϥץबƤӥ롼Ȥø뤳ȤϤǤʤ
.PP
Τ褦ˡsetuid-root ץϰŪ˥롼øͿ
롼ȤǤʤ褦˿ȤǤ줫
.B setuid
ȤäƺƤӥ롼ø뤳ȤǤʤ褦ˤ롣
(POSIX ǤʤBSD)
.B seteuid
ǹԤʤȤǤ롣
.SH ֤
0 ֤롣顼ξ \-1 ֤졢
.I errno
Ŭڤꤵ롣
.SH 顼
.TP
.B EAGAIN
.I uid
ߤΥ桼 ID ȥޥå
.I uid
ˤäƥץ NPROC rlimit Ķ
.TP
.B EPERM
桼ø
(Linux Ǥ
.B CAP_SETUID
ѥӥƥ (capability) )
.I uid
ƤӽФץμ¥桼 ID ޤ¸桼 ID Ȱפʤ
.SH
SVr4, SVID, POSIX.1
4.4BSD ΥȤϴʸߴϤʤ
BSD Υϼ (real)¸ (saved)¸ (effective) ID Ƥꤹ롣
SVr4 ˤ¾ EINVAL 顼ˤĤƤεҤ롣
.SH "LINUX ͭ"
Linux ϥե롦ƥࡦ桼 ID γǰġ
̾ϼ¸桼 ID
.B setuid
ϸߤΥץΥե롦ƥࡦ桼 ID ꤹ롣
.BR setfsuid (2)
⻲Ȥ뤳ȡ
.PP
.I uid
Τμ¸ uid ȰۤäƤ硢ץϥפ뤳Ȥ
ػߤ롣
.SH Ϣ
.BR getuid (2),
.BR seteuid (2),
.BR setfsuid (2),
.BR setreuid (2),
.BR capabilities (7)
|