summaryrefslogtreecommitdiff
path: root/source3/printing/printing.c
AgeCommit message (Collapse)AuthorFilesLines
2007-10-10r23168: Move the lp_max_connections() into service.c.Volker Lendecke1-1/+1
(This used to be commit 4afe37d431b6eb475769a2057025da9aa8d1bb14)
2007-10-10r23167: Remove an unused parameterVolker Lendecke1-1/+1
(This used to be commit 3452a870d58cdddf03ddf6ee698bca8416e05cbf)
2007-10-10r23055: Rewrite messages.c to use auto-generated marshalling in the tdb. I'mVolker Lendecke1-1/+1
doing this because for the clustering the marshalling is needed in more than one place, so I wanted a decent routine to marshall a message_rec struct which was not there before. Tridge, this seems about the same speed as it used to be before, the librpc/ndr overhead in my tests was under the noise. Volker (This used to be commit eaefd00563173dfabb7716c5695ac0a2f7139bb6)
2007-10-10r22954: More messaging_registerVolker Lendecke1-8/+10
(This used to be commit 9b8df24107ffe3016031e5257c5680689f061886)
2007-10-10r22895: Convert some more calls from message_send_buf to messaging_send_bufVolker Lendecke1-2/+3
(This used to be commit c8b98273406242a89a7e5d1fb5d79120ebe5822a)
2007-10-10r22868: Replace some message_send_pid calls with messaging_send_pid calls. MoreVolker Lendecke1-1/+2
tomorrow. (This used to be commit 74fa57ca5d7fa8eace72bbe948a08a0bca3cc4ca)
2007-10-10r22747: Fix some C++ warningsVolker Lendecke1-1/+1
(This used to be commit a66a04e9f11f6c4462f2b56b447bae4eca7b177c)
2007-10-10r22736: Start to merge the low-hanging fruit from the now 7000-line cluster ↵Volker Lendecke1-1/+1
patch. This changes "struct process_id" to "struct server_id", keeping both is just too much hassle. No functional change (I hope ;-)) Volker (This used to be commit 0ad4b1226c9d91b72136310d3bbb640d2c5d67b8)
2007-10-10r22009: change TDB_DATA from char * to unsigned char *Stefan Metzmacher1-17/+17
and fix all compiler warnings in the users metze (This used to be commit 3a28443079c141a6ce8182c65b56ca210e34f37f)
2007-10-10r21988: make use of string_tdb_data()Stefan Metzmacher1-8/+5
to avoid creating the TDB_DATA struct from strings "by hand" metze (This used to be commit 2f52df71039befff8646aa67c1123df7be3591d2)
2007-10-10r21446: Karolins "printjob username"Volker Lendecke1-1/+5
(This used to be commit 19ee6779255a269830fa8ee51468a4738dadf942)
2007-10-10r21064: The core of this patch isVolker Lendecke1-2/+4
void message_register(int msg_type, void (*fn)(int msg_type, struct process_id pid, - void *buf, size_t len)) + void *buf, size_t len, + void *private_data), + void *private_data) { struct dispatch_fns *dfn; So this adds a (so far unused) private pointer that is passed from message_register to the message handler. A prerequisite to implement a tiny samba4-API compatible wrapper around our messaging system. That itself is necessary for the Samba4 notify system. Yes, I know, I could import the whole Samba4 messaging system, but I want to do it step by step and I think getting notify in is more important in this step. Volker (This used to be commit c8ae60ed65dcce9660ee39c75488f2838cf9a28b)
2007-10-10r20124: clean up nested extern declaration warningsHerb Lewis1-2/+2
(This used to be commit ac3eb7813e33b9a2e78c9158433f7ed62c3b62bb)
2007-10-10r17590: Some C++ WarningsVolker Lendecke1-6/+6
(This used to be commit b7ec240880af0072ef20b2c0d688ef3cc386d484)
2007-10-10r17293: After the results from the cluster tests in Germany,Jeremy Allison1-2/+0
fix the messaging code to call the efficient calls : save_re_uid() set_effective_uid(0); messaging_op restore_re_uid(); instead of using heavyweight become_root()/unbecome_root() pairs around all messaging code. Fixup the messaging code to ensure sec_init() is called (only once) so that non-root processes still work when sending messages. This is a lighter weight solution to become_root()/unbecome_root() (which swaps all the supplemental groups) and should be more efficient. I will migrate all server code over to using this (a similar technique should be used in the passdb backend where needed). Jeremy. (This used to be commit 4ace291278d9a44f5c577bdd3b282c1231e543df)
2007-10-10r16945: Sync trunk -> 3.0 for 3.0.24 code. Still needJeremy Allison1-17/+28
to do the upper layer directories but this is what everyone is waiting for.... Jeremy. (This used to be commit 9dafb7f48ca3e7af956b0a7d1720c2546fc4cfb8)
2007-10-10r16648: Fix bug #3889 reported by jason@ncac.gwu.edu.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 2eefe9b6f52e64927c0ae23adce111a42d821206)
2007-10-10r16626: Fix bug #3878. Reported by jason@ncac.gwu.edu.Jeremy Allison1-2/+2
Jeremy. (This used to be commit 4c3019eb99d0a18a33ef1fa90d01b9c99c0b25c3)
2007-10-10r16599: Make it clear to Klocwork we're not dereferencing. Issue #2026.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 9402bf0d4cc6d04283ed69a6dedac7767df84626)
2007-10-10r16216: Add debug messages to make it possible to try andJeremy Allison1-8/+31
debug why a job pause or resume command is not being done. Jeremy. (This used to be commit e6aacb1426bd04c4006f7be66228f9f8d9a7065d)
2007-10-10r15101: Little step towards getting Samba4 tdb into 3: tdb_lock_bystring ↵Volker Lendecke1-5/+5
does not have the timeout argument in Samba4. Add a new routine tdb_lock_bystring_with_timeout. Volker (This used to be commit b9c6e3f55602fa505859a4b2cd137b74105d685f)
2007-10-10r15025: Fix exit_server_cleanly call.Jeremy Allison1-1/+1
Jeremy. (This used to be commit a64976b94482ef4397d5b791a0e266edba5a3d0c)
2007-10-10r14898: This change is an attempt to improve the quality of the information thatJames Peach1-1/+1
is produced when a process exits abnormally. First, we coalesce the core dumping code so that we greatly improve our odds of being able to produce a core file, even in the case of a memory fault. I've removed duplicates of dump_core() and split it in two to reduce the amount of work needed to actually do the dump. Second, we refactor the exit_server code path to always log an explanation and a stack trace. My goal is to always produce enough log information for us to be able to explain any server exit, though there is a risk that this could produce too much log information on a flaky network. Finally, smbcontrol has gained a smbd fault injection operation to test the changes above. This is only enabled for developer builds. (This used to be commit 56bc02d64498eb3faf89f0c5452b9299daea8e95)
2007-10-10r13915: Fixed a very interesting class of realloc() bugs found by Coverity.Jeremy Allison1-6/+2
realloc can return NULL in one of two cases - (1) the realloc failed, (2) realloc succeeded but the new size requested was zero, in which case this is identical to a free() call. The error paths dealing with these two cases should be different, but mostly weren't. Secondly the standard idiom for dealing with realloc when you know the new size is non-zero is the following : tmp = realloc(p, size); if (!tmp) { SAFE_FREE(p); return error; } else { p = tmp; } However, there were *many* *many* places in Samba where we were using the old (broken) idiom of : p = realloc(p, size) if (!p) { return error; } which will leak the memory pointed to by p on realloc fail. This commit (hopefully) fixes all these cases by moving to a standard idiom of : p = SMB_REALLOC(p, size) if (!p) { return error; } Where if the realloc returns null due to the realloc failing or size == 0 we *guarentee* that the storage pointed to by p has been freed. This allows me to remove a lot of code that was dealing with the standard (more verbose) method that required a tmp pointer. This is almost always what you want. When a realloc fails you never usually want the old memory, you want to free it and get into your error processing asap. For the 11 remaining cases where we really do need to keep the old pointer I have invented the new macro SMB_REALLOC_KEEP_OLD_ON_ERROR, which can be used as follows : tmp = SMB_REALLOC_KEEP_OLD_ON_ERROR(p, size); if (!tmp) { SAFE_FREE(p); return error; } else { p = tmp; } SMB_REALLOC_KEEP_OLD_ON_ERROR guarentees never to free the pointer p, even on size == 0 or realloc fail. All this is done by a hidden extra argument to Realloc(), BOOL free_old_on_error which is set appropriately by the SMB_REALLOC and SMB_REALLOC_KEEP_OLD_ON_ERROR macros (and their array counterparts). It remains to be seen what this will do to our Coverity bug count :-). Jeremy. (This used to be commit 1d710d06a214f3f1740e80e0bffd6aab44aac2b0)
2007-10-10r13622: Allow to rename machine accounts in a Samba Domain. This still uses theGünther Deschner1-2/+4
"rename user script" to do the rename of the posix machine account (this might be changed later). Fixes #2331. Guenther (This used to be commit b2eac2e6eb6ddd1bcb4ed5172e7cd64144c18d16)
2007-10-10r13293: Rather a big patch I'm afraid, but this should fix bug #3347Jeremy Allison1-7/+8
by saving the UNIX token used to set a delete on close flag, and using it when doing the delete. libsmbsharemodes.so still needs updating to cope with this change. Samba4 torture tests to follow. Jeremy. (This used to be commit 23f16cbc2e8cde97c486831e26bcafd4ab4a9654)
2007-10-10r10656: BIG merge from trunk. Features not copied overGerald Carter1-46/+113
* \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)
2007-10-10r10555: a few compile warnings from jason MaderGerald Carter1-3/+3
(This used to be commit 88998fa0b919fec4966d171a9c7b4f875bc1e26a)
2007-10-10r10371: Adding iPrint printing backend written by Joel J. Smith @ Novell.Jeremy Allison1-0/+6
Jeremy. (This used to be commit 155dc2d52a971bfb8d7565c06f3efc637e130b11)
2007-10-10r9244: Fix bugs found by Coverity.Jeremy Allison1-3/+21
Jeremy. (This used to be commit bf80edeea70cb4ed90f9e1e7adeedeb9cf3b38c1)
2007-10-10r8686: Revert %LOGONSERVER%-substitution. The substition is done on the client,Günther Deschner1-1/+1
not on the server. We now preserve this windows variable (important for vampired setups) and correctly substitute only the "%L"s in strings like: "%LOGONSERVER% %L %lOgOnSeRvEr% %L". Guenther (This used to be commit dccf777f42ce1d3f788548842fb8a606bed5708c)
2007-10-10r8506: BUG 2853: don't strip out characters like '$' from printer namesGerald Carter1-16/+8
when substituting for the lpq command. (This used to be commit 2f5de718a98e56fe55d8905b12505dfc3e432544)
2007-10-10r7829: fix unitialized printer status field that was breaking migration of ↵Gerald Carter1-0/+2
print queues (This used to be commit ada1d326aeef4a2f33a360a8ea4a874e59fcfee6)
2007-10-10r6890: Refactor printing interface to take offset into job. Fixes bugJeremy Allison1-2/+3
where large print jobs can have out-of-order offsets. Bug found by Arcady Chernyak <Arcady.Chernyak@efi.com> Jeremy. (This used to be commit 482f7e0e3706098b71aa0b31a134994acb1e9fcf)
2007-10-10r6490: BUG 1998: patch from Olaf Imig <Olaf.Imig@bifab.de>; fix byte ↵Gerald Carter1-3/+9
ordering bug when storing 16-bit RAP print job ids (This used to be commit 2c66a4098a3c9ca0a12160d4193d65085ece1dfe)
2007-10-10r5993: compiler warning fixGerald Carter1-1/+1
(This used to be commit 4e8b868e6e29513a0c4c1b8992a502d5b6cf2c3d)
2007-10-10r5950: more compiler warning's from Jason MaderGerald Carter1-2/+2
(This used to be commit 27c6e85ad59a86ab45ae3297c7445c4ff15546c8)
2007-10-10r5807: fix segfault after compiler warning clean up (and cleanup another ↵Gerald Carter1-4/+4
warning) (This used to be commit 2dae527e217ff9da2ad9f434bf1280744e93fad7)
2007-10-10r5770: Get rid of some compiler warningsVolker Lendecke1-28/+17
(This used to be commit 96a0f7d60c973e9f74ac90e3c79f94a01770f681)
2007-10-10r5691: wrapping the pause/resume/purge printer commands inGerald Carter1-53/+62
{become,unbecome}_root() blocks. We've already done a print_access_check() to ensure the user is admin. The means that non-root users can pause and manage printers. I really don't see how this worked before without setuid binaries on the server. Also update print_queue_update() interface to allow an smbd to update the print queue cache locally rather than going through the bg lpq daemon. This is needed for things like pjob_delete() to ensure the cache is current for the specific client. (This used to be commit f75369ec865f4ba1ae8201ae750c0f45158ed536)
2007-10-10r4662: Fix from "Jerome Borsboom" <j.borsboom@erasmusmc.nl> to fixJeremy Allison1-0/+1
missing release reference for printer tdb. Jeremy. (This used to be commit 5942bb7737fe8efc452d59cda0d6e35e309c97b7)
2007-10-10r4539: patch from Rob -- adding real printcap name cache function to speed ↵Gerald Carter1-1/+1
up printcap reloads (This used to be commit 1cad5250932b963c2eb9b775221b13db386d601b)
2007-10-10r4094: BUG 2107: fix memory bloating caused by large numbers of ↵Gerald Carter1-35/+136
print_queue_updates() requests sent via messages.tdb (This used to be commit 56b1110c71b17eeb2ebdb7d506d86deb6b81f0d5)
2007-10-10r4088: Get medieval on our ass about malloc.... :-). Take control of all our ↵Jeremy Allison1-4/+4
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)
2007-10-10r4028: * prevent the background LPQ daemon from updatingGerald Carter1-63/+85
the print queue cache just because multiple smbd processes sent a message that it was out of date. * add some extra debug messages while trying to track down down jobs being left in the queue after printing has completed. (This used to be commit a64505d52fcb23374711e22b3df328c9a7848b84)
2007-10-10r3867: Fix from david.hu@hp.com - make a copy of an incoming messageJeremy Allison1-5/+5
rather than indirecting into it as a struct (may not be on an even byte boundary). Bug #2052. Jeremy. (This used to be commit 8a91a69961622a31851f2394c591ddaa61a36000)
2007-10-10r3067: patch based on volker's initial work in trunk that fixes the queu ↵Gerald Carter1-211/+301
update problem when using the background daemon (This used to be commit de7af09e727e744aa27af85ef7c0f73ed5c1550a)
2007-10-10r2569: Patch from Rob Foehl <rwf@loonybin.net>:Gerald Carter1-4/+0
- fix typo in libads/ldap_printer.c:39, ads_find_printer_on_server() (originally libads-typo.patch) - fix leak in printing/nt_printing.c, is_printer_published() (originally is_printer_published-leak.patch) - fix double print_backend_init() calls, now only called from main() - restructuring in printing/nt_printing.c - replaced (un)publish_it() with ads-specific functions - moved common code to nt_printer_publish() - improved error handling in several places - added check_published_printers() in printing/nt_printing.c, to verify that each published printer is actually in the directory at startup - changed calling semantics of mod_a_printer, dump_a_printer, and update_driver_init to be more consistent with the rest of the api and reduce some copying (This used to be commit 50a5a3dbd02acb0d09133b6e42cc37d091ea901d)
2007-10-10r2191: ensure that we assign our pid to print jobs (and not our parent's ↵Gerald Carter1-17/+8
pid); ensures that spooling jobs from dead smbds are removed from the tdb (This used to be commit 9e42d016e1fee9ac999dadc383eb5db45ed79b00)
2007-10-10r2133: Several fixes:Gerald Carter1-14/+15
* BUG 1627: fix for NIS compiles on HPUX 11.00, AIX 4.3 and 5.1 patch from Olaf Flebbe <o.flebbe@science-computing.de>. Will need to watch this one in the build farm. * Fix bug found by rwf@loonybin.net where the PRINT_ATTRIBUTE_PUBLISHED was getting reset by attempts to sanitize the defined attributes (PRINTER_ATTRIBUTE_SAMBA) * Resolve name conflict on DEC OSF-5.1 (inspired by patch from Adharsh Praveen <rprav@india.hp.com>) * Work around parsing error in the print change notify code (not that the alignment bug is still there but reording the entries in the array works around it). * remove duplicate declaration of getprintprocdir from rpcclient. (This used to be commit 7474c6a446037f3ca2546cb6984d800bfc524029)