obnox/samba-autobuild/.git
4 years agovfs_preopen: TALLOC_FREE(fde) before closing the underlying fd master
Volker Lendecke [Wed, 26 Jun 2019 15:43:44 +0000 (17:43 +0200)]
vfs_preopen: TALLOC_FREE(fde) before closing the underlying fd

Without that we might get wrong stuff out of epoll

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agovfs_preopen: Fix an uninitialized variable read
Volker Lendecke [Wed, 26 Jun 2019 15:43:20 +0000 (17:43 +0200)]
vfs_preopen: Fix an uninitialized variable read

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agovfs_preopen: Fix for O_NOFOLLOW
Volker Lendecke [Wed, 26 Jun 2019 15:42:54 +0000 (17:42 +0200)]
vfs_preopen: Fix for O_NOFOLLOW

Since 4301505d977449d core smbd code passes O_NOFOLLOW together with
[O_RDONLY|O_RDWR] as flags. This breaks activating vfs_preopen, we
need to look at *just* the access mode.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agosmbd: Fix broken brlock for clustering
Volker Lendecke [Thu, 27 Jun 2019 11:21:33 +0000 (13:21 +0200)]
smbd: Fix broken brlock for clustering

This should have been in f11c5887f4fb4b766, sorry. We now always need
TDB_SEQNUM on brlock.tdb.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agovfs:glusterfs_fuse: treat ENOATTR as ENOENT
Michael Adam [Thu, 20 Jun 2019 13:14:57 +0000 (15:14 +0200)]
vfs:glusterfs_fuse: treat ENOATTR as ENOENT

The original implementation of the virtual xattr get_real_filename
in gluster was misusing the ENOENT errno as the authoritative anwer
that the file/dir that we were asking the real filename for does not
exist. But since the getxattr call is done on the parent directory,
this is a violation of the getxattr API which uses ENOENT for the
case that the file/dir that the getxattr call is done against does
not exist.

Now after a recent regression for fuse-mount re-exports due to
gluster mapping ENOENT to ESTALE in the fuse-bridge, the gluster
implementation is changed to more correctly return ENOATTR if the
requested file does not exist.

This patch changes the glusterfs_fuse vfs module to treat ENOATTR as
ENOENT to be fully functional again with latest gluster.

- Without this patch, samba against a new gluster will work correctly,
  but the get_real_filename optimization for a non-existing entry
  is lost.

- With this patch, Samba will not work correctly any more against
  very old gluster servers: Those (correctly) returned ENOATTR
  always, which Samba originally interpreted as EOPNOTSUPP, triggering
  the expensive directory scan. With this patch, ENOATTR is
  interpreted as ENOENT, the authoritative answer that the requested
  entry does not exist, which is wrong unless it really does not exist.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Fri Jun 28 12:52:03 UTC 2019 on sn-devel-184

4 years agovfs:glusterfs: treat ENOATTR as ENOENT
Michael Adam [Thu, 20 Jun 2019 13:14:57 +0000 (15:14 +0200)]
vfs:glusterfs: treat ENOATTR as ENOENT

The original implementation of the virtual xattr get_real_filename
in gluster was misusing the ENOENT errno as the authoritative anwer
that the file/dir that we were asking the real filename for does not
exist. But since the getxattr call is done on the parent directory,
this is a violation of the getxattr API which uses ENOENT for the
case that the file/dir that the getxattr call is done against does
not exist.

Now after a recent regression for fuse-mount re-exports due to
gluster mapping ENOENT to ESTALE in the fuse-bridge, the gluster
implementation is changed to more correctly return ENOATTR if the
requested file does not exist.

This patch changes the glusterfs vfs module to treat ENOATTR as ENOENT
to be fully functional again with latest gluster.

- Without this patch, samba against a new gluster will work correctly,
  but the get_real_filename optimization for a non-existing entry
  is lost.

- With this patch, Samba will not work correctly any more against
  very old gluster servers: Those (correctly) returned ENOATTR
  always, which Samba originally interpreted as EOPNOTSUPP, triggering
  the expensive directory scan. With this patch, ENOATTR is
  interpreted as ENOENT, the authoritative answer that the requested
  entry does not exist, which is wrong unless it really does not exist.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 years agos3:notifyd: Handle sigup in notifyd to reparse smb.conf
Shyamsunder Rathi [Sat, 18 May 2019 01:34:04 +0000 (18:34 -0700)]
s3:notifyd: Handle sigup in notifyd to reparse smb.conf

