1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-31 17:18:04 +03:00
Commit Graph

427 Commits

Author SHA1 Message Date
Luke Leighton
75bc100943 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...
(This used to be commit 8ce93b80d3)
1999-11-25 05:26:48 +00:00
Luke Leighton
ac4dd24140 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.
(This used to be commit 45e92258e7)
1999-11-24 23:40:20 +00:00
Luke Leighton
a70a4626df service control manager API completed. svcenum -i works, but does not
do so twice.  possible memory corruption, revolving around getopt().
(This used to be commit 7cacf8bd02)
1999-11-24 23:11:03 +00:00
Luke Leighton
d7889cd223 rewrote policy handle code to be generic (it's needed for client-side too)
attempted to fix regsetsec command
(This used to be commit eaac0923e0)
1999-11-24 18:09:33 +00:00
Luke Leighton
6b91ecb417 attempted a svcset command. password is encrypted / messed up, therefore
command fails.
(This used to be commit 9193f0eff5)
1999-11-23 23:05:47 +00:00
Luke Leighton
7bd8fd1a10 adding svcctl 0x1b function
(This used to be commit d5869df371)
1999-11-23 18:57:07 +00:00
Luke Leighton
4c4af2ba5e shuffling msrpc code around so that it can be used independently of rpcclient
(This used to be commit e88e7d529b)
1999-11-23 18:56:26 +00:00
Luke Leighton
ef8ced0ca6 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.
(This used to be commit a51f62f4cf)
1999-11-20 18:17:29 +00:00
Luke Leighton
e1820455c2 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.
(This used to be commit 9795e5948c)
1999-11-19 02:05:19 +00:00
Luke Leighton
eb8c70cb66 - 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?
(This used to be commit 3152bde7d8)
1999-11-19 01:24:41 +00:00
Luke Leighton
1c6c4e7e39 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...
(This used to be commit 569babb393)
1999-11-19 00:12:16 +00:00
Luke Leighton
e3b2f276e0 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?
(This used to be commit c3913f8ae2)
1999-11-18 19:29:08 +00:00
Luke Leighton
a394a4a8fa updating reg_value_info() parsing code to take BUFFER2 instead of just
a char*.  now copes with multiple types.
(This used to be commit 3df7c903c5)
1999-11-18 17:57:21 +00:00
Luke Leighton
ccc8585567 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.
(This used to be commit 98ddeaf442)
1999-11-18 00:26:11 +00:00
Luke Leighton
cc8df5ce49 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 \.
(This used to be commit 70b2c1ecbb)
1999-11-16 21:14:53 +00:00
Luke Leighton
6b56ebb7cf 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.
(This used to be commit 71f1213867)
1999-11-16 17:27:41 +00:00
Richard Sharpe
8a84d000c9 Changes to implement NET_AUTH based on NET_AUTH2, to get Win2000
happier in joining a Samba domain.
(This used to be commit 70274b5253)
1999-11-16 14:10:23 +00:00
Luke Leighton
089b57b5b4 added server-side samr enum domains. fixed some parsing issues, server-side.
(This used to be commit 60b0840106)
1999-11-15 23:46:27 +00:00
Luke Leighton
98ee99eb72 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!!!!!
(This used to be commit 3146aa6b60)
1999-11-15 22:43:08 +00:00
Luke Leighton
b231d2fafa - 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.
(This used to be commit 25c70e3c98)
1999-11-15 22:11:10 +00:00
Luke Leighton
826ad16b36 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.
(This used to be commit e6e5caf16c)
1999-11-09 19:35:30 +00:00
Luke Leighton
702b085293 preparation for doing a spoolss enum jobs command. had to rewrite
spoolss_enumjobs parsing code to do read / writes not just writes.
(This used to be commit bc659a09f9)
1999-11-08 22:00:41 +00:00
Luke Leighton
c6e3fc5838 const feeding frenzy
(This used to be commit e0eb390ab3)
1999-11-08 20:58:06 +00:00
Luke Leighton
2c3fdead4d missed mem_grow_data call
(This used to be commit 681cbb9ec1)
1999-11-06 21:25:52 +00:00
Luke Leighton
4dbd1c135c fixed string function for reading in printer_info_N.
(This used to be commit 0249ae50ad)
1999-11-06 20:36:07 +00:00
Luke Leighton
0f18ca772d 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.
(This used to be commit 135eaa9773)
1999-11-06 19:52:04 +00:00
Luke Leighton
bd6467154e 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.
(This used to be commit ef7fa58fd3)
1999-11-06 18:11:19 +00:00
Luke Leighton
32dedee7f0 experimental spoolss rpcclient commands
(This used to be commit c86edef90e)
1999-11-05 18:40:38 +00:00
Luke Leighton
fe8383382d samuserset <username> -p password. YESSSSS :)
you have to use "ntlmv1" at the moment (i.e set client ntlmv2 = no).
(This used to be commit f52504c553)
1999-11-04 21:41:36 +00:00
Luke Leighton
cae821d459 adding experimental set user password command to rpcclient, it returns
error wrong password against nt.  ????
(This used to be commit b3f16e6b5a)
1999-11-04 00:09:15 +00:00
Luke Leighton
83f2465f0f created msrpc_srv_enum_tprt() function by massaging cmd_srv_enum_tprt().
(This used to be commit 3f9455c535)
1999-11-03 22:14:38 +00:00
Luke Leighton
dc963d7939 dynamic mem allocation in net_srv_transport_enum() parsing.
(This used to be commit 6b919ebb4e)
1999-11-03 21:51:29 +00:00
Luke Leighton
59a7e6cef8 had to move unistr2_dup(), unistr2_free() and unistr2_copy() into
util_unistr.c in order to get bin/testparm to compile.
(This used to be commit e718ce9c4a)
1999-11-03 20:01:07 +00:00
Luke Leighton
c015b02b43 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 :-)
(This used to be commit a80ea2eb47)
1999-11-03 19:58:47 +00:00
Luke Leighton
aa77f20a5b dynamic mem allocation in enum dom groups and enum dom aliases
(This used to be commit baa789fabc)
1999-11-02 23:31:16 +00:00
Luke Leighton
74224aa4f8 const char* issues
(This used to be commit 11ecec8457)
1999-11-01 23:16:07 +00:00
Luke Leighton
7032daa887 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.
(This used to be commit 953fe6ba94)
1999-11-01 22:25:38 +00:00
Luke Leighton
92892c014e added rpcclient svcstop <service name> command. gnu readline
command-completion works.
(This used to be commit 926fe6273a)
1999-11-01 17:52:11 +00:00
Luke Leighton
e7a9b398c7 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...
(This used to be commit 2903f22e7e)
1999-10-31 05:23:32 +00:00
Luke Leighton
dbda98047d added svcinfo <service name> command.
(This used to be commit c243231d85)
1999-10-31 04:11:17 +00:00
Luke Leighton
4cda1d2b4f NetServerTransportEnum parsing, client-side and rpcclient "srvtransports" added.
(This used to be commit 37f4aac06f)
1999-10-30 22:34:38 +00:00
Luke Leighton
d0fd259514 more reshuffling of enum groups code. more higher order functions.
(This used to be commit 497d423172)
1999-10-29 17:37:27 +00:00
Luke Leighton
3d096e1b8f added HKEY_CLASSES_ROOT MSRPC open call. reg_open_hkcr etc. supported
in rpcclient, regenum HKEY_CLASSES_ROOT or regenum HKCR to test.
(This used to be commit b0aa933ef4)
1999-10-29 16:24:11 +00:00
Luke Leighton
5612824426 - typecast malloc / Realloc issues.
- signed / unsigned issues.
(This used to be commit c8fd555179)
1999-10-25 19:03:27 +00:00
Luke Leighton
fdf6383cbe signed / unsigned and typecast issues
(This used to be commit 6e22bf912c)
1999-10-25 17:10:54 +00:00
Luke Leighton
8e1f542ddf 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.
(This used to be commit 19490d8b4f)
1999-10-25 16:22:08 +00:00
Luke Leighton
45b794bdde the dynamic memory alloc blood-fest goes on...
(This used to be commit 134b20e2a7)
1999-10-21 19:02:57 +00:00
Luke Leighton
52fed795e1 turning some of the rpcclient functions dynamic. this is likely to
break a few things...
(This used to be commit 4b06f30323)
1999-10-21 18:25:12 +00:00
Luke Leighton
6f9105c853 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).
(This used to be commit 8976eca2db)
1999-10-21 16:53:50 +00:00
Luke Leighton
87d92a1f11 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 :)
(This used to be commit 02f2406042)
1999-10-19 19:55:43 +00:00
Luke Leighton
c05be7037b initialising enum dom users mem and account name ptrs to NULL.
(This used to be commit 6f933fb359)
1999-10-18 16:26:55 +00:00
Luke Leighton
63fa96e216 added prs_struct "error" member, set and checked when prs_struct
data is handled.
(This used to be commit b4ba49c5c1)
1999-10-15 20:10:46 +00:00
Luke Leighton
003f7364fd adding error checking in parsing code
(This used to be commit 4c98d71ebd)
1999-10-15 20:00:30 +00:00
Luke Leighton
c941cb581b oops! srvinfo 2 command caught bug where strings in containers assumed
to exist.  not good!
(This used to be commit 2af635f8b7)
1999-10-15 19:21:18 +00:00
Luke Leighton
df71b9eda7 renamed args due to global "class" variable
(This used to be commit 7b3666f01c)
1999-10-15 19:20:30 +00:00
Luke Leighton
896ecb48ca 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.
(This used to be commit 3b583f7be5)
1999-10-15 18:46:22 +00:00
Luke Leighton
dcea4bfd0f stop over-runs in reading / writing data stream.
(This used to be commit 144fd01f37)
1999-10-14 19:21:23 +00:00
Luke Leighton
cba7662da1 - 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*.
(This used to be commit e5b80bd2f7)
1999-10-07 22:10:29 +00:00
Luke Leighton
65ce93d549 splitting dom info into sam_query_dominfo function
(This used to be commit 39c367b8e9)
1999-10-01 18:44:33 +00:00
Jean-François Micouleau
7b88001235 Correctly handle the dependent files in the printer_driver_info_3 struct
It means complex printer drivers should now download fine.

	J.F.
