1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00
Commit Graph

617 Commits

Author SHA1 Message Date
Tim Potter
e69222f081 Implemented client side functions for SPOOLSS addform, getform, setform and
enumforms.
0001-01-01 00:00:00 +00:00
Tim Potter
029e2b307d Converted remaining spoolss rpcclient functions to werror/needed/offered.
I couldn't test some of these because I didn't know the right magic
arguments to pass to rpcclient (familiar anyone? (-:) so there may be some
bugs lurking.
0001-01-01 00:00:00 +00:00
Tim Potter
fccfa034e9 Converted {cmd,cli}_spoolss_getprinter() to WERROR and offered/neede. 0001-01-01 00:00:00 +00:00
Tim Potter
ae38fcf62c Converted cmd_spoolss_enumprinterdrivers() to use new
cli_spoolss_enumprinterdrivers() function.
0001-01-01 00:00:00 +00:00
Tim Potter
825b5c8bd6 Added addform, setform and deleteform commands. The only one I could get
to actually work was addform.  )-:

Removed a whole bunch of calls to werror_to_ntstatus() because there isn't
a one-to-one mapping of NTSTATUS values to WERROR values.  This function
maps WERR_ACCESS_DENIED to NTSTATUS_INVALID_LOCK_SEQUENCE or something
silly like that.
0001-01-01 00:00:00 +00:00
Tim Potter
6a58c9bd06 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
5dfba2cf53 Back out some of the less well thought out ideas from last weeks work on
winbind default domains, particulary now I understand whats going on a lot
better.  This ensures that the RPC client code does as little 'magic' as
possible - this is up to the application/user.  (Where - for to name->sid code
- it was all along).  This leaves the change that allows the sid->name code to
return domains and usernames in seperate paramaters.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
c84fa7f5fd Make a talloc'ed copy of this strings so we can pass the right kind of pointer
to the function.  This fixes a nice little segfault the brute-force-casting
created. :-)

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
e870f0e727 This patch makes the 'winbind use default domain' code interact better with
smbd, and also makes it much cleaner inside winbindd.

It is mostly my code, with a few changes and testing performed by Alexander
Bokovoy <a.bokovoy@sam-solutions.net>.  ab has tested it in security=domain and
security=ads, but more testing is always appricatiated.

The idea is that we no longer cart around a 'domain\user' string, we keep them
seperate until the last moment - when we push that string into a pwent on onto
the socket.

This removes the need to be constantly parsing that string - the domain prefix
is almost always already provided, (only a couple of functions actually changed
arguments in all this).

Some consequential changes to the RPC client code, to stop it concatonating the
two strings (it now passes them both back as params).

I havn't changed the cache code, however the usernames will no longer have a
double domain prefix in the key string.  The actual structures are unchanged
 - but the meaning of 'username' in the 'rid' will have changed.  (The cache is
invalidated at startup, so on-disk formats are not an issue here).

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Simo Sorce
6b123adda9 fixes (asprintf) from 2.2 0001-01-01 00:00:00 +00:00
Tim Potter
7bfd1f35e4 Converted getprinterdriver to WERROR - it always returns dos error 6
(invalid handle) though.  )-:
0001-01-01 00:00:00 +00:00
Tim Potter
4efbdda3fc Converted enumprinters and enumports cmd functions to use WERROR
values returned from cli functions.  They are converted to NTSTATUS codes
using the error map functions.

Do buffer size loop checks by setting offered = 0 and using the return
value of needed in the next call.
0001-01-01 00:00:00 +00:00
Tim Potter
248d114f85 spoolss rpc client cleanup:
- converted OpenPrinterEx and ClosePrinter to WERROR instead of NT_STATUS
 - doc
0001-01-01 00:00:00 +00:00
Tim Potter
950d8e3656 Display nicer message when server name could not be resolved. 0001-01-01 00:00:00 +00:00
Tim Potter
b70f870cd9 Fixed crash bug in display_print_info_2() 0001-01-01 00:00:00 +00:00
Tim Potter
d1564fbf1f Fixed crash bug in display_print_info_1() 0001-01-01 00:00:00 +00:00
Tim Potter
6b7e9d03cf Unicode byte ording fix from Benjamin Kuit <bj@it.uts.edu.au> 0001-01-01 00:00:00 +00:00
Andrew Bartlett
79031b68ce Finish idra's cleanup of the RPC remote shutdown code. 0001-01-01 00:00:00 +00:00
Simo Sorce
d2c663185e remove unneaded memory leaking code. 0001-01-01 00:00:00 +00:00
Jean-François Micouleau
55b9cd7af6 close some handles. not really necessary but doesn't hurt.
J.F.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
d5f2e645e4 added all level to samr_query_disp_info rpcclient side.
J.F.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
18dc4cd57a put back the -l option to rpcclient.
that's the most useful option in this tool !

I love rpcclient ;-)

	J.F.
