samba.git
3 years agoldb: correct comments in attrib_handers val_to_int64
Douglas Bagnall [Fri, 5 Mar 2021 20:57:44 +0000 (09:57 +1300)]
ldb: correct comments in attrib_handers val_to_int64

c.f. the identical static function in lib/ldb-samba/ldif_handlers.c

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agoutil:str_sub: talloc_free on error
Douglas Bagnall [Wed, 10 Mar 2021 09:13:48 +0000 (22:13 +1300)]
util:str_sub: talloc_free on error

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agoutil: don't mark impure functions as pure
Douglas Bagnall [Wed, 10 Mar 2021 09:05:37 +0000 (22:05 +1300)]
util: don't mark impure functions as pure

nothing that allocates memory can be pure, unless it guarantees to
allocate exactly the same pointer very time (which it does not).

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosamba-tool gpo: add missing newline to admxload warning
Björn Baumbach [Tue, 9 Mar 2021 12:11:08 +0000 (13:11 +0100)]
samba-tool gpo: add missing newline to admxload warning

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: David Mulder <dmulder@suse.com>
Autobuild-User(master): Björn Baumbach <bb@sernet.de>
Autobuild-Date(master): Thu Mar 11 21:41:04 UTC 2021 on sn-devel-184

3 years agosamba-gpupdate: Check sysvol download paths in case-insensitive way
David Mulder [Tue, 9 Mar 2021 18:13:40 +0000 (11:13 -0700)]
samba-gpupdate: Check sysvol download paths in case-insensitive way

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

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Björn Baumbach <bb@sernet.de>
3 years agosamba-gpupdate: Test that sysvol paths download in case-insensitive way
David Mulder [Tue, 9 Mar 2021 19:30:14 +0000 (12:30 -0700)]
samba-gpupdate: Test that sysvol paths download in case-insensitive way

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

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Björn Baumbach <bb@sernet.de>
3 years agosamba-gpupdate: Enable the Startup Scripts Extension
David Mulder [Tue, 9 Mar 2021 16:28:15 +0000 (09:28 -0700)]
samba-gpupdate: Enable the Startup Scripts Extension

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Björn Baumbach <bb@sernet.de>
3 years agosamba-tool: gpo manage sudoers handle missing and dispersed principal names
David Mulder [Tue, 9 Mar 2021 16:16:27 +0000 (09:16 -0700)]
samba-tool: gpo manage sudoers handle missing and dispersed principal names

If we don't anticipate a missing principal name,
samba-tool crashes. Also, principal names could
be in dispersed listelements.

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Björn Baumbach <bb@sernet.de>
3 years agosamba-tool: Ensure that gpo manage sudoers handles missing/dispersed principal names
David Mulder [Tue, 9 Mar 2021 21:14:24 +0000 (14:14 -0700)]
samba-tool: Ensure that gpo manage sudoers handles missing/dispersed principal names

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Björn Baumbach <bb@sernet.de>
3 years agoUpdate status of SMB_VFS_SETXATTR
Noel Power [Mon, 1 Mar 2021 15:22:32 +0000 (15:22 +0000)]
Update status of SMB_VFS_SETXATTR

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Mar 11 18:58:46 UTC 2021 on sn-devel-184

