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

490 Commits

Author SHA1 Message Date
Tim Potter
3478427f2e Port of lsa_lookup_sids() and lsa_lookup_names() rpc client functions from
TNG branch.

Re-instated lsa_lookup_sids and lsa_lookup_names functions in rpcclient.

This requires most samba binaries to link in another handful of object
files due to uncessary coupling between modules.  )-:
(This used to be commit 817819d0cc)
2000-12-08 03:34:00 +00:00
Andrew Tridgell
0e494d7ec6 no longer pass the type to make_sec_desc(), instead the type is
derived from the other arguments
(This used to be commit 9ec4b1fa48)
2000-12-04 01:58:22 +00:00
Jean-François Micouleau
0e84103a54 alignment issues.
I hate that job ...

	J.F.
(This used to be commit 97e3b29356)
2000-11-29 14:39:06 +00:00
Gerald Carter
af85ca538c o fixed logon script problems (wrong len in reply to net_sam_logon for
a few strings).  I was the one who broke it obviously.

o changed a few more defaults in the smbpasswd backend with
  respect to times.  Now the logon time becomes '0' and the
  pass_can_change_time is set ot the same as pass_last_set_time

o change Get_Pwnam() call in local_lookup_name to sys_getpwnam()
  as it did not seem necessary to try case permutations in the
  username.

  Tim,  I think this was your code, so you might want to double
  check me.


-- jerry
(This used to be commit 37a665002c)
2000-11-22 19:51:41 +00:00
Jeremy Allison
6003be4856 ADDPRINTERDRIVER info level 6 fix - this is dynamic depending
on a field in the struct - that's why it was so hard to find.
Jeremy.
(This used to be commit 0ab6eb01b0)
2000-11-22 01:26:09 +00:00
Jeremy Allison
2bd3a436fd Fix for updating of print queues changed from a local box. Essentially,
this makes sure that the change messages sent to ourselves are handled
synchronously w.r.t. other smb packets incoming.
Jeremy.
(This used to be commit 78a1307445)
2000-11-21 00:30:15 +00:00
Jeremy Allison
475fb713a9 Fix for memory leak when adding driver.
Jeremy.
(This used to be commit eeab4e0290)
2000-11-17 02:22:35 +00:00
Gerald Carter
9fede0dc0d Large commit which restructures the local password storage API.
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 0b92d0838e)
2000-11-13 23:03:34 +00:00
Jeremy Allison
6cc6a4f3f3 rpc_parse/parse_spoolss.c: Updated comment for old version of W2K.
tdb/tdbutil.c: With varargs uint16 is cast to (int).
Jeremy.
(This used to be commit 98764c5df9)
2000-11-10 21:24:09 +00:00
Jeremy Allison
c1900772ce printing/nt_printing.c: use getpwuid not smbgetpwuid. Canonicalize printernames.
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 b17e23a8ff)
2000-11-10 19:36:34 +00:00
Tim Potter
8a190a9e46 Merge of printer security descriptor, info level and printerdata
comparison changes from appliance branch.
(This used to be commit ae087bdf31)
2000-11-07 02:54:50 +00:00
Jeremy Allison
d4959bdbdc Only use prs_uint8s on marshalling as we know we're little endian. On
unmarshalling use prs_uint16s. Yes this sucks :-).
Jeremy.
(This used to be commit 3d68257850)
2000-10-30 21:47:20 +00:00
Jeremy Allison
dc0b638489 Fixed double btyte-swap problems with bigendian architectures.
Jeremy.
(This used to be commit c96a77957b)
2000-10-30 19:45:22 +00:00
Tim Potter
60661e1d28 Fixes for io_q_setprinter rpc parsing.
(This used to be commit 1b86b9139e)
2000-10-18 00:55:02 +00:00
Jean-François Micouleau
85643cd72c last part of W2K support.
the trust domain list reply on netlogon pipe was wrong, interim hack until
we have full trust relationships.

changed some unistr2 to parse the ending NULL char.

added a prs_align_needed() function. much like a prs_align but with a
condition. needed for the unistr2 parsing.

	J.F.
