summaryrefslogtreecommitdiff
path: root/source3/printing/printing.c
AgeCommit message (Collapse)AuthorFilesLines
2010-08-08s3: Lift the smbd_messaging_context from print_queue_purgeVolker Lendecke1-2/+3
2010-08-08s3: Lift the smbd_messaging_context from print_queue_resumeVolker Lendecke1-2/+3
2010-08-08s3: Lift the smbd_messaging_context from print_queue_pauseVolker Lendecke1-2/+3
2010-08-08s3: Lift the smbd_messaging_context from print_job_startVolker Lendecke1-2/+2
2010-08-08s3: Lift the smbd_messaging_context from print_job_checksVolker Lendecke1-4/+5
2010-08-08s3: Lift the smbd_messaging_context from print_job_resumeVolker Lendecke1-3/+4
2010-08-08s3: Lift the smbd_messaging_context from print_job_pauseVolker Lendecke1-3/+4
2010-08-08s3: Lift the smbd_messaging_context from print_job_deleteVolker Lendecke1-1/+2
2010-08-08s3: Lift the smbd_messaging_context from print_time_access_checkVolker Lendecke1-1/+2
2010-08-08s3: Lift the smbd_messaging_context from print_access_checkVolker Lendecke1-7/+13
2010-08-06s3-netlogon: remove global include of netlogon.h.Günther Deschner1-0/+1
This reduces precompiled headers by another 4 MB and also slightly speeds up the build. Guenther
2010-07-31s3-build: avoid to globally include printing and spoolss headers.Günther Deschner1-0/+2
This shrinks precompiled headers by 3MB and will slightly speed up any build. Guenther
2010-07-27s3-printing: Added automatic migration of printing tdbs.Andreas Schneider1-0/+83
Signed-off-by: Jim McDonough <jmcd@samba.org>
2010-07-27s3-printing: Removed unused function print_job_fd().Simo Sorce1-15/+0
Signed-off-by: Jim McDonough <jmcd@samba.org>
2010-07-27s3-spoolss: Use WERROR for print_job_delete.Simo Sorce1-18/+20
And also check for PJOB_SMBD_SPOOLING in print_job_write. Signed-off-by: Jim McDonough <jmcd@samba.org>
2010-07-27s3-printing: Handled case when smbd spools a file on behalf of spoolss.Simo Sorce1-29/+97
2010-07-27s3-printing: Made print_job_start more robust.Simo Sorce1-81/+144
Explicitly return ntstatus errors instead of relying on elusive errno. Split the function to make it easier to follow. Signed-off-by: Jim McDonough <jmcd@samba.org>
2010-07-27s3-smbd: Added code to print via spoolss.Simo Sorce1-1/+1
2010-07-27s3-printing: Convert print_time_access_check.Simo Sorce1-1/+1
use spoolss_PrintInfo2 and winreg calls Signed-off-by: Jim McDonough <jmcd@samba.org>
2010-07-27s3-spoolss: Migrated NT_DEVICEMODE to spoolss_DeviceMode.Simo Sorce1-11/+11
Signed-off-by: Jim McDonough <jmcd@samba.org>
2010-07-04s3: Pass the new server_id through reinit_after_forkVolker Lendecke1-3/+6
2010-07-04s3: Fix some nested extern warningsVolker Lendecke1-2/+3
2010-07-04s3: Remove serverid_[de]register_selfVolker Lendecke1-2/+3
This removes some deep references to procid_self()
2010-06-13s3: Remove the pointless PRINTERNAME macroVolker Lendecke1-6/+6
2010-06-10s3:misc make use of server_[event/messaging]_context directlyAndreas Schneider1-6/+7
Untangle these functions from smbd specific dependencies so they can be freely used in multiple servers.
2010-05-28s3:auth use info3 in auth_serversupplied_infoSimo Sorce1-1/+1
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-06s3: only include gen_ndr headers where needed.Günther Deschner1-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
2010-04-28s3-spoolss: add support for SetJobInfo level 1 (for jobfile rename).Günther Deschner1-1/+23
Guenther
2010-04-28s3-lanman: remove unsupported print_job_set_place().Günther Deschner1-10/+0
Guenther
2010-03-25Second part of bug #7288 - SMB job IDs in CUPS job names wrong.Jeremy Allison1-2/+0
Forgot to delete the overload of the smbjob bool. Jeremy.
2010-03-25Fix bug #7288 - SMB job IDs in CUPS job names wrong.Jeremy Allison1-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.
2010-03-10Try and fix bug #7233 - print fails with jobs >4GB from Win7 clients.Jeremy Allison1-1/+1
Remove an arbitrarty 4G B limit that *doesn't need to be there* ! Jeremy.
2010-03-10s3: Fix a long-standing problem with recycled PIDsVolker Lendecke1-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
2010-02-14s3: convert registry and printing code to TYPESAFE_QSORT()Andrew Tridgell1-3/+2
2009-11-29s3: "print_job_end" only looks at the sizeVolker Lendecke1-2/+1
2009-11-29s3: Pass the "fake dir create times" parameter to sys_*statVolker Lendecke1-1/+2
Step 0 to restore it as a per-share paramter
2009-06-22s3: forward MSG_DEBUG from smbd parent to all childrenAravind Srinivasan1-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.
2009-05-27s3: Allow child processes to exit gracefully if we are out of fdsMarc VanHeyningen1-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>
2009-05-26Introduce "struct stat_ex" as a replacement for SMB_STRUCT_STATVolker Lendecke1-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.
2009-05-11Hopefully fix the buildfarm. Add some debug level 10 messagesJeremy Allison1-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.
2009-05-06s3-printing: simplify print_queue helper functions and return WERROR.Günther Deschner1-17/+10
Guenther
2009-04-20Remove smb_mkstemp() - libreplace will now provide a secure mkstemp() ifJelmer Vernooij1-1/+1
the system one is broken.
2009-03-18s3:printing: use tevent_loop_wait() instead of manual loopingStefan Metzmacher1-50/+6
metze
2009-03-18s3:printing: use a fd event to monitor the pipe to the parentStefan Metzmacher1-3/+23
metze
2009-03-12s3-spoolss: make jobname a const char * in print_job_start().Günther Deschner1-1/+1
Guenther
2009-03-01Only copy sharename up from rap_to_pjobidVolker Lendecke1-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 :-)
2009-02-26s3: fix the build JOB_STATUS_BLOCKED -> JOB_STATUS_BLOCKED_DEVQMichael Adam1-1/+1
Günther, please check... Michael
2009-02-18S3: Stop creating SMBD cores when failing to create a pipe.todd stecher1-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.
2009-02-10s3-spoolss: remove more whitespace.Günther Deschner1-135/+135
Guenther
2009-01-27s3:smbd: use signal events for SIGTERM, SIGHUP and SIGCHLDStefan Metzmacher1-15/+3
metze