3 years agoVFS: Remove SMB_VFS_SETXATTR, no longer used
Noel Power [Fri, 19 Feb 2021 10:39:49 +0000 (10:39 +0000)]
VFS: Remove SMB_VFS_SETXATTR, no longer used

                                   ---------------
                                  /               \
                                 /      REST       \
                                /        IN         \
                               /        PEACE        \
                              /                       \
                              |                       |
                              |   SMB_VFS_SETXATTR    |
                              |                       |
                              |                       |
                              |       19 February     |
                              |          2021         |
                              |                       |
                              |                       |
                             *|     *  *  *           | *
                    _________)/\\_//(\/(/\)/\//\/\////|_)_______

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Noel Power <noel.power@suse.com>
3 years agos3/modules: snapper: Add missing fsetxattr_fn impl
Noel Power [Wed, 10 Mar 2021 09:24:04 +0000 (09:24 +0000)]
s3/modules: snapper: Add missing fsetxattr_fn impl

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3/modules: shadow_copy2: Add new fsetxattr_fn implementation
Noel Power [Fri, 19 Feb 2021 15:03:01 +0000 (15:03 +0000)]
s3/modules: shadow_copy2: Add new fsetxattr_fn implementation

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3/modules: ceph_snapshots: Add missing fsetxattr_fn implementation
Noel Power [Fri, 19 Feb 2021 14:51:14 +0000 (14:51 +0000)]
s3/modules: ceph_snapshots: Add missing fsetxattr_fn implementation

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos2/modules: nfs4acl_smb4acl_set_fn SMB_VFS_NEXT_SETXATTR -> SMB_VFS_NEXT_FFSETXATTR
Noel Power [Fri, 19 Feb 2021 14:47:07 +0000 (14:47 +0000)]
s2/modules: nfs4acl_smb4acl_set_fn SMB_VFS_NEXT_SETXATTR -> SMB_VFS_NEXT_FFSETXATTR

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3/modules: fake_acls_lchown use SMB_VFS_NEXT_FSET
Noel Power [Fri, 19 Feb 2021 16:21:58 +0000 (16:21 +0000)]
s3/modules: fake_acls_lchown use SMB_VFS_NEXT_FSET

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3/modules: fake_acls: SMB_VFS_NEXT_SETXATTR -> SMB_VFS_NEXT_FSETXATTR
Noel Power [Fri, 19 Feb 2021 13:35:04 +0000 (13:35 +0000)]
s3/modules: fake_acls: SMB_VFS_NEXT_SETXATTR -> SMB_VFS_NEXT_FSETXATTR

Ensure fake_acls_sys_acl_set_file gets properly setup smb_filename

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3/lib: SMB_VFS_NEXT_SETXATTR -> SMB_VFS_NEXT_FSETXATTR
Noel Power [Fri, 19 Feb 2021 12:43:00 +0000 (12:43 +0000)]
s3/lib: SMB_VFS_NEXT_SETXATTR -> SMB_VFS_NEXT_FSETXATTR

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3/torture: SMB_VFS_SETXATTR -> SMB_VFS_FSETXATTR
Noel Power [Fri, 19 Feb 2021 09:17:57 +0000 (09:17 +0000)]
s3/torture: SMB_VFS_SETXATTR -> SMB_VFS_FSETXATTR

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3/modules: stream_dir make sure mark_file_valid is called with fsp
Noel Power [Thu, 18 Feb 2021 21:13:07 +0000 (21:13 +0000)]
s3/modules: stream_dir make sure mark_file_valid is called with fsp

can we get this further up the call path ???

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3/modules: streams_xattr_renameat SMB_VFS_SETXATTR -> SMB_VFS_FSETXATTR
Noel Power [Thu, 18 Feb 2021 20:18:46 +0000 (20:18 +0000)]
s3/modules: streams_xattr_renameat SMB_VFS_SETXATTR -> SMB_VFS_FSETXATTR

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3/modules: streams_xattr: Fix fname passed to SETXATTR
Noel Power [Thu, 18 Feb 2021 19:34:15 +0000 (19:34 +0000)]
s3/modules: streams_xattr: Fix fname passed to SETXATTR

