On Mon, Jan 27, 2003, Michael van Elst wrote:

>     added suid-wrapper for mailgate
> [...]
>   @@ -0,0 +1,21 @@
>   +#include <sys/types.h>
>   +#include <unistd.h>
>   +
>   +#define DIR  "@l_prefix@/libexec/rt"
>   +#define PROG "@l_prefix@/libexec/rt/tools/rt-mailgate"
>   +
>   +int main(int argc, char *argv[])
>   +{
>   +    static char *const myenv[] = {
>   +        "PATH=/bin:/usr/bin",
>   +        NULL
>   +    };
>   +
>   +    if (chdir(DIR) == -1) {
>   +        perror("chdir");
>   +        exit(1);
>   +    }
>   +
>   +    execve(PROG, argv, myenv);
>   +}
> [...]

Ops, why no setuid(geteuid()) and setgid(getegid()) at all?

                                       Ralf S. Engelschall
                                       [EMAIL PROTECTED]
                                       www.engelschall.com

______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
Developer Communication List                   [EMAIL PROTECTED]

Reply via email to