static char remote_machine[MACHINE_NAME_SIZE];
userdom_struct current_user_info;
-fstring remote_proto="UNKNOWN";
+static fstring remote_proto="UNKNOWN";
+
+void set_remote_proto(const char *proto)
+{
+ fstrcpy(remote_proto, proto);
+}
/**
* Set the 'local' machine name
#ifndef SUBSTITUTE_H
#define SUBSTITUTE_H
+void set_remote_proto(const char *proto);
bool set_local_machine_name(const char *local_name, bool perm);
const char *get_local_machine_name(void);
bool set_remote_machine_name(const char *remote_name, bool perm);
#include "auth/gensec/gensec.h"
#include "../libcli/smb/smb_signing.h"
#include "lib/util/string_wrappers.h"
+#include "source3/lib/substitute.h"
/*
* MS-CIFS, 2.2.4.52.2 SMB_COM_NEGOTIATE Response:
*/
#define NO_PROTOCOL_CHOSEN 0xffff
-extern fstring remote_proto;
-
static void get_challenge(struct smbXsrv_connection *xconn, uint8_t buff[8])
{
NTSTATUS nt_status;
exit_server_cleanly("no protocol supported\n");
}
- fstrcpy(remote_proto,supported_protocols[protocol].short_name);
+ set_remote_proto(supported_protocols[protocol].short_name);
reload_services(sconn, conn_snum_used, true);
status = supported_protocols[protocol].proto_reply_fn(req, choice);
if (!NT_STATUS_IS_OK(status)) {
#include "auth.h"
#include "auth/gensec/gensec.h"
#include "lib/util/string_wrappers.h"
+#include "source3/lib/substitute.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_SMB2
-extern fstring remote_proto;
-
/*
* this is the entry point if SMB2 is selected via
* the SMB negprot and the given dialect.
break;
}
- fstr_sprintf(remote_proto, "SMB%X_%02X",
- (dialect >> 8) & 0xFF, dialect & 0xFF);
+ {
+ fstring proto;
+ fstr_sprintf(proto,
+ "SMB%X_%02X",
+ (dialect >> 8) & 0xFF, dialect & 0xFF);
+ set_remote_proto(proto);
+ DEBUG(3,("Selected protocol %s\n", proto));
+ }
reload_services(req->sconn, conn_snum_used, true);
- DEBUG(3,("Selected protocol %s\n", remote_proto));
in_preauth = smb2_negotiate_context_find(&in_c,
SMB2_PREAUTH_INTEGRITY_CAPABILITIES);
exit_server_cleanly("no protocol supported\n");
}
- fstrcpy(remote_proto,supported_protocols[protocol].short_name);
+ set_remote_proto(supported_protocols[protocol].short_name);
reload_services(sconn, conn_snum_used, true);
status = supported_protocols[protocol].proto_reply_fn(req, choice);
if (!NT_STATUS_IS_OK(status)) {