summaryrefslogtreecommitdiffstats
path: root/source/smbwrapper/smbw.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/smbwrapper/smbw.c')
-rw-r--r--source/smbwrapper/smbw.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/source/smbwrapper/smbw.c b/source/smbwrapper/smbw.c
index 2dd7c4ea6dd..9878d3c70b6 100644
--- a/source/smbwrapper/smbw.c
+++ b/source/smbwrapper/smbw.c
@@ -1,5 +1,6 @@
/*
- Unix SMB/CIFS implementation.
+ Unix SMB/Netbios implementation.
+ Version 2.0
SMB wrapper functions
Copyright (C) Andrew Tridgell 1998
@@ -28,6 +29,7 @@ static struct smbw_server *smbw_srvs;
struct bitmap *smbw_file_bmap;
extern pstring global_myname;
+extern BOOL AllowDebugChange;
fstring smbw_prefix = SMBW_PREFIX;
@@ -44,6 +46,8 @@ void smbw_init(void)
{
extern BOOL in_client;
static int initialised;
+ static pstring servicesf = CONFIGFILE;
+ extern FILE *dbf;
char *p;
int eno;
pstring line;
@@ -56,9 +60,10 @@ void smbw_init(void)
smbw_busy++;
DEBUGLEVEL = 0;
+ AllowDebugChange = False;
setup_logging("smbsh",True);
- dbf = x_stderr;
+ dbf = stderr;
if ((p=smbw_getshared("LOGFILE"))) {
dbf = sys_fopen(p, "a");
@@ -69,15 +74,18 @@ void smbw_init(void)
exit(1);
}
+ charset_initialise();
+
in_client = True;
load_interfaces();
if ((p=smbw_getshared("SERVICESF"))) {
- pstrcpy(dyn_CONFIGFILE, p);
+ pstrcpy(servicesf, p);
}
- lp_load(dyn_CONFIGFILE,True,False,False);
+ lp_load(servicesf,True,False,False);
+ codepage_initialise(lp_client_code_page());
get_myname(global_myname);
@@ -442,7 +450,7 @@ struct smbw_server *smbw_server(char *server, char *share)
pstring ipenv;
struct in_addr ip;
- zero_ip(&ip);
+ zero_ip(&ip);
ZERO_STRUCT(c);
get_auth_data_fn(server, share, &workgroup, &username, &password);
@@ -466,13 +474,13 @@ struct smbw_server *smbw_server(char *server, char *share)
DEBUG(4,("server_n=[%s] server=[%s]\n", server_n, server));
- if ((p=strchr_m(server_n,'#')) &&
+ if ((p=strchr(server_n,'#')) &&
(strcmp(p+1,"1D")==0 || strcmp(p+1,"01")==0)) {
struct in_addr sip;
pstring s;
fstrcpy(group, server_n);
- p = strchr_m(group,'#');
+ p = strchr(group,'#');
*p = 0;
/* cache the workgroup master lookup */
@@ -493,7 +501,7 @@ struct smbw_server *smbw_server(char *server, char *share)
again:
slprintf(ipenv,sizeof(ipenv)-1,"HOST_%s", server_n);
- zero_ip(&ip);
+ zero_ip(&ip);
if ((p=smbw_getshared(ipenv))) {
ip = *(interpret_addr2(p));
}