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

495 Commits

Author SHA1 Message Date
Andrew Bartlett
42127cdbb0 s4-credentials Add explicit event context handling to Kerberos calls (only)
By setting the event context to use for this operation (only) onto
the krb5_context just before we call that operation, we can try
and emulate the specification of an event context to the actual send_to_kdc()

This eliminates the specification of an event context to many other
cli_credentials calls, and the last use of event_context_find()

Special care is taken to restore the event context in the event of
nesting in the send_to_kdc function.

Andrew Bartlett
2010-10-11 13:02:16 +00:00
Andrew Bartlett
baeaa17986 s4-kerberos Remove unused parameter 2010-10-11 13:02:15 +00:00
Jelmer Vernooij
6c410dd615 kdc: Add missing dependency on samba_gensec_server. 2010-10-11 01:06:36 +02:00
Jelmer Vernooij
93126b3315 samdb: Add flags argument to samdb_connect(). 2010-10-10 23:08:49 +02:00
Matthias Dieter Wallnöfer
0e5b77bec4 s4:kdc - use "userAccountControl" always unsigned
It doesn't change much but it's nicer to have it consistent.
2010-10-05 08:43:19 +00:00
Jelmer Vernooij
5548d3d41e Add missing dependencies for com_err. 2010-10-05 00:38:35 +02:00
Jelmer Vernooij
39f9bfde39 heimdal: Fix name of kdc library. 2010-10-05 00:38:34 +02:00
Jelmer Vernooij
1db3221c94 heimdal: Fix name of 'hdb'. 2010-10-05 00:38:34 +02:00
Matthias Dieter Wallnöfer
7d0d6d4d23 s4:kdc/db-glue.c - remove unused variable
Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Sun Oct  3 17:30:34 UTC 2010 on sn-devel-104
2010-10-03 17:30:34 +00:00
Andrew Bartlett
dcb1a0698a s4-kdc Remove special case kerberos restriction in the KDC
We should avoid using Kerberos or any other recursive auth mechanism
in ldb backends, but denying Kerberos here won't be enough, so
remove the special case.  (Typcially we bind using a different password
space and DIGEST-MD5 or NTLM).

Andrew Bartlett
2010-10-03 15:23:19 +00:00
Andrew Bartlett
0e11d18d14 s4-kdc Fix up after import of new lorikeet-heimdal
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Sun Oct  3 01:56:04 UTC 2010 on sn-devel-104
2010-10-03 01:56:04 +00:00
Andrew Bartlett
7b9a6645b1 s4-kdc Rework 'allowed encryption types' handling in the KDC
All DCs and all krbtgt servers are forced to use AES, regardless
of the msDS-SecondaryKrbTgtNumber value.

Andrew Bartlett
2010-10-02 09:11:37 +10:00
Andrew Tridgell
4e0a3ea705 s4-kdc: RODC DCs should be able to produce forwardable tickets
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-09-28 19:25:51 -07:00
Andrew Bartlett
3d4576b170 s4-kdc Ensure that an RODC may act as a server (needed to fill
the krbtgt role).

Andrew Bartlett
2010-09-28 19:25:50 -07:00
Andrew Bartlett
89ee9e6518 s4-kdc Handle the case where we may be given a ticket from an RODC in db layer
This includes rewriting the PAC if the original krbtgt isn't to be
trusted, and reading different entries from the DB for the krbtgt
depending on the krbtgt number.

Andrew Bartlett
2010-09-29 04:23:07 +10:00
Andrew Bartlett
3021af2777 s4-kdc Add common setup, handle RODC setup case
This means we just set up the system_session etc in one place
and don't diverge between the MIT and Heimdal plugins.

We also now determine if we are an RODC and store some details
that we will need later.

Andrew Bartlett
2010-09-29 04:23:07 +10:00
Andrew Bartlett
990720b8cd s4-kdc Add function to determine if a hdb entry is a RODC
This is important, as we must ignore the PAC from an RODC.

Andrew Bartlett
2010-09-29 04:23:07 +10:00
Andrew Bartlett
85f7bce865 s4-kdc Use msDS-SecondaryKrbTgtNumber to fill in the full KVNO
Andrew Bartlett
2010-09-29 04:23:07 +10:00
Andrew Tridgell
bc47af50eb s4-kdc: added ifdef guards in kdc.h
this prevents too much recursion in the compiler preprocessor
2010-09-27 22:55:04 -07:00
Andrew Tridgell
d5a4e53ad8 s4-kdc: prevent segfault on bad trust strings
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-09-16 21:09:17 +10:00
Günther Deschner
e2f15d2a25 s4-trusts: fix trustDomainPasswords drsblobs IDL and server side support.
Also remove bogus trustCurrentPasswords struct which we just had because our IDL
was incorrect.

