1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-15 23:24:37 +03:00

54 Commits

Author SHA1 Message Date
Andrew Tridgell
31774dce67 much simpler code to choose a DC to contact in winbindd. We now always
choose the server that has the most bits in common in its IP with one
of our interfaces.
-
Jeremy Allison
b521abd86b Added new error codes. Fix up connection code to retry in the same way
that app-head does.
Jeremy.
-
Gerald Carter
764b58e2c0 merge from APP_HEAD
* s/driverlocation/comment
* detect native mode domain and enumerate local groups

Also

* Added sendfile stats from SAMBA_2_2
-
Gerald Carter
38a956c79b fix typo -
Gerald Carter
dd948a302a merge native_mode flag in winbindd_domain struct from app-head -
Gerald Carter
38c9e42998 merge of new client side support the Win2k LSARPC UUID in rpcbind
from APP_HEAD
-
Jeremy Allison
6929b65954 Doh ! Lookup name before checking negative cache (the way Tim originally
had it...).
Jeremy.
-
Jeremy Allison
c4fcbb2948 Fix memory leak in getting DC list. Remember to exclude failed lookups.
Jeremy.
-
Jeremy Allison
38c67632ad Moved -ve cache check to correct place.
Jeremy.
-
Andrew Tridgell
0d28d76947 Add clock skew handling to our kerberos code. This allows us to cope with
the DC being out of sync with the local machine.
-
Jean-François Micouleau
4d38caca40 added cli_net_auth_3 client code.
changed cli_nt_setup_creds() to call cli_net_auth_2 or cli_net_auth_3 based on a switch.
pass also the negociation flags all the way.
all the places calling cli_nt_setup_creds() are still using cli_net_aut2(), it's just for future use and for rpcclient.

in the future we will be able to call auth_2 or auth_3 as we want.

	J.F.
-
Andrew Tridgell
f757223ebe fix connecting to a BDC when the PDC is down but in WINS and no bcast
can be used to find a BDC

2nd try ....
-
Andrew Tridgell
e95d8e2c9e fix connecting to a BDC when the PDC is down but in WINS and no bcast
can be used to find a BDC
-
Tim Potter
b8dba26978 Moved calculation of secure channel type into a new function. -
Andrew Tridgell
68e70b000b fixed wbinfo -t for netbiosless domains -
Andrew Tridgell
e358d7b24c This fixes a number of ADS problems, particularly with netbiosless
setups.

- split up the ads structure into logical pieces. This makes it much
  easier to keep things like the authentication realm and the server
  realm separate (they can be different).

- allow ads callers to specify that no sasl bind should be performed
(used by "net ads info" for example)

- fix an error with handing ADS_ERROR_SYSTEM() when errno is 0

- completely rewrote the code for finding the LDAP server. Now try DNS
  methods first, and try all DNS servers returned from the SRV DNS
  query, sorted by closeness to our interfaces (using the same sort code
  as we use in replies from WINS servers). This allows us to cope with
  ADS DCs that are down, and ensures we don't pick one that is on the
  other side of the country unless absolutely necessary.

- recognise dnsRecords as binary when displaying them

- cope with the realm not being configured in smb.conf (work it out
  from the LDAP server)

- look at the trustDirection when looking up trusted domains and don't
  include trusts that trust our domains but we don't trust
  theirs.

- use LDAP to query the alternate (netbios) name for a realm, and make
  sure that both and long and short forms of the name are accepted by
  winbindd. Use the short form by default for listing users/groups.

- rescan the list of trusted domains every 5 minutes in case new trust
  relationships are added while winbindd is running

- include transient trust relationships (ie. C trusts B, B trusts A,
  so C trusts A) in winbindd.

- don't do a gratuituous node status lookup when finding an ADS DC (we
  don't need it and it could fail)

- remove unused sid_to_distinguished_name function

- make sure we find the allternate name of our primary domain when
  operating with a netbiosless ADS DC (using LDAP to do the lookup)

- fixed the rpc trusted domain enumeration to support up to approx
  2000 trusted domains (the old limit was 3)

- use the IP for the remote_machine (%m) macro when the client doesn't
  supply us with a name via a netbios session request (eg. port 445)

- if the client uses SPNEGO then use the machine name from the SPNEGO
  auth packet for remote_machine (%m) macro

- add new 'net ads workgroup' command to find the netbios workgroup
  name for a realm
-
Andrew Tridgell
3929532e3b support netbiosless search for the DC using ADS in the winbindd AUTH
code.
-
Tim Potter
13c0cc830e Fixed for memory leak in connection caching code when a dc is
permanently down.   Found by Dan Coppock.
-
Tim Potter
277f6bbb9a Renamed all the new_cli_netlogon_* functions to cli_netlogon_*
as they're no longer new!
-
Andrew Bartlett
c552910477 I just noticed that I never added my copyright when I messed with this
previously.  Fix that.

Andrew Bartlett
-
Andrew Bartlett
23689b0746 Update cli_full_connection() to take a 'flags' paramater, and try to get a
few more places to use it.

Andrew Bartlett
-
Simo Sorce
897e64d2e0 more debug classess activated -
Andrew Bartlett
c205b18bd6 Remove the password length paramater from cli_full_connection - it really
didn't make any sense, and its was always just strlen(password) anyway.

This fixes it to be strlen(password)+1

Andrew Bartlett
-
Jeremy Allison
5de792e7e9 Fixed the handle leak in the connection management code (this code is crap
and should be rewritten, just not now... :-).
Jeremy.
-
Andrew Bartlett
8e705dd921 Various winbind updates:
- pam_winbind updates from vance, fixing a typo and making some the options
  work properly.

- Extra parinoia in the winbind connection loop

- Allow pam_winbind to compile on HP-UX (Don Mcall, more work to do).

