Skip to content

Commit 6da748a

Browse files
committed
Merge branch 'rs/fix-unlink-unix-socket'
The unix-domain socket used by the sample credential cache daemon tried to unlink an existing stale one at a wrong path, if the path to the socket was given as an overlong path that does not fit in sun_path member of the sockaddr_un structure. * rs/fix-unlink-unix-socket: unix-socket: remove stale socket before calling chdir()
2 parents 955d7be + 2869b3e commit 6da748a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

unix-socket.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,12 @@ int unix_stream_listen(const char *path)
9999
struct sockaddr_un sa;
100100
struct unix_sockaddr_context ctx;
101101

102+
unlink(path);
103+
102104
if (unix_sockaddr_init(&sa, path, &ctx) < 0)
103105
return -1;
104106
fd = unix_stream_socket();
105107

106-
unlink(path);
107108
if (bind(fd, (struct sockaddr *)&sa, sizeof(sa)) < 0)
108109
goto fail;
109110

0 commit comments

Comments
 (0)