[RP-PPPoE] 3.11 bug report
David Binderman
dcb314 at hotmail.com
Fri Jul 18 10:05:58 EDT 2014
Hello there,
----------------------------------------
> D'oh. Please try this patch.
Looks good to me.
Regards
David Binderman
>
> Regards,
>
> David.
>
> diff --git a/src/common.c b/src/common.c
> index f115f4f..6a2988e 100644
> --- a/src/common.c
> +++ b/src/common.c
> @@ -45,8 +45,8 @@ static char const RCSID[] =
> /* Are we running SUID or SGID? */
> int IsSetID = 0;
>
> -static uid_t saved_uid = -2;
> -static uid_t saved_gid = -2;
> +static uid_t saved_uid = (uid_t) -2;
> +static uid_t saved_gid = (uid_t) -2;
>
> /**********************************************************************
> *%FUNCTION: parsePacket
> @@ -173,8 +173,8 @@ findTag(PPPoEPacket *packet, UINT16_t type, PPPoETag *tag)
> void
> switchToRealID (void) {
> if (IsSetID) {
> - if (saved_uid < 0) saved_uid = geteuid();
> - if (saved_gid < 0) saved_gid = getegid();
> + if (saved_uid == (uid_t) -2) saved_uid = geteuid();
> + if (saved_gid == (uid_t) -2) saved_gid = getegid();
> if (setegid(getgid()) < 0) {
> printErr("setgid failed");
> exit(EXIT_FAILURE);
> _______________________________________________
> RP-PPPoE mailing list
> RP-PPPoE at lists.roaringpenguin.com
> http://lists.roaringpenguin.com/cgi-bin/mailman/listinfo/rp-pppoe
More information about the RP-PPPoE
mailing list