aboutsummaryrefslogtreecommitdiffstats
path: root/g10/g10.c
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2004-09-30 15:00:58 +0000
committerDavid Shaw <[email protected]>2004-09-30 15:00:58 +0000
commit85f975596887930f8488f9008367d052b9aa660d (patch)
tree4be8d9c27425689a9f43eee28ae06e5ff45fe94f /g10/g10.c
parent* util.h: Prototype destroy_dotlock(). From Werner on stable branch. (diff)
downloadgnupg-85f975596887930f8488f9008367d052b9aa660d.tar.gz
gnupg-85f975596887930f8488f9008367d052b9aa660d.zip
* gpgv.c, keydb.c (keydb_add_resource): Factored keyring creation out to
.. (maybe_create_keyring): .. new. Make sure that we do the checks in a locked state. Problem reported by Stefan Haller. Try to create the home directory before acquiring a lock for the keyring. From Werner on stable branch. * g10.c (main): Blow up if we didn't lose setuid. From Werner on stable branch.
Diffstat (limited to 'g10/g10.c')
-rw-r--r--g10/g10.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/g10/g10.c b/g10/g10.c
index 66a106526..85c27d424 100644
--- a/g10/g10.c
+++ b/g10/g10.c
@@ -1685,6 +1685,13 @@ main( int argc, char **argv )
maybe_setuid = 0;
/* Okay, we are now working under our real uid */
+#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. */
+ if(getuid()!=geteuid())
+ BUG();
+#endif
+
set_native_charset (NULL); /* Try to auto set the character set */
/* Try for a version specific config file first */