1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-28 17:47:29 +03:00

444 Commits

Author SHA1 Message Date
Günther Deschner
479dec6845 r16452: Fix memleak in the CLDAP processing (found by valgrind).
Guenther
2007-10-10 11:18:54 -05:00
Volker Lendecke
5b1eba76b3 r16339: Fix Klocwork ID
277 278     (cmd_*)

485 487 488 (ldap.c)

Volker
2007-10-10 11:17:36 -05:00
Jeremy Allison
7e397b534a r16326: Klocwork #509. Always check return allocs.
Jeremy.
2007-10-10 11:17:33 -05:00
Jeremy Allison
2b69d436da r16324: Klocwork #499. Allways check results from alloc.
Jeremy.
2007-10-10 11:17:33 -05:00
Jeremy Allison
dd31f3fc0e r16322: Klocwork #481., Don't deref null on malloc fail.
Jeremy.
2007-10-10 11:17:33 -05:00
Günther Deschner
afdb118902 r16272: Fix memleak.
Guenther
2007-10-10 11:17:30 -05:00
Günther Deschner
535d03cbe8 r16268: Add TCP fallback for our implementation of the CHANGEPW kpasswd calls.
This patch is mainly based on the work of Todd Stecher
<tstecher@isilon.com> and has been reviewed by Jeremy.

I sucessfully tested and valgrinded it with MIT 1.4.3, 1.3.5, Heimdal
0.7.2 and 0.6.1rc3.

Guenther
2007-10-10 11:17:29 -05:00
Volker Lendecke
b369d0891a r16201: Fix Klocwork 439 2007-10-10 11:17:24 -05:00
Jeremy Allison
98751e8190 r16199: Fix Klocwork #1 - ensure we test the first
strtok for NULL.
Jeremy.
2007-10-10 11:17:24 -05:00
Günther Deschner
dfebcc8e19 r16190: Fix more memleaks.
Guenther
2007-10-10 11:17:23 -05:00
Günther Deschner
f6516a799a 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
2007-10-10 11:17:21 -05:00
Günther Deschner
8fc70d0df0 r16115: Make "net ads changetrustpw" work again.
(adapt to the new UPN/SPN scheme).

Guenther
2007-10-10 11:17:21 -05:00
Günther Deschner
7327f94546 r15980: Correctly destroy talloc_ctx when the LDAP posix attribute query has
failed. Noticed by Bob Gautier.

Guenther
2007-10-10 11:17:16 -05:00
Lars Müller
7c375fd540 r15822: Add suggestion made by Ralf Haferkamp. 2007-10-10 11:17:10 -05:00
Günther Deschner
6cfc65ea20 r15704: Prefer LDAP error codes in ads_search_retry_sid().
Guenther
2007-10-10 11:17:08 -05:00
Gerald Carter
ad1f947625 r15701: change 'net ads leave' to disable the machine account in the domain (since removal implies greater permissions that Windows clients require) 2007-10-10 11:17:08 -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
Günther Deschner
ec26c355b3 r15696: Free LDAP search result.
Guenther
2007-10-10 11:17:07 -05:00
Volker Lendecke
53f7104b4f r15635: Fix a bogus gcc uninit variable message 2007-10-10 11:17:04 -05:00
Gerald Carter
b69ac0e304 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.
2007-10-10 11:17:01 -05:00
Günther Deschner
8dd925c5fb r15559: Smaller fixes for the new cldap code:
* replace printf to stderr with DEBUG statements as they get printed in
  daemons
* "net ads lookup" return code

Guenther
2007-10-10 11:17:01 -05:00
Günther Deschner
821bbb4566 r15558: Do not wait endless for a CLDAP reply when the LDAP server is
unavailable; use "ldap timeout" handling.

Jerry, please check.

Guenther
2007-10-10 11:16:59 -05:00
Gerald Carter
18f2e1a4e1 r15544: make sure to define NS_PACKETSZ for Bind 4 interfaces (fix build on us4) 2007-10-10 11:16:57 -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
a75dd80c62 r15523: Honour the time_offset also when verifying kerberos tickets. This
prevents a nasty failure condition in winbindd's pam_auth where a tgt
and a service ticket could have been succefully retrieved, but just not
validated.

Guenther
2007-10-10 11:16:55 -05:00
Andrew Bartlett
221a6de7d0 r15492: Without this patch, the LDAP client libs will call abort() in
ldap_get_values_len, because they were handed a NULL msgs pointer, for
example in ads_pull_sid().

This occurs when the AD server fails at the connect stage.  (The
toubled AD server is actually Samba4 in my example).

