samba.git
3 years agosmbd: remove dead code
Ralph Boehme [Fri, 29 May 2020 09:27:35 +0000 (11:27 +0200)]
smbd: remove dead code

LINKS_READ_ONLY is not defined anywhere since ages.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agoAdd net-ads-join dnshostname=fqdn option
Isaac Boukris [Wed, 27 May 2020 13:54:12 +0000 (15:54 +0200)]
Add net-ads-join dnshostname=fqdn option

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

Signed-off-by: Isaac Boukris <iboukris@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri May 29 13:33:28 UTC 2020 on sn-devel-184

3 years agoAdd msDS-AdditionalDnsHostName entries to the keytab
Isaac Boukris [Wed, 27 May 2020 13:36:28 +0000 (15:36 +0200)]
Add msDS-AdditionalDnsHostName entries to the keytab

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

Signed-off-by: Isaac Boukris <iboukris@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agoAdd a test for msDS-AdditionalDnsHostName entries in keytab
Isaac Boukris [Wed, 27 May 2020 15:55:12 +0000 (17:55 +0200)]
Add a test for msDS-AdditionalDnsHostName entries in keytab

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

Signed-off-by: Isaac Boukris <iboukris@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agoRefactor ads_keytab_add_entry() to make it iterable
Isaac Boukris [Wed, 27 May 2020 11:25:17 +0000 (13:25 +0200)]
Refactor ads_keytab_add_entry() to make it iterable

so we can more easily add msDS-AdditionalDnsHostName entries.

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

Signed-off-by: Isaac Boukris <iboukris@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agoFix accidental overwrite of dnsHostName by the last netbios alias
Isaac Boukris [Wed, 27 May 2020 13:52:46 +0000 (15:52 +0200)]
Fix accidental overwrite of dnsHostName by the last netbios alias

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

Signed-off-by: Isaac Boukris <iboukris@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agoAdd a test to check dNSHostName with netbios aliases
Isaac Boukris [Wed, 27 May 2020 14:50:45 +0000 (16:50 +0200)]
Add a test to check dNSHostName with netbios aliases

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

Signed-off-by: Isaac Boukris <iboukris@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agosmbd: Protect smbd_smb2_getinfo_send() against invalid quota files
Volker Lendecke [Fri, 22 May 2020 12:41:27 +0000 (14:41 +0200)]
smbd: Protect smbd_smb2_getinfo_send() against invalid quota files

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri May 29 09:55:10 UTC 2020 on sn-devel-184

3 years agotorture3: Check error code for quotactl on a non-quota file handle
Volker Lendecke [Fri, 22 May 2020 13:24:06 +0000 (15:24 +0200)]
torture3: Check error code for quotactl on a non-quota file handle

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 years agolibsmb: Use tevent_req_received() in cli_qfileinfo_recv()
Volker Lendecke [Wed, 27 May 2020 17:09:51 +0000 (19:09 +0200)]
libsmb: Use tevent_req_received() in cli_qfileinfo_recv()

That takes care of doing the early talloc_free(state)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu May 28 20:35:41 UTC 2020 on sn-devel-184

3 years agopylibsmb: Use async cli_mkdir also for smb2
Volker Lendecke [Tue, 26 May 2020 07:01:57 +0000 (09:01 +0200)]
pylibsmb: Use async cli_mkdir also for smb2

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibsmb: Remove sync cli_smb2_mkdir()
Volker Lendecke [Mon, 25 May 2020 16:31:10 +0000 (18:31 +0200)]
libsmb: Remove sync cli_smb2_mkdir()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibsmb: Use async cli_smb2_mkdir in async cli_mkdir
Volker Lendecke [Mon, 25 May 2020 16:23:31 +0000 (18:23 +0200)]
libsmb: Use async cli_smb2_mkdir in async cli_mkdir

No need to call the sync wrapper in cli_mkdir()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibsmb: Add async cli_smb2_mkdir_send()/recv()
Volker Lendecke [Tue, 26 May 2020 20:21:14 +0000 (22:21 +0200)]
libsmb: Add async cli_smb2_mkdir_send()/recv()

