The branch, v3-5-test has been updated
       via  59676ec... Cope with old CIFSFS clients that use SMBunlink to 
remove symlinks instead of trans2:posix_unlink. Jeremy.
      from  c6c0907... s3: Fix shadow copy display on Windows 7

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-5-test


- Log -----------------------------------------------------------------
commit 59676ec21f022a2af2f72385d8ea368f2a60ad3b
Author: Jeremy Allison <j...@samba.org>
Date:   Thu Oct 8 15:36:36 2009 -0700

    Cope with old CIFSFS clients that use SMBunlink to remove
    symlinks instead of trans2:posix_unlink.
    Jeremy.

-----------------------------------------------------------------------

Summary of changes:
 source3/smbd/reply.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index abc3163..2365ed1 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -2383,6 +2383,8 @@ static NTSTATUS do_unlink(connection_struct *conn,
        files_struct *fsp;
        uint32 dirtype_orig = dirtype;
        NTSTATUS status;
+       int ret;
+       bool posix_paths = lp_posix_pathnames();
 
        DEBUG(10,("do_unlink: %s, dirtype = %d\n",
                  smb_fname_str_dbg(smb_fname),
@@ -2392,7 +2394,12 @@ static NTSTATUS do_unlink(connection_struct *conn,
                return NT_STATUS_MEDIA_WRITE_PROTECTED;
        }
 
-       if (SMB_VFS_LSTAT(conn, smb_fname) != 0) {
+       if (posix_paths) {
+               ret = SMB_VFS_LSTAT(conn, smb_fname);
+       } else {
+               ret = SMB_VFS_LSTAT(conn, smb_fname);
+       }
+       if (ret != 0) {
                return map_nt_error_from_unix(errno);
        }
 
@@ -2479,7 +2486,9 @@ static NTSTATUS do_unlink(connection_struct *conn,
                 FILE_SHARE_NONE,       /* share_access */
                 FILE_OPEN,             /* create_disposition*/
                 FILE_NON_DIRECTORY_FILE, /* create_options */
-                FILE_ATTRIBUTE_NORMAL, /* file_attributes */
+                                       /* file_attributes */
+                posix_paths ? FILE_FLAG_POSIX_SEMANTICS|0777 :
+                               FILE_ATTRIBUTE_NORMAL,
                 0,                     /* oplock_request */
                 0,                     /* allocation_size */
                 NULL,                  /* sd */


-- 
Samba Shared Repository

Reply via email to