1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

4930 Commits

Author SHA1 Message Date
Jeremy Allison
df0e54bea3 s3: libsmb: Cleanup - namecache_store() - use common out.
Prepare for moving malloc values to talloc.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-07-16 06:52:36 +00:00
Jeremy Allison
06f0a7e911 s3: libsmb: Cleanup - namecache_store() initialize stack variables.
Preparing for common out: exit.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-07-16 06:52:36 +00:00
Jeremy Allison
67ea64d27e s3: libsmb: Cleanup - move talloc frame out of inner scope.
Make it available thoughout the function. Prepare to use
talloc for namecache_key().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-07-16 06:52:36 +00:00
Jeremy Allison
be41035127 s3: libsmb: Cleanup modern coding standards. 'True/False' -> 'true/false'.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-07-16 06:52:36 +00:00
Jeremy Allison
c7e8c3d427 s3: lib: Cleanup - make ipstr_list_make() and ipstr_list_parse() private to the only user.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-07-16 06:52:36 +00:00
Jeremy Allison
2371c45f11 s3: lib: Cleanup - nothing uses ipstr_list_free(). Remove it.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-07-16 06:52:36 +00:00
Jeremy Allison
527d7df08e s3: lib: Cleanup - all the ipstr_XXX() functions are only used in namecache.c.
Move them there. Will remove from the global namespace next.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-07-16 06:52:36 +00:00
Jeremy Allison
f59490dc2d s3: libsmb: Fix SMB2 client rename bug to a Windows server.
Fix bug where renaming to a target name of one
UCS2 character (name length 2 bytes) fails to
a Windows 10 SMB2 server.

The Windows 10 SMB2 server has a minimum length
for a SMB2_FILE_RENAME_INFORMATION buffer of
24 bytes. It returns NT_STATUS_INFO_LENGTH_MISMATCH
if the length is less. This isn't an alignment
issue as Windows client happily 2-byte align
for larget target name sizes. Also the Windows 10
SMB1 server doesn't have this restriction.

If the name length is too short, pad out with
zeros to 24 bytes.

Hard to add a test for this as we don't want to
add this silly restriction to the Samba server
as it would break all non-Windows clients.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14403

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jul  1 18:59:53 UTC 2020 on sn-devel-184
2020-07-01 18:59:53 +00:00
Volker Lendecke
9f7791a909 libsmb: Add overflow protection to symlink_reparse_buffer_marshall()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-06-15 17:59:39 +00:00
Volker Lendecke
e343773a3d libsmb: Fix a typo
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-06-10 22:20:46 +00:00
Andreas Schneider
accbd9ee1c Revert "s3:libsmb: add a cache for cli_session_creds_prepare_krb5()"
This reverts commit b458f8fbb7.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Jun 10 10:10:16 UTC 2020 on sn-devel-184
2020-06-10 10:10:15 +00:00
Stefan Metzmacher
b458f8fbb7 s3:libsmb: add a cache for cli_session_creds_prepare_krb5()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-06-09 16:02:59 +00:00
Volker Lendecke
6f1db2d19e libsmb: Remove unused cli_smb2_qfileinfo_basic()
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 Jun  4 18:36:17 UTC 2020 on sn-devel-184
2020-06-04 18:36:17 +00:00
Volker Lendecke
f619c611d5 libsmb: Use cli_qfileinfo_basic() in cli_smb2_qpathinfo2()
Last user of cli_smb2_qfileinfo_basic().

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-06-04 17:11:40 +00:00
Volker Lendecke
cedbe17c99 libsmb: Remove unused cli_smb2_getattrE()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-06-04 17:11:40 +00:00
Volker Lendecke
ba8ba8830d libsmb: Use cli_qfileinfo_basic() in cli_smb2_getatr()
This was the only remaining user of cli_smb2_getattrE(), and as
cli_qfileinfo_basic() now does all protocols, we can get rid of
cli_smb2_getattrE().

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-06-04 17:11:40 +00:00
Volker Lendecke
ee40012f6e pylibsmb: Use cli_qfileinfo_basic_send() in py_smb_filesize()
This now does all protocols asynchronously

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-06-04 17:11:40 +00:00
Volker Lendecke
34e2881b0a libsmb: Make qfileinfo_basic available for smb2 in async mode
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-06-04 17:11:40 +00:00
Volker Lendecke
068c7f4d67 libsmb: Remove unused sync version of cli_getattrE()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-06-04 17:11:39 +00:00
Volker Lendecke
29866ad7b2 libsmb: Remove cli_getattrE() fallback from cli_qfileinfo_basic() users
cli_qfileinfo_basic() now takes care of this centrally

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-06-04 17:11:39 +00:00
Volker Lendecke
1a14d8cf7e libsmb: Use SMBgetattrE in cli_qfileinfo_basic_send() if necessary
This is a behaviour change: Before this patch, independent of the actual
protocol we tried to do the trans2 getinfo call. All the remaining callers just
do a direct fallback to SMBgetattrE when that fails without even looking at the
error code. Here we deterministically decide after the negotiated protocol
which flavour to use without a fallback.

