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

87 Commits

Author SHA1 Message Date
Andrew Bartlett
fcbfc7ad06 Changes all over the shop, but all towards:
- NTLM2 support in the server
 - KEY_EXCH support in the server
 - variable length session keys.

In detail:

 - NTLM2 is an extension of NTLMv1, that is compatible with existing
domain controllers (unlike NTLMv2, which requires a DC upgrade).

 * This is known as 'NTLMv2 session security' *

(This is not yet implemented on the RPC pipes however, so there may
well still be issues for PDC setups, particuarly around password
changes.  We do not fully understand the sign/seal implications of
NTLM2 on RPC pipes.)

This requires modifications to our authentication subsystem, as we
must handle the 'challege' input into the challenge-response algorithm
being changed.  This also needs to be turned off for
'security=server', which does not support this.

- KEY_EXCH is another 'security' mechanism, whereby the session key
actually used by the server is sent by the client, rather than being
the shared-secret directly or indirectly.

- As both these methods change the session key, the auth subsystem
needed to be changed, to 'override' session keys provided by the
backend.

- There has also been a major overhaul of the NTLMSSP subsystem, to merge the 'client' and 'server' functions, so they both operate on a single structure.  This should help the SPNEGO implementation.

- The 'names blob' in NTLMSSP is always in unicode - never in ascii.
Don't make an ascii version ever.

- The other big change is to allow variable length session keys.  We
have always assumed that session keys are 16 bytes long - and padded
to this length if shorter.  However, Kerberos session keys are 8 bytes
long, when the krb5 login uses DES.

 * This fix allows SMB signging on machines not yet running MIT KRB5 1.3.1. *

- Add better DEBUG() messages to ntlm_auth, warning administrators of
misconfigurations that prevent access to the privileged pipe.  This
should help reduce some of the 'it just doesn't work' issues.

- Fix data_blob_talloc() to behave the same way data_blob() does when
passed a NULL data pointer.  (just allocate)


REMEMBER to make clean after this commit - I have changed plenty of data structures...
(This used to be commit f3bbc87b0d)
2003-11-22 13:19:38 +00:00
Jim McDonough
3d8e3f314b Add initshutdown pipe commands to rpcclient. Second part of fix to bug
#534
(This used to be commit 4e86243ea1)
2003-10-24 13:49:29 +00:00
Gerald Carter
11777e6a30 Attempt at fixing bug #283. There however is no solution.
There is a workaround documented in the bug report.

This patch does:

  * add server support for the LSA_DS UUID on the lsarpc pipe
  * store a list of context_ids/api_structs in the pipe_struct
    so that we don't have to lookup the function table for a pipe.
    We just match the context_id.  Note that a dce/rpc alter_context
    does not destroy the previous context so it is possible to
    have multiple bindings active on the same pipe. Observed from
    standalone win2k sp4 client.
  * added server code for DsROleGetPrimaryDOmainInfo() but disabled it
    since it causes problems enumerating users and groups from a 2ksp4
    domain member in a Samba domain.
(This used to be commit 96bc2abfcb)
2003-08-14 21:14:28 +00:00
Jim McDonough
bdaac40746 Move PAC decoding over from HEAD.
(This used to be commit b0fd4e5555)
2003-04-16 16:57:01 +00:00
Tim Potter
3b865c7398 Merge of rpcecho pipe for testing large dcerpc requests and responses.
Only compiled in when --enable-developer argument passed to configure.
(This used to be commit 017da9393b)
2003-04-14 02:08:03 +00:00
Volker Lendecke
b4d0f208fb Merge the TNG netlogon schannel from HEAD.
No more XP requiresignorseal anymore!

Thanks again to Luke :-)

Volker
(This used to be commit 6b2b55901d)
2003-04-06 07:04:09 +00:00
Andrew Bartlett
634c54310c Merge from HEAD - make Samba compile with -Wwrite-strings without additional
warnings.  (Adds a lot of const).

Andrew Bartlett
(This used to be commit 3a7458f947)
2003-01-03 08:28:12 +00:00
Gerald Carter
9c1b62c0fd merge of working dsrolegetprimdominfo() client code from APP_HEAD
(This used to be commit 028477e352)
2002-10-04 19:33:41 +00:00
Andrew Tridgell
e90b652848 updated the 3.0 branch from the head branch - ready for alpha18
(This used to be commit 03ac082dcb)
2002-07-15 10:35:28 +00:00
Tim Potter
308b222ffd Spelling fixes.
(This used to be commit a7fa0733ba)
2002-03-05 00:53:46 +00:00
Andrew Bartlett
670f78f501 Matching header files for the last netlogon cleanup.
Andrew Bartlett
(This used to be commit a9edcc1cb7)
2002-03-03 04:01:49 +00:00
Tim Potter
cd68afe312 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
(This used to be commit 6a58c9bd06)
2002-01-30 06:08:46 +00:00
Jeremy Allison
565b9cc157 Return correct RPC fault PDU on bad handle incoming.
Jeremy.
(This used to be commit 0db93d8752)
2002-01-25 05:28:37 +00:00
Andrew Bartlett
32101155d4 Kill off another ugly wart from the side of the passdb subsystem.
This time its the pdb_getsampwuid() function - which was only being used by the
SAMR rpc subsystem to gain a 'user session key'.  This 'user session key' is
actually generated at login time, and the other changes here simply move that
data around.

