1 .\" Copyright (C) 2001 Andries Brouwer (aeb@cwi.nl)
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date. The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein. The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" [should really be seteuid.3]
24 .\" Modified, 27 May 2004, Michael Kerrisk <mtk.manpages@gmail.com>
25 .\" Added notes on capability requirements
27 .\" Japanese Version Copyright (c) 2001, 2005 Yuichi SATO
28 .\" all rights reserved.
29 .\" Translated 2001-06-04, Yuichi SATO <ysato@h4.dion.ne.jp>
30 .\" Updated & Modified 2005-01-04, Yuichi SATO <ysato444@yahoo.co.jp>
31 .\" Updated 2010-04-23, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.24
33 .\"WORD: effective user ID ¼Â¸ú¥æ¡¼¥¶¡¼ ID
34 .\"WORD: real user ID ¼Â¥æ¡¼¥¶¡¼ ID
35 .\"WORD: saved user ID Êݸ¥æ¡¼¥¶¡¼ ID
38 .TH SETEUID 2 2009-10-17 "Linux" "Linux Programmer's Manual"
40 seteuid, setegid \- ¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤ä ¼Â¸ú¥°¥ë¡¼¥× ID ¤òÀßÄꤹ¤ë
42 .B #include <sys/types.h>
44 .B #include <unistd.h>
46 .BI "int seteuid(uid_t " euid );
48 .BI "int setegid(gid_t " egid );
51 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
52 .RB ( feature_test_macros (7)
60 _BSD_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600
65 ¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤òÀßÄꤹ¤ë¡£
66 ÈóÆø¢¥æ¡¼¥¶¡¼¤Î¥×¥í¥»¥¹¤Î¾ì¹ç¡¢¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤ËÀßÄê¤Ç¤¤ë¤Î¤Ï¡¢
67 ¼Â¥æ¡¼¥¶¡¼ ID¡¦¼Â¸ú¥æ¡¼¥¶¡¼ ID¡¦Êݸ set-user-ID ¤Î¤¤¤º¤ì¤«¤À¤±¤Ç¤¢¤ë¡£
70 ¤Ï¡Ö¥æ¡¼¥¶¡¼¡×¤Ç¤Ï¤Ê¤¯¡Ö¥°¥ë¡¼¥×¡×¤ËÂФ·¤ÆÁ´¤¯Æ±¤¸¤³¤È¤ò¹Ô¤¦¡£
73 .\" equals \-1, nothing is changed.
74 .\" (This is an artifact of the implementation in glibc of seteuid()
75 .\" using setresuid(2).)
77 À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤¬ÊÖ¤µ¤ì¤ë¡£
78 ¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢
87 ¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ËÆø¢¤¬¤Ê¤¯¡¢
90 ¤¬¼Â¥æ¡¼¥¶¡¼ (¥°¥ë¡¼¥×) ID¡¢¤Þ¤¿¤Ï¼Â¸ú¥æ¡¼¥¶¡¼ (¥°¥ë¡¼¥×) ID¡¢
91 Êݸ set-user-ID (Êݸ set-group-ID) ¤Î¤¤¤º¤ì¤Ç¤â¤Ç¤Ï¤Ê¤¤
96 ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤¬¡¢
100 ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¤Ê¤¤¾ì¹ç¤Ë¡¢Æø¢¤¬¤Ê¤¤¤ÈȽÃǤµ¤ì¤ë)¡£
102 4.3BSD, POSIX.1-2001.
104 ¼Â¸ú¥æ¡¼¥¶¡¼ (¥°¥ë¡¼¥×) ID ¤òÊݸ set-user-ID (Êݸ set-group-ID) ¤Ë
105 ÀßÄê¤Ç¤¤ë¤Î¤Ï¡¢Linux 1.1.37 (1.1.38) °Ê¹ß¤Ç¤¢¤ë¡£
106 Á´¤Æ¤Î¥·¥¹¥Æ¥à¤Ë¤ª¤¤¤Æ
108 ¤ò¥Á¥§¥Ã¥¯¤¹¤Ù¤¤Ç¤¢¤ë¡£
110 libc4, libc5, glibc 2.0 ¤Ç¤Ï¡¢
113 .BI setreuid(\-1, " euid" )
114 ¤ÈÅù²Á¤Ç¤¢¤ê¡¢Êݸ set-user-ID ¤òÊѹ¹¤¹¤ë¤«¤â¤·¤ì¤Ê¤¤¡£
116 .BI setresuid(\-1, " euid" ", \-1)"
117 ¤ÈÅù²Á¤Ç¤¢¤ê¡¢Êݸ set-user-ID Êѹ¹¤·¤Ê¤¤¡£
128 ¤È¤·¤Æ¸½ºß¤Î¼Â¸ú¥æ¡¼¥¶ (¥°¥ë¡¼¥×) ID ¤ÈƱ¤¸Ãͤò»ØÄê²Äǽ¤Ç¤¢¤ë
129 ɬÍפϤʤ¤¤È¤µ¤ì¤Æ¤ª¤ê¡¢¤¤¤¯¤Ä¤«¤Î¼ÂÁõ¤Ç¤Ï
132 ¤È¤·¤Æ¸½ºß¤Î¼Â¸ú¥æ¡¼¥¶ (¥°¥ë¡¼¥×) ID ¤ÈƱ¤¸Ãͤò
133 »ØÄꤹ¤ë¤³¤È¤¬¤Ç¤¤Ê¤¤¡£
139 .BR capabilities (7),