0001-01-01 00:00:00 +00:00
Tim Potter
60d1d0bfa9 Fix for null command description in rpcclient help. From Benjamin Kuit
<bj@it.uts.edu.au>.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
aa52ae7354 lp_setup_logfile() doesn't exist any more 0001-01-01 00:00:00 +00:00
Jeremy Allison
0bea6cf79a Removed global debugf. Replaced with lp_set_logfile(name).
Fixed winbindd to finally stop leaving log. file droppings :-).
Jeremy.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
cb61606b8e initialise strings 0001-01-01 00:00:00 +00:00
Jean-François Micouleau
c99bc30559 update the ldap support code. it compiles.
Ignacio you can update your howto ;-)

samsync: a small patch to try chaning challenges.

	J.F.
0001-01-01 00:00:00 +00:00
Tim Potter
216dff4380 Fix some compiler warnings. 0001-01-01 00:00:00 +00:00
Jean-François Micouleau
d49c8e4d3d added a -V[erbose] option to samsync. Decode a lot of information
I'm looking at chaining the credentials

	J.F.
0001-01-01 00:00:00 +00:00
Tim Potter
4ef50ef9f7 SAMR query sec obj returns different results depending on which sam handle
it is passed.  Not sure what these different contexts are called or what
they are used for.

 - if a rid is specified to samquerysecobj then use the sam user policy
    handle for that rid
 - if -d is specified then use the sam domain policy handle
 - otherwise just use the sam connect policy handle

JF, any ideas about this?
0001-01-01 00:00:00 +00:00
Tim Potter
d1ebd259c8 Grr - people who put const everywhere should fix up all the warnings they
generate.
0001-01-01 00:00:00 +00:00
Tim Potter
1dc0e9096d Removed unused variable. 0001-01-01 00:00:00 +00:00
Tim Potter
59b2e3f408 Doing some research into ACLs on the LSA and SAM policy objects.
- added lsaquerysecobj to rpcclient
 - renamed querysecobj to samquerysecobj
 - removed duplicated display_sec_acl() code from cmd_spoolss.c and
   cmd_samr.c and moved it into display_sec.c
0001-01-01 00:00:00 +00:00
Tim Potter
83caa883d7 Compile fix. 0001-01-01 00:00:00 +00:00
Jean-François Micouleau
d4bc8f02f7 added enum alias groups to rpcclient 0001-01-01 00:00:00 +00:00
Tim Potter
bef4365647 Added client and server code for the GetPrintProcessorDirectory SPOOLSS
rpc.  This was supposed to fix a printer driver download bug but it didn't
but it seemed a shame to trash all this code so I'm commiting it #ifdef'ed
out in case someone needs it one day.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
eee925861a This change reworkes the connection code for both rpcclient and net new
'net' untility.

This should make it easier to port rpcclient code across to net.

It also allows SPNEGO (the NTLMSSP subsystem in particular) to work, becouse
it kills off the early destruction of the clear-text password.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
06cb20a46d added queryuseraliases to rpcclient
and some comments to the samr server code, to explain what we should
return here.

	J.F.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
d9d1486165 added samr_query_sec_obj. and put back some code to display a security
descriptor.

added to samr_lookup_name the choice to select the either the builtin
(s-1-5-32) domain or our current domain (s-1-5-21-x-y-z)

	J.F.
0001-01-01 00:00:00 +00:00
Tim Potter
9712d3f15a Renamed sid field in SEC_ACE to trustee to be more in line with MS's
definitions.
0001-01-01 00:00:00 +00:00
Tim Potter
7d10fa2082 dyn_CONFIGFILE fixups. 0001-01-01 00:00:00 +00:00
Andrew Tridgell
058a5aee90 added "net join" command
this completes the first stage of the smbd ADS support
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
1748d5a2af added lsaenumprivsaccount and lsalookupprivvalue to rpcclient
and more to come ...

	J.F.
