1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-11-04 20:38:50 +01:00

See ChangeLog: Thu Jun 8 20:22:00 CEST 2000 Werner Koch

This commit is contained in:
Werner Koch 2000-06-08 18:08:06 +00:00
parent 662f328608
commit bf2ace8a83
2 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,7 @@
Thu Jun 8 20:22:00 CEST 2000 Werner Koch <wk@openit.de>
* secmem.c (lock_pool,secmem_init): Additional check for dropped privs.
Tue May 30 16:37:55 CEST 2000 Werner Koch <wk@openit.de>
* iobuf.c (iobuf_cancel): Fix for MSDOS.

View File

@ -128,7 +128,9 @@ lock_pool( void *p, size_t n )
#endif
if( uid && !geteuid() ) {
if( setuid( uid ) || getuid() != geteuid() )
/* check that we really dropped the privs.
* Note: setuid(0) should always fail */
if( setuid( uid ) || getuid() != geteuid() || !setuid(0) )
log_fatal("failed to reset uid: %s\n", strerror(errno));
}
@ -260,7 +262,7 @@ secmem_init( size_t n )
disable_secmem=1;
uid = getuid();
if( uid != geteuid() ) {
if( setuid( uid ) || getuid() != geteuid() )
if( setuid( uid ) || getuid() != geteuid() || !setuid(0) )
log_fatal("failed to drop setuid\n" );
}
#endif