1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00
Commit Graph

1769 Commits

Author SHA1 Message Date
Andrew Bartlett
7f7b6a59b4 r9418: SPNEGO fixes:
- Fix mixing of code and data
- send mechListMic again in SPENGO server
- only send optomistic first packet in the client.
(This used to be commit 9941da8081)
2007-10-10 13:33:36 -05:00
Andrew Bartlett
7e36c7e607 r9416: Cleanups inspired by jra's work to migrate Samba4's NTLMSSP code back
into Samba3.

The NTLMSSP sign/seal code now assumes that GENSEC has already checked
to see if SIGN or SEAL should be permitted.  This simplfies the code
ensures that no matter what the mech, the correct code paths have been
set in place.

Also remove duplication caused by the NTLMv2 code's history, and
document why some of the things a bit funny.

In SPNEGO, create a new routine to handle the negTokenInit creation.
We no longer send an OID for a mech we can't start (like kerberos on
the server without a valid trust account).

Andrew Bartlett
(This used to be commit fe45ef608f)
2007-10-10 13:33:36 -05:00
Andrew Bartlett
40f56f63be r9415: Remove old kerberos code (including salt guessing code) that has only
caused me pain (and covourty warnings).

Simply gensec_gssapi to assume the properties of lorikeet-heimdal,
rather than having #ifdef around critical features.  This simplifies
the code rather a lot.

Andrew Bartlett
(This used to be commit 11156f556d)
2007-10-10 13:33:36 -05:00
Andrew Bartlett
b456bfa015 r9412: Simplfy this NTLM authentication code by requiring the caller to
supply the user_sess_key and lm_sess_key parameters.  Inspired by
coverty complaining about inconsistant checking.

Also factor out some of this code, where we deal with just NT and LM
hashes, or embedded plaintext passwords.

Andrew Bartlett
(This used to be commit ceec35564f)
2007-10-10 13:33:35 -05:00
Andrew Bartlett
8e11003e21 r9411: Ensure we don't send a challenge without first getting a negotiate in
NTLMSSP, unless we are in datagram mode (not fully implemented yet).

Andrew Bartlett
(This used to be commit 727f510942)
2007-10-10 13:33:35 -05:00
Simo Sorce
3e4c4cff21 r9391: Convert all the code to use struct ldb_dn to ohandle ldap like distinguished names
Provide more functions to handle DNs in this form
(This used to be commit 692e35b779)
2007-10-10 13:33:32 -05:00
Tim Potter
878e139f09 r9357: Remove DBGC_CLASS cruft copied over from Samba 3. I would like to
replace this with something funkier.
(This used to be commit 8d376d56c7)
2007-10-10 13:33:27 -05:00
Stefan Metzmacher
3be75a4c6d r9240: - move struct security_token to the idl file, with this we can
the ndr_pull/push/print functions for it in the ntacl-lsm module

- fix compiler warnings in the ldap_encode_ndr_* code

metze
(This used to be commit 83d65d0d7e)
2007-10-10 13:31:37 -05:00
Andrew Bartlett
457d7fd672 r9233: Ensure that the output variable is initialised in this conversion from
error to non-error case.

Andrew Bartlett
(This used to be commit ab75cd53e7)
2007-10-10 13:31:35 -05:00
Stefan Metzmacher
79c1c76b26 r9196: - add a note about the Canonicalize KDCOPtion flag
- add a note about old client using the wrong checksum type for GSSAPI
  in the Authenticator

metze
(This used to be commit 07e39bd94c)
2007-10-10 13:31:30 -05:00
Andrew Bartlett
910c1d55c2 r9165: Fix inverted error check in untested code path. (My untested code...)
Andrew Bartlett
(This used to be commit fba7a0edd4)
2007-10-10 13:31:26 -05:00
Andrew Bartlett
8db8279730 r9084: 'resign' the sample PAC for the validation of the signature algorithms.
If we ever get problems with the kerberos code, it should show up as a
different signature in this PAC.

This involved returning more data from the pac functions, so changed
some callers and split up some functions.

Andrew Bartlett
(This used to be commit d514a74912)
2007-10-10 13:31:15 -05:00
Andrew Bartlett
aa7d44c0d9 r9022: One more step in the game of whack-a-mole with the PAC.
This makes the PAC we generate match (closely) the PAC generated by my
test win2k3 DC.

Andrew Bartlett
(This used to be commit 6172b18680)
2007-10-10 13:31:08 -05:00
Andrew Bartlett
896fd8e1cd r8980: Make Samba4 honour account control flags (we were asking for a
non-existant field).

Also change time(NULL) into an NTTIME for comparison, rather than
experience rounding bugs (size of time_t) when converting an NTTIME
into a time_t.

Andrew Bartlett
(This used to be commit 181155f9e0)
2007-10-10 13:31:03 -05:00
Jelmer Vernooij
5e1a9fe62b r8933: Fix missing prototype warnings
(This used to be commit 39b2220a84)
2007-10-10 13:30:58 -05:00
Andrew Tridgell
176ed87e48 r8774: make some gensec errors a bit less verbose
(This used to be commit 2134ca4755)
2007-10-10 13:30:04 -05:00
Andrew Bartlett
cd882fc78d r8701: Fix up auth_developer for recent changes.
Andrew Bartlett
(This used to be commit 1bc5a11907)
2007-10-10 13:29:55 -05:00
Andrew Bartlett
b16362fab6 r8700: Propmted by tridge's need to do plaintext auth in ejs, rework the
user_info strcture in auth/

This moves it to a pattern much like that found in ntvfs, with
functions to migrate between PAIN, HASH and RESPONSE passwords.

Instead of make_user_info*() functions, we simply fill in the control
block in the callers, per recent dicussions on the lists.  This
removed a lot of data copies as well as error paths, as we can grab
much of it with talloc.

Andrew Bartlett
(This used to be commit ecbd2235a3)
2007-10-10 13:29:55 -05:00
Andrew Tridgell
989a4b673d r8676: attribute lists in ldb searches must be NULL terminated
this is what was causing the panic on the s390 box
(This used to be commit 3a49626ae1)
2007-10-10 13:29:53 -05:00
Andrew Bartlett
5bf8d0f516 r8644: This is a more useful error than unsuccesful.
Andrew Bartlett
(This used to be commit d7136c93fb)
2007-10-10 13:29:49 -05:00
Andrew Tridgell
e835621799 r8520: fixed a pile of warnings from the build farm gcc -Wall output on
S390. This is an attempt to avoid the panic we're seeing in the
automatic builds.

The main fixes are:

 - assumptions that sizeof(size_t) == sizeof(int), mostly in printf formats

 - use of NULL format statements to perform dn searches.

 - assumption that sizeof() returns an int
(This used to be commit a58ea6b385)
2007-10-10 13:29:34 -05:00
Andrew Tridgell
c77f4a68c6 r8460: removed the unused function krb5_locate_kdc(). It causes a build failure on irix.
Andrew, if you planned on using this in the future then we can put it
back and work out how to make it portable
(This used to be commit eaa74913fe)
2007-10-10 13:23:05 -05:00
Love Hörnquist Åstrand
053cec96df r8390: (smb_pam_start): move variable to scope within #ifdef to avoid warning
for those PAM implementations w/o PAM_RHOST and/or PAM_TTY
(This used to be commit 95cb2d942f)
2007-10-10 13:20:14 -05:00
Volker Lendecke
3e0aa2e756 r8321: Fix some uninitalized variable warnings
(This used to be commit 126cb3db4b)
2007-10-10 13:20:06 -05:00
Simo Sorce
3b03ccb2f7 r8259: We want to oset the provided flags not zero
(This used to be commit 50d8ccacca)
2007-10-10 13:19:27 -05:00
Andrew Bartlett
e75c7ff39f r8252: Steal metze's thunder, and prove that with a few small tweaks, we can
now push/pull a sample PAC, and still have the same byte buffer.
(Metze set up the string code, and probably already has a similar
patch).

Unfortunetly win2k3 still doesn't like what we provide, but every step helps.

Also use data_blob_const() when we are just wrapping data for API
reasons.

Andrew Bartlett
(This used to be commit e7c8076fc1)
2007-10-10 13:19:25 -05:00
Andrew Tridgell
38ec84a75c r8251: fixed a couple of valgrind errors in the unix auth code. Simo, can you
please check that this is what you intended?
(This used to be commit a57738769d)
2007-10-10 13:19:25 -05:00
Andrew Bartlett
c0a78453a7 r8250: More PAC work. We now sucessfully verify the KDC signature from my DC
(I have included the krbtgt key from my test network).

It turns out the krbtgt signature is over the 16 (or whatever,
enc-type dependent) bytes of the signature, not the entire structure.

Also do not even try to use Kerberos or GSSAPI on an IP address, it
will only fail.

Andrew Bartlett
(This used to be commit 3b9558e82f)
2007-10-10 13:19:25 -05:00
Stefan Metzmacher
f1031746e5 r8164: - match the ordering w2k3 uses for the PAC_BUFFER:
LOGON_INFO
   LOGON_NAME
   SRV_CHECKSUM
   KDC_CHECKSUM

- w2k3 also don't use the groupmembership array with rids
  it uses the othersids array

metze
(This used to be commit 2286fad27d)
2007-10-10 13:19:16 -05:00
Stefan Metzmacher
1f01bafd44 r8163: if sidcount is zero it happened that we return NT_STATUS_NO_MEMORY...
metze
(This used to be commit a9ff35a1a2)
2007-10-10 13:19:16 -05:00
Stefan Metzmacher
a33178fc72 r8156: I found out that the unknown[2] field of the unknown[4] array is a length too,
it's always 16 bytes smaller than the size in the PAC_BUFFER

we now dump the blob's on LOCAL-PAC with -d 10

metze
(This used to be commit 4ef721ce53)
2007-10-10 13:19:13 -05:00
Stefan Metzmacher
148235a009 r8148: - make the PAC generation code a bit more readable and add some outof memory checks
- move to handmodified pull/push code for PAC_BUFFER
  to get the _ndr_size field and the subcontext size right

