]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
3 years agotestprogs: Reformat test_kpasswd_heimdal.sh
Andreas Schneider [Fri, 22 Apr 2022 13:46:05 +0000 (15:46 +0200)] 
testprogs: Reformat test_kpasswd_heimdal.sh

shfmt -w -p -i 0 -fn testprogs/blackbox/test_kpasswd_heimdal.sh

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
3 years agotestprogs: Reformat test_kinit_trusts_mit.sh
Andreas Schneider [Fri, 22 Apr 2022 13:46:05 +0000 (15:46 +0200)] 
testprogs: Reformat test_kinit_trusts_mit.sh

shfmt -w -p -i 0 -fn testprogs/blackbox/test_kinit_trusts_mit.sh

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
3 years agotestprogs: Reformat test_kinit_trusts_heimdal.sh
Andreas Schneider [Fri, 22 Apr 2022 13:46:05 +0000 (15:46 +0200)] 
testprogs: Reformat test_kinit_trusts_heimdal.sh

shfmt -w -p -i 0 -fn testprogs/blackbox/test_kinit_trusts_heimdal.sh

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
3 years agotestprogs: Reformat test_kinit_mit.sh
Andreas Schneider [Fri, 22 Apr 2022 13:46:05 +0000 (15:46 +0200)] 
testprogs: Reformat test_kinit_mit.sh

shfmt -w -p -i 0 -fn testprogs/blackbox/test_kinit_mit.sh

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
3 years agotestprogs: Reformat test_kinit_heimdal.sh
Andreas Schneider [Fri, 22 Apr 2022 13:46:05 +0000 (15:46 +0200)] 
testprogs: Reformat test_kinit_heimdal.sh

shfmt -w -p -i 0 -fn testprogs/blackbox/test_kinit_heimdal.sh

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
3 years agotestprogs: Reformat test_export_keytab_mit.sh
Andreas Schneider [Fri, 22 Apr 2022 13:46:04 +0000 (15:46 +0200)] 
testprogs: Reformat test_export_keytab_mit.sh

shfmt -w -p -i 0 -fn testprogs/blackbox/test_export_keytab_mit.sh

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
3 years agotestprogs: Reformat test_export_keytab_heimdal.sh
Andreas Schneider [Fri, 22 Apr 2022 13:46:04 +0000 (15:46 +0200)] 
testprogs: Reformat test_export_keytab_heimdal.sh

shfmt -w -p -i 0 -fn testprogs/blackbox/test_export_keytab_heimdal.sh

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
3 years agotestprogs: Reformat test_client_kerberos.sh
Andreas Schneider [Fri, 22 Apr 2022 13:46:04 +0000 (15:46 +0200)] 
testprogs: Reformat test_client_kerberos.sh

shfmt -w -p -i 0 -fn testprogs/blackbox/test_client_kerberos.sh

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
3 years agotestprogs: Reformat test_client_etypes.sh
Andreas Schneider [Fri, 22 Apr 2022 13:46:04 +0000 (15:46 +0200)] 
testprogs: Reformat test_client_etypes.sh

shfmt -w -p -i 0 -fn testprogs/blackbox/test_client_etypes.sh

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
3 years agotestprogs: Reformat test_chgdcpass.sh
Andreas Schneider [Fri, 22 Apr 2022 13:46:04 +0000 (15:46 +0200)] 
testprogs: Reformat test_chgdcpass.sh

shfmt -w -p -i 0 -fn testprogs/blackbox/test_chgdcpass.sh

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
3 years agotestprogs: Reformat subunit.sh
Andreas Schneider [Fri, 22 Apr 2022 13:46:04 +0000 (15:46 +0200)] 
testprogs: Reformat subunit.sh

shfmt -w -p -i 0 -fn testprogs/blackbox/subunit.sh

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
3 years agotestprogs: Reformat schemaupgrade.sh
Andreas Schneider [Fri, 22 Apr 2022 13:46:04 +0000 (15:46 +0200)] 
testprogs: Reformat schemaupgrade.sh

shfmt -w -p -i 0 -fn testprogs/blackbox/schemaupgrade.sh

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
3 years agotestprogs: Reformat runtime-links.sh
Andreas Schneider [Fri, 22 Apr 2022 13:46:04 +0000 (15:46 +0200)] 
testprogs: Reformat runtime-links.sh

shfmt -w -p -i 0 -fn testprogs/blackbox/runtime-links.sh

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
3 years agotestprogs: Reformat renamedc.sh
Andreas Schneider [Fri, 22 Apr 2022 13:46:04 +0000 (15:46 +0200)] 
testprogs: Reformat renamedc.sh

shfmt -w -p -i 0 -fn testprogs/blackbox/renamedc.sh

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
3 years agotestprogs: Reformat nsstest.sh
Andreas Schneider [Fri, 22 Apr 2022 13:46:04 +0000 (15:46 +0200)] 
testprogs: Reformat nsstest.sh

