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

1287 Commits

Author SHA1 Message Date
Andreas Schneider
818d51862c s4-gensec: Fixed wrong usage of error_string.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-03-08 09:18:04 +01:00
Matthias Dieter Wallnöfer
13b1bf5d47 s4:auth/sam.c - change base context for the "tmp_ctx" context in "authsam_expand_nested_groups"
Better use the "res_sids_ctx" as base context for the "tmp_ctx" and not the
long-living "sam_ctx"/"ldb" context to prevent memory leaks.
2010-03-04 22:18:10 +01:00
Matthias Dieter Wallnöfer
1f371cdbe5 s4:sam.c - make "authsam_expand_nested_groups" public
This is needed by the "tokenGroups" work in the operational LDB module.
2010-03-04 18:16:22 +01:00
Matthias Dieter Wallnöfer
7587665d92 s4:sam.c - cosmetic indentation fix 2010-03-04 18:16:22 +01:00
Matthias Dieter Wallnöfer
0049c9ed1c s4:sam.c - change variable types to unsigned in "sids_contains_sid"
Should also be unsigned - no need for a signed "i" and "num_sids" here.
2010-03-04 18:16:22 +01:00
Karolin Seeger
340797f3fa Fix typo in comments. 2010-03-03 16:03:13 +01:00
Andrew Bartlett
25723914c5 s4:python Add bindings to set GENSEC flags on credentials in python
This should allow these to be manipulated by python scripts that need
encrypted connections.

Andrew Bartlett
2010-02-26 21:38:42 +11:00
Andrew Tridgell
781ad038c9 s4-krb5: propogate errors from a lot more kerberos functions
We need to be able to give sensible error messages when a kerberos
calls fails. This propogates the kerberos error up the stack to the
caller.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-02-26 13:59:16 +11:00
Matthias Dieter Wallnöfer
e912d50709 s4:auth - make some parts "signed-safe"
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-02-25 08:17:11 +11:00
Simo Sorce
805f7507e2 s4:cleanup remove unused schannel ldb code 2010-02-23 12:46:51 -05:00
Simo Sorce
1203de99b1 s4:schannel merge code with s3
After looking at the s4 side of the (s)channel :) I found out that it makes
more sense to simply make it use the tdb based code than redo the same changes
done to s3 to simplify the interface.

Ldb is slow, to the point it needs haks to pre-open the db to speed it up, yet
that does not solve the lookup speed, with ldb it is always going to be slower.

Looking through the history it is evident that the schannel database doesn't
really need greate expanadability. And lookups are always done with a single
Key. This seem a perfet fit for tdb while ldb looks unnecessarily complicated.

The schannel database is not really a persistent one. It can be discared during
an upgrade without causing any real issue. all it contains is temproary session
data.
2010-02-23 12:46:50 -05:00
Brad Hards
4b024683ac Spelling fixes for source4/auth.
The comment for USER_INFO_INTERACTIVE_LOGON looks like a cut-n-paste from the line above.

Signed-off-by: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
2010-02-22 21:45:37 +01:00
Andrew Bartlett
a9d9447d5a s4:credentials Add hooks to extract a named Kerberos credentials cache
This allows the integration of external tools that can't be linked
into C or python, but need to authenticate as the local machine
account.

The machineaccountccache script demonstrates this, and debugging has
been improved in cli_credentials_set_secrets() by passing back and
error string.

