From owner-man-jp@jp.FreeBSD.org Sat Oct 30 12:16:14 2004
Received: (from daemon@localhost)
	by castle.jp.FreeBSD.org (8.11.6p2+3.4W/8.11.3) id i9U3GEP01636;
	Sat, 30 Oct 2004 12:16:14 +0900 (JST)
	(envelope-from owner-man-jp@jp.FreeBSD.org)
Received: from multi.al.rim.or.jp (multi.al.rim.or.jp [202.247.191.124])
	by castle.jp.FreeBSD.org (8.11.6p2+3.4W/8.11.3) with ESMTP/inet id i9U3GC801630
	for <man-jp@jp.FreeBSD.org>; Sat, 30 Oct 2004 12:16:12 +0900 (JST)
	(envelope-from kano@na.rim.or.jp)
Received: from shell.rim.or.jp
	by multi.al.rim.or.jp (3.7W/HMX-12) id MAA24990
	for <man-jp@jp.FreeBSD.org>; Sat, 30 Oct 2004 12:16:12 +0900 (JST)
From: kano@na.rim.or.jp
Received: (from kano_na@localhost)
	by shell.rim.or.jp (8.9.3p2/3.7W/DI-2000071215) id MAA90224;
	Sat, 30 Oct 2004 12:16:12 +0900 (JST)
	(envelope-from kano_na)
Message-Id: <200410300316.MAA90224@shell.rim.or.jp>
To: man-jp@jp.FreeBSD.org
References: <4180B8CD.7000007@gc5.so-net.ne.jp>
        <200410281333.WAA44130@shell.rim.or.jp>
        <4181096C.4070006@gc5.so-net.ne.jp>
In-Reply-To: <4181096C.4070006@gc5.so-net.ne.jp>
Reply-To: man-jp@jp.FreeBSD.org
Precedence: list
Date: Sat, 30 Oct 2004 12:16:12 +0900
X-Sequence: man-jp 5530
Subject: [man-jp 5530] Re: Updates to 5.3RC
Sender: owner-man-jp@jp.FreeBSD.org
X-Originator: kano@na.rim.or.jp
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+041021

In message <4181096C.4070006@gc5.so-net.ne.jp>
  SUZUKI Koichi <metal@gc5.so-net.ne.jp> writes:
