]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
4 years agolib:krb_wrap: Add missing error check in smb_krb5_salt_principal_str()
Andreas Schneider [Tue, 14 Dec 2021 15:12:43 +0000 (16:12 +0100)] 
lib:krb_wrap: Add missing error check in smb_krb5_salt_principal_str()

Found by covscan.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3:winbindd: Remove dead code from sam_rids_to_names()
Andreas Schneider [Tue, 14 Dec 2021 14:46:05 +0000 (15:46 +0100)] 
s3:winbindd: Remove dead code from sam_rids_to_names()

domain_name is never NULL in this case. Found by covscan.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos4:dns_server: Remove less-than-zero comparison of an unsigned value
Andreas Schneider [Tue, 14 Dec 2021 14:42:06 +0000 (15:42 +0100)] 
s4:dns_server: Remove less-than-zero comparison of an unsigned value

This will never be true. Found by covscan

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoctdb:client: Initialize structs and pointers in ctdb_ctrl_(en|dis)able_node()
Andreas Schneider [Tue, 14 Dec 2021 14:38:45 +0000 (15:38 +0100)] 
ctdb:client: Initialize structs and pointers in ctdb_ctrl_(en|dis)able_node()

Found by covscan.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3:libnet: Initialize struct ODJ_POLICY_DNS_DOMAIN_INFO
Andreas Schneider [Fri, 10 Dec 2021 14:10:39 +0000 (15:10 +0100)] 
s3:libnet: Initialize struct ODJ_POLICY_DNS_DOMAIN_INFO

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolib:util: Check return value of tdb_parse_record()
Andreas Schneider [Fri, 10 Dec 2021 14:06:03 +0000 (15:06 +0100)] 
lib:util: Check return value of tdb_parse_record()

This makes covscan happy.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3:lib: Do not close fd = -1 on fail in netapi example
Andreas Schneider [Fri, 10 Dec 2021 14:03:20 +0000 (15:03 +0100)] 
s3:lib: Do not close fd = -1 on fail in netapi example

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3:lib: Fix memory leak in netapi examples
Andreas Schneider [Fri, 10 Dec 2021 13:56:08 +0000 (14:56 +0100)] 
s3:lib: Fix memory leak in netapi examples

Found by covscan.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3: smbd: In call_trans2qfilepathinfo(), remove unneeded vfs_stat().
Jeremy Allison [Tue, 14 Dec 2021 17:50:12 +0000 (09:50 -0800)] 
s3: smbd: In call_trans2qfilepathinfo(), remove unneeded vfs_stat().

We know at this point that we have VALID_STAT(smb_fname->st).

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Dec 15 19:26:50 UTC 2021 on sn-devel-184

4 years agos3: smbd: In call_trans2qfilepathinfo(), we must have an existing object in the QPATH...
Jeremy Allison [Tue, 14 Dec 2021 17:46:51 +0000 (09:46 -0800)] 
s3: smbd: In call_trans2qfilepathinfo(), we must have an existing object in the QPATHINFO case.

qpathinfo must operate on an existing file, so we
can exit early if filename_convert() returned the "new file"
NT_STATUS_OK, !VALID_STAT case.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
4 years agos3: smbd: Inside call_trans2setfilepathinfo(), for the TRANSACT2_SETPATHINFO case...
Jeremy Allison [Tue, 14 Dec 2021 00:54:07 +0000 (16:54 -0800)] 
s3: smbd: Inside call_trans2setfilepathinfo(), for the TRANSACT2_SETPATHINFO case, we don't need to re-stat.

If we need a valid filesystem object, and we have a !VALID_STAT()
return from filename_convert(), the previous commit has already
errored out. We don't need a re-stat call here.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
4 years agos3: smbd: Inside call_trans2setfilepathinfo(), for the TRANSACT2_SETPATHINFO case...
Jeremy Allison [Tue, 14 Dec 2021 00:48:14 +0000 (16:48 -0800)] 
s3: smbd: Inside call_trans2setfilepathinfo(), for the TRANSACT2_SETPATHINFO case, ensure we have a VALID_STAT return from filename_convert().

Remember, filename_convert() can return NT_STATUS_OK
with !VALID_STAT() if the last component doesn't exist,
as this may be an object create.

For call_trans2setfilepathinfo(), there are only 4 info levels
for the TRANSACT2_SETPATHINFO (pathname) case that don't require
an existing filesystem object (i.e. a VALID_STAT()) in the return
from filename_convert() as they can create an object in the
filesystem.

If we don't get a VALID_STAT() and the info level isn't one of
those 4, error out.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
4 years agos3: smbd: call_trans2setfilepathinfo(), TRANSACT2_SETFILEINFO case, use helper functi...
Jeremy Allison [Mon, 13 Dec 2021 22:19:35 +0000 (14:19 -0800)] 
s3: smbd: call_trans2setfilepathinfo(), TRANSACT2_SETFILEINFO case, use helper function vfs_stat().

