mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
- Don't use /tmp because it's outside ATF's prescribed sandbox
- Replace a hardcoded PATH_MAX value with sizeof(path) - Use path like an array, not a pointer, and always try to unlink it in cleanup MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
parent
c7ded8ba9e
commit
b74bcac4bd
1 changed files with 4 additions and 4 deletions
|
|
@ -452,8 +452,8 @@ run_parent(void)
|
|||
static void
|
||||
cleanup(void)
|
||||
{
|
||||
if (*path != '\0')
|
||||
unlink(path);
|
||||
|
||||
unlink(path);
|
||||
}
|
||||
|
||||
int
|
||||
|
|
@ -461,12 +461,12 @@ main(int argc, char *argv[])
|
|||
{
|
||||
int pagesize;
|
||||
|
||||
*path = '\0';
|
||||
path[0] = '\0';
|
||||
|
||||
pagesize = getpagesize();
|
||||
|
||||
if (argc == 1) {
|
||||
snprintf(path, PATH_MAX, "/tmp/sendfile.XXXXXXXXXXXX");
|
||||
snprintf(path, sizeof(path), "sendfile.XXXXXXXXXXXX");
|
||||
file_fd = mkstemp(path);
|
||||
if (file_fd == -1)
|
||||
FAIL_ERR("mkstemp");
|
||||
|
|
|
|||
Loading…
Reference in a new issue