pstring servicesf = CONFIGFILE;
extern pstring debugf;
extern fstring global_myworkgroup;
+extern fstring global_sam_name;
extern pstring global_myname;
int am_parent = 1;
that client substitutions will be
done correctly in the process. */
reset_globals_after_fork();
+
+ /*
+ * Ensure this child has kernel oplock
+ * capabilities, but not it's children.
+ */
+ set_process_capability(KERNEL_OPLOCK_CAPABILITY, True);
+ set_inherited_process_capability(KERNEL_OPLOCK_CAPABILITY, False);
+
return True;
}
/* The parent doesn't need this socket */
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();
}
printf("\t-P passive only\n");
printf("\t-a append to log file (default)\n");
printf("\t-o overwrite log file, don't append\n");
+ printf("\t-i scope NetBIOS scope to use (default none)\n");
printf("\n");
}
so set our umask to 0 */
umask(0);
- GetWd(OriginalDir);
+ dos_GetWd(OriginalDir);
init_uid();
exit(1);
}
- init_structs();
-
+ 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());
- pstrcpy(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(!initialise_alias_db())
+ {
+ exit(1);
+ }
- if(!pdb_generate_machine_sid()) {
- DEBUG(0,("ERROR: Samba cannot get a machine SID.\n"));
+ 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();
+
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);
if( !open_oplock_ipc() )
exit(1);
- check_kernel_oplocks();
-
smbd_process();
close_sockets();