summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYasuma Takeda <yasuma@osstech.co.jp>2008-12-05 13:37:51 -0800
committerJeremy Allison <jra@samba.org>2008-12-05 13:37:51 -0800
commit611ef42053eb99f4c29d4efa86eaea9f1ca06286 (patch)
treef7715a5e3f80fd5cf7ba804dd88662bd7f200c05
parentac4a77ccca08b73f828938a0cfaece66b1c9deea (diff)
downloadsamba-611ef42053eb99f4c29d4efa86eaea9f1ca06286.tar.gz
samba-611ef42053eb99f4c29d4efa86eaea9f1ca06286.tar.bz2
samba-611ef42053eb99f4c29d4efa86eaea9f1ca06286.zip
Fix bug #5944 - nmbd does not boot if socket adress = "" is defined in smb.conf
-rw-r--r--source3/param/loadparm.c16
-rw-r--r--source3/smbd/server.c5
2 files changed, 17 insertions, 4 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 217957ab37..c743b89680 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -5063,7 +5063,6 @@ FN_GLOBAL_STRING(lp_remote_announce, &Globals.szRemoteAnnounce)
FN_GLOBAL_STRING(lp_remote_browse_sync, &Globals.szRemoteBrowseSync)
FN_GLOBAL_LIST(lp_wins_server_list, &Globals.szWINSservers)
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_LIST(lp_netbios_aliases, &Globals.szNetbiosAliases)
@@ -9468,3 +9467,18 @@ int lp_min_receive_file_size(void)
}
return MIN(Globals.iminreceivefile, BUFFER_SIZE);
}
+
+/*******************************************************************
+ If socket address is an empty character string, it is necessary to
+ define it as "0.0.0.0".
+********************************************************************/
+
+const char *lp_socket_address(void)
+{
+ char *sock_addr = Globals.szSocketAddress;
+
+ if (sock_addr[0] == '\0'){
+ string_set(&Globals.szSocketAddress, "0.0.0.0");
+ }
+ return Globals.szSocketAddress;
+}
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index fff05a3aac..f7bdb58288 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -469,9 +469,8 @@ static bool open_sockets_smbd(bool is_daemon, bool interactive, const char *smb_
char *sock_tok;
const char *sock_ptr;
- if (sock_addr[0] == '\0' ||
- strequal(sock_addr, "0.0.0.0") ||
- strequal(sock_addr, "::")) {
+ if (strequal(sock_addr, "0.0.0.0") ||
+ strequal(sock_addr, "::")) {
#if HAVE_IPV6
sock_addr = "::,0.0.0.0";
#else