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

284 Commits

Author SHA1 Message Date
Andrew Tridgell
ede02ee038 r2051: switched the samdb over to using the new destructor and reference
count features of talloc, instead of re-implementing both those
features inside of samdb (which is what we did before).

This makes samdb considerably simpler, and also fixes some bugs, as I
found some error paths that didn't call samdb_close(). Those are now
handled by the fact that a talloc_free() will auto-close and destroy
the samdb context, using a destructor.
(This used to be commit da60987a92)
2007-10-10 12:58:21 -05:00
Andrew Bartlett
aca6a1e1ee r1993: Allow WinXP domain logon to progress a bit further (it seems broken for me).
Fix indent, and add a few more useful debug messages.

Send a fault, if the bind is not accepted - don't just leave the client hanging.

Andrew Bartlett
(This used to be commit 486215edc1)
2007-10-10 12:58:15 -05:00
Andrew Tridgell
b83ba93eae r1983: a completely new implementation of talloc
This version does the following:

  1) talloc_free(), talloc_realloc() and talloc_steal() lose their
     (redundent) first arguments

  2) you can use _any_ talloc pointer as a talloc context to allocate
     more memory. This allows you to create complex data structures
     where the top level structure is the logical parent of the next
     level down, and those are the parents of the level below
     that. Then destroy either the lot with a single talloc_free() or
     destroy any sub-part with a talloc_free() of that part

  3) you can name any pointer. Use talloc_named() which is just like
     talloc() but takes the printf style name argument as well as the
     parent context and the size.

The whole thing ends up being a very simple piece of code, although
some of the pointer walking gets hairy.

So far, I'm just using the new talloc() like the old one. The next
step is to actually take advantage of the new interface
properly. Expect some new commits soon that simplify some common
coding styles in samba4 by using the new talloc().
(This used to be commit e35bb094c5)
2007-10-10 12:58:14 -05:00
Andrew Bartlett
f607197054 r1498: (merge from 3.0)
Rework our random number generation system.

On systems with /dev/urandom, this avoids a change to secrets.tdb for every fork().

For other systems, we now only re-seed after a fork, and on startup.
No need to do it per-operation.  This removes the 'need_reseed'
parameter from generate_random_buffer().

This also requires that we start the secrets subsystem, as that is
where the reseed value is stored, for systems without /dev/urandom.

In order to aviod identical streams in forked children, the random
state is re-initialised after the fork(), at the same point were we do
that to the tdbs.

Andrew Bartlett
(This used to be commit b97d3cb2ef)
2007-10-10 12:57:35 -05:00
Stefan Metzmacher
b82881591c r1335: NT_STATUS_INTERNAL_DB_CORRUPTION
should cause DEBUG(0,(...));

metze
(This used to be commit 80851e6778)
2007-10-10 12:56:50 -05:00
Andrew Bartlett
dc9f55dbec r1294: A nice, large, commit...
This implements gensec for Samba's server side, and brings gensec up
to the standards of a full subsystem.

This means that use of the subsystem is by gensec_* functions, not
function pointers in structures (this is internal).  This causes
changes in all the existing gensec users.

Our RPC server no longer contains it's own generalised security
scheme, and now calls gensec directly.

Gensec has also taken over the role of auth/auth_ntlmssp.c

An important part of gensec, is the output of the 'session_info'
struct.  This is now reference counted, so that we can correctly free
it when a pipe is closed, no matter if it was inherited, or created by
per-pipe authentication.

The schannel code is reworked, to be in the same file for client and
server.

ntlm_auth is reworked to use gensec.

The major problem with this code is the way it relies on subsystem
auto-initialisation.  The primary reason for this commit now.is to
allow these problems to be looked at, and fixed.

