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

168 Commits

Author SHA1 Message Date
Volker Lendecke
846e939260 r17089: Fix a possible null dereference and some memleaks.
Jerry, please check.

Thanks,

Volker
(This used to be commit b87c495221)
2007-10-10 11:38:11 -05:00
Gerald Carter
060b155cd2 r16952: New derive DES salt code and Krb5 keytab generation
Major points of interest:

* Figure the DES salt based on the domain functional level
  and UPN (if present and applicable)
* Only deal with the DES-CBC-MD5, DES-CBC-CRC, and RC4-HMAC
  keys
* Remove all the case permutations in the keytab entry
  generation (to be partially re-added only if necessary).
* Generate keytab entries based on the existing SPN values
  in AD

The resulting keytab looks like:

ktutil:  list -e
slot KVNO Principal
---- ---- ---------------------------------------------------------------------
   1    6 host/suse10.plainjoe.org@COLOR.PLAINJOE.ORG (DES cbc mode with CRC-32)
   2    6 host/suse10.plainjoe.org@COLOR.PLAINJOE.ORG (DES cbc mode with RSA-MD5)
   3    6 host/suse10.plainjoe.org@COLOR.PLAINJOE.ORG (ArcFour with HMAC/md5)
   4    6           host/suse10@COLOR.PLAINJOE.ORG (DES cbc mode with CRC-32)
   5    6           host/suse10@COLOR.PLAINJOE.ORG (DES cbc mode with RSA-MD5)
   6    6           host/suse10@COLOR.PLAINJOE.ORG (ArcFour with HMAC/md5)
   7    6               suse10$@COLOR.PLAINJOE.ORG (DES cbc mode with CRC-32)
   8    6               suse10$@COLOR.PLAINJOE.ORG (DES cbc mode with RSA-MD5)
   9    6               suse10$@COLOR.PLAINJOE.ORG (ArcFour with HMAC/md5)

The list entries are the two basic SPN values (host/NetBIOSName & host/dNSHostName)
and the sAMAccountName value.  The UPN will be added as well if the machine has
one. This fixes 'kinit -k'.

Tested keytab using mod_auth_krb and MIT's telnet.  ads_verify_ticket()
continues to work with RC4-HMAC and DES keys.
(This used to be commit 6261dd3c67)
2007-10-10 11:19:15 -05:00
Jeremy Allison
fbdcf2663b r16945: Sync trunk -> 3.0 for 3.0.24 code. Still need
to do the upper layer directories but this is what
everyone is waiting for....

Jeremy.
(This used to be commit 9dafb7f48c)
2007-10-10 11:19:14 -05:00
Günther Deschner
7048040be8 r16862: Reverting accidential changes in ads_try_connect() from previous commit.
Guenther
(This used to be commit 6257f9af93)
2007-10-10 11:19:12 -05:00
Günther Deschner
f3e71c6072 r16861: Fixing crash bug when passing no domain/realm name to the CLDAP request.
Guenther
(This used to be commit 863aeb621a)
2007-10-10 11:19:11 -05:00
Günther Deschner
67d8c7432f r16836: When receiving a CLDAP reply make sure that we always store the correct
netbios domain name in server affinity cache.

Guenther
(This used to be commit 08958411ee)
2007-10-10 11:19:11 -05:00
Jeremy Allison
8f0ea257b6 r16685: Fix bug #3901 reported by jason@ncac.gwu.edu.
Jeremy.
(This used to be commit d48655d9c0)
2007-10-10 11:19:07 -05:00
Volker Lendecke
8961048d24 r16339: Fix Klocwork ID
277 278     (cmd_*)

485 487 488 (ldap.c)

