summaryrefslogtreecommitdiffstats
path: root/source/nsswitch/wb_common.c
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-03-22 18:36:09 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:18:50 -0500
commit08c29abc03267b0dfb41cec3734653a536027a10 (patch)
treed3b2602aa8e4e01fe0290f8e52f06914b477bfe3 /source/nsswitch/wb_common.c
parent184c4619773f786c5299499e121e485b7545764f (diff)
downloadsamba-08c29abc03267b0dfb41cec3734653a536027a10.tar.gz
samba-08c29abc03267b0dfb41cec3734653a536027a10.tar.xz
samba-08c29abc03267b0dfb41cec3734653a536027a10.zip
r21935: Revert obviously not sufficiently tested code -- sorry for the pain. I am afraid I was basically off the net for the day
Diffstat (limited to 'source/nsswitch/wb_common.c')
-rw-r--r--source/nsswitch/wb_common.c47
1 files changed, 7 insertions, 40 deletions
diff --git a/source/nsswitch/wb_common.c b/source/nsswitch/wb_common.c
index fb84373aa63..05d2a660e73 100644
--- a/source/nsswitch/wb_common.c
+++ b/source/nsswitch/wb_common.c
@@ -33,7 +33,6 @@ BOOL winbind_on( void );
/* Global variables. These are effectively the client state information */
int winbindd_fd = -1; /* fd for winbindd socket */
-static int is_privileged = 0;
/* Free a response structure */
@@ -288,7 +287,7 @@ static int winbind_named_pipe_sock(const char *dir)
/* Connect to winbindd socket */
-static int winbind_open_pipe_sock(int recursing, int need_priv)
+static int winbind_open_pipe_sock(int recursing)
{
#ifdef HAVE_UNIXSOCKET
static pid_t our_pid;
@@ -301,10 +300,6 @@ static int winbind_open_pipe_sock(int recursing, int need_priv)
close_sock();
our_pid = getpid();
}
-
- if ((need_priv != 0) && (is_privileged == 0)) {
- close_sock();
- }
if (winbindd_fd != -1) {
return winbindd_fd;
@@ -318,8 +313,6 @@ static int winbind_open_pipe_sock(int recursing, int need_priv)
return -1;
}
- is_privileged = 0;
-
/* version-check the socket */
request.flags = WBFLAG_RECURSE;
@@ -336,14 +329,9 @@ static int winbind_open_pipe_sock(int recursing, int need_priv)
if ((fd = winbind_named_pipe_sock((char *)response.extra_data.data)) != -1) {
close(winbindd_fd);
winbindd_fd = fd;
- is_privileged = 1;
}
}
- if ((need_priv != 0) && (is_privileged == 0)) {
- return -1;
- }
-
SAFE_FREE(response.extra_data.data);
return winbindd_fd;
@@ -354,7 +342,7 @@ static int winbind_open_pipe_sock(int recursing, int need_priv)
/* Write data to winbindd socket */
-int write_sock(void *buffer, int count, int recursing, int need_priv)
+int write_sock(void *buffer, int count, int recursing)
{
int result, nwritten;
@@ -362,7 +350,7 @@ int write_sock(void *buffer, int count, int recursing, int need_priv)
restart:
- if (winbind_open_pipe_sock(recursing, need_priv) == -1) {
+ if (winbind_open_pipe_sock(recursing) == -1) {
return -1;
}
@@ -548,8 +536,7 @@ BOOL winbind_env_set( void )
* send simple types of requests
*/
-NSS_STATUS winbindd_send_request(int req_type, int need_priv,
- struct winbindd_request *request)
+NSS_STATUS winbindd_send_request(int req_type, struct winbindd_request *request)
{
struct winbindd_request lrequest;
@@ -568,14 +555,12 @@ NSS_STATUS winbindd_send_request(int req_type, int need_priv,
init_request(request, req_type);
- if (write_sock(request, sizeof(*request),
- request->flags & WBFLAG_RECURSE, need_priv) == -1) {
+ if (write_sock(request, sizeof(*request), request->flags & WBFLAG_RECURSE) == -1) {
return NSS_STATUS_UNAVAIL;
}
if ((request->extra_len != 0) &&
- (write_sock(request->extra_data.data, request->extra_len,
- request->flags & WBFLAG_RECURSE, need_priv) == -1)) {
+ (write_sock(request->extra_data.data, request->extra_len, request->flags & WBFLAG_RECURSE) == -1)) {
return NSS_STATUS_UNAVAIL;
}
@@ -625,25 +610,7 @@ NSS_STATUS winbindd_request_response(int req_type,
int count = 0;
while ((status == NSS_STATUS_UNAVAIL) && (count < 10)) {
- status = winbindd_send_request(req_type, 0, request);
- if (status != NSS_STATUS_SUCCESS)
- return(status);
- status = winbindd_get_response(response);
- count += 1;
- }
-
- return status;
-}
-
-NSS_STATUS winbindd_priv_request_response(int req_type,
- struct winbindd_request *request,
- struct winbindd_response *response)
-{
- NSS_STATUS status = NSS_STATUS_UNAVAIL;
- int count = 0;
-
- while ((status == NSS_STATUS_UNAVAIL) && (count < 10)) {
- status = winbindd_send_request(req_type, 1, request);
+ status = winbindd_send_request(req_type, request);
if (status != NSS_STATUS_SUCCESS)
return(status);
status = winbindd_get_response(response);