There are problems with the new code:
- I've tested it with smbtorture, but currently don't have VMware and
  valgrind working (this I'll fix soon).
- The SPNEGO code is client-only at this point.
- We still do not do kerberos.

Andrew Bartlett
(This used to be commit 07fd885fd4)
2007-10-10 12:56:49 -05:00
Stefan Metzmacher
db8c78c497 r1235: as the pidl code init all output data.
we should do it manualy too.

metze
(This used to be commit d3b80fd40a)
2007-10-10 12:56:46 -05:00
Stefan Metzmacher
cf5fdae640 r1234: valgrind found this uninitialised var...
But I don't know how to fix this correct,
so maybe this needs to be fixed

(tridge: can you please look at this)

metze
(This used to be commit b8b4d0d5bf)
2007-10-10 12:56:46 -05:00
Andrew Tridgell
5b044b30ca r1150: - fixed interactive sam logon in the rpc server
- added a torture test for interactive login in smbtorture

These changes allow winxp to perform an interactive login (a login on
the winxp console) against a Samba4 DC. Our netlogon server code is
still filling in many of the fields incorrectly, but it fills in
enough that winxp can login.
(This used to be commit db9ea488b0)
2007-10-10 12:56:41 -05:00
Andrew Tridgell
ef34f4de25 r1145: added server support for logon level 5 in sam logon
(This used to be commit cb3d3b5e51)
2007-10-10 12:56:40 -05:00
Andrew Tridgell
7ae1735798 r1141: - consolidated the netr_SamInfo structures using a netr_SamBaseInfo
structure (andrew, this is the type of structure consolidation I think
  you were asking about. It's possible here in NDR as it isn't in the
  top level fn code)

- added validation level 6 in sam logon

With these changes I can successfully authentication smbclient to a
winxp server, with the winxp server using a Samba4 ADS DC for account
auth
(This used to be commit 705205083a)
2007-10-10 12:56:40 -05:00
Andrew Tridgell
a384d2f1a1 r1139: added IDL and server code for netr_LogonSamLogonWithFlags()
(This used to be commit 4eac7340d8)
2007-10-10 12:56:40 -05:00
Andrew Tridgell
bccac81d87 r1136: - added IDL for netr_LogonGetDomainInfo()
- added workstation to auth_session_info in rpc servers

- added session key fetch hook in crypto backends in dcesrv

- store and fetch seed as well as a session key in schannel ldb

- when a client uses schannel to setup a netlogon pipe connection we
  also need to setup the credentials from the schannel negotiation so
  credentials chaining works

- added server side netr_LogonGetDomainInfo() call
(This used to be commit a35459387d)
2007-10-10 12:56:39 -05:00
Andrew Bartlett
f3826432fb r1080: Make sure to initialise all the returned elements in the SamLogon
reply also initialise the LM session key, when we have it (was failing
because the auth code was setting it's length wrong).

Andrew Bartlett
(This used to be commit de97d9df22)
2007-10-10 12:56:37 -05:00
Andrew Bartlett
46c88d561f r1061: The start of the SamLogon call for the NETLOGON pipe.
Changes:

- Check for a valid 'pipe_state' in netr_ServerAuthenticate3 before
  we dereference it

- removes the expansionroom[7] in the netr_SamInfo* structs to 7
individual elements.
- renames netr_SamInfo -> netr_SamInfo2
          netr_SamInfo2 -> netr_SamInfo3
  - Having the thing we always called an 'info3' being 'netr_SamInfo2'
    was just too confusing.

- Expand and fill in extra details about users from the SAM, into
  the server_info, for processing into the SamLogon reply.

- Add a dum_sid_dup() function to duplicate a struct dom_sid

The SamLogon code currently does not return supplementary groups, and is
only tested with Samba4 smbtorture.

Andrew Bartlett
(This used to be commit 6c92563b79)
2007-10-10 12:56:35 -05:00
Andrew Bartlett
bcac502d44 r1058: The start of work on the SamLogon call for NETLOGON.
This starts to store information about the user in the server_info
struct - like the account name, the full name etc.

Also, continue to make the names of the structure elements in the
logon reply more consistant with those in the SAMR pipe.

Andrew Bartlett
(This used to be commit 3ccd96bd94)
2007-10-10 12:56:35 -05:00
Andrew Tridgell
4c6f04d83f r1029: cope wiith samdb_result_passwords() returning a null machine password
(This used to be commit ee6c17f373)
2007-10-10 12:56:30 -05:00
Tim Potter
21aaa719b5 r1026: Spelling.
(This used to be commit b7fe73613a)
2007-10-10 12:56:30 -05:00
Andrew Bartlett
5b04ca8080 r1025: Rename (across the samr and netlogon pipes, so far)
pwd -> password
passwd -> password

username -> account_name

Also work on consistant structure feild names between these two pipes,
and fix up some callers to use samr_Password for the netlogon
credential code.

Andrew Bartlett
(This used to be commit 4e35418c27)
2007-10-10 12:56:30 -05:00
Andrew Tridgell
1a993b800e r1016: - store the schannel session key after it is established
- move to a centralised way of handling talloc/ldb interaction
(This used to be commit 2b9b752875)
2007-10-10 12:56:27 -05:00
Andrew Bartlett
9eb6afb00d r1009: Make all users of NT and LM passwords use the samr_Password structure.
This includes the netlogon pipe, for the machine account password
change system.

Andrew Bartlett
(This used to be commit 49d545a820)
2007-10-10 12:56:26 -05:00
Andrew Tridgell
8087d844ef r995: - renamed many of our crypto routines to use the industry standard
names rather than our crazy naming scheme. So DES is now called
  des_crypt() rather than smbhash()

- added the code from the solution of the ADS crypto challenge that
  allows Samba to correctly handle a 128 bit session key in all of the
  netr_ServerAuthenticateX() varients. A huge thanks to Luke Howard
  from PADL for solving this one!

- restructured the server side rpc authentication to allow for other
  than NTLMSSP sign and seal. This commit just adds the structure, the
  next commit will add schannel server side support.

- added 128 bit session key support to our client side code, and
  testing against w2k3 with smbtorture. Works well.
(This used to be commit 729b2f41c9)
2007-10-10 12:56:25 -05:00
Andrew Tridgell
6611f01050 r951: from w2k3 behaviour, the netlogon server is supposed to give back the negotiate flags it can support.
(This used to be commit 7ad56fc4db)
2007-10-10 12:56:21 -05:00
Andrew Tridgell
6a0ce94d02 r950: - added netr_ServerAuthenticate3(). This is used by WinXP clients who try to login to Samba4, as
WinXP sees us as an ADS server.

Unfortunately WinXP also uses a set of negotiate_flags that we don't
support yet. Some crypto work needed.
(This used to be commit 2d740b6570)
2007-10-10 12:56:21 -05:00
Andrew Tridgell
d9538e7412 r937: - added a simple QuerySecurity implementation in samr server
- moved some sec desc defines into misc.idl

 - fixed pw_len field in UserInfo26

 - made some pipes available on TCP

 - added netr_DsrEnumerateDomainTrusts() to netlogon

 - added templates for remaining netlogon IDL calls (from ethereal)

 - added a unistr_noterm vs unistr error detector in ndr basic decoder

 - added torture test for netr_DsrEnumerateDomainTrusts()
(This used to be commit ae5a5113fb)
2007-10-10 12:56:20 -05:00
Andrew Tridgell
db3c011977 r917: - added the start of a LSA server to samba4.
- added start of QueryDomainInfo in samr server

"net rpc info" from samba3 now works against a samba4 server. I
suspect join will work fairly soon.
(This used to be commit 0a2c6a1062)
2007-10-10 12:56:19 -05:00
Stefan Metzmacher
fcd718c7d8 r890: convert samba4 to use [u]int8_t instead of [u]int8
metze
(This used to be commit 2986c5f08c)
2007-10-10 12:56:16 -05:00
Stefan Metzmacher
f88bf54c7f r889: convert samba4 to use [u]int16_t instead of [u]int16
metze
(This used to be commit af6f1f8a01)
2007-10-10 12:56:16 -05:00
Stefan Metzmacher
f9d8f8843d r884: convert samba4 to use [u]int32_t instead of [u]int32
metze
(This used to be commit 0e5517d937)
2007-10-10 12:56:15 -05:00
Andrew Tridgell
579c13da43 r873: converted samba4 to use real 64 bit integers instead of
structures. This was suggested by metze recently.

I checked on the build farm and all the machines we have support 64
bit ints, and support the LL suffix for 64 bit constants. I suspect
some won't support strtoll() and related functions, so we will
probably need replacements for those.
(This used to be commit 9a9244a1c6)
2007-10-10 12:56:14 -05:00
Andrew Bartlett
93076cb9bc r816: - Make use of tridge's new samdb_result_sid_prefix() helper function.
- Remove legacy sid_to_string (which contained a memleak)

 - Remove some unused parts of lib/util_sid.c

Andrew Bartlett
(This used to be commit 7c69a85984)
2007-10-10 12:53:52 -05:00
Andrew Bartlett
92dd542aa0 r754: Implement the SetPassword operation on the netlogon pipe.
This involves allowing the password set code in samdb to take an
already hashed password, and some fixes to our torture code.

Andrew Bartlett
(This used to be commit f9f581b580)
2007-10-10 12:53:48 -05:00
Andrew Bartlett
82306753e2 r745: Move netr_ServerPasswordSet up with the other secure channel
management functions, and make sure to include the fault until this is
no longer a stub.

Andrew Bartlett
(This used to be commit b886cb65f8)
2007-10-10 12:53:46 -05:00
Andrew Bartlett
064e7447be r743: Start on a NETLOGON server in Samba4.
Currently this only authentiates the machine, not real users.

As a consequence of running the Samba4 NETLOGON test against Samba4, I
found a number of issues in the SAMR server, which I have addressed.
There are more templates in the provison.ldif for this reason.

I also added some debug to our credentials code, and fixed some bugs
in the auth_sam module.

The static buffer in generate_random_string() bit me badly, so I
removed it in favor of a talloc based system.

Andrew Bartlett
(This used to be commit 94624e519b)
2007-10-10 12:53:46 -05:00