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

400 Commits

Author SHA1 Message Date
Gerald Carter
7ed3fcad2a fixed a few bugs in new_smb_io_relarraystr().
Marshalling code path now uses spoolss_smb_io_unistr()
also caught a NULL pointer case.

i'll update TNG later.
(This used to be commit bd4c83eb40a14baf447ac88886d4eafe7b9a309f)
2000-08-14 21:18:02 +00:00
Gerald Carter
e2bb0779af fix for new_smb_io_relarraystr() and new_smb_io_relstr()
to use spool_smb_io_unistr() as this does not call prs_align()
befrore parsing the UNISTR.

Parsing a void* buffer from an RPC should not be aligned
on 4 byte boundaries.  Don't think this change affects
any marshalling code, only unmarshalling...




jerry
(This used to be commit bc154e8522a75540a8504195c1e6f45739167e6b)
2000-08-14 03:17:17 +00:00
Gerald Carter
13913e2c97 removed the prs_align in spoolss_smb_io_unistr() (JF, please check)
as it was throwing things off when parsing buffers passed in SPOOLSS
RPCs

fixed the unmarshalling of UNISTR arrays to be double NULL terminated




jerry
(This used to be commit 236f19659cea87cc35128990954d30c43114b889)
2000-08-12 14:51:36 +00:00
Gerald Carter
2ca88a0f2d fixes to prs_unistr UNMARSHALLING only. Problem was due to talloc's
of 0 bytes.



jerry
(This used to be commit 3fcc59ba928250759bbf3ef46d7c118950a5ba6f)
2000-08-12 14:31:29 +00:00
Jeremy Allison
f6795780eb Fixed the problem with UNISTR marshalling in a buffer5 struct.
The smb_io_unistr() code called a prs_align, this was not being
counted in the size or taken account of in the offset calculation.
Fixed size_ calculation to always return a size a multiple of 4
and also set the offset correctly. This fixes the problem I saw
and will hopefully fix the problem HP reported. JF please check
this change.
Jeremy.
(This used to be commit ceba9f3dcdb4bddae17ec0024692c9074086302d)
2000-08-11 23:13:09 +00:00
Gerald Carter
7ce5aacf7e working on the unmarshalling of dependentfiles to a DRIVER_INFO_3
struct.  Not wuite there.





jerry
(This used to be commit 1a145977f09654fc51ebcd40ef7a2aa69aa96cfb)
2000-08-10 14:03:13 +00:00
Gerald Carter
2f9a0f83fe deal with allocation size of 0 in prs_unistr when UNMARSHALLING
jerry
(This used to be commit 26a73a70e282a5e46cc2b6fe7bc09b406724c9dd)
2000-08-10 14:00:40 +00:00
Gerald Carter
a08d444896 More work on AddPrinterDriver() and AddPrinterEx() client RPC's
Also fixed init_unistr() to deal with a NULL source character string.



-jerry
(This used to be commit 8ecd5dd52a6bd867f5d117352048ee43ce7254d9)
2000-08-09 20:14:29 +00:00
Gerald Carter
3a123d2572 cleanup in init_unistr2_from_unistr()
--jerry
(This used to be commit 1e00ac19cd001024fa8007eff5137aac877796fa)
2000-08-08 06:59:35 +00:00
Gerald Carter
f296a8d087 All changes related to rpcclient...
- cleaned up some code
- Fixed a few memory leaks of my own making
- Add AddPrinterDriver(); I'm missing some of the semantics
  here as the call is done correctly, but I'm not getting all
  the information right in the DRIVER_INFO_3 struct I think.
  Will work on it tomorrow some more...



--jerry
(This used to be commit 3bf9a29f34ee4ade5180c5a0b0b9ff4aca7f0f08)
2000-08-08 06:57:48 +00:00
Gerald Carter
8705fbc42c it is not my day it seems. :-(
Fixed missing )


j-
(This used to be commit 7b69cbbde36e51f8f7b74691428a04e8871d8b4a)
2000-08-05 19:18:25 +00:00
Gerald Carter
cfb5d7d84c removed the for() loop to copy the buffer in init_unistr2_from_unistr()
Replaced with a memcpy()



Forgot to commit this a few moments ago


j-
(This used to be commit 34d4fb54c3121d31cb8b29193f71d5e7b5471cdc)
2000-08-05 19:03:00 +00:00
Gerald Carter
139dcbb0bf Fixed bug in init_unistr2_from_unistr() found by Elrond.
Thanks :-)





j-
(This used to be commit 4ecd15cd5851e94808756e3da0ce6a066f0a0cd7)
2000-08-05 18:58:45 +00:00
Gerald Carter
4003a1c55b 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
(This used to be commit e15d9befd24cf5f3410c4be819b2a1fcf68048fb)
2000-08-04 12:46:36 +00:00
Gerald Carter
394795e28b After talking with Jeremy and JF (and staring at packet traces between
NT <-> NT), I've come to realize that UNISTR2 strings should be NULL
terminated.