Guenther
2010-08-25 13:27:50 +02:00
Andrew Bartlett
6cf29b3e4f s4:security Change struct security_token->sids from struct dom_sid * to struct dom_sid
This makes the structure much more like NT_USER_TOKEN in the source3/
code.  (The remaining changes are that privilages still need to be merged)

Andrew Bartlett
2010-08-23 08:50:55 +10:00
Andrew Bartlett
7c6ca95bec s4:security Remove use of user_sid and group_sid from struct security_token
This makes the structure more like Samba3's NT_USER_TOKEN
2010-08-18 09:50:38 +10:00
Matthias Dieter Wallnöfer
4c8edc8f5e s4:kdc/kpasswdd.c - let the user change his own password with his own rights
Now it's finally possible that the user can change his password with a DSDB
connection using his credentials.

NOTICE: I had to extract the old password from the SAMDB since I was unable to
find it somewhere else (authinfo for example).
2010-08-17 18:45:34 +02:00
Matthias Dieter Wallnöfer
2a423e0547 s4:kdc/rpc server - adapt the "samdb_set_password" calls which perform password sets 2010-08-17 18:45:34 +02:00
Andrew Tridgell
6b266b85cf s4-loadparm: 2nd half of lp_ to lpcfg_ conversion
this converts all callers that use the Samba4 loadparm lp_ calling
convention to use the lpcfg_ prefix.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-16 18:24:27 +10:00
Andrew Bartlett
d76e4852eb s4:kdc Rework the 'allowed enc types' calculation
This changes the calculation to apply the allowed enc types to all
uses of the key (no point allowing a weak kinit to a key the server
wanted strongly protected).  It also ensures that all the non-DES keys
are available on the krbtgt in particular, even as it does not have a
msds-SupportedEncryptionTypes attributes.

Andrew Bartlett
2010-06-29 16:59:30 +10:00
Matthias Dieter Wallnöfer
0c29224da3 s4:kdc/kdc.c - add cast to suppress warnings on Solaris 10 cc 2010-06-26 19:43:51 +02:00
Matthias Dieter Wallnöfer
c8a5ed8db9 s4:kdc/kpasswdd.c - remove unreachable code 2010-06-26 19:42:29 +02:00
Jelmer Vernooij
c5d07d2a1a Per Andrews request, revert
"heimdal/waf: Initial work on making it possible to use the system"
as the hdb_check_s4u2self function handling is incorrect.

This reverts commit b099631f42.
2010-06-23 14:49:02 +02:00
Andrew Bartlett
80701e5f29 s4:kdc Use msDS-SupportedEncTypes in our KDC
We need to honour this, otherwise we will send AES-encrypted tickets
to unprepared Kerberos targets.

Andrew Bartlett
2010-06-23 20:10:01 +10:00
Matthias Dieter Wallnöfer
ecbe9a74c6 s4:kdc/db-glue.c - remove unreachable code
Would be nice if someone could check if this fits.
2010-06-20 22:33:03 +02:00
Jelmer Vernooij
b099631f42 heimdal/waf: Initial work on making it possible to use the system
heimdal again.

Still missing are the detection of the right Heimdal version and
linking (unresolved symbols at the moment).
2010-06-19 15:32:27 +02:00
Andrew Bartlett
e5232bdc69 s4:kdc Remove special talloc_free of the ldb context
I can see no reason not to just let this go with the talloc tree that
created it, and avoid a talloc_free with references.

Andrew Bartlett
2010-05-28 21:59:04 +10:00
Jelmer Vernooij
390ada6ec7 Remove more usages of iconv_convenience in files which were apparently not recompiled by waf. 2010-05-18 11:45:31 +02:00
Jelmer Vernooij
b8268cf7b0 s3: Remove use of iconv_convenience. 2010-05-18 11:45:31 +02:00
Jelmer Vernooij
f9ca9e46ad Finish removal of iconv_convenience in public API's. 2010-05-18 11:45:30 +02:00
Matthias Dieter Wallnöfer
6e8098b261 s4:samdb_set_password/samdb_set_password_sid - Rework
Adapt the two functions for the restructured "password_hash" module. This
means that basically all checks are now performed in the mentioned module.