- after looking closely to the sample w2k3 PAC in our torture test (and some more in my archive)
  I found out that the first uint32 before the netr_SamInfo3 was also a pointer,
  (and we passed a NULL pointer there before, so I think that was the reason why the windows clients doesn't want our PAC)

  w2k3 uses this for unique pointers:

  ptr = ndr->ptr_count * 4;
  ptr |= 0x00020000;
  ndr->ptr_count;

- do one more pull/push round with the sample PAC

metze
(This used to be commit 0eee179415)
2007-10-10 13:19:13 -05:00
Andrew Bartlett
dbd2688c90 r8110: More PAC work. I still can't get WinXP to accept the PAC, but we are
much closer.

This changes PIDL to allow a subcontext to have a pad8 flag, saying to
pad behind to an 8 byte boundary.  This is the only way I can explain
the 4 trainling zeros in the signature struct.

Far more importantly, the PAC code is now under self-test, both in
creating/parsing our own PAC, but also a PAC from my win2k3 server.
This required changing auth_anonymous, because I wanted to reuse the
anonymous 'server_info' generation code.

I'm still having trouble with PIDL, particulary as surrounds value(),
but I'll follow up on the list.

Andrew Bartlett
(This used to be commit 50a54bf4e9)
2007-10-10 13:19:09 -05:00
Andrew Bartlett
ce5882e82f r8016: Get the keyblock arguments correct. (the context struct changed, but
I forgot to update the users)

Andrew Bartlett
(This used to be commit 44b86b7e65)
2007-10-10 13:18:59 -05:00
Andrew Bartlett
ddffc922df r8001: Also fill in the krbtgt checksum, and make sure to put the right
checksum in the right place...

Andrew Bartlett
(This used to be commit 90d0f502da)
2007-10-10 13:18:57 -05:00
Andrew Bartlett
9a7481bcfe r7993: Further work on the Krb5 PAC.
We now generate the PAC, and can verifiy both our own PAC and the PAC
from Win2k3.

This commit adds the PAC generation code, spits out the code to get
the information we need from the NETLOGON server back into a auth/
helper function, and adds a number of glue functions.

In the process of building the PAC generation code, some hints in the
Microsoft PAC specification shed light on other parts of the code, and
the updates to samr.idl and netlogon.idl come from those hints.

Also in this commit:

The Heimdal build package has been split up, so as to only link the
KDC with smbd, not the client utils.

To enable the PAC to be veified with gensec_krb5 (which isn't quite
dead yet), the keyblock has been passed back to the calling layer.

Andrew Bartlett
(This used to be commit e2015671c2)
2007-10-10 13:18:57 -05:00
Andrew Bartlett
f4e75294be r7991: I forgot to free the keyblock once we are done with it.
Andrew Bartlett
(This used to be commit a68e348375)
2007-10-10 13:18:56 -05:00
Andrew Bartlett
f4607c6e55 r7989: Allow the use of hashed passwords in the kerberos client and server,
and create the in-memory keytab with the correct kvno, if available.

Andrew Bartlett
(This used to be commit 7b7b2b038e)
2007-10-10 13:18:56 -05:00
Andrew Bartlett
cbbe4e816c r7986: Fix the compile, thanks to HotaruT.
This won't actually work until I get the keyblock filled in again, but
at least it will compile.

I first need to decide if we want to keep the server-side gensec_krb5
code at all, now we have the GSSAPI layer doing what we want.

Andrew Bartlett
(This used to be commit 28e49de929)
2007-10-10 13:18:56 -05:00
Andrew Bartlett
5daf957362 r7980: Forgot to add kerberos_pac.c to this config.mk file.
Andrew Bartlett
(This used to be commit bba58a1876)
2007-10-10 13:18:56 -05:00
Andrew Bartlett
66da650727 r7979: Metze reminded me to try one more combination, and we can now verify
the 'PAC', required for interopability with Active Directory.

This is still a cludge, as it doesn't handle different encryption
types, but that should be fairly easy to fix (needs PIDL/IDL changes).

Andrew Bartlett
(This used to be commit 690cfc44ce)
2007-10-10 13:18:56 -05:00
Andrew Bartlett
99777452f0 r7978: A start again on PAC verification. I have noticed that the kerberos
keys appear at the end of the PAC, which I feel is deliberate (it
makes this much easier).

I still can't make it work, but I'm sure we are closer.

Andrew Bartlett
(This used to be commit 6f0e1c80ae)
2007-10-10 13:18:55 -05:00
Andrew Bartlett
f9861c9c5a r7968: Pull the PAC from within GSSAPI, rather than only when using our own
'mock GSSAPI'.

Many thanks to Luke Howard for the work he has done on Heimdal for
XAD, to provide the right API hooks in GSSAPI.

Next step is to verify the signatures, and to build the PAC for the
KDC end.

Andrew Bartlett
(This used to be commit 2e82743c98)
2007-10-10 13:18:55 -05:00
Andrew Bartlett
2fb1e179f6 r7965: Remove the GENSEC password callback structure members, as these are no
longer used.

Andrew Bartlett
(This used to be commit 14be7d9569)
2007-10-10 13:18:54 -05:00
Andrew Bartlett
14b0722edf r7935: auth_unix now uses crypt(), so depend on -lcrypt.
This builds on the work tridge did to make -lcrypt conditional, rather
than globally linked.  This was needed for Heimdal stuff, but then I
'fixed' heimdal, and we now reintroduce it here.

Andrew Bartlett
(This used to be commit 83d9d8f482)
2007-10-10 13:18:52 -05:00
Simo Sorce
b30d59c3bf r7934: ported samba3 pass_check functions to auth_unix.c
not having these platforms they are untested,
let's hope the buildfarm can catch any problem
(This used to be commit 08ec299dcb)
2007-10-10 13:18:52 -05:00
Andrew Tridgell
37e3d02621 r7863: removed an unused variable
(This used to be commit 9ee3dbad6b)
2007-10-10 13:18:44 -05:00
Andrew Bartlett
8bbb77d88a r7862: Updates to the Kerberos notes, based on recent changes and discoveries.
Andrew Bartlett
(This used to be commit 7d791d13bc)
2007-10-10 13:18:44 -05:00
Andrew Tridgell
bdee131f30 r7860: switch our ldb storage format to use a NDR encoded objectSid. This is
quite a large change as we had lots of code that assumed that
objectSid was a string in S- format.

metze and simo tried to convince me to use NDR format months ago, but
I didn't listen, so its fair that I have the pain of fixing all the
code now :-)

This builds on the ldb_register_samba_handlers() and ldif handlers
code I did earlier this week. There are still three parts of this
conversion I have not finished:

 - the ltdb index records need to use the string form of the objectSid
   (to keep the DNs sane). Until that it done I have disabled indexing on
   objectSid, which is a big performance hit, but allows us to pass
   all our tests while I rejig the indexing system to use a externally
   supplied conversion function

 - I haven't yet put in place the code that allows client to use the
   "S-xxx-yyy" form for objectSid in ldap search expressions. w2k3
   supports this, presumably by looking for the "S-" prefix to
   determine what type of objectSid form is being used by the client. I
   have been working on ways to handle this, but am not happy with
   them yet so they aren't part of this patch

 - I need to change pidl to generate push functions that take a
   "const void *" instead of a "void*" for the data pointer. That will
   fix the couple of new warnings this code generates.

Luckily it many places the conversion to NDR formatted records
actually simplified the code, as it means we no longer need as many
calls to dom_sid_parse_talloc(). In some places it got more complex,
but not many.
(This used to be commit d40bc2fa8d)
2007-10-10 13:18:44 -05:00
Andrew Bartlett
4432cc73ae r7843: Use the new Heimdal gsskrb_acquire_creds API. This has the right
lifetime constraints, and works with the in-memory keytab.

Move initialize_krb5_error_table() into our kerberos startup code,
rather than in the GSSAPI code explitly.  (Hmm, we probably don't need
this at all..)

Andrew Bartlett
(This used to be commit bedf92da5c)
2007-10-10 13:18:42 -05:00
Andrew Bartlett
8a68f96f8c r7827: Add in-memory keytab to Samba4, using the new MEMORY_WILDCARD keytab
support in Heimdal.

This removes the 'ext_keytab' step from my Samba4/WinXP client howto.

In doing this work, I realised that the replay cache in Heimdal is
currently a no-op, so I have removed the calls to it, and therefore
the mutex calls from passdb/secrets.c.

This patch also includes a replacement 'magic' mechanism detection,
that does not issue extra error messages from deep inside the GSSAPI
code.

Andrew Bartlett
(This used to be commit c19d5706f4)
2007-10-10 13:18:41 -05:00
Andrew Bartlett
e578c33c2c r7757: Add NTLMv2 support to the NT1 Session setup (ie, not SPNEGO/NTLMSSP)
Session Setup code.

Add a mem_ctx argument to a few of the NTLMv2 support functions, and
add smb.conf options to control client NTLMv2 behaviour.

Andrew Bartlett
(This used to be commit 3f35cdb218)
2007-10-10 13:18:32 -05:00
Andrew Tridgell
ee57c76a68 r7704: - fixed open_nbt_connection() to return NULL when the connection failed
- got rid of smbcli_shutdown() and use talloc_free() instead.
(This used to be commit 1011b1bf51)
2007-10-10 13:18:23 -05:00
Andrew Bartlett
5b19286df0 r7690: Move the NT hash generation into the credentials system, rather than
in all the callers.  This also allows us to be more flexible in the
type of password we store.

Andrew Bartlett
(This used to be commit 00b8588c68)
2007-10-10 13:18:23 -05:00
Andrew Bartlett
949deaf9e3 r7687: Some more tests that must be done only when krb5_config is absent.
Andrew Bartlett
(This used to be commit 898f72d196)
2007-10-10 13:18:22 -05:00
Love Hörnquist Åstrand
c3948492d4 r7638: krb5_closelog in heimdal-0.7 not longer leaks memory, so remove that comment
(This used to be commit 3aa80b8e58)
2007-10-10 13:18:16 -05:00
Andrew Bartlett
7a33552d82 r7637: Another useful Heimdal feature we need.
Andrew Bartlett
(This used to be commit 57ddedc954)
2007-10-10 13:18:16 -05:00
Andrew Tridgell
af237084ec r7633: this patch started as an attempt to make the dcerpc code use a given
event_context for the socket_connect() call, so that when things that
use dcerpc are running alongside anything else it doesn't block the
whole process during a connect.

Then of course I needed to change any code that created a dcerpc
connection (such as the auth code) to also take an event context, and
anything that called that and so on .... thus the size of the patch.