(This used to be commit a893df5c00)
1999-09-24 14:45:21 +00:00
Jean-François Micouleau
13266d5115 Alan (alanh@pinacl.co.uk) found a nasty bug
J.F.
(This used to be commit 7dc7801c20)
1999-09-24 10:13:38 +00:00
Luke Leighton
0a6eac0b79 testing for attempts to get more info levels into samr_query_userinfo
(This used to be commit cc19d5cc5c)
1999-09-21 21:04:03 +00:00
Luke Leighton
29ba13f6ea 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.
(This used to be commit 1d05d2c959)
1999-09-14 21:42:49 +00:00
Luke Leighton
ddf33698b5 - 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
(This used to be commit 8fb2ff247a)
1999-09-12 22:40:27 +00:00
Matthew Chapman
49b7c8cac3 Removing a stray return, probably inserted during debugging, which broke
NetrShareEnum. Be careful what you commit Luke...
(This used to be commit cc27dba003)
1999-08-23 08:54:07 +00:00
Luke Leighton
d2d6144253 event log update, netsessenum, netconnenum update.
(This used to be commit 819af56074)
1999-08-18 20:33:49 +00:00
Luke Leighton
3d4b2c8b5e event log update
(This used to be commit bcc1212b07)
1999-08-18 20:11:29 +00:00
Luke Leighton
6bcd191a6c changing debug output message reg_io_unknown_1 to reg_io_close.
(This used to be commit c4901f5951)
1999-08-03 20:54:22 +00:00
Luke Leighton
8598bf2a7f 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.
(This used to be commit b2d9cbef6f)
1999-08-03 20:30:25 +00:00
Jean-François Micouleau
4bff267574 - 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
(This used to be commit bf9b639bf9)
1999-07-27 10:46:44 +00:00
Luke Leighton
f2e0bbffb5 renaming AUTH VERIFIER to AUTH NTLMSSP VERIFIER. ready for adding
another RPC authentication system.
(This used to be commit 1a211bafeb)
1999-07-26 21:47:23 +00:00
Matthew Chapman
61b92043da BDC support.
Fixing and clarifying SAM_PWD structure.
(This used to be commit 8e36b07a0e)
1999-07-22 10:55:09 +00:00
Luke Leighton
6a5a4e8186 BDC support.
(This used to be commit 2331aa32ab)
1999-07-21 00:32:09 +00:00
Jean-François Micouleau
89517ed4d3 many small bugs...
J.F.
(This used to be commit bda429eb73)
1999-07-01 18:02:34 +00:00
Luke Leighton
73891ca8e4 improving authentication code (tidyup).
(This used to be commit ab1a6aa42d)
1999-06-29 18:47:06 +00:00
Jean-François Micouleau
0c927f2b1b 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
(This used to be commit 8d73f83b6c)
1999-06-22 18:42:10 +00:00
Matthew Chapman
99e42c0656 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.
(This used to be commit c3c25e762f)
1999-06-02 03:19:20 +00:00
Luke Leighton
d58b440fad alignment needed after unicode string names in password change.
(This used to be commit e66b6afc69)
1999-05-06 18:02:05 +00:00
Jean-François Micouleau
4e5bf481fb last part of RPC api change.
and of rpcclient eventlog funtion

	Jean Francois
