summaryrefslogtreecommitdiffstats
path: root/source3/printing
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* s3: printing: Fix problem with server taking too long to respond to a ↵Jeremy Allison2014-02-182-2/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* param: rename lp function and variable from "minprintspace" to "min_print_space"Garming Sam2014-02-071-2/+2
| | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* param: rename lp function and variable from "queueresumecommand" to ↵Garming Sam2014-02-071-1/+1
| | | | | | | | "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>
* param: rename lp function and variable from "queuepausecommand" to ↵Garming Sam2014-02-071-1/+1
| | | | | | | | "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>
* param: rename lp function and variable from "printcommand" to "print_command"Garming Sam2014-02-071-1/+1
| | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* param: rename lp function and variable from "max_reported_jobs" to ↵Garming Sam2014-02-071-2/+2
| | | | | | | | "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>
* param: rename lp function and variable from "lprmcommand" to "lprm_command"Garming Sam2014-02-071-2/+2
| | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* param: rename lp function and variable from "lpresumecommand" to ↵Garming Sam2014-02-071-1/+1
| | | | | | | | "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>
* param: rename lp function and variable from "lpqcommand" to "lpq_command"Garming Sam2014-02-071-2/+2
| | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* param: rename lp function and variable from "lpqcachetime" to "lpq_cache_time"Garming Sam2014-02-071-2/+2
| | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* param: rename lp function and variable from "lppausecommand" to ↵Garming Sam2014-02-071-1/+1
| | | | | | | | "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>
* 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>
* loadparm: rename lp[cfg]_print_ok to lp[cfg]_printable for consistency with docsMichael Adam2014-02-034-7/+7
| | | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* loadparm: rename lp[cfg]_pathname to lp[cfg]_path for consistency with docsMichael Adam2014-02-033-10/+10
| | | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* s3:printing fix a compiler warningChristian Ambach2013-12-121-1/+1
| | | | | | | about a potentially uninitialized variable Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* printing: use DEBUG instead of sys_adminlogDavid Disseldorp2013-11-201-24/+12
| | | | | | | | 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>
* printing: fix double space in debug statementDavid Disseldorp2013-11-201-1/+1
| | | | | Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* printing: return WERROR from print_access_checkDavid Disseldorp2013-11-202-56/+47
| | | | | | | | | | 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>
* printing: always store sytem job-ID in queue stateDavid Disseldorp2013-11-181-21/+22
| | | | | | | | | | | | | | | | | | | 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
* spoolss: return the spoolss job ID in notificationsDavid Disseldorp2013-11-181-1/+1
| | | | | | | | | | | | | | | | | 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>
* s3-rpc_cli: pass down ndr_interface_table to rpc_pipe_open_interface().Günther Deschner2013-08-052-3/+3
| | | | | | | | Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3-printing: avoid KRB5CCNAME overwrite in printer publishing (Bug #7444).Günther Deschner2013-07-191-0/+13
| | | | | | | | | | 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
* Fix bug 9900: is_printer_published GUID retrievalDavid Disseldorp2013-06-031-47/+82
| | | | | | | | | | | | | 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>
* printing: explicitly clear PUBLISHED attributeDavid Disseldorp2013-06-031-1/+1
| | | | | | | | | 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>
* bug 9830: fix panic in nt_printer_publish_adsDavid Disseldorp2013-04-251-2/+8
| | | | | | | | | | | 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
* smbd: Convert print_spool_open to synthetic_smb_fnameVolker Lendecke2013-04-171-3/+3
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Convert driver_unlink_internals to synthetic_smb_fnameVolker Lendecke2013-04-171-3/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* spoolssd: Cast getpid() result to unsigned int for GNU/Solaris buildAndrew Bartlett2013-03-151-1/+1
| | | | Reviewed-by: Jeremy Allison <jra@samba.org>
* s3-net: Add encoding=<CP> to 'net printing migrate'.Andreas Schneider2013-03-153-6/+20
| | | | | | | 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>
* Make sure to set umask() before calling mkstemp().Andreas Schneider2013-03-062-0/+7
| | | | | | | 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
* s3-daemons: Set the comment field of the daemons.Andreas Schneider2013-03-052-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* s3:printing: s/event_add_fd/tevent_add_fd and s/EVENT_FD_/TEVENT_FD_Stefan Metzmacher2013-02-191-2/+2
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:printing: s/struct fd_event/struct tevent_fdStefan Metzmacher2013-02-191-2/+2
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:printing: s/struct event_context/struct tevent_contextStefan Metzmacher2013-02-192-4/+4
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* spoolss: make spoolss deal with ndr64 StartDocPrinter by using proper ↵Günther Deschner2013-01-241-8/+15
| | | | | | | | | container object. Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* printing: Free talloc_stackframe() on all exit pathsAndrew Bartlett2013-01-191-0/+2
| | | | Reviewed-by: Stefan Metzmacher <metze@samba.org>
* BUG 9378: Add extra attributes for AD printer publishing.David Disseldorp2013-01-181-1/+85
| | | | | | | | | | 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
* printing: Remove invalid free from error path.David Disseldorp2013-01-181-1/+0
| | | | Reviewed-by: Andreas Schneider <asn@samba.org>
* printing: Create default architecture directories on init.Andreas Schneider2013-01-171-0/+59
| | | | | | | 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
* spoolss: make spoolss deal with ndr64 ULONG_PTR of devmode_ptr and secdesc_ptr.Günther Deschner2013-01-171-2/+0
| | | | | | | Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* smbd: Fix calls to create_conn_struct_cwd to be correctly indented.Andrew Bartlett2013-01-071-18/+18
| | | | | | | | These are whitespace changes only, left out of the previous commit to preserve clarity. Andrew Bartlett. Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Split create_conn_struct into a fn that does not change the working dirAndrew Bartlett2013-01-071-3/+3
| | | | | | | | | | | 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>
* s3-printing: Correctly create the printing cache path.Andreas Schneider2012-12-121-1/+6
| | | | | | | Found by Coverity. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* s3-printing: Don't call talloc_free on an uninitialized pointer.Andreas Schneider2012-12-121-1/+1
| | | | | | | Found by Coverity. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>