0001-01-01 00:00:00 +00:00
Tim Potter
8fc772c9e5 Removed TimeInit() call from every client program (except for one place
in smbd/process.c where the timezone is reinitialised.  Was replaced with
check for a static is_initialised boolean.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
646651018a added lsa_enum_sids to rpcclient
fixed lsa_enum_rpivs server code. This time it works as W2K.
fixed smbgroupedit to compile and work.

	J.F.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
84035ae72f add another command to rpcclient: getdispname. Show the full description
of a privilege.

	J.F.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
fa63cb78e3 add a command to rpcclient: enumprivs
J.F.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
bfbe7f377e samr_querydom_info level 1: found the meaning of the unknow fields. And
discovered that our reply is short by 4 bytes since day 1 of this code.

Added a decode function to rpcclient too.

splitted the STRING2 fields filling while trying to understand the win9x
userlist bug. (didn't fix the bug, but the reply looks closer to NT).

        J.F.
0001-01-01 00:00:00 +00:00
Martin Pool
79ec88f0da Store some path names in global variables initialized to configure
default, rather than in preprocessor macros.
0001-01-01 00:00:00 +00:00
Tim Potter
7c6529c081 FALSE -> False 0001-01-01 00:00:00 +00:00
Tim Potter
7c3090fb20 Fixed some compiler warnings. 0001-01-01 00:00:00 +00:00
Tim Potter
c79e94ea27 Allow the logon level to be passed to cli_netlogon_sam_logon() rather than
the validation level.
0001-01-01 00:00:00 +00:00
Tim Potter
c3f5df8d67 Display some errors if the initial connection to the server could not be
made.
0001-01-01 00:00:00 +00:00
Tim Potter
7c5ac46b8a Added samlogon command to test against win2k native mode server. I think
there's a bug in the marshalling of net_sam_logon.
0001-01-01 00:00:00 +00:00
Tim Potter
d93488b953 Converted a bunch of functions to use sscanf %i instead of atoi to
allow hex or decimal rids to be specified.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
0573caa91b samr querydispinfo can change level, start index and max entries.
added level 4 decoding.

	J.F.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
0157fdc8a2 allow the samr commands to work back and the help too ;-)
J.F.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
5296b20ad8 the next step in the intl changeover. This should get us compiling agian,
and also completes the switch to lang_tdb.c. SWAT should now work
with a po file in the lib/ directory

also removed useless SYSLOG defines in many files
0001-01-01 00:00:00 +00:00
Tim Potter
f6f0a444fa Moved from include subdir. 0001-01-01 00:00:00 +00:00
Tim Potter
a40facba96 Some old stuff hanging around since the CIFS conference. Big cleanup of
rpcclient code.  Refactored cmd_* functions to move common mem_ctx and pipe
opening stuff up one level.  Moved rpcclient.h into rpcclient directory and
out of includes/smb.h
0001-01-01 00:00:00 +00:00
Jeremy Allison
4fdd45f3cc Fixup insure changes for rpcclient.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
9f5405d425 Incorrect definition of debugf.
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
2d0922b0ea Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header. 0001-01-01 00:00:00 +00:00
Simo Sorce
d38bc1dcec return NT_STATUS_NO_MEMORY istead of NT_STATUS_OK if we are out of memory. 0001-01-01 00:00:00 +00:00
Tim Potter
e0bdcbc599 Converted cli_net_auth2() and cli_nt_setup_creds() to return NTSTATUS. 0001-01-01 00:00:00 +00:00
Simo Sorce
5ceecc7bef move to SAFE_FREE() 0001-01-01 00:00:00 +00:00
Andrew Bartlett
512e9a5f94 Fix up NTSTATUS stuff in rpcclient's help function 0001-01-01 00:00:00 +00:00
Tim Potter
5da9862002 Produce correct lanman and nt hashes in samsync smbpasswd output. The
output from samsync -p produces the same output as running PWDUMP.EXE on
the domain controller except it happens via the sam synchronisation protocol.
0001-01-01 00:00:00 +00:00
Tim Potter
842fcd94fa Converted to NTSTATUS return codes.
Started on producing smbpasswd output from user account information.
Doesn't work yet.

Added -U option so samsync can be run interactively.
0001-01-01 00:00:00 +00:00
Tim Potter
66c7bb9467 oh foo 0001-01-01 00:00:00 +00:00
Tim Potter
a46e9cc3a1 Don't crash if run with no command line arguments. (-: 0001-01-01 00:00:00 +00:00
Andrew Tridgell
5bb7e4f0f6 it now all compiles - so try enabling it by default and see what explodes on the build farm 0001-01-01 00:00:00 +00:00
Andrew Tridgell
dcd6e735f7 the next stage in the NTSTATUS/WERROR change. smbd and nmbd now compile, but the client code still needs some work 0001-01-01 00:00:00 +00:00
Andrew Tridgell
24f9ab683d the next step in our error code handling change
- added WERROR for win32 error codes
- added a configure test for immediate structures

still lots to do, so its not enabled by default, but the main
structure is there
0001-01-01 00:00:00 +00:00
Tim Potter
c96aae613d Start of samsync program invoked by smbd to perform sam synchronisation and
sam replication.  It doesn't work yet.  (-:
0001-01-01 00:00:00 +00:00
Tim Potter
3a60cb44f2 Merge of sam sync code from TNG.
Reverse-engineered the sam replication protocol from staring at hex dumps
for a while.  It's pretty similar to the sam sync protocol with a couple of
different delta header types.

I wasn't able to figure out the format of the privilege stuff - needs more
time and a whiteboard.  (-:

The impressive bit is that the sam sync stuff from tng basically just
worked thanks mainly to Luke Leighton's efforts in this area.
0001-01-01 00:00:00 +00:00
Tim Potter
c292b63ff6 Fix bug in usage().
Allow user to invoke with \\ or // in front of server name.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
1d36250e33 converted another bunch of stuff to NTSTATUS 0001-01-01 00:00:00 +00:00
Simo Sorce
fd54412ce9 - avoid possible mem leaks in rpcclient/cmd_*.c (talloc_destroy not performed)
- ported two rpc back from TNG (WINREG: shutdown and abort shutdown)
- some optimizations and changed some DEBUG statement in loadparm.c
- changed rpcclient a bit moved from non reentrant next_token_nr to next_token
- in cmd_reg.c not sure if getopt will work ok on all platforms only setting optind=0
0001-01-01 00:00:00 +00:00
Tim Potter
5f5ed41ee8 Replaced the duplicate DOS constants with appropriate ones from doserr.h to
emphasise the fact that the spoolss pipe returns DOS error codes instead of
32-bit nt status codes.
0001-01-01 00:00:00 +00:00
Tim Potter
2c7d09b38d Return an exit code when connect failed.
Patch from Michael Sweet <mike@easysw.com>
0001-01-01 00:00:00 +00:00
Tim Potter
2e33940360 Held a shoot-out between NT_STATUS_NO_PROBLEMO and NT_STATUS_NOPROBLEMO.
According to the incorruptible judges find and grep, the latter won.

Mmm - procrastination.  (-:
0001-01-01 00:00:00 +00:00
Tim Potter
37052a1bcc Started adding some help/usage info for rpcclient commands. 0001-01-01 00:00:00 +00:00
Andrew Tridgell
b2a4a62b5e fixed anonymous login in rpcclient 0001-01-01 00:00:00 +00:00
Andrew Tridgell
29d8f9bcb3 improved the command line parsing of rpcclient 0001-01-01 00:00:00 +00:00
Andrew Tridgell
57e7df8ae5 missed a couple of strchr calls 0001-01-01 00:00:00 +00:00
Andrew Tridgell
c41fc06376 strchr and strrchr are macros when compiling with optimisation in gcc, so we can't redefine them. damn. 0001-01-01 00:00:00 +00:00
Andrew Tridgell
debb471267 The big character set handling changeover!
This commit gets rid of all our old codepage handling and replaces it with
iconv. All internal strings in Samba are now in "unix" charset, which may
be multi-byte. See internals.doc and my posting to samba-technical for
a more complete explanation.
0001-01-01 00:00:00 +00:00
Simo Sorce
1959864490 fix compiler warnings 0001-01-01 00:00:00 +00:00
Andrew Tridgell
674ee2f1d1 next_token() was supposed to be a reentrant replacement for strtok(),
but the code suffered from bitrot and is not now reentrant. That means
we can get bizarre behaviour
i've fixed this by making next_token() reentrant and creating a
next_token_nr() that is a small non-reentrant wrapper for those lumps
of code (mostly smbclient) that have come to rely on the non-reentrant
behaviour
0001-01-01 00:00:00 +00:00
Tim Potter
aa9024c959 Added delete domain user rpcclient command. 0001-01-01 00:00:00 +00:00
Tim Potter
13df2304b3 Added some msdfs client routines. 0001-01-01 00:00:00 +00:00
Tim Potter
e65b486273 Added stub dfs client commands to rpcclient. 0001-01-01 00:00:00 +00:00
Tim Potter
abc294c4a8 Added stubs for dfs rpc client routines. 0001-01-01 00:00:00 +00:00
Tim Potter
2ca5ea16bd Fixups for new args to cli_samr_connect()
Added samlookupnames and samlookuprids rpcclient commands.
0001-01-01 00:00:00 +00:00
Tim Potter
6c9796286c Added add domain user to rpcclient.
Added cli_ functions for set userinfo and userinfo2.
0001-01-01 00:00:00 +00:00
Gerald Carter
c827787d67 merge from 2.2 0001-01-01 00:00:00 +00:00
Gerald Carter
e30a3be954 merge from 2.2 0001-01-01 00:00:00 +00:00
Gerald Carter
7e23ed4890 merge from 2.2 0001-01-01 00:00:00 +00:00
Tim Potter
c93718daa1 Added srvinfo and partial logonctrl and logonctrl2 commands. 0001-01-01 00:00:00 +00:00
Tim Potter
6e0805c191 Fixed compiler warning. 0001-01-01 00:00:00 +00:00
Tim Potter
c4e7ce267f Removed some level 0 debugs accidentally left in - oops. 0001-01-01 00:00:00 +00:00
Tim Potter
c9b4ed79c8 Replaced next_command() with call to next_token(). 0001-01-01 00:00:00 +00:00
Tim Potter
3343c9f0d6 Added stubs for SRVSVC and NETLOGON rpcclient commands. 0001-01-01 00:00:00 +00:00
Gerald Carter
515caaf7b4 merge from 2.2 (deleteprinterdriver RPC) 0001-01-01 00:00:00 +00:00
Gerald Carter
09506ac0e6 merge from 2.2 DeletePrinterDriver() server side stud coming
in separate commit after I get it working in 2.2.
0001-01-01 00:00:00 +00:00
Tim Potter
22b760e246 Fixed up SAM_USERINFO_CTR dynamic stuff in cmd_samr_query_user() 0001-01-01 00:00:00 +00:00
Tim Potter
ab58fdf77a Added arg to querygroupinfo. 0001-01-01 00:00:00 +00:00
Tim Potter
48688c4592 Memory leak fixes plus general cleanup. 0001-01-01 00:00:00 +00:00
Tim Potter
727d2929bc Fixed querydispinfo command. 0001-01-01 00:00:00 +00:00
Tim Potter
1ea5aa4a80 iAdded querydispinfo and querydominfo functions.
Allow rid to be specified in lookupuser.
0001-01-01 00:00:00 +00:00
Tim Potter
982195c89d Added queryaliasmem function.
Moved fetch_domain_sid() calls out of harms way so they didn't spam out
queries on SAMR pipe.
0001-01-01 00:00:00 +00:00
Tim Potter
d4f6ce9422 Tidyup of server vs servername, username vs user to remove compiler
warnings.
0001-01-01 00:00:00 +00:00
Tim Potter
23427a57da Added cmd_samr_enum_dom_groups() function. 0001-01-01 00:00:00 +00:00
Tim Potter
3434e0bf7f More usability fixes. 0001-01-01 00:00:00 +00:00
Tim Potter
37cdf37fee Allow ctrl-d to exit rpcclient.
Don't try to run anything if user just presses return at rpcclient prompt.
0001-01-01 00:00:00 +00:00
Gerald Carter
0a6ceed279 rpcclient merge from 2.2 (including Jeremy's non-void return fix) 0001-01-01 00:00:00 +00:00
Jeremy Allison
94747b4639 Got "medieval on our ass" about adding the -1 to slprintf.
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
cea13dff75 Changed usage message for query_groupmem and query_usergroups as they don't
convert names to rids yet.
0001-01-01 00:00:00 +00:00
Jeremy Allison
be825b0746 Added Gerald's fixes.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
38b19fad28 More unused variables.
Jeremy.
0001-01-01 00:00:00 +00:00
Gerald Carter
1d14d812ea merge from 2.2 (reorder commands in array) 0001-01-01 00:00:00 +00:00
Andrew Tridgell
4ec971e905 fixed rpcclient readline code 0001-01-01 00:00:00 +00:00
Gerald Carter
0cb7639cef addprinter and adddriver are working now :-) 0001-01-01 00:00:00 +00:00
Gerald Carter
5d32167385 added getdriverdir and cleaned up the PRINTER_DRIVER_CTR struct 0001-01-01 00:00:00 +00:00
Gerald Carter
83d6bc4454 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.
0001-01-01 00:00:00 +00:00
Gerald Carter
6aaac37663 more updates. several spoolss commands added as placeholders
to be filled in one at a time.
0001-01-01 00:00:00 +00:00
Gerald Carter
d98ac8852a 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
0001-01-01 00:00:00 +00:00
Gerald Carter
e652a14264 move charset_initialize() up in the food chain so that lp_load_services
and stuff will work....
0001-01-01 00:00:00 +00:00
Jeremy Allison
0be41d5158 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.
0001-01-01 00:00:00 +00:00
Tim Potter
76f08426a0 rpcclient functions for remaining samr and lsa functions. All functions
now pass through insure except for some of the dodgy spoolss prs
weirdness.
0001-01-01 00:00:00 +00:00
Tim Potter
635db9b601 Pass correctly formatted args to cli_spoolss_open_printer_ex() 0001-01-01 00:00:00 +00:00
Tim Potter
079f46aca4 Memory leak fixes and uninitialised variables spotted by insure. 0001-01-01 00:00:00 +00:00
Tim Potter
8072ee62b0 Memory leak fixes spotted by insure. 0001-01-01 00:00:00 +00:00
Tim Potter
42674cc616 Use MAXIMUM_ALLOWED_ACCESS when doing a cli_spoolss_open_printer_ex() 0001-01-01 00:00:00 +00:00
Tim Potter
9a953514f2 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...
0001-01-01 00:00:00 +00:00
Tim Potter
817819d0cc 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.  )-:
0001-01-01 00:00:00 +00:00
Tim Potter
77b0bda4df 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?
0001-01-01 00:00:00 +00:00
Gerald Carter
ae7dd77c24 spoolgetprinterdriver now returns "Windows NT x86" and "Windows 4.0"
driver information.

Will merge into TNG.



jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
2d95c38f7e added -P (for no prompt) and -A <authfile> options
jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
4fad1fc28a fixed an off by one error where I was tromping on memory
when initializing a driver_info_3 struct.  See spoolss_addprinterdriver()



jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
ce2d20395a FIxed some unmarshalling problems with relstr and unistr arrays
jerry
0001-01-01 00:00:00 +00:00
Jeremy Allison
e466c863f5 Tidied up security rights definitions.
Jeremy.
0001-01-01 00:00:00 +00:00
Gerald Carter
206565368b Working on spoolss_getprinterdriver() as it does not display all the
dependentfiles.



jery
0001-01-01 00:00:00 +00:00
Gerald Carter
880e811616 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
0001-01-01 00:00:00 +00:00
Gerald Carter
8ecd5dd52a More work on AddPrinterDriver() and AddPrinterEx() client RPC's
Also fixed init_unistr() to deal with a NULL source character string.



-jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
39d025693e Fixed AddPrinterDriver()
jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
3bf9a29f34 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
0001-01-01 00:00:00 +00:00
Gerald Carter
8e5e929561 spoolss_addprinterex() was adding the printer and returning the
correct handle, but was deleting the connection to the server.
Doh!!



--jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
e15d9befd2 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
0001-01-01 00:00:00 +00:00
Jeremy Allison
c55bcec817 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.
0001-01-01 00:00:00 +00:00
Gerald Carter
45fbf31b69 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
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
883f7402d4 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.
0001-01-01 00:00:00 +00:00
Gerald Carter
2c0f6bcc8f some initial code for AddPrinterEx() project. Most is ifdef'd out
'cause it's not all written.


-jerry
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
ac0a145acc 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.
0001-01-01 00:00:00 +00:00
Gerald Carter
56ce247977 Added EnumPorts() and fixed up some problems
with the other spoolss client calls.

Also cleaned up output for 'help' command.



jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
c8abc31187 Fixed unitilized secdesc pointer which was causing spoolgetprinter
rpcclient command to fail on shared printers.




jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
15b3591271 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
0001-01-01 00:00:00 +00:00
Gerald Carter
0faf21662d adding more spoolss command into rpcclient. They don't all work
currently.  More to come later.


--jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
12e2a21e1b 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
0001-01-01 00:00:00 +00:00
Gerald Carter
269051aa0c 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
0001-01-01 00:00:00 +00:00
Gerald Carter
426c43fb51 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
0001-01-01 00:00:00 +00:00
Andrew Tridgell
b28cc4163b 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.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
f890bcf067 moved secrets fns into secrets.c 0001-01-01 00:00:00 +00:00
Shirish Kalele
15e7d8f6c5 Added the NETDFS pipe to allow remote administration of the msdfs symlinks
on the samba server.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
f76c037255 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.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
88ad00b82a added secrets.tdb and changed storage of trust account password to use
it
0001-01-01 00:00:00 +00:00
Andrew Tridgell
d7cd7c88fd moved trans2.h and nterr.h into includes.h with all our other includes 0001-01-01 00:00:00 +00:00
Luke Leighton
96717211ed 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)
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
61c970b10a After 3AM, it's getting hard for Luke :-) 0001-01-01 00:00:00 +00:00
Luke Leighton
49d7f0afbc 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.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
d72c98a931 use GET_DENY_MODE() macro instead of the bit shift 0001-01-01 00:00:00 +00:00
Andrew Tridgell
8f3ff09283 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)
0001-01-01 00:00:00 +00:00
Andrew Tridgell
b563be824b 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.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
25b13f8b79 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!
0001-01-01 00:00:00 +00:00
Andrew Tridgell
4a20579571 more files from 2.0.6 0001-01-01 00:00:00 +00:00
Andrew Tridgell
d7b2087865 2nd phase of head branch sync with SAMBA_2_0 - this delets all the files that were in the head branch but weren't in SAMBA_2_0 0001-01-01 00:00:00 +00:00
Andrew Tridgell
453a822a76 first pass at updating head branch to be to be the same as the SAMBA_2_0 branch 0001-01-01 00:00:00 +00:00
Luke Leighton
caa5052522 final part of "first" phase converting over to msrpc daemon architecture.
done a minimal amout of clean-up in the Makefile, removing unnecessary
modules from the link stage.  this is not complete, yet, and will
involve some changes, for example to smbd, to remove dependencies on
the password database API that shouldn't be there.  for example,
smbd should not ever call getsmbpwXXX() it should call the Samr or Lsa
API.

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

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

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

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

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

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

