Index: clamav/libclamav/readdb.c
===================================================================
--- clamav.orig/libclamav/readdb.c	2008-04-02 22:17:28.000000000 +0200
+++ clamav/libclamav/readdb.c	2008-04-16 11:08:12.000000000 +0200
@@ -1433,7 +1433,7 @@
 {
 	struct stat sb;
 	int ret;
-
+	char *tmpdirsave;
 
     if(stat(path, &sb) == -1) {
         cli_errmsg("cl_loaddbdir(): Can't get status of %s\n", path);
@@ -1448,12 +1448,24 @@
     (*engine)->dboptions = options;
 
     switch(sb.st_mode & S_IFMT) {
-	case S_IFREG: 
+	case S_IFREG:
+		tmpdirsave = cli_strdup(getenv("TMPDIR"));
+		setenv("TMPDIR", "/tmp", 1);
 	    ret = cli_load(path, engine, signo, options, NULL, 0);
+		if (tmpdirsave) {
+			setenv("TMPDIR", tmpdirsave, 1);
+			free(tmpdirsave);
+		}
 	    break;
 
 	case S_IFDIR:
+		tmpdirsave = cli_strdup(getenv("TMPDIR"));
+		setenv("TMPDIR", "/tmp", 1);
 	    ret = cli_loaddbdir(path, engine, signo, options);
+		if (tmpdirsave) {
+			setenv("TMPDIR", tmpdirsave, 1);
+			free(tmpdirsave);
+		}
 	    break;
 
 	default:

