1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-07 17:18:11 +03:00
Commit Graph

357 Commits

Author SHA1 Message Date
Jean-François Micouleau
07f2e194ba parse correctly getprinterdriver2
found a stupid bug in enumprinters
fixed some memleaks
found a coredump in enumprinterdata
getprinterdriverdir responds correctly now.

	J.F.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
87da4404ab 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.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
025cdb345f 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.
0001-01-01 00:00:00 +00:00
Jeremy Allison
066898689f 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.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
d7bcfe17ce added enumprintprocessordatatypes
now NT is happy and the "always send data in RAW mode" is checked

	J.F.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
b76ae1f92f 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.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
aa9054d14b 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.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
f9c2080111 more rewrite ...
comitting before starting on new functions.

	J.F.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
3d6d386375 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.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
2f544a8077 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()
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
81e375bbbe spoolss definitions.
also added some prs_struct functions, 'cause I'm handling buffers as
prs_struct.

	J.F.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
bd9d4cdde9 First commit of the spoolss code to the HEAD branch.
still needs a lot of cleaning/debuging.

	J.F.
0001-01-01 00:00:00 +00:00
Luke Leighton
adbf97c0a9 made cvs main up-to-date with samba_tng, with addition of process id to
msrpc loop-back interface.
0001-01-01 00:00:00 +00:00
Luke Leighton
55035b8984 SAMR_R_UNKNOWN_38 is 3 uint16 params (4-byte aligned) followed by status code. 0001-01-01 00:00:00 +00:00
Jeremy Allison
4914d2f161 Added HP change.
Jeremy.
0001-01-01 00:00:00 +00:00
Luke Leighton
3362fcdfa4 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?
0001-01-01 00:00:00 +00:00
Luke Leighton
8976e26d46 simple mods to add msrpc pipe redirection. default behaviour: fall back
to using internal msrpc code in smbd.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
d7b2087865 2nd phase of head branch sync with SAMBA_2_0 - this delets all the files that were in the head branch but weren't in SAMBA_2_0 0001-01-01 00:00:00 +00:00
Andrew Tridgell
453a822a76 first pass at updating head branch to be to be the same as the SAMBA_2_0 branch 0001-01-01 00:00:00 +00:00
Luke Leighton
caa5052522 final part of "first" phase converting over to msrpc daemon architecture.
done a minimal amout of clean-up in the Makefile, removing unnecessary
modules from the link stage.  this is not complete, yet, and will
involve some changes, for example to smbd, to remove dependencies on
the password database API that shouldn't be there.  for example,
smbd should not ever call getsmbpwXXX() it should call the Samr or Lsa
API.

this first implementation has minor problems with not reinstantiating
the same services as the caller.  the "homes" service is a good example.
0001-01-01 00:00:00 +00:00
Luke Leighton
aa3c659a8d delineation between smb and msrpc more marked. smbd now constructs
pdus, and then feeds them over either a "local" function call or a "remote"
function call to an msrpc service.  the "remote" msrpc daemon, on the
other side of a unix socket, then calls the same "local" function that
smbd would, if the msrpc service were being run from inside smbd.

this allows a transition from local msrpc services (inside the same smbd
process) to remote (over a unix socket).

removed reference to pipes_struct in msrpc services.  all msrpc processing
functions take rpcsrv_struct which is a structure containing state info
for the msrpc functions to decode and create pdus.

created become_vuser() which does everything not related to connection_struct
that become_user() does.

removed, as best i could, connection_struct dependencies from the nt spoolss
printing code.

todo: remove dcinfo from rpcsrv_struct because this stores NETLOGON-specific
info on a per-connection basis, and if the connection dies then so does
the info, and that's a fairly serious problem.

had to put pretty much everything that is in user_struct into parse_creds.c
to feed unix user info over to the msrpc daemons.  why?  because it's
expensive to do unix password/group database lookups, and it's definitely
expensive to do nt user profile lookups, not to mention pretty difficult
and if you did either of these it would introduce a complication /
unnecessary interdependency.  so, send uid/gid/num_groups/gid_t* +
SID+num_rids+domain_group_rids* + unix username + nt username + nt domain
+ user session key etc.  this is the MINIMUM info identified so far that's
actually implemented.  missing bits include the called and calling
netbios names etc.  (basically, anything that can be loaded into
standard_sub() and standard_sub_basic()...)
0001-01-01 00:00:00 +00:00
Luke Leighton
5e68403bbb parsing code for transferring unix and nt security credentials over-the-wire.
at present, a unix password is missing from the unix credentials, but is
not _actually_ expected to be needed.  weeelll... maybe :-)

