1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-31 17:18:04 +03:00
Commit Graph

625 Commits

Author SHA1 Message Date
Jelmer Vernooij
4ac2be9958 r13924: Split more prototypes out of include/proto.h + initial work on header
file dependencies
(This used to be commit 1228358767)
2007-10-10 13:52:24 -05:00
Andrew Bartlett
61fe79d022 r13910: Fix the 'your password has expired' on every login. We now consider
if the 'password does not expire' flag has been set, filling in the
PAC and netlogon reply correctly if so.

Andrew Bartlett
(This used to be commit c530ab5dc6)
2007-10-10 13:52:22 -05:00
Jelmer Vernooij
ba564a901e r13903: Don't generate prototypes for modules and binaries in include/proto.h by
default.
(This used to be commit c80a8f1102)
2007-10-10 13:52:21 -05:00
Jelmer Vernooij
c287cc247d r13851: More doc improvements.
(This used to be commit 936d26ae64)
2007-10-10 13:52:16 -05:00
Jelmer Vernooij
3bec2022eb r13844: Remove _PUBLIC_ for now as the proto script seems to make false assumptions
about the data type being known.
(This used to be commit 991bec80e4)
2007-10-10 13:52:15 -05:00
Jelmer Vernooij
c71c86c524 r13842: Make some more functions public.
(This used to be commit aac1b99b36)
2007-10-10 13:52:15 -05:00
Jelmer Vernooij
af30a32b69 r13840: Mark some functions as public.
(This used to be commit 9a188eb1f4)
2007-10-10 13:52:14 -05:00
Jelmer Vernooij
80c8a52286 r13655: Use new name of build header
(This used to be commit bca0e8054f)
2007-10-10 13:52:05 -05:00
Stefan Metzmacher
5f7b504cef r13619: fix compiler warning
metze
(This used to be commit 7b284174aa)
2007-10-10 13:52:01 -05:00
Andrew Bartlett
08195b0ed5 r13584: Another try at SPNEGO stuff. I need to write a better testsuite for this.
This tries to ensure that when we are a client, we cope with mechs
(like GSSAPI) that only abort (unknown server) at first runtime.

Andrew Bartlett
(This used to be commit cb5d18c619)
2007-10-10 13:51:58 -05:00
Andrew Bartlett
9d1954c25d r13583: Realise that the member server name appears in all calls that use the
credentials.

Consistantly rename these elements in the IDL to computer_name.

Fix the server-side code to always lookup by this name.

Add new, even nastier tests to RPC-SCHANNEL to prove this.

Andrew Bartlett
(This used to be commit 341a0abeb4)
2007-10-10 13:51:58 -05:00
Andrew Bartlett
26421fb2dc r13481: As far as I can tell, my changes in -r 12863 were dangerously untested.
We do need the gsskrb5_get_initiator_subkey() routine.  But we should
ensure that we do always get a valid key, to prevent any segfaults.

Without this code, we get a different session key compared with
Win2k3, and so kerberised smb signing fails.

Andrew Bartlett
(This used to be commit cfd0df16b7)
2007-10-10 13:51:55 -05:00
Andrew Bartlett
e7630ebe47 r13472: After Volker's advise, try every combination of parameters. This
isn't every parameter on NTLMSSP, but it is most of the important
ones.

This showed up that we had the '128bit && LM_KEY' case messed up.
This isn't supported, so we must look instead at the 56 bit flag.

Andrew Bartlett
(This used to be commit 990da31b5f)
2007-10-10 13:51:54 -05:00
Andrew Bartlett
e9e8096641 r13471: With more 'try all options' testing, I found this 'simple' but in the
NTLM2 signing code.

Andrew Bartlett
(This used to be commit 16e5c96875)
2007-10-10 13:51:54 -05:00
Andrew Bartlett
e218c8442d r13470: Thanks to a report from VL:
We were causing mayhem by weakening the keys at the wrong point in time.

I think this is the correct place to do it.  The session key for SMB
signing, and the 'smb session key' (used for encrypting password sets)
is never weakened.

The session key used for bulk data encryption/signing is weakened.

This also makes more sense, when we look at the NTLM2 code.

Andrew Bartlett
(This used to be commit 3fd32a1209)
2007-10-10 13:51:54 -05:00
Andrew Bartlett
ba04ff6736 r13467: Add new parametric options (for testing) controlling LM_KEY and 56-bit
encryption behaviour.

Andrew Bartlett
(This used to be commit 2b3b2f33a4)
2007-10-10 13:51:54 -05:00
Andrew Bartlett
5cecce1761 r13402: Make Samba4 pass a nastier RPC-SCHANNEL test.
The new RPC-SCHANNEL test shows that the full credentials state must
be kept in some shared memory, for some length of time.  In
particular, clients will reconnect with SCHANNEL (after loosing all
connections) and expect that the credentials chain will remain in the
same place.

To achive this, we do the server-side crypto in a transaction,
including the fetch/store of the shared state.

Andrew Bartlett
(This used to be commit 982a6aa871)
2007-10-10 13:51:53 -05:00
Andrew Bartlett
2e7f35f88f r13344: Trust SASL to have subtle distinctions between NULL and zero-length
responses...

Also trust OpenLDAP to be pedantic about it, breaking connections to AD.

In any case, we now get this 'right' (by nasty overloading hacks, but
hey), and we can now use system-supplied OpenLDAP libs and SASL/GSSAPI
to talk to Samba4.

Andrew Bartlett
(This used to be commit 0cbe18211a)
2007-10-10 13:51:46 -05:00
Andrew Bartlett
f256a9c55e r13342: Make the GSSAPI SASL mech actually work, by (shock horror) reading the spec.
GSSAPI differs from GSS-SPNEGO in an additional 3 packets, negotiating
a buffer size and what integrity protection/privacy should be used.

I worked off draft-ietf-sasl-gssapi-03, and this works against Win2k3.

I'm doing this in the hope that Apple clients as well as SASL-based
LDAP tools may get a bit further.

I still can't get ldapsearch to work, it fails with the ever-helpful
'Local error'.

Andrew Bartlett
(This used to be commit 3e46289775)
2007-10-10 13:51:46 -05:00
Andrew Bartlett
13c1f1b6f1 r13252: Cleanup, both in code, comments and talloc use:
In particular, I've used the --leak-report-full option to smbd to
track down memory that shouldn't be on a long-term context.  This is
now talloc_free()ed much earlier.

Andrew Bartlett
(This used to be commit c6eb74f429)
2007-10-10 13:51:38 -05:00
Andrew Bartlett
7e9868c74f r13250: I missed a couple of talloc_free()'s
Andrew Bartlett
(This used to be commit 3570a62876)
2007-10-10 13:51:38 -05:00
Andrew Bartlett
7c7125be5d r13247: Try to make better use of talloc in the auth/ and auth/gensec code.
We don't want temporary memory hanging around on the long-term
contexts.

Andrew Bartlett
(This used to be commit 85b3f6ebdd)
2007-10-10 13:51:37 -05:00
Andrew Bartlett
a0060cb343 r13245: Don't segfault if we don't have a credentials structure on this gensec
context.

Andrew Bartlett
(This used to be commit 1e840aa436)
2007-10-10 13:51:37 -05:00
Andrew Bartlett
44e601b5ad r13206: This patch finally re-adds a -k option that works reasonably.
From here we can add tests to Samba for kerberos, forcing it on and
off.  In the process, I also remove the dependency of credentials on
GENSEC.

This also picks up on the idea of bringing 'set_boolean' into general
code from jpeach's cifsdd patch.

Andrew Bartlett
(This used to be commit 1ac7976ea6)
2007-10-10 13:51:33 -05:00
Jelmer Vernooij
662a58bded r13170: Remove some dependencies on -1 implying the size of pstring
(This used to be commit f7c28d3148)
2007-10-10 13:51:31 -05:00
Andrew Bartlett
28d78c40ad r13107: Follow the lead of Heimdal's kpasswdd and use the HDB (hdb-ldb in our
case) as the keytab.

