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

662 Commits

Author SHA1 Message Date
Andrew Bartlett
35b309fa0c gensec: clarify memory ownership for gensec_session_info() and gensec_session_key()
This is slightly less efficient, because we no longer keep a cache on
the gensec structures, but much clearer in terms of memory ownership.
Both gensec_session_info() and gensec_session_key() now take a mem_ctx
and put the result only on that context.

Some duplication of memory in the callers (who were rightly uncertain
about who was the rightful owner of the returned memory) has been
removed to compensate for the internal copy.

Andrew Bartlett
2011-08-03 18:48:02 +10:00
Stefan Metzmacher
ac8096e69d s4:kdc: fix compiler warning
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Aug  2 06:06:15 CEST 2011 on sn-devel-104
2011-08-02 06:06:15 +02:00
Stefan Metzmacher
51b94ab3fd s4:kdc: canonicalize the principal if HDB_F_FOR_TGS_REQ is given
Windows seems to always canonicalize the principal in TGS replies.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Jul 26 03:25:06 CEST 2011 on sn-devel-104
2011-07-26 03:25:06 +02:00
Stefan Metzmacher
8d159e9de1 s4:kdc: restore the behavior before the last heimdal import
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed Jul 20 12:12:38 CEST 2011 on sn-devel-104
2011-07-20 12:12:38 +02:00
Stefan Metzmacher
7acc1a7a2f s4:kdc: set *_strongest_*_key to true to restore the old behavior
TODO: check why this is needed.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Jul 15 12:26:25 CEST 2011 on sn-devel-104
2011-07-15 12:26:25 +02:00
Stefan Metzmacher
b005fa142f s4:kdc/mit_samba: disable mit_samba_check_s4u2proxy()
As mit_samba_update_pac_data() doesn't support adding
S4U_DELEGATION_INFO to the pac (and I have no clue how to add that)
we should disable S4U2Proxy until this is implemented.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Jun 28 20:35:19 CEST 2011 on sn-devel-104
2011-06-28 20:35:18 +02:00
Stefan Metzmacher
73b1e1466c s4:kdc: generate the S4U_DELEGATION_INFO in the regenerated pac
metze
2011-06-28 19:23:43 +02:00
Stefan Metzmacher
020f60287c s4:kdc: use KRB5_WINDC_PLUGIN_MINOR define instead of KRB5_WINDC_PLUGING_MINOR
metze
2011-06-28 18:24:37 +02:00
Stefan Metzmacher
ad45072aaf s4:kdc: implement samba_kdc_check_s4u2proxy()
metze
2011-06-24 19:06:44 +02:00
Volker Lendecke
f0ff6f390a Use tevent_req_oom
This fixes a few Coverity errors
2011-06-20 12:33:24 +02:00
Andrew Bartlett
a1f04e8abc libcli/util Rename common map_nt_error_from_unix to avoid duplicate symbol
The two error tables need to be combined, but for now seperate the names.

(As the common parts of the tree now use the _common function,
errmap_unix.c must be included in the s3 autoconf build).

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Mon Jun 20 08:12:03 CEST 2011 on sn-devel-104
2011-06-20 08:12:03 +02:00
Andrew Tridgell
40dc94a53f s4-ipv6: update callers to load_interface_list() 2011-06-06 12:26:10 +10:00
Andrew Tridgell
dc8c8fd9e4 s4-ipv6: use iface_list_wildcard() to listen on IPv6
when we need to listen on a wildcard address, we now listen on a list
of sockets, usually 0.0.0.0 and ::
2011-06-06 12:26:10 +10:00
Stefan Metzmacher
a7b8593f9c s4:kdc: split s4u2self and s4u2proxy checks
metze
2011-05-18 07:46:44 +02:00
Stefan Metzmacher
5f48c5df51 s4:kdc: UF_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION => flags.trusted_for_delegation
metze
2011-05-18 07:46:43 +02:00
Andrew Bartlett
22cb631b4f s4-interfaces Rename interfaces code so not to conflict with source3/
The iface_count, iface_n_bcast, and load_interfaces functions
conflicted with functions of the same name in source3, so the source4
functions were renamed.  Hopefully we can actually wrap one around the
other in future.

Andrew Bartlett
2011-05-08 12:57:04 +02:00
Andrew Bartlett
86baefe224 kdc: always ldb escape the realm 2011-04-05 23:46:04 +02:00
Andrew Bartlett
b5616adc8a lib/util/charset rename iconv_convenience to iconv_handle
This better reflects what this structure is