this is used to transfer credentials between smbd and msrpc daemons, down
a unix socket, so that the unix and nt credentials can be inherited by
an msrpc daemon called up from smbd.
0001-01-01 00:00:00 +00:00
Luke Leighton
30c7fdd6ef ABOUT TIME!!!!!!!!
damn, this one is bad.

started, at least two days ago, to add an authentication mechanism to
the smbd<->msrpc redirector/relay, such that sufficient unix / nt
information could be transferred across the unix socket to do a
become_user() on the other side of the socket.

it is necessary that the msrpc daemon inherit the same unix and nt
credentials as the smbd process from which it was spawned, until
such time as the msrpc daemon receives an authentication request
of its own, whereupon the msrpc daemon is responsible for authenticating
the new credentials and doing yet another become_user() etc sequence.
0001-01-01 00:00:00 +00:00
Luke Leighton
2245b0c6d1 the first independent msrpc daemon - lsarpcd.
one horrible cut / paste job from smbd, plus a code split of shared
components between the two.

the job is not _yet_ complete, as i need to be able to do a become_user()
call for security reasons.  i picked lsarpcd first because you don't
_need_ security on it (microsoft botched so badly on this one, it's not
real.  at least they fixed this in nt5 with restrictanonymous=0x2).
fixing this involves sending the current smb and unix credentials down
the unix pipe so that the daemon it eventually goes to can pick them
up at the other end.

i can't believe this all worked!!!
0001-01-01 00:00:00 +00:00
Luke Leighton
c98c666906 damn, that took a while. nt login password was being stored incorrectly
in private .mac file (oops).  ntlogin test now works.
0001-01-01 00:00:00 +00:00
Luke Leighton
cef258f1c9 fixing joining to domain plus something weird going down with nt logins... 0001-01-01 00:00:00 +00:00
Luke Leighton
7846818432 improving createuser account command to be able to add workstations
and then set a default random password.
0001-01-01 00:00:00 +00:00
Luke Leighton
44dd3efa63 first attempt at getting \PIPE\NETLOGON working. it's pretty horrible. 0001-01-01 00:00:00 +00:00
Luke Leighton
7a69633058 well, i stuffed up the spooler commands. 0001-01-01 00:00:00 +00:00
Luke Leighton
4c3556fae7 this one's a handle-based one (missed in the first round). 0001-01-01 00:00:00 +00:00
Luke Leighton
8ce93b80d3 cool! completed a samr* API that _would_ look like an msdn samr* api...
if microsoft bothered to publish it.  actually, there are good reasons
for not publishing it: people might write programs for it, and then
those programs wouldn't work on nt5, for example...
0001-01-01 00:00:00 +00:00
Luke Leighton
45e92258e7 registry API moved over to new format. reg_connect() is the top-level
function, which takes \\server_name.

