mirror of
https://github.com/samba-team/samba.git
synced 2024-12-27 03:21:53 +03:00
Make 'remote_machine' private to lib/substitute.c, and fix all the user to use
the new accessor functions. Andrew Bartlett
This commit is contained in:
parent
e57a896f06
commit
f393de2310
@ -25,7 +25,6 @@
|
||||
#undef DBGC_CLASS
|
||||
#define DBGC_CLASS DBGC_AUTH
|
||||
|
||||
extern fstring remote_machine;
|
||||
extern pstring global_myname;
|
||||
|
||||
/****************************************************************************
|
||||
@ -394,7 +393,7 @@ BOOL make_user_info_for_reply(auth_usersupplied_info **user_info,
|
||||
|
||||
ret = make_user_info_map(user_info, smb_name,
|
||||
client_domain,
|
||||
remote_machine,
|
||||
get_remote_machine_name(),
|
||||
local_lm_blob,
|
||||
local_nt_blob,
|
||||
plaintext_password,
|
||||
@ -429,7 +428,7 @@ BOOL make_user_info_for_reply_enc(auth_usersupplied_info **user_info,
|
||||
|
||||
return make_user_info_map(user_info, smb_name,
|
||||
client_domain,
|
||||
remote_machine,
|
||||
get_remote_machine_name(),
|
||||
lm_resp,
|
||||
nt_resp,
|
||||
no_plaintext_blob,
|
||||
|
@ -25,9 +25,11 @@ fstring local_machine="";
|
||||
fstring remote_arch="UNKNOWN";
|
||||
userdom_struct current_user_info;
|
||||
fstring remote_proto="UNKNOWN";
|
||||
fstring remote_machine="";
|
||||
extern pstring global_myname;
|
||||
|
||||
static fstring remote_machine="";
|
||||
|
||||
|
||||
void set_local_machine_name(const char* local_name)
|
||||
{
|
||||
fstring tmp_local_machine;
|
||||
|
@ -269,9 +269,8 @@ static BOOL reload_interfaces(time_t t)
|
||||
static BOOL reload_nmbd_services(BOOL test)
|
||||
{
|
||||
BOOL ret;
|
||||
extern fstring remote_machine;
|
||||
|
||||
fstrcpy( remote_machine, "nmbd" );
|
||||
set_remote_machine_name("nmbd");
|
||||
|
||||
if ( lp_loaded() ) {
|
||||
pstring fname;
|
||||
|
@ -20,7 +20,6 @@
|
||||
|
||||
#include "includes.h"
|
||||
|
||||
extern fstring remote_machine;
|
||||
static TDB_CONTEXT *tdb;
|
||||
|
||||
/****************************************************************************
|
||||
@ -178,7 +177,7 @@ BOOL claim_connection(connection_struct *conn,char *name,int max_connections,BOO
|
||||
}
|
||||
crec.start = time(NULL);
|
||||
|
||||
StrnCpy(crec.machine,remote_machine,sizeof(crec.machine)-1);
|
||||
StrnCpy(crec.machine,get_remote_machine_name(),sizeof(crec.machine)-1);
|
||||
StrnCpy(crec.addr,conn?conn->client_address:client_addr(),sizeof(crec.addr)-1);
|
||||
|
||||
dbuf.dptr = (char *)&crec;
|
||||
|
@ -29,7 +29,6 @@
|
||||
extern BOOL case_sensitive;
|
||||
extern BOOL case_preserve;
|
||||
extern BOOL short_case_preserve;
|
||||
extern fstring remote_machine;
|
||||
extern BOOL use_mangled_map;
|
||||
|
||||
static BOOL scan_directory(char *path, char *name,connection_struct *conn,BOOL docache);
|
||||
|
@ -23,7 +23,6 @@
|
||||
extern int Protocol;
|
||||
extern int max_recv;
|
||||
extern fstring global_myworkgroup;
|
||||
extern fstring remote_machine;
|
||||
BOOL global_encrypted_passwords_negotiated = False;
|
||||
BOOL global_spnego_negotiated = False;
|
||||
struct auth_context *negprot_global_auth_context = NULL;
|
||||
|
@ -303,7 +303,7 @@ int register_vuid(auth_serversupplied_info *server_info, char *smb_name)
|
||||
/****************************************************************************
|
||||
add a name to the session users list
|
||||
****************************************************************************/
|
||||
void add_session_user(char *user)
|
||||
void add_session_user(const char *user)
|
||||
{
|
||||
fstring suser;
|
||||
StrnCpy(suser,user,sizeof(suser)-1);
|
||||
|
@ -38,7 +38,6 @@ extern pstring global_myname;
|
||||
extern int global_oplock_break;
|
||||
unsigned int smb_echo_count = 0;
|
||||
|
||||
extern fstring remote_machine;
|
||||
extern BOOL global_encrypted_passwords_negotiated;
|
||||
|
||||
|
||||
@ -108,7 +107,7 @@ int reply_special(char *inbuf,char *outbuf)
|
||||
of possibly valid usernames if we are operating
|
||||
in share mode security */
|
||||
if (lp_security() == SEC_SHARE) {
|
||||
add_session_user(remote_machine);
|
||||
add_session_user(get_remote_machine_name());
|
||||
}
|
||||
|
||||
reload_services(True);
|
||||
|
@ -27,9 +27,7 @@ extern BOOL short_case_preserve;
|
||||
extern BOOL case_mangle;
|
||||
extern BOOL case_sensitive;
|
||||
extern BOOL use_mangled_map;
|
||||
extern fstring remote_machine;
|
||||
extern userdom_struct current_user_info;
|
||||
extern fstring remote_machine;
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
@ -636,7 +634,7 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser,
|
||||
I have disabled this chdir check (tridge) */
|
||||
if (vfs_ChDir(conn,conn->connectpath) != 0) {
|
||||
DEBUG(0,("%s (%s) Can't change directory to %s (%s)\n",
|
||||
remote_machine, conn->client_address,
|
||||
get_remote_machine_name(), conn->client_address,
|
||||
conn->connectpath,strerror(errno)));
|
||||
change_to_root_user();
|
||||
yield_connection(conn, lp_servicename(SNUM(conn)));
|
||||
@ -676,7 +674,7 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser,
|
||||
*/
|
||||
|
||||
if( DEBUGLVL( IS_IPC(conn) ? 3 : 1 ) ) {
|
||||
dbgtext( "%s (%s) ", remote_machine, conn->client_address );
|
||||
dbgtext( "%s (%s) ", get_remote_machine_name(), conn->client_address );
|
||||
dbgtext( "connect to service %s ", lp_servicename(SNUM(conn)) );
|
||||
dbgtext( "initially as user %s ", user );
|
||||
dbgtext( "(uid=%d, gid=%d) ", (int)geteuid(), (int)getegid() );
|
||||
@ -825,7 +823,7 @@ connection_struct *make_connection(const char *service_in, DATA_BLOB password,
|
||||
}
|
||||
|
||||
DEBUG(0,("%s (%s) couldn't find service %s\n",
|
||||
remote_machine, client_addr(), service));
|
||||
get_remote_machine_name(), client_addr(), service));
|
||||
*status = NT_STATUS_BAD_NETWORK_NAME;
|
||||
return NULL;
|
||||
}
|
||||
@ -847,7 +845,7 @@ void close_cnum(connection_struct *conn, uint16 vuid)
|
||||
change_to_root_user();
|
||||
|
||||
DEBUG(IS_IPC(conn)?3:1, ("%s (%s) closed connection to service %s\n",
|
||||
remote_machine,conn->client_address,
|
||||
get_remote_machine_name(),conn->client_address,
|
||||
lp_servicename(SNUM(conn))));
|
||||
|
||||
if (conn->vfs_ops.disconnect != NULL) {
|
||||
|
@ -27,8 +27,6 @@
|
||||
|
||||
#include "includes.h"
|
||||
|
||||
extern fstring remote_machine;
|
||||
|
||||
static TDB_CONTEXT *tdb;
|
||||
/* called when a session is created */
|
||||
BOOL session_claim(user_struct *vuser)
|
||||
@ -116,7 +114,7 @@ BOOL session_claim(user_struct *vuser)
|
||||
sessionid.pid = pid;
|
||||
sessionid.uid = vuser->uid;
|
||||
sessionid.gid = vuser->gid;
|
||||
fstrcpy(sessionid.remote_machine, remote_machine);
|
||||
fstrcpy(sessionid.remote_machine, get_remote_machine_name());
|
||||
fstrcpy(sessionid.ip_addr, client_addr());
|
||||
|
||||
if (!smb_pam_claim_session(sessionid.username, sessionid.id_str, sessionid.hostname)) {
|
||||
|
@ -607,7 +607,6 @@ int reply_sesssetup_and_X(connection_struct *conn, char *inbuf,char *outbuf,
|
||||
extern BOOL global_encrypted_passwords_negotiated;
|
||||
extern BOOL global_spnego_negotiated;
|
||||
extern int Protocol;
|
||||
extern fstring remote_machine;
|
||||
extern userdom_struct current_user_info;
|
||||
extern int max_send;
|
||||
|
||||
@ -736,7 +735,7 @@ int reply_sesssetup_and_X(connection_struct *conn, char *inbuf,char *outbuf,
|
||||
return ERROR_NT(NT_STATUS_LOGON_FAILURE);
|
||||
}
|
||||
|
||||
DEBUG(3,("sesssetupX:name=[%s]\\[%s]@[%s]\n", domain, user, remote_machine));
|
||||
DEBUG(3,("sesssetupX:name=[%s]\\[%s]@[%s]\n", domain, user, get_remote_machine_name()));
|
||||
|
||||
if (*user) {
|
||||
if (global_spnego_negotiated) {
|
||||
|
@ -26,7 +26,6 @@ extern pstring global_myname;
|
||||
|
||||
extern pstring user_socket_options;
|
||||
|
||||
extern fstring remote_machine;
|
||||
extern WINS_OWNER *global_wins_table;
|
||||
extern int partner_count;
|
||||
|
||||
@ -637,7 +636,7 @@ static void process(void)
|
||||
lp_set_logfile(logfile);
|
||||
}
|
||||
|
||||
pstrcpy(remote_machine, "wrepld");
|
||||
set_remote_machine_name("wrepld");
|
||||
|
||||
setup_logging(argv[0],interactive);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user