- Fix up configure.in to use the same method for building the test .so
  as the Makefile uses.

Andrew Bartlett
-
Andrew Bartlett
f4f23fad60 Fix a double-free bug in wbinfo -t's call in winbindd.
I forgot to clean this up when netlogon move across to the connection cache
arrangement.

Also add some smb_panics to the connection_ok() code to try to catch this kind
of thing better in future.

Andrew Bartlett
-
Andrew Bartlett
ef68b28fa0 Allow us to see the difference between these two errors. (We need to chase
down some bugs with it...).

Andrew Bartlett
-
Tim Potter
1f007d3ed4 Renamed get_nt_error_msg() to nt_errstr(). -
Andrew Tridgell
967cb3ed0c always make winbindd try for the PDC first before trying for a BDC
this prevents propogation delays in the SAM between the PDC and BDCs
-
Andrew Bartlett
ac8c24a9a8 Allow Samba to trust NT4 Domains.
This commit builds on the auth subsystem to give Samba support for trusting NT4
domains.  It is off by default, but is enabled by adding 'trustdomain' to the
'auth methods' smb.conf paramater.

Tested against NT4 only - there are still some issues with the join code for
Win2k servers (spnego stuff).

The main work TODO involves enumerating the trusted domains (including the RPC
calls to match), and getting winbind to run on the PDC correctly.

Similarly, work remains on getting NT4 to trust Samba domains.

Andrew Bartlett
-
Jeremy Allison
8ed49fe0df Ensure that winbindd and smbd both use identical logic to find dc's.
Fix bug where zeroip addresses were being checked.
Jeremy.
-
Andrew Bartlett
92cbefdf27 Winbind cleanup.
This patch fixes the segfaults I introduced in the previous conneciton caching
patch.  It cleans up the connection cache a *lot* - in particular it adds
significant robustness to the operation.

If a the DC goes down, we no longer fail the next operation - the code checks
if the connection died during one of its own operations on the socket, and
restarts the conneciton as required.

There is still a memory leak in here somewhere - but this code also cleans up a
number of these.

Also added is the abilty to sepecify the domain of the 'get around restrict anonymous'
user that winbind uses.

Andrew Bartlett
-
Andrew Bartlett
49d3e47666 A few small winbind updates:
Add a connection cache to the netlogon pipe.  This makes a *massive* difference
to the time-per-auth.  Also fix up *some* of the memory leaks in other
connection caches.

Add some debugging messages for the is_connected() code.  I'm thinking we
should get a client implementation of SMBecho and call it here - as it would
allow us to always know the DC is around before we start.

Down the debug level for some of the pam_winbind code - I'll probably down it
further when I'm finished debugging.

Andrew Bartlett
-
Tim Potter
6a58c9bd06 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
-
Tim Potter
1f7172b48e Removed dodgy init of local variable. -
Tim Potter
fc7ed1b4a8 Much more useful handling of backup domain controllers in winbindd. Honour
the "password server" smb.conf parameter when choosing a DC to connect to.

Due to the origin of the code in cm_get_dc_name() it wouldn't try
additional DCs if the first DC didn't work.  This would wedge winbindd if you
had "password server = foo1, foo2" and foo1 was down.
-
Simo Sorce
6b123adda9 fixes (asprintf) from 2.2 -
Andrew Bartlett
4609edcac3 Further rpc_client removal, this time from winbindd.
Also removed the dependency on auth_util.o, which makes things nicer.

Finally, this kills off the NECESSARY_BECAUSE_SAMBA_DEPENDENCIES_ARE_SO_BROKEN_OBJ
makefile variable - becouse Samba dependencies are starting to be sane again!

Andrew Bartlett
-
Tim Potter
1217ef28a6 Modify winbindd to use authenticated user info from secrets.tdb when making
IPC$ connections to domain controllers.
-
Andrew Tridgell
0216b0fca1 The beginnings of alternative backends for winbindd
This just splits off the dispinfo call behind a methods structure.
I'll split off a few more functions soon, then we will be ready for
LDAP replacement methods
-
Tim Potter
4215048f7b I think the lookup_pdc_name() should be called lookup_dc_name() and the
name_status_find() call here should look up a #1c name instead of #1d.
This fixes some bugs currently with BDC authentication in winbindd and in
smbd as you can't query the #1d name with the ip address of a BDC.

Who is Uncle Tom Cobbley anyway?
-
Tim Potter
6446d2acd5 Some reformatting.
M-x tabify
-
Andrew Tridgell
b599947348 don't die with a FPE if there are no DCs -
Tim Potter
8f01a8b078 Fixed check machine account function. -
Jeremy Allison
5e8df83ba9 Tidyup formatting a bit (spaces->tabs) whilst reading new code to understand
connection caching. Getting ready for back-merge to 2.2.3.
Jeremy.
-
Tim Potter
77c287e946 Caching user, group and domain sam handles was a stupid idea.
Now we just keep a record of the open pipes.
-
Tim Potter
e07bcfcccd Cache positive and negative name domain controller lookups.
Cache negative connection attempt lookups.

Fixed loginc bug in connection_ok()
-
Tim Potter
caef54e400 Random connection robustness related fixes. Display some debugs about
the currently open connections when winbindd receives a USR1 signal.

Hmm - I've just realised this will conflict with the messaging code
but we don't use that yet.
-
Tim Potter
d85aa1ce83 Use cli_nt_login_network() instead of domain_client_validate() to perform
pam authentication.  This allows us to link in less other crap.

Authenticating with a challenge/response doesn't seem to work though - we
always get back NT_STATUS_WRONG_PASSWORD.
-
Volker Lendecke
fd1d0064b3 Don't force winbind to use non-local DC's.
Volker
-