1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-19 10:03:58 +03:00

86 Commits

Author SHA1 Message Date
Günther Deschner
86a61c86a4 r1967: Fix a couple of krb5-DEBUG-messages.
Guenther
2007-10-10 10:52:25 -05:00
Gerald Carter
157d53782d r294: checking in volker's winbindd patches; tested on domain members (Samba and AD) as well as on a Samba DC 2007-10-10 10:51:17 -05:00
Volker Lendecke
8037750df5 Apply some const -
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
97a24d1389 missed one on BUG 1195; make sure to set the private * to NULL -
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
d7b6298b9e fixing compile problems due to my recent ads.h changes -
Andrew Bartlett
6a9bbd1da3 Machines are people too!
While machine accounts cannot use an NTLM login (NT4 style), they are
otherwise full and valid members of the domain, and expect to be able to
use kerberos to connect to CIFS servers.

This means that the LocalSystem account, used by various services, can
perform things like backups, without the admin needing to enter further
passwords.

This particular issue (bug 722) has started to come up a lot on the lists.

I have only enabled it for winbindd-based systems, as the macros use use
to call the 'add user script' will strip the $ from the username for
security reasons.

Andrew Bartlett
-
Andrew Bartlett
7e5855dfd2 shorten some more lines. -
Andrew Bartlett
32397c8b01 Change our Domain controller lookup routines to more carefully seperate
DNS names (realms) from NetBIOS domain names.

Until now, we would experience delays as we broadcast lookups for DNS names
onto the local network segments.

Now if DNS comes back negative, we fall straight back to looking up the
short name.

Andrew Bartlett
-
Andrew Bartlett
06c3f15aa1 rpc_client/cli_lsarpc.c:
rpc_parse/parse_lsa.c:
nsswitch/winbindd_rpc.c:
nsswitch/winbindd.h:
 - Add const

libads/ads_ldap.c:
 - Cleanup function for use

nsswitch/winbindd_ads.c:
 - Use new utility function ads_sid_to_dn
 - Don't search for 'dn=', rather call the ads_search_retry_dn()

nsswitch/winbindd_ads.c:
include/rpc_ds.h:
rpc_client/cli_ds.c:
 - Fixup braindamage in cli_ds_enum_domain_trusts():
    - This function was returning a UNISTR2 up to the caller, and
      was doing nasty (invalid, per valgrind) things with memcpy()
    - Create a new structure that represents this informaiton in a useful way
      and use talloc.

Andrew Bartlett
-
Andrew Bartlett
131bb928f1 Fix for bug 707, getent group for huge ads groups (>1500 members)
This introduces range retrieval of ADS attributes.

VL rewrote most of Gnther's patch, partly to remove code duplication and
partly to get the retrieval of members in one rush, not interrupted by the
lookups for the DN.

I rewrote that patch, to ensure that we can keep an eye on the USN
(sequence number) of the entry - this allows us to ensure the read was
atomic.

In particular, the range retrieval is now generic, for strings.  It
could easily be made generic for any attribute type, if need be.

Andrew Bartlett
-
Volker Lendecke
dafa4d202b And yet another const
Volker
-
Andrew Bartlett
903263a1bd Under certain error conditions (a talloc() failure above) this would cause
a double-free(), and the resultant malloc heap corruption.

This may be one of our lurking winbind segfaults.

Andrew Bartlett
-
Volker Lendecke
0c8ee04c78 After talking with abartlet remove the fix for bug 707 again.
Volker
-
Volker Lendecke
9d8235bf41 Fix for bug 707, getent group for huge ads groups (>1500 members)
This introduces range retrieval of ADS attributes.

I've rewritten most of Gnther's patch, partly to remove code duplication and
partly to get the retrieval of members in one rush, not interrupted by the
lookups for the DN.

Andrew, you told me that you would like to see a check whether the AD sequence
number is the same before and after the retrieval to achieve atomicity. This
would be trivial to add, but I'm not sure that we want this, as this adds two
roundtrips to every membership query. We can not know before the first query
whether we get additional range values, and at that point it's too late to ask
for the USN.

Tested with a group of 4000 members along with lots of small groups.

Volker
-
Andrew Tridgell
b3e024ce1d a small include file rearrangement that doesn't affect normal
compilation, but that allows Samba3 to take advantage of pre-compiled
headers in gcc if available.
-
Gerald Carter
5eca81c660 make sure to use the escaped DN; patch from Guenther Deschner; bug 592 -
Gerald Carter
1cfbd92404 don't call ads_destroy() twice; fixes segfault in winbindd when DC goes down; bug 437 -
Gerald Carter
74c02e5fbc finish off bug 282. AAdd extra checks for pointers after
ads_search_XXX() calls.
-
Gerald Carter
89f6adf830 revert retry loops in winbindd_ads as abartket points out, we
already have ads_search_retry() for this.  However, neither
domain_sid() nor sequence_nunber() used this function.  So modify
them to us ads_do_search_retry() so we can specify the base search
DN and scope.
-
Gerald Carter
3913e43724 fixes for ads domain membership when only the realm is defined in
smb.conf

