+static void createline(char *line)
+{
+ char *w;
+ char *ep;
+
+ for (w=dl_next(line); w!=line; w=dl_next(w)) {
+ if (strncasecmp(w, "auto=", 5) == 0)
+ createinfo.autof = parse_auto(w+5, "auto=", 1);
+ else if (strncasecmp(w, "owner=", 6) == 0) {
+ if (w[6] == 0) {
+ fprintf(stderr, Name ": missing owner name\n");
+ continue;
+ }
+ createinfo.uid = strtoul(w+6, &ep, 10);
+ if (*ep != 0) {
+ struct passwd *pw;
+ /* must be a name */
+ pw = getpwnam(w+6);
+ if (pw)
+ createinfo.uid = pw->pw_uid;
+ else
+ fprintf(stderr, Name ": CREATE user %s not found\n", w+6);
+ }
+ } else if (strncasecmp(w, "group=", 6) == 0) {
+ if (w[6] == 0) {
+ fprintf(stderr, Name ": missing group name\n");
+ continue;
+ }
+ createinfo.gid = strtoul(w+6, &ep, 10);
+ if (*ep != 0) {
+ struct group *gr;
+ /* must be a name */
+ gr = getgrnam(w+6);
+ if (gr)
+ createinfo.gid = gr->gr_gid;
+ else
+ fprintf(stderr, Name ": CREATE group %s not found\n", w+6);
+ }
+ } else if (strncasecmp(w, "mode=", 5) == 0) {
+ if (w[5] == 0) {
+ fprintf(stderr, Name ": missing CREATE mode\n");
+ continue;
+ }
+ createinfo.mode = strtoul(w+5, &ep, 8);
+ if (*ep != 0) {
+ createinfo.mode = 0600;
+ fprintf(stderr, Name ": unrecognised CREATE mode %s\n",
+ w+5);
+ }
+ } else if (strncasecmp(w, "metadata=", 9) == 0) {
+ /* style of metadata to use by default */
+ int i;
+ for (i=0; superlist[i] && !createinfo.supertype; i++)
+ createinfo.supertype =
+ superlist[i]->match_metadata_desc(w+9);
+ if (!createinfo.supertype)
+ fprintf(stderr, Name ": metadata format %s unknown, ignoring\n",
+ w+9);
+ } else if (strncasecmp(w, "symlinks=yes", 12) == 0)
+ createinfo.symlinks = 1;
+ else if (strncasecmp(w, "symlinks=no", 11) == 0)
+ createinfo.symlinks = 0;
+ else {
+ fprintf(stderr, Name ": unrecognised word on CREATE line: %s\n",
+ w);
+ }
+ }
+}