This avoids issues in replicated setups, as we will replicate the
kpasswd key correctly (including from windows, which is why I care at
the moment).

Andrew Bartlett
(This used to be commit 849500d1aa)
2007-10-10 13:51:26 -05:00
Tim Potter
9f9f35ae56 r12971: Fix spelling.
(This used to be commit e9ec3a379c)
2007-10-10 13:51:13 -05:00
Andrew Bartlett
ae51cc9bec r12927: Fix typo.
(This used to be commit 01e98966ca)
2007-10-10 13:51:07 -05:00
Andrew Bartlett
8e42a0c63c r12919: Ensure we never 'extend' the session key length, or fill in past the
length of the (possibly null) pointer.

In reality this should come to us either 16 or 0 bytes in length, but
this is the safest test.

This is bug 3401 in Samba3, thanks to Yau Lam Yiu <yiuext at cs.ust.hk>

Andrew Bartlett
(This used to be commit f3aa702944)
2007-10-10 13:51:03 -05:00
Stefan Metzmacher
6b566e83a6 r12899: - fix warnings on AIX
- fix compilation of auth/kerberos/krb5_init_context.c on AIX

metze
(This used to be commit 0e1ad08a85)
2007-10-10 13:51:00 -05:00
Andrew Bartlett
adab8d3968 r12863: As lha suggested to me a while back, it appears that the
gsskrb5_get_initiator_subkey() routine is bougs.  We can indeed use
gss_krb5_get_subkey().

This is fortunate, as there was a segfault bug in 'initiator' version.

Andrew Bartlett
(This used to be commit ec11870ca1)
2007-10-10 13:50:55 -05:00
Andrew Bartlett
bceaf62d2f r12824: Another typo.
Andrew Bartlett
(This used to be commit 08f8b2aadb)
2007-10-10 13:50:02 -05:00
Andrew Bartlett
ca90a75ba0 r12821: Fix typos.
Andrew Bartlett
(This used to be commit f4386f7af1)
2007-10-10 13:50:01 -05:00
Andrew Bartlett
1d95bcf3f8 r12816: Ugly hacks to the auth_unix code to make a SYSTEM token for root. If
we are going to try and have a 'real' NT token for these users, it is
going to get messy fast.  I want to go down the idmap road, but we
don't have the infrustucure for that yet.

Andrew Bartlett
(This used to be commit c90d5e82ff)
2007-10-10 13:50:00 -05:00
Andrew Bartlett
31753e2cfc r12808: Actually, with that we can avoid roken compleatly.
Andrew Bartlett
(This used to be commit 37f342b010)
2007-10-10 13:49:58 -05:00
Andrew Bartlett
a7a8eece69 r12807: I'm wondering if this might fix AIX on the build farm...
Andrew Bartlett
(This used to be commit 8f70d6270a)
2007-10-10 13:49:58 -05:00
Andrew Bartlett
f55ea8bb3d r12804: This patch reworks the Samba4 sockets layer to use a socket_address
structure that is more generic than just 'IP/port'.

It now passes make test, and has been reviewed and updated by
metze. (Thankyou *very* much).

This passes 'make test' as well as kerberos use (not currently in the
testsuite).

The original purpose of this patch was to have Samba able to pass a
socket address stucture from the BSD layer into the kerberos routines
and back again.   It also removes nbt_peer_addr, which was being used
for a similar purpose.

It is a large change, but worthwhile I feel.

Andrew Bartlett
(This used to be commit 88198c4881)
2007-10-10 13:49:57 -05:00
Stefan Metzmacher
35dffd9a10 r12795: remember the gensec_security context
metze
(This used to be commit ec1a7b5cef)
2007-10-10 13:49:56 -05:00
Andrew Bartlett
6eabf593bb r12718: We don't use unicodePwd directly any more.
Andrew Bartlett
(This used to be commit c10491fb9b)
2007-10-10 13:49:45 -05:00
Jelmer Vernooij
78c50015bb r12694: Move some headers to the directory of the subsystem they belong to.
(This used to be commit c722f665c9)
2007-10-10 13:49:39 -05:00
Andrew Bartlett
8cd5930a4b r12682: This patch finally fixes our kpasswdd implementation to be compatible
with clients compiled against the MIT Kerberos implementation.  (Which
checks for address in KRB-PRIV packets, hence my comments on socket
functions earlier today).

It also fixes the 'set password' operation to behave correctly (it was
previously a no-op).

This allows Samba3 to join Samba4.  Some winbindd operations even work,
which I think is a good step forward.  There is naturally a lot of work
to do, but I wanted at least the very basics of Samba3 domain membership
to be available for the tech preview.

Andrew Bartlett
(This used to be commit 4e80a557f9)
2007-10-10 13:49:37 -05:00
Jelmer Vernooij
bc4aebfaec r12670: Make a couple of dependencies stricter
Re-introduce and use the OUTPUT_TYPE property for MODULEs to force
specific modules to always be included
(This used to be commit f9eede3d40)
2007-10-10 13:49:35 -05:00
Jelmer Vernooij
8b7013fa50 r12628: Prevent double registration warnings
(This used to be commit 98ec52beee)
2007-10-10 13:49:09 -05:00
Andrew Bartlett
c0e574a473 r12627: This magic comment keeps minimal_includes.pl from suggesting the
removal of this header.

