]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: VFS: error_inject. parent_smb_fname() -> SMB_VFS_PARENT_PATHNAME().
authorJeremy Allison <jra@samba.org>
Wed, 26 May 2021 18:03:25 +0000 (11:03 -0700)
committerRalph Boehme <slow@samba.org>
Wed, 2 Jun 2021 05:39:30 +0000 (05:39 +0000)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/modules/vfs_error_inject.c

index 31257cc1d00ba1ef0dbb834e870e342854e0b758..dca8783edafcaeea55f8cd49006e784685e753ef 100644 (file)
@@ -133,7 +133,7 @@ static int vfs_error_inject_unlinkat(struct vfs_handle_struct *handle,
        struct smb_filename *parent_fname = NULL;
        int error = inject_unix_error("unlinkat", handle);
        int ret;
-       bool ok;
+       NTSTATUS status;
 
        if (error == 0) {
                return SMB_VFS_NEXT_UNLINKAT(handle, dirfsp, smb_fname, flags);
@@ -146,9 +146,14 @@ static int vfs_error_inject_unlinkat(struct vfs_handle_struct *handle,
                return -1;
        }
 
-       ok = parent_smb_fname(full_fname, full_fname, &parent_fname, NULL);
-       if (!ok) {
+       status = SMB_VFS_PARENT_PATHNAME(handle->conn,
+                                        full_fname, /* TALLOC_CTX. */
+                                        full_fname,
+                                        &parent_fname,
+                                        NULL);
+       if (!NT_STATUS_IS_OK(status)) {
                TALLOC_FREE(full_fname);
+               errno = map_errno_from_nt_status(status);
                return -1;
        }