Check for WRITE_ACCESS on the file before overriding an EACCESS.
authorJeremy Allison <jra@samba.org>
Thu, 25 Apr 2013 21:06:03 +0000 (14:06 -0700)
committerKarolin Seeger <kseeger@samba.org>
Mon, 10 Jun 2013 19:22:50 +0000 (21:22 +0200)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Sat Apr 27 15:57:17 CEST 2013 on sn-devel-104
(cherry picked from commit 5185460067229a342ddf3951ecc968017c2ed4df)

The last 4 patches address bug #9794 - opening/editing or copying MS files
causes a core dump with invalid lock order.

source3/smbd/dosmode.c

index 64877d2b9307664c54facedee120efcf56e9adbd..3152631f65b607568b90048f09e98f44b8364a3b 100644 (file)
@@ -419,6 +419,10 @@ static bool set_ea_dos_attribute(connection_struct *conn,
                if(!CAN_WRITE(conn) || !lp_dos_filemode(SNUM(conn)))
                        return false;
 
+               if (!can_write_to_file(conn, smb_fname)) {
+                       return false;
+               }
+
                /*
                 * We need to open the file with write access whilst
                 * still in our current user context. This ensures we