tested a _few_ functions.  found that regcreatekey receives a Fault PDU.
0001-01-01 00:00:00 +00:00
Luke Leighton
7cacf8bd02 service control manager API completed. svcenum -i works, but does not
do so twice.  possible memory corruption, revolving around getopt().
0001-01-01 00:00:00 +00:00
Luke Leighton
eaac0923e0 rewrote policy handle code to be generic (it's needed for client-side too)
attempted to fix regsetsec command
0001-01-01 00:00:00 +00:00
Luke Leighton
9193f0eff5 attempted a svcset command. password is encrypted / messed up, therefore
command fails.
0001-01-01 00:00:00 +00:00
Luke Leighton
d5869df371 adding svcctl 0x1b function 0001-01-01 00:00:00 +00:00
Luke Leighton
e88e7d529b shuffling msrpc code around so that it can be used independently of rpcclient 0001-01-01 00:00:00 +00:00
Luke Leighton
a51f62f4cf dynamic memory allocation i added a month ago: forgot to ZERO_STRUCT()
some of the server-side stuff.  Realloc() was being used, so it
Realloc()d some random area of memory.  oops.dynamic memory allocation i added a month ago: forgot to ZERO_STRUCT()
some of the server-side stuff.  Realloc() was being used, so it
Realloc()d some random area of memory.  oops.dynamic memory allocation i added a month ago: forgot to ZERO_STRUCT()
some of the server-side stuff.  Realloc() was being used, so it
Realloc()d some random area of memory.  oops.
0001-01-01 00:00:00 +00:00
Luke Leighton
9795e5948c nt5rc2 falling over because the LsaQueryInfoPolicy() response _must_
have the string max length = string length + 1.

if not, then it gets its knickers in a twist over whether the string
is NULL-terminated or not.

four days.

four days i spent on this one.
0001-01-01 00:00:00 +00:00
Luke Leighton
3152bde7d8 - surprise! the number of UNICODE strings that didn't have alignment
after them is incredible.  how did we get away with this for so long?
0001-01-01 00:00:00 +00:00
Luke Leighton
569babb393 added \PIPE\browser plus experimental brsinfo command. you wouldn't
believe the XXXX that MIGHT be involved in getting nt5rc2 to join
a samba domain...
0001-01-01 00:00:00 +00:00
Luke Leighton
c3913f8ae2 added samuserset2 rpcclient command to test ACB_XXX bit-setting on
samr opcode 0x25.  _yet_ another failed attempt to get nt5rc2 to join
a samba domain.  what _is_ it with this stuff, dammit?
0001-01-01 00:00:00 +00:00
Luke Leighton
3df7c903c5 updating reg_value_info() parsing code to take BUFFER2 instead of just
a char*.  now copes with multiple types.
0001-01-01 00:00:00 +00:00
Luke Leighton
98ddeaf442 added regqueryval command (experimental) to get reg_io_q_info() and
reg_io_r_info() working properly.  previously they weren't well
understood (well, they were the first of the registry functions i did,
back in december 97, ok??? :-)

set ntversion to 0x1 in SAMQUERY, so that we reply same as NT4 srv.
0001-01-01 00:00:00 +00:00
Luke Leighton
70b2c1ecbb attempting to get nt5 wksta to join domain.
1) had to fix samr "create user" and "set user info" (level 23).

2) had to fix netlogon enum trust domains

3) registry key needed \\ in it not \.
0001-01-01 00:00:00 +00:00
Luke Leighton
71f1213867 added two new params: "trusted domains" and "trusting domains".
these _may_ not actually ever get used, as trust relationships
really need to be established with shared secrets, and you need
to get the SID of the trusted and trusting domains, so this
may have to go in a private/xxx.mac file.
0001-01-01 00:00:00 +00:00
Richard Sharpe
70274b5253 Changes to implement NET_AUTH based on NET_AUTH2, to get Win2000
happier in joining a Samba domain.
0001-01-01 00:00:00 +00:00
Luke Leighton
60b0840106 added server-side samr enum domains. fixed some parsing issues, server-side. 0001-01-01 00:00:00 +00:00
Luke Leighton
3146aa6b60 added rpcclient "enumdomains" command. enumerates names of domains
for which a PDC is responsible.  typical answers are:
<Name of Domain> plus <Builtin>.

against a hierarchical, down-level-compatible NT5 PDC, there's likely to
be more than these two entries!!!!!
0001-01-01 00:00:00 +00:00
Luke Leighton
25c70e3c98 - added DCE/RPC "fault" PDU support.
- disabled (AGAIN) the GETDC "if (MAILSLOT\NTLOGON)" code that will get
NT5rc2 to work but WILL break win95 (AGAIN).  this needs _not_ to be
re-enabled but to be replaced with a better mechanism.

- added SMBwrite support (note: SMBwriteX already existed) as NT5rc2 is
sending DCE/RPC over SMBwrite not SMBwriteX.
0001-01-01 00:00:00 +00:00
Luke Leighton
e6e5caf16c debugging rpcclient spoolenum and spooljobs commands. oh, did i forget
to mention, there's a spooljobs <printer name> command, and it uses
command-line completion?  prints out NT print jobs really nicely, too.
0001-01-01 00:00:00 +00:00
Luke Leighton
bc659a09f9 preparation for doing a spoolss enum jobs command. had to rewrite
spoolss_enumjobs parsing code to do read / writes not just writes.
0001-01-01 00:00:00 +00:00
Luke Leighton
e0eb390ab3 const feeding frenzy 0001-01-01 00:00:00 +00:00
Luke Leighton
681cbb9ec1 missed mem_grow_data call 0001-01-01 00:00:00 +00:00
Luke Leighton
0249ae50ad fixed string function for reading in printer_info_N. 0001-01-01 00:00:00 +00:00
Luke Leighton
135eaa9773 added rpcclient spoolenum command. enumerates printers.
spoolss_r_io_enumprinters doesn't decode strings correctly
as printer_info_1/2 code has only been written to write
structures, not read them.
0001-01-01 00:00:00 +00:00
Luke Leighton
ef7fa58fd3 spoolss openprinterex / closeprinter client-code.
experimental spoolopen <printer name> command added.

