diff options
Diffstat (limited to 'source3/winbindd')
-rw-r--r-- | source3/winbindd/winbindd_group.c | 8 | ||||
-rw-r--r-- | source3/winbindd/winbindd_user.c | 8 | ||||
-rw-r--r-- | source3/winbindd/winbindd_util.c | 12 | ||||
-rw-r--r-- | source3/winbindd/winbindd_wins.c | 10 |
4 files changed, 32 insertions, 6 deletions
diff --git a/source3/winbindd/winbindd_group.c b/source3/winbindd/winbindd_group.c index 7432bda451..bc532bbce7 100644 --- a/source3/winbindd/winbindd_group.c +++ b/source3/winbindd/winbindd_group.c @@ -991,7 +991,13 @@ static void getgrgid_recv(void *private_data, bool success, const char *sid) DEBUG(10,("getgrgid_recv: gid %lu has sid %s\n", (unsigned long)(state->request.data.gid), sid)); - string_to_sid(&group_sid, sid); + if (!string_to_sid(&group_sid, sid)) { + DEBUG(1,("getgrgid_recv: Could not convert sid %s " + "from string\n", sid)); + request_error(state); + return; + } + winbindd_getgrsid(state, group_sid); return; } diff --git a/source3/winbindd/winbindd_user.c b/source3/winbindd/winbindd_user.c index fd1fdd3699..5356e16a74 100644 --- a/source3/winbindd/winbindd_user.c +++ b/source3/winbindd/winbindd_user.c @@ -527,7 +527,13 @@ static void getpwuid_recv(void *private_data, bool success, const char *sid) DEBUG(10,("uid2sid_recv: uid %lu has sid %s\n", (unsigned long)(state->request.data.uid), sid)); - string_to_sid(&user_sid, sid); + if (!string_to_sid(&user_sid, sid)) { + DEBUG(1,("uid2sid_recv: Could not convert sid %s " + "from string\n,", sid)); + request_error(state); + return; + } + winbindd_getpwsid(state, &user_sid); } diff --git a/source3/winbindd/winbindd_util.c b/source3/winbindd/winbindd_util.c index 748099a32e..2d87015fec 100644 --- a/source3/winbindd/winbindd_util.c +++ b/source3/winbindd/winbindd_util.c @@ -682,8 +682,16 @@ static void init_child_recv(void *private_data, bool success) state->response->data.domain_info.name); fstrcpy(state->domain->alt_name, state->response->data.domain_info.alt_name); - string_to_sid(&state->domain->sid, - state->response->data.domain_info.sid); + if (!string_to_sid(&state->domain->sid, + state->response->data.domain_info.sid)) { + DEBUG(1,("init_child_recv: Could not convert sid %s " + "from string\n", + state->response->data.domain_info.sid)); + state->continuation(state->private_data, False); + talloc_destroy(state->mem_ctx); + return; + } + state->domain->native_mode = state->response->data.domain_info.native_mode; state->domain->active_directory = diff --git a/source3/winbindd/winbindd_wins.c b/source3/winbindd/winbindd_wins.c index 4a3d2682b6..f9ba13ffda 100644 --- a/source3/winbindd/winbindd_wins.c +++ b/source3/winbindd/winbindd_wins.c @@ -46,9 +46,15 @@ static int wins_lookup_open_socket_in(void) if (res == -1) return -1; - setsockopt(res,SOL_SOCKET,SO_REUSEADDR,(char *)&val,sizeof(val)); + if (setsockopt(res,SOL_SOCKET,SO_REUSEADDR,(char *)&val,sizeof(val))) { + close(res); + return -1; + } #ifdef SO_REUSEPORT - setsockopt(res,SOL_SOCKET,SO_REUSEPORT,(char *)&val,sizeof(val)); + if (setsockopt(res,SOL_SOCKET,SO_REUSEPORT,(char *)&val,sizeof(val))) { + close(res); + return -1; + } #endif /* SO_REUSEPORT */ /* now we've got a socket - we need to bind it */ |