]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
printing: call vfs_stat() in driver_unlink_internals()
authorRalph Boehme <slow@samba.org>
Tue, 12 Jan 2021 11:03:02 +0000 (12:03 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 14 Jan 2021 17:55:33 +0000 (17:55 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/printing/nt_printing.c

index 47f6beba1c4c37cd43f217a8ce2c8b6b3e67ee02..ffee1d51e5fafb030f7eac18dd9142b7c4f06207 100644 (file)
@@ -2026,6 +2026,7 @@ static NTSTATUS driver_unlink_internals(connection_struct *conn,
        struct smb_filename *smb_fname = NULL;
        char *print_dlr_path;
        NTSTATUS status = NT_STATUS_NO_MEMORY;
+       int ret;
 
        print_dlr_path = talloc_asprintf(tmp_ctx, "%s/%d/%s",
                                         short_arch, vers, fname);
@@ -2043,6 +2044,12 @@ static NTSTATUS driver_unlink_internals(connection_struct *conn,
                goto err_out;
        }
 
+       ret = vfs_stat(conn, smb_fname);
+       if (ret == -1) {
+               status = map_nt_error_from_unix(errno);
+               goto err_out;
+       }
+
        status = openat_pathref_fsp(conn->cwd_fsp, smb_fname);
        if (NT_STATUS_EQUAL(status, NT_STATUS_STOPPED_ON_SYMLINK)) {
                status = NT_STATUS_OBJECT_NAME_NOT_FOUND;