At present, SIGHUP is blocked on notifyd. So, if parent smbd
is started with "log level" 10 in smb.conf, and later changed
to 0, the SIGHUP will not change the log level to 0 in notify
smbd process and it will keep printing verbose logs in the
corresponding log files.

Proposed fix is to write a SIGHUP handler for notifyd and set
it to reload services.

Reviewed-by: Hemanth Thummala <hemanth.thummala@nutanix.com>
Signed-off-by: Shyamsunder Rathi <shyam.rathi@nutanix.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by:Volker Lendecke <vl@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jun 27 17:57:12 UTC 2019 on sn-devel-184

4 years agos4:torture: Use GnuTLS RC4 in rpc forest_trust test
Andreas Schneider [Thu, 21 Feb 2019 10:06:23 +0000 (11:06 +0100)]
s4:torture: Use GnuTLS RC4 in rpc forest_trust test

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Jun 27 14:11:39 UTC 2019 on sn-devel-184

4 years agos4:tortue: Use GnuTLS RC4 in rpc lsa test
Andreas Schneider [Thu, 21 Feb 2019 10:03:01 +0000 (11:03 +0100)]
s4:tortue: Use GnuTLS RC4 in rpc lsa test

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agonsswitch: Use GnuTLS RC4 in wbclient test
Andreas Schneider [Fri, 9 Nov 2018 09:20:42 +0000 (10:20 +0100)]
nsswitch: Use GnuTLS RC4 in wbclient test

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agos4:rpc_server: Use GnuTLS RC4 in lsa server
Andreas Schneider [Tue, 19 Feb 2019 11:18:52 +0000 (12:18 +0100)]
s4:rpc_server: Use GnuTLS RC4 in lsa server

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agos3:utils: Use GnuTLS RC4 in npc_rpc_trust
Andreas Schneider [Thu, 17 Jan 2019 13:10:52 +0000 (14:10 +0100)]
s3:utils: Use GnuTLS RC4 in npc_rpc_trust

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agos4:rpc_server: Use GnuTLS RC4 in lsa endpoint
Andreas Schneider [Thu, 17 Jan 2019 11:25:43 +0000 (12:25 +0100)]
s4:rpc_server: Use GnuTLS RC4 in lsa endpoint

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agos3:rpc_client: Use C99 inititializer in dcerpc_samr_chgpasswd_user()
Andreas Schneider [Mon, 21 Jan 2019 12:16:56 +0000 (13:16 +0100)]
s3:rpc_client: Use C99 inititializer in dcerpc_samr_chgpasswd_user()