(This used to be commit 7fc8659e83)
1999-05-03 22:04:02 +00:00
Jean-François Micouleau
60c211a3ab 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
(This used to be commit 66b4b896fb)
1999-05-03 21:52:29 +00:00
Matthew Chapman
e3a888d5a9 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
(This used to be commit f456dcf08e)
1999-05-01 05:56:55 +00:00
Jean-François Micouleau
be552ca350 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
(This used to be commit 4c515804b7)
1999-04-27 10:43:32 +00:00
Jean-François Micouleau
de0c233a7a Adding RPC spoolss code support and some new low-level printing functions.
Jean Francois
(This used to be commit 9e8192cc67)
1999-04-27 10:13:02 +00:00
Matthew Chapman
7fe5ba774b 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.
(This used to be commit cf30a472f7)
1999-04-23 14:47:45 +00:00
Matthew Chapman
1c71256291 Incorrect length (number of unicode characters rather than buffer size)
passed to ascii_to_unibuf in make_buffer2 was breaking User Manager.
(This used to be commit c518cef78d)
1999-04-11 01:39:16 +00:00
Matthew Chapman
373ea639e0 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.
(This used to be commit 7b830350eb)
1999-04-08 05:36:15 +00:00
Luke Leighton
6ce4aaad2b added SamrQueryDomainInfo call info level 0x3 for kix32.exe support
(This used to be commit ac070dfd39)
1999-03-29 17:24:46 +00:00
Luke Leighton
fa01e8764c added SAMR_USER_INFO_24 info level to samr_set_userinfo. this is used
by "Welcome to SAMBA Domain".
(This used to be commit 4aed18b5e1)
1999-03-25 15:14:30 +00:00
Luke Leighton
43a460075a 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.
(This used to be commit 2e58ed7424)
1999-03-25 13:54:31 +00:00
Luke Leighton
d4de2b0ae3 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.
(This used to be commit 9092368af8)
1999-03-24 21:09:34 +00:00
Luke Leighton
cd7c530f56 removed 2 unnecessary args from make_uni_hdr.
(This used to be commit f84dede27e)
1999-03-24 17:26:08 +00:00
Matthew Chapman
22ab15823f Fixed LSA Lookup Names. There were a few too many NULL pointers in a
negative response, which tended to crash lsass.exe.
(This used to be commit 6d03f61d25)
1999-03-24 12:18:28 +00:00
Luke Leighton
6b9cb3a254 dynamic memory allocation in samr enum dom users. works with 849 entries now.
(This used to be commit 103557e26b)
1999-03-23 20:43:44 +00:00
Matthew Chapman
803100197b Another UNICODE issue - this time BUFFER2 was being transmitted incorrectly.
(This used to be commit 73730f6004)
1999-03-23 13:45:42 +00:00
Matthew Chapman
5380636c4e If a buffer pointer is NULL then its length_is() attribute should not be
transmitted.

Such a problem was crashing Server Manager.
(This used to be commit 402ed18188)
1999-03-23 02:31:34 +00:00
Matthew Chapman
2a34b224b8 Ensuring return status is aligned in SAMR_QUERY_DISPINFO response.
(This used to be commit 1e17c2529c)
1999-03-21 12:55:18 +00:00
Luke Leighton
da4cd4f5a9 added a "createuser" command.
(This used to be commit fefb4bf191)
1999-03-19 21:20:19 +00:00
Luke Leighton
19e22bc8b6 value->enc_secret not value->secret
(This used to be commit d6cee14f80)
1999-03-19 21:15:03 +00:00
Matthew Chapman
f7eaf17216 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.
(This used to be commit 113d03a38a)
1999-03-18 09:36:43 +00:00
Matthew Chapman
eb82f27bd1 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.
(This used to be commit 900238a661)
1999-03-18 06:30:27 +00:00
Matthew Chapman
e8ac69c168 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.
(This used to be commit 365fa3b5fb)
1999-03-18 05:16:59 +00:00
Matthew Chapman
517aade8bd Added SVC_QUERY_DISP_NAME (corresponding to the GetServiceDisplayName API).
Needed during preliminary part of SAM replication.
(This used to be commit 03e722cdf5)
1999-03-16 06:24:24 +00:00
Luke Leighton
6e88171bac new "domtrust" test command. r&d into inter-domain trust accounts.
(This used to be commit 65b0abe8b7)
1999-03-12 05:47:06 +00:00
Luke Leighton
8cf03d5a39 - 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.
(This used to be commit 1c330d5682)
1999-03-08 19:19:01 +00:00
Matthew Chapman
05f772b431 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.
(This used to be commit 7d03e6e219)
1999-02-24 01:52:30 +00:00
Luke Leighton
1e71ecdcb2 added jeremy's new c++-like code for parsing of security descriptors.
(This used to be commit ec1b7000fd)
1999-02-23 22:39:54 +00:00
Luke Leighton
5c5f544538 samr_lookup_names "none found" error needed corrections with empty lists.
(This used to be commit e164b5080c)
1999-02-19 17:41:05 +00:00
Luke Leighton
b52903aefe problem been there for months: reg_r_info not aligning after string buffer.
(This used to be commit 66e2787ab7)
1999-02-18 18:50:44 +00:00
Luke Leighton
52fb07aea2 rpcclient shutdown command
(This used to be commit 59f081069a)
1999-02-16 18:04:21 +00:00
Matthew Chapman
2737f26ad6 Always null-terminate strings.
Also some string length and sizeof(pointer) corrections.
(This used to be commit ce24191939)
1999-02-15 05:33:30 +00:00
Matthew Chapman
fd96929ec1 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).
(This used to be commit a1d39af1ce)
1999-02-12 00:16:09 +00:00
Luke Leighton
c6d16eea43 the UNICODE issue...
(This used to be commit 73db80f341)
1999-02-11 18:50:13 +00:00
Luke Leighton
748f296a76 removal of the use of unistrn2 function: replace it with unistr2_to_str
which is more appropriate.
(This used to be commit ac72fe1ab3)
1999-02-09 19:51:44 +00:00
Luke Leighton
99a9b0f7c4 UNICODE byte ordering issue: typecast to uint16* replaced with SSVAL()
(This used to be commit 9084b7e33d)
1999-02-08 23:40:49 +00:00
Luke Leighton
1153f00f88 cache unix groups so that two-level getgrent calls don't occur.
(This used to be commit f7dfa55a2e)
1999-02-03 00:49:24 +00:00
Matthew Chapman
c80c2e0d9e 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?).
(This used to be commit 1e3873111f)
1999-02-01 02:39:37 +00:00
Luke Leighton
9b5043cb2f 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.
(This used to be commit ad58cdfac6)
1999-01-29 21:22:08 +00:00
Luke Leighton
6b7e1ead37 rpcclient "Service Control Manager" svcenum [-i] command.
(This used to be commit a022710f1e)
1999-01-28 21:11:15 +00:00
Luke Leighton
0504d696f8 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_?
(This used to be commit a15a3f95f2)
1998-12-20 00:37:24 +00:00
Luke Leighton
3cc7e2936a adding svcctl parsing code
(This used to be commit c6f2f58c74)
1998-12-09 23:16:37 +00:00
Luke Leighton
74576a48fd adding some enumerate services code, client and server.
(This used to be commit dacf5b152b)
1998-12-09 16:28:04 +00:00
Luke Leighton
7135fb0a2c adding "Service Control Manager" commands to rpcclient.
(This used to be commit e5ee965f8d)
1998-12-08 23:29:37 +00:00
Luke Leighton
8308c000b2 adding srvsvc pipe.
(This used to be commit d06d636994)
1998-12-08 00:25:04 +00:00
Luke Leighton
54529fbd66 bugs in rpcclient. add_aliasmem uses a DOM_SID2 not a DOM_SID.
(This used to be commit 8a85d7abed)
1998-12-07 21:32:02 +00:00
Luke Leighton
312f4f3960 - lib/unix_sec_ctxt.c
attempt at taking lib/uid.c and getting a unix security context
	change module that is independent of "cnums" and "snums".
	a security context is needed for pipes, not just IPC$ or other
	services.

- group database API

	added add_group/alias_member, del_group/alias_member,
	del_group/alias_entry functions.  del_builtin_entry() is
	deliberately set to NULL to cause an exception, you cannot
	delete builtin aliases.

- parse_lsa.c srv_lsa.c

	fixed lookup_names code, it was a load of trash and didn't do
	anything.

- cmd_samr.c rpcclient.c srv_samr.c

	added "deletegroup", "deletealias", "delaliasmem", "delgroupmem",
	"addgroupmem", "addaliasmem", "createalias", "creategroup", to
	both client and server code.

	server code calls into unix stubs right now, which don't actually
	do anything.  the only instance where they are expected to do
	anything is in appliance mode NOT even in the ldap code or anything.

	client code modified to call samr_lookup_names() for group code
	(because we can) and lsa_lookup_names() for alias code (because
	we have to).

