if (r > 0)
return -r; /* already warned */
- else if (r == -ENOTSUP) {
+ else if (r == -EOPNOTSUPP) {
log_debug_errno(r, "ACLs not supported by file system at %s", path);
return 0;
} else if (r < 0)
_cleanup_(item_free_contents) Item i = {};
ItemArray *existing;
Hashmap *h;
- int r, c = -1, pos;
+ int r, pos;
bool force = false, boot = false;
assert(fname);
assert(line >= 1);
assert(buffer);
- r = sscanf(buffer,
- "%ms %ms %ms %ms %ms %ms %n",
+ r = unquote_many_words(&buffer,
&action,
&path,
&mode,
&user,
&group,
&age,
- &c);
- if (r < 2) {
+ &i.argument,
+ NULL);
+ if (r < 0)
+ return log_error_errno(r, "[%s:%u] Failed to parse line: %m", fname, line);
+ else if (r < 2) {
log_error("[%s:%u] Syntax error.", fname, line);
return -EIO;
}
return r;
}
- if (c >= 0) {
- c += strspn(buffer+c, WHITESPACE);
- if (buffer[c] != 0 && (buffer[c] != '-' || buffer[c+1] != 0)) {
- i.argument = unquote(buffer+c, "\"");
- if (!i.argument)
- return log_oom();
- }
- }
-
switch (i.type) {
case CREATE_FILE:
unsigned n;
for (n = 0; n < existing->count; n++) {
- if (!item_compatible(existing->items + n, &i))
+ if (!item_compatible(existing->items + n, &i)) {
log_warning("[%s:%u] Duplicate line for path \"%s\", ignoring.",
fname, line, i.path);
+ return 0;
+ }
}
} else {
existing = new0(ItemArray, 1);