[distcc] distcc 0.14 patch for setting uid/gid

Dwayne Rightler drightler at technicalogic.com
Wed Nov 20 19:11:01 GMT 2002


At least on linux it seems to be ok:

#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>

int main()
{
        uid_t uid;
        uid_t euid;
        uid_t suid;

        setuid(99);
        seteuid(99);

        getresuid(&uid,&euid,&suid);
        printf("Real: %d\nEffective: %d\nSaved: %d\n",uid,euid,suid);
        return(0);
}

outputs:

Real: 99
Effective: 99
Saved: 99

Martin Pool said:
> Onlooker 20 Nov 2002, Dwayne Rightler <drightler at technicalogic.com>
> wrote:
>> Here is a small patch I wrote so you can start distccd with
>> user/group.
>
> Thankyou for the patch.
>
> I think as written this is not secure, because on some platforms it will
> leave the process with some root privileges.  I might be wrong, but it
> needs to be checked again the "Setuid Demystified" whitepaper.
>
> Once somebody (you/me/somebody else) checks that and writes a test case
> I am happy to merge it.
>
> --
> Martin






More information about the distcc mailing list