aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/ChangeLog7
-rw-r--r--common/sysutils.c25
-rw-r--r--g10/ChangeLog4
-rw-r--r--g10/gpg.c2
4 files changed, 28 insertions, 10 deletions
diff --git a/common/ChangeLog b/common/ChangeLog
index 65126200c..3d545866c 100644
--- a/common/ChangeLog
+++ b/common/ChangeLog
@@ -1,3 +1,10 @@
+2008-06-19 Werner Koch <[email protected]>
+
+ * sysutils.c: Remove <ctype.h>.
+ (fd_translate_max): Use macro for the size.
+ (translate_table_init): Protect read against EINTR and replace
+ isspace by spacep.
+
2008-06-18 Marcus Brinkmann <[email protected]>
* sysutils.c (TRANS_MAX): Bump up to 350 to be on the safe side.
diff --git a/common/sysutils.c b/common/sysutils.c
index b76c83990..564b075e1 100644
--- a/common/sysutils.c
+++ b/common/sysutils.c
@@ -50,7 +50,6 @@
# include <pth.h>
#endif
#include <fcntl.h>
-#include <ctype.h>
#include "util.h"
#include "i18n.h"
@@ -301,7 +300,7 @@ static struct
{
int from;
int to;
-} fd_translate[8];
+} fd_translate[FD_TRANSLATE_MAX];
/* Number of entries used in fd_translate. */
static int fd_translate_len;
@@ -310,7 +309,9 @@ static int fd_translate_len;
/* Initialize the fd translation table. This reads one line from
stdin which is expected to be in the format "FROM TO [...]" where
each "FROM TO" pair are two handle numbers. Handle number FROM on
- the command line is translated to handle number TO. */
+ the command line is translated to handle number TO.
+
+ Note that this function may be called while still being setuid. */
void
translate_table_init (void)
{
@@ -327,7 +328,9 @@ translate_table_init (void)
/* We always read one line from stdin. */
for (idx = 0; idx < TRANS_MAX; idx++)
{
- res = read (0, &line[idx], 1);
+ do
+ res = read (0, &line[idx], 1);
+ while (res == -1 && errno == EINTR);
if (res != 1)
break;
if (line[idx] == '\n')
@@ -340,7 +343,11 @@ translate_table_init (void)
{
char buf[1];
do
- res = read (0, buf, 1);
+ {
+ do
+ res = read (0, buf, 1);
+ while (res == -1 && errno == EINTR);
+ }
while (res == 1 && *buf != '\n');
}
@@ -354,21 +361,21 @@ translate_table_init (void)
unsigned long to;
char *tail;
- while (isspace (*linep))
+ while (spacep (linep))
linep++;
if (*linep == '\0')
break;
from = strtoul (linep, &tail, 0);
- if (tail == NULL || ! (*tail == '\0' || isspace (*tail)))
+ if (tail == NULL || ! (*tail == '\0' || spacep (tail)))
break;
linep = tail;
- while (isspace (*linep))
+ while (spacep (linep))
linep++;
if (*linep == '\0')
break;
to = strtoul (linep, &tail, 0);
- if (tail == NULL || ! (*tail == '\0' || isspace (*tail)))
+ if (tail == NULL || ! (*tail == '\0' || spacep (tail)))
break;
linep = tail;
diff --git a/g10/ChangeLog b/g10/ChangeLog
index bc2475feb..c4e6b38d9 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,7 @@
+2008-06-19 Werner Koch <[email protected]>
+
+ * gpg.c (gpgconf_list): Add "group".
+
2008-06-18 Marcus Brinkmann <[email protected]>
* gpg.c (enum cmd_and_opt_values): New option
diff --git a/g10/gpg.c b/g10/gpg.c
index a568bb97e..9019cf22d 100644
--- a/g10/gpg.c
+++ b/g10/gpg.c
@@ -1562,7 +1562,7 @@ gpgconf_list (const char *configfile)
printf ("allow-pka-lookup:%lu:\n", GC_OPT_FLAG_NONE);
printf ("log-file:%lu:\n", GC_OPT_FLAG_NONE);
printf ("debug-level:%lu:\"none:\n", GC_OPT_FLAG_DEFAULT);
-
+ printf ("group:%lu:\n", GC_OPT_FLAG_NONE);
xfree (configfile_esc);
}