Andrew Bartlett
2011-03-25 04:37:06 +01:00
Andrew Tridgell
15e84a9a09 charcnv: removed the allow_badcharcnv and allow_bad_conv options to convert_string*()
we shouldn't accept bad multi-byte strings, it just hides problems

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Thu Mar 24 01:47:26 CET 2011 on sn-devel-104
2011-03-24 01:47:26 +01:00
Jelmer Vernooij
a68b59e9a6 source4/kdc: Fix prototypes for all functions. 2011-03-19 03:20:05 +01:00
Stefan Metzmacher
8002406c51 s4:kdc: split the kdc_tcp_proxy() logic from the main kdc logic
By having kdc_tcp_proxy_send/recv(), which just asks any writeable
dc for a reponse blob, we simplify the interaction between
client-local and local-writeable sockets.

This allows us to make kdc_socket, kdc_process_fn_t, kdc_tcp_call and kdc_tcp_socket
private to kdc.c again.

metze
2011-03-04 21:19:05 +01:00
Stefan Metzmacher
e70b09e8f8 s4:kdc: split the kdc_udp_proxy() logic from the main kdc logic
By having kdc_udp_proxy_send/recv(), which just asks any writeable
dc for a reponse blob, we simplify the interaction between
client-local and local-writeable sockets.

This allows us to make kdc_udp_call and kdc_udp_socket private to
kdc.c again.

metze
2011-03-04 21:19:05 +01:00
Stefan Metzmacher
ad9ac99afd s4:kdc: add a kdc_proxy_unavailable_error() helper function
metze
2011-03-04 21:19:05 +01:00
Stefan Metzmacher
0c78640e67 s4:kdc: fix calculation of the rodc kvno
Bit shifting is non-trivial in C:-)

This

	int32_t a = 0x12340000;
	uint32_t b = (a >> 16);

results in 0x00001234, but this

	int32_t a = 0xEDCB0000;
	uint32_t b = (a >> 16);

results in 0xFFFFEDCB, while we expected 0x0000EDCB.

metze
2011-03-04 21:19:05 +01:00
Andrew Tridgell
ed71c1ef1f s4-auth: rename 'auth' subsystem to 'auth4'
this prevents conflicts with the s3 auth modules. The auth modules in
samba3 may appear in production smb.conf files, so it is preferable to
rename the s4 modules for minimal disruption.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-02-18 15:09:46 +11:00
Andrew Tridgell
8dc92c8f71 ldb: use #include <ldb.h> for ldb
thi ensures we are using the header corresponding to the version of
ldb we're linking against. Otherwise we could use the system ldb for
link and the in-tree one for include

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-02-10 06:51:07 +01:00
Andrew Bartlett
a2ce53c1f5 s4-auth Rework auth subsystem to remove struct auth_serversupplied_info
This changes auth_serversupplied_info into the IDL-defined struct
auth_user_info_dc.  This then in turn contains a struct
auth_user_info, which is the only part of the structure that is
mainted into the struct session_info.

The idea here is to avoid keeping the incomplete results of the
authentication (such as session keys, lists of SID memberships etc) in
a namespace where it may be confused for the finalised results.

Andrew Barltett
2011-02-09 01:11:06 +01:00
Simo Sorce
1d27f0b264 mit-samba: Allow nesting on the event context
This context is used in ldb, and ldb modules apparently abort if nesting is not
allowed.