This also means that (when I check some details) we will be able to use the
user session key, even when we are not actually the DC, becouse its one of the
components of the info3 struct returned on logon.

Andrew Bartlett
(This used to be commit 799ac01fe0)
2002-01-20 13:26:31 +00:00
Andrew Bartlett
bb6af711b8 This is the current patch from Luke Leighton <lckl@samba-tng.org> to add a
degree of seperation betwen reading/writing the raw NamedPipe SMB packets
and the matching operations inside smbd's RPC components.

This patch is designed for no change in behaviour, and my tests hold that to be
true.  This patch does however allow for the future loadable modules interface
to specify function pointers in replacement of the fixed state.

The pipes_struct has been split into two peices, with smb_np_struct taking the
information that should be generic to where the data ends up.

Some other minor changes are made: we get another small helper function in
util_sock.c and some of the original code has better failure debugs and
variable use. (As per on-list comments).

Andrew Bartlett
(This used to be commit 8ef13cabdd)
2002-01-20 02:40:05 +00:00
Tim Potter
27cbee1b4e Removed CHECK_STRUCT macro - it isn't used anywhere.
(This used to be commit 06c619b395)
2001-09-14 04:31:15 +00:00
Tim Potter
5cf3467dc8 Merge of struct acct_info from TNG.
(This used to be commit 2eb28b3d51)
2001-05-04 07:36:09 +00:00
Jeremy Allison
9f793948bd include/ntdomain.h:
rpc_server/srv_lsa_hnd.c: Remove back pointer from policy handle list as the pipe
						that opened the handle may have been closed. We were dereferencing
						into something that had been closed.
rpc_parse/parse_spoolss.c: Sync up with Gerald's changes in 2.2.
lib/replace.c: Don't do proto on setlinebuf as it differs between systems.
Jeremy.
(This used to be commit 887ef3e12d)
2001-04-02 22:27:40 +00:00
Jeremy Allison
e532d96a26 Move to a handle database per pipe name, not per pipe.
Jeremy.
(This used to be commit a24b248a77)
2001-03-13 20:18:45 +00:00
Jeremy Allison
b840dce676 Moved cruft out of smb.h into ntdomain.h where it belongs. dc struct
now in pipe struct (where used) rather than user_struct.
Secured machine account password changing in srv_netlog_nt.c - ensure
that only the given machine can change its own password. May need to
free this up later for NT admin tools, but this is a fail-safe secure
position for now.
Jeremy.
(This used to be commit 46b12f2275)
2001-03-11 22:26:28 +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
Jeremy Allison
00ab9021b0 Serious (and I *mean* serious) attempt to fix little/bigendian RPC issues.
We were reading the endainness in the RPC header and then never propagating
it to the internal parse_structs used to parse the data.
Also removed the "align" argument to prs_init as it was *always* set to
4, and if needed can be set differently on a case by case basis.
Now ready for AS/U testing when Herb gets it set up :-).
Jeremy.
(This used to be commit 0cd37c831d)
2001-03-09 23:48:58 +00:00
Jeremy Allison
5ec1642809 Ok - this is a *BIG* change - but it fixes the problems with static strings
in the RPC code. This change was prompted by trying to save a long (>256)
character comment in the printer properties page.

The new system associates a TALLOC_CTX with the pipe struct, and frees
the pool on return of a complete PDU.

A global TALLOC_CTX is used for the odd buffer allocated in the BUFFERxx
code, and is freed in the main loop.

This code works with insure, and seems to be free of memory leaks and
crashes (so far) but there are probably the occasional problem with
code that uses UNISTRxx structs on the stack and expects them to contain
storage without doing a init_unistrXX().

This means that rpcclient will probably be horribly broken.
A TALLOC_CTX also needed associating with the struct cli_state also,
to make the prs_xx code there work.

The main interface change is the addition of a TALLOC_CTX to the
prs_init calls - used for dynamic allocation in the prs_XXX calls.

Now this is in place it should make dynamic allocation of all RPC
memory on unmarshall *much* easier to fix.

Jeremy.
(This used to be commit 0ff2ce543e)
2000-07-27 00:47:19 +00:00
Gerald Carter
a1bd676617 Fixed some more client 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

All part of the ongoing rpcclient work.

