1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-03 04:23:50 +03:00
Commit Graph

90 Commits

Author SHA1 Message Date
Andrew Tridgell
248f3265e6 r19325: leak fix from lha 2007-10-10 14:21:09 -05:00
Andrew Bartlett
90b01b8af2 r18826: Allow 'enterprise' principal names to log in.
These principals do not need to be in the same realm as the rest of
the ticket, the full principal name is in the first componet of the
ASN.1.

Samba4's backend will handle getting this to the 'right' place.

Andrew Bartlett
2007-10-10 14:19:14 -05:00
Andrew Tridgell
95455b5789 r18528: work around what appears to be a compiler bug in gcc on irix. It
caused the RPC-SECRETS test to crash smbd in an inlined version of
this memcmp() call. This patch should have absolutely no effect at
all, but in fact it prevents the crash.

Disassembling at the point of the crash, it shows that gcc is inlining
the memcmp(). I don't know enough MIPS assembler to actually spot the
bug. In case anyone reading this does know MIPS assembler, here is the
gcc generated code that crashes:

0x105e0218 <gssapi_krb5_verify_header+168>:     lw      $t1,52($sp)
0x105e021c <gssapi_krb5_verify_header+172>:     lw      $t1,0($t1)
0x105e0220 <gssapi_krb5_verify_header+176>:     lhu     $t1,0($t1)
0x105e0224 <gssapi_krb5_verify_header+180>:     lw      $t2,68($sp)
0x105e0228 <gssapi_krb5_verify_header+184>:     lhu     $t2,0($t2)
0x105e022c <gssapi_krb5_verify_header+188>:     subu    $t1,$t1,$t2

it gets a segv at 0x105e0220.

