summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/interface.c10
-rw-r--r--source3/nmbd/nmbd.c28
-rw-r--r--source3/param/loadparm.c12
3 files changed, 26 insertions, 24 deletions
diff --git a/source3/lib/interface.c b/source3/lib/interface.c
index 3e45d627d3..48070c4446 100644
--- a/source3/lib/interface.c
+++ b/source3/lib/interface.c
@@ -168,8 +168,7 @@ load the list of network interfaces
****************************************************************************/
void load_interfaces(void)
{
- char *ptr;
- fstring token;
+ char **ptr;
int i;
struct iface_struct ifaces[MAX_INTERFACES];
@@ -201,7 +200,7 @@ void load_interfaces(void)
/* if we don't have a interfaces line then use all broadcast capable
interfaces except loopback */
- if (!ptr || !*ptr) {
+ if (!ptr || !*ptr || !**ptr) {
if (total_probed <= 0) {
DEBUG(0,("ERROR: Could not determine network interfaces, you must use a interfaces config line\n"));
exit(1);
@@ -216,8 +215,9 @@ void load_interfaces(void)
return;
}
- while (next_token(&ptr,token,NULL,sizeof(token))) {
- interpret_interface(token);
+ while (*ptr) {
+ interpret_interface(*ptr);
+ ptr++;
}
if (!local_interfaces) {
diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c
index 2fab8f6bc7..2969c332d5 100644
--- a/source3/nmbd/nmbd.c
+++ b/source3/nmbd/nmbd.c
@@ -549,11 +549,11 @@ static BOOL open_sockets(BOOL isdaemon, int port)
static BOOL init_structs(void)
{
extern fstring local_machine;
- char *p, *ptr;
+ char *p, **ptr;
int namecount;
int n;
int nodup;
- pstring nbname;
+ char *nbname;
if (! *global_myname)
{
@@ -569,7 +569,7 @@ static BOOL init_structs(void)
*/
/* Work out the max number of netbios aliases that we have */
ptr = lp_netbios_aliases();
- for( namecount=0; next_token(&ptr,nbname,NULL, sizeof(nbname)); namecount++ )
+ for( namecount=0; *ptr; namecount++,ptr++ )
;
if ( *global_myname )
namecount++;
@@ -588,8 +588,14 @@ static BOOL init_structs(void)
my_netbios_names[namecount++] = global_myname;
ptr = lp_netbios_aliases();
- while ( next_token( &ptr, nbname, NULL, sizeof(nbname) ) )
+ while ( *ptr )
{
+ nbname = strdup(*ptr);
+ if (nbname == NULL)
+ {
+ DEBUG(0,("init_structs: malloc fail when allocating names.\n"));
+ return False;
+ }
strupper( nbname );
/* Look for duplicates */
nodup=1;
@@ -599,17 +605,13 @@ static BOOL init_structs(void)
nodup=0;
}
if (nodup)
- my_netbios_names[namecount++] = strdup( nbname );
+ my_netbios_names[namecount++] = nbname;
+ else
+ free(nbname);
+
+ ptr++;
}
- /* Check the strdups succeeded. */
- for( n = 0; n < namecount; n++ )
- if( NULL == my_netbios_names[n] )
- {
- DEBUG(0,("init_structs: malloc fail when allocating names.\n"));
- return False;
- }
-
/* Terminate name list */
my_netbios_names[namecount++] = NULL;
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index a6bfab880a..ba201e33b1 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -143,13 +143,13 @@ typedef struct
char *szLogonHome;
char *szWINSserver;
char *szCodingSystem;
- char *szInterfaces;
+ char **szInterfaces;
char *szRemoteAnnounce;
char *szRemoteBrowseSync;
char *szSocketAddress;
char *szNISHomeMapName;
char *szAnnounceVersion; /* This is initialised in init_globals */
- char *szNetbiosAliases;
+ char **szNetbiosAliases;
char *szDomainOtherSIDs;
char *szNameResolveOrder;
char *szLdapServer;
@@ -661,10 +661,10 @@ static struct parm_struct parm_table[] = {
{"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_DOS_STRING},
{"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL, NULL, FLAG_BASIC | FLAG_DOS_STRING},
{"netbios name", P_UGSTRING, P_GLOBAL, global_myname, handle_netbios_name, NULL, FLAG_BASIC | FLAG_DOS_STRING},
- {"netbios aliases", P_STRING, P_GLOBAL, &Globals.szNetbiosAliases, NULL, NULL, FLAG_DOS_STRING},
+ {"netbios aliases", P_LIST, P_GLOBAL, &Globals.szNetbiosAliases, NULL, NULL, FLAG_DOS_STRING},
{"netbios scope", P_UGSTRING, P_GLOBAL, global_scope, NULL, NULL, FLAG_DOS_STRING},
{"server string", P_STRING, P_GLOBAL, &Globals.szServerString, NULL, NULL, FLAG_BASIC | FLAG_DOS_STRING},
- {"interfaces", P_STRING, P_GLOBAL, &Globals.szInterfaces, NULL, NULL, FLAG_BASIC},
+ {"interfaces", P_LIST, P_GLOBAL, &Globals.szInterfaces, NULL, NULL, FLAG_BASIC},
{"bind interfaces only", P_BOOL, P_GLOBAL, &Globals.bBindInterfacesOnly, NULL, NULL, 0},
{"Security Options", P_SEP, P_SEPARATOR},
@@ -1472,11 +1472,11 @@ FN_GLOBAL_STRING(lp_logon_home, &Globals.szLogonHome)
FN_GLOBAL_STRING(lp_remote_announce, &Globals.szRemoteAnnounce)
FN_GLOBAL_STRING(lp_remote_browse_sync, &Globals.szRemoteBrowseSync)
FN_GLOBAL_STRING(lp_wins_server, &Globals.szWINSserver)
-FN_GLOBAL_STRING(lp_interfaces, &Globals.szInterfaces)
+FN_GLOBAL_LIST(lp_interfaces, &Globals.szInterfaces)
FN_GLOBAL_STRING(lp_socket_address, &Globals.szSocketAddress)
FN_GLOBAL_STRING(lp_nis_home_map_name, &Globals.szNISHomeMapName)
static FN_GLOBAL_STRING(lp_announce_version, &Globals.szAnnounceVersion)
-FN_GLOBAL_STRING(lp_netbios_aliases, &Globals.szNetbiosAliases)
+FN_GLOBAL_LIST(lp_netbios_aliases, &Globals.szNetbiosAliases)
FN_GLOBAL_STRING(lp_panic_action, &Globals.szPanicAction)
FN_GLOBAL_STRING(lp_adduser_script, &Globals.szAddUserScript)
FN_GLOBAL_STRING(lp_deluser_script, &Globals.szDelUserScript)