An exception consists in the SAMR password change calls since they need very
precise NTSTATUS return codes on wrong constraints ("samr_password.c") file
2010-05-10 19:07:46 +02:00
Marcel Ritter
6be72df736 Simple fix to prevent crash for non-pac principals
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-04-27 16:41:51 +10:00
Matthias Dieter Wallnöfer
c678563efe s4:kdc/db-glue.c - use "TALLOC_FREE" insteal of "talloc_free" for the "priv" context
Also after a free "priv" could be != NULL and may be freed again.
This should fix bug #7365.
2010-04-17 20:10:27 +02:00
Matthias Dieter Wallnöfer
827ccdf6b9 s4:kdc/wdc-samba4.c - fix integer counter types 2010-04-12 02:03:12 +02:00
Matthias Dieter Wallnöfer
ad898fd638 s4:kdc/db-glue.c - fix integer counter types 2010-04-12 02:03:11 +02:00
Andrew Bartlett
f2b63d58da s4:kdc Add functions to hdb-samba4 for the new s4u2self callback.
For now, this shares the 'if it's the same host' system with the
constrained delegation code.

Andrew Bartlett
2010-04-10 21:40:59 +10:00
Andrew Tridgell
f9eae32f4b s4-waf: mark the wscript files as python so vim/emacs knows how to highlight them 2010-04-06 20:27:11 +10:00
Andrew Tridgell
844acb2260 build: waf quicktest nearly works
Rewrote wafsamba using a new dependency handling system, and started
adding the waf test code
2010-04-06 20:26:48 +10:00
Andrew Tridgell
845e0cbe6f build: commit all the waf build files in the tree 2010-04-06 20:26:48 +10:00
Andrew Bartlett
5f6f7a2e51 s4:kdc Add support for changing password of a servicePrincipalName
Apparently AD supports setting a password on a servicePrincipalName,
not just a user principal name.  This should fix (part of) the join of
OpenSolaris's internal CIFS server to Samba4 as reported by Bug #7273

Andrew Bartlett
2010-03-25 16:32:04 +11:00
Andreas Schneider
c3b90f00d4 s4-kdc: Fixed the memory context of tstream_bsd_existing()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-02-26 12:08:53 +01:00
Simo Sorce
d8cbc6ccdb s4:kdc add mit plugin code 2010-02-25 13:01:14 -05:00
Simo Sorce
489f78d19e s4:kdc make function static 2010-02-25 13:01:14 -05:00
Brad Hards
1e986c1cb3 More spelling fixes across source4/
Signed-off-by: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
2010-02-22 21:45:38 +01:00
Brad Hards
7a23b9769b Various source4 spelling fixes.
Signed-off-by: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
2010-02-22 21:45:37 +01:00
Andrew Tridgell
0bedb9cf5e s4-dsdb: removed gendb_search_single_extended_dn()
Use dsdb_search_one() instead, which allows for arbitrary controls

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-02-16 21:10:51 +11:00
Andrew Tridgell
90203f87e7 s4-dsdb: change samdb_replace() to dsdb_replace() and allow for dsdb_flags
This allows for controls to be added easily where they are needed.
2010-02-16 21:10:50 +11:00
Simo Sorce
30797cec7d s4:kdc Fill in created_by principal field 2010-02-12 16:39:33 -05:00
Simo Sorce
2e2b7e8259 s4:kdc Fix double free and uninitialized memory.
In samba_kdc_trust_message2entry() on error, hdb_free_entry()
may end up trying to access uninitialized memory or double
free the hdb_entry.
2010-02-12 16:39:26 -05:00
Simo Sorce
b116d4e5b9 s4:kdc Streamline client access verification call
Move the core to pac-glue so that other plugins can use it.
2010-01-31 13:25:17 -05:00
Simo Sorce
0520bd7782 s4:kdc Fix netbios name retrieval
The code was looping but always checking only the first address.
2010-01-31 13:25:17 -05:00
Simo Sorce
14e006747e s4:kdc remove dead code and comments 2010-01-28 19:33:34 -05:00
Simo Sorce
7b355d41b5 s4:kdc Fill in more data fields 2010-01-28 19:33:34 -05:00
Simo Sorce
3ce54a4a97 s4:kdc move db functions in their own file
Keep all heimdal related plugin code within hdb_samba4.c
Move interfaces needed by multiple plugins in db-glue.c

Move sequence context in main db context so that we do
not depend on db->hdb_dbc in the common code.

