s3: smbd: Remove one more use of lp_posix_pathnames().
[obnox/samba/samba-obnox.git] / source3 / smbd / dir.c
index 2ab37680b58a546820a0c5c93f08663eaedccee8..380591521068b088ee0477083cef2ba81f9d3aea 100644 (file)
@@ -485,7 +485,7 @@ NTSTATUS dptr_create(connection_struct *conn,
                if (smb_dname == NULL) {
                        return NT_STATUS_NO_MEMORY;
                }
-               if (lp_posix_pathnames()) {
+               if (req != NULL && req->posix_pathnames) {
                        ret = SMB_VFS_LSTAT(conn, smb_dname);
                } else {
                        ret = SMB_VFS_STAT(conn, smb_dname);
@@ -545,7 +545,8 @@ NTSTATUS dptr_create(connection_struct *conn,
                TALLOC_FREE(dir_hnd);
                return NT_STATUS_NO_MEMORY;
        }
-       if (lp_posix_pathnames() || (wcard[0] == '.' && wcard[1] == 0)) {
+       if ((req != NULL && req->posix_pathnames) ||
+                       (wcard[0] == '.' && wcard[1] == 0)) {
                dptr->has_wild = True;
        } else {
                dptr->has_wild = wcard_has_wild;
@@ -1963,7 +1964,7 @@ static int have_file_open_below_fn(struct file_id fid,
        return 1;
 }
 
-static bool have_file_open_below(connection_struct *conn,
+bool have_file_open_below(connection_struct *conn,
                                 const struct smb_filename *name)
 {
        struct have_file_open_below_state state = {
@@ -2035,7 +2036,7 @@ NTSTATUS can_delete_directory_fsp(files_struct *fsp)
                return status;
        }
 
-       if (!lp_posix_pathnames() &&
+       if (!(fsp->posix_flags & FSP_POSIX_FLAGS_RENAME) &&
            lp_strict_rename(SNUM(conn)) &&
            have_file_open_below(fsp->conn, fsp->fsp_name))
        {