we see to be overwritting the 'old' stream, this change fixes it

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3/modules: streams_xattr_ftruncate SMB_VFS_SETXATTR -> SMB_VFS_FSETXATTR
Noel Power [Thu, 18 Feb 2021 18:56:56 +0000 (18:56 +0000)]
s3/modules: streams_xattr_ftruncate SMB_VFS_SETXATTR -> SMB_VFS_FSETXATTR

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3/modules: streams_xattr_pwrite SMB_VFS_SETXATTR -> SMB_VFS_FSETXATTR
Noel Power [Thu, 18 Feb 2021 18:14:16 +0000 (18:14 +0000)]
s3/modules: streams_xattr_pwrite SMB_VFS_SETXATTR -> SMB_VFS_FSETXATTR

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agostreams_xattr_openat SMB_VFS_SETXATTR -> SMB_VFS_FSETXATTR
Noel Power [Thu, 18 Feb 2021 17:04:24 +0000 (17:04 +0000)]
streams_xattr_openat SMB_VFS_SETXATTR -> SMB_VFS_FSETXATTR

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3/modules: vfs_acl_xattr SMB_VFS_SETXATTR -> SMB_VFS_FSETXATTR
Noel Power [Thu, 18 Feb 2021 14:46:54 +0000 (14:46 +0000)]
s3/modules: vfs_acl_xattr SMB_VFS_SETXATTR -> SMB_VFS_FSETXATTR

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3/smbd: Detect and fail attempt to set_ea_dos_attribute on link
Noel Power [Wed, 10 Mar 2021 09:12:37 +0000 (09:12 +0000)]
s3/smbd: Detect and fail attempt to set_ea_dos_attribute on link

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3/smbd: SMB_VFS_SETXATTR => SMB_VFS_FSETXATTR
Noel Power [Wed, 17 Feb 2021 09:27:40 +0000 (09:27 +0000)]
s3/smbd: SMB_VFS_SETXATTR => SMB_VFS_FSETXATTR

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3/smbd: set_create_timespec_ea should create smb_fname with valid fsp
Noel Power [Thu, 18 Feb 2021 10:54:23 +0000 (10:54 +0000)]
s3/smbd: set_create_timespec_ea should create smb_fname with valid fsp

we need to call file_set_dosmode (which ends up calling
SMB_VFS_FSETXATTR via set_ea_dos_attribute) has smb_fname set up
with a valid smb_fname->fsp

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3/smb3: ensure file_set_dosmode is passed valid smb_fname->fsp
Noel Power [Thu, 18 Feb 2021 11:05:34 +0000 (11:05 +0000)]
s3/smb3: ensure file_set_dosmode is passed valid smb_fname->fsp

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3/smb3: ensure file_set_dosmode is passed valid smb_fname->fsp
Noel Power [Thu, 18 Feb 2021 11:04:55 +0000 (11:04 +0000)]
s3/smb3: ensure file_set_dosmode is passed valid smb_fname->fsp

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3/smb3: ensure file_set_dosmode is passed valid smb_fname->fsp
Noel Power [Thu, 18 Feb 2021 11:01:10 +0000 (11:01 +0000)]
s3/smb3: ensure file_set_dosmode is passed valid smb_fname->fsp

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3/modules: ensure catia_set_dos_attributes passes on pathref
Noel Power [Wed, 17 Feb 2021 09:34:40 +0000 (09:34 +0000)]
s3/modules: ensure catia_set_dos_attributes passes on pathref

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3/smbd: posix_acls SMB_VFS_SETXATTR -> SMB_VFS_FSETXATTR
Noel Power [Tue, 16 Feb 2021 20:25:31 +0000 (20:25 +0000)]
s3/smbd: posix_acls SMB_VFS_SETXATTR -> SMB_VFS_FSETXATTR

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3/modules: posixacl convert from SMB_VFS_SETXATTR -> SMB_VFS_FSETXATTR
Noel Power [Tue, 16 Feb 2021 19:55:23 +0000 (19:55 +0000)]
s3/modules: posixacl convert from SMB_VFS_SETXATTR -> SMB_VFS_FSETXATTR

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3/lib: adouble SMB_VFS_SETXATTR => SMB_VFS_FSETXATTR
Noel Power [Tue, 16 Feb 2021 19:25:59 +0000 (19:25 +0000)]
s3/lib: adouble SMB_VFS_SETXATTR => SMB_VFS_FSETXATTR

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3/smbd: set_ea SMB_VFS_FSETXATTR => SMB_VFS_FSETXATTR
Noel Power [Tue, 16 Feb 2021 18:49:19 +0000 (18:49 +0000)]
s3/smbd: set_ea SMB_VFS_FSETXATTR => SMB_VFS_FSETXATTR

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agoidmap_nss: Do not return SID from unixids_to_sids on type mismatch
Christof Schmitt [Fri, 5 Mar 2021 23:07:54 +0000 (16:07 -0700)]
idmap_nss: Do not return SID from unixids_to_sids on type mismatch

The call to winbind_lookup_name already wrote the result in the id_map
array. The later check for the type detected a mismatch, but that did
not remove the SID from the result struct.

