aboutsummaryrefslogtreecommitdiffstats
path: root/util/secmem.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>1999-01-09 15:06:59 +0000
committerWerner Koch <[email protected]>1999-01-09 15:06:59 +0000
commit002b1a8632d2c2795deb4682ba6db8be120db9b4 (patch)
tree33a0e8c96550f24d9aa1747b05a9f471f975e7a7 /util/secmem.c
parentSee ChangeLog: Thu Jan 7 18:00:58 CET 1999 Werner Koch (diff)
downloadgnupg-002b1a8632d2c2795deb4682ba6db8be120db9b4.tar.gz
gnupg-002b1a8632d2c2795deb4682ba6db8be120db9b4.zip
See ChangeLog: Sat Jan 9 16:02:23 CET 1999 Werner Koch
Diffstat (limited to '')
-rw-r--r--util/secmem.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/util/secmem.c b/util/secmem.c
index 30396f3c3..e9bc05abd 100644
--- a/util/secmem.c
+++ b/util/secmem.c
@@ -1,5 +1,5 @@
/* secmem.c - memory allocation from a secure heap
- * Copyright (C) 1998 Free Software Foundation, Inc.
+ * Copyright (C) 1998,1999 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@@ -104,7 +104,7 @@ lock_pool( void *p, size_t n )
#endif
if( uid && !geteuid() ) {
- if( setuid( uid ) )
+ if( setuid( uid ) || getuid() != geteuid() )
log_fatal("failed to reset uid: %s\n", strerror(errno));
}
@@ -223,7 +223,7 @@ secmem_init( size_t n )
disable_secmem=1;
uid = getuid();
if( uid != geteuid() ) {
- if( setuid( uid ) )
+ if( setuid( uid ) || getuid() != geteuid() )
log_fatal("failed to drop setuid\n" );
}
#endif