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

59 Commits

Author SHA1 Message Date
Jeremy Allison
7f23546730 Forward port the change to talloc_init() to make all talloc contexts
named. Ensure we can query them.
Jeremy.
(This used to be commit 842e08e52a665ae678eea239759bb2de1a0d7b33)
2002-12-20 20:23:06 +00:00
Gerald Carter
74cdd691a9 enable enumeration of domain local groups using LDAP (and in a native mode domain)
(This used to be commit 3ac98b59632fd771b8819f88a479ef4c0daade68)
2002-11-15 17:56:21 +00:00
Gerald Carter
e1096e6936 NULL enum_local_groups for ads winbindd (temporary workaround).
(This used to be commit 06eea39abdb49d9d547707dcb170c988d7276c1d)
2002-10-18 17:42:41 +00:00
Andrew Bartlett
7e4afe5381 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
(This used to be commit c864edf4fbf8a6c37888a14b861d7c12cf503d4f)
2002-09-27 12:23:47 +00:00
Andrew Bartlett
eec38ee3bb 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
(This used to be commit 5b9a7ab901bc311f3ad08462a8a68d133c34a8b4)
2002-09-06 11:46:59 +00:00
Andrew Tridgell
ab9ff0fa73 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
(This used to be commit e358d7b24c86a46d8c361b9e32a25d4f71a6dc00)
2002-08-05 02:47:46 +00:00
Andrew Tridgell
5d82785756 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.
(This used to be commit 5538048e4f6dd224b2990f3c6a3e99fd07065f77)
2002-07-11 05:28:08 +00:00
Andrew Tridgell
fd8d5e56af fixed a bug handling startup when the ads server is not contactable
(This used to be commit dbfd4e5101599bcb85600e4c5c93ce5390b9aa91)
2002-07-01 04:47:29 +00:00
Simo Sorce
a60e37096d more debug classess activated
(This used to be commit 897e64d2e0c1d04ab93441ccaffe369bf43be46e)
2002-06-18 09:20:13 +00:00
Andrew Bartlett
bad738e653 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
(This used to be commit 04f9a8ff4c7982f6597c0f6748f85d66d4784901)
2002-06-13 14:06:08 +00:00
Andrew Tridgell
9401cdbb51 fixed some debug messages
(This used to be commit 8b5ac00ac60135f83145c65425d7b33a751a15b4)
2002-06-03 03:04:35 +00:00
Andrew Tridgell
fc78c773f8 fixed trust relationships in ADS winbindd after breaking them with my BDC changes ...
(This used to be commit 8096032663690eafb6bb8b4f405d6231389d4f80)
2002-04-19 03:00:29 +00:00
Andrew Tridgell
c0a9919430 fixed the fallback to a BDC for ADS connections
(This used to be commit 3e58a1ee83ea0b4347ce24e566445cc6cb67bb3a)
2002-04-18 06:56:44 +00:00
Andrew Tridgell
a83a0ac9c5 pull_username() is a local function
(This used to be commit fbf154bcfb68b90eb43ada9de317c93f43711608)
2002-04-14 05:51:13 +00:00
Andrew Tridgell
58c7f38368 hanle the case where the win2000 username is completely different from
the pre-win2000 username
(This used to be commit aa139ba507e4b898377fdfc9b27f7febf029d5a4)
2002-04-14 05:46:23 +00:00
Andrew Tridgell
35bc06d35c modified the ADS backend to accept either the long or short versions
of long usernames (win2000 usernames can be longer than 20 characters)
(This used to be commit 0719e756f60950b9ec04450fda5cc3776752e9a9)
2002-04-14 05:14:50 +00:00
Andrew Tridgell
560a51f46b 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.
(This used to be commit dfa990170bb9a665ba48443258e2a87f50baa75c)
2002-04-11 14:30:31 +00:00
Andrew Tridgell
e76d514f57 fixed the secondary group mappings for ADS users
(This used to be commit be399f5823bb8dfe6cc28d58aaeceb51f1b7382b)
2002-03-21 02:28:23 +00:00
Andrew Tridgell
7b50eef89e updated winbindd to used paged ldap searches for all ldap queries
(This used to be commit 41e1560798b7eb19575b0d97a5e489eb170bcfd5)
2002-03-19 22:15:32 +00:00
Andrew Tridgell
08a0230855 fixed 2 reconnection bugs in the ADS backend support
(This used to be commit 1aaa2091d54e7e50cf75927d658e57776792d6ae)
2002-03-12 20:17:34 +00:00
Andrew Tridgell
e1aed4f49c better detection of dead ADS connections, so we have some chance of
reconnecting
(This used to be commit 58b79c0dc882fa402423e44a594e30c27177f490)
2002-03-09 19:36:53 +00:00
Tim Potter
cd68afe312 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
(This used to be commit 6a58c9bd06d0d7502a24bf5ce5a2faf0a146edfa)
2002-01-30 06:08:46 +00:00
Andrew Bartlett
93a8358910 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
(This used to be commit e870f0e727952aeb8599cf93ad2650ae56eca033)
2002-01-20 01:24:59 +00:00
Andrew Tridgell
401c7495ea added ads_domain_sid() function
(This used to be commit ff002a458afa6ca378f0c6d2ec9fb74233c839a7)
2001-12-20 23:35:14 +00:00
Andrew Tridgell
15aad7f33d use "ads server" option if set for primary domain
(This used to be commit 1bf5c1a46f4c3f44054ce8fcbc551cdb72683f2b)
2001-12-19 13:33:08 +00:00
Andrew Tridgell
a04aec58d3 add support for mixtures of ADS/NT4 domains, as long as the primary
domain is ADS
(This used to be commit e97b40e09427c2c5f0a497f9432af08d6d6762f2)
2001-12-19 12:38:52 +00:00
Andrew Tridgell
1f31ace6cb much better ADS error handling system
(This used to be commit 05a90a28843e0d69183a49a76617c5f32817df16)
2001-12-19 12:21:12 +00:00
Andrew Tridgell
9126a40e2c 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.
(This used to be commit adf44a9bd0d997ba4dcfadc564a29149531525af)
2001-12-19 09:53:30 +00:00
Andrew Tridgell
a062e58d9e - 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
(This used to be commit ee1c3e1f044b4ef62169ad74c5cac40eef81bfda)
2001-12-19 08:44:23 +00:00
Jim McDonough
d9c3ef8450 Replace backslash with winbind separator before calling parse_domain_user(). Winbind separators other than backslash didn't work.
(This used to be commit 6688781331e046adc77783792fc009cda7c8b5b8)
2001-12-11 19:27:40 +00:00
Andrew Tridgell
d86b7f9dc3 handle systems without setenv()
(This used to be commit 87090652460e57703b40f21e9ed08c18770b61c3)
2001-12-11 06:17:01 +00:00
Andrew Tridgell
d033e53300 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
(This used to be commit 34328e30315e4b42087d0ee11ed0c3fb715bc250)
2001-12-11 01:04:13 +00:00
Andrew Tridgell
abeb0f50ea got rid of start_ndx from query_user_list()
(This used to be commit 1c909afe76566807fb576c965eb869f98e72f2bd)
2001-12-11 00:03:58 +00:00
Andrew Tridgell
273deacb32 robustness fixes and moved ccache location into winbindd_ads code
(This used to be commit 24aa09ff3dd128c6f12b4cb072943ff668a29a67)
2001-12-10 22:10:16 +00:00
Andrew Tridgell
6b36fa3a8a use objectCategory instead of objectClass for faster searching
(This used to be commit 4d3b827e5ac1ac20ec31acdc1e2a0264f1c18e43)
2001-12-10 06:21:44 +00:00
Andrew Tridgell
2bbc91978b 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
(This used to be commit 217c39f23282e20f96a61a0d5a2434b3f5f66a86)
2001-12-10 06:05:21 +00:00
Andrew Tridgell
f3918919d2 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
(This used to be commit 7c60ae59378be1b2af2e57ee3927966a29a797a5)
2001-12-10 02:25:19 +00:00
Andrew Tridgell
e051c2c430 make sid_binstring available without HAVE_ADS
(This used to be commit 4a6d29768665f71b72cf48ee34ee9a9c451232f6)
2001-12-10 00:39:01 +00:00
Andrew Tridgell
31842f5d01 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.
(This used to be commit fddb4f4c04473a60a97212c0c8e143d6a4d68380)
2001-12-09 23:59:42 +00:00
Andrew Tridgell
0b33cb1a7b - use accountype not accountcontrol
- better debug code
(This used to be commit 01f63b9c92137e6de906412952c7a2c8da21dfbe)
2001-12-09 06:10:02 +00:00
Andrew Tridgell
b6c618467d fixed type passed to ads_search
(This used to be commit 0ff30848f3ef4f38e9bc80dc96be4f37bb2dcb0e)
2001-12-09 00:46:37 +00:00
Andrew Tridgell
5d378a280f 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
(This used to be commit 435fdf276a79c2a517adcd7726933aeef3fa924b)
2001-12-08 11:18:56 +00:00
Andrew Tridgell
a87b9bf561 fixed a memory leak
(This used to be commit 45c328800e42ba01c8d6113c0691546804137677)
2001-12-05 10:43:43 +00:00
Andrew Tridgell
9421ad4a7a 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
(This used to be commit 7d94f1b7365215a020d3678d03d820a7d086174f)
2001-12-05 09:46:53 +00:00
Andrew Tridgell
addea9645d moved the sequence number fetch into the backend, and fetch the
sequence number via ldap when using ads
(This used to be commit 9a084f0bb91883224ad44e2b76417d10c15cce42)
2001-12-05 07:52:44 +00:00
Andrew Tridgell
5329af6e11 don't double free ldap message lists
(This used to be commit f64612b89bae1148d73555cac00f6019a01f9304)
2001-12-05 07:36:35 +00:00
Andrew Tridgell
cb01c8e192 fixed another leak - memory usage now seems to be quite small
(This used to be commit a45e3968590a021c1b464db5265a09ba48cb5797)
2001-12-05 07:11:26 +00:00
Andrew Tridgell
a313351e94 added very basic ads connection cacheing
(This used to be commit 7de670cd15c1a87dd01ab22d74a7e6cbf5ae6673)
2001-12-05 07:05:53 +00:00
Andrew Tridgell
faa0f63774 plugged most of the memory leaks
(This used to be commit 60b5d4432abd905ee61fe381487ed87139134685)
2001-12-05 06:16:33 +00:00
Andrew Tridgell
ca61334c76 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 ...
(This used to be commit fad564c177049eb47e5bf48c98b62281c6348ffc)
2001-12-05 05:35:45 +00:00