OSDN Git Service
(root)
/
android-x86
/
external-toybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
46ddb55
)
Don't let mktemp -q /path/to/file delete arbitrary files, and don't have
author
Rob Landley
<rob@landley.net>
Thu, 31 Dec 2015 02:54:19 +0000
(20:54 -0600)
committer
Rob Landley
<rob@landley.net>
Thu, 31 Dec 2015 02:54:19 +0000
(20:54 -0600)
"mktemp -u > /dev/full" leave file around.
toys/lsb/mktemp.c
patch
|
blob
|
history
diff --git
a/toys/lsb/mktemp.c
b/toys/lsb/mktemp.c
index
f1f9d88
..
118dacc
100644
(file)
--- a/
toys/lsb/mktemp.c
+++ b/
toys/lsb/mktemp.c
@@
-48,8
+48,10
@@
void mktemp_main(void)
if (toys.optflags & FLAG_q) toys.exitval = 1;
else perror_exit("Failed to create %s %s/%s",
d_flag ? "directory" : "file", TT.tmpdir, template);
- } else xputs(template);
- if (toys.optflags & FLAG_u) unlink(template);
+ } else {
+ if (toys.optflags & FLAG_u) unlink(template);
+ xputs(template);
+ }
if (CFG_TOYBOX_FREE) free(template);
}