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

122490 Commits

Author SHA1 Message Date
Björn Baumbach
d72a512e0f pyauth: add python binding for auth_session_info_set_unix()
Bug: https://bugzilla.samba.org/show_bug.cgi?id=14400

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-06-05 10:32:31 +00:00
Björn Baumbach
bde136a280 s4-auth/unix_token: add new function auth_session_info_set_unix()
Used to fill the unix info in a struct auth_session_info similar to
auth_session_info_fill_unix().

The new auth_session_info_set_unix() receives the uid and gid for
the unix token as an parameter. It does not query the unix token from
winbind (via security_token_to_unix_token()).
This is useful to fill a user session info manually if winbind is not
available.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14400

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-06-05 10:32:31 +00:00
Björn Baumbach
d159b4c0a5 s4-auth/unix_token: separate out filling the unix_info elements in a struct session_info
Bug: https://bugzilla.samba.org/show_bug.cgi?id=14400

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-06-05 10:32:31 +00:00
Björn Baumbach
824fa5f45c python: fix slow's mail address
Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-06-05 10:32:30 +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
8a3556d0cf torture3: Fix a debug message
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
c90d3df41b net: Align integer types, move variable closer to its use
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
b56cc5bf09 net: Copy hires timestamps in net_copy_fileattr()
In this routine we're using cli_ntcreate, so I would assume the hires
timestamp calls to be available. My goal is to reduce the use of the
second-resolution calls and potentially push their fallback use into
clifile.c.

Only tested manually.

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
bc7fc08f17 torture3: Use cli_qfileinfo_basic() in run_posix_append()
Only Samba does the SMB1 posix extensions, and we do the "advanced"
trans-based call.

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
f607172e7a s3: client. Move to all 32-bit attributes in smbclient.
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
c7e3a00396 s3: torture: Add simple tests to samba3.base.attr to check INVALID_PARAMETER returned on SMB1 out-of-range attribute use.
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
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
30b3475f4a s3: Fix dfs-reparse testing code to use 32-bit attributes. Change variable names mode -> attr.
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
bac7442a6e s3: smbclient: Rename mode parameter to attr.
This is a DOS attribute, not a UNIX mode.

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