jean-francois, f.y.i. i changed the #define for SPOOLSS_OPENPRINTEREX from
op code 0x44 to 0x45.
0001-01-01 00:00:00 +00:00
Luke Leighton
c86edef90e experimental spoolss rpcclient commands 0001-01-01 00:00:00 +00:00
Luke Leighton
f52504c553 samuserset <username> -p password. YESSSSS :)
you have to use "ntlmv1" at the moment (i.e set client ntlmv2 = no).
0001-01-01 00:00:00 +00:00
Luke Leighton
b3f16e6b5a adding experimental set user password command to rpcclient, it returns
error wrong password against nt.  ????
0001-01-01 00:00:00 +00:00
Luke Leighton
3f9455c535 created msrpc_srv_enum_tprt() function by massaging cmd_srv_enum_tprt(). 0001-01-01 00:00:00 +00:00
Luke Leighton
6b919ebb4e dynamic mem allocation in net_srv_transport_enum() parsing. 0001-01-01 00:00:00 +00:00
Luke Leighton
e718ce9c4a had to move unistr2_dup(), unistr2_free() and unistr2_copy() into
util_unistr.c in order to get bin/testparm to compile.
0001-01-01 00:00:00 +00:00
Luke Leighton
a80ea2eb47 three types of array-creation / array-deletion functions:
char*
UNISTR2*
SID*

decided to create a higher-order function set, add_item_to_array()
free_item_array().

higher-order support routines needed to add a new type:

type* item_dup(const type*)
void item_free(type*)

of course, strdup() and free() are perfect, pre-existing examples
of such functions, used in the implementation of add_chars_to_array()
and free_char_array().

sid_dup() and free() work for the add_sids_to_array() and free_sid_array()
implementations.

use unistr2_dup() and created unistr2_free() because the functionality
behind these may change into something horrible, like [horror] dynamic
memory allocation of the UNISTR2 character array.  argh!!!!

jean-francois, this function set implements what we talked about over...
a year ago, now :-)
0001-01-01 00:00:00 +00:00
Luke Leighton
baa789fabc dynamic mem allocation in enum dom groups and enum dom aliases 0001-01-01 00:00:00 +00:00
Luke Leighton
11ecec8457 const char* issues 0001-01-01 00:00:00 +00:00
Luke Leighton
953fe6ba94 added lsaenumdomains command.
attempting to get blood out of a stone^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H
querysecret to work, it keeps returning access denied.
0001-01-01 00:00:00 +00:00
Luke Leighton
926fe6273a added rpcclient svcstop <service name> command. gnu readline
command-completion works.
0001-01-01 00:00:00 +00:00
Luke Leighton
2903f22e7e added yet another rpcclient command: svcstart <service name> [arg0] [arg1] ...
works with command-line completion on the service name (ohh yesss, this
is becoming my favourite bit of functionality-on-the-side hee hee :)

