[LTP] [RFC] openposix: Use TMPDIR instead of hardcoded /tmp

Cyril Hrubis chrubis@suse.cz
Tue Dec 15 11:18:54 CET 2020


Hi!
> What is your opionion? Does a change like this make sense or would
> you do it differently?

Sounds reasonable.

I guess that we should also bump the buffer sizes a bit since tests
seems to use 256 bytes, which is not that hard to overflow. I would go
for at least 4096.

Or we may as well give up on passing a stack allocated buffer and use
malloc() for the path instead.

As for mkdtemp() if we added that we would have to add a function to
remove the directory at the end, so I wouldn't do that unless we want to
actually write a test library for the openposix tests.

And lastly but not least we do have testcases there that open files in
current directory, these should be ideally converted to create the files
in TMPDIR as well.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list