1
0
mirror of https://github.com/samba-team/samba.git synced 2025-06-21 03:17:08 +03:00

228 Commits

Author SHA1 Message Date
Gerald Carter
e15d9befd2 clunky support for calling AddPrinterEx(). The code currently reports
that the call failed, but the printer shows up on the remote NT client.
(note this is the client side call).  I've botched the return value
somewhere and will fix that today.




jerry
-
Jeremy Allison
d6db29be98 Much though I hate to admit it - JF was completely correct. I cannot
now reproduce the bug I had with adding a printer driver, and PrintMig.exe
crashes if I use my SD code but works with his.
I stand completely corrected :-). - So I'm reverting to his code as it works :-).
Jeremy.
-
Jeremy Allison
c55bcec817 Tidyup removing many of the 0xC0000000 | NT_STATUS_XXX stuff (only need NT_STATUS_XXX).
Removed IS_BITS_xxx macros as they were just reproducing "C" syntax in a more
obscure way.
Jeremy.
-
Jeremy Allison
902ada6379 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.
-
Gerald Carter
d321d0dddd More work on rpcclient...
* Fixed to work with Jeremy's recent changes re: dunamic
    memory allocation when unmarshalling unistr[2]
  * included EnumPorts level 1
  * more work on AddPrinterEx




--jerry
-
Jean-François Micouleau
9178d2a1aa remove warnings
J.F.
-
Jeremy Allison
0ff2ce543e 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.
-
Jean-François Micouleau
883f7402d4 Found out that we are crashing spoolss in enumprinterdata.
So fixed enumprinterdatas in rpcclient to debug the server code,
and found that the parsing code was missing 2 prs_align().

We are not crashing NT anymore. :-)

        J.F.
-
Jean-François Micouleau
ac0a145acc 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.
-
Jeremy Allison
a0ee774fe9 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.
-
Gerald Carter
a2205c6646 Added functions for enumerating ports on remote print server.
Tim,  You should also look at new_smb_io_printer_info_2()
and see if the change from NULL to &i regarding the secdesc is ok.




jerry
-
Jeremy Allison
f038a24e9f 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.
-
Gerald Carter
3bc9af4c1d removed prs_data(), prs_free_data(), and prs_realloc_data()
as these were unneeded and replaced by the real functions
already in HEAD.

Added a few more functions to parse_spoolss.c to help with the
rpcclient merge from TNG.
-
Jean-François Micouleau
08b41bab17 we are now sure the printer_info_2 timestamp is updated everytime
required.

	J.F.
-
Jean-François Micouleau
493f7d11ac - 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.
-
Tim Potter
898a483cda Fixes for various compile warnings on Solaris 8. -
Jean-François Micouleau
1fae158529 the dummy field in driver_info_6 is before the driver version and not
after.

I don't know who broke all that code, but I'm  ******** (censured)

	J.F.
-
Jean-François Micouleau
a882dd225e driver_info_6 had a prs_align() that should not have been there.
J.F.
-
Jeremy Allison
d47329649d Removed unneccessary ()'s afer &'s that made it look like we
don't know how the C language works :-).
Jeremy
-
Jeremy Allison
f3fe384dc3 Tidy up current spool code - added some JRATEST ifdefs to allow
experimentation with what is making spoolss.exe crash - may be removed
later.
Jeremy.
-
Jeremy Allison
aa49dc037f Removed extra uint32 field in auto-notify reply. This fixes some spoolss.exe
crashes but there are still more to work on.
Jeremy.
-
Jeremy Allison
8c9ed87436 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.
-
Jeremy Allison
151b131ee0 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.
-
Jeremy Allison
2a9e645cbd Fixes for Win2k "add printer driver" INFO_LEVEL_6 was wrong, also some
memory fixes.
Jeremy.
-
Jean-François Micouleau
1871d4a3f6 parsing code for reply[open|close]printer in preparation of the event
stuff.

	J.F.
-
Jeremy Allison
34b63896ab Memory leak fixes.
Jeremy.
-
Jeremy Allison
03cd4aa144 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.
-
Andrew Tridgell
6506e6f470 simple increment bug in uniarray_2_dosarray -
Andrew Tridgell
417a88fc6a no space was being reserved for the security descriptor in the parse
buffer
-
Jeremy Allison
ac383bb765 More memory leak and PANIC action fixes.
This is *horrible* code :-(.
Jeremy.
-
Jeremy Allison
48a8031826 Fixed null pointer indirect in addprinterex. Still working on problem
with extra directory layer in NT drivers.
Jeremy.
-
Jeremy Allison
3cdcfa6325 More insure found memory leak and corruption fixes.
Jeremy.
-
Jeremy Allison
eba31e4e80 Back to building. Now to test with insure.
Added some frees needed to stop memory leaks.
Jeremy.
-
Jeremy Allison
c2099cfb03 Getting back to a compilable state (not there yet but close).
Added patches for random -> sys_random.
Added set_effective_xxx patches for AFS code.
Memory allocation changes in spoolss code.
Jeremy.
-
Luke Leighton
726c359d1d moved notif_y_table struct to spoolss_nt.c only used there.
#ifdef'd driver-code out with define RELIES_ON_SMBD_SPECIFIC_CODE because
spoolssd doesn't link with smbd/*.c (find_service("print$") is not
possible).
-
Luke Leighton
3f976e7139 hack to get setprinter working, level2, null sec desc. -
Luke Leighton
f9f2a04fdb security descs in spoolss. needs parse_sec.c nttrans.c broken. -
Andrew Tridgell
4fef181af3 a fairly big change in spoolss.
got rid of the forms, drivers and printers files in the nt drivers
directory and instead use a single tdb

note that this is _not_ all finished.
-
Andrew Tridgell
87d9bac3a1 don't call prs_dump() here -
Andrew Tridgell
4de7202da4 changed uniarray_2_ascarray to uniarray_2_dosarray -
Jeremy Allison
eefbfb5e16 Added unicode_to_dos_char() function to address converting single UNICODE
characters to one or more DOS codepage characters.
Jeremy.
-
Andrew Tridgell
974813f0d4 added spool_io_printer_driver_info_level_6()
thsi function and the associated header structure were autogenerated
using a little awk based code geerator I wroe ths evening. I'll commit
that next ...
-
Andrew Tridgell
e72a571853 added support for deleting printers into the spoolss system -
Andrew Tridgell
d7cd7c88fd moved trans2.h and nterr.h into includes.h with all our other includes -
Jeremy Allison
9a118cd4a2 Modified interfaces and added checks around *all* *alloc calls
so that errors are returned on memory allocation failure.
Jeremy.
-
Jean-François Micouleau
cef44398f9 off by one error ...
J.F.
-
Jean-François Micouleau
396f73c11b changed all the status code to ERROR_xxx instead of NT_STATUS_xx which are
wrong in the spoolss case.

fxed a bug in the job notify code (that's the polite answer), the truth is
different: there is a bug in the NT spooler service, including SP6a and
NT2K.

changed the default lpcommand in the LPRNG case.

	J.F.
-
Jean-François Micouleau
c212fbe009 rewrote getprinterdriver level 3, now correctly handle the dependent
files.
A number of memleak fixed
some error return values fixed.

	J.F.
-
Jeremy Allison
53721fbc7d rpc_parse/parse_spoolss.c: Added checks on mallocs/overflow checks on all prs_xx
calls.
smbd/connection.c: Fix from David Lee <T.D.Lee@durham.ac.uk>.
Jeremy.
-
Jean-François Micouleau
4847f7b17b oops ! forgot smb.h in last commit
added info level 1 parsing code for addprinter(ex)

	J.F.
-