Remove unnecessary paremeters from function prototypes
2010-01-28 19:33:34 -05:00
Simo Sorce
a097527ab7 s4:kdc Use a clearer name for the samba kdc entry
Renames hdb_samba4_private to samba_kdc_entry
Streamlines members of the entry and the kdc db contextto avoid
unnecessary duplication.
2010-01-28 19:33:34 -05:00
Simo Sorce
c6865af445 s4:kdc Use better db context structure
This allows to use a common structure not tied to hdb_samba4
Also allows to avoid many casts within hdb_samba4 functions

This is the first step to abstract samba kdc databse functions
so they can be used by the MIT forthcoming plugin.
2010-01-28 19:33:34 -05:00
Simo Sorce
b63b9bcd42 s4:windc move windc plugin in its own file
Keep all heimdal related plugin code within wdc-samba4.c
Leave only interfaces common to multiple plugins in pac-glue.c
2010-01-27 14:03:06 -05:00
Simo Sorce
1f2e9e90bd s4:PAC make common functions public 2010-01-27 14:03:06 -05:00
Simo Sorce
82a80b7f71 s4:PAC Streamline pac-glue step 2
Split functions so that no assumption is made about which plugin
is using them
2010-01-27 14:03:06 -05:00
Simo Sorce
85e3561dc9 s4:PAC Streamline pac-glue
First step, preparing to share the code between multiple plugins.
2010-01-27 14:03:06 -05:00
Simo Sorce
4c548048c5 s4:kdc Simplify header files 2010-01-22 11:16:24 -05:00
Simo Sorce
e0e255fb24 Fix comment/debug messages 2010-01-11 11:55:28 -05:00
Simo Sorce
7eee8e053b Fix comment 2010-01-08 17:01:02 -05:00
Andreas Schneider
0588f34467 s4-kdc: Migrate tcp connections to tsocket.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-01-08 14:38:35 +01:00
Stefan Metzmacher
42c34cdafa s4:kdc: use LIBSAMBA_TSOCKET
metze
2010-01-08 14:36:49 +01:00
Stefan Metzmacher
d97562b382 s4:kdc: the ->process function returns "bool"
metze
2010-01-08 14:36:49 +01:00
Stefan Metzmacher
5126b52810 s4:kdc: use the remote and local address from the stream_connection struct
metze
2009-12-24 17:38:33 +01:00
Simo Sorce
67d1af4384 s4:cleanups More trailing spaces and tabs 2009-12-23 15:17:56 -05:00
Simo Sorce
da27d4e465 s4:cleanups remove trailing spaces and tabs 2009-12-23 15:09:49 -05:00
Stefan Metzmacher
fcbe8f0c80 s4:kdc: setup the local and remote tsocket_address at accept time
metze
2009-12-19 18:24:26 +01:00
Stefan Metzmacher
4dc958c7c8 s4:kdc: convert UDP based communication to tdgram_context
metze
2009-12-19 18:24:26 +01:00
Andreas Schneider
ac2d31e24c s4-gensec: Replace gensec_set_peer_addr with new tsocket based fn. 2009-12-16 20:28:38 +01:00
Andreas Schneider
226a9db2d9 s4-gensec: Replace gensec_set_my_addr() with new tsocket based fn. 2009-12-16 20:28:38 +01:00
Andreas Schneider
b55d07615b s4-kdc: Migrate to tsocket_address. 2009-12-15 23:34:23 +01:00
Endi S. Dewata
9ce7e9ab84 s4:kdc - Merged kdc_tcp_accept() and kpasswdd_tcp_accept().
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2009-12-01 16:41:02 +11:00
Endi S. Dewata
0c89a6f2aa s4:kdc - Merged kdc_add_kdc_socket() and kdc_add_kpasswd_socket().
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2009-12-01 16:40:57 +11:00
Endi S. Dewata
c93fc3a10a s4:kdc - Disable KDC port when it's set to 0.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2009-12-01 16:40:44 +11:00
Andrew Tridgell
2b858c6939 s4-hdb: go back to a separate samdb for the KDC
The change to use a common system_session broke replication as the KDC
forces CRED_DONT_USE_KERBEROS on session->credentials, which is shared
with other parts of the system.

