From f1fc17ea37e41cca3aacffaac43e6b8c39e95d58 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Fri, 20 Dec 2002 01:25:27 +0000 Subject: Merge from HEAD. - null termination of winbind request fix - bail out if we can't open winbind socket (This used to be commit 102e490d683c0758a9798a3c15e748509690c95b) --- source3/nsswitch/winbindd.c | 8 +++++++- source3/nsswitch/winbindd_nss.h | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'source3/nsswitch') diff --git a/source3/nsswitch/winbindd.c b/source3/nsswitch/winbindd.c index 4bfec1afe4..24d08a4e88 100644 --- a/source3/nsswitch/winbindd.c +++ b/source3/nsswitch/winbindd.c @@ -362,7 +362,7 @@ void winbind_process_packet(struct winbindd_cli_state *state) /* Process request */ /* Ensure null termination of entire request */ - state->request.domain[sizeof(state->request.domain)-1]='\0'; + state->request.null_term = '\0'; state->pid = state->request.pid; @@ -519,6 +519,12 @@ static void process_loop(void) /* Initialise fd lists for select() */ listen_sock = open_winbindd_socket(); + + if (listen_sock == -1) { + perror("open_winbind_socket"); + exit(1); + } + maxfd = listen_sock; FD_ZERO(&r_fds); diff --git a/source3/nsswitch/winbindd_nss.h b/source3/nsswitch/winbindd_nss.h index 368bf10cea..5c2db2ac2c 100644 --- a/source3/nsswitch/winbindd_nss.h +++ b/source3/nsswitch/winbindd_nss.h @@ -36,7 +36,7 @@ /* Update this when you change the interface. */ -#define WINBIND_INTERFACE_VERSION 5 +#define WINBIND_INTERFACE_VERSION 6 /* Socket commands */ @@ -156,7 +156,7 @@ struct winbindd_request { } name; uint32 num_entries; /* getpwent, getgrent */ } data; - fstring domain; /* {set,get,end}{pw,gr}ent() */ + char null_term; }; /* Response values */ -- cgit