shfmt -w -p -i 0 -fn testprogs/blackbox/nsstest.sh

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
3 years agotestprogs: Reformat ldapcmp_restoredc.sh
Andreas Schneider [Fri, 22 Apr 2022 13:46:04 +0000 (15:46 +0200)] 
testprogs: Reformat ldapcmp_restoredc.sh

shfmt -w -p -i 0 -fn testprogs/blackbox/ldapcmp_restoredc.sh

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
3 years agotestprogs: Reformat join_ldapcmp.sh
Andreas Schneider [Fri, 22 Apr 2022 13:46:04 +0000 (15:46 +0200)] 
testprogs: Reformat join_ldapcmp.sh

shfmt -w -p -i 0 -fn testprogs/blackbox/join_ldapcmp.sh

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
3 years agotestprogs: Reformat functionalprep.sh
Andreas Schneider [Fri, 22 Apr 2022 13:46:04 +0000 (15:46 +0200)] 
testprogs: Reformat functionalprep.sh

shfmt -w -p -i 0 -fn testprogs/blackbox/functionalprep.sh

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
3 years agotestprogs: Reformat dom_parse.sh
Andreas Schneider [Fri, 22 Apr 2022 13:46:04 +0000 (15:46 +0200)] 
testprogs: Reformat dom_parse.sh

shfmt -w -p -i 0 -fn testprogs/blackbox/dom_parse.sh

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
3 years agotestprogs: Reformat dfree.sh
Andreas Schneider [Fri, 22 Apr 2022 13:46:04 +0000 (15:46 +0200)] 
testprogs: Reformat dfree.sh

shfmt -w -p -i 0 -fn testprogs/blackbox/dfree.sh

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
3 years agotestprogs: Reformat demote-saveddb.sh
Andreas Schneider [Fri, 22 Apr 2022 13:46:04 +0000 (15:46 +0200)] 
testprogs: Reformat demote-saveddb.sh

shfmt -w -p -i 0 -fn testprogs/blackbox/demote-saveddb.sh

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
3 years agotestprogs: Reformat dbcheck.sh
Andreas Schneider [Fri, 22 Apr 2022 13:46:04 +0000 (15:46 +0200)] 
testprogs: Reformat dbcheck.sh

shfmt -w -p -i 0 -fn testprogs/blackbox/dbcheck.sh

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
Autobuild-User(master): Pavel Filipensky <pfilipensky@samba.org>
Autobuild-Date(master): Thu Aug  4 10:11:30 UTC 2022 on sn-devel-184

3 years agotestprogs: Reformat dbcheck-oldrelease.sh
Andreas Schneider [Fri, 22 Apr 2022 13:46:04 +0000 (15:46 +0200)] 
testprogs: Reformat dbcheck-oldrelease.sh

shfmt -w -p -i 0 -fn testprogs/blackbox/dbcheck-oldrelease.sh

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
3 years agotestprogs: Reformat dbcheck-links.sh
Andreas Schneider [Fri, 22 Apr 2022 13:46:04 +0000 (15:46 +0200)] 
testprogs: Reformat dbcheck-links.sh

shfmt -w -p -i 0 -fn testprogs/blackbox/dbcheck-links.sh

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
3 years agomdssvc: check if the user closed the query before trying to read the HTTP response...
Ralph Boehme [Fri, 19 Nov 2021 12:24:50 +0000 (13:24 +0100)] 
mdssvc: check if the user closed the query before trying to read the HTTP response from Elasticsearch

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Wed Aug  3 14:00:36 UTC 2022 on sn-devel-184

3 years agomdssvc: fold two if blocks into one
Ralph Boehme [Fri, 19 Nov 2021 15:50:44 +0000 (16:50 +0100)] 
mdssvc: fold two if blocks into one

No change in behaviour.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
3 years agomdssvc: don't trigger http reconnect if a search was cancelled
Ralph Boehme [Fri, 19 Nov 2021 12:21:31 +0000 (13:21 +0100)] 
mdssvc: don't trigger http reconnect if a search was cancelled

Calling tevent_req_error() triggers a HTTP reconnect in mds_es_search_done() as
mds_es_search_recv() returns the error so we call mds_es_reconnect_on_error().

slq (which is s->slq) or s->mds_es_ctx will be NULL if the user closed a search
or disconnected a share with an active mdssvc IPC pipe, no need to trigger a
HTTP reconnect for those cases.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
3 years agomdssvc: fix check if search connection state is gone
Ralph Boehme [Fri, 19 Nov 2021 12:11:20 +0000 (13:11 +0100)] 
mdssvc: fix check if search connection state is gone

This was dead code: before this patchset noone set s->mds_es_ctx->mds_ctx to
NULL. A previous commit changed that so now the mds_es_ctx destructor sets
s->mds_es_ctx to NULL if a search "s" was currently in-flight.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
3 years agomdssvc: reapply default search destructor when marking a search non-pending
Ralph Boehme [Thu, 18 Nov 2021 15:51:36 +0000 (16:51 +0100)] 
mdssvc: reapply default search destructor when marking a search non-pending

