]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
printing: Remove a few obsolete openat_pathref_fsp() calls
authorVolker Lendecke <vl@samba.org>
Wed, 4 Dec 2024 15:30:03 +0000 (16:30 +0100)
committerVolker Lendecke <vl@samba.org>
Tue, 17 Dec 2024 12:30:31 +0000 (12:30 +0000)
driver_convert_unix calls filename_convert_dirfsp, which these days
fills smb_fname->fsp. So openat_pathref_fsp() will immediately return
success as it finds smb_fname->fsp != NULL.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
source3/printing/nt_printing.c

index 7907fb4b22969aec32a606ef5c0dbbbb1fd86718..14a1e496c04a8aded23cd637d8e91bb55b1e3fbc 100644 (file)
@@ -829,12 +829,6 @@ static int file_version_is_newer(connection_struct *conn, fstring new_file, fstr
                goto error_exit;
        }
 
-       status = openat_pathref_fsp(conn->cwd_fsp, smb_fname);
-       if (!NT_STATUS_IS_OK(status)) {
-               ret = 1;
-               goto done;
-       }
-
        status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                NULL,                                   /* req */
@@ -891,13 +885,6 @@ static int file_version_is_newer(connection_struct *conn, fstring new_file, fstr
                goto error_exit;
        }
 
-       status = openat_pathref_fsp(conn->cwd_fsp, smb_fname);
-       if (!NT_STATUS_IS_OK(status)) {
-               DBG_NOTICE("Can't open new file [%s], errno = %d\n",
-                          smb_fname_str_dbg(smb_fname), errno);
-               goto error_exit;
-       }
-
        status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                NULL,                                   /* req */
@@ -1110,15 +1097,6 @@ static uint32_t get_correct_cversion(const struct auth_session_info *session_inf
                goto error_exit;
        }
 
-       nt_status = openat_pathref_fsp(conn->cwd_fsp, smb_fname);
-       if (!NT_STATUS_IS_OK(nt_status)) {
-               DBG_NOTICE("Can't open file [%s]: %s\n",
-                          smb_fname_str_dbg(smb_fname),
-                          nt_errstr(nt_status));
-               *perr = WERR_ACCESS_DENIED;
-               goto error_exit;
-       }
-
        nt_status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                NULL,                                   /* req */