1 commit a1815d4ad4ffe84e8f7d128a38955e3dab306e0d
2 Author: Markus Steinborn <msteinbo>
3 Date: Thu Dec 17 16:24:17 2009 -0800
5 setfacl: fix restore crash on malformed input
7 Malformed input to setfacl --restore can cause a crash due to a double
10 Ensure that freed memory is set to NULL.
13 https://savannah.nongnu.org/bugs/index.php?28185
15 Signed-off-by: Brandon Philips <bphilips@suse.de>
17 diff --git a/setfacl/parse.c b/setfacl/parse.c
18 index b333beb..e7e6add 100644
21 @@ -525,8 +525,10 @@ read_acl_comments(
25 - if (path_p && *path_p)
26 + if (path_p && *path_p) {
33 diff --git a/test/Makefile b/test/Makefile
34 index 828b6a4..0c6ee3e 100644
37 @@ -22,7 +22,8 @@ include $(TOPDIR)/include/builddefs
38 TESTS = $(wildcard *.test)
39 ROOT = $(wildcard root/*.test)
40 NFS = $(wildcard nfs/*.test)
41 -LSRCFILES = sort-getfacl-output run make-tree $(TESTS) $(ROOT) $(NFS)
42 +LSRCFILES = sort-getfacl-output run make-tree $(TESTS) $(ROOT) $(NFS) \
43 + test/malformed-restore-double-owner.acl
47 diff --git a/test/malformed-restore-double-owner.acl b/test/malformed-restore-double-owner.acl
49 index 0000000..1981de2
51 +++ b/test/malformed-restore-double-owner.acl
61 diff --git a/test/malformed-restore.test b/test/malformed-restore.test
63 index 0000000..e92b75b
65 +++ b/test/malformed-restore.test
67 +Test for malformed input to --restore
68 + https://savannah.nongnu.org/bugs/index.php?28185
70 + $ cp malformed-restore-double-owner.acl tmp.acl
71 + $ sed -i "s/USER/%TUSER/g" tmp.acl
72 + $ sed -i "s/GROUP/%TGROUP/g" tmp.acl
74 + $ setfacl --restore tmp.acl
75 + > setfacl: tmp.acl: Invalid argument
80 + $ getfacl tmp > tmp.acl
81 + $ sed -i 's/--t/--x/g' tmp.acl
82 + $ setfacl --restore tmp.acl
83 + > setfacl: tmp.acl: Invalid argument