diff options
author | Werner Koch <wk@gnupg.org> | 2009-03-03 10:02:58 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2009-03-03 10:02:58 +0100 |
commit | c20b3db108b090b7b34f48a6085a6824fc4db715 (patch) | |
tree | cbedc554619505de2750785252791c51a563bce2 /common | |
parent | Add missing option strings. (diff) | |
download | gnupg2-c20b3db108b090b7b34f48a6085a6824fc4db715.tar.xz gnupg2-c20b3db108b090b7b34f48a6085a6824fc4db715.zip |
Add --reload command to gpgconf.
Fix a problem in exechelp.c
Get ready for a release.
Diffstat (limited to 'common')
-rw-r--r-- | common/ChangeLog | 5 | ||||
-rw-r--r-- | common/exechelp.c | 9 |
2 files changed, 12 insertions, 2 deletions
diff --git a/common/ChangeLog b/common/ChangeLog index f9e0fa4b0..61ae679b4 100644 --- a/common/ChangeLog +++ b/common/ChangeLog @@ -1,3 +1,8 @@ +2009-03-03 Werner Koch <wk@g10code.com> + + * exechelp.c (do_exec): Make sure that /dev/null connected FDs are + not closed. + 2009-01-19 Werner Koch <wk@g10code.com> * audit.c (writeout_li): Translate a few more result strings. diff --git a/common/exechelp.c b/common/exechelp.c index bb9ddd557..4da3c9787 100644 --- a/common/exechelp.c +++ b/common/exechelp.c @@ -238,7 +238,7 @@ do_exec (const char *pgmname, const char *argv[], for (i=0,j=1; argv[i]; i++, j++) arg_list[j] = (char*)argv[i]; - /* Connect the standard files. */ + /* Assign /dev/null to unused FDs. */ for (i=0; i <= 2; i++) { if (fds[i] == -1 ) @@ -248,7 +248,12 @@ do_exec (const char *pgmname, const char *argv[], log_fatal ("failed to open `%s': %s\n", "/dev/null", strerror (errno)); } - else if (fds[i] != i && dup2 (fds[i], i) == -1) + } + + /* Connect the standard files. */ + for (i=0; i <= 2; i++) + { + if (fds[i] != i && dup2 (fds[i], i) == -1) log_fatal ("dup2 std%s failed: %s\n", i==0?"in":i==1?"out":"err", strerror (errno)); } |