diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-10-25 20:35:17 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-10-25 20:36:01 +0200 |
commit | ec863ba65a41e58680a3ab15841243088284e808 (patch) | |
tree | b92316794d11a99154bcd1eea32741b1f8b87fc7 /src/reply-password.c | |
parent | f015eca2a2f4186208930cf23196967ed425e2c9 (diff) |
ask-password: add basic tty agent
Diffstat (limited to 'src/reply-password.c')
-rw-r--r-- | src/reply-password.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/reply-password.c b/src/reply-password.c index 24d73a798e..575a437645 100644 --- a/src/reply-password.c +++ b/src/reply-password.c @@ -49,9 +49,9 @@ static int send_on_socket(int fd, const char *socket_name, const void *packet, s zero(sa); sa.un.sun_family = AF_UNIX; - strncpy(sa.un.sun_path+1, socket_name, sizeof(sa.un.sun_path)-1); + strncpy(sa.un.sun_path, socket_name, sizeof(sa.un.sun_path)); - if (sendto(fd, packet, size, MSG_NOSIGNAL, &sa.sa, offsetof(struct sockaddr_un, sun_path) + 1 + strlen(socket_name)) < 0) { + if (sendto(fd, packet, size, MSG_NOSIGNAL, &sa.sa, offsetof(struct sockaddr_un, sun_path) + strlen(socket_name)) < 0) { log_error("Failed to send: %m"); return -1; } |