There were 3 places where I punted:

  - abartlet wanted me to add a gensec_set_event_context() call
    instead of adding it to the gensec init calls. Andrew, my
    apologies for not doing this. I didn't do it as adding a new
    parameter allowed me to catch all the callers with the
    compiler. Now that its done, we could go back and use
    gensec_set_event_context()

  - the ejs code calls auth initialisation, which means it should pass
    in the event context from the web server. I punted on that. Needs fixing.

  - I used a NULL event context in dcom_get_pipe(). This is equivalent
    to what we did already, but should be fixed to use a callers event
    context. Jelmer, can you think of a clean way to do that?

I also cleaned up a couple of things:

 - libnet_context_destroy() makes no sense. I removed it.

 - removed some unused vars in various places
(This used to be commit 3a3025485b)
2007-10-10 13:18:15 -05:00
Andrew Tridgell
6be47e9bc2 r7597: removed the bogus get_myfullname() and get_mydomname() calls, and put
them in the ntlmssp code, which is the only place they are
used. Andrew, please remove them completely once you have some more
reliable way to get this info

they are bogus as gethostname() may give us a short hostname (and does
on lot of systems), so the calls often give totally the wrong result
anyway
(This used to be commit 35ec292f86)
2007-10-10 13:18:12 -05:00
Stefan Metzmacher
33bbe2b9e1 r7536: doesn't spam the smbd_log in the build_farm...
metze
(This used to be commit 9f4ed54c58)
2007-10-10 13:18:07 -05:00
Andrew Bartlett
e9fa8f7cce r7509: With the update to Heimdal 20050612 we no longer need krb5_freelog(),
as krb5_closelog() no longer leaks memory.

