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

1517 Commits

Author SHA1 Message Date
Ralph Boehme
142db4048f s3:vfs: add create tags to SMB_VFS_CREATEFILE
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-12-04 22:11:07 +01:00
Stefan Metzmacher
fe40ee148a s3:printing: fix some const warnings in print_iprint.c
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-25 07:25:44 +01:00
Kai Blin
6c35082a94 s3:printing: Avoid compiler warning about unused label
Signed-off-by: Kai Blin <kai@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-25 07:25:44 +01:00
David Disseldorp
d3cd60d660 printer_list: don't leak lock_path onto talloc tos
Also check for allocation failures.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-03 23:46:05 +01:00
David Disseldorp
2307c3700c nt_printing: don't leak state_path onto talloc tos
Also check for allocation failures, and close tdbs in
nt_printing_tdb_upgrade error paths.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-03 23:46:04 +01:00
David Disseldorp
77b5be1742 printing: add jobid_to_sysjob helper function
Samba needs to deal with two types of print job identifiers, those
allocated by the printing backend (sysjob ids), and those allocated
by Samba's spoolss server (jobids).

This change adds a helper function to map spoolss jobids to sysjob ids,
to go alongside the corresponding sysjob to jobid mapping function.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-10-30 06:52:04 +01:00
David Disseldorp
b376a82225 printer_list: fix talloc tos leak of tdb record
Reported-by: Franz Pförtsch <franz.pfoertsch@brose.com>
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Oct  7 19:25:09 CEST 2014 on sn-devel-104
2014-10-07 19:25:09 +02:00
David Disseldorp
58b18e23e9 printing: don't leak cache_path onto talloc tos
Also check for allocation failures.

Reported-by: Franz Pförtsch <franz.pfoertsch@brose.com>
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-10-06 19:18:05 +02:00
Volker Lendecke
446de4f680 vfs3: Pass "lease" through SMB_VFS_CREATE_FILE
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-08-11 21:11:16 +02:00
David Disseldorp
2706af4d78 smbd: split printer reload processing
All printer inventory updates are currently done via
delete_and_reload_printers(), which handles registry.tdb updates for
added or removed printers, AD printer unpublishing on removal, as well
as share service creation and deletion.

This change splits this functionality into two functions such that
per-client smbd processes do not perform registry.tdb updates or printer
unpublishing. This is now only performed by the process that performs
the printcap cache update.

This change is similar to ac6604868d from
the 3.6 branch.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10652

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-08-08 14:10:39 +02:00
David Disseldorp
30ce835670 printing: return last change time with pcap_cache_loaded()
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10652

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-08-08 14:10:39 +02:00
David Disseldorp
6d75e20ca8 printing: remove pcap_cache_add()
All print list updates are now done via pcap_cache_replace(), which can
call into the print_list code directly.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10652

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-08-08 14:10:39 +02:00
David Disseldorp
e5e6e2c796 printing: reload printer_list.tdb from in memory list
This will allow in future for a single atomic printer_list.tdb update.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10652

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-08-08 14:10:38 +02:00
David Disseldorp
4f4501ac1f printing: only reload printer shares on client enum
Currently, automatic printer share updates are handled in the following
way:
- Background printer process (BPP) forked on startup
- Parent smbd and per-client children await MSG_PRINTER_PCAP messages
- BPP periodically polls the printing backend for printcap data
	- printcap data written to printer_list.tdb
	- MSG_PRINTER_PCAP sent to all smbd processes following update
- smbd processes all read the latest printer_list.tdb data, and update
  their share listings

This procedure is not scalable, as all smbd processes hit
printer_list.tdb in parallel, resulting in a large spike in CPU usage.

This change sees smbd processes only update their printer share lists
only when a client asks for this information, e.g. via NetShareEnum or
EnumPrinters.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10652

Suggested-by: Volker Lendecke <vl@samba.org>
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-08-08 14:10:38 +02:00
David Disseldorp
1e83435eac printing: traverse_read the printer list for share updates
The printcap update procedure involves the background printer process
obtaining the printcap information from the printing backend, writing
this to printer_list.tdb, and then notifying all smbd processes of the
new list. The processes then all attempt to simultaneously traverse
printer_list.tdb, in order to update their local share lists.

With a large number of printers, and a large number of per-client smbd
processes, this traversal results in significant lock contention, mostly
due to the fact that the traversal is unnecessarily done with an
exclusive (write) lock on the printer_list.tdb database.

This commit changes the share update code path to perform a read-only
traversal.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10652

Reported-by: Alex K <korobkin+samba@gmail.com>
Reported-by: Franz Pförtsch <franz.pfoertsch@brose.com>
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-08-08 14:10:38 +02:00
Volker Lendecke
f5efddb9ae lib: directory_create_or_exist() does not use "uid" parameter
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-07-28 22:04:13 +02:00
Volker Lendecke
d3417b253e smbd: Avoid double-free in get_print_db_byname
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>

Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Tue Jul  8 22:27:03 CEST 2014 on sn-devel-104
2014-07-08 22:27:03 +02:00
David Disseldorp
efb4684a3f printing: fix purge of all print jobs
The incorrect (system) jobid is currently passed to the job deletion
function.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10612