This is needed to ensure searches that are scheduled more then once to the
Elasticsarch server (because the first run didn't return all results) get
removed from the list of searches in case the user closes the query.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
3 years agomdssvc: prevent a crash when pending search finishes after the client closed the...
Ralph Boehme [Fri, 19 Nov 2021 12:29:54 +0000 (13:29 +0100)] 
mdssvc: prevent a crash when pending search finishes after the client closed the search connection

When a search is in-flight and currently being processed against the
Elasticsearch server, we set s->pending. In the destructor of "s" we check "pending"
and reject deallocation of the object.

One instance where "s" is requested to be deallocated is when the client closes
the top-level per-share search connection. This will implicitly close all
searches associated with the mds_ctx from mds_ctx_destructor_cb():

while (mds_ctx->query_list != NULL) {
/*
 * slq destructor removes element from list.
 * Don't use TALLOC_FREE()!
 */
talloc_free(mds_ctx->query_list);
}

So when this happens the Elasticsearch backend query object stays around,
alongside with any active tevent_req request and a tevent_req timer set with
tevent_req_set_endtime() in mds_es_search_send().

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14915
RN: mdssvc crashes when searches are pending and the client closes the mdssvc IPC pipe

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
3 years agomdssvc: move calling mds_es_search_set_pending() to mds_es_next_search_trigger()
Ralph Boehme [Fri, 19 Nov 2021 11:56:37 +0000 (12:56 +0100)] 
mdssvc: move calling mds_es_search_set_pending() to mds_es_next_search_trigger()

This makes the calls to mds_es_search_set_pending() and
mds_es_search_unset_pending() symmetric. No change in behaviour.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
3 years agomdssvc: consolidate calls of mds_es_search_unset_pending()
Ralph Boehme [Fri, 19 Nov 2021 12:28:17 +0000 (13:28 +0100)] 
mdssvc: consolidate calls of mds_es_search_unset_pending()

Both codepaths were mds_es_search_unset_pending() is currently called end up
going through the higher level callback mds_es_search_done(). Moving the call to
mds_es_search_unset_pending() ensures we call it consistently and don't miss it
in some error code path.

Otherwise no change in behaviour.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
3 years agomdssvc: update a comment
Ralph Boehme [Fri, 19 Nov 2021 07:27:34 +0000 (08:27 +0100)] 
mdssvc: update a comment

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
3 years agomdssvc: fix a comment
Ralph Boehme [Thu, 18 Nov 2021 15:51:21 +0000 (16:51 +0100)] 
mdssvc: fix a comment

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
3 years agos3: smbd: Convert smb_file_rename_information() to use filename_convert_dirfsp().
Jeremy Allison [Thu, 28 Jul 2022 19:38:47 +0000 (12:38 -0700)] 
s3: smbd: Convert smb_file_rename_information() to use filename_convert_dirfsp().

There is only one last user of filename_convert(), in filename_convert_smb1_search_path().

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): Tue Aug  2 20:46:38 UTC 2022 on sn-devel-184

3 years agos3: smbd: Convert smb_file_link_information() to use filename_convert_dirfsp().
Jeremy Allison [Thu, 28 Jul 2022 19:32:07 +0000 (12:32 -0700)] 
s3: smbd: Convert smb_file_link_information() to use filename_convert_dirfsp().

One less use of filename_convert().

Later we should optimize this by passing in
the src_dirfsp from the caller.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3: smbd: Convert smb2_file_rename_information() to use filename_convert_dirfsp().
Jeremy Allison [Thu, 28 Jul 2022 19:29:22 +0000 (12:29 -0700)] 
s3: smbd: Convert smb2_file_rename_information() to use filename_convert_dirfsp().

One less use of filename_convert().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3: smbd: Convert smb_set_file_unix_hlink() to use filename_convert_dirfsp().
Jeremy Allison [Thu, 28 Jul 2022 19:23:36 +0000 (12:23 -0700)] 
s3: smbd: Convert smb_set_file_unix_hlink() to use filename_convert_dirfsp().

One less use of filename_convert().

Later we should optimize this by passing in
the src_dirfsp from the caller.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3: smbd: Convert reply_ntrename() to use filename_convert_dirfsp().
Jeremy Allison [Thu, 28 Jul 2022 19:18:47 +0000 (12:18 -0700)] 
s3: smbd: Convert reply_ntrename() to use filename_convert_dirfsp().

One less use of filename_convert().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3: smbd: Convert reply_mv() to use filename_convert_dirfsp().
Jeremy Allison [Thu, 28 Jul 2022 19:09:34 +0000 (12:09 -0700)] 
s3: smbd: Convert reply_mv() to use filename_convert_dirfsp().

