selftest: create ncalrpcdir with 0755 permissions
authorStefan Metzmacher <metze@samba.org>
Sun, 22 May 2011 17:40:19 +0000 (19:40 +0200)
committerStefan Metzmacher <metze@samba.org>
Mon, 23 May 2011 11:26:33 +0000 (13:26 +0200)
We need to reset the umask in order to set to the desired permissions.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Mon May 23 13:26:33 CEST 2011 on sn-devel-104

selftest/selftest.pl

index 6f8cbe1fe8e9a2dc3e9516616aff68d20b4eb78f..23434fc86ce3b9c0de8248ce136d032beed63b69 100755 (executable)
@@ -597,11 +597,20 @@ sub write_clientconf($$$)
                mkdir("$clientdir/lockdir", 0777);
        }
 
+       # this is ugly, but the ncalrpcdir needs exactly 0755
+       # otherwise tests fail.
+       my $mask = umask;
+       umask 0022;
+       if ( -d "$clientdir/ncalrpcdir/np" ) {
+               unlink <$clientdir/ncalrpcdir/np/*>;
+               rmdir <$clientdir/ncalrpcdir/np>;
+       }
        if ( -d "$clientdir/ncalrpcdir" ) {
                unlink <$clientdir/ncalrpcdir/*>;
-       } else {
-               mkdir("$clientdir/ncalrpcdir", 0777);
+               rmdir <$clientdir/ncalrpcdir>;
        }
+       mkdir("$clientdir/ncalrpcdir", 0755);
+       umask $mask;
 
        open(CF, ">$conffile");
        print CF "[global]\n";