summaryrefslogtreecommitdiffstats
path: root/bin/setfacl/util.c
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2009-12-26 10:06:45 +0000
committertrasz <trasz@FreeBSD.org>2009-12-26 10:06:45 +0000
commit0d8feb4153ecf50f763a2d1ce9074675cf68aae1 (patch)
tree69da4084dd7940b1bc884ce84515d2b52bc68da0 /bin/setfacl/util.c
parente11fe899ea4c6f36c564e59d30a2d022dfb7f33c (diff)
downloadFreeBSD-src-0d8feb4153ecf50f763a2d1ce9074675cf68aae1.zip
FreeBSD-src-0d8feb4153ecf50f763a2d1ce9074675cf68aae1.tar.gz
Improve ACL branding mismatch detection and reporting in some rare cases,
such as "setfacl -m ''".
Diffstat (limited to 'bin/setfacl/util.c')
-rw-r--r--bin/setfacl/util.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/bin/setfacl/util.c b/bin/setfacl/util.c
index 46b9abb..3c42979 100644
--- a/bin/setfacl/util.c
+++ b/bin/setfacl/util.c
@@ -43,3 +43,26 @@ zmalloc(size_t size)
err(1, "calloc() failed");
return (ptr);
}
+
+const char *
+brand_name(int brand)
+{
+ switch (brand) {
+ case ACL_BRAND_NFS4:
+ return "NFSv4";
+ case ACL_BRAND_POSIX:
+ return "POSIX.1e";
+ default:
+ return "unknown";
+ }
+}
+
+int
+branding_mismatch(int brand1, int brand2)
+{
+ if (brand1 == ACL_BRAND_UNKNOWN || brand2 == ACL_BRAND_UNKNOWN)
+ return (0);
+ if (brand1 != brand2)
+ return (1);
+ return (1);
+}
OpenPOWER on IntegriCloud