This should be fixed once we confirm whether the ldap backend actually
relies on CRED_DONT_USE_KERBEROS
2009-11-09 21:38:49 +11:00
Stefan Metzmacher
a10b522a0a s4:kdc: remove unused struct kpasswd_socket
metze
2009-11-05 09:55:11 +01:00
Matthias Dieter Wallnöfer
3d2c9ea457 s4:kdc/hdb-samba4 - Remove unused variable 2009-10-30 12:13:26 +01:00
Andrew Tridgell
54bd30f706 s4-samdb: reduce the number of samdb opens at startup
Using common parameters means that the ldb_wrap code can return a
reference rather than a new database
2009-10-25 17:19:03 +11:00
Andrew Tridgell
98e4393df9 s4-dsdb: create a static system_session context
This patch adds a system_session cache, preventing us from having to
recreate it on every ldb open, and allowing us to detect when the same
session is being used in ldb_wrap
2009-10-23 14:52:17 +11:00
Matthias Dieter Wallnöfer
e9686985cb s4: Changes the old occurences of "lp_realm" in "lp_dnsdomain" where needed
For KERBEROS applications the realm should be upcase (function "lp_realm") but
for DNS ones it should be used lowcase (function "lp_dnsdomain"). This patch
implements the use of both in the right way.
2009-10-14 10:50:43 +02:00
Andrew Bartlett
e0e7ca4ee8 Revert "s4:hdb-samba4 - Don't double-free "db""
This reverts commit 11a8a54c82.

The actual fix for bug 6801 is in hdb_end_seq_get() - this attempt
leaks 'db' instead.

Andrew Bartlett
2009-10-14 10:20:02 +11:00
Matthias Dieter Wallnöfer
11a8a54c82 s4:hdb-samba4 - Don't double-free "db"
"db" is freed anyway after the destructor terminates so this does really make
no sense here (rather it makes code crash).

Should fix bug #6801.
2009-10-13 17:36:58 +02:00
Matthias Dieter Wallnöfer
607ceff234 s3/s4 - Adapt the IDL changes on various locations 2009-10-08 09:50:19 +02:00
Andrew Tridgell
e9a589feac s4-server: kill main daemon if a task fails to initialise
When one of our core tasks fails to initialise it can now ask for the
server as a whole to die, rather than limping along in a degraded
state.
2009-09-18 18:05:55 -07:00
Andrew Tridgell
ade5d43c5c s4-kdc: ignore unknown keytypes
don't fail hdb operations if one of the key types is unknown
2009-09-18 18:04:15 -07:00
Andrew Bartlett
932690c093 s4:kdc In the kpasswd server, don't use the client address in mk_priv
This code eventually calls into mk_priv in the Heimdal code, and if
the client is behind NAT, or somehow has an odd idea about it's own
network addresses, it will fail to accept this packet if we set an
address.  It seems easiser not to.  (Found by testing with NetAPP at
plugfest)

Andrew Bartlett
2009-09-16 07:18:16 -07:00
Andrew Tridgell
3c7cbd60e5 fixed a double free bug on error in net export 2009-08-25 16:59:25 +10:00
Andrew Bartlett
29ef1b2325 s4:kerberos Use MIT compatible names for these enc types
This is a small start on (ie, the only trivial part of) the work shown in:
http://k5wiki.kerberos.org/wiki/Projects/Samba4_Port#Samba.27s_use_of_Heimdal_symbols.2C_with_MIT_differences
(a table of all Kerberos symbols used in Samba4, and notes on where
they differ from those provided with MIT Kerberos)

Andrew Bartlett
2009-08-21 17:50:49 +10:00
Andrew Bartlett
8ff1f50b0c s4:kerberos Add support for user principal names in certificates
This extends the PKINIT code in Heimdal to ask the HDB layer if the
User Principal Name name in the certificate is an alias (perhaps just
by case change) of the name given in the AS-REQ.  (This was a TODO in
the Heimdal KDC)

The testsuite is extended to test this behaviour, and the other PKINIT
certficate (using the standard method to specify a principal name in a
certificate) is updated to use a Administrator (not administrator).
(This fixes the kinit test).

Andrew Bartlett
2009-07-28 14:10:47 +10:00
Andrew Bartlett
47a7a2e442 s4:kerberos Add 'net export keytab' command for wireshark decryption
It is much easier to do decryption with wireshark when the keytab is
available for every host in the domain.  Running 'net export keytab
<keytab name>' will export the current (as pointed to by the supplied
smb.conf) local Samba4 doamin.

(This uses Heimdal's 'hdb' keytab and then the existing hdb-samba4,
and so has a good chance of keeping working in the long term).

Andrew Bartlett
2009-07-28 08:52:43 +10:00
Stefan Metzmacher
b7c003c09c Revert "s4:kerberos Add 'net export keytab' command for wireshark decryption"
This reverts commit a40ce5d0d9.

This breaks the build...

