summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/connection.c3
-rw-r--r--source3/smbd/filename.c1
-rw-r--r--source3/smbd/negprot.c1
-rw-r--r--source3/smbd/password.c2
-rw-r--r--source3/smbd/reply.c3
-rw-r--r--source3/smbd/service.c10
-rw-r--r--source3/smbd/session.c4
-rw-r--r--source3/smbd/sesssetup.c3
8 files changed, 9 insertions, 18 deletions
diff --git a/source3/smbd/connection.c b/source3/smbd/connection.c
index b53ef9fb3f..5609c2963d 100644
--- a/source3/smbd/connection.c
+++ b/source3/smbd/connection.c
@@ -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;
diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c
index e5f9b7a0ae..ce98af4ace 100644
--- a/source3/smbd/filename.c
+++ b/source3/smbd/filename.c
@@ -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);
diff --git a/source3/smbd/negprot.c b/source3/smbd/negprot.c
index 1d79cbd5d0..2be04fd686 100644
--- a/source3/smbd/negprot.c
+++ b/source3/smbd/negprot.c
@@ -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;
diff --git a/source3/smbd/password.c b/source3/smbd/password.c
index 2558ffe163..6d922139e7 100644
--- a/source3/smbd/password.c
+++ b/source3/smbd/password.c
@@ -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);
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index a4ed770f31..dc49fe3e2e 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -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);
diff --git a/source3/smbd/service.c b/source3/smbd/service.c
index aac90f2fdc..26e00aa49f 100644
--- a/source3/smbd/service.c
+++ b/source3/smbd/service.c
@@ -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) {
diff --git a/source3/smbd/session.c b/source3/smbd/session.c
index f7ade5570c..54b7a24b07 100644
--- a/source3/smbd/session.c
+++ b/source3/smbd/session.c
@@ -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)) {
diff --git a/source3/smbd/sesssetup.c b/source3/smbd/sesssetup.c
index f6d536f301..d45b04202e 100644
--- a/source3/smbd/sesssetup.c
+++ b/source3/smbd/sesssetup.c
@@ -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) {