(This used to be commit d8bf81553c)
2000-10-13 14:02:01 +00:00
Herb Lewis
8719c27726 changes to sync with 2.2. tree
.cvsignore              remove config.h - not in this directory
include/profile.h       profile changes
lib/messages.c          added message to return debug level
libsmb/clierror.c       cast to get rid of compiler warning
libsmb/smbencrypt.c     cast to get rid of compiler warning
profile/profile.c       add flush profile stats changes for profile struct
rpc_parse/parse_samr.c  fix for compiler warning
rpc_server/srv_samr.c   cast to get rid of compiler warning
smbd/ipc.c              profile stats
message.c               profile stats
smbd/negprot.c          profile stats
smbd/nttrans.c          profile stats
smbd/trans2.c           profile stats
utils/smbcontrol.c      new flush stats command
(This used to be commit bbb24daa25)
2000-10-11 05:31:39 +00:00
Jean-François Micouleau
11d999f2bc a netlogon enum trust query doesn't have a function_code at end.
a sam_user_info_24 doesn't have a uint16 at end
samr_create_user also creates the unix account now
samr_set_userinfo changes the password.

        J.F.
(This used to be commit 94f4024481)
2000-10-10 13:08:55 +00:00
Jean-François Micouleau
75c346e70c added samr_set_user_info and info_2.
cleanup of create_user
cleanup of rid/sid mix in samr. now we only have sid.

some prs_align() missing in parse_samr.c

a small debug change in srv_pipe.c

You still can't change a user's password in this commit.
Will be availble in the next one.

	J.F.
(This used to be commit b655bc281f)
2000-10-07 15:56:36 +00:00
Jean-François Micouleau
a4cd5013f5 fixing prs_unistr2(). For the special case of an empty (but existing)
string.

	J.F.
(This used to be commit 83bfe94771)
2000-10-05 12:41:31 +00:00
Jeremy Allison
23f78fd7b9 Adding Herb's compile warning fixes to HEAD.
Jeremy.
(This used to be commit d131ad1ce3)
2000-10-04 01:03:23 +00:00
Jeremy Allison
c5ca95aeb1 Fixes from Herb - compiler warnings.
Jeremy.
(This used to be commit d9d3668fa3)
2000-10-03 18:29:12 +00:00
Jean-François Micouleau
b06d83c909 fixed samr_create_user(). we now correctly parse the query and the reply.
And we create the disabled account. That means we can create user and
trust accounts remotely !

ifdef out a return in passdb/smbpass.c. I think I didn't break any
security. Jeremy could you check if I didn't make any mistakes ???

	J.F.
(This used to be commit 416be1b64f)
2000-09-28 17:35:03 +00:00
Jean-François Micouleau
8c93ddf3e0 samr unknown 0x32 is in fact samr create user.
so renamed and tidy up of the server function.

	J.F.
(This used to be commit 0f707ac1fb)
2000-09-27 13:02:57 +00:00
Jean-François Micouleau
233bc00020 printer notify code.
It only sends notifies to one client. The broadcasting notify code will
code soon.

	J.F.
(This used to be commit 4c63c91858)
2000-09-25 21:05:18 +00:00
Jeremy Allison
0fc271ea4a Some code moved back from TNG - updates to LSA stuff. Not yet used but
will be needed soon.
Jeremy.
(This used to be commit f0aa8f9314)
2000-09-20 22:07:56 +00:00
Jeremy Allison
13904f585c param/loadparm.c: Fix based on Damian's code to stop printer scripts getting overwritten.
rpc_parse/parse_spoolss.c: Tidyup to call function for relstring arrays.
Win2000 now does "Add Printer" successfully !!!!!

Jeremy.
(This used to be commit d666b958bc)
2000-09-19 22:32:56 +00:00
Jean-François Micouleau
a2c82976b8 in a printer_info_6, driver version is 64 bits long and there is a 32 bit
padding before.

	J.F.
