1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-17 02:05:21 +03:00

71 Commits

Author SHA1 Message Date
Günther Deschner
0a012c12d6 Remove DomainControllerAddressType which we now have in IDL.
Guenther
2008-02-28 23:15:30 +01:00
Günther Deschner
2605c6758e Move DS_DOMAIN_FUNCTION defines to ads.h.
Guenther
2008-01-29 15:15:28 +01:00
Jeremy Allison
98e154c312 This is a large patch (sorry). Migrate from struct in_addr
to struct sockaddr_storage in most places that matter (ie.
not the nmbd and NetBIOS lookups). This passes make test
on an IPv4 box, but I'll have to do more work/testing on
IPv6 enabled boxes. This should now give us a framework
for testing and finishing the IPv6 migration. It's at
the state where someone with a working IPv6 setup should
(theorecically) be able to type :
smbclient //ipv6-address/share
and have it work.
Jeremy.
2007-10-24 14:16:54 -07:00
Günther Deschner
f5b3de4d30 r24804: As a temporary workaround, also try to guess the server's principal in the
"not_defined_in_RFC4178@please_ignore" case to make at least LDAP SASL binds
succeed with windows server 2008.

Guenther
2007-10-10 12:30:23 -05:00
Stefan Metzmacher
d0ec732387 r24131: - make it more clear what the different min and max fields mean
- with the "GSSAPI" sasl mech the plain, sign or seal negotiation
  is independed from the req_flags and ret_flags
- verify the server supports the wrapping type we want
- better handling on negotiated buffer sizes

metze
2007-10-10 12:29:09 -05:00
Stefan Metzmacher
05fce8815f r24039: remove unused global variable...
metze
2007-10-10 12:28:58 -05:00
Stefan Metzmacher
408bb2e6e2 r23946: add support for NTLMSSP sign and seal
NOTE: windows servers are broken with sign only...

metze
2007-10-10 12:28:48 -05:00
Stefan Metzmacher
2075c05b3d r23945: add infrastructure to select plain, sign or seal LDAP connection
metze
2007-10-10 12:28:48 -05:00
Stefan Metzmacher
65ce6fa21a r23926: implement output buffer handling for the SASL write wrapper
metze
2007-10-10 12:28:45 -05:00
Stefan Metzmacher
7d8518ebd9 r23922: implement input buffer handling for the SASL read wrapper
metze
2007-10-10 12:28:42 -05:00
Stefan Metzmacher
873eaff8fe r23898: rename HAVE_ADS_SASL_WRAPPING -> HAVE_LDAP_SASL_WRAPPING
metze
2007-10-10 12:28:39 -05:00
Stefan Metzmacher
d5512da62a r23896: hopefully fix the build on most systems
metze
2007-10-10 12:28:39 -05:00
Stefan Metzmacher
a3b97cdce7 r23893: add dummy callbacks for LDAP SASL wrapping,
they're not used yet...

metze
2007-10-10 12:28:39 -05:00
Stefan Metzmacher
00909194a6 r23888: move elements belonging to the current ldap connection to a
substructure.

metze
2007-10-10 12:28:38 -05:00
Günther Deschner
1d5b08326f r23838: Allow to store schema and config path in ADS_STRUCT config.
Guenther
2007-10-10 12:28:33 -05:00
Günther Deschner
d832014a6f r23826: Fix gpo security filtering by matching the security descriptor ace's for the
extended apply group policy right.

Guenther
2007-10-10 12:28:31 -05:00
Günther Deschner
964acb2716 r23766: Add GTYPE_SECURITY_UNIVERSAL_GROUP define.
Guenther
2007-10-10 12:23:54 -05:00
Günther Deschner
11b390309b r23607: Add legacy support for Services for Unix (SFU) 2.0.
Guenther
2007-10-10 12:23:35 -05:00
Günther Deschner
52fdbbda53 r23128: Fix typo.
Guenther
2007-10-10 12:22:48 -05:00
Lars Müller
1351207626 r22841: Add comment to endif statement. 2007-10-10 12:22:01 -05:00
Günther Deschner
648df57e53 r22797: We are only interested in the DACL of the security descriptor, so search with
the SD_FLAGS control.

