summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--daemon/httpauthd.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/daemon/httpauthd.c b/daemon/httpauthd.c
index ad2f365..b471094 100644
--- a/daemon/httpauthd.c
+++ b/daemon/httpauthd.c
@@ -246,7 +246,6 @@ int main(int argc, char* argv[])
if(!threads)
errx(1, "out of memory");
- /* TODO: Import the new sock_any from clamsmtp */
/* Get the socket type */
if(sock_any_pton(g_socket, &sany, DEFAULT_PORT) == -1)
errx(1, "invalid socket name or ip: %s", g_socket);
@@ -260,8 +259,8 @@ int main(int argc, char* argv[])
setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *)&i, sizeof(i));
/* Unlink the socket file if it exists */
- /* TODO: Is this safe? */
- unlink(g_socket);
+ if(SANY_TYPE(sany) == AF_UNIX)
+ unlink(g_socket);
if(bind(sock, &SANY_ADDR(sany), SANY_LEN(sany)) != 0)
err(1, "couldn't bind to address: %s", g_socket);