One less use of filename_convert().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3: smbd: Convert reply_mkdir() to use filename_convert_dirfsp().
Jeremy Allison [Thu, 28 Jul 2022 19:04:47 +0000 (12:04 -0700)] 
s3: smbd: Convert reply_mkdir() to use filename_convert_dirfsp().

One less use of filename_convert().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3: smbd: Convert reply_unlink() to use filename_convert_dirfsp().
Jeremy Allison [Thu, 28 Jul 2022 18:52:36 +0000 (11:52 -0700)] 
s3: smbd: Convert reply_unlink() to use filename_convert_dirfsp().

One less use of filename_convert().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3: smbd: Convert cmd_utime() to use filename_convert_dirfsp().
Jeremy Allison [Thu, 28 Jul 2022 17:56:28 +0000 (10:56 -0700)] 
s3: smbd: Convert cmd_utime() to use filename_convert_dirfsp().

One less use of filename_convert().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3: smbd: Convert smbd_smb2_create_durable_lease_check() to use filename_convert_dirf...
Jeremy Allison [Thu, 28 Jul 2022 17:54:03 +0000 (10:54 -0700)] 
s3: smbd: Convert smbd_smb2_create_durable_lease_check() to use filename_convert_dirfsp().

One less use of filename_convert().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3: smbd: Convert _srvsvc_NetSetFileSecurity() to use filename_convert_dirfsp().
Jeremy Allison [Thu, 28 Jul 2022 17:48:18 +0000 (10:48 -0700)] 
s3: smbd: Convert _srvsvc_NetSetFileSecurity() to use filename_convert_dirfsp().

One less use of filename_convert().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3: smbd: Convert _srvsvc_NetGetFileSecurity() to use filename_convert_dirfsp().
Jeremy Allison [Thu, 28 Jul 2022 17:46:25 +0000 (10:46 -0700)] 
s3: smbd: Convert _srvsvc_NetGetFileSecurity() to use filename_convert_dirfsp().

One less use of filename_convert().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3: smbd: Convert call_trans2setfilepathinfo() to use filename_convert_dirfsp().
Jeremy Allison [Thu, 28 Jul 2022 17:41:25 +0000 (10:41 -0700)] 
s3: smbd: Convert call_trans2setfilepathinfo() to use filename_convert_dirfsp().

One less use of filename_convert().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3: smbd: Convert call_trans2qfilepathinfo() to use filename_convert_dirfsp().
Jeremy Allison [Thu, 28 Jul 2022 17:39:12 +0000 (10:39 -0700)] 
s3: smbd: Convert call_trans2qfilepathinfo() to use filename_convert_dirfsp().

One less use of filename_convert().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3: smbd: Convert reply_setatr() to use filename_convert_dirfsp().
Jeremy Allison [Thu, 28 Jul 2022 17:33:31 +0000 (10:33 -0700)] 
s3: smbd: Convert reply_setatr() to use filename_convert_dirfsp().

One less use of filename_convert().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3: smbd: Convert reply_getatr() to use filename_convert_dirfsp().
Jeremy Allison [Thu, 28 Jul 2022 17:30:02 +0000 (10:30 -0700)] 
s3: smbd: Convert reply_getatr() to use filename_convert_dirfsp().

One less use of filename_convert().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3: smbd: Add dirfsp parameter to create_directory().
Jeremy Allison [Thu, 28 Jul 2022 19:01:21 +0000 (12:01 -0700)] 
s3: smbd: Add dirfsp parameter to create_directory().

Not yet used but passed down to SMB_VFS_CREATE().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3: smbd: Add src_dirfsp and dst_dirfsp parameters to copy_internals().
Jeremy Allison [Thu, 28 Jul 2022 18:49:35 +0000 (11:49 -0700)] 
s3: smbd: Add src_dirfsp and dst_dirfsp parameters to copy_internals().

Not yet used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3: smbd: Add old_dirfsp and new_dirfsp parameters to hardlink_internals().
Jeremy Allison [Thu, 28 Jul 2022 18:43:21 +0000 (11:43 -0700)] 
s3: smbd: Add old_dirfsp and new_dirfsp parameters to hardlink_internals().

Not yet used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3: smbd: Add dst_dirfsp parameter to rename_internals_fsp().
Jeremy Allison [Thu, 28 Jul 2022 18:25:48 +0000 (11:25 -0700)] 
s3: smbd: Add dst_dirfsp parameter to rename_internals_fsp().

Not yet used, but when this is fully plumbed though we can
look at optimizing and removing the code inside rename_internals_fsp()
that currently gets it's own dst_dirfsp.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3: smbd: Add dirfsp parameter to unlink_internals().
Jeremy Allison [Thu, 28 Jul 2022 18:17:47 +0000 (11:17 -0700)] 
s3: smbd: Add dirfsp parameter to unlink_internals().

