diff options
author | Stefan Metzmacher <metze@samba.org> | 2004-06-23 23:44:50 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:56:46 -0500 |
commit | f89a67e3452b0613f659c4ba26c6ed79843c33de (patch) | |
tree | ceb7fc8f196aab3daf6e79215b7fca4f483327b8 /source4/smbd/rewrite.c | |
parent | 68e8c18e33a0aaa4b34be34ccff38e4ec90806ac (diff) | |
download | samba-f89a67e3452b0613f659c4ba26c6ed79843c33de.tar.gz samba-f89a67e3452b0613f659c4ba26c6ed79843c33de.tar.bz2 samba-f89a67e3452b0613f659c4ba26c6ed79843c33de.zip |
r1233: -move smb related code to smb_server/*
-move process_model code to smbd/process_model.c
-remove some used code
metze
(This used to be commit 10dd8487290a2876253ce69033e374d23b42e704)
Diffstat (limited to 'source4/smbd/rewrite.c')
-rw-r--r-- | source4/smbd/rewrite.c | 108 |
1 files changed, 99 insertions, 9 deletions
diff --git a/source4/smbd/rewrite.c b/source4/smbd/rewrite.c index e32cd96a0e..2250c5cc27 100644 --- a/source4/smbd/rewrite.c +++ b/source4/smbd/rewrite.c @@ -35,18 +35,108 @@ BOOL init_change_notify(void) BOOL pcap_printername_ok(const char *service, const char *foo) { return True; } -BOOL namecache_enable(void) -{ return True; } - -BOOL share_info_db_init(void) -{ return True; } - -BOOL init_registry(void) -{ return True; } - BOOL share_access_check(struct request_context *req, struct tcon_context *conn, int snum, uint32_t desired_access) { return True; } BOOL init_names(void) { return True; } +/* + * initialize an smb process + */ +void smbd_process_init(void) +{ + TALLOC_CTX *mem_ctx; + + mem_ctx = talloc_init("smbd_process_init talloc"); + if (!mem_ctx) { + DEBUG(0,("smbd_process_init: ERROR: No memory\n")); + exit(1); + } + + /* possibly reload the services file. */ + reload_services(NULL, True); + + if (*lp_rootdir()) { + if (sys_chroot(lp_rootdir()) == 0) + DEBUG(2,("Changed root to %s\n", lp_rootdir())); + } + + /* Setup oplocks */ + if (!init_oplocks()) + exit(1); + + /* Setup change notify */ + if (!init_change_notify()) + exit(1); + + talloc_destroy(mem_ctx); +} + +void init_subsystems(void) +{ + /* Setup the PROCESS_MODEL subsystem */ + if (!process_model_init()) + exit(1); + + /* Setup the AUTH subsystem */ + if (!auth_init()) + exit(1); + + /* Setup the NTVFS subsystem */ + if (!ntvfs_init()) + exit(1); + + /* Setup the DCERPC subsystem */ + if (!dcesrv_init()) + exit(1); + +} + +/**************************************************************************** + Reload the services file. +**************************************************************************/ +BOOL reload_services(struct server_context *smb, BOOL test) +{ + BOOL ret; + + if (lp_loaded()) { + pstring fname; + pstrcpy(fname,lp_configfile()); + if (file_exist(fname, NULL) && + !strcsequal(fname, dyn_CONFIGFILE)) { + pstrcpy(dyn_CONFIGFILE, fname); + test = False; + } + } + + reopen_logs(); + + if (test && !lp_file_list_changed()) + return(True); + + if (smb) { + lp_killunused(smb, conn_snum_used); + } + + ret = lp_load(dyn_CONFIGFILE, False, False, True); + + load_printers(); + + /* perhaps the config filename is now set */ + if (!test) + reload_services(smb, True); + + reopen_logs(); + + load_interfaces(); + + mangle_reset_cache(); + reset_stat_cache(); + + /* this forces service parameters to be flushed */ + set_current_service(NULL,True); + + return(ret); +} + |