summaryrefslogtreecommitdiff
path: root/source3/printing/nt_printing.c
AgeCommit message (Collapse)AuthorFilesLines
2007-10-10r23888: move elements belonging to the current ldap connection to aStefan Metzmacher1-1/+1
substructure. metze (This used to be commit 00909194a6c1ed193dfdb296f50f58a53450583c)
2007-10-10r23801: The FSF has moved around a lot. This fixes their Mass Ave address.Andrew Tridgell1-2/+1
(This used to be commit 87c91e4362c51819032bfbebbb273c52e203b227)
2007-10-10r23779: Change from v2 or later to v3 or later.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3)
2007-10-10r23724: Reduce access to the global inbuf a tiny bit. Add a struct smb_requestVolker Lendecke1-8/+8
that contains some of the fields from the SMB header, removing the need to access inbuf directly. This right now is used only in the open file code & friends, and creating that header is only done when needed. This needs more work, but it is a start. Jeremy, I'm only checking this into 3_0, please review before I merge it to _26. Volker (This used to be commit ca988f4e79e977160d82e86486972afd15d4acf5)
2007-10-10r22954: More messaging_registerVolker Lendecke1-4/+5
(This used to be commit 9b8df24107ffe3016031e5257c5680689f061886)
2007-10-10r22844: Introduce const DATA_BLOB data_blob_null = { NULL, 0, NULL }; andVolker Lendecke1-3/+3
replace all data_blob(NULL, 0) calls. (This used to be commit 3d3d61687ef00181f4f04e001d42181d93ac931e)
2007-10-10r22524: Fix memleak.Günther Deschner1-0/+2
Guenther (This used to be commit e55c52f6547157f2684d6eb7ba14de7a0234324d)
2007-10-10r22009: change TDB_DATA from char * to unsigned char *Stefan Metzmacher1-27/+28
and fix all compiler warnings in the users metze (This used to be commit 3a28443079c141a6ce8182c65b56ca210e34f37f)
2007-10-10r21989: make use of tdb_*_bystring() and string_term_tdb_data()Stefan Metzmacher1-54/+31
to avoid creating the TDB_DATA struct from strings "by hand" metze (This used to be commit 1897da9efcfe58ff3c190450731f33bef3ac2ebd)
2007-10-10r21987: split tdb_prs_*() functions in version which take a keystr and a ↵Stefan Metzmacher1-3/+3
TDB_DATA key metze (This used to be commit 724c6fa337bb535e1b97d0452c2489f58339a3bf)
2007-10-10r21875: BUG 3275: Patch from Andy Polyakov <appro@fy.chalmers.se>Gerald Carter1-12/+12
Relax check for i386 header checks in the PE header of printer driver files. Thus allowing uploading of x64 print drivers from 64bit Windows clients. (This used to be commit 328807ec7b1ce6489d5443a93d1599f93af93933)
2007-10-10r21862: add the cups comment and location lookup to ↵Gerald Carter1-3/+10
get_a_printer_2_default() as well (This used to be commit 5b47c4e5c25550ad72f9e558bb50f237ba28f81e)
2007-10-10r21861: Pull the comment and location from CUPS if we don't have oneGerald Carter1-0/+9
when fetching a printer from ntprinters.tdb. Slightly modified from original version submitted on samba-technical ml by Andy Polyakov <appro@fy.chalmers.se> (This used to be commit e859e1fdcd13c55746a53b5de4a02a3278f41815)
2007-10-10r21672: The cannonical file access pattern should look like this :Jeremy Allison1-5/+5
srvstr_get_path(inbuf, name, smb_buf(inbuf) + 1, sizeof(name), 0, STR_TERMINATE, &status); if (!NT_STATUS_IS_OK(status)) { return ERROR_NT(status); } RESOLVE_DFSPATH(name, conn, inbuf, outbuf); status = unix_convert(conn, name, False, NULL, &sbuf); if (!NT_STATUS_IS_OK(status)) { return ERROR_NT(status); } status = check_name(conn, name); if (!NT_STATUS_IS_OK(status)) { return ERROR_NT(status); } Make sure that every access pattern (including the wildcard generated paths from unlink, rename, and copy) do the same. Tidy things up a bit.... Jeremy. (This used to be commit b8327b21ddf518d34c6cd6c01bd7fc0fd3f63c0c)
2007-10-10r21606: Implement escaping function for ldap RDN valuesSimo Sorce1-3/+21
Fix escaping of DN components and filters around the code Add some notes to commandline help messages about how to pass DNs revert jra's "concistency" commit to nsswitch/winbindd_ads.c, as it was incorrect. The 2 functions use DNs in different ways. - lookup_usergroups_member() uses the DN in a search filter, and must use the filter escaping function to escape it Escaping filters that include escaped DNs ("\," becomes "\5c,") is the correct way to do it (tested against W2k3). - lookup_usergroups_memberof() instead uses the DN ultimately as a base dn. Both functions do NOT need any DN escaping function as DNs can't be reliably escaped when in a string form, intead each single RDN value must be escaped separately. DNs coming from other ldap calls (like ads_get_dn()), do not need escaping as they come already escaped on the wire and passed as is by the ldap libraries DN filtering has been tested. For example now it is possible to do something like: 'net ads add user joe#5' as now the '#' character is correctly escaped when building the DN, previously such a call failed with Invalid DN Syntax. Simo. (This used to be commit 5b4838f62ab1a92bfe02626ef40d7f94c2598322)
2007-10-10r21258: Fix for connecting printers from Vista by storingGerald Carter1-9/+78
the printer GUID as a REG_SZ as Vista seems to whine about unknown REG_BINARY values. Thanks to Martin Zielinski <mz@seh.de> for his excellent analysis on this. (This used to be commit fa5490b71b5cd41b63b028aa8a316e1197263083)
2007-10-10r21064: The core of this patch isVolker Lendecke1-2/+3
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-10r20796: Fix the same problem Jeremy has fixed (improper handling of deferred ↵Volker Lendecke1-5/+5
opens) for delete_driver_files. Proper fix pending... :-) Jeremy, please check. Volker (This used to be commit 21b8f15dd5ad567efeacf5ba22dc4d8c64b09b76)
2007-10-10r20718: Sync up the filename path parsing changes from SAMBA_3_0_24.Jeremy Allison1-21/+17
The only difference between the two trees now w.r.t file serving are the changes to smbd/open.c in this branch I need to review. Jeremy. (This used to be commit f4474edf6a0c71001dbd01429ef70bafad6abd74)
2007-10-10r20544: Change copy_file() to return NTSTATUS. This is in preparation of turningVolker Lendecke1-11/+10
close_file() to NTSTATUS as well. I'm not sure I got all the error codes right, but as I've never come across a smb_copy() call in all my Samba work, I'm leaving it at that. If I'm absolutely bored, I will write a thorough torture test. As far as I can see, Samba4 even does not have a libcli implementation for it... :-) Volker (This used to be commit 5ebdf02ba166df69e210e6f70c01a44e6205ecc1)
2007-10-10r20339: Make mkdir_internal static to open.cVolker Lendecke1-1/+1
(This used to be commit 6dd0886b49969d0edfe16861f19d35275217b2af)
2007-10-10r18745: Use the Samba4 data structures for security descriptors and security ↵Jelmer Vernooij1-35/+35
descriptor buffers. Make security access masks simply a uint32 rather than a structure with a uint32 in it. (This used to be commit b41c52b9db5fc4a553b20a7a5a051a4afced9366)
2007-10-10r18654: Rename "struct uuid" => "struct GUID" for consistency.Jelmer Vernooij1-7/+7
(This used to be commit 5de76767e857e9d159ea46e2ded612ccd6d6bf19)
2007-10-10r18019: Fix a C++ warnings: Don't use void * in libads/ for LDAPMessage anymore.Volker Lendecke1-2/+2
Compiled it on systems with and without LDAP, I hope it does not break the build farm too badly. If it does, I'll fix it tomorrow. Volker (This used to be commit b2ff9680ebe0979fbeef7f2dabc2e3f27c959d11)
2007-10-10r17590: Some C++ WarningsVolker Lendecke1-7/+7
(This used to be commit b7ec240880af0072ef20b2c0d688ef3cc386d484)
2007-10-10r16945: Sync trunk -> 3.0 for 3.0.24 code. Still needJeremy Allison1-12/+16
to do the upper layer directories but this is what everyone is waiting for.... Jeremy. (This used to be commit 9dafb7f48ca3e7af956b0a7d1720c2546fc4cfb8)
2007-10-10r16701: Fix segv when adding a printer caused by not initializing theGerald Carter1-1/+1
realm name in ads_init() in nt_printer_publish(). (This used to be commit a25e75e78db092b3992dfc6f7e2737023d43e2c3)
2007-10-10r16582: Fix Klocwork #1997 and all generic class of problemsJeremy Allison1-0/+15
where we don't correctly check the return from memdup. Jeremy. (This used to be commit ce14daf51c7ee2f9c68c77f7f4674e6f0e35c9ca)
2007-10-10r16424: Fix possible null deref and a memory leak found byJeremy Allison1-0/+2
examining Klockwork #1519. get_printer_subkeys() could return zero without initializing it's return pointer arg. Fixed this. Added free of subkey pointer return in registry/reg_printing.c (interesting that neithe Coverity or Klocwork found this one). Jeremy. (This used to be commit 4fbeae1a3ac3499e5d9f566655cbafccd9d691cb)
2007-10-10r16367: Missed one, Klocwork #915.Jeremy Allison1-0/+4
Jeremy. (This used to be commit b581fee9824712b9385e9975739a8ddbb297bca8)
2007-10-10r16365: Fix Klocwork #895, #898, #899, #915, #932, #938 and aJeremy Allison1-25/+106
few other problems Klocwork missed. Jeremy. (This used to be commit fe05769a1a85f924c67be7e5dcee4871a86948d7)
2007-10-10r15569: Fix Coverity bug # 287. Jerry, can you check if WERR_NOMEM is a ↵Volker Lendecke1-0/+11
correct error code here? Thanks, Volker (This used to be commit 5787bd0ee90b081ae12a4a976893cb297fa7bed4)
2007-10-10r15543: New implementation of 'net ads join' to be more like Windows XP.Gerald Carter1-1/+1
The motivating factor is to not require more privileges for the user account than Windows does when joining a domain. The points of interest are * net_ads_join() uses same rpc mechanisms as net_rpc_join() * Enable CLDAP queries for filling in the majority of the ADS_STRUCT->config information * Remove ldap_initialized() from sam/idmap_ad.c and libads/ldap.c * Remove some unnecessary fields from ADS_STRUCT * Manually set the dNSHostName and servicePrincipalName attribute using the machine account after the join Thanks to Guenther and Simo for the review. Still to do: * Fix the userAccountControl for DES only systems * Set the userPrincipalName in order to support things like 'kinit -k' (although we might be able to just use the sAMAccountName instead) * Re-add support for pre-creating the machine account in a specific OU (This used to be commit 4c4ea7b20f44cd200cef8c7b389d51b72eccc39b)
2007-10-10r15309: normalize printing keys when deletingGerald Carter1-7/+3
(This used to be commit 037f9f831e001a12261419e37c725558dd717af9)
2007-10-10r15101: Little step towards getting Samba4 tdb into 3: tdb_lock_bystring ↵Volker Lendecke1-1/+1
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-10r14506: Remove remaining references to a KCM credential cache type.Günther Deschner1-4/+0
Guenther (This used to be commit aae8f8ae7a79d06c74151186f3c2470bdec5687d)
2007-10-10r14489: Guard against coverity reversion. #181 is a false positiveJeremy Allison1-0/+2
but make the intent clearer. Jeremy. (This used to be commit 2703df7a8f26a315ae6ab53de8f7814fa66a1c54)
2007-10-10r14273: Fix coverity bug #202. Memory leak on error path.Jeremy Allison1-1/+3
Jeremy. (This used to be commit d2be8163f2cf69681150ed7de720a37ffaa8e937)
2007-10-10r14221: Fix coverity #76. My previous change wasn't quite enough :-).Jeremy Allison1-0/+1
Jeremy. (This used to be commit 21b70035f39973e9edff323219c3c7eeb1550e2b)
2007-10-10r14184: Coverity fix #56. Ensure we can't deref null.Jeremy Allison1-1/+1
Jeremy. (This used to be commit c76092a0662714b49c3c519d6f01174b8995a036)
2007-10-10r13915: Fixed a very interesting class of realloc() bugs found by Coverity.Jeremy Allison1-40/+17
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-10r13547: add earlier checks to deny deleting a printer driver. The previousGerald Carter1-0/+5
code relied upon file permissions alone. Now we check that the user is a printer administrator and that the share has not been marked read only for that user. (This used to be commit 117d9fd9e16a7afbc6772506a4f8c33ff99d33f7)
2007-10-10r13316: Let the carnage begin....Gerald Carter1-4/+10
Sync with trunk as off r13315 (This used to be commit 17e63ac4ed8325c0d44fe62b2442449f3298559f)
2007-10-10r13293: Rather a big patch I'm afraid, but this should fix bug #3347Jeremy Allison1-7/+7
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-10r12889: BUG 3380: fix crash when changing printer drivers caused by ↵Gerald Carter1-0/+2
accessing a previously freed pointer (This used to be commit bcce3b69f83f52deb308d8c2f5165000468bd552)
2007-10-10r11420: Fix issue pointed out by Dina Fine <dina@exanet.com>. We canJeremy Allison1-5/+5
only tell at parse time from the wire if an incoming name has wildcards or not. If it's a mangled name and we demangle the demangled name may contain wildcard characters. Ensure these are ignored. Jeremy. (This used to be commit 4cd8e2a96b98ff711905e8c6f416b22440c16062)
2007-10-10r10554: * BUG 3057: assume x64 drivers are v3 driversGerald Carter1-1/+8
* BUG 3087: allow smbspool to establisha geust connection using a username with no password (This used to be commit 39369c8041e0633e88c30e0c62530c2393ef80f6)
2007-10-10r10154: Fix crash bug on security descriptor upgrade (as seen on x86_64).Günther Deschner1-1/+2
Guenther (This used to be commit daa61ef75b4f7cf510b17cd0b85f5830c73b9279)
2007-10-10r9739: conver the reg_objects (REGSUBKEY_CTR & REGVAL_CTR) to useGerald Carter1-351/+145
the new talloc() features: Note that the REGSUB_CTR and REGVAL_CTR objects *must* be talloc()'d since the methods use the object pointer as the talloc context for internal private data. There is no longer a regXXX_ctr_intit() and regXXX_ctr_destroy() pair of functions. Simply TALLOC_ZERO_P() and TALLOC_FREE() the object. Also had to convert the printer_info_2->NT_PRINTER_DATA field to be talloc()'d as well. This is just a stop on the road to cleaning up the printer memory management. (This used to be commit ef721333ab9639cb5346067497e99fbd0d4425dd)
2007-10-10r9086: * fix invalid read in parse_spoolss when writing a devmode toGerald Carter1-15/+22
the wire * fix dup_a_regval() when size is 0 * ensure we pass a pstring to unlink_internals (fixes delete_driver code) (This used to be commit 353e63ff421c564a1b7c7cfe95982f31c871a227)