summaryrefslogtreecommitdiffstats
path: root/source3/printing/printing.c
Commit message (Collapse)AuthorAgeFilesLines
* s3: only include gen_ndr headers where needed.Günther Deschner2010-05-061-0/+1
| | | | | | | | | | | | | | | | | This shrinks include/includes.h.gch by the size of 7 MB and reduces build time as follows: ccache build w/o patch real 4m21.529s ccache build with patch real 3m6.402s pch build w/o patch real 4m26.318s pch build with patch real 3m6.932s Guenther
* s3-spoolss: add support for SetJobInfo level 1 (for jobfile rename).Günther Deschner2010-04-281-1/+23
| | | | Guenther
* s3-lanman: remove unsupported print_job_set_place().Günther Deschner2010-04-281-10/+0
| | | | Guenther
* Second part of bug #7288 - SMB job IDs in CUPS job names wrong.Jeremy Allison2010-03-251-2/+0
| | | | | | Forgot to delete the overload of the smbjob bool. Jeremy.
* Fix bug #7288 - SMB job IDs in CUPS job names wrong.Jeremy Allison2010-03-251-19/+0
| | | | | | | | | | | | | | | | | | | | | | | 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.
* Try and fix bug #7233 - print fails with jobs >4GB from Win7 clients.Jeremy Allison2010-03-101-1/+1
| | | | | Remove an arbitrarty 4G B limit that *doesn't need to be there* ! Jeremy.
* s3: Fix a long-standing problem with recycled PIDsVolker Lendecke2010-03-101-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a samba server process dies hard, it has no chance to clean up its entries in locking.tdb, brlock.tdb, connections.tdb and sessionid.tdb. For locking.tdb and brlock.tdb Samba is robust by checking every time we read an entry from the database if the corresponding process still exists. If it does not exist anymore, the entry is deleted. This is not 100% failsafe though: On systems with a limited PID space there is a non-zero chance that between the smbd's death and the fresh access, the PID is recycled by another long-running process. This renders all files that had been locked by the killed smbd potentially unusable until the new process also dies. This patch is supposed to fix the problem the following way: Every process ID in every database is augmented by a random 64-bit number that is stored in a serverid.tdb. Whenever we need to check if a process still exists we know its PID and the 64-bit number. We look up the PID in serverid.tdb and compare the 64-bit number. If it's the same, the process still is a valid smbd holding the lock. If it is different, a new smbd has taken over. I believe this is safe against an smbd that has died hard and the PID has been taken over by a non-samba process. This process would not have registered itself with a fresh 64-bit number in serverid.tdb, so the old one still exists in serverid.tdb. We protect against this case by the parent smbd taking care of deregistering PIDs from serverid.tdb and the fact that serverid.tdb is CLEAR_IF_FIRST. CLEAR_IF_FIRST does not work in a cluster, so the automatic cleanup does not work when all smbds are restarted. For this, "net serverid wipe" has to be run before smbd starts up. As a convenience, "net serverid wipedbs" also cleans up sessionid.tdb and connections.tdb. While there, this also cleans up overloading connections.tdb with all the process entries just for messaging_send_all(). Volker
* s3: convert registry and printing code to TYPESAFE_QSORT()Andrew Tridgell2010-02-141-3/+2
|
* s3: "print_job_end" only looks at the sizeVolker Lendecke2009-11-291-2/+1
|
* s3: Pass the "fake dir create times" parameter to sys_*statVolker Lendecke2009-11-291-1/+2
| | | | Step 0 to restore it as a per-share paramter
* s3: forward MSG_DEBUG from smbd parent to all childrenAravind Srinivasan2009-06-221-0/+19
| | | | | | | | | | | | | | | | | | | Before 3.3, an smbcontrol debug message sent to the target "smbd" would actually be sent to all running processes including nmbd and winbindd. This behavior was changed in 3.3 so that the "smbd" target would only send a message to the process found in smbd.pid, while the "all" target would send a message to all processes. The ability to set the debug level of all processes within a single daemon, without specifying each pid is quite useful. This was implemented in winbindd in 065760ed. This patch does the same thing for smbd. Upon receiving a MSG_DEBUG the parent smbd will rebroadcast it to all of its children. The printing process has been added to the list of smbd child processes, and we now always track the number of smbd children regardless of the "max smbd processes" setting.
* s3: Allow child processes to exit gracefully if we are out of fdsMarc VanHeyningen2009-05-271-2/+3
| | | | | | | | | | 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>
* Introduce "struct stat_ex" as a replacement for SMB_STRUCT_STATVolker Lendecke2009-05-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces struct stat_ex { dev_t st_ex_dev; ino_t st_ex_ino; mode_t st_ex_mode; nlink_t st_ex_nlink; uid_t st_ex_uid; gid_t st_ex_gid; dev_t st_ex_rdev; off_t st_ex_size; struct timespec st_ex_atime; struct timespec st_ex_mtime; struct timespec st_ex_ctime; struct timespec st_ex_btime; /* birthtime */ blksize_t st_ex_blksize; blkcnt_t st_ex_blocks; }; typedef struct stat_ex SMB_STRUCT_STAT; It is really large because due to the friendly libc headers playing macro tricks with fields like st_ino, so I renamed them to st_ex_xxx. Why this change? To support birthtime, we already have quite a few #ifdef's at places where it does not really belong. With a stat struct that we control, we can consolidate the nanosecond timestamps and the birthtime deep in the VFS stat calls. At this moment it is triggered by a request to support the birthtime field for GPFS. GPFS does not extend the system level struct stat, but instead has a separate call that gets us the additional information beyond posix. Without being able to do that within the VFS stat calls, that support would have to be scattered around the main smbd code. It will very likely break all the onefs modules, but I think the changes will be reasonably easy to do.
* Hopefully fix the buildfarm. Add some debug level 10 messagesJeremy Allison2009-05-111-1/+7
| | | | | | | | I used to track down the vlp problem, change the vlp test printer not to use a static path of /tmp/vlp.tdb for the virtual print database (as this will eventually fill up). Cause it to use a virtual print database inside the cachepath. Jeremy.
* s3-printing: simplify print_queue helper functions and return WERROR.Günther Deschner2009-05-061-17/+10
| | | | Guenther
* Remove smb_mkstemp() - libreplace will now provide a secure mkstemp() ifJelmer Vernooij2009-04-201-1/+1
| | | | the system one is broken.
* s3:printing: use tevent_loop_wait() instead of manual loopingStefan Metzmacher2009-03-181-50/+6
| | | | metze
* s3:printing: use a fd event to monitor the pipe to the parentStefan Metzmacher2009-03-181-3/+23
| | | | metze
* s3-spoolss: make jobname a const char * in print_job_start().Günther Deschner2009-03-121-1/+1
| | | | Guenther
* Only copy sharename up from rap_to_pjobidVolker Lendecke2009-03-011-1/+3
| | | | | | | | | | | | | | Why?? :-) Another one of the little micro-optimizations that I just came across: If you allocate a variable in a sub-block like the "fstring sharename" in write_file(), gcc even with -O3 will allocate this variable unconditionally on the stack at the beginning of the routine. So with eliminating this fstring we cut 256 bytes of stack in a very hot code path writing to a file. It might make us a bit more cache-friendly. This would probably not be worth a second look if it involved larger code changes, but this one was just too simple to let it pass :-)
* s3: fix the build JOB_STATUS_BLOCKED -> JOB_STATUS_BLOCKED_DEVQMichael Adam2009-02-261-1/+1
| | | | | | Günther, please check... Michael
* S3: Stop creating SMBD cores when failing to create a pipe.todd stecher2009-02-181-3/+7
| | | | | | This was uncovered when the MAX FD limit was hit, causing an instant core and invoking error reporting. This fix causes SMBD to exit, but without building a core.
* s3-spoolss: remove more whitespace.Günther Deschner2009-02-101-135/+135
| | | | Guenther
* s3:smbd: use signal events for SIGTERM, SIGHUP and SIGCHLDStefan Metzmacher2009-01-271-15/+3
| | | | metze
* s3:printing: handle tevent_context events in the sys_select() callStefan Metzmacher2009-01-221-16/+42
| | | | metze
* s3: put printing/ under cache_dir, not lock_dirMichael Adam2009-01-161-2/+2
| | | | Michael
* clean event context after child is forked.Bo Yang2009-01-051-1/+2
| | | | Signed-off-by: Stefan Metzmacher <metze@samba.org>
* Fix bug #5688 LPQ process is orphaned if socket address parameter is invalidSATOH Fumiyasu2008-12-091-6/+33
|
* Fix nonempty blank linesVolker Lendecke2008-12-071-5/+5
|
* Use {u,}int64_t instead of SMB_BIG_{U,}INT.Jelmer Vernooij2008-10-141-2/+2
|
* Allow %u parameters for print job username - use advanced subJim McDonough2008-07-161-3/+5
| | | | | | Based on 3.0 and 3.2 patch from Bo Yang <boyang@novell.com> Bo, please verify this version works for you. (This used to be commit 9e6760cfeaf77e80df3b84004090d934f3c2d574)
* Change print_access_check to take auth_serversupplied_info instead of ↵Volker Lendecke2008-06-261-45/+48
| | | | | | | current_user Reason: This is the main user of p->current_user which I would like to remove (This used to be commit fd43059b3dfa8cdac9814de1c76f963ba5de9bcb)
* Remove "userdom_struct user" from "struct user_struct"Volker Lendecke2008-05-051-3/+6
| | | | (This used to be commit 420de035237bb08bc470c9eb820f3da2edaa6805)
* Fix CLEAR_IF_FIRST handling of messages.tdbVolker Lendecke2008-04-231-1/+1
| | | | | | | | We now open messages.tdb even before we do the become_daemon. become_daemon() involves a fork and an immediate exit of the parent, thus the parent_is_longlived argument must be set to false in this case. The parent is not really long lived :-) (This used to be commit 4f4781c6d17fe2db34dd5945fec52a7685448aec)
* printing: call reinit_after_fork() in the backgroundqueue processStefan Metzmacher2008-04-181-0/+5
| | | | | metze (This used to be commit 9adb675a86e81c90e2bddfe984b5ac8f201fec75)
* Fix typos.Karolin Seeger2008-04-091-1/+1
| | | | | Karolin (This used to be commit 6cee34703503fbf3629057345fe221b866560648)
* use tdb_wipe_all() instead of tdb_wipe() - it is faster...Michael Adam2008-03-261-1/+1
| | | | | Michael (This used to be commit 3d2fdcd50fdbfb66a14360516836445d47eceeb0)
* util_tdb: add a wrapper tdb_wipe() for traverse with tdb_traverse_delete_fn().Michael Adam2008-03-251-1/+1
| | | | | | | | Replace all callers of traverse with this tdb_traverse_delete_fn() and don't export tdb_traverse_delete_fn() anymore. Michael (This used to be commit d4be4e30cd8c3bdc303da30e42280f892a45a8c9)
* Fix some typos.Karolin Seeger2008-02-081-1/+1
| | | | | Karolin (This used to be commit 2bec0a1fb7857e6fb8ec15e5f597b2d4125f105b)
* Remove a globalVolker Lendecke2007-12-281-9/+15
| | | | (This used to be commit 515f6a8cff7e28b0e98136f3214ef52512cfaf37)
* Tiny simplificationsVolker Lendecke2007-12-101-1/+1
| | | | | | | locking.c:open_read_only was unused don't export the silly boolean flag locking_init(bool read_only) (This used to be commit 2f3c865707010bc7c463a02782dbee3dc2479da1)
* remove a staticVolker Lendecke2007-12-101-12/+18
| | | | (This used to be commit 0006b14d38b80562458b37f616c9b68a3168fe64)
* Change tdb_unpack "P" to return a malloc'ed string ratherJeremy Allison2007-12-031-3/+7
| | | | | | | than expect a pstring space to put data into. Fix the (few) callers. Jeremy. (This used to be commit 7722a7d2c63f84b8105aa775b39f0ceedd4ed513)
* Remove pstrcpy I missed.Jeremy Allison2007-11-201-1/+0
| | | | | Jeremy. (This used to be commit f5701756154e4e113414d8dd6c850685a2594801)
* Remove more pstring. Unify talloc_sub functions to makeJeremy Allison2007-11-191-30/+51
| | | | | | | them a better match for replacing string_sub. Remove more unused code. Jeremy. (This used to be commit ae7885711f504f1442335f09088cbe149a7e00f9)
* RIP BOOL. Convert BOOL -> bool. I found a few interestingJeremy Allison2007-10-181-37/+37
| | | | | | | | 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)
* r25399: Excise uint - > uint32 (where appropriate) or unsigned int.Jeremy Allison2007-10-101-1/+1
| | | | | Jeremy. (This used to be commit b4ee924000f4a21b16a70e08e58331d209c4d114)
* 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)
* r23168: Move the lp_max_connections() into service.c.Volker Lendecke2007-10-101-1/+1
| | | | (This used to be commit 4afe37d431b6eb475769a2057025da9aa8d1bb14)