Andrew, please repush it, when it's fixed:-)

metze
2009-07-27 17:41:11 +02:00
Andrew Bartlett
a40ce5d0d9 s4:kerberos Add 'net export keytab' command for wireshark decryption
It is much easier to do decryption with wireshark when the keytab is
available for every host in the domain.  Running 'net export keytab
<keytab name>' will export the current (as pointed to by the supplied
smb.conf) local Samba4 doamin.

(This uses Heimdal's 'hdb' keytab and then the existing hdb-samba4,
and so has a good chance of keeping working in the long term).

Andrew Bartlett
2009-07-27 22:41:42 +10:00
Andrew Bartlett
56f4516399 s4:kdc Push context to hdb_samba4 by way of the 'name' of the DB
This overloads the 'name' part of the keytab name to supply a context
pointer, and so avoids 3 global variables!

To do this, we had to stop putting the entry for kpasswd into the
secrets.ldb.  (I don't consider this a big loss, and any entry left
there by an upgrade will be harmless).

Andrew Bartlett
2009-07-27 22:41:42 +10:00
Andrew Bartlett
afb6ac247b s4:kdc Tidy up hdb_samba4 some more
This removes the last use of the prefix hdb_ldb and makes it clear
that we pass in 3 global variables to get state information into
hdb_samba4 when used as a keytab.  (And that they belong to
hdb_samba4, not to the KDC)

Andrew Bartlett
2009-07-27 22:41:41 +10:00
Andrew Bartlett
09135ee5a0 s4:kdc Add in a simple check for constrained delegation to self
To do this properly, we must use the PAC, but for now this is enough
to check that we are delegating to another name on the same host
(which must be safe).

(Windows 7 does this a lot, also noted in bug 6273)

Andrew Bartlett
2009-07-20 14:21:18 +10:00
Andrew Bartlett
19bc4ce95c s4:kdc Rework KDC to pull in less attributes for krbtgt lookups
Each attribute we request from LDB comes with a small cost, so don't
lookup any more than we must for the (very) frequent krbtgt lookup
case.  Similarly, we don't need to build a PAC for a server (as a
target), so don't ask for the PAC attributes here either.

Andrew Bartlett
2009-07-17 08:26:49 +10:00
Andrew Bartlett
d7b31ff853 s4:kdc rename functions from LDB_ to hdb_samba4
The LDB_ prefix is misleading, and stomps on the LDB namespace.  This
is a Samba4 hdb module, and not something generic.

Andrew Bartlett
2009-07-17 08:26:48 +10:00
Andrew Bartlett
c901f57ce3 s4:kdc Initialise new hdb function pointers.
Soon we will add implementations for these.
2009-07-16 11:31:37 +10:00
Günther Deschner
8db45607f8 libds: share UF_ flags between samba3 and 4.
Guenther
2009-07-13 15:36:06 +02:00
Andrew Bartlett
89a074b784 s4:heimdal Allow KRB5_NT_ENTERPRISE names in all DB lookups
The previous code only allowed an KRB5_NT_ENTERPRISE name (an e-mail
list user principal name) in an AS-REQ.  Evidence from the wild
(Win2k8 reportadely) indicates that this is instead valid for all
types of requests.

While this is now handled in heimdal/kdc/misc.c, a flag is now defined
in Heimdal's hdb so that we can take over this handling in future (once we start
using a system Heimdal, and if we find out there is more to be done
here).

Andrew Bartlett
2009-06-30 12:11:14 +10:00
Andrew Bartlett
6ba0e7f7b2 s4:kdc Only get the lp_ctx once for a LDB_fetch() 2009-06-30 12:06:38 +10:00
Andrew Bartlett
684a03e7f9 Rework hdb-samba4 to remove useless abstractions.
The function LDB_lookup_principal() has been eliminated, and it's
contents spread back to it's callers.  Removing the abstraction makes
the code clearer.

Also ensure we never pass unescaped user input to a LDB search
function.

Andrew Bartlett
2009-06-30 10:29:30 +10:00
Andrew Bartlett
19413c5249 s4:kdc Allow a password change when the password is expired
This requires a rework on Heimdal's windc plugin layer, as we want
full control over what tickets Heimdal will issue.  (In particular, in
case our requirements become more complex in future).

The original problem was that Heimdal's check would permit the ticket,
but Samba would then deny it, not knowing it was for kadmin/changepw

Also (in hdb-samba4) be a bit more careful on what entries we will
make the 'change_pw' service mark that this depends on.

