1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

rpc_server: Fix CID 1362565 Improper use of negative value

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
This commit is contained in:
Volker Lendecke 2016-06-07 10:01:32 +02:00
parent 6279773fed
commit f5e95af59b

View File

@ -2077,8 +2077,16 @@ static void dcesrv_sock_accept(struct stream_connection *srv_conn)
if (transport == NCALRPC) {
uid_t uid;
gid_t gid;
int sock_fd;
ret = getpeereid(socket_get_fd(srv_conn->socket), &uid, &gid);
sock_fd = socket_get_fd(srv_conn->socket);
if (sock_fd == -1) {
stream_terminate_connection(
srv_conn, "socket_get_fd failed\n");
return;
}
ret = getpeereid(sock_fd, &uid, &gid);
if (ret == -1) {
status = map_nt_error_from_unix_common(errno);
DEBUG(0, ("dcesrv_sock_accept: "