version 1.19.2.3, 2001/03/12 15:44:08 |
version 1.19.2.4, 2001/03/21 18:52:35 |
|
|
|
|
sunaddr.sun_family = AF_UNIX; |
sunaddr.sun_family = AF_UNIX; |
strlcpy(sunaddr.sun_path, authsocket, sizeof(sunaddr.sun_path)); |
strlcpy(sunaddr.sun_path, authsocket, sizeof(sunaddr.sun_path)); |
sunaddr.sun_len = len = SUN_LEN(&sunaddr)+1; |
len = SUN_LEN(&sunaddr)+1; |
|
sunaddr.sun_len = len; |
|
|
sock = socket(AF_UNIX, SOCK_STREAM, 0); |
sock = socket(AF_UNIX, SOCK_STREAM, 0); |
if (sock < 0) |
if (sock < 0) |
|
|
len = 4; |
len = 4; |
while (len > 0) { |
while (len > 0) { |
l = read(auth->fd, buf + 4 - len, len); |
l = read(auth->fd, buf + 4 - len, len); |
|
if (l == -1 && (errno == EAGAIN || errno == EINTR)) |
|
continue; |
if (l <= 0) { |
if (l <= 0) { |
error("Error reading response length from authentication socket."); |
error("Error reading response length from authentication socket."); |
return 0; |
return 0; |
|
|
if (l > sizeof(buf)) |
if (l > sizeof(buf)) |
l = sizeof(buf); |
l = sizeof(buf); |
l = read(auth->fd, buf, l); |
l = read(auth->fd, buf, l); |
|
if (l == -1 && (errno == EAGAIN || errno == EINTR)) |
|
continue; |
if (l <= 0) { |
if (l <= 0) { |
error("Error reading response from authentication socket."); |
error("Error reading response from authentication socket."); |
return 0; |
return 0; |
|
|
/* Get the number of entries in the response and check it for sanity. */ |
/* Get the number of entries in the response and check it for sanity. */ |
auth->howmany = buffer_get_int(&auth->identities); |
auth->howmany = buffer_get_int(&auth->identities); |
if (auth->howmany > 1024) |
if (auth->howmany > 1024) |
fatal("Too many identities in authentication reply: %d\n", |
fatal("Too many identities in authentication reply: %d", |
auth->howmany); |
auth->howmany); |
|
|
return auth->howmany; |
return auth->howmany; |