]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: unix: do not unlink() abstract namespace sockets upon failure.
authorJan Seda <hodor@hodor.cz>
Thu, 26 Jun 2014 18:44:05 +0000 (20:44 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 2 Jul 2014 15:57:28 +0000 (17:57 +0200)
commit7319b64fc4c9b7e04726816c6cc02f6ecf66a0a4
tree87058fbde6c3508ecb6c045f5912244d1bf42a35
parent8c27bcaea0116247ee055c5481a63507de4fe6e4
BUG/MEDIUM: unix: do not unlink() abstract namespace sockets upon failure.

When bind() fails (function uxst_bind_listener()), the fail path doesn't
consider the abstract namespace and tries to unlink paths held in
uninitiliazed memory (tempname and backname). See the strace excerpt;
the strings still hold the path from test1.

===============================================================================================
23722 bind(5, {sa_family=AF_FILE, path=@"test2"}, 110) = -1 EADDRINUSE (Address already in use)
23722 unlink("/tmp/test1.sock.23722.tmp") = -1 ENOENT (No such file or directory)
23722 close(5)                          = 0
23722 unlink("/tmp/test1.sock.23722.bak") = -1 ENOENT (No such file or directory)
===============================================================================================

This patch should be backported to 1.5.
src/proto_uxst.c