Andrew Bartlett
2010-02-20 17:58:07 +11: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
b630530730 s4-dsdb: added dsdb_search_one() and cleanup dsdb_find_dn_by_guid()
dsdb_find_dn_by_guid() now takes a struct GUID instead of a
guid_string. All the callers in fact wanted a struct GUID, so we now
avoid the extra conversion.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-02-16 21:10:51 +11:00
Andrew Tridgell
0f50f4440d s4-auth: use TYPESAFE_QSORT() in gensec 2010-02-13 22:36:12 +11:00
Matthias Dieter Wallnöfer
d5af819b1a s4:auth/credentials/credentials.c - Initialise the "lm_response" and "nt_response" structures
In some cases those structures are not initialised and the whole authentication
system crashes with a SIGSEGV. Bug discovered by Matthieu Patou in bug #6755.
2010-02-12 15:04:07 +01:00
Matthias Dieter Wallnöfer
e34637b2a6 s4:Remove "Py_RETURN_NONE" compatibility code
This was needed only by Python 2.3 which we no longer support.
2010-02-09 17:53:09 +01:00
Simo Sorce
f77714c887 s4:kdc streamline context initialization
Allow other plugins to init the context without having it try to grab sockets
or set samba specific logging.
2010-01-31 13:30:31 -05:00
Stefan Metzmacher
1c76df6219 s4:auth_sam: avoid usage of data_blob_talloc_reference() and copy the session keys
metze
2010-01-29 11:16:35 +01:00
Simo Sorce
61a4ab36d9 cleanup: remove trailing spaces and tabs 2010-01-28 02:05:05 -05:00
Jelmer Vernooij
f679def4f2 s4: Fix a few warnings. 2010-01-21 16:15:11 +13:00
Andrew Tridgell
29d08bfe26 s4-kerberos: raise the general kerberos debug level to 3
level 2 for every krb request is a bit much
2010-01-16 18:30:22 +11:00
Simo Sorce
3d184399a5 Strip trailing spaces 2010-01-12 13:50:24 -05:00
Stefan Metzmacher
d5cbfbb93a s4:ntlmssp: remove mem_ctx from check_password() callback to match s3
metze
2009-12-29 17:06:25 +01:00
Stefan Metzmacher
f31d144e70 s4:ntlmssp_server: always call ntlmssp_server_postauth() and decide there if it's a noop
metze
2009-12-29 17:06:25 +01:00
Stefan Metzmacher
994d34b949 s4:ntlmssp_server: don't use a mem_ctx for ntlmssp_server_auth()
metze
2009-12-29 17:06:25 +01:00
Stefan Metzmacher
3f04b60fb9 s4:ntlmssp_server: don't use mem_ctx in auth_ntlmssp_check_password()
metze
2009-12-29 17:06:24 +01:00
Stefan Metzmacher
7d4692fa43 s4:ntlmssp_server: clear session key in ntlmssp_server_preauth()
metze
2009-12-29 17:06:24 +01:00
Stefan Metzmacher
dea456089a s4:ntlmssp: use data_blob_null in ntlmssp_server_auth()
metze
2009-12-29 17:06:24 +01:00
Stefan Metzmacher
60b9434492 s4:ntlmssp_server: remove unused variable
metze
2009-12-29 17:06:23 +01:00
Stefan Metzmacher
a8e61ac084 s4:auth/ntlmssp: let get_challenge() return a NTSTATUS and fill a stack buffer
metze
2009-12-29 17:06:23 +01:00
Jelmer Vernooij
fbb59b2dca dsdb: Fix dependencies when building against system ldb. 2009-12-29 16:26:21 +01:00
Stefan Metzmacher
8b68349442 s4:auth: add auth_get_server_info_principal() prototype to auth.h
metze
2009-12-29 12:13:30 +01:00
Stefan Metzmacher
27349a68ea s4:auth: make auth_challenge_may_be_modified() public
metze
2009-12-29 12:13:29 +01:00
Stefan Metzmacher
af25fb55c0 s4:auth: remove autogenerated auth/ntlm/auth_proto.h
metze
2009-12-29 12:13:23 +01:00
Stefan Metzmacher
8ab62799ed s4:ntlmssp: fix whitespaces in ntlmssp.h
metze
2009-12-29 08:18:52 +01:00
Stefan Metzmacher
078482ad0e s4:auth: change auth_check_password_send/recv to tevent_req
metze
2009-12-24 17:38:34 +01:00
Stefan Metzmacher
577857d351 s4:gensec: change gensec_update_send/recv to tevent_req
metze
2009-12-24 17:38:34 +01:00
Andrew Bartlett
585900deb5 s4:gensec Don't give a warning when Windows client connects with NTLM
We have had the workaround for a long time, but at the time the log
warnings remained.

Andrew Bartlett
2009-12-22 17:30:05 +11:00
Andrew Bartlett
0809696dbf s4:auth Change 'get_challenge' API to be more like Samba3
It is just easier to fill in the known to be 8 byte challenge than
stuff about with allocated pointers.

