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

54 Commits

Author SHA1 Message Date
Gerald Carter
ce55cf1b82 r395: BUG 1232: patch from landonf@opendarwin.org (Landon Fuller) to fix
user/group enumeration on systems whose libc does not call setgrent()
before trying to enumerate users (i.e. FreeBSD 5.2)
(This used to be commit 8106d80972)
2007-10-10 10:51:21 -05:00
Gerald Carter
f7cf0aaa6f r294: checking in volker's winbindd patches; tested on domain members (Samba and AD) as well as on a Samba DC
(This used to be commit 157d53782d)
2007-10-10 10:51:17 -05:00
Gerald Carter
7af3777ab3 r116: volker's patch for local group and group nesting
(This used to be commit b393469d95)
2007-10-10 10:51:10 -05:00
Volker Lendecke
97b200d422 Apply some const
(This used to be commit 8037750df5)
2004-03-30 08:03:32 +00:00
Andrew Bartlett
7d068355aa This merges in my 'always use ADS' patch. Tested on a mix of NT and ADS
domains, this patch ensures that we always use the ADS backend when
security=ADS, and the remote server is capable.

The routines used for this behaviour have been upgraded to modern Samba
codeing standards.

This is a change in behaviour for mixed mode domains, and if the trusted
domain cannot be reached with our current krb5.conf file, we will show
that domain as disconnected.

This is in line with existing behaviour for native mode domains, and for
our primary domain.

As a consequence of testing this patch, I found that our kerberos error
handling was well below par - we would often throw away useful error
values.  These changes move more routines to ADS_STATUS to return
kerberos errors.

Also found when valgrinding the setup, fix a few memory leaks.

While sniffing the resultant connections, I noticed we would query our
list of trusted domains twice - so I have reworked some of the code to
avoid that.

Andrew Bartlett
(This used to be commit 7c34de8096)
2004-01-08 08:19:18 +00:00
Andrew Bartlett
614c18d24b 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
(This used to be commit 06c3f15aa1)
2004-01-05 02:04:37 +00:00
Andrew Bartlett
b34401b48a Forgot to commit this for the 'get our primary domain' change.
(This used to be commit 6f3cd9e2af)
2003-12-31 08:42:22 +00:00
Andrew Tridgell
e1c468477c 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.
(This used to be commit b3e024ce1d)
2003-11-12 01:51:10 +00:00
Jim McDonough
8c64504f7c Update my copyrights according to my agreement with IBM
(This used to be commit a2bd8f0bfa)
2003-08-01 15:30:44 +00:00
Jim McDonough
f210ee9b99 Fix copyright statements for various pieces of Anthony Liguori's work.
(This used to be commit 15d2bc4785)
2003-08-01 14:47:39 +00:00
Gerald Carter
93bcb9963b merge of the netsamlogon caching code from APPLIANCE_HEAD
This replaces the universal group caching code (was originally
based on that code).  Only applies to the the RPC code.

One comment: domain local groups don't show up in 'getent group'
that's easy to fix.

Code has been tested against 2k domain but doesn't change anything
with respect to NT4 domains.

netsamlogon caching works pretty much like the universal group
caching code did but has had much more testing and puts winbind
mostly back in sync between branches.
(This used to be commit aac01dc7bc)
2003-06-21 04:05:01 +00:00
Andrew Tridgell
057ec70b53 - 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.
(This used to be commit cdd9b60a07)
2003-06-10 03:50:38 +00:00
Tim Potter
1f84a14b0b Bug 83: fixes for building when $srcdir != $builddir from David Lee
<t.d.lee@durham.ac.uk>
(This used to be commit e48a8b5e9c)
2003-05-23 01:59:43 +00:00
Andrew Bartlett
1a9394195d 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
(This used to be commit d4d5e6c2ee)
2003-04-23 11:54:56 +00:00
Andrew Bartlett
d23b35a65f Winbind merges from HEAD:
- fix winbindd_pam bugs
 - give a better error message for unauthorized access to auth_crap
 - show this message in wbinfo
 - fix spelling: privilaged -> privileged
   ** This changes the location of the winbindd privileged pipe **
   (thanks to tpot)

Andrew Bartlett
(This used to be commit 92c2a33483)
2003-04-07 07:32:51 +00:00
Andrew Bartlett
53beee9e56 (merge from HEAD)
NTLM Authentication:

