s3: smbd: Change open_streams_for_delete() to take a struct smb_filename *.
[samba.git] / source3 / smbd / trans2.c
index bc34add01898f760336aee9395034522ceceda64..b1eb9a9d2af1948e9e129b59024d5d1ea90f332c 100644 (file)
@@ -2633,6 +2633,8 @@ close_if_end = %d requires_resume_key = %d backup_priv = %d level = 0x%x, max_da
                        reply_nterror(req, NT_STATUS_NO_MEMORY);
                        goto out;
                }
+               /* Ensure smb_dname->base_name matches. */
+               smb_dname->base_name = directory;
        }
 
        DEBUG(5,("dir=%s, mask = %s\n",directory, mask));
@@ -2698,7 +2700,7 @@ total_data=%u (should be %u)\n", (unsigned int)total_data, (unsigned int)IVAL(pd
        ntstatus = dptr_create(conn,
                                req,
                                NULL, /* fsp */
-                               directory,
+                               smb_dname,
                                False,
                                True,
                                req->smbpid,
@@ -5178,8 +5180,12 @@ NTSTATUS smbd_do_qfilepathinfo(connection_struct *conn,
                                return NT_STATUS_INVALID_PARAMETER;
                        }
 
-                       status = vfs_streaminfo(conn, fsp, smb_fname->base_name,
-                                               talloc_tos(), &num_streams, &streams);
+                       status = vfs_streaminfo(conn,
+                                               fsp,
+                                               smb_fname,
+                                               talloc_tos(),
+                                               &num_streams,
+                                               &streams);
 
                        if (!NT_STATUS_IS_OK(status)) {
                                DEBUG(10, ("could not get stream info: %s\n",
@@ -7512,7 +7518,7 @@ static NTSTATUS smb_set_file_unix_basic(connection_struct *conn,
                if (fsp && fsp->fh->fd != -1) {
                        ret = SMB_VFS_FCHMOD(fsp, unixmode);
                } else {
-                       ret = SMB_VFS_CHMOD(conn, smb_fname->base_name, unixmode);
+                       ret = SMB_VFS_CHMOD(conn, smb_fname, unixmode);
                }
                if (ret != 0) {
                        return map_nt_error_from_unix(errno);
@@ -7539,7 +7545,7 @@ static NTSTATUS smb_set_file_unix_basic(connection_struct *conn,
                         * UNIX extensions calls must always operate
                         * on symlinks.
                         */
-                       ret = SMB_VFS_LCHOWN(conn, smb_fname->base_name,
+                       ret = SMB_VFS_LCHOWN(conn, smb_fname,
                                             set_owner, (gid_t)-1);
                }
 
@@ -7571,7 +7577,7 @@ static NTSTATUS smb_set_file_unix_basic(connection_struct *conn,
                         * UNIX extensions calls must always operate
                         * on symlinks.
                         */
-                       ret = SMB_VFS_LCHOWN(conn, smb_fname->base_name, (uid_t)-1,
+                       ret = SMB_VFS_LCHOWN(conn, smb_fname, (uid_t)-1,
                                  set_grp);
                }
                if (ret != 0) {