summaryrefslogtreecommitdiff
path: root/source3/printing/nt_printing.c
AgeCommit message (Collapse)AuthorFilesLines
2001-07-09split the nt_drivers.tdb in 3 separate tdb files. Should speed-up lookupsJean-François Micouleau1-32/+114
J.F. (This used to be commit c08e22713ea4ddbc4951dc8dcc40609eb0039ddb)
2001-07-04strchr and strrchr are macros when compiling with optimisation in gcc, so we ↵Andrew Tridgell1-13/+13
can't redefine them. damn. (This used to be commit c41fc06376d1a2b83690612304e85010b5e5f3cf)
2001-07-04The big character set handling changeover!Andrew Tridgell1-7/+1
This commit gets rid of all our old codepage handling and replaces it with iconv. All internal strings in Samba are now in "unix" charset, which may be multi-byte. See internals.doc and my posting to samba-technical for a more complete explanation. (This used to be commit debb471267960e56005a741817ebd227ecfc512a)
2001-07-02Fixed extra file_free calls - my fault :-(.Jeremy Allison1-14/+4
Jeremy. (This used to be commit 2f8b84bda040edc87a7af29c3a281cf335e392cb)
2001-06-26SGI compiler fixes.Herb Lewis1-0/+6
Jeremy (This used to be commit 45bf995bf62aa6cc176d57e2f954cc2d379717ef)
2001-06-22Fix from "Jim McDonough" <jmcd@us.ibm.com>" - when we use open_file_shared(),Jeremy Allison1-5/+5
we need to close with close_file(). Jeremy. (This used to be commit 5b2ffd160f3b4b9607bb6fd6db1644af9254ad9e)
2001-06-04use LDSHFLAGS not -shared in several placesAndrew Tridgell1-1/+1
(This used to be commit 8ec9c87b5d1a7dae17d5b1a30f58effaf5e69e4b)
2001-05-18merge from 2.2 (deleteprinterdriver RPC)Gerald Carter1-0/+101
(This used to be commit 515caaf7b448e55206433a9ca04fb5078f91cde2)
2001-05-10Replaced a whole bunch of lookup_name() requests inTim Potter1-8/+11
construct_default_printer_sdb() with checks of the owner rid instead. This should be much faster, work on non-English systems and systems with renamed user or group names. (This used to be commit 8b435b0a2ab1fa060473753fa05f0aba8406b607)
2001-05-03Merging Gerald's "no printer driver" fix from 2.2.Jeremy Allison1-0/+10
Jeremy. (This used to be commit 409b1e4d1b996b26eee80bf5cb4edd962e4a4c76)
2001-04-27More debug %d -> %u issues.Jeremy Allison1-6/+6
Jeremy. (This used to be commit 6fcb600dcd23c61d1a7d2ce8c2b7b2eea2e58623)
2001-04-08Added per-share security tdb. Tidied up many slprintfs (need -1 on length).Jeremy Allison1-38/+39
Jeremy. (This used to be commit d786191bc116c17a3f53a1c272d969942b7e5d25)
2001-04-03Sync up with new NT forms code.Jeremy Allison1-20/+155
Jeremy. (This used to be commit 63ce316d870be0cf61ae669c955479ec175fdaef)
2001-03-23Two OS/2 printer fixes from Jim McDonough @ IBM.Jeremy Allison1-0/+85
First one adds a new info level into the lanman printing and an ioctl to the trans2 code. Andrew - this uses ASCII only. It looks ok to me but please check ! Second one adds a parameter "os2 driver map" that allows OS/2 driver names to be mapped. Jeremy. (This used to be commit da79b519e0b6b4317d7fb5260d74e0e74a7e0b46)
2001-03-11Merge of new 2.2 code into HEAD (Gerald I hate you :-) :-). Allows new SAMRJeremy Allison1-8/+5
RPC code to merge with new passdb code. Currently rpcclient doesn't compile. I'm working on it... Jeremy. (This used to be commit 0be41d5158ea4e645e93e8cd30617c038416e549)
2001-03-09Serious (and I *mean* serious) attempt to fix little/bigendian RPC issues.Jeremy Allison1-1/+1
We were reading the endainness in the RPC header and then never propagating it to the internal parse_structs used to parse the data. Also removed the "align" argument to prs_init as it was *always* set to 4, and if needed can be set differently on a case by case basis. Now ready for AS/U testing when Herb gets it set up :-). Jeremy. (This used to be commit 0cd37c831d79a12a10e479bf4fa89ffe64c1292a)
2001-03-03Roll back to using malloc/realloc on some of spoolss in head.Jeremy Allison1-39/+15
I'm having problems with talloc_realloc in the 2.2 branch and I want a stable reference. The only problem is this breaks the clean auto-generated code in *one* call in srv_spoolss.c (the rfnpcnex call). Jeremy. (This used to be commit 57a9340cbafa40f3a41e6c676c6f2477855fd799)
2001-03-02Move to talloc controlled NT forms.Jeremy Allison1-15/+39
Jeremy. (This used to be commit 3e190e693375c6032dd64bf8dd3c90f90dc4e3b4)
2001-03-01Fixed a couple of getpwXX calls that were not going through the sys_getpwXXJeremy Allison1-2/+2
cache. Jeremy. (This used to be commit a648935ae93f781aedba8f89b0071a24e42f4543)
2001-02-28Move to talloc control of SPOOL_XXX structs. Move to talloc control ofJeremy Allison1-55/+34
security descriptors and pointers. Syncup with 2.2 tree. Jeremy. (This used to be commit 14d5997dc841e78a619e865288486d50c245896d)
2001-02-12Merge of JohnR's changes to appliance-head, JF's changes to 2.2,Jeremy Allison1-2/+13
updated the POSIX_ACL code to be in sync. Jeremy. (This used to be commit c0517d6f4e3079feca1309fd1ea7b21e83f0de02)
2001-01-29Changes from APPLIANCE_HEAD:David O'Neill1-23/+82
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-26Changes from APPLIANCE_HEAD:David O'Neill1-1/+23
source/printing/nt_printing.c - fix for Win2k sending NULL devicemode in setprinter calls which was making NT4 grumpy. The solution is to never set a NULL devicemode if we previously had a valid one in the printer's TDB entry. (This used to be commit b9036a07781724d58b34da3b6e876dd28d5f70a6)
2001-01-19Changes from APPLIANCE_HEAD:David O'Neill1-6/+26
source/printing/nt_printing.c - use se_create_child_secdesc() to create appropriate security descriptor when performing print job admin security checks. source/printing/printing.c - Use JOB_ACCESS_ADMINISTER instead of PRINTER_ACCESS_ADMINISTER in print_job_{delete,pause,resume}() - If stat'ing the job file fails, delete the job from printing.tdb - In print_job_end() check lpq cache time and do a print_queue_update() This prevents printing.tdb from growing when using NT/2K clients, and there isn't someone pressing F5 in a port monitor window. - In print_queue_resume() check lpq cache time and do a print_queue_update() Probably should do it for print_job_resume() too. (This used to be commit 0068b7741fd54706ef36ddbbc3092389d281e684)
2001-01-17Changes from APPLIANCE_HEAD:David O'Neill1-3/+0
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-11Changes from APPLIANCE_HEAD:David O'Neill1-15/+32
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-04Changes from APPLIANCE_HEAD:David O'Neill1-70/+36
source/Makefile.in - changes to ctags and etags rules that somehow got lost along the way. source/include/proto.h - make proto source/smbd/sec_ctx.c source/smbd/password.c - merge debugs for debugging user groups and NT token stuff. source/lib/util_str.c - capitalise domain name returned from parse_domain_user() source/nsswitch/wb_client.c - fix broken conditional in debug statement. source/include/rpc_secdes.h source/include/rpc_spoolss.h source/printing/nt_printing.c source/lib/util_seaccess.c - fix printer permission bugs related to ACE masks for printers. This adds mapping of generic access rights to object specific rights for NT printers. Still need to work out whether or not to ignore ACEs with certain flags set, though. See comments in util_seaccess.c:check_ace() for details. source/printing/nt_printing.c source/printing/printing.c - use PRINTER_ACCESS_ADMINISTER instead of JOB_ACCESS_ADMINISTER until we sort out printer/printjob permission stuff. (This used to be commit 1dba9c5cd1e6389734c648f6903abcb7c8d5b2f0)
2000-12-21merge from appliance headGerald Carter1-0/+5
(This used to be commit 393c5f14e0858dcb3d6cb26eb5643b520c2c9686)
2000-12-18Merged Tim's fixes from appliance-head.Jeremy Allison1-4/+8
Jeremy. (This used to be commit 26f873540c2299600cb80eb059fcdaf70ec82473)
2000-12-13Added proto definition for new RPC calls.Jeremy Allison1-32/+15
Added printing fix from appliance-head. Jeremy. (This used to be commit f4c7f9ddb906b67ee4397e7707309356085476d1)
2000-12-11Adding in debug for SD's.Jeremy Allison1-0/+17
Jeremy. (This used to be commit a19f936b644fedc4c59ada5f12172abed9894910)
2000-12-06Sync-up with appliance-head printing code.Jeremy Allison1-48/+46
Jeremy. (This used to be commit fe730614d70b331ec7b1a909940395c9713ea8ac)
2000-12-04c++ style comments are NOT allowedAndrew Tridgell1-1/+0
(This used to be commit 8b3c1f4455b7db440911960298f772c4db3d8112)
2000-12-04no longer pass the type to make_sec_desc(), instead the type isAndrew Tridgell1-4/+0
derived from the other arguments (This used to be commit 9ec4b1fa48fbae937fdf78db06005a7b0cd52d89)
2000-11-27passdb/secrets.c passdb/smbpassfile.c smbd/server.c : Actually *use* the codeJeremy Allison1-1/+10
written to transition from an old DOMAIN.MACHINE.MAC file to secrets.tdb. printing/nt_printing.c: Fix case insensitive name lookups for driver files. John - this should fix the Win9x/WinME problem correctly. Jeremy. (This used to be commit 8f3332a9acf413ac5d12053ca5c52733a4e946cc)
2000-11-17Fix for memory leak when adding driver.Jeremy Allison1-6/+7
Jeremy. (This used to be commit eeab4e0290f9df84025e91c85d27b21e0c02781f)
2000-11-17Fix for incorrect break using wrong offset when updating a form.Jeremy Allison1-6/+4
Jeremy. (This used to be commit 365c76e39d2397a12ac6785a51c4d1529527a356)
2000-11-15Uninitialized memory read fixes.Jeremy Allison1-3/+7
open_file_shared takes a DOS pathname, not a UNIX one. Jeremy. (This used to be commit b2b59b93ff1c5bdc43b099e2db1ee86fe8514152)
2000-11-14Merge from appliance head of JR's changes for driver versioning.Jeremy Allison1-175/+687
Jeremy. (This used to be commit cdbd2e99775642dc2e92004be9014bf38a92d80f)
2000-11-14printing/nt_printing.c: After long soul searching and making both Andrew and myJeremy Allison1-2/+4
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-13Large commit which restructures the local password storage API.Gerald Carter1-1/+2
Currently the only backend which works is smbpasswd (tdb, LDAP, and NIS+) are broken, but they were somewhat broken before. :) The following functions implement the storage manipulation interface /*The following definitions come from passdb/pdb_smbpasswd.c */ BOOL pdb_setsampwent (BOOL update); void pdb_endsampwent (void); SAM_ACCOUNT* pdb_getsampwent (void); SAM_ACCOUNT* pdb_getsampwnam (char *username); SAM_ACCOUNT* pdb_getsampwuid (uid_t uid); SAM_ACCOUNT* pdb_getsampwrid (uint32 rid); BOOL pdb_add_sam_account (SAM_ACCOUNT *sampass); BOOL pdb_update_sam_account (SAM_ACCOUNT *sampass, BOOL override); BOOL pdb_delete_sam_account (char* username); There is also a host of pdb_set..() and pdb_get..() functions for manipulating SAM_ACCOUNT struct members. Note that the struct passdb_ops {} has gone away. Also notice that struct smb_passwd (formally in smb.h) has been moved to passdb/pdb_smbpasswd.c and is not accessed outisde of static internal functions in this file. All local password searches should make use of the the SAM_ACCOUNT struct and the previously mentioned functions. I'll write some documentation for this later. The next step is to fix the TDB passdb backend, then work on spliting the backends out into share libraries, and finally get the LDAP backend going. What works and may not: o domain logons from Win9x works o domain logons from WinNT 4 works o user and group enumeration as implemented by Tim works o file and print access works o changing password from Win9x & NT ummm...i'll fix this tonight :) If I broke anything else, just yell and I'll fix it. I think it should be fairly quite. -- jerry (This used to be commit 0b92d0838ebdbe24f34f17e313ecbf61a0301389)
2000-11-10printing/nt_printing.c: use getpwuid not smbgetpwuid. Canonicalize printernames.Jeremy Allison1-7/+14
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-5/+6
consistent. Still working with Jeremy on this, there is probably more to be done (This used to be commit c4bb9c598cf9781d48bc123a8cbbed9c2049bf89)
2000-11-07Merge of printer security descriptor, info level and printerdataTim Potter1-58/+2
comparison changes from appliance branch. (This used to be commit ae087bdf312806e08848695cad70a943bb3d71b9)
2000-11-04Sync up with Tim's changes in applience-head for SACLs.Jeremy Allison1-49/+44
Jeremy. (This used to be commit 6b94273fc61b26e83c8d791bc626fd52055ef293)
2000-10-26Added John Reillys patch for error code returns from ↵Jeremy Allison1-5/+7
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-14/+42
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-25John Reilly @ HP (who is a wonderful human being and *definately* needsJeremy Allison1-54/+161
CVS commit access :-) has written a simple routine that peeks inside the MS PE printer driver file format and can tell if a driver is W2K or NT4.x. So we can now correctly return the driver version number. Hurrah ! JF - this is the code you always wanted ..... :-) :-). Jeremy. (This used to be commit fd17374e6d888813f4ed7142480cf93b8a16bfef)
2000-10-10got rid of tdb_writelock() and instead lock a chain. tdb_writelock()Andrew Tridgell1-4/+5
is conceptually flawed (This used to be commit 6e4a3585521b7e5928298bd0f1418ff9fbcacfb4)
2000-09-29utils/smbcontrol.c: Fixes from Herb for interactive use.Jeremy Allison1-1/+1
printing/nt_printing.c: No C++ comments please :-). Jeremy. (This used to be commit dd9f668108215f18240458fc33bf872a6fc9e6be)