summaryrefslogtreecommitdiffstats
path: root/source3/smbd/server.c
Commit message (Collapse)AuthorAgeFilesLines
...
* s3: Convert init_system_info to NTSTATUSVolker Lendecke2011-02-201-2/+4
|
* s3: increase the log level for missing PIDs on SIGCHLDDavid Disseldorp2011-02-171-1/+2
| | | | | | | | | | | | | | | | | | | Since the fix for bso#7836, the parent smbd is responsible for maintaining an up-to-date printcap cache. It does this by forking a child process to asynchronously fetch printcap data from CUPS. When the child process exits after fetching all printcap data, the parent smbd is sent SIGCHLD. This triggers smbd_sig_chld_handler() which looks for the exited process PID on a "children" list. Child smbd process PIDs are added to the "children" list to ensure cleanup on unclean shutdown and log level change notification messages. Printcap update process PIDs are not added to the list as they do not maintain any state that requires cleanup, nor do they wait on tevent for messages. Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Thu Feb 17 11:11:45 CET 2011 on sn-devel-104
* s3-smbd: Added a function to setup rpc services.Andreas Schneider2011-02-021-90/+2
| | | | | Move the complete setup of the rpc service to its own file and use callbacks to register at the endpoint mapper.
* s3-epmapper: Added a endpoint mapper skeleton.Andreas Schneider2011-02-021-0/+1
|
* s3-printing: Initiate pcap reload from parent smbdDavid Disseldorp2011-01-071-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 7022554, smbds share a printcap cache (printer_list.tdb), therefore ordering of events between smbd processes is important when updating printcap cache information. Consider the following two process example: 1) smbd1 receives HUP or printcap cache time expiry 2) smbd1 checks whether pcap needs refresh, it does 3) smbd1 marks pcap as refreshed 4) smbd1 forks child1 to obtain cups printer info 5) smbd2 receives HUP or printcap cache time expiry 6) smbd2 checks whether pcap needs refresh, it does not (due to step 3) 7) smbd2 reloads printer shares prior to child1 completion (stale pcap) 8) child1 completion, pcap cache (printer_list.tdb) is updated by smbd1 9) smbd1 reloads printer shares based on new pcap information In this case both smbd1 and smbd2 are reliant on the pcap update performed on child1 completion. The prior commit "reload shares after pcap cache fill" ensures that smbd1 only reloads printer shares following pcap update, however smbd2 continues to present shares based on stale pcap data. This commit addresses the above problem by driving pcap cache and printer share updates from the parent smbd process. 1) smbd0 (parent) receives a HUP or printcap cache time expiry 2) smbd0 forks child0 to obtain cups printer info 3) child0 completion, pcap cache (printer_list.tdb) is updated by smbd0 4) smbd0 reloads printer shares 5) smbd0 notifies child smbds of pcap update via message_send_all() 6) child smbds read fresh pcap data and reload printer shares This architecture has the additional advantage that only a single process (the parent smbd) requests printer information from the printcap backend. Use time_mono in housekeeping functions As suggested by Björn Jacke.
* s3-printing: reload shares after pcap cache fillDavid Disseldorp2011-01-071-1/+2
| | | | | | | | | | | | | | | | Since commit eada8f8a, updates to the cups pcap cache are performed asynchronously - cups_cache_reload() forks a child process to request cups printer information and notify the parent smbd on completion. Currently printer shares are reloaded immediately following the call to cups_cache_reload(), this occurs prior to smbd receiving new cups pcap information from the child process. Such behaviour can result in stale print shares as outlined in bug 7836. This fix ensures print shares are only reloaded after new pcap data has been received. Pair-Programmed-With: Lars Müller <lars@samba.org>
* s3-rpcecho: Only register rpcecho in the developer build.Andreas Schneider2011-01-041-0/+2
| | | | | Autobuild-User: Andreas Schneider <asn@samba.org> Autobuild-Date: Tue Jan 4 18:56:38 CET 2011 on sn-devel-104
* s3-smbd: Call all the rpc services in the right order.Andreas Schneider2011-01-041-5/+41
|
* s3:smbd: remove some commented out legacy codeMichael Adam2010-12-021-5/+0
| | | | | Autobuild-User: Michael Adam <obnox@samba.org> Autobuild-Date: Thu Dec 2 01:18:19 CET 2010 on sn-devel-104
* s3: Allow disabling of mdns registrationsVolker Lendecke2010-11-051-1/+1
| | | | | Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Fri Nov 5 11:24:41 UTC 2010 on sn-devel-104
* s3-debug Move 'load_case_tables()' before lp_set_cmdline() and popt callsAndrew Bartlett2010-11-021-2/+2
| | | | | | | | | | The problem here is that we cannot run lp_set_cmdline() (directly or indirectly via the popt helpers) until load_case_tables() has been run. However, load_case_tables does not have auto-initialisation, so we must init it once, and once only. Andrew Bartlett
* s3-debug Impove setup_logging() to specify logging to stderrAndrew Bartlett2010-11-021-1/+5
| | | | | | | | This change improves the setup_logging() API so that callers which wish to set up logging to stderr can simply ask for it, rather than directly modify the dbf global variable. Andrew Bartlett
* s3: Call printer_list_parent_init in the parentVolker Lendecke2010-10-081-0/+5
| | | | Simo, please check!
* Move talloc_enable_null_tracking() to the s3 daemonsVolker Lendecke2010-10-081-1/+7
|
* s3: Lift smbd_messaging_context() from open_sockets_smbd()Volker Lendecke2010-09-281-16/+14
|
* s3: Remove talloc_autofree_context() from files.cVolker Lendecke2010-09-281-2/+5
|
* s3: Remove talloc_autofree_context() from notify_internal_parent_init()Volker Lendecke2010-09-261-1/+1
|
* s3: Remove talloc_autofree_context() from serverid_parent_init()Volker Lendecke2010-09-261-1/+1
|
* s3: Remove talloc_autofree_context() from messaging_tdb_parent_init()Volker Lendecke2010-09-261-1/+1
|
* s3:registry: move prototype from reg_init_full.c to its own header.Michael Adam2010-09-211-0/+1
|
* s3-build: only include ctdbd_conn.h where needed.Günther Deschner2010-09-201-0/+1
| | | | Guenther
* s3-spoolss: Don't leak memory on the session counter list.Andreas Schneider2010-09-101-1/+8
| | | | Thanks Günther, please check.
* s3: messaging_ctdbd_connection() was only called with procid_self()Volker Lendecke2010-08-311-2/+1
| | | | Eventually we'll get this right...
* s3: Remove smbd_server_fd()Volker Lendecke2010-08-291-7/+0
| | | | | | | | | This breaks the perfcol_onefs() build. Tim, Steve, this use of smbd_server_fd is replacable by calls into substitute.c. I don't have a onefs environment around to build a fix, so I've decided to insert an #error, making it not compile. The fix should be pretty obvious, you can get the socket data via "%I" and "%i" substitutions.
* s3: Remove two uses of smbd_server_fd()Volker Lendecke2010-08-291-1/+1
| | | | | Actually, this is a bit cheating. But those two files depend on smbd_server_conn anyway, it does not make things worse.
* s3: Remove a use of smbd_server_fd() in smbd main()Volker Lendecke2010-08-291-2/+1
| | | | | The effect this might have is that we set the socket options a bit later in inetd mode.
* s3: Set the client_id in substitute.c onceVolker Lendecke2010-08-291-0/+5
| | | | | This never changes during a client connection's life, so we can set it once.
* s3: Remove some references to smbd_server_fd()Volker Lendecke2010-08-281-5/+7
|
* s3-build: only include memcache.h where needed.Günther Deschner2010-08-261-0/+1
| | | | Guenther
* s3: Add smbd_server_connection->client_idVolker Lendecke2010-08-181-1/+21
|
* s3: Lift smbd_server_fd from reload_services()Volker Lendecke2010-08-181-2/+3
|
* s3: Add "sock" to smbd_server_connectionVolker Lendecke2010-08-161-0/+1
|
* s3: Remove get_client_fd()Volker Lendecke2010-08-161-5/+0
|
* s3-smbd: Publish nt printers.Andreas Schneider2010-08-131-4/+14
| | | | | | | Reloading of the printers requires rpc services up and running! The first call in reload_services will be skipped. Signed-off-by: Simo Sorce <idra@samba.org>
* s3-smbd: Move rpc services init to smbd parent.Andreas Schneider2010-08-131-0/+45
| | | | | | | | | | | | | | | The move to the parent makes it possible to use an internal rpc pipe really early and as we migrated serveral parts of samba to rpc function this is required. This should speed up the fork of a smbd a bit cause the rpc services are already running. We still have several problems here which aren't solved. We don't have a dependency tree here. For example we have to make sure that the registry is initialized before we can use the winreg pipe. The spoolss server requires winreg, so we have to start winreg before we can start the spoolss server. I'm sure there are more dependencies. Signed-off-by: Simo Sorce <idra@samba.org>
* s3-smbd: Regroup some init functions.Andreas Schneider2010-08-131-12/+12
| | | | Signed-off-by: Simo Sorce <idra@samba.org>
* s3-smbd: Cleanup the order of the init functions.Andreas Schneider2010-08-131-5/+6
| | | | Signed-off-by: Simo Sorce <idra@samba.org>
* s3-smbd: Make sure the event context is initialized.Andreas Schneider2010-08-131-0/+3
| | | | Signed-off-by: Simo Sorce <idra@samba.org>
* s3: Remove the smbd_messaging_context from smb_conf_updatedVolker Lendecke2010-08-081-1/+1
|
* s3: Pass sconn to smbd_processVolker Lendecke2010-08-081-3/+3
|
* s3: Lift the smbd_messaging_context from start_background_queueVolker Lendecke2010-08-081-1/+2
|
* s3: Lift the smbd_messaging_context from smbd_setup_sig_hup_handlerVolker Lendecke2010-08-081-2/+4
|
* s3: Lift the smbd_messaging_context from reload_servicesVolker Lendecke2010-08-081-2/+2
|
* s3: Remove a pointless "else"Volker Lendecke2010-08-071-1/+3
|
* s3-popt: Only include popt-common.h when needed.Andreas Schneider2010-08-051-0/+1
|
* s3-secrets: only include secrets.h when needed.Günther Deschner2010-08-051-0/+1
| | | | Guenther
* s3: Add msg_ctx to smbd_server_connectionVolker Lendecke2010-07-051-0/+2
| | | | | | It would be obvious to initialize this in smbd_init_globals(), but there the messaging_context can't be initialized yet because we don't have smb.conf loaded yet.
* s3: Pass procid_self() explicitly to messaging_ctdbd_connection()Volker Lendecke2010-07-051-1/+2
|
* s3: Create a unique id for the smbd parentVolker Lendecke2010-07-051-0/+4
|
* s3: Pass the new server_id through reinit_after_forkVolker Lendecke2010-07-041-3/+7
|