Reported-by: Franz Pförtsch <franz.pfoertsch@brose.com>
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-21 23:31:13 +02:00
Volker Lendecke
758b057700 printing_cups: Call the msg_ctx destructor on exit
With the new messaging, if we don't do this, we'll leave sockets around. I'm
sure we will not catch everything, so a periodic cleanup will be required.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-04-23 22:33:08 +02:00
Andreas Schneider
562ade624a s3-spoolssd: Don't register spoolssd if epmd is not running.
https://bugzilla.samba.org/show_bug.cgi?id=10474

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-02-27 16:47:47 +01:00
Jeremy Allison
148bbdd8d0 s3-printing: Fix obvious memory leak in printer_list_get_printer().
https://bugzilla.samba.org/show_bug.cgi?id=9993

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Feb 25 13:19:37 CET 2014 on sn-devel-104
2014-02-25 13:19:37 +01:00
Poornima Gurusiddaiah
72f9932d4f s3:printing: Fix a possible NULL dereference.
Coverity-Id: 710708

Signed-off-by: Poornima Gurusiddaiah <pgurusid@redhat.com>
Reviewed-by: Ira Cooper <ira@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-02-24 09:51:31 +05:30
Volker Lendecke
a93aaec77e spoolssd: Use only one messaging_context per process
After the fork, the code created a fresh messaging_context before doing the
reinit_after_fork. This means to have two initialized messaging contexts in
that process. This patch aligns spoolssd with lsad.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-02-19 16:38:30 -08:00
Jeremy Allison
cd655715b8 s3: printing: Fix problem with server taking too long to respond to a MSG_PRINTER_DRVUPGRADE message.
Receiving a MSG_PRINTER_DRVUPGRADE causes
smbd to iterate over all printers looking
for ones that uses the driver. This is a very
expensive operation requiring a read of all
registry printer parameters.

On a system with a large number of printers,
this causes the clients to timeout (smbd
can take longer than 60 seconds to respond).

This patch fixes the problem by forwarding
the MSG_PRINTER_DRVUPGRADE to the background
lpq queue updater process and allowing it to
take care of the updating of the changeid
in the registry, allowing the smbd connected
to the client to return to processing requests
immediately.

https://bugzilla.samba.org/show_bug.cgi?id=9942

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Feb 18 17:48:30 CET 2014 on sn-devel-104
2014-02-18 17:48:30 +01:00
Garming Sam
52b1b168b3 param: rename lp function and variable from "minprintspace" to "min_print_space"
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-02-07 16:19:16 -08:00
Garming Sam
798678ecfc param: rename lp function and variable from "queueresumecommand" to "queueresume_command"
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-02-07 16:19:14 -08:00
Garming Sam
609e7bea49 param: rename lp function and variable from "queuepausecommand" to "queuepause_command"
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-02-07 16:19:14 -08:00
Garming Sam
77d04917f7 param: rename lp function and variable from "printcommand" to "print_command"
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-02-07 16:19:14 -08:00
Garming Sam
cf6f358563 param: rename lp function and variable from "max_reported_jobs" to "max_reported_print_jobs"
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-02-07 16:19:14 -08:00
Garming Sam
db52b908c7 param: rename lp function and variable from "lprmcommand" to "lprm_command"
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-02-07 16:19:14 -08:00
Garming Sam
bbcd004218 param: rename lp function and variable from "lpresumecommand" to "lpresume_command"
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-02-07 16:19:14 -08:00
Garming Sam
b8eedddc2f param: rename lp function and variable from "lpqcommand" to "lpq_command"
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-02-07 16:19:14 -08:00
Garming Sam
3fda1fa96f param: rename lp function and variable from "lpqcachetime" to "lpq_cache_time"
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-02-07 16:19:14 -08:00
Garming Sam
d3460a798a param: rename lp function and variable from "lppausecommand" to "lppause_command"
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-02-07 16:19:14 -08:00
Michael Adam
cf0cb0add9 dbwrap: add a dbwrap_flags argument to db_open()
This is in preparation to support handing flags to backends,
in particular activating read only record support for ctdb
databases. For a start, this does nothing but adding the
parameter, and all databases use DBWRAP_FLAG_NONE.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-02-07 16:06:06 +01:00
Michael Adam
4286e147a6 loadparm: rename lp[cfg]_print_ok to lp[cfg]_printable for consistency with docs
Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2014-02-03 13:27:15 +13:00
Michael Adam
d85bab275a loadparm: rename lp[cfg]_pathname to lp[cfg]_path for consistency with docs
Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2014-02-03 13:26:13 +13:00
Christian Ambach
805515b83f s3:printing fix a compiler warning
about a potentially uninitialized variable

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-12-12 14:21:27 -08:00
David Disseldorp
024e691d85 printing: use DEBUG instead of sys_adminlog
sys_adminlog() is another syslog wrapper. Use DEBUG(0, ...) instead,
which offers the same syslog(LOG_ERR) behaviour.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2013-11-20 08:16:45 +01:00
David Disseldorp
d9d8b837b6 printing: fix double space in debug statement
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2013-11-20 08:16:40 +01:00
David Disseldorp
956a4552f2 printing: return WERROR from print_access_check
print_access_check() currently returns a bool based on whether access is
granted or denied. Errno is set on failure, but none of the callers use
it.
This change converts print_access_check() to return a WERROR.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2013-11-20 08:16:25 +01:00
David Disseldorp
b7da5a5b00 printing: always store sytem job-ID in queue state
Print jobs have multiple identifiers: the regular spoolss jobid, which
is allocated by spoolss on job submission, and the system jobid, which
is assigned by the printing back-end.
Currently these identifiers are incorrectly mixed in print job queue
tracking. Fix this by ensuring that only the system jobid is stored in
the print queue state structure.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10271

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>

Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Mon Nov 18 18:03:41 CET 2013 on sn-devel-104
2013-11-18 18:03:41 +01:00
David Disseldorp
24d025f85d spoolss: return the spoolss job ID in notifications
Print job notifications currently carry the system print job identifier
from the queue structure. Instead, the spoolss job identifier should be
resolved and returned.