(This used to be commit cd41d7a354)
2000-09-16 10:07:46 +00:00
Jeremy Allison
244c296199 Fixes from JF as I didn't understand the string array sizing code correctly.
Jeremy.
(This used to be commit 63a7d0fc35)
2000-09-15 21:20:49 +00:00
Jeremy Allison
ccddd111c6 Move towards getting W2k p&p to upload NT4.x drivers. Still doesn't work -
not sure why (JF - a glance at this would be appreciated). Removed code
that JF objected to with enumprinterdata. Added translations to/from
level 6 - but Win2k still not happy... hmmm...
Jeremy.
(This used to be commit e5d98ba9e9)
2000-09-15 00:15:10 +00:00
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
a1f66a820d Fix for the SID history problem when using a Win2k domain controller
with security=domain. Also fixed to dynamically allocate the SIDs and GIDs.
Jeremy.
(This used to be commit 2b1f66eb82)
2000-09-06 01:06:39 +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
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
b26e3d2525 Fixed overrun write error when using debuglevel > 50.
Jeremy.
(This used to be commit 3d9b163655)
2000-08-30 22:54:54 +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
Gerald Carter
82149af29f added comment for my own memory purposes
jerry
(This used to be commit b64ddbd1aa)
2000-08-17 20:03:53 +00:00
Gerald Carter
a9b2a40682 hack for unmarshalling unistr's on machines with BIG_ENDIAN arch
I think we have a lot more of these bugs lurking (i'm fairly
confident of it).




jerry
(This used to be commit 3b14487c7e)
2000-08-16 03:44:04 +00:00
Gerald Carter
4620c70549 - fixed memcpy bug in copy_unistr2()
- init_unistr2_from_unistr() does not NULL terminate
  the buffer



