* 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[] = {
{
EXEC SQL BEGIN DECLARE SECTION;
int ngid, cnt;
- char *name;
+ char *name, *desc;
EXEC SQL END DECLARE SECTION;
unsigned char *p;
int idx, err;
else if (!strcmp(q->shortname, "ulis"))
idx = 1;
name = argv[idx];
+ desc = argv[10 + idx];
if (idx == 1)
{
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