[3.0] 81c7a6e Unlink -s file with autogenerated names

Tollef Fog Heen tfheen at varnish-cache.org
Thu Sep 22 14:01:54 CEST 2011


commit 81c7a6e729e8f2d833699c3f79384f5d201a30e4
Author: Tollef Fog Heen <tfheen at varnish-software.com>
Date:   Tue Sep 6 13:49:59 2011 +0200

    Unlink -s file with autogenerated names
    
    If just -s file or -s file,/path/to/directory is given, the file
    stevedore will generate a name.  Make sure to unlink this to not leak
    disk space over time.
    
    Fixes: #1008

diff --git a/bin/varnishd/stevedore_utils.c b/bin/varnishd/stevedore_utils.c
index a38588d..bd4e368 100644
--- a/bin/varnishd/stevedore_utils.c
+++ b/bin/varnishd/stevedore_utils.c
@@ -108,6 +108,7 @@ STV_GetFile(const char *fn, int *fdp, const char **fnp, const char *ctx)
 		if (fd < 0)
 			ARGV_ERR("(%s) \"%s\" mkstemp(%s) failed (%s)\n",
 			    ctx, fn, buf, strerror(errno));
+		AZ(unlink(buf));
 		*fnp = strdup(buf);
 		AN(*fnp);
 		retval = 2;



More information about the varnish-commit mailing list