--jerry
(This used to be commit 65ee5f9b6e)
2000-08-16 03:41:02 +00:00
Jeremy Allison
0631c6e3a7 Tidied up extra ()'s.
Jeremy
(This used to be commit f94f37dcab)
2000-08-15 02:33:27 +00:00
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 bd4c83eb40)
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 bc154e8522)
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 236f19659c)
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 3fcc59ba92)
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 ceba9f3dcd)
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 1a145977f0)
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 26a73a70e2)
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 8ecd5dd52a)
2000-08-09 20:14:29 +00:00
Gerald Carter
3a123d2572 cleanup in init_unistr2_from_unistr()
--jerry
(This used to be commit 1e00ac19cd)
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 3bf9a29f34)
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 7b69cbbde3)
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 34d4fb54c3)
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 4ecd15cd58)
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 e15d9befd2)
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 c8f9e54bea)
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 d6db29be98)
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 c55bcec817)
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 902ada6379)
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 d321d0dddd)
2000-07-31 14:56:01 +00:00
Tim Potter
b58ebd10de Fixed read overrun in init_string2()
(This used to be commit 4ab75143c4)
2000-07-28 06:27:32 +00:00
Jean-François Micouleau
3cc9e1a6a7 remove warnings
J.F.
(This used to be commit 9178d2a1aa)
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 0ff2ce543e)
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 883f7402d4)
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 ac0a145acc)
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 a0ee774fe9)
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 a2205c6646)
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 f038a24e9f)
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 f7bc6df3be)
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 3bc9af4c1d)
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 08b41bab17)
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 493f7d11ac)
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 fb0e1fb9e3)
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 4f431ea1f5)
2000-07-10 19:55:39 +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
541303d969 Fix for passing NULL pointer as an array parameter in
domain_client_validate()
(This used to be commit 3ee111bff7)
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 61d2aad5dc)
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 1fae158529)
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 a882dd225e)
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 d47329649d)
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 f3fe384dc3)
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 aa49dc037f)
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 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
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
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 1871d4a3f6)
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 e1b1b6fb67)
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 bd34f65239)
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 6c7adeab0f)
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 341d07c516)
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 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
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 03cd4aa144)
2000-06-05 20:55:57 +00:00
Andrew Tridgell
f87246df62 simple increment bug in uniarray_2_dosarray
(This used to be commit 6506e6f470)
2000-06-05 14:06:13 +00:00
Andrew Tridgell
d48c727c97 no space was being reserved for the security descriptor in the parse
buffer
(This used to be commit 417a88fc6a)
2000-06-04 23:34:55 +00:00
Andrew Tridgell
3ca34cc49f sec_desc_size() needs to handle a null secdesc
(This used to be commit b152d75ea6)
2000-06-04 23:34:11 +00:00
Jeremy Allison
0cc1389935 More memory leak and PANIC action fixes.
This is *horrible* code :-(.
Jeremy.
(This used to be commit ac383bb765)
2000-06-02 21:16:39 +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 48a8031826)
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 3cdcfa6325)
2000-06-01 21:52:49 +00:00
Jeremy Allison
61ab5b46cf Back to building. Now to test with insure.
Added some frees needed to stop memory leaks.
Jeremy.
(This used to be commit eba31e4e80)
2000-06-01 18:17:22 +00:00
Jeremy Allison
f0080e5a39 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.
(This used to be commit c2099cfb03)
2000-06-01 17:01:34 +00:00
Andrew Tridgell
85295c5c09 init_unistr takes a const 2nd arg
(ps: I hate const)
(This used to be commit 7030b7f06a)
2000-05-28 23:07:26 +00:00
Luke Leighton
b38aa95bc9 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).
(This used to be commit 726c359d1d)
2000-05-28 21:01:14 +00:00
Luke Leighton
6ec1ae35b4 hack to get setprinter working, level2, null sec desc.
(This used to be commit 3f976e7139)
2000-05-27 04:51:02 +00:00
Luke Leighton
a65dead017 security descs in spoolss. needs parse_sec.c nttrans.c broken.
(This used to be commit f9f2a04fdb)
2000-05-27 01:26:34 +00:00
Shirish Kalele
f3c44fba11 Fixed memory leak in RPC parsing code.
Problem in prs_set_buffer_size() was Realloc returns a NULL when newsize is zero (equivalent to a free()). We were returning a failure here without resetting the buffer_size or the data_p pointer in the prs_struct. And we weren't checking for a failure from prs_set_buffer_size(). So realloc's to zero size were not reflected in the prs_struct: memory leak.
(This used to be commit 590d9ece84)
2000-05-26 22:37:08 +00:00
Andrew Tridgell
68239f38fd 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.
(This used to be commit 4fef181af3)
2000-05-24 06:20:42 +00:00
Shirish Kalele
74d677ec59 Added the NETDFS pipe to allow remote administration of the msdfs symlinks
on the samba server.
(This used to be commit 15e7d8f6c5)
2000-05-18 18:43:53 +00:00
Jeremy Allison
819c154498 Fixed bug I introduced last night (sorry). Now truncate incoming prs_struct
buffer size to exact size of incoming data to prevent read overruns into slop
space.
Jeremy.
(This used to be commit aa1a4f46da)
2000-05-17 19:17:16 +00:00
Jeremy Allison
c560164030 Fixed bug where mallocd size of prs_struct could be larger than
incoming packet. Ensure new alloced memory is zeroed before use.
Jeremy.
(This used to be commit 1c3193aa1c)
2000-05-17 03:12:56 +00:00
Jeremy Allison
91b736d258 Synced up srv_samr with HP changes. Added error checking to original code
- what a concept :-). All this code will be replaced with TNG stuff anyway,
so not a big deal....
Jeremy.
(This used to be commit b090cff4b5)
2000-05-16 19:45:26 +00:00
Jeremy Allison
ad9a3a16e0 Added Shirish's reg changes to HEAD. Sync up with 2.2.0 backport.
Also added prs_xx error return checks to new code in rpc_parse/parse_reg.c
Jeremy.
(This used to be commit a148cb9962)
2000-05-15 20:53:08 +00:00
Andrew Tridgell
b599ae9e40 don't call prs_dump() here
(This used to be commit 87d9bac3a1)
2000-05-15 09:59:25 +00:00
Andrew Tridgell
bb01686063 update grow_size in prs_grow
(This used to be commit a42da20536)
2000-05-15 09:58:58 +00:00
Andrew Tridgell
414caf80a2 make prs_dump() store up to 100 variants of each msg type
(This used to be commit 0e7819bb45)
2000-05-15 07:17:34 +00:00
Andrew Tridgell
b3373e9932 changed uniarray_2_ascarray to uniarray_2_dosarray
(This used to be commit 4de7202da4)
2000-05-12 14:28:50 +00:00
Jeremy Allison
fa659fea9b Added unicode_to_dos_char() function to address converting single UNICODE
characters to one or more DOS codepage characters.
Jeremy.
(This used to be commit eefbfb5e16)
2000-05-12 14:28:48 +00:00
Andrew Tridgell
0806cf75ff 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 ...
(This used to be commit 974813f0d4)
2000-05-12 14:28:46 +00:00
Andrew Tridgell
ddc9b8b406 more merging
it is now at the stage that winbindd can compile in the head branch,
but not link
(This used to be commit d178c00aae)
2000-05-10 09:49:55 +00:00
Andrew Tridgell
c23e01d049 the beginnings of a new scheme I've working on to allow an easier
head/tng merge.