Change this by first assigning the SID to a temporary variable and only
write it to the id_map array after the type checks.

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Mar 11 08:38:41 UTC 2021 on sn-devel-184

3 years agoidmap_rfc2307: Do not return SID from unixids_to_sids on type mismatch
Christof Schmitt [Fri, 5 Mar 2021 23:01:13 +0000 (16:01 -0700)]
idmap_rfc2307: Do not return SID from unixids_to_sids on type mismatch

The call to winbind_lookup_name already wrote the result in the id_map
array. The later check for the type detected a mismatch, but that did
not remove the SID from the result struct.

Change this by first assigning the SID to a temporary variable and only
write it to the id_map array after the type checks.

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

Signed-off-by: Christof Schmitt <cs@samba.org>
3 years agowinbind: Only use unixid2sid mapping when module reports ID_MAPPED
Christof Schmitt [Fri, 5 Mar 2021 22:48:29 +0000 (15:48 -0700)]
winbind: Only use unixid2sid mapping when module reports ID_MAPPED

Only consider a mapping to be valid when the idmap module reports
ID_MAPPED. Otherwise return the null SID.

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agosmbd: Ensure errno is preserved across fsp destructor
Sachin Prabhu [Wed, 10 Mar 2021 12:22:07 +0000 (12:22 +0000)]
smbd: Ensure errno is preserved across fsp destructor

The errno can be overwritten by the calls made by the fsp destructor.
This can cause problems if the original errno was required by subsequent
calls.

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Mar 10 22:55:17 UTC 2021 on sn-devel-184

3 years agopython: Disable calls to _dsdb_garbage_collect_tombstones without addc
David Mulder [Thu, 3 Dec 2020 17:32:09 +0000 (17:32 +0000)]
python: Disable calls to _dsdb_garbage_collect_tombstones without addc

dsdb._dsdb_garbage_collect_tombstones isn't
built without the addc, so ignore calls to it
in samdb.

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool: Enable pydns without ad dc
David Mulder [Thu, 17 Sep 2020 19:27:41 +0000 (13:27 -0600)]
samba-tool: Enable pydns without ad dc

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agosamba-tool: Enable pydsdb without ad dc
David Mulder [Thu, 17 Sep 2020 19:27:14 +0000 (13:27 -0600)]
samba-tool: Enable pydsdb without ad dc

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopython: Test samdb import
David Mulder [Mon, 7 Dec 2020 14:39:00 +0000 (07:39 -0700)]
python: Test samdb import

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agoldb: dn tests use cmocka print functions
Douglas Bagnall [Fri, 5 Mar 2021 02:49:56 +0000 (15:49 +1300)]
ldb: dn tests use cmocka print functions

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Björn Jacke <bjacke@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Mar 10 09:51:25 UTC 2021 on sn-devel-184

3 years agoldb_match: remove redundant check
Douglas Bagnall [Wed, 3 Mar 2021 06:54:37 +0000 (19:54 +1300)]
ldb_match: remove redundant check

We already ensure the no-trailing-asterisk case ends at the end of the
string.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Björn Jacke <bjacke@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agoldb: add tests for ldb_wildcard_compare
Douglas Bagnall [Fri, 5 Mar 2021 02:47:56 +0000 (15:47 +1300)]
ldb: add tests for ldb_wildcard_compare

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Björn Jacke <bjacke@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agoldb_match: trailing chunk must match end of string
Douglas Bagnall [Wed, 3 Mar 2021 06:17:36 +0000 (19:17 +1300)]
ldb_match: trailing chunk must match end of string

A wildcard search is divided into chunks by the asterisks. While most
chunks match the first suitable string, the last chunk matches the
last possible string (unless there is a trailing asterisk, in which
case this distinction is moot).

We always knew this in our hearts, but we tried to do it in a funny
complicated way that stepped through the string, comparing here and
there, leading to CVE-2019-3824 and missed matches (bug 14044).

With this patch, we just jump to the end of the string and compare it.
As well as being correct, this should also improve performance, as the
previous algorithm involved a quadratic loop of erroneous memmem()s.

