Whoops - it helps if I attach the patch :)

Glen

---------- Forwarded message ----------
Date: Thu, 24 Jul 2003 16:54:55 +1000 (EST)
From: Glen Gibb <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Possible problem with ACL masks and getfacl

Hi all,

I'm not sure if this is a real problem or not, but if I set a group
ACL on a file, and then set a mask, when running getfacl the group names
are not listed.

I'm running 5.1 RELEASE.

The following sequence commands show the problem (I create a file, display
the ACL, set a group ACL, display the ACL, set a mask, and then display
the ACL again. The problem is with the final display - the group name is
not displayed).


# touch testfile
# getfacl testfile
#file:testfile
#owner:0
#group:0
user::rw-
group::r--
other::r--
# setfacl -m g:staff:rwx testfile
# getfacl testfile
#file:testfile
#owner:0
#group:0
user::rw-
group::r--
group:staff:rwx
mask::rwx
other::r--
# setfacl -m m::rx testfile
# getfacl testfile
#file:testfile
#owner:0
#group:0
user::rw-
group::r--
group::rwx              # effective: r-x
mask::r-x
other::r--


Attached is a proposed patch to lib/libc/posix1e/acl_to_text.c to correct
this problem. Please note that this patch has not been tested as the
computer I'm testing on won't build world :( (cheap computer with cheap
components). The source used is actually CURRENT as of Tuesday July
22nd.

I admit that there may be a reason why the user name is not shown
which I don't know about :).

Feedback is greatly appreciated.

Glen Gibb


--- /usr/src/lib/libc/posix1e/acl_to_text.c.orig        Thu Jul 24 16:47:41 2003
+++ /usr/src/lib/libc/posix1e/acl_to_text.c     Thu Jul 24 16:48:12 2003
@@ -177,9 +177,10 @@
                                    effective_perm_buf);
                                if (error)
                                        goto error_label;
-                               len = asprintf(&tmpbuf, "%sgroup::%s\t\t# "
+                               len = asprintf(&tmpbuf, "%sgroup:%s:%s\t\t# "
                                    "effective: %s\n",
-                                   buf, perm_buf, effective_perm_buf);
+                                   buf, name_buf, perm_buf, 
+                                   effective_perm_buf);
                        } else {
                                len = asprintf(&tmpbuf, "%sgroup:%s:%s\n", buf,
                                    name_buf, perm_buf);
_______________________________________________
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to