libsmbclient - setxattr sometimes corrupts conext
Henrik
henke at mac.se
Wed Jan 9 19:23:50 GMT 2008
Hello list,
We are using samba 3.0.28 and we noticed some weird bugs with the
smbc_setxattr function.
Worth of mentioning is that on our contexts we use:
smbc_option_set( pSmbContext, "full_time_names", 1 );
It looks like setting time values somehow corrupt the context, so that
we can't set ACL using names. Somehow it works if we set ACL using SIDs.
This has been tried on several paths, many times, many files/
directories after each other, same result every time.
In the following example we first set CREATE_TIME and WRITE_TIME of a
directory, then try to set the ACL using Names, which fails. Then we
get a new context and try again, which works.
setxattr smb://10.168.1.133/C$/Test/Test/dir_a
system.dos_attr.*
CREATE_TIME:1199807690,WRITE_TIME:1199807823
nReturnValue: 0, errno: 0
setxattr smb://10.168.1.133/C$/Test/Test/dir_a
system.nt_sec_desc.*+
REVISION:1,OWNER:BBI-DEV\Admin,GROUP:BBI-DEV\Ingen,ACL:BBI-DEV
\Admin:0/3/0x001f01ff,ACL:BBI-DEV\Lena:0/3/0x001f01ff,ACL:NT Authority
\SYSTEM:0/3/0x001f01ff
nReturnValue: -1, errno: 22
Here it failed, so the program get a new context and try again with
the exact same call to setxattr:
setxattr smb://10.168.1.133/C$/Test/Test/dir_a
system.nt_sec_desc.*+
REVISION:1,OWNER:BBI-DEV\Admin,GROUP:BBI-DEV\Ingen,ACL:BBI-DEV
\Admin:0/3/0x001f01ff,ACL:BBI-DEV\Lena:0/3/0x001f01ff,ACL:NT Authority
\SYSTEM:0/3/0x001f01ff
nReturnValue: 0, errno: 0
Success as we use a new clean context.
-----------------------------------------------------------------------------------------------------------------------------
In the following example we first set CREATE_TIME and WRITE_TIME of a
directory, then try to set the ACL using SIDs, which works!
setxattr smb://10.168.1.133/C$/Test/Test/dir_a
system.dos_attr.*
CREATE_TIME:1199807690,WRITE_TIME:1199807823
nReturnValue: 0, errno: 0
setxattr smb://10.168.1.133/C$/Test/Test/dir_a
system.nt_sec_desc.*
REVISION:
1,OWNER:S-1-5-21-1454471165-1214440339-839522115-1005,GROUP:S-1-5-21-1454471165-1214440339-839522115-513,ACL:S-1-5-21-1454471165-1214440339-839522115-1005:0/3/0x001f01ff,ACL:S-1-5-21-1454471165-1214440339-839522115-1004:0/3/0x001f01ff,ACL:S-1-5-18:0/3/0x001f01ff
nReturnValue: 0, errno: 0
If we DO NOT set CREATE_TIME and WRITE_TIME and ONLY set ACLs, then it
works every time with both ACL Names and ACL SIDs.
Should I issue a bug report on this?
Cheers,
Henrik
More information about the samba-technical
mailing list