- srv_lookup.c

	oops, lookup on unsplit name, we got lookup on DOMAIN, DOMAIN\name
	instead of DOMAIN, name.
(This used to be commit b8175702ef)
1998-12-07 17:23:48 +00:00
Luke Leighton
7cbd3bcef5 added delete domain group and local group and delete domain group member.
(This used to be commit bf15343def)
1998-12-04 23:06:27 +00:00
Luke Leighton
89c56492a8 - oops, i got "add alias member" and "delete alias member" swapped.
- samr_enum_dom_users, the first 4 bytes is some sort of garbage,
  nt5-beta2 clears them out to zeros whereas nt4 does not.
  fixed bug where we were assuming that the first 4 bytes of a
  response _had_ to be non-zero.

- cli_lsarpc.c: forgot to append the rid on the lsa_lookup_names()
  client call.

- added in "addaliasmem" and "addgroupmem" commands.  the addaliasmem
  command actually turned out to be a "delaliasmem" :-) :-)

- parse_lsa.c: moved assert array check to after the size of useable
  array space is set...
(This used to be commit 165b15a8ca)
1998-12-04 21:48:06 +00:00
Luke Leighton
cf0ea874b1 - renamed do_samr_xxx to samr_xxx
- renamed do_lsa_xxx to lsa_xxx

- added "enumgroups [-m]" command, enumerates groups, shows members.
- added cmd_sam_add_groupmem(), need to call these in rpcclient.c
- added cmd_sam_add_aliasmem(), need to call these in rpcclient.c

- modified "enumaliases [-m]" command

- improved "enumgroups" and "enumaliases" to display names not just RIDS/SIDs.

- renamed "samr_unknown_12" to "samr_lookup_rids".

- added the following client-side functions:

	get_samr_query_groupmem()
	get_samr_query_aliasmem()
	get_samr_query_groupinfo()
	samr_enum_dom_groups()
	samr_enum_dom_aliases()
	samr_add_aliasmem()
	samr_add_groupmem()

- improved display output (display.c)
(This used to be commit eacc5e581a)
1998-12-04 16:30:00 +00:00
Luke Leighton
32167eda0d added createalias command to rpcclient
(This used to be commit 4771d5451b)
1998-12-03 22:20:30 +00:00
Luke Leighton
b99dc808df create domain group command (creategroup) added to rpcclient.
renamed do_samr_xxxx to samr_xxxx.
(This used to be commit 1e5d81c154)
1998-12-03 20:50:33 +00:00
Luke Leighton
404b7b49b2 adding group parsing: add/modify/delete/add members.
(This used to be commit 13a656b0e5)
1998-12-03 17:29:03 +00:00
Luke Leighton
364025fe37 spotted the mistake in group_info1 parsing.
(This used to be commit e39c0c76ae)
1998-12-02 22:13:48 +00:00
Luke Leighton
78df0fb8f1 added rid and sid_name_use to DOMAIN_GRP_MEMBER, for use in group member
query.

domain groups now work, hurrah!  only thing is that the description is
one character long, don't know why (which is wierd in itself).
(This used to be commit 78a86c6496)
1998-12-02 22:05:56 +00:00
Luke Leighton
51534a4b97 adding group member code, made a start. found that the group members'
rid is needed not the name (see DOMAIN_GRP_MEMBER) decided to go home.
(This used to be commit 9337049dfc)
1998-12-02 01:13:02 +00:00
Luke Leighton
5dd26daad5 query_aliasmem code. it works (hurrah).
(This used to be commit f7f2516df4)
1998-12-01 22:18:48 +00:00
Luke Leighton
04e382fb16 rpc_samr.h parse_samr.c srv_samr.c :
samr_query_aliasmembers (cool!)

util_pwdb.c sids.c nmbd.c server.c smbpasswd.c swat.c :

	pwdb_initialise(BOOL is_server) now creates / reads DOMAIN_NAME.SID
	if is_server is True, and does LsaQueryInfoPolicy(levels 3 and 5)
	to obtain member and pdc sids.
(This used to be commit 3e1eb4f26b)
1998-12-01 19:10:44 +00:00
Luke Leighton
67638b8d2b adding some samr parsing calls (group / alias adding / deleting)
added code that moves MACHINE.SID to DOMAIN_NAME.SID if it exists.
(This used to be commit 51c1c31768)
1998-12-01 16:04:24 +00:00
Luke Leighton
30038de462 weekend work. user / group database API.
- split sam_passwd and smb_passwd into separate higher-order function tables

- renamed struct smb_passwd's "smb_user" to "unix_user".  added "nt_user"
plus user_rid, and added a "wrap" function in both sam_passwd and smb_passwd
password databases to fill in the blank entries that are not obtained
from whatever password database API instance is being used.

NOTE: whenever a struct smb_passwd or struct sam_passwd is used, it MUST
be initialised with pwdb_sam_init() or pwd_smb_init(), see chgpasswd.c
for the only example outside of the password database APIs i could find.

- added query_useraliases code to rpcclient.

- dealt with some nasty interdependencies involving non-smbd programs
and the password database API.  this is still not satisfactorily
resolved completelely, but it's the best i can do for now.

- #ifdef'd out some password database options so that people don't
mistakenly set them unless they recompile to _use_ those options.

lots of debugging done, it's still not finished.  the unix/NT uid/gid
and user-rid/group-rid issues are better, but not perfect.  the "BUILTIN"
domain is still missing: users cannot be added to "BUILTIN" groups yet,
as we only have an "alias" db API and a "group" db API but not "builtin-alias"
db API...
(This used to be commit 5d5d7e4de7)
1998-11-29 20:03:33 +00:00
Luke Leighton
5ebcdbae9b yeehaah got users to be included in S-1-5-xxx-yyy-zzz's local groups.
now need search capability on S-1-5-20, which will need argh, a
"group database API" on S-1-5-20, and the ability to add BUILTIN\Admins
etc to "local group map" argh.
(This used to be commit a24f6eb00b)
1998-11-25 23:54:30 +00:00
Luke Leighton
59d4087160 LsaLookupNames client call (first used as lookupnames command in rpcclient).
(This used to be commit 68342a29a8)
1998-11-25 19:57:04 +00:00
Luke Leighton
4cee58780c unix instance of group database API
(This used to be commit e76f593b35)
1998-11-23 21:51:05 +00:00
Jeremy Allison
f22b817d3f acconfig.h configure configure.in include/config.h.in: Added -lsec and -lsecurity checks
in a more sane way.
rpc_client/cli_netlogon.c: Removed correct bits check to see if this works with an NT3.51 PDC.
rpc_parse/parse_samr.c: Fixed compile warnings.
Jeremy.
(This used to be commit 34d8f4b1c4)
1998-11-20 20:44:21 +00:00
Luke Leighton
74d539f557 - group database API. oops and oh dear, the threat has been carried out:
the pre-alpha "domain group" etc parameters have disappeared.

- interactive debug detection