Guenther
2007-10-10 12:21:57 -05:00
Günther Deschner
dcd902f24a r22664: When we have krb5_get_init_creds_opt_get_error() then try to get the NTSTATUS
codes directly out of the krb5_error edata.

Guenther
2007-10-10 12:19:53 -05:00
Günther Deschner
7e1a84b722 r21240: Fix longstanding Bug #4009.
For the winbind cached ADS LDAP connection handling
(ads_cached_connection()) we were (incorrectly) assuming that the
service ticket lifetime equaled the tgt lifetime. For setups where the
service ticket just lives 10 minutes, we were leaving hundreds of LDAP
connections in CLOSE_WAIT state, until we fail to service entirely with
"Too many open files".

Also sequence_number() in winbindd_ads.c needs to delete the cached LDAP
connection after the ads_do_search_retry() has failed to submit the
search request (although the bind succeeded (returning an expired
service ticket that we cannot delete from the memory cred cache - this
will get fixed later)).

Guenther
2007-10-10 12:17:50 -05:00
Gerald Carter
aaec0115e2 r20986: Commit the prototype of the nss_info plugin interface.
This allows a provider to supply the homedirectory, etc...
attributes for a user without requiring support in core
winbindd code.  The idmap_ad.c module has been modified
to provide the idmap 'ad' library as well as the rfc2307 and sfu
"winbind nss info" support.

The SID/id mapping is working in idmap_ad but the nss_info
still has a few quirks that I'm in the process of resolving.
2007-10-10 12:17:23 -05:00
Jeremy Allison
97e248f89a r20857: Silence gives assent :-). Checking in the fix for
site support in a network where many DC's are down.
I heard via Volker there is still a bug w.r.t the
wrong site being chosen with trusted domains but
we'll have to layer that fix on top of this.
Gd - complain if this doesn't work for you.
Jeremy.
2007-10-10 12:17:14 -05:00
Volker Lendecke
b2ff9680eb r18019: Fix a C++ warnings: Don't use void * in libads/ for LDAPMessage anymore.
Compiled it on systems with and without LDAP, I hope it does not break the
build farm too badly. If it does, I'll fix it tomorrow.

Volker
2007-10-10 11:39:49 -05:00
Jeremy Allison
5ae3564d68 r17970: Add missing include-guards around ads.h and ads_cldap.h.
Remove all reference to "Default-First-Site-Name" and
treat it like any other site.
Jeremy.
2007-10-10 11:39:44 -05:00
Jeremy Allison
9be4ecf24b r17945: Store the server and client sitenames in the ADS
struct so we can see when they match - only create
the ugly krb5 hack when they do.
Jeremy.
2007-10-10 11:39:01 -05:00
Jeremy Allison
d500e1f96d r17943: The horror, the horror. Add KDC site support by
writing out a custom krb5.conf file containing
the KDC I need. This may suck.... Needs some
testing :-).
Jeremy.
2007-10-10 11:39:01 -05:00
Jeremy Allison
2b8d72f09c r16548: Fix bug #3867 reported by jason@ncac.gwu.edu.
Jeremy.
2007-10-10 11:18:59 -05:00
Volker Lendecke
def075baf8 r16336: Fix Klocwork ID's 1087, 1095, 1096, 1098, 1099, 1101, 1102, 1105, 1107, 1109,
1111

Volker
2007-10-10 11:17:35 -05:00
Günther Deschner
7d766b5505 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
2007-10-10 11:17:08 -05:00
Günther Deschner
52423e01dc 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
2007-10-10 11:17:08 -05:00
Gerald Carter
4c4ea7b20f 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
2007-10-10 11:16:57 -05:00
Günther Deschner
10e4211755 r15243: Sorry for the breakage:
* Fix the build without kerberos headers
* Fix memleak in the krb5_address handling

Guenther
2007-10-10 11:16:30 -05:00
Günther Deschner
8b2ba11508 r15240: Correctly disallow unauthorized access when logging on with the
kerberized pam_winbind and workstation restrictions are in effect.

The krb5 AS-REQ needs to add the host netbios-name in the address-list.

We don't get the clear NT_STATUS_INVALID_WORKSTATION code back yet from
the edata of the KRB_ERROR but the login at least fails when the local
machine is not in the workstation list on the DC.