See https://tools.ietf.org/html/rfc4517

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Björn Jacke <bjacke@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agolib/util: Replace buggy string_sub_talloc() with talloc_string_sub() in lib/util
Andrew Bartlett [Wed, 10 Mar 2021 03:16:42 +0000 (16:16 +1300)]
lib/util: Replace buggy string_sub_talloc() with talloc_string_sub() in lib/util

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Mar 10 08:06:25 UTC 2021 on sn-devel-184

3 years agolib/param: Remove lpcfg_volume_label() and only caller in NTVFS file server
Andrew Bartlett [Wed, 10 Mar 2021 02:59:10 +0000 (15:59 +1300)]
lib/param: Remove lpcfg_volume_label() and only caller in NTVFS file server

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agolib/param: Remove unused functions in lib/param/loadparm.c
Andrew Bartlett [Wed, 10 Mar 2021 02:31:05 +0000 (15:31 +1300)]
lib/param: Remove unused functions in lib/param/loadparm.c

The lib/param code does not service smbd, no home directories nor printers are handled
in this codebase and these functions are uncalled.

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agowinbindd: Apply some const to normalize_name_map()
Volker Lendecke [Tue, 23 Feb 2021 15:27:44 +0000 (16:27 +0100)]
winbindd: Apply some const to normalize_name_map()

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): Tue Mar  9 23:45:51 UTC 2021 on sn-devel-184

3 years agosmbd: Fix a DEBUG message
Volker Lendecke [Fri, 5 Mar 2021 10:36:20 +0000 (11:36 +0100)]
smbd: Fix a DEBUG message

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosrvsrvc: Reload conf after changing a share
Volker Lendecke [Tue, 9 Mar 2021 07:50:26 +0000 (08:50 +0100)]
srvsrvc: Reload conf after changing a share

The call to messaging_send_all() skips ourselves. This is tested in
source3/script/tests/test_rpcclientsrvsvc.sh, which right now we only
survive because the rpcclient call spawns a new smbd, which reloads
smb.conf. Once you start running srvsvcd in a long-running daemon,
this fails.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolib: Fix file_ploadv_send/recv cleanup
Volker Lendecke [Sat, 13 Feb 2021 10:40:34 +0000 (11:40 +0100)]
lib: Fix file_ploadv_send/recv cleanup

We have to first TALLOC_FREE() the waiting event before closing the
pipe. Otherwise EPOLL_CTL_DEL is unhappy and might remove an unrelated
file descriptor.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agog_lock: Add extensive debug information
Volker Lendecke [Thu, 4 Feb 2021 17:46:59 +0000 (18:46 +0100)]
g_lock: Add extensive debug information

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibrpc: Simplify struct dcesrv_handle
Volker Lendecke [Wed, 27 Jan 2021 13:59:16 +0000 (14:59 +0100)]
librpc: Simplify struct dcesrv_handle

This saves a tiny bit of memory: dom_sid_dup() allocates a full struct
dom_sid, although it might not have to. Save the additional talloc
object and the pointer, be more cache-friendly

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibcli: Simplify tstream_npa_connect_readv_done()
Volker Lendecke [Tue, 16 Feb 2021 16:21:57 +0000 (17:21 +0100)]
libcli: Simplify tstream_npa_connect_readv_done()