- re-added mem_man (andrew's memory management, detects memory corruption)

- american spellings of "initialise" replaced with english spelling of
  "initialise".

- started on "lookup_name()" and "lookup_sid()" functions.  proper ones.

- moved lots of functions around.  created some modules of commonly used
  code.  e.g the password file locking code, which is used in groupfile.c
  and aliasfile.c and smbpass.c

- moved RID_TYPE_MASK up another bit.  this is really unfortunate, but
  there is no other "fast" way to identify users from groups from aliases.
  i do not believe that this code saves us anything (the multipliers)
  and puts us at a disadvantage (reduces the useable rid space).
  the designers of NT aren't silly: if they can get away with a user-
  interface-speed LsaLookupNames / LsaLookupSids, then so can we.  i
  spoke with isaac at the cifs conference, the only time for example that
  they do a security context check is on file create.  certainly not on
  individual file reads / writes, which would drastically hit their
  performance and ours, too.

- renamed myworkgroup to global_sam_name, amongst other things, when used
  in the rpc code.  there is also a global_member_name, as we are always
  responsible for a SAM database, the scope of which is limited by the role
  of the machine (e.g if a member of a workgroup, your SAM is for _local_
  logins only, and its name is the name of your server.  you even still
  have a SID.  see LsaQueryInfoPolicy, levels 3 and 5).

- updated functionality of groupname.c to be able to cope with names
  like DOMAIN\group and SERVER\alias.  used this code to be able to
  do aliases as well as groups.  this code may actually be better
  off being used in username mapping, too.

- created a connect to serverlist function in clientgen.c and used it
  in password.c

- initialisation in server.c depends on the role of the server.  well,
  it does now.

- rpctorture.  smbtorture.  EXERCISE EXTREME CAUTION.
(This used to be commit 0d21e1e609)
1998-11-17 16:19:04 +00:00
Jeremy Allison
8fc1504ff8 Makefile.in configure configure.in include/config.h.in: Changes for DGUX and UNIXWARE.
groupdb/aliasdb.c groupdb/aliasfile.c groupdb/groupfile.c: Don't use snprinf, use slprintf.
include/includes.h: Fix YP problem.
include/smb.h: Fix ZERO_STRUCTP.
lib/util_sock.c: Added strerror() in debugs.
passdb/ldap.c: Don't use snprinf, use slprintf.
rpc_client/cli_lsarpc.c rpc_client/cli_pipe.c rpc_parse/parse_sec.c rpc_server/srv_pipe.c: Don't use snprinf, use slprintf.
script/installman.sh: DGUX changes.
smbd/open.c smbd/oplock.c: Fixed gcc warnings.
web/swat.c: Changes USER to SWAT_USER.
(This used to be commit 4c2b5a0098)
1998-11-13 21:41:01 +00:00
Luke Leighton
d3e6aa666d ZERO_STRUCTP not PN
(This used to be commit ff8667c880)
1998-11-13 19:07:28 +00:00
Luke Leighton
d90063493c use ZERO_STRUCTPN (checks for NULL) not ZERO_STRUCTP (doesn't check for NULL)
(This used to be commit 70ac9dbcec)
1998-11-13 17:36:42 +00:00
Andrew Tridgell
2db96e3047 fixes for OSF1 compilation
(This used to be commit 5be3c37f50)
1998-11-13 03:37:01 +00:00
Jeremy Allison
2164685b9f include/smb.h: Re-added zero pointer protection to ZERO_STRUCTP.
lib/util_sock.c: Added strerror() calls to getpeername failures (which seem to be giving IRIX trouble at the moment).
rpc_parse/parse_sec.c: Changed use of ZERO_STRUCTPN to ZERO_STRUCTP which again does zero pointer protection.
smbd/quotas.c: Fixed typo.
Jeremy.
(This used to be commit b62f008974)
1998-11-13 02:07:07 +00:00
Luke Leighton
cb265dbb8b security descriptors
(This used to be commit 9412edfd4c)
1998-11-13 01:38:41 +00:00
Luke Leighton
2c7f6da1fa security descriptors.
kanji const char* warnings.
(This used to be commit 06abdfd68e)
1998-11-12 23:35:05 +00:00
Luke Leighton
597c5a6caa jean-f. sent me some S-1-3-0,1,2,3 SIDs and names. S-1-3 doesn't exist.
security descriptor testing.  hey wow, you can get a SD then send it back!
(This used to be commit 7466c3113e)
1998-11-12 19:21:20 +00:00
Luke Leighton
1ab463a795 security descriptors and registry.
(This used to be commit 9814ac8a65)
1998-11-12 16:03:35 +00:00
Luke Leighton
e35207f28d security descriptor info, provided by jean-francois
(This used to be commit 719382a557)
1998-11-11 21:44:02 +00:00
Luke Leighton
60a91a1dca clearing up security descriptor
(This used to be commit abdc9d790b)
1998-11-11 19:22:08 +00:00
Luke Leighton
58cbefdaaf registry delete value command: "regdeleteval".
this is just so unbelievably simple to do...
(This used to be commit c05254a150)
1998-11-11 00:57:13 +00:00
Luke Leighton
edf630c85e renamed unk_1b to flush_key
(This used to be commit ddfdb65346)
1998-11-11 00:43:41 +00:00
Luke Leighton
07eb9133ef - renamed open_policy to open_hklm.
- renamed open_unk_4 to open_hku

- fixed createkey issue spotted by phil cox
(This used to be commit 7df85b9567)
1998-11-11 00:36:15 +00:00
Luke Leighton
75ca9df787 rpcclient registry key delete command: "regdeletekey".
(This used to be commit 20987b6105)
1998-11-10 22:14:05 +00:00
Luke Leighton
c098e44df4 registry modification requires a "sync" or "refresh" on the parent key.
opcode 0xb added to do this.  a likely candidate name is "RegFlushKey".
(This used to be commit 5e9567e3c7)
1998-11-10 22:03:34 +00:00
Jeremy Allison
375e53826c include/local.h:
include/smb.h:
param/loadparm.c: Made GUEST_SESSSETUP run time selectable. Horror of horrors :-).
printing/printing.c: Added J.F.'s latest fix.
rpc_parse/parse_misc.c:
parse_reg.c:
rpcclient/cmd_reg.c:
rpcclient/display.c: SGI compiler signed/unsigned issues.
smbd/reply.c: Made GUEST_SESSSETUP run time selectable. Horror of horrors :-).
utils/testparm.c: Added extra test.
Jeremy.
(This used to be commit 9668a5ef50)
1998-11-10 20:51:25 +00:00
Luke Leighton
1e1c2ec93c rpcclient registry commands.
(This used to be commit 36fcb4a6e6)
1998-11-10 19:05:00 +00:00
Luke Leighton
748fe7a383 split socket util functions into util_sock.c. util.c NOT committed
and util_sock.c NOT included in Makefile.in.

registry commands added to rpcclient.

waiting for 2_0_0 split before committing modified files.  these files
are new modules, and are not referenced in the Makefile.in
(This used to be commit 373f60256f)
1998-11-09 16:40:38 +00:00
Luke Leighton
ba4135aaf8 fix to some of the unicode string handling. there are others pending
in non-critical areas.
(This used to be commit 6da2e15272)
1998-11-03 18:37:05 +00:00
Jeremy Allison
e600debafb Added clear-out-structure fix for make_unistr2.
Jeremy.
(This used to be commit 2bce2cf6d8)
1998-10-28 18:32:34 +00:00
Luke Leighton
528c3d3e68 amazing. the improvements to NT continue, evidence for which shows up
now as "RPC fault" if the UNIHDR structure lengths do not exactly
match up to the length of the data stream.

so, all versions of samba prior to this one have an off-by-one bug
in unicode string lengths.

