From baf9c7936e1c4d57fe8bb454161a5f2b8dd32076 Mon Sep 17 00:00:00 2001 From: David Disseldorp Date: Thu, 12 Sep 2013 15:14:53 +0200 Subject: [PATCH] DON'T PUSH: trigger file_set_dosmode lock order panic A simple reproducer for: https://bugzilla.samba.org/show_bug.cgi?id=9794 --- selftest/target/Samba3.pm | 2 +- source3/smbd/dosmode.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm index 0972457..bc2456f 100755 --- a/selftest/target/Samba3.pm +++ b/selftest/target/Samba3.pm @@ -984,7 +984,7 @@ sub provision($$$$$$) map hidden = no map system = no map readonly = no - store dos attributes = yes + store dos attributes = no create mask = 755 dos filemode = yes vfs objects = acl_xattr fake_acls xattr_tdb streams_depot diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c index 2d07dd9..35516c2 100644 --- a/source3/smbd/dosmode.c +++ b/source3/smbd/dosmode.c @@ -852,6 +852,8 @@ int file_set_dosmode(connection_struct *conn, struct smb_filename *smb_fname, return -1; } +#if 0 + !! simulate path based chmod failure with EPERM or EACCES !! ret = SMB_VFS_CHMOD(conn, smb_fname->base_name, unixmode); if (ret == 0) { if(!newfile || (lret != -1)) { @@ -865,6 +867,7 @@ int file_set_dosmode(connection_struct *conn, struct smb_filename *smb_fname, if((errno != EPERM) && (errno != EACCES)) return -1; +#endif if(!lp_dos_filemode(SNUM(conn))) return -1; -- 1.8.1.4