[SAMBA4]+[PATCH] problem with sticky bit

simo idra at samba.org
Sat Sep 9 16:04:46 GMT 2006

Hi tridge,

I found the problem I had with the /tmp, and as I thought it is a
problem with the sticky bit (I am testing on a FC5 machine).

See what happen when you try to retrieve an extended attribute on a
directory with and without the sticky bit:

# chmod 1777 /root/test/tmp
# getfattr -n user.DosAttrib /root/test/tmp
/root/test/tmp: user.DosAttrib: Operation not permitted
# chmod 0777 /root/test/tmp
# getfattr -n user.DosAttrib /root/test/tmp
/root/test/tmp: user.DosAttrib: No such attribute

Operation not permitted is always returned even if the attribute exists

# setfattr -n user.DosAttrib -v test /root/test/tmp
# getfattr -n user.DosAttrib /root/test/tmp
getfattr: Removing leading '/' from absolute path names
# file: root/test/tmp

# chmod 1777 /root/test/tmp
# getfattr -n user.DosAttrib /root/test/tmp
/root/test/tmp: user.DosAttrib: Operation not permitted

I don't know if this is a kernel bug or it is expected behavior to have
an EPERM errno if the sticky bit is set, in any case we must handle it.

It does not happen for files, only for directories.

The attached patch fixes the problem, but I am not sure this is the
right way to handle this problem.


Simo Sorce
Samba Team GPL Compliance Officer
email: idra at samba.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: samba4_eperm_sticky_on_dir.patch
Type: text/x-patch
Size: 1082 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20060909/5a929ac2/samba4_eperm_sticky_on_dir.bin

More information about the samba-technical mailing list