all versions of NT prior to NT 5 beta 2 could possibly have buffer
problems when receiving badly formatted UNICODE strings.
(This used to be commit 161eb6f511)
1998-10-27 15:03:47 +00:00
Luke Leighton
cbd0b2ccf9 bug fix in lsa_trans_names.
well-known aliases S-1-5-20 is actually S-1-5-0x20 but sid_to_string does
decimal not hexadecimal oops.
(This used to be commit 4d830e2436)
1998-10-22 18:15:23 +00:00
Luke Leighton
eadc5b8c6e domain aliases added a bit better: does local aliases if you query
for sid S-1-5-20 and does (nothing at the moment) if you query for
your own sid.
(This used to be commit da40f26f4b)
1998-10-21 22:36:26 +00:00
Luke Leighton
21e107fd42 the next dialog: user-groups. it's not very sensible what appears, but hey:
it appears!
(This used to be commit 399035098f)
1998-10-21 21:11:16 +00:00
Jeremy Allison
6e3af45afe Fixed mainly signed/unsigned issues found by SGI cc in -fullwarn mode.
smbd/chgpasswd.c: Fixed (my) stupid bug where I was returning stack based variables. Doh !
smbd/trans2.c: Allows SETFILEINFO as well as QFILEINFO on directory handles.
Jeremy.
(This used to be commit 0b44d27d0b)
1998-10-21 16:58:34 +00:00
Luke Leighton
ac9be4ddca oops!
(This used to be commit 500e5536be)
1998-10-21 16:54:23 +00:00
Luke Leighton
4773506383 signed / unsigned issues
(This used to be commit bd2fc6bb85)
1998-10-21 16:28:44 +00:00
Luke Leighton
9307940876 fixing smbd encrypted rpcs (data lens, alloc hints, sequence nums argh).
put unicode strings after SAMLOGON query regardless of whether it's
an NT mailslot or a non-NT mailslot, after having observed this behaviour
out of NT machines.
(This used to be commit c101113ec2)
1998-10-21 01:35:01 +00:00
Luke Leighton
476d0fd236 calls to prs_grow() on array structures so that data construction doesn't
over-run buffers
(This used to be commit 06cc6eaa50)
1998-10-20 16:24:57 +00:00
Luke Leighton
01de603084 - dce/rpc code
- removed debug info in struni2 and unistr2 (security risk)

- rpc_pipe function was getting pointer to data then calling realloc *dur*

- password check function, the start of "credential checking",
  user, wks, domain, pass as the credentials (not just user,pass which
  is incorrect in a domain context)

- cli_write needs to return ssize_t not size_t, because total can be -1
  if the write fails.

- fixed signed / unsigned warnings (how come i don't get those any more
  when i compile with gcc???)

- nt password change added in smbd.  yes, jeremy, i verified that the
  SMBtrans2 version still works.
(This used to be commit fcfb40d2b0)
1998-10-19 17:32:10 +00:00
Luke Leighton
a785f8d2c9 dce/rpc
(This used to be commit 29434f496c)
1998-10-16 23:40:59 +00:00
Luke Leighton
c9ab92ffe5 rpcclient ntlogin test
(This used to be commit f69cf05ff5)
1998-10-16 00:59:22 +00:00
Luke Leighton
c404bb7754 rpcclient interactive login (with trust account changing if you are root)
cli_session_setup handles null sessions correctly
(This used to be commit 60c0f22a4e)
1998-10-15 23:51:07 +00:00
Luke Leighton
a42afcdcc7 bug-fixing against:
AS/U:
      it returns dce/rpc "first" and "last" bits _clear_ in a bind/ack
      response, when they should be set in a (small) packet.  they also,
      in the bind/ack do not set a secondary address string at all, so
      we can't check against that...

Win95:
      client-side dce/rpc code is a bit odd.  it does a "WaitNamedPipeState"
      and has slightly different pipe-naming (\PIPE\LANMAN is joined by
      \PIPE\SRVSVC, \PIPE\WINREG etc whereas nt just has \PIPE\LANMAN
      and \PIPE\).

Win95-USRMGR.EXE:
      added LsaOpenPolicy (renamed existing to LsaOpenPolicy2).
      added SamrConnect (renamed existing to SamrConnect2).
(This used to be commit a7fccd807b)
1998-10-15 05:47:29 +00:00
Luke Leighton
935dc98f66 dce/rpc
(This used to be commit 69f5f9f889)
1998-10-14 06:29:20 +00:00
Luke Leighton
78c1fd054f dce/rpc
(This used to be commit 8a7ac4a25d)
1998-10-09 23:31:50 +00:00
Luke Leighton
abb67ee6de signed / unsigned issues spotted by herb
(This used to be commit 0b90442021)
1998-10-09 20:31:52 +00:00
Luke Leighton
8158620124 dce/rpc.
(This used to be commit e0445419b2)
1998-10-09 20:17:11 +00:00
Luke Leighton
755986764f dce/rpc
(This used to be commit 32d0f5e4a5)
1998-10-09 19:05:19 +00:00
Luke Leighton
6909350ed9 dce/rpc
(This used to be commit 62fdeef1b7)
1998-10-08 23:57:46 +00:00
Luke Leighton
48b31ae44f dce/rpc
(This used to be commit 6677b888bd)
1998-10-07 21:42:24 +00:00
Luke Leighton
2fef8f2e87 dce/rpc
(This used to be commit 34afa638f6)
1998-10-07 15:22:49 +00:00
Andrew Tridgell
f931d7181c put #if BROKEN_CODE around all the bits of code in rpc_parse.c that
don't compile.

Luke, you'll need to remove these when you've fixed the code.
(This used to be commit 4f411d6264)
1998-10-07 01:01:26 +00:00
Luke Leighton
c07b2bdf90 dce/rpc
(This used to be commit eb279cabd0)
1998-10-06 22:03:04 +00:00
Luke Leighton
732d4ff7da Makefile.in :
- added srvsvc client files

clientgen.c :

	- replaced cli_error(cli, int *cls, int *err) with
	  cli_error(cli, uint8 cls, uint32 *err).  this version detects
	  32 bit status messages.  the DOS error "MORE_DATA", the
	  equivalent of the 32 bit *warning* 0x8000 0005
	  (STATUS_BUFFER_OVERFLOW), was being processed as an error,
	  terminating the cli_receive_trans() call.

cli_pipe.c :

	- replaced calls that had been incorrectly modified from
	  32 bit warnings (0x8000 0005 - STATUS_BUFFER_OVERFLOW)
	  to 8 bit DOS errors (0x01 0xEA - MORE_DATA).
	  the use of the old version of cli_error (DOS only)
	  instead of the new one (DOS and 32 bit) caused the
	  dce/rpc client code to fail.

	- replaced 2 space indentation with tab indentation in all functions.

cli_srvsvc.c :
cmd_srvsvc.c :

	- added these files back in, fixing them up to use jeremy's
	  modified versions of the dce/rpc client functions.

parse_srv.c :

	- added back in some "unused" functions required by dce/rpc
	  client-side code.  it would be helpful if all such "unused"
	  functions could be added back in.

rpcclient.c :

	- added "session", "file", "share", "connection" enumeration
	  functions back in.  these are equivalent to nt's "NetXXXXXEnum"
	  Win32 (MSDN) functions.

	- added "srvinfo" function back in.  this is equivalent to
	  nt's NetServerGetInfo Win32 (MSDN) function.
(This used to be commit bcf39ffdcc)
1998-10-02 21:09:23 +00:00
Luke Leighton
d8f609aeeb lsa_lookup_sids command added. severe debugging needed on lookup_sids
code.  added "quality of service" capability to lsa_open_policy code.

