[Samba] Losing Permissions of Files

Helmut Hullen Hullen at t-online.de
Mon Jun 17 09:02:00 MDT 2013


Hallo,

I wrote am 16.06.13:


[...]

>> The solution required the correct storage of the DOS attributes, the
>> appropriate configuration lines are

>> # store DOS attributes in extended attributes
>> 	ea support = yes
>> 	store dos attributes = yes
>> 	map readonly = no
>> 	map archive = no
>> 	map system = no
>> 	map hidden = no

>> You need to make sure that your file system is mounted with extended
>> attributes as well.

> In my case: all these options are set (in the "[global]" paragraph).

> The share is included with

> [WinUpdate]
> 	comment		= Update Windows
> 	path		= /srv/CDs/Update

> 	read only	= no
> 	public		= yes
> 	read list	= @schueler, @lehrer, @fachl, @adm
> 	write list	= @lehrer, @adm
> 	wide links	= no
> 	create mask	= 0755
> 	directory mask	= 1755
> 	# AND
> 	force directory mode	= 0755
> 	# OR

> 	inherit permissions	= yes
> 	map archive	= no
> #

> The directory "/srv/CDs" is an ext3 partition, mounted with
> "user_xattr".

> Reading in this share is no problem, writing too. Only executing
> something like *.vbs or *.cmd or *.exe produces under Samba4 (Samba3
> mode, using "smbd" and "nmbd" like samba-3.6.x) the error message (in
> german, on my machine)

> "Auf das angegebene Gerät bzw. den Pfad oder die Datei kann nicht
> zugegriffen werden. Sie verfügen eventuell nicht über ausreichende
> Berechtigungen, um auf das Element zugreifen zu können."

> That message is a bit different from that messages Tanveer showed:
> "You do not have permission to view or edit this object's permission
> settings."
> Viewing is (in my case) possible, editing too - at least with *.vbs
> and *.cmd.

> p.e. file "update.cmd"

> @echo off
> cd /D "%~dp0cmd"
> start DoUpdate.cmd %*

> Only executing produces the above mentioned error message.

> When I run Samba-3.6.8 (or older): all works fine.

----------------------

Maybe I've solved this problem.
Running with log level 3 showed

[2013/06/17 16:38:30.731946,  3] ../source3/smbd/ 
error.c:82(error_packet_set)
  NT error packet at ../source3/smbd/error.c(165) cmd=162 (SMBntcreateX) NT_STATUS_ACCESS_DENIED
[2013/06/17 16:38:30.732671,  3] ../source3/smbd/process.c:1794(process_smb)
  Transaction 439918 of length 126 (0 toread)
[2013/06/17 16:38:30.732909,  3] ../source3/smbd/process.c:1397(switch_message)
  switch message SMBntcreateX (pid 3997) conn 0x8060478
[2013/06/17 16:38:30.733102,  3] ../source3/smbd/vfs.c:1118(check_reduced_name)
  check_reduced_name [client/Update.cmd] [/srv/CDs/Update]
[2013/06/17 16:38:30.733316,  3] ../source3/smbd/vfs.c:1248(check_reduced_name)
  check_reduced_name: client/Update.cmd reduced to /srv/CDs/Update/client/Update.cmd
[2013/06/17 16:38:30.733625,  2] ../source3/smbd/dosmode.c:92(unix_mode)
  unix_mode(client/Update.cmd) inheriting from client
[2013/06/17 16:38:30.733796,  2] ../source3/smbd/dosmode.c:115(unix_mode)
  unix_mode(client/Update.cmd) inherit mode 40755
[2013/06/17 16:38:30.733892,  3] ../source3/smbd/dosmode.c:160(unix_mode)
  unix_mode(client/Update.cmd) returning 0644
[2013/06/17 16:38:30.735209,  3] ../source3/smbd/error.c:82(error_packet_set)
  NT error packet at ../source3/smbd/error.c(165) cmd=162 (SMBntcreateX) NT_STATUS_ACCESS_DENIED

-------------------

The problem seems to be that samba4 (running in samba3 mode) expects an  
executable file ("inherit mode") but the file "Update.cmd" had (under  
Linux) no executable flag.

Under Samba 3.6 and older: no problem.

When I changed the linux rights to 755 all worked fine.

Is that a desired behaviour, or is that an error?

Viele Gruesse!
Helmut


More information about the samba mailing list