summaryrefslogtreecommitdiff
path: root/source3/printing
Commit message (Collapse)AuthorAgeFilesLines
* printing: Fix building with CUPS version older than 1.7Andreas Schneider2016-12-081-0/+6
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12183 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Karolin Seeger <kseeger@samba.org>
* s3:spoolss: Add support for COPY_FROM_DIRECTORY in AddPrinterDriverExAndreas Schneider2016-11-301-14/+78
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12415 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 4d9f4bfc69a5899bdf91406dfb7efb70a530446c)
* s3-printing: Allow printer names longer than 16 charsAndreas Schneider2016-11-141-18/+37
| | | | | | | | | | | | | | | Printers with long names are supported in the meantime. However we issue a warning that if one printer exceeeds 15 chars we warn about it. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12195 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 2611fd02a0a6a0a0a506df70fe1a1eb4a2e76062) Autobuild-User(v4-4-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-4-test): Mon Nov 14 15:56:11 CET 2016 on sn-devel-144
* s3-printing: Correctly encode CUPS printer URIsAndreas Schneider2016-11-141-18/+110
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12183 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit c160ae9afb222466c50ae170447a6a0805f7169f)
* s3-printing: fix migrate printer code (bug 8618)Björn Baumbach2016-10-241-0/+27
| | | | | | | | | | | | | | | | | | Removed path from driver files. We only need the basenames. (cherry picked from commit d61993043fcb7676a58658476421f5f4ff1a3fea) (cherry picked from commit 9f07ef2249dc21eab37cd5888623e6edc84b2b59) BUG: https://bugzilla.samba.org/show_bug.cgi?id=8618 Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Wed Oct 5 19:19:39 CEST 2016 on sn-devel-144 (cherry picked from commit eb7555397fd4e9f66e041179aadff59f2a39d14f)
* dlist: remove unneeded type argument from DLIST_ADD_END()Michael Adam2016-03-041-1/+1
| | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 476672b647e44898a6de8894b23e598ad13b1fcf)
* lib: Move sys_rw* to lib/utilVolker Lendecke2015-10-132-2/+2
| | | | | | | genrand.c will require it soon Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: Move call to prctl_set_comment to reinit_after_forkChristof Schmitt2015-09-243-13/+5
| | | | | | | This save a few lines of code. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3-rpc_server: Fix inteface typo.Günther Deschner2015-06-041-4/+4
| | | | | | | | | | | Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Ira Cooper <ira@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Jun 4 03:51:29 CEST 2015 on sn-devel-104
* s3-spoolss: use talloc_zero in spoolss notify codeGünther Deschner2015-05-211-6/+2
| | | | | | | | Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Thu May 21 22:53:16 CEST 2015 on sn-devel-104
* Convert the few instances of int32 there were to int32_t.Richard Sharpe2015-05-161-1/+1
| | | | | | | | Signed-off-by: Richard Sharpe <rsharpe@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat May 16 03:09:12 CEST 2015 on sn-devel-104
* Convert all uint32/16/8 to _t in a grab-bag of remaining files.Richard Sharpe2015-05-142-2/+2
| | | | | | | | | | I still need to fix the rpc stuff, but we are almost there. Signed-off-by: Richard Sharpe <rsharpe@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu May 14 22:16:56 CEST 2015 on sn-devel-104
* Convert all (remaining) uses of uint32/16/8 to _t in source3/printing.Richard Sharpe2015-05-126-49/+49
| | | | | Signed-off-by: Richard Sharpe <rsharpe@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Convert uint32/16/8 to 32_t/16_t/8_t in printing.h and all files that ↵Richard Sharpe2015-05-013-102/+102
| | | | | | | include it. Signed-off-by: Richard Sharpe <rsharpe@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: use smbd_reinit_after_forkRalph Boehme2015-04-222-4/+2
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:spoolss: use lp_load() wrapper lp_load_global().Michael Adam2015-04-221-1/+1
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
* lib: Remove tdb_fetch_compatVolker Lendecke2015-03-173-17/+17
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* lib: Remove tdb_errorstr_compatVolker Lendecke2015-03-171-6/+6
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* Remove tdb_[first|next]key_compatVolker Lendecke2015-03-172-8/+8
| | | | | | | This is essentially a revert of 3a8faefd. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* lib: Remove tdb_open_compatVolker Lendecke2015-03-171-2/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* printing: increse log level for unreachable cups serversBjörn Jacke2015-03-051-2/+2
| | | | | | | | | | | | | this annoying messages hitting the logs very often on non-cups servers by default in log level 0 otherwise. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11133 Signed-off-by: Bjoern Jacke <bj@sernet.de> Reviewed-by: David Disseldorp <ddiss@samba.org> Autobuild-User(master): Björn Jacke <bj@sernet.de> Autobuild-Date(master): Thu Mar 5 14:38:42 CET 2015 on sn-devel-104
* printing: rework nt_printer_guid_store to return errorsAndreas Schneider2015-02-181-17/+32
| | | | | | | | | | | Callers can now choose whether or not to ignore errors. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11018 Pair-programmed-with: David Disseldorp <ddiss@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* printing: add nt_printer_guid_retrieve() helperDavid Disseldorp2015-02-181-0/+58
| | | | | | | | | | | | This function connects to the domain controller and retrieves the GUID for the corresponding printer DN. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11018 Pair-programmed-with: Andreas Schneider <asn@samba.org> Signed-off-by: David Disseldorp <ddiss@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* printing: split out printer DN and GUID retrievalDavid Disseldorp2015-02-181-72/+137
| | | | | | | | | | | This functions are used for printer publishing. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11018 Pair-programmed-with: Andreas Schneider <asn@samba.org> Signed-off-by: David Disseldorp <ddiss@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* printing/cups: pack requested-attributes with IPP_TAG_KEYWORDDavid Disseldorp2015-02-101-1/+1
| | | | | | | | | | | | | | | | | | The CUPS IPP_GET_JOBS requested-attributes array indicates which job attributes the caller would like in the cupsd response. Until now, Samba has packed these attributes with a IPP_TAG_NAME format tag. In recent versions of CUPS, this results in the IPP_GET_JOBS response only including the job-id and job-printer-uri fields, even with JobPrivateValues=none configured. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10808 Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Feb 10 01:38:58 CET 2015 on sn-devel-104
* lib: Split out write_data[_iov]Volker Lendecke2014-12-071-0/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Split out sys_[read|write] & friendsVolker Lendecke2014-12-071-0/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:vfs: add create tags to SMB_VFS_CREATEFILERalph Boehme2014-12-041-3/+6
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:printing: fix some const warnings in print_iprint.cStefan Metzmacher2014-11-251-6/+6
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:printing: Avoid compiler warning about unused labelKai Blin2014-11-251-0/+4
| | | | | | Signed-off-by: Kai Blin <kai@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* printer_list: don't leak lock_path onto talloc tosDavid Disseldorp2014-11-031-2/+9
| | | | | | | Also check for allocation failures. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* nt_printing: don't leak state_path onto talloc tosDavid Disseldorp2014-11-032-30/+80
| | | | | | | | 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>
* printing: add jobid_to_sysjob helper functionDavid Disseldorp2014-10-301-18/+52
| | | | | | | | | | | | 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>
* printer_list: fix talloc tos leak of tdb recordDavid Disseldorp2014-10-071-0/+1
| | | | | | | | | 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
* printing: don't leak cache_path onto talloc tosDavid Disseldorp2014-10-062-5/+25
| | | | | | | | 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>
* vfs3: Pass "lease" through SMB_VFS_CREATE_FILEVolker Lendecke2014-08-111-0/+3
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: split printer reload processingDavid Disseldorp2014-08-081-3/+97
| | | | | | | | | | | | | | | | | | | | 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 ac6604868d1325dd4c872dc0f6ab056d10ebaecf 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>
* printing: return last change time with pcap_cache_loaded()David Disseldorp2014-08-085-7/+13
| | | | | | | 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>
* printing: remove pcap_cache_add()David Disseldorp2014-08-082-11/+6
| | | | | | | | | | 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>
* printing: reload printer_list.tdb from in memory listDavid Disseldorp2014-08-086-34/+52
| | | | | | | | | 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>
* printing: only reload printer shares on client enumDavid Disseldorp2014-08-081-29/+5
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* printing: traverse_read the printer list for share updatesDavid Disseldorp2014-08-085-12/+17
| | | | | | | | | | | | | | | | | | | | | | | 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>
* lib: directory_create_or_exist() does not use "uid" parameterVolker Lendecke2014-07-282-5/+3
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Avoid double-free in get_print_db_bynameVolker Lendecke2014-07-081-2/+2
| | | | | | | | 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
* printing: fix purge of all print jobsDavid Disseldorp2014-05-211-4/+19
| | | | | | | | | | | 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>
* printing_cups: Call the msg_ctx destructor on exitVolker Lendecke2014-04-231-0/+1
| | | | | | | | 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>
* s3-spoolssd: Don't register spoolssd if epmd is not running.Andreas Schneider2014-02-271-17/+22
| | | | | | | https://bugzilla.samba.org/show_bug.cgi?id=10474 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3-printing: Fix obvious memory leak in printer_list_get_printer().Jeremy Allison2014-02-251-0/+1
| | | | | | | | | | | 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
* s3:printing: Fix a possible NULL dereference.Poornima Gurusiddaiah2014-02-241-1/+1
| | | | | | | | 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>
* spoolssd: Use only one messaging_context per processVolker Lendecke2014-02-191-1/+1
| | | | | | | | | 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>