diff options
author | des <des@FreeBSD.org> | 2005-06-20 06:52:08 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2005-06-20 06:52:08 +0000 |
commit | c916de4c26582680c1851b471bd282428e81c8ac (patch) | |
tree | afde37dad7354b07f3d4f6a88303f7b0bd535896 /net | |
parent | ee37ef034d14e2d61f46052fcc98775b373b58aa (diff) | |
download | FreeBSD-ports-c916de4c26582680c1851b471bd282428e81c8ac.zip FreeBSD-ports-c916de4c26582680c1851b471bd282428e81c8ac.tar.gz |
In Net::Server::Daemonize::set_uid(), call POSIX::setuid() when
"$< = $> = $uid" fails, not when it succeeds (it's a fallback in the
former case, a no-op in the latter)
Similar fix for Net::Server::Daemonize::set_gid().
Diffstat (limited to 'net')
-rw-r--r-- | net/p5-Net-Server/files/patch-set_ugid | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/net/p5-Net-Server/files/patch-set_ugid b/net/p5-Net-Server/files/patch-set_ugid new file mode 100644 index 0000000..0fa1327 --- /dev/null +++ b/net/p5-Net-Server/files/patch-set_ugid @@ -0,0 +1,24 @@ +--- lib/Net/Server/Daemonize.pm.orig Mon Jun 20 08:33:05 2005 ++++ lib/Net/Server/Daemonize.pm Mon Jun 20 08:34:31 2005 +@@ -200,8 +200,8 @@ + sub set_uid { + my $uid = get_uid( shift() ); + $< = $> = $uid; +- if( $< != $uid ){ +- die "Couldn't become uid \"$uid\"\n"; ++ if( $< == $uid ){ ++ return 1; + } + my $result = POSIX::setuid( $uid ); + if( ! defined($result) ){ +@@ -218,8 +218,8 @@ + $) = $gids; + $( = $gid; + my $result = (split(/\s+/,$())[0]; +- if( $result != $gid ){ +- die "Couldn't become gid \"$gid\" ($result)\n"; ++ if( $result == $gid ){ ++ return 1; + } + POSIX::setgid( $gid ) || die "Couldn't POSIX::setgid to \"$gid\" [$!]\n"; + return 1; |