[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Wed, 06 Jun 2007 20:07:33 +0100
From: Matt Keenan <matt@...ode-solutions.com>
To: Steve French <sfrench@...ba.org>
CC: Jeremy Allison <jra@...ba.org>,
LKML <linux-kernel@...r.kernel.org>,
linux-cifs-client@...ts.samba.org
Subject: [PATCH] CIFS should honour umask
This patch makes CIFS honour a process' umask like other filesystems.
Of course the server is still free to munge the permissions if it wants
to; but the client will send the "right" permissions to begin with.
A few caveats;
1) It only applies to filesystems that have CAP_UNIX (aka support unix
extensions)
2) It applies the correct mode to the follow up CIFSSMBUnixSetPerms()
after remote creation (I can write a new patch if you want with the
"right" mode at actual creation time; however the "right" perms will
still need to be given to the follow up CIFSSMBUnixSetPerms() anyway).
3) It will probably work best with Samba 3.0.25a or newer (ie with this
patch applied
http://lists.samba.org/archive/linux-cifs-client/2007-January/001697.html)
4) It has been compiled, and tested on 2.6.22-rc4 / Samba 3.0.25a
(Ubuntu Dapper with a few custom backports), and with a bit of testing
seems to work just fine. (it also incidentally side steps bugs in
thunderbird and openoffice (the apps don't check the permissions on
files they create, they assume they will open() the way that have asked
them to be created xref open(O_WRONLY|O_CREAT) => valid fd then
mmap(fd,PROT_READ) => EFAULT).
I am going to give this patch a more thorough test tomorrow with ltp.
Comments, corrections, et al are welcome.
Matt
--
Matt Keenan
OpCode Solutions
View attachment "patch-2.6.22-rc4.cifs-umask-fix" of type "text/plain" (2239 bytes)
Powered by blists - more mailing lists