Fixes to ensure we work with disable netbios = yes
-
Tim Potter
e3f5afb831 Fix for bug 282 that didn't get checked in. -
Gerald Carter
7021cf63a4 should fix bug 364 & 311: Retry patch based on suggestion from
Ken Cross.  Sometimes ads conenction get stale but we don't know
they are dead until we try them. This patch may need some optimization
after people bang on it for a while.
-
Gerald Carter
b1763ace4e Check in Andrew's fix for bug #305 (always use lp_realm() )
Also make sure thet ads_startup uses lp_realm instead of
just relying on the workgroup name.  Fixes bug in net ads join
when the workgroup defaults to "WORKGROUP" and we ignore the
realm name.
-
Herb Lewis
398bd14fc6 get rid of more compiler warnings -
Gerald Carter
0ab00ccaed working on transtive trusts issue:
* use DsEnumerateDomainTrusts() instead of LDAP search.
    wbinfo -m now lists all trusted downlevel domains and
    all domains in the forest.

Thnigs to do:

  o Look at Krb5 connection trusted domains
  o make sure to initial the trusted domain cache as soon
    as possible
-
Jeremy Allison
ff222716a0 Removed strupper/strlower macros that automatically map to strupper_m/strlower_m.
I really want people to think about when they're using multibyte strings.
Jeremy.
-
Tim Potter
10c51bbef8 Fix more shadow variable warnings. -
Gerald Carter
14f2cd139a * set domain->last_status = NT_STATUS_SERVER_DISABLED on an ads_connect() failure
* Fix code to use winbind_rpc methods for trusted mixed mode or NT4 domains
  ( does no one ever test this? )
* add in LDAP code to get the sequence number for rpc based seqnum update.
  ( this is needed if the DC is upgraded and samba is not reconfigured
    to use security = ads; it's not pretty but it works (from app_head) )
* fix bug that caused us to enumerate domain local groups in domains
  other than our own
-
Andrew Tridgell
cdd9b60a07 - fixed the bug that forced us not to use the winbindd cache when we
have a primary ADS domain and a secondary (trusted) NT4 domain. This
  caused winbindd to be *really* slow for that setup.

- fixed winbindd_getgrgid(), which was calling uid_to_sid instead of
  gid_to_sid(). When you make changes to winbind *PLEASE* test using
  nsstest.
-
Jeremy Allison
4161a122b7 More instrumentation for winbindd.
Jeremy.
-
Andrew Bartlett
d4d5e6c2ee Merge HEAD's winbind into 3.0.
This includes the 'SIDs Rule' patch, mimir's trusted domains cacheing code,
the winbind_idmap abstraction (not idmap proper, but the stuff that held up
the winbind LDAP backend in HEAD).

Andrew Bartlett
-
Andrew Bartlett
876e00fd11 Merge from HEAD - save the type of channel used to contact the DC.
This allows us to join as a BDC, without appearing on the network as one
until we have the database replicated, and the admin changes the configuration.

This also change the SID retreval order from secrets.tdb, so we no longer
require a 'net rpc getsid' - the sid fetch during the domain join is sufficient.
Also minor fixes to 'net'.

Andrew Bartlett
-
Andrew Bartlett
837680ca51 Merge from HEAD client-side authentication changes:
- new kerberos code, allowing the account to change it's own password
   without special SD settings required
 - NTLMSSP client code, now seperated from cliconnect.c
 - NTLMv2 client code
 - SMB signing fixes

Andrew Bartlett
-
Tim Potter
c4f46890fe Merge some random looking setenv related kerberos stuff that makes
winbindd build again.
-
Jeremy Allison
09a218a9f6 Forward port the change to talloc_init() to make all talloc contexts
named. Ensure we can query them.
Jeremy.
-
Gerald Carter
ff4b2411d1 enable enumeration of domain local groups using LDAP (and in a native mode domain) -
Gerald Carter
5a2f1edb58 NULL enum_local_groups for ads winbindd (temporary workaround). -
Gerald Carter
3de09e5cf1 syncing up with HEAD. Seems to be a lot of differences creeping in
(i ignored the new SAMBA stuff, but the rest of this looks like it should
have been merged already).
-
Gerald Carter
65e7b5273b sync'ing up for 3.0alpha20 release -
Jelmer Vernooij
3928578b52 sync 3.0 branch with head -
Andrew Tridgell
03ac082dcb updated the 3.0 branch from the head branch - ready for alpha18 -
Andrew Tridgell
dfa990170b possibly fix the 15000 user problem
I think its caused by a rpc operation failing and us giving invalid
data back to the cache layer. Using talloc_zero() should solve this.
-
Andrew Tridgell
be399f5823 fixed the secondary group mappings for ADS users -
Andrew Tridgell
41e1560798 updated winbindd to used paged ldap searches for all ldap queries -
Andrew Tridgell
1aaa2091d5 fixed 2 reconnection bugs in the ADS backend support -
Andrew Tridgell
58b79c0dc8 better detection of dead ADS connections, so we have some chance of
reconnecting
-
Tim Potter
6a58c9bd06 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
-
Andrew Bartlett
e870f0e727 This patch makes the 'winbind use default domain' code interact better with
smbd, and also makes it much cleaner inside winbindd.

It is mostly my code, with a few changes and testing performed by Alexander
Bokovoy <a.bokovoy@sam-solutions.net>.  ab has tested it in security=domain and
security=ads, but more testing is always appricatiated.

The idea is that we no longer cart around a 'domain\user' string, we keep them
seperate until the last moment - when we push that string into a pwent on onto
the socket.

This removes the need to be constantly parsing that string - the domain prefix
is almost always already provided, (only a couple of functions actually changed
arguments in all this).

Some consequential changes to the RPC client code, to stop it concatonating the
two strings (it now passes them both back as params).

I havn't changed the cache code, however the usernames will no longer have a
double domain prefix in the key string.  The actual structures are unchanged
 - but the meaning of 'username' in the 'rid' will have changed.  (The cache is
invalidated at startup, so on-disk formats are not an issue here).

Andrew Bartlett
-