Samba 3.0.20 read-only behaviour
Jeremy Allison
jra at samba.org
Tue Oct 11 04:21:36 GMT 2005
On Mon, Oct 10, 2005 at 09:15:56PM -0700, Jeremy Allison wrote:
> On Tue, Oct 11, 2005 at 11:47:39AM +1000, Andrew Bartlett wrote:
>
> > Can we at least remove the dependence on the *share* read only setting.
> > A file seen via a read-only share should not have different attributes
> > to a file seen via a read-write share, of the same unix location!
>
> That's a bug when "acl check permissions" is set to true (which is the
> default settin so that's why you're hitting it). I'll fix it asap - thanks
> for the unusual bug report :-). It's not supposed to act like that.
And here's the patch I just checked in. Thanks !
Jeremy
-------------- next part --------------
Index: smbd/posix_acls.c
===================================================================
--- smbd/posix_acls.c (revision 10876)
+++ smbd/posix_acls.c (working copy)
@@ -4149,16 +4149,13 @@
/****************************************************************************
Actually emulate the in-kernel access checking for write access. We need
this to successfully check for ability to write for dos filetimes.
+ Note this doesn't take into account share write permissions.
****************************************************************************/
BOOL can_write_to_file(connection_struct *conn, const char *fname, SMB_STRUCT_STAT *psbuf)
{
int ret;
- if (!CAN_WRITE(conn)) {
- return False;
- }
-
if (current_user.uid == 0 || conn->admin_user) {
/* I'm sorry sir, I didn't know you were root... */
return True;
Index: smbd/dosmode.c
===================================================================
--- smbd/dosmode.c (revision 10876)
+++ smbd/dosmode.c (working copy)
@@ -479,7 +479,7 @@
*/
/* Check if we have write access. */
- if (can_write_to_file(conn, fname, &sbuf)) {
+ if (CAN_WRITE(conn) && can_write_to_file(conn, fname, &sbuf)) {
/* We are allowed to become root and change the filetime. */
become_root();
ret = SMB_VFS_UTIME(conn,fname, times);
More information about the samba-technical
mailing list