summaryrefslogtreecommitdiff
path: root/source3/nsswitch
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2000-07-17 02:37:11 +0000
committerTim Potter <tpot@samba.org>2000-07-17 02:37:11 +0000
commitda1f8dc23b58b0f5dbe1328dd67f74abd317c264 (patch)
tree694d4279e41b92701dc70591d131481c1c449cfd /source3/nsswitch
parentc9dc68746b2d31d7c28a655fcd252f015c68de87 (diff)
downloadsamba-da1f8dc23b58b0f5dbe1328dd67f74abd317c264.tar.gz
samba-da1f8dc23b58b0f5dbe1328dd67f74abd317c264.tar.bz2
samba-da1f8dc23b58b0f5dbe1328dd67f74abd317c264.zip
Renamed a parameter in init_request() function.
Initialise response structure correctly. (This used to be commit 587c8e58fdd79dce47fb59ce702596ea58c8b4a6)
Diffstat (limited to 'source3/nsswitch')
-rw-r--r--source3/nsswitch/wb_common.c29
1 files changed, 19 insertions, 10 deletions
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;