[Pkg-samba-maint] Bug#501678: Files copied/moved to cifs filesystems get attributes changed

Steve Langasek vorlon at debian.org
Sat Oct 18 23:52:21 UTC 2008


On Fri, Oct 10, 2008 at 10:55:53PM +0100, Chris Carr wrote:
> > Are you sure this is happening when you move files?  I see it when I copy
> > files, but not when I move them.

> Yes. I have just confirmed this by moving a plain text file onto a samba
> share (/home/chrisc on the server mounted as /home/chrisc/MyDocs on the
> client). Bizarrely, I received the following error message: 

> mv: setting permissions for `MyDocs/text.txt': Permission denied

Ok, then there's a separate permissions issue in this case.

> ... but still the +x attribute was set! So does that mean it wasn't set
> by the mv command, but by the samba server? 

It was set via the permission mapping when the file was opened for writing.

> > The reason for this is that 'mv' or 'cp -p' will explicitly set the file
> > mode with fchmod(); if you run 'cp' without the '-p' option, then the mode
> > on the new file is not copied separately, it's expected to be set by the
> > option passed to open() which comes from the user's umask.

> > It looks like this is somehow related to the handling of 'map archive'
> > between client and server.  If you set 'map archive = no', then the
> > executable bit is not set.

> Sorry to be dim, but you mean set that in smb.conf, yes? 

On the server, yes.

-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slangasek at ubuntu.com                                     vorlon at debian.org





More information about the Pkg-samba-maint mailing list