had to fix the svc_io_q_start_service() code which was missing the
ptr_argv[] array in between the array-size and the UNISTR2-array.
i.e it's actually an array of _pointers_ to unicode strings...
0001-01-01 00:00:00 +00:00
Luke Leighton
c243231d85 added svcinfo <service name> command. 0001-01-01 00:00:00 +00:00
Luke Leighton
37f4aac06f NetServerTransportEnum parsing, client-side and rpcclient "srvtransports" added. 0001-01-01 00:00:00 +00:00
Luke Leighton
497d423172 more reshuffling of enum groups code. more higher order functions. 0001-01-01 00:00:00 +00:00
Luke Leighton
b0aa933ef4 added HKEY_CLASSES_ROOT MSRPC open call. reg_open_hkcr etc. supported
in rpcclient, regenum HKEY_CLASSES_ROOT or regenum HKCR to test.
0001-01-01 00:00:00 +00:00
Luke Leighton
c8fd555179 - typecast malloc / Realloc issues.
- signed / unsigned issues.
0001-01-01 00:00:00 +00:00
Luke Leighton
6e22bf912c signed / unsigned and typecast issues 0001-01-01 00:00:00 +00:00
Luke Leighton
19490d8b4f one of those wonderful moments when running against a different MSRPC
implementation (NT5) when you discover that your code is trash.
samr_enum_dom_users(), samr_enum_dom_aliases() and samr_enum_dom_groups()
all take a HANDLE for multiple-call enumeration purposes.
0001-01-01 00:00:00 +00:00
Luke Leighton
134b20e2a7 the dynamic memory alloc blood-fest goes on... 0001-01-01 00:00:00 +00:00
Luke Leighton
4b06f30323 turning some of the rpcclient functions dynamic. this is likely to
break a few things...
0001-01-01 00:00:00 +00:00
Luke Leighton
8976eca2db various. debug levels changed. nmbd doesn't need libsmb/clienttrust.c.
samr_lookup_rids() moved to a dynamic memory structure not a
static one limited to 32 RIDs.  cli_pipe.c reading wasn't checking
ERRmoredata when DOS error codes negotiated (this terminates
MSRPC code with prejudice).
0001-01-01 00:00:00 +00:00
Luke Leighton
02f2406042 need status codes from cli_net_req_chal() and cli_net_auth2().
this format is what i would like _all_ these functions to be
(returning status codes, not BOOL) but that's a horrendous
amount of work at the moment :)
0001-01-01 00:00:00 +00:00
Luke Leighton
6f933fb359 initialising enum dom users mem and account name ptrs to NULL. 0001-01-01 00:00:00 +00:00
Luke Leighton
b4ba49c5c1 added prs_struct "error" member, set and checked when prs_struct
data is handled.
0001-01-01 00:00:00 +00:00
Luke Leighton
4c98d71ebd adding error checking in parsing code 0001-01-01 00:00:00 +00:00
Luke Leighton
2af635f8b7 oops! srvinfo 2 command caught bug where strings in containers assumed
to exist.  not good!
0001-01-01 00:00:00 +00:00
Luke Leighton
7b3666f01c renamed args due to global "class" variable 0001-01-01 00:00:00 +00:00
Luke Leighton
3b583f7be5 return results on prs_xxxxx() and all xxx_io_xxx() routines.
the whole task is not complete, yet.  xxx_io_xxx() routines that
_call_ xxx_io_xxx() routines not done.

prs_xxxx() covered by macros.  considering doing xxx_io_xxxx in the same way.
0001-01-01 00:00:00 +00:00
Luke Leighton
144fd01f37 stop over-runs in reading / writing data stream. 0001-01-01 00:00:00 +00:00
Luke Leighton
e5b80bd2f7 - added rudimentary CAP_UNICODE support because i thought it was part of
a problem i was having.

- added rudimentary CAP_STATUS32 support for same reason.

- added hard-coded, copy-the-same-data-from-over-the-wire version of
CAP_EXTENDED_SECURITY, which is a security-blob to encapsulate
GSSAPI which encodes
SPNEGO which is used to negotiate
Kerberos or NTLMSSP.  i have implemented
NTLMSSP which negotiates
NTLMv1 or NTLMv2 and 40-bit or 128-bit etc.  i have implemented
NTLMv1 / 40-bit.

*whew*.
0001-01-01 00:00:00 +00:00
Luke Leighton
39c367b8e9 splitting dom info into sam_query_dominfo function 0001-01-01 00:00:00 +00:00
Jean-François Micouleau
a893df5c00 Correctly handle the dependent files in the printer_driver_info_3 struct
It means complex printer drivers should now download fine.

	J.F.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
7dc7801c20 Alan (alanh@pinacl.co.uk) found a nasty bug
J.F.
0001-01-01 00:00:00 +00:00
Luke Leighton
cc19d5cc5c testing for attempts to get more info levels into samr_query_userinfo 0001-01-01 00:00:00 +00:00
Luke Leighton
1d05d2c959 wow!!!! this one's been here for two years!!!! alignment issues
in smb_io_dom_query() where the string name could mis-align!
added a call to prs_align() after the domain string name.
0001-01-01 00:00:00 +00:00
Luke Leighton
8fb2ff247a - initialising mach_passwd_file locks to zero (prev. uninit.)
- cleanup

- #defined report to sprintf as it's #defined to another function in
  other uses of cmd_lsarpc.c
