summaryrefslogtreecommitdiff
path: root/source3/printing/print_cups.c
AgeCommit message (Collapse)AuthorFilesLines
2013-02-19s3:printing: s/event_add_fd/tevent_add_fd and s/EVENT_FD_/TEVENT_FD_Stefan Metzmacher1-2/+2
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-19s3:printing: s/struct fd_event/struct tevent_fdStefan Metzmacher1-2/+2
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-19s3:printing: s/struct event_context/struct tevent_contextStefan Metzmacher1-3/+3
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2012-07-20Use ippGet/ippSet (accessors) for IPP API.Jiri Popelka1-75/+116
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-18loadparm: make the source3/ lp_ functions take an explicit TALLOC_CTX *.Rusty Russell1-13/+15
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-06-26s3-printing: pass lpq command to job_submitDavid Disseldorp1-1/+3
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-26s3-printing: rename queue->job sysjobDavid Disseldorp1-1/+1
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-26s3-printing: remove print_parse_jobid() from print_cups.cDavid Disseldorp1-11/+1
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-03-24lib/util: Remove obsolete sys_getpid() and sys_fork().Jelmer Vernooij1-1/+1
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
2011-12-12s3: Remove a bunch of calls to procid_self()Volker Lendecke1-1/+1
All callers to messaging_[re]init only used procid_self()
2011-06-09s3-talloc Change TALLOC_P() to talloc()Andrew Bartlett1-1/+1
Using the standard macro makes it easier to move code into common, as TALLOC_P isn't standard talloc.
2011-05-16s3-printing: Remove obsolete and unused cups_pull_comment_location().Andreas Schneider1-157/+0
Signed-off-by: Günther Deschner <gd@samba.org>
2011-05-16s3-printing: Get the location info from cups.Günther Deschner1-2/+16
Signed-off-by: Günther Deschner <gd@samba.org>
2011-05-11s3-printing: make cups_pull_comment_location() work again.Günther Deschner1-13/+2
we deal with lp_cups_server in cups_connect() already, inside the URI all our other cups functions we use ipp://localhost, do the same here. Guenther Autobuild-User: Günther Deschner <gd@samba.org> Autobuild-Date: Wed May 11 11:36:07 CEST 2011 on sn-devel-104
2011-05-10s3-printing: Fix double free of cups request.Günther Deschner1-4/+0
We never free the request in our cups api usage except for here. The reason is probably htis (from the cupsDoConnect API docs): "This function sends the IPP request to the specified server, retrying and authenticating as necessary. The request is freed with ippDelete() after receiving a valid IPP response." Revert "Fix a memory leak in cups_pull_comment_location" This reverts commit fee2664dad37536b05ce8bdae3e74d45b257f632. Autobuild-User: Günther Deschner <gd@samba.org> Autobuild-Date: Tue May 10 17:32:58 CEST 2011 on sn-devel-104
2011-05-10s3-printing: very obvious fix for cups_pull_comment_location().Günther Deschner1-1/+1
This has been in there since 2008... Guenther
2011-04-21Fix compiler warning in debug message.Jeremy Allison1-2/+2
2011-03-16s3-printing: fix memory leak in print_cups.cDavid Disseldorp1-16/+9
As found by valgrind, tmp_pcap_cache is not freed following printer list tdb update. Signed-off-by: Andreas Schneider <asn@samba.org> Autobuild-User: Andreas Schneider <asn@cryptomilk.org> Autobuild-Date: Wed Mar 16 16:37:58 CET 2011 on sn-devel-104
2011-03-16s3-printing: remove duplicate cups response processing codeDavid Disseldorp1-147/+94
There is currently a lot of duplicate code included for processing responses to CUPS_GET_PRINTERS and CUPS_GET_CLASSES requests. This change splits this code into a separate function. Signed-off-by: Andreas Schneider <asn@samba.org>
2011-03-16s3-printing: use printcap IDL for IPCDavid Disseldorp1-131/+107
Use printcap IDL for marshalling and unmarshalling messages between cups child and parent smbd processes. This simplifies the IPC and ensures the parent is notified of cups errors encountered by the child. https://bugzilla.samba.org/show_bug.cgi?id=7994 Signed-off-by: Andreas Schneider <asn@samba.org>
2011-03-04s3-printing: fix cups pcap reload with no printersDavid Disseldorp1-12/+27
cups_async_callback() is called to receive new printcap data from a child process which requests the information from cupsd. Newly received printcap information is stored in a temporary printcap cache (tmp_pcap_cache). Once the child process closes the printcap IPC file descriptor, the system printcap cache is replaced with the newly populated tmp_pcap_cache, however this only occurs if tmp_pcap_cache is non null (has at least one printer). If the printcap cache is empty, which is the case when cups is not exporting any printers, the printcap cache is not replaced resulting in stale data. https://bugzilla.samba.org/show_bug.cgi?id=7915 Signed-off-by: Andreas Schneider <asn@samba.org>
2011-03-04s3-printing: remove unneeded local_pcap_copy globalDavid Disseldorp1-36/+18
The cups local_pcap_copy global served as a temporary buffer during asynchronous cups printcap cache updates, as well as indicating when the printcap cache had not yet been filled and printcap cache update should block. As smbd printcap reads are now triggered by the parent smbd following printcap cache update, the variable and blocking mechanism are no longer needed. Signed-off-by: Andreas Schneider <asn@samba.org>
2011-01-07s3-printing: remove old entries in pcap_cache_replaceDavid Disseldorp1-6/+5
Callers of pcap_cache_replace() assume the existing printcap cache is replaced by the new values provided. This is not currently the case, old entries should be removed.
2011-01-07s3-printing: reload shares after pcap cache fillDavid Disseldorp1-8/+32
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>
2010-08-16s3-printing: Lift the use of smbd_server_fd from job_submit.Volker Lendecke1-8/+1
Signed-off-by: Andreas Schneider <asn@samba.org>
2010-08-16s3: Remove get_client_fd()Volker Lendecke1-2/+2
2010-08-08s3: Remove the smbd_messaging_context from cups_cache_reloadVolker Lendecke1-7/+5
2010-08-08s3: Remove the smbd_messaging_context from cups_pcap_load_asyncVolker Lendecke1-5/+7
2010-07-04s3: Pass the new server_id through reinit_after_forkVolker Lendecke1-2/+5
2010-06-13s3: Remove the pointless PRINTERNAME macroVolker Lendecke1-9/+18
2010-06-10s3:misc make use of server_[event/messaging]_context directlyAndreas Schneider1-4/+4
Untangle these functions from smbd specific dependencies so they can be freely used in multiple servers.
2010-05-14s3-printing: explicitly include "printing/pcap.h" as there is ↵Günther Deschner1-1/+1
/usr/include/pcap.h. Thanks metze for pointing this out. Simo, please check. Guenther
2010-05-14Make pcap headers privateSimo Sorce1-0/+1
Signed-off-by: Günther Deschner <gd@samba.org>
2010-03-26s3-printing: avoid mixing cups backend code with nt_printing code in ↵Günther Deschner1-21/+14
cups_pull_comment_location. Guenther
2010-03-25Fix bug #7288 - SMB job IDs in CUPS job names wrong.Jeremy Allison1-1/+10
Based on a patch from Michael Karcher <samba@mkarcher.dialup.fu-berlin.de>. I think this is the correct fix. It causes cups_job_submit to use print_parse_jobid(), which I've moved into printing/lpq_parse.c (to allow the link to work). It turns out the old print_parse_jobid() was *broken*, in that the pjob filename was set as an absolute path - not relative to the sharename (due to it not going through the VFS calls). This meant that the original code doing a strncmp on the first part of the filename would always fail - it starts with a "/", not the relative pathname of PRINT_SPOOL_PREFIX ("smbprn."). This fix could fix some other mysterious printing bugs - probably the ones Guenther noticed where job control fails on non-cups backends. Guenther PLEASE CHECK ! Jeremy.
2010-03-24Fix bug #7269 - Job management commands don't work for CUPS queues.Michael Karcher1-1/+9
Samba needs to retrieve pjob->sysjob from the CUPS response (as is done in the iprint backend).
2010-02-23s3-print: Remove obsolete signal type cast.Andreas Schneider1-3/+3
2009-06-19Fix coverity #740. Resource leak in error paths. We shouldJeremy Allison1-3/+2
always return queue here as the caller will free. Jeremy.
2009-05-27s3: Allow child processes to exit gracefully if we are out of fdsMarc VanHeyningen1-2/+2
When we run out of file descriptors for some reason, every new connection forks a child that immediately panics causing smbd to coredump. This seems unnecessarily harsh; with this code change we now catch that error and merely log a message about it and exit without the core dump. Signed-off-by: Tim Prouty <tprouty@samba.org>
2009-03-30s3/cups: add encryption supportBjörn Jacke1-0/+5
2009-02-13Fix Coverity ID 740 (RESOURCE_LEAK)Volker Lendecke1-0/+2
2009-01-05Attempt to fix crash seen with new CUPS async printcap loading code.Jeremy Allison1-0/+3
Jeremy.
2009-01-05clean event context after child is forked.Bo Yang1-1/+2
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2008-12-30Fix a memory leak in cups_pull_comment_locationVolker Lendecke1-0/+4
We allocated "request" with ippNew, so we also should ippDelete it.
2008-10-10Initialize near creation of resource. Makes code clearer.Jeremy Allison1-0/+2
Jeremy.
2008-10-10Ensure we do reinit_after_fork().Jeremy Allison1-0/+5
Jeremy.
2008-10-10Allow data flow to be debugged and only log on error. All seems ok now.Jeremy Allison1-8/+40
Jeremy.
2008-10-10Async is trickier than it looks :-). Don't use a stack variable for a ↵Jeremy Allison1-6/+18
private data ptr. Jeremy.
2008-10-10If you have a large number of cups printers, then scanning for print info ↵Jeremy Allison1-3/+208
can cause a client to timeout (it takes longer than 30 seconds to enumerate them). Make scanning for printers async with a callback from the main loop. This fixes a bug that was irritating *me* :-). Jeremy.
2008-10-02Don't reject a successful alloc :-(.Jeremy Allison1-1/+1
Jeremy.