Print clients can use notification job-ids in subsequent spoolss SetJob
requests. Returning an incorrect identifier can result in the failure of
such requests, e.g. spoolss_SetJob(SPOOLSS_JOB_CONTROL_DELETE).

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10271

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2013-11-18 16:03:59 +01:00
Günther Deschner
6886cff0a7 s3-rpc_cli: pass down ndr_interface_table to rpc_pipe_open_interface().
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-08-05 10:29:59 +02:00
Günther Deschner
44429f948b s3-printing: avoid KRB5CCNAME overwrite in printer publishing (Bug #7444).
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Fri Jul 19 17:53:08 CEST 2013 on sn-devel-104
2013-07-19 17:53:08 +02:00
David Disseldorp
002d1a4467 Fix bug 9900: is_printer_published GUID retrieval
Samba currently always responds to GetPrinter(level = 7) requests with
DSPRINT_UNPUBLISH, regardless of the AD publish status tracked via the
PRINTER_ATTRIBUTE_PUBLISHED flag. This is due to erroneous "objectGUID"
unmarshalling in is_printer_published().

This change splits "objectGUID" retrieval into a separate function, and
adds a pull_reg_sz() call to correctly unmarshall the GUID.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-06-03 14:10:07 +02:00
David Disseldorp
f9b6b09e4e printing: explicitly clear PUBLISHED attribute
Currently nt_printer_publish(DSPRINT_UNPUBLISH) flips (via xor) the
info2->attributes PRINTER_ATTRIBUTE_PUBLISHED flag, rather than
explicitly clearing it.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-06-03 14:10:07 +02:00
David Disseldorp
b1574ebb0b bug 9830: fix panic in nt_printer_publish_ads
Check for ads_find_machine_acct() errors, to ensure a NULL LDAPMessage
pointer doesn't get passed to ldap_get_dn().

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-By: Günther Deschner <gd@samba.org>

Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Thu Apr 25 19:01:55 CEST 2013 on sn-devel-104
2013-04-25 19:01:55 +02:00
Volker Lendecke
235a309fc1 smbd: Convert print_spool_open to synthetic_smb_fname
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:50:03 -07:00
Volker Lendecke
ea519ec5ce smbd: Convert driver_unlink_internals to synthetic_smb_fname
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:50:03 -07:00
Andrew Bartlett
cdc062273c spoolssd: Cast getpid() result to unsigned int for GNU/Solaris build
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-03-15 10:38:50 -07:00
Andreas Schneider
90068bb460 s3-net: Add encoding=<CP> to 'net printing migrate'.
This allows you to convert printing tdb's which are in e.g. in latin1 to
convert to UTF-8 and import them into the registry.

Reviewed-by: Günther Deschner <gd@samba.org>
2013-03-15 12:11:03 +01:00
Andreas Schneider
90cbfc96d1 Make sure to set umask() before calling mkstemp().
Reviewed-by: David Disseldorp <ddiss@samba.org>

Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Wed Mar  6 01:16:34 CET 2013 on sn-devel-104
2013-03-06 01:16:34 +01:00
Andreas Schneider
f06a0352e5 s3-daemons: Set the comment field of the daemons.
PR_SET_NAME sets the comm field of a process. This way we can give
processes a name and they are easier to identify.

$ ps afx -o pid,comm
29447 smbd
29452  \_ epmd
29453  \_ lsasd-master
29455  |   \_ lsasd-child
29457  |   \_ lsasd-child
29459  |   \_ lsasd-child
29461  |   \_ lsasd-child
29463  |   \_ lsasd-child
29454  \_ spoolssd-master
29456      \_ lpqd
29458      \_ spoolssd-child
29460      \_ spoolssd-child
29462      \_ spoolssd-child
29465      \_ spoolssd-child
29466      \_ spoolssd-child
29467      \_ spoolssd-child
29468      \_ spoolssd-child
29469      \_ spoolssd-child
29470      \_ spoolssd-child
29471      \_ spoolssd-child

Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-03-05 23:29:48 +01:00
Stefan Metzmacher
abf8e166b8 s3:printing: s/event_add_fd/tevent_add_fd and s/EVENT_FD_/TEVENT_FD_
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-19 23:48:01 +01:00
Stefan Metzmacher
b7a925f56b s3:printing: s/struct fd_event/struct tevent_fd
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-19 23:47:59 +01:00
Stefan Metzmacher
99367d413a s3:printing: s/struct event_context/struct tevent_context
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-19 23:47:53 +01:00
Günther Deschner
11fba10208 spoolss: make spoolss deal with ndr64 StartDocPrinter by using proper container object.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-01-24 17:42:25 +01:00
Andrew Bartlett
d90b709ebb printing: Free talloc_stackframe() on all exit paths
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-19 09:42:02 +01:00
David Disseldorp
4f9cffbae6 BUG 9378: Add extra attributes for AD printer publishing.
Currently attempting to publish a printer in AD fails with "Object class
violation", due to a number of missing attributes in the LDAP request.

Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Jan 18 17:27:35 CET 2013 on sn-devel-104
2013-01-18 17:27:35 +01:00
David Disseldorp
12a08d8ae2 printing: Remove invalid free from error path.
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-01-18 15:37:10 +01:00
Andreas Schneider
d34cd6d061 printing: Create default architecture directories on init.
Reviewed-by: Guenther Deschner <gd@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Jan 17 20:36:17 CET 2013 on sn-devel-104
2013-01-17 20:36:17 +01:00
Günther Deschner
e8feca012e spoolss: make spoolss deal with ndr64 ULONG_PTR of devmode_ptr and secdesc_ptr.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-01-17 17:11:37 +01:00
Andrew Bartlett
5a3e915d20 smbd: Fix calls to create_conn_struct_cwd to be correctly indented.
These are whitespace changes only, left out of the previous commit to preserve clarity.

Andrew Bartlett.

Reviewed-by: Jeremy Allison <jra@samba.org>
2013-01-07 16:18:14 -08:00
Andrew Bartlett
6c80cf747d smbd: Split create_conn_struct into a fn that does not change the working dir
The python bindings do not want the current working directory changed
during operations, so we provide two functions, one providing the
original behaviour, and other providing the python bindings with just
the memory allocation and initilisation stuff.

Andrew Bartlett

Reviewed-by: Jeremy Allison <jra@samba.org>
2013-01-07 16:09:39 -08:00
Andreas Schneider
880b0f18be s3-printing: Correctly create the printing cache path.
Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2012-12-12 15:00:02 +01:00
Andreas Schneider
e039676fe2 s3-printing: Don't call talloc_free on an uninitialized pointer.
Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2012-12-12 09:42:32 +01:00
David Disseldorp
e19da78ce0 s3-printing: add missing carriage return to debug str
Reviewed-by: Andreas Schneider <asn@samba.org>
2012-11-29 13:39:56 +01:00
Volker Lendecke
9a2db48e7e s3: Remove some calls to procid_self
The goal is to have procid_self handling completely in the messaging_context.

Signed-off-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Oct 19 20:39:56 CEST 2012 on sn-devel-104
2012-10-19 20:39:56 +02:00
Andreas Schneider
cabd2b2e96 s3fs-printing: Simplify the comment and location handling.
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Oct 11 18:49:15 CEST 2012 on sn-devel-104
2012-10-11 18:49:15 +02:00
Andreas Schneider
c12cc3cf9c s3fs-printing: Fix RAW printing for normal users.
This fixes bug #8769.

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Oct  8 16:11:51 CEST 2012 on sn-devel-104
2012-10-08 16:11:51 +02:00
Andreas Schneider
aa6a7a9780 s3fs-smbd: Move housekeeping to the background process.
If you add 200 printers using lpadmin. Then you wait for the printcap
cache to expire. As soon as this expires we notify all deamons that they
should reload the printers. This mean we need to create the default
registry keys for each printer. If you do e.g. a 'smbclient -L' during
that time you will get a lot of timeouts.

This lets the housekeeping function of the printcap cache do the task of
creating the default registry keys in background queue process. When it is done
with the task it will tell all smbd childs to reload the printers and the 200
printers appear.

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Oct  1 20:28:23 CEST 2012 on sn-devel-104
2012-10-01 20:28:23 +02:00
Andreas Schneider
d52d7efba3 s3-printing: Increase debug level for info that the db is empty.
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Sep 20 12:01:48 CEST 2012 on sn-devel-104
2012-09-20 12:01:48 +02:00
David Disseldorp
fb15e5a58f s3-printing: fix bug 9123 lprng job tracking errors
The lprng printing back-end is truncating the print job filename in the
lpq output, which means that Samba is not able to determine the back-end
job ID for a newly submitted print job.
Remove the unneeded spoolss job ID from the print job file name to
ensure the job filename is not truncated. Also log these warnings at a
higher log level.

Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Wed Aug 29 14:25:13 CEST 2012 on sn-devel-104
2012-08-29 14:25:12 +02:00
Jeremy Allison
b70f23c2b5 Correctly check for errors in strlower_m() returns. 2012-08-09 12:08:18 -07:00
Jeremy Allison
b76d574b98 Fix incorrect use of server as a talloc context. 2012-07-24 00:09:46 +02:00
Jiri Popelka
f7b88fbe9f Use ippGet/ippSet (accessors) for IPP API.
CUPS 1.6 makes various structures private and
introduces these ippGet and ippSet functions
for all of the fields in these structures.
http://www.cups.org/str.php?L3928

We define our own accessors when CUPS < 1.6.

Signed-off-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jul 20 22:35:55 CEST 2012 on sn-devel-104
2012-07-20 22:35:55 +02:00
Rusty Russell
fe72740e82 loadparm: make the source3/ lp_ functions take an explicit TALLOC_CTX *.
They use talloc_tos() internally: hoist that up to the callers, some
of whom don't want to us talloc_tos().

A simple patch, but hits a lot of files.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-07-18 15:07:23 +09:30
Rusty Russell
7a6591037b nt_printing_tdb_migrate(): fix stackframe leak.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-07-18 05:00:31 +09:30
Andreas Schneider
98ab074094 s3-printing: Remove deprecated lp_printer_admin(). 2012-07-03 21:56:49 +02:00
David Disseldorp
082b90674a s3-printing: fix broken print_job_get_name() return
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Wed Jun 27 04:04:56 CEST 2012 on sn-devel-104
2012-06-27 04:04:56 +02:00
David Disseldorp
e01ef8a9bd s3-printing: use euid for vlp job tracking
vlp can be called by print_run_command as root with euids set
appropriately, vlp should use this to track the job owner.
2012-06-26 16:10:39 +02:00
David Disseldorp
1c2f154323 s3-printing: fill print_generic sysjob id on job submission
Change the generic print backend to fill the printing backend job
identifier (sysjob) on submission of a new job.
This is needed to ensure correct mapping of spoolss jobs and entries in
the backend print queue.

This and the last 13 commits attempt to address bug 8719.
2012-06-26 16:10:39 +02:00
David Disseldorp
c29773d890 s3-printing: pass lpq command to job_submit
Currently the generic print backend does not fill the printing backend
job identifier (sysjob) on submission of a new job. The sysjob
identifier is required to correctly map jobs in the printer queue to
corresponding spoolss print jobs.

Passing the lpq command to job_submit allows the generic print backend
to check the printer queue for the new job following submission. This
behaviour will come in a later commit.
2012-06-26 16:10:39 +02:00
David Disseldorp
91cd9a4797 s3-printing: remove unused print_job_fname() 2012-06-26 16:10:39 +02:00
David Disseldorp
9a296efa9e s3-printing: pass a talloc ctx to unpack_pjob
Rather than allocating the devicemode on a null context.
2012-06-26 16:10:39 +02:00
David Disseldorp
2f85c1fcf2 s3-printing: return talloced print jobs
print_job_find() currently returns print jobs to callers via a
statically allocated variable, this is particularly messy as the
device mode is talloced under the static variable.

This change adds or passes a talloc context to all callers, giving them
ownership of the returned print job.
2012-06-26 16:10:39 +02:00
David Disseldorp
e1ddf8f0e4 s3-printing: clean up print_job_pause/resume interface
Currently both return a bool and sometimes set a werr pointer argument,
always return werror instead.
2012-06-26 16:10:39 +02:00
David Disseldorp
97073589d0 s3-printing: fix potential print db refcount leak 2012-06-26 16:10:39 +02:00
David Disseldorp
1cd2433e8d s3-spoolss: remove duplicate "." in smbd spooler path 2012-06-26 16:10:39 +02:00
David Disseldorp
4e33424581 s3-printing: remove print_parse_jobid()
With all callers fixed, it is now safe to remove.
2012-06-26 16:10:39 +02:00
David Disseldorp
fb2579e3ee s3-printing: remove redundant variable set 2012-06-26 16:10:39 +02:00
David Disseldorp
5eaa47c433 s3-printing: remove print_parse_jobid() calls from printing.c
In all cases the spoolss layer job id can be determinded from the
printing subsystem allocated job identifier (sysjob).
2012-06-26 16:10:39 +02:00
David Disseldorp
dbca645eec s3-printing: rename queue->job sysjob
Print jobs maintain two job identifiers, the jobid allocated by the
spoolss layer (pj->jobid), and the job identifier defined by the
printing backend (pj->sysjob).

Printer job queues currently only contain a single job identifier
variable (queue->job), the variable is sometimes representative of the
spoolss layer job identifier, and more often representative of the
printing backend id.

This change renames the queue job identifier from queue->job to
queue->sysjob, in preparation for a change to only store the printing
backend identifier.
2012-06-26 16:10:39 +02:00
David Disseldorp
a66618f402 s3-printing: remove print_parse_jobid() from print_cups.c
The spoolss print job identifier is now passed to the cups layer via
struct printjob, therefore it is no longer necessary to parse the job
filename to determine it.
2012-06-26 16:10:39 +02:00
David Disseldorp
a2d880ddcd s3-printing: store print jobid as part of struct printjob
Printing code in some places relies upon the spool-file format to
retrieve the print jobid. By storing the jobid as part of struct
printjob, and hence in the printing TDB, we can move away from this ugly
behaviour.
2012-06-26 16:10:39 +02:00
Michael Adam
51a19364ff s3:printing: fix use of a non-existent word (existant) 2012-06-12 07:21:43 +02:00
Stefan Metzmacher
484cb4e43e s3:printing: let print_spool_open() take a uint64_t vuid
metze
2012-06-06 10:18:40 +02:00
Stefan Metzmacher
b6319b5457 s3:printing: use smbd/smbd.h instead of just smbd/proto.h in queue_process.c
This fixes compiler warnings regarding incomplete types.

metze
2012-06-06 10:18:39 +02:00
Stefan Metzmacher
d1d7904182 s3:printing: add print_spool_rap_jobid()
metze
2012-06-06 10:18:37 +02:00
Stefan Metzmacher
6d2d8f5444 s3:printing: make struct print_file_data private to printspoolss.c
metze
2012-06-06 10:18:37 +02:00
Jeremy Allison
8fd02fa2d6 Forward port of Richard Sharpe's <realrichardsharpe@gmail.com> fix for bug #8970 - Possible memory leaks in the samba master process. 2012-05-31 16:08:44 -07:00
Stefan Metzmacher
a92f7176bd s3:smbd/msdfs: let create_conn_struct() also fake the 'smbd_server_connection'
metze
2012-05-24 14:12:32 +02:00
Andrew Bartlett
6aa12fcb30 build: Remove SMB_OFF_T, replace with off_t
Now that we always require a 64 bit off_t, we no longer need SMB_OFF_T.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Fri Apr  6 01:47:43 CEST 2012 on sn-devel-104
2012-04-06 01:47:43 +02:00
Jelmer Vernooij
c0288e0612 lib/util: Remove obsolete sys_getpid() and sys_fork().
The performance of these is minimal (these days) and they can return
invalid results when used as part of applications that do not use
sys_fork().

Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sat Mar 24 21:55:41 CET 2012 on sn-devel-104
2012-03-24 21:55:40 +01:00
Andreas Schneider
1a65f90a34 s3-printing: Make printer a const char *. 2012-03-14 17:56:14 +01:00
Andrew Bartlett
b07d504ca4 change low FDs are handled in Samba
We now only close fds 0, 1, 2 when we are a forked daemon, and take
care not to close a file descriptor that we might need for foreground
stdin monitoring.

This should fix stdout logging in the lsa and epmapper deamons (ie in
make test).

Andrew Bartlett
2012-03-04 10:14:34 +01:00
Jeremy Allison
21528da9cd Fix a bunch of "unused variable" warnings.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Feb 18 06:22:40 CET 2012 on sn-devel-104
2012-02-18 06:22:40 +01:00
David Disseldorp
a6bd7f3d57 s3-printing: fix crash in printer_list_set_printer()
The printer list database format was recently changed to accommodate for
the printcap location field.
One of the tdb_pack calls is not provided with a location string
argument, this causes a crash on some platforms.

https://bugzilla.samba.org/show_bug.cgi?id=8762

Signed-off-by: Günther Deschner <gd@samba.org>
Signed-off-by: Jim McDonough <jmcd@samba.org>
Signed-off-by: Lars Müller <lars@samba.org>

Autobuild-User: David Disseldorp <ddiss@samba.org>
Autobuild-Date: Wed Feb 15 19:34:38 CET 2012 on sn-devel-104
2012-02-15 19:34:38 +01:00
Volker Lendecke
740d4d7550 s3: files_struct->mode is only written, remove it
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Tue Feb 14 19:14:29 CET 2012 on sn-devel-104
2012-02-14 19:14:29 +01:00
Björn Baumbach
5ec12732c3 s3-printing: Add new printers to registry.
This fixes bug #8554, #8612 and #8748.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Autobuild-User: Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date: Thu Feb  9 16:39:04 CET 2012 on sn-devel-104
2012-02-09 16:39:04 +01:00
Jeremy Allison
a9e03337c1 Finally remove all malloc()'s from the substitute code. Now totally
talloc() based.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Jan 27 03:43:21 CET 2012 on sn-devel-104
2012-01-27 03:43:21 +01:00
David Disseldorp
ec094bf9ac WERROR type variable being incorrectly checked with a NT_STATUS_IS_X
type macro.
2012-01-23 12:18:01 -08:00
David Disseldorp
b2c9317cd1 s3-spoolss: prefix print$ path on driver file deletion
Driver file paths stored in the registry do not include the server path
prefix. delete_driver_files() incorrectly assumes such a prefix.

https://bugzilla.samba.org/show_bug.cgi?id=8697

Signed-off-by: Andreas Schneider <asn@samba.org>
2012-01-20 17:43:34 +01:00
Volker Lendecke
45e61fcf61 s3: Add a "lock_order" argument to db_open
This will be used to enforce a lock hierarchy between the databases. We have
seen deadlocks between locking.tdb, brlock.tdb, serverid.tdb and notify*.tdb.
These should be fixed by refusing a dbwrap_fetch_locked that does not follow a
defined lock hierarchy.
2012-01-18 14:48:04 +01:00
Stefan Metzmacher
32b5b461fa s3:printing: avoid messaging_event_context() in print_queue_housekeeping()
metze
2012-01-17 08:10:28 +01:00
Stefan Metzmacher
16bd41b7e7 s3:printing/spoolssd: avoid using server_messaging_context()
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Dec 16 16:29:41 CET 2011 on sn-devel-104
2011-12-16 16:29:41 +01:00
Stefan Metzmacher
5061dd26d3 s3:printing/spoolssd: pass event and messaging context to check_updater_child()
metze
2011-12-15 11:08:52 +01:00
Volker Lendecke
4066e291f5 s3: Remove a call to procid_self() 2011-12-13 11:00:54 +01:00
Volker Lendecke
0f9d14820e s3: Remove a bunch of calls to procid_self()
All callers to messaging_[re]init only used procid_self()
2011-12-12 21:50:25 +01:00
Volker Lendecke
6316335801 s3: Fix typos
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Thu Dec  8 12:05:55 CET 2011 on sn-devel-104
2011-12-08 12:05:54 +01:00
Björn Baumbach
955775023b s3-printing: fix typo
Signed-off-by: Michael Adam <obnox@samba.org>
2011-11-03 10:13:40 +01:00
Andreas Schneider
2f65ae25df s3: Include uid_wrapper where it is missing. 2011-10-27 13:32:02 +02:00
Michael Adam
c7c1a3e276 s3:printing: convert printer_list to use dbwrap wrapper functions
Avoid direct use of the db_record and db_context structs.
2011-10-11 14:17:57 +02:00
Michael Adam
0e28448a78 s3:dbwrap: convert dbwrap_fetch(), dbwrap_fetch_bystring() and dbwrap_fetch_bystring_upper() to NTSTATUS 2011-10-11 14:17:56 +02:00
Volker Lendecke
425b93ef69 s3: Remove the smbd_server_conn ref from create_conn_struct 2011-09-26 14:59:12 +02:00
Andreas Schneider
a9dc2c81ad s3-spoolss: Fix bug #8351 forms migration.
Don't fail if the form already exists (or is builtin now).

Signed-off-by: Andreas Schneider <asn@samba.org>

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Sep  9 03:21:42 CEST 2011 on sn-devel-104
2011-09-09 03:21:42 +02:00
Andreas Schneider
3e8c665465 s3-smbd: Rename reload_printers() and add documentation.
Autobuild-User: Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date: Mon Sep  5 17:59:47 CEST 2011 on sn-devel-104
2011-09-05 17:59:47 +02:00
Andreas Schneider
ad37341949 s3-spoolssd: Remove stale printers only on a valid pcap update.
load_printers() removes stale printers and we should only remove them if
we have a CUPS connection and talked to cups. Else we will remove every
configured printer if cups is not available.

Autobuild-User: Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date: Mon Sep  5 11:18:23 CEST 2011 on sn-devel-104
2011-09-05 11:18:23 +02:00
Simo Sorce
a4188aaf7b s3-spoolss: Remove useless check
If we *really* are a bout to exit (PF_WORKER_EXITING) then the event will not
be called as the loop will exit. Otherwise PF_SRV_MSG_EXIT may not  be honoured
for a long time if we have cients connected, therefore keep handling SIGHUP
properly in those cases.

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21 09:05:06 -04:00
Simo Sorce
feadd849ba s3-spoolssd: Listen on parent messages
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21 09:05:06 -04:00
Simo Sorce
72746498a4 s3-spoolssd: Send a message to the parent when we accept a connection
Every time we accept a connection wanr the parent, so it can run management
routines and reallocate more resources if necessary.

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21 09:05:06 -04:00
Simo Sorce
f07f5c5100 s3-spoolssd: User new prefork helpers to simplify code.
Also stop using the listening as now the prefork code properly sets
the PF_WORKER_ACCEPTING flag and it can be relied upon without having to keep
additional status around.

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21 09:05:05 -04:00
Simo Sorce
e3736f826b s3-prefork: Fix worker flags handling.
We can't have a clear idea of wether the worker is IDLE or BUSY.
The only things we can tell is if it is Alive, whether it is currently
Accepting connections or wether it is Exiting soon.

Remove PF_WORKER_IDLE, PF_WORKER_BUSY and replace their use with
PF_WORKER_ALIVE. Also properly assign PF_WORKER_ACCEPTING so that
users of the API can rely on the flag.

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21 09:05:05 -04:00
Simo Sorce
ee0c69a25e s3-prefork: do not use a lock_fd, just race on accept()
We used a lock mimicking what apache does for preforked children.
But it doesn't work properly in our case because we do not stop once a request
has been served. Clients are allowed to perform multiple requests and keep the
connection open.
This means that if we allow multiple clients per children, then a child could
take the lock and then be asked to do a long or even locking operation by a
client it already is serving. This woulkd cause the whole server to deadlock,
as the child is now busy and also holding on the lock.
Using a race on accept() by having a tevent_fd on the listening socket wait
for read events we never deadlock. At most we cause a bit of contention among
children. But in the generic case connections are much less frequent for us as
clients tend to be long lived. So the little contention we may have is not a
big deal.

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21 09:05:05 -04:00
Simo Sorce
884969ed97 s3-spoolssd: Use prefrok utils to manage children
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21 09:05:04 -04:00
Simo Sorce
0647a93c64 s3-spoolss: Introduce helper function to manage pool.
We were not properly managing allowed clients and pool management was
duplicated across a few callers.
Concentrate all management heuristics in one single function.

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21 09:05:04 -04:00
Simo Sorce
bfd9624818 s3-spoolssd: Fix spoolss logging.
Use the same code as in lsasd.

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21 09:05:04 -04:00
Simo Sorce
23e7e1c158 s3-rpc_server: Replace RPC_SERVICE_MODE_DAEMON checks
Use rpc_daemon_type() macros where appropriate instead.

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21 09:05:03 -04:00
Andreas Schneider
dea21619a2 s3-spoolssd: Check if we were able to create the prefork pool.
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21 09:05:02 -04:00
Simo Sorce
d52343a967 s3-messaging: Do not register to classes we are not going to use.
Signed-off-by: Andreas Schneider <asn@samba.org>

Autobuild-User: Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date: Thu Aug 11 17:09:30 CEST 2011 on sn-devel-104
2011-08-11 17:09:30 +02:00
Simo Sorce
cb1af61cb1 s3-messaging: Remove obsolete class.
The FLAG_MSG_PRINT_NOTIFY class is actually obsolete and never used, as the
only message belonging to it is not used either.

Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-11 14:57:55 +02:00
Andreas Schneider
9eafbebf9c s3-spoolss: Fix prototypes warnings.
Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10 18:14:06 +02:00
Simo Sorce
c3cfa6be47 s3-printing: Do not try to force reload.
Be more correct in load printers at startup.
If async process have already started we do not need to force a reload, but we
just need to load the printers. If other process have not finished initializing
it makes no sense to try to force them as they are masking SIGHUP unitl init is
done anyway.

Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10 18:14:06 +02:00
Simo Sorce
54aaa5a58c s3-spoolss: do not call pcap_cache_reload() directly
The background queue process is repsonsible for that.
Just reload printers if necessary or wait for a message from bq to do that.

Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10 18:14:05 +02:00
Simo Sorce
dd4ff4bfdd s3-printing: Add child handler to bq process
The cups backend forks a child to do asynchronous work.
We need a sigchld handler in bq to properly wait for the chilod to finish and
reap it, otherwise it hangs the forever as a zombie process.

Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10 18:14:05 +02:00
Simo Sorce
befc539273 s3-spoolss: Fix printers related messaging
Children were not properly receiving messages to reload printers when
the background queue process was dispatching them.

Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10 18:14:05 +02:00
Simo Sorce
7a07162558 s3-prefork: Fix use of child id.
Children Ids must start at 1 as 0 represent the father.
Also fix callbacks that restart logs to use a procedd global variable that
holds the Id so that they work correctly both fot the parent process and the
children.

Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10 18:14:05 +02:00
Simo Sorce
f00681fe9a s3-printing: make sure to block SIGHUP ...
... until we are ready to handle it.

Also make us ready as early as possible in spoolssd.

Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10 18:14:05 +02:00
Simo Sorce
6f682be2ae s3-spoolss: Use a global variable for the pool
This allows for setting up signal handlers earlier which is needed
for the following patch. It also simplify the code in a few places.
After all we never have more than pool active at any time during
spoolssd life span.

Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10 18:14:05 +02:00