different lsa_open_policy queries are *not* dealt with in the server code.
answers like "0xC000 0022" - access denied - will have to be made to
lsa_lookup_sids calls when a "quality of service" request is *not* specified
in the lsa_open_policy call.
(This used to be commit 299a723d4e)
1998-09-30 19:09:57 +00:00
Alexandre Oliva
a2d7f765e8 get away with dummy and .dummy files
(This used to be commit 90a8a02484)
1998-09-29 04:52:17 +00:00
Alexandre Oliva
cf971f88ac automated generation of .dummy files for each subdirectory;
dummy.in files are no longer needed, and new directories will be taken
care of automatically, at configure (or config.status --recheck) time
(This used to be commit 237a8e5fe6)
1998-09-28 00:14:36 +00:00
Luke Leighton
4b9e0941b9 rpcclient: got samr command "enumusers -g -u" working
(This used to be commit 3a00023efe)
1998-09-25 23:14:20 +00:00
Luke Leighton
6fb5804b28 added in samr commands. assistance in returning the missing functions,
automatically removed because they were "unused", would be appreciated.
(This used to be commit d0f7b0d915)
1998-09-25 22:20:05 +00:00
Luke Leighton
ff07b2e4a3 added wksinfo command to rpcclient, which don't work too good.
(This used to be commit 8d23da91cb)
1998-09-25 21:20:37 +00:00
Luke Leighton
66d5d73a5d added rpcclient program
(This used to be commit aa38f39d67)
1998-09-25 21:01:52 +00:00
Luke Leighton
d8f66be141 qualifier name in session_enum was being assumed to exist. if NULL, the
name should not be read.  file_enum and connection_enum didn't do this:
wonder why only session_enum had this bug?
(This used to be commit 203a97e39e)
1998-09-24 20:19:31 +00:00
Luke Leighton
0c5dcf52b0 took out #ifdef'd code in make_samr_r_query_usergroups that copied
DOM_GID static-size array, because it's malloc'd now.
(This used to be commit 7776002218)
1998-09-24 20:17:19 +00:00
Luke Leighton
f650b65800 this fixes the last of the issues where USRMGR.EXE and SRVMGR.EXE were
failing.  running these two programs on a samba pdc now work.


parse_samr.c:

- removed __LINE__ from debug macros.

- removed call to SMB_ASSERT_ARRAY() in samr_r_query_usergroups.  the
  DOM_GID array is a malloc'd array (by make_dom_gids) not a static
  array.


srv_samr.c:

- replaced all "struct smb_passwd"s with sam_passwds instead.  there
  were uid to rid confusion issues (assumptions that uids were equal
  to rids).

- #if 0'd the pdb_rid_is_user() call which, given the above corrections,
  would probably work now.


srv_util.c:

- replaced "struct smb_passwd" with sam_passwd in lookup_user_rid, as
  assumptions were being made that uids were equal to rids.
(This used to be commit 3f98697cd5)
1998-09-24 20:02:56 +00:00
Alexandre Oliva
e649750cb4 major autoconf clean-up
fix problems in builds with srcdir!=builddir
(This used to be commit 1ffc3b807a)
1998-09-21 09:07:08 +00:00
Andrew Tridgell
e9ea36e4d2 tridge the destroyer returns!
prompted by the interpret_security() dead code that Jean-Francois
pointed out I added a make target "finddead" that finds potentially
dead (ie. unused) code. It spat out 304 function names ...

I went through these are deleted many of them, making others static
(finddead also reports functions that are used only in the local
file).

in doing this I have almost certainly deleted some useful code. I may
have even prevented compilation with some compile options. I
apologise. I decided it was better to get rid of this code now and add
back the one or two functions that are needed than to keep all this
baggage.

So, if I have done a bit too much "destroying" then let me know. Keep
the swearing to a minimum :)

One bit I didn't do is the ubibt code. Chris, can you look at that?
Heaps of unused functions there. Can they be made static?
(This used to be commit 2204475c87)
1998-09-05 05:07:05 +00:00
Andrew Tridgell
ea1cd3fbd7 we were setting the strings 1 too long in make_srv_share_info1_str()
(This used to be commit 29e1e59db8)
1998-09-03 05:35:13 +00:00
Andrew Tridgell
61b5fd6f32 bounds check next_token() to prevent possible buffer overflows
(This used to be commit 3eade55dc7)
1998-08-31 03:11:42 +00:00
Jeremy Allison
8afc9c80ac Changed ASSERT macros to SMB_ASSERT macros as some systems already
have an ASSERT macro defined.
Jeremy.
(This used to be commit dbe6ad014a)
1998-08-24 21:49:10 +00:00
Andrew Tridgell
3f3f47b0bd added ASSERT() and ASSERT_ARRAY() macros and sprinkled them liberally
in the rpc code.
(This used to be commit e6ce1c5b5a)
1998-08-22 02:54:21 +00:00
Andrew Tridgell
b9623ab59e this is the bug change to using connection_struct* instead of cnum.
Connections[] is now a local array in server.c

I might have broken something with this change. In particular the
oplock code is suspect and some .dll files aren't being oplocked when
I expected them to be. I'll look at it after I've got some sleep.
(This used to be commit c7ee025ead)
1998-08-14 17:38:29 +00:00
Andrew Tridgell
87bcd5502c added ignore rules for the dummy files
(This used to be commit 687f76a17d)
1998-08-09 11:25:49 +00:00
Andrew Tridgell
8d42ee0f2c some merge cleanups
(This used to be commit 1d655b7c64)
1998-07-29 03:15:02 +00:00
Jeremy Allison
7a2b695bcb password.c: Fixes to allow Win95 clients to have lm encrypted passwords
recognised.
lib/rpc/client/cli_login.c: Fix debug comment.
lib/rpc/parse/parse_misc.c: Fix for passing null pointers.
lib/rpc/parse/parse_net.c: Send correct password lengths when called
                           from Win95.
Jeremy.
(This used to be commit ad1848b355)
1998-07-06 22:48:21 +00:00
Jeremy Allison
bbd7ca65e7 clientgen: Added USE_SSL for client shutdown.
clitar.c: Added 'Samba style' comments before string_create_s().
loadparm.c: Fixed missing comma in SSL code.
util.c: Removed string_create_s(). Currently it's only called from
        clitar.c and having it here as well as a static in clitar
        causes the compile to break (Richard, please decide where
        you want this function).
lib/rpc/parse/parse_net.c: Fix from <anders.blomdell@control.lth.se>
                           to stop coredump on missing parameter.
Jeremy.
(This used to be commit d23b443225)
1998-06-16 18:25:36 +00:00
Jeremy Allison
1b86bead99 I was wrong about the length and max_length values in make_unistr2.
Jeremy.
(This used to be commit 1d77728bbb)
1998-06-09 02:33:56 +00:00
Jeremy Allison
e85295d924 loadparm.c: Removed 'domain other sids' parameter.
lib/rpc/include/rpc_lsa.h: Changed #defines for RPC calls - moved some, made LSA_LOOKUPNAMES correct.
lib/rpc/include/rpc_misc.h: Changed DOMAIN_ALIAS_xxx to BUILTIN_ALIAS_xxx.
                            Changed bitmasks for uid to rid to be 1 bit.
