projects
/
debian
/
as31
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
fde89d9
)
of course, it'd be helpful to actually apply the patch in my tree...
debian/2.3.1-5
author
Bdale Garbee
<bdale@gag.com>
Wed, 11 Jan 2012 18:23:32 +0000
(11:23 -0700)
committer
Bdale Garbee
<bdale@gag.com>
Wed, 11 Jan 2012 18:23:32 +0000
(11:23 -0700)
as31/run.c
patch
|
blob
|
history
diff --git
a/as31/run.c
b/as31/run.c
index 126d3b5a014e6ca31406aad3480079a7f4f20305..28c5317f9a56e49acb4912f00dddff1f1e598aa1 100644
(file)
--- a/
as31/run.c
+++ b/
as31/run.c
@@
-39,8
+39,8
@@
int run_as31(const char *infile, int lst, int use_stdout,
char *incLineBuffer=NULL;
int incSizeBuf=0;
FILE* includeFile=NULL;
char *incLineBuffer=NULL;
int incSizeBuf=0;
FILE* includeFile=NULL;
+ int fd;
- uid_t uid;
/* first, figure out all the file names */
dashl = lst;
/* first, figure out all the file names */
dashl = lst;
@@
-95,11
+95,18
@@
int run_as31(const char *infile, int lst, int use_stdout,
}
}
}
}
- uid = geteuid();
- sprintf(tmpName,"/tmp/as31-%i-%ld.asm",uid,random());
- fin = fopen(tmpName, "w");
+ sprintf(tmpName,"/tmp/as31-XXXXXX.asm");
+ fd = mkstemps(tmpName, 4);
+ if (fd == -1) {
+ mesg_f("Cannot create temp file\n");
+ if (outfile) free(outfile);
+ if (lstfile) free(lstfile);
+ return -1;
+ }
+ fin = fdopen(fd, "w");
if (fin == NULL) {
mesg_f("Cannot open temp file: %s\n",tmpName);
if (fin == NULL) {
mesg_f("Cannot open temp file: %s\n",tmpName);
+ close(fd);
if (outfile) free(outfile);
if (lstfile) free(lstfile);
return -1;
if (outfile) free(outfile);
if (lstfile) free(lstfile);
return -1;