This also cleans up after using them.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agoauth:ntlmssp: Use GnuTLS RC4 in ntlmssp server
Andreas Schneider [Fri, 9 Nov 2018 11:33:10 +0000 (12:33 +0100)]
auth:ntlmssp: Use GnuTLS RC4 in ntlmssp server

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agoauth:gensec: Return NTSTATUS for netsec_do_seal()
Andreas Schneider [Wed, 22 May 2019 07:17:37 +0000 (09:17 +0200)]
auth:gensec: Return NTSTATUS for netsec_do_seal()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agoauth:gensec: Use GnuTLS RC4 in netsec_do_seal()
Andreas Schneider [Wed, 22 May 2019 07:08:09 +0000 (09:08 +0200)]
auth:gensec: Use GnuTLS RC4 in netsec_do_seal()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agoauth:gensec: Use GnuTLS RC4 in netsec_do_seq_num()
Andreas Schneider [Fri, 9 Nov 2018 09:33:44 +0000 (10:33 +0100)]
auth:gensec: Use GnuTLS RC4 in netsec_do_seq_num()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agolibcli:auth: Return NTSTATUS for netlogon_creds_arcfour_crypt()
Andreas Schneider [Wed, 29 May 2019 12:46:17 +0000 (14:46 +0200)]
libcli:auth: Return NTSTATUS for netlogon_creds_arcfour_crypt()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agolibcli:auth: Return NTSTATUS for netlogon_creds_crypt_samlogon_logon()
Andreas Schneider [Wed, 29 May 2019 14:51:01 +0000 (16:51 +0200)]
libcli:auth: Return NTSTATUS for netlogon_creds_crypt_samlogon_logon()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agolibcli:auth: Return NTSTATUS for netlogon_creds_decrypt_samlogon_logon()
Andreas Schneider [Wed, 29 May 2019 14:49:29 +0000 (16:49 +0200)]
libcli:auth: Return NTSTATUS for netlogon_creds_decrypt_samlogon_logon()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agolibcli:auth: Return NTSTATUS for netlogon_creds_encrypt_samlogon_logon()
Andreas Schneider [Wed, 29 May 2019 14:46:36 +0000 (16:46 +0200)]
libcli:auth: Return NTSTATUS for netlogon_creds_encrypt_samlogon_logon()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agolibcli:auth: Return NTSTATUS for netlogon_creds_server_step_check()
Andreas Schneider [Wed, 29 May 2019 12:39:34 +0000 (14:39 +0200)]
libcli:auth: Return NTSTATUS for netlogon_creds_server_step_check()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agolibcli:auth: Return NTSTATUS for netlogon_creds_decrypt_samlogon_validation()
Andreas Schneider [Wed, 29 May 2019 12:35:20 +0000 (14:35 +0200)]
libcli:auth: Return NTSTATUS for netlogon_creds_decrypt_samlogon_validation()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agolibcli:auth: Return NTSTATUS for netlogon_creds_encrypt_samlogon_validation()
Andreas Schneider [Wed, 29 May 2019 12:25:57 +0000 (14:25 +0200)]
libcli:auth: Return NTSTATUS for netlogon_creds_encrypt_samlogon_validation()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agolibcli:auth: Use GnuTLS RC4 for netlogon credentials
Andreas Schneider [Thu, 31 Jan 2019 10:28:02 +0000 (11:28 +0100)]
libcli:auth: Use GnuTLS RC4 for netlogon credentials

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agolib/crypto: Use GnuTLS RC4 for samba_gnutls_arcfour_confounded_md5()
Andrew Bartlett [Thu, 27 Jun 2019 04:45:33 +0000 (16:45 +1200)]
lib/crypto: Use GnuTLS RC4 for samba_gnutls_arcfour_confounded_md5()

This allows Samba to use GnuTLS for drsuapi_{en,de}crypt_attribute_value()

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agoliblic/drsupai: use samba_gnutls_arcfour_confounded_md5() wrapper
Andrew Bartlett [Thu, 27 Jun 2019 04:05:32 +0000 (16:05 +1200)]
liblic/drsupai: use samba_gnutls_arcfour_confounded_md5() wrapper

This common code will reduce duplication, particularly when we move
arcfour_encrypt_buffer() calls to GnuTLS

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agolib/crypto: Add GnuTLS helper function samba_gnutls_arcfour_confounded_md5()
Andrew Bartlett [Thu, 27 Jun 2019 03:05:49 +0000 (15:05 +1200)]
lib/crypto: Add GnuTLS helper function samba_gnutls_arcfour_confounded_md5()

This will avoid duplicated code as we convert arcfour_crypt_blob() into
direct GnuTLS calls

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agolibcli/drsuapi: Correct comment in drsuapi_decrypt_attribute_value()
Andrew Bartlett [Thu, 27 Jun 2019 02:53:49 +0000 (14:53 +1200)]
libcli/drsuapi: Correct comment in drsuapi_decrypt_attribute_value()

This is not a copy, it is just a pointer assignment.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agolibcli/drsuapi: Add expected value unit tests for drsuapi_{en,de}crypt_attribute_value()
Andrew Bartlett [Thu, 27 Jun 2019 02:45:36 +0000 (14:45 +1200)]
libcli/drsuapi: Add expected value unit tests for drsuapi_{en,de}crypt_attribute_value()

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agolibcli/drsuapi: Add const to *in parameters to drsuapi_{en,de}crypt_attribute_value()
Andrew Bartlett [Thu, 27 Jun 2019 02:17:44 +0000 (14:17 +1200)]
libcli/drsuapi: Add const to *in parameters to drsuapi_{en,de}crypt_attribute_value()

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agolibcli/drsuapi: Make drsuapi_decrypt_attribute_value() static
Andrew Bartlett [Wed, 26 Jun 2019 23:29:29 +0000 (11:29 +1200)]
libcli/drsuapi: Make drsuapi_decrypt_attribute_value() static

