aboutsummaryrefslogtreecommitdiffstats
path: root/cipher/dynload.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>1998-07-09 13:37:17 +0000
committerWerner Koch <[email protected]>1998-07-09 13:37:17 +0000
commite143f23c237e523758173e65ff8fdd2966ed938b (patch)
treeb17a57e05ddb9680922b00a42bb5ebefe62d71cd /cipher/dynload.c
parentfixed clearsig stuff (diff)
downloadgnupg-e143f23c237e523758173e65ff8fdd2966ed938b.tar.gz
gnupg-e143f23c237e523758173e65ff8fdd2966ed938b.zip
fixed severe exploitV0-3-2
Diffstat (limited to 'cipher/dynload.c')
-rw-r--r--cipher/dynload.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/cipher/dynload.c b/cipher/dynload.c
index e22731702..a8c01f259 100644
--- a/cipher/dynload.c
+++ b/cipher/dynload.c
@@ -22,6 +22,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#ifdef HAVE_DL_DLOPEN
#include <dlfcn.h>
#endif
@@ -109,7 +110,11 @@ load_extension( EXTLIST el )
int seq = 0;
int class, vers;
+ /* make sure we are not setuid */
+ if( getuid() != geteuid() )
+ log_bug("trying to load an extension while still setuid\n");
+ /* now that we are not setuid anymore, we can safely load modules */
el->handle = dlopen(el->name, RTLD_NOW);
if( !el->handle ) {
log_error("%s: error loading extension: %s\n", el->name, dlerror() );