Andrew Bartlett
(This used to be commit 17d4d49fe1)
2007-10-10 13:49:08 -05:00
Jelmer Vernooij
6ebe31dc1b r12621: INIT_FUNCTION no longer has to be set on libraries
(This used to be commit 7ff1ecdc6f)
2007-10-10 13:49:06 -05:00
Jelmer Vernooij
aa9f67163c r12620: Get rid of automatically generated lists of init functions of subsystems.
This allows Samba libraries to be used by other projects (and parts of
Samba to be built as shared libraries).
(This used to be commit 44f0aba715)
2007-10-10 13:49:06 -05:00
Stefan Metzmacher
aed4d517fe r12610: we need struct passwd on some systems
metze
(This used to be commit fd7812beb2)
2007-10-10 13:49:04 -05:00
Jelmer Vernooij
d4de4c2d21 r12608: Remove some unused #include lines.
(This used to be commit 70e7449318)
2007-10-10 13:49:03 -05:00
Andrew Bartlett
c82c9fe7bb r12599: This new LDB module (and associated changes) allows Samba4 to operate
using pre-calculated passwords for all kerberos key types.
(Previously we could only use these for the NT# type).

The module handles all of the hash/string2key tasks for all parts of
Samba, which was previously in the rpc_server/samr/samr_password.c
code.  We also update the msDS-KeyVersionNumber, and the password
history.  This new module can be called at provision time, which
ensures we start with a database that is consistent in this respect.

By ensuring that the krb5key attribute is the only one we need to
retrieve, this also simplifies the run-time KDC logic.  (Each value of
the multi-valued attribute is encoded as a 'Key' in ASN.1, using the
definition from Heimdal's HDB.  This simplfies the KDC code.).

It is hoped that this will speed up the KDC enough that it can again
operate under valgrind.
(This used to be commit e902274321)
2007-10-10 13:49:01 -05:00
Andrew Bartlett
906c142423 r12594: Jelmer pushed some proposed header reductions to the list today. This
commits some of these that I know to be correct in the kerberos area.

Andrew Bartlett
(This used to be commit 6787b3737c)
2007-10-10 13:49:00 -05:00
Jelmer Vernooij
46aa296cc9 r12592: Remove some useless dependencies
(This used to be commit ca8db1a0cd)
2007-10-10 13:49:00 -05:00
Jelmer Vernooij
2cd5ca7d25 r12542: Move some more prototypes out to seperate headers
(This used to be commit 0aca5fd513)
2007-10-10 13:47:55 -05:00
Jelmer Vernooij
6aafed9600 r12499: Move smb_build.h out of includes.h
(This used to be commit c92ace494f)
2007-10-10 13:47:45 -05:00
Jelmer Vernooij
d8e35f8828 r12498: Eliminate INIT_OBJ_FILES and ADD_OBJ_FILES. We were not using
the difference between these at all, and in the future the
fact that INIT_OBJ_FILES include smb_build.h will be sufficient to
have recompiles at the right time.
(This used to be commit b24f2583ed)
2007-10-10 13:47:45 -05:00
Jelmer Vernooij
448483199f r12494: Support loading modules from .so files for most subsystems.
We now use a different system for initializing the modules for a subsystem.
Most subsystems now have an init function that looks something like this:

	init_module_fn static_init[] = STATIC_AUTH_MODULES;
	init_module_fn *shared_init = load_samba_modules(NULL, "auth");

	run_init_functions(static_init);
	run_init_functions(shared_init);

	talloc_free(shared_init);

I hope to eliminate the other init functions later on (the
init_programname_subsystems; defines).
(This used to be commit b6d2ad4ce0)
2007-10-10 13:47:45 -05:00
Andrew Bartlett
97113d0508 r12439: No need to keep walking this list if we find the match.
Andrew Bartlett
(This used to be commit cf1883c3cc)
2007-10-10 13:47:39 -05:00
Andrew Bartlett
36d7778784 r12436: Fix Samba4 as a server to Win2000 for the domain join.
We still have Win2000 issues, but now we correctly handle the case
where NTLMSSP is chosen as an authentication mech, but the OID list
still contains Kerberos as a later option.

Andrew Bartlett
(This used to be commit dc2b2c33f8)
2007-10-10 13:47:39 -05:00
Andrew Bartlett
9a9cb35cbd r12422: Some kerberos comments and clarifications.
Andrew Bartlett
(This used to be commit 31046cd22b)
2007-10-10 13:47:36 -05:00
Andrew Bartlett
221c1512a8 r12411: Add 'net samdump keytab <keytab>'.
This extracts a remote windows domain into a keytab, suitable for use
in ethereal for kerberos decryption.

For the moment, like net samdump and net samsync, the 'password
server' smb.conf option must be set to the binding string for the
server. eg:

password server = ncacn_np:mypdc

Andrew Bartlett
(This used to be commit 272013438f)
2007-10-10 13:47:35 -05:00
Andrew Tridgell
636dbb355b r12363: minor fixes for win2000 join/login
- the objectClass needs to be added to the list of attributes to make
   the check for objectClass=computer work

 - the short version of the name needs to be used for the 'cn' in
   cracknames
(This used to be commit 53f0fb77c3)
2007-10-10 13:47:31 -05:00
Andrew Bartlett
bceca72304 r12361: Add a new function: ldb_binary_encode_string()
This is for use on user-supplied arguments to printf style format
strings which will become ldb filters.  I have used it on LSA, SAMR
and the auth/ code so far.

Also add comments to cracknames code.

Andrew Bartlett
(This used to be commit 8308cf6e04)
2007-10-10 13:47:30 -05:00
Andrew Bartlett
6bd8be8671 r12360: Add simple bind support into our LDAP server.
Needs changes to our client code for automated testing.

Andrew Bartlett
(This used to be commit e751d81414)
2007-10-10 13:47:30 -05:00
Andrew Bartlett
97b54b007e r12310: Link simple bind support in our internal LDAP libs to LDB and the
command line processing system.

This is a little ugly at the moment, but works.  What I cannot manage
to get to work is the extraction and propogation of command line
credentials into the js interface to ldb.

Andrew Bartlett
(This used to be commit f34ede763e)
2007-10-10 13:47:28 -05:00
Andrew Bartlett
d8966dcd7e r12268: Use transactions to ensure that the schannel db is consistant.
Andrew Bartlett
(This used to be commit 949137e312)
2007-10-10 13:47:26 -05:00
Jelmer Vernooij
ab31a44216 r12254: Add some (hopefully correct) descriptions for libraries that are installed.
Install pkg-config files.
(This used to be commit a86abe84e2)
2007-10-10 13:47:24 -05:00
Andrew Bartlett
a1827a1deb r12227: I realised that I wasn't yet seeing authenticated LDAP for the ldb
backend.

The idea is that every time we open an LDB, we can provide a
session_info and/or credentials.  This would allow any ldb to be remote
to LDAP.  We should also support provisioning to a authenticated ldap
server.

(They are separate so we can say authenticate as foo for remote, but
here we just want a token of SYSTEM).

Andrew Bartlett
(This used to be commit ae2f3a64ee)
2007-10-10 13:47:22 -05:00
Andrew Bartlett
172a8b477e r12179: Allow our KDC to use LDAP to get to the backend database.
To avoid a circular depenency, it is not allowed to use Krb5 as an
authentication mechanism, so this must be removed from the list.  An
extension to the credentials system allows this function.

Also remove proto.h use for any of the KDC, and use NTSTATUS returns
in more places.

Andrew Bartlett
(This used to be commit 5f9dddd02c)
2007-10-10 13:47:16 -05:00
Stefan Metzmacher
89260f978e r12065: fix compiler warning
metze
(This used to be commit c60bac5baa)
2007-10-10 13:47:03 -05:00
Andrew Tridgell
16c7e92cd2 r12064: pass back the socket level error correctly (so we get
NT_STATUS_CONNECTION_REFUSED when a KDC is not listening)
(This used to be commit 0f85fc204c)
2007-10-10 13:47:03 -05:00
Andrew Tridgell
469aad2c48 r12063: fixed the krb5 client code to handle ICMP port unreachable errors, and
error out immediatelly. This prevents a long timeout
(This used to be commit f6c0fccc06)
2007-10-10 13:47:03 -05:00
Andrew Bartlett
c3f35aafed r12061: Add missing file to previous commit. This provides a hook on which to
attach a restriction on available GENSEC mechanisms.

Andrew Bartlett
(This used to be commit 8154f2421f)
2007-10-10 13:47:03 -05:00
Andrew Bartlett
61bd609574 r12060: Work towards allowing the credentials system to allow/deny certain
GENSEC mechansims.  This will allow a machine join to an NT4 domain to
avoid even trying kerberos, or a sensitive operation to require it.

Andrew Bartlett
(This used to be commit 11c7a89e52)
2007-10-10 13:47:02 -05:00
Andrew Bartlett
42f2bfbd9b r12059: Use random keytab names (so we get different keytabs, rather than
share the MEMORY: keytab).

Andrew Bartlett
(This used to be commit 6c43de2708)
2007-10-10 13:47:02 -05:00
Andrew Bartlett
f8a44902f4 r12058: Set an anonymous fallback, if the machine account isn't available.
Andrew Bartlett
(This used to be commit 55cb72f5cf)
2007-10-10 13:47:02 -05:00
Andrew Bartlett
c7c6b5620b r12056: Some clarification fixes for the keytab code, and use the right
function for enctype to string.

Andrew Bartlett
(This used to be commit ae6c968cb2)
2007-10-10 13:47:02 -05:00
Andrew Bartlett
9c6b7f2d62 r11995: A big kerberos-related update.
This merges Samba4 up to current lorikeet-heimdal, which includes a
replacement for some Samba-specific hacks.

In particular, the credentials system now supplies GSS client and
server credentials.  These are imported into GSS with
gss_krb5_import_creds().  Unfortunetly this can't take an MEMORY
keytab, so we now create a FILE based keytab as provision and join
time.

Because the keytab is now created in advance, we don't spend .4s at
negprot doing sha1 s2k calls.  Also, because the keytab is read in
real time, any change in the server key will be correctly picked up by
the the krb5 code.

To mark entries in the secrets which should be exported to a keytab,
there is a new kerberosSecret objectClass.  The new routine
cli_credentials_update_all_keytabs() searches for these, and updates
the keytabs.

This is called in the provision.js via the ejs wrapper
credentials_update_all_keytabs().

We can now (in theory) use a system-provided /etc/krb5.keytab, if

krb5Keytab: FILE:/etc/krb5.keytab

is added to the secrets.ldb record.  By default the attribute

privateKeytab: secrets.keytab

is set, pointing to allow the whole private directory to be moved
without breaking the internal links.
(This used to be commit 6b75573df4)
2007-10-10 13:46:56 -05:00
Andrew Bartlett
22f1de0998 r11994: This function no longer needs a special declaration.
Andrew Bartlett
(This used to be commit 88a7b7805c)
2007-10-10 13:46:56 -05:00
Andrew Bartlett
b2c98db507 r11993: As well as making an in-MEMORY keytab, allow a file-based keytab to be updated.
This allows a new password to be written in, and old entries removed
(we keep kvno and kvno-1).

Clean up the code a lot, and add comments on what it is doing...

Andrew Bartlett
(This used to be commit 0a911baaba)
2007-10-10 13:46:56 -05:00
Andrew Bartlett
759e40fb4a r11991: Null termainte the list of backends. (Makes it easier to walk the list).
Andrew Bartlett
(This used to be commit fc4202dea8)
2007-10-10 13:46:56 -05:00
Andrew Bartlett
0e476e7ce0 r11989: Rather than grabbing the machine account details at this point, grab
them 'later'.  We will need to handle the errors when we call the
get_* methods.

Andrew Bartlett
(This used to be commit c6e572f870)
2007-10-10 13:46:55 -05:00
Andrew Tridgell
516d0a97c9 r11969: got rid of the very annoying 'failed to open /secrets.tdb'
messages. As discussed with Andrew, this will soon be replaced with a
system that marks the credentials to use the machine accout from the
database rather than pre-loading the machine account details here.

The reason we got the annoying messages is this was being called
before smb.conf is loaded, so the code doesn't yet know the location
of the private directory
(This used to be commit 6aeb4bf3fe)
2007-10-10 13:46:52 -05:00
Tim Potter
03d301ead5 r11967: Fix more 64-bit warnings.
(This used to be commit 9c4436a124)
2007-10-10 13:46:52 -05:00
Andrew Bartlett
3a3c53327a r11940: Love has clarified why this code does what it does.
Andrew Bartlett
(This used to be commit 9b3dedbc0b)
2007-10-10 13:46:49 -05:00
Andrew Bartlett
eb4fbaeee2 r11929: Add static, comments.
Andrew Bartlett
(This used to be commit 41f09ef934)
2007-10-10 13:46:48 -05:00
Andrew Bartlett
01fc59df42 r11928: More Kerberos musings...
Andrew Bartlett
(This used to be commit 571f9c9c51)
2007-10-10 13:46:48 -05:00
Stefan Metzmacher
1fb2397913 r11601: try to fix the build on IRIX 6.5 us4
abartlet, tridge, lha: is there a better way?

metze
(This used to be commit b2b4969bdc)
2007-10-10 13:45:57 -05:00
Stefan Metzmacher
b4bc46feb9 r11600: remove unused code
metze
(This used to be commit 06ccbc3fa9)
2007-10-10 13:45:56 -05:00
Stefan Metzmacher
5b28800103 r11599: remove local (and broken) version of strhaslower() strhasupper()
metze
(This used to be commit 35e17abb87)
2007-10-10 13:45:56 -05:00
Simo Sorce
5c95905871 r11567: Ldb API change patch.
This patch changes the way lsb_search is called and the meaning of the returned integer.
The last argument of ldb_search is changed from struct ldb_message to struct ldb_result
which contains a pointer to a struct ldb_message list and a count of the number of messages.
The return is not the count of messages anymore but instead it is an ldb error value.

I tryed to keep the patch as tiny as possible bu as you can guess I had to change a good
amount of places. I also tried to double check all my changes being sure that the calling
functions would still behave as before. But this patch is big enough that I fear some bug
may have been introduced anyway even if it passes the test suite. So if you are currently
working on any file being touched please give it a deep look and blame me for any error.

Simo.
(This used to be commit 22c8c97e6f)
2007-10-10 13:45:53 -05:00
Andrew Bartlett
918c7634c2 r11543: A major upgrade to our KDC and PAC handling.
We now put the PAC in the AS-REP, so that the client has it in the
TGT.  We then validate it (and re-sign it) on a TGS-REQ, ie when the
client wants a ticket.

This should also allow us to interop with windows KDCs.

If we get an invalid PAC at the TGS stage, we just drop it.

I'm slowly trying to move the application logic out of hdb-ldb.c, and
back in with the rest of Samba's auth system, for consistancy.  This
continues that trend.

Andrew Bartlett
(This used to be commit 36973b1eef)
2007-10-10 13:45:52 -05:00
Andrew Bartlett
4c57d08c52 r11538: More notes on things we need.
Andrew Bartlett
(This used to be commit 890ad0412b)
2007-10-10 13:45:51 -05:00
Andrew Bartlett
cc99c7bbeb r11537: Make the authsam_account_ok routine callable by external users (the KDC).
Andrew Bartlett
(This used to be commit 1643ad169c)
2007-10-10 13:45:51 -05:00
Andrew Bartlett
2dcb73aed8 r11525: Move lookups (including the attribute search) for users from
kdc/hdb-ldb.c to share the routines used for auth/

This will require keeping the attribute list in sync, but I think it
is worth it for the next steps (sharing the server_info generation).

Andrew Bartlett
(This used to be commit da38bcefa7)
2007-10-10 13:45:48 -05:00
Andrew Bartlett
df9af34876 r11522: Add support for delegated credentials and machine account credentials
to ldb, based on the sessionInfo we now pass around.

Andrew Bartlett
(This used to be commit 84e16e4ea7)
2007-10-10 13:45:48 -05:00
Andrew Bartlett
72820aaf92 r11521: Add in client support for checking supportedSASLmechanisms, and then
determining a mechanism to use.

Currently it doesn't to fallbacks like SPNEGO does, but this could be
added (to GENSEC, not to here).

This also adds a new function to GENSEC, which returns a list of SASL
names in our preference order (currently determined by the build
system of all things...).

Also make the similar function used for OIDs in SPNEGO do the same.

This is all a very long-winded way of moving from a hard-coded NTLM to
GSS-SPNEGO in our SASL client...

Andrew Bartlett
(This used to be commit 130eb9bb9a)
2007-10-10 13:45:48 -05:00
Andrew Bartlett
6ac2585e87 r11520: indent
(This used to be commit ce611eb5f3)
2007-10-10 13:45:47 -05:00
Andrew Bartlett
694a8e7402 r11514: Fixup debug message
(This used to be commit b2372cad36)
2007-10-10 13:45:46 -05:00
Andrew Bartlett
20debaa289 r11470: To a server trusted for delegation (checked for in the gss libs),
delegate by default.

Andrew Bartlett
(This used to be commit 49d489c81d)
2007-10-10 13:45:41 -05:00
Andrew Bartlett
cc0f3779b1 r11468: Merge a bit more of init_sec_context from Heimdal CVS into our
DCE_STYLE modified version, and add parametric options to control
delegation.

It turns out the only remaining issue is sending delegated credentials
to a windows server, probably due to the bug lha mentions in his blog
(using the wrong key).

If I turn delgation on in smbclient, but off in smbd, I can proxy a
cifs session.

I can't wait till Heimdal 0.8, so I'll see if I can figure out the fix
myself :-)

Andrew Bartlett
(This used to be commit fd5fd03570)
2007-10-10 13:45:40 -05:00
Andrew Bartlett
3b2a6997b4 r11452: Update Heimdal to current lorikeet, including removing the ccache side
of the gsskrb5_acquire_cred hack.

Add support for delegated credentials into the auth and credentials
subsystem, and specifically into gensec_gssapi.

Add the CIFS NTVFS handler as a consumer of delegated credentials,
when no user/domain/password is specified.

Andrew Bartlett
(This used to be commit 55b89899ad)
2007-10-10 13:45:38 -05:00
Andrew Bartlett
1d6e6540e0 r11441: Remove the auth_domain module from Samba4, as we will only do things
via winbindd in Samba4.

Andrew Bartlett
(This used to be commit e63be25d0b)
2007-10-10 13:45:38 -05:00
Andrew Bartlett
8b95bda975 r11440: Actually check the right thing for 'is this a machine account' (thanks metze).
Andrew Bartlett
(This used to be commit 848831a155)
2007-10-10 13:45:37 -05:00
Andrew Bartlett
87d9cd202a r11414: Add passing around of logon_parameters to Samba4 auth_winbind
Andrew Bartlett
(This used to be commit 7e3c22f57b)
2007-10-10 13:45:34 -05:00
Andrew Bartlett
cfa2adf040 r11401: A simple hack to have our central credentials system deny sending LM
authentication for user@realm logins and machine account logins.

This should avoid various protocol downgrade attacks.

Andrew Bartlett
(This used to be commit 76c2d204d0)
2007-10-10 13:45:31 -05:00
Stefan Metzmacher
fb2bceea6e r11400: fix compiler warnings
metze
(This used to be commit a29a107d95)
2007-10-10 13:45:31 -05:00
Andrew Bartlett
d0831d27a5 r11399: Add another case where we need to fallback, if the KDC isn't there.
Andrew Bartlett
(This used to be commit e82fbb58dd)
2007-10-10 13:45:31 -05:00
Andrew Bartlett
12d4dd28a5 r11394: Allow KDC unreachable as another 'forget about gssapi' error on SPNEGO.
Andrew Bartlett
(This used to be commit da24074860)
2007-10-10 13:45:30 -05:00
Andrew Bartlett
5e456b38ed r11393: Avoid error messages and get more correctness with long plaintext passwords.
Andrew Bartlett
(This used to be commit cb0b3c0057)
2007-10-10 13:45:30 -05:00
Jelmer Vernooij
a4e7bf3a89 r11382: Require number of required M4 macros
Make MODULE handling a bit more like BINARY, LIBRARY and SUBSYSTEM
Add some more PUBLIC_HEADERS
(This used to be commit 875eb8f4cc)
2007-10-10 13:45:29 -05:00
Jelmer Vernooij
93fd08168f r11377: Add support for building LIBRARY elements as shared libraries:
- Adds -rpath bin/ so you don't have to install Samba in order to use compiled binaries.
 - Writes out pkg-config files when building shared libs
 - Supports automatic fallback to MERGEDOBJ (which is the default) or
   OBJ_LIST (if ld -r is not supported)

Building with shared libs reduces the size of the Samba binaries from
197 Mb to 60 Mb (including libraries) on my system (GCC4, with debugging).

To build with shared libraries support enabled, run:

LIBRARY_OUTPUT_TYPE=SHARED_LIBRARY ./config.status

init functions don't get called correctly yet when using shared libs, so
you won't be able to actually run anything with success :-)

Once init functions are done, I'll look at support for loading shared
modules once again.

Based on a patch by Peter Novodvorsky (nidd on IRC).
(This used to be commit 0b54405685)
2007-10-10 13:45:28 -05:00
Andrew Bartlett
546f63df5b r11370: Samba4 now passes it's own RPC-SAMLOGON test again.
This avoids the nasty user@DOMAIN test for now, as it has very odd
semantics with NTLMv2.

Allow only user accounts to do an interactive login.

Andrew Bartlett
(This used to be commit 690cad8083)
2007-10-10 13:45:27 -05:00
Andrew Bartlett
152988a828 r11366: Pass around the flags which indicate if we should support plaintext
logins and NTLM machine account logins.

Andrew Bartlett
(This used to be commit 421e64c2b4)
2007-10-10 13:45:26 -05:00
Andrew Bartlett
2bb739396c r11358: Ensure domains are always upper-case as well. Helps NTLMv2.
Andrew Bartlett
(This used to be commit 82527491b2)
2007-10-10 13:45:24 -05:00
Andrew Bartlett
524eeac064 r11350: Add some debugs to assist tracking down kerberos issues in future.
(Make it easy to see what was put into the keytab, so we can tell when
gssapi screams that it can't pull it out).

Andrew Bartlett
(This used to be commit c56142c4ac)
2007-10-10 13:45:22 -05:00
Andrew Bartlett
c0d1fb4914 r11342: Remove unused variables.
Andrew Bartlett
(This used to be commit eed8f4a031)
2007-10-10 13:45:21 -05:00
Andrew Bartlett
13b0da09ee r11325: Fix up some kerberos notes.
Andrew Bartlett
(This used to be commit 89623af30f)
2007-10-10 13:45:20 -05:00
Andrew Bartlett
040add3d07 r11315: Sorry gd, I just removed all of your code that I just merged...
(We now ask the kerberos libraries to handle getting and unwapping the PAC).

Andrew Bartlett
(This used to be commit 6a0beb29da)
2007-10-10 13:45:18 -05:00
Andrew Bartlett
14a3abd559 r11314: Use a patch from lha to have the kerberos libs extract the PAC, rather
than doing ASN.1 parsing in Samba.

Also use the API function for getting a client from a ticket, rather
than just digging in the structure.

Andrew Bartlett
(This used to be commit 25d5ea6d72)
2007-10-10 13:45:18 -05:00
Andrew Bartlett
22c9123296 r11313: Typo
(This used to be commit 204185576c)
2007-10-10 13:45:18 -05:00
Andrew Bartlett
15f8a34a56 r11312: Make it clear we are looking at the 'domain ref', not the domain
itself in the auth_sam module.

Andrew Bartlett
(This used to be commit 0800942dbb)
2007-10-10 13:45:18 -05:00
Jelmer Vernooij
8ee1ee66ed r11303: Support defining and installing public headers for libraries.
Support installing libraries.
Get rid of pkg-config file (will be autogenerated later on).
(This used to be commit b4745032a2)
2007-10-10 13:45:16 -05:00
Andrew Bartlett
d27ffc27ff r11293: Use the right search when forming the data for the PAC.
Andrew Bartlett
(This used to be commit ecacef213b)
2007-10-10 13:45:14 -05:00
Stefan Metzmacher
7751bd939f r11278: fix compiler warnings
metze
(This used to be commit 716e6b0c88)
2007-10-10 13:45:12 -05:00
Andrew Bartlett
ef57650d6e r11273: Initialise the new server_info->logon_server element.
Andrew Bartlett
(This used to be commit bc6f6f9381)
2007-10-10 13:45:11 -05:00
Andrew Bartlett
a0647a89a8 r11272: In trying to track down why Win2k3 is again rejecting our PAC, ensure
we can round-trip all the way back to a server_info structure, not
just a filled in PAC_DATA. (I was worried about generated fields being
incorrect, or some other logical flaw).

Andrew Bartlett
(This used to be commit 11b1d78cc5)
2007-10-10 13:45:11 -05:00
Andrew Bartlett
db4b95827e r11270: Move the core CrackNames code from rpc_server/drsuapi to dsdb/samdb.
I'm sure this will not be the final resting place, but it will do for
now.

Use the cracknames code in auth/ for creating a server_info given a
principal name only (should avoid assumtions about spliting a
user@realm principal).

Andrew Bartlett
(This used to be commit c9d5d8e45d)
2007-10-10 13:45:11 -05:00
Jelmer Vernooij
4c5a4a7e02 r11244: Relative path names in .mk files
(This used to be commit 24e1030090)
2007-10-10 13:45:06 -05:00
Andrew Bartlett
16bbafb7e8 r11239: Use ${REALM} for the realm in rootdse.ldif
Add the kpasswd server to our KDC, implementing the 'original' and
Microsoft versions of the protocol.

This works with the Heimdal kpasswd client, but not with MIT, I think
due to ordering issues.  It may not be worth the pain to have this
code go via GENSEC, as it is very, very tied to krb5.

This gets us one step closer to joins from Apple, Samba3 and other
similar implementations.

Andrew Bartlett
(This used to be commit ab5dbbe10a)
2007-10-10 13:45:06 -05:00
Andrew Bartlett
f203903f1c r11226: Cope with Samba3's behaviour on LDAP with GSS-SPNEGO.
Andrew Bartlett
(This used to be commit 4d9667f5a0)
2007-10-10 13:45:05 -05:00
Andrew Bartlett
b0c7c175b1 r11220: Add the ability to handle the salt prinicpal as part of the
credentials.  This works with the setup/secrets.ldif change from the
previous patch, and pretty much just re-invents the keytab.

Needed for kpasswdd work.

Andrew Bartlett
(This used to be commit cc9d167bab)
2007-10-10 13:45:04 -05:00
Andrew Bartlett
2817ef9f53 r11219: Now that we have the credentials hooked in here, we have a much more
reasonable value to fill in for the mechListMIC.

Andrew Bartlett
(This used to be commit 51d78de2b7)
2007-10-10 13:45:04 -05:00
Andrew Bartlett
d820c353dc r11218: Always return the mutual authentication reply (needed for kpasswd),
and remove now duplicated unwrap_pac().

Andrew Bartlett
(This used to be commit 90642d54e0)
2007-10-10 13:45:04 -05:00
Andrew Bartlett
532b16f3d5 r11216: Upgrade to gd's PAC extraction code from Samba3. While I still want
to make some this the kerberos library's problem, we may as well use
the best code that is around.

Andrew Bartlett
(This used to be commit a7fe3078a6)
2007-10-10 13:45:04 -05:00
Andrew Bartlett
10989431e5 r11215: Remove no-op prompter intended to work around bugs in old kerberos libs.
I'm also worried this might cause loops, if we get a 'force password
change', and the prompter tries to 'deal with it'.

Andrew Bartlett
(This used to be commit 5bc10c4e47)
2007-10-10 13:45:03 -05:00
Jelmer Vernooij
f4d590662e r11214: Remove scons files (see http://lists.samba.org/archive/samba-technical/2005-October/043443.html)
(This used to be commit 7fffc5c917)
2007-10-10 13:45:03 -05:00
Andrew Bartlett
a9f15bb83e r11212: Enable sealing of data with raw krb5, consolidate some code into the
main gensec_krb5_start and always ask for sequence numbers.

Andrew Bartlett
(This used to be commit 801cd6c6ff)
2007-10-10 13:45:03 -05:00
Andrew Bartlett
b5e734b4ca r11209: We can't read the priorSecret unless we ask for it.
Andrew Bartlett
(This used to be commit ee9a93688d)
2007-10-10 13:45:02 -05:00
Andrew Bartlett
11b16c2580 r11204: Allow us to read credentials from secrets.ldb without a
secureChannelType (non machine join records).

Andrew Bartlett
(This used to be commit 3dddf497cc)
2007-10-10 13:45:01 -05:00
Andrew Bartlett
372ca26b20 r11200: Reposition the creation of the kerberos keytab for GSSAPI and Krb5
authentication.  This pulls the creating of the keytab back to the
credentials code, and removes the special case of 'use keberos keytab
= yes' for now.

This allows (and requires) the callers to specify the credentials for
the server credentails to GENSEC.  This allows kpasswdd (soon to be
added) to use a different set of kerberos credentials.

The 'use kerberos keytab' code will be moved into the credentials
layer, as the layers below now expect a keytab.

We also now allow for the old secret to be stored into the
credentials, allowing service password changes.

Andrew Bartlett
(This used to be commit 205f77c579)
2007-10-10 13:45:00 -05:00
Andrew Bartlett
9e25f33a1a r11199: Push an objectSid into the schannel state database, to match the new header.
Andrew Bartlett
(This used to be commit a665b56085)
2007-10-10 13:45:00 -05:00
Andrew Bartlett
b0fe5e6ade r11196: Clean up memory leaks (pointed out by vl), and handle the case where
the client doesn't guess correctly on the mech to use.  It must back
off and try the mech the server selected from the list.

I'm not particularly attached to our SPNEGO parser, so while I can't
easily use the SPNEGO application logic in Heimdal, I'm going to look
closely at using the asn1 routines to avoid some pain here.

Andrew Bartlett
(This used to be commit 9292173874)
2007-10-10 13:44:59 -05:00
Jeremy Allison
1bdd3a466d r11081: Remember to remove unused variables.
Jeremy.
(This used to be commit bfa41398a6)
2007-10-10 13:44:45 -05:00
Jeremy Allison
877a40d0a4 r11080: Narrowing down on the #1828 PPC bug. The PPC client sends an
initial NTLMSSP negotiate blob of only 16 bytes - no strings
added ! (So don't try parsing them).
Jeremy.
(This used to be commit 42d93a317a)
2007-10-10 13:44:45 -05:00
Jeremy Allison
5de65d5801 r11076: Still working on bug #1828, PPC hell. The PPC client sends the
NTLMSSP client and domain strings as Unicode, even when setting
flags as OEM. Cope with this.
Jeremy.
(This used to be commit 77399e1cec)
2007-10-10 13:44:44 -05:00
Stefan Metzmacher
ebe6f9ea49 r11058: remove useless talloc context
metze
(This used to be commit d9d3fe1b8a)
2007-10-10 13:44:43 -05:00
Stefan Metzmacher
cffd522b5c r11052: bring samba4 uptodate with the samba4-winsrepl branch,
before the bad merge

metze
(This used to be commit 471c0ca4ab)
2007-10-10 13:44:43 -05:00
Stefan Metzmacher
2ecb46d595 r11037:
(This used to be commit 6913e33840)
2007-10-10 13:42:33 -05:00
Andrew Bartlett
8dfa59372f r10985: To aid in testing, this allows us to easily force kerberos to use UDP or TCP.
Andrew Bartlett
(This used to be commit ae0b4028ff)
2007-10-10 13:39:50 -05:00
Andrew Bartlett
2c6ecae4e6 r10982: Move credentials.h into auth/credentials, and add flags needed by
previous patch.

Andrew Bartlett
(This used to be commit 2c537d47ba)
2007-10-10 13:39:50 -05:00
Andrew Bartlett
f7ff0540d2 r10981: Pull code to decide between and implement NTLMv2, NTLM and LM
authentication out of the various callers and into the kitchen
sink.. err, credentials subsystem.

This should ensure consistant logic, as well as get us one step closer
to security=server operation in future.

Andrew Bartlett
(This used to be commit 09c9576330)
2007-10-10 13:39:50 -05:00
Andrew Bartlett
b4a1e760c9 r10945: Free the salt after we are done with it. May need a merge to similar
code in Samba3.

Andrew Bartlett
(This used to be commit 36e302bac8)
2007-10-10 13:39:44 -05:00
Andrew Tridgell
a599edf04c r10913: This patch isn't as big as it looks ...
most of the changes are fixes to make all the ldb code compile without
warnings on gcc4. Unfortunately That required a lot of casts :-(

I have also added the start of an 'operational' module, which will
replace the timestamp module, plus add support for some other
operational attributes

In ldb_msg_*() I added some new utility functions to make the
operational module sane, and remove the 'ldb' argument from the
ldb_msg_add_*() functions. That argument was only needed back in the
early days of ldb when we didn't use the hierarchical talloc and thus
needed a place to get the allocation function from. Now its just a
pain to pass around everywhere.

Also added a ldb_debug_set() function that calls ldb_debug() plus sets
the result using ldb_set_errstring(). That saves on some awkward
coding in a few places.
(This used to be commit f6818daecc)
2007-10-10 13:39:41 -05:00
Andrew Tridgell
36d73b0e71 r10894: make the handling of dn/distinguishedName much closer to real
ldap. Also ensure we put a objectclass on our private ldb's, so they
have some chance of being stored in ldap if you want to
(This used to be commit 1af2cc067f)
2007-10-10 13:39:40 -05:00
Andrew Bartlett
90570e46d0 r10812: Fix capitalisation (thanks tridge).
Andrew Bartlett
(This used to be commit f78982a0f1)
2007-10-10 13:39:32 -05:00
Andrew Bartlett
1377cca5f4 r10810: This adds the hooks required to communicate the current user from the
authenticated session down into LDB.  This associates a session info
structure with the open LDB, allowing a future ldb_ntacl module to
allow/deny operations on that basis.

Along the way, I cleaned up a few things, and added new helper functions
to assist.  In particular the LSA pipe uses simpler queries for some of
the setup.

In ldap_server, I have removed the 'ldasrv:hacked' module, which hasn't
been worked on (other than making it continue to compile) since January,
and I think the features of this module are being put into ldb anyway.

I have also changed the partitions in ldap_server to be initialised
after the connection, with the private pointer used to associate the ldb
with the incoming session.

Andrew Bartlett
(This used to be commit fd7203789a)
2007-10-10 13:39:32 -05:00
Andrew Bartlett
05c5d145e7 r10796: Make getting an anonymous session info a utility function.
Andrew Bartlett
(This used to be commit 6021fa3734)
2007-10-10 13:39:30 -05:00
Andrew Bartlett
39daa629ff r10764: To match Win2k3 SP1, we need to set an anonymous user token for
schannel connections.

Test for Win2k3 SP1 behaviour in RPC-SCHANNEL.

Andrew Bartlett
(This used to be commit 1c3911374e)
2007-10-10 13:39:28 -05:00
Andrew Bartlett
3223cd45ee r10670: Add notes on things that are TODO in Samba4 kerberos land.
Andrew Bartlett
(This used to be commit 5b2114bb9c)
2007-10-10 13:39:16 -05:00
Andrew Tridgell
69c7cd98ce r10669: reverted jelmers commit 10663 as it was causing lots of panics in 'make test'
I also think the method of getting rid of pstring isn't the right
one. I certainly do want to get rid of pstring/fstring, but the reason
for removing them is the use of arbitrary sized fixed length strings
on the stack and in structures. Changing to another fixed length stack
string format isn't really a win, and moving to use strncpy() is
actually worse than pstrcpy() as strncpy() has the absolutely awful
semantics of always zeroing all remaining bytes, so it ends up taking
a lot of cpu doing pointless memory writes.

I'd rather move to more use of asprintf()/talloc_asprintf() and
similar functions for dynamic string allocation.

You also have to be very careful about some of these system defined
string limits. One some systems PATH_MAX could be 64k or even larger,
which can quickly blow the stack out when you allocate a few of them.
(This used to be commit 194efd26e4)
2007-10-10 13:39:16 -05:00
Jelmer Vernooij
819eeaef32 r10663: Eliminate use of pstring
(This used to be commit 57cfbe51e6)
2007-10-10 13:39:15 -05:00
Andrew Bartlett
66af2d9e42 r10597: And add the .mk files for the new credentials subsystem.
Andrew Bartlett
(This used to be commit 51a0275a0e)
2007-10-10 13:39:09 -05:00
Andrew Bartlett
a12a6686ba r10596: Move the credentials code into it's own subsystem, and push it under auth/
Andrew Bartlett
(This used to be commit 2e76a4b8ef)
2007-10-10 13:39:09 -05:00
Jelmer Vernooij
5058f4b9e8 r10586: Add MergedObject() builder. Default to Library() rather
then StaticLibrary()
(This used to be commit b53313dc51)
2007-10-10 13:39:08 -05:00
Jelmer Vernooij
5a1cf98998 r10579: str_list_make() can return NULL
(This used to be commit f547ab4644)
2007-10-10 13:39:07 -05:00
Andrew Bartlett
718dd6dda6 r10565: Try to make Kerberos authentication a bit more friendly.
This disables it for 'localhost' as well as for any host our KDC does
not recognise.

Andrew Bartlett
(This used to be commit 49c6c36763)
2007-10-10 13:39:06 -05:00
Andrew Bartlett
8407a1a866 r10561: This patch takes over KDC socket routines in Heimdal, and directs them
at the Samba4 socket layer.

The intention here is to ensure that other events may be processed while
heimdal is waiting on the KDC.  The interface is designed to be
sufficiently flexible, so that the plugin may choose how to time
communication with the KDC (ie multiple outstanding requests, looking
for a functional KDC).

I've hacked the socket layer out of cldap.c to handle this very
specific case of one udp packet and reply.  Likewise I also handle
TCP, stolen from the winbind code.

This same plugin system might also be useful for a self-contained
testing mode in Heimdal, in conjunction with libkdc.  I would suggest
using socket-wrapper instead however.

Andrew Bartlett
(This used to be commit 3b09f9e8f9)
2007-10-10 13:39:04 -05:00
Jelmer Vernooij
3f41ddd882 r10532: Replace next_token() with str_list_make()
(This used to be commit 87bb382445)
2007-10-10 13:39:02 -05:00
Jelmer Vernooij
49839f356f r10513: Reduce some use of pstring. The main reason some parts of the code still
use pstring is next_token() now.
(This used to be commit a5b88bcd42)
2007-10-10 13:38:58 -05:00
Jelmer Vernooij
e337caeed1 r10509: Some more sconscript fixes. Now getting to link stage for smbclient
(This used to be commit 6df956edba)
2007-10-10 13:38:58 -05:00
Jelmer Vernooij
3d4ea18d4d r10478: More work on proto headers; we now generate a couple of smaller ones
that are then included by include/proto.h
(This used to be commit 703ffbaaac)
2007-10-10 13:38:52 -05:00
Andrew Bartlett
5a770bf720 r10464: Use more consistant names.
Andrew Bartlett
(This used to be commit 1f726906c4)
2007-10-10 13:38:49 -05:00
Tim Potter
52bf6f52a1 r10447: Add gensec sources to proto.h
(This used to be commit 1b675a1bdf)
2007-10-10 13:38:47 -05:00
Andrew Tridgell
6fe9eee3c4 r10407: the schannel database does not need to be synchronous (and thus crash
safe) as it is removed on smbd restart
(This used to be commit 0951db6a89)
2007-10-10 13:38:41 -05:00
Andrew Bartlett
51cbc188df r10402: Make the RPC-SAMLOGON test pass against Win2k3 SP0 again.
I still have issues with Win2k3 SP1, and Samba4 doesn't pass it's own
test for the moment, but I'm working on these issues :-)

This required a change to the credentials API, so that the special
case for NTLM logins using a principal was indeed handled as a
special, not general case.

Also don't set the realm from a ccache, as then it overrides --option=realm=.

Andrew Bartlett
(This used to be commit 194e8f07c0)
2007-10-10 13:38:39 -05:00
Andrew Bartlett
3b7f8ddd9a r10398: Don't do DNS lookups on short names (no .).
Andrew Bartlett
(This used to be commit 77aca9619d)
2007-10-10 13:38:39 -05:00
Volker Lendecke
b1ad4a27cb r10390: Remove fstring, pstring and uint32_t from winbindd_nss.h.
Volker
(This used to be commit 3dc7e67dc5)
2007-10-10 13:38:39 -05:00
Andrew Bartlett
428c8ce207 r10383: This patch is on the road to implementing servers (such as kpasswd) that
use raw krb5, not GSSAPI.  I still keep the 'fake GSSAPI' code, but
under the module name 'fake_gssapi_krb5'.

Andrew Bartlett
(This used to be commit 99efec2758)
2007-10-10 13:38:34 -05:00
Tim Potter
d191c7d993 r10377: Save configuration stuff to sconf.cache so it isn't annoyingly run
at every single build.  Run 'scons configure=1' or delete sconf.cache
to force checks to be re-run.

Jelmer, I think this stuff is cached in the .sconf_cache directory but
the message is still displayed and it looks like it caches the compiled
test object file not the actual result of the test.
(This used to be commit 9d001dc083)
2007-10-10 13:38:33 -05:00
Andrew Bartlett
b1b5e49f98 r10372: Having gone to all the effort to uppercase the realm, actually set the
upper-case realm.

Andrew Bartlett
(This used to be commit 3e38456dd5)
2007-10-10 13:38:32 -05:00
Jelmer Vernooij
8db177b652 r10366: More scons fixes. Building et, asn1, lex and yacc files sort-of works now
(This used to be commit 22f18a8424)
2007-10-10 13:38:32 -05:00
Andrew Bartlett
65d4da0ff3 r10364: Turn gensec:gssapi on by default, except for a login of the form
-Udomain\\user.

This will probably break in a few configurations, so please let me
know.  I'll also work to have a way to inhibit kerberos/ntlmssp, as
this removes -k.

Andrew Bartlett
(This used to be commit 3c0dc570b8)
2007-10-10 13:38:31 -05:00
Jelmer Vernooij
6812c73534 r10348: Add scons scripts for remaining subsystems. Most subsystems build now,
but final linking still fails (as does generating files asn1, et, idl and proto
files)
(This used to be commit 4f0d7f75b9)
2007-10-10 13:38:30 -05:00
Andrew Bartlett
f9263dd102 r10337: This grubby little hack is the implementation of a concept discussed
on the kerberos mailing lists a couple of weeks ago: Don't use DNS at
all for expanding short names into long names.

Using the 'override krb5_init_context' code already in the tree, this
removes the DNS lag on a kerberos session setup/connection.

Andrew Bartlett
(This used to be commit de3ceab3d0)
2007-10-10 13:38:29 -05:00
Jelmer Vernooij
069e498da2 r10330: Add SConscript to more subsystems. Some of the tdb tools build now.
Start on custom Samba scons tools (for handling proto generation, pidl, etc)
(This used to be commit 4bffe44359)
2007-10-10 13:38:28 -05:00
Andrew Bartlett
3198e58161 r10292: This is set below from lp_server_role().
Andrew Bartlett
(This used to be commit 096c751f37)
2007-10-10 13:38:14 -05:00
Andrew Bartlett
f281d77824 r10291: The patch optionally (off by default, not available in all cases) allows
Samba to use the target principal name supplied in the mechTokenMIC of
an SPNEGO negTokenInit.

This isn't a great idea for security reasons, but is how Samba3 behaves,
and allows kerberos to function more often in some environments.  It is
only available for CIFS session setups, due to the ordering of the
exchange.

Andrew Bartlett
(This used to be commit f6a6456441)
2007-10-10 13:38:13 -05:00
Andrew Bartlett
f3bce652c8 r10286: This patch is ugly and disgusting, but for now it works better than the other
ideas I have had.

When I get a full list of things I want to do to a krb5_context I'll
either add gsskrb5_ wrappers, or a way of speicfying the krb5 context
per gssapi context.

(I want to ensure that the only krb5_context variables created while
executing Samba4 are via our wrapper).

Andrew Bartlett
(This used to be commit 8a22d46e70)
2007-10-10 13:38:13 -05:00
Jelmer Vernooij
85263c3061 r10246: Remove unused function
Move auth-specific file to auth/
(This used to be commit 8aa9711a30)
2007-10-10 13:38:11 -05:00
Andrew Bartlett
5d3d4093b3 r10174: This patch implements generic PAC verification, without assumptions
about the size of the signature.  In particular, this works with AES,
which was previously broken Samba4/Samba4.

Reviewed by metze (and thanks for help with the previous IDL commit).
(This used to be commit 3c8be196cc)
2007-10-10 13:38:06 -05:00
Andrew Bartlett
c42e76f986 r10155: Add more notes on required gsskrb5 functions.
Andrew Bartlett
(This used to be commit cdfcc09343)
2007-10-10 13:38:04 -05:00
Andrew Bartlett
5edbeca141 r10153: This patch adds a new parameter to gensec_sig_size(), the size of the
data to be signed/sealed.  We can use this to split the data from the
signature portion of the resultant wrapped packet.

This required merging the gsskrb5_wrap_size patch from
lorikeet-heimdal, and fixes AES encrption issues on DCE/RPC (we no
longer use a static 45 byte value).

This fixes one of the krb5 issues in my list.

Andrew Bartlett
(This used to be commit e4f2afc343)
2007-10-10 13:38:04 -05:00
Andrew Bartlett
1757f8355c r10145: Allow a variable length signature, so we can support signing with
other than arcfour-hmac-md5.  Currently we still fail to verify other
signatures however.

Andrew Bartlett
(This used to be commit 2e5884fc24)
2007-10-10 13:38:03 -05:00
Andrew Bartlett
1f2f470889 r10066: This is the second in my patches to work on Samba4's kerberos support,
with an aim to make the code simpiler and more correct.

Gone is the old (since the very early Samba 3.0 krb5 days) 'iterate over
all keytypes)' code in gensec_krb5, we now follow the approach used in
gensec_gssapi, and use a keytab.

I have also done a lot of work in the GSSAPI code, to try and reduce
the diff between us and upstream heimdal.  It was becoming hard to
track patches in this code, and I also want this patch (the DCE_STYLE
support) to be in a 'manageable' state for when lha considers it for
merging.  (metze assures me it still has memory leak problems, but
I've started to address some of that).

This patch also includes a simple update of other code to current
heimdal, as well as changes we need for better PAC verification.

On the PAC side of things we now match windows member servers by
checking the name and authtime on an incoming PAC.  Not generating these
right was the cause of the PAC pain, and so now both the main code and
torture test validate this behaviour.

One thing doesn't work with this patch:
 - the sealing of RPC pipes with kerberos, Samba -> Samba seems
broken.  I'm pretty sure this is related to AES, and the need to break
apart the gss_wrap interface.

Andrew Bartlett
(This used to be commit a3aba57c00)
2007-10-10 13:36:33 -05:00
Andrew Bartlett
6b14ffe271 r10035: This patch removes the need for the special case hack
'MEMORY_WILDCARD' keytab type. (part of this checking is in effect a
merge from lorikeet-heimdal, where I removed this)

This is achieved by correctly using the GSSAPI gsskrb5_acquire_cred()
function, as this allows us to specify the target principal, regardless
of which alias the client may use.

This patch also tries to simplify some principal handling and fixes some
error cases.

Posted to samba-technical, reviewed by metze, and looked over by lha on IRC.

Andrew Bartlett
(This used to be commit 506a7b67ae)
2007-10-10 13:36:31 -05:00
Andrew Bartlett
370f5b9563 r10021: More kerberos notes.
(This used to be commit f36e657a41)
2007-10-10 13:36:30 -05:00
Andrew Bartlett
2786f3d704 r9927: Extend copyright for all the hard work I've done this year.
Andrew Bartlett
(This used to be commit b50e546eb4)
2007-10-10 13:36:22 -05:00
Jelmer Vernooij
b674411eb4 r9792: Rename StrCaseCmp -> strcasecmp_m. All these years I was thinking
StrCaseCmp was sys_strcasecmp, while it is in fact strcasecmp_m!
(This used to be commit 200a8f6652)
2007-10-10 13:35:01 -05:00
Andrew Bartlett
24186a80eb r9728: A *major* update to the credentials system, to incorporate the
Kerberos CCACHE into the system.

This again allows the use of the system ccache when no username is
specified, and brings more code in common between gensec_krb5 and
gensec_gssapi.

It also has a side-effect that may (or may not) be expected: If there
is a ccache, even if it is not used (perhaps the remote server didn't
want kerberos), it will change the default username.

Andrew Bartlett
(This used to be commit 6202267f6e)
2007-10-10 13:34:54 -05:00
Andrew Bartlett
d91a5808f0 r9693: Move the smb_krb5_context setup code to use the new pattern of
tmp_ctx, then steal at the last moment, on success.

andrew Bartlett
(This used to be commit c7a44518ad)
2007-10-10 13:34:41 -05:00
Andrew Bartlett
c496f58c6f r9681: We don't need the full smb_krb5_context here, so just pass the krb5_context.
Andrew Bartlett
(This used to be commit 47699019db)
2007-10-10 13:34:40 -05:00