1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-28 07:21:54 +03:00
Commit Graph

108 Commits

Author SHA1 Message Date
Jeremy Allison
e0f9de0c49 Implemented DELETEPRINTERDATA (tested with Gerald's Win32 progs).
Jeremy.
(This used to be commit fb48efaf83)
2000-09-09 00:19:35 +00:00
Jeremy Allison
912ecf7fb9 Fixed typo where docname was being checked for datatype - was causing
STARTDOCPRINTER call to fail. I *love* Gerald's test code :-).
Jeremy.
(This used to be commit 43192370f3)
2000-09-08 02:20:48 +00:00
Jeremy Allison
f4ae5a6e38 Win32 API is explicit that EnumPrinterData returns ERROR_MORE_DATA not
ERROR_INSUFICIENT_BUFFER when working out what space is needed. This fix
gives us the same return that WinNT does.
Jeremy.
(This used to be commit a87f6277b1)
2000-09-08 00:28:07 +00:00
Jeremy Allison
8808c4e6c8 Fixed the printerdata code to return NO_MORE_ITEMS if a size is requested
and the parameter index doesn't exist. I think this code can be simplified
considerably, but JF needs to check to be sure.
Jeremy.
(This used to be commit 4d792e6bcb)
2000-09-07 20:56:24 +00:00
Jeremy Allison
6ef7bf0eac Added code to return NO_MORE_ENTRIES when trying to determine
size using "NT mega hack". I think this is the correct thing to
do but JF should also examine the.
Jeremy.
(This used to be commit 29ba3a2cdf)
2000-09-07 19:12:59 +00:00
Jeremy Allison
061fc961cd Fix from John Reilly for double free of printer struct.
Jeremy.
(This used to be commit c15b7e41e1)
2000-09-06 01:55:36 +00:00
Jeremy Allison
d644d4438c Implemented GETFORM tested and working using Gerald's Win32 test progs....
Jeremy.
(This used to be commit 55ed0a9b0c)
2000-09-05 20:56:09 +00:00
David O'Neill
a3a28675fa Changes from APPLIANCE_HEAD (per Tim Potter):
- make proto
	- addition of function to convert from errno values to NT status codes
	  (source/lib/error.c)
	- purge queue done without full access permission will purge only the
	  jobs owned by that user, rather than failing.
	- unlock job database tdb before sending job to printer
	- in print_job_start(), ensure that we don't pick a jobid with an existing
	  temporary file that may be owned by another user, as it causes silent
	  failures.
	- fixes for printer permission checking for NT5 clients
	  (source/include/rpc_spoolss.h, source/printing/nt_printing.c,
	   source/printing/printing.c, source/rpc_server/srv_spoolss_nt.c)
	- change from uint8 to 'enum SID_NAME_USE' (source/rpc_server/srv_lsa.c)
	- fixed memory leaks for win95 driver download process
	  (source/smbd/lanman.c)
	- properly free prs_structs and dacl in testsuite/printing/psec.c
(This used to be commit 74af3e2cae)
2000-09-01 18:49:26 +00:00
Jeremy Allison
fa810d4c80 Implemented DELETEFORM tested using Gerald's Win32 test code :-).
Jeremy.
(This used to be commit 596c21a2af)
2000-08-31 19:04:51 +00:00
Jeremy Allison
c77bf3d9e2 Fixed error returns for moving printer driver files around so generic
"Access denied" isn't always returned. More fixes found using Gerald's
wonderful Win32 test progs :-).
Jeremy.
(This used to be commit 67b9d40e3d)
2000-08-30 21:09:21 +00:00
Jeremy Allison
d407579b94 Implemented AbortPrinter() from Gerald's Win32 test code. Just purge all
possible printjobs from that printer (I think this is correct).
Added error code returns for print_queue_XXX() functions.
Jeremy.
(This used to be commit 6d081a9017)
2000-08-30 00:45:59 +00:00
Andrew Tridgell
9e1f9a5719 yipee!
The spoolss AddJob function has an [in,out] buffer not an [in] buffer
(despite the comment in the code to the contrary). Also, we must fail
this function - not just blindly reply "no problem" as AddJob should
always fail on non-local printers.

