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

513 Commits

Author SHA1 Message Date
Gerald Carter
43000d8d06 merge from 2.2 (deleteprinterdriver RPC)
(This used to be commit 515caaf7b4)
2001-05-18 04:11:17 +00:00
Gerald Carter
013b454d1a merge from 2.2 DeletePrinterDriver() server side stud coming
in separate commit after I get it working in 2.2.
(This used to be commit 09506ac0e6)
2001-05-17 18:57:25 +00:00
Tim Potter
baff5a6569 Fixed up SAM_USERINFO_CTR dynamic stuff in cmd_samr_query_user()
(This used to be commit 22b760e246)
2001-05-15 05:02:29 +00:00
Tim Potter
c24bf6d8ab Added arg to querygroupinfo.
(This used to be commit ab58fdf77a)
2001-05-14 03:51:39 +00:00
Tim Potter
862fe3b7ed Memory leak fixes plus general cleanup.
(This used to be commit 48688c4592)
2001-05-11 07:04:47 +00:00
Tim Potter
481a727687 Fixed querydispinfo command.
(This used to be commit 727d2929bc)
2001-05-08 03:53:16 +00:00
Tim Potter
8e84cde71d iAdded querydispinfo and querydominfo functions.
Allow rid to be specified in lookupuser.
(This used to be commit 1ea5aa4a80)
2001-05-07 02:00:28 +00:00
Tim Potter
b8adb72139 Added queryaliasmem function.
Moved fetch_domain_sid() calls out of harms way so they didn't spam out
queries on SAMR pipe.
(This used to be commit 982195c89d)
2001-05-04 07:35:25 +00:00
Tim Potter
a8be5dced6 Tidyup of server vs servername, username vs user to remove compiler
warnings.
(This used to be commit d4f6ce9422)
2001-05-04 07:34:16 +00:00
Tim Potter
206a2a61da Added cmd_samr_enum_dom_groups() function.
(This used to be commit 23427a57da)
2001-05-04 04:17:39 +00:00
Tim Potter
0eaa469aa8 More usability fixes.
(This used to be commit 3434e0bf7f)
2001-05-04 04:15:48 +00:00
Tim Potter
1bbc3d193b Allow ctrl-d to exit rpcclient.
Don't try to run anything if user just presses return at rpcclient prompt.
(This used to be commit 37cdf37fee)
2001-05-04 01:04:23 +00:00
Gerald Carter
e40449fa72 rpcclient merge from 2.2 (including Jeremy's non-void return fix)
(This used to be commit 0a6ceed279)
2001-04-28 00:32:56 +00:00
Jeremy Allison
f9a15ce1a6 Got "medieval on our ass" about adding the -1 to slprintf.
Jeremy.
(This used to be commit 94747b4639)
2001-04-08 20:22:39 +00:00
Tim Potter
7a1f5c517b Changed usage message for query_groupmem and query_usergroups as they don't
convert names to rids yet.
(This used to be commit cea13dff75)
2001-03-28 05:01:54 +00:00
Jeremy Allison
194a87bf76 Added Gerald's fixes.
Jeremy.
(This used to be commit be825b0746)
2001-03-23 21:54:30 +00:00
Jeremy Allison
cd4fea0098 More unused variables.
Jeremy.
(This used to be commit 38b19fad28)
2001-03-23 20:41:22 +00:00
Gerald Carter
6e64ea1473 merge from 2.2 (reorder commands in array)
(This used to be commit 1d14d812ea)
2001-03-19 17:23:26 +00:00
Andrew Tridgell
62711a9ceb fixed rpcclient readline code
(This used to be commit 4ec971e905)
2001-03-19 00:32:16 +00:00
Gerald Carter
207e715059 addprinter and adddriver are working now :-)
(This used to be commit 0cb7639cef)
2001-03-15 22:06:53 +00:00
Gerald Carter
729b7cf214 added getdriverdir and cleaned up the PRINTER_DRIVER_CTR struct
(This used to be commit 5d32167385)
2001-03-15 16:43:19 +00:00
Gerald Carter
f4ae39d53a added getdriver and enumdrivers commands. Also fixed
enumprinters so that it works as well.  Couple of other
misc fixes while we're working on rpcclient.
(This used to be commit 83d6bc4454)
2001-03-15 07:13:27 +00:00
Gerald Carter
79dc43767e more updates. several spoolss commands added as placeholders
to be filled in one at a time.
(This used to be commit 6aaac37663)
2001-03-15 02:15:05 +00:00
Gerald Carter
fb3d8452e5 set of changes in the beginning of bringing rpcclient changes
back to working order.  The main change is that the cli_*() RPC
functions from libsmb/*.c now should accept a struct cli_state*.

The reason for this is that rpcclient should establish the
connection to the server at startup so that it is not necessary
to keep the clear test or password hash in memory for each command.

enumports and enumprinters now works as well.  lsa* functions
have been tested.  SAMR calls may or may not work (one of the core
dumps I know), but it compiles :-)



jerry
(This used to be commit d98ac8852a)
2001-03-14 20:22:57 +00:00
Gerald Carter
381e8299dc move charset_initialize() up in the food chain so that lp_load_services
and stuff will work....
(This used to be commit e652a14264)
2001-03-13 18:48:26 +00:00
Jeremy Allison
da3053048c Merge of new 2.2 code into HEAD (Gerald I hate you :-) :-). Allows new SAMR
RPC code to merge with new passdb code.
Currently rpcclient doesn't compile. I'm working on it...
Jeremy.
(This used to be commit 0be41d5158)
2001-03-11 00:32:10 +00:00
Tim Potter
19a8acda64 rpcclient functions for remaining samr and lsa functions. All functions
now pass through insure except for some of the dodgy spoolss prs
weirdness.
(This used to be commit 76f08426a0)
2001-01-15 23:35:59 +00:00
Tim Potter
7237fd3c85 Pass correctly formatted args to cli_spoolss_open_printer_ex()
(This used to be commit 635db9b601)
2001-01-12 19:47:08 +00:00
Tim Potter
44a9dc1ba8 Memory leak fixes and uninitialised variables spotted by insure.
(This used to be commit 079f46aca4)
2001-01-12 18:19:57 +00:00
Tim Potter
eb1e855f4e Memory leak fixes spotted by insure.
(This used to be commit 8072ee62b0)
2001-01-12 17:53:47 +00:00
Tim Potter
78b2616049 Use MAXIMUM_ALLOWED_ACCESS when doing a cli_spoolss_open_printer_ex()
(This used to be commit 42674cc616)
2001-01-12 02:58:29 +00:00
Tim Potter
fc659e07d0 Start of a rewrite of rpcclient based on the libsmb rpc client routines.
Currently there are a small selection of lsa, samr and spoolss functions
implemented.  More to follow...
(This used to be commit 9a953514f2)
2001-01-11 22:49:30 +00:00
Tim Potter
3478427f2e Port of lsa_lookup_sids() and lsa_lookup_names() rpc client functions from
TNG branch.

Re-instated lsa_lookup_sids and lsa_lookup_names functions in rpcclient.

This requires most samba binaries to link in another handful of object
files due to uncessary coupling between modules.  )-:
(This used to be commit 817819d0cc)
2000-12-08 03:34:00 +00:00
Tim Potter
cf9443677d Modified argc passed to rpc_client cmd_* functions to include argv[0].
Gerald, could you check to see I haven't introduced any bugs into
rpcclient/cmd_spoolss.c?
(This used to be commit 77b0bda4df)
2000-12-08 03:24:38 +00:00
Gerald Carter
072d39165d spoolgetprinterdriver now returns "Windows NT x86" and "Windows 4.0"
driver information.

Will merge into TNG.



jerry
(This used to be commit ae7dd77c24)
2000-09-12 16:03:16 +00:00
Gerald Carter
a86ae846ad added -P (for no prompt) and -A <authfile> options
jerry
(This used to be commit 2d95c38f7e)
2000-08-29 14:43:42 +00:00
Gerald Carter
0136927ed8 fixed an off by one error where I was tromping on memory
when initializing a driver_info_3 struct.  See spoolss_addprinterdriver()



jerry
(This used to be commit 4fad1fc28a)
2000-08-18 06:03:13 +00:00
Gerald Carter
74f2fc40db FIxed some unmarshalling problems with relstr and unistr arrays
jerry
(This used to be commit ce2d20395a)
2000-08-12 14:26:01 +00:00
Jeremy Allison
1e823bc781 Tidied up security rights definitions.
Jeremy.
(This used to be commit e466c863f5)
2000-08-10 19:51:45 +00:00
Gerald Carter
536a055a9a Working on spoolss_getprinterdriver() as it does not display all the
dependentfiles.



jery
(This used to be commit 206565368b)
2000-08-10 14:05:19 +00:00
Gerald Carter
8e0e319674 Needed to add the SHARED attribute bit when creating a printer
on a Samba host.  Also needed to add an option to pass the share
name (printer name) on the command line.

And fixed the checking of the return code for spoolss_r_addprinterex()




jerry
(This used to be commit 880e811616)
2000-08-10 04:10:29 +00:00
Gerald Carter
a08d444896 More work on AddPrinterDriver() and AddPrinterEx() client RPC's
Also fixed init_unistr() to deal with a NULL source character string.



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



--jerry
(This used to be commit 3bf9a29f34)
2000-08-08 06:57:48 +00:00
Gerald Carter
4fabc1ad0d spoolss_addprinterex() was adding the printer and returning the
correct handle, but was deleting the connection to the server.
Doh!!



--jerry
(This used to be commit 8e5e929561)
2000-08-04 20:32:34 +00:00
Gerald Carter
4003a1c55b clunky support for calling AddPrinterEx(). The code currently reports
that the call failed, but the printer shows up on the remote NT client.
(note this is the client side call).  I've botched the return value
somewhere and will fix that today.




jerry
(This used to be commit e15d9befd2)
2000-08-04 12:46:36 +00:00
Jeremy Allison
7f36df301e Tidyup removing many of the 0xC0000000 | NT_STATUS_XXX stuff (only need NT_STATUS_XXX).
Removed IS_BITS_xxx macros as they were just reproducing "C" syntax in a more
obscure way.
Jeremy.
(This used to be commit c55bcec817)
2000-08-01 18:32:34 +00:00
Gerald Carter
a6ef985df4 More work on rpcclient...
* Fixed to work with Jeremy's recent changes re: dunamic
    memory allocation when unmarshalling unistr[2]
  * included EnumPorts level 1
  * more work on AddPrinterEx




--jerry
(This used to be commit 45fbf31b69)
2000-07-31 14:50:53 +00:00
Jean-François Micouleau
1e3a5503cd Found out that we are crashing spoolss in enumprinterdata.
So fixed enumprinterdatas in rpcclient to debug the server code,
and found that the parsing code was missing 2 prs_align().

We are not crashing NT anymore. :-)

        J.F.
(This used to be commit 883f7402d4)
2000-07-26 09:40:49 +00:00
Gerald Carter
48a3e00224 some initial code for AddPrinterEx() project. Most is ifdef'd out
'cause it's not all written.


-jerry
(This used to be commit 2c0f6bcc8f)
2000-07-25 21:07:46 +00:00
Jean-François Micouleau
5a5ef18379 A rather big change set ! (listed in no particular order)
- changed the default forms flag to 2
- all short architecture name are uppercased
- get_short_archi() is now case unsensitive
- the drivers TDB is indexed by archi/version/name
- implemented code to move drivers from the upload area to the download
area. Someone else need to look at that code.
- don't return anymore a default driver if it doesn't exist in the TDB.
Instead return an error.
- cleaned prs_unistr.
- #ifdef out jeremy's new SD parsing in printer_info_2
- removed the unused MANGLE_CODE

- #ifdef out the security checking in update_printer() as it doesn't work
for me.

Zap your ntdrivers.tdb, it won't work anymore.

	J.F.
(This used to be commit ac0a145acc)
2000-07-25 13:15:16 +00:00
Gerald Carter
92708e3945 Added EnumPorts() and fixed up some problems
with the other spoolss client calls.

Also cleaned up output for 'help' command.



jerry
(This used to be commit 56ce247977)
2000-07-21 19:59:51 +00:00
Gerald Carter
58221bfcf7 Fixed unitilized secdesc pointer which was causing spoolgetprinter
rpcclient command to fail on shared printers.




jerry
(This used to be commit c8abc31187)
2000-07-20 13:38:48 +00:00
Gerald Carter
2089176e34 Fixed some more SPOOLSS functions. The following
functions work now:

  - spoolenum
  - spoolopen
  - spoolgetprinter
  - spoolgetprinterdriver

Items todo:

  - track down memory bug with spoolenumdata
  - fix spoolgetprinterdriverdir
  - fix spoolgetdata
  - fix display_job_info_ctr in spooljobs


--jerry
(This used to be commit 15b3591271)
2000-07-18 05:02:16 +00:00
Gerald Carter
fb7a24d8b4 adding more spoolss command into rpcclient. They don't all work
currently.  More to come later.


--jerry
(This used to be commit 0faf21662d)
2000-07-14 16:29:22 +00:00
Gerald Carter
9de93aa818 More rpcclient merge issues:
* fixes some readline bugs from the merge
	* first attempt at commands (spoolenum almost works)
	* no changes to existing functions in HEAD; only additions
	  of new functions.  I'll weed out what I can as I go.




--jerry
(This used to be commit 12e2a21e1b)
2000-07-07 06:18:00 +00:00
Gerald Carter
33f6a1d9bb first pass at merging rpcclient from TNG to HEAD. You can get a
semi-connection and a rpcclient prompt, but no functionality there yet.
Will be a few more days on that.

--jerry
(This used to be commit 269051aa0c)
2000-07-03 04:28:29 +00:00
Gerald Carter
3396a1d978 just enough to get rpcclient to compile. Look for #if 0
blocks around a few unimplemented functions.  Also had to
add cli_reg.c to Makefile.in


--jerry
(This used to be commit 426c43fb51)
2000-06-23 00:09:21 +00:00
Andrew Tridgell
8843a6379d Linux kernel oplocks now seem to work, but need a _lot_ of testing
I had to modify sys_select() to not loop on EINTR. I added a wrapper
called sys_select_intr() which gives the old behaviour.
(This used to be commit b28cc4163b)
2000-06-11 05:57:58 +00:00
Andrew Tridgell
da44845a09 moved secrets fns into secrets.c
(This used to be commit f890bcf067)
2000-06-03 06:22:19 +00:00
Shirish Kalele
74d677ec59 Added the NETDFS pipe to allow remote administration of the msdfs symlinks
on the samba server.
(This used to be commit 15e7d8f6c5)
2000-05-18 18:43:53 +00:00
Andrew Tridgell
c23e01d049 the beginnings of a new scheme I've working on to allow an easier
head/tng merge.

It goes something like this:

- headers from tng get copied over one at a time

- the old headers get renamed to *_old.h

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

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

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

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

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

Note this this is still a very delicate operation, as at every step of
the way I want to keep head fully functional. Please don't take part
unless you discuss it with me first.
(This used to be commit f76c037255)
2000-05-09 13:28:19 +00:00
Andrew Tridgell
2958dfcdf8 added secrets.tdb and changed storage of trust account password to use
it
(This used to be commit 88ad00b82a)
2000-05-08 10:42:21 +00:00
Andrew Tridgell
00e3fe1324 moved trans2.h and nterr.h into includes.h with all our other includes
(This used to be commit d7cd7c88fd)
2000-04-25 14:06:57 +00:00
Luke Leighton
2864ac574b indent update to make t easier to see setuid mods in TNG. some
code from these modules i had to leave out (nothing to do withj setuid)
(This used to be commit 96717211ed)
2000-03-21 21:08:07 +00:00
Jean-François Micouleau
c473ca6259 After 3AM, it's getting hard for Luke :-)
(This used to be commit 61c970b10a)
2000-02-04 15:19:28 +00:00
Luke Leighton
bbe275e95b 1) added void* state argument to tdb_traverse. guess what! there were
two places i found where it was appropriate to _use_ that third argument,
in locking.c and brlock.c!  there was a static traverse_function and
i removed the static variable, typecast it to a void*, passed it to
tdb_traverse and re-cast it back to the traverse_function inside the
tdb_traverse function.  this makes the use of tdb_traverse() reentrant,
which is never going to happen, i know, i just don't like to see
statics lying about when there's no need for them.

as i had to do in samba-tng, all uses of tdb_traverse modified to take
the new void* state argument.

2) disabled rpcclient: referring people to use SAMBA_TNG rpcclient.
i don't know how the other samba team members would react if i deleted
rpcclient from cvs main.  damn, that code's so old, it's unreal.
20 rpcclient commands, instead of about 70 in SAMBA_TNG.
(This used to be commit 49d7f0afbc)
2000-02-04 04:59:31 +00:00
Andrew Tridgell
2513cd5f17 use GET_DENY_MODE() macro instead of the bit shift
(This used to be commit d72c98a931)
2000-01-16 12:24:01 +00:00
Andrew Tridgell
8cf023fee3 a consequence of the access_table() fixes is that we can't treat
DENY_DOS and DENY_FCB as the same thing anymore (the difference
matters for *.exe files)
(This used to be commit 8f3ff09283)
2000-01-16 11:22:39 +00:00
Andrew Tridgell
171da4d787 this looks like a big commit, but it isn't really :)
This fixes our netbios scope handling. We now have a 'netbios scope' option
in smb.conf and the scope option is removed from make_nmb_name()

this was prompted by a bug in our PDC finding code where it didn't append
the scope to the query of the '*' name.
(This used to be commit b563be824b)
2000-01-07 06:55:36 +00:00
Andrew Tridgell
d705b62141 got rid of mem_man
yamd is much better, and doesn't require any source code changes
if you haven't seen yamd then take a look at
	http://www3.hmc.edu/~neldredge/yamd/
its excellent!
(This used to be commit 25b13f8b79)
2000-01-03 03:31:41 +00:00
Andrew Tridgell
418ba2933f more files from 2.0.6
(This used to be commit 4a20579571)
1999-12-17 01:52:05 +00:00
Andrew Tridgell
32a965e09c 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
(This used to be commit d7b2087865)
1999-12-13 13:35:20 +00:00
Andrew Tridgell
3db52feb1f first pass at updating head branch to be to be the same as the SAMBA_2_0 branch
(This used to be commit 453a822a76)
1999-12-13 13:27:58 +00:00
Luke Leighton
4f8a24522c 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.
(This used to be commit caa5052522)
1999-12-12 20:03:42 +00:00
Luke Leighton
0ce128e355 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()...)
(This used to be commit aa3c659a8d)
1999-12-12 01:25:49 +00:00
Luke Leighton
4ab9d91428 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.
(This used to be commit 30c7fdd6ef)
1999-12-08 21:43:03 +00:00
Luke Leighton
c2a3b11b07 starting "connection reuse" system in smb-agent. added version number
which isn't actually used right now :-)
(This used to be commit d54a64ae3a)
1999-12-03 22:02:03 +00:00
Luke Leighton
5db56cfce4 i always get caught out with non-gnu-readline code mods :-)
(This used to be commit a47cc64470)
1999-12-03 19:59:44 +00:00
Luke Leighton
7d01f964ff cool! a unix socket smb redirector. code based on smbfilter and
ideas from ssh-agent.

the intent is to be able to share smb sessions using cli_net_use_add()
across multiple processes, where one process knows the target server
name, user name and domain, but not the smb password.
(This used to be commit 294b653f2e)
1999-12-03 18:16:08 +00:00
Luke Leighton
69683dc27a promptline undefined (pline)
(This used to be commit f33e4ca930)
1999-12-03 17:02:47 +00:00
Luke Leighton
98e28ee14c cleaning up: removing those horrible references to server list
functions (cli_net_use_addlist()).  needed originally because
there was no get_dc_any_name() function.
(This used to be commit 3a2b920ea2)
1999-12-02 19:03:23 +00:00
Luke Leighton
ddfe7956f2 oops, pwdb_initialise() called unnecessarily from here (failure to read
trusted domains may cause rpcclient to fail).
(This used to be commit 12e2b97321)
1999-12-02 16:38:16 +00:00
Luke Leighton
e9b8c7743a default SID map now reads in "trusted domains" from smb.conf.
(This used to be commit f0946d1cca)
1999-12-02 16:31:24 +00:00
Luke Leighton
10b82d30b7 improved enumdomains added -i option.
(This used to be commit 50dc709fa9)
1999-12-02 01:46:01 +00:00
Luke Leighton
bd4bea62ad clearing up connection-related stuff. password credentials were messing
up.

added a complicated prompt which i don't like, but it tells you
domain\user@hostname$
(This used to be commit 338d08f69b)
1999-12-02 01:16:05 +00:00
Luke Leighton
a2e135d195 added net use (actually net -S srv -U user -W dom) and net del (actually
same as net use but with -d and -f) command options
(This used to be commit 586db87ea3)
1999-12-01 22:39:27 +00:00
Luke Leighton
a76fee7333 more cli_session_setup() calls. what the heck are these doing???
they should all be replaced with cli_establish_connection().

created cli_use_wait_keyboard() which waits on multiple cli_states
and swallows session keepalives.
(This used to be commit fcc39b3f4f)
1999-12-01 22:06:53 +00:00
Luke Leighton
720ea1e304 make sure domain and name to generate trust account .mac file are upper case.
(This used to be commit fbfb350bdf)
1999-12-01 20:18:59 +00:00
Luke Leighton
f6c5f75568 damn, that took a while. nt login password was being stored incorrectly
in private .mac file (oops).  ntlogin test now works.
(This used to be commit c98c666906)
1999-12-01 20:18:21 +00:00
Luke Leighton
86ac6fa938 fixing joining to domain plus something weird going down with nt logins...
(This used to be commit cef258f1c9)
1999-12-01 19:25:51 +00:00
Luke Leighton
d9cc4c3950 improving createuser account command to be able to add workstations
and then set a default random password.
(This used to be commit 7846818432)
1999-12-01 18:47:29 +00:00
Luke Leighton
106fe88be0 1) when no domain used in ntlogin test command, should use default one
from previous lsaquery command.  over-ridden from DOMAIN\username

2) initialisation of cli_state is a little more specific: sets use_ntlmv2
   to Auto.  this can always be over-ridden.

3) fixed reusage of ntlmssp_cli_flgs which was being a pain

4) added pwd_compare() function then fixed bug in cli_use where NULL
   domain name was making connections multiply unfruitfully

5) type-casting of mallocs and Reallocs that cause ansi-c compilers to bitch
(This used to be commit 301a6efaf6)
1999-12-01 16:39:51 +00:00
Luke Leighton
6ddfc68e04 sys_select added one more argument (read, write selectors).
(This used to be commit e4d92ff9df)
1999-12-01 02:15:14 +00:00
Luke Leighton
7e42174792 split display.c into modules.
(This used to be commit 5b5719d6a0)
1999-12-01 00:52:22 +00:00
Luke Leighton
0d44ff9a76 attempting to resolve the issue that multiple servers often specified in
parameters to connect to \PIPE\NETLOGON.
(This used to be commit d1986ade30)
1999-11-29 21:47:14 +00:00
Luke Leighton
44334ace98 ok. got ntlogin command working. argh, it maintains a connection to
the remote machine, because i don't know what to _do_ with it!!!!

argh!!!
(This used to be commit 85cc680736)
1999-11-29 21:16:12 +00:00
Luke Leighton
e302cb2b18 first attempt at getting \PIPE\NETLOGON working. it's pretty horrible.
(This used to be commit 44dd3efa63)
1999-11-29 19:46:57 +00:00
Luke Leighton
dbc916a251 renamed PRINTER_HND to POLICY_HND.
(This used to be commit 8b92be25bd)
1999-11-29 17:45:47 +00:00
Luke Leighton
9720774c6a well, i stuffed up the spooler commands.
(This used to be commit 7a69633058)
1999-11-27 23:25:45 +00:00
Luke Leighton
70b218b3ea moved at command over to new abstract connection system. matthew, you
initialised dest_wks _after_ using it in at_soon() :-) so i fixed this :)
(This used to be commit 0aaf0c9c80)
1999-11-27 22:58:11 +00:00
Luke Leighton
ad1e5fdd96 moved browser command brsinfo over to new abstracted connection
(This used to be commit 601d217f44)
1999-11-27 22:53:28 +00:00
Luke Leighton
c80b85803b this one's a handle-based one (missed in the first round).
(This used to be commit 4c3556fae7)
1999-11-27 22:47:17 +00:00
Luke Leighton
e4a2e8e46f removed do_ prefix from srvsvc API
(This used to be commit e4e5743a40)
1999-11-27 22:35:58 +00:00
Luke Leighton
9fef73c27e updated \PIPE\wkssvc commands to use new abstracted connection system.
modified resolve_srv_name() to return dest host of *SMBSERVER if
server name is \\ip.add.ress.format
(This used to be commit 3204829225)
1999-11-27 22:34:12 +00:00
Luke Leighton
4a6761a58d using "abstracted" cli_connection, got \PIPE\srvsvc commands up and running
again.
(This used to be commit 6b67d6164d)
1999-11-27 22:19:51 +00:00
Luke Leighton
3fc5ec73be further abstraction involving client states. main client-side code
is pretty much independent of SMB client states, which will make it
easier to add other transports.
(This used to be commit a1ff7e8fc3)
1999-11-27 21:50:11 +00:00
Luke Leighton
d4bf1ca515 remove use of client_info lsa_info_pol.
(This used to be commit 2dad9d912d)
1999-11-27 20:34:32 +00:00
Luke Leighton
015dc121ea enhanced samuser command to do same thing as enumusers command (-g -u -a)
except with only one user.  done by sharing same code.
(This used to be commit 4e029d50fc)
1999-11-27 20:29:16 +00:00
Luke Leighton
4c92992b4e bug-fixing registry commands and the rpcclient "rpcclient" command.
the rpcclient "rpcclient" command allows user options to be reset
(e.g the username / password) _without_ terminating rpcclient.
try this:

rpcclient -S srv1 -U% -l log
srv1$ rpcclient -S srv2
srv2$

:-)
(This used to be commit c049865782)
1999-11-27 00:02:03 +00:00
Luke Leighton
9b68305475 whoa. _major_ restructure of rpcclient. fixed some buuugs, created a few.
found out that getopt() _must_ have optind set to 0 before reuse.

still haven't decided what to do with the net* api yet...
(This used to be commit 29c480085e)
1999-11-26 23:04:19 +00:00
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
2803a72751 ok. *whew*. this is the first completed part of the restructure.
verified that lsaquery, lsalookupsids work, and found some bugs in the
parameters of these commands :-)

soo... we now have an lsa_* api that has the same arguments as the nt
Lsa* api!  cool!

the only significant coding difference is the introduction of a
user_credentials structure, containing user, domain, pass and ntlmssp
flags.
(This used to be commit 57bff6fe82)
1999-11-24 22:45:09 +00:00
Luke Leighton
f8b82a7b95 first stages of removing struct cli_state* and uint16 fnum from all
msrpc client code.  the intent is to hide / abstract / associate
connection info behind policy handles.

this makes the msrpc functions look more and more like their nt equivalents.

who-hou!
(This used to be commit c01b18e632)
1999-11-24 20:24:33 +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
511b2d6736 oops, freed argc,argv arguments twice.
(This used to be commit 447143be81)
1999-11-23 23:14:10 +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
14713d00b5 oops!!!! wrong command!!!
(This used to be commit cbbfef6d2a)
1999-11-23 20:32:52 +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
c5a6d0c84d the last one. that concludes the removal of all next_token() calls
from rpcclient/cmd_*.c.
(This used to be commit ca803c17fa)
1999-11-22 20:14:13 +00:00
Luke Leighton
1ed8653112 another four next_token() removals (using getopt instead)
(This used to be commit 3e76ca9b17)
1999-11-22 19:46:26 +00:00
Luke Leighton
288a5059a2 another two.
(This used to be commit b0f8ef6168)
1999-11-22 19:37:05 +00:00
Luke Leighton
bb876dc6c3 another one
(This used to be commit c1ba1bfd68)
1999-11-22 19:26:56 +00:00
Luke Leighton
48a4df7dac moved two more commands over to getopt.
(This used to be commit de360d1e90)
1999-11-22 19:25:30 +00:00
Luke Leighton
aa12f3e0e9 okay :) all cmd_() functions now take int argc, char **argv :) that
means that some commands need more work, as they still use next_token(),
the use of which i wish to avoid.

plus, i was getting fed up of the poor command-line processing in some
of these commands.  i'm starting to need getopt() in them, especially
in samsetuser.

WARNING: only cmd_samr has been modded to use getopt() so far!  reg
commands won't work, esp.
(This used to be commit 9a1efa03c8)
1999-11-22 19:02:39 +00:00
Luke Leighton
dab1a12278 you know what? this sort of thing makes me laugh. hmm, what functions
have we got.  and what data do we have.  hmm.. i wonder what the NTLMv2
user session key can be... hmmm... weell.... there's some hidden data
here, generated from the user password that doesn't go over-the-wire,
so that's _got_ to be involved.  and... that bit of data took a lot of
computation to produce, so it's probably _also_ involved... and md4 no, md5?
no, how about hmac_md5 yes let's try that one (the other's didn't work)
oh goodie, it worked!

i love it when this sort of thing happens.  took all of fifteen minutes to
guess it.  tried concatenating client and server challenges.  tried
concatenating _random_ bits of client and server challenges.  tried
md5 of the above.  tried hmac_md5 of the above.  eventually, it boils down
to this:

kr = MD4(NT#,username,domainname)
hmacntchal=hmac_md5(kr, nt server challenge)
sess_key = hmac_md5(kr, hmacntchal);
(This used to be commit ab174759cd)
1999-11-21 19:24:01 +00:00
Luke Leighton
4629acd6f5 moving create user function into msrpc_samr.c
(This used to be commit e885027eb7)
1999-11-21 17:09:20 +00:00
Luke Leighton
a56bea383b doing a code reshuffle. want to add code to establish trust relationships.
(This used to be commit 3ec269b402)
1999-11-20 19:43:37 +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
da517a3ff4 responses to UDP samquery go back to SERVER<00> not DOMAIN<1c>, the
request name.

modified createuser rpcclient command to examine name being added.  if it
ends in a $, assume that a workstation trust account is being added.
(This used to be commit 4aea261cb0)
1999-11-18 23:15:45 +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
01e61554ca oops, mistake in parsing command-arguments. repeated calls to
next_token() should not have line to parse as first arg.  oops.
(This used to be commit 3273bc068d)
1999-11-16 17:15:45 +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
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
97398b4c74 riccardo sibilia spotted line 1884 has uint32 group_rid[0] not group_rid[1]
oops!
(This used to be commit ea1d5af105)
1999-11-09 17:39:21 +00:00
Luke Leighton
c6e3fc5838 const feeding frenzy
(This used to be commit e0eb390ab3)
1999-11-08 20:58:06 +00:00
Luke Leighton
21d1d4a2e2 const feeding frenzy
(This used to be commit 6d27c5f32d)
1999-11-08 19:32:05 +00:00
Luke Leighton
514be1cf73 added command-completion printer enum code.
(This used to be commit 6947f8fac7)
1999-11-06 21:08:35 +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
37983b979f added samalias <aliasname> rpcclient command (shows info on alias)
added samaliasmem <aliasname> rpcclient command (shows members in alias)

added tab command-completion to SAM alias related commands (inc 2 above).
(This used to be commit 0c700fb609)
1999-11-02 23:47:17 +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
dcc037cfc6 yet another attempt to get lsaquerysecret working.
(This used to be commit fbeceec501)
1999-11-02 23:29:44 +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
de573ca891 rewrote rpcclient enumaliases command.
(This used to be commit 492fdaaf20)
1999-11-01 21:09:24 +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
Matthew Chapman
7726985b00 Fixed typo which was preventing the omission of seconds in the 'at' command.
I *love* this scheduler stuff, it's so useful!
(This used to be commit 5cb124806d)
1999-11-01 12:11:05 +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
ce31503de5 command-line completion for new svcinfo command
(This used to be commit 5ca07721ba)
1999-10-31 04:19:58 +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
e7b5412943 connection info level renamed to transport info level
(This used to be commit 1c3a6f9822)
1999-10-30 22:35:44 +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
eae9b12ca5 general, drastic improvements to rpcclient.
added samgroup <groupname> command
added samgroupmem <groupname> command

added proper registry key completion

added sam command user-completion (e.g samuser [tab])

added sam command group-completion (e.g samgroup [tab])
(This used to be commit bc5d021916)
1999-10-30 20:32:40 +00:00
Luke Leighton
090d51c8c5 messing with command-line completion. it sort-of works to be able
to enumerate down a key tree, but it's a serious fudge.  oops.
(This used to be commit a5e805806a)
1999-10-29 23:15:10 +00:00
Luke Leighton
8ba1c74002 added gnu readline command-line completion to the regenum command.
(This used to be commit 50890516fd)
1999-10-29 21:31:19 +00:00
Luke Leighton
bcf1c31826 rpcclient regenum key client code rewritten to use higher order functions.
(This used to be commit 6a759c57dc)
1999-10-29 20:24:18 +00:00
Luke Leighton
243feaa08c rewrite rpcclient sam enum user code to use higher order functions.
(This used to be commit b794ff2130)
1999-10-29 19:31:32 +00:00
Luke Leighton
a8b8b8ac3b using #defines for function prototypes
(This used to be commit 4a44cccf44)
1999-10-29 18:57:22 +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
97993e4973 using higher-order-function in enum groups as a test. makes it really
useful for doing things _other_ than just "print me".
(This used to be commit 229313de7d)
1999-10-29 16:19:17 +00:00
Luke Leighton
326b011b2d restructuring sam enum dom groups code to do multiple calls to
sam_enum_dom_groups.  enum dom aliases is still left to do (dom users
already done).
(This used to be commit 8d181924ce)
1999-10-28 20:34:28 +00:00
Luke Leighton
c7c77cbfd7 restructuring samr client code.
(This used to be commit a78607b5db)
1999-10-28 20:02:29 +00:00
Luke Leighton
640012d80b removed samr_* variables from info struct.
(This used to be commit 4d5b860802)
1999-10-28 19:02:23 +00:00
Luke Leighton
2222a306a8 rewrote samr enum groups code a bit.
(This used to be commit 3f99ab7720)
1999-10-28 17:52:12 +00:00
Luke Leighton
9a5b9753dd no CLIX, no !HAVE_READLINE blah blah. argh.
(This used to be commit de69f3ef77)
1999-10-27 16:58:35 +00:00
Luke Leighton
1298a3d1e0 created samr_query_groupmem() function from existing code.
(This used to be commit d2d5a853f8)
1999-10-26 20:03:48 +00:00
Luke Leighton
ea6592046f adding extra parameter back in to trust account functions (trust account name).
restoring opening S-1-5-20 in sam enum users code.
(This used to be commit 1be877114e)
1999-10-26 16:46:45 +00:00
Luke Leighton
9d890f269c cut/paste code from smbclient for wait_keyboard() function. oops.
(This used to be commit c25560ba43)
1999-10-26 14:27:46 +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
bb6de2f1e9 oops, added wait_keyboard back, but _this_ time wrapped it with
HAVE_READLINE
(This used to be commit af05710d0b)
1999-10-19 19:54:01 +00:00
Luke Leighton
415f84112e removed unused static wait_keyboard()
(This used to be commit 8cb6163b06)
1999-10-15 18:44:33 +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
Luke Leighton
5b38ad78b8 permissions on SamrConnect changed to 0x02000000 (maximum allowed)
(This used to be commit cbc646b1d8)
1999-10-01 18:27:29 +00:00
Luke Leighton
860688f6e7 error-code checking in lsa_lookup_sids. anonymous connections for
domain info.  adjusting net_srv_get_info function.
(This used to be commit 42eb916fae)
1999-10-01 18:11:57 +00:00
Luke Leighton
f1c2fdb270 split matthew's sync command (only currently called from smbpasswd)
into a separate module
(This used to be commit d99eca020a)
1999-09-21 21:28:27 +00:00
Luke Leighton
701f9ed2c9 reading in smb server domain name from SMBnegprot response
(This used to be commit 25025f4505)
1999-09-16 22:46:45 +00:00
Luke Leighton
6bf6b0ad44 added rpcclient SamrQueryDisplayInfo command "dispinfo"
(This used to be commit 6c98d6c9aa)
1999-09-14 21:04:02 +00:00
Luke Leighton
827599cbb2 restructuring
(This used to be commit 9d74161a92)
1999-09-12 23:59:09 +00:00
Luke Leighton
85f0d0bff3 using #define report
(This used to be commit 7fc2ee2f96)
1999-09-12 23:39:57 +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
Luke Leighton
736c507722 debugged enumgroups -g option
(This used to be commit 1cde47ba6a)
1999-08-30 17:15:59 +00:00
Luke Leighton
501acbba23 added call to samr_query_groupinfo in enumgroups command (-m option)
(This used to be commit e2a72e2c64)
1999-08-30 17:07:53 +00:00
Luke Leighton
42fdd41b1d improved "dominfo" rpcclient command
(This used to be commit 65a54b6e16)
1999-08-29 16:36:21 +00:00
Luke Leighton
53b4095d2c added experimental del_groupmem and del_aliasmem commands that were not
being called from rpcclient.c

improved add_groupmem command, but cannot test it against nt non-pdc!
(This used to be commit 7a383a2a02)
1999-08-29 13:18:10 +00:00
Luke Leighton
f4e98283cd display of session enum info
(This used to be commit e0713cf933)
1999-08-18 21:13:15 +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
fc13cb4086 added some usage info for rpcclient.
(This used to be commit ec11bbaf54)
1999-08-17 20:11:12 +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
Matthew Chapman
d0d85964da BDC support.
(This used to be commit 05a2687b7c)
1999-07-22 10:55:23 +00:00
Luke Leighton
6a5a4e8186 BDC support.
(This used to be commit 2331aa32ab)
1999-07-21 00:32:09 +00:00
Luke Leighton
d0372689d6 use pstring for at command instead of fstring
(This used to be commit 43d3d2336f)
1999-07-21 00:30:18 +00:00
Tim Potter
d244f2d1c8 Partial GNU readline support for rpcclient. Only command line history
and command completion implemented.
(This used to be commit 795fa6a518)
1999-07-09 05:10:10 +00:00
Luke Leighton
73891ca8e4 improving authentication code (tidyup).
(This used to be commit ab1a6aa42d)
1999-06-29 18:47:06 +00:00
Luke Leighton
cae3620b2e safe string error reporting functions (found a potential buffer overflow
of a pstrcpy into an fstring).
(This used to be commit ac0060443d)
1999-06-24 18:58:08 +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
94a4094f44 had to move day display names into lib/util, to get rpctorture to compile.
(This used to be commit 8c80742e4e)
1999-05-07 18:20:59 +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
Matthew Chapman
16758a4252 New rpcclient command "at" for NT scheduler control, a slightly improved
version of the NT command.

at { time [/INTERACTIVE] [{/EVERY|/NEXT}:5,Sun,...] command | [/DEL] [jobid] }

Examples (options used in abbreviated form):
at                                         ; Shows all jobs
at 1                                       ; Detail on job 1
at /D                                      ; Deletes all jobs
at /D 1                                    ; Deletes job 1
at 11:11:11AM /I /N:1 d:\humour\silly.exe  ; First of next month
at 9:00AM /E:M,T,W,Th,F net send MATTY Hi  ; Each weekday
at 11:00PM /E c:\winnt\backup.exe          ; Every day
(This used to be commit cf8c476d2e)
1999-04-23 15:01:35 +00:00
Matthew Chapman
7930cb0dfc Fixed rpcclient's samuser command.
(This used to be commit 60a8b478ac)
1999-04-11 02:34:44 +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
da4cd4f5a9 added a "createuser" command.
(This used to be commit fefb4bf191)
1999-03-19 21:20:19 +00:00
Matthew Chapman
55bce9e30e querysecret now shows the real, fairdinkum, decrypted secret :-)
(This used to be commit 5951e16a11)
1999-03-19 15:11:07 +00:00
Luke Leighton
6cc71c5354 double-checked the return results from new querysecret command, corrected
my corrections :)
(This used to be commit 082109369b)
1999-03-18 22:13:15 +00:00
Luke Leighton
60d632173b matt,
remember: only close handles that you've previously opened.  if the
lsa_open_secret() succeeds then and only then can you close it.
if the lsa_open_policy2() succeeds then and only then can you close it.
(This used to be commit 60da0a1255)
1999-03-18 22:12:05 +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
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
b6db424576 reverted access control flags in enum commands.
(This used to be commit 97a0b24955)
1999-03-09 01:17:16 +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
Luke Leighton
76ebe05c18 oops, accidentally committed clear-text password reading last week.
(This used to be commit e0b5a866ce)
1999-03-08 18:42:43 +00:00
Luke Leighton
2dd4c985c0 improving syntax / useability of rpcclient "shutdown" command:
rpcclient [-m messsage] [-t timeout] [-r or --reboot].
(This used to be commit 8b859797aa)
1999-03-01 16:01:45 +00:00
Matthew Chapman
7f88bf771a Added "lookupdomain" rpcclient command. Not particularly useful currently
(you can do "lookupdomain MYDOMAIN" and "lookupdomain BUILTIN" and the
results won't be too surprising), but it will come in useful testing the
new password database code I'm working on.
(This used to be commit d1cc33bcb6)
1999-02-24 01:58:08 +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
52fb07aea2 rpcclient shutdown command
(This used to be commit 59f081069a)
1999-02-16 18:04:21 +00:00
Luke Leighton
78314c2e32 bitmap to strings
(This used to be commit ba5919bcae)
1999-02-16 18:02:50 +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
2b8292075c Cut and paste error.
(This used to be commit 9ea91d89d2)
1999-02-12 03:09:24 +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
0e402f197d enum dom users buffer was 0x80 not 0x8000. must fix "enumeration" code
as you need to make multiple enum dom users calls.
(This used to be commit b5396d3c6d)
1999-02-11 18:48:18 +00:00
Luke Leighton
a71d268114 uninitialised pointer being freed if lookupnames failed. oops.
(This used to be commit d77de86858)
1999-02-11 17:25:26 +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
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
0504064085 Service Control Manager - service enumeration.
(This used to be commit f4dd8f6b56)
1999-01-27 20:31:58 +00:00
Luke Leighton
f6c646467d set_port warning / unused / global/local variable overlap issues
cmd_svcctl.c tests got put into cvs by mistake.
(This used to be commit 0ed70972d7)
1999-01-27 19:37:29 +00:00
Luke Leighton
4af8d7aa29 - got client code cleartext passwords working again in cli_session_setup.
needed this for some tests.

- removed code that said "if lm password is not encrypted then encrypt both
  lm and nt passwords".  actually it said "if lm password length is not 24
  bytes and we're in security=user mode..."

  it didn't bother to check whether the nt password was NULL or not, and
  doing the encryption inside cli_session_setup is the wrong place.

- checked all instances where cli_session_setup is called with cleartext
  passwords that are expected to then be encrypted (see above) with the
  test "if pwlen != 24...".  there was only one: all the others either
  provide encrypted passwords, do null sessions or use
  cli_establish_connection.

* recommendation: use cli_establish_connection() in smbwrapper/smbw.c
(This used to be commit 2a509e9606)
1999-01-27 00:08:33 +00:00
Luke Leighton
254470cb56 added sid_name_use array argument to lsa_lookup_names and lsa_lookup_sids.
(This used to be commit 0b2095e092)
1998-12-14 20:23:20 +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