The last external user was removed in 0980a3471ed8fcc3a37296857285dc0235e0e0d2 in 2010

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agolibcli:drsuapi: Use gnutls_error_to_werror() in repl_decrypt
Andreas Schneider [Mon, 24 Jun 2019 11:20:58 +0000 (13:20 +0200)]
libcli:drsuapi: Use gnutls_error_to_werror() in repl_decrypt

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agolibcli:auth: Use gnutls_error_to_werror() in smbencrypt
Andreas Schneider [Mon, 24 Jun 2019 11:18:32 +0000 (13:18 +0200)]
libcli:auth: Use gnutls_error_to_werror() in smbencrypt

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agolibcli:util: Add gnutls_error_to_werror()
Andreas Schneider [Mon, 24 Jun 2019 11:14:12 +0000 (13:14 +0200)]
libcli:util: Add gnutls_error_to_werror()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agolib/crypto: move gnutls error wrapper to own subsystem
Andrew Bartlett [Wed, 26 Jun 2019 04:41:05 +0000 (16:41 +1200)]
lib/crypto: move gnutls error wrapper to own subsystem

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3: torture: Ensure we can always get a POSIX ACL on a directory handle.
Jeremy Allison [Tue, 25 Jun 2019 20:39:59 +0000 (13:39 -0700)]
s3: torture: Ensure we can always get a POSIX ACL on a directory handle.

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 Jun 26 19:31:28 UTC 2019 on sn-devel-184

4 years agos3: smbd: We also need to open a real directory fd when modifying security.
Jeremy Allison [Tue, 25 Jun 2019 17:32:10 +0000 (10:32 -0700)]
s3: smbd: We also need to open a real directory fd when modifying security.

Makes the logic identical to file open.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agolib/param: clang: Fix 'dereference of a null pointer' warning
Noel Power [Fri, 14 Jun 2019 13:57:59 +0000 (13:57 +0000)]
lib/param: clang: Fix 'dereference of a null pointer' warning

Fixes:

lib/param/loadparm.c:3325:36: warning: Access to field 'szService' results in a dereference of a null pointer (loaded from variable 'service') <--[clang]
        return lpcfg_string((const char *)service->szService)

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Wed Jun 26 11:53:08 UTC 2019 on sn-devel-184

4 years agolibrpc/ndr: clang: Fix warning 'Value stored to 'towernum' is never read'
Noel Power [Fri, 14 Jun 2019 13:49:47 +0000 (13:49 +0000)]
librpc/ndr: clang: Fix warning 'Value stored to 'towernum' is never read'

Fixes:

librpc/ndr/ndr_orpc.c:140:2: warning: Value stored to 'towernum' is never read <--[clang]
        towernum = 0;
        ^          ~
1 warning generated.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agolib/dwrap: Fix 'Null pointer passed as an argument to a 'nonnull' parameter '
Noel Power [Fri, 14 Jun 2019 13:40:28 +0000 (13:40 +0000)]
lib/dwrap: Fix 'Null pointer passed as an argument to a 'nonnull' parameter '

Fixes:

lib/dbwrap/dbwrap.c:645:4: warning: Null pointer passed as an argument to a 'nonnull' parameter <--[clang]
                        memcpy(p, dbufs[i].dptr, thislen);

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agolib/dbwrap: clang: Fix 'all argument is an uninitialized value'
Noel Power [Fri, 14 Jun 2019 13:36:31 +0000 (13:36 +0000)]
lib/dbwrap: clang: Fix 'all argument is an uninitialized value'

Fixes:

lib/dbwrap/dbwrap.c:533:4: warning: 2nd function call argument is an uninitialized value <--[clang]
                        dbwrap_lock_order_unlock(db, lockptr);
                        ^

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agolib/util: clang: Fix Value stored during its initialization is never read
Noel Power [Thu, 13 Jun 2019 18:26:18 +0000 (18:26 +0000)]
lib/util: clang: Fix Value stored during its initialization is never read

Fixes:

lib/util/util_tdb.c:385:11: warning: Value stored to 'result' during its initialization is never read <--[clang]

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agoclang: Fix Null pointer passed as argument warning
Noel Power [Thu, 13 Jun 2019 13:39:22 +0000 (13:39 +0000)]
clang: Fix Null pointer passed as argument warning

Fixes:
lib/tdb/common/transaction.c:354:2: warning: Null pointer passed as an argument to a 'nonnull' parameter <--[clang]
        memcpy(tdb->transaction->blocks[blk] + off, buf, len);
&

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agolib/tdb: clang: Fix warning: Dereference of null pointer
Noel Power [Wed, 12 Jun 2019 14:55:43 +0000 (14:55 +0000)]
lib/tdb: clang: Fix warning: Dereference of null pointer

