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

59 Commits

Author SHA1 Message Date
Jeremy Allison
842e08e52a Forward port the change to talloc_init() to make all talloc contexts
named. Ensure we can query them.
Jeremy.
0001-01-01 00:00:00 +00:00
Gerald Carter
3ac98b5963 enable enumeration of domain local groups using LDAP (and in a native mode domain) 0001-01-01 00:00:00 +00:00
Gerald Carter
06eea39abd NULL enum_local_groups for ads winbindd (temporary workaround). 0001-01-01 00:00:00 +00:00
Andrew Bartlett
c864edf4fb Move a number of ADS related functions out into utility libs, so that things
like metze's sam_ads can also use them.

Also add error checking etc to a few more functions.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
5b9a7ab901 Patch from "Stefan (metze) Metzmacher" <metze@metzemix.de>
to extend the ADS_STATUS system to include NTSTATUS, and to provide a better
general infrustructure for his sam_ads work.

I've also added some extra failure mode DEBUG()s to parts of the code.

NOTE:  The ADS_ERR_OK() macro is rather sensitive to braketing issues - without
the final set of brakets, the test is essentially inverted - causing some
intersting 'error = success' messages...

Andrew Bartlett
0001-01-01 00:00:00 +00:00
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
0001-01-01 00:00:00 +00:00
Andrew Tridgell
5538048e4f this implements a completely new strategy for fetching group
membership from an ADS server. We now use a 'member' query on the
group and do a separate call to convert the resulting distinguished
name to a name, rid etc. This is *much* faster for very large numbers
of groups (on a quantum test system with 10000 groups it drops the
time from an hour to about 35 seconds).

strangely enough, this actually *increases* the amount of ldap
traffic, its just that the MS LDAP server answers these queries much
faster.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
dbfd4e5101 fixed a bug handling startup when the ads server is not contactable 0001-01-01 00:00:00 +00:00
Simo Sorce
897e64d2e0 more debug classess activated 0001-01-01 00:00:00 +00:00
Andrew Bartlett
04f9a8ff4c Latest patch from metze <metze@metzemix.de> to move most of samba across
to using SIDs instead of RIDs.

The new funciton sid_peek_check_rid() takes an 'expected domain sid' argument.

The idea here is to prevent mistakes where the SID is implict, but isn't
the same one that we have in the struct.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Tridgell
8b5ac00ac6 fixed some debug messages 0001-01-01 00:00:00 +00:00
Andrew Tridgell
8096032663 fixed trust relationships in ADS winbindd after breaking them with my BDC changes ... 0001-01-01 00:00:00 +00:00
Andrew Tridgell
3e58a1ee83 fixed the fallback to a BDC for ADS connections 0001-01-01 00:00:00 +00:00
Andrew Tridgell
fbf154bcfb pull_username() is a local function 0001-01-01 00:00:00 +00:00
Andrew Tridgell
aa139ba507 hanle the case where the win2000 username is completely different from
the pre-win2000 username
0001-01-01 00:00:00 +00:00
Andrew Tridgell
0719e756f6 modified the ADS backend to accept either the long or short versions
of long usernames (win2000 usernames can be longer than 20 characters)
0001-01-01 00:00:00 +00:00
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.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
be399f5823 fixed the secondary group mappings for ADS users 0001-01-01 00:00:00 +00:00
Andrew Tridgell
41e1560798 updated winbindd to used paged ldap searches for all ldap queries 0001-01-01 00:00:00 +00:00
Andrew Tridgell
1aaa2091d5 fixed 2 reconnection bugs in the ADS backend support 0001-01-01 00:00:00 +00:00
Andrew Tridgell
58b79c0dc8 better detection of dead ADS connections, so we have some chance of
reconnecting
0001-01-01 00:00:00 +00:00
Tim Potter
6a58c9bd06 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
0001-01-01 00:00:00 +00:00
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
0001-01-01 00:00:00 +00:00
Andrew Tridgell
ff002a458a added ads_domain_sid() function 0001-01-01 00:00:00 +00:00
Andrew Tridgell
1bf5c1a46f use "ads server" option if set for primary domain 0001-01-01 00:00:00 +00:00
Andrew Tridgell
e97b40e094 add support for mixtures of ADS/NT4 domains, as long as the primary
domain is ADS
0001-01-01 00:00:00 +00:00
Andrew Tridgell
05a90a2884 much better ADS error handling system 0001-01-01 00:00:00 +00:00
Andrew Tridgell
adf44a9bd0 added trusted realm support to ADS authentication
the method used for checking if a domain is a trusted domain is very
crude, we should really call a backend fn of some sort. For now I'm
using winbindd to do the dirty work.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
ee1c3e1f04 - added initial support for trusted domains in winbindd_ads
- gss error code patch from a.bokovoy@sam-solutions.net
- better sid dumping in ads_dump
- fixed help in wbinfo
0001-01-01 00:00:00 +00:00
Jim McDonough
6688781331 Replace backslash with winbind separator before calling parse_domain_user(). Winbind separators other than backslash didn't work. 0001-01-01 00:00:00 +00:00
Andrew Tridgell
8709065246 handle systems without setenv() 0001-01-01 00:00:00 +00:00
Andrew Tridgell
34328e3031 removed the start_ndx parameter from group enumeration
I tried testing this by lowering the buffer size in
cli_samr_enum_dom_groups() but that didn't work - I think this needs
more looking into
0001-01-01 00:00:00 +00:00
Andrew Tridgell
1c909afe76 got rid of start_ndx from query_user_list() 0001-01-01 00:00:00 +00:00
Andrew Tridgell
24aa09ff3d robustness fixes and moved ccache location into winbindd_ads code 0001-01-01 00:00:00 +00:00
Andrew Tridgell
4d3b827e5a use objectCategory instead of objectClass for faster searching 0001-01-01 00:00:00 +00:00
Andrew Tridgell
217c39f232 winbindd backends can now be marked "consistent" or "inconsistent"
consistent backends (like ADS) always give correct primary group
info, so we can play cache tricks to speed things up a lot