had to put pretty much everything that is in user_struct into parse_creds.c
to feed unix user info over to the msrpc daemons.  why?  because it's
expensive to do unix password/group database lookups, and it's definitely
expensive to do nt user profile lookups, not to mention pretty difficult
and if you did either of these it would introduce a complication /
unnecessary interdependency.  so, send uid/gid/num_groups/gid_t* +
SID+num_rids+domain_group_rids* + unix username + nt username + nt domain
+ user session key etc.  this is the MINIMUM info identified so far that's
actually implemented.  missing bits include the called and calling
netbios names etc.  (basically, anything that can be loaded into
standard_sub() and standard_sub_basic()...)
0001-01-01 00:00:00 +00:00
Luke Leighton
30c7fdd6ef ABOUT TIME!!!!!!!!
damn, this one is bad.

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

it is necessary that the msrpc daemon inherit the same unix and nt
credentials as the smbd process from which it was spawned, until
such time as the msrpc daemon receives an authentication request
of its own, whereupon the msrpc daemon is responsible for authenticating
the new credentials and doing yet another become_user() etc sequence.
0001-01-01 00:00:00 +00:00
Luke Leighton
d54a64ae3a starting "connection reuse" system in smb-agent. added version number
which isn't actually used right now :-)
0001-01-01 00:00:00 +00:00
Luke Leighton
a47cc64470 i always get caught out with non-gnu-readline code mods :-) 0001-01-01 00:00:00 +00:00
Luke Leighton
294b653f2e 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.
0001-01-01 00:00:00 +00:00
Luke Leighton
f33e4ca930 promptline undefined (pline) 0001-01-01 00:00:00 +00:00
Luke Leighton
3a2b920ea2 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.
0001-01-01 00:00:00 +00:00
Luke Leighton
12e2b97321 oops, pwdb_initialise() called unnecessarily from here (failure to read
trusted domains may cause rpcclient to fail).
0001-01-01 00:00:00 +00:00
Luke Leighton
f0946d1cca default SID map now reads in "trusted domains" from smb.conf. 0001-01-01 00:00:00 +00:00
Luke Leighton
50dc709fa9 improved enumdomains added -i option. 0001-01-01 00:00:00 +00:00
Luke Leighton
338d08f69b 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$
0001-01-01 00:00:00 +00:00
Luke Leighton
586db87ea3 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
0001-01-01 00:00:00 +00:00
Luke Leighton
fcc39b3f4f 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.
0001-01-01 00:00:00 +00:00
Luke Leighton
fbfb350bdf make sure domain and name to generate trust account .mac file are upper case. 0001-01-01 00:00:00 +00:00
Luke Leighton
c98c666906 damn, that took a while. nt login password was being stored incorrectly
in private .mac file (oops).  ntlogin test now works.
0001-01-01 00:00:00 +00:00
Luke Leighton
cef258f1c9 fixing joining to domain plus something weird going down with nt logins... 0001-01-01 00:00:00 +00:00
Luke Leighton
7846818432 improving createuser account command to be able to add workstations
and then set a default random password.
0001-01-01 00:00:00 +00:00
Luke Leighton
301a6efaf6 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
0001-01-01 00:00:00 +00:00
Luke Leighton
e4d92ff9df sys_select added one more argument (read, write selectors). 0001-01-01 00:00:00 +00:00
Luke Leighton
5b5719d6a0 split display.c into modules. 0001-01-01 00:00:00 +00:00
Luke Leighton
d1986ade30 attempting to resolve the issue that multiple servers often specified in
parameters to connect to \PIPE\NETLOGON.
0001-01-01 00:00:00 +00:00
Luke Leighton
85cc680736 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!!!
0001-01-01 00:00:00 +00:00
Luke Leighton
44dd3efa63 first attempt at getting \PIPE\NETLOGON working. it's pretty horrible. 0001-01-01 00:00:00 +00:00
Luke Leighton
8b92be25bd renamed PRINTER_HND to POLICY_HND. 0001-01-01 00:00:00 +00:00
Luke Leighton
7a69633058 well, i stuffed up the spooler commands. 0001-01-01 00:00:00 +00:00
Luke Leighton
0aaf0c9c80 moved at command over to new abstract connection system. matthew, you
initialised dest_wks _after_ using it in at_soon() :-) so i fixed this :)
0001-01-01 00:00:00 +00:00
Luke Leighton
601d217f44 moved browser command brsinfo over to new abstracted connection 0001-01-01 00:00:00 +00:00
Luke Leighton
4c3556fae7 this one's a handle-based one (missed in the first round). 0001-01-01 00:00:00 +00:00
Luke Leighton
e4e5743a40 removed do_ prefix from srvsvc API 0001-01-01 00:00:00 +00:00
Luke Leighton
3204829225 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
0001-01-01 00:00:00 +00:00
Luke Leighton
6b67d6164d using "abstracted" cli_connection, got \PIPE\srvsvc commands up and running
again.
0001-01-01 00:00:00 +00:00
Luke Leighton
a1ff7e8fc3 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.
0001-01-01 00:00:00 +00:00
Luke Leighton
2dad9d912d remove use of client_info lsa_info_pol. 0001-01-01 00:00:00 +00:00
Luke Leighton
4e029d50fc enhanced samuser command to do same thing as enumusers command (-g -u -a)
except with only one user.  done by sharing same code.
0001-01-01 00:00:00 +00:00
Luke Leighton
c049865782 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$