Andrew Bartlett
2007-10-10 11:16:54 -05:00
Gerald Carter
43f5d09a16 r15464: fix dns build breakage on IRIX and OpenBSD 2007-10-10 11:16:50 -05:00
Gerald Carter
b0160f8933 r15463: compile fix for new DNS code for machine using Bind 4 libs (old IRIX host) 2007-10-10 11:16:50 -05:00
Gerald Carter
cf71f88a3c r15462: replace the use of OpenLDAP's ldap_domain2hostlist() for
locating AD DC's with out own DNS SRV queries.
Testing on Linux and Solaris.
2007-10-10 11:16:49 -05:00
Günther Deschner
f4af888282 r15461: Free LDAP result in ads_get_attrname_by_oid().
Guenther
2007-10-10 11:16:49 -05:00
Günther Deschner
be2bd3945c r15392: In most cases, this mapping is more appropriate. (I know, it is still a
mess, but there is no way the get NTSTATUS from the edata yet).

Guenther
2007-10-10 11:16:39 -05:00
Günther Deschner
5557ada694 r15305: Let winbind search by sid directly (or in windows terms: "bind to a
sid"); works in all AD versions I tested. Also add "net ads sid" search
tool.

Guenther
2007-10-10 11:16:33 -05:00
Günther Deschner
2922c7f570 r15250: dump some more sids.
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
Jeremy Allison
37ab42afbc r15210: Add wrapper functions smb_krb5_parse_name, smb_krb5_unparse_name,
smb_krb5_parse_name_norealm_conv that pull/push from unix charset
to utf8 (which krb5 uses on the wire). This should fix issues when
the unix charset is not compatible with or set to utf8.
Jeremy.
2007-10-10 11:16:28 -05:00
Jim McDonough
1953f63903 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.
2007-10-10 11:15:54 -05:00
Günther Deschner
90df68634b r14682: Small cleanup in ads_verify_ticket.
Guenther
2007-10-10 11:15:43 -05:00
Günther Deschner
bde4a4018e r14611: Fix init_creds_opts issue jerry discovered when using MIT krb5 1.3:
We were using a far too short renewable_time in the request; newer MIT
releases take care interally that the renewable time is never shorter
then the default ticket lifetime.

Guenther
2007-10-10 11:15:39 -05:00
Günther Deschner
afc519530f r14585: Tighten argument list of kerberos_kinit_password again,
kerberos_kinit_password_ext provides access to more options.

Guenther
2007-10-10 11:15:38 -05:00
Günther Deschner
8a0c1933d3 r14576: Skip remaining keytab entries when we have a clear indication that
krb5_rd_req could decrypt the ticket but that ticket is just not valid
at the moment (either not yet valid or already expired). (This also
prevents an MIT kerberos related crash)

Guenther
2007-10-10 11:15:37 -05:00
Gerald Carter
635f0c9c01 r14512: Guenther, This code breaks winbind with MIT krb1.3.
I'm disabling it for now until we have en effective
means of dealing with the ticket request flags for users
and computers.
2007-10-10 11:15:35 -05:00
Günther Deschner
7b1fcb75da r14503: Fix principal in debug statement.
Guenther
2007-10-10 11:15:34 -05:00
Jim McDonough
37b6e2c8de r14252: Fix Coverity #72: free alloc'ed storage before return. Also found one
more that coverity didn't find from asprintf.
2007-10-10 11:15:21 -05:00
Jeremy Allison
c0f906ac8d r14170: Paranioa fix for sesssetup.
Fix Coverity bug #26. Guard against NULL ref.
Jeremy.
2007-10-10 11:15:15 -05:00
Jeremy Allison
78ac3f9cbd r14118: Fix coverity bug #24. Missing return statement meant
a possible NULL ptr deref.
Jeremy.
2007-10-10 11:11:13 -05:00
Günther Deschner
4a1a3c4808 r14074: Some cleanup; there is no point in declaring and mapping
KRB5KRB_ERR_RESPONSE_TOO_BIG when the krb5 library does not know about
this.

Guenther
2007-10-10 11:11:09 -05:00
Volker Lendecke
4a75edf9de r14017: Okay, okay, I have turned a double-free into dead code :-)
Fix Coverity # 214.

Volker
2007-10-10 11:11:05 -05:00
Günther Deschner
e4c12ab167 r13965: Make sure we always reset the userAccountControl bits when re-joining
with an existing account.

Guenther
2007-10-10 11:11:01 -05:00
Volker Lendecke
bbfb205693 r13951: Fix Coverity Bug #163.
This code was not used anyway :-)

Volker
2007-10-10 11:11:01 -05:00