inconsistent backends (like MSRPC) need to fetch stuff more often
0001-01-01 00:00:00 +00:00
Andrew Tridgell
7c60ae5937 moved the domain sid lookup and enumeration of trusted domains into
the backends

at startup, loop until we get the domain sid for our primary domain,
trying every 10 seconds. This makes winbindd handle a room-wide power
failure better
0001-01-01 00:00:00 +00:00
Andrew Tridgell
4a6d297686 make sid_binstring available without HAVE_ADS 0001-01-01 00:00:00 +00:00
Andrew Tridgell
fddb4f4c04 completely new winbindd cache infrastructure
this one looks like just another winbind backend, and has the
following properties:

- does -ve and +ve cacheing of all queries

- can be disabled with -n switch to winbindd

- stores all records packed, so even huge domains are not a problem
for a complete cache

- handles the server being down

- uses sequence numbers for all entries

This fixes a lot of problems with winbindd. Serving from cache is now
*very* fast.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
01f63b9c92 - use accountype not accountcontrol
- better debug code
0001-01-01 00:00:00 +00:00
Andrew Tridgell
0ff30848f3 fixed type passed to ads_search 0001-01-01 00:00:00 +00:00
Andrew Tridgell
435fdf276a added internal sasl/gssapi code. This means we are no longer dependent on cyrus-sasl which makes the code much less fragile. Also added code to auto-determine the server name or realm 0001-01-01 00:00:00 +00:00
Andrew Tridgell
45c328800e fixed a memory leak 0001-01-01 00:00:00 +00:00
Andrew Tridgell
7d94f1b736 added a REALLY gross hack into kerberos_kinit_password so that
winbindd can do a kinit
this will be removed once we have code that gets a tgt
and puts it in a place where cyrus-sasl can see it
0001-01-01 00:00:00 +00:00
Andrew Tridgell
9a084f0bb9 moved the sequence number fetch into the backend, and fetch the
sequence number via ldap when using ads
0001-01-01 00:00:00 +00:00
Andrew Tridgell
f64612b89b don't double free ldap message lists 0001-01-01 00:00:00 +00:00
Andrew Tridgell
a45e396859 fixed another leak - memory usage now seems to be quite small 0001-01-01 00:00:00 +00:00
Andrew Tridgell
7de670cd15 added very basic ads connection cacheing 0001-01-01 00:00:00 +00:00
Andrew Tridgell
60b5d4432a plugged most of the memory leaks 0001-01-01 00:00:00 +00:00
Andrew Tridgell
fad564c177 added the last winbindd/ads backend function
winbindd is now fully functional with a native mode w2k server

now for the memory leaks and speed ...
0001-01-01 00:00:00 +00:00