Skip to content

The parameter connection_cache is missing because kwargs was not passed. #330

@D-KeyChen

Description

@D-KeyChen

I passed the connection_cache parameter when calling copy2, but received the error [NtStatus 0xc0000022] Unknown NtStatus error returned 'STATUS_ACCESS_DENIED'.

Upon examining the source code, it was noted that after copy2 calls _copy, the kwargs parameter is not passed when copyfile is called.
Is the **kwargs parameter missing in line L455-L456?

def _copy(src, dst, follow_symlinks, copy_meta_func, **kwargs):
# Need to check if dst is a UNC path before checking if it's a dir in smbclient.path before checking to see if it's
# a local directory. If either one is a dir, join the filename of src onto dst.
if (is_remote_path(ntpath.normpath(dst)) and isdir(dst, **kwargs)) or os.path.isdir(dst):
dst = _join_local_or_remote_path(dst, _basename(src))
copyfile(src, dst, follow_symlinks=follow_symlinks)
copy_meta_func(src, dst, follow_symlinks=follow_symlinks)
return dst

Sorry, English is not my primary language; the above content was generated by Google Translate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions