1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

26 Commits

Author SHA1 Message Date
Simo Sorce
2e8a85ec72 s3:smbd - Move printing queue stuff
This way we can properly deal with pcap updates in the background queue process
if it is enabled (on by default) and not perform these actions in the main
smbd process.

Signed-off-by: Günther Deschner <gd@samba.org>
2011-08-02 15:28:03 +02:00
Andrew Bartlett
9fcc617ff5 s3-auth Use the common auth_session_info
This patch finally has the same structure being used to describe the
authorization data of a user across the whole codebase.

This will allow of our session handling to be accomplished with common code.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:13 +10:00
Andrew Bartlett
f16d8f4eb8 s3-auth Use struct auth3_session_info outside the auth subsystem
This seperation between the structure used inside the auth modules and
in the wider codebase allows for a gradual migration from struct
auth_serversupplied_info -> struct auth_session_info (from auth.idl)

The idea here is that we keep a clear seperation between the structure
before and after the local groups, local user lookup and the session
key modifications have been processed, as the lack of this seperation
has caused issues in the past.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:10 +10:00
Andrew Bartlett
489f528857 param: Merge param headers into lib/param/loadparm.h
This defines a common table format, so we can in future define a
common table.

Andrew Bartlett
2011-06-29 15:44:09 +10:00
Andrew Bartlett
8524924a46 s3-smbd provide struct smbd_server_connection * to conn_snum_used
This provides the 'sconn' parameter to this key functions, that
is currently duplicated in dummysmbd.c, which causes duplicate symbol
issues in the waf build.

This has natrually caused a number of consequential changes across the
codebase, includning not passing a messaging context into initial
reload_services():

This causes problems because the global smbd_server_connection isn't
yet set up, as there isn't a connection here, just the initial
process.

Andrew Bartlett
2011-05-31 00:32:07 +02:00
Günther Deschner
ab36d597e7 s3-messages: make ndr_messaging.h part of messages.h.
Guenther
2011-03-30 01:13:09 +02:00
Günther Deschner
b2af281e50 s3-messages: only include messages.h where needed.
Guenther
2011-03-30 01:13:09 +02:00
Günther Deschner
af300a9fcb s3-auth: smbd needs auth.h
Guenther
2011-03-30 01:13:09 +02:00
Günther Deschner
8c24ebf371 s3: include smbd/smbd.h where needed.
Guenther
2011-03-30 01:13:08 +02:00
Günther Deschner
8225c0ad6c s3-printing: only include printing where really needed.
Guenther
2011-02-22 21:52:18 +01:00
Andrew Bartlett
2e69e89456 s3-auth Rename auth_serversupplied_info varaiables: server_info -> session_info
These variables, of type struct auth_serversupplied_info were poorly
named when added into 2001, and in good consistant practice, this has
extended all over the codebase in the years since.

The structure is also not ideal for it's current purpose.  Originally
intended to convey the results of the authentication modules, it
really describes all the essential attributes of a session.  This
rename will reduce the volume of a future patch to replaced these with
a struct auth_session_info, with auth_serversupplied_info confined to
the lower levels of the auth subsystem, and then eliminated.

(The new structure will be the output of create_local_token(), and the
change in struct definition will ensure that this is always run, populating
local groups and privileges).

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-02-22 16:20:10 +11:00
David Disseldorp
0b188e7784 s3-printing: Initiate pcap reload from parent smbd
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.
2011-01-07 15:37:39 -08:00
David Disseldorp
04248c2cfa s3-printing: reload shares after pcap cache fill
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>
2011-01-07 15:37:39 -08:00
Volker Lendecke
ac7b63384d s3: Lift smbd_server_fd from reload_services() 2010-08-18 11:18:21 +02:00
Andreas Schneider
ca8db7fd63 s3-smbd: Publish nt printers.
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>
2010-08-13 12:20:10 -04:00
Volker Lendecke
016418d6c2 s3: Remove the smbd_messaging_context from load_printers 2010-08-08 23:37:47 +02:00
Volker Lendecke
1c1d83a532 s3: Remove the smbd_messaging_context from pcap_cache_reload 2010-08-08 23:37:47 +02:00
Volker Lendecke
39da717fe1 s3: Lift the smbd_messaging_context from reload_services 2010-08-08 18:09:33 +02:00
Volker Lendecke
7c7ffb70fb s3: Lift the smbd_messaging_context from reload_printers 2010-08-08 18:09:33 +02:00
Volker Lendecke
99b2da4504 s3: Lift the smbd_messaging_context from is_printer_published 2010-08-08 16:03:26 +02:00
Volker Lendecke
7d08c25f98 s3: Lift the smbd_messaging_context from nt_printer_publish 2010-08-08 16:03:25 +02:00
Volker Lendecke
e43ffde91f s3: Lift the smbd_messaging_context from nt_printer_remove 2010-08-08 16:03:25 +02:00
Günther Deschner
813fbbd68c s3-build: avoid to globally include printing and spoolss headers.
This shrinks precompiled headers by 3MB and will slightly speed up any build.

Guenther
2010-07-31 00:50:31 +02:00
Simo Sorce
a1fe2ed68a s3-spoolss: Use winreg_delete_printer_key to delete printers.
Signed-off-by: Jim McDonough <jmcd@samba.org>
2010-07-27 10:27:10 -04:00
Simo Sorce
44bc6714b0 s3-printing: Converted printer publishing functions.
Use spoolss_PrintInfo2 and winreg calls.

Signed-off-by: Jim McDonough <jmcd@samba.org>
2010-07-27 10:27:10 -04:00
Andrew Bartlett
6f279de0e6 s3:smbd split reload services/printers functions from server.c
This helps vfstest, as it previously had duplicate copies of these
functions.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-05-28 18:08:26 +02:00