xfs-masters
[Top] [All Lists]

[Bug 790] getfacl 2.2.47 follows symlinks, even without -L

To: xfs-master@xxxxxxxxxxx
Subject: [Bug 790] getfacl 2.2.47 follows symlinks, even without -L
From: bugzilla-daemon@xxxxxxxxxxx
Date: Thu, 6 Nov 2008 03:38:16 -0800
http://oss.sgi.com/bugzilla/show_bug.cgi?id=790





------- Additional Comments From matthijs@xxxxxxxx  2008-11-06 03:38 CST -------
On second thought, the fix is still not complete. The new version now correctly
refrains from touching and traversing the symlink, but it still stats it (not
just lstat).

This results in errors for broken symlinks, which are annoying and confusing.

$ mkdir foo; ln -s /nonexistent foo/bar
$ getfacl -R foo/
[snip output]
getfacl: foo//bar: No such file or directory
$ cd foo;
$ getfacl -P bar 
getfacl: bar: No such file or directory


The cause for this is that walk_tree_rec always stats a symlink, then sets the
WALK_TREE_SYMLINK flag, which is then used by both do_set (in setfacl) and
do_print (in getfacl) to ignore the file.

The attached patch fixe this by making do_set and do_print first check for
symlinks that don't need to be followed and making a quick exit, and then print
an error afterwards.

IMHO this patch is still quite hacky, and the stat on the symlink should never
happen, nor should do_print or do_set be called on symlinks that are not
considered. However, this approach is slightly more flexible for future changes,
perhaps.

-- 
Configure bugmail: http://oss.sgi.com/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

<Prev in Thread] Current Thread [Next in Thread>