summaryrefslogtreecommitdiff
path: root/daemon/httpauthd.c
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2004-08-18 17:05:12 +0000
committerStef Walter <stef@memberwebs.com>2004-08-18 17:05:12 +0000
commit12af3bad4cf302ffad84b192c388de63a2b1c12e (patch)
tree9d894ddecc99d588ec73e55b0fdf044a178fe9ad /daemon/httpauthd.c
parentd9efad53d0ea51262bd8dc418c9c916a2c338026 (diff)
Only unlink socket when a UNIX type
Diffstat (limited to 'daemon/httpauthd.c')
-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);