Andrew Bartlett
(This used to be commit b0bf8a4a5f)
2007-10-10 13:18:02 -05:00
Andrew Tridgell
bce8cda061 r7352: the internal heimdal build change. This changes quite a few things:
- if you want kerberos now, you need to unpack a lorikeet heimdal
   tree in source/heimdal/. If source/heimdal/ does not exist at
   configure time then all kerberos features are disabled. You cannot
   use an external kerberos library for now. That may change later.

 - moved lib/replace/ config stuff to lib/replace/ and create a
   lib/replace/replace.h. That allows the heimdal build to use our
   portability layer, and prevenets duplicate definitions of functions
   like strlcat()

 - if you do enable heimdal, then you will need to do 'make
   HEIMDAL_EXTERNAL' before you build Samba. That should be fixed once
   I explain the problem to jelmer (the problem is the inability to
   set a depend without also dragging in the object list of the
   dependency. We need this for building the heimdal asn1 compiler and
   et compiler.

 - disabled all of the m4 checks for external kerberos libraries. I
   left them in place in auth/kerberos/, but disabled it in
   configure.in

some of the heimdal_build/ code is still very rough, for example I
don't correctly detect the correct awk, flex, bison replacements for
heimdal_build/build_external.sh. I expect to fix that stuff up over
the next few days.
(This used to be commit d4648249b2)
2007-10-10 13:17:45 -05:00
Andrew Bartlett
8107bdec7b r7306: Use a consistant #define for detecting support for the Heimdal krb5
log redirection code.

Andrew Bartlett
(This used to be commit 93335d587d)
2007-10-10 13:17:39 -05:00
Stefan Metzmacher
2c499fe5aa r7303: autodetect the libkdc and our kdc support
btw: I use this for configuring heimdal

>>>
CONFIG="CFLAGS=\"-g -O -Wall -Wstrict-prototypes -Wpointer-arith -Wcast-align -Wwrite-strings -Wdeclaration-after-statement\" \
	CC=gcc-4.0 \
	./configure -C --prefix=$HOME/prefix/heimdal-test \
	--sysconfdir=/etc \
	--enable-shared=no \
	--with-ldb=$HOME/prefix/ldb \
	--without-openldap \
	--without-openssl $@"

echo $CONFIG
eval $CONFIG
>>>

maybe you also want to use --disable-berkeley-db

metze
(This used to be commit 2aec140e00)
2007-10-10 13:17:39 -05:00
Andrew Bartlett
2e787b5b17 r7291: Additional notes on what we require from a kerberos implementation.
Andrew Bartlett
(This used to be commit a8d3493b6f)
2007-10-10 13:17:37 -05:00
Andrew Bartlett
e168c5fefa r7285: It appears that MIT Kerberos does not have the log redirection
facility that I'm using. This should let us compile the non-KDC
components on MIT again.

Andrew Bartlett
(This used to be commit ae9c2d2b54)
2007-10-10 13:17:36 -05:00
Andrew Bartlett
d26f46f72c r7270: A big revamp to the way we handle kerberos errors in Samba4. We now
fill in the function pointers to handle the logging, and catch all the
kerberos warnings. (Currently at level 3).

To avoid a memory leak, this requries a new function: krb5_freelog(),
which I've added to lorikeet/heimdal.

This also required a revamp to how we handle the krb5_context, so as
to make it easier to handle with talloc destructors.

Andrew Bartlett
(This used to be commit 63272794c4)
2007-10-10 13:17:34 -05:00
Andrew Bartlett
8cd92242b9 r7269: talloc_steal() is preferred where possible, as it can't fail and does
not have some of the issues of talloc_reference().

Andrew Bartlett
(This used to be commit 2fb413355a)
2007-10-10 13:17:34 -05:00
Andrew Bartlett
5112e38393 r7258: Fix the final linking error with libkdc - we need to link libhdb as well.
With this fix, I can request tickets from our built-in KDC!

Andrew Bartlett
(This used to be commit d7cd76013b)
2007-10-10 13:17:32 -05:00
Andrew Bartlett
7ea6543ce5 r7257: Ensure the error message can never be uninitialised.
Andrew Bartlett
(This used to be commit fdd964582a)
2007-10-10 13:17:32 -05:00
Simo Sorce
6a71fa86fb r7242: typo
(This used to be commit 4444585f06)
2007-10-10 13:17:31 -05:00
Andrew Bartlett
089b538163 r7241: The KDC almost links...
Using current lorikeet/heimdal, and with the KDC module enabled (it is
disabled by default), I almost get the KDC to link.

(To enable the KDC for testing, comment out the only line in
smbd/config.m4, and add 'kdc' to the 'server services' line in
smb.conf).
(This used to be commit 26cd4b4f68)
2007-10-10 13:17:30 -05:00
Andrew Bartlett
752ffdf49c r7240: Don't call our fancy error message routines on a null context.
Andrew Bartlett
(This used to be commit 35877387c8)
2007-10-10 13:17:30 -05:00
Simo Sorce
a27609822b r7233: what about filling that new element ?
(This used to be commit 6a5e48c35c)
2007-10-10 13:17:29 -05:00
Simo Sorce
d870c3481e r7232: add some more auth stuff
enables us to authenticate against system users (only PAM support right now)
(This used to be commit 0c894de58b)
2007-10-10 13:17:29 -05:00
Simo Sorce
0b4a3021e1 r7224: add some more usefull data to the auth_usersupplied_info struct
(This used to be commit e40c44e9cd)
2007-10-10 13:17:28 -05:00
Andrew Bartlett
8c4733b412 r7219: Don't allow 'binding' to be used uninitilaised.
Andrew Bartlett
(This used to be commit 3dd730fbc8)
2007-10-10 13:17:27 -05:00
Andrew Bartlett
b910a7c5e3 r7218: Don't use an uninitialised variable in an error message.
Andrew Bartlett
(This used to be commit 1f68cf7d0e)
2007-10-10 13:17:27 -05:00
Tim Potter
4888823524 r6939: Get rid of SUBSYSTEM::NDR since all it did was require NDR_RAW.
(This used to be commit e077d9948f)
2007-10-10 13:16:59 -05:00
Andrew Bartlett
db169af3b7 r6883: Move to what simo assures me is the 'correct' way to find the NetBIOS
and long names for a domain.

Add servicePrincipalName mapping table (administrator configurable),
in the same spot as microsoft uses.

Andrew Bartlett
(This used to be commit c25e78b4b3)
2007-10-10 13:16:55 -05:00
Andrew Bartlett
ab92b82d83 r6882: Put in configure tests and #ifdef to keep Samba building on older Heimdal.
Andrew Bartlett
(This used to be commit f2e9261925)
2007-10-10 13:16:54 -05:00
Jelmer Vernooij
e73d051e20 r6839: Add support for building subsystems as shared libraries. This can be
done by setting:
OUTPUT_TYPE = SHARED_LIBRARY
in the [SUBSYSTEM::...] section belonging to a subsystem.

The idea is to allow multiple values to OUTPUT_TYPE simultaneously
(e.g. OUTPUT_TYPE = SHARED_LIBRARY, STATIC_LIBRARY, OBJLIST )
(This used to be commit b9d0ae93ba)
2007-10-10 13:16:50 -05:00
Jelmer Vernooij
29a8069aee r6838: Remove unnecessary calls to gensec_gsskrb5
Make the build system give a proper warning about this in the future
(This used to be commit 2d980465af)
2007-10-10 13:16:49 -05:00
Andrew Bartlett
e29cb65a90 r6819: More notes on krb5 requirements
Andrew Bartlett
(This used to be commit dbd8459987)
2007-10-10 13:16:47 -05:00
Tim Potter
d441930987 r6810: Rename auth/{ntlmssp,gensec,kerberos} mk and m4 files to be called
config.mk and config.m4 to be consistent with the rest of Samba.
(This used to be commit f377c71e4f)
2007-10-10 13:16:46 -05:00
Jelmer Vernooij
3184d47c42 r6805: Remove two remaining references to gensec_gsskrb5
(This used to be commit a02e077397)
2007-10-10 13:16:45 -05:00
Andrew Bartlett
1d0e2b9569 r6803: Try to bring in the correct GSSAPI headers for the krb5 mech. This
should allow us to ditch the local static storage for OIDs, as well as
fix the build on non-heimdal platforms.

Andrew Bartlett
(This used to be commit a7e2ecfac9)
2007-10-10 13:16:45 -05:00
Andrew Bartlett
c71a11c7ad r6801: It appears that krb5_make_principal, while convenient, is not portable.
Andrew Bartlett
(This used to be commit c8e8fa129e)
2007-10-10 13:16:45 -05:00
Andrew Bartlett
5c6dd5e800 r6800: A big GENSEC update:
Finally remove the distinction between 'krb5' and 'ms_krb5'.  We now
don't do kerberos stuff twice on failure.  The solution to this is
slightly more general than perhaps was really required (as this is a
special case), but it works, and I'm happy with the cleanup I achived
in the process.  All modules have been updated to supply a
NULL-terminated list of OIDs.

In that process, SPNEGO code has been generalised, as I realised that
two of the functions should have been identical in behaviour.

Over in the actual modules, I have worked to remove the 'kinit' code
from gensec_krb5, and placed it in kerberos/kerberos_util.c.

The GSSAPI module has been extended to use this, so no longer requires
a manual kinit at the command line.  It will soon loose the
requirement for a on-disk keytab too.

The general kerberos code has also been updated to move from
error_message() to our routine which gets the Heimdal error string
(which may be much more useful) when available.

Andrew Bartlett
(This used to be commit 0101728d8e)
2007-10-10 13:16:45 -05:00
Andrew Bartlett
8f96c42027 r6799: Remove a rudundent variable from the context structure - we can figure
this out by asking GENSEC, just like everybody else.

Andrew Bartlett
(This used to be commit 0268d6c46b)
2007-10-10 13:16:45 -05:00
Rafal Szczesniak
2c08639e02 r6797: Typo fix.
rafal
(This used to be commit 0f9a2aef6c)
2007-10-10 13:16:44 -05:00
Andrew Bartlett
50da9ed856 r6796: Remove the gensec_gsskrb5 module, which had had all of it's special
features merged back into gensec_gssapi.

(Removed because I've made some API changes, and it isn't worth
'fixing' the rudundent code to cope with changes)

Andrew Bartlett
(This used to be commit e8cf3d58ec)
2007-10-10 13:16:44 -05:00
Jelmer Vernooij
5b18cf2268 r6795: Make some functions static and remove some unused ones.
(This used to be commit 46509eb899)
2007-10-10 13:16:44 -05:00
Simo Sorce
51b0f62b8f r6794: spellfix
(This used to be commit f5956d1501)
2007-10-10 13:16:44 -05:00
Andrew Bartlett
ae0cf9c240 r6793: Move auth_sam to use the dnsDomain rather than the
soon-to-be-depricated 'realm'.

Add torture test for this behaviour.

Andrew Bartlet
(This used to be commit 6b9020661a)
2007-10-10 13:16:44 -05:00
Andrew Bartlett
c0c1b26a76 r6792: Allow a mech to fail on the first pass at the packet, and still fall
back to the other options.

Andrew Bartlett
(This used to be commit 9153d73061)
2007-10-10 13:16:43 -05:00
Andrew Bartlett
4f9fa5a81d r6791: My early notes on the particular things I have discovered as I learn
kerberos, and how Microsoft constructs their kerberos implementation.

Andrew Bartlett
(This used to be commit 5fa9be75d9)
2007-10-10 13:16:43 -05:00
Tim Potter
8aa0aec431 r6767: Fix compiler warning.
(This used to be commit 45a0692be1)
2007-10-10 13:16:42 -05:00
Andrew Tridgell
3da16200e9 r6740: make gensec_gssapi.c compile again
(This used to be commit 6d15e95111)
2007-10-10 13:16:40 -05:00
Andrew Bartlett
c64ac2fc5a r6738: My version of the patch by metze that I just reverted (-r 6734).
This also includes other changes to reduce memory use by GENSEC when
not being used for sign/seal operations.  This should lower tridge's K
'per connection' benchmark further.

Andrew Bartlett
(This used to be commit 4a5829401b)
2007-10-10 13:16:40 -05:00
Andrew Bartlett
0aef77698e r6737: Explain these error returns a bit better.
Andrew Bartlett
(This used to be commit 77d054c65a)
2007-10-10 13:16:40 -05:00
Andrew Bartlett
d4d4d66828 r6736: Revert metze's -r 6734, as metze and I made the same changes at the
same time, but with different names.  This just helps me avoid
conflicts when I merge up my other changes.

Andrew Bartlett
(This used to be commit 27e6a853a5)
2007-10-10 13:16:39 -05:00
Stefan Metzmacher
3bdd579f55 r6734: most compiler don't like struct elements without a name...
metze
(This used to be commit 0c1cd40bce)
2007-10-10 13:16:39 -05:00
Stefan Metzmacher
470f14ece2 r6733: GSS_C_DCE_STYLE is not available for most builds
metze
(This used to be commit 3536029e8f)
2007-10-10 13:16:39 -05:00
Stefan Metzmacher
15e84f47c5 r6730: register gensec_krb5 also with the drcrpc auth type
metze
(This used to be commit 491d7804f5)
2007-10-10 13:16:39 -05:00
Andrew Bartlett
976fc6f76a r6729: Fix silly copy-paste bug spotted by metze.
Andrew Bartlett
(This used to be commit 400899995b)
2007-10-10 13:16:39 -05:00
Andrew Bartlett
dc3cb69a09 r6728: Microsoft relies very strongly on getting the OIDs it expects, so we
must register the 'MS' OID for the domain join to progress.

Andrew Bartlett
(This used to be commit c8fbda6bfd)
2007-10-10 13:16:38 -05:00
Andrew Bartlett
8b2eb02d15 r6727: One more step down the long march to the 'Kerberos domain join'.
This patch allows a suitably patched Heimdal GSSAPI library (detected
in configure) to supply to us the session keys, and further compleats
the gensec_gssapi module.  This is tested for CIFS, but fails for LDAP
at this point (that is what I'll work on next).

We currently fill out the 'session info' from the SAM, like
gensec_krb5 does, but both will need to use the PAC extraction
functions in the near future.

Andrew Bartlett
(This used to be commit 937ee36161)
2007-10-10 13:16:38 -05:00
Andrew Bartlett
369c53ccf4 r6711: Clarify that we are dealing with a salting principal in the kerberos
code, which is certainly not in the form of machine$.

Rework the default salt to match what I just added to the heimdal
server (Samba4 is back on speaking terms with lorikeet heimdal now),
from Luke Howard's post to samba-technical in Nov 2004.

Now to test compatability with MS...

Andrew Bartlett
(This used to be commit d719a0093b)
2007-10-10 13:16:37 -05:00
Stefan Metzmacher
fa24196d0d r6705: let the gensec module decide if messages can be signed and sealed in a different
order than a strict request - reply sequence

Note: we should also fix the client code...

metze
(This used to be commit 0a61d1f651)
2007-10-10 13:16:36 -05:00
Stefan Metzmacher
0b3e651e05 r6704: fix compiler warning
metze
(This used to be commit 9d86314c44)
2007-10-10 13:16:36 -05:00
Stefan Metzmacher
34ae3b1604 r6703: fix the build
metze
(This used to be commit 333f9bdf58)
2007-10-10 13:16:36 -05:00
Andrew Bartlett
a21b7de463 r6701: Updates to our server-side ticket verification code, we now use the
client credentials code to read the secrets.ldb.

Also clean up error handling, and ensure to always set the
last_error_message stuff.

Andrew Bartlett
(This used to be commit 435d229e5d)
2007-10-10 13:16:36 -05:00
Andrew Bartlett
69f3a934d7 r6700: Upper case realms in kerberos-specific parts of the code, as this is
no longer done globally.

This keeps MIT client libraries happy, because otherwise the windows
KDC will return a different case to what was requested.

Andrew Bartlett
(This used to be commit 9098b9321f)
2007-10-10 13:16:35 -05:00
Andrew Tridgell
f597d6df59 r6620: the type 23 schannel bind uses a workstation name, not an account name
(This used to be commit 250f1f69dd)
2007-10-10 13:16:31 -05:00
Tim Potter
8bcfc14d64 r6610: Fix a const warning in the gensec spnego implementation. (A make proto
is required after updating to this version).
(This used to be commit 258d03ef92)
2007-10-10 13:16:30 -05:00
Andrew Bartlett
85e9412c47 r6565: Cludge, cludge, cludge...
We need to pass the 'secure channel type' to the NETLOGON layer, which
must match the account type.

(Yes, jelmer objects to this inclusion of the kitchen sink ;-)

Andrew Bartlett
(This used to be commit 8ee208a926)
2007-10-10 13:16:26 -05:00
Andrew Bartlett
bb6e2059ee r6544: Use common structures between SAMR, NETLGON and the Krb5 PAC.
Fill out the group list for the SamLogon reply, so clients get the
supplementary groups.

Andrew Bartlett
(This used to be commit d9c31e60a7)
2007-10-10 13:16:24 -05:00
Andrew Bartlett
d3481b160c r6522: I have no idea why this change was made, but it not only breaks
connections to Win2k3, it doesn't match the well-known behaviour from
samba3.

Andrew Bartlett
(This used to be commit 99c9afe45a)
2007-10-10 13:16:22 -05:00
Tim Potter
cba367d001 r6521: Include system/network.h to fix compiler warning.
(This used to be commit 45383f6cec)
2007-10-10 13:16:22 -05:00
Andrew Bartlett
4aaffcf866 r6498: Add comments in line with those I already added to 3.0.
Please don't re-invent security=server :-)

Andrew Bartlett
(This used to be commit b3a38e9c8c)
2007-10-10 13:16:19 -05:00
Stefan Metzmacher
a09593c37a r6484: fix NTLMSSP client against w2k and w2k3
if we use lm_response = data_blob(NULL, 0);

we got NT_STATUS_INVALID_PARAMETER

(abartlet: we should maybe also give this error in our server code)

metze
(This used to be commit be5e301442)
2007-10-10 13:16:19 -05:00
Tim Potter
3edf40cd49 r6466: Spelling.
(This used to be commit 764b967926)
2007-10-10 13:11:39 -05:00
Andrew Bartlett
9c0647ddca r6465: Use talloc_zero for the gensec_ntlmssp_state structure, as the history
of this code has too many pre-zeroed structure assumptions.

Remove unused 'stub' functions

Andrew Bartlett
(This used to be commit 78dc57c655)
2007-10-10 13:11:39 -05:00
Andrew Bartlett
8b0e09e24f r6464: Remove the last of the Samba3 NTLMSSP API. This removes the rudundent
struct ntlmssp_state, and pushes all the member elements into struct
gensec_ntlmssp_state.

This also removes the 2-layer start function, caused by the previous
double abstraction layer.

Andrew Bartlett
(This used to be commit eebbb4205b)
2007-10-10 13:11:39 -05:00
Andrew Bartlett
f5a8054f26 r6463: Move NTLM2 and NTLM (v1) specific variables into a union for DCE/RPC.
Andrew Bartlett
(This used to be commit 227f2578da)
2007-10-10 13:11:39 -05:00
Andrew Bartlett
0501a440be r6462: Move the arcfour sbox state into it's own structure, and allocate it
with talloc() for the NTLMSSP system.

Andrew Bartlett
(This used to be commit 7a93ac49c2)
2007-10-10 13:11:39 -05:00
Andrew Bartlett
874cd2db86 r6460: Push the client credentials into NTLMSSP, allowing logins of the form
user@REALM for the first time.

Fix the build for smbencrypt.c

Andrew Bartlett
(This used to be commit 5a6a57cd93)
2007-10-10 13:11:39 -05:00
Andrew Bartlett
3045ecfa1d r6458: Split up NTLMSSP into a new directory, and into seperate files for the
client and server logic code.  In future, this may allow us to build
only the NTLMSSP client, and not the server, but in the short-term, it
allows me greater sainity in moving around these files.

Andrew Bartlett
(This used to be commit 2f22841c67)
2007-10-10 13:11:38 -05:00
Andrew Bartlett
4c6db04124 r6455: Remove wrapper functions, and ntlmssp_end (which is well handed by talloc() now).
Andrew Bartlett
(This used to be commit fc3e3653eb)
2007-10-10 13:11:38 -05:00
Andrew Bartlett
53079da638 r6454: Start to migrate NTLMSSP away from it's own API to just use GENSEC.
The aim here is to remove the extra layer of abstraction, and to then
use the credentials code directly in the NTLMSSP layer.

Andrew Bartlett
(This used to be commit b14c530dfd)
2007-10-10 13:11:38 -05:00
Andrew Bartlett
a2abd01cca r6453: Move verbose errors for the schannel 'not in the DB, or DB corrupt' error cases.
Andrew Bartlett
(This used to be commit 24f98f32aa)
2007-10-10 13:11:38 -05:00
Tim Potter
932803d3ce r6359: Fix compiler warning with struct sockaddr. I'm sure I fixed this a few
weeks ago - weird.
(This used to be commit 1738761d89)
2007-10-10 13:11:34 -05:00
Andrew Tridgell
9bf2c69401 r6340: - added an easy to use function to initialise a temporary ldb with some ldif
- init the schannel.ldb with some CASE_INSENSITIVE attributes
(This used to be commit e6376b2430)
2007-10-10 13:11:33 -05:00
Tim Potter
481e80afc4 r6322: Fix compile warning for struct sockaddr.
(This used to be commit 9c45f8d7bc)
2007-10-10 13:11:31 -05:00
Stefan Metzmacher
4581134bf5 r6128: fix the build
metze
(This used to be commit 8059315034)
2007-10-10 13:11:20 -05:00
Andrew Bartlett
7cabdeb7ec r6113: Move GENSEC and the kerberos code out of libcli/auth, and into
auth/gensec and auth/kerberos.

This also pulls the kerberos configure code out of libads (which is
otherwise dead), and into auth/kerberos/kerberos.m4

Andrew Bartlett
(This used to be commit e074d63f3d)
2007-10-10 13:11:20 -05:00
Andrew Bartlett
2eb3d68062 r6028: A MAJOR update to intergrate the new credentails system fully with
GENSEC, and to pull SCHANNEL into GENSEC, by making it less 'special'.

GENSEC now no longer has it's own handling of 'set username' etc,
instead it uses cli_credentials calls.

In order to link the credentails code right though Samba, a lot of
interfaces have changed to remove 'username, domain, password'
arguments, and these have been replaced with a single 'struct
cli_credentials'.

In the session setup code, a new parameter 'workgroup' contains the
client/server current workgroup, which seems unrelated to the
authentication exchange (it was being filled in from the auth info).

This allows in particular kerberos to only call back for passwords
when it actually needs to perform the kinit.

The kerberos code has been modified not to use the SPNEGO provided
'principal name' (in the mechListMIC), but to instead use the name the
host was connected to as.  This better matches Microsoft behaviour,
is more secure and allows better use of standard kerberos functions.

To achieve this, I made changes to our socket code so that the
hostname (before name resolution) is now recorded on the socket.

In schannel, most of the code from librpc/rpc/dcerpc_schannel.c is now
in libcli/auth/schannel.c, and it looks much more like a standard
GENSEC module.  The actual sign/seal code moved to
libcli/auth/schannel_sign.c in a previous commit.

The schannel credentails structure is now merged with the rest of the
credentails, as many of the values (username, workstation, domain)
where already present there.  This makes handling this in a generic
manner much easier, as there is no longer a custom entry-point.

The auth_domain module continues to be developed, but is now just as
functional as auth_winbind.  The changes here are consequential to the
schannel changes.

The only removed function at this point is the RPC-LOGIN test
(simulating the load of a WinXP login), which needs much more work to
clean it up (it contains copies of too much code from all over the
torture suite, and I havn't been able to penetrate its 'structure').

Andrew Bartlett
(This used to be commit 2301a4b38a)
2007-10-10 13:11:15 -05:00
Andrew Bartlett
79f6bcd5ae r5988: Fix the -P option (use machine account credentials) to use the Samba4
secrets system, and not the old system from Samba3.

This allowed the code from auth_domain to be shared - we now only
lookup the secrets.ldb in lib/credentials.c.

In order to link the resultant binary, samdb_search() has been moved
from deep inside rpc_server into lib/gendb.c, along with the existing
gendb_search_v().  The vast majority of this patch is the simple
rename that followed,

(Depending on the whole SAMDB for just this function seemed pointless,
and brought in futher dependencies, such as smbencrypt.c).

Andrew Bartlett
(This used to be commit e13c671619)
2007-10-10 13:11:12 -05:00
Andrew Bartlett
8307c19c78 r5985: Actually adding auth_domain.c in -r 5983 would probably have been a
good idea....

Andrew Bartlett
(This used to be commit 84b566a36b)
2007-10-10 13:11:12 -05:00
Andrew Bartlett
d735487aad r5983: Start support for being a domain member in Samba4.
This adds the auth_domain module to the auth subsystem, and cleans up
some small details around the join process (ensuring all the right
info is in the DB).

Andrew Bartlett
(This used to be commit 858cbfb821)
2007-10-10 13:11:12 -05:00
Andrew Bartlett
48e7cfbe1d r5895: Remove old auth_domain code - to be replaced with entirely new implementation.
Andrew Bartlett
(This used to be commit a16339729d)
2007-10-10 13:11:06 -05:00
Andrew Bartlett
42031bc4be r5668: Add tests to RPC-SAMLOGON to test for user@REALM style logins. These
need a NULL domain (or a "" domain, except this breaks NTLMv2, and I
need to look into it a bit more).

Add support to the Samba4 server for these logins.  This will need
extension when we handle trusted domains as a DC, as it is a principal
name, not just another format for the username.

Andrew Bartlett
(This used to be commit de02c7c222)
2007-10-10 13:10:58 -05:00
Andrew Tridgell
e82aad1ce3 r5298: - got rid of pstring.h from includes.h. This at least makes it a bit
less likely that anyone will use pstring for new code

 - got rid of winbind_client.h from includes.h. This one triggered a
   huge change, as winbind_client.h was including system/filesys.h and
   defining the old uint32 and uint16 types, as well as its own
   pstring and fstring.
(This used to be commit 9db6c79e90)
2007-10-10 13:09:38 -05:00
Stefan Metzmacher
d8d3a5ffe3 r5137: fix types
metze
(This used to be commit add1c57937)
2007-10-10 13:09:26 -05:00
Andrew Tridgell
f82a03b2c1 r4955: fixed a couple of minor memory leaks in the auth_sam code
(This used to be commit 2eba223bda)
2007-10-10 13:09:09 -05:00
Andrew Tridgell
61a3d370b9 r4758: - added async support to the session request code
- added async support to the negprot client code

- removed two unused parameters from smbcli_full_connection() code

- converted smbclient to use smbcli_full_connection() rather than
  reinventing everything itself
(This used to be commit 71cbe28734)
2007-10-10 13:08:50 -05:00
Stefan Metzmacher
46a32687da r4620: - add interface functions to the auth subsystem so that callers doesn't need to
use function pointers anymore
- make the module init much easier
- a lot of cleanups

don't try to read the diff in auth/ better read the new files

it passes test_echo.sh and test_rpc.sh

abartlet: please fix spelling fixes

metze
(This used to be commit 3c0d16b823)
2007-10-10 13:08:34 -05:00
Andrew Tridgell
11ce2cfd70 r4591: - converted the other _p talloc functions to not need _p
- added #if TALLOC_DEPRECATED around the _p functions

- fixes the code that broke from the above

while doing this I fixed quite a number of places that were
incorrectly using the non type-safe talloc functions to use the type
safe ones. Some were even doing multiplies for array allocation, which
is potentially unsafe.
(This used to be commit 6e7754abd0)
2007-10-10 13:08:30 -05:00
Andrew Bartlett
56df264cf8 r4566: Fix Samba4 to pass it's own RPC-SAMLOGON torture test.
Include RPC-SAMLOGON in the list of tests expected to pass

Remove silly extra loops from the RPC-SAMLOGON test, which mostly just
slowed htings down.

Andrew Bartlett
(This used to be commit 518ca9fb69)
2007-10-10 13:08:28 -05:00
Andrew Bartlett
8eb981c90a r4499: Almost make our Samba4 server pass the RPC-SAMLOGON torture test.
I just need to fix a couple of NTLMv2 issues before we can fully pass,
and put this in test_rpc.sh, as a 'should pass' test.

Andrew Bartlett
(This used to be commit 4b52409e38)
2007-10-10 13:08:15 -05:00
Stefan Metzmacher
b5b1c52a98 r4419: move security_token stuff to the libcli/security/
and debug privileges

metze
(This used to be commit c981808ed4)
2007-10-10 13:07:47 -05:00
Stefan Metzmacher
9be2e63315 r4339: - rename auth_guest to auth_anonymous
- don't use static const strings in the server_info

- fix segfault when auth_sam gets "" as username

metze
(This used to be commit 7fcbd483d4)
2007-10-10 13:07:36 -05:00
Andrew Tridgell
adbdb055ee r4151: added privilege attribute handling on samdb.
pvfs will now honor some privileges on ACLs, and it will be quite easy
to add the checks for more privileges in the necessary places, by
making calls to sec_privilege_check().
(This used to be commit 3549039d0f)
2007-10-10 13:07:19 -05:00
Andrew Tridgell
6ca874f71a r4147: converted from NT_USER_TOKEN to struct security_token
this is mostly just a tidyup, but also adds the privilege_mask, which
I will be using shortly in ACL checking.

note that I had to move the definition of struct security_token out of
security.idl as pidl doesn't yet handle arrays of pointers, and the
usual workaround (to use a intermediate structure) would make things
too cumbersome for this structure, especially given we never encode it
to NDR.
(This used to be commit 7b446af09b)
2007-10-10 13:06:31 -05:00
Andrew Tridgell
9defca2895 r4072: - changed the names of some of the well known sids to be more consistent
- added string constants for the important privileges.
(This used to be commit d5bc706140)
2007-10-10 13:06:22 -05:00
Andrew Tridgell
6e6374cb5b r4055: fixed more places to use type safe allocation macros
(This used to be commit eec698254f)
2007-10-10 13:06:20 -05:00
Andrew Tridgell
58c326809a r4052: fixed a bunch of code to use the type safe _p allocation macros
(This used to be commit 80d15fa340)
2007-10-10 13:06:18 -05:00
Andrew Tridgell
4183b2ac38 r4037: fixed a bunch of "might be uninitialised" warnings after enabling -O1 in my compile
(This used to be commit 0928b1f5b6)
2007-10-10 13:06:16 -05:00
Stefan Metzmacher
15543f18ac r4000: DATA_BLOB.data is uint8_t * not void * :-)
(thanks abartlet for telling me)

metze
(This used to be commit 2783bf393f)
2007-10-10 13:06:13 -05:00
Stefan Metzmacher
5cbc9574a6 r3970: fix compiler warning
metze
(This used to be commit 1f03d79712)
2007-10-10 13:06:09 -05:00
Jelmer Vernooij
d95a256d1b r3881: Split up the LIBNDR_GEN subsystem into NDR_* and RPC_NDR_* subsystems.
This reduces the total size of the samba binaries from 119 Mb to 73 Mb.
Next step will be to have the build system obtain some of this information
by itself, so that we don't have to write ~10 lines per interface manually.
(This used to be commit 16d905f6b0)
2007-10-10 13:06:01 -05:00
Stefan Metzmacher
b307f18825 r3876: fix compiler warnings
metze
(This used to be commit 9ad3837dba)
2007-10-10 13:06:00 -05:00
Stefan Metzmacher
856ee66537 r3810: create a LIB_SECURITY subsystem
- move dom_sid, security_descriptor, security_* funtions to one place
  and rename some of them

metze
(This used to be commit b620bdd672)
2007-10-10 13:05:56 -05:00
Stefan Metzmacher
8a18778286 r3783: - don't use make proto for ldb anymore
- split ldh.h out of samba's includes.h

- make ldb_context and ldb_module private to the subsystem

- use ltdb_ prefix for all ldb_tdb functions

metze
(This used to be commit f5ee40d6ce)
2007-10-10 13:05:52 -05:00
Jelmer Vernooij
34ddb33b4b r3744: Support building subsystems as a shared library. Modules don't work yet,
so while this does compile, it does not work yet.
(This used to be commit 3d885562c9)
2007-10-10 13:05:50 -05:00
Jelmer Vernooij
31ded4901b r3737: - Get rid of the register_subsystem() and register_backend() functions.
- Re-disable tdbtool (it was building fine on my Debian box but other
					machines were having problems)
(This used to be commit 0d7bb2c40b)
2007-10-10 13:05:48 -05:00
Jelmer Vernooij
8e16d8a76f r3733: More build system fixes/features:
- Use .mk files directly (no need for a SMB_*_MK() macro when adding a new SUBSYSTEM, MODULE or BINARY). This allows addition of new modules and subsystems without running configure
 - Add support for generating .dot files with the Samba4 dependency tree (as used by the graphviz and springgraph utilities)
(This used to be commit 64826da834)
2007-10-10 13:05:47 -05:00
Andrew Tridgell
930f9090ba r3599: fixed a couple of memory errors in the rpc netlogon server
(found with valgrind)
(This used to be commit 151dd4593d)
2007-10-10 13:05:37 -05:00
Jelmer Vernooij
71db46ea66 r3586: Fix some of the issues with the module init functions.
Both subsystems and modules can now have init functions, which can be
specified in .mk files (INIT_FUNCTION = ...)

The build system will define :
 - SUBSYSTEM_init_static_modules that calls the init functions of all statically compiled modules. Failing to load will generate an error which is not fatal
 - BINARY_init_subsystems that calls the init functions (if defined) for the subsystems the binary depends on

This removes the hack with the "static bool Initialised = " and the
"lazy_init" functions
(This used to be commit 7a8244761b)
2007-10-10 13:05:36 -05:00
Andrew Tridgell
e1f38d8138 r3571: rough guesses at what abartlet really wanted to do in his last commit
(which I suspect was missing some pieces)

this at least fixes the build so i can keep going on pvfs. Please review/fix Andrew.
(This used to be commit bffd18d09d)
2007-10-10 13:05:32 -05:00
Andrew Bartlett
9ced859ac8 r3555: Fix auth_winbind to work with the new auth_util conversion code.
Andrew Bartlett
(This used to be commit 3215f1c6ce)
2007-10-10 13:05:32 -05:00
Andrew Bartlett
2b250bf7fd r3554: Use the new talloc_reference changes to simply the conversion of
returned validation information into the server_info struct.

Also allow for easier expansion to different variations on validation
levels.

Andrew Bartlett
(This used to be commit 316b74029c)
2007-10-10 13:05:31 -05:00
Andrew Tridgell
acc9f59c7f r3476: fixed some const warnings
(This used to be commit 7dc58dc01e)
2007-10-10 13:05:18 -05:00
Andrew Tridgell
3643fb1109 r3463: separated out some more headers (asn_1.h, messages.h, dlinklist.h and ioctl.h)
(This used to be commit b97e395c81)
2007-10-10 13:05:17 -05:00
Andrew Tridgell
a1d0b97ed4 r3462: separate out the crypto includes
(This used to be commit 3f75117db9)
2007-10-10 13:05:16 -05:00
Andrew Tridgell
edbfc0f6e7 r3453: - split out the auth and popt includes
- tidied up some of the system includes

- moved a few more structures back from misc.idl to netlogon.idl and samr.idl now that pidl
  knows about inter-IDL dependencies
(This used to be commit 7b7477ac42)
2007-10-10 13:05:13 -05:00
Andrew Tridgell
26c6b4c70b r3449: more include file reduction
the ldb part isn't ideal, I will have to think of a better solution
(This used to be commit 6b1f86aea8)
2007-10-10 13:05:13 -05:00
Andrew Tridgell
ead3508ac8 r3447: more include/system/XXX.h include files
(This used to be commit 264ce91810)
2007-10-10 13:05:12 -05:00
Andrew Tridgell
284349482f r3443: the next stage in the include files re-organisation.
I have created the include/system/ directory, which will contain the
wrappers for the system includes for logical subsystems. So far I have
created include/system/kerberos.h and include/system/network.h, which
contain all the system includes for kerberos code and networking code.
These are the included in subsystems that need kerberos or networking
respectively.

Note that this method avoids the mess of #ifdef HAVE_XXX_H in every C
file, instead each C module includes the include/system/XXX.h file for
the logical system support it needs, and the details are kept isolated
in include/system/

This patch also creates a "struct ipv4_addr" which replaces "struct
in_addr" in our code. That avoids every C file needing to import all
the system networking headers.
(This used to be commit 2e25c71853)
2007-10-10 13:05:11 -05:00
Andrew Tridgell
90067934cd r3428: switched to using minimal includes for the auto-generated RPC code.
The thing that finally convinced me that minimal includes was worth
pursuing for rpc was a compiler (tcc) that failed to build Samba due
to reaching internal limits of the size of include files. Also the
fact that includes.h.gch was 16MB, which really seems excessive. This
patch brings it back to 12M, which is still too large, but
better. Note that this patch speeds up compile times for both the pch
and non-pch case.

This change also includes the addition iof a "depends()" option in our
IDL files, allowing you to specify that one IDL file depends on
another. This capability was needed for the auto-includes generation.
(This used to be commit b8f5fa8ac8)
2007-10-10 13:05:09 -05:00
Andrew Bartlett
85796280f4 r3361: Allow Samba4 (I'm interested in ntlm_auth in particular) to use
Samba3's winbind.  This is also the start of domain membership code in
Samba4, as we now (partially) parse the info3, and use it like Samba3
does.

Andrew Bartlett
(This used to be commit c1b7303c1c)
2007-10-10 13:05:01 -05:00
Andrew Tridgell
9d055846f2 r3278: - rewrote the client side rpc connection code to use lib/socket/
rather than doing everything itself. This greatly simplifies the
  code, although I really don't like the socket_recv() interface (it
  always allocates memory for you, which means an extra memcpy in this
  code)

- fixed several bugs in the socket_ipv4.c code, in particular client
  side code used a non-blocking connect but didn't handle EINPROGRESS,
  so it had no chance of working. Also fixed the error codes, using
  map_nt_error_from_unix()

- cleaned up and expanded map_nt_error_from_unix()

- changed interpret_addr2() to not take a mem_ctx. It makes absolutely
  no sense to allocate a fixed size 4 byte structure like this. Dozens
  of places in the code were also using interpret_addr2() incorrectly
  (precisely because the allocation made no sense)
(This used to be commit 7f2c771b0e)
2007-10-10 13:04:49 -05:00
Andrew Tridgell
86bd884b1e r3269: fixed return value
(This used to be commit bc392d88b1)
2007-10-10 13:04:48 -05:00
Andrew Bartlett
596d2de763 r3190: When we don't have a PAC, do a lookup in the local ldb instead.
This required reworking the auth_sam code, so that it would export the
'name -> server_info' functionality.  It's a bit ugly from a modular
point of view, but it's what we have to do...

Fix up some of the code to better use the new talloc()

Andrew Bartlett
(This used to be commit 18e08b4497)
2007-10-10 13:04:38 -05:00
Andrew Bartlett
e5fc6dd0bb r3186: Use the properties of the new talloc() system to handle the auth
session info and server info structures.

Andrew Bartlett
(This used to be commit 5bdf391b3b)
2007-10-10 13:04:38 -05:00
Andrew Bartlett
4298624589 r3170: Add winbind client support back into Samba4. This is to allow
auth_winbind to work, and to therefore use the new ntlm_auth and
GENSEC in an otherwise Samba3 setup.

I'm not quite sure what fun-and games my svn cp caused as I merged
this from samba_3_0, but anyway...

Andrew Bartlett
(This used to be commit 5925b94a59)
2007-10-10 13:04:31 -05:00
Andrew Tridgell
7d32679e96 r2857: this commit gets rid of smb_ucs2_t, wpstring and fpstring, plus lots of associated functions.
The motivation for this change was to avoid having to convert to/from
ucs2 strings for so many operations. Doing that was slow, used many
static buffers, and was also incorrect as it didn't cope properly with
unicode codepoints above 65536 (which could not be represented
correctly as smb_ucs2_t chars)

The two core functions that allowed this change are next_codepoint()
and push_codepoint(). These functions allow you to correctly walk a
arbitrary multi-byte string a character at a time without converting
the whole string to ucs2.

While doing this cleanup I also fixed several ucs2 string handling
bugs. See the commit for details.

The following code (which counts the number of occuraces of 'c' in a
string) shows how to use the new interface:

size_t count_chars(const char *s, char c)
{
	size_t count = 0;

	while (*s) {
		size_t size;
		codepoint_t c2 = next_codepoint(s, &size);
		if (c2 == c) count++;
		s += size;
	}

	return count;
}
(This used to be commit 814881f0e5)
2007-10-10 12:59:39 -05:00
Andrew Tridgell
48f960ab47 r2856: fixed a minor memory leak in the auth code
(This used to be commit 1b3c7d9cfa)
2007-10-10 12:59:39 -05:00
Andrew Tridgell
9a415b723c r2798: get rid of a unnecessary static
(This used to be commit c3dfa7e828)
2007-10-10 12:59:35 -05:00
Andrew Tridgell
6b481af7f2 r2793: fixed the handling of primaryGroupID in auth_sam. There were two bugs,
the first was it didn't pass primaryGroupID as an attributed it
wanted, the second was it didn't cope with primaryGroupID not being
present.
(This used to be commit 8373bfcdec)
2007-10-10 12:59:34 -05:00
Andrew Tridgell
b2f1a29e43 r2710: continue with the new style of providing a parent context whenever
possible to a structure creation routine. This makes for much easier
global cleanup.
(This used to be commit e14ee428ec)
2007-10-10 12:59:25 -05:00
Andrew Tridgell
351ca44e8b r2674: I have realised that talloc() should have its context marked const, as
a const pointer really means that "the data pointed to by this pointer
won't change", and that is certainly true of talloc(). The fact that
some behind-the-scenes meta-data can change doesn't matter from the
point of view of const.

this fixes a number of const warnings caused by const data structures
being passed as talloc contexts. That will no longer generate a
warning.

also changed the talloc leak reporting option from --leak-check to
--leak-report, as all it does is generate a report on exit. A new
--leak-report-full option has been added that shows the complete tree
of memory allocations, which is is quite useful in tracking things down.

NOTE: I find it quite useful to insert talloc_report_full(ptr, stderr)
calls at strategic points in the code while debugging memory
allocation problems, particularly before freeing a major context (such
as the connection context). This allows you to see if that context has
been accumulating too much data, such as per-request data, which
should have been freed when the request finished.
(This used to be commit c60ff99c31)
2007-10-10 12:59:20 -05:00
Andrew Tridgell
5a064d4a62 r2669: convert make_user_info() and associated functions from malloc to talloc
(This used to be commit 278cef77f0)
2007-10-10 12:59:19 -05:00
Andrew Tridgell
3ea916b227 r2654: fixed some more server memory leaks. We are now down to a single leak
of 16 bytes, caused by the 16 byte data_blob in the smb_signing
code.
(This used to be commit 2f1b788e09)
2007-10-10 12:59:17 -05:00
Andrew Tridgell
df6dce1065 r2650: fixed a memory leak in make_server_info()
(This used to be commit 4aba6e7101)
2007-10-10 12:59:16 -05:00
Andrew Tridgell
9a62dce0ac r2648: - use a destructor on struct server_connection to simplify the
connection termination cleanup, and to ensure that the event
  contexts are properly removed for every process model

- gave auth_context the new talloc treatment, which removes another
  source of memory leaks.
(This used to be commit 230e1cd777)
2007-10-10 12:59:16 -05:00
Andrew Tridgell
6bea5bea4c r2643: convert more of the auth subsyystem to the new talloc methods. This
also fixes a memory leak found with --leak-check.
(This used to be commit f19201ea27)
2007-10-10 12:59:15 -05:00
Andrew Tridgell
30381686c4 r2621: - now that the client code is non-blocking, we no longer need
write_data and read_data, which are inherently blocking operations

- got rid of some old NBT keepalive routines that are not needed
(This used to be commit e73b4ae4e5)
2007-10-10 12:59:12 -05:00
Andrew Bartlett
964d46138d r2543: Catch one more use of sub_get_remote_machine().
Andrew Bartlett
(This used to be commit d483d88674)
2007-10-10 12:59:04 -05:00
Andrew Bartlett
cde9a48dfb r2513: Avoid strupper/strlower when you can. This developers module
certainly doesn't need it.

Andrew Bartlett
(This used to be commit 77d7c76c9b)
2007-10-10 12:59:00 -05:00
Andrew Bartlett
f9d4bd1868 r2505: Remove unused function. If/when we implement plaintext authenticaton
in Samba4, I want to redo this.

Andrew Bartlett
(This used to be commit 139cc702ac)
2007-10-10 12:58:59 -05:00
Andrew Tridgell
44090f273c r2431: got rid of strnequal() in a couple of places
(This used to be commit a1b5880b2e)
2007-10-10 12:58:52 -05:00
Andrew Tridgell
833a896f56 r2104: fixed typo that causes a segv
(This used to be commit e37a4c1a63)
2007-10-10 12:58:25 -05:00
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 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 Tridgell
326f562e72 r1982: i is not initialised or used
(This used to be commit db4bc88f9a)
2007-10-10 12:58:14 -05:00
Stefan Metzmacher
c5fbb6f23c r1654: rename cli_ -> smbcli_
rename CLI_ -> SMBCLI_

metze
(This used to be commit 8441750fd9)
2007-10-10 12:57:47 -05:00
Andrew Tridgell
90fbb2d01f r1518: check for ldb_search giving -1 (indicating db corruption)
(This used to be commit 9af821c4df)
2007-10-10 12:57:38 -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
45a85bdd35 r1486: commit the start of the generic server infastructure
the idea is to have services as modules (smb, dcerpc, swat, ...)

the process_model don't know about the service it self anymore.

TODO:
- the smbsrv should use the smbsrv_send function
- the service subsystem init should be done like for other modules
- we need to have a generic socket subsystem, which handle stream, datagram,
  and virtuell other sockets( e.g. for the ntvfs_ipc module to connect to the dcerpc server
  , or for smb or dcerpc or whatever to connect to a server wide auth service)
- and other fixes...

NOTE: process model pthread seems to be broken( but also before this patch!)

metze
(This used to be commit bbe5e00715)
2007-10-10 12:57:35 -05:00
Andrew Bartlett
b62e6f1ec1 r1461: ntlm_check.c is a server-side peice of code, so it belongs in AUTH.
Andrew Bartlett
(This used to be commit 67ac960066)
2007-10-10 12:57:32 -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
Stefan Metzmacher
92ca39eff6 r1334: remove unused stuff
metze
(This used to be commit 7a8786269b)
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
Andrew Bartlett
fe0706d5d5 r1292: Add const to the subsystem/module registration code.
Add some 'multi init' code, until we get a better set of infrustructure.

Andrew Bartlett
(This used to be commit 982422b2d2)
2007-10-10 12:56:49 -05:00
Andrew Tridgell
f62fffb1c5 r1151: fixed fill-in of force_password_change field in auth_sam
(This used to be commit 9135f14540)
2007-10-10 12:56:41 -05:00
Andrew Tridgell
6c13c97ac2 r1146: initially zero server info
(This used to be commit c1aeaf97b3)
2007-10-10 12:56:40 -05:00
Andrew Tridgell
112fac1cde r1143: fixed spelling of sAMAccountName
(This used to be commit aadfbcee76)
2007-10-10 12:56:40 -05:00
Andrew Bartlett
0387684df6 r1142: I think this should fix the interactive logins for tridge - don't take
sizeof() a pointer...

Andrew Bartlett
(This used to be commit c1019e6df6)
2007-10-10 12:56:40 -05:00
Andrew Tridgell
c1e88ab8b2 r1138: allow for a user in no groups
(This used to be commit f9c1e12594)
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
Stefan Metzmacher
b717b40235 r1078: the dxesrv_crypto_* implementations should now explicit set
the dce_conn->auth_state.session_info
( the ntlmssp one works fine, but the schannel one isn't implemented yet)

this is also set by the ntvfs_ipc backend on the endpoint connect.

metze
(This used to be commit ad3dd1789e)
2007-10-10 12:56:37 -05:00
Stefan Metzmacher
6564fd402d r1067: fix compiler warnings
metze
(This used to be commit e5d338821e)
2007-10-10 12:56:36 -05:00
Andrew Bartlett
0d9e31cf16 r1063: userdom_struct dies!
(Cleanup unused header definitions)

Andrew Bartlett
(This used to be commit 5941873f55)
2007-10-10 12:56:36 -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 Bartlett
c455b0a935 r1028: More consistancy fixes, which should also fix the build.
Andrew Bartlett
(This used to be commit 0d2ae66d3a)
2007-10-10 12:56:30 -05:00
Andrew Bartlett
35af895350 r1027: More rename:
pwd -> password

(should fix the build).

Andrew Bartlett
(This used to be commit f9280f956e)
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 Bartlett
306fcbd063 r1023: Prepare the auth subsystem interfaces for netlogon SamLogon to use.
Andrew Bartlett
(This used to be commit b5fa2baaa9)
2007-10-10 12:56:28 -05:00
Andrew Bartlett
42b6b71493 r1021: Because auth_serversupplied_info is not reference counted, this may
only be called once per authentication.

Andrew Bartlett
(This used to be commit 9a5de8de95)
2007-10-10 12:56:28 -05:00
Andrew Bartlett
8de7e76e78 r1020: Add an (untested, until the other end is hooked in) method for
obtaining the session_info from an NTLMSSP authenticated user.

Andrew Bartlett
(This used to be commit 7961f1a18d)
2007-10-10 12:56:28 -05:00
Andrew Bartlett
0d466258be r1019: Push the auth subsystem away from using typedef, and over to the 'all
goodness and light' struct ;-)

Break apart the auth subsystem's return strucutres, into the parts
that a netlogon call cares about, and the parts that are for a local
session.  This is the 'struct session_info' and it will almost
completly replace the current information stored on a vuid, but be
generic to all login methods (RPC over TCP, for example).

Andrew Bartlett
(This used to be commit d199697014)
2007-10-10 12:56:28 -05:00
Stefan Metzmacher
8f84a98e29 r1001: in samba4 we don't(shouldn't) use typedef's anymore...
metze
(This used to be commit ac5f6f7e51)
2007-10-10 12:56:25 -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
Stefan Metzmacher
98d291423f r961: convert 'uchar' to 'uint8_t'
metze
(This used to be commit 9f914e4af9)
2007-10-10 12:56:23 -05:00
Stefan Metzmacher
45e93c19ef r943: change samba4 to use 'uint8_t' instead of 'unsigned char'
metze
(This used to be commit b5378803fd)
2007-10-10 12:56:21 -05:00
Andrew Tridgell
56e74a7c3f r924: got rid of the global well-known SIDs, instead using const defines in misc.idl
(This used to be commit ce7920a5fa)
2007-10-10 12:56:20 -05:00
Andrew Tridgell
39a236883e r904: - fixed account expiry testing in auth_sam
- added printf style format attribute checking to samdb varargs fns

- fix nt_time_to_unix() for zero and -1 times
(This used to be commit 41f9b144f9)
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 Bartlett
5b0ab386cb r874: This patch is a pile of work on NTLMSSP:
Samba's NTLMSSP code is now fully talloc based, which should go a long
way to cleaning up the memory leaks in this code.  This also avoids a
lot of extra copies of data, as we now allocate the 'return' blobs on
a caller-supplied context.

I have also been doing a lot of work towards NTLM2 signing and
sealing.  I have this working for sealing, but not for the verifier
(MD5 integrity check on the stream) which is still incorrect.

(I can aim a rpcecho sinkdata from a Win2k3 box to my server, and the
data arrives intact, but the signature check fails.  It does however
match the test values I have...).

The new torture test is cludged in - when we get a unit test suite
back, I'll happliy put it in the 'right' place....

Andrew Bartlett
(This used to be commit 399e2e2b11)
2007-10-10 12:56:14 -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
Stefan Metzmacher
454bba05df r850: convert SUBSYSTEM AUTH to a config.mk file
metze
(This used to be commit b29414bd23)
2007-10-10 12:56:11 -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
582ef8ea88 r751: Fix debug message to print the right variable.
Andrew Bartlett
(This used to be commit aa4b56a873)
2007-10-10 12:53:48 -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
Andrew Bartlett
6b921d1d21 r719: Follow the trend - remove more unused functions.
Andrew Bartlett
(This used to be commit 62eef851fd)
2007-10-10 12:53:45 -05:00
Andrew Bartlett
0f14ae46f3 r715: Finish the ldb conversion for the auth_sam module.
Andrew Bartlett
(This used to be commit 099151cdab)
2007-10-10 12:53:44 -05:00
Andrew Bartlett
c727f2ec5e r708: Clean up copyright headers, to reflect code that has come and gone
over time.

Andrew Bartlett
(This used to be commit 1a53e5c829)
2007-10-10 12:53:44 -05:00
Andrew Bartlett
d12e825042 r685: The SAM is dead! Long live the new SAM! ;-)
This commit kills passdb, which was only hosting the auth subsystem.

With the work tridge has done on Samba4's SAM backend, this can (and
now is) all hosted on ldb.  The auth_sam.c file now references this
backend.