This isn't a change in behavior, even though the
old comment says: "Always do lstat for UNIX calls".

A previous commit enforces POSIX pathname negotiation
before allowing UNIX info levels to be processed here,
so we can guarantee that SMB_FILENAME_POSIX_PATH is set
on smb_fname if we're allowing a UNIX info level.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
4 years agos3: smbd: In call_trans2qfilepathinfo(), TRANSACT2_QPATHINFO, use helper function...
Jeremy Allison [Mon, 13 Dec 2021 22:13:59 +0000 (14:13 -0800)] 
s3: smbd: In call_trans2qfilepathinfo(), TRANSACT2_QPATHINFO, use helper function vfs_stat().

This isn't a change in behavior, even though the
old comment says: "Always do lstat for UNIX calls".

A previous commit enforces POSIX pathname negotiation
before allowing UNIX info levels to be processed here,
so we can guarantee that SMB_FILENAME_POSIX_PATH is set
on smb_fname if we're allowing a UNIX info level.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
4 years agos3: smbd: In call_trans2qfilepathinfo(), TRANSACT2_QPATHINFO on a named stream case...
Jeremy Allison [Mon, 13 Dec 2021 22:09:33 +0000 (14:09 -0800)] 
s3: smbd: In call_trans2qfilepathinfo(), TRANSACT2_QPATHINFO on a named stream case, use helper function vfs_stat().

This isn't a change in behavior, even though the
old comment says: "Always do lstat for UNIX calls".

A previous commit enforces POSIX pathname negotiation
before allowing UNIX info levels to be processed here,
so we can guarantee that SMB_FILENAME_POSIX_PATH is set
on smb_fname if we're allowing a UNIX info level.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
4 years agos3: smbd: In call_trans2qfilepathinfo(), TRANSACT2_QFILEINFO case, use helper functio...
Jeremy Allison [Mon, 13 Dec 2021 22:05:32 +0000 (14:05 -0800)] 
s3: smbd: In call_trans2qfilepathinfo(), TRANSACT2_QFILEINFO case, use helper function vfs_stat().

This isn't a change in behavior, even though the
old comment says: "Always do lstat for UNIX calls".

A previous commit enforces POSIX pathname negotiation
before allowing UNIX info levels to be processed here,
so we can guarantee that SMB_FILENAME_POSIX_PATH is set
on smb_fname if we're allowing a UNIX info level.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
4 years agos3: smbd: In parent_dirname_compatible_open(), use helper function vfs_stat().
Jeremy Allison [Tue, 14 Dec 2021 00:08:14 +0000 (16:08 -0800)] 
s3: smbd: In parent_dirname_compatible_open(), use helper function vfs_stat().

This is a change in behavior, but the old behavior was incorrect.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
4 years agos3: smbd: In vfs_stat_smb_basename() use vfs_stat() helper function.
Jeremy Allison [Mon, 13 Dec 2021 22:02:51 +0000 (14:02 -0800)] 
s3: smbd: In vfs_stat_smb_basename() use vfs_stat() helper function.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
4 years agos3: smbd: In smbd_smb2_getinfo_send(), use vfs_stat() utility function.
Jeremy Allison [Mon, 13 Dec 2021 21:45:13 +0000 (13:45 -0800)] 
s3: smbd: In smbd_smb2_getinfo_send(), use vfs_stat() utility function.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
4 years agos3: smbd: In stat_cache_lookup(), remove unused posix_paths param.
Noel Power [Wed, 15 Dec 2021 15:55:02 +0000 (15:55 +0000)] 
s3: smbd: In stat_cache_lookup(), remove unused posix_paths param.

Signed-off-by: Noel Power <npower@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3: smbd: In stat_cache_lookup(), use vfs_stat() utility function.
Jeremy Allison [Mon, 13 Dec 2021 21:44:25 +0000 (13:44 -0800)] 
s3: smbd: In stat_cache_lookup(), use vfs_stat() utility function.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
4 years agos3: smbd: In setup_close_full_information() the posix_open parameter is not needed...
Noel Power [Wed, 15 Dec 2021 15:36:22 +0000 (15:36 +0000)] 
s3: smbd: In setup_close_full_information() the posix_open parameter is not needed anymore.

Signed-off-by: Noel Power <npower@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3: smbd: In setup_close_full_information() use vfs_stat() helper function.
Jeremy Allison [Mon, 13 Dec 2021 21:43:06 +0000 (13:43 -0800)] 
s3: smbd: In setup_close_full_information() use vfs_stat() helper function.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
4 years agos3: smbd: In check_parent_exists() use utility function vfs_stat().
Jeremy Allison [Mon, 13 Dec 2021 21:42:35 +0000 (13:42 -0800)] 
s3: smbd: In check_parent_exists() use utility function vfs_stat().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
4 years agotests/krb5: Add tests for AS-REQ to self with FAST
Joseph Sutton [Tue, 14 Dec 2021 06:16:15 +0000 (19:16 +1300)] 
tests/krb5: Add tests for AS-REQ to self with FAST

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Dec 15 04:33:11 UTC 2021 on sn-devel-184

