diff options
author | Filipe Brandenburger <filbranden@google.com> | 2018-04-04 02:17:19 -0700 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-04-04 11:17:19 +0200 |
commit | edb3ca0d611e33033058db1482150e929c55916f (patch) | |
tree | 4122e2c84ebec0c7e61c7fd5185fbaab8f71fd9c /src/test/test-path.c | |
parent | add384dd4d2b96db6ace5ad9c52b1dd7553ebec2 (diff) | |
download | systemd-edb3ca0d611e33033058db1482150e929c55916f.tar.gz |
test-path: Set umask explicitly (#8616)
Running `test-path` under an umask such as 027 fails with:
Assertion '(s.st_mode & S_IRWXO) == 0004' failed at ../src/test/test-path.c:247, function test_path_makedirectory_directorymode(). Aborting.
Looking at directory /tmp/test-path_makedirectory, it was indeed created
with mode 0740, applying the umask to the requested 0744.
Set an explicit umask for this test, to ensure reproducible results.
Diffstat (limited to 'src/test/test-path.c')
-rw-r--r-- | src/test/test-path.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/test/test-path.c b/src/test/test-path.c index 880e54d81c..ec9d2626e2 100644 --- a/src/test/test-path.c +++ b/src/test/test-path.c @@ -20,6 +20,8 @@ #include <stdbool.h> #include <stdio.h> +#include <sys/stat.h> +#include <sys/types.h> #include "alloc-util.h" #include "fd-util.h" @@ -266,6 +268,8 @@ int main(int argc, char *argv[]) { const test_function_t *test = NULL; Manager *m = NULL; + umask(022); + log_parse_environment(); log_open(); |