lha, what do you think of this? The change should be innocuous on all
other platforms, apart from making the code harder to read :(
2007-10-10 14:18:42 -05:00
Andrew Tridgell
9034238e27 r18322: fixed a compilation problem on AIX caused by lex not putting config.h
first. That leads to a conflicting define for lseek() due to
_LARGE_FILES being defined after standards headers are included
2007-10-10 14:18:08 -05:00
Andrew Tridgell
3697cd6597 r18308: get this right .... 2007-10-10 14:18:06 -05:00
Andrew Tridgell
1f38a7ea56 r18300: fixed a type bug in heimdal - lha, you happy with this upstream? It
showed up on ia_64 systems
2007-10-10 14:18:04 -05:00
Andrew Tridgell
92742b8999 r18204: darn, compilers always look in the directory the source is in for
headers with "" even with a -I override. That means our heimdal_build/
roken override doesn't work.

Switching to <> style includes in roken fixes this. lha, would be be
acceptable upstream? I notice that half your includes of roken.h are
with <> now anyway, so should be harmless (and even more consistent!)
2007-10-10 14:17:49 -05:00
Jelmer Vernooij
fe7ca4b145 r18031: Merge my replace fixes:
* libreplace can now build stand-alone
 * add stub testsuite for libreplace
 * make talloc/tdb/ldb use libreplace
2007-10-10 14:17:05 -05:00
Andrew Bartlett
99ce2ecf39 r17986: Add a copy of the Heimdal licence to our source tree, to make it very
clear what the conditions on this code are, and that the terms are GPL
compatible.

Andrew Bartlett
2007-10-10 14:17:01 -05:00
Jelmer Vernooij
f7afa1cb77 r17930: Merge noinclude branch:
* Move dlinklist.h, smb.h to subsystem-specific directories
 * Clean up ads.h and move what is left of it to dsdb/
   (only place where it's used)
2007-10-10 14:16:54 -05:00
Andrew Bartlett
df2e4f061f r16235: Don't update minor_status when cleaning up on error. This restores
sensible log messages to gensec_gssapi.

Andrew Bartlett
2007-10-10 14:09:07 -05:00
Gerald Carter
26a2fa97e4 r16100: Patch from Michael Wood <mwood@icts.uct.ac.za>: s/then/than/ for correct grammar 2007-10-10 14:08:59 -05:00
Andrew Bartlett
ae2913898c r16056: Fix errors found by trying to use our kpasswd server and the Apple client.
Andrew Bartlett
2007-10-10 14:08:54 -05:00
Stefan Metzmacher
ecff7b70aa r16000: - use uint16_t instead of u_int16_t
- use int32_t for seq_number

both changes let us use the types which the main heimdal code uses

metze
2007-10-10 14:08:48 -05:00
Stefan Metzmacher
e1842c9b55 r15993: don't use u_int32_t, as the main heimdal code also don't use
it anymore

metze
2007-10-10 14:08:47 -05:00
Andrew Tridgell
acfaa98b5e r15953: our timegm() replacement still doesn't work, so grab the one from
Heimdal which does work. This should fix most of the rest of the
failures on solaris
2007-10-10 14:08:44 -05:00
Andrew Bartlett
0132312124 r15515: Syncronsise with current lorikeet-heimdal.
Andrew Bartlett
2007-10-10 14:05:45 -05:00
Andrew Bartlett
4b44355d42 r15491: Always initialise is_cfx (found by Valgrind)
Always remember to free the crypto context (found by Luke Howard)
2007-10-10 14:05:41 -05:00
Andrew Bartlett
120374f5f9 r15484: Make accept_security_context() more compatible with how Samba3 (and
similarly built clients) behave.

This is better than just ignoring the checksum, if it isn't the GSSAPI
checksum.  (Samba4 clients in Samba3 mode use more than just the MD5
checksum, and will use a signed AES checksum if available.  Actual
samba3 may well do the same in future, against a suitable KDC).

Also a change for easier debugging of checksum issues.

Andrew Bartlett
2007-10-10 14:05:39 -05:00
Andrew Bartlett
ef5604b877 r15481: Update heimdal/ to match current lorikeet-heimdal.
This includes many useful upstream changes, many of which should
reduce warnings in our compile.

It also includes a change to the HDB interface, which removes the need
for Samba4/lorikeet-heimdal to deviate from upstream for hdb_fetch().
The new flags replace the old entry type enum.

(This required the rework in hdb-ldb.c included in this commit)

Andrew Bartlett
2007-10-10 14:05:39 -05:00
Andrew Bartlett
f0e538126c r15192: Update Samba4 to use current lorikeet-heimdal.
Andrew Bartlett
2007-10-10 14:04:15 -05:00
James Peach
76dea9f68c r15155: Add strsep replacement from heimdal 0.7.2 for systems that don't
have strsep in libc.
2007-10-10 14:04:12 -05:00
Andrew Tridgell
dca9003ec2 r14949: re-add the two lex.c files for heimdal, these are needed for systems
that don't have bison/flex. If we auto-generate these on samba.org we
can delete these again.
2007-10-10 14:00:22 -05:00
Stefan Metzmacher
02703f4e8f r14711: let windows clients retry after getting ERR_SKEW
metze
2007-10-10 13:59:11 -05:00
Andrew Bartlett
bdb55ce2b5 r14707: Initialise default value (the rest of this function sets it to 1 if
this is CFX).

Caught by Valgrind.

Andrew Bartlett
2007-10-10 13:59:11 -05:00
Andrew Bartlett
a5c2b4cc92 r14635: - Remove lex.c from SVN (it is built anyway, and having it in SVN
confuses things)

- Update Samba4 from lorikeet-heimdal

- Remove generated symlink on make clean

Andrew Bartlett
2007-10-10 13:59:02 -05:00
Jelmer Vernooij
303832bdc9 r14605: Create heimdal/lib/des/hcrypto symlink if it doesn't exist 2007-10-10 13:59:00 -05:00
Jelmer Vernooij
2c7b62a861 r14281: Pull apart LIBDIR and MODULESDIR
Move architecture-independent data to DATADIR (was LIBDIR)
2007-10-10 13:57:07 -05:00
Andrew Bartlett
97a0a0e2fa r14198: Update Samba4 to current lorikeet-heimdal.
Andrew Bartlett
2007-10-10 13:56:58 -05:00
Andrew Bartlett
cfd0df16b7 r13481: As far as I can tell, my changes in -r 12863 were dangerously untested.
We do need the gsskrb5_get_initiator_subkey() routine.  But we should
ensure that we do always get a valid key, to prevent any segfaults.

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

Andrew Bartlett
2007-10-10 13:51:55 -05:00
Andrew Bartlett
38809b43a5 r13144: This seems to be required for Samba4 to talk to Samba4, and to get the
same session key.  I need to understand this more, but it works
samba/samba, and I don't have access to windows doing AES (longhorn)
yet.

Andrew Bartlett
2007-10-10 13:51:28 -05:00
Andrew Bartlett
849500d1aa r13107: Follow the lead of Heimdal's kpasswdd and use the HDB (hdb-ldb in our
case) as the keytab.

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

Andrew Bartlett
2007-10-10 13:51:26 -05:00
Andrew Bartlett
ec11870ca1 r12863: As lha suggested to me a while back, it appears that the
gsskrb5_get_initiator_subkey() routine is bougs.  We can indeed use
gss_krb5_get_subkey().

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

Andrew Bartlett
2007-10-10 13:50:55 -05:00
Jelmer Vernooij
6391761601 r12696: Reduce the size of include/structs.h 2007-10-10 13:49:40 -05:00
Andrew Bartlett
8fd5224c6b r12269: Update to current lorikeet-heimdal. This changed the way the hdb
interface worked, so hdb-ldb.c and the glue have been updated.

Andrew Bartlett
2007-10-10 13:47:26 -05:00
Andrew Bartlett
d5a2de8ef0 r12037: Fix malloc corruption caused by double-free(), where realloc(ptr, 0)
is equivilant to free().

This is the issue tridge was seeing in the MEMORY: keytab code.

Andrew Bartlett
2007-10-10 13:47:01 -05:00
Andrew Bartlett
2426581dfb r12000: Update to current lorikeet-heimdal, including in particular support
for referencing an existing in-MEMORY keytab (required for the new way
we push that to GSSAPI).

Andrew Bartlett
2007-10-10 13:46:57 -05:00
Andrew Bartlett
6b75573df4 r11995: A big kerberos-related update.
This merges Samba4 up to current lorikeet-heimdal, which includes a
replacement for some Samba-specific hacks.

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

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

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

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

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

krb5Keytab: FILE:/etc/krb5.keytab

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

privateKeytab: secrets.keytab

is set, pointing to allow the whole private directory to be moved
without breaking the internal links.
2007-10-10 13:46:56 -05:00
Andrew Bartlett
9b3dedbc0b r11940: Love has clarified why this code does what it does.
Andrew Bartlett
2007-10-10 13:46:49 -05:00
Andrew Bartlett
eaf8777e44 r11931: Add a short README explaining what this directory is all about.
Andrew Bartlett
2007-10-10 13:46:49 -05:00
Andrew Bartlett
328fa186f2 r11930: Add socket/packet handling code for kpasswdd
Allow ticket requests with only a netbios name to be considered 'null'
addresses, and therefore allowed by default.

Use the netbios address as the workstation name for the allowed
workstations check with krb5.

Andrew Bartlett
2007-10-10 13:46:48 -05:00
Andrew Bartlett
31c4ab26d7 r11568: Debuging aids: Let the administrator know when a key/entry expired,
rather than just the fact of the expiry.

Andrew Bartlett
2007-10-10 13:45:54 -05:00
Andrew Bartlett
36973b1eef r11543: A major upgrade to our KDC and PAC handling.
We now put the PAC in the AS-REP, so that the client has it in the
TGT.  We then validate it (and re-sign it) on a TGS-REQ, ie when the
client wants a ticket.

This should also allow us to interop with windows KDCs.

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

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

Andrew Bartlett
2007-10-10 13:45:52 -05:00
Andrew Bartlett
dbf73a82fc r11542: Add the netbios name type. We will need it when we start to handle
allowedWorkstations on Krb5.

Andrew Bartlett
2007-10-10 13:45:51 -05:00
Andrew Bartlett
6bb1b24428 r11541: More logical (I think...) delegation semantics.
Andrew Bartlett
2007-10-10 13:45:51 -05:00
Andrew Bartlett
4315836cd8 r11536: Add a hook for client-principal access control to hdb-ldb, re-using
the code in auth/auth_sam.c for consistancy.  This will also allow us
to have one place for a backend directory hook.

I will use a very similar hook to add the PAC.

Andrew Bartlett
2007-10-10 13:45:50 -05:00
Andrew Bartlett
da0ff19856 r11529: Disable DNS lookups for forwarded credentials, unless really, really
wanted.  There is nothing that suggests that the host we forward
credentials to will not have other interfaces, unassoicated with their
service name.  Likewise, the name may be a netbios, not DNS name.

This should avoid some nasty DNS lookups.

Andrew Bartlett
2007-10-10 13:45:49 -05:00
Andrew Bartlett
e60cdb63fb r11477: This seems really nasty, but as I understand it an attacker cannot
change this checksum, as it is inside the encrypted packets.

Where the client (such as Samba3) fakes up GSSAPI, allow it to
continue.  We can't rid the world of all Samba3 and similar clients...

Andrew Bartlett
2007-10-10 13:45:42 -05:00
Andrew Bartlett
d6928a3bf8 r11469: Fix typo, and use the correct (RFC4120) session key for delegating
credentials.  This means we now delegate to windows correctly.

Andrew Bartlett
2007-10-10 13:45:40 -05:00
Andrew Bartlett
fd5fd03570 r11468: Merge a bit more of init_sec_context from Heimdal CVS into our
DCE_STYLE modified version, and add parametric options to control
delegation.

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

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

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

Andrew Bartlett
2007-10-10 13:45:40 -05:00