xfs
[Top] [All Lists]

Re: setfacl bug

To: Nathan Scott <nathans@xxxxxxx>
Subject: Re: setfacl bug
From: Ethan Benson <erbenson@xxxxxxxxxx>
Date: Sun, 11 Aug 2002 17:00:03 -0800
Cc: agruen@xxxxxxx, linux-xfs@xxxxxxxxxxx, acl-devel@xxxxxxxxxxx
In-reply-to: <20020812002123.GC456@frodo>; from nathans@sgi.com on Mon, Aug 12, 2002 at 10:21:23AM +1000
Mail-copies-to: nobody
Mail-followup-to: Nathan Scott <nathans@xxxxxxx>, agruen@xxxxxxx, linux-xfs@xxxxxxxxxxx, acl-devel@xxxxxxxxxxx
References: <20020810211425.A23502@plato.local.lan> <20020812002123.GC456@frodo>
Sender: owner-linux-xfs@xxxxxxxxxxx
User-agent: Mutt/1.2.5i
one more detail, setfacl -b is also completly broken, it just returns
Permission denied for regular files.  this is consistent with Nathan's
assessment that acl_get_file needs to not fail on regular files.

sidenote, why is setfacl returning permission denied? this does not
seem to be the correct error.

On Mon, Aug 12, 2002 at 10:21:23AM +1000, Nathan Scott wrote:
> hi,
> 
> This one needs to be reported to the setfacl author - the fix
> for this one will need a better knowledge of the setfacl code
> than I have.
> 
> Andreas, from a quick look this is almost certainly related to
> that 2.0.13 change which makes acl_get_file fail for reg files
> when asked about default ACLs.  I've added some ltrace output
> below which provides a bit more info on top of Ethan's notes.
> 
> cheers.
> 
> -- 
> Nathan
> 
> 
> On Sat, Aug 10, 2002 at 09:14:25PM -0800, Ethan Benson wrote:
> > I originally noticed this problem start after upgrading to acl 2.0.15,
> > however i thought perhaps it was related to xattr bugs in 2.4.18 so i
> > waited until upgrading to 2.4.19 to see if the problem persists, it
> > does:
> > 
> > eb@ash ~/tmp$ mkdir src dst
> > eb@ash ~/tmp$ mkdir src/dir dst/dir
> > eb@ash ~/tmp$ touch src/dir/file dst/dir/file
> > eb@ash ~/tmp$ setfacl -m u:bin:r-- src/dir/file 
> > eb@ash ~/tmp$ (cd src ; getfacl --skip-base -R -P .) | (cd dst ; setfacl 
> > --restore=-)
> > setfacl: dir/file: Permission denied
> > eb@ash ~/tmp$ getfacl src/dir/file 
> > # file: src/dir/file
> > # owner: eb
> > # group: eb
> > user::rw-
> > user:bin:r--
> > group::r--
> > mask::r--
> > other::r--
> > 
> > eb@ash ~/tmp$ getfacl dst/dir/file 
> > # file: dst/dir/file
> > # owner: eb
> > # group: eb
> > user::rw-
> > group::r--
> > other::r--
> > 
> > i use the above method as part of my backup script, it worked with acl
> > 2.0.8 but not with 2.0.15.
> > 
> > current kernel is 2.4.19 with split patches, previous kernel was
> > 2.4.18 with split patches.
> > 
> > here is the relevant piece of strace output:
> > 
> > lstat64(0x10015750, 0x7ffff8c8)         = 0
> > SYS_212(0x10015750, 0xffeeb84, 0x7ffff710, 0x84, 0xa0a0a0a) = -1 ENODATA 
> > (No data available)
> > stat64(0x10015750, 0x7ffff7a8)          = 0
> > SYS_212(0x10015750, 0xffeeb9c, 0x7ffff710, 0x84, 0xff95d20) = -1 ENODATA 
> > (No data available)
> > stat64(0x10015750, 0x7ffff7a8)          = 0
> > open("/usr/share/locale/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT 
> > (No such file or directory)
> > open("/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No 
> > such file or directory)
> > write(2, "setfacl: dir/file: Permission de"..., 37setfacl: dir/file: 
> > Permission denied) = 37
> > read(0, "", 4096)                       = 0
> > exit(0)                                 = ?
> > 
> > 
> > -- 
> > Ethan Benson
> > http://www.alaska.net/~erbenson/
> 
> 
> $ ( cd src ; getfacl --skip-base -R -P . ) | ( cd dst ; ltrace setfacl 
> --restore=- )
> [...]
> acl_get_file(0x0804daf0, 32768, 0x40136680, 0x4004e1de, 1) = 0x0804ee24
> acl_dup(0x0804ee24, 32768, 0x40136680, 0x4004e1de, 1) = 0x0804eeb4
> acl_free(0x0804eeb4, 0, 0xbffff978, 5, 0x0804ed30) = 0
> acl_init(5, 0x40012c90, 0xbffff97c, 0x0804a805, 0x0804eeb4) = 0x0804eecc
> acl_get_file(0x0804daf0, 16384, 0xbffff90c, 0x4001c8a6, 1) = 0
> __errno_location()                                = 0x40139a20
> __errno_location()                                = 0x40139a20
> strerror(13)                                      = "Permission denied"
> fprintf(0x40136360, "%s: %s: %s\n", "setfacl", "dir/file", "Permission 
> denied"setfacl: dir/file: Permission denied
> ) = 37
> acl_free(0x0804eecc, 1, 0xbffff978, 5, 0x0804ed30) = 0
> acl_free(0x0804ee24, 1, 0xbffff978, 5, 0x0804ed30) = 0
> 

-- 
Ethan Benson
http://www.alaska.net/~erbenson/

Attachment: pgpx3mWMbe6Y6.pgp
Description: PGP signature

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