[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Acl-devel] [PATCH] libacl: Fix acl_from_text() returning NULL on all in
From: |
Dmitry V. Levin |
Subject: |
[Acl-devel] [PATCH] libacl: Fix acl_from_text() returning NULL on all input |
Date: |
Thu, 20 Apr 2017 03:40:44 +0300 |
Commit 5dac69ce914202c587f00da638123403111ca673 introduced a regression:
apparently, gcc treats
#pragma GCC diagnostic pop
as a kind of statement, so this causes parse_acl_entry()
to return -1 unconditionally, and therefore causes acl_from_text()
to return NULL unconditionally, too.
Fix this by moving the pragma after the "if" statement.
Reported-by: Valery Inozemtsev <address@hidden>
---
libacl/acl_from_text.c | 2 +-
test/misc.test | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/libacl/acl_from_text.c b/libacl/acl_from_text.c
index bb2ab04..09790c9 100644
--- a/libacl/acl_from_text.c
+++ b/libacl/acl_from_text.c
@@ -307,8 +307,8 @@ create_entry:
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Waddress"
if (acl_copy_entry(entry_d, int2ext(&entry_obj)) != 0)
-#pragma GCC diagnostic pop
return -1;
+#pragma GCC diagnostic pop
return 0;
fail:
diff --git a/test/misc.test b/test/misc.test
index c4d9774..3d39b42 100644
--- a/test/misc.test
+++ b/test/misc.test
@@ -8,6 +8,7 @@ two dummy users (bin and daemon) and a dummy group (daemon).
$ touch f
Only change a base ACL:
+ $ chacl u::rw,g::r,o::- f
$ setfacl -m u::r f
$ setfacl -m u::rw,u:bin:rw f
$ ls -dl f | awk '{print $1}'
--
ldv
- [Acl-devel] [PATCH] libacl: Fix acl_from_text() returning NULL on all input,
Dmitry V. Levin <=