summaryrefslogtreecommitdiff
path: root/source3/printing/print_generic.c
Commit message (Collapse)AuthorAgeFilesLines
* source3: move lib/substitute.c functions out of proto.hRalph Boehme2021-11-111-0/+1
| | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14897 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* printing: Simplify calling print commandsVolker Lendecke2021-05-111-5/+5
| | | | | | | We have fstr_sprintf for this Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* printing: Fix typosVolker Lendecke2021-03-241-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:param: make "servicename" a substituted optionRalph Boehme2019-11-271-1/+1
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* printing: use lpcfg_substituted_string() in print_run_command()Ralph Boehme2019-11-271-1/+3
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* smbdotconf: mark "printername" with substitution="1"Ralph Boehme2019-11-271-6/+18
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3:printing: Fix %J substitionRalph Boehme2019-11-071-8/+11
| | | | | | | | | | | | | | | | | | | | | print_run_command() uses lp_print_command() which internally performs basic substition by calling talloc_sub_basic(). As a result. any of the variables in the "basic set", including "%J" are already substituted. To prevent the unwanted subtitution, we declare all affected configuration options as const, which disabled the basic substition. As a result print_run_command() can run manual substitution on all characters, including %J, in the variadic argument list *before* calling lp_string() to run basic substition which we had disabled before with the const. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13745 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Thu Nov 7 16:01:21 UTC 2019 on sn-devel-184
* s3:printing: add a DEBUG statementRalph Boehme2019-11-071-0/+2
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13745 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3: rename talloc_sub_advanced() to talloc_sub_full()Ralph Boehme2019-11-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently have the following substitution functions: talloc_sub_basic() talloc_sub_advanced() talloc_sub_basic() currently substitutes a subset of talloc_sub_advanced(). We'll need a function X that only substitutes what talloc_sub_advanced() substitutes *without* what talloc_sub_basic() does. To get there rename talloc_sub_advanced() to talloc_sub_full(). A subsequent commit will then bring back talloc_sub_advanced() as described above. Examples with fictional replacement letters A and B. Currently: talloc_sub_basic: A talloc_sub_advanced: AB New: talloc_sub_basic: A talloc_sub_advanced: B talloc_sub_full: AB BUG: https://bugzilla.samba.org/show_bug.cgi?id=13745 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* printing: Avoid an "extern current_user"Volker Lendecke2017-10-271-2/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Update smbrun to allow for settings environment variables.Trever L. Adams2016-10-131-1/+1
| | | | | | | | | Signed-off-by: Trever L. Adams <trever.adams@gmail.com> Reviewed-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Oct 13 04:26:26 CEST 2016 on sn-devel-144
* 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 "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 "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>
* s3-printing: fix bug 9123 lprng job tracking errorsDavid Disseldorp2012-08-291-1/+1
| | | | | | | | | | | | The lprng printing back-end is truncating the print job filename in the lpq output, which means that Samba is not able to determine the back-end job ID for a newly submitted print job. Remove the unneeded spoolss job ID from the print job file name to ensure the job filename is not truncated. Also log these warnings at a higher log level. Autobuild-User(master): David Disseldorp <ddiss@samba.org> Autobuild-Date(master): Wed Aug 29 14:25:13 CEST 2012 on sn-devel-104
* loadparm: make the source3/ lp_ functions take an explicit TALLOC_CTX *.Rusty Russell2012-07-181-13/+13
| | | | | | | | | | 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>
* s3-printing: fill print_generic sysjob id on job submissionDavid Disseldorp2012-06-261-57/+88
| | | | | | | | | Change the generic print backend to fill the printing backend job identifier (sysjob) on submission of a new job. This is needed to ensure correct mapping of spoolss jobs and entries in the backend print queue. This and the last 13 commits attempt to address bug 8719.
* s3-printing: pass lpq command to job_submitDavid Disseldorp2012-06-261-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.
* Change sys_getcd() to take no arguments and always return malloc'ed memory ↵Jeremy Allison2011-06-011-8/+8
| | | | | | (or NULL). Part of the efforts to remove PATH_MAX on modern systems.
* s3: Remove the pointless PRINTERNAME macroVolker Lendecke2010-06-131-5/+7
|
* Fix more asprintf warnings and some error path errors.Jeremy Allison2008-12-231-1/+3
| | | | Jeremy.
* Use common util_file code.Jelmer Vernooij2008-10-121-3/+3
|
* Cope with changed signature of http_timestring().Jelmer Vernooij2008-10-111-1/+1
|
* Adding missing calls to va_end().Tim Potter2008-01-271-0/+4
| | | | | | | | | Just a small commit to get a handle on this git thingy. This patch fixes some missing calls to va_end() to match various calls to va_start() and VA_COPY(). Tim. (This used to be commit ec367f307dff7948722b9ac97beb960efd91991f)
* Remove pstring from printing/*.c except for theJeremy Allison2007-11-211-35/+77
| | | | | | | tdb_unpack requirement (I'll be making that an allocating interface later). Jeremy. (This used to be commit d2ee75326ac291ab4f1860075ba35f58703c7d9d)
* RIP BOOL. Convert BOOL -> bool. I found a few interestingJeremy Allison2007-10-181-1/+1
| | | | | | | | 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)
* r23784: use the GPLv3 boilerplate as recommended by the FSF and the license textAndrew Tridgell2007-10-101-2/+1
| | | | (This used to be commit b0132e94fc5fef936aa766fb99a306b3628e9f07)
* r23779: Change from v2 or later to v3 or later.Jeremy Allison2007-10-101-1/+1
| | | | | Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3)
* r22852: merge fixes for CVE-2007-2446 and CVE-2007-2447 to all branchesGerald Carter2007-10-101-1/+1
| | | | (This used to be commit f65214be68c1a59d9598bfb9f3b19e71cc3fa07b)
* r20124: clean up nested extern declaration warningsHerb Lewis2007-10-101-3/+2
| | | | (This used to be commit ac3eb7813e33b9a2e78c9158433f7ed62c3b62bb)
* r16945: Sync trunk -> 3.0 for 3.0.24 code. Still needJeremy Allison2007-10-101-2/+9
| | | | | | | | to do the upper layer directories but this is what everyone is waiting for.... Jeremy. (This used to be commit 9dafb7f48ca3e7af956b0a7d1720c2546fc4cfb8)
* r16393: Klocwork #1164. Null deref.Jeremy Allison2007-10-101-1/+1
| | | | | Jeremy. (This used to be commit c9a4ce51ed85686a35f350f4681b95d68adebbd6)
* r14023: My last bug fix still left a potential null deref.Jeremy Allison2007-10-101-8/+9
| | | | | | C- "must try harder" :-). Jeremy. (This used to be commit 9c55bf74ca28530045c5cb3cbfffad242039ca75)
* r14003: Clarify code that lead to Coverity report #13.Jeremy Allison2007-10-101-12/+15
| | | | | | Not a bug, but better to remove false positives. Jeremy. (This used to be commit f9a75d76546bc4618736f0d48646e77d7572db25)
* r13316: Let the carnage begin....Gerald Carter2007-10-101-1/+1
| | | | | Sync with trunk as off r13315 (This used to be commit 17e63ac4ed8325c0d44fe62b2442449f3298559f)
* r10656: BIG merge from trunk. Features not copied overGerald Carter2007-10-101-4/+4
| | | | | | | | * \PIPE\unixinfo * winbindd's {group,alias}membership new functions * winbindd's lookupsids() functionality * swat (trunk changes to be reverted as per discussion with Deryck) (This used to be commit 939c3cb5d78e3a2236209b296aa8aba8bdce32d3)
* r4088: Get medieval on our ass about malloc.... :-). Take control of all our ↵Jeremy Allison2007-10-101-1/+1
| | | | | | | | | | allocation functions so we can funnel through some well known functions. Should help greatly with malloc checking. HEAD patch to follow. Jeremy. (This used to be commit 620f2e608f70ba92f032720c031283d295c5c06a)
* r3067: patch based on volker's initial work in trunk that fixes the queu ↵Gerald Carter2007-10-101-45/+44
| | | | | | update problem when using the background daemon (This used to be commit de7af09e727e744aa27af85ef7c0f73ed5c1550a)
* a small include file rearrangement that doesn't affect normalAndrew Tridgell2003-11-121-0/+1
| | | | | | compilation, but that allows Samba3 to take advantage of pre-compiled headers in gcc if available. (This used to be commit b3e024ce1da7c7e24fcacd8a2964dd2e4562ba39)
* Fix more 64-bit printf warnings.Tim Potter2003-11-031-1/+1
| | | | (This used to be commit 23443e3aa079710221557e18158d0ddb8ff48a36)
* Ensure print queue array is zeroed out before returning.Jeremy Allison2003-04-091-0/+1
| | | | | Jeremy. (This used to be commit f0fac6a1e3574d2d0419968b8e806b5de91f5a81)
* updated the 3.0 branch from the head branch - ready for alpha18Andrew Tridgell2002-07-151-5/+3
| | | | (This used to be commit 03ac082dcb375b6f3ca3d810a6a6367542bc23ce)
* Merge JohnR's fix.Jeremy Allison2002-03-191-5/+10
| | | | | Jeremy. (This used to be commit d5fd1fd859cec3076d2f01ed234314ea8d80a753)
* Removed version number from file header.Tim Potter2002-01-301-2/+1
| | | | | Changed "SMB/Netbios" to "SMB/CIFS" in file header. (This used to be commit 6a58c9bd06d0d7502a24bf5ce5a2faf0a146edfa)
* Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.Tim Potter2001-10-021-2/+0
| | | | (This used to be commit 2d0922b0eabfdc0aaf1d0797482fef47ed7fde8e)
* strchr and strrchr are macros when compiling with optimisation in gcc, so we ↵Andrew Tridgell2001-07-041-1/+1
| | | | | | can't redefine them. damn. (This used to be commit c41fc06376d1a2b83690612304e85010b5e5f3cf)
* The big character set handling changeover!Andrew Tridgell2001-07-041-5/+1
| | | | | | | | This commit gets rid of all our old codepage handling and replaces it with iconv. All internal strings in Samba are now in "unix" charset, which may be multi-byte. See internals.doc and my posting to samba-technical for a more complete explanation. (This used to be commit debb471267960e56005a741817ebd227ecfc512a)
* configure:Jeremy Allison2001-04-141-15/+7
| | | | | | | | | | | | | | | | | | | | | | | configure.in: include/config.h.in: include/profile.h: smbd/vfs-wrap.c: smbd/vfs.c: Added fchmod and fchown to VFS (sorry Gerald - but we needed them anyway). smbd/dosmode.c: smbd/files.c: printing/printfsp.c: smbd/close.c: smbd/open.c: Fixed "dos filemode" correctly so there are no race conditions. Forces test of open of file O_WRONLY before allowing fchmod as root. Afterwards, calls standard close function that preserves POSIX locks due to POSIX-me-harder braindamage. :-). Andrew please review this code. Also - in removing the tmpdir param in smbrun an extra NULL parameter was missed in each print_run_command() call (which is a varargs fn.). Now fixed. Jeremy. (This used to be commit 32397e5bc6d995ce7ca37c82d6aedc1e5b1b6fbd)