0001-01-01 00:00:00 +00:00
Matthew Chapman
cc27dba003 Removing a stray return, probably inserted during debugging, which broke
NetrShareEnum. Be careful what you commit Luke...
0001-01-01 00:00:00 +00:00
Luke Leighton
819af56074 event log update, netsessenum, netconnenum update. 0001-01-01 00:00:00 +00:00
Luke Leighton
bcc1212b07 event log update 0001-01-01 00:00:00 +00:00
Luke Leighton
c4901f5951 changing debug output message reg_io_unknown_1 to reg_io_close. 0001-01-01 00:00:00 +00:00
Luke Leighton
b2d9cbef6f reverted jeremy's c++-like security descriptor modifications as the
simplest method to get rpcclient's reggetsec command working.  the
buffers passed as arguments in do_reg_get_key_sec() do need to be
locally allocated not dynamically allocated, as two calls to
reg_get_key_sec() are needed.  on the first, the server fills in the
size of the security descriptor buffer needed.  on the second, the
server fills in the security descriptor buffer.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
bf9b639bf9 - enumprintprocessors and enumprintmonitors added.
- getjob (level 1 and 2) done.
- better handling of getprinterdriver (level 2).
- added workaround to print PCL files.

Now the spoolss code should be compliant with all kind of printers :-)

	Jean Francois
0001-01-01 00:00:00 +00:00
Luke Leighton
1a211bafeb renaming AUTH VERIFIER to AUTH NTLMSSP VERIFIER. ready for adding
another RPC authentication system.
0001-01-01 00:00:00 +00:00
Matthew Chapman
8e36b07a0e BDC support.
Fixing and clarifying SAM_PWD structure.
0001-01-01 00:00:00 +00:00
Luke Leighton
2331aa32ab BDC support. 0001-01-01 00:00:00 +00:00
Jean-François Micouleau
bda429eb73 many small bugs...
J.F.
0001-01-01 00:00:00 +00:00
Luke Leighton
ab1a6aa42d improving authentication code (tidyup). 0001-01-01 00:00:00 +00:00
Jean-François Micouleau
8d73f83b6c Fixed most memory leak and big-endian bug in the spoolss code.
Also added addform/setform rpc api calls. Now I can add/change forms from
the server property dialog box.

Jean Francois
0001-01-01 00:00:00 +00:00
Matthew Chapman
c3c25e762f Some more BDC-related fixes, mainly to the NET_SAM_SYNC RPC with respect
to alignment, missing fields, etc. - it should now work correctly.
There is still the problem of decoding the private data field.
0001-01-01 00:00:00 +00:00
Luke Leighton
e66b6afc69 alignment needed after unicode string names in password change. 0001-01-01 00:00:00 +00:00
Jean-François Micouleau
7fc8659e83 last part of RPC api change.
and of rpcclient eventlog funtion

	Jean Francois
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
66b4b896fb Added a new command to rpcclient: eventlog <log> where <log> is System,
Security or Application. That's a crude equivalent to the eventviewer.

	Jean Francois
0001-01-01 00:00:00 +00:00
Matthew Chapman
f456dcf08e Adding "time" rpcclient command which displays the remote time.
Also added special "now" time to the "at" command, e.g.:
  at now /i cmd   ; pops up a command prompt
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
4c515804b7 rpc_parse/parse_misc.c : defined a new BUFFER5 struct
include/ntdomain.h     : added rpc_spoolss.h include statement
include/proto.h
include/rpc_dce.h      : added definition of RPC_ALTER_CONTEXT request &
                         reply
param/loadparm.c       : 2 new options for NT printing support and some
                         changes to initial values in the LPRNG case.
rpc_parse/parse_prs.c  : added prs_uint16s()
rpc_parse/parse_rpc.c  : added SYNT_SPOOLSS_V1 and code for the
                         alter-context support.
rpc_server/srv_pipe.c  : alter-context support
smbd/nttrans.c
smbd/server.c
include/rpc_misc.h
Makefile.in
include/smb.h