jerry
(This used to be commit c8f9e54beafcb0c0668f1510e7693dbf22485aa8)
2000-08-04 12:42:19 +00:00
Jeremy Allison
468af1937d 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.
(This used to be commit d6db29be98f717a9038b5ac1ff492c70ce2e92a7)
2000-08-02 18:49:36 +00:00
Jeremy Allison
7f36df301e 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.
(This used to be commit c55bcec817f47d6162466b193d533c877194124a)
2000-08-01 18:32:34 +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
Gerald Carter
f9d3ff99fd 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
(This used to be commit d321d0dddd052b49c94bef8f214be7343337d907)
2000-07-31 14:56:01 +00:00
Tim Potter
b58ebd10de Fixed read overrun in init_string2()
(This used to be commit 4ab75143c4466ad0ea8443512dd5ade449d72462)
2000-07-28 06:27:32 +00:00
Jean-François Micouleau
3cc9e1a6a7 remove warnings
J.F.
(This used to be commit 9178d2a1aac26f8d6533f7dc86ff9b19eb72db8b)
2000-07-27 08:00:25 +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
1e3a5503cd 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.
(This used to be commit 883f7402d495182aeff85152216cc8b3cfc18bef)
2000-07-26 09:40:49 +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
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
Gerald Carter
e5c5b2723f 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
(This used to be commit a2205c6646aa677090908a4e1532ed8590adc0e0)
2000-07-21 19:58:24 +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
Gerald Carter
2de59a3bea fixed a bug (my own) in create_ntc_from_cli_state()
--jerry
(This used to be commit f7bc6df3befb8d0981dbd96f353039a5913321d7)
2000-07-18 05:13:44 +00:00
Gerald Carter
2c46a26a8b 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.
(This used to be commit 3bc9af4c1dbdb664970541f6091982ffccc87b31)
2000-07-14 16:58:03 +00:00
Jean-François Micouleau
6c2242eade we are now sure the printer_info_2 timestamp is updated everytime
required.

	J.F.
(This used to be commit 08b41bab177affac088c981d7c620728e8e6e9b0)
2000-07-12 16:11:33 +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
Gerald Carter
9ab8dfa381 #ifndef RPCCLIENT_TEST
use old prs_unistr()
#else
	use new prs_unistr() which handles UNMARSHALL
#endif /* RPCCLIENT_TEST */



jerry
(This used to be commit fb0e1fb9e31db135eeb8e949a7ad0826906ba1ff)
2000-07-11 16:28:59 +00:00
Gerald Carter
64db2010fb included a a new prs_unistr(). Is currently #if'd out (denoted
by RPCCLIENT_TEST) in order to not break anything in the smbd
code (and to give time to review it).  Originally written by JF.
In effect, this checkin makes no changes to parse_prs.c at all.





jerry
(This used to be commit 4f431ea1f5d1d3b868d0bb56a299070e608c2512)
2000-07-10 19:55:39 +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
541303d969 Fix for passing NULL pointer as an array parameter in
domain_client_validate()
(This used to be commit 3ee111bff78826a5ee419554d4ef2b2b2d3ae7aa)
2000-07-10 04:56:30 +00:00
Gerald Carter
d2b40a7de2 More rpcclient merge issues:
* fixes some readline bugs from the merge
        * first attempt at commands (spoolenum almost works)
        * no changes to existing functions in HEAD; only additions
          of new functions.  I'll weed out what I can as I go.




--jerry
(This used to be commit 61d2aad5dc2b212b11c981f1eca47efa627e9fc8)
2000-07-07 06:20:46 +00:00
Jean-François Micouleau
53e0629979 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.
(This used to be commit 1fae158529ca0d1cb01ff422638418ce0dbd8dbf)
2000-07-04 22:51:05 +00:00
Jean-François Micouleau
b8262b4bdd driver_info_6 had a prs_align() that should not have been there.
J.F.
(This used to be commit a882dd225e464b300cedb52eb43f57f3a56c5b31)
2000-07-04 21:58:45 +00:00
Jeremy Allison
55f9dc2027 Removed unneccessary ()'s afer &'s that made it look like we
don't know how the C language works :-).
Jeremy
(This used to be commit d47329649d4f92a52acac7de256d9d9b0afc33c8)
2000-07-01 05:44:49 +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
8980d53e7c Removed extra uint32 field in auto-notify reply. This fixes some spoolss.exe
crashes but there are still more to work on.
Jeremy.
(This used to be commit aa49dc037fa4e7b00d1a33619da5450a4eda1b9e)
2000-06-28 16:52:59 +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
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
Jean-François Micouleau
4ec7597d11 parsing code for reply[open|close]printer in preparation of the event
stuff.

	J.F.
(This used to be commit 1871d4a3f64401f9a6f749ce26d1715e3bcdeac3)
2000-06-10 22:35:52 +00:00
Jeremy Allison
03e0164270 Luke, I am moving the code back into passdb/passdb.c, this the correct
place to do this, not in smbd/passwd.c

Please don't change this without asking first, I have run this past
Andrew so talk to him (I'm on vacation next week).

I also removed the g_newXXX macros. There are essentially a private C extension,
not used anywhere else in the code, and add no functionality over malloc(XX)
and make the code harder to understand (everyone knows what malloc does).

Jeremy.
(This used to be commit e1b1b6fb6794ba02e1fea510a981fa0ce0d12b58)
2000-06-09 18:45:31 +00:00
Luke Leighton
ad98207f54 dynamic allocation of NET_USER_INFO_3 gids.
jeremy, the intent is to call se_access_check() with usr-sid, grp-sid,
array-of-group-rids (but array-of-group-sids would do).

please do look at smbd/lanman.c's api_NetWkstaGetInfo, it will show you
that we really do need to store the entire NET_USER_INFO_3 structure.

then again, api_NetWkstaGetInfo is only used by win9x so who cares :)
(This used to be commit bd34f652390adc32c4959d164c628687f526d977)
2000-06-09 03:00:34 +00:00
Jeremy Allison
6d38ba721c Moved tdb functions that access parse structs into parse_prs.c
to prevent builkd breaking.
Jeremy.
(This used to be commit 6c7adeab0f92844ecefbcb923d0d4763d4c3eaa5)
2000-06-08 01:16:42 +00:00
Jeremy Allison
b2eef912cf Cause printer SD's to be displayed correctly (full control).
Jeremy.
(This used to be commit 341d07c516865bdd9be99f98cd0754d12b25f9c0)
2000-06-08 00:17:05 +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