lib/rpc/parse/parse_misc.c: Changed make_unistr2 to put length as given, max length as one more.
lib/rpc/server/srv_netlog.c: Removed 'domain other sids' parameter.
lib/rpc/server/srv_samr.c: Changed DOMAIN_ALIAS_xxx to BUILTIN_ALIAS_xxx.
lib/rpc/server/srv_util.c: Changed DOMAIN_ALIAS_xxx to BUILTIN_ALIAS_xxx.
Jeremy.
(This used to be commit 34c91840a3)
1998-06-09 02:26:26 +00:00
Luke Leighton
684edc9fcd - created pdb_sethexpwd(), to be called from all pwd apis that need to
store passwords in ascii format

- dealt with lots of signed/unsigned char thingies spotted by Tim Winders.
(This used to be commit bd825f1ef1)
1998-05-24 13:36:43 +00:00
Luke Leighton
9c99863642 dce/rpc net time command from jean-francois. does not support timezones
(This used to be commit 8e11d542ee)
1998-05-20 13:17:26 +00:00
Jeremy Allison
f8a4273407 passdb.c
server.c: Moved generate_machine_sid() into passdb.c for Jean-Francois
          (who might want an LDAP version). Changed locking to free exclusive
          lock as soon as possible to prevent contention.
lib/rpc/parse/parse_samr.c
lib/rpc/server/srv_samr.c: Changed last SID-as-string manipulation
                           function to use DOM_SID structure.
Jeremy.
(This used to be commit 3b8f5aef57)
1998-05-14 21:10:49 +00:00
Jeremy Allison
a4276507e4 chgpasswd.c: Added comments to #ifdefs
ipc.c: Caused samba password changing not to be done if UNIX password
       changing requested and not successful.
util.c: Added string_to_sid() and sid_to_string() functions.
lib/rpc/client/cli_samr.c:
lib/rpc/include/rpc_misc.h:
lib/rpc/parse/parse_lsa.c:
lib/rpc/parse/parse_misc.c:
lib/rpc/parse/parse_net.c:
lib/rpc/parse/parse_samr.c:
lib/rpc/server/srv_lsa.c:
lib/rpc/server/srv_lsa_hnd.c:
lib/rpc/server/srv_netlog.c:
lib/rpc/server/srv_samr.c:
lib/rpc/server/srv_util.c: Changes so that instead of passing SIDs
around as char *, they are converted to DOM_SID at the earliest
opportunity, and passed around as that. Also added dynamic memory
allocation of group sids. Preparing to auto-generate machine sid.
Jeremy.
(This used to be commit 134d6fa79c)
1998-05-14 01:30:40 +00:00
Andrew Tridgell
5b619d9514 initialise some variables (stops warning)
(This used to be commit 6074d09dbf)
1998-05-13 05:07:55 +00:00
Luke Leighton
00d8e6626f function comments wrong
(This used to be commit da11063cbd)
1998-05-12 16:43:52 +00:00
Jeremy Allison
f888868f46 This is a security audit change of the main source.
It removed all ocurrences of the following functions :

sprintf
strcpy
strcat

The replacements are slprintf, safe_strcpy and safe_strcat.

It should not be possible to use code in Samba that uses
sprintf, strcpy or strcat, only the safe_equivalents.

Once Andrew has fixed the slprintf implementation then
this code will be moved back to the 1.9.18 code stream.

Jeremy.
(This used to be commit 2d77445400)
1998-05-12 00:55:32 +00:00
Andrew Tridgell
3dfc0c8472 changed to use slprintf() instead of sprintf() just about
everywhere. I've implemented slprintf() as a bounds checked sprintf()
using mprotect() and a non-writeable page.

This should prevent any sprintf based security holes.
(This used to be commit ee09e9dadb)
1998-05-11 06:38:36 +00:00
Luke Leighton
f601e6e048 patches from jean francois: couple of minor bugs
(This used to be commit 532b3956c6)
1998-05-05 09:04:49 +00:00
Jeremy Allison
e305c2c9e2 clientgen.c: Fixed null session setup bug.
password.c: Stopped cli_nt_logout call (we don't have it correct yet).
            Added Luke object-orientation fix :-).
smb.h: Added clnt_name_slash to cli_state.
lib/rpc/client/cli_login.c: Changed global_myname to clnt_name_slash where needed.
lib/rpc/client/cli_netlogon.c: Fixed debug messages, don't check creds on error.
lib/rpc/client/cli_pipe.c: Fixed debug messages, Added Luke object-orientation fix.
lib/rpc/parse/parse_misc.c: Fixed STRING2 linearization bug that was adding 1.
Jeremy.
(This used to be commit c6c22df201)
1998-04-29 19:22:01 +00:00
Jeremy Allison
d3832506b2 This is the checkin that adds the security=domain functionality.
WARNING - so far this has only been tested against a Samba PDC
(still waiting for IS to add me the machine accounts :-).

Still missing is the code in smbpasswd that will add a machine
account password and change it on the domain controller, but
this is not hard, and I will check it in soon.

Jeremy.
(This used to be commit 17b94a7084)
1998-04-29 00:02:57 +00:00
Jeremy Allison
30675f81f6 Makefile: Added nterr.c into the mix.
clientgen.c: Added nt_error as an entry in the struct client_state.
password.c: Open the netlogon pipe.
smb.h: Added nt_error as an entry in the struct client_state.
lib/rpc/parse/parse_net.c: Added comments on net logon.
lib/rpc/server/srv_netlog.c: Added comments on net logon.
Jeremy.
(This used to be commit 899a9f0dce)
1998-04-23 22:59:19 +00:00
Jeremy Allison
e300c0346f includes.h: Moved HPUX undefine of SEMMSL to where it actually does something.
ipc.c: Added Luke's debug statement.
locking_slow.c: Added FTRUNCATE_NEEDS_ROOT code for broken systems that
need it (not sure what these are yet).

membuffer.c ntdomain.h proto.h
lib/rpc/include/rpc_dce.h lib/rpc/include/rpc_srvsvc.h
lib/rpc/parse/parse_prs.c lib/rpc/parse/parse_rpc.c
lib/rpc/server/srv_pipe_hnd.c lib/rpc/server/srv_util.c:
   Re-merge of Luke's NTDOM changes 'cos he's a lazy git with
   carpel tunnel syndrome :-).

Jeremy.
(This used to be commit 52e3966fbc)
1998-04-10 18:21:16 +00:00
Jeremy Allison
5d7c8375e4 clientgen.c ipc.c smbpasswd.c: Fixes for warnings (from Herb).
quotas.c: Linux quota fix.
util.c: Ensure smb_read_error is zero in all calls that can set it.
lib/rpc/include/rpc_misc.h lib/rpc/include/rpc_netlogon.h
lib/rpc/parse/parse_misc.c lib/rpc/parse/parse_net.c
lib/rpc/server/srv_netlog.c : Modify Luke's code to call
SamOEMhash().

Jeremy.
(This used to be commit 7f74970838)
1998-03-24 00:37:53 +00:00
Jeremy Allison
fdeea341ed "For I have laboured mightily on Luke's code, and hath broken
all I saw" - the book of Jeremy, chapter 1 :-).

So here is the mega-merge of the NTDOM branch server code.
It doesn't include the new client side pieces, we'll look
at that later.

This should give the same functionality, server wise, as
the NTDOM branch does, only merged into the main branch.

Any fixes to domain controler functionality should be
added to the main branch, not the NTDOM branch.

This code compiles without warnings on gcc2.8, but will
need further testing before we are sure all the working
functionality of the NTDOM server branch has been
correctly carried over.

I hereby declare the server side of the NTDOM branch
dead (and all who sail in her :-).

Jeremy.
(This used to be commit 118ba4d77a)
1998-03-11 21:11:04 +00:00