It *might* be relevant for very old embedded systems that we don't know, but if
we break something we can easily fix it.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-06-04 17:11:39 +00:00
Volker Lendecke
4d1a84b39e libsmb: Add async cli_qfileinfo_basic
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-06-04 17:11:39 +00:00
Jeremy Allison
199a7343ee s3: libsmb: cli_setatr() and async version. Don't allow attribtes > 16 bits on an old protocol send.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-06-04 17:11:39 +00:00
Jeremy Allison
7c3f3add32 s3: libsmb: cli_unlink() and async version. Don't allow attribtes > 16 bits on an old protocol send.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-06-04 17:11:39 +00:00
Jeremy Allison
2eb1a7f1e7 s3: libsmb: Change cli_unlink() and async version to take a uint32_t attribute.
Fix the callers.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-06-04 17:11:39 +00:00
Jeremy Allison
98d5efd3fd s3: libsmb: Change cli_setfileinfo_ext() and async version to take a uint32_t attr.
Fix all callers.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-06-04 17:11:38 +00:00
Jeremy Allison
39b42f04d6 s3: libsmb: Change cli_setpathinfo_ext() to take 32-bit attributes.
Fix the callers. Note the special casing of mapping (uint16)-1 -> (uint32_t)-1
in SMBC_setatr() where we can't change the ABI.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-06-04 17:11:38 +00:00
Jeremy Allison
8ad8a8f7ae s3: libsmb: Change cli_setatr() and async version to use 32-bit attributes.
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>
2020-06-04 17:11:38 +00:00
Jeremy Allison
fe3879b3c9 s3: libsmb: Make cli_list_trans() and cli_list take a 32-bit attribute.
All sub-functions take 32-bits, and all callers now are
compatible with 32-bit attributes.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-06-04 17:11:38 +00:00
Jeremy Allison
8ae2851ebc s3: libsmb: Make cli_list_old() take 32-bit attribute.
Only uses 16 on the wire. No change needed in callers.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-06-04 17:11:38 +00:00
Jeremy Allison
2d6b1ef790 s3: libsmb: Change cli_smb2_setatr() to use 32-bit attributes.
The SMB_SET_FILE_BASIC_INFO info level this uses in SMB2
sets 32-bit attributes, so don't use SSVAL, use SIVAL.

