From: tytso Date: Tue, 13 Sep 1994 16:36:04 +0000 (+0000) Subject: Don't allow someone to add a string with a single quote character; this X-Git-Tag: OPSSRC_BASE~50 X-Git-Url: http://andersk.mit.edu/gitweb/moira.git/commitdiff_plain/f1f92ff741afce557351964fdb1d4126e83c239a Don't allow someone to add a string with a single quote character; this breaks things in Moira. Print a warning message if a string which does not contain an '@', '%', or '!' character is added to a list. --- diff --git a/clients/blanche/blanche.c b/clients/blanche/blanche.c index b311941f..02107188 100644 --- a/clients/blanche/blanche.c +++ b/clients/blanche/blanche.c @@ -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";