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

37 Commits

Author SHA1 Message Date
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
Volker Lendecke
fd35232584 Commit the translation of the realm to the netbios domain name in the kerberos
session setup. After talking to jht and abartlet I made this unconditional, no
additional parameter.

Jerry: This is a change in behaviour, but I think it is necessary.

Volker
(This used to be commit 3ce6c9f273)
2004-01-04 11:51:31 +00:00
Andrew Bartlett
829188b34f Try to gain a bit more consistancy in the output of usernames from ntlm_auth:
Instead of returning a name in DOMAIN\user format, we now return it in the
same way that nsswtich does - following the rules of 'winbind use default
domain', in the correct case and with the correct seperator.

This should help sites who are using Squid or the new SASL code I'm working
on, to match back to their unix usernames.

Andrew Bartlett
(This used to be commit 7a3a5a6361)
2003-12-30 13:20:39 +00:00
Andrew Tridgell
53dfaac5fb as discussed on irc, this is a small patch that allows a few more
winbind functions to be accessed via NSS. This provides a much cleaner
way for applications that need (for example) to provide name->sid
mappings to do this via NSS rather than having to know the winbindd
pipe protocol (as this might change).

This patch also adds a varient of the winbindd_getgroups() call called
winbindd_getusersids() that provides direct SID->SIDs listing of a
users supplementary groups. This is enough to allow non-Samba
applications to do ACL checking.

A test program for the new functionality will be committed shortly.

I also added the 'wbinfo --user-sids' option to expose the new
function in wbinfo.
(This used to be commit 702b35da0a)
2003-11-19 08:11:14 +00:00
Gerald Carter
d5d9055b9b add --domain=DOMAINNAME to wbinfo
Add support for geting the sequence number, list of users, and list
of groups for a specific domain (assuming on reported back by
wbinfo -m)

	wbinfo -u --domain=DOA
(This used to be commit 34fc6e1bf9)
2003-08-10 22:01:11 +00:00
Gerald Carter
03d5867d52 moving more code around.
* move rid allocation into IDMAP.  See comments in _api_samr_create_user()
  * add winbind delete user/group functions

I'm checking this in to sync up with everyone.  But I'm going to split
the add a separate winbindd_allocate_rid() function for systems
that have an 'add user script' but need idmap to give them a RID.
Life would be so much simplier without 'enable rid algorithm'.
The current RID allocation is horrible due to this one fact.
Tested idmap_tdb but not idmap_ldap yet.  Will do that tomorrow.

Nothing has changed in the way a samba domain is represented, stored,
or search in the directory so things should be ok with previous installations.

going to bed now.
(This used to be commit 0463045cc7)
2003-07-11 05:33:40 +00:00
Gerald Carter
16ff7b26f6 Large set of changes to add UNIX account/group management
to winbindd.  See README.idmap-and-winbind-changes for details.
(This used to be commit 1111bc7b0c)
2003-07-09 16:44:47 +00:00
Gerald Carter
0b18acb841 and so it begins....
* remove idmap_XX_to_XX calls from smbd.  Move back to the
  the winbind_XXX and local_XXX calls used in 2.2

* all uid/gid allocation must involve winbindd now

* move flags field around in winbindd_request struct

* add WBFLAG_QUERY_ONLY option to winbindd_sid_to_[ug]id()
  to prevent automatic allocation for unknown SIDs

* add 'winbind trusted domains only' parameter to force a domain member
  server to use matching users names from /etc/passwd for its domain
  (needed for domain member of a Samba domain)

* rename 'idmap only' to 'enable rid algorithm' for better clarity
  (defaults to "yes")

code has been tested on

  * domain member of native mode 2k domain
  * ads domain member of native mode 2k domain
  * domain member of NT4 domain
  * domain member of Samba domain
  * Samba PDC running winbindd with trusts

Logons tested using 2k clients and smbclient as domain users
and trusted users. Tested both 'winbind trusted domains only = [yes|no]'