:-)
0001-01-01 00:00:00 +00:00
Luke Leighton
29c480085e 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...
0001-01-01 00:00:00 +00:00
Luke Leighton
8ce93b80d3 cool! completed a samr* API that _would_ look like an msdn samr* api...
if microsoft bothered to publish it.  actually, there are good reasons
for not publishing it: people might write programs for it, and then
those programs wouldn't work on nt5, for example...
0001-01-01 00:00:00 +00:00
Luke Leighton
45e92258e7 registry API moved over to new format. reg_connect() is the top-level
function, which takes \\server_name.

tested a _few_ functions.  found that regcreatekey receives a Fault PDU.
0001-01-01 00:00:00 +00:00
Luke Leighton
7cacf8bd02 service control manager API completed. svcenum -i works, but does not
do so twice.  possible memory corruption, revolving around getopt().
0001-01-01 00:00:00 +00:00
Luke Leighton
57bff6fe82 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.
0001-01-01 00:00:00 +00:00
Luke Leighton
c01b18e632 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!
0001-01-01 00:00:00 +00:00
Luke Leighton
eaac0923e0 rewrote policy handle code to be generic (it's needed for client-side too)
attempted to fix regsetsec command
0001-01-01 00:00:00 +00:00
Luke Leighton
447143be81 oops, freed argc,argv arguments twice. 0001-01-01 00:00:00 +00:00
Luke Leighton
9193f0eff5 attempted a svcset command. password is encrypted / messed up, therefore
command fails.
0001-01-01 00:00:00 +00:00
Luke Leighton
cbbfef6d2a oops!!!! wrong command!!! 0001-01-01 00:00:00 +00:00
Luke Leighton
d5869df371 adding svcctl 0x1b function 0001-01-01 00:00:00 +00:00
Luke Leighton
e88e7d529b shuffling msrpc code around so that it can be used independently of rpcclient 0001-01-01 00:00:00 +00:00
Luke Leighton
ca803c17fa the last one. that concludes the removal of all next_token() calls
from rpcclient/cmd_*.c.
0001-01-01 00:00:00 +00:00
Luke Leighton
3e76ca9b17 another four next_token() removals (using getopt instead) 0001-01-01 00:00:00 +00:00
Luke Leighton
b0f8ef6168 another two. 0001-01-01 00:00:00 +00:00
Luke Leighton
c1ba1bfd68 another one 0001-01-01 00:00:00 +00:00
Luke Leighton
de360d1e90 moved two more commands over to getopt. 0001-01-01 00:00:00 +00:00
Luke Leighton
9a1efa03c8 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.
0001-01-01 00:00:00 +00:00
Luke Leighton
ab174759cd 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);
0001-01-01 00:00:00 +00:00
Luke Leighton
e885027eb7 moving create user function into msrpc_samr.c 0001-01-01 00:00:00 +00:00
Luke Leighton
3ec269b402 doing a code reshuffle. want to add code to establish trust relationships. 0001-01-01 00:00:00 +00:00
Luke Leighton
569babb393 added \PIPE\browser plus experimental brsinfo command. you wouldn't
believe the XXXX that MIGHT be involved in getting nt5rc2 to join
a samba domain...
0001-01-01 00:00:00 +00:00
Luke Leighton
4aea261cb0 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.
0001-01-01 00:00:00 +00:00
Luke Leighton
c3913f8ae2 added samuserset2 rpcclient command to test ACB_XXX bit-setting on
samr opcode 0x25.  _yet_ another failed attempt to get nt5rc2 to join
a samba domain.  what _is_ it with this stuff, dammit?
0001-01-01 00:00:00 +00:00
Luke Leighton
3df7c903c5 updating reg_value_info() parsing code to take BUFFER2 instead of just
a char*.  now copes with multiple types.
0001-01-01 00:00:00 +00:00
Luke Leighton
98ddeaf442 added regqueryval command (experimental) to get reg_io_q_info() and
reg_io_r_info() working properly.  previously they weren't well
understood (well, they were the first of the registry functions i did,
back in december 97, ok??? :-)