>> make.conf.5 $B$G$O!"(B set-user-ID bit $B$,!"(B
>> $B!V%f!<%6(B ID $B@_Dj%S%C%H!W$HLu$5$l$F$$$k$b$N$H(B
>> $B!V%;%C%H%f!<%6(B ID $B%S%C%H!W$HLu$5$l$F$$$k$b$N$,$"$k$N$,5$$K$J$j$^$7$?!#(B
> 
> $B$3$l$O!V%f!<%6(B ID $B@_Dj%S%C%H!W$G$9$M!#(B
> $BBPLuI=$K$"$j$^$9$G$9!#(B

$B$=$A$i$r8+$k$N$rK:$l$F$$$^$7$?!#<:Ni$7$^$7$?!#(B

>> # $BB>$N%^%K%e%"%k%Z!<%8$r8+$k$HE}0l$5$l$?Lu8l$O$J$$$h$&$J$N$G!"(B
>> # make.conf.5 $B$NCf$@$1$G$bB7$($k$N$,%h%5%2$+$H;W$$$^$9!#(B
> 
> $B$`$`!"B>$K$b$"$j$^$9$+!#(B
> $BD>$5$M$P!D(B

access.2, chmod.2, chown.2, execve.2, execve.2, intro.2,
getuid.2, kill.2, setreuid.2, setuid.2, write.2, sendmail.8
$B$G$OBPLuI=$I$*$j$G$7$?!#(B

$B0J2<$O!"BPLuI=$I$*$j$G$J$+$C$?$b$N$G$9!#(B

man1/chmod.1
> $B<B9T;~(B setuid $B$*$h$S<B9T;~(B setgid $B%S%C%H(B

# $B86J8(B:
# The set-user-ID-on-execution and set-group-ID-on-execution bits.

man1/cp.1
> $B%3%T!<85%U%!%$%k$K(B SETUID $B%S%C%H$,N)$C$F$*$j$+$D$=$N%f!<%6(B ID $B$,J]B8$G$-$J$$(B
> $B>l9g!"(BSETUID $B%S%C%H$OJ]B8$5$l$^$;$s!#%3%T!<85%U%!%$%k$K(B SETGID $B%S%C%H$,(B
> $BN)$C$F$*$j$+$D$=$N%0%k!<%W(BID$B$,J]B8$G$-$J$$>l9g!"(BSETGID $B%S%C%H$OJ]B8$5$l$^$;$s!#(B
> $B%3%T!<85$N%U%!%$%k$K(B SETUID $B%S%C%H$H(B SETGID $B%S%C%H$,6&$K(B
> $BN)$C$F$*$j$+$D$=$N%f!<%6(B ID $B$+%0%k!<%W(B ID $B$N$$$:$l$+0lJ}$G$bJ]B8$G$-$J$$>l9g!"(B
> .Fl p
> $B%*%W%7%g%s$,;XDj$5$l$F$$$J$$8B$j!"(B
> SETUID $B%S%C%H$H(B SETGID $B%S%C%H$NN>J}$,J]B8$5$l$^$;$s!#(B

# $B86J8(B:
# If the source file has its set-user-ID bit on and the user ID cannot
# be preserved, the set-user-ID bit is not preserved
# in the copy's permissions.
# If the source file has its set-group-ID bit on and the group ID cannot
# be preserved, the set-group-ID bit is not preserved
# in the copy's permissions.
# If the source file has both its set-user-ID and set-group-ID bits on,
# and either the user ID or group ID cannot be preserved, neither
# the set-user-ID nor set-group-ID bits are preserved in the copy's
# permissions.

> $B%3%T!<85%U%!%$%k$N(B SETUID $B%S%C%H$,N)$C$F$$$F$b!"%3%T!<85%U%!%$%k$H%3%T!<@h(B
> $B%U%!%$%k$N=jM-<T$,F10l$G$J$$8B$j!"$=$l$OMn$H$5$l$^$9!#(B
> $B%3%T!<85%U%!%$%k$N(B SETGID $B%S%C%H$,N)$C$F$$$F$b!"%3%T!<85%U%!%$%k$H%3%T!<@h(B
> $B%U%!%$%k$,F10l%0%k!<%W$KB0$7$+$D%3%T!<$r9T$&%f!<%6$,$=$N%0%k!<%W(B
> $B$KF~$C$F$$$J$$8B$j$=$l$OMn$H$5$l$^$9!#(B
> SETUID $B%S%C%H$H(B SETGID $B%S%C%H$NN>J}$,N)$C$F$$$k>l9g!">e5-$N$9$Y$F$N(B
> $B>r7o$,K~$?$5$l$J$$8B$j!"N>J}$N%S%C%H$,Mn$H$5$l$^$9!#(B

# $B86J8(B:
# If the source file has its set-user-ID bit on, that bit is removed
# unless both the source file and the destination file are owned by the
# same user.
# If the source file has its set-group-ID bit on, that bit is removed
# unless both the source file and the destination file are in the same
# group and the user is a member of that group.
# If both the set-user-ID and set-group-ID bits are set, all of the above
# conditions must be fulfilled or both bits are removed.

man1/ls.1
> .It Sy S
> $B=jM-<T$KBP$9$k%"%/%;%95v2D$K$*$$$F!"%U%!%$%k$,<B9T2DG=$G$O$J$/!"$+$D!"(B
> $B<B8z%f!<%6(B ID (set-user-ID) $B%b!<%I$,%;%C%H$5$l$F$$$k>l9g!#(B
> $B=jM-%0%k!<%W$KBP$9$k%"%/%;%95v2D$K$*$$$F!"%U%!%$%k$,<B9T2DG=$G$O$J$/!"(B
> $B$+$D!"<B8z%0%k!<%W(B ID (set-group-ID) $B%b!<%I$,%;%C%H$5$l$F$$$k>l9g!#(B
> .It Sy s
> $B=jM-<T$KBP$9$k%"%/%;%95v2D$K$*$$$F!"%U%!%$%k$,<B9T2DG=$G!"$+$D!"(B
> $B<B8z%f!<%6(B ID $B%b!<%I$,%;%C%H$5$l$F$$$k>l9g!#(B
> $B=jM-%0%k!<%W$KBP$9$k%"%/%;%95v2D$NCf$G!"%U%!%$%k$,<B9T2DG=$G!"(B
> $B$+$D!"<B8z%0%k!<%W(B ID $B%b!<%I$,%;%C%H$5$l$F$$$k>l9g!#(B
> .It Sy x
> $B%U%!%$%k$,<B8z2DG=$^$?$O%G%#%l%/%H%j$,8!:w2DG=$G$"$k>l9g!#(B
> .It Sy \-
> $B%U%!%$%k$O!"FI$_=P$7!"=q$-9~$_!"<B9T$N$$$:$l$b5v2D$5$l$F$*$i$:!"(B
> $B<B8z%f!<%6(B ID $B$b<B8z%0%k!<%W(B ID $B$b%9%F%#%C%-%S%C%H$b@_Dj$5$l$F$$$J$$>l9g(B
> ($B0J2<;2>H(B)$B!#(B

# $B86J8(B:
# .It Sy S
# If in the owner permissions, the file is not executable and
# set-user-ID mode is set.
# If in the group permissions, the file is not executable
# and set-group-ID mode is set.
# .It Sy s
# If in the owner permissions, the file is executable
# and set-user-ID mode is set.
# If in the group permissions, the file is executable
# and setgroup-ID mode is set.
# .It Sy x
# The file is executable or the directory is
# searchable.
# .It Sy \-
# The file is neither readable, writable, executable,
# nor set-user-ID nor set-group-ID mode, nor sticky.
# (See below.)

man1/rtld.1
> $B$3$N4D6-JQ?t$O!"(B
> set-user-ID $B5Z$S(B set-group-ID $B$5$l$?%W%m%0%i%`$K$*$$$F$OL5;k$5$l$^$9!#(B
(2 $B2U=j(B)

# $B86J8(B:
# This is ignored for set-user-ID and set-group-ID programs.

man1/tcsh.1
> set-user ID $B%9%/%j%W%H$OK\%*%W%7%g%s$J$7$G$O<B9T$G$-$^$;$s!#(B

# $B86J8(B
# will not run a set-user ID script without this option.

> set-user-ID $B%S%C%H$,%;%C%H$5$l$F$$$k(B (+)

# $B86J8(B:
# Set-user-ID bit is set (+)

man1/test.1
> .Ar file
> $B$,B8:_$7!"$=$l$K(B setuid $B%U%i%0$,N)$C$F$$$l$P??$K$J$j$^$9!#(B

# $B86J8(B:
# True if
# .Ar file
# exists and its set user ID flag


man3/strmode.3
> .It S
> $BJ8;z$,=jM-<T%Q!<%_%C%7%g%s$N0lIt$G$"$j!"(B
> $B%U%!%$%k$,<B9T2DG=$G$O$J$$$+!"(B
> $B$^$?$O%G%#%l%/%H%j$,=jM-<T$K$h$C$F8!:w2DG=$G$O$J$/!"(B
> set-user-id $B%S%C%H$,@_Dj$5$l$F$$$k>l9g!#(B
> .It S
> $BJ8;z$,%0%k!<%W%Q!<%_%C%7%g%s$N0lIt$G$"$j!"(B
> $B%U%!%$%k$,<B9T2DG=$G$O$J$$$+!"(B
> $B$^$?$O%G%#%l%/%H%j$,%0%k!<%W$K$h$C$F8!:w2DG=$G$O$J$/!"(B
> set-group-id $B%S%C%H$,@_Dj$5$l$F$$$k>l9g!#(B

# $B86J8(B:
# .It S
# If the character is part of the owner permissions and the file is not
# executable or the directory is not searchable by the owner, and the
# set-user-id bit is set.
# .It S
# If the character is part of the group permissions and the file is not
# executable or the directory is not searchable by the group, and the
# set-group-id bit is set.

> .It s
> $BJ8;z$,=jM-<T%Q!<%_%C%7%g%s$N0lIt$G$"$j!"(B
> $B%U%!%$%k$,<B9T2DG=$G$"$k$+!"(B
> $B$^$?$O%G%#%l%/%H%j$,=jM-<T$K$h$C$F8!:w2DG=$G$"$j!"(B
> set-user-id $B%S%C%H$,@_Dj$5$l$F$$$k>l9g!#(B
> .It s
> $BJ8;z$,%0%k!<%W%Q!<%_%C%7%g%s$N0lIt$G$"$j!"(B
> $B%U%!%$%k$,<B9T2DG=$G$"$k$+!"(B
> $B$^$?$O%G%#%l%/%H%j$,%0%k!<%W$K$h$C$F8!:w2DG=$G$"$j!"(B
> set-group-id $B%S%C%H$,@_Dj$5$l$F$$$k>l9g!#(B

# .It s
# If the character is part of the owner permissions and the file is
# executable or the directory searchable by the owner, and the set-user-id
# bit is set.
# .It s
# If the character is part of the group permissions and the file is
# executable or the directory searchable by the group, and the set-group-id
# bit is set.

man8/ldconfig.8
> .Sh $B%;%-%e%j%F%#(B
> .Ev $B%;%C%H(B uid (set-user-Id)
> $B%W%m%0%i%`$N%"%I%l%96u4V$K6&M-%i%$%V%i%j$rFI$_9~$`;~$K$O!"(B
> $BFCJL$NCm0U$r$7$J$1$l$P$J$j$^$;$s!#(B

# $B86J8(B:
# .Sh SECURITY
# Special care must be taken when loading shared libraries into the address
# space of
# .Ev set-user-Id
# programs.

man8/mount.8
> .It Cm nosuid
> $B<B8z%f!<%6(B ID (set-user-ID) $B%;%C%H!"(B
> $B<B8z%0%k!<%W(B ID (set-group-ID) $B%;%C%H%S%C%H$N(B
> $B8z2L$r$J$/$7$^$9!#(B

# $B86J8(B:
# .It Cm nosuid
# Do not allow set-user-identifier or set-group-identifier bits to take effect.

man8/rc.sendmail.8
> $B$3$l$O!"(B
> .Xr sendmail 8
> $B$r%;%C%H%f!<%6(B ID $B%P%$%J%j$H$7$J$$$?$a$KI,MW$G$9!#(B

# $B86J8(B:
# a localhost-only listening SMTP service required for running
# .Xr sendmail 8
# as a non-set-user-ID binary.