tevent_req_error takes care of the ==0 case

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibcli: Add a NULL check to tstream_npa
Volker Lendecke [Tue, 16 Feb 2021 16:21:33 +0000 (17:21 +0100)]
libcli: Add a NULL check to tstream_npa

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolib: Fix samba_sockaddr_[get|set]_port
Volker Lendecke [Sat, 13 Feb 2021 10:16:17 +0000 (11:16 +0100)]
lib: Fix samba_sockaddr_[get|set]_port

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolib: Protect "messaging_dgm_init()" from NULL dirs
Volker Lendecke [Sat, 6 Mar 2021 14:49:46 +0000 (15:49 +0100)]
lib: Protect "messaging_dgm_init()" from NULL dirs

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agorpc_server: Use any_nt_status_not_ok() in srv_netlog_nt.c
Volker Lendecke [Wed, 24 Feb 2021 15:01:27 +0000 (16:01 +0100)]
rpc_server: Use any_nt_status_not_ok() in srv_netlog_nt.c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agorpc_server: Use direct struct initialization instead of ZERO_STRUCT
Volker Lendecke [Wed, 24 Feb 2021 14:49:49 +0000 (15:49 +0100)]
rpc_server: Use direct struct initialization instead of ZERO_STRUCT

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agoepmapper: talloc_stackframe() panics on failure
Volker Lendecke [Tue, 26 Jan 2021 13:17:02 +0000 (14:17 +0100)]
epmapper: talloc_stackframe() panics on failure

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agorpc_server: talloc_stackframe() panics on failure
Volker Lendecke [Fri, 5 Feb 2021 07:06:57 +0000 (08:06 +0100)]
rpc_server: talloc_stackframe() panics on failure

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agorpc_client: Save a few lines with direct struct initialization
Volker Lendecke [Sat, 6 Feb 2021 07:32:36 +0000 (08:32 +0100)]
rpc_client: Save a few lines with direct struct initialization

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agorpcclient: talloc_stackframe() panics on failure
Volker Lendecke [Sat, 6 Feb 2021 14:56:52 +0000 (15:56 +0100)]
rpcclient: talloc_stackframe() panics on failure

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolib: Align integer types
Volker Lendecke [Fri, 12 Feb 2021 18:17:34 +0000 (19:17 +0100)]
lib: Align integer types

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolib: Avoid a cast in messages_dgm
Volker Lendecke [Sun, 14 Feb 2021 08:15:15 +0000 (09:15 +0100)]
lib: Avoid a cast in messages_dgm

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolib: Avoid a memleak in pidfile_unlink()
Volker Lendecke [Sat, 13 Feb 2021 21:19:42 +0000 (22:19 +0100)]
lib: Avoid a memleak in pidfile_unlink()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolib: Avoid ZERO_STRUCT in pidfile_pid()
Volker Lendecke [Sat, 13 Feb 2021 21:19:12 +0000 (22:19 +0100)]
lib: Avoid ZERO_STRUCT in pidfile_pid()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolib: Make socket options output less chatty
Volker Lendecke [Sat, 13 Feb 2021 11:49:57 +0000 (12:49 +0100)]
lib: Make socket options output less chatty

All the socket options were a large block in debug output. Put them on
one line.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolib: Fix an uninitialized variable read
Volker Lendecke [Thu, 11 Feb 2021 07:03:38 +0000 (08:03 +0100)]
lib: Fix an uninitialized variable read

If cli_rpc_pipe_open_noauth() fails, we end up in TALLOC_FREE() of
"p", which is uninitialized.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibrpc: Fix typos
Volker Lendecke [Fri, 29 Jan 2021 09:13:13 +0000 (10:13 +0100)]
librpc: Fix typos

While there, wrap the long comment lines

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: Fix a typo (recieve->receive), reformat comment
Volker Lendecke [Fri, 12 Feb 2021 11:49:22 +0000 (12:49 +0100)]
smbd: Fix a typo (recieve->receive), reformat comment

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibrpc: Fix a typo, while there linewrap the comment
Volker Lendecke [Wed, 27 Jan 2021 13:53:15 +0000 (14:53 +0100)]
librpc: Fix a typo, while there linewrap the comment

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agorpc_server: Fix a typo
Volker Lendecke [Wed, 24 Feb 2021 12:33:58 +0000 (13:33 +0100)]
rpc_server: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agowinbindd: Fix a typo
Volker Lendecke [Mon, 22 Feb 2021 18:32:00 +0000 (19:32 +0100)]
winbindd: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolib: Fix a typo
Volker Lendecke [Wed, 24 Feb 2021 20:30:59 +0000 (21:30 +0100)]
lib: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agorpc_client: Fix a typo
Volker Lendecke [Fri, 26 Feb 2021 20:38:19 +0000 (21:38 +0100)]
rpc_client: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolib: Fix a typo
Volker Lendecke [Mon, 1 Mar 2021 12:36:45 +0000 (13:36 +0100)]
lib: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agoctdb: Fix a typo
Volker Lendecke [Wed, 3 Mar 2021 08:58:50 +0000 (09:58 +0100)]
ctdb: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agorpc_server: Align integer types
Volker Lendecke [Wed, 24 Feb 2021 12:33:44 +0000 (13:33 +0100)]
rpc_server: Align integer types

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agorpc_server: Fix a typo
Volker Lendecke [Sun, 7 Mar 2021 08:57:05 +0000 (09:57 +0100)]
rpc_server: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosamba: Fix indentation
Volker Lendecke [Sun, 7 Mar 2021 09:11:09 +0000 (10:11 +0100)]
samba: Fix indentation

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosamba-tool: Add a gpo command for setting VGP Issue Group Policy
David Mulder [Fri, 19 Feb 2021 19:36:50 +0000 (12:36 -0700)]
samba-tool: Add a gpo command for setting VGP Issue Group Policy

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Mar  8 20:57:50 UTC 2021 on sn-devel-184