This fixes a bug where the "print test page" failed about half the
time. I suspect it will also fix a bunch of other intermittent spoolss
bugs where the client (incorrectly) tries to use the AddJob printing
interface.
(This used to be commit 14e534a890)
2000-08-28 04:42:31 +00:00
Jeremy Allison
f03879e0b3 Tidied up some error returns from printing calls. Still need to map UNIX
errors to NT error for print job failure returns. Patch from John Reilly at HP.
Jeremy.
(This used to be commit 3514b5bb8f)
2000-08-23 23:05:49 +00:00
Jeremy Allison
137b7f873a Added "add_printer_hook" call to update printer for Win9x clients.
Patch from John Reilly <jreilly@hp.com>.
Jeremy.
(This used to be commit 76a5713bd3)
2000-08-10 23:41:16 +00:00
Andrew Tridgell
fadb15da71 got error code right for printer update/add failure
(This used to be commit 0d00d2ec25)
2000-08-09 07:34:35 +00:00
Andrew Tridgell
db24453581 added printer admin option
any user in that list can do anything to a printer
(This used to be commit 7b5912be15)
2000-08-09 04:19:18 +00:00
Jeremy Allison
d95777ac34 Added print job substitutions for %{printername}, %{sharename} and %{portname}
from the NT printer tdb.
Also added checks for time restrictions before allowing a job to print.
Jeremy.
(This used to be commit 8cfb55e81a)
2000-08-01 00:41:19 +00:00
Jeremy Allison
55ff9cb38b Save & restore the port name correctly.
Jeremy.
(This used to be commit c0648c981e)
2000-07-31 21:41:03 +00:00
Jeremy Allison
49fcb300de Added John Reilly's enumports/addprinter/delprinter scripting code plus the
fix for the Win9x printer drivers.
Changed command names to add "command" string on the end for some consistancy
with the other scripting commands.
Added '%P' option to tdbpack/unpack to store long comment string.
Made port name be "Samba Printer Port" if no enum port script given.
Fixed prs_uint32_pre code to cope with null args.
Jeremy.
(This used to be commit 902ada6379)
2000-07-31 20:41:51 +00:00
Jeremy Allison
5ec1642809 Ok - this is a *BIG* change - but it fixes the problems with static strings
in the RPC code. This change was prompted by trying to save a long (>256)
character comment in the printer properties page.

The new system associates a TALLOC_CTX with the pipe struct, and frees
the pool on return of a complete PDU.

A global TALLOC_CTX is used for the odd buffer allocated in the BUFFERxx
code, and is freed in the main loop.

This code works with insure, and seems to be free of memory leaks and
crashes (so far) but there are probably the occasional problem with
code that uses UNISTRxx structs on the stack and expects them to contain
storage without doing a init_unistrXX().

This means that rpcclient will probably be horribly broken.
A TALLOC_CTX also needed associating with the struct cli_state also,
to make the prs_xx code there work.

The main interface change is the addition of a TALLOC_CTX to the
prs_init calls - used for dynamic allocation in the prs_XXX calls.

Now this is in place it should make dynamic allocation of all RPC
memory on unmarshall *much* easier to fix.

Jeremy.
(This used to be commit 0ff2ce543e)
2000-07-27 00:47:19 +00:00
Jean-François Micouleau
134a4b8654 if no comment in TDB, use comment from print share.
J.F.
(This used to be commit c267b23620)
2000-07-26 10:31:05 +00:00
Tim Potter
c89cf814cc Fixed memory leaks in _spoolss_addprinterdriver()
(This used to be commit 1f49788442)
2000-07-26 03:38:30 +00:00
Jeremy Allison
bc22ae0b47 Fixed up error checking and move printer file code. Fixed a memory leak.
Jeremy.
(This used to be commit 5130dd0f8b)
2000-07-25 22:35:57 +00:00
Jeremy Allison
fcbf694957 Added some error checking and returns to the new 'move' code.
Jeremy.
(This used to be commit 0bd88d304c)
2000-07-25 17:09:29 +00:00
Jean-François Micouleau
5a5ef18379 A rather big change set ! (listed in no particular order)
- changed the default forms flag to 2
- all short architecture name are uppercased
- get_short_archi() is now case unsensitive
- the drivers TDB is indexed by archi/version/name
- implemented code to move drivers from the upload area to the download
area. Someone else need to look at that code.
- don't return anymore a default driver if it doesn't exist in the TDB.
Instead return an error.
- cleaned prs_unistr.
- #ifdef out jeremy's new SD parsing in printer_info_2
- removed the unused MANGLE_CODE

