diff options
author | Andrew Bartlett <abartlet@samba.org> | 2003-03-24 09:54:13 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2003-03-24 09:54:13 +0000 |
commit | 53beee9e5675a59c67d9ecfbaec50dca4ac01750 (patch) | |
tree | b4ca6d9d3055c941bab8da23d70abf3e9eae4260 /source3/nsswitch/winbindd_util.c | |
parent | 7d4bfa0eda4f79f55950d4089e636eecc37975f6 (diff) | |
download | samba-53beee9e5675a59c67d9ecfbaec50dca4ac01750.tar.gz samba-53beee9e5675a59c67d9ecfbaec50dca4ac01750.tar.bz2 samba-53beee9e5675a59c67d9ecfbaec50dca4ac01750.zip |
(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 ec071ca3dcbd3881dc08e6a8d7ac2ff0bcd57664)
Diffstat (limited to 'source3/nsswitch/winbindd_util.c')
-rw-r--r-- | source3/nsswitch/winbindd_util.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/source3/nsswitch/winbindd_util.c b/source3/nsswitch/winbindd_util.c index 99b94eac47..262d862b8a 100644 --- a/source3/nsswitch/winbindd_util.c +++ b/source3/nsswitch/winbindd_util.c @@ -444,9 +444,15 @@ void fill_domain_username(fstring name, const char *domain, const char *user) * Winbindd socket accessor functions */ +char *get_winbind_priv_pipe_dir(void) +{ + return lock_path(WINBINDD_PRIV_SOCKET_SUBDIR); +} + /* Open the winbindd socket */ static int _winbindd_socket = -1; +static int _winbindd_priv_socket = -1; int open_winbindd_socket(void) { @@ -460,6 +466,18 @@ int open_winbindd_socket(void) return _winbindd_socket; } +int open_winbindd_priv_socket(void) +{ + if (_winbindd_priv_socket == -1) { + _winbindd_priv_socket = create_pipe_sock( + get_winbind_priv_pipe_dir(), WINBINDD_SOCKET_NAME, 0750); + DEBUG(10, ("open_winbindd_priv_socket: opened socket fd %d\n", + _winbindd_priv_socket)); + } + + return _winbindd_priv_socket; +} + /* Close the winbindd socket */ void close_winbindd_socket(void) @@ -470,6 +488,12 @@ void close_winbindd_socket(void) close(_winbindd_socket); _winbindd_socket = -1; } + if (_winbindd_priv_socket != -1) { + DEBUG(10, ("close_winbindd_socket: closing socket fd %d\n", + _winbindd_priv_socket)); + close(_winbindd_priv_socket); + _winbindd_priv_socket = -1; + } } /* |