On Wed, Apr 12, 2006 at 07:51:53PM +1000, Nathan Scott wrote:

> Please do... actions speak alot louder than words.

[I'm CCing security because I already wrote them about this]

I've never used any of these libraries, so bear with me...

(looking at the Debian stable version)

setfacl.c line 341:

    if (nftw(file, __do_set, 0, opt_walk_physical * FTW_PHYS) < 0) {

this is the tree walk function described by 'man nftw', so seems pretty
straightforward... the __do_set function called by nftw as it walks the tree
has:

    if (S_ISLNK(stat->st_mode) &&
        (opt_walk_physical || (ftw->level > 0 && !opt_walk_logical)))

but I stuck a printf before that line which shows that S_ISLNK(stat->st_mode)
is always returning 0, even when the file is in fact a symlink.  So either
this is actually a bug in nftw(), or I don't properly understand how nftw is
supposed to be used.  I don't see anything wrong with the setfacl code.

I'll see if I can dig into nftw() tomorrow if someone else who knows what
they're doing hasn't already figured this out by then.

The nftw man page describes the FTW_PHYS option to nftw as "this is what you
want", and that option is not used in the default -R case with setfacl.  I
wonder if it is because no one else except setfacl is using this option set to
0 and thus it hasn't been tested?



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to