- #ifdef out the security checking in update_printer() as it doesn't work
for me.

Zap your ntdrivers.tdb, it won't work anymore.

	J.F.
(This used to be commit ac0a145acc)
2000-07-25 13:15:16 +00:00
Jeremy Allison
ac70155b25 Tidy up code to add printer. Always index in tdb by sharename. This
is beginning to come together...
Jeremy.
(This used to be commit 614bf56186)
2000-07-25 01:50:53 +00:00
Jeremy Allison
78bbcec21b Fixed open handle code in printers - 3 functions were always being done
in order - moved them into open_printer_hnd().
Added saving of comment field.
Jeremy.
(This used to be commit a0ee774fe9)
2000-07-22 00:48:29 +00:00
Jeremy Allison
2637bfee06 rpc_parse/parse_prs.c: Removed extraneous ()'s.
rpc_parse/parse_spoolss.c: Fixed the security descriptor marshalling in a INFO_2 struct.
							for some reason SD's should be done inline after the info2, not
							as the last buffer marshall.
rpc_server/srv_spoolss_nt.c: Removed extraneous ()'s.
Jeremy.
(This used to be commit f038a24e9f)
2000-07-18 19:25:32 +00:00
Tim Potter
9665d3fc7b Missing var.
(This used to be commit 5c1c562226)
2000-07-17 06:04:23 +00:00
Tim Potter
873c0366d9 Free security descriptor after access check in update_printer_sec()
(This used to be commit bc5f9c00be)
2000-07-17 05:38:26 +00:00
Tim Potter
53c91652c6 Renamed arguments to se_access_check()
(This used to be commit 714b50b47d)
2000-07-17 02:38:43 +00:00
Jean-François Micouleau
5813ecff99 - The printers are indexed by the sharename in both get_a_printer() and
add_a_printer() now.

- correctly unpack the private part of a devmode and remove a memleak

- correctly retrieve the pair(value,data) for getprinterdata

- handle null devicemode in printer_info_2

I still have some bugs but I'm not crashing anymore NT4SP6 d/c build :-)


        J.F.
(This used to be commit 493f7d11ac)
2000-07-12 14:10:40 +00:00
Jeremy Allison
445e92eb01 Ensure correct driver paths are returned in INFO_2 struct.
Jeremy.
(This used to be commit 7a95c289cd)
2000-07-10 22:30:13 +00:00
Tim Potter
b561c18597 Fixes for various compile warnings on Solaris 8.
(This used to be commit 898a483cda)
2000-07-10 06:41:04 +00:00
Tim Potter
78a4848e8d Re-instated lanman printing security checks (oops).
A user can now pause, resume or delete their own job even if they don't
have the Manage Documents privilege.

Added call to se_access_check() for changing printer properties.  The Full
Access privilege is required for the user to perform this.

Several uninitialised variables and memory leaks plugged.

Modified default ACL created on new printers to be Everyone / Print instead
of Everyone / Full Access.  This required some random stuffing around with
the value of the revision field to correspond with the ACL that NT produces
when setting the same permission on the printer.

Fixed dodgy function call in printing/printfsp.c
(This used to be commit 2abce4dcfa)
2000-07-10 05:08:21 +00:00
Jeremy Allison
89eafd3cef printing/nt_printing.c: (From JF) use the driver name - already given to us.
printing/printing.c: priority needs to be 1 not zero (found by checked build).
rpc_server/srv_spoolss_nt.c: Log invalid handle access, also print out if this is a different
							pid handle. This will help track down client access after a connection
							is closed.
Jeremy.
(This used to be commit 4ff949228c)
2000-07-06 23:31:46 +00:00
Tim Potter
d01839e49e Pass either an authenticated pipe or SMB user in a current_user struct down
to the printing back end functions.
(This used to be commit a2751a269e)
2000-07-06 06:53:47 +00:00
Jean-François Micouleau
2d2b6a46f7 reverting Jeremy's changes to enumprinterdata.
Jeremy, the out_max_value_len and out_max_data_len were good. Your change
is breaking NT4SP6 checked version.

        J.F.
