git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@1198 77e5149b-7576-45b1-b177-96237e5ba77b
Tomasz Kojm authored on 2004/12/19 11:14:40... | ... |
@@ -173,28 +173,18 @@ void sigtool(struct optstruct *opt) |
173 | 173 |
} else if(optl(opt, "vba") || optl(opt, "vba-hex")) { |
174 | 174 |
int fd, hex_output=0; |
175 | 175 |
char *dir; |
176 |
- const char *tmpdir; |
|
177 | 176 |
|
178 | 177 |
|
179 | 178 |
if (optl(opt, "vba-hex")) |
180 | 179 |
hex_output = 1; |
181 | 180 |
|
182 |
- tmpdir = getenv("TMPDIR"); |
|
183 |
- |
|
184 |
- if(tmpdir == NULL) |
|
185 |
-#ifdef P_tmpdir |
|
186 |
- tmpdir = P_tmpdir; |
|
187 |
-#else |
|
188 |
- tmpdir = "/tmp"; |
|
189 |
-#endif |
|
190 |
- |
|
191 | 181 |
/* generate the temporary directory */ |
192 |
- dir = cli_gentemp(tmpdir); |
|
182 |
+ dir = cli_gentemp(NULL); |
|
193 | 183 |
if(mkdir(dir, 0700)) { |
194 | 184 |
mprintf("vba dump: Can't create temporary directory %s\n", dir); |
195 | 185 |
return; |
196 | 186 |
} |
197 |
- |
|
187 |
+ |
|
198 | 188 |
if((fd = open(getargl(opt, "vba"), O_RDONLY)) == -1) { |
199 | 189 |
if((fd = open(getargl(opt, "vba-hex"), O_RDONLY)) == -1) { |
200 | 190 |
mprintf("Can't open file %s\n", getargl(opt, "vba")); |
... | ... |
@@ -207,11 +197,10 @@ void sigtool(struct optstruct *opt) |
207 | 207 |
free(dir); |
208 | 208 |
close(fd); |
209 | 209 |
return; |
210 |
- } |
|
210 |
+ } |
|
211 | 211 |
|
212 | 212 |
close(fd); |
213 | 213 |
sigtool_vba_scandir(dir, hex_output); |
214 |
- |
|
215 | 214 |
cli_rmdirs(dir); |
216 | 215 |
free(dir); |
217 | 216 |
|
... | ... |
@@ -24,12 +24,12 @@ |
24 | 24 |
#include <sys/stat.h> |
25 | 25 |
#include <fcntl.h> |
26 | 26 |
#include <dirent.h> |
27 |
-#include <stdint.h> |
|
28 | 27 |
#include <clamav.h> |
29 | 28 |
#include <ctype.h> |
30 | 29 |
|
31 | 30 |
#include "../libclamav/vba_extract.h" |
32 | 31 |
#include "../libclamav/others.h" |
32 |
+#include "../libclamav/cltypes.h" |
|
33 | 33 |
|
34 | 34 |
typedef struct mac_token_tag |
35 | 35 |
{ |