fix euid/uid/suid-problem with gnupg
This commit is contained in:
parent
1dec5cdee2
commit
b7b33984fc
8
index.c
8
index.c
|
@ -5,9 +5,17 @@
|
|||
|
||||
/* C wrapper to allow ezmlm-web.cgi to run suid */
|
||||
/* Copyright (C) 1999/2000, Guy Antony Halse, All Rights Reserved */
|
||||
/* Copyright (C) 02005/02006, Lars Kruse, All Rights Reserved */
|
||||
/* See the README file in this distribution for copyright information */
|
||||
|
||||
int main(void) {
|
||||
|
||||
/* Set the (real) uid to the same value, as the effective uid.
|
||||
This is necesary, as (the suid) gpg tries to run on behalf of www-data
|
||||
instead of the presumed user.
|
||||
I hope, that this will not break on non-linux systems ... */
|
||||
setreuid(getuid(), -1);
|
||||
|
||||
/* Change this path to wherever you decided to put ezmlm-web.cgi */
|
||||
execv("/usr/local/bin/ezmlm-web.cgi", NULL);
|
||||
|
||||
|
|
Loading…
Reference in a new issue