- Add a 'privileged' mode to Winbindd.  This is achieved by means of a directory
  under lockdir, that the admin can change the group access for.

- This mode is now required to access with 'CRAP' authentication feature.
- This *will* break the current SQUID helper, so I've fixed up our ntlm_auth
  replacement:
 - Update our NTLMSSP code to cope with 'datagram' mode, where we don't get a
   challenge.
 - Use this to make our ntlm_auth utility suitable for use in current Squid 2.5
   servers.
 - Tested - works for Win2k clients, but not Win9X at present.  NTLMSSP updates
   are needed.
 - Now uses fgets(), not x_fgets() to cope with Squid environment (I think
   somthing to do with non-blocking stdin).

- Add much more robust connection code to wb_common.c - it will not connect to
  a server of a different protocol version, and it will automatically try and
  reconnect to the 'privileged' pipe if possible.
  - This could help with 'privileged' idmap operations etc in future.

- Add a generic HEX encode routine to util_str.c,
- fix a small line of dodgy C in StrnCpy_fn()

- Correctly pull our 'session key' out of the info3 from th the DC.  This is
  used in both the auth code, and in for export over the winbind pipe to
  ntlm_auth.

- Given the user's challenge/response and access to the privileged pipe,
  allow external access to the 'session key'.  To be used for MSCHAPv2
  integration.

Andrew Bartlett
(This used to be commit ec071ca3dc)
2003-03-24 09:54:13 +00:00
Jeremy Allison
e0989e1304 *Excellent* patch from Michael Steffens <michael_steffens@hp.com> to limit
the unix domain sockets used by winbindd (also solves FD_SETSIZE problem
in winbindd to boot !). Adds a "last_access" field to winbindd connections,
and will close the oldest idle connection once the number of open connections
goes over WINBINDD_MAX_SIMULTANEOUS_CLIENTS (defined in local.h as 200
currently).
Jeremy.
(This used to be commit 7a586552a3)
2003-02-28 00:25:55 +00:00
Andrew Bartlett
26488953e7 Merge from HEAD: We don't need this any more, setenv() is in replace.c now
(This used to be commit cd6ad1f13b)
2003-02-19 12:33:32 +00:00
Gerald Carter
bfa93735ab merge from APP_HEAD of winbindd's domain local group fix
(This used to be commit 09c6f6329d)
2002-10-08 18:32:42 +00:00
Gerald Carter
055e6d1491 * merge native_mode flag in winbindd_domain struct from app-head
* add some files missing from a previous commit
(This used to be commit 29159c9737)
2002-10-04 21:42:04 +00:00
Jelmer Vernooij
b2edf254ed sync 3.0 branch with head
(This used to be commit 3928578b52)
2002-08-17 17:00:51 +00:00
Andrew Tridgell
e90b652848 updated the 3.0 branch from the head branch - ready for alpha18
(This used to be commit 03ac082dcb)
2002-07-15 10:35:28 +00:00
Tim Potter
9195f34e4a Moved definition of winbind username/password secrets into secrets.h
(This used to be commit b618b5943d)
2002-04-10 00:35:00 +00:00
Andrew Bartlett
e91e0a83af 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
(This used to be commit 92cbefdf27)
2002-02-15 13:28:59 +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 6a58c9bd06)
2002-01-30 06:08:46 +00:00
Tim Potter
da84e2a756 Always query the PDC for the list of trusted domains rather than interating
the list received at startup or we get an out of date list.  I thought
there might be some sequence number that is incremented when a trusted
domain is added or removed - perhaps there is but I just haven't found it
yet.

 - Renamed get_domain_info() to init_domain_list()

 - Made an accessor function to return the list of trusted domains rather
   than using a global so we don't have to remember to put a magic init
   function

 - The getent state can not keep a pointer to a winbind_domain structure as
   it may be freed if init_domain_list() is called again so we keep the
   domain name instead
