pstring servicesf = CONFIGFILE;
extern pstring debugf;
extern fstring global_myworkgroup;
+extern fstring global_sam_name;
extern pstring global_myname;
int am_parent = 1;
locking_end();
DEBUG(3,("Server exit (%s)\n", (reason ? reason : "")));
+#ifdef MEM_MAN
+ {
+ extern FILE *dbf;
+ smb_mem_write_verbose(dbf);
+ dbgflush();
+ }
+#endif
exit(0);
}
/****************************************************************************
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();
}
so set our umask to 0 */
umask(0);
- GetWd(OriginalDir);
+ dos_GetWd(OriginalDir);
init_uid();
exit(1);
}
+ get_myname(myhostname,NULL);
+
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;
codepage_initialise(lp_client_code_page());
- fstrcpy(global_myworkgroup, lp_workgroup());
+ if (!pwdb_initialise(True))
+ {
+ exit(1);
+ }
+
+ if(!initialise_sam_password_db())
+ {
+ exit(1);
+ }
+
+ if(!initialise_passgrp_db())
+ {
+ exit(1);
+ }
+
+ if(!initialise_group_db())
+ {
+ exit(1);
+ }
- if(!pdb_generate_sam_sid()) {
- DEBUG(0,("ERROR: Samba cannot create a SAM SID.\n"));
+ if(!initialise_alias_db())
+ {
+ exit(1);
+ }
+
+ if(!initialise_builtin_db())
+ {
+ exit(1);
+ }
+
+ if (!get_member_domain_sid())
+ {
+ DEBUG(0,("ERROR: Samba cannot obtain PDC SID from PDC(s) %s.\n",
+ lp_passwordserver()));
exit(1);
}
become_daemon();
}
- check_kernel_oplocks();
+ check_kernel_oplocks();
if (!directory_exist(lp_lockdir(), NULL)) {
mkdir(lp_lockdir(), 0755);
if (!locking_init(0))
exit(1);
- if(!initialize_password_db())
- exit(1);
-
/* possibly reload the services file. */
reload_services(True);