3 years agosamba-tool: Test gpo manage issue set command
David Mulder [Fri, 19 Feb 2021 19:33:42 +0000 (12:33 -0700)]
samba-tool: Test gpo manage issue set command

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosamba-tool: Add a gpo command for listing VGP Issue Group Policy
David Mulder [Fri, 19 Feb 2021 19:25:00 +0000 (12:25 -0700)]
samba-tool: Add a gpo command for listing VGP Issue Group Policy

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosamba-tool: Test gpo manage issue list command
David Mulder [Fri, 19 Feb 2021 18:01:08 +0000 (11:01 -0700)]
samba-tool: Test gpo manage issue list command

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agogpo: Apply Group Policy Issue setting from VGP
David Mulder [Fri, 19 Feb 2021 17:22:04 +0000 (10:22 -0700)]
gpo: Apply Group Policy Issue setting from VGP

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agogpo: Test Group Policy VGP Issue Policy
David Mulder [Fri, 19 Feb 2021 16:45:38 +0000 (09:45 -0700)]
gpo: Test Group Policy VGP Issue Policy

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosamba-tool: Add a gpo command for setting VGP MOTD Group Policy
David Mulder [Thu, 18 Feb 2021 16:42:49 +0000 (09:42 -0700)]
samba-tool: Add a gpo command for setting VGP MOTD Group Policy

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosamba-tool: Test gpo manage motd set command
David Mulder [Thu, 18 Feb 2021 15:50:25 +0000 (08:50 -0700)]
samba-tool: Test gpo manage motd set command

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosamba-tool: Add a gpo command for listing VGP MOTD Group Policy
David Mulder [Thu, 18 Feb 2021 14:50:08 +0000 (07:50 -0700)]
samba-tool: Add a gpo command for listing VGP MOTD Group Policy

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosamba-tool: Test gpo manage motd list command
David Mulder [Wed, 17 Feb 2021 21:58:51 +0000 (14:58 -0700)]
samba-tool: Test gpo manage motd list command

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agogpo: Apply Group Policy MOTD setting from VGP
David Mulder [Wed, 17 Feb 2021 21:43:50 +0000 (14:43 -0700)]
gpo: Apply Group Policy MOTD setting from VGP

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agogpo: Test Group Policy VGP MOTD Policy
David Mulder [Wed, 17 Feb 2021 20:24:55 +0000 (13:24 -0700)]
gpo: Test Group Policy VGP MOTD Policy

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agogpo: Don't free talloc pointer held elsewhere
David Mulder [Fri, 26 Feb 2021 22:02:02 +0000 (15:02 -0700)]
gpo: Don't free talloc pointer held elsewhere

Freeing this pointer produces the following error:
ERROR: talloc_free with references at ../../libgpo/pygpo.c:481
reference at ../../pytalloc_util.c:164
reference at ../../pytalloc_util.c:164

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Mar  8 19:08:07 UTC 2021 on sn-devel-184

3 years agogpo: vgp_sudoers_ext handle missing and dispersed principal names
David Mulder [Fri, 26 Feb 2021 16:46:49 +0000 (09:46 -0700)]
gpo: vgp_sudoers_ext handle missing and dispersed principal names

If we don't anticipate a missing principal name,
the extension crashes. Also, principal names could
be in dispersed listelements.

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>