(This used to be commit 37216c649a)
2002-01-11 05:33:45 +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 adf44a9bd0)
2001-12-19 09:53:30 +00:00
Tim Potter
6cc5e2edc1 Modify winbindd to use authenticated user info from secrets.tdb when making
IPC$ connections to domain controllers.
(This used to be commit 1217ef28a6)
2001-12-11 05:19:15 +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 34328e3031)
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 1c909afe76)
2001-12-11 00:03:58 +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 217c39f232)
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 7c60ae5937)
2001-12-10 02:25:19 +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 fddb4f4c04)
2001-12-09 23:59:42 +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 9a084f0bb9)
2001-12-05 07:52:44 +00:00
Andrew Tridgell
a313351e94 added very basic ads connection cacheing
(This used to be commit 7de670cd15)
2001-12-05 07:05:53 +00:00
Andrew Tridgell
3278f563b9 finally worked out how to do ldap lookups by binary blobs, so I can
now do searches on SID. This allows me to do a true ldap sid_to_name()
function

one one function to go!
(This used to be commit 7d44aa3915)
2001-12-05 04:48:51 +00:00
Andrew Tridgell
7b64e61e68 added lookup_groups() to the ads backend
winbindd/ADS can now do initgroups()
(This used to be commit 43edeaca9f)
2001-12-04 12:10:05 +00:00
Andrew Tridgell
1d66a6beba moved lookup_usergroups() into the backend structure
(This used to be commit 689f45d207)
2001-12-04 06:46:53 +00:00
Andrew Tridgell
8e8ce079b8 added a query_user backend
fixed a winbindd crash when the group membership can't be looked up
(This used to be commit 088f4cc5be)
2001-12-04 06:17:39 +00:00
Andrew Tridgell
fc85a60962 changed query_dispinfo to query_user_list
(This used to be commit 80010d80f9)
2001-12-03 11:32:55 +00:00
Andrew Tridgell
6f907af4e7 put sid_to_name behind the winbindd backend interface
I spent quite a while trying to work out how to make this call
via ldap and failed. I then found that MS servers seem use rpc
for sid_to_name, and it works even when in native mode, I ended
up just implementing it via rpc
(This used to be commit 789833b44e)
2001-12-03 11:11:14 +00:00
Andrew Tridgell
c868fe502b added name_to_sid to the backend
(This used to be commit 816e40a51a)
2001-12-03 08:17:46 +00:00
Andrew Tridgell
78169af90a split winbindd_enum_dom_groups into the new backend structure
also created winbindd_rpc.c which contains the functions that
have been converted to the new structure. There will soon be
a winbindd_ads.c for the ldap backend
(This used to be commit e4ccc602ba)
2001-12-03 01:23:42 +00:00
Andrew Tridgell
de744cb970 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
(This used to be commit 0216b0fca1)
2001-12-01 12:31:43 +00:00
Jeremy Allison
16ceec46d6 Added transparent +ve caching for lookupname/lookupsid. -ve caching can
be easily added (a one liner) once we know the correct error codes returned
by a W2K DC.
All other winbindd calls should go through a similar transparent caching layer
(and will soon).
Jeremy.
(This used to be commit b16bb21d37)
2001-11-21 09:59:15 +00:00
Tim Potter
e3e9c52b7a Fixed some memory leaks introduced by connection handling rewrite, as well
as one memory leak that has been there for ages!

Changed the way talloc is used in get{pw,gr}nam routines.
(This used to be commit d52cd1854f)
2001-10-19 08:22:52 +00:00
Tim Potter
52995a5f7d Converted some more functions to create and dispose of a talloc context on a
per-call basis rather than per-connection.

Had a bit more of a reformatting fest.

Still need to run it through insure and handle downed connections.
(This used to be commit 46fe5a8fb9)
2001-10-19 01:46:43 +00:00
Tim Potter
8632b44f6b Removed some unused code from the recent cleanup.
(This used to be commit 4f12df9fc5)
2001-10-12 03:56:13 +00:00
Tim Potter
482a9ef278 This is the start of a bit of a rewrite of winbindd's connection handling.
I've wrapped up all the decisions about managing, making and closing
connections into a connection manager in nsswitch/winbindd_cm.c.

It's rather incomplete at the moment - only querying basic user info works
at the moment (i.e finger -m DOMAIN/user) and everything else is broken.

Jeremy, please take a look and I'll start moving across the rest of
winbindd to this new system.
(This used to be commit c369cf5af7)
2001-10-05 00:20:06 +00:00
Tim Potter
dc1fc3ee8e Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.
(This used to be commit 2d0922b0ea)
2001-10-02 04:29:50 +00:00