Andrew Bartlett
2009-12-22 17:29:15 +11:00
Andrew Bartlett
383369e8f2 s4:auth generate the prototype file in the right place 2009-12-22 17:29:13 +11:00
Stefan Metzmacher
fae70e1f54 s4:gensec: allow clearing local and remote address by passing NULL
metze
2009-12-16 20:34:15 +01:00
Andreas Schneider
c457d54434 s4-gensec: Remove obsolete socket_address vars and fns. 2009-12-16 20:28:39 +01:00
Andreas Schneider
1e5488859a s4-gensec: Replace gensec_get_peer_addr with new tsocket based fn. 2009-12-16 20:28:38 +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
8ca88042f0 s4-gensec: Replace gensec_get_my_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
743e6363d5 s4-gensec: Added remote and local setter/getter using tsocket. 2009-12-16 20:28:37 +01:00
Andrew Bartlett
609b831462 s4:credentials Put the 'secrets.keytab' in the same directory as secrets.ldb
This avoids trouble when the secrets.ldb is updated with ldbedit but
an smb.conf is not specified.

Andrew Bartlett
2009-11-02 16:36:52 +11:00
Stefan Metzmacher
fab9aff6a2 s4:gensec/schannel: remove unused talloc_reference() in schannel_update()
We never expose creds to the caller in schannel_update().

metze
2009-10-24 11:59:14 +02:00
Andrew Tridgell
3050f83288 s4-python: we need to include Python.h first
If we don't include Python.h first then we get a pile of warnings due
to broken redefines of XOPEN_SOURCE in the Python includes.
2009-10-23 16:23:01 +11:00
Andrew Bartlett
b7f71c9407 s4:gensec Use an index on computerName in schannel.ldb 2009-10-23 15:41:35 +11:00
Andrew Tridgell
4ad0397d8a s4-ldbwrap: added re-use of ldb contexts in ldb_wrap_connect()
This allows us to reuse a ldb context if it is open twice, instead
of going through the expensive process of a full ldb open. We can
reuse it if all of the parameters are the same.

The change relies on callers using talloc_unlink() or free of a parent
to close a ldb context.
2009-10-23 14:52:17 +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
Andrew Tridgell
5e79a86298 s4: ran minimal_includes.pl on source4/auth/gensec 2009-10-20 16:05:24 +11:00
Andrew Tridgell
f8109b0f49 s4: ran minimal_includes.pl on source4/auth/ntlmssp 2009-10-20 16:05:07 +11:00
Andrew Tridgell
49650a226e s4: ran minimal_includes.pl on source4/auth/ntlm 2009-10-20 16:05:03 +11:00
Endi S. Dewata
180ca8ed88 s4:auth - fixed problem reading bind DN from secrets database 2009-10-16 14:08:11 +02:00
Matthias Dieter Wallnöfer
925e96029e s4:auth_sam: Restructure tail in "authsam_get_server_info_principal" and fix a memory leak 2009-10-16 14:06:30 +02:00
Matthias Dieter Wallnöfer
ea60b72c46 s4:ntlmssp server - use also here the new "lp_dnsdomain()" call 2009-10-15 10:32:16 +02:00
Matthias Dieter Wallnöfer
3bd452e3f6 s4:auth/credentials/credentials - fix uninitalised pointers
This should fix bug #6755.
2009-10-15 10:32:12 +02: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 Tridgell
5a5c30cb38 s4-pygensec: a bit closer to working
I'll need help from Andrew on how to get gensec to initialise it's ops
element
2009-10-02 18:50:59 +10:00
Jelmer Vernooij
6a79ad7664 gensec: Avoid exposing lp_ctx on the API level. 2009-09-26 20:55:18 +02:00
Jelmer Vernooij
52a17e5c32 pygensec: Add initial work on a gensec Python module. 2009-09-26 19:41:59 +02:00
Matthias Dieter Wallnöfer
85276e120c s4:auth/gensec/schannel - fix a const warning 2009-09-25 10:59:13 +02:00
Stefan Metzmacher
36e889f2cf s4:schannel: fix some compiler warnings
If we only do signing we can pass down a const data buffer.