It goes something like this:

- headers from tng get copied over one at a time

- the old headers get renamed to *_old.h

- server side code that used the old headers gets a
  #define OLD_NTDOMAIN 1
  #undef OLD_NTDOMAIN
  at the start and end of the code

- mkproto.awk recognises these special defines and does magic stuff so
  that each .c file sees the right headers

- we start moving the rpc client libraries from tng to head.

if this goes OK then, in theory, we should be able to move the client
side rpc code from tng to head without disturbing the existing head
server side code. Then when that works we can consider merging the
server side.

it remains to be seen if this scheme will work. So far I've moved
rpc_samr.h and don't seem to have broken anything.

Note this this is still a very delicate operation, as at every step of
the way I want to keep head fully functional. Please don't take part
unless you discuss it with me first.
(This used to be commit f76c037255)
2000-05-09 13:28:19 +00:00
Jeremy Allison
99352a0986 Insure uninitialized memory read fixes.
Jeremy.
(This used to be commit 577ddbfbec)
2000-05-03 02:24:01 +00:00
Andrew Tridgell
59fa2dbe2c added support for deleting printers into the spoolss system
(This used to be commit e72a571853)
2000-05-02 15:31:55 +00:00
Shirish Kalele
b39cee0bb9 Added info level 1005 to netsharegetinfo (is the share a DFS root)
Added dfs_server announcement in set_default_server_announce_type()
(This used to be commit 99d07e1352)
2000-04-28 18:36:47 +00:00
Andrew Tridgell
00e3fe1324 moved trans2.h and nterr.h into includes.h with all our other includes
(This used to be commit d7cd7c88fd)
2000-04-25 14:06:57 +00:00
Jeremy Allison
a130656fc0 rpc_parse/parse_rpc.c: Changes from TNG (thanks Luke) for NTLMSSP parsing.
smbd/reply.c: Fixed typo in debug.
Jeremy.
(This used to be commit c2aa6d66b3)
2000-04-13 18:38:00 +00:00
Jeremy Allison
aac823aca1 Modified interfaces and added checks around *all* *alloc calls
so that errors are returned on memory allocation failure.
Jeremy.
(This used to be commit 9a118cd4a2)
2000-04-06 22:48:53 +00:00
Jean-François Micouleau
974cf7d7c9 off by one error ...
J.F.
(This used to be commit cef44398f9)
2000-04-05 17:53:45 +00:00
Jean-François Micouleau
dc2d1544b3 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.
(This used to be commit 396f73c11b)
2000-04-05 10:05:32 +00:00
Tim Potter
772ab755cd Fixed spelling of Andrew's name. (-:
(This used to be commit b912fb7dd2)
2000-03-30 06:42:34 +00:00
Jean-François Micouleau
6ca0ed9baa rewrote getprinterdriver level 3, now correctly handle the dependent
files.
A number of memleak fixed
some error return values fixed.

	J.F.
