summaryrefslogtreecommitdiff
path: root/source3/libnet/libnet_join.c
AgeCommit message (Collapse)AuthorFilesLines
2026-04-07s3:libads: Set dns_lookup_kdc=false during net ads joinPavel Filipenský1-1/+59
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15999 Signed-off-by: Pavel Filipenský <pfilipensky@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Pavel Filipensky <pfilipensky@samba.org> Autobuild-Date(master): Tue Apr 7 14:09:40 UTC 2026 on atb-devel-224
2026-04-07s3:libnet: Fix DC numeric ip handlingPavel Filipenský1-1/+1
This is fixing regression introduced via 82f53c8 BUG: https://bugzilla.samba.org/show_bug.cgi?id=15999 Signed-off-by: Pavel Filipenský <pfilipensky@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2025-09-05s3:net: Pass down the server from cmdline to sync_pw2keytabs()Andreas Schneider1-1/+1
This makes sure that during 'net ads join' the keytab create code - sync_pw2keytabs() talks to the same DC at what the machine account was created. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15905 Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Pavel Filipenský <pfilipensky@samba.org> Pair-Programmed-With: Pavel Filipenský <pfilipensky@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Autobuild-User(master): Pavel Filipensky <pfilipensky@samba.org> Autobuild-Date(master): Fri Sep 5 13:38:33 UTC 2025 on atb-devel-224
2025-06-16libsmb: Remove "source3/libsmb/libsmb.h"Volker Lendecke1-1/+3
libsmb.h added ads_status.h and cli_smb2_fnum.h. Only few users need either. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-04-18s3:libsmb: pass struct smb_transports to cli_full_connection_creds()Stefan Metzmacher1-3/+12
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-01-30s3-libnet: avoid using lp_dns_hostname() in join codeGünther Deschner1-1/+8
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15777 This codepath is also used for provisiong non-local machines into AD during offlinejoin operations. When creating accounts for non-local machines we certainly need to be able to use arbitrary hostname other than lp_netbios_name() (which is used internally by lp_dns_hostname()). This partly reverts 0e96092c1895ecb41d4064111566b4ada71fe457. Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Thu Jan 30 07:35:05 UTC 2025 on atb-devel-224
2025-01-13s3:libnet_join: use GENSEC_FEATURE_NO_DELEGATION for trust credentialsStefan Metzmacher1-0/+9
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
2024-11-19libnet3: Fix Coverity ID 1034874 Resource leakVolker Lendecke1-2/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2024-09-26s3:rpc_client: pass remote_{name,sockaddr} to rpccli_connect_netlogon()Stefan Metzmacher1-0/+10
Otherwise this can only work with NCACN_NP... Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2024-09-26s3:libnet: make use of rpccli_connect_netlogon() instead of reimplement the ↵Stefan Metzmacher1-97/+21
logic We only need the logic to setup a full netlogon connection once... Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2024-09-26s3:libnet_join: make use of dcerpc_binding_handle_transport_session_key()Stefan Metzmacher1-1/+2
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2024-07-26s3:libnet: Sync keytab during libnet_join_create_keytab()Pavel Filipenský1-8/+2
BUG: https://bugzilla.samba.org/show_bug.cgi?id=6750 Signed-off-by: Pavel Filipenský <pfilipensky@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-05-22s3:libnet: Convert myalias to lower caseAndreas Schneider1-0/+4
This will be more consistent as it is a dnsname. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-05-22s3:libnet: Use lp_dns_hostname() in libnet_join.cAndreas Schneider1-0/+22
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-05-14s3:include: remove unused krb5_env.hStefan Metzmacher1-1/+0
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2024-05-14s3:libnet_join: pass down cli_credentials *admin_credentials to ↵Stefan Metzmacher1-202/+58
libnet_{Join,Unjoin}Ctx() Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2024-04-29s3:libnet: Fix memory leak in libnet_join_connect_dc_ipc()Andreas Schneider1-4/+7
Direct leak of 885 byte(s) in 1 object(s) allocated from: #0 0x7f261b8dc03f in malloc (/lib64/libasan.so.8+0xdc03f) (BuildId: 3e1694ad218c99a8b1b69231666a27df63cf19d0) #1 0x7f261b2c2bc2 in __talloc_with_prefix ../../lib/talloc/talloc.c:783 #2 0x7f261b2c543c in _talloc_pool ../../lib/talloc/talloc.c:838 #3 0x7f261b2c543c in _talloc_pooled_object ../../lib/talloc/talloc.c:906 #4 0x7f261a69cac9 in __tevent_req_create ../../lib/tevent/tevent_req.c:98 #5 0x7f261a75bf55 in cli_full_connection_creds_send ../../source3/libsmb/cliconnect.c:3455 #6 0x7f261a75c4b7 in cli_full_connection_creds ../../source3/libsmb/cliconnect.c:3818 #7 0x7f261b70d39f in libnet_join_connect_dc_ipc ../../source3/libnet/libnet_join.c:1146 #8 0x7f261b715794 in libnet_join_lookup_dc_rpc ../../source3/libnet/libnet_join.c:1188 #9 0x7f261b715794 in libnet_DomainJoin ../../source3/libnet/libnet_join.c:2812 #10 0x7f261b715794 in libnet_Join ../../source3/libnet/libnet_join.c:3040 #11 0x555bd93671ea in net_ads_join ../../source3/utils/net_ads.c:1855 #12 0x555bd9415ca9 in net_join ../../source3/utils/net_join.c:45 #13 0x555bd940b972 in net_run_function ../../source3/utils/net_util.c:464 #14 0x555bd9363129 in main ../../source3/utils/net.c:1372 #15 0x7f2616a281af in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2024-04-29s3:libsmb: Pass memory context to cli_full_connection_creds()Andreas Schneider1-3/+7
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2023-09-11s3:libnet: Fix code spellingJoseph Sutton1-1/+1
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-08-21s3:libnet: Remove unnecessary castJoseph Sutton1-1/+1
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-07-05s3-net: no secrets access required when processing a ODJ provisioningGünther Deschner1-0/+8
It should be possible to call "net offlinejoin provision" as non-root, no access to secrets.tdb required in that case. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15414 Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Wed Jul 5 09:23:22 UTC 2023 on atb-devel-224
2022-12-16s3-librpc: add ads.idl and convert ads_struct to talloc.Günther Deschner1-5/+5
Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-12-13CVE-2022-37966 s3:libnet: no longer reference des encryption typesStefan Metzmacher1-3/+2
We no longer have support for des encryption types in the kerberos libraries anyway. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15237 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2022-12-13CVE-2022-37966 s3:libnet: remove unused ifdef HAVE_ENCTYPE_AES*Stefan Metzmacher1-4/+0
aes encryption types are always supported. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15237 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2022-06-27s3:libads: Allocate ads->auth.ccache_name under ADS_STRUCT talloc contextSamuel Cabrero1-3/+7
Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-06-27s3:libads: Allocate ads->auth.user_name under ADS_STRUCT talloc contextSamuel Cabrero1-2/+6
Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-06-27s3:libads: Allocate ads->auth.password under ADS_STRUCT talloc contextSamuel Cabrero1-2/+6
Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-06-27s3:libads: Allocate ads->auth.realm under ADS_STRUCT talloc contextSamuel Cabrero1-3/+3
Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-06-27s3:libads: Allocate ADS_STRUCT under a talloc contextSamuel Cabrero1-13/+8
The ads_destroy() function is now static and only called from the ADS_STRUCT destructor. Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-06-27s3:libnet: Allocate a temporary talloc context in libnet_connect_ads()Samuel Cabrero1-4/+14
Prepare to allocate ADS_STRUCT under a talloc context. Pass a talloc context where the ads struct will be moved on success. Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-06-27s3:libnet: Allocate the machine name string under its container's talloc contextSamuel Cabrero1-1/+1
Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-06-27s3:libnet: Allocate the machine name string under its container's talloc contextSamuel Cabrero1-1/+1
Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-05-23s3:libnet: Fix talloc frame not freed in orderSamuel Cabrero1-1/+1
Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-01-22s3:libnet: Do not set ADS_AUTH_ALLOW_NTLMSSP in FIPS modePavel Filipenský1-1/+17
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14955 Pair-Programmed-With: Andreas Schneider <asn@samba.org> Signed-off-by: Pavel Filipenský <pfilipen@redhat.com> Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Sat Jan 22 00:27:52 UTC 2022 on sn-devel-184
2022-01-10s3:libnet: Fix dead code in libnet_join.cPavel Filipenský1-3/+2
Found by covscan. Pair-programmed-with: Andreas Schneider <asn@samba.org> Signed-off-by: Pavel Filipenský <pfilipen@redhat.com> Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2021-12-02s3:rpc_client: Pass remote name and socket to ↵Günther Deschner1-7/+22
cli_rpc_pipe_open_schannel_with_creds() BUG: https://bugzilla.samba.org/show_bug.cgi?id=14767 Pair-Programmed-With: Andreas Schneider <asn@samba.org> Signed-off-by: Guenther Deschner <gd@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2021-12-02s3:libnet: Remove tailing whitespaces in libnet_join.cAndreas Schneider1-7/+7
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14767 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2021-07-14s3-libnet_join: always check config correctness while joining offlineGünther Deschner1-3/+9
Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2021-07-14s3-libnet_join: check for netbios name correctness as wellGünther Deschner1-1/+11
Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2021-07-14s3-libnet_join: set netbios name as well when modification is requestedGünther Deschner1-0/+7
Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2021-07-14s3-libnet_join: use dsgetonedcname to validate given DCGünther Deschner1-32/+43
Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2021-07-14s3-libnet_join: use joinprov3 struct in libnet_DomainOfflineJoin()Günther Deschner1-1/+8
Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2021-07-14s3-libnet_join: add support for libnet_DomainOfflineJoinGünther Deschner1-1/+99
libnet_DomainOfflineJoin will consume the provided offline domain join blob and lay out libnet_Join information to properly store join metadata in the local database. Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2021-07-14s3-libnet_join: return account rid in libnet_JoinCtxGünther Deschner1-4/+10
Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2021-07-14s3-libnet_join: return the allocated netr_DsRGetDCNameInfo structGünther Deschner1-0/+3
Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2021-07-14s3-libnet_join: add new provision_computer_account_only flagGünther Deschner1-3/+19
Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2021-04-28auth:creds: Add obtained arg to cli_credentials_set_kerberos_state()Andreas Schneider1-1/+2
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2020-11-03auth:creds: Rename CRED_USE_KERBEROS valuesAndreas Schneider1-1/+1
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2020-08-19s3:libsmb: Remove signing_state from cli_full_connection_creds()Andreas Schneider1-6/+3
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2020-08-19s3:libsmb: Introduce CLI_FULL_CONNECTION_IPCAndreas Schneider1-3/+3
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>