No change needed in callers as implicit casts work fine.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-06-04 17:11:38 +00:00
Jeremy Allison
83493d47a6 s3: libsmb: Change cli_qpathinfo1() and async version to return a 32-bit attribute.
Only used in torture.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-06-04 17:11:38 +00:00
Jeremy Allison
e527ccd29c s3: libsmb: Change cli_qpathinfo3() to return a 32-bit attribute.
Fix all callers.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-06-04 17:11:38 +00:00
Jeremy Allison
3849ceaa69 s3: libsmb: Change cli_qpathinfo2() and async versions to return a 32-bit attribute.
Fix all callers.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-06-04 17:11:38 +00:00
Jeremy Allison
ad5d5d94a3 s3: libsmb: Change cli_getatr() and async versions to return a 32-bit attribute.
Fix all callers.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-06-04 17:11:38 +00:00
Jeremy Allison
2f1fbb678b s3: libsmb: Rename uint16_t attr -> sattr (short attributes).
This will make it easier to add 32-bit attr value later.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-06-04 17:11:37 +00:00
Jeremy Allison
e2726bed8d s3: libsmb: Change cli_getattrE() and async versions to return a 32-bit attribute.
Fix all callers.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-06-04 17:11:37 +00:00
Jeremy Allison
b34107f98c s3: libsmb: Change cli_qfileinfo_basic() to return 32-bit attributes.
Fix all callers.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-06-04 17:11:37 +00:00
Jeremy Allison
d29884e778 s3: libsmb: Change cli_smb2_qpathinfo2() to return a 32 bit attribute.
Fix all callers. All libsmb SMB2 calls now return 32 bit attributes.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-06-04 17:11:37 +00:00
Jeremy Allison
808d873c0f s3: libsmb: Fix cli_smb2_getatr() to return a 32 bit attribute.
Fix all callers.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-06-04 17:11:37 +00:00
Jeremy Allison
9305039f5f s3: libsmb: Change cli_smb2_getattrE() to return 32 bit attributes.
Fix all callers.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-06-04 17:11:37 +00:00
Jeremy Allison
054ff63a24 s3: libsmb: Change cli_smb2_qfileinfo_basic() and all users to return a uint32_t attribute.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-06-04 17:11:37 +00:00
Jeremy Allison
6238968991 s3: libsmb: clifile.c: Rename all uint16_t *attr parameters to uint16_t *pattr.
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>
2020-06-04 17:11:37 +00:00
Jeremy Allison
60758ca42e s3: libsmb: clirap. Rename all mode/ *mode parameters to attr and pattr.
They are attributes, not unix modes.

Once they have the right name, we can start moving all uses to uint32_t.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-06-04 17:11:37 +00:00
Jeremy Allison
97fa1bc9b5 s3: libsmb: cli_smb2_qfileinfo_basic()/cli_smb2_qpathinfo2(). Rename a parameter from mode -> pattr.
Also rename attr pointers to pattr.

They are pointers to attributes.

Only parameter name changes, no logic changes.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-06-04 17:11:37 +00:00
Jeremy Allison
8db68d7417 s3: libsmb: Change size of finfo->attr to uint32_t.
That's what modern servers return.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-06-04 17:11:37 +00:00
Jeremy Allison
a5f5cbc25e s3: libsmb: SMBC_chmod_ctx(), rename mode -> attr when setting attributes.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-06-04 17:11:36 +00:00
Jeremy Allison
ab59d5b596 s3: libsmb: Internally rename to use the name attr instead of mode for attributes.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-06-04 17:11:36 +00:00
Jeremy Allison
14894dce29 s3: libsmb: Internally rename to use the name attr instead of mode for attributes.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-06-04 17:11:36 +00:00
Jeremy Allison
8db0ba666a s3: libsmb: In struct file_info rename mode -> attr.
Cleanup.  It's never been a UNIX mode, always a DOS attribute field.
Make that explicit.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-06-04 17:11:36 +00:00
Jeremy Allison
6463f2612a s3: libsmb: Info level SMB_FIND_EA_SIZE encodes attibutes as a uint16, not a uint8.
We will need this to detect FILE_ATTRIBUTE_REPARSE_POINT in a later commit.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14391

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-06-03 04:54:38 +00:00
Jeremy Allison
be52f87c37 s3: libsmb: Info level SMB_FIND_INFO_STANDARD encodes attibutes as a uint16, not a uint8.
We will need this to detect FILE_ATTRIBUTE_REPARSE_POINT in a later commit.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14391

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-06-03 04:54:38 +00:00
Jeremy Allison
5e3e6c4c0c s3: libsmb: Info level SMB_FIND_FILE_BOTH_DIRECTORY_INFO encodes attibutes as a uint32, not a uint8.
Cast to a uint16_t for now after pulling the information
as finfo->mode is currently only 16 bits.

We will need this to detect FILE_ATTRIBUTE_REPARSE_POINT in a later commit.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14391

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-06-03 04:54:38 +00:00
Jeremy Allison
3063e1601a s3: libsmb: Info level SMB2_FIND_ID_BOTH_DIRECTORY_INFO encodes attibutes as a uint32, not a uint8.
Fix the SMB2 parsing code.

Cast to a uint16_t for now after pulling the information
as finfo->mode is currently only 16 bits.

