vlendec/samba-autobuild/.git
3 years agolib: Move a #define ip_equal_v4() to nmbd/nmbd.h
Volker Lendecke [Thu, 11 Jun 2020 12:48:48 +0000 (14:48 +0200)]
lib: Move a #define ip_equal_v4() to nmbd/nmbd.h

It's only used there

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: Fix typos
Volker Lendecke [Sat, 13 Jun 2020 13:32:31 +0000 (15:32 +0200)]
smbd: Fix typos

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agotsocket: Fix a typo
Volker Lendecke [Sun, 14 Jun 2020 14:36:23 +0000 (16:36 +0200)]
tsocket: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agonet: Align integer types
Volker Lendecke [Sun, 14 Jun 2020 08:45:39 +0000 (10:45 +0200)]
net: Align integer types

"i" is used to loop over an int as well. Introduce an int helper
variable that is autoconverted without warnings

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agoreplmd: slightly clarify a comment
Douglas Bagnall [Thu, 23 Apr 2020 03:37:53 +0000 (15:37 +1200)]
replmd: slightly clarify a comment

it has been a long time since we introduced "control", so lets remind
ourselves which control it was.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sat Jun 13 06:50:12 UTC 2020 on sn-devel-184

3 years agodsdb/mod/acl_util: do not deref NULL sd_flags control
Douglas Bagnall [Thu, 23 Apr 2020 03:31:13 +0000 (15:31 +1200)]
dsdb/mod/acl_util: do not deref NULL sd_flags control

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agoldb commandline: don't crash if a received control contains no data
Douglas Bagnall [Wed, 22 Apr 2020 22:57:24 +0000 (10:57 +1200)]
ldb commandline: don't crash if a received control contains no data

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agoldb/controls: avoid stealing our own stuff
Douglas Bagnall [Wed, 22 Apr 2020 22:32:17 +0000 (10:32 +1200)]
ldb/controls: avoid stealing our own stuff

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agoldb/mod/paged_searches: cope with NULL control data
Douglas Bagnall [Wed, 22 Apr 2020 22:31:39 +0000 (10:31 +1200)]
ldb/mod/paged_searches: cope with NULL control data

We won't get NULL data over ldap, but it can be set via 'local_oid:'.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopython: do not always import socket_server
Douglas Bagnall [Mon, 25 May 2020 23:33:42 +0000 (11:33 +1200)]
python: do not always import socket_server

This cost around 10ms for every Python script, and was only used in one
test.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopython: do not always import urllib
Douglas Bagnall [Mon, 25 May 2020 23:31:16 +0000 (11:31 +1200)]
python: do not always import urllib

Only provision.py wants a function from urllib, but we were importing
it in samba.compat, which is imported by samba, mening that every
python script importing anything from samba took 40ms longer to start
up.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agodoc: Add markup to README.Coding for samba wiki links
David Mulder [Fri, 12 Jun 2020 21:15:04 +0000 (15:15 -0600)]
doc: Add markup to README.Coding for samba wiki links

Adding markup to the README.Coding allows us to
link to sections of the document from the samba
wiki and prevents documentation duplication.

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jun 12 23:32:30 UTC 2020 on sn-devel-184

3 years agodocs: protocolfreedom.org is no longer
Andrew Bartlett [Wed, 3 Jun 2020 04:18:36 +0000 (16:18 +1200)]
docs: protocolfreedom.org is no longer

It is just a random spam site now

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agoRemove outdated install_with_python.sh
Andrew Bartlett [Wed, 3 Jun 2020 04:16:49 +0000 (16:16 +1200)]
Remove outdated install_with_python.sh

This was a cludge to help get past the need for Python on
the Samba build farm in particular.  We now need Python3
by default so clearly this has not been used in quite some
time so is safe to remove.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agodocs: Point to wiki Contribute page rather than samba-technical
Andrew Bartlett [Wed, 3 Jun 2020 04:10:50 +0000 (16:10 +1200)]
docs: Point to wiki Contribute page rather than samba-technical

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agobuild: Put the note from the bottom of the old BUILD_SYSTEMS.txt somewhere useful
Andrew Bartlett [Wed, 3 Jun 2020 04:06:34 +0000 (16:06 +1200)]
build: Put the note from the bottom of the old BUILD_SYSTEMS.txt somewhere useful

