summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-02-03 17:10:44 +0000
committerLuke Leighton <lkcl@samba.org>1999-02-03 17:10:44 +0000
commitceef08b60e1fc3839df89b27028aa9ac0f920f25 (patch)
tree2f78c2833c8c36caab48c457fffe58af65dd6425 /source3
parent91403ea47dc6a23bd17c45ed0e5d6b61b3f8b531 (diff)
downloadsamba-ceef08b60e1fc3839df89b27028aa9ac0f920f25.tar.gz
samba-ceef08b60e1fc3839df89b27028aa9ac0f920f25.tar.bz2
samba-ceef08b60e1fc3839df89b27028aa9ac0f920f25.zip
initialise my name (used in %h) prior to loading smb.conf files.
(This used to be commit ed128c38a88746ec7822d598e72f0106a30a4af7)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/server.c41
1 files changed, 15 insertions, 26 deletions
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 3e25bfa633..0b332db0fd 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -444,35 +444,14 @@ void exit_server(char *reason)
/****************************************************************************
initialise connect, service and file structs
****************************************************************************/
-static void init_structs(void )
+static void init_structs(void)
{
get_myname(myhostname,NULL);
- /*
- * Set the machine NETBIOS name if not already
- * set from the config file.
- */
-
- if (!*global_myname) {
- char *p;
- fstrcpy( global_myname, myhostname );
- p = strchr( global_myname, '.' );
- if (p)
- *p = 0;
- }
-
- strupper( global_myname );
-
conn_init();
-
file_init();
-
- /* for RPC pipes */
- init_rpc_pipe_hnd();
-
- /* for LSA handles */
- init_lsa_policy_hnd();
-
+ init_rpc_pipe_hnd(); /* for RPC pipes */
+ init_lsa_policy_hnd(); /* for LSA handles */
init_dptrs();
}
@@ -635,11 +614,21 @@ static void usage(char *pname)
exit(1);
}
+ init_structs();
+
if (!reload_services(False))
return(-1);
- init_structs();
-
+ /*
+ * Set the machine NETBIOS name if not already
+ * set from the config file.
+ */
+ if (!*global_myname)
+ {
+ fstrcpy(global_myname, dns_to_netbios_name(myhostname));
+ }
+ strupper(global_myname);
+
#ifdef WITH_SSL
{
extern BOOL sslEnabled;