Andrew Bartlett
2009-06-18 13:49:30 +10:00
Andrew Bartlett
9b261c008a s4:heimdal: import lorikeet-heimdal-200906080040 (commit 904d0124b46eed7a8ad6e5b73e892ff34b6865ba)
Also including the supporting changes required to pass make test

A number of heimdal functions and constants have changed since we last
imported a tree (for the better, but inconvenient for us).

Andrew Bartlett
2009-06-12 07:45:48 +10:00
Andrew Tridgell
dfd56dd294 changed the auth path to use extended DN ops to avoid non-indexed searches
Logs showed that every SAM authentication was causing a non-indexed
ldb search for member=XXX. This was previously indexed in Samba4, but
since we switched to using the indexes from the full AD schema it now
isn't.

The fix is to use the extended DN operations to allow us to ask the
server for the memberOf attribute instead, with with the SIDs attached
to the result. This also means one less search on every
authentication.

The patch is made more complex by the fact that some common routines
use the result of these user searches, so we had to update all
searches that uses user_attrs and those common routines to make sure
they all returned a ldb_message with a memberOf filled in and the SIDs
attached.
2009-06-04 14:10:11 +10:00
Andrew Bartlett
5264ad627d Handle the krbtgt special case by looking for RID -514
It turns out (seen in MS-SAMR 3.1.1.7.1 for example) that the primary
way the krbtgt account is recognised as special is that RID.  This
should fix issues such as 'password expired' on the kpasswd service.

Andrew Bartlett
2009-05-27 07:58:07 +10:00
Andrew Bartlett
6ef65389fd Don't use crossRef records to find our own domain
A single AD server can only host a single domain, so don't stuff about
with looking up our crossRef record in the cn=Partitions container.
We instead trust that lp_realm() and lp_workgroup() works correctly.

Andrew Bartlett
2009-05-26 12:37:09 +10:00
Stefan Metzmacher
9521801dc8 s4:kdc: use krb5_data_free()
metze
2009-03-26 15:01:03 +01:00
Jelmer Vernooij
7ab8f373c8 Use common header file for character set handling in Samba 3 and Samba 4. 2009-03-01 22:24:34 +01:00
Jelmer Vernooij
94069bd274 s4: Use same function signature for convert_* as s3. 2009-03-01 19:55:46 +01:00
Jelmer Vernooij
9ffb6d2d9e Add allow_badcharcnv argument to all conversion function, for
consistency with Samba 3.
2009-03-01 06:33:40 +01:00
Andrew Bartlett
71632a1697 Remove auth/ntlm as a dependency of GENSEC by means of function pointers.
When starting GENSEC on the server, the auth subsystem context must be
passed in, which now includes function pointers to the key elements.

This should (when the other dependencies are fixed up) allow GENSEC to
exist as a client or server library without bundling in too much of
our server code.

Andrew Bartlett
2009-02-13 10:24:16 +11:00
Stefan Metzmacher
d9c30894a1 s4:service_stream: s/private/private_data
metze
2009-02-02 13:09:00 +01:00
Stefan Metzmacher
5f13710ced s4:irpc: avoid c++ reserved word 'private'
metze
2009-02-01 00:17:20 +01:00
Stefan Metzmacher
15239f742c s4:kdc: avoid c++ reserved word 'private'
metze
2009-02-01 00:17:19 +01:00
Stefan Metzmacher
183c379fe5 s4:lib/tevent: rename structs
list=""
list="$list event_context:tevent_context"
list="$list fd_event:tevent_fd"
list="$list timed_event:tevent_timer"

for s in $list; do
	o=`echo $s | cut -d ':' -f1`
	n=`echo $s | cut -d ':' -f2`
	r=`git grep "struct $o" |cut -d ':' -f1 |sort -u`
	files=`echo "$r" | grep -v source3 | grep -v nsswitch | grep -v packaging4`
	for f in $files; do
		cat $f | sed -e "s/struct $o/struct $n/g" > $f.tmp
		mv $f.tmp $f
	done
done