Not yet used but passed to SMB_VFS_CREATE().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3: smbd: Add src_dirfsp and dst_dirfsp parameters to rename_internals().
Jeremy Allison [Thu, 28 Jul 2022 18:08:17 +0000 (11:08 -0700)] 
s3: smbd: Add src_dirfsp and dst_dirfsp parameters to rename_internals().

Not yet used (but passed to SMB_VFS_CREATE_FILE()).

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3: smbd: In reply_ntrename(), don't call filename_convert() if we know it's a stream...
Jeremy Allison [Fri, 29 Jul 2022 21:07:50 +0000 (14:07 -0700)] 
s3: smbd: In reply_ntrename(), don't call filename_convert() if we know it's a stream rename.

There is no point in calling filename_convert() on a raw stream name.
It can never find the file anyway (and never returns a valid smb_fname->fsp).
Use the same logic as SMB2_FILE_RENAME_INFORMATION_INTERNAL now does
and generate smb_fname_new directly.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3: smbd: Tweak the logic of smb2_file_rename_information().
Jeremy Allison [Fri, 29 Jul 2022 21:38:17 +0000 (14:38 -0700)] 
s3: smbd: Tweak the logic of smb2_file_rename_information().

There's no point in calling filename_convert() and then
just ignoring the returned smb_fname if it's a raw stream name.
Only call filename_convert() if we know it isn't a raw stream
name.

Ignore stream/non-stream mismatches in src and dst in
smb2_file_rename_information, let rename_internals_fsp()
take care of that as the error returns inside rename_internals_fsp()
are tested by raw.streams.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3: smbd: Inside filename_convert_dirfsp_nosymlink(), don't require UCF_PREP_CREATEFI...
Jeremy Allison [Mon, 1 Aug 2022 18:40:14 +0000 (11:40 -0700)] 
s3: smbd: Inside filename_convert_dirfsp_nosymlink(), don't require UCF_PREP_CREATEFILE when parsing a stream name that doesn't already exist.

We don't require it for a new file. Without this change, we have
to add UCF_PREP_CREATEFILE to the destination flags when we are
doing renames to a destination stream name, but not when doing
renames to a destination file name, which makes for inconsistent API use.

filename_convert_dirfsp() is now a drop in replacement
for filename_convert(), even for the ugly SMB1 POSIX
cases.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3: smbd: In filename_convert_dirfsp(), don't let an SMB1+POSIX client see a symlink...
Jeremy Allison [Tue, 2 Aug 2022 00:55:23 +0000 (17:55 -0700)] 
s3: smbd: In filename_convert_dirfsp(), don't let an SMB1+POSIX client see a symlink to a directory with no permissions.

This isn't 100% correct, but it gets us close enough
to the old behavior for SMB1+POSIX libsmbclient. If we went through a
symlink, and we got NT_STATUS_ACCESS_DENIED on the directory
containing the target, just don't allow the client to see the
intermediate path.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3: smbd: In filename_convert_dirfsp_nosymlink(), in SMB1-only POSIX mode, allow...
Jeremy Allison [Mon, 1 Aug 2022 21:24:31 +0000 (14:24 -0700)] 
s3: smbd: In filename_convert_dirfsp_nosymlink(), in SMB1-only POSIX mode, allow a pathname referencing a symlink to be returned.

Doesn't contain a valid smb_fname->fsp pointer of course,
and is only used by the SMB1 code to take a reference to
a smylink name for manipulation (unlinkat, readlinkat etc.).

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3: smbd: In filename_convert_dirfsp(), allow SMB1+POSIX to traverse non-terminal...
Jeremy Allison [Mon, 1 Aug 2022 21:40:54 +0000 (14:40 -0700)] 
s3: smbd: In filename_convert_dirfsp(), allow SMB1+POSIX to traverse non-terminal symlinks.

This is the behavior of filename_convert() and
we need to allow it for the legacy SMB1+POSIX libsmbclient
libraries already deployed out there.

When we add SMB2 POSIX we must disallow symlink
traversal over any symlinks, the client must
resolve symlinks locally.

Add a note to show this is where we need to add
an error for SMB2+POSIX names with UCF_POSIX_PATHNAMES
set.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agolib:replace: Only include <sys/mount.h> on non-Linux systems
Andreas Schneider [Tue, 2 Aug 2022 05:55:46 +0000 (07:55 +0200)] 
lib:replace: Only include <sys/mount.h> on non-Linux systems

Details at:
https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Aug  2 11:05:14 UTC 2022 on sn-devel-184

3 years agoRevert "lib:replace: Remove <sys/mount.h> from filesys.h"
Andreas Schneider [Tue, 2 Aug 2022 05:55:11 +0000 (07:55 +0200)] 
Revert "lib:replace: Remove <sys/mount.h> from filesys.h"

