summaryrefslogtreecommitdiff
path: root/source3/rpc_server/srv_spoolss_nt.c
AgeCommit message (Collapse)AuthorFilesLines
2001-02-23include/rpc_spoolss.h: Added JOB_STATUS_XXX defines.Jeremy Allison1-5/+31
include/smb.h: Added LPQ_xx enums to correspond with the NT JOB_STATUS_XXX. We need these to be different as we're storing LPQ_xx enums in the tdb already. rpc_server/srv_spoolss_nt.c: Don't need to return status strings as we're now returning status codes. smbd/lanman.c: Change the RAP status codes to have "RAP" in the name. printing/printing.c: Keep track of the status of a job. Allow a job to be deleted from one smbd when being submitted by another. Made logic in mutex clearer. Jeremy. (This used to be commit 71029da7dd74eb91dd6953752bdf238f319d985d)
2001-02-16Excise snprintf -> slprintf.Jeremy Allison1-64/+140
srv_samr.c: duplicate gid fix. srv_spoolss_nt.c: Merge of JF's work. uid.c: Fix for returning names when a PDC. Jeremy. (This used to be commit d938ad6963a2dd4eda930d508600ec1902dc2b16)
2001-02-03merge from APPLIANCE_HEAD (mapping access_required 0x0 toGerald Carter1-2/+6
PRINTER_ACCESS_USE) (This used to be commit 0c57b05de46f04dda941fcb4ba4f2a5a88b8dc9f)
2001-01-31Changes from SAMBA_2_2:David O'Neill1-51/+65
source/rpc_server/srv_spoolss_nt.c source/rpc_server/srv_spoolss.c source/include/proto.h - correct checking of access_required in openprinterex as talked with John R. and Jerry. You can only do server stuff (adding printers, changing forms, ..) if you're root or if user is in printer admin list. Printers options are grayed if you don't have the PRINTER_ADMINISTER flag in the secdesc. (This used to be commit f449d871bf0c385d8c57de2d795e1d7ef7f256f7)
2001-01-29Changes from APPLIANCE_HEAD:David O'Neill1-32/+55
source/include/proto.h - make proto source/printing/nt_printing.c source/rpc_server/srv_spoolss_nt.c - Fix for the overwriting of printerdata entries when WinNT and Win2k are modifying printer parameters on PCL printers. Turns out that Win2k creates a printer with a NULL devmode entry and then expects to set it on *OPEN* (yes this is insane). So we cannot return a "default" devmode for a printer - and we must allow an open to set it. source/tdb/tdb.c - Show freelist in an easier format. Show total free. - When storing a new record, allocate memory for the key + data before the tdb_allocate() as if the malloc fails a (sparse) hole is left in the tdb. source/tdb/tdbtool.c - Show freelist in an easier format. Show total free. source/tdb/Makefile - cleaned up Makefile dependancies source/smbd/lanman.c - Fix for Win9x corrupting it's own parameter string. source/printing/printfsp.c source/printing/printing.c source/rpc_server/srv_spoolss_nt.c source/smbd/close.c - Added normal close parameter into print_fsp_end() which treats an abnormal close as error condition and deletes the spool file. (This used to be commit 025f7a092ad258ff774e3f5e53737f8210cc8af6)
2001-01-25Changes from APPLIANCE_HEAD:David O'Neill1-20/+11
source/rpc_server/srv_spoolss_nt.c - Changed the se_access_check() call in _spoolss_open_printer_ex() to a print_access_check(). This allows the 'printer admins' smb.conf and other permission override parameters to affect the result of a printer open. - Don't perform access check when opening a handle on a print server as it breaks browsing the Printers folder. (This used to be commit bbe51d4b5f6da4c7668214511e25eff098bf03b1)
2001-01-23Changes from APPLIANCE_HEAD:David O'Neill1-12/+24
source/rpc_server/srv_spoolss_nt.c - add an access check to _spoolss_deleteprinter() to stop random users and passers by from deleting printers. source/lib/messages.c - converted global msg_all struct to a local in message_send_all() function. source/include/smb.h - added a success error code to the spoolss return codes. source/include/proto.h source/param/loadparm.c source/printing/printing.c - Added new parameter "total print jobs" to limit the total number of print jobs across all queues. Currently individual queues are limited by "max print jobs". (This used to be commit 02f154e729b0e8465d3e1e2ac794e6ab3844ce57)
2001-01-23Changes from APPLIANCE_HEAD:David O'Neill1-3/+0
source/rpc_server/srv_spoolss_nt.c - remove redundant srv_spoolss_sendnotify() calls from _spoolss_startdocprinter() and _spoolss_enddocprinter(), as its functionality is already covered in print_job_start() and print_job_end() source/printing/printing.c - force a print_queue_update() prior to print queue purge so that all jobs are purged. (This used to be commit 0ccc552203d6432cde844c5946b203b27f257b1a)
2001-01-19Changes from APPLIANCE_HEAD:David O'Neill1-2/+2
source/include/proto.h - make proto source/rpc_server/srv_spoolss_nt.c - clean up incorrect debug statement (This used to be commit f07f4e9c7b9bb5230f10fffe50beab163b6f7790)
2001-01-18Changes from APPLIANCE_HEAD:David O'Neill1-1/+1
source/rpc_server/srv_spoolss_nt.c - Fixed dereference of NULL pointer in security descriptor notification used by Win2K printers. (This used to be commit 1b6efd18943ef3ed0e2e061495d05cfdecd86c88)
2001-01-17Changes from APPLIANCE_HEAD:David O'Neill1-95/+431
source/include/proto.h source/include/rpc_spoolss.h source/rpc_parse/parse_spoolss.c source/rpc_server/srv_spoolss.c source/rpc_server/srv_spoolss_nt.c - speedups in printer queue enumeration - still room for improvement. The construct_dev_mode() still creates and destroys a printer info_2 structure every time it is called. - fixed job->devmode memory leak - converted printer job notification routines to use tallocated memory rather than a fixed 2K buffer. This reduces the memory requirements of a 4500 job queue enumeration from 90MB to about 16MB. (This used to be commit 7853b27bc1765d48d5f06837f8aca71a3a0d1e5d)
2001-01-17Changes from APPLIANCE_HEAD:David O'Neill1-18/+33
source/rpc_server/srv_spoolss_nt.c - Unrolled construct_notify_jobs_info() loop to only fetch printer info_2 structure once rather than num_print_jobs times. - convert command to unix codepage. - remove lp_remove_service() call as it prevents lp_killservice() from working. - Modified some DEBUG and DEBUGADD statements. source/param/loadparm.c source/param/params.c - change printer, preload, auto services to FLAG_DOS_STRING, reverted earlier changes to szPrintername et al, add comments. source/printing/load.c - fix bug with lp_auto_services() and strtok() source/printing/nt_printing.c source/printing/printing.c - remove redundant test that used SERVICE(snum) source/printing/pcap.c - add unix_to_dos() calls, add notes wrt FIXMEs for xxx_printer_fn() functions. source/web/swat.c - added FIXME comment. source/smbd/service.c - added comment re: dos codepage (This used to be commit 7b774b72c2857af9519012106714a9e2cb099da3)
2001-01-15Changes from APPLIANCE_HEAD:David O'Neill1-0/+2
source/rpc_parse/parse_lsa.c - off by one unistr length bug in init_lsa_trans_name() source/lib/util_sid.c - resolve more BUILTIN sid values to names. source/nsswitch/wb_client.c - fix typo in debug message - set errno on error so we don't get bogus value from last failure. source/rpc_server/srv_spoolss_nt.c - add debug to track number of open printer handles for ease of tracking handle leaks in the future. source/rpc_server/srv_lsa.c - fix off-by-one string bug. This was preventing NT from displaying names for well-know SIDs in printer permissions dialog. (This used to be commit 59229b9025cff54cbdd05e374616ffbf9c6fee33)
2001-01-11Changes from APPLIANCE_HEAD:David O'Neill1-43/+69
testsuite/printing/psec.c - Use lock directory from smb.conf parameter when peeking at the ntdrivers.tdb file. source/rpc_parse/parse_sec.c - fix typo in debug message source/script/installbin.sh - create private directory as part of 'make install'. source/nsswitch/winbindd_cache.c source/nsswitch/winbindd_idmap.c source/passdb/secrets.c source/smbd/connection.c - always convert tdb key to unix code-page when generating. source/printing/nt_printing.c - always convert tdb key to unix code-page when generating. - don't prepend path to a filename that is NULL in add_a_printer_driver_3(). source/rpc_server/srv_spoolss_nt.c - always convert tdb key to unix code-page when generating. - don't prepend server name to a path/filename that is NULL in the fill_printer_driver_info functions. source/printing/printing.c - always convert tdb key to unix code-page when generating. - move access check for print_queue_purge() outside of job delete loop. source/smbd/unix_acls.c - fix for setting ACLs (this got missed earlier) source/lib/messages.c - trivial sync with appliance_head (This used to be commit 376601d17d53ef7bfaafa576bd770e554516e808)
2001-01-08Changes merged from APPLIANCE_HEAD:David O'Neill1-1/+5
source/printing/printing.c source/rpc_server/srv_spoolss_nt.c - convert args for print command to unix codepage. (This used to be commit 1c0ae957f8f1abee7d22a18b6df092eb2a884ae1)
2001-01-05Changes from APPLIANCE_HEAD:David O'Neill1-10/+47
source/rpc_server/srv_spoolss_nt.c - fixed printer policy handle leak in the allow MS printer wizard stuff. - mimic behaviour of NT on open_printer_ex() calls by not allowing call to succeed if connecting user doesn't have at least print permissions to the printer. Unfortunately, this seems to trigger a anonymous connection re-using bug so subsequent connects to the printer by a different user from the same machine always fail. Blame Tim. =^) (This used to be commit 33fc7f4527c34b39b1a0f3fee2f0697ea74f79c4)
2000-12-21merge from appliance headGerald Carter1-1/+4
(This used to be commit 4671a313775f052ae949ba441db7e0060bed0b75)
2000-12-18Merged Tim's fixes from appliance-head.Jeremy Allison1-95/+113
Jeremy. (This used to be commit 26f873540c2299600cb80eb059fcdaf70ec82473)
2000-12-15lib/util_unistr.c:Jean-François Micouleau1-1/+1
rewrote unistr2_to_ascii() to correct a bug seen on SGI boxes. rpc_parse/parse_misc.c: rpc_parse/parse_prs.c: rewrote of BUFFER5 handling to NOT byteswap when it was already in network byte order. rpc_parse/parse_samr.c: cleanup of samr_io_q_lookup_domain(), remove the over-parsing by 2 bytes. rpc_server/srv_lsa.c: UNISTR2 strings need to be NULL terminated to pleased W2K. rpc_server/srv_spoolss_nt.c: use snprintf instead of safe_strcpy as we want the string truncated at 32 chars. That should fix SUN and SGI box not able to act as printserver and the problem with joining from a W2K wks. J.F. (This used to be commit 69fe739303b105f2c488f266f13977da1b6b201d)
2000-12-15Fixed memory leak in JOB_INFO_2 code.Jeremy Allison1-3/+2
Jeremy. (This used to be commit d0d31eead3367485bbac684d881839029010975d)
2000-12-15Fixed memory leaks in lsa_XX calls. Fixed memory leaks in smbcacls. MergedJeremy Allison1-1/+1
in fixes from appliance-head and 2.2. Fixed multiple connection.tdb open problem. Jeremy. (This used to be commit 0a40bc83e14c69a09948ec09bb6fc5026c4f4c14)
2000-12-14Updates from appliance-head.Jeremy Allison1-8/+47
Jeremy. (This used to be commit 15ae2c335b52e34c06d8f4f9ebad28078292b208)
2000-12-11Adding in debug for SD's.Jeremy Allison1-0/+31
Jeremy. (This used to be commit a19f936b644fedc4c59ada5f12172abed9894910)
2000-12-07file_lines_load/file_lines_pload can now optionally convert unix_to_dos()Jeremy Allison1-3/+3
on read. Jeremy. (This used to be commit 76b8dd376d13eb4469417be217c966d54d333367)
2000-11-22Changes from APPLIANCE_HEAD:David O'Neill1-4/+4
- Add code to test equivalence of private data in NT_DEVICEMODE (This used to be commit 684981851ffa3b51e78a6fd5960e219823eb90d5)
2000-11-17Fix from John Reilly for equivalence tests.Jeremy Allison1-76/+79
Jeremy. (This used to be commit b456274a7ba22d512bab5ede979cd9363398825b)
2000-11-17Fix for memory leak when adding driver.Jeremy Allison1-4/+4
Jeremy. (This used to be commit eeab4e0290f9df84025e91c85d27b21e0c02781f)
2000-11-16Fix for a problem with the new messaging system. If a sender is using theJeremy Allison1-1/+1
messaging system as a notification mechanism, and the speed of notification greatly exceeds the speed of message recovery, then you get a massively (>75Mb) growing tdb. If the message is a simple notification, then the message is static, and you only need one of them in transit to a target process at any one time. This patch adds a BOOL "allow_duplicates" to the message_send_XX primitives. If set to False, then before sending a message the sender checks the existing message queue for a target pid for a duplicate of this message, and doesn't add to it if one already exists. Also added code into msgtest.c to test this. Jeremy. (This used to be commit 3aa7995660395ecb85c8e35b638fa9fbbb952558)
2000-11-14Merge from appliance head of JR's changes for driver versioning.Jeremy Allison1-1/+1
Jeremy. (This used to be commit cdbd2e99775642dc2e92004be9014bf38a92d80f)
2000-11-14printing/nt_printing.c: After long soul searching and making both Andrew and myJeremy Allison1-13/+10
life a misery, here is the only possible null driver fix we have found. This *SUCKS*. rpc_server/srv_spoolss_nt.c: Correct printername search. Correct portname reply Correct attributes reply. Removal of unused temp variable. Jeremy. (This used to be commit 06e71c9f8be20b84e33e143c3d0b7904225efb45)
2000-11-10printing/nt_printing.c: use getpwuid not smbgetpwuid. Canonicalize printernames.Jeremy Allison1-85/+65
printing/printing.c: Insure fix for malloc of zero. rpc_parse/parse_misc.c: Enusre UNISTR's are zero filled. rpc_parse/parse_spoolss.c: Correct INFO_6 - differs between pre-releases of W2K and shipping build. rpc_server/srv_spoolss_nt.c: Canonicalize printernames. Jeremy. (This used to be commit b17e23a8ff2b44540726968355a4b7e26f244f3b)
2000-11-08an attempt to get the handling of fields in printer info structuresAndrew Tridgell1-43/+24
consistent. Still working with Jeremy on this, there is probably more to be done (This used to be commit c4bb9c598cf9781d48bc123a8cbbed9c2049bf89)
2000-11-08Merge fest!!!Tim Potter1-24/+20
(This used to be commit 87775074b22bb969c3585556e2a86ac4c7d4b0d4)
2000-11-07Merge of printer security descriptor, info level and printerdataTim Potter1-37/+267
comparison changes from appliance branch. (This used to be commit ae087bdf312806e08848695cad70a943bb3d71b9)
2000-10-30Merge of comment repair.Tim Potter1-8/+8
(This used to be commit 7712421910b12fd64cf90100e4495669bec67c2f)
2000-10-29Patches from John Reilly @ HP for print job time bugs.Jeremy Allison1-6/+16
Jeremy. (This used to be commit 0eb7f2d514317882684e9c0c51d46b1ac1eb2568)
2000-10-26Added John Reillys patch for error code returns from ↵Jeremy Allison1-1/+2
clean_up_printer_driver_strunct() calls. Jeremy. (This used to be commit f81a2a03bf435e65e7484ab021f86a8a4f62b656)
2000-10-26Sorry JF - no billable hours :-). I fixed the "stream of events" problemJeremy Allison1-6/+6
with PCL drivers. The problem was we were updating the changeid on every SETPRINTERDATA/DELETEPRINTERDATA call. We should not do this, we should just update the 'setprinter' called count. We update the changeid on calls to SETPRINTER/ADDPRINTER/ADDPRINTEREX etc. Also fixed the correct returning of the create time on printers. Jeremy. (This used to be commit 521f09829fd329f87b3d19e8871e2b989c98a58e)
2000-10-20Merge from appliance-headTim Potter1-1/+5
(This used to be commit 6d39df7cf84d391bb4dd55d9a26f9f5a6368f46f)
2000-10-10Fix found by Andrew to stop local/remote printers beingJeremy Allison1-3/+18
confused. check_printer_ok was causing SETPRINTER calls to fail. Jeremy. (This used to be commit b41cc5fea7409d07529adad44f0cbba5c764591c)
2000-10-06Proto update. Also fix from John Reilly @ HP for not showing APW with W2K.Jeremy Allison1-7/+14
Jeremy. (This used to be commit 698288cb9de316527c0c2a271e18c920578f9930)
2000-10-06Herb's warning fixes. Also the POSIX locking fix.Jeremy Allison1-3/+1
We now use our own vfs layer to do get/set acl calls (hurrah!). Jeremy. (This used to be commit dfe77c7046cbd65ee52aea7439f21503c1eac41d)
2000-10-04Adding Herb's compile warning fixes to HEAD.Jeremy Allison1-45/+0
Jeremy. (This used to be commit d131ad1ce3f6e72e295f865a463f8dcbfa6f8d42)
2000-10-03Fixes from Herb - compiler warnings.Jeremy Allison1-1/+1
Jeremy. (This used to be commit d9d3668fa322cbed36ca3393d8268bf0e5255e8d)
2000-10-02Added debug so if zero length messages get sent we successfully removeJeremy Allison1-0/+9
them (this can happen if smbd processes are shut down at the wrong time). Jeremy. (This used to be commit c1de97f96b8c5ad8e5f01a0d17c6387733769442)
2000-09-29Missing null termination on printer changenotify message caused insureJeremy Allison1-3/+4
error. Jeremy. (This used to be commit 3733d29ce678c71ef2ee8b600e547765d8d8ea9e)
2000-09-27Fixed stupid introduced bug found by "Jim McDonough/Boulder/IBM" ↵Jeremy Allison1-2/+2
<jmcd@us.ibm.com>. Jeremy. (This used to be commit 563f8b09a810446c658bf58303b5fe998d27bec9)
2000-09-26broadcast printer notify message to all clients. We now have printerJean-François Micouleau1-8/+15
notification as on NT. Andrew, your message passing code is cool :-) J.F. (This used to be commit 0374bc4b5f56d0fab3f7310e13cb71b5a71f9112)
2000-09-26Changes from John Reilly to add a parameter "show add printer wizard" thatJeremy Allison1-5/+25
allows Samba to turn off the display of APW (hmmm. This should probably be a share specific parameter, I'll fix that in another commit). Also a few small changes to JF's code to fix compiler warnings about missing return statements and also change '//' comments (C++) to /* .. */ comments (C). Jeremy. (This used to be commit 0a9ccc99b335650d235eb747d803d059f7828fd7)
2000-09-25printer notify code.Jean-François Micouleau1-6/+144
It only sends notifies to one client. The broadcasting notify code will code soon. J.F. (This used to be commit 4c63c9185887c64e57d901e82a4a16a83522c898)