4 years agotests/krb5: Correctly determine whether tickets are service tickets
Joseph Sutton [Tue, 14 Dec 2021 06:16:00 +0000 (19:16 +1300)] 
tests/krb5: Correctly determine whether tickets are service tickets

Previously we expected tickets to contain a ticket checksum if the sname
was not the krbtgt. However, the ticket checksum should not be present
if we are performing an AS-REQ to our own account. Now we determine a
ticket is a service ticket only if the request is also a TGS-REQ.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agotests/krb5: Generate unique UPNs for enterprise tests
Joseph Sutton [Tue, 14 Dec 2021 06:16:26 +0000 (19:16 +1300)] 
tests/krb5: Generate unique UPNs for enterprise tests

This helps to avoid problems with account creation on Windows due to UPN
uniqueness constraints.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agos4:torture: Fix typo
Joseph Sutton [Thu, 9 Dec 2021 00:18:54 +0000 (13:18 +1300)] 
s4:torture: Fix typo

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agos4:torture: Remove comments that are no longer relevant
Joseph Sutton [Thu, 9 Dec 2021 00:18:45 +0000 (13:18 +1300)] 
s4:torture: Remove comments that are no longer relevant

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agokdc: Pad UPN_DNS_INFO PAC buffer
Joseph Sutton [Fri, 10 Dec 2021 01:59:22 +0000 (14:59 +1300)] 
kdc: Pad UPN_DNS_INFO PAC buffer

Padding this buffer to a multiple of 8 bytes allows the PAC buffer
padding to match Windows.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agoRevert "s4/heimdal/lib/krb5/pac.c: Align PAC buffers to match Windows"
Joseph Sutton [Tue, 14 Dec 2021 06:19:42 +0000 (19:19 +1300)] 
Revert "s4/heimdal/lib/krb5/pac.c: Align PAC buffers to match Windows"

This alignment should be done on the Samba side instead.

This reverts commit 28a5a586c8e9cd155d676dcfcb81a2587ace99d1.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agotests/krb5: Add tests for PAC buffer alignment
Joseph Sutton [Wed, 8 Dec 2021 22:56:55 +0000 (11:56 +1300)] 
tests/krb5: Add tests for PAC buffer alignment

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agos4:mitkdc: Call krb5_pac_init() in kdb_samba_db_sign_auth_data()
Andreas Schneider [Mon, 13 Dec 2021 07:31:49 +0000 (08:31 +0100)] 
s4:mitkdc: Call krb5_pac_init() in kdb_samba_db_sign_auth_data()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agos4:mitkdc: Do not allocate the PAC buffer in samba_make_krb5_pac()
Andreas Schneider [Thu, 7 Oct 2021 13:12:35 +0000 (15:12 +0200)] 
s4:mitkdc: Do not allocate the PAC buffer in samba_make_krb5_pac()

This will be allocated by the KDC in MIT KRB5 1.20 and newer.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agos4:mitkdc: Pass NULL to ks_get_pac() as the client_key
Andreas Schneider [Mon, 13 Dec 2021 14:48:08 +0000 (15:48 +0100)] 
s4:mitkdc: Pass NULL to ks_get_pac() as the client_key

This is unused with MIT KRB5 < 1.20 as this is probably not the right key.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agos4:mitkdc: Add support for pac_attrs and requester_sid
Andreas Schneider [Mon, 13 Dec 2021 07:33:05 +0000 (08:33 +0100)] 
s4:mitkdc: Add support for pac_attrs and requester_sid

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agos4:mitkdc: Reset errno to 0 for com_err messages
Andreas Schneider [Wed, 8 Dec 2021 08:17:32 +0000 (09:17 +0100)] 
s4:mitkdc: Reset errno to 0 for com_err messages

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agos4:mitkdc: Use talloc_get_type_abort() in ks_get_context()
Andreas Schneider [Wed, 8 Dec 2021 08:16:57 +0000 (09:16 +0100)] 
s4:mitkdc: Use talloc_get_type_abort() in ks_get_context()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agos4:mitkdc: Initilalize is_error with errno instead of EPERM(1)
Andreas Schneider [Tue, 19 Oct 2021 10:15:50 +0000 (12:15 +0200)] 
s4:mitkdc: Initilalize is_error with errno instead of EPERM(1)

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agotdb: Raw performance torture to beat tdb_increment_seqnum
Volker Lendecke [Mon, 13 Dec 2021 16:49:51 +0000 (17:49 +0100)] 
tdb: Raw performance torture to beat tdb_increment_seqnum

Running this on sn-devel-184 takes ~14 seconds with the atomic
ops. Without them I did not wait for it to finish. After reducing
NPROCS from 500 to 50 it still ran for more than a minute.

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 Dec 15 01:03:56 UTC 2021 on sn-devel-184