(This used to be commit 5f2be8ba7d)
2000-07-01 16:40:10 +00:00
Jean-François Micouleau
104217f3b0 Found that the minimum priority is 1 and not 0 on NT.
Changed back the devicemode's devicename to "\\server\printer".

I'm 100% sure it is correct, it's what NT sends on the wire. And that's
the printer's name and NOT the port's name as it has to be unique. It must
also be a UNC because it's a remote printer (remote for the client).

        J.F.
(This used to be commit a7098c47b6)
2000-07-01 09:34:37 +00:00
Jeremy Allison
eed5e03043 Fixed oops with missing MANGLE_PATH directive.
Jeremy.
(This used to be commit fb6b5a9645)
2000-06-30 01:07:26 +00:00
Jeremy Allison
774b06ee21 Tidy up current spool code - added some JRATEST ifdefs to allow
experimentation with what is making spoolss.exe crash - may be removed
later.
Jeremy.
(This used to be commit f3fe384dc3)
2000-06-29 00:52:40 +00:00
Jeremy Allison
36fd3866ef Changing drivers using the properties page works - but only if getting/setting
security descriptors is disabled (as it is in this code).

If get/set sd's is enabled spooler.exe crashes on NT.

I'll investigate and fix that issue next.

Jeremy.
(This used to be commit 8c9ed87436)
2000-06-26 22:08:20 +00:00
Jeremy Allison
ec1c58fcc0 lib/util_sid.c: Uninitialized memory read.
rpc_parse/parse_spoolss.c: Added note about prs_align when marshalling a SEC_DESC...
rpc_server/srv_lsa.c: Tim - your changes broke the display of the 'everyone' group
						when doing file access with no winbindd running. This is a partial
						fix - more when I have analysed this more.
rpc_server/srv_spoolss_nt.c: Fix for the 'change driver' problem ! Hurrah !

Jeremy.
(This used to be commit 151b131ee0)
2000-06-24 00:15:08 +00:00
Jeremy Allison
eecab5c660 Changed enumports to show printernames as ports. In line with 'the grand plan' :-)
Gerald & I discussed with HP. More changes to follow.
Jeremy.
(This used to be commit 193a248bed)
2000-06-22 23:59:22 +00:00
Jeremy Allison
f9e9f98a4a lib/util_unistr.c: Removed ascii_to_unistr() as it does no codepage.
Removed unistr_to_ascii() as it was never used.
printing/nt_printing.c: Removed "DUMMY.XX" files.
rpc_server/srv_spoolss_nt.c: Use dos_PutUniCode() instead of ascii_to_unistr().
							Attempted to fix the "return value" size code based on J.F's
							comments. This needs looking at.
Jeremy.
(This used to be commit de99011bf3)
2000-06-22 01:39:17 +00:00
Jeremy Allison
69c75c8a16 Fixes for Win2k "add printer driver" INFO_LEVEL_6 was wrong, also some
memory fixes.
Jeremy.
(This used to be commit 2a9e645cbd)
2000-06-20 23:58:56 +00:00
Tim Potter
e83ddf6e69 Simplified server pipe implementation by changing arguments passed down
through to the individual pipe api calls.  Instead of passing two
prs_struct pointers, we now pass the pipes_struct pointer which contains
the former information as well as other useful stuff like the vuid.

Pass the vuid from the pipes_struct down to the lower level spoolss
functions to perform security checks.

ZERO_STRUCTP the info_2 structure before filling it.  Free the device mode
field before freeing the info_2 to avoid a memory leak.  Fixed
uninitialised pointer bug in fill_job_info_2().
(This used to be commit a9547b7e3a)
2000-06-16 08:18:09 +00:00
Jeremy Allison
0164047afb Fixing get/set of security descriptors.
Removed ugly hack for NT printing.
Fixed up tdb parse stuff memory leaks.
Jeremy.
(This used to be commit 8ef41f31c5)
2000-06-07 01:49:23 +00:00
Jeremy Allison
d253db1b9a Memory leak fixes.
Jeremy.
(This used to be commit 34b63896ab)
2000-06-06 20:44:58 +00:00
Jeremy Allison
84aa9ad049 Create elements in default, not in read.
Jeremy.
(This used to be commit 0d681ea252)
2000-06-06 01:34:20 +00:00