1 commit fd34ef53234f465bf12cd51ca3a7bb056856e3dd
2 Author: Brandon Philips <brandon@ifup.org>
3 Date: Thu Dec 17 13:36:57 2009 -0800
5 setfacl: print useful error from read_acl_comments
7 restore()'s fail path expects errno to contain the error but that is not
8 the case with read_acl_comments().
10 Fix up the error path in restore() and have read_acl_comments() return
11 EINVAL which makes more sense in this case.
13 Signed-off-by: Brandon Philips <bphilips@suse.de>
15 diff --git a/setfacl/parse.c b/setfacl/parse.c
16 index 4df1a19..b333beb 100644
19 @@ -527,7 +527,7 @@ read_acl_comments(
21 if (path_p && *path_p)
28 diff --git a/setfacl/setfacl.c b/setfacl/setfacl.c
29 index 56b0aa4..802f060 100644
30 --- a/setfacl/setfacl.c
31 +++ b/setfacl/setfacl.c
32 @@ -136,8 +136,10 @@ restore(
34 error = read_acl_comments(file, &line, &path_p, &uid, &gid,
44 @@ -158,10 +160,10 @@ restore(
47 if (!(args.seq = seq_init()))
50 if (seq_append_cmd(args.seq, CMD_REMOVE_ACL, ACL_TYPE_ACCESS) ||
51 seq_append_cmd(args.seq, CMD_REMOVE_ACL, ACL_TYPE_DEFAULT))
55 error = read_acl_seq(file, args.seq, CMD_ENTRY_REPLACE,
57 @@ -249,9 +251,11 @@ getout:
64 fprintf(stderr, "%s: %s: %s\n", progname, xquote(filename, "\n\r"),