Fixes:

lib/tdb/common/lock.c:933:6: warning: Dereference of null pointer <--[clang]
        if (tdb->allrecord_lock.count) {
            ^~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agoselftest: schema version check in provision test
Aaron Haslett [Thu, 11 Apr 2019 05:44:48 +0000 (17:44 +1200)]
selftest: schema version check in provision test

Modifying blackbox provision test to check schema version.

Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Jun 26 05:31:03 UTC 2019 on sn-devel-184

4 years agoschema: changing default base schema to 2012_R2
Aaron Haslett [Mon, 14 Jan 2019 22:19:54 +0000 (11:19 +1300)]
schema: changing default base schema to 2012_R2

Changing default base schema from 2008_R2 to 2012_R2

Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agoselftest: specifying 2008_R2 base schema for tests that need it
Aaron Haslett [Tue, 15 Jan 2019 03:30:51 +0000 (16:30 +1300)]
selftest: specifying 2008_R2 base schema for tests that need it

We're going to change the default base schema so this patch changes all
tests and testenvs requiring the current default (2008_R2) to specify it
in all provision commands using --base-schema.

Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agodsdb: Handle DB corner-case where PSO container doesn't exist
Tim Beale [Mon, 24 Jun 2019 22:10:17 +0000 (10:10 +1200)]
dsdb: Handle DB corner-case where PSO container doesn't exist

A 2003 AD DB with functional level set to >= 2008 was non-functional
due to the PSO checks.

We already check the functional level is >= 2008 before checking for the
PSO container. However, users could change their functional level
without ensuring their DB conforms to the corresponding base schema.

The objectclass DSDB module should prevent the PSO container from ever
being deleted. So the only way we should be able to hit this case is
through upgrading the functional level (but not the underlying schema
objects). If so, log a low-priority message and continue without errors.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14008
RN: Previously, AD operations such as user authentication could fail
completely with the message 'Error 32 determining PSOs in system' logged
on the samba server. This problem would only affect a domain that was
created using a pre-2008 AD base schema and then had its functional
level manually raised to 2008 or greater. This issue has now been
resolved.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agopidl: Remove the need to always specify --client with --python
Andrew Bartlett [Tue, 25 Jun 2019 03:41:40 +0000 (15:41 +1200)]
pidl: Remove the need to always specify --client with --python

This allows us to avoid generating client code for NDR-only protocols that do
not go over DCE/RPC

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
4 years agolibrpc: No longer generate or build unused client bindings for frsrpc
Andrew Bartlett [Wed, 26 Jun 2019 04:09:30 +0000 (16:09 +1200)]
librpc: No longer generate or build unused client bindings for frsrpc

We retain the IDL and NDR parsers for ndrdump.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
4 years agolibrpc: Do not generate extra unused client or python bindings with PIDL
Andrew Bartlett [Tue, 25 Jun 2019 22:01:16 +0000 (10:01 +1200)]
librpc: Do not generate extra unused client or python bindings with PIDL

This sorts out the idl list into the parts that actually need --python and --client specified
and so speeds up the compile and clarifies the code behaviour.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
4 years agolibrpc: Remove frsblobs.idl
Andrew Bartlett [Tue, 25 Jun 2019 00:51:50 +0000 (12:51 +1200)]
librpc: Remove frsblobs.idl

We can now dump public structures using ndrdump, so helper dump functions
are not required any more.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
4 years agolibrpc: Remove unused RPC_NDR_MDSSVC
Andrew Bartlett [Tue, 25 Jun 2019 03:29:31 +0000 (15:29 +1200)]
librpc: Remove unused RPC_NDR_MDSSVC

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
4 years agolibrpc: Remove unused RPC_NDR_KEYSVC
Andrew Bartlett [Tue, 25 Jun 2019 03:29:15 +0000 (15:29 +1200)]
librpc: Remove unused RPC_NDR_KEYSVC

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
4 years agolibrpc: Remove unused RPC_NDR_TRKWKS
Andrew Bartlett [Tue, 25 Jun 2019 03:28:53 +0000 (15:28 +1200)]
librpc: Remove unused RPC_NDR_TRKWKS

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
4 years agolibrpc: Remove unused RPC_NDR_SCERPC
Andrew Bartlett [Tue, 25 Jun 2019 03:00:49 +0000 (15:00 +1200)]
librpc: Remove unused RPC_NDR_SCERPC

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
4 years agolibrpc: Remove unused RPC_NDR_WZCSVC
Andrew Bartlett [Tue, 25 Jun 2019 03:00:35 +0000 (15:00 +1200)]
librpc: Remove unused RPC_NDR_WZCSVC

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
4 years agolibrpc: Remove unused RPC_NDR_MSGSVC
Andrew Bartlett [Tue, 25 Jun 2019 03:00:07 +0000 (15:00 +1200)]
librpc: Remove unused RPC_NDR_MSGSVC

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
4 years agolibrpc: Remove unused RPC_NDR_SERVER_ID
Andrew Bartlett [Tue, 25 Jun 2019 02:59:28 +0000 (14:59 +1200)]
librpc: Remove unused RPC_NDR_SERVER_ID

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
4 years agolibrpc: Remove unused RPC_NDR_NBT
Andrew Bartlett [Tue, 25 Jun 2019 02:58:42 +0000 (14:58 +1200)]
librpc: Remove unused RPC_NDR_NBT

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
4 years agolibrpc: Remove unused RPC_NDR_DSBACKUP
Andrew Bartlett [Tue, 25 Jun 2019 02:57:52 +0000 (14:57 +1200)]
librpc: Remove unused RPC_NDR_DSBACKUP

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
4 years agolibrpc: Remove unused RPC_NDR_WINSIF
Andrew Bartlett [Tue, 25 Jun 2019 01:30:08 +0000 (13:30 +1200)]
librpc: Remove unused RPC_NDR_WINSIF

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
4 years agolibrpc: Remove unused RPC_NDR_POLICYAGENT
Andrew Bartlett [Tue, 25 Jun 2019 01:13:53 +0000 (13:13 +1200)]
librpc: Remove unused RPC_NDR_POLICYAGENT

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
4 years agolibrpc: Remove unused RPC_NDR_EFS
Andrew Bartlett [Tue, 25 Jun 2019 01:03:48 +0000 (13:03 +1200)]
librpc: Remove unused RPC_NDR_EFS

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
4 years agolibrpc: Remove unused RPC_NDR_AUDIOSRV
Andrew Bartlett [Tue, 25 Jun 2019 00:58:10 +0000 (12:58 +1200)]
librpc: Remove unused RPC_NDR_AUDIOSRV

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
4 years agolibrpc: Remove unused RPC_NDR_SMB_ACL
Andrew Bartlett [Tue, 25 Jun 2019 22:02:46 +0000 (10:02 +1200)]
librpc: Remove unused RPC_NDR_SMB_ACL

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
4 years agolibrpc: Remove unused RPC_NDR_IDMAP
Andrew Bartlett [Tue, 25 Jun 2019 22:02:36 +0000 (10:02 +1200)]
librpc: Remove unused RPC_NDR_IDMAP

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
4 years agolibrpc: Remove unused RPC_NDR_XATTR
Andrew Bartlett [Tue, 25 Jun 2019 00:43:44 +0000 (12:43 +1200)]
librpc: Remove unused RPC_NDR_XATTR

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
4 years agolibrpc: Remove unused RPC_NDR_DRSBLOBS
Andrew Bartlett [Tue, 25 Jun 2019 22:01:01 +0000 (10:01 +1200)]
librpc: Remove unused RPC_NDR_DRSBLOBS

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
4 years agolibrpc: Remove unused RPC_NDR_NTLMSSP
Andrew Bartlett [Tue, 25 Jun 2019 00:22:59 +0000 (12:22 +1200)]
librpc: Remove unused RPC_NDR_NTLMSSP

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
4 years agolibrpc: Do not generate client code for dbgidl.idl
Andrew Bartlett [Tue, 25 Jun 2019 00:12:35 +0000 (12:12 +1200)]
librpc: Do not generate client code for dbgidl.idl

We only want to record the GUID and function table names, we do not need
to generate uncalled stubs.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
4 years agos4-torture: Remove unused #include of librpc/gen_ndr/ndr_dcerpc_c.h
Andrew Bartlett [Tue, 25 Jun 2019 04:00:59 +0000 (16:00 +1200)]
s4-torture: Remove unused #include of librpc/gen_ndr/ndr_dcerpc_c.h

We only need librpc/rpc/rpc_common.h

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
4 years agolib/tls: Remove unused header definitions from source4/lib/tls/tls.h (tls socket...
Andrew Bartlett [Mon, 24 Jun 2019 23:48:37 +0000 (11:48 +1200)]
lib/tls: Remove unused header definitions from source4/lib/tls/tls.h (tls socket wrapper)

These were removed in eb15acdd35600878aba3319e070199200d9a1357 but the
header declarations were not removed.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
4 years agontvfs: Remove now unused functions
Andrew Bartlett [Mon, 24 Jun 2019 23:57:16 +0000 (11:57 +1200)]
ntvfs: Remove now unused functions

These likely became unused once other untested parts of the NTVFS file server were
removed in 2017e291a2da3d63741df82b480f32ee57f6a165,
ee8b48df0f995611e0c8f8d6766e4882c5f4f4cd,
679227d6063074aabb986d78fab42b856db265e3,
31de52ed2efe598e7fab72d90a742d4f9e03c97e

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
4 years agopackaging: Update READMEs to reflect current status.
Karolin Seeger [Mon, 24 Jun 2019 09:27:04 +0000 (11:27 +0200)]
packaging: Update READMEs to reflect current status.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
Reviewed-by: Björn Baumbach <bb@sernet.de>
Autobuild-User(master): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(master): Tue Jun 25 12:09:39 UTC 2019 on sn-devel-184

4 years agoclient: enable allinfo and altname tab completion
David Disseldorp [Mon, 7 May 2018 14:02:29 +0000 (16:02 +0200)]
client: enable allinfo and altname tab completion

Should tab-complete a single remote path.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Tue Jun 25 10:55:45 UTC 2019 on sn-devel-184

4 years agos3: torture: Add POSIX-ACL-OPLOCK test to check interaction of posix ACL operations...
Jeremy Allison [Wed, 19 Jun 2019 18:32:18 +0000 (11:32 -0700)]
s3: torture: Add POSIX-ACL-OPLOCK test to check interaction of posix ACL operations with an oplocked Windows handle.

(Spoiler alert, it breaks the oplock :-).

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): Mon Jun 24 20:05:34 UTC 2019 on sn-devel-184

4 years agos3: smbd: Posix ACLs. Now we know we have a handle, always use VFS_FCHMOD instead...
Jeremy Allison [Thu, 20 Jun 2019 18:43:17 +0000 (11:43 -0700)]
s3: smbd: Posix ACLs. Now we know we have a handle, always use VFS_FCHMOD instead of VFS_CHMOD.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos3: modules: Fruit. Now we know we have a handle, always use VFS_FCHMOD instead of...
Jeremy Allison [Thu, 20 Jun 2019 18:42:42 +0000 (11:42 -0700)]
s3: modules: Fruit. Now we know we have a handle, always use VFS_FCHMOD instead of VFS_CHMOD.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos3: smbd: If smbd_do_qfilepathinfo() causes an oplock or lease break, we must check...
Jeremy Allison [Wed, 19 Jun 2019 18:23:41 +0000 (11:23 -0700)]
s3: smbd: If smbd_do_qfilepathinfo() causes an oplock or lease break, we must check for deferred open here.

Note this isn't an issue in SMB2, as no SMB2 info level requests
called by smbd_do_qfilepathinfo()/smbd_do_setfilepathinfo() from
SMB2 can cause a oplock or lease break.

The SMB1 trans2.c: calling of smbd_do_setfilepathinfo()
correctly copes with this, this was just missed in the
SMB1 call of smbd_do_qfilepathinfo().

Needed for the following POSIX ACL query interacting
with Windows oplock file test to follow.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos3: smbd: Make set_unix_posix_default_acl() take an fsp argument, not smb_fname.
Jeremy Allison [Tue, 18 Jun 2019 22:36:58 +0000 (15:36 -0700)]
s3: smbd: Make set_unix_posix_default_acl() take an fsp argument, not smb_fname.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos3: smbd: Add default ACLS can only be set on directory check to smb_set_posix_acl().
Jeremy Allison [Tue, 18 Jun 2019 22:29:25 +0000 (15:29 -0700)]
s3: smbd: Add default ACLS can only be set on directory check to smb_set_posix_acl().

This was already being checked in the lower layer,
so no change in behavior, just an efficiency and
clarity change.

Just move an extra check here so we refuse the
set if a default ACL is sent on a file object
before we go into the lower layers.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos3: smbd: Only pass fsp to remove_posix_acl(). No longer uses smb_fname.
Jeremy Allison [Tue, 18 Jun 2019 22:21:47 +0000 (15:21 -0700)]
s3: smbd: Only pass fsp to remove_posix_acl(). No longer uses smb_fname.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos3: smbd: Only pass fsp to set_unix_posix_acl(). No longer uses smb_fname.
Jeremy Allison [Tue, 18 Jun 2019 22:18:47 +0000 (15:18 -0700)]
s3: smbd: Only pass fsp to set_unix_posix_acl(). No longer uses smb_fname.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos3: smbd: Change set_unix_posix_default_acl() to return NTSTATUS.
Jeremy Allison [Tue, 18 Jun 2019 22:14:53 +0000 (15:14 -0700)]
s3: smbd: Change set_unix_posix_default_acl() to return NTSTATUS.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos3: smbd: Cleanup - make set_unix_posix_default_acl() use modern coding standards.
Jeremy Allison [Tue, 18 Jun 2019 22:09:34 +0000 (15:09 -0700)]
s3: smbd: Cleanup - make set_unix_posix_default_acl() use modern coding standards.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos3: smbd: Make set_unix_posix_acl() return NTSTATUS.
Jeremy Allison [Tue, 18 Jun 2019 22:03:28 +0000 (15:03 -0700)]
s3: smbd: Make set_unix_posix_acl() return NTSTATUS.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos3: smbd: Cleanup - make remove_posix_acl() return NTSTATUS.
Jeremy Allison [Tue, 18 Jun 2019 21:55:37 +0000 (14:55 -0700)]
s3: smbd: Cleanup - make remove_posix_acl() return NTSTATUS.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos3: smbd: Cleanup - make set_unix_posix_acl() use modern coding standards.
Jeremy Allison [Tue, 18 Jun 2019 21:48:22 +0000 (14:48 -0700)]
s3: smbd: Cleanup - make set_unix_posix_acl() use modern coding standards.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos3: smbd: Cleanup - make remove_posix_acl() use modern coding standards.
Jeremy Allison [Tue, 18 Jun 2019 21:44:03 +0000 (14:44 -0700)]
s3: smbd: Cleanup - make remove_posix_acl() use modern coding standards.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos3: smbd: Fix smb_query_posix_acl() to always use fsp handle.
Jeremy Allison [Tue, 18 Jun 2019 21:14:31 +0000 (14:14 -0700)]
s3: smbd: Fix smb_query_posix_acl() to always use fsp handle.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos3: smbd: Plumb through struct smb_request *req parameter so it can be used by smb_qu...
Jeremy Allison [Tue, 18 Jun 2019 20:11:51 +0000 (13:11 -0700)]
s3: smbd: Plumb through struct smb_request *req parameter so it can be used by smb_query_posix_acl().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos3: smbd: Fix smb_query_posix_acl() to use modern coding standards.
Jeremy Allison [Tue, 18 Jun 2019 18:24:12 +0000 (11:24 -0700)]
s3: smbd: Fix smb_query_posix_acl() to use modern coding standards.

Add wrap protection.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos3: smbd: Factor out code into a separate function smb_query_posix_acl().
Jeremy Allison [Tue, 18 Jun 2019 17:49:34 +0000 (10:49 -0700)]
s3: smbd: Factor out code into a separate function smb_query_posix_acl().

Will clean up coding standards next.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos3: smbd: Now we always have a handle in smb_set_posix_acl(), use it instead of smb_f...
Jeremy Allison [Thu, 13 Jun 2019 23:17:49 +0000 (16:17 -0700)]
s3: smbd: Now we always have a handle in smb_set_posix_acl(), use it instead of smb_fname.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos3: smbd: Update smb_set_posix_acl() to always use an open file handle.
Jeremy Allison [Mon, 17 Jun 2019 22:34:13 +0000 (15:34 -0700)]
s3: smbd: Update smb_set_posix_acl() to always use an open file handle.

Uses get_posix_fsp() added in the previous commit.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos3: smbd: Add get_posix_fsp() utility function. Not yet used.
Jeremy Allison [Mon, 17 Jun 2019 22:30:00 +0000 (15:30 -0700)]
s3: smbd: Add get_posix_fsp() utility function. Not yet used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos3: smbd: Clarify logic with helper variables in smb_set_posix_acl()
Jeremy Allison [Thu, 13 Jun 2019 23:07:59 +0000 (16:07 -0700)]
s3: smbd: Clarify logic with helper variables in smb_set_posix_acl()

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