From e3d70efb65e00b292e73210d6fe6f2cb81632746 Mon Sep 17 00:00:00 2001 From: ian Date: Sat, 30 Jan 1999 19:38:04 +0000 Subject: [PATCH] String-termination bugfix. Compilation fixes (-D_GNU_SOURCE, etc.), and some config file improvements. --- Changelog | 16 ++++++++++++++++ Makefile.in | 3 ++- client.c | 3 ++- configure.in | 2 ++ parser.c | 1 + servexec.c | 1 + system.default | 5 ++++- system.override | 12 +++++++----- 8 files changed, 35 insertions(+), 8 deletions(-) diff --git a/Changelog b/Changelog index b46bde3..7d105a9 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,19 @@ +userv (0.59); urgency=high + + * Fix failure to terminate string properly in parser.c, which could + cause some problems with "-quoted strings. (This is not thought to be + security-critical, and the bug can be avoided by not using "-quoted + strings in configuration files.) + + * Provided `system.default' file checks /etc/userv/services.d and + /etc/userv/default.d; system.override runs /etc/userv/override.d. + + * Add to servexec.c. + * Add -D_GNU_SOURCE to CFLAGS in configure.in. + * Braces added in client.c to prevent GCC `ambiguous else' warning. + + -- Ian Jackson Sat, 30 Jan 1999 19:37:17 +0000 + userv (0.58); urgency=high * Fixed failure to set gid when invoking service !! diff --git a/Makefile.in b/Makefile.in index 4339481..bfa02cd 100644 --- a/Makefile.in +++ b/Makefile.in @@ -59,7 +59,8 @@ all: daemon client install: all $(INSTALL_PROGRAM) -s -o root -g root -m 755 daemon $(sbindir)/uservd $(INSTALL_PROGRAM) -s -o root -g root -m 4755 client $(bindir)/userv - $(INSTALL) -d -o root -g root -m 2755 $(etcsubdir) + $(INSTALL) -d -o root -g root -m 2755 $(etcsubdir) \ + $(etcsubdir)/default.d $(etcsubdir)/services.d $(etcsubdir)/override.d if ! test -f $(etcsubdir)/system.default; then \ $(INSTALL_DATA) -o root -g root system.default $(etcsubdir); fi if ! test -f $(etcsubdir)/system.override; then \ diff --git a/client.c b/client.c index f53211f..d201bef 100644 --- a/client.c +++ b/client.c @@ -738,13 +738,14 @@ static void callvalueoption(const struct optioninfo *oip, char *arg) { char *equals; if (oip->values == 2) { equals= strchr(arg,'='); - if (!equals) + if (!equals) { if (oip->abbrev) usageerror("option --%s (-%c) passed argument `%s' with no `='", oip->full,oip->abbrev,arg); else usageerror("option --%s passed argument `%s' with no `='", oip->full,arg); + } *equals++= 0; (oip->fn)(oip,equals,arg); } else { diff --git a/configure.in b/configure.in index 7b842ce..4eb36c0 100644 --- a/configure.in +++ b/configure.in @@ -42,6 +42,8 @@ AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL +CFLAGS="$CFLAGS -D_GNU_SOURCE" + AC_CACHE_CHECK(for EPROTO,userv_cv_hdr_eproto, AC_EGREP_CPP(yes, [ diff --git a/parser.c b/parser.c index fbf0872..0965f41 100644 --- a/parser.c +++ b/parser.c @@ -173,6 +173,7 @@ static int dequote(char *inplace) { } } assert(*p); assert(!*++p); + *q++= 0; return tokv_quotedstring; } diff --git a/servexec.c b/servexec.c index a924e05..778cd8b 100644 --- a/servexec.c +++ b/servexec.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include diff --git a/system.default b/system.default index 5c8e8c7..3774f0e 100644 --- a/system.default +++ b/system.default @@ -11,7 +11,10 @@ # fi # (procmail-wrapper could extract envelope information from the # arguments and/or -D options and pass them to procmail.) -# + +include-directory /etc/userv/default.d +include-lookup service /etc/userv/services.d + # If you want to force users to provide a particular service, # then you can put it here and use `quit'. Eg: # if ( grep service-user-shell /etc/shells diff --git a/system.override b/system.override index db44664..4c7e2e0 100644 --- a/system.override +++ b/system.override @@ -1,5 +1,7 @@ -# This is for subtle overriding things. Most things should go -# in system.default, so that the user can override them if they -# want and so that if you want to force the user to provide a -# service you don't needlessly parse their configuration file -# and get the error messages from it. +# This is for subtle overriding things. Most things should go in +# system.default (or default.d or services.d), so that the user can +# override them if they want and so that if you want to force the user +# to provide a service you don't needlessly parse their configuration +# file and get the error messages from it. + +include-directory /etc/userv/override.d -- 2.30.2