metze
2009-09-25 05:20:16 +02:00
Andrew Tridgell
ced2429dfa s4-auth: add SID_NT_ENTERPRISE_DCS is a server trust account 2009-09-19 19:40:03 -07:00
Andrew Tridgell
52f2e26a25 s4-sam: add a note about the solaris client 2009-09-17 15:19:31 -07:00
Kouhei Sutou
f8dae40fc8 spnego: Support ASN.1 BIT STRING and use it in SPNEGO.
Signed-off-by: Günther Deschner <gd@samba.org>
2009-09-17 20:10:54 +02:00
Günther Deschner
503d035814 spnego: share spnego_parse.
Guenther
2009-09-17 01:12:20 +02:00
Stefan Metzmacher
033ced60ac libcli/auth: rewrite schannel sign/seal code to be more generic
This prepares support for HMAC-SHA256/AES.

metze
2009-09-16 12:29:06 +02:00
Günther Deschner
f3979b50a9 schannel: move schannel_sign to main directory.
Guenther
2009-09-16 01:54:59 +02:00
Günther Deschner
1a21db8ea1 s4-schannel: try to fix the build.
Guenther
2009-09-16 01:07:26 +02:00
Günther Deschner
1f4123677e s4-schannel: first step of decoupling schannel from gensec.
Guenther
2009-09-16 00:16:04 +02:00
Günther Deschner
9cb205d753 s4-schannel: strip trailing whitespace.
Guenther
2009-09-16 00:13:20 +02:00
Günther Deschner
8b0f54027c s4-schannel: use NL_AUTH_MESSAGE for schannel.
Guenther
2009-09-13 06:50:11 +02:00
Günther Deschner
760666c107 s4-schannel: strip trailing whitespace.
Guenther
2009-09-13 06:50:03 +02:00
Nadezhda Ivanova
269fe99a62 Added "admin_session" method.
The purpose of admin_session is to be able to execute parts of provisioning
as the user Administrator in order to have the correct group and owner in the
security descriptors. To be used for provisioning and tests only.
2009-09-09 18:57:50 +10:00
Matthias Dieter Wallnöfer
88f546dfd9 s4:sam - Implement also here the right primary group behaviour
We have not only to expand the additional groups but *also* the primary group to
gain all rights of a user account.

Also, remove an unneeded context (tmp_ctx) and "talloc_steal".
2009-09-07 08:37:24 +02:00
Günther Deschner
074c6d4214 s4: include ntlmssp header in auth/ntlmssp/ntlmssp.h.
Guenther
2009-08-28 13:43:35 +02:00
Günther Deschner
38d677bdf2 s4-ntlmssp: use interface constants in TargetInfo blob.
Guenther
2009-08-28 10:09:13 +02:00
Günther Deschner
e8c19f31b3 s4-ntlmssp: use NTLMSSP headers from IDL and remove duplicate constants.
Guenther
2009-08-28 10:09:06 +02:00
Günther Deschner
17d3800e92 s4-schannel: add ldb suffix to schannel functions.
Guenther
2009-08-27 15:55:18 +02: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 Tridgell
fd43e0ee09 added a uid_wrapper library
This library intercepts seteuid and related calls, and simulates them
in a manner similar to the nss_wrapper and socket_wrapper
libraries. This allows us to enable the vfs_unixuid NTVFS module in
the build farm, which means we are more likely to catch errors in the
token manipulation.

The simulation is not complete, but it is enough for Samba4 for
now. The major areas of incompleteness are:

 - no emulation of setreuid, setresuid or saved uids. These would be
   needed for use in Samba3

 - no emulation of ruid changing. That would also be needed for Samba3

 - no attempt to emulate file ownership changing, so code that (for
   example) tests whether st.st_uid matches geteuid() needs special
   handling
