From da1f8dc23b58b0f5dbe1328dd67f74abd317c264 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Mon, 17 Jul 2000 02:37:11 +0000 Subject: Renamed a parameter in init_request() function. Initialise response structure correctly. (This used to be commit 587c8e58fdd79dce47fb59ce702596ea58c8b4a6) --- source3/nsswitch/wb_common.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'source3') diff --git a/source3/nsswitch/wb_common.c b/source3/nsswitch/wb_common.c index 5d1f3431cc..42712d68da 100644 --- a/source3/nsswitch/wb_common.c +++ b/source3/nsswitch/wb_common.c @@ -30,18 +30,16 @@ static int established_socket = -1; /* fd for winbindd socket */ -/* - * Utility and helper functions - */ +/* Initialise a request structure */ -void init_request(struct winbindd_request *req,int rq_type) +void init_request(struct winbindd_request *request, int request_type) { static char *domain_env; static BOOL initialised; - req->cmd = rq_type; - req->pid = getpid(); - req->domain[0] = '\0'; + request->cmd = request_type; + request->pid = getpid(); + request->domain[0] = '\0'; if (!initialised) { initialised = True; @@ -49,12 +47,21 @@ void init_request(struct winbindd_request *req,int rq_type) } if (domain_env) { - strncpy(req->domain, domain_env, - sizeof(req->domain) - 1); - req->domain[sizeof(req->domain) - 1] = '\0'; + strncpy(request->domain, domain_env, + sizeof(request->domain) - 1); + request->domain[sizeof(request->domain) - 1] = '\0'; } } +/* Initialise a response structure */ + +void init_response(struct winbindd_response *response) +{ + /* Initialise return value */ + + response->result = NSS_STATUS_UNAVAIL; +} + /* Close established socket */ void close_sock(void) @@ -322,7 +329,9 @@ enum nss_status winbindd_request(int req_type, } /* Fill in request and send down pipe */ + init_request(request, req_type); + init_response(response); if (write_sock(request, sizeof(*request)) == -1) { return NSS_STATUS_UNAVAIL; -- cgit