set ntversion to 0x1 in SAMQUERY, so that we reply same as NT4 srv.
0001-01-01 00:00:00 +00:00
Luke Leighton
3273bc068d oops, mistake in parsing command-arguments. repeated calls to
next_token() should not have line to parse as first arg.  oops.
0001-01-01 00:00:00 +00:00
Luke Leighton
3146aa6b60 added rpcclient "enumdomains" command. enumerates names of domains
for which a PDC is responsible.  typical answers are:
<Name of Domain> plus <Builtin>.

against a hierarchical, down-level-compatible NT5 PDC, there's likely to
be more than these two entries!!!!!
0001-01-01 00:00:00 +00:00
Luke Leighton
e6e5caf16c debugging rpcclient spoolenum and spooljobs commands. oh, did i forget
to mention, there's a spooljobs <printer name> command, and it uses
command-line completion?  prints out NT print jobs really nicely, too.
0001-01-01 00:00:00 +00:00
Luke Leighton
ea1d5af105 riccardo sibilia spotted line 1884 has uint32 group_rid[0] not group_rid[1]
oops!
0001-01-01 00:00:00 +00:00
Luke Leighton
e0eb390ab3 const feeding frenzy 0001-01-01 00:00:00 +00:00
Luke Leighton
6d27c5f32d const feeding frenzy 0001-01-01 00:00:00 +00:00
Luke Leighton
6947f8fac7 added command-completion printer enum code. 0001-01-01 00:00:00 +00:00
Luke Leighton
0249ae50ad fixed string function for reading in printer_info_N. 0001-01-01 00:00:00 +00:00
Luke Leighton
135eaa9773 added rpcclient spoolenum command. enumerates printers.
spoolss_r_io_enumprinters doesn't decode strings correctly
as printer_info_1/2 code has only been written to write
structures, not read them.
0001-01-01 00:00:00 +00:00
Luke Leighton
ef7fa58fd3 spoolss openprinterex / closeprinter client-code.
experimental spoolopen <printer name> command added.

jean-francois, f.y.i. i changed the #define for SPOOLSS_OPENPRINTEREX from
op code 0x44 to 0x45.
0001-01-01 00:00:00 +00:00