2009-08-05 10:51:00 +10:00
Matthias Dieter Wallnöfer
0e87f07fc0 s4: Change my nested groups patch to don't include user's SID itself in the "groupSID"s structure 2009-08-04 17:21:39 +02:00
Matthieu Patou
c50dff4cce Return infinite time for last last logoff when last logoff = 0 2009-08-03 14:08:15 +10:00
Stefan Metzmacher
7d470fdb1b s4:auth: make sure we have elements returned at all in authsam_expand_nested_groups()
metze
2009-07-31 14:40:29 +02:00
Matthias Dieter Wallnöfer
71b013f4de s4: Patch to implement nested group and privileges
This patch adds a function "authsam_expand_nested_groups" (calculation of rights
through expanding groups of a certain SID) which basically collects all
memberships through "memberOf" attributes. It works with either user or group SIDs.
For avoiding loops it tests on each call if the SID hasn't been added yet (through
the helper function "sids_contains_sid").
The function itself is called by "authsam_make_server_info".
2009-07-31 14:40:29 +02:00
Stefan Metzmacher
7204ea422b s4:gensec/spnego: only generate the mechListMic when the server expects it
This fixes the ntvfs.cifs tests.

metze
2009-07-28 12:16:13 +02: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
Stefan Metzmacher
210181de75 s4:gensec_gssapi: pass the correct oid to the gssapi layer.
metze
2009-07-24 09:48:13 +02:00
Stefan Metzmacher
c00e4040bc s4:gensec/spengo: make sure we send the blob with the micListMech signature to the peer
We should even do this if the submech has no more data to send.

metze
2009-07-24 09:38:30 +02: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
e16a2a1fa9 s4:gensec Rework gensec_krb5 mutual authentication defaults
When emulating Samba3 (which we do to ensure we don't break
compatability), don't do mutual authentication by default, as it
breaks the session key with AES and isn't what Samba3 does anyway.

Andrew Bartlett
2009-07-16 09:23:36 +10:00
Andrew Bartlett
bc354fb1a6 s4:gensec Allow mutual auth to be turned off in 'fake_gssapi_krb5'
This allows the older 'like Samba3' GENSEC krb5 implementation to work
against Windows 2008.  I'm using this to track down interop issues in
this area.

Andrew Bartlett
2009-07-16 09:23:35 +10:00
Stefan Metzmacher
57afa1edeb s4:auth/ntlmssp: let _unwrap fallback to seal if sign only doesn't work
s4:auth/ntlmssp: let _unwrap fallback to seal if sign only doesn't work

Windows always uses SEAL with NTLMSSP on LDAP connection even if not negotiated.

metze
2009-07-08 13:15:22 +02:00
Andrew Bartlett
6dd6ccbdc9 s4:auth It is easier to copy the session key than get talloc right.
The session keys as supplied already have a reference on them, so
stealing them creates challenges.  For 16 bytes, it is just easier to
be consistant and copy them.

