selftest: make sure we don't have any umask limitations for selftest
authorStefan Metzmacher <metze@samba.org>
Fri, 7 Apr 2017 08:39:31 +0000 (10:39 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Sun, 9 Apr 2017 23:11:19 +0000 (01:11 +0200)
We create $prefix with 0700 (umask 0077), but everything else
should not have a umask limitation (by default).

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12709

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
selftest/selftest.pl

index 45e0ae0451f1851530602c4abbeb906add5085fb..32fc845bde55bb37d3e613fa7f9586130e53ec5a 100755 (executable)
@@ -307,8 +307,11 @@ die("using an empty prefix isn't allowed") unless $prefix ne "";
 # permissions on this as some subdirectories in this tree will have
 # wider permissions (ie 0777) and this would allow other users on the
 # host to subvert the test process.
+umask 0077;
 mkdir($prefix, 0700) unless -d $prefix;
 chmod 0700, $prefix;
+# We need to have no umask limitations for the tests.
+umask 0000;
 
 my $prefix_abs = abs_path($prefix);
 my $tmpdir_abs = abs_path("$prefix/tmp");