summaryrefslogtreecommitdiff
path: root/source3/printing/printer_list.c
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* 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: traverse_read the printer list for share updatesDavid Disseldorp2014-08-081-6/+11
| | | | | | | | | | | | | | | | | | | | | | | 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>
* 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
* dbwrap: add a dbwrap_flags argument to db_open()Michael Adam2014-02-071-1/+2
| | | | | | | | | | 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>
* s3fs-printing: Simplify the comment and location handling.Andreas Schneider2012-10-111-13/+17
| | | | | Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Thu Oct 11 18:49:15 CEST 2012 on sn-devel-104
* s3-printing: Increase debug level for info that the db is empty.Andreas Schneider2012-09-201-1/+2
| | | | | Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Thu Sep 20 12:01:48 CEST 2012 on sn-devel-104
* s3-printing: fix crash in printer_list_set_printer()David Disseldorp2012-02-151-1/+1
| | | | | | | | | | | | | | | | 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
* s3: Add a "lock_order" argument to db_openVolker Lendecke2012-01-181-1/+1
| | | | | | | 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.
* s3:printing: convert printer_list to use dbwrap wrapper functionsMichael Adam2011-10-111-11/+20
| | | | Avoid direct use of the db_record and db_context structs.
* s3:dbwrap: convert dbwrap_fetch(), dbwrap_fetch_bystring() and ↵Michael Adam2011-10-111-6/+4
| | | | dbwrap_fetch_bystring_upper() to NTSTATUS
* s3:dbwrap: move all .c and .h files of dbwrap to lib/dbwrap/Michael Adam2011-07-291-1/+1
| | | | | Autobuild-User: Michael Adam <obnox@samba.org> Autobuild-Date: Fri Jul 29 13:34:22 CEST 2011 on sn-devel-104
* s3:dbwrap: move db_open() to a file dbwrap_open.c of its own.Michael Adam2011-07-291-0/+1
| | | | | | Also start new folder lib/dbwrap/ where dbwrap_open.c is stored and make the fallbacke implementation functoins non-static and create a dbwrap_private.h header file that contains their prototypes.
* s3-printing: Get the location info from cups.Günther Deschner2011-05-161-8/+34
| | | | Signed-off-by: Günther Deschner <gd@samba.org>
* s3: only include tdb headers where needed.Günther Deschner2011-05-061-0/+1
| | | | Guenther
* s3-includes: only include system/filesys.h when needed.Günther Deschner2011-03-301-0/+1
| | | | Guenther
* s3-printing: remove printer_list_need_refreshDavid Disseldorp2011-01-071-26/+0
| | | | | | | | | | printer_list_need_refresh() was used previously to ensure one smbd process did not attempt to update the printer_list tdb during or soon after update by another smbd. It is no longer needed, as pcap updates are now only performed by the parent smbd process following startup, SIGHUP, config update or printcap cache time expiry.
* s3-printing: fix printer_list_traverse()David Disseldorp2010-12-201-1/+1
| | | | | | | | | The tdb traverse function returns the number of elements traversed, or less than zero on error, printer_list_traverse() is incorrectly checking for non-zero return. Autobuild-User: Andreas Schneider <asn@samba.org> Autobuild-Date: Mon Dec 20 18:44:41 CET 2010 on sn-devel-104
* s3: Remove talloc_autofree_context() from get_printer_list_db()Volker Lendecke2010-10-081-1/+1
| | | | Another db that does not need explicit closing
* s3-printing: skip metadata entry when traversing printerlist.Günther Deschner2010-09-291-0/+5
| | | | | | | | | We were creating a new printer (with a very broken name) out of the lasttimestamp entry all the time. Simo, please check. Guenther
* Change to using TDB_INCOMPATIBLE_HASH (the jenkins hash) on allJeremy Allison2010-09-271-1/+1
| | | | | | | | | | TDB_CLEAR_IF_FIRST tdb's. For tdb's like gencache where we open without CLEAR_IF_FIRST and then with CLEAR_IF_FIRST if corrupt this is still safe to use as if opening an existing tdb the new hash will be ignored - it's only used on creating a new tdb not opening an old one. Jeremy.
* s3/printing: avoid a possible race condition in the cache timeoutBjörn Jacke2010-09-161-2/+1
|
* s3/printing: make clock jump save and use monotonic time for cache timeoutBjörn Jacke2010-09-151-13/+14
|
* s3-printing: Add method to skip refresh if just happned.Simo Sorce2010-09-151-0/+26
| | | | | | | This way if multiple process try to refresh at the same time we don't do it over and over again. Signed-off-by: Andreas Schneider <asn@cynapses.org>
* s3-printing: Added a printer list database.Simo Sorce2010-09-151-0/+389
Signed-off-by: Andreas Schneider <asn@cynapses.org>