Andrew Bartlett
2009-07-07 13:27:47 +10:00
Andrew Tridgell
6a192020a2 gensec_start now steals the auth_context 2009-07-01 15:15:37 +10:00
Andrew Tridgell
08ed6a2281 another case that should use py_talloc_reference 2009-07-01 15:15:37 +10:00
Andrew Tridgell
f7a6206b55 removed a redundent talloc_steal 2009-07-01 15:15:36 +10:00
Andrew Tridgell
b2c3c08b46 fixed the use of talloc_steal in ntlmssp_server
The previous use of talloc_steal could cause a steal of a pointer that
had references. This ensures that doesn't happen
2009-07-01 15:15:36 +10:00
Don Davis
9aff7b0b59 Rework the kerberos-notes.txt in order and format
This reworks the notes file to be less stream-of-consciousness and more
task for porting, with a very particular focus on a potential port of
Samba4 to use MIT Kerberos.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2009-06-30 18:12:02 +10:00
Kai Blin
4250eab4b5 s4 auth_winbind: Internally, info3 has utf8 buffers, not utf16 buffers.
Thanks to gd for the catch.
2009-06-25 21:36:49 +02:00
Kai Blin
309924e5c1 s4 auth_winbind: Don't allocate the rids for the info3 structure within the loop 2009-06-25 19:38:51 +02:00
Kai Blin
946beae010 s4: Add libwbclient backend to auth_winbind 2009-06-25 19:18:40 +02:00
Matthias Dieter Wallnöfer
2627c6c0c2 Fixed some uninitialised variables
I tried hard to not change the program logic. Should fix bug #6439.
2009-06-19 11:32:01 +10:00
Andrew Bartlett
6620489e7f Remove unused variable 2009-06-18 14:02:13 +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
0ac46b00ab s4:gensec Print GSSAPI error message when unable to find PAC 2009-06-18 13:49:30 +10:00
Jelmer Vernooij
7b8fcacda2 pycredentials: Raise MemoryError when unable to create objects. 2009-06-17 20:45:38 +02:00
Jelmer Vernooij
d4172bbcc5 pycredentials: Fix memory leak. 2009-06-17 20:45:38 +02: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
Donald T. Davis
9e7501b2cb Clarify and expand the Kerberos notes made by Andrew Bartlett in 2005
Compiled with Andrew over a series of phone calls and gobby sessions,
with the aim of documenting Kerberos requirements for Samba to us an
alternate (ie, MIT) Kerberos library.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2009-06-10 11:38:27 +10:00
Andrew Bartlett
fbde0011e6 Remove copy of kerberos-notes.txt added in incorrect location 2009-06-10 11:37:49 +10:00
Donald T. Davis
8e1b848aed Clarify and expand the Kerberos notes made by Andrew Bartlett in 2005
Compiled with Andrew over a series of phone calls and gobby sessions
with Andrew, with the aim of documenting Kerberos requirements for
Samba to us an alternate (ie, MIT) Kerberos library.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2009-06-10 11:19:18 +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
Jelmer Vernooij
6ace18904d Fix more unresolved symbols. 2009-06-02 18:05:41 +02:00
Jelmer Vernooij
fe2b04b4bb python: Move helper functions for using param into a separate file rather
than linking against the python module.
2009-06-02 18:05:40 +02:00
Jelmer Vernooij
f90782f228 Fix dependencies when using shared libraries. 2009-06-02 18:05:39 +02:00
Andrew Tridgell
a9542ba21b use domain_dn not ncname
fixed up from previous patch that removed the use of crossref records
2009-05-26 14:47:11 +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
Andrew Tridgell
b335618d17 fixed interpretation of ACB_PWNOTREQ
This bit actually means that we should ignore the minimum password
length field for this user. It doesn't mean that the password should
be seen as empty
2009-05-25 15:23:54 +10:00
Andrew Bartlett
7a54cd041e Remove unused headers 2009-04-19 22:01:09 +02:00
Andrew Bartlett
dbcd80ed01 Fix Samba4 build errors with common libcli/samsync 2009-04-16 10:17:17 +10:00
Andrew Bartlett
d78cdc5fe2 Rework to use new API for common netlogon credential chaining 2009-04-14 16:23:45 +10:00
Andrew Bartlett
5095d7b1c8 Rework Samba4 to use the new common libcli/auth code
In particular, this is the rename from creds_ to netlogon_creds_, as
well as other links to use the new common crypto.

Andrew Bartlett
2009-04-14 16:23:44 +10:00
Andrew Bartlett
f23eea294a Push schannel_state.c into the top level.
This is the server side state for netlogon credential chaining

Andrew Bartlett
2009-04-14 16:23:43 +10:00
Andrew Bartlett
6c8f7e4005 Port Samba4 to the new combined libcli/auth functions
For example, some of the new shared functionality was previously in the wkssvc
torture test.

Andrew Bartlett
2009-04-14 16:23:41 +10:00
Andrew Bartlett
a19966375a Move ntlm_check.h into the common libcli/auth 2009-04-14 16:23:41 +10:00
Andrew Bartlett
9feea7fa4c Move MSRPC-PARSE into the common libcli/auth
This is a depenceny of smbencrypt.c
2009-04-14 14:19:39 +10:00
Andrew Bartlett
927a8b3304 Move libcli/auth to the top level 2009-04-14 14:19:39 +10:00
Jelmer Vernooij
1e200c1952 Merge branch 'master' of git://git.samba.org/samba 2009-03-26 15:31:02 +01:00
Stefan Metzmacher
4d96417931 s4:auth/credentials: use krb5_data_free()
metze
2009-03-26 15:01:02 +01:00
Stefan Metzmacher
8a264753a1 s4:auth/credentials: include gssapi/gssapi_krb5.h
metze
2009-03-26 15:01:02 +01:00
Jelmer Vernooij
4478756571 Strip /usr/include from include flags, so we don't end up including
the system tevent if it's too old.
2009-03-15 18:10:20 +01:00
Jelmer Vernooij
7972d82436 Remove -L/usr/lib from a couple more make variables. 2009-03-15 00:54:55 +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
cd6026135d Push sam_get_server_info_principal into the auth subsystem
This means it must be accessed via the supplied auth_context in the
GENSEC server, and should remove the hard depenceny of GENSEC on the
auth subsystem and ldb (allowing LDB not to rely on LDB is considered
a good thing, apparently)

