diff options
author | David Shaw <[email protected]> | 2002-07-03 04:01:21 +0000 |
---|---|---|
committer | David Shaw <[email protected]> | 2002-07-03 04:01:21 +0000 |
commit | bccb780228121a6ade6b08aecc50449455d9d1aa (patch) | |
tree | 8ebce5ee3f47f9a7fc1948e0622c7caf6111f4bc /g10/g10.c | |
parent | * options.h, g10.c (main), keyserver.c (keyserver_refresh): Maintain and (diff) | |
download | gnupg-bccb780228121a6ade6b08aecc50449455d9d1aa.tar.gz gnupg-bccb780228121a6ade6b08aecc50449455d9d1aa.zip |
* exec.h, exec.c (set_exec_path, exec_write), g10.c (main): If
USE_EXEC_PATH is defined at compile time, use it to lock the exec-path and
not allow the user to change it.
Diffstat (limited to 'g10/g10.c')
-rw-r--r-- | g10/g10.c | 14 |
1 files changed, 5 insertions, 9 deletions
@@ -46,6 +46,7 @@ #include "status.h" #include "g10defs.h" #include "keyserver-internal.h" +#include "exec.h" enum cmd_and_opt_values { aNull = 0, oArmor = 'a', @@ -1331,15 +1332,10 @@ main( int argc, char **argv ) break; case oTempDir: opt.temp_dir=pargs.r.ret_str; break; case oExecPath: - { - /* Notice that path is never freed. That is - intentional due to the way putenv() works. */ - char *path=m_alloc(5+strlen(pargs.r.ret_str)+1); - strcpy(path,"PATH="); - strcat(path,pargs.r.ret_str); - if(putenv(path)!=0) - log_error(_("unable to set exec-path to %s\n"),path); - } +#ifndef USE_EXEC_PATH + if(set_exec_path(pargs.r.ret_str)) + log_error(_("unable to set exec-path to %s\n"),pargs.r.ret_str); +#endif break; case oNotation: add_notation_data( pargs.r.ret_str, 0 ); |