metze
2008-12-29 20:46:40 +01:00
Stefan Metzmacher
f271469931 s4:kdc: pass down event_context explicit
metze
2008-12-29 09:46:38 +01:00
Jelmer Vernooij
928fd47c3d s4: Fix subsystem for various services in samba daemon. 2008-12-22 19:04:55 +01:00
Stefan Metzmacher
180245fce0 s4:kdc: allow a trusted domain to get kerberos tickets
metze
2008-12-04 15:45:16 +01:00
Jelmer Vernooij
b034c519f5 Add gensec_settings structure. This wraps loadparm_context for now, but
should in the future only contain some settings required for gensec.
2008-11-02 02:05:48 +01:00
Jelmer Vernooij
23302413b3 Remove unused include param/param.h. 2008-10-24 16:37:56 +02:00
Jelmer Vernooij
37d885c51a Remove iconv_convenience argument from convert_string{,talloc}() but
make them wrappers around convert_string{,talloc}_convenience().
2008-10-24 14:26:46 +02:00
Jelmer Vernooij
922a29992e Remove iconv_convenience parameter from simple string push/pull
functions.
2008-10-24 03:40:09 +02:00
Andrew Bartlett
c41cc67722 Ensure the hdb_method structure is not on the stack.
We supply this to krb5 as a plugin, so we must keep it around as long
as the krb5_context.

Andrew Bartlett
2008-10-20 20:07:09 +11:00
Jelmer Vernooij
6a89b59ca6 Add TALLOC_CTX pointer to strhex_to_data_blob for consistency with Samba
3.
2008-10-18 18:09:04 +02:00
Andrew Bartlett
7c88ea8aad Create a 'straight paper path' for UTF16 passwords.
This uses a virtual attribute 'clearTextPassword' (name chosen to
match references in MS-SAMR) that contains the length-limited blob
containing an allegidly UTF16 password.  This ensures we do no
validation or filtering of the password before we get a chance to MD4
it.  We can then do the required munging into UTF8, and in future
implement the rules Microsoft has provided us with for invalid inputs.

All layers in the process now deal with the strings as length-limited
inputs, incluing the krb5 string2key calls.

This commit also includes a small change to samdb_result_passwords()
to ensure that LM passwords are not returned to the application logic
if LM authentication is disabled.

The objectClass module has been modified to allow the
clearTextPassword attribute to pass down the stack.

Andrew Bartlett
2008-10-16 12:48:16 +11:00
Jelmer Vernooij
9565999755 Fix include paths to new location of libutil. 2008-10-11 21:31:42 +02:00
Andrew Bartlett
e0a4d7f467 Set default trust kvno to -1 2008-10-06 14:28:27 -07:00
Andrew Bartlett
c3b28c7a81 Fix cross-realm authentication in Samba4's KDC. 2008-10-06 14:28:27 -07:00
Andrew Bartlett
912209ac84 Use the trust password version as kvno for trusts in Kerberos. 2008-10-06 14:28:26 -07:00
Andrew Bartlett
6ad78f01a5 Rename hdb_ldb to hdb_samba4 and load as a plugin into the kdc.
This avoids one more custom patch to the Heimdal code, and provides a
more standard way to produce hdb plugins in future.

I've renamed from hdb_ldb to hdb_samba4 as it really is not generic
ldb.

Andrew Bartlett
2008-09-29 22:34:35 -07:00
Matthias Dieter Wallnöfer
57edd24ca0 Cosmetic corrections for the KERBEROS library
This commit applies some cosmetic corrections for the KERBEROS library.
2008-09-24 19:40:03 +02:00
Jelmer Vernooij
6925202bde Move source4/lib/crypto to lib/crypto. 2008-09-24 15:30:23 +02:00
Jelmer Vernooij
6a689c23e8 Rename smbd -> samba.
This reverts commit 05ea5e23cf.

Conflicts:

	source4/smbd/server.c
2008-09-24 03:16:15 +02:00
Simo Sorce
508527890a Merge ldb_search() and ldb_search_exp_fmt() into a simgle function.
The previous ldb_search() interface made it way too easy to leak results,
and being able to use a printf-like expression turns to be really useful.
2008-09-23 18:17:46 -04:00
Andrew Bartlett
cebd9a9013 This torture test and skipping of the server-side check was bogus.
The IDL is declared to force the MessageType to 3 on output, so we
instead checked the same thing 255 times...

Andrew Bartlett
2008-09-22 14:23:22 -07:00
Stefan Metzmacher
1d92b2211c s4: allways initialize the process model before it's used
metze
2008-09-22 18:16:09 +02:00
Jelmer Vernooij
05ea5e23cf Revert "Rename smbd -> samba."
This reverts commit 0e9008be35.
2008-09-21 21:32:40 +02:00
Jelmer Vernooij
0e9008be35 Rename smbd -> samba. 2008-09-21 21:26:40 +02:00
Andrew Bartlett
2c2fde57fa Update copyright
(This used to be commit edea162a0e)
2008-09-05 16:45:58 +10:00