Is this working as designed or a samba bug? I am trying to chown ownership of a file in a samba share and it results in an error. cifstest6:~ # smbclient //cifstest8/smb8 -U root Enter root's password: Domain=[CIFSTEST8] OS=[Unix] Server=[Samba 3.4.0-GIT-e6a5f11-devel] smb: \> chown 65534 65534 file2 NT_STATUS_ACCESS_DENIED chown file \file2 uid=65534, gid=65534 The share is thus exported [smb88] path = /tmp/cifstest88 browseable = Yes read only = No guest ok = Yes writable = yes printable = yes ls -l /tmp/cifstest8/file2 -rwxrwxrwx 1 root root 0 Mar 10 10:47 /tmp/cifstest8/file2 [2009/03/10 11:40:24, 3] smbd/trans2.c:6831(call_trans2setfilepathinfo) call_trans2setfilepathinfo(6) file2 (fnum -1) info_level=512 totdata=100 [2009/03/10 11:40:24, 10] smbd/trans2.c:6069(smb_set_file_unix_basic) smb_set_file_unix_basic: SMB_SET_FILE_UNIX_BASIC: name = file2 size = 0, uid = 65534, gid = 65533, raw perms = 037777777777 [2009/03/10 11:40:24, 10] smbd/trans2.c:6129(smb_set_file_unix_basic) smb_set_file_unix_basic: SMB_SET_FILE_UNIX_BASIC changing owner 65534 for path file2 [2009/03/10 11:40:24, 3] smbd/error.c:60(error_packet_set) error packet at smbd/trans2.c(7087) cmd=50 (SMBtrans2) NT_STATUS_ACCESS_DENIED
On Tue, Mar 10, 2009 at 9:32 PM, Shirish Pargaonkar <shirishpargaonkar@gmail.com> wrote:> Is this working as designed or a samba bug? > > I am trying to chown ownership of a file in a samba share and it > results in an error. > > cifstest6:~ # smbclient //cifstest8/smb8 -U root > Enter root's password: > Domain=[CIFSTEST8] OS=[Unix] Server=[Samba 3.4.0-GIT-e6a5f11-devel] > smb: \> chown 65534 65534 file2 > NT_STATUS_ACCESS_DENIED chown file \file2 uid=65534, gid=65534 > > The share is thus exported > > [smb88] > ? ? ? ?path = ?/tmp/cifstest88 > ? ? ? ?browseable = Yes > ? ? ? ?read only = No > ? ? ? ?guest ok = Yes > ? ? ? ?writable = yes > ? ? ? ?printable = yes > > ls -l /tmp/cifstest8/file2 > -rwxrwxrwx 1 root root 0 Mar 10 10:47 /tmp/cifstest8/file2 > > > [2009/03/10 11:40:24, ?3] smbd/trans2.c:6831(call_trans2setfilepathinfo) > ?call_trans2setfilepathinfo(6) file2 (fnum -1) info_level=512 totdata=100 > [2009/03/10 11:40:24, 10] smbd/trans2.c:6069(smb_set_file_unix_basic) > ?smb_set_file_unix_basic: SMB_SET_FILE_UNIX_BASIC: name = file2 size > = 0, uid = 65534, gid = 65533, raw perms = 037777777777 > [2009/03/10 11:40:24, 10] smbd/trans2.c:6129(smb_set_file_unix_basic) > ?smb_set_file_unix_basic: SMB_SET_FILE_UNIX_BASIC changing owner > 65534 for path file2 > [2009/03/10 11:40:24, ?3] smbd/error.c:60(error_packet_set) > ?error packet at smbd/trans2.c(7087) cmd=50 (SMBtrans2) NT_STATUS_ACCESS_DENIED >Sorry, I pasted wrong stanza in smb.conf, the correct one being [smb8] path = /tmp/cifstest8 browseable = Yes read only = No guest ok = Yes writable = yes
On Wed, Mar 11, 2009 at 6:13 AM, Volker Lendecke <Volker.Lendecke@sernet.de> wrote:> On Wed, Mar 11, 2009 at 05:28:00AM -0500, Shirish Pargaonkar wrote: >> >> smb: \> chown 65534 file2 >> >> chown uid gid file >> >> >> >> smb: \> chown 65534 65533 file2 >> >> NT_STATUS_ACCESS_DENIED chown file \file2 uid=65534, gid=65533 >> >> >> >> With just uid supplied to chown command, I do not get any error but >> >> nothing changes on the server. >> >> >> >> cifstest8:/tmp/cifstest8 # cat /etc/passwd | grep nobody >> >> nobody:x:65534:65533:nobody:/var/lib/nobody:/bin/bash >> >> >> >> cifstest8:/tmp/cifstest8 # cat /etc/group | grep nobody >> >> nobody:x:65533: >> >> nogroup:x:65534:nobody >> >> >> > >> > chown("file2", 65534, 4294967295) = -1 EPERM (Operation not permitted) >> > >> > That gid of 4294967295 does not look right >> > >> >> >> ret = SMB_VFS_CHOWN(conn, fname, set_owner, (gid_t)-1); >> >> is failing. > > "man 2 chown" gives: > > If the owner or group is specified as -1, then that ID is not changed. > > This sounds like either a 32/64 bit problem or a problem > with SELinux. > > Volker >Volker, yes, I think problem with SELinux. With this samba server, no such problem smbd -V Version 3.0.22-3-SUSE-CODE10 Thanks for the help.