chiark / gitweb /
String-termination bugfix. Compilation fixes (-D_GNU_SOURCE, etc.), and some config...
authorian <ian>
Sat, 30 Jan 1999 19:38:04 +0000 (19:38 +0000)
committerian <ian>
Sat, 30 Jan 1999 19:38:04 +0000 (19:38 +0000)
Changelog
Makefile.in
client.c
configure.in
parser.c
servexec.c
system.default
system.override

index b46bde3cf4cc36df97b908fc562e218d75355c0c..7d105a934aaf068691405a53fc1dd33ed4137b5e 100644 (file)
--- 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 <string.h> 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 <ian@davenant.greenend.org.uk>  Sat, 30 Jan 1999 19:37:17 +0000
+
 userv (0.58); urgency=high
 
   * Fixed failure to set gid when invoking service !!
 userv (0.58); urgency=high
 
   * Fixed failure to set gid when invoking service !!
index 4339481598e147c2c9f2962955d24664bb3aac90..bfa02cd7a772f40a9a41e59a0e7011bd0bf320fd 100644 (file)
@@ -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:       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 \
                if ! test -f $(etcsubdir)/system.default; then \
                        $(INSTALL_DATA) -o root -g root system.default $(etcsubdir); fi
                if ! test -f $(etcsubdir)/system.override; then \
index f53211fd310a0295135bd5b1288f2cc59cf14f40..d201bef428672b9b84683082b990b886f514700e 100644 (file)
--- 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,'=');
   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);
       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 {
     *equals++= 0;
     (oip->fn)(oip,equals,arg);
   } else {
index 7b842ce1a93b1e9400f557e9a35c8f2b11709dad..4eb36c08855ec9ded3ae6b8f6c5d6f13c58a9189 100644 (file)
@@ -42,6 +42,8 @@ AC_PROG_CC
 AC_PROG_CPP
 AC_PROG_INSTALL
 
 AC_PROG_CPP
 AC_PROG_INSTALL
 
+CFLAGS="$CFLAGS -D_GNU_SOURCE"
+
 AC_CACHE_CHECK(for EPROTO,userv_cv_hdr_eproto,
  AC_EGREP_CPP(yes,
 [
 AC_CACHE_CHECK(for EPROTO,userv_cv_hdr_eproto,
  AC_EGREP_CPP(yes,
 [
index fbf0872a1ec2db564178d2905dc1fb73675b5e4d..0965f41868ff0252a56e1071cd5fd45ed509e808 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -173,6 +173,7 @@ static int dequote(char *inplace) {
     }
   }
   assert(*p); assert(!*++p);
     }
   }
   assert(*p); assert(!*++p);
+  *q++= 0;
   return tokv_quotedstring;
 }
 
   return tokv_quotedstring;
 }
 
index a924e054a3d185a2977c1dcbd960137fa33c5587..778cd8b415b50c60fed57e1dbe63b526a77981d5 100644 (file)
@@ -23,6 +23,7 @@
 #include <limits.h>
 #include <errno.h>
 #include <assert.h>
 #include <limits.h>
 #include <errno.h>
 #include <assert.h>
+#include <string.h>
 #include <unistd.h>
 #include <stdarg.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <stdarg.h>
 #include <stdlib.h>
index 5c8e8c73f698e8f595ba6eca81843d4eddf2ad53..3774f0ec5bc28cd468426f77f2f4a22a57873d77 100644 (file)
 #      fi
 # (procmail-wrapper could extract envelope information from the
 # arguments and/or -D options and pass them to procmail.)
 #      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
 # 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
index db4466489182b68170da7a0b27243301cfdd3428..4c7e2e0bea2a016aab40bfa27195c0a5fd5126f8 100644 (file)
@@ -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