(This used to be commit c212fbe009)
2000-03-29 12:36:44 +00:00
Jeremy Allison
614929752e 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.
(This used to be commit 53721fbc7d)
2000-03-25 01:37:08 +00:00
Jeremy Allison
8f1620125d acconfig.h configure configure.in: Added check for UT_SYSLEN for utmp code.
include/byteorder.h: Added alignment macros.
include/nameserv.h: Added defines for msg_type field options - from rfc1002.
lib/time.c: Typo fix.
lib/util_unistr.c: Updates from UNICODE branch.
printing/nt_printing.c: bzero -> memset.
smbd/connection.c: Added check for UT_SYSLEN for utmp code.

Other fixes : Rollback of unapproved commit from Luke.
Please *ask* next time before doing large changes to HEAD.

Jeremy.
(This used to be commit f02999dbf7)
2000-03-22 19:03:12 +00:00
Luke Leighton
b89b75a368 added the following message to all dce/rpc client/server code, except
the spoolss code (it's cut from TNG) and the smb-dce/rpc interface
code that jeremy has been working up to TNG-functionality.

i also want this message to go into SAMBA_2_0 and SAMBA_2_0_RELEASE,
because it is intolerable that potentially good modifications be made
to code that is going to be thrown away, and people waste their time
fixing bugs and adding enhancements that have already been carried
out already, up to two years ago in the TNG branch.

/*
 * THIS CODE IS OUT-OF-DATE BY TWO YEARS, IS LEGACY DESIGN AND VERY, VERY,
 * INCOMPLETE.  PLEASE DO NOT MAKE ANY FURTHER ENHANCEMENTS TO THIS CODE
 * UNLESS THEY ARE ALSO CARRIED OUT IN THE SAMBA_TNG BRANCH.
 *
 * PLEASE DO NOT TREAT THIS CODE AS AUTHORITATIVE IN *ANY* WAY.
 *
 * REPEAT, PLEASE DO NOT MAKE ANY MODIFICATIONS TO THIS CODE WITHOUT
 * FIRST CHECKING THE EQUIVALENT MODULE IN SAMBA_TNG, UPDATING THAT
 * FIRST, *THEN* CONSIDER MAKING THE SAME MODIFICATION IN THIS BRANCH
 *
 * YOU WILL, ALMOST GUARANTEED, FIND THAT THE BUG-FIX OR ENHANCEMENT THAT
 * YOU THINK IS NECESSARY, HAS ALREADY BEEN IMPLEMENTED IN SAMBA_TNG.
 * IF IT HAS NOT, YOUR BUG-FIX OR ENHANCEMENT *MUST* GO INTO SAMBA_TNG
 * AS THE SAMBA_TNG CODE WILL REPLACE THIS MODULE WITHOUT REFERENCE TO
 * ANYTHING IN IT, WITH THE POSSIBLE RISK THAT THE BUG-FIX OR ENHANCEMENT
 * MAY BE LOST.
 *
 * PLEASE OBSERVE AND RESPECT THIS SIMPLE REQUEST.
 *
 * THANK YOU.
 *
 * lkcl@samba.org
 */
(This used to be commit cfaea90529)
2000-03-22 10:26:09 +00:00
Jean-François Micouleau
c5fbb293a8 oops ! forgot smb.h in last commit
added info level 1 parsing code for addprinter(ex)

	J.F.
(This used to be commit 4847f7b17b)
2000-03-13 19:34:04 +00:00
Jean-François Micouleau
79bfb14318 parse correctly getprinterdriver2
found a stupid bug in enumprinters
fixed some memleaks
found a coredump in enumprinterdata
getprinterdriverdir responds correctly now.

	J.F.
(This used to be commit 07f2e194ba)
2000-03-13 11:09:20 +00:00
Jean-François Micouleau
e0ebb76a74 getprinter level 0: was to short, found most of the fields, undocumented,
undecoded, nothing in MSDN, but now it works :-)

cleanup of error codes.
fixed some dfs declarations function.

	J.F.
(This used to be commit 87da4404ab)
2000-03-10 17:12:24 +00:00
Jean-François Micouleau
78d7ba5ca0 changed prs_unistr to parse empty and non-empty strings the same way.
fixed typo in SPOOLSS_SYNT
some cleanup of unused functions
wrote make_spoolss_enumprinter and make_spoolss_openprinterex for
rpcclient as I'm trying to keep in sync the parsing code between HEAD and
TNG.

