]> andersk Git - moira.git/commitdiff
disallow newlines in list descriptions.
authorzacheiss <zacheiss>
Thu, 6 Jul 2000 20:29:42 +0000 (20:29 +0000)
committerzacheiss <zacheiss>
Thu, 6 Jul 2000 20:29:42 +0000 (20:29 +0000)
server/qsetup.pc

index a2b2b89fb7282b3e5d8edebb692724e08cd724b1..fc1c8cd933401bc8fa7e8816139d04d4248b0561 100644 (file)
@@ -276,6 +276,9 @@ int setup_dclu(struct query *q, char *argv[], client *cl)
  * a -1 there.  Remember that this is also used for ulis, with the indexes
  * at 6 & 7.  Also check that the list name does not contain uppercase
  * characters, control characters, @, or :.
+ *
+ *  Newlines in list descriptions do bad things to the aliases file
+ *  moira generates, so make sure the description doesn't contain any, too.
  */
 
 static int badlistchars[] = {
@@ -301,7 +304,7 @@ int setup_alis(struct query *q, char *argv[], client *cl)
 {
   EXEC SQL BEGIN DECLARE SECTION;
   int ngid, cnt;
-  char *name;
+  char *name, *desc;
   EXEC SQL END DECLARE SECTION;
   unsigned char *p;
   int idx, err;
@@ -311,6 +314,7 @@ int setup_alis(struct query *q, char *argv[], client *cl)
   else if (!strcmp(q->shortname, "ulis"))
     idx = 1;
   name = argv[idx];
+  desc = argv[10 + idx];
 
   if (idx == 1)
     {
@@ -328,6 +332,12 @@ int setup_alis(struct query *q, char *argv[], client *cl)
        return MR_BAD_CHAR;
     }
 
+  for (p = (unsigned char *) desc; *p; p++)
+    {
+      if (*p == '\n')
+       return MR_BAD_CHAR;
+    }
+
   /* Check that it doesn't conflict with a pre-existing weirdly-cased
    * name. */
   EXEC SQL SELECT COUNT(name) INTO :cnt FROM list
This page took 0.041576 seconds and 5 git commands to generate.