4 years agotdb: Use atomic operations for tdb_[increment|get]_seqnum
Volker Lendecke [Mon, 13 Dec 2021 16:42:12 +0000 (17:42 +0100)] 
tdb: Use atomic operations for tdb_[increment|get]_seqnum

With locking.tdb now based on g_lock.c code, we change locking.tdb a
lot more often. I have a customer case where LDX tortures smbd very
hard with 800+ concurrent connections, which now completely falls over
where 4.12 still worked fine. Some debugging showed a thundering herd
on fcntl locking.tdb index 48 (TDB_SEQNUM_OFS). We still use fcntl for
the seqnum, back when we converted the chainlocks to mutexes we did
not consider it to be a problem. Now it is, but all we need to do with
the SEQNUM is to increment it, so an __atomic_add_fetch() of one is
sufficient.

I've taken a look at the C11 standard atomics, but I could not figure
out how to use them properly, to me they seem more general to be
initialized first etc. All we need is a X86 "lock incl 48(%rax)" to be
emitted, and the gcc __atomic_add_fetch seems to do this.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoconfigure: Check for __atomic_add_fetch() and __atomic_load()
Volker Lendecke [Mon, 13 Dec 2021 16:40:52 +0000 (17:40 +0100)] 
configure: Check for __atomic_add_fetch() and __atomic_load()

To be used in the tdb_seqnum code soon

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolib/util: Add signal.h include
Bernd Kuhls [Sun, 12 Dec 2021 09:27:42 +0000 (10:27 +0100)] 
lib/util: Add signal.h include

Fixes build error with samba-4.15.3 and uClibc:

../../source3/printing/samba-bgqd.c: In function ‘main’:
../../source3/printing/samba-bgqd.c:340:21: error: ‘SIGPIPE’ undeclared (first use in this function); did you mean ‘EPIPE’?
../../source3/printing/samba-bgqd.c:384:14: error: ‘SIGTERM’ undeclared (first use in this function)

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Dec 13 16:22:28 UTC 2021 on sn-devel-184

4 years agos3: smbtorture3: Fix POSIX-BLOCKING-LOCK to actually negotiate SMB1+POSIX before...
Jeremy Allison [Thu, 18 Nov 2021 20:16:44 +0000 (12:16 -0800)] 
s3: smbtorture3: Fix POSIX-BLOCKING-LOCK to actually negotiate SMB1+POSIX before using POSIX calls.

This must be done before doing POSIX calls on a connection.

Remove the final entry in knownfail.d/posix_infolevel_fails

    samba3.smbtorture_s3.plain.POSIX-BLOCKING-LOCK.smbtorture\(nt4_dc_smb1\)

And remove the file knownfail.d/posix_infolevel_fails itself.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Sat Dec 11 12:03:36 UTC 2021 on sn-devel-184

4 years agos3: tests: Fix the samba3.blackbox.acl_xattr test to actually negotiate SMB1+POSIX...
Jeremy Allison [Fri, 19 Nov 2021 08:05:35 +0000 (00:05 -0800)] 
s3: tests: Fix the samba3.blackbox.acl_xattr test to actually negotiate SMB1+POSIX before using POSIX calls.

Remove the following entries in knownfail.d/posix_infolevel_fails.

    samba3.blackbox.acl_xattr.NT1.nt_affects_posix.*
    samba3.blackbox.acl_xattr.NT1.nt_affects_chown.*
    samba3.blackbox.acl_xattr.NT1.nt_affects_chgrp.*

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: tests: Fix the samba3.blackbox.inherit_owner test to actually negotiate SMB1...
Jeremy Allison [Fri, 19 Nov 2021 20:12:36 +0000 (12:12 -0800)] 
s3: tests: Fix the samba3.blackbox.inherit_owner test to actually negotiate SMB1+POSIX before using POSIX calls.

Remove the following entry in knownfail.d/posix_infolevel_fails.

samba3.blackbox.inherit_owner.*.NT1.*verify.*unix\ owner.*

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos4: torture: Fix unix.info2 test to actually negotiate SMB1+POSIX before using POSIX...
Jeremy Allison [Fri, 19 Nov 2021 20:15:06 +0000 (12:15 -0800)] 
s4: torture: Fix unix.info2 test to actually negotiate SMB1+POSIX before using POSIX calls.

Cope with the minor difference in wildcard search return when
we're actually using SMB1+POSIX on the server (SMB1+POSIX treats
all directory search paths as wildcards).

Remove the following entries in knownfail.d/posix_infolevel_fails.

samba3.unix.info2.info2\(nt4_dc_smb1\)
        samba3.unix.info2.info2\(ad_dc_smb1\)

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos4: torture: Fix raw.search:test_one_file() by using the SMB1+POSIX connection for...
Jeremy Allison [Fri, 19 Nov 2021 22:51:39 +0000 (14:51 -0800)] 
s4: torture: Fix raw.search:test_one_file() by using the SMB1+POSIX connection for POSIX info levels.