This statement on how we handle --with options is best placed near where
the options are set, so developers see it when trying to choose the
correct thing to do.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agodocs: Remove the statement about why we moved to Waf
Andrew Bartlett [Wed, 3 Jun 2020 03:51:48 +0000 (15:51 +1200)]
docs: Remove the statement about why we moved to Waf

This is not important for new users or developers, and has little useful information

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agoUpdate README.md with more up to date information
Andrew Bartlett [Wed, 3 Jun 2020 03:50:28 +0000 (15:50 +1200)]
Update README.md with more up to date information

In particular, point to the new Contribute page on the wiki

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agoUpdate README.contributing to point to new Contributing wiki page
Andrew Bartlett [Wed, 3 Jun 2020 03:43:28 +0000 (15:43 +1200)]
Update README.contributing to point to new Contributing wiki page

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agodb-glue.c: set forwardable flag on cross-realm tgt tickets
Isaac Boukris [Tue, 14 Jan 2020 12:16:02 +0000 (13:16 +0100)]
db-glue.c: set forwardable flag on cross-realm tgt tickets

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

Match Windows behavior and allow the forwardable flag to be
set in cross-realm tickets. We used to allow forwardable to
any server, but now that we apply disallow-forwardable policy
in heimdal we need to explicitly allow in the corss-realm case
(and remove the workaround we have for it the MIT plugin).

Signed-off-by: Isaac Boukris <iboukris@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Jun 12 22:10:34 UTC 2020 on sn-devel-184

3 years agoselftest: test forwardable flag in cross-realm with s4u2proxy
Isaac Boukris [Sat, 9 May 2020 14:26:45 +0000 (16:26 +0200)]
selftest: test forwardable flag in cross-realm with s4u2proxy

Signed-off-by: Isaac Boukris <iboukris@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agoselftest: test forwardable flag in cross-realm tgt tickets
Isaac Boukris [Wed, 6 May 2020 13:54:55 +0000 (15:54 +0200)]
selftest: test forwardable flag in cross-realm tgt tickets

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

Signed-off-by: Isaac Boukris <iboukris@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agoselftest: allow EncASRepPart to be encoded as EncTGSRepPart
Isaac Boukris [Wed, 6 May 2020 23:25:36 +0000 (01:25 +0200)]
selftest: allow EncASRepPart to be encoded as EncTGSRepPart

that's how MIT kdc encodes it, clients accept both.

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

Signed-off-by: Isaac Boukris <iboukris@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agoheimdal: apply disallow-forwardable on server in TGS request
Isaac Boukris [Mon, 13 Jan 2020 22:42:54 +0000 (23:42 +0100)]
heimdal: apply disallow-forwardable on server in TGS request

upstream commit: 839b073facd2aecda6740224d73e560bc79965dc

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

Signed-off-by: Isaac Boukris <iboukris@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agoselftest: add test for disallowed-forwardable server
Isaac Boukris [Sun, 19 Jan 2020 15:24:24 +0000 (16:24 +0100)]
selftest: add test for disallowed-forwardable server

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

Signed-off-by: Isaac Boukris <iboukris@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool dns query --help: Someone forgot 'PTR' from the list of record types
Rowland Penny [Fri, 5 Jun 2020 06:56:21 +0000 (07:56 +0100)]
samba-tool dns query --help: Someone forgot 'PTR' from the list of record types

Signed-off-by: Rowland Penny <rpenny@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jun 11 04:37:37 UTC 2020 on sn-devel-184

3 years agokdc: allow checksum of PA-FOR-USER to be HMAC_MD5
Isaac Boukris [Mon, 12 Nov 2018 10:26:25 +0000 (12:26 +0200)]
kdc: allow checksum of PA-FOR-USER to be HMAC_MD5