You will need to assign your users passwords in ldb - adding a new line:

unicodePwd: myPass

to a record, using ldbedit, should be sufficient.  Naturally, this
assumes you have had your personal SAMR provisioning tutorial from
tridge.  Everybody else can still use the anonymous logins.

Andrew Bartlett
(This used to be commit 2aa0b55fb8)
2007-10-10 12:53:42 -05:00
Stefan Metzmacher
f236700ef6 r665: merge over the new build system from my tmp branch
to the main SAMBA_4_0 tree.

NOTE: that it's not completely ready, but it's functional:-)

metze
(This used to be commit c78a2ddb28)
2007-10-10 12:53:36 -05:00
Andrew Bartlett
bc8e2d5f23 r620: Remove more ununsed code.
Andrew Bartlett
(This used to be commit 795ace17a8)
2007-10-10 12:51:54 -05:00
Andrew Bartlett
c9bf9773e0 r619: Remove more code that is no longer called.
Andrew Bartlett
(This used to be commit 4e614cbe92)
2007-10-10 12:51:52 -05:00
Andrew Bartlett
c041077856 r614: Clean out the POSIX assumptions from the Samba4 auth subsystem.
This removes the code that tried to lookup posix groups, as well as
the code that was tied to the SAM_ACCOUNT.

