summaryrefslogtreecommitdiffstats
path: root/bin/setfacl
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2012-09-04 11:50:13 +0000
committertrasz <trasz@FreeBSD.org>2012-09-04 11:50:13 +0000
commitd6100248e102cd1be1c02bd7cbb101bac4a8c394 (patch)
tree22c259435c9012031310cfa663067439ca79d69b /bin/setfacl
parent510edf439e17d9c0bc3d03435da40fb7e2e35a84 (diff)
downloadFreeBSD-src-d6100248e102cd1be1c02bd7cbb101bac4a8c394.zip
FreeBSD-src-d6100248e102cd1be1c02bd7cbb101bac4a8c394.tar.gz
Make "setfacl -bd" an alias for "setfacl -k". Previously it would crash
on assert. PR: bin/165807 MFC after: 1 month
Diffstat (limited to 'bin/setfacl')
-rw-r--r--bin/setfacl/setfacl.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/bin/setfacl/setfacl.c b/bin/setfacl/setfacl.c
index 41a37f2..e1f3023 100644
--- a/bin/setfacl/setfacl.c
+++ b/bin/setfacl/setfacl.c
@@ -264,6 +264,17 @@ main(int argc, char *argv[])
need_mask = 1;
break;
case OP_REMOVE_EXT:
+ /*
+ * Don't try to call remove_ext() for empty
+ * default ACL.
+ */
+ if (acl_type == ACL_TYPE_DEFAULT &&
+ acl_get_entry(acl, ACL_FIRST_ENTRY,
+ &unused_entry) == 0) {
+ local_error += remove_default(&acl,
+ file->filename);
+ break;
+ }
remove_ext(&acl, file->filename);
need_mask = 0;
break;
OpenPOWER on IntegriCloud