even if the tgt session key uses different hmac.

Per [MS-SFU] 2.2.1 PA-FOR-USER the checksum is
always HMAC_MD5, and that's what windows 7 client
and MIT client send.

In heimdal both the client and kdc use the checksum of
the tgt key instead and therefore work with each other
but windows and MIT clients fail against heimdal KDC.

Windows KDC allows either checksum (HMAC_MD5 or from
tgt) so we should do the same to support all clients.

Signed-off-by: Isaac Boukris <iboukris@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Jun 11 02:48:58 UTC 2020 on sn-devel-184

3 years agos3-libads: use ldap_init_fd() to initialize a ldap session if possible
Björn Baumbach [Wed, 3 Jun 2020 17:40:59 +0000 (19:40 +0200)]
s3-libads: use ldap_init_fd() to initialize a ldap session if possible

Use the known ip address of the ldap server to open the connection and
initialize the ldap session with ldap_init_fd().

This avoid unnecessary DNS lookups which might block or prevent the
successful connection.

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

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosmbclient: Simplify do_list()
Volker Lendecke [Fri, 5 Jun 2020 13:09:44 +0000 (15:09 +0200)]
smbclient: Simplify do_list()

With the DLIST-based work queue we don't need to protect the "list
head" from reallocation anymore

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): Wed Jun 10 23:43:04 UTC 2020 on sn-devel-184

3 years agosmbclient: Simplify the queue for recursive listing
Volker Lendecke [Fri, 5 Jun 2020 05:57:36 +0000 (07:57 +0200)]
smbclient: Simplify the queue for recursive listing

We now have talloc and the DLIST macros. That simplifies things a bit.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbclient: Simplify do_list_helper()
Volker Lendecke [Fri, 5 Jun 2020 13:07:08 +0000 (15:07 +0200)]
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>
3 years agosmbclient: Slightly simplify do_list()
Volker Lendecke [Fri, 5 Jun 2020 05:58:35 +0000 (07:58 +0200)]
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>
3 years agosmbclient: Do early return in do_list_helper().
Volker Lendecke [Fri, 5 Jun 2020 12:54:22 +0000 (14:54 +0200)]
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>
3 years agosmbclient: Align integer types
Volker Lendecke [Fri, 5 Jun 2020 12:04:08 +0000 (14:04 +0200)]
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>
3 years agosmbclient: Align some integer types
Volker Lendecke [Fri, 5 Jun 2020 05:56:27 +0000 (07:56 +0200)]
smbclient: Align some integer types

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agovfs: Fix typos
Volker Lendecke [Wed, 27 May 2020 13:31:07 +0000 (15:31 +0200)]
vfs: Fix typos

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibsmb: Fix a typo
Volker Lendecke [Thu, 4 Jun 2020 14:15:56 +0000 (16:15 +0200)]
libsmb: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agoregistry3: Fix a typo
Volker Lendecke [Thu, 28 May 2020 09:36:14 +0000 (11:36 +0200)]
registry3: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3/torture: test rbtree TDB_INSERT and TDB_MODIFY flags
David Disseldorp [Tue, 9 Jun 2020 16:21:11 +0000 (18:21 +0200)]
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

3 years agos3/torture: use stack buffer for rbtree loop
David Disseldorp [Tue, 9 Jun 2020 13:52:29 +0000 (15:52 +0200)]
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>
3 years agodbwrap_rbt: support TDB_INSERT and TDB_MODIFY store flags
David Disseldorp [Tue, 9 Jun 2020 13:46:51 +0000 (15:46 +0200)]
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>
3 years agovfs_default: Remove an unused data member
Anoop C S [Sat, 30 May 2020 12:21:20 +0000 (17:51 +0530)]
vfs_default: Remove an unused data member

This was added as part of 7f7ce0ec2f3e3cfb46314e5ad3ea6b5c49085f1d 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>
3 years agoRevert "s3:libsmb: add a cache for cli_session_creds_prepare_krb5()"
Andreas Schneider [Wed, 10 Jun 2020 07:47:51 +0000 (09:47 +0200)]
Revert "s3:libsmb: add a cache for cli_session_creds_prepare_krb5()"