We will need this to detect FILE_ATTRIBUTE_REPARSE_POINT in a later commit.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-06-03 04:54:38 +00:00
Volker Lendecke
5c918d40bd libsmb: Use tevent_req_received() in cli_qfileinfo_recv()
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
2020-05-28 20:35:41 +00:00
Volker Lendecke
0b6debbbb0 pylibsmb: Use async cli_mkdir also for smb2
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-28 19:11:40 +00:00
Volker Lendecke
99ced4cc58 libsmb: Remove sync cli_smb2_mkdir()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-28 19:11:40 +00:00
Volker Lendecke
93675b4f96 libsmb: Use async cli_smb2_mkdir in async cli_mkdir
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>
2020-05-28 19:11:40 +00:00
Volker Lendecke
9b598a281b libsmb: Add async cli_smb2_mkdir_send()/recv()
Not converting the sync version to use it, it will go away very soon

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-28 19:11:39 +00:00
Volker Lendecke
e724c51d7f pylibsmb: Use async cli_chkpath also for smb2
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-28 19:11:39 +00:00
Volker Lendecke
44875bdad7 libsmb: Remove sync cli_smb2_chkpath()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-28 19:11:39 +00:00
Volker Lendecke
c4bf5b2381 libsmb: Use async cli_smb2_chkpath in async cli_chkpath
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>
2020-05-28 19:11:39 +00:00
Volker Lendecke
fafdb5e38c libsmb: Add async cli_smb2_chkpath_send/recv()
Not converting the sync version to use it, it will go away very soon

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-28 19:11:39 +00:00
Volker Lendecke
825948c766 pylibsmb: Use async cli_rmdir also for smb2
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-28 19:11:39 +00:00
Volker Lendecke
19bb7b0096 libsmb: Remove sync cli_smb2_rmdir()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-28 19:11:39 +00:00
Volker Lendecke
81a491dc80 libsmb: Use tevent_req_simple_finish_ntstatus() in cli_rmdir_done()
Save a few lines of code

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-28 19:11:39 +00:00
Volker Lendecke
fe1e4dc9d9 libsmb: Use async cli_smb2_rmdir in async cli_rmdir
No need to call the sync wrapper in cli_rmdir()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-28 19:11:39 +00:00
Volker Lendecke
eec64f2456 libsmb: Remove the CREATE_ACCESS_READ #define
That only confuses things

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-28 19:11:39 +00:00
Volker Lendecke
535731a291 libsmb: Reformat calls to cli_ntcreate()
The next patch will change one of the arguments

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-28 19:11:39 +00:00
Volker Lendecke
1692b8a651 pylibsmb: Use async cli_unlink also for smb2
Async cli_smb2_unlink was just added

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-28 19:11:38 +00:00
Volker Lendecke
a92a4324c7 libsmb: Remove sync cli_smb2_unlink()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-28 19:11:38 +00:00
Volker Lendecke
f8eb754561 libsmb: Use tevent_req_simple_finish_ntstatus() in cli_unlink_done()
Save a few lines of code

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-28 19:11:38 +00:00
Volker Lendecke
5c8312f8e8 libsmb: Use async cli_smb2_unlink in async cli_unlink
No need to call the sync wrapper in cli_unlink()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-28 19:11:38 +00:00
Volker Lendecke
2c6138f47d libsmb: Remove clistr_pull_talloc()
This was just a 1:1 wrapper around pull_string_talloc()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-28 19:11:38 +00:00
Volker Lendecke
3cf84f0e1f libsmb: Trim #includes
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-28 19:11:38 +00:00
Volker Lendecke
652b733337 libsmb: Remove an outdated comment
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-28 19:11:38 +00:00
Stefan Metzmacher
bae35ebcf3 s3:libsmb: remove finally unused credential flags
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu May 28 08:04:12 UTC 2020 on sn-devel-184
2020-05-28 08:04:12 +00:00
Stefan Metzmacher
0de5c488ed s3:libsmb: remove unused cli_full_connection()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2020-05-28 06:43:39 +00:00
Stefan Metzmacher
0b3e331111 s3:libsmb: remove unused cli_cm_force_encryption()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2020-05-28 06:43:39 +00:00
Stefan Metzmacher
4f3733957e s3:libsmb_server: fix error handling in SMBC_server_internal()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2020-05-28 06:43:39 +00:00
Stefan Metzmacher
4386986f43 s3:libsmb_server: make use of SMBC_auth_credentials() in SMBC_attr_server()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2020-05-28 06:43:39 +00:00
Stefan Metzmacher
cf041240f1 s3:libsmb_server: split out SMBC_auth_credentials() helper
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2020-05-28 06:43:39 +00:00
Stefan Metzmacher
ff2123d499 s3:libsmb_server: don't use auth related flags in SMBC_server_internal()
These are ignored at the lower levels if we're passing cli_credential
structures along.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2020-05-28 06:43:39 +00:00
Stefan Metzmacher
2465301226 s3:libsmb: make use of get_cmdline_auth_info_creds() in get_ipc_connect()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2020-05-28 06:43:38 +00:00
Volker Lendecke
da766db4e8 libsmb: Apply some const to parse_finfo_id_both_directory_info()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon May 25 09:36:15 UTC 2020 on sn-devel-184
2020-05-25 09:36:15 +00:00
Volker Lendecke
4487ba9c2f libsmb: Remove unused cli_errstr()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2020-05-25 08:13:28 +00:00
Volker Lendecke
3cc45aae6a libsmb: Move a variable declaration closer to its use
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2020-05-25 08:13:28 +00:00
Volker Lendecke
52d4825a4e libsmb: Remove some lines that were never used
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2020-05-25 08:13:28 +00:00
Volker Lendecke
c52a05d76f libsmb: Avoid casts
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2020-05-25 08:13:28 +00:00
Volker Lendecke
abf9d1d745 libsmb: Use IS[DOT]DOT
strequal is not necessary here

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2020-05-25 08:13:28 +00:00
Volker Lendecke
abff0c5e41 libsmb: Remove a pointless ZERO_STRUCT()
"c" is a pointer that was initialized to NULL above

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2020-05-25 08:13:28 +00:00
Volker Lendecke
4734b64e3f libsmb: Simplify callers of SMBC_dlist_contains()
This function already does the NULL check on the file pointer

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2020-05-25 08:13:27 +00:00
Volker Lendecke
20b99b03a0 libsmb: Make SMBC_dlist_contains return bool
It returned True/False, and is used as boolean only. Modernize
formatting a bit.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2020-05-25 08:13:27 +00:00
Volker Lendecke
66caa6b24d libsmb: Align calls to SMBC_dlist_contains()
Everywhere else it's called as !SMBC_dlist_contains()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2020-05-25 08:13:27 +00:00
Jeremy Allison
393da520e4 s3: libsmbclient: Finish unifing bad iconv behavior across CORE NT1 SMB2 protocols.
On bad name conversion, exit the directory listing with an error, but leave the
connection intact. We were already checking for finfo->name == NULL here,
but were ignoring it and not reporting an error.

