]> andersk Git - moira.git/commitdiff
Don't allow someone to add a string with a single quote character; this
authortytso <tytso>
Tue, 13 Sep 1994 16:36:04 +0000 (16:36 +0000)
committertytso <tytso>
Tue, 13 Sep 1994 16:36:04 +0000 (16:36 +0000)
breaks things in Moira.

Print a warning message if a string which does not contain an
'@', '%', or '!' character is added to a list.

clients/blanche/blanche.c

index b311941fbabc51a63ca9d142c90585c5d3e443e6..02107188a5039a5f6e7dad4f7f1fa0e5e535a3d6 100644 (file)
@@ -239,6 +239,14 @@ char **argv;
 
     /* Process the add list */
     while (sq_get_data(addlist, &memberstruct)) {
+       if ((memberstruct->type == M_STRING ||
+            memberstruct->type == M_ANY) &&
+           strchr(memberstruct->name, '\'')) {
+               fprintf(stderr, "Illegal character \"'\" in \"STRING:%s\", aborting blanche.\n",
+                       memberstruct->name);
+               fprintf(stderr, "No changes were made.\n");
+               exit(1);
+       }
        /* canonicalize string if necessary */
        if (memberstruct->type == M_STRING &&
            (p = strchr(memberstruct->name, '@'))) {
@@ -310,6 +318,14 @@ char **argv;
            if (status != MR_SUCCESS)
              com_err(whoami, status, "while adding member %s to %s",
                      memberstruct->name, listname);
+           else if (!strchr(memberstruct->name, '@') &&
+                    !strchr(memberstruct->name, '!') &&
+                    !strchr(memberstruct->name, '%')) {
+               fprintf(stderr, "\nWARNING: \"STRING:%s\" was just added to list \"%s\".\n",
+                       memberstruct->name, listname);
+               fprintf(stderr, "\tIf %s is a mailing list, this may cause it to stop working.\n", listname);
+               fprintf(stderr, "\tYou should consider removing \"STRING:%s\" from the list.\n", memberstruct->name);
+           }
            break;
        case M_KERBEROS:
            membervec[1] = "KERBEROS";
This page took 0.036803 seconds and 5 git commands to generate.