Andrew Bartlett
2009-02-13 14:02:49 +11: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
40c3ab2fbc s4:auth/ntlm: fix c++ warning
metze
2009-02-05 18:18:09 +01:00
Stefan Metzmacher
c8b9679e40 s4:pyauth: fix compiler warnings
metze
2009-02-05 17:48:13 +01:00
Stefan Metzmacher
0872fa7b1f s4:pycredentials: fix compiler warnings
metze
2009-02-05 17:48:12 +01:00
Stefan Metzmacher
eb012dd212 s4:auth/credentials: the python bindings don't use swig anymore
metze
2009-02-02 15:16:09 +01:00
Stefan Metzmacher
426dc44c5c s4:auth: the python bindings don't use swig anymore
metze
2009-02-02 15:16:09 +01:00
Stefan Metzmacher
2e82a4ced2 s4:auth/kerberos: s/private/private_data
metze
2009-02-02 13:08:05 +01:00
Stefan Metzmacher
e7454d46d4 s4:auth/gensec: s/private/private_data
metze
2009-02-02 13:08:04 +01:00
Simo Sorce
1dc745ec89 Make schannel not depend on samdb anymore. 2009-02-01 13:06:38 -05:00
Stefan Metzmacher
582b27be24 s4:auth: try to fix the build on Solaris
MAXHOSTNAMELEN comes in via system/network.h now.

metze
2009-01-31 11:34:12 +01:00
Jelmer Vernooij
c9d193eb08 Add prototypes required by samba-gtk. 2009-01-25 05:32:30 +01:00
Stefan Metzmacher
a83feb2fe3 s4:auth: move make_server_info_netlogon_validation() function arround
metze
2009-01-21 13:36:11 +01:00
Jelmer Vernooij
ba5d6e6d70 Avoid using a utility header for Python replacements included in Samba,
since this will not be shipped with talloc/tdb/tevent/etc.
2009-01-08 12:20:20 +01:00
Tim Prouty
61a23c5eea s3/s4 build: Fix Py_RETURN_NONE to work with python versions < 2.4 2009-01-07 15:03:16 -08:00
Jelmer Vernooij
d2c70d24e1 py: Properly increase the reference counter of Py_None. 2009-01-06 04:13:57 +01:00
Stefan Metzmacher
c72cbce6ee s4:auth/kerberos: convert to tevent_* api
metze
2009-01-03 19:58:56 +01:00
Stefan Metzmacher
5fa0d3d568 s4:socket: use a socket_wrapper aware function to auto close the fd event for sockets
metze
2009-01-03 19:58:53 +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
Jelmer Vernooij
1feab85be6 Rename samba-socket -> samba_socket to fix a couple more compiler
warnings.
2008-12-24 00:15:43 +01:00
Matthias Dieter Wallnöfer
7c6a20a439 Add missing includes, required for use of gensec by 3rd-party
applications.
2008-12-23 20:17:59 +01:00
Jelmer Vernooij
05adbbc8c9 s4: Always link in auth, as some of the core infrastructure depends on it. 2008-12-22 18:12:22 +01:00
Jelmer Vernooij
d58270c537 Add header for pyparam. 2008-12-22 04:38:57 +01:00
Jelmer Vernooij
6efb7ff981 Fix various Python-related bugs. 2008-12-21 07:34:27 +01:00
Jelmer Vernooij
f36ff0bac2 Include errors.i verbatim in security.i, as it's the only file still using it. 2008-12-21 05:35:39 +01:00
Jelmer Vernooij
263c6670fc Convert credentials Python module to "manual" C - no SWIG used to generate
the C code.
2008-12-21 05:29:23 +01:00
Jelmer Vernooij
bfb29e94b1 Convert auth python module to "plain" C rather than using SWIG. 2008-12-21 03:37:31 +01:00
Stefan Metzmacher
fc31f2c526 s4:lib/socket: socket_connect_send() and socket_connect_ev() should only wrok with addresses
metze
2008-12-18 13:32:51 +01:00
Stefan Metzmacher
081f8883ba s4: fix LIBEVENTS dependencies and use more forward declarations
We should only include events.h where we really need it
and prefer forward declarations of 'struct event_context'