Remove the following entry in knownfail.d/posix_infolevel_fails.

^samba3.raw.search.one\ file\ search.*

from knownfail.d/posix_infolevel_fails

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos4: torture: raw.search: Add setup_smb1_posix(). Call it on the second connection...
Jeremy Allison [Fri, 19 Nov 2021 22:48:20 +0000 (14:48 -0800)] 
s4: torture: raw.search: Add setup_smb1_posix(). Call it on the second connection in test_one_file().

Not yet used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos4: torture: In raw.search:test_one_file() add a second connection.
Jeremy Allison [Fri, 19 Nov 2021 22:44:05 +0000 (14:44 -0800)] 
s4: torture: In raw.search:test_one_file() add a second connection.

Change from torture_suite_add_1smb_test() to torture_suite_add_2smb_test().

Not yet used. We will need this to do SMB1+POSIX search calls on
a connection on which we have negotiated SMB1+POSIX.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbclient: Give a message if we try and use any POSIX command without negotiating...
Jeremy Allison [Sun, 21 Nov 2021 04:17:11 +0000 (20:17 -0800)] 
s3: smbclient: Give a message if we try and use any POSIX command without negotiating POSIX first.

Ensure we only use a POSIX command if POSIX is set up.
Issue the message: Command "posix" must be issued before the "XXXX" command can be used.
After the parameter parsing has been done.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: Tighten up info level checks for SMB1+POSIX to make sure POSIX was negotiat...
Jeremy Allison [Thu, 18 Nov 2021 19:48:42 +0000 (11:48 -0800)] 
s3: smbd: Tighten up info level checks for SMB1+POSIX to make sure POSIX was negotiated first.

Add knownfail file

knownfail.d/posix_infolevel_fails

for tests that don't currently negotiate
SMB1+POSIX before using SMB1+POSIX calls.

These are:

samba3.smbtorture_s3.plain.POSIX-BLOCKING-LOCK.smbtorture\(nt4_dc_smb1\)
samba3.blackbox.acl_xattr.NT1.nt_affects_posix.*
samba3.blackbox.acl_xattr.NT1.nt_affects_chown.*
samba3.blackbox.acl_xattr.NT1.nt_affects_chgrp.*
samba3.blackbox.inherit_owner.*.NT1.*verify.*unix\ owner.*
samba3.unix.info2.info2\(nt4_dc_smb1\)
samba3.unix.info2.info2\(ad_dc_smb1\)
samba3.raw.search.one\ file\ search.*

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos4: torture: In raw.search:test_one_file() remove the leading '\\' in the test filenames.
Jeremy Allison [Fri, 19 Nov 2021 22:18:47 +0000 (14:18 -0800)] 
s4: torture: In raw.search:test_one_file() remove the leading '\\' in the test filenames.

We'll soon be using this under SMB1+POSIX and neither Windows or POSIX
need a leading '\\' (and SMB1+POSIX sees the '\\' as part of the name).

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos4: torture: Fix raw.search:test_one_file() to use torture_result() instead of printf.
Jeremy Allison [Fri, 19 Nov 2021 20:54:47 +0000 (12:54 -0800)] 
s4: torture: Fix raw.search:test_one_file() to use torture_result() instead of printf.

I think this test pre-dates torture_result.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: Remove 'struct uc_state' name_has_wildcard element.
Jeremy Allison [Fri, 3 Dec 2021 21:06:27 +0000 (13:06 -0800)] 
s3: smbd: Remove 'struct uc_state' name_has_wildcard element.

It is never set or looked at.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Sat Dec 11 08:07:14 UTC 2021 on sn-devel-184

4 years agos3: smbd: In unix_convert_step_stat() remove use of state->name_was_wildcard.
Jeremy Allison [Fri, 3 Dec 2021 21:05:55 +0000 (13:05 -0800)] 
s3: smbd: In unix_convert_step_stat() remove use of state->name_was_wildcard.

It can never be true.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: In unix_convert_step() remove all use of 'state->name_was_wildcard'
Jeremy Allison [Fri, 3 Dec 2021 21:03:47 +0000 (13:03 -0800)] 
s3: smbd: In unix_convert_step() remove all use of 'state->name_was_wildcard'

We know it is never true.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: In unix_convert() remove the now unneeded block indentation.
Jeremy Allison [Fri, 3 Dec 2021 20:59:50 +0000 (12:59 -0800)] 
s3: smbd: In unix_convert() remove the now unneeded block indentation.

We removed the 'if (state->name_has_wildcard) {' clause, so
the block no longer needs indenting.

Best seen with git show -b.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: In unix_convert(), remove all references to state->name_has_wildcard.
Jeremy Allison [Fri, 3 Dec 2021 20:55:41 +0000 (12:55 -0800)] 
s3: smbd: In unix_convert(), remove all references to state->name_has_wildcard.