Jean Francois
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
9e8192cc67 Adding RPC spoolss code support and some new low-level printing functions.
Jean Francois
0001-01-01 00:00:00 +00:00
Matthew Chapman
cf30a472f7 Adding scheduler control pipe (\atsvc), client-side routines, and rpcclient
command "at" (compatible with NT's "at" command - see rpcclient commit) -
useful for remote NT administration.
0001-01-01 00:00:00 +00:00
Matthew Chapman
c518cef78d Incorrect length (number of unicode characters rather than buffer size)
passed to ascii_to_unibuf in make_buffer2 was breaking User Manager.
0001-01-01 00:00:00 +00:00
Matthew Chapman
7b830350eb Mainly BDC-related changes.
* Added SEC_CHAN_BDC
* Propagate sec_chan into the various functions which change trust account
  passwords, so they can be used for domain control and inter-domain
  trusts.
* Fix for endianness problem reported by Edan Idzerda <edan@mtu.edu>. A
  BUFFER2 is really a "unibuf" in my terminology and we should treat it as
  such.
* Added some more common NT structures (BIGINT, BUFHDR2, BUFFER4).
* Added NET_SAM_SYNC (-> NetDatabaseSync2) RPC for account replication.
  Still experimental and incomplete, with a few too many NULL security
  descriptors lying around (must go look at Jeremy's SD code). Haven't
  worked out password encryption yet either.
  However, the XXX_INFO structures I've added to rpc_netlogon.h are quite
  nice as they give some insight into how these objects are stored in the
  SAM.
0001-01-01 00:00:00 +00:00
Luke Leighton
ac070dfd39 added SamrQueryDomainInfo call info level 0x3 for kix32.exe support 0001-01-01 00:00:00 +00:00
Luke Leighton
4aed18b5e1 added SAMR_USER_INFO_24 info level to samr_set_userinfo. this is used
by "Welcome to SAMBA Domain".
0001-01-01 00:00:00 +00:00
Luke Leighton
2e58ed7424 SAM database "set user info".
----------------------------

- removed DOM_RID4

- removed SAMR_UNKNOWN_32

- added SAMR_SET_USERINFO (opcode 0x32)

- added level 0x1 to SAMR_QUERY_DOM_INFO (needed for create user)

- fixed pwdb_gethexpwd() it was failing on XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

- added mod_sam21pwd_entry()

- preparing to call mod_sam21pwd_entry()

- added "user session key" to user_struct.dc.  this is md4(nt#) and is
  needed to decode user's clear-text passwords in SAMR_SET_USERINFO.

- split code out in chgpasswd.c to decode 516 byte password buffers.
0001-01-01 00:00:00 +00:00
Luke Leighton
9092368af8 matt, you had removed a "pointer" from DOM_R_REF structure which made it
possible to fix lsa_r_lookup_names, but forgot to add that pointer in
to lsa_r_lookup_sids, where DOM_R_REF was also being used.
0001-01-01 00:00:00 +00:00
Luke Leighton
f84dede27e removed 2 unnecessary args from make_uni_hdr. 0001-01-01 00:00:00 +00:00
Matthew Chapman
6d03f61d25 Fixed LSA Lookup Names. There were a few too many NULL pointers in a
negative response, which tended to crash lsass.exe.
0001-01-01 00:00:00 +00:00
Luke Leighton
103557e26b dynamic memory allocation in samr enum dom users. works with 849 entries now. 0001-01-01 00:00:00 +00:00
Matthew Chapman
73730f6004 Another UNICODE issue - this time BUFFER2 was being transmitted incorrectly. 0001-01-01 00:00:00 +00:00
Matthew Chapman
402ed18188 If a buffer pointer is NULL then its length_is() attribute should not be
transmitted.

Such a problem was crashing Server Manager.
0001-01-01 00:00:00 +00:00
Matthew Chapman
1e17c2529c Ensuring return status is aligned in SAMR_QUERY_DISPINFO response. 0001-01-01 00:00:00 +00:00
Luke Leighton
fefb4bf191 added a "createuser" command. 0001-01-01 00:00:00 +00:00
Luke Leighton
d6cee14f80 value->enc_secret not value->secret 0001-01-01 00:00:00 +00:00
Matthew Chapman
113d03a38a Added SVC_START_SERVICE rpc. An NT PDC will attempt to start the NETLOGON
service on its BDC's prior to initiating SAM replication. For now just
return success.
0001-01-01 00:00:00 +00:00
Matthew Chapman
900238a661 Changed hard-coded number of users/groups in SAMR_QUERY_DOMAIN_INFO
to MAX_SAM_ENTRIES to prevent truncation of user lists.
A proper implementation is not important right now.
0001-01-01 00:00:00 +00:00
Matthew Chapman
365fa3b5fb Adding LSA_OPENSECRET (-> LsarOpenSecret) and LSA_QUERYSECRET
(-> LsarQuerySecret) on client side, including rpcclient command
"querysecret" for others to play with.

The major obstacle is working out the encryption algorithm used
for the secret value. It definitely uses the NT hash as part of the
key, and it seems the block size is 64 bits - probably DES based -
but I can't work out what's done in between. Help required.
0001-01-01 00:00:00 +00:00
Matthew Chapman
03e722cdf5 Added SVC_QUERY_DISP_NAME (corresponding to the GetServiceDisplayName API).
Needed during preliminary part of SAM replication.
0001-01-01 00:00:00 +00:00
Luke Leighton
65b0abe8b7 new "domtrust" test command. r&d into inter-domain trust accounts. 0001-01-01 00:00:00 +00:00
Luke Leighton
1c330d5682 - todd sabin spotted bugs in samr enum dom users / groups / aliases code:
last count (probably an ENUM / resume handle) should always be returned
  even if there are no items being returned.

- got fed up of seven intendation levels in cmd_samr.c, maximum recommended
  in *any* code is three!  made some sub-fns instead.
0001-01-01 00:00:00 +00:00
Matthew Chapman
7d03e6e219 Win9x user level security.
* Added SAMR_LOOKUP_DOMAIN (-> SamrLookupDomainInSamServer)

* Added real SAMR_ENUM_DOM_GROUPS (corresponding to
SamrEnumerateGroupsInDomain). The existing one is just an alias for
SamrQueryDisplayInformation (see below).

* Added three extra info levels to SAMR_QUERY_DISPINFO. Info level 3 is
what was previously SAMR_ENUM_DOM_GROUPS; info levels 4 and 5 are
simple user/group list requests used by Win9x and I suspect (haven't
checked) the "low speed connection" User Manager.

* Added another two aliases for SAMR_QUERY_DISPINFO, opcodes 0x30 and
0x33. Usually the first is with info level 3 and the second 4 but there is
some overlap so indeed these should be implemented as just aliases.

* Return ERRDOS/ERRmoredata on extra data instead of
STATUS_BUFFER_OVERFLOW for Win95's benefit. On a named pipe this results
in an SMBreadX as usual.

Still need to fix SAMR_QUERY_DOMAIN_INFO which has a hard-coded number of
users and groups - which Win95 proceeds to truncate at.
0001-01-01 00:00:00 +00:00
Luke Leighton
ec1b7000fd added jeremy's new c++-like code for parsing of security descriptors. 0001-01-01 00:00:00 +00:00
Luke Leighton
e164b5080c samr_lookup_names "none found" error needed corrections with empty lists. 0001-01-01 00:00:00 +00:00
Luke Leighton
66e2787ab7 problem been there for months: reg_r_info not aligning after string buffer. 0001-01-01 00:00:00 +00:00
Luke Leighton
59f081069a rpcclient shutdown command 0001-01-01 00:00:00 +00:00
Matthew Chapman
ce24191939 Always null-terminate strings.
Also some string length and sizeof(pointer) corrections.
0001-01-01 00:00:00 +00:00
Matthew Chapman
a1d39af1ce UNICODE cleanup (see lib/util_unistr.c).
No more ugly static library buffers and all functions take a destination
string length (especially unistrcpy was rather dangerous; we were only
saved by the fact that datagrams are limited in size).
0001-01-01 00:00:00 +00:00
Luke Leighton
73db80f341 the UNICODE issue... 0001-01-01 00:00:00 +00:00
Luke Leighton
ac72fe1ab3 removal of the use of unistrn2 function: replace it with unistr2_to_str
which is more appropriate.
0001-01-01 00:00:00 +00:00
Luke Leighton
9084b7e33d UNICODE byte ordering issue: typecast to uint16* replaced with SSVAL() 0001-01-01 00:00:00 +00:00
Luke Leighton
f7dfa55a2e cache unix groups so that two-level getgrent calls don't occur. 0001-01-01 00:00:00 +00:00
Matthew Chapman
1e3873111f Initialise NTTIME properly in make_reg_q_enum_key instead of using
unix_to_nt_time hack. Seems to me it's ignored anyway (dummy return
buffer?).
0001-01-01 00:00:00 +00:00
Luke Leighton
ad58cdfac6 fix for enumerate domain users (bug spotted by sean matthews).
also needed to use start index properly and generate next index.

both client and server code need to recognise error code 0x105
when there's not enough room to store all the users in one call.

sort this out another time.
0001-01-01 00:00:00 +00:00
Luke Leighton
a022710f1e rpcclient "Service Control Manager" svcenum [-i] command. 0001-01-01 00:00:00 +00:00
Luke Leighton
a15a3f95f2 fix for potential lsass.exe crashing due to negative response from
LsaLookupNames being incorrect.  this is a bit wierd: why would the
lsass.exe on the nt _client_ crash due to an LsaLookupNames response
from a samba _server_?
0001-01-01 00:00:00 +00:00
Luke Leighton
c6f2f58c74 adding svcctl parsing code 0001-01-01 00:00:00 +00:00