This should make auth_ldb much easier to write :-)

Andrew Bartlett
(This used to be commit e096ee2112)
2007-10-10 12:51:51 -05:00
Andrew Bartlett
63a41d7d4d r448: Fix 'auth' in Samba4, by making 'auth methods' a normal smb.conf
paramter, without special links to other variables.

When we get 'server role' ideas back into Samba4, we can fix this properly.

The default is:

guest, sam_ignoredomain

which is the expected behaviour for a stand-alone server.

Andrew Bartlett
(This used to be commit 56ebc4275f)
2007-10-10 12:51:43 -05:00
Andrew Bartlett
9f084101dd r443: Update Samba4 to the auth and NTLMSSP code from Samba3.
Not all the auth code is merged - only those parts that are actually
being used in Samba4.

There is a lot more work to do in the NTLMSSP area, and I hope to
develop that work here.  There is a start on this here - splitting
NTLMSSP into two parts that my operate in an async fashion (before and
after the actual authentication)

Andrew Bartlett
(This used to be commit 5876c78806)
2007-10-10 12:51:42 -05:00
Andrew Tridgell
ac193579e7 r152: a quick airport commit ....
added ldbedit, a _really_ useful command

added ldbadd, ldbdel, ldbsearch and ldbmodify to build

solved lots of timezone issues, we now pass the torture tests with
client and server in different zones

