From a7c9e79190759d76a5396441fe6ac502d7b38835 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 17 Jul 2008 19:49:51 +0000 Subject: [PATCH] Revert that last stupid setuid detection fix. --- common/ChangeLog | 5 ----- common/exechelp.c | 2 +- g10/ChangeLog | 5 ----- g10/exec.c | 4 ++-- g10/gpg.c | 4 ++-- 5 files changed, 5 insertions(+), 15 deletions(-) diff --git a/common/ChangeLog b/common/ChangeLog index 6fdf436f5..dcee95bbf 100644 --- a/common/ChangeLog +++ b/common/ChangeLog @@ -1,8 +1,3 @@ -2008-07-17 Werner Koch - - * exechelp.c (gnupg_spawn_process_detached): Do not run the setuid - test for root. - 2008-06-26 Werner Koch * estream.c (es_write_sanitized): Loose check for control diff --git a/common/exechelp.c b/common/exechelp.c index 90071e775..dcbbe90b0 100644 --- a/common/exechelp.c +++ b/common/exechelp.c @@ -826,7 +826,7 @@ gnupg_spawn_process_detached (const char *pgmname, const char *argv[], pid_t pid; int i; - if (getuid() && getuid() != geteuid()) + if (getuid() != geteuid()) return gpg_error (GPG_ERR_BUG); if (access (pgmname, X_OK)) diff --git a/g10/ChangeLog b/g10/ChangeLog index 342c012ee..4aa1ed114 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,8 +1,3 @@ -2008-07-17 Werner Koch - - * gpg.c (main): Do not run the setuid test for root. - * exec.c (exec_write): Ditto. - 2008-06-25 Marcus Brinkmann * gpg.c (enum cmd_and_opt_values): Remove option diff --git a/g10/exec.c b/g10/exec.c index 40561e871..9ecd2ab64 100644 --- a/g10/exec.c +++ b/g10/exec.c @@ -318,8 +318,8 @@ int exec_write(struct exec_info **info,const char *program, #if defined(HAVE_GETUID) && defined(HAVE_GETEUID) /* There should be no way to get to this spot while still carrying - setuid privs. Just in case, bomb out if we are (and are not root). */ - if (getuid () && getuid () != geteuid ()) + setuid privs. Just in case, bomb out if we are. */ + if ( getuid () != geteuid ()) BUG (); #endif diff --git a/g10/gpg.c b/g10/gpg.c index c226b1e35..0601f50f0 100644 --- a/g10/gpg.c +++ b/g10/gpg.c @@ -2015,8 +2015,8 @@ main (int argc, char **argv) got_secmem = 1; #if defined(HAVE_GETUID) && defined(HAVE_GETEUID) /* There should be no way to get to this spot while still carrying - setuid privs. Just in case, bomb out if we are (and are not root). */ - if (getuid () && getuid () != geteuid ()) + setuid privs. Just in case, bomb out if we are. */ + if ( getuid () != geteuid () ) BUG (); #endif maybe_setuid = 0;