Guenther
2007-10-10 11:16:29 -05:00
Günther Deschner
170038f4cd r14051: Add remaining (documented) userAccountControl bits, thanks to Luke
Howard for pointing this out.

Guenther
2007-10-10 11:11:08 -05:00
Günther Deschner
ffce0461de r13657: Let winbindd try to obtain the gecos field from the msSFU30Gecos
attribute when "winbind nss info = sfu" is set. Fixes #3539.

Guenther
2007-10-10 11:10:21 -05:00
Gerald Carter
17e63ac4ed r13316: Let the carnage begin....
Sync with trunk as off r13315
2007-10-10 11:06:23 -05:00
Günther Deschner
db38ed6be6 r11242: use LDAP bitwise machting rule when searching for groups in ADS.
This avoids that each time a full-group-dump is requested from ADS; the
bitwise match allows to only query those groups we are interested in.

The ADS LDAP server changed to RFC compliant behaviour when decoding the ldap
filter with extensible match in the latest SPs (fixes). From the patch:

/* Workaround ADS LDAP bug present in MS W2K3 SP0 and W2K SP4 w/o
  * rollup-fixes:
  *
  * According to Section 5.1(4) of RFC 2251 if a value of a type is it's
  * default value, it MUST be absent. In case of extensible matching the
  * "dnattr" boolean defaults to FALSE and so it must be only be present
  * when set to TRUE.
  *
  * When it is set to FALSE and the OpenLDAP lib (correctly) encodes a
  * filter using bitwise matching rule then a buggy AD fails to decode
  * the extensible match. As a workaround set it to TRUE and thereby add
  * the dnAttributes "dn" field to cope with those older AD versions.
  * It should not harm and won't put any additional load on the AD since
  * none of the dn components have a bitmask-attribute.
  *
  * Thanks to Ralf Haferkamp for input and testing */

Guenther
2007-10-10 11:05:09 -05:00
Gerald Carter
939c3cb5d7 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)
2007-10-10 11:04:48 -05:00
Günther Deschner
28b5969942 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
2007-10-10 10:58:07 -05:00
Jeremy Allison
0f0281c234 r4665: Fix inspired by posting from Joe Meadows <jameadows@webopolis.com>.
Make all LDAP timeouts consistent.
Jeremy.
2007-10-10 10:53:50 -05:00
Günther Deschner
8836621694 r2832: Readd WKGUID-binding to match the correct default-locations of new
User-, Group- and Machine-Accounts in Active Directory (this got lost
during the last trunk-merge).

This way we match e.g. default containers moved by redircmp.exe and
redirusr.exe in Windows 2003 and don't blindly default to cn=Users or
cn=Computers.

Further wkguids can be examied via "net ads search wellknownobjects=*".
This should still keep a samba3-client joining a samba4 dc. Fixes
Bugzilla #1343.

Guenther
2007-10-10 10:52:54 -05:00
Jim McDonough
c2436c433a Fix bugzilla # 1208
Winbind tickets expired.  We now check the expiration time, and acquire
new tickets.  We couln't rely on renewing them, because if we didn't get
a request before they expired, we wouldn't have renewed them.  Also, there
is a one-week limit in MS on renewal life, so new tickets would have been
needed after a week anyway.   Default is 10 hours, so we should only be
acquiring them that often, unless the configuration on the DC is changed (and
the minimum is 1 hour).
-
Gerald Carter
4449e0e251 bug 1195: add flag to ADS_STRUCT so we know who owns the main structure's memory (not the members though) -
Gerald Carter
ebabf72a78 fix some warnings from the Sun compiler -
Jim McDonough
d30bef4c37 Fix to properly set AP_OPTS_SUBKEY in heimdal. In MIT it is a #define, but
in heimdal it is an enum.  Thanks to Guenther Deschner (gd@suse.de).

With this join will work, but without a keytab, cifs connections will still
fail with heimdal.  Fix to come later.
-
Andrew Tridgell
23a6ea385c added an auth flag that indicates if we should be allowed to fallback
to NTLMSSP for SASL if krb5 fails. This is important as otherwise the
admin may think that a join has succeeeded when kerberos is actually
broken.
-
Andrew Bartlett
372a574a73 Fix comment - we now have 5 types of error... -