Volker
(This used to be commit 5b1eba76b3)
2007-10-10 11:17:36 -05:00
Jeremy Allison
d730df0493 r16324: Klocwork #499. Allways check results from alloc.
Jeremy.
(This used to be commit 2b69d436da)
2007-10-10 11:17:33 -05:00
Jeremy Allison
be6fd76436 r16322: Klocwork #481., Don't deref null on malloc fail.
Jeremy.
(This used to be commit dd31f3fc0e)
2007-10-10 11:17:33 -05:00
Günther Deschner
1628d33ba0 r16190: Fix more memleaks.
Guenther
(This used to be commit dfebcc8e19)
2007-10-10 11:17:23 -05:00
Günther Deschner
97f496a0e3 r16117: Make winbindd work again in security=ads.
We still used the old HOST/* UPN to get e.g. users, now we need
samaccountname$@REA.LM.

Guenther
(This used to be commit f6516a799a)
2007-10-10 11:17:21 -05:00
Lars Müller
ec3021dc3b r15822: Add suggestion made by Ralf Haferkamp.
(This used to be commit 7c375fd540)
2007-10-10 11:17:10 -05:00
Gerald Carter
463e7c1171 r15701: change 'net ads leave' to disable the machine account in the domain (since removal implies greater permissions that Windows clients require)
(This used to be commit ad1f947625)
2007-10-10 11:17:08 -05:00
Günther Deschner
c60e96c392 r15698: An attempt to make the winbind lookup_usergroups() call in security=ads
more scalable:

The most efficient way is to use the "tokenGroups" attribute which gives
the nested group membership. As this attribute can not always be
retrieved when binding with the machine account (the only garanteed way
to get the tokenGroups I could find is when the machine account is a
member of the "Pre Win2k Access" builtin group).

Our current fallback when "tokenGroups" failed is looking for all groups
where the userdn was in the "member" attribute. This behaves not very
well in very large AD domains.

The patch first tries the "memberOf" attribute on the user's dn in that
case and directly retrieves the group's sids by using the LDAP Extended
DN control from the user's object.

The way to pass down the control to the ldap search call is rather
painfull and probably will be rearranged later on.

Successfully tested on win2k sp0, win2k sp4, wink3 sp1 and win2k3 r2.

Guenther
(This used to be commit 7d766b5505)
2007-10-10 11:17:08 -05:00
Günther Deschner
39c45ce4f1 r15697: I take no comments as no objections :)
Expand the "winbind nss info" to also take "rfc2307" to support the
plain posix attributes LDAP schema from win2k3-r2.

This work is based on patches from Howard Wilkinson and Bob Gautier
(and closes bug #3345).

Guenther
(This used to be commit 52423e01dc)
2007-10-10 11:17:08 -05:00
Günther Deschner
e129dc40f7 r15696: Free LDAP search result.
Guenther
(This used to be commit ec26c355b3)
2007-10-10 11:17:07 -05:00
Volker Lendecke
c290d34985 r15635: Fix a bogus gcc uninit variable message
(This used to be commit 53f7104b4f)
2007-10-10 11:17:04 -05:00
Gerald Carter
f1039b8fb4 r15560: Since the hotel doesn't have Sci-Fi and no "Doctor Who"....
Re-add the capability to specify an OU in which to create
the machine account.  Done via LDAP prior to the RPC join.
(This used to be commit b69ac0e304)
2007-10-10 11:17:01 -05:00
Gerald Carter
2c029a8b96 r15543: New implementation of 'net ads join' to be more like Windows XP.
The motivating factor is to not require more privileges for
the user account than Windows does when joining a domain.

The points of interest are

* net_ads_join() uses same rpc mechanisms as net_rpc_join()
* Enable CLDAP queries for filling in the majority of the
  ADS_STRUCT->config information
* Remove ldap_initialized() from sam/idmap_ad.c and
  libads/ldap.c
* Remove some unnecessary fields from ADS_STRUCT
* Manually set the dNSHostName and servicePrincipalName attribute
  using the machine account after the join

Thanks to Guenther and Simo for the review.

Still to do:

* Fix the userAccountControl for DES only systems
* Set the userPrincipalName in order to support things like
  'kinit -k' (although we might be able to just use the sAMAccountName
  instead)
* Re-add support for pre-creating the machine account in
  a specific OU
(This used to be commit 4c4ea7b20f)
2007-10-10 11:16:57 -05:00
Günther Deschner
3bff11407e r15461: Free LDAP result in ads_get_attrname_by_oid().
Guenther
(This used to be commit f4af888282)
2007-10-10 11:16:49 -05:00
Günther Deschner
b86c19795a r15250: dump some more sids.
Guenther
(This used to be commit 2922c7f570)
2007-10-10 11:16:30 -05:00
Jim McDonough
92f139d4c4 r14931: Fix #1374: can't join an OU with name that contains '#'
I had to eliminate "\" as an OU path separator, because it is the escape
char in LDAP.  We still accept "/", but using the escape char is just
not a good choice.
(This used to be commit 1953f63903)
2007-10-10 11:15:54 -05:00
Jim McDonough
06f7ee5d4b r14252: Fix Coverity #72: free alloc'ed storage before return. Also found one
more that coverity didn't find from asprintf.
(This used to be commit 37b6e2c8de)
2007-10-10 11:15:21 -05:00
Jeremy Allison
acf0c6fb66 r14118: Fix coverity bug #24. Missing return statement meant
a possible NULL ptr deref.
Jeremy.
(This used to be commit 78ac3f9cbd)
2007-10-10 11:11:13 -05:00
Günther Deschner
3432273ab0 r13965: Make sure we always reset the userAccountControl bits when re-joining
with an existing account.

Guenther
(This used to be commit e4c12ab167)
2007-10-10 11:11:01 -05:00
Volker Lendecke
c2288e6db3 r13951: Fix Coverity Bug #163.
This code was not used anyway :-)

Volker
(This used to be commit bbfb205693)
2007-10-10 11:11:01 -05:00
Günther Deschner
379bd6865f r13657: Let winbindd try to obtain the gecos field from the msSFU30Gecos
attribute when "winbind nss info = sfu" is set. Fixes #3539.

Guenther
(This used to be commit ffce0461de)
2007-10-10 11:10:21 -05:00
Günther Deschner
c1ffb8d9bc r13410: Dump a netbootGUID as a GUID.
Guenther
(This used to be commit 9b19a68456)
2007-10-10 11:09:59 -05:00
Gerald Carter
0af1500fc0 r13316: Let the carnage begin....
Sync with trunk as off r13315
(This used to be commit 17e63ac4ed)
2007-10-10 11:06:23 -05:00
Gerald Carter
855e02f164 r13310: first round of server affinity patches for winbindd & net ads join
(This used to be commit 6c3480f9ae)
2007-10-10 11:06:23 -05:00
James Peach
92092cbcdc r12878: Don't use non-static array initialisers.
(This used to be commit 95b231f028)
2007-10-10 11:06:05 -05:00
Gerald Carter
3f6d9a7b9d r12196: patch from Krishna Ganugapati <krishnag@centeris.com>
Use the subtree delete ldap control when running 'net ads leave'
to ensure that the machine account is actually deleted.
(This used to be commit e96000c16c)
2007-10-10 11:05:49 -05:00
Jeremy Allison
d1f91f7c72 r12043: It's amazing the warnings you find when compiling on a 64-bit
box with gcc4 and -O6...
Fix a bunch of C99 dereferencing type-punned pointer will break
strict-aliasing rules errors. Also added prs_int32 (not uint32...)
as it's needed in one place. Find places where prs_uint32 was being
used to marshall/unmarshall a time_t (a big no no on 64-bits).
More warning fixes to come.
Thanks to Volker for nudging me to compile like this.
Jeremy.
(This used to be commit c65b752604)
2007-10-10 11:05:42 -05:00
Günther Deschner
f6b8327fac r11875: Allow to use START_TLS (by manually setting "ldap ssl = start_tls") for
LDAP connections to ADS (Windows 2003).

Guenther
(This used to be commit 95543fab0f)
2007-10-10 11:05:33 -05:00
Gerald Carter
ac331c48db r11863: BUG 3196: patch from Alex Deiter <tiamat@komi.mts.ru> to compile against the Sun LDAP client libs. But not for AD support; just ldap support
(This used to be commit a33e78aced)
2007-10-10 11:05:31 -05:00
Gerald Carter
54abd2aa66 r10656: BIG merge from trunk. Features not copied over
* \PIPE\unixinfo
* winbindd's {group,alias}membership new functions
* winbindd's lookupsids() functionality
* swat (trunk changes to be reverted as per discussion with Deryck)
(This used to be commit 939c3cb5d7)
2007-10-10 11:04:48 -05:00
Günther Deschner
065d7e82a7 r8048: Replace "done" with "failed".
Guenther
(This used to be commit 7285edc4fe)
2007-10-10 10:58:09 -05:00
Volker Lendecke
3f11139bf3 r8047: "oid" is defined in a heimdal header. With my gcc this generates a ton of
shadowed variable warnings. Fix that.

Volker
(This used to be commit 3846c0afa1)
2007-10-10 10:58:09 -05:00
Günther Deschner
2e7f22e833 r7994: This adds support in Winbindd's "security = ads"-mode to retrieve the POSIX
homedirectory and the loginshell from Active Directory's "Services for Unix".

Enable it with:

        winbind sfu support = yes

User-Accounts without SFU-Unix-Attributes will be assigned template-based
Shells and Homedirs as before.

Note that it doesn't matter which version of Services for Unix you use (2.0,
2.2, 3.0 or 3.5). Samba should detect the correct attributes (msSFULoginShell,
msSFU30LoginShell, etc.) automatically.

If you also want to share the same uid/gid-space as SFU then also use PADL's
ad-idmap-Plugin:

        idmap backend = ad

When using the idmap-plugin only those accounts will appear in Name Service
Switch that have those UNIX-attributes which avoids potential uid/gid-space
clashes between SFU-ids and automatically assigned idmap-ids.

Guenther
(This used to be commit 28b5969942)
2007-10-10 10:58:07 -05:00
Jeremy Allison
7b9d6ac23e r6595: This is Volkers new-talloc patch. Just got the go-ahead from
Volker to commit. Woo Hoo !
Jeremy.
(This used to be commit 316df944a4)
2007-10-10 10:56:46 -05:00
Derrell Lipman
9840db418b r6149: Fixes bugs #2498 and 2484.
1. using smbc_getxattr() et al, one may now request all access control
   entities in the ACL without getting all other NT attributes.
2. added the ability to exclude specified attributes from the result set
   provided by smbc_getxattr() et al, when requesting all attributes,
   all NT attributes, or all DOS attributes.
3. eliminated all compiler warnings, including when --enable-developer
   compiler flags are in use.  removed -Wcast-qual flag from list, as that
   is specifically to force warnings in the case of casting away qualifiers.

Note: In the process of eliminating compiler warnings, a few nasties were
      discovered.  In the file libads/sasl.c, PRIVATE kerberos interfaces
      are being used; and in libsmb/clikrb5.c, both PRIAVE and DEPRECATED
      kerberos interfaces are being used.  Someone who knows kerberos
      should look at these and determine if there is an alternate method
      of accomplishing the task.
(This used to be commit 994694f7f2)
2007-10-10 10:56:24 -05:00
Gerald Carter
73d1950c01 r5956: more compile warngin fixes from the Mr. Mader
(This used to be commit f3f315b14d)
2007-10-10 10:56:11 -05:00
Gerald Carter
40295c41db r5948: more compile cleanups from Jason Mader
(This used to be commit cc6c769c3c)
2007-10-10 10:56:10 -05:00
Gerald Carter
a309fed583 r5336: BUG 2329: fix to re-enable winbindd to locate DC's when 'disable netbios = yes'
(This used to be commit 75a223f118)
2007-10-10 10:55:38 -05:00
Gerald Carter
44be949f28 r5207: patches from Jay Fenlason @ RedHat (scooped from their Fedora packages)
(This used to be commit 9019a84361)
2007-10-10 10:55:33 -05:00
Jeremy Allison
d16a5c4381 r4665: Fix inspired by posting from Joe Meadows <jameadows@webopolis.com>.
Make all LDAP timeouts consistent.
Jeremy.
(This used to be commit 0f0281c234)
2007-10-10 10:53:50 -05:00
Jeremy Allison
883874c562 r4346: Fix cut-and-paste error - bugid #2189. Fixed by Buck Huppmann <buckh@pobox.com>
Jeremy.
(This used to be commit 5c22cb082c)
2007-10-10 10:53:45 -05:00
Jeremy Allison
acf9d61421 r4088: Get medieval on our ass about malloc.... :-). Take control of all our allocation
functions so we can funnel through some well known functions. Should help greatly with
malloc checking.
HEAD patch to follow.
Jeremy.
(This used to be commit 620f2e608f)
2007-10-10 10:53:32 -05:00
Volker Lendecke
0bd9bc6eca r3841: Time out in ads search queries. Even AD servers can hang.
Volker
(This used to be commit fc454c8ef6)
2007-10-10 10:53:20 -05:00