mirror of
https://github.com/boostorg/filesystem.git
synced 2025-05-12 05:31:49 +00:00
Use access() to check if the root directory is writable.
This is more reliable than testing if the user is root as in some chroot environments root directory may be writable by a non-root user.
This commit is contained in:
parent
141727b568
commit
d204b41dba
@ -1232,7 +1232,7 @@ void create_directories_tests()
|
||||
BOOST_TEST(!ec);
|
||||
|
||||
#ifdef BOOST_POSIX_API
|
||||
if (geteuid() > 0)
|
||||
if (access("/", W_OK) != 0)
|
||||
{
|
||||
ec.clear();
|
||||
BOOST_TEST(!fs::create_directories("/foo", ec)); // may be OK on Windows
|
||||
|
Loading…
x
Reference in New Issue
Block a user