metze
2008-12-17 11:04:45 +01:00
Stefan Metzmacher
180245fce0 s4:kdc: allow a trusted domain to get kerberos tickets
metze
2008-12-04 15:45:16 +01:00
Tim Prouty
1115b7b342 s3/s4 build: Fix execinfo and sasl build error when the libs/headers are in non-standard locations.
These configure checks have the correct flags at configure time, so
let's pass them through so they are used at compile time.
2008-11-18 17:43:51 -08:00
Jelmer Vernooij
b45caa44e1 Fix the build. 2008-11-02 23:58:49 +01:00
Jelmer Vernooij
1e053df95c Remove use of global_loadparm for disabled gensec backends. 2008-11-02 19:28:17 +01:00
Jelmer Vernooij
ff36c52d8c Remove another use of global_loadparm.
Eventually, we should move some of these parameters into a separate
struct (perhaps into smb_transport_options?), to avoid the long lists of
parameters.
2008-11-02 16:07:28 +01:00
Jelmer Vernooij
c537f7a914 Fix the build. 2008-11-02 05:49:36 +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
a76adc5397 Remove two debug parameters, not used anywhere.
Andrew, I was pretty sure these could be removed but if not, please let
me know.
2008-11-02 01:03:46 +01:00
Jelmer Vernooij
7a6190e9a7 Remove another use of global_loadparm. 2008-11-02 01:03:26 +01:00
Jelmer Vernooij
3a6b88f9f9 Remove unused argument iconv_convenience. 2008-11-01 20:58:41 +01:00
Jelmer Vernooij
8c4e2eb49d Remove use of lp_*() from ntlm_check.c. 2008-11-01 17:55:57 +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
8b06312f7e Eliminate another instance of global_loadparm. 2008-10-24 13:13:27 +02:00
Jelmer Vernooij
922a29992e Remove iconv_convenience parameter from simple string push/pull
functions.
2008-10-24 03:40:09 +02:00
Jelmer Vernooij
87ec1d2532 Make sure prototypes are always included, make some functions static and
remove some unused functions.
2008-10-20 18:59:51 +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
235e68f7b7 Remove unused variable. 2008-10-15 00:09:08 +02:00
Jelmer Vernooij
1b99d8fbb5 Use common util_file code. 2008-10-12 17:34:43 +02:00
Jelmer Vernooij
218f482fbf Use common strlist implementation in Samba 3 and Samba 4. 2008-10-12 00:56:56 +02:00
Jelmer Vernooij
9565999755 Fix include paths to new location of libutil. 2008-10-11 21:31:42 +02:00
Jelmer Vernooij
caa4e42860 Move lib/util from source4 to top-level libutil.
Conflicts:

	source4/Makefile
2008-10-11 21:05:38 +02:00
Jelmer Vernooij
2c4391e950 Provide the same set of helper functions for DEBUG in Samba 3 and Samba
4, even though the macros are still different.

This makes it possible to use object code compiled with one DEBUG()
macro from the other sourceX directory.
2008-10-11 20:44:19 +02:00
Stefan Metzmacher
999b69d176 s4:gensec: pass down want_features to the spnego backend mech
metze
2008-10-06 19:21:44 +02:00
Andrew Tridgell
f84093df86 Merge branch 'master' of ssh://git.samba.org/data/git/samba 2008-09-30 13:02:09 -07:00
Jelmer Vernooij
181ee01da6 Pass session options around; saves another use of global_loadparm. 2008-09-30 02:47:19 +02:00