This reverts commit b458f8fbb7febf3584fa648128b4e1dc764059f7.

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

3 years agoAdd docs build to CI
Andrew Bartlett [Wed, 3 Jun 2020 00:33:50 +0000 (12:33 +1200)]
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

3 years agodocs-xml: Remove GNU TexInfo build
Andrew Bartlett [Wed, 3 Jun 2020 00:21:50 +0000 (12:21 +1200)]
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>
3 years agodocs-xml: Remove references to inkscape (not used any more, no more SVG files)
Andrew Bartlett [Wed, 3 Jun 2020 00:14:38 +0000 (12:14 +1200)]
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>
3 years agodocs-xml: Remove final references to Samba3-HOWTO and Samba3-ByExample
Andrew Bartlett [Wed, 3 Jun 2020 00:09:33 +0000 (12:09 +1200)]
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>
3 years agodocs-xml: Remove references to building docs using Plucker
Andrew Bartlett [Wed, 3 Jun 2020 00:08:01 +0000 (12:08 +1200)]
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>
3 years agoRemove "undocumented" target mentioned in configure script
Andrew Bartlett [Tue, 2 Jun 2020 23:55:45 +0000 (11:55 +1200)]
Remove "undocumented" target mentioned in configure script

This was left over from 12aed897ec688d5bc379690208e8b85158b8227f

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
3 years agoutil: Reallocate larger buffer if getpwuid_r() returns ERANGE
Martin Schwenke [Fri, 5 Jun 2020 12:05:42 +0000 (22:05 +1000)]
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

3 years agoutil: Fix build on FreeBSD by avoiding NSS_BUFLEN_PASSWD
Martin Schwenke [Fri, 5 Jun 2020 11:52:23 +0000 (21:52 +1000)]
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>
3 years agoutil: Simplify input validation
Martin Schwenke [Tue, 9 Jun 2020 01:52:50 +0000 (11:52 +1000)]
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>
3 years agos3:libads: remove unused "GSSAPI" support
Stefan Metzmacher [Fri, 8 Nov 2019 11:22:53 +0000 (12:22 +0100)]
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

3 years agotalloc: Mark ptr of talloc_unlink() not as a tainted scalar
Andreas Schneider [Tue, 9 Jun 2020 15:00:24 +0000 (17:00 +0200)]
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>
3 years agos3:libsmb: add a cache for cli_session_creds_prepare_krb5()
Stefan Metzmacher [Wed, 7 Aug 2019 10:11:58 +0000 (12:11 +0200)]
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>
3 years agos4:torture:smb2: use delete-on-close in test_rw_invalid()
Stefan Metzmacher [Tue, 2 Jun 2020 11:52:23 +0000 (13:52 +0200)]
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

3 years agopysmbd: make sure that session unix info is filled
Björn Baumbach [Tue, 2 Jun 2020 13:33:36 +0000 (15:33 +0200)]
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

3 years agotests/pysmbd: fill session unix info in ntacl tests
Björn Baumbach [Thu, 4 Jun 2020 11:51:30 +0000 (13:51 +0200)]
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>
3 years agopython/samba/provision: set unix session info for user session, used for sysvol acl...
Björn Baumbach [Thu, 4 Jun 2020 14:02:24 +0000 (16:02 +0200)]
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>
3 years agopyauth: add python binding for auth_session_info_set_unix()
Björn Baumbach [Thu, 4 Jun 2020 14:00:04 +0000 (16:00 +0200)]
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>
3 years agos4-auth/unix_token: add new function auth_session_info_set_unix()
Björn Baumbach [Thu, 4 Jun 2020 13:41:34 +0000 (15:41 +0200)]
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>
3 years agos4-auth/unix_token: separate out filling the unix_info elements in a struct session_info
Björn Baumbach [Thu, 4 Jun 2020 13:39:02 +0000 (15:39 +0200)]
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>
3 years agopython: fix slow's mail address
Björn Baumbach [Fri, 29 May 2020 14:05:10 +0000 (16:05 +0200)]
python: fix slow's mail address

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agolibsmb: Remove unused cli_smb2_qfileinfo_basic()
Volker Lendecke [Thu, 4 Jun 2020 13:29:48 +0000 (15:29 +0200)]
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

