summaryrefslogtreecommitdiff
path: root/source3/printing/print_cups.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix compiler warning in debug message.Jeremy Allison2011-04-211-2/+2
|
* s3-printing: fix memory leak in print_cups.cDavid Disseldorp2011-03-161-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
* s3-printing: remove duplicate cups response processing codeDavid Disseldorp2011-03-161-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>
* s3-printing: use printcap IDL for IPCDavid Disseldorp2011-03-161-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>
* s3-printing: fix cups pcap reload with no printersDavid Disseldorp2011-03-041-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>
* s3-printing: remove unneeded local_pcap_copy globalDavid Disseldorp2011-03-041-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>
* s3-printing: remove old entries in pcap_cache_replaceDavid Disseldorp2011-01-071-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.
* s3-printing: reload shares after pcap cache fillDavid Disseldorp2011-01-071-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>
* s3-printing: Lift the use of smbd_server_fd from job_submit.Volker Lendecke2010-08-161-8/+1
| | | | Signed-off-by: Andreas Schneider <asn@samba.org>
* s3: Remove get_client_fd()Volker Lendecke2010-08-161-2/+2
|
* s3: Remove the smbd_messaging_context from cups_cache_reloadVolker Lendecke2010-08-081-7/+5
|
* s3: Remove the smbd_messaging_context from cups_pcap_load_asyncVolker Lendecke2010-08-081-5/+7
|
* s3: Pass the new server_id through reinit_after_forkVolker Lendecke2010-07-041-2/+5
|
* s3: Remove the pointless PRINTERNAME macroVolker Lendecke2010-06-131-9/+18
|
* s3:misc make use of server_[event/messaging]_context directlyAndreas Schneider2010-06-101-4/+4
| | | | | Untangle these functions from smbd specific dependencies so they can be freely used in multiple servers.
* s3-printing: explicitly include "printing/pcap.h" as there is ↵Günther Deschner2010-05-141-1/+1
| | | | | | | | /usr/include/pcap.h. Thanks metze for pointing this out. Simo, please check. Guenther
* Make pcap headers privateSimo Sorce2010-05-141-0/+1
| | | | Signed-off-by: Günther Deschner <gd@samba.org>
* s3-printing: avoid mixing cups backend code with nt_printing code in ↵Günther Deschner2010-03-261-21/+14
| | | | | | cups_pull_comment_location. Guenther
* Fix bug #7288 - SMB job IDs in CUPS job names wrong.Jeremy Allison2010-03-251-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.
* Fix bug #7269 - Job management commands don't work for CUPS queues.Michael Karcher2010-03-241-1/+9
| | | | | Samba needs to retrieve pjob->sysjob from the CUPS response (as is done in the iprint backend).
* s3-print: Remove obsolete signal type cast.Andreas Schneider2010-02-231-3/+3
|
* Fix coverity #740. Resource leak in error paths. We shouldJeremy Allison2009-06-191-3/+2
| | | | | always return queue here as the caller will free. Jeremy.
* s3: Allow child processes to exit gracefully if we are out of fdsMarc VanHeyningen2009-05-271-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>
* s3/cups: add encryption supportBjörn Jacke2009-03-301-0/+5
|
* Fix Coverity ID 740 (RESOURCE_LEAK)Volker Lendecke2009-02-131-0/+2
|
* Attempt to fix crash seen with new CUPS async printcap loading code.Jeremy Allison2009-01-051-0/+3
| | | | Jeremy.
* clean event context after child is forked.Bo Yang2009-01-051-1/+2
| | | | Signed-off-by: Stefan Metzmacher <metze@samba.org>
* Fix a memory leak in cups_pull_comment_locationVolker Lendecke2008-12-301-0/+4
| | | | We allocated "request" with ippNew, so we also should ippDelete it.
* Initialize near creation of resource. Makes code clearer.Jeremy Allison2008-10-101-0/+2
| | | | Jeremy.
* Ensure we do reinit_after_fork().Jeremy Allison2008-10-101-0/+5
| | | | Jeremy.
* Allow data flow to be debugged and only log on error. All seems ok now.Jeremy Allison2008-10-101-8/+40
| | | | Jeremy.
* Async is trickier than it looks :-). Don't use a stack variable for a ↵Jeremy Allison2008-10-101-6/+18
| | | | | | private data ptr. Jeremy.
* If you have a large number of cups printers, then scanning for print info ↵Jeremy Allison2008-10-101-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.
* Don't reject a successful alloc :-(.Jeremy Allison2008-10-021-1/+1
| | | | Jeremy.
* Fix bug #5080. Access to cups-printers via samba broken with cups 1.3.4, ↵Jeremy Allison2008-10-011-90/+251
| | | | | | | | | Unsupported character set. Cups 1.3.4 expects utf8 to be used in all messages to/from the server. We may be using a different character set so we need to use talloc utf8 push/pull functions in all communication. Needs more testing. Don't release until I've done a thorough test. I also have a version for 3.2.x. Jeremy.
* Whitespace cleanup.Jeremy Allison2008-10-011-16/+16
| | | | Jeremy.
* printing: Rename new parameter "cups timeout" to "cups connection timeout".Karolin Seeger2008-09-241-1/+1
| | | | Karolin
* printing: Add new parameter "cups timeout".Karolin Seeger2008-09-231-6/+28
| | | | | | | | | | The default timeout for connections to CUPS servers is set to 5 minutes in the CUPS libraries. The smbd hangs on startup until the timeout is reached if the CUPS server is unreachable. This parameter makes the timeout configurable. The default value is set to 30 seconds. Karolin
* Remove pstring from srv_spoolss_nt.c. All gone from rpc_server/*.cJeremy Allison2007-11-271-1/+3
| | | | | Jeremy. (This used to be commit b5a2a1e3f82a0d319fc9a1d76f5166150680f4d4)
* Remove pstring from printing/*.c except for theJeremy Allison2007-11-211-4/+8
| | | | | | | tdb_unpack requirement (I'll be making that an allocating interface later). Jeremy. (This used to be commit d2ee75326ac291ab4f1860075ba35f58703c7d9d)
* Remove most of the remaining globals out of lib/util_sock.c.Jeremy Allison2007-11-031-2/+2
| | | | | | | I have a plan for dealing with the remaining..... Watch this space. Jeremy. (This used to be commit 963fc7685212689f02b3adcc05b4273ee5c382d4)
* I can't get away without a 'length' arg. :-).Jeremy Allison2007-11-031-1/+1
| | | | | Jeremy. (This used to be commit 95d01279a5def709d0a5d5ae7224d6286006d120)
* Stop get_peer_addr() and client_addr() from using globalJeremy Allison2007-11-031-1/+2
| | | | | | statics. Part of my library cleanups. Jeremy. (This used to be commit e848506c858bd16706c1d7f6b4b032005512b8ac)
* RIP BOOL. Convert BOOL -> bool. I found a few interestingJeremy Allison2007-10-181-4/+4
| | | | | | | | bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f)
* Add const to the get_peer_addr() and get_socket_addr()Jeremy Allison2007-10-111-1/+1
| | | | | | calls. Use the IPv6 varient for get_peer_addr(). Jeremy. (This used to be commit baf1f52e34ae2465a7a34be1065da29ed97e7bea)
* r23801: The FSF has moved around a lot. This fixes their Mass Ave address.Andrew Tridgell2007-10-101-2/+1
| | | | (This used to be commit 87c91e4362c51819032bfbebbb273c52e203b227)
* r23779: Change from v2 or later to v3 or later.Jeremy Allison2007-10-101-1/+1
| | | | | Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3)
* r21958: Fix Coverity ID 343 (dead code)Volker Lendecke2007-10-101-3/+0
| | | | (This used to be commit 6d093043ed437c1de6f9a50013d9bd84c75cf3ff)
* r21861: Pull the comment and location from CUPS if we don't have oneGerald Carter2007-10-101-0/+139
| | | | | | | | when fetching a printer from ntprinters.tdb. Slightly modified from original version submitted on samba-technical ml by Andy Polyakov <appro@fy.chalmers.se> (This used to be commit e859e1fdcd13c55746a53b5de4a02a3278f41815)
* r20245: merge 20244 from samba_3_0_24Herb Lewis2007-10-101-2/+1
| | | | | get rid of more nested extern declarations warnings (This used to be commit e9df051f5201843e3428ddbed7a719553c2e799a)