Remove the knownfail.d/bad_iconv file as we now
behave the same across CORE/NT1/SMB2.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14374

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue May 12 21:32:44 UTC 2020 on sn-devel-184
2020-05-12 21:32:44 +00:00
Jeremy Allison
753115a8d1 s3: libsmb: In SMB2 return NT_STATUS_INVALID_NETWORK_RESPONSE if name conversion ended up with a NULL filename.
Can happen if namelen == 0.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14374

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2020-05-12 19:53:46 +00:00
Jeremy Allison
b10de0bb64 s3: libsmb: In SMB1 old protocol - return NT_STATUS_INVALID_NETWORK_RESPONSE if name conversion ended up with a NULL filename.
Can happen if namelen == 0.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14374

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2020-05-12 19:53:46 +00:00
Gary Lockyer
13a2f70a4d Fix clang 9 missing-field-initializer warnings
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
2020-05-08 09:31:31 +00:00
Volker Lendecke
f80c97cb8d libsmb: Protect cli_oem_change_password() from rprcnt<2
Bug: https://bugzilla.samba.org/show_bug.cgi?id=14362
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue May  5 17:12:04 UTC 2020 on sn-devel-184
2020-05-05 17:12:04 +00:00
Volker Lendecke
ce8b70df7b libsmb: Protect cli_RNetServerEnum against rprcnt<6
Bug: https://bugzilla.samba.org/show_bug.cgi?id=14362
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2020-05-05 15:35:35 +00:00