It is never set.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: Inside unix_convert(), never set state->name_is_wildcard.
Jeremy Allison [Fri, 3 Dec 2021 20:53:36 +0000 (12:53 -0800)] 
s3: smbd: Inside unix_convert(), never set state->name_is_wildcard.

We error out immediately if it's set anyway.
Preparing to remove 'state->name_is_wildcard' structure element.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: UCF_ALWAYS_ALLOW_WCARD_LCOMP 0x00000002 is no longer used.
Jeremy Allison [Fri, 3 Dec 2021 20:40:43 +0000 (12:40 -0800)] 
s3: smbd: UCF_ALWAYS_ALLOW_WCARD_LCOMP 0x00000002 is no longer used.

Hurrah !

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: We no longer need determine_path_error().
Jeremy Allison [Fri, 3 Dec 2021 20:37:15 +0000 (12:37 -0800)] 
s3: smbd: We no longer need determine_path_error().

Now we don't have to consider wildcards just
return NT_STATUS_OBJECT_PATH_NOT_FOUND for
the cases we used to call it.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: Inside 'struct uc_state', remove allow_wcard_last_component.
Jeremy Allison [Fri, 3 Dec 2021 19:33:42 +0000 (11:33 -0800)] 
s3: smbd: Inside 'struct uc_state', remove allow_wcard_last_component.

This is never allowed.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: filename_convert() no longer deals with wildcards.
Jeremy Allison [Fri, 3 Dec 2021 19:30:42 +0000 (11:30 -0800)] 
s3: smbd: filename_convert() no longer deals with wildcards.

These are already errored out with NT_STATUS_OBJECT_NAME_INVALID
in the unix_convert() code.

Remove the check.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: parse_dfs_path() can ignore wildcards.
Jeremy Allison [Fri, 3 Dec 2021 19:48:23 +0000 (11:48 -0800)] 
s3: smbd: parse_dfs_path() can ignore wildcards.

If one is passed to filename_convert(), it will error out there
with NT_STATUS_OBJECT_NAME_INVALID.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: Remove 'bool search_wcard_flag' from parse_dfs_path().
Jeremy Allison [Fri, 3 Dec 2021 19:42:23 +0000 (11:42 -0800)] 
s3: smbd: Remove 'bool search_wcard_flag' from parse_dfs_path().

Never set.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: dfs_path_lookup() no longer deals with wildcards.
Jeremy Allison [Fri, 3 Dec 2021 19:31:40 +0000 (11:31 -0800)] 
s3: smbd: dfs_path_lookup() no longer deals with wildcards.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: Fix call_trans2findfirst() to use filename_convert_smb1_search_path().
Jeremy Allison [Fri, 3 Dec 2021 19:28:40 +0000 (11:28 -0800)] 
s3: smbd: Fix call_trans2findfirst() to use filename_convert_smb1_search_path().

filename_convert() no longer has to handle wildcards.
UCF_ALWAYS_ALLOW_WCARD_LCOMP is now unused.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: Convert reply_search() to use filename_convert_smb1_search_path().
Jeremy Allison [Fri, 3 Dec 2021 19:22:03 +0000 (11:22 -0800)] 
s3: smbd: Convert reply_search() to use filename_convert_smb1_search_path().

Cleans up this code path nicely !

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: Add filename_convert_smb1_search_path() - deals with SMB1 search pathnames.
Jeremy Allison [Fri, 3 Dec 2021 18:35:09 +0000 (10:35 -0800)] 
s3: smbd: Add filename_convert_smb1_search_path() - deals with SMB1 search pathnames.

SMB1search and trans2 findfirst are unique in that
they are the only passed in pathnames that can contain
a terminal wildcard component.

Deal with these two special cases with this new function
that strips off the terminal wildcard and returns as
the mask, and pass the non-wildcard parent directory
component through the standard filename_convert().

Uses new helper function strip_gmt_from_raw_dfs().

When SMB1search and trans2 findfirst have been
converted to use this function, we can strip all
wildcard handling out of filename_convert() as
we now know it will only ever be given valid
pathnames.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: Allow dfs_redirect() to return a TWRP token it got from a parsed pathname.
Jeremy Allison [Sat, 4 Dec 2021 00:14:08 +0000 (16:14 -0800)] 
s3: smbd: Allow dfs_redirect() to return a TWRP token it got from a parsed pathname.

This one is subtle. If an SMB1 request has both a DFS path and a @GMT token,
the unix_convert() inside the DFS path processing will remove the @GMT
token, not allowing the subsequent unix_convert() inside filename_convert()
to see it. By returning it from dfs_redirect() we can ensure it's correctly
added to the smb_filename returned from filename_convert().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: In dfs_path_lookup(). If we have a DFS path including a @GMT-token, don...
Jeremy Allison [Sat, 4 Dec 2021 00:00:26 +0000 (16:00 -0800)] 
s3: smbd: In dfs_path_lookup(). If we have a DFS path including a @GMT-token, don't throw away the twrp value when parsing the path.