fixed several build issues

I know this breaks the no-LDAP build. Wait till I arrive in San Jose for that
fix.
(This used to be commit af34710d4d)
2007-10-10 12:51:11 -05:00
Stefan Metzmacher
1c798aba40 - port AUTH and PASSDB subsystems to new
SMB_SUBSYSTEM() scheme

- some const fixes in ntvfs

metze
(This used to be commit af89a78123)
2004-02-03 11:10:56 +00:00
Andrew Tridgell
d009dc61f9 ntlmssp over rpc over tcp now fully works
I needed to hack the ntlmssp code a little, as the auth code in samba4
is out of date relative to the samba3 auth code. I need to do a merge :)
(This used to be commit 6ee0935afe)
2003-12-14 10:45:50 +00:00
Andrew Tridgell
16309de71d * the RPC-ECHO pipe now works in smbd, as long as the data sizes
don't cause fragmented pdus (I'll add fragments shortly)

 * change data_blob_talloc() to not zero memory when the 2nd argument
   is NULL. The zeroing just masks bugs, and can't even allow a DOS
   attack

 * modified pidl to ensure that [ref] arguments to the out side of
   functions are allocated when parsing the in side. This allows rpc
   backends to assume that [ref] variables are all setup. Doesn't work
   correctly for [ref] arrays yet

 * changed DLIST_ADD_END() to take the type instead of a tmp
   variable. This means you don't need to declare a silly tmp variable in
   the caller
