1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-19 10:03:58 +03:00

599 Commits

Author SHA1 Message Date
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 67b9d40e3df19523714430cb4457717575f2a61e)
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 6d081a9017f87f59b7189ba507e211db01c40af5)
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 14e534a8907c34b53e00a63756efd71903ff9432)
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 3514b5bb8fffd78e3647425d93b74e2e6291bafc)
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 76a5713bd3fad18ec60d12fc3f965f3e9717c159)
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 0d00d2ec258b36d73e865f06d5d11745d7cdafa9)
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 7b5912be150dd590d6195be40b0976305b8716ba)
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 8cfb55e81abebf0354e6d470ed68bbac1d6560ad)
2000-08-01 00:41:19 +00:00
Jeremy Allison
55ff9cb38b Save & restore the port name correctly.
Jeremy.
(This used to be commit c0648c981edef2a29b3a22a7d08aa226ca724e95)
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 902ada63799cf27924c72e24e7593a8c9fb5eba9)
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 0ff2ce543ee54f7364e6d839db6d06e7ef1edcf4)
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 c267b23620677a11f702bfea4885a28e66a05b05)
2000-07-26 10:31:05 +00:00
Tim Potter
c89cf814cc Fixed memory leaks in _spoolss_addprinterdriver()
(This used to be commit 1f49788442b0d1264c70166e727b8588b936e6ec)
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 5130dd0f8b80aed5fb3c0df290b627057cc9b825)
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 0bd88d304cd773e0bbf3e6f7fedcb3b544d41cbe)
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 ac0a145acc0953a6f362497abbf4dfe70aa522a6)
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 614bf56186b5836020a7813855a5108da0ee8433)
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 a0ee774fe92e5d0bc84d1d6729e8c538c67e8aba)
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 f038a24e9f624fdb04cd52769d45783248ce8a38)
2000-07-18 19:25:32 +00:00
Tim Potter
9665d3fc7b Missing var.
(This used to be commit 5c1c5622269c54dca89eb178ca25981ab7928e75)
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 bc5f9c00be5b8c2f6d258f0c95ed3b4fc0201b87)
2000-07-17 05:38:26 +00:00
Tim Potter
53c91652c6 Renamed arguments to se_access_check()
(This used to be commit 714b50b47dab46f5cdde49d7c200b353c2e0398a)
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 493f7d11acf753ba24c88e6cbb73d86a8595a66a)
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 7a95c289cd0b4615d2a5aa8a148c767b57460ffa)
2000-07-10 22:30:13 +00:00
Tim Potter
b561c18597 Fixes for various compile warnings on Solaris 8.
(This used to be commit 898a483cdab1ed7d8ff902c0dc0e0620440ae4cd)
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 2abce4dcfa351051df6e5f789b34fa99c9b81c22)
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 4ff949228c40b6abb2008df8db985562ac2895d2)
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 a2751a269e05d5e46d4b22d6082a5898cdb4526f)
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 5f2be8ba7dcd1eacc169e8d1d53c309e45a5cce6)
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 a7098c47b6ecbd7bb5df1330ea176aa4d463aad3)
2000-07-01 09:34:37 +00:00
Jeremy Allison
eed5e03043 Fixed oops with missing MANGLE_PATH directive.
Jeremy.
(This used to be commit fb6b5a964512dec37f85f8de39c0c06f702aabbd)
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 f3fe384dc39ce49c639a7adf35179a50cb86abf0)
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 8c9ed874363e6a710bc0fe521bb8c4f7ee219587)
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 151b131ee01ef916c072bcdaa9943a2e984a0f45)
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 193a248beda99103c73a0b0ea5e2fbcbb516ce8e)
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 de99011bf3b2a23bd1854a047382a107aaeb9c68)
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 2a9e645cbddef1cddc5c978310b7efed492758d2)
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 a9547b7e3a068941cda5619f05a64e798584535a)
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 8ef41f31c53e14ad057d883810a1cd2301fede2a)
2000-06-07 01:49:23 +00:00
Jeremy Allison
d253db1b9a Memory leak fixes.
Jeremy.
(This used to be commit 34b63896ab1543936d6b9b382ef6727a161b6bf2)
2000-06-06 20:44:58 +00:00
Jeremy Allison
84aa9ad049 Create elements in default, not in read.
Jeremy.
(This used to be commit 0d681ea252e0cf7fdf57d316d2bfe7caa9b4fbf5)
2000-06-06 01:34:20 +00:00
Jeremy Allison
6d8c131f50 Some tidyup fixes (memory leaks etc.). Still no progress with the
"no driver" issue. I'm banging my head against comparitive packet
dumps right now...
Jeremy.
(This used to be commit 03cd4aa1443acd958593f37c61ff9c90a43c660b)
2000-06-05 20:55:57 +00:00
Andrew Tridgell
dbf004bdab added a MANGLE_DRIVER_PATH define to chooose whether we stuff with the
driver path do a rename etc.

I turned it off by default as it is causing me no end of problems. The
client will *cache* this path, and that screws things up badly as the
temp directory is no longer there when it is needed.
(This used to be commit 46f5f41c88b6ffa117d30f7702628b43dd456902)
2000-06-04 00:26:08 +00:00
Jeremy Allison
5a5540f87a rpc_client/cli_lsarpc.c: Removed unused variable.
rpc_server/srv_spoolss_nt.c: Fixed more memory leaks.
smbd/nttrans.c: Fixed shadow variable problem.
Jeremy.
(This used to be commit f0a7540831181d3a47e7f8ce8be55a36a2f2aba1)
2000-06-03 00:53:07 +00:00
Jeremy Allison
0cc1389935 More memory leak and PANIC action fixes.
This is *horrible* code :-(.
Jeremy.
(This used to be commit ac383bb765ea606fc1105aa91470fcdf453d9335)
2000-06-02 21:16:39 +00:00
Jeremy Allison
c7d0975183 More memory leak fixes.
Jeremy.
(This used to be commit 4e7b6b20eabe02f1ab74254607178ba35e61c9ce)
2000-06-02 20:08:28 +00:00
Jeremy Allison
2472ab1e60 More memory corruption (leaks etc.) fixes.
Jeremy.
(This used to be commit 71a0621f552083880e89923055e8bd14d0b1b82f)
2000-06-02 19:42:11 +00:00
Jeremy Allison
01c4ecd234 Fixed null pointer indirect in addprinterex. Still working on problem
with extra directory layer in NT drivers.
Jeremy.
(This used to be commit 48a80318269c832e702678237e86ba55c10444f1)
2000-06-02 18:38:49 +00:00
Jeremy Allison
8ff6458a3e More insure found memory leak and corruption fixes.
Jeremy.
(This used to be commit 3cdcfa6325b9cd2d7f7c90c4b2d1c6ec73fc2f6d)
2000-06-01 21:52:49 +00:00
Jeremy Allison
b9fedcb2de param/loadparm.c: Looks like someone ran indent on this !
passdb/smbpass.c: Insure uninitialized memory reference fix.
printing/nt_printing.c:
rpc_server/srv_spoolss_nt.c: Insure memory leak fixes.
smbd/unix_acls.c: Shadow ref fix.
Jeremy.
(This used to be commit d175d3ebefc053e9badd91ca5f2d8bd03eb6705d)
2000-06-01 21:00:37 +00:00