/*!
* check access list
*
- * this function wants something of the following form:
- * "@group,name,name2,@group2,name3".
+ * this function wants a string consisting of names seperated by comma
+ * or space. Names may be quoted within a pair of quotes. Groups are
+ * denoted by a leading @ symbol.
+ * Example:
+ * user1 user2, user3, @group1 @group2, @group3 "user name1", "@group name1"
* A NULL argument allows everybody to have access.
* We return three things:
* -1: no list
EC_NULL_LOG( names = strdup(args) );
- if ((p = strtok(names, ",")) == NULL) /* nothing, return okay */
+ if ((p = strtok_quote(names, ", ")) == NULL) /* nothing, return okay */
EC_EXIT_STATUS(-1);
while (p) {
EC_EXIT_STATUS(1);
} else if (strcasecmp(p, name) == 0) /* it's a user name */
EC_EXIT_STATUS(1);
- p = strtok(NULL, ", ");
+ p = strtok_quote(NULL, ", ");
}
EC_CLEANUP: