[collectd] [PATCH] email plugin: Don't unlink the socket file on startup.

Sebastian Harl sh at tokkee.org
Tue Jun 17 19:59:14 CEST 2008


Usually, collectd runs as user root, thus making it an unsafe operation to
unconditionally remove the file even though one should be able to assume
that it "belongs" to collectd.

Signed-off-by: Sebastian Harl <sh at tokkee.org>
---
 src/email.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/src/email.c b/src/email.c
index fbdc785..edd72cb 100644
--- a/src/email.c
+++ b/src/email.c
@@ -396,7 +396,6 @@ static void *open_connection (void *arg)
 	addr.sun_family = AF_UNIX;
 
 	sstrncpy (addr.sun_path, path, (size_t)(UNIX_PATH_MAX - 1));
-	unlink (addr.sun_path);
 
 	errno = 0;
 	if (-1 == bind (connector_socket, (struct sockaddr *)&addr,
-- 
1.5.6.rc2

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20080617/993f57e6/attachment.pgp 


More information about the collectd mailing list