3 years agolibsmb: Use cli_qfileinfo_basic() in cli_smb2_qpathinfo2()
Volker Lendecke [Thu, 4 Jun 2020 13:26:31 +0000 (15:26 +0200)]
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>
3 years agotorture3: Fix a debug message
Volker Lendecke [Thu, 4 Jun 2020 13:25:14 +0000 (15:25 +0200)]
torture3: Fix a debug message

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibsmb: Remove unused cli_smb2_getattrE()
Volker Lendecke [Thu, 4 Jun 2020 13:23:45 +0000 (15:23 +0200)]
libsmb: Remove unused cli_smb2_getattrE()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibsmb: Use cli_qfileinfo_basic() in cli_smb2_getatr()
Volker Lendecke [Thu, 4 Jun 2020 13:22:04 +0000 (15:22 +0200)]
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>
3 years agopylibsmb: Use cli_qfileinfo_basic_send() in py_smb_filesize()
Volker Lendecke [Thu, 4 Jun 2020 13:16:26 +0000 (15:16 +0200)]
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>
3 years agolibsmb: Make qfileinfo_basic available for smb2 in async mode
Volker Lendecke [Thu, 4 Jun 2020 13:11:24 +0000 (15:11 +0200)]
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>
3 years agolibsmb: Remove unused sync version of cli_getattrE()
Volker Lendecke [Thu, 4 Jun 2020 06:45:37 +0000 (08:45 +0200)]
libsmb: Remove unused sync version of cli_getattrE()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibsmb: Remove cli_getattrE() fallback from cli_qfileinfo_basic() users
Volker Lendecke [Thu, 4 Jun 2020 06:43:49 +0000 (08:43 +0200)]
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>
3 years agolibsmb: Use SMBgetattrE in cli_qfileinfo_basic_send() if necessary
Volker Lendecke [Thu, 4 Jun 2020 06:38:31 +0000 (08:38 +0200)]
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>
3 years agonet: Align integer types, move variable closer to its use
Volker Lendecke [Tue, 2 Jun 2020 13:44:12 +0000 (15:44 +0200)]
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>
3 years agonet: Copy hires timestamps in net_copy_fileattr()
Volker Lendecke [Wed, 3 Jun 2020 15:56:53 +0000 (17:56 +0200)]
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>
3 years agotorture3: Use cli_qfileinfo_basic() in run_posix_append()
Volker Lendecke [Thu, 28 May 2020 16:56:22 +0000 (18:56 +0200)]
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>
3 years agolibsmb: Add async cli_qfileinfo_basic
Volker Lendecke [Thu, 28 May 2020 16:24:17 +0000 (18:24 +0200)]
libsmb: Add async cli_qfileinfo_basic

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3: client. Move to all 32-bit attributes in smbclient.
Jeremy Allison [Wed, 3 Jun 2020 21:25:50 +0000 (14:25 -0700)]
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>
3 years agos3: torture: Add simple tests to samba3.base.attr to check INVALID_PARAMETER returned...
Jeremy Allison [Thu, 4 Jun 2020 04:23:21 +0000 (21:23 -0700)]
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>
3 years agos3: libsmb: cli_setatr() and async version. Don't allow attribtes > 16 bits on an...
Jeremy Allison [Thu, 4 Jun 2020 04:11:25 +0000 (21:11 -0700)]
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>
3 years agos3: libsmb: cli_unlink() and async version. Don't allow attribtes > 16 bits on an...
Jeremy Allison [Thu, 4 Jun 2020 04:07:33 +0000 (21:07 -0700)]
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>
3 years agos3: libsmb: Change cli_unlink() and async version to take a uint32_t attribute.
Jeremy Allison [Thu, 4 Jun 2020 04:03:39 +0000 (21:03 -0700)]
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>
3 years agos3: libsmb: Change cli_setfileinfo_ext() and async version to take a uint32_t attr.
Jeremy Allison [Thu, 4 Jun 2020 03:58:06 +0000 (20:58 -0700)]
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>
3 years agos3: libsmb: Change cli_setpathinfo_ext() to take 32-bit attributes.
Jeremy Allison [Thu, 4 Jun 2020 03:48:23 +0000 (20:48 -0700)]
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>
3 years agos3: libsmb: Change cli_setatr() and async version to use 32-bit attributes.
Jeremy Allison [Wed, 3 Jun 2020 21:12:38 +0000 (14:12 -0700)]
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>
3 years agos3: libsmb: Make cli_list_trans() and cli_list take a 32-bit attribute.
Jeremy Allison [Wed, 3 Jun 2020 21:07:21 +0000 (14:07 -0700)]
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>
3 years agos3: libsmb: Make cli_list_old() take 32-bit attribute.
Jeremy Allison [Wed, 3 Jun 2020 20:56:37 +0000 (13:56 -0700)]
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>
3 years agos3: libsmb: Change cli_smb2_setatr() to use 32-bit attributes.
Jeremy Allison [Wed, 3 Jun 2020 20:50:57 +0000 (13:50 -0700)]
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>
3 years agos3: Fix dfs-reparse testing code to use 32-bit attributes. Change variable names...
Jeremy Allison [Wed, 3 Jun 2020 20:44:55 +0000 (13:44 -0700)]
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>
3 years agos3: libsmb: Change cli_qpathinfo1() and async version to return a 32-bit attribute.
Jeremy Allison [Wed, 3 Jun 2020 20:42:58 +0000 (13:42 -0700)]
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>
3 years agos3: libsmb: Change cli_qpathinfo3() to return a 32-bit attribute.
Jeremy Allison [Wed, 3 Jun 2020 20:36:05 +0000 (13:36 -0700)]
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>
3 years agos3: libsmb: Change cli_qpathinfo2() and async versions to return a 32-bit attribute.
Jeremy Allison [Wed, 3 Jun 2020 20:28:04 +0000 (13:28 -0700)]
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>
3 years agos3: libsmb: Change cli_getatr() and async versions to return a 32-bit attribute.
Jeremy Allison [Wed, 3 Jun 2020 20:15:17 +0000 (13:15 -0700)]
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>
3 years agos3: libsmb: Rename uint16_t attr -> sattr (short attributes).
Jeremy Allison [Wed, 3 Jun 2020 20:09:43 +0000 (13:09 -0700)]
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>
3 years agos3: libsmb: Change cli_getattrE() and async versions to return a 32-bit attribute.
Jeremy Allison [Wed, 3 Jun 2020 20:00:56 +0000 (13:00 -0700)]
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>
3 years agos3: libsmb: Change cli_qfileinfo_basic() to return 32-bit attributes.
Jeremy Allison [Wed, 3 Jun 2020 19:54:10 +0000 (12:54 -0700)]
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>
3 years agos3: libsmb: Change cli_smb2_qpathinfo2() to return a 32 bit attribute.
Jeremy Allison [Wed, 3 Jun 2020 19:17:30 +0000 (12:17 -0700)]
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>
3 years agos3: libsmb: Fix cli_smb2_getatr() to return a 32 bit attribute.
Jeremy Allison [Wed, 3 Jun 2020 19:13:33 +0000 (12:13 -0700)]
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>
3 years agos3: libsmb: Change cli_smb2_getattrE() to return 32 bit attributes.
Jeremy Allison [Wed, 3 Jun 2020 19:07:05 +0000 (12:07 -0700)]
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>
3 years agos3: libsmb: Change cli_smb2_qfileinfo_basic() and all users to return a uint32_t...
Jeremy Allison [Wed, 3 Jun 2020 18:57:39 +0000 (11:57 -0700)]
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>