(This used to be commit 46e0a35819)
2003-12-12 03:59:09 +00:00
Andrew Tridgell
7602aa50fd * got rid of UNISTR2 and everything that depends on it
* removed a bunch of code that needs to be rewritten using the new
    interfaces
(This used to be commit 9b02b486ef)
2003-12-01 00:17:30 +00:00
Andrew Tridgell
e0ac659917 signed DCERPC over TCP now works !
* moved ntlmssp code into libcli/auth/, and updated to latest ntlmssp
   code from samba3 (thanks Andrew! the new interface is great)

 * added signing/ntlmssp support in the dcerpc code

 * added a dcerpc_auth.c module for the various dcerpc auth mechanisms
(This used to be commit c18c9b5585)
2003-11-26 01:16:41 +00:00
Andrew Tridgell
d47d14f2ff reduced the number of magic types we need in mkproto.pl
In general I prefer "struct foo" to just "foo" for most
structures. There are exceptions.
(This used to be commit 04eb12b56c)
2003-11-23 01:53:54 +00:00
Andrew Tridgell
7fd381376f - a few portability fixes from Jim Myers
- added SMBD_LISTEN_BACKLOG in local.h

- added the beginnings of a ndr/rpc parsing framework for Samba4. It
  currently correctly parses security descriptors for the nttrans
  QUERY_SECDESC call, but I hope it will become a reasonable framework
  that an idl based generator can work to
(This used to be commit 9bf904fc34)
2003-10-30 08:32:26 +00:00
Herb Lewis
00743e97f8 cast to get rid of warnings
(This used to be commit cb7a9aef02)
2003-08-15 17:29:04 +00:00
Andrew Tridgell
ef2e26c91b first public release of samba4 code
(This used to be commit b0510b5428)
2003-08-13 01:53:07 +00:00