Not converting the sync version to use it, it will go away very soon

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agopylibsmb: Use async cli_chkpath also for smb2
Volker Lendecke [Tue, 26 May 2020 07:01:57 +0000 (09:01 +0200)]
pylibsmb: Use async cli_chkpath also for smb2

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibsmb: Remove sync cli_smb2_chkpath()
Volker Lendecke [Mon, 25 May 2020 16:31:10 +0000 (18:31 +0200)]
libsmb: Remove sync cli_smb2_chkpath()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibsmb: Use async cli_smb2_chkpath in async cli_chkpath
Volker Lendecke [Mon, 25 May 2020 16:23:31 +0000 (18:23 +0200)]
libsmb: Use async cli_smb2_chkpath in async cli_chkpath

No need to call the sync wrapper in cli_chkpath()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibsmb: Add async cli_smb2_chkpath_send/recv()
Volker Lendecke [Tue, 26 May 2020 20:21:14 +0000 (22:21 +0200)]
libsmb: Add async cli_smb2_chkpath_send/recv()

Not converting the sync version to use it, it will go away very soon

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agopylibsmb: Use async cli_rmdir also for smb2
Volker Lendecke [Tue, 26 May 2020 07:01:57 +0000 (09:01 +0200)]
pylibsmb: Use async cli_rmdir also for smb2

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibsmb: Remove sync cli_smb2_rmdir()
Volker Lendecke [Mon, 25 May 2020 16:31:10 +0000 (18:31 +0200)]
libsmb: Remove sync cli_smb2_rmdir()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibsmb: Use tevent_req_simple_finish_ntstatus() in cli_rmdir_done()
Volker Lendecke [Mon, 25 May 2020 16:29:26 +0000 (18:29 +0200)]
libsmb: Use tevent_req_simple_finish_ntstatus() in cli_rmdir_done()

Save a few lines of code

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibsmb: Use async cli_smb2_rmdir in async cli_rmdir
Volker Lendecke [Mon, 25 May 2020 16:23:31 +0000 (18:23 +0200)]
libsmb: Use async cli_smb2_rmdir in async cli_rmdir

No need to call the sync wrapper in cli_rmdir()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbcacls: Fix typo "inherated"->"inherited"
Volker Lendecke [Tue, 26 May 2020 06:17:14 +0000 (08:17 +0200)]
smbcacls: Fix typo "inherated"->"inherited"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbcacls: Align integer types
Volker Lendecke [Tue, 26 May 2020 06:16:32 +0000 (08:16 +0200)]
smbcacls: Align integer types

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbcacls: Remove the CREATE_ACCESS_READ #define
Volker Lendecke [Tue, 26 May 2020 06:04:52 +0000 (08:04 +0200)]
smbcacls: Remove the CREATE_ACCESS_READ #define

That only confuses things

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbcacls: Reformat a call to cli_ntcreate()
Volker Lendecke [Tue, 26 May 2020 06:07:41 +0000 (08:07 +0200)]
smbcacls: Reformat a call to cli_ntcreate()

The next patch will change one of the arguments

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibsmb: Remove the CREATE_ACCESS_READ #define
Volker Lendecke [Tue, 26 May 2020 06:04:52 +0000 (08:04 +0200)]
libsmb: Remove the CREATE_ACCESS_READ #define

That only confuses things

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibsmb: Reformat calls to cli_ntcreate()
Volker Lendecke [Tue, 26 May 2020 06:07:41 +0000 (08:07 +0200)]
libsmb: Reformat calls to cli_ntcreate()

The next patch will change one of the arguments

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbclient: Remove the CREATE_ACCESS_READ #define
Volker Lendecke [Tue, 26 May 2020 06:04:52 +0000 (08:04 +0200)]
smbclient: Remove the CREATE_ACCESS_READ #define

That only confuses things

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbclient: Reformat a call to cli_ntcreate()
Volker Lendecke [Tue, 26 May 2020 06:01:33 +0000 (08:01 +0200)]
smbclient: Reformat a call to cli_ntcreate()

The next patch will change one of the arguments

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agopylibsmb: Use async cli_unlink also for smb2
Volker Lendecke [Tue, 26 May 2020 07:01:57 +0000 (09:01 +0200)]
pylibsmb: Use async cli_unlink also for smb2

Async cli_smb2_unlink was just added

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibsmb: Remove sync cli_smb2_unlink()
Volker Lendecke [Mon, 25 May 2020 16:31:10 +0000 (18:31 +0200)]
libsmb: Remove sync cli_smb2_unlink()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibsmb: Use tevent_req_simple_finish_ntstatus() in cli_unlink_done()
Volker Lendecke [Mon, 25 May 2020 16:29:26 +0000 (18:29 +0200)]
libsmb: Use tevent_req_simple_finish_ntstatus() in cli_unlink_done()

Save a few lines of code

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibsmb: Use async cli_smb2_unlink in async cli_unlink
Volker Lendecke [Mon, 25 May 2020 16:23:31 +0000 (18:23 +0200)]
libsmb: Use async cli_smb2_unlink in async cli_unlink

No need to call the sync wrapper in cli_unlink()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibsmb: Remove clistr_pull_talloc()
Volker Lendecke [Sun, 17 May 2020 10:57:32 +0000 (12:57 +0200)]
libsmb: Remove clistr_pull_talloc()

This was just a 1:1 wrapper around pull_string_talloc()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibsmb: Trim #includes
Volker Lendecke [Sun, 17 May 2020 10:06:23 +0000 (12:06 +0200)]
libsmb: Trim #includes

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibsmb: Remove an outdated comment
Volker Lendecke [Mon, 25 May 2020 16:21:40 +0000 (18:21 +0200)]
libsmb: Remove an outdated comment

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3:libsmb: remove finally unused credential flags
Stefan Metzmacher [Mon, 11 Nov 2019 16:52:13 +0000 (17:52 +0100)]
s3:libsmb: remove finally unused credential flags

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

3 years agoexamples/fuse/smb2mount: avoid using CLI_FULL_CONNECTION_{USE,FALLBACK_AFTER}_KERBERO...
Stefan Metzmacher [Mon, 11 Nov 2019 16:47:42 +0000 (17:47 +0100)]
examples/fuse/smb2mount: avoid using CLI_FULL_CONNECTION_{USE,FALLBACK_AFTER}_KERBEROS flags

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:rpcclient: avoid using auth related CLI_FULL_CONNECTION_* flags
Stefan Metzmacher [Mon, 11 Nov 2019 16:49:48 +0000 (17:49 +0100)]
s3:rpcclient: avoid using auth related CLI_FULL_CONNECTION_* flags

We use get_cmdline_auth_info_creds() and pass cli_credentials arround.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:torture: don't use CLI_FULL_CONNECTION_USE_KERBEROS in open_nbt_connection()
Stefan Metzmacher [Mon, 11 Nov 2019 16:49:05 +0000 (17:49 +0100)]
s3:torture: don't use CLI_FULL_CONNECTION_USE_KERBEROS in open_nbt_connection()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:smbspool: avoid using CLI_FULL_CONNECTION_{USE,FALLBACK_AFTER}_KERBEROS flags
Stefan Metzmacher [Mon, 11 Nov 2019 16:47:42 +0000 (17:47 +0100)]
s3:smbspool: avoid using CLI_FULL_CONNECTION_{USE,FALLBACK_AFTER}_KERBEROS flags

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:libsmb: remove unused cli_full_connection()
Stefan Metzmacher [Mon, 11 Nov 2019 16:29:57 +0000 (17:29 +0100)]
s3:libsmb: remove unused cli_full_connection()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:libsmb: remove unused cli_cm_force_encryption()
Stefan Metzmacher [Mon, 11 Nov 2019 16:28:35 +0000 (17:28 +0100)]
s3:libsmb: remove unused cli_cm_force_encryption()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:libsmb_server: fix error handling in SMBC_server_internal()
Stefan Metzmacher [Mon, 11 Nov 2019 16:26:53 +0000 (17:26 +0100)]
s3:libsmb_server: fix error handling in SMBC_server_internal()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:libsmb_server: make use of SMBC_auth_credentials() in SMBC_attr_server()
Stefan Metzmacher [Mon, 11 Nov 2019 16:25:47 +0000 (17:25 +0100)]
s3:libsmb_server: make use of SMBC_auth_credentials() in SMBC_attr_server()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:libsmb_server: split out SMBC_auth_credentials() helper
Stefan Metzmacher [Mon, 11 Nov 2019 15:40:40 +0000 (16:40 +0100)]
s3:libsmb_server: split out SMBC_auth_credentials() helper

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:libsmb_server: don't use auth related flags in SMBC_server_internal()
Stefan Metzmacher [Mon, 11 Nov 2019 16:23:14 +0000 (17:23 +0100)]
s3:libsmb_server: don't use auth related flags in SMBC_server_internal()

These are ignored at the lower levels if we're passing cli_credential
structures along.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:locktest2: use cli_session_creds_init() directly
Stefan Metzmacher [Mon, 11 Nov 2019 15:14:38 +0000 (16:14 +0100)]
s3:locktest2: use cli_session_creds_init() directly

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:net: make use of net_context_creds() in net_ads_printer_publish()
Stefan Metzmacher [Mon, 11 Nov 2019 14:46:16 +0000 (15:46 +0100)]
s3:net: make use of net_context_creds() in net_ads_printer_publish()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:libnet_join: call cli_session_creds_init() directly
Stefan Metzmacher [Mon, 11 Nov 2019 14:38:24 +0000 (15:38 +0100)]
s3:libnet_join: call cli_session_creds_init() directly

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:netlookup: make use of cli_credentials_init_anon()
Stefan Metzmacher [Mon, 11 Nov 2019 14:23:45 +0000 (15:23 +0100)]
s3:netlookup: make use of cli_credentials_init_anon()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:net: make use of net_context_creds() in connect_to_service()
Stefan Metzmacher [Mon, 11 Nov 2019 14:18:11 +0000 (15:18 +0100)]
s3:net: make use of net_context_creds() in connect_to_service()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:net: make use of cli_credentials_init_anon() in connect_to_ipc_anonymous()
Stefan Metzmacher [Mon, 11 Nov 2019 14:14:18 +0000 (15:14 +0100)]
s3:net: make use of cli_credentials_init_anon() in connect_to_ipc_anonymous()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:libnet_join: make use of cli_credentials_init_anon()
Stefan Metzmacher [Mon, 11 Nov 2019 14:10:10 +0000 (15:10 +0100)]
s3:libnet_join: make use of cli_credentials_init_anon()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:rpc_server/spoolss: make use of cli_credentials_init_anon()
Stefan Metzmacher [Mon, 11 Nov 2019 14:02:11 +0000 (15:02 +0100)]
s3:rpc_server/spoolss: make use of cli_credentials_init_anon()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:rpcclient: Use get_cmdline_auth_info_creds()
Stefan Metzmacher [Sun, 10 Nov 2019 23:44:22 +0000 (00:44 +0100)]
s3:rpcclient: Use get_cmdline_auth_info_creds()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:rpcclient: Rename creds to trust_creds
Andreas Schneider [Tue, 26 May 2020 10:10:06 +0000 (12:10 +0200)]
s3:rpcclient: Rename creds to trust_creds

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 years agos3:libsmb: make use of get_cmdline_auth_info_creds() in get_ipc_connect()
Stefan Metzmacher [Mon, 11 Nov 2019 14:01:03 +0000 (15:01 +0100)]
s3:libsmb: make use of get_cmdline_auth_info_creds() in get_ipc_connect()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:smbcacls: make use of get_cmdline_auth_info_creds()
Stefan Metzmacher [Mon, 11 Nov 2019 13:48:12 +0000 (14:48 +0100)]
s3:smbcacls: make use of get_cmdline_auth_info_creds()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:smbcquotas: make use of get_cmdline_auth_info_creds()
Stefan Metzmacher [Mon, 11 Nov 2019 13:48:12 +0000 (14:48 +0100)]
s3:smbcquotas: make use of get_cmdline_auth_info_creds()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:mdfind: make use of get_cmdline_auth_info_creds()
Stefan Metzmacher [Mon, 11 Nov 2019 13:45:43 +0000 (14:45 +0100)]
s3:mdfind: make use of get_cmdline_auth_info_creds()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:rpcclient: make use of get_cmdline_auth_info_creds() in cmd_spoolss.c
Stefan Metzmacher [Mon, 11 Nov 2019 13:38:19 +0000 (14:38 +0100)]
s3:rpcclient: make use of get_cmdline_auth_info_creds() in cmd_spoolss.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agoexamples/fuse/smb2mount: make use of get_cmdline_auth_info_creds()
Stefan Metzmacher [Mon, 11 Nov 2019 13:34:36 +0000 (14:34 +0100)]
examples/fuse/smb2mount: make use of get_cmdline_auth_info_creds()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:cli_pipe: remove unused cli_rpc_pipe_open_generic_auth()
Stefan Metzmacher [Mon, 11 Nov 2019 13:28:06 +0000 (14:28 +0100)]
s3:cli_pipe: remove unused cli_rpc_pipe_open_generic_auth()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:cli_pipe: improve debug messages in cli_rpc_pipe_open_with_creds()
Stefan Metzmacher [Mon, 11 Nov 2019 13:27:25 +0000 (14:27 +0100)]
s3:cli_pipe: improve debug messages in cli_rpc_pipe_open_with_creds()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:net: make use of cli_rpc_pipe_open_with_creds() by using net_context_creds()
Stefan Metzmacher [Mon, 11 Nov 2019 12:58:37 +0000 (13:58 +0100)]
s3:net: make use of cli_rpc_pipe_open_with_creds() by using net_context_creds()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:net: avoid prompting for a password if --use-ccache is used
Stefan Metzmacher [Mon, 11 Nov 2019 12:58:37 +0000 (13:58 +0100)]
s3:net: avoid prompting for a password if --use-ccache is used

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:net: add net_context_creds() helper function
Stefan Metzmacher [Mon, 11 Nov 2019 12:57:55 +0000 (13:57 +0100)]
s3:net: add net_context_creds() helper function

Pair-Programmed-With: Andreas Schneider <asn@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:net: always set ctx->opt_user_specified = true when we overwrite opt_user_name
Stefan Metzmacher [Mon, 11 Nov 2019 12:43:02 +0000 (13:43 +0100)]
s3:net: always set ctx->opt_user_specified = true when we overwrite opt_user_name

If we force changing the used username we should make that clear.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:net: remove unused net_use_machine_account()
Stefan Metzmacher [Mon, 11 Nov 2019 12:35:16 +0000 (13:35 +0100)]
s3:net: remove unused net_use_machine_account()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:cli_pipe: remove unused 'use_kerberos' from cli_rpc_pipe_open_generic_auth()
Stefan Metzmacher [Mon, 11 Nov 2019 12:11:53 +0000 (13:11 +0100)]
s3:cli_pipe: remove unused 'use_kerberos' from cli_rpc_pipe_open_generic_auth()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agoOID: Reserve 1.3.6.1.4.1.7165.777.x for use on the wiki
Andrew Bartlett [Tue, 26 May 2020 10:35:40 +0000 (22:35 +1200)]
OID: Reserve 1.3.6.1.4.1.7165.777.x for use on the wiki

This allows us to handle some OIDs more freely and use them in example schema
without patching the main git repo each time.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Gary Lockyer <gary@samba.org>
Autobuild-Date(master): Wed May 27 22:17:10 UTC 2020 on sn-devel-184

3 years agolib/util: Allow gdb to be started by samba_start_debugger() under the default Ubuntu...
Andrew Bartlett [Sat, 23 May 2020 09:24:07 +0000 (21:24 +1200)]
lib/util: Allow gdb to be started by samba_start_debugger() under the default Ubuntu restrictions

Ubuntu (in particular) restricts ptrace by default for security reasons
but the processe to be traced can allow tracing by a child process
using prctl().  This matches what is done for panic action =

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
3 years agos3: VFS: cap. Fixup mistake using the wrong parameter to capencode.
Jeremy Allison [Tue, 26 May 2020 18:34:08 +0000 (11:34 -0700)]
s3: VFS: cap. Fixup mistake using the wrong parameter to capencode.

Caught by Coverity.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue May 26 21:35:55 UTC 2020 on sn-devel-184

3 years agolibgpo: Remove unused code
Stefan Metzmacher [Mon, 11 Nov 2019 14:56:32 +0000 (15:56 +0100)]
libgpo: Remove unused code

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue May 26 11:22:07 UTC 2020 on sn-devel-184

3 years agos3-net: disable net_ads_gpo_apply() and net_ads_gpo_refresh()
David Mulder [Fri, 12 Oct 2018 10:10:43 +0000 (04:10 -0600)]
s3-net: disable net_ads_gpo_apply() and net_ads_gpo_refresh()

These are now handled in samba-gpupdate, and the
net ads gpo refresh has not worked for some time.

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agolibsmb: Apply some const to parse_finfo_id_both_directory_info()
Volker Lendecke [Sat, 16 May 2020 15:33:38 +0000 (17:33 +0200)]
libsmb: Apply some const to parse_finfo_id_both_directory_info()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon May 25 09:36:15 UTC 2020 on sn-devel-184

3 years agolibsmb: Remove unused cli_errstr()
Volker Lendecke [Sat, 16 May 2020 15:01:04 +0000 (17:01 +0200)]
libsmb: Remove unused cli_errstr()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agotorture3: Remove some ancient unused code
Volker Lendecke [Sat, 16 May 2020 15:00:35 +0000 (17:00 +0200)]
torture3: Remove some ancient unused code

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agolibsmb: Move a variable declaration closer to its use
Volker Lendecke [Mon, 20 Apr 2020 07:57:31 +0000 (09:57 +0200)]
libsmb: Move a variable declaration closer to its use

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agolibsmb: Remove some lines that were never used
Volker Lendecke [Sun, 19 Apr 2020 12:40:56 +0000 (14:40 +0200)]
libsmb: Remove some lines that were never used

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agolibsmb: Avoid casts
Volker Lendecke [Sat, 22 Feb 2020 10:52:51 +0000 (11:52 +0100)]
libsmb: Avoid casts

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agolibsmb: Use IS[DOT]DOT
Volker Lendecke [Sat, 22 Feb 2020 10:48:45 +0000 (11:48 +0100)]
libsmb: Use IS[DOT]DOT

strequal is not necessary here

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agolibsmb: Remove a pointless ZERO_STRUCT()
Volker Lendecke [Sat, 22 Feb 2020 10:21:44 +0000 (11:21 +0100)]
libsmb: Remove a pointless ZERO_STRUCT()

"c" is a pointer that was initialized to NULL above

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agolibsmb: Simplify callers of SMBC_dlist_contains()
Volker Lendecke [Fri, 21 Feb 2020 21:35:44 +0000 (22:35 +0100)]
libsmb: Simplify callers of SMBC_dlist_contains()

This function already does the NULL check on the file pointer

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agolibsmb: Make SMBC_dlist_contains return bool
Volker Lendecke [Fri, 21 Feb 2020 21:13:49 +0000 (22:13 +0100)]
libsmb: Make SMBC_dlist_contains return bool

It returned True/False, and is used as boolean only. Modernize
formatting a bit.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agolibsmb: Align calls to SMBC_dlist_contains()
Volker Lendecke [Fri, 21 Feb 2020 21:31:06 +0000 (22:31 +0100)]
libsmb: Align calls to SMBC_dlist_contains()

Everywhere else it's called as !SMBC_dlist_contains()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agobuild: add configure option to control vfs_snapper build
Matt Taylor [Mon, 11 May 2020 19:26:41 +0000 (15:26 -0400)]
build: add configure option to control vfs_snapper build

vfs_snapper is currently built if dbus development headers / libraries
are detected during configure. This commit adds new --disable-snapper
and --enable-snapper (default) configure parameters. When enabled,
configure will fail if the dbus development headers / libraries are
missing.

Signed-off-by: Matt Taylor <liverbugg@rinux.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon May 25 01:16:46 UTC 2020 on sn-devel-184

3 years agobuild: quota wscript error message spelling fix
Matt Taylor [Tue, 12 May 2020 13:07:14 +0000 (15:07 +0200)]
build: quota wscript error message spelling fix

Signed-off-by: Matt Taylor <liverbugg@rinux.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos3: rpc_server: Avoid casts calling to find_policy_by_hnd()
Samuel Cabrero [Mon, 18 May 2020 10:04:33 +0000 (12:04 +0200)]
s3: rpc_server: Avoid casts calling to find_policy_by_hnd()

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos3: rpc_server: Remove dead code
Samuel Cabrero [Mon, 4 Nov 2019 18:01:28 +0000 (19:01 +0100)]
s3: rpc_server: Remove dead code

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos3: rpc_server: Drop s3 rpc handles implementation
Samuel Cabrero [Mon, 4 Nov 2019 17:38:14 +0000 (18:38 +0100)]
s3: rpc_server: Drop s3 rpc handles implementation

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agopidl: Set dce_call in pipes_struct before dispatching call
Samuel Cabrero [Tue, 29 Oct 2019 11:36:30 +0000 (12:36 +0100)]
pidl: Set dce_call in pipes_struct before dispatching call

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos3: rpc_server: Remove SAMR specific policy_handle_find() function
Samuel Cabrero [Thu, 7 May 2020 12:24:56 +0000 (14:24 +0200)]
s3: rpc_server: Remove SAMR specific policy_handle_find() function

The generic function already checks the handle type.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos3: rpc_server: Move SAMR handle based access check to a wrapper function
Samuel Cabrero [Thu, 14 May 2020 16:35:28 +0000 (18:35 +0200)]
s3: rpc_server: Move SAMR handle based access check to a wrapper function

Now that the type associated to the handle is the same for all handle
types we can wrap the access check.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos3: rpc_server: Remove SAMR specific policy_handle_create() function
Samuel Cabrero [Thu, 7 May 2020 11:29:29 +0000 (13:29 +0200)]
s3: rpc_server: Remove SAMR specific policy_handle_create() function

Now that we pass the handle type to the generic handle creation and find
functions we can drop the specific SAMR ones.

The policy_handle_create() function labeled the talloc chunk used to
allocate the handle's associated data, and the policy_handle_find() is
checking the name matches with the expected data. The check is performed
now by the generic functions based on the handle type so we can drop
these SAMR specific functions.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos3: rpc_server: pass DCE/RPC handle type to find_policy_handle
Samuel Cabrero [Wed, 6 May 2020 11:56:46 +0000 (13:56 +0200)]
s3: rpc_server: pass DCE/RPC handle type to find_policy_handle

Following changes in commit c7a4578d06427a82ead287f0c5248c1a54cc9336
pass the handle type to the handle search functions. The handle type will
be verified unless passing DCESRV_HANDLE_ANY to find functions.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agos3: rpc_server: Strip out access check field from s3 handles implementation
Samuel Cabrero [Tue, 29 Oct 2019 11:39:10 +0000 (12:39 +0100)]
s3: rpc_server: Strip out access check field from s3 handles implementation

The handle based security model is a SAMR specific feature. The access
granted is stored in the handle's associated data after creating it and
the access is verified after searching the handle.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
3 years agolibrpc: core: Move the s4 handles implementation to the RPC server core
Samuel Cabrero [Tue, 29 Oct 2019 10:04:43 +0000 (11:04 +0100)]
librpc: core: Move the s4 handles implementation to the RPC server core

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>