From 8ed068d31ca83977ee5c6503e8a9fb6e1f938e4b Mon Sep 17 00:00:00 2001 From: Edward Tomasz Napierala Date: Tue, 4 Sep 2012 11:50:13 +0000 Subject: [PATCH] Make "setfacl -bd" an alias for "setfacl -k". Previously it would crash on assert. PR: bin/165807 MFC after: 1 month --- bin/setfacl/setfacl.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bin/setfacl/setfacl.c b/bin/setfacl/setfacl.c index 41a37f21d10..e1f3023e27d 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;