Autobuild-User: Simo Sorce <idra@samba.org>
Autobuild-Date: Mon Feb  7 20:58:02 CET 2011 on sn-devel-104
2011-02-07 20:58:02 +01:00
Andrew Tridgell
60be4a4c37 s4-kdc: don't ask for an extended DN for krbtgt_dn
otherwise msg->dn would be non-minimal and would fail in searches

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-01-14 16:39:33 +11:00
Brad Hards
bf0d5d04ab Typo fix in KDC parameters.
Signed-off-by: Matthias Dieter Wallnöfer <mdw@samba.org>

Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Fri Dec 24 12:09:00 CET 2010 on sn-devel-104
2010-12-24 12:09:00 +01:00
Matthias Dieter Wallnöfer
136a5d7a26 s4:kdc/*.c - minimise includes
Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Sun Dec 12 15:20:46 CET 2010 on sn-devel-104
2010-12-12 15:20:46 +01:00
Matthias Dieter Wallnöfer
c7b2ec6fbb s4:kdc/proxy.c - optimise includes in order to fix a build warning on Tru64 2010-12-12 12:15:51 +01:00
Matthias Dieter Wallnöfer
3c38166cdb s4:kdc/kpasswdd.c - don't return an uninitialised NT_STATUS
Discovered by Tru64 build
2010-12-12 11:58:59 +01:00
Andrew Bartlett
f681859eb8 s4-lsa Implement kerberos ticket life policy
We now no longer print tickets with a potentially infinite life, and
we report the same life over LSA as we use in the KDC.  We should get
this from group policy, but for now it's parametric smb.conf options.

Andrew Bartlett
2010-12-09 18:02:59 +11:00
Matthias Dieter Wallnöfer
f156c340b4 s4:kdc/kpasswdd.c - fix memory leaks 2010-12-04 16:40:25 +01:00
Matthias Dieter Wallnöfer
88a2ad28fe s4/kdc - fix a warning regarding a changed parameter type (kvno)
Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Fri Dec  3 23:56:15 CET 2010 on sn-devel-104
2010-12-03 23:56:15 +01:00
Andrew Bartlett
c5bea98ddb s4:heimdal: import lorikeet-heimdal-201012010201 (commit 81fe27bcc0148d410ca4617f8759b9df1a5e935c) 2010-12-01 17:00:47 +11:00
Andrew Tridgell
33d178767b s4-loadparm: use loadparm_init_global() instead of loadparm_init()
this prevents us having two lp_ctx contexts in these tools which leads
to bizarre behaviour

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-11-29 18:04:42 +11:00
Andrew Bartlett
deed2a935b s4-kdc Rework supported encryption type logic to match Microsoft
Thanks to Hongwei Sun for the clear description of the algorithim
involved.  Importantly, it isn't possible to remove encryption types
from the list, only to add them over the defaults (DES and
arcfour-hmac-md5, and additional AES for DCs and RODCs).

This changes the behaviour for entries with
msDS-supportedEncryptionTypes: 0, which Angelos Oikonomopoulos
reported finding set by ADUC when attempting to store cleartext
passwords.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Tue Nov 16 21:24:43 UTC 2010 on sn-devel-104
2010-11-16 21:24:43 +00:00
Andrew Bartlett
d76f11a8bd s4-kdc Fix the realm handling again, this time pay attention to the flags
The KDC sets different flags for the AS-REQ (this is client-depenent)
and the TGS-REQ to determine if the realm should be forced to the
canonical value.  If we do this always, or do this never, we get into
trouble, so it's much better to honour the flags we are given.

Andrew Bartlett
2010-11-16 15:30:13 +11:00
Andrew Bartlett
5c72c6b760 s4-kdc use 'flags' to only create the 'admin data' elements when requested
This avoids setting these values when the caller simply does not care

Andrew Bartlett
2010-11-16 15:30:12 +11:00
Andrew Bartlett
935d7a6f72 s4-kdc Add 'flags' parameter to db fetch calls
This will allow these calls to honour the flags passed in from the KDC

Andrew Bartlett
2010-11-16 15:30:12 +11:00
Andrew Bartlett
96bdcf7ea9 s4-kdc Don't regenerate the PAC for cross-realm tickets
We should never get a cross-realm ticket that was not issued by a full
DC, but if someone claims to have such a thing, reject it rather than
segfaulting on the NULL client pointer.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Mon Nov 15 23:59:34 UTC 2010 on sn-devel-104
2010-11-15 23:59:34 +00:00
Andrew Bartlett
a32ade647d s4-kdc Don't always regenerate the PAC
The PAC was being regenerated on all normal DCs, because they don't
have a msDS-SecondaryKrbTgtNumber attribute.  Instead we need to check
if it's set and not equal to our RODC number, allowing RODCs to trust
the full DCs and itself, but not other RODCs.

Andrew Bartlett
2010-11-15 23:17:05 +00:00
Andrew Bartlett
6358303784 s4-kdc Fix realm handling in our KDC
we should reset the realm part of the principal, but not the lowercase
realm embedded in the 'krbtgt/realm@REALM'.

Andrew Bartlett
2010-11-15 08:04:04 +00:00
Jelmer Vernooij
caa3935a38 kdc: Build as shared module by default. 2010-11-15 03:14:23 +01:00
Andrew Bartlett
be8526a0a1 s4-kdc update startup routines after heimdal update
We should check the errors from krb5_kdc_windc_init and we now need to
additionally run krb5_kdc_pkinit_config()

Andrew Bartlett
2010-11-15 01:25:06 +00:00
Andrew Bartlett
bbfaa9bbdf s4-kdc Remove use of heimdal private headers in kpasswd server.
This remains an abuse, because it relies on setting into the krb5_principal
structure, but at least it causes less trouble for the server.

Andrew Bartlett
2010-11-15 01:25:06 +00:00
Andrew Tridgell
2d7dc86b5d s4-kdc: if "bind interfaces only" is false, then also listen on wildcard
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Mon Nov 15 00:13:59 UTC 2010 on sn-devel-104
2010-11-15 00:13:59 +00:00
Jelmer Vernooij
bee3b665a8 Build wrepl server as service by default. 2010-11-14 17:14:05 +00:00
Andrew Tridgell
1ec8d55e27 s4-kdc: added proxying of kdc requests for RODCs
when we are an RODC and we get a request for a principal that we don't
have the right secrets for, we need to proxy the request to a
writeable DC. This happens for both TCP and UDP requests, for both
krb5 and kpasswd

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Fri Nov 12 08:03:20 UTC 2010 on sn-devel-104
2010-11-12 08:03:20 +00:00
Andrew Bartlett
e7fb5a6c91 s4-kdc Return HDB_ERR_NOT_FOUND_HERE on un-revealed accounts on an RODC
This means that when we are an RODC, and an account does not have the
password attributes, we can now indicate to the kdc code that it
should forward the request to a real DC.

(The proxy code itself is not in this commit).

Andrew Bartlett
2010-11-12 18:18:55 +11:00
Andrew Tridgell
2fbaa09919 s4-kdc: split the kdc process return into a tri-state
this is in preparation for doing forwarding of packets for RODCs

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-11-12 18:18:55 +11:00
Andrew Tridgell
4f352a5b6a s4-kdc: we don't need the special include handling now
the special handling was to cope with the conflict with the kdc.h
header

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-11-12 18:18:55 +11:00
Andrew Tridgell
e26609b667 s4-kdc: rename kdc/kdc.h to kdc/kdc-glue.h
kdc.h conflicts with a heimdal header name
2010-11-12 18:18:55 +11:00
Jelmer Vernooij
4217734a51 credentials: Lowercase library name,
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sun Nov  7 01:48:44 UTC 2010 on sn-devel-104
2010-11-07 01:48:44 +00:00
Jelmer Vernooij
3deece5591 s4: Remove the old perl/m4/make/mk-based build system.
The new waf-based build system now has all the same functionality, and
the old build system has been broken for quite some time.

Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sun Oct 31 02:01:44 UTC 2010 on sn-devel-104
2010-10-31 02:01:44 +00:00
Andrew Tridgell
046d38faa5 s4-smbd: don't initialise process models more than once
this also removes the event_context parameter from process model
initialisation. It isn't needed, and is confusing when a process model
init can be called from more than one place, possibly with different
event contexts.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-10-30 23:49:00 +11:00
Andrew Tridgell
b6b0d2cea3 s4-kdc: create a 'pac' private grouping library
this removes the final case where we have an object file linked into
two libraries

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-10-30 23:49:00 +11:00
Jelmer Vernooij
a74e8be6d1 waf: Stop automaticaly changing dashes to underscores in library names. 2010-10-26 10:17:18 -07:00
Jelmer Vernooij
8cf61377aa waf: Remove lib prefix from libraries manually. 2010-10-26 10:17:17 -07:00
Jelmer Vernooij
18ae8887a3 s4: Rename DB_GLUE to db_glue. 2010-10-24 00:20:04 +00:00
Jelmer Vernooij
833480d3ad s4: Rename LIBSAMBA-* to libsamba-* 2010-10-24 00:20:04 +00:00
Andrew Tridgell
7c92baf0dc s4-kdc: make DB_GLUE a private library 2010-10-21 19:03:25 +11:00
Matthias Dieter Wallnöfer
3ead246062 s4:"util_ldb" - remove some really unused dependancies 2010-10-18 19:35:11 +02:00
Matthias Dieter Wallnöfer
a3f61dea40 Revert "s4:remove "util_ldb" submodule and integrate the three gendb_* calls in "dsdb/common/util.c""
This reverts commit 8a2ce5c47c.

Jelmer pointed out that these are also in use by other LDB databases - not only
SAMDB ones.

Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Sun Oct 17 13:37:16 UTC 2010 on sn-devel-104
2010-10-17 13:37:16 +00:00
Matthias Dieter Wallnöfer
8a2ce5c47c s4:remove "util_ldb" submodule and integrate the three gendb_* calls in "dsdb/common/util.c"
They're only in use by SAMDB code.

Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Sun Oct 17 09:40:13 UTC 2010 on sn-devel-104
2010-10-17 09:40:13 +00:00
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
Andrew Bartlett
a35263e1ab Implement NETLOGON PAC verfication on the server-side
This is implemented by means of a message to the KDC, to avoid having
to link most of the KDC into netlogon.

Andrew Bartlett
(This used to be commit 82fcd7941f)
2008-09-03 15:30:17 +10:00
Andrew Bartlett
c79dff2e9b Heimdal provides Kerberos PAC parsing routines. Use them.
This uses Heimdal's PAC parsing code in the:
 - LOCAL-PAC test
 - gensec_gssapi server
 - KDC (where is was already used, the support code refactored from here)

In addition, the service and KDC checksums are recorded in the struct
auth_serversupplied_info, allowing them to be extracted for validation
across NETLOGON.

Andrew Bartlett
(This used to be commit 418b440a7b)
2008-08-28 16:28:47 +10:00
Stefan Metzmacher
d3265b01e5 kdc: move references to heimdal internals into heimdal_build/kpasswd-glue.h
metze
(This used to be commit 65057f17b0)
2008-08-26 12:30:03 +02:00
Andrew Bartlett
7f86b26a35 Only allow the trust in the correct direction (per the flags).
(This used to be commit 2c71954294)
2008-08-26 10:27:00 +10:00
Andrew Bartlett
9eacc3a8f3 Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into 4-0-local
(This used to be commit a555334db6)
2008-08-25 08:27:06 +10:00
Stefan Metzmacher
d0a8c05cb2 kdc/pac-glue: pull/push the logon_info via the PAC_INFO union
This prepares the next commit...

metze
(This used to be commit 7d297f7fb7)
2008-08-20 15:23:02 +02:00
Andrew Bartlett
fe95409de7 Trusted domains implementation for the KDC.
At this stage, only arcfour-hmac-md5 trusts are used, and all trusts
are presumed bi-directional.  Much more work still to be done.

Andrew Bartlett
(This used to be commit 3e9f5c2816)
2008-08-15 21:16:20 +10:00
Andrew Bartlett
5f873a4d8f More work towards trusted domain support in the KDC.
(This used to be commit c87d732b23)
2008-08-08 10:35:57 +10:00
Andrew Bartlett
8930a2159d Start implementind domain trusts in our KDC.
Andrew Bartlett
(This used to be commit 8aba7c3623)
2008-08-05 12:46:57 +10:00
Stefan Metzmacher
5fd1c5445b libreplace: include <krb5.h> and <com_err.h> and no heimdal specific headers
metze
(This used to be commit cffed8e19e)
2008-08-01 21:10:40 +02:00
Stefan Metzmacher
f2ac351d6e kdc: use mostly only public kerberos headers
We shoule avoid using the private heimdal function
_krb5_principalname2krb5_principal()

metze
(This used to be commit 10db07c69a)
2008-08-01 17:54:34 +02:00
Stefan Metzmacher
7b4081da8f Revert "Start implementind domain trusts in our KDC."
This reverts commit 736ce50afd.

This breaks the build...

metze
(This used to be commit afd07073b9)
2008-08-01 15:22:25 +02:00
Andrew Bartlett
2a0677e514 Start implementind domain trusts in our KDC.
Andrew Bartlett
(This used to be commit 736ce50afd)
2008-07-31 07:47:01 +10:00
Stefan Metzmacher
79657f78e8 hdb-ldb: fix the callers after drsblobs.idl changes
metze
(This used to be commit 1223cd17c7)
2008-07-24 08:24:10 +02:00
Stefan Metzmacher
0842eb25a1 hdb-ldb: try to find Primary:Kerberos-Newer-Keys and fallback to Primary:Kerberos
Now provide AES tickets if we find the keys in the supplementalCredentials attribute

metze
(This used to be commit 8300259f10)
2008-07-23 14:46:11 +02:00
Stefan Metzmacher
fa40b0709a hdb-ldb: check the SUPPLEMENTAL_CREDENTIALS_SIGNATURE
metze
(This used to be commit 7219740ef4)
2008-07-23 14:46:08 +02:00
Stefan Metzmacher
b4e9e8954a hdb-ldb: fix comment about padding
metze
(This used to be commit ca28d05b11)
2008-07-23 14:46:06 +02:00
Stefan Metzmacher
75cdaa4c84 hdb-ldb: fix crash bug in the error path
metze
(This used to be commit ac02d6a0f7)
2008-07-23 14:46:06 +02:00
Stefan Metzmacher
71ce9975fa kdc: we don't need any *_locl.h header from heimdal in the kdc
metze
(This used to be commit feca16dd6d)
2008-06-04 15:39:17 +02:00
Andrew Bartlett
be14efbdf9 Revert Jelmer's CFLAGS commit e2b71a0ecb
This commit broke the build, because not all files (libreplace, popt)
were updated.

Andrew Bartlett
(This used to be commit 3faacf4351)
2008-05-31 08:35:55 +10:00
Jelmer Vernooij
39f50afc57 Move CFLAGS handling out of smb_build.
(This used to be commit e2b71a0ecb)
2008-05-30 02:07:28 +02:00
Jelmer Vernooij
4c70cda986 Fix a couple (well, little more than that..) of typos.
(This used to be commit a6b5211994)
2008-05-18 23:02:47 +02:00
Jelmer Vernooij
4c8756f147 Create prototype headers from Makefile directory, without smb_build in the middle.
(This used to be commit f4a77b96f9)
2008-05-18 22:30:08 +02:00
Jelmer Vernooij
4f0db42958 Use variables for source directory in a couple more places.
(This used to be commit 56bb2907c6)
2008-05-18 19:41:33 +02:00
Jelmer Vernooij
cc9c4aaa8d Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into v4-0-gmake3
Conflicts:

	source/Makefile
	source/auth/config.mk
	source/auth/gensec/config.mk
	source/build/m4/public.m4
	source/build/make/python.mk
	source/build/make/rules.mk
	source/build/smb_build/header.pm
	source/build/smb_build/main.pl
	source/build/smb_build/makefile.pm
	source/dsdb/config.mk
	source/dsdb/samdb/ldb_modules/config.mk
	source/kdc/config.mk
	source/lib/events/config.mk
	source/lib/events/events.c
	source/lib/ldb/config.mk
	source/lib/nss_wrapper/config.mk
	source/lib/policy/config.mk
	source/lib/util/config.mk
	source/libcli/smb2/config.mk
	source/libnet/config.mk
	source/librpc/config.mk
	source/nbt_server/config.mk
	source/ntptr/ntptr_base.c
	source/ntvfs/posix/config.mk
	source/ntvfs/sysdep/config.mk
	source/param/config.mk
	source/rpc_server/config.mk
	source/rpc_server/service_rpc.c
	source/scripting/ejs/config.mk
	source/scripting/python/config.mk
	source/smb_server/config.mk
	source/smbd/server.c
	source/torture/config.mk
	source/torture/smb2/config.mk
	source/wrepl_server/config.mk
(This used to be commit 13bbd42068)
2008-04-25 10:04:20 +01:00
Jelmer Vernooij
21fc767378 Specify event_context to ldb_wrap_connect explicitly.
(This used to be commit b4e1ae07a2)
2008-04-17 12:23:44 +02:00
Jelmer Vernooij
1efbd5fbf6 Remove event context tracking from the credentials struct.
(This used to be commit 4d7fc946b2)
2008-04-17 01:03:18 +02:00
Jelmer Vernooij
ffc5cbfe80 Move object files lists to makefile rather than smb_build.
(This used to be commit 5628d58990)
2008-04-14 16:53:00 +02:00
Jelmer Vernooij
18d80bdf1f Merge v4.0-test
(This used to be commit 977dbdeaf3)
2008-03-28 00:44:14 +01:00
Andrew Bartlett
dc49ae599e Remove useless extra argument to samdb_result_account_expires().
Andrew Bartlett
(This used to be commit bc607c334f)
2008-03-25 15:25:13 +11:00
Andrew Bartlett
a08e951eb8 Remove unused variable.
(This used to be commit 1de21f5fdd)
2008-03-19 11:15:04 +11:00
Andrew Bartlett
aaf62085dd Merge branch 'v4-0-logon' of git://git.id10ts.net/samba into 4-0-local
(This used to be commit 8252b51850)
2008-03-19 11:04:42 +11:00
Andrew Bartlett
9e6b0c2871 Merge lorikeet-heimdal -r 787 into Samba4 tree.
Andrew Bartlett
(This used to be commit d88b530522)
2008-03-19 10:17:42 +11:00