Will commit changes to TNG after lunch.

	J.F.
(This used to be commit 025cdb345f)
2000-03-06 11:13:40 +00:00
Jeremy Allison
4fb014372e Fixes from Luke, back-ported from TNG to Win2k. Correctly return FAULT_PDU on
unknown rpc calls. Win2k now correctly shows the owners of files.
Jeremy.
(This used to be commit 066898689f)
2000-02-29 21:39:54 +00:00
Jean-François Micouleau
fd3acf437a added enumprintprocessordatatypes
now NT is happy and the "always send data in RAW mode" is checked

	J.F.
(This used to be commit d7bcfe17ce)
2000-02-26 23:01:02 +00:00
Jean-François Micouleau
badee62bca rewrote enumprinterdata. still a bug in it but reproducing it hard and
borring.

I need a client test program urgently!!!

rewrote setprinter, doesn't coredump anymore, and no memleak.

	J.F.
(This used to be commit b76ae1f92f)
2000-02-26 22:22:24 +00:00
Jean-François Micouleau
f3319f7963 converted a couple of bzero() to memset()
rewrote the printer notify code, so now it's compatible with SP5 and fully
dynamic. No more limits on printers and job lists.

removed the make_xxx() functions as they are not used and broken

fixed a bug in the open handle function.

	J.F.
(This used to be commit aa9054d14b)
2000-02-24 16:27:06 +00:00
Jean-François Micouleau
0e004212d2 more rewrite ...
comitting before starting on new functions.

	J.F.
(This used to be commit f9c2080111)
2000-02-21 01:58:13 +00:00
Jean-François Micouleau
8688933c7f fix the reply of rpc_alter_context
OpenPrinterEx is now decoding correctly the query
most of the EnumXXX use the new_buffer struct.
check the (un)marshalling return code.

conclusion: still a long way to go. all the client code has to be
rewritten, and I still wonder how to implement correctly the notify stuff.
(This used to be commit 3d6d386375)
2000-02-15 18:07:45 +00:00
Jean-François Micouleau
07fd3b392d Hum, I should remove my gloves when I'm in front of an xterm :)
fixed a stupid bug in unistr2_to_ascii that I introduced

fixed getprinterdata()
(This used to be commit 2f544a8077)
2000-02-07 18:06:54 +00:00
Jean-François Micouleau
195e3d44da spoolss definitions.
also added some prs_struct functions, 'cause I'm handling buffers as
prs_struct.

	J.F.
(This used to be commit 81e375bbbe)
2000-02-07 16:25:15 +00:00
Jean-François Micouleau
6a6749d81e First commit of the spoolss code to the HEAD branch.
still needs a lot of cleaning/debuging.

	J.F.
(This used to be commit bd9d4cdde9)
2000-02-07 16:17:59 +00:00
Luke Leighton
d91bfabc5d made cvs main up-to-date with samba_tng, with addition of process id to
msrpc loop-back interface.
(This used to be commit adbf97c0a9)
2000-01-21 02:33:21 +00:00
Luke Leighton
34edb1b47e SAMR_R_UNKNOWN_38 is 3 uint16 params (4-byte aligned) followed by status code.
(This used to be commit 55035b8984)
2000-01-17 23:01:23 +00:00
Jeremy Allison
012be9ee73 Added HP change.
Jeremy.
(This used to be commit 4914d2f161)
2000-01-14 19:34:57 +00:00
Luke Leighton
8433aa4379 modified smbd/msrpc credential transfer system. user session key
is *missing* from samba cvs main, therefore it is set to all zeros.
this will cause, amongst other things, administrator-changing-user-passwords,
and setting up new accounts, to fail, as the user's password can only be
decoded with the session key (in this case, the administrator's usr sess key).

it's never a perfect world, is it?
(This used to be commit 3362fcdfa4)
2000-01-11 02:00:31 +00:00
Luke Leighton
fbd17c8daf simple mods to add msrpc pipe redirection. default behaviour: fall back
to using internal msrpc code in smbd.
(This used to be commit 8976e26d46)
2000-01-03 19:19:48 +00:00