This reverts commit 7a6bd2279897ed389d10f09e5b315a7bca96e7d4.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agoctdb-common: CID 1507498: Control flow issues (DEADCODE)
Martin Schwenke [Sat, 30 Jul 2022 00:19:56 +0000 (10:19 +1000)] 
ctdb-common: CID 1507498: Control flow issues (DEADCODE)

Fix typo in error checking.  While here adjust the bottom of the
range, making errno 0 invalid.

Add corresponding test cases using an alternative syntax for errno packets
(#nnn[;] - trailing ';' is optional).

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Mon Aug  1 09:19:55 UTC 2022 on sn-devel-184

3 years agolib:replace: Remove <sys/mount.h> from filesys.h
Andreas Schneider [Fri, 29 Jul 2022 08:08:24 +0000 (10:08 +0200)] 
lib:replace: Remove <sys/mount.h> from filesys.h

You need to be careful if you include <sys/mount.h> or <linux/mount.h>
at least since glibc 2.36.

Details at:
https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Jul 29 13:08:36 UTC 2022 on sn-devel-184

3 years agoCVE-2022-32743 s4:rpc_server/netlogon: Reconnect to samdb as workstation account
Joseph Sutton [Thu, 9 Jun 2022 07:46:07 +0000 (19:46 +1200)] 
CVE-2022-32743 s4:rpc_server/netlogon: Reconnect to samdb as workstation account

This ensures that the database update can be attributed to the
workstation account, rather than to the anonymous SID, in the audit
logs.

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Thu Jul 28 23:41:27 UTC 2022 on sn-devel-184

3 years agoCVE-2022-32743 s4:rpc_server/common: Add dcesrv_samdb_connect_session_info()
Joseph Sutton [Thu, 9 Jun 2022 07:32:30 +0000 (19:32 +1200)] 
CVE-2022-32743 s4:rpc_server/common: Add dcesrv_samdb_connect_session_info()

This function allows us to connect to samdb as a particular user by
passing in that user's session info.

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agoCVE-2022-32743 dsdb/modules/acl: Allow simultaneous sAMAccountName, dNSHostName,...
Joseph Sutton [Tue, 7 Jun 2022 05:38:55 +0000 (17:38 +1200)] 
CVE-2022-32743 dsdb/modules/acl: Allow simultaneous sAMAccountName, dNSHostName, and servicePrincipalName change

If the message changes the sAMAccountName, we'll check dNSHostName and
servicePrincipalName values against the new value of sAMAccountName,
rather than the account's current value. Similarly, if the message
changes the dNSHostName, we'll check servicePrincipalName values against
the new dNSHostName. This allows setting more than one of these
attributes simultaneously with validated write rights.

We now pass 'struct ldb_val' to acl_validate_spn_value() instead of
simple strings. Previously, we were relying on the data inside 'struct
ldb_val' having a terminating zero byte, even though this is not
guaranteed.

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agoCVE-2022-32743 dsdb/modules/acl: Account for sAMAccountName without $
Joseph Sutton [Tue, 7 Jun 2022 05:37:34 +0000 (17:37 +1200)] 
CVE-2022-32743 dsdb/modules/acl: Account for sAMAccountName without $

If we have an account without a trailing $, we should ensure the
servicePrincipalName matches the entire sAMAccountName. We should not
allow a match against the sAMAccountName prefix of length
strlen(samAccountName) - 1, as that could conflict with a different
account.

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agoCVE-2022-32743 s4:rpc_server/netlogon: Connect to samdb as a user, rather than as...
Joseph Sutton [Tue, 7 Jun 2022 05:29:02 +0000 (17:29 +1200)] 
CVE-2022-32743 s4:rpc_server/netlogon: Connect to samdb as a user, rather than as system

This allows us to perform validation on a client-specified dNSHostName
value, to ensure that it matches the sAMAccountName.

We might not have any rights to modify the account, so pass the control
FORCE_ALLOW_VALIDATED_DNS_HOSTNAME_SPN_WRITE which allows us to perform
a validated write to dNSHostName and servicePrincipalName (and
unvalidated writes to other attributes, such as operatingSystem).

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agoCVE-2022-32743 s4:rpc_server/netlogon: Always observe NETR_WS_FLAG_HANDLES_SPN_UPDATE...
Joseph Sutton [Tue, 7 Jun 2022 05:25:28 +0000 (17:25 +1200)] 
CVE-2022-32743 s4:rpc_server/netlogon: Always observe NETR_WS_FLAG_HANDLES_SPN_UPDATE flag

Even when there is no old DNS hostname present.

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agoCVE-2022-32743 s4:rpc_server/netlogon: Remove dNSHostName prefix check
Joseph Sutton [Thu, 2 Jun 2022 05:11:08 +0000 (17:11 +1200)] 
CVE-2022-32743 s4:rpc_server/netlogon: Remove dNSHostName prefix check

This check is not exhaustive (it does not check the suffix of the
dNSHostName), and should be covered by a validated write check in
acl_modify().

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agoCVE-2022-32743 dsdb/modules/acl: Handle FORCE_ALLOW_VALIDATED_DNS_HOSTNAME_SPN_WRITE...
Joseph Sutton [Tue, 7 Jun 2022 05:39:07 +0000 (17:39 +1200)] 
CVE-2022-32743 dsdb/modules/acl: Handle FORCE_ALLOW_VALIDATED_DNS_HOSTNAME_SPN_WRITE control

When this control is specified, we'll assume we have Validated Write on
dNSHostName and servicePrincipalName, and Write Property on other
attributes.

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agoCVE-2022-32743 dsdb/common: Add FORCE_ALLOW_VALIDATED_DNS_HOSTNAME_SPN_WRITE control
Joseph Sutton [Tue, 7 Jun 2022 05:36:43 +0000 (17:36 +1200)] 
CVE-2022-32743 dsdb/common: Add FORCE_ALLOW_VALIDATED_DNS_HOSTNAME_SPN_WRITE control

Passing this control will grant the right to set validated values for
dNSHostName and servicePrincipalName, and non-validated values for other
attributes.

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agoCVE-2022-32743 dsdb: Implement validated dNSHostName write
Joseph Sutton [Wed, 1 Jun 2022 04:08:42 +0000 (16:08 +1200)] 
CVE-2022-32743 dsdb: Implement validated dNSHostName write

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agoCVE-2022-32743 s4/dsdb/util: Add function to check for a subclass relationship
Joseph Sutton [Tue, 14 Jun 2022 02:16:10 +0000 (14:16 +1200)] 
CVE-2022-32743 s4/dsdb/util: Add function to check for a subclass relationship

We need to be able to determine whether an object is a subclass of a
specific objectclass such as 'computer'.

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agoCVE-2022-32743 s4/dsdb/util: Add dsdb_msg_get_single_value()
Joseph Sutton [Tue, 7 Jun 2022 05:36:56 +0000 (17:36 +1200)] 
CVE-2022-32743 s4/dsdb/util: Add dsdb_msg_get_single_value()

This function simulates an add or modify operation for an ldb message to
determine the final value of a particular single-valued attribute. This
is useful when validating attributes that should stay in sync with other
attributes, such as servicePrincipalName and dNSHostName.

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agoCVE-2022-32743 s4:torture/rpc: Fix tests to match Windows
Joseph Sutton [Tue, 14 Jun 2022 05:19:00 +0000 (17:19 +1200)] 
CVE-2022-32743 s4:torture/rpc: Fix tests to match Windows

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agoCVE-2022-32743 tests/py_credentials: Add tests for setting dNSHostName with LogonGetD...
Joseph Sutton [Tue, 7 Jun 2022 05:35:35 +0000 (17:35 +1200)] 
CVE-2022-32743 tests/py_credentials: Add tests for setting dNSHostName with LogonGetDomainInfo()

Test that the value is properly validated, and that it can be set
regardless of rights on the account.

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agoCVE-2022-32743 s4-acl: Add tests for validated dNSHostName write
Joseph Sutton [Wed, 1 Jun 2022 04:07:17 +0000 (16:07 +1200)] 
CVE-2022-32743 s4-acl: Add tests for validated dNSHostName write

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 years agoexamples/winexe: fix fetching return code of the remote command
Yury Lunev [Wed, 27 Jul 2022 18:22:49 +0000 (21:22 +0300)] 
examples/winexe: fix fetching return code of the remote command

ctrl_inbuf field is used to parse remote-side information. A typo was
there that tried to parse return code as "version 0x%x" whereas the
correct way to do it (tested on Windows 10) is to scan for "return_code
%x".

Signed-off-by: Yury Lunev <yury.lunev@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jul 28 18:01:16 UTC 2022 on sn-devel-184

3 years agos3: smbd: Convert reply_checkpath() to use filename_convert_dirfsp().
Jeremy Allison [Wed, 27 Jul 2022 23:21:52 +0000 (16:21 -0700)] 
s3: smbd: Convert reply_checkpath() to use filename_convert_dirfsp().

One less use of filename_convert().

This is the acid test of filename_convert_dirfsp() pathname error
handling.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Jul 28 16:34:54 UTC 2022 on sn-devel-184

3 years agos3: smbd: Convert call_trans2mkdir() to use filename_convert_dirfsp().
Jeremy Allison [Wed, 27 Jul 2022 19:39:11 +0000 (12:39 -0700)] 
s3: smbd: Convert call_trans2mkdir() to use filename_convert_dirfsp().

One less use of filename_convert().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3: smbd: Convert call_trans2open() to use filename_convert_dirfsp().
Jeremy Allison [Wed, 27 Jul 2022 19:36:23 +0000 (12:36 -0700)] 
s3: smbd: Convert call_trans2open() to use filename_convert_dirfsp().

One less use of filename_convert().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3: smbd: Convert reply_rmdir() to use filename_convert_dirfsp().
Jeremy Allison [Wed, 27 Jul 2022 19:29:18 +0000 (12:29 -0700)] 
s3: smbd: Convert reply_rmdir() to use filename_convert_dirfsp().

One less use of filename_convert().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3: smbd: Convert reply_ctemp() to use filename_convert_dirfsp().
Jeremy Allison [Wed, 27 Jul 2022 19:23:42 +0000 (12:23 -0700)] 
s3: smbd: Convert reply_ctemp() to use filename_convert_dirfsp().

One less use of filename_convert().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3: smbd: Convert reply_mknew() to use filename_convert_dirfsp().
Jeremy Allison [Wed, 27 Jul 2022 19:09:48 +0000 (12:09 -0700)] 
s3: smbd: Convert reply_mknew() to use filename_convert_dirfsp().

One less use of filename_convert().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3: smbd: Convert reply_open_and_X() to use filename_convert_dirfsp().
Jeremy Allison [Wed, 27 Jul 2022 19:00:32 +0000 (12:00 -0700)] 
s3: smbd: Convert reply_open_and_X() to use filename_convert_dirfsp().

One less use of filename_convert().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3: smbd: Convert reply_open() to use filename_convert_dirfsp().
Jeremy Allison [Wed, 27 Jul 2022 19:05:17 +0000 (12:05 -0700)] 
s3: smbd: Convert reply_open() to use filename_convert_dirfsp().

One less use of filename_convert().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3: smbd: Fix the error processing in filename_convert_dirfsp_nosymlink() to match...
Jeremy Allison [Wed, 27 Jul 2022 22:28:13 +0000 (15:28 -0700)] 
s3: smbd: Fix the error processing in filename_convert_dirfsp_nosymlink() to match unix_convert() 100%

We need this in order to pass:

samba3.raw.samba3badpath
raw.chkpath
samba3.base.chkpath

Now we can convert all the SMB1 reply_openXXX functions,
and reply_checkpath().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3: smbd: In filename_split_lcomp() ensure we never return a streamname if posix...
Jeremy Allison [Wed, 27 Jul 2022 23:52:40 +0000 (16:52 -0700)] 
s3: smbd: In filename_split_lcomp() ensure we never return a streamname if posix is set.

POSIX has no streams, even on the root of a directory.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3: smbd: Ensure we set fsp->file_id in openat_pathref_dirfsp_nosymlink().
Jeremy Allison [Wed, 27 Jul 2022 21:36:33 +0000 (14:36 -0700)] 
s3: smbd: Ensure we set fsp->file_id in openat_pathref_dirfsp_nosymlink().

This is a subtle one. The dirfsp returned by openat_pathref_dirfsp_nosymlink()
can be used inside open.c and passed to check_parent_access_fsp() to
check if a delete_on_close flag has been set on an existing "real"
open fsp. So the file_id must be correctly set in order for this
to work. Without it, samba3.base.delete fails in deltest20 when
we convert reply_open_and_X() to use filename_convert_dirfsp().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3:winbind: Implement dcerpc_samr_chgpasswd_user4 for PamAuthChangePassword
Andreas Schneider [Tue, 26 Jul 2022 14:54:36 +0000 (16:54 +0200)] 
s3:winbind: Implement dcerpc_samr_chgpasswd_user4 for PamAuthChangePassword

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Jul 28 12:47:31 UTC 2022 on sn-devel-184

3 years agos3:libsmb: Add dcerpc_samr_chgpasswd_user4 to remote_password_change()
Andreas Schneider [Tue, 26 Jul 2022 14:27:32 +0000 (16:27 +0200)] 
s3:libsmb: Add dcerpc_samr_chgpasswd_user4 to remote_password_change()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 years agos3:test: Print the output to understand what was going wrong
Andreas Schneider [Tue, 26 Jul 2022 18:54:44 +0000 (20:54 +0200)] 
s3:test: Print the output to understand what was going wrong

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 years agos4:libnet: Add support for samr_ChangePasswordUser4()
Andreas Schneider [Tue, 26 Jul 2022 13:43:31 +0000 (15:43 +0200)] 
s4:libnet: Add support for samr_ChangePasswordUser4()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 years agos4:libnet: Move code using RC4 into its own function
Andreas Schneider [Tue, 26 Jul 2022 13:13:08 +0000 (15:13 +0200)] 
s4:libnet: Move code using RC4 into its own function

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 years agos4:libnet: Remove unused code in libnet_ChangePassword_samr()
Andreas Schneider [Tue, 26 Jul 2022 12:47:53 +0000 (14:47 +0200)] 
s4:libnet: Remove unused code in libnet_ChangePassword_samr()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 years agos4:torture: Add test for dcerpc_samr_ChangePasswordUser4
Andreas Schneider [Tue, 5 Jul 2022 11:26:37 +0000 (13:26 +0200)] 
s4:torture: Add test for dcerpc_samr_ChangePasswordUser4

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