s3: We only need base_name in map_open_params_to_ntcreate
authorVolker Lendecke <vl@samba.org>
Fri, 29 Jul 2011 21:26:58 +0000 (14:26 -0700)
committerKarolin Seeger <kseeger@samba.org>
Mon, 24 Oct 2011 17:15:13 +0000 (19:15 +0200)
(cherry picked from commit 1fa4b369d2fabbf34cda576d91d8aa9baa4e8b68)

source3/include/proto.h
source3/smbd/open.c
source3/smbd/reply.c
source3/smbd/trans2.c

index d560ee536843ecd852bd5554f4e5c503ff6c05b1..af43b34071d299cb77d818fdc32ef4f7b2a602e2 100644 (file)
@@ -6628,7 +6628,7 @@ NTSTATUS fcb_or_dos_open(struct smb_request *req,
                         uint32 access_mask,
                         uint32 share_access,
                         uint32 create_options);
-bool map_open_params_to_ntcreate(const struct smb_filename *smb_fname,
+bool map_open_params_to_ntcreate(const char *smb_base_fname,
                                 int deny_mode, int open_func,
                                 uint32 *paccess_mask,
                                 uint32 *pshare_mode,
index f0b92713d7787d9154318db6903708dbc3cb2645..38e4e16b1de414900d885b79fd9f3543102e8d82 100644 (file)
@@ -1226,7 +1226,7 @@ NTSTATUS fcb_or_dos_open(struct smb_request *req,
  Open a file with a share mode - old openX method - map into NTCreate.
 ****************************************************************************/
 
-bool map_open_params_to_ntcreate(const struct smb_filename *smb_fname,
+bool map_open_params_to_ntcreate(const char *smb_base_fname,
                                 int deny_mode, int open_func,
                                 uint32 *paccess_mask,
                                 uint32 *pshare_mode,
@@ -1240,7 +1240,7 @@ bool map_open_params_to_ntcreate(const struct smb_filename *smb_fname,
 
        DEBUG(10,("map_open_params_to_ntcreate: fname = %s, deny_mode = 0x%x, "
                  "open_func = 0x%x\n",
-                 smb_fname_str_dbg(smb_fname), (unsigned int)deny_mode,
+                 smb_base_fname, (unsigned int)deny_mode,
                  (unsigned int)open_func ));
 
        /* Create the NT compatible access_mask. */
@@ -1315,7 +1315,7 @@ bool map_open_params_to_ntcreate(const struct smb_filename *smb_fname,
 
                case DENY_DOS:
                        create_options |= NTCREATEX_OPTIONS_PRIVATE_DENY_DOS;
-                       if (is_executable(smb_fname->base_name)) {
+                       if (is_executable(smb_base_fname)) {
                                share_mode = FILE_SHARE_READ|FILE_SHARE_WRITE;
                        } else {
                                if (GET_OPENX_MODE(deny_mode) == DOS_OPEN_RDONLY) {
@@ -1340,7 +1340,7 @@ bool map_open_params_to_ntcreate(const struct smb_filename *smb_fname,
        DEBUG(10,("map_open_params_to_ntcreate: file %s, access_mask = 0x%x, "
                  "share_mode = 0x%x, create_disposition = 0x%x, "
                  "create_options = 0x%x\n",
-                 smb_fname_str_dbg(smb_fname),
+                 smb_base_fname,
                  (unsigned int)access_mask,
                  (unsigned int)share_mode,
                  (unsigned int)create_disposition,
index 3101e181fc89b9ac8f59a10fdd318f9ce50000b1..43cdf96c4d7b14bc92f89d4d7494b3c207a5c960 100644 (file)
@@ -1753,7 +1753,7 @@ void reply_open(struct smb_request *req)
                goto out;
        }
 
-       if (!map_open_params_to_ntcreate(smb_fname, deny_mode,
+       if (!map_open_params_to_ntcreate(smb_fname->base_name, deny_mode,
                                         OPENX_FILE_EXISTS_OPEN, &access_mask,
                                         &share_mode, &create_disposition,
                                         &create_options)) {
@@ -1926,7 +1926,8 @@ void reply_open_and_X(struct smb_request *req)
                goto out;
        }
 
-       if (!map_open_params_to_ntcreate(smb_fname, deny_mode, smb_ofun,
+       if (!map_open_params_to_ntcreate(smb_fname->base_name, deny_mode,
+                                        smb_ofun,
                                         &access_mask, &share_mode,
                                         &create_disposition,
                                         &create_options)) {
@@ -6428,7 +6429,8 @@ NTSTATUS copy_file(TALLOC_CTX *ctx,
        if (!target_is_directory && count) {
                new_create_disposition = FILE_OPEN;
        } else {
-               if (!map_open_params_to_ntcreate(smb_fname_dst_tmp, 0, ofun,
+               if (!map_open_params_to_ntcreate(smb_fname_dst_tmp->base_name,
+                                                0, ofun,
                                                 NULL, NULL,
                                                 &new_create_disposition,
                                                 NULL)) {
index 0d144213e0323f924ef1a45751489614f244b119..88ac17d81ed00179f8b005b7cceb5b6bc726bb4a 100644 (file)
@@ -1068,7 +1068,8 @@ static void call_trans2open(connection_struct *conn,
                goto out;
        }
 
-       if (!map_open_params_to_ntcreate(smb_fname, deny_mode, open_ofun,
+       if (!map_open_params_to_ntcreate(smb_fname->base_name, deny_mode,
+                                        open_ofun,
                                         &access_mask, &share_mode,
                                         &create_disposition,
                                         &create_options)) {