Re: discarding root privileges in suid perl
>>>>> "Ben" == Ben Gertzfield <che@debian.org> writes:
>>>>> "Brian" == Brian May <bam@debian.org> writes:
Brian> die "Can't drop privileges" unless $UID == $EUID && $GID eq
Brian> $EGID;
Ben> This looks suspicious. Try ($UID == $EUID) && ($GID ==
Ben> $EGID). Both the parens are needed, and your 'eq' there
Ben> should be ==.
Not sure about the ==, according to man perlvar:
If you are on a machine that supports membership in multiple groups
simultaneously, [$GID] gives a space separated list of groups you are
in.
which would imply that it is a string, and eq should be used.
I have tried parens, however, the same problem occurs, as EUID = 0, as
per my debug statement.
--
Brian May <bam@debian.org>
Reply to: