summaryrefslogtreecommitdiff
path: root/source3/libsmb/clifile.c
Commit message (Collapse)AuthorAgeFilesLines
* libsmb: Simplify clistr_is_previous_version_path()Volker Lendecke2022-12-161-14/+14
| | | | | | | | | | Nobody looks at the out params anymore Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Fri Dec 16 08:42:18 UTC 2022 on sn-devel-184
* libsmb: Remove sync cli_posix_readlink() wrapperVolker Lendecke2022-12-051-42/+0
| | | | | | | cli_readlink() now covers smb1 posix extensions as well Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* libsmb: Pass symlink error up through cli_smb2_create_fnum_recv()Volker Lendecke2022-11-221-1/+2
| | | | | | | | Not passing through the sync wrapper yet. Not needed right now, and it's simple to add if required. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Fix cli_fsctl()Volker Lendecke2022-11-221-1/+1
| | | | | | | Untested code is broken code. Found while testing symlinks over SMB1. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Add cli_fsctl_send/recvVolker Lendecke2022-10-031-0/+121
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: libsmb: In cli_posix_open_internal_send() ↵Jeremy Allison2022-09-151-2/+10
| | | | | | | | | | | | (SMBtrans2:TRANSACT2_SETPATHINFO) check for DFS pathname. See smbtorture3: SMB1-DFS-PATHS: test_smb1_setpathinfo_XXXX() Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Sep 15 19:44:00 UTC 2022 on sn-devel-184
* s3: libsmb: In cli_qpathinfo_send() (SMBtrans2:TRANSACT2_QPATHINFO) check ↵Jeremy Allison2022-09-151-2/+13
| | | | | | | | | for DFS pathname. See smbtorture3: SMB1-DFS-PATHS: test_smb1_qpathinfo() Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s3: libsmb: In cli_set_ea_path() (SMBtrans2:TRANSACT2_SETPATHINFO) check for ↵Jeremy Allison2022-09-151-2/+13
| | | | | | | | | DFS pathname. See smbtorture3: SMB1-DFS-PATHS: test_smb1_setpathinfo_XXXX() Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s3: libsmb: In cli_ctemp_send() (SMBctemp) check for DFS pathname.Jeremy Allison2022-09-151-2/+13
| | | | | | | | smbtorture3: SMB1-DFS-OPERATIONS: test_smb1_ctemp() shows SMBctemp uses DFS paths. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s3: libsmb: In cli_chkpath_send() (SMBcheckpath) check for DFS pathname.Jeremy Allison2022-09-151-2/+13
| | | | | | | | smbtorture3: SMB1-DFS-OPERATIONS: test_smb1_chkpath() shows SMBcheckpath uses DFS paths. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s3: libsmb: In cli_setatr_send() (SMBsetatr) check for DFS pathname.Jeremy Allison2022-09-151-2/+13
| | | | | | | | smbtorture3: SMB1-DFS-OPERATIONS: test_smb1_setatr() shows SMBsetatr uses DFS paths. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s3: libsmb: In cli_getatr_send() (SMBgetatr) check for DFS pathname.Jeremy Allison2022-09-151-2/+13
| | | | | | | | smbtorture3: SMB1-DFS-OPERATIONS: test_smb1_getatr() shows SMBgetatr uses DFS paths. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s3: libsmb: In cli_openx_create() (SMBopenX) check for DFS pathname.Jeremy Allison2022-09-151-2/+13
| | | | | | | | smbtorture3: SMB1-DFS-OPERATIONS: test_smb1_openx() shows SMBopenX uses DFS paths. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s3: libsmb: In cli_nttrans_create_send() (SMBnttrans:NT_TRANSACT_CREATE) ↵Jeremy Allison2022-09-151-2/+12
| | | | | | | | | | check for DFS pathname. smbtorture3: SMB1-DFS-OPERATIONS: test_smb1_nttrans_create() shows SMBnttrans:NT_TRANSACT_CREATE uses DFS paths. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s3: libsmb: In cli_ntcreate1_send() (SMBntcreateX) check for DFS pathname.Jeremy Allison2022-09-151-2/+12
| | | | | | | | smbtorture3: SMB1-DFS-OPERATIONS: test_smb1_ntcreatex() shows SMBntcreateX uses DFS paths. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s3: libsmb: In cli_rmdir_send() (SMBrmdir) check for DFS pathname.Jeremy Allison2022-09-151-2/+13
| | | | | | | | smbtorture3: SMB1-DFS-OPERATIONS: test_smb1_rmdir() shows SMBrmdir uses DFS paths. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s3: libsmb: In cli_mkdir_send() (SMBmkdir) check for DFS pathname.Jeremy Allison2022-09-151-2/+13
| | | | | | | | smbtorture3: SMB1-DFS-OPERATIONS: test_smb1_mkdir() shows SMBmkdir uses DFS paths. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s3: libsmb: In cli_unlink_send() (SMBunlink) check for DFS pathname.Jeremy Allison2022-09-151-2/+13
| | | | | | | | smbtorture3: SMB1-DFS-OPERATIONS: test_smb1_unlink() shows SMBunlink uses DFS paths. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s3: libsmb: In cli_ntrename_internal_send() (SMBntrename) check for DFS dst ↵Jeremy Allison2022-09-151-14/+15
| | | | | | | | | | | | | | pathname. See smbtorture3: SMB1-DFS-PATHS: test_smb1_ntrename_rename(). and smbtorture3: SMB1-DFS-PATHS: test_smb1_ntrename_hardlink(). Remove the old code that stripped a DFS name from the destination filename, and go through smb1_dfs_share_path() as we did for fname_src in the last commit. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s3: libsmb: In cli_ntrename_internal_send() (SMBntrename) check for DFS ↵Jeremy Allison2022-09-151-2/+14
| | | | | | | | | | source pathname. smbtorture3: SMB1-DFS-PATHS: test_smb1_ntrename_rename() shows SMBntrename uses DFS for src and dst. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s3: libsmb: In cli_cifs_rename_send() (SMBmv) check for DFS dst pathname.Jeremy Allison2022-09-151-14/+15
| | | | | | | | | | | See smbtorture3: SMB1-DFS-PATHS: test_smb1_mv(). Remove the old code that stripped a DFS name from the destination filename, and go through smb1_dfs_share_path() as we did for fname_src in the last commit. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s3: libsmb: In cli_cifs_rename_send() (SMBmv) check for DFS source pathname.Jeremy Allison2022-09-151-2/+16
| | | | | | | | smbtorture3: SMB1-DFS-PATHS: test_smb1_mv() shows SMBmv uses DFS for src and dst. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s3: libsmb: Make cli_setpathinfo_send() (SMBtrans2: TRANSACT2_SETPATHINFO) ↵Jeremy Allison2022-09-151-2/+11
| | | | | | | | | DFS path aware. See smbtorture3: SMB1-DFS-PATHS: test_smb1_setpathinfo_XXXX() Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s3: libsmb: Cleanup - remove unused fname_src parameter from ↵Jeremy Allison2022-09-151-4/+0
| | | | | | | cli_dfs_target_check(). Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s3: libsmb: Add missing memory allocation fail check in cli_openx_create().Jeremy Allison2022-09-151-0/+3
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s3: libsmb: Add missing memory allocation fail checks in cli_ntcreate1_send().Jeremy Allison2022-09-151-0/+6
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* libsmb: Add tevent_req_received() to cli_posix_readlink_recv()Volker Lendecke2022-08-261-0/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: libsmb: Call cli_dfs_target_check() from cli_cifs_rename_send().Jeremy Allison2022-02-041-0/+13
| | | | | | | | | Strips off any DFS prefix from the target if passed in. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14169 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s3: libsmb: Call cli_dfs_target_check() from cli_smb1_rename_send().Jeremy Allison2022-02-041-0/+12
| | | | | | | | | Strips off any DFS prefix from the target if passed in. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14169 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s3: libsmb: Call cli_dfs_target_check() from cli_ntrename_internal_send().Jeremy Allison2022-02-041-0/+13
| | | | | | | | | | Currently we don't pass MSDFS names as targets here, but a caller may erroneously do this later, and for non-DFS names this is a no-op. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14169 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* s3: libsmb: Call cli_dfs_target_check() from cli_smb2_hardlink_send().Jeremy Allison2022-02-041-0/+14
| | | | | | | | | | Currently we don't pass MSDFS names as targets here, but a caller may erroneously do this later, and for non-DFS names this is a no-op. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14169 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* lib: libsmbclient: Ensure cli_rename() always sets cli->raw_status.Jeremy Allison2022-02-021-0/+1
| | | | | | | | | | | | | | | | Identical change as used in cli_unlink(), cli_mkdir(), cli_rmdir() cli_chkpath() to ensure SMB2 calls correctly set raw_status for libsmbclient uses. Remove knownfail. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14938 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Feb 2 21:50:31 UTC 2022 on sn-devel-184
* libsmb: Remove "trans_oob()" macroVolker Lendecke2021-11-111-1/+1
| | | | | | | It was just a 1:1 substitution for smb_buffer_oob() Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Use cli_ntcreate in cli_chkpathVolker Lendecke2021-11-111-9/+42
| | | | | | | cli_ntcreate handles smb2, thus remove cli_smb2_chkpath. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Make cli_rename_send()/recv() smb2-capableVolker Lendecke2020-11-161-4/+17
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Make cli_rename_send()/_recv() a proper tevent_req engineVolker Lendecke2020-11-161-38/+64
| | | | | | | This will make it more obvious to add SMB2 soon Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Use a direct struct initialization to avoid a memsetVolker Lendecke2020-10-211-2/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Remove unused sync version of cli_getattrE()Volker Lendecke2020-06-041-61/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: libsmb: cli_setatr() and async version. Don't allow attribtes > 16 bits ↵Jeremy Allison2020-06-041-0/+10
| | | | | | | on an old protocol send. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3: libsmb: cli_unlink() and async version. Don't allow attribtes > 16 bits ↵Jeremy Allison2020-06-041-0/+10
| | | | | | | on an old protocol send. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3: libsmb: Change cli_unlink() and async version to take a uint32_t attribute.Jeremy Allison2020-06-041-2/+2
| | | | | | | Fix the callers. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3: libsmb: Change cli_setatr() and async version to use 32-bit attributes.Jeremy Allison2020-06-041-2/+2
| | | | | | | Fix the callers. Only sets 16 bits on the wire for this level. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3: libsmb: Change cli_getatr() and async versions to return a 32-bit attribute.Jeremy Allison2020-06-041-13/+5
| | | | | | | Fix all callers. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3: libsmb: Change cli_getattrE() and async versions to return a 32-bit ↵Jeremy Allison2020-06-041-13/+5
| | | | | | | | | attribute. Fix all callers. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3: libsmb: Fix cli_smb2_getatr() to return a 32 bit attribute.Jeremy Allison2020-06-041-2/+10
| | | | | | | Fix all callers. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3: libsmb: Change cli_smb2_getattrE() to return 32 bit attributes.Jeremy Allison2020-06-041-2/+10
| | | | | | | Fix all callers. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3: libsmb: clifile.c: Rename all uint16_t *attr parameters to uint16_t *pattr.Jeremy Allison2020-06-041-12/+12
| | | | | | | | | Will make it easier to move to 32 bit attributes later. No logic changes, just a rename. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* libsmb: Use tevent_req_received() in cli_qfileinfo_recv()Volker Lendecke2020-05-281-2/+2
| | | | | | | | | | That takes care of doing the early talloc_free(state) Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu May 28 20:35:41 UTC 2020 on sn-devel-184
* libsmb: Use async cli_smb2_mkdir in async cli_mkdirVolker Lendecke2020-05-281-4/+17
| | | | | | | No need to call the sync wrapper in cli_mkdir() Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Use async cli_smb2_chkpath in async cli_chkpathVolker Lendecke2020-05-281-4/+17
| | | | | | | No need to call the sync wrapper in cli_chkpath() Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>