Also included a new generic list ADT.  Cleaner and simplier
than the stuff in util_array.c i think (but then that's why I wrote it).





--jerry
(This used to be commit 381aba2c9a)
2000-07-18 05:16:30 +00:00
Gerald Carter
7a88bb6baa make proto
and a few changes to ntdomain for rpcclient printing functions


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




--jerry
(This used to be commit 61d2aad5dc)
2000-07-07 06:20:46 +00:00
Tim Potter
96446651af Moved authenticated pipe user details into a current_user struct.
(This used to be commit 3c4a5f624b)
2000-07-06 07:01:37 +00:00
Tim Potter
f048209484 Some more sec_ctx changes. Modified some fields in the pipe_struct
structure so authenticated pipe users can have their unix groups set when
become_authenticated_pipe_user() is called.
(This used to be commit 55c9bf124d)
2000-07-03 06:52:31 +00:00
Gerald Carter
8d429db410 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.

The changes to the header files were minor.  A few struct's and a few
additional fields to existing ones.  No deletions.  **minimal change
necessary** :-)  Well, maybe not minimal, but I tried.

All other programs compile, link and run ok from what I can tell so
I don;t think I broke anything.

--jerry
(This used to be commit cd7f0b0b91)
2000-07-03 04:26:37 +00:00
Tim Potter
0630db580a Changed function prototype for pipe api functions to take a pipes_struct
instead of two prs_data pointers.
(This used to be commit 73e4466fc3)
2000-06-16 08:24:11 +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
1076cfd78f addd grow_size to prs_struct so we know how much data is actually in
the buffer
(This used to be commit 725889869c)
2000-05-15 09:58:22 +00:00
Andrew Tridgell
ddc9b8b406 more merging
it is now at the stage that winbindd can compile in the head branch,
but not link
(This used to be commit d178c00aae)
2000-05-10 09:49:55 +00:00
Andrew Tridgell
c23e01d049 the beginnings of a new scheme I've working on to allow an easier
head/tng merge.

It goes something like this:

- headers from tng get copied over one at a time

- the old headers get renamed to *_old.h

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

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

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

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

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

Note this this is still a very delicate operation, as at every step of
the way I want to keep head fully functional. Please don't take part
unless you discuss it with me first.
(This used to be commit f76c037255)
2000-05-09 13:28:19 +00:00
Tim Potter
ba0a53b52c Removed unused parameter vuid from rpc_server api_* calls. For the very few
functions that need to access the vuid, it can be obtained from the
current_user global.

Did some whitespace cleanup.
(This used to be commit 738b307bd7)
2000-04-04 00:35:34 +00:00
Jeremy Allison
5e22394654 Fixups for compiles with gcc flags -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual
Partially implemented rpc daemon redirect (needs more work).
Jeremy.
(This used to be commit a462191698)
2000-03-10 19:50:03 +00:00
Jeremy Allison
6bb92a6d38 Big update moving the multi-pdu support from 2.0.x into HEAD for JF
and the printer functions.
Also tidied up some header includes and got the order right so you
can now do a :

make proto
make clean
make

Jeremy.
(This used to be commit 833cd9fba9)
2000-03-09 21:45:16 +00:00
Jeremy Allison
9db96b7646 lib/system.c: Fixed gcc warnings.
nmbd/nmbd_processlogon.c: Use "True" and "False" instead of 1 and 0.
Others - preparing for multiple pdu write code.
Jeremy.
(This used to be commit 9f879ec396)
2000-02-23 02:02:33 +00:00
Jean-François Micouleau
b7ef313b31 spoolss include definitions
J.F.
(This used to be commit 853a1a3027)
2000-02-07 16:27:03 +00:00
Luke Leighton
fbd17c8daf simple mods to add msrpc pipe redirection. default behaviour: fall back
to using internal msrpc code in smbd.
(This used to be commit 8976e26d46)
2000-01-03 19:19:48 +00:00
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
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
a0ba234cf9 the first independent msrpc daemon - lsarpcd.
one horrible cut / paste job from smbd, plus a code split of shared
components between the two.

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

i can't believe this all worked!!!
(This used to be commit 2245b0c6d1)
1999-12-06 00:44:32 +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
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
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
98ee99eb72 added rpcclient "enumdomains" command. enumerates names of domains
for which a PDC is responsible.  typical answers are:
<Name of Domain> plus <Builtin>.

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

- added SMBwrite support (note: SMBwriteX already existed) as NT5rc2 is
sending DCE/RPC over SMBwrite not SMBwriteX.
(This used to be commit 25c70e3c98)
1999-11-15 22:11:10 +00:00
Luke Leighton
826ad16b36 debugging rpcclient spoolenum and spooljobs commands. oh, did i forget
to mention, there's a spooljobs <printer name> command, and it uses
command-line completion?  prints out NT print jobs really nicely, too.
(This used to be commit e6e5caf16c)
1999-11-09 19:35:30 +00:00
Luke Leighton
c6e3fc5838 const feeding frenzy
(This used to be commit e0eb390ab3)
1999-11-08 20:58:06 +00:00