This will be a long week of changes.  The next item on the list is
winbindd_passdb.c & machine trust accounts not in /etc/passwd (done
via winbindd_passdb)
(This used to be commit 8266dffab4)
2003-07-07 05:11:10 +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
Andrew Bartlett
1cba0a7579 Merge from HEAD:
- NTLMSSP over SPENGO (sesssion-setup-and-x) cleanup and code refactor.
  - also consequential changes to the NTLMSSP and SPNEGO parsing functions
  - and the client code that uses the same functions
 - Add ntlm_auth, a NTLMSSP authentication interface for use by applications
   like Squid and Apache.
  - also consquential changes to use common code for base64 encode/decode.
 - Winbind changes to support ntlm_auth (I don't want this program to need
   to read smb.conf, instead getting all it's details over the pipe).
 - nmbd changes for fstrcat() instead of fstrcpy().

Andrew Bartlett
(This used to be commit fbb46da79c)
2003-01-28 12:07:02 +00:00
Andrew Bartlett
1f67168a54 The winbind in Samba 3.0 doesn't use the 'proof' for ntlm_auth_crap, so don't
include it in the struct.  (Important becouse it currently has the same version
number as the one in HEAD, which also doesn't have this).

Andrew Bartlett
(This used to be commit 0d2da98590)
2003-01-04 09:04:06 +00:00
Jeremy Allison
98ac4503ac Finish adding strings to all talloc_init() calls.
Jeremy.
(This used to be commit aa8439a49e)
2002-12-23 23:54:10 +00:00
Tim Potter
f1fc17ea37 Merge from HEAD.
- null termination of winbind request fix
 - bail out if we can't open winbind socket
(This used to be commit 102e490d68)
2002-12-20 01:25:27 +00:00
Gerald Carter
a834a73e34 sync'ing up for 3.0alpha20 release
(This used to be commit 65e7b5273b)
2002-09-25 15:19:00 +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
Herb Lewis
93af72fe45 merge winbindd WINS changes from 2.2
(This used to be commit 205399dc17)
2002-03-29 15:37:39 +00:00
Andrew Bartlett
ed389ee8dc Drastic impromvents to pam_winbind.
This adds code to do generic PAM -> NTSTATUS and NTSTATUS -> PAM error
conversions, and uses them to make the error handling in pam_winbind sane.

In particular, pam_winbind now uses PAM error codes, not silly '-1, -2 ...'
stuff, and logs the NTSTATUS error that winbind now sends over the pipe.

Added code to wbinfo to display these - makes a big difference in debugging
winbindd.

The main change here is the code to allow pam_winbind password changing to
correctly stack - This code ripped from pam_unix, and the copyright attached.
(Same as for all pam modules, including pam_winbind)

Andrew Bartlett
(This used to be commit dc1a72f896)
2002-02-05 09:40:36 +00:00
Andrew Tridgell
3a1a53c88a added 'wbinfo --sequence' to show sequence numbers of all domains
(This used to be commit bcd234a3da)
2002-01-31 11:49:29 +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
Andrew Bartlett
06c79a1757 Change the winbind interface to use seperate 'domain' and 'username' feilds for
the sid->uid and uid->sid conversions.

Remove some duplicate arguments from these funcitons, and update the
request/response structures for this and the 'winbind domain name' feature.

As such 'winbindd_lookup_name' now takes both a domain and username.
(This used to be commit ce1b4d4c30)
2002-01-26 09:55:38 +00:00
Tim Potter
85e06cebc0 Since AB has been changing the winbind interface it's time to add the "mock
swedish" test to client calls.  This is putting a length field at the
start of a request so we can disconnect clients talking with an out of date
libnss_winbind.so rather than deadlock them.

Misc cleanups:

 - made some int values uint32
 - moved WINBIND_INTERFACE_VERSION to start of cmd list
(This used to be commit a4af65b9b9)
2002-01-10 23:45:29 +00:00
Andrew Bartlett
7d6dd0b3a0 Return the winbind separator over the socket, so programs don't have to parse
smb.conf to get it right.

While wb_client needs its lp_load() for samba dependency reasons, it now uses
the new method both to example and test the new code.

Also add an interface version function, and return the winbind's samba version
string.

In preperation for default domains, its now up to winbindd to reject plaintext
auths that don't have a seperator, but NTLM (CRAP) auths now have two feilds,
hence need parsing.

Andrew Bartlett
(This used to be commit 2bd2a092ee)
2002-01-10 11:28:14 +00:00
Andrew Bartlett
cf00e41421 This changes the winbind protcol a bit:
It adds a 'ping' request, just to check winbind is in fact alive

It also changes winbindd_pam_auth_crap to take usernames and domain seperatly.

(backward incompatible change, needs merge to 2.2, but this is not yet released
code, so no workarounds)

Finally, it adds some debugs and fixes a few memory leaks (uses talloc to do
it).

Andrew Bartlett
(This used to be commit 6df29bfe33)
2002-01-10 10:23:54 +00:00
Tim Potter
610f530aee A big tidyup while thinking about getting trusted domains being re-read
when they are added or removed on the PDC.

 - renamed GETPWNAM_FROM_{UID,USER} constants and functions to GETPW{NAM,UID}

 - renamed GETGRNAM_FROM_{GID,GROUP} constants and functions to GETGR{NAM,GID}

 - use SIGUSR2 in winbindd for debugging/logging instead of SIGUSR1 in
   preparation for moving to smbcontrol type messages (not sure whether to
   ditch this altogether or not)

 - tidy debugging messages in top level winbind user and group routines

 - convert talloc_init() to talloc_init_named()

 - make enumerations of the domain list use the same local variable names
(This used to be commit eeb8af9c1a)
2002-01-10 06:20:03 +00:00
Jeremy Allison
efa52853f6 Preparing to implement +ve and -ve caching for lookupname/lookupsid calls.
Jeremy.
(This used to be commit 1f6cc536b2)
2001-11-21 08:36:43 +00:00
Jeremy Allison
5d97ab9df8 Got ready to implement Martin's idea, but request doesn't have a length
field.... well, now at least the code is there when it does :-).
Jeremy.
(This used to be commit 22e323ca47)
2001-11-14 20:02:02 +00:00
Simo Sorce
b50d10c2a3 move to SAFE_FREE()
(This used to be commit 03dc67788f)
2001-09-17 04:52:45 +00:00
Andrew Tridgell
7deed93dd7 fixed a bunch of compilation errors on Solaris, mostly people getting NSS_STATUS and WINBINDD error codes mixed up
(This used to be commit 66698d6b84)
2001-09-05 07:55:54 +00:00
Tim Potter
b0f167cdf2 Added another authentication interface to winbindd. The Challenge Response
Authentication Protocol (CRAP) takes a tuple of (username, random
challenge, encrypted lm password, encrypted nt password) where the
passwords are encrypted with the random challenge ala ntlmssp.
(This used to be commit 11f72a78e3)
2001-08-22 02:48:16 +00:00
Tim Potter
76aab4ad56 Renamed WINBINDD_INITGROUPS constant to WINBINDD_GETGROUPS.
(This used to be commit 5f3cf2eb78)
2000-10-11 05:45:06 +00:00
Tim Potter
ebe8a05062 Updated file with version in TNG.
(This used to be commit 156e17dea4)
2000-08-25 00:55:27 +00:00
Tim Potter
e7b5aba7f1 Merge of wbinfo program from TNG.
(This used to be commit 659e4d88ff)
2000-07-05 11:24:26 +00:00
Tim Potter
1230fe46ae Merge from TNG.
(This used to be commit b46fc0ed04)
2000-06-30 06:48:47 +00:00
Tim Potter
9ee57562d2 Merge from TNG.
(This used to be commit e5cb97dda8)
2000-06-14 09:58:12 +00:00
Andrew Tridgell
32cb0660d2 brought the winbindd code into head
this does not yet compile, but I'm working on that.
(This used to be commit 3fb862531a)
2000-05-09 11:43:00 +00:00