From: Filipe Brandenburger Date: Wed, 4 Apr 2018 09:17:19 +0000 (-0700) Subject: test-path: Set umask explicitly (#8616) X-Git-Tag: v239~439 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=edb3ca0d611e33033058db1482150e929c55916f;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/test/test-path.c b/src/test/test-path.c index 880e54d81c2..ec9d2626e2c 100644 --- a/src/test/test-path.c +++ b/src/test/test-path.c @@ -20,6 +20,8 @@ #include #include +#include +#include #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();