1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00
Commit Graph

122519 Commits

Author SHA1 Message Date
Volker Lendecke
a2243f7506 smbclient: Simplify do_list_helper()
Do an early return when we don't want to recurse

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-06-10 22:20:46 +00:00
Volker Lendecke
a10dbe1745 smbclient: Slightly simplify do_list()
Nonrecursive listing is just a special case of recursive
listing. do_list_helper() checks that.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-06-10 22:20:46 +00:00
Volker Lendecke
d71564e07f smbclient: Do early return in do_list_helper().
Align integer types.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-06-10 22:20:46 +00:00
Volker Lendecke
9081138a22 smbclient: Align integer types
gcc complained that the if-condition compared unsigned rb_size with a
signed value. Somehow through the arithmetic the uint16_t's got
promoted to integer.

Also, avoid some printf casts

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-06-10 22:20:46 +00:00
Volker Lendecke
675bb46ab2 smbclient: Align some integer types
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-06-10 22:20:46 +00:00
Volker Lendecke
0221337a6b vfs: Fix typos
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-06-10 22:20:46 +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
Volker Lendecke
fd60ab270c registry3: 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
David Disseldorp
787092b50a s3/torture: test rbtree TDB_INSERT and TDB_MODIFY flags
Confirm that record overwrite with TDB_INSERT and record insert with
TDB_MODIFY both fail with appropriate error values.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jun 10 20:28:45 UTC 2020 on sn-devel-184
2020-06-10 20:28:45 +00:00
David Disseldorp
00a0da0503 s3/torture: use stack buffer for rbtree loop
Using the stack here simplifies the error paths.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-06-10 19:08:40 +00:00
David Disseldorp
c5b10466c3 dbwrap_rbt: support TDB_INSERT and TDB_MODIFY store flags
These flags provide insert-new and overwrite-existing record semantics
respectively.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-06-10 19:08:40 +00:00
Anoop C S
f501881a1c vfs_default: Remove an unused data member
This was added as part of 7f7ce0ec2f but
never got consumed.

Signed-off-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-06-10 19:08:40 +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
Andrew Bartlett
0208d5f64b Add docs build to CI
We did not check we could actually build the HTML of the
Samba Developers guide and HTML of the manpages previously.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Jun 10 07:11:59 UTC 2020 on sn-devel-184
2020-06-10 07:11:59 +00:00
Andrew Bartlett
4a3ed0d845 docs-xml: Remove GNU TexInfo build
This does not build and is not a common or required format for
documentation any more.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2020-06-10 05:44:37 +00:00
Andrew Bartlett
9392c3f81c docs-xml: Remove references to inkscape (not used any more, no more SVG files)
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2020-06-10 05:44:37 +00:00
Andrew Bartlett
ccb606c469 docs-xml: Remove final references to Samba3-HOWTO and Samba3-ByExample
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2020-06-10 05:44:37 +00:00
Andrew Bartlett
cedd00fdff docs-xml: Remove references to building docs using Plucker
This was for Palm OS based handheld devices, Windows Mobile devices, and other PDAs...

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2020-06-10 05:44:37 +00:00
Andrew Bartlett
158cea3ba8 Remove "undocumented" target mentioned in configure script
This was left over from 12aed897ec

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2020-06-10 05:44:37 +00:00
Martin Schwenke
ddac6b2eb4 util: Reallocate larger buffer if getpwuid_r() returns ERANGE
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Tue Jun  9 21:07:24 UTC 2020 on sn-devel-184
2020-06-09 21:07:24 +00:00
Martin Schwenke
847208cd8a util: Fix build on FreeBSD by avoiding NSS_BUFLEN_PASSWD
NSS_BUFLEN_PASSWD is not defined on FreeBSD.  Use
sysconf(_SC_GETPW_R_SIZE_MAX) instead, as per POSIX.

Use a dynamically allocated buffer instead of trying to cram all of
the logic into the declarations.  This will come in useful later
anyway.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-06-09 19:46:37 +00:00
Martin Schwenke
922bce2668 util: Simplify input validation
It appears that snprintf(3) is being used for input validation.
However, this seems like overkill because it causes szPath to be
copied an extra time.  The mostly likely protections being sought
here, according to https://cwe.mitre.org/data/definitions/20.html,
look to be DoS attacks involving CPU and memory usage.  A simpler
check that uses strnlen(3) can mitigate against both of these and is
simpler.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-06-09 19:46:37 +00:00
Stefan Metzmacher
7e36b1ec2e s3:libads: remove unused "GSSAPI" support
All AD servers support "GSS-SPNEGO". So we better
remove code that doesn't use gensec.

If we ever need this back we could use the
"gssapi_krb5_sasl" gensec module explicit
or just pass the SASL mech list to gensec.

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

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Jun  9 17:24:31 UTC 2020 on sn-devel-184
2020-06-09 17:24:30 +00:00
Andreas Schneider
9e922b75d0 talloc: Mark ptr of talloc_unlink() not as a tainted scalar
This should address a lot of issues reported by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2020-06-09 16:02:59 +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
Stefan Metzmacher
05e1417396 s4:torture:smb2: use delete-on-close in test_rw_invalid()
We test the limits here and leave a 16TB file with zeros.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Jun  5 13:17:55 UTC 2020 on sn-devel-184
2020-06-05 13:17:55 +00:00
Björn Baumbach
72d69eef13 pysmbd: make sure that session unix info is filled
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>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Jun  5 11:54:06 UTC 2020 on sn-devel-184
2020-06-05 11:54:06 +00:00
Björn Baumbach
26fd73de7b tests/pysmbd: fill session unix info in ntacl tests
Valid unix info is required.

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
efea16f367 python/samba/provision: set unix session info for user session, used for sysvol acl reset
The unix session info is required and expected by e.g. many vfs
modules. Missing unix session info leads to samba panic.

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
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