Browse code

setenv -> putenv

git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@224 77e5149b-7576-45b1-b177-96237e5ba77b

Tomasz Kojm authored on 2004/02/02 01:53:12
Showing 3 changed files
... ...
@@ -23,6 +23,11 @@ Submission management interface (for database developers only): Diego D'Ambra
23 23
 Database developers:
24 24
 
25 25
 aCaB <acab*clamav.net>
26
+
27
+Christoph Cordes <cc*clamav.net>
28
+gpg key   :
29
+GPG fingerprint = 4C6F F6A5 6034 04B1 1006  A7E1 1F1B 78CE C6DA 0F00
30
+
26 31
 Diego D'Ambra <diego*clamav.net>
27 32
 Jason Englander <jason*clamav.net>
28 33
 Tomasz Kojm <tkojm*clamav.net>
... ...
@@ -32,7 +37,7 @@ gpg key   : http://www.clamav.net/gpg/ddm.gpg
32 32
 GPG fingerprint = E697 81BD A912 3F5A 737E  C254 B3B1 F81A 0278 7880
33 33
 
34 34
 Tomasz Papszun <tomek*clamav.net>
35
-gpg key	  : http://www.lodz.tpsa.pl/~tomek/pgp.txt
35
+gpg key	  : http://www.clamav.net/gpg/tomek.gpg
36 36
 GPG fingerprint = F115 0CA4 775D 9898 6F32  0F98 C0C2 2079 C1CA 59EE
37 37
 
38 38
 
... ...
@@ -1,3 +1,8 @@
1
+Sun Feb  1 17:50:30 CET 2004 (tk)
2
+---------------------------------
3
+  * clamd: use putenv() instead of setenv() while setting TemporaryDirectory
4
+	   (due to a compilation error on Solaris reported by Nigel)
5
+
1 6
 Sun Feb  1 02:12:50 CET 2004 (tk)
2 7
 ---------------------------------
3 8
   * libclamav: + use strcasecmp() instead of strcmp() when comparing
... ...
@@ -51,6 +51,7 @@ void clamd(struct optstruct *opt)
51 51
 	struct cl_node *root = NULL;
52 52
 	const char *dbdir, *cfgfile;
53 53
 	int ret, virnum = 0, tcpsock;
54
+	char *var;
54 55
 
55 56
     /* initialize some important variables */
56 57
 
... ...
@@ -175,10 +176,13 @@ void clamd(struct optstruct *opt)
175 175
 
176 176
     /* set the temporary dir */
177 177
     if((cpt = cfgopt(copt, "TemporaryDirectory"))) {
178
-	if(!setenv("TMPDIR", cpt->strarg, 1))
178
+	var = (char *) mcalloc(8 + strlen(cpt->strarg), sizeof(char));
179
+	sprintf(var, "TMPDIR=%s", cpt->strarg);
180
+	if(!putenv(var))
179 181
 	    logg("Setting %s as global temporary directory\n", cpt->strarg);
180 182
 	else
181 183
 	    logg("!Can't set TMPDIR variable - insufficient space in the environment.\n");
184
+	free(var);
182 185
     }
183 186
 
184 187
     /* load the database(s) */