Not yet used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: filename_convert() is now a one-to-one wrapper around filename_convert_inte...
Jeremy Allison [Fri, 3 Dec 2021 18:19:38 +0000 (10:19 -0800)] 
s3: smbd: filename_convert() is now a one-to-one wrapper around filename_convert_internal().

Remove filename_convert() and rename filename_convert_internal() -> filename_convert().
Move the old DEBUG(..) statements to DBG_XXX() so they don't print the wrong name.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: Remove now unused check_reduced_name_with_privilege().
Jeremy Allison [Fri, 3 Dec 2021 18:14:03 +0000 (10:14 -0800)] 
s3: smbd: Remove now unused check_reduced_name_with_privilege().

We now only have one function that does this check (check_reduced_name()),
used everywhere.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: Remove unused check_name_with_privilege().
Jeremy Allison [Fri, 3 Dec 2021 18:13:13 +0000 (10:13 -0800)] 
s3: smbd: Remove unused check_name_with_privilege().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: In filename_convert_internal(), remove call to check_name_with_privilege().
Jeremy Allison [Fri, 3 Dec 2021 18:10:45 +0000 (10:10 -0800)] 
s3: smbd: In filename_convert_internal(), remove call to check_name_with_privilege().

We now always pass NULL as struct smb_request *smbreq,
so this code path can never be taken.

Comment out check_name_with_privilege() as it's now
no longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: Remove filename_convert_with_privilege(). No longer used.
Jeremy Allison [Fri, 3 Dec 2021 01:55:26 +0000 (17:55 -0800)] 
s3: smbd: Remove filename_convert_with_privilege(). No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: In call_trans2findfirst() we don't need filename_convert_with_privilege...
Jeremy Allison [Fri, 3 Dec 2021 01:51:42 +0000 (17:51 -0800)] 
s3: smbd: In call_trans2findfirst() we don't need filename_convert_with_privilege() anymore.

It was extra-paranoid code now not needed as the new VFS
version of filename_convert() does the same job.

There are now no remaining callers of filename_convert_with_privilege().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: Remove split_fname_dir_mask().
Jeremy Allison [Fri, 10 Dec 2021 00:51:45 +0000 (16:51 -0800)] 
s3: smbd: Remove split_fname_dir_mask().

No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: In rename_internals(), remove the name spliting and re-combining code.
Jeremy Allison [Fri, 10 Dec 2021 00:49:46 +0000 (16:49 -0800)] 
s3: smbd: In rename_internals(), remove the name spliting and re-combining code.

filename_convert() handles mangled names just fine, so we don't
need to split the last component and check for mangle.

Now we don't take wildcard names this is not needed. This was the
last caller of split_fname_dir_mask(), so ifdef it out.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: check_name() is now static to filename.c
Jeremy Allison [Fri, 10 Dec 2021 00:47:13 +0000 (16:47 -0800)] 
s3: smbd: check_name() is now static to filename.c

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: In rename_internals_fsp(), remove unneeded call to check_name().
Jeremy Allison [Fri, 10 Dec 2021 00:45:13 +0000 (16:45 -0800)] 
s3: smbd: In rename_internals_fsp(), remove unneeded call to check_name().

All callers have gone through filename_convert(), which has
already called check_name() on the destination.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: Handling SMB_FILE_RENAME_INFORMATION, the destination name is a single...
Jeremy Allison [Fri, 10 Dec 2021 00:35:17 +0000 (16:35 -0800)] 
s3: smbd: Handling SMB_FILE_RENAME_INFORMATION, the destination name is a single component.

No errors should be allowed from filename_convert().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: Remove the old unlink_internals() implementation.
Jeremy Allison [Fri, 10 Dec 2021 00:16:52 +0000 (16:16 -0800)] 
s3: smbd: Remove the old unlink_internals() implementation.

No longer used. filename_convert() already handles mangled
names just fine, so we don't need this logic.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: Comment out the old unlink_internals(). Rename do_unlink() -> unlink_intern...
Jeremy Allison [Fri, 10 Dec 2021 00:14:40 +0000 (16:14 -0800)] 
s3: smbd: Comment out the old unlink_internals(). Rename do_unlink() -> unlink_internals().

One parameter needs changing position. The logic inside unlink_internals()
is no longer needed if it doesn't accept wildcards. filename_convert()
already handles mangled names just fine, so we don't need this logic.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: Move to modern debug calls inside do_unlink().
Jeremy Allison [Fri, 10 Dec 2021 00:11:20 +0000 (16:11 -0800)] 
s3: smbd: Move to modern debug calls inside do_unlink().

We will be changing its name next.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: smbd: Move setting of dirtype if FILE_ATTRIBUTE_NORMAL to do_unlink().
Jeremy Allison [Fri, 10 Dec 2021 00:08:07 +0000 (16:08 -0800)] 
s3: smbd: Move setting of dirtype if FILE_ATTRIBUTE_NORMAL to do_unlink().

Now we don't use wildcards when calling in unlink_internals()
the logic inside it serves no purpose and can be replaced with
a direct call to do_unlink() (which we will rename to unlink_internals()).

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3:torture: Initialize pointer with NULL
Andreas Schneider [Fri, 10 Dec 2021 16:24:43 +0000 (17:24 +0100)] 
s3:torture: Initialize pointer with NULL

source3/torture/torture.c:4309:17: error: ‘pname’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
 4309 |                 printf("qfilename gave different name? [%s] [%s]\n",
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 4310 |                        fname, pname);
      |                        ~~~~~~~~~~~~~

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Dec 11 00:25:46 UTC 2021 on sn-devel-184

4 years agoWHATSNEW. Added section about samba-dcerpcd.
Jeremy Allison [Thu, 30 Sep 2021 23:05:49 +0000 (16:05 -0700)] 
WHATSNEW. Added section about samba-dcerpcd.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Dec 10 14:52:54 UTC 2021 on sn-devel-184

4 years agodcesrv_core: Remove unused dcesrv_reinit_context()
Volker Lendecke [Mon, 27 Sep 2021 11:13:11 +0000 (13:13 +0200)] 
dcesrv_core: Remove unused dcesrv_reinit_context()

This was only used in the prefork source3 rpc servers

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agos3:rpc_server: Delete unused code and doc references
Volker Lendecke [Tue, 8 Jun 2021 07:10:05 +0000 (09:10 +0200)] 
s3:rpc_server: Delete unused code and doc references

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agoprinting: Remove "start_daemons" from printing_subsystem_init()
Volker Lendecke [Sun, 28 Nov 2021 19:29:26 +0000 (20:29 +0100)] 
printing: Remove "start_daemons" from printing_subsystem_init()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agos3:rpc_server: Activate samba-dcerpcd
Volker Lendecke [Fri, 18 Jun 2021 17:11:19 +0000 (19:11 +0200)] 
s3:rpc_server: Activate samba-dcerpcd

This is the big switch to use samba-dcerpcd for the RPC services in
source3/. It is a pretty big and unordered patch, but I don't see a
good way to split this up into more manageable pieces without
sacrificing bisectability even more. Probably I could cut out a few
small ones, but a major architechtural switch like this will always be
messy.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agos3:rpc_server: Add samba-dcerpcd helper programs
Volker Lendecke [Wed, 7 Apr 2021 07:13:25 +0000 (07:13 +0000)] 
s3:rpc_server: Add samba-dcerpcd helper programs

These are rpcd_* binaries.

rpcd_classic collects everything that's not specific

Changes the epmapper to read the epmdb.tdb, which will make the
epmapper tests non-bisectable until the switch is done.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agos3:winbind: Close internal RPC pipes after 5 idle seconds
Volker Lendecke [Sat, 19 Jun 2021 15:06:59 +0000 (17:06 +0200)] 
s3:winbind: Close internal RPC pipes after 5 idle seconds

Even internal pipes have a small cost, external ones will block a
process from exiting soon.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agos3:rpc_server: Make npa_state_init() public
Volker Lendecke [Fri, 18 Jun 2021 17:56:48 +0000 (19:56 +0200)] 
s3:rpc_server: Make npa_state_init() public

Will be used later in client tools.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agounittest: Remove test_sambafs_srv_pipe
Volker Lendecke [Thu, 17 Jun 2021 06:31:32 +0000 (08:31 +0200)] 
unittest: Remove test_sambafs_srv_pipe

is_known_pipename() will be removed soon

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agos3:printing: Move pcap_cache_loaded() to load.c
Volker Lendecke [Wed, 16 Jun 2021 06:31:56 +0000 (08:31 +0200)] 
s3:printing: Move pcap_cache_loaded() to load.c

A future patch will remove the PRINTING dependency from smbd, but in
delete_and_reload_printers() we still reference it.

Maybe at some later stage we can remove reload_printers() overall, we
don't really need to load the full printer list into every smbd. All
we need is to load them on-demand for explicit listing functions, but
there we can throw them away again. And when someone connects to the
printer, we can also load them on demand.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agosmbcontrol: Add rpc-dump-status
Volker Lendecke [Sun, 28 Feb 2021 21:03:01 +0000 (22:03 +0100)] 
smbcontrol: Add rpc-dump-status

Get status information out of samba-dcerpcd and its RPC helpers.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agos3:rpc_client: Add rpc_pipe_open_local_np()
Volker Lendecke [Wed, 7 Apr 2021 07:19:27 +0000 (07:19 +0000)] 
s3:rpc_client: Add rpc_pipe_open_local_np()

Helper routine to connect to bind to a locally started rpcd_* process's
rpc interface.

Based upon local_np_connect() to start samba-dcerpcd on demand if it's
not there, designed to replace our internal RPC interfaces where the
RPC server runs in the same process. This will be called from winbindd_cm.c
and source3/rpc_server/rpc_ncacn_np.c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>