mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
* 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.
This commit is contained in:
parent
c6feade425
commit
bccb780228
4 changed files with 30 additions and 9 deletions
14
g10/g10.c
14
g10/g10.c
|
@ -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 );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue