diff options
author | Andreas Schneider <asn@samba.org> | 2020-05-28 17:22:12 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2020-08-19 16:22:41 +0000 |
commit | c58a301c273c24531e798cd7c1b2af9be1364af9 (patch) | |
tree | c4ba566c320dd087f452cbcfc693fa2edcb8d1cd /source3 | |
parent | 946e43f0ccf3bc39d65d9b096f0a40fb12726ebb (diff) | |
download | samba-c58a301c273c24531e798cd7c1b2af9be1364af9.tar.gz |
s3:libsmb: Introduce CLI_FULL_CONNECTION_IPC
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3')
-rw-r--r-- | source3/include/client.h | 1 | ||||
-rw-r--r-- | source3/libnet/libnet_join.c | 6 | ||||
-rw-r--r-- | source3/libsmb/cliconnect.c | 3 | ||||
-rw-r--r-- | source3/rpc_server/spoolss/srv_spoolss_nt.c | 4 | ||||
-rw-r--r-- | source3/rpcclient/cmd_spoolss.c | 2 | ||||
-rw-r--r-- | source3/rpcclient/rpcclient.c | 2 | ||||
-rw-r--r-- | source3/utils/mdfind.c | 2 | ||||
-rw-r--r-- | source3/utils/net_ads.c | 3 | ||||
-rw-r--r-- | source3/utils/net_util.c | 9 | ||||
-rw-r--r-- | source3/utils/netlookup.c | 4 |
10 files changed, 24 insertions, 12 deletions
diff --git a/source3/include/client.h b/source3/include/client.h index 6a3b1b02ff3..19a738900b7 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -121,5 +121,6 @@ struct file_info { #define CLI_FULL_CONNECTION_FORCE_ASCII 0x0100 #define CLI_FULL_CONNECTION_FORCE_SMB1 0x0400 #define CLI_FULL_CONNECTION_DISABLE_SMB1 0x0800 +#define CLI_FULL_CONNECTION_IPC 0x1000 #endif /* _CLIENT_H */ diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c index 34938603606..392e3eff74f 100644 --- a/source3/libnet/libnet_join.c +++ b/source3/libnet/libnet_join.c @@ -1068,7 +1068,7 @@ static NTSTATUS libnet_join_connect_dc_ipc(const char *dc, bool use_ccache = false; bool pw_nt_hash = false; struct cli_credentials *creds = NULL; - int flags = 0; + int flags = CLI_FULL_CONNECTION_IPC; NTSTATUS status; if (use_kerberos && pass) { @@ -1684,7 +1684,7 @@ NTSTATUS libnet_join_ok(struct messaging_context *msg_ctx, struct netlogon_creds_CredentialState *creds = NULL; uint32_t netlogon_flags = 0; NTSTATUS status; - int flags = 0; + int flags = CLI_FULL_CONNECTION_IPC; if (!dc_name) { TALLOC_FREE(frame); @@ -1734,7 +1734,7 @@ NTSTATUS libnet_join_ok(struct messaging_context *msg_ctx, NULL, 0, "IPC$", "IPC", anon_creds, - 0, + flags, SMB_SIGNING_OFF); } diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c index 1fb1f0127b9..f20146378e3 100644 --- a/source3/libsmb/cliconnect.c +++ b/source3/libsmb/cliconnect.c @@ -2788,7 +2788,7 @@ static struct tevent_req *cli_start_connection_send( } state->ev = ev; - if (signing_state == SMB_SIGNING_IPC_DEFAULT) { + if (flags & CLI_FULL_CONNECTION_IPC) { state->min_protocol = lp_client_ipc_min_protocol(); state->max_protocol = lp_client_ipc_max_protocol(); } else { @@ -3673,6 +3673,7 @@ struct cli_state *get_ipc_connect(char *server, uint32_t flags = CLI_FULL_CONNECTION_ANONYMOUS_FALLBACK; flags |= CLI_FULL_CONNECTION_FORCE_SMB1; + flags |= CLI_FULL_CONNECTION_IPC; nt_status = cli_full_connection_creds(&cli, NULL, server, server_ss, 0, "IPC$", "IPC", get_cmdline_auth_info_creds(user_info), diff --git a/source3/rpc_server/spoolss/srv_spoolss_nt.c b/source3/rpc_server/spoolss/srv_spoolss_nt.c index 8b6a803a910..16e3ee485f0 100644 --- a/source3/rpc_server/spoolss/srv_spoolss_nt.c +++ b/source3/rpc_server/spoolss/srv_spoolss_nt.c @@ -2481,7 +2481,9 @@ static bool spoolss_connect_to_client(struct rpc_pipe_client **pp_pipe, struct c /* setup the connection */ ret = cli_full_connection_creds( pp_cli, lp_netbios_name(), remote_machine, &rm_addr, 0, "IPC$", "IPC", - anon_creds, 0, SMB_SIGNING_OFF); + anon_creds, + CLI_FULL_CONNECTION_IPC, + SMB_SIGNING_OFF); TALLOC_FREE(anon_creds); if ( !NT_STATUS_IS_OK( ret ) ) { DEBUG(2,("spoolss_connect_to_client: connection to [%s] failed!\n", diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c index 88122eb296d..3de126f54cd 100644 --- a/source3/rpcclient/cmd_spoolss.c +++ b/source3/rpcclient/cmd_spoolss.c @@ -3538,7 +3538,7 @@ static WERROR cmd_spoolss_printercmp(struct rpc_pipe_client *cli, "IPC$", "IPC", get_cmdline_auth_info_creds( popt_get_cmdline_auth_info()), - 0, /* flags */ + CLI_FULL_CONNECTION_IPC, get_cmdline_auth_info_signing_state( popt_get_cmdline_auth_info())); diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c index 67a1066fc15..c86474d08f1 100644 --- a/source3/rpcclient/rpcclient.c +++ b/source3/rpcclient/rpcclient.c @@ -1019,7 +1019,7 @@ out_free: static int opt_port = 0; int result = 0; TALLOC_CTX *frame = talloc_stackframe(); - uint32_t flags = 0; + uint32_t flags = CLI_FULL_CONNECTION_IPC; struct dcerpc_binding *binding = NULL; enum dcerpc_transport_t transport; uint32_t bflags = 0; diff --git a/source3/utils/mdfind.c b/source3/utils/mdfind.c index 2f952c29b4f..a3c879e75fb 100644 --- a/source3/utils/mdfind.c +++ b/source3/utils/mdfind.c @@ -70,7 +70,7 @@ int main(int argc, char **argv) const char *mds_query = NULL; struct cli_state *cli = NULL; char *basepath = NULL; - uint32_t flags = 0; + uint32_t flags = CLI_FULL_CONNECTION_IPC; int signing_state = SMB_SIGNING_IPC_DEFAULT; uint64_t *cnids = NULL; size_t ncnids; diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c index 8dd0baed4ce..ce4810e3e64 100644 --- a/source3/utils/net_ads.c +++ b/source3/utils/net_ads.c @@ -2519,7 +2519,8 @@ static int net_ads_printer_publish(struct net_context *c, int argc, const char * nt_status = cli_full_connection_creds(&cli, lp_netbios_name(), servername, &server_ss, 0, "IPC$", "IPC", - creds, 0, + creds, + CLI_FULL_CONNECTION_IPC, SMB_SIGNING_IPC_DEFAULT); if (NT_STATUS_IS_ERR(nt_status)) { diff --git a/source3/utils/net_util.c b/source3/utils/net_util.c index c566ecc9000..d01b2d8c771 100644 --- a/source3/utils/net_util.c +++ b/source3/utils/net_util.c @@ -110,6 +110,7 @@ NTSTATUS connect_to_service(struct net_context *c, NTSTATUS nt_status; enum smb_signing_setting signing_setting = SMB_SIGNING_DEFAULT; struct cli_credentials *creds = NULL; + int flags = 0; creds = net_context_creds(c, c); if (creds == NULL) { @@ -119,12 +120,14 @@ NTSTATUS connect_to_service(struct net_context *c, if (strequal(service_type, "IPC")) { signing_setting = SMB_SIGNING_IPC_DEFAULT; + flags |= CLI_FULL_CONNECTION_IPC; } nt_status = cli_full_connection_creds(cli_ctx, NULL, server_name, server_ss, c->opt_port, service_name, service_type, - creds, 0, + creds, + flags, signing_setting); if (!NT_STATUS_IS_OK(nt_status)) { d_fprintf(stderr, _("Could not connect to server %s\n"), @@ -195,7 +198,9 @@ NTSTATUS connect_to_ipc_anonymous(struct net_context *c, nt_status = cli_full_connection_creds(cli_ctx, c->opt_requester_name, server_name, server_ss, c->opt_port, "IPC$", "IPC", - anon_creds, 0, SMB_SIGNING_OFF); + anon_creds, + CLI_FULL_CONNECTION_IPC, + SMB_SIGNING_OFF); if (NT_STATUS_IS_OK(nt_status)) { return nt_status; diff --git a/source3/utils/netlookup.c b/source3/utils/netlookup.c index 6cea2ee306c..2241beb331f 100644 --- a/source3/utils/netlookup.c +++ b/source3/utils/netlookup.c @@ -98,7 +98,9 @@ static struct con_struct *create_cs(struct net_context *c, nt_status = cli_full_connection_creds(&cs->cli, lp_netbios_name(), lp_netbios_name(), &loopback_ss, 0, "IPC$", "IPC", - anon_creds, 0, SMB_SIGNING_OFF); + anon_creds, + CLI_FULL_CONNECTION_IPC, + SMB_SIGNING_OFF); if (!NT_STATUS_IS_OK(nt_status)) { DEBUG(2,("create_cs: Connect failed. Error was %s\n", nt_errstr(nt_status))); |