tests: fix root_test permission issues
The parent directories need execute all permissions.
This commit is contained in:
parent
a97d14c42d
commit
e22c8ea0bd
@ -39,10 +39,14 @@ func TestSupplementaryGroups(t *testing.T) {
|
|||||||
t.Skip("must run as root")
|
t.Skip("must run as root")
|
||||||
}
|
}
|
||||||
cDir := test_helpers.InitFS(t)
|
cDir := test_helpers.InitFS(t)
|
||||||
|
os.Chmod(cDir, 0755)
|
||||||
pDir := cDir + ".mnt"
|
pDir := cDir + ".mnt"
|
||||||
test_helpers.MountOrFatal(t, cDir, pDir, "-allow_other", "-extpass=echo test")
|
test_helpers.MountOrFatal(t, cDir, pDir, "-allow_other", "-extpass=echo test")
|
||||||
defer test_helpers.UnmountPanic(pDir)
|
defer test_helpers.UnmountPanic(pDir)
|
||||||
|
|
||||||
|
// We need an unrestricted umask
|
||||||
|
syscall.Umask(0000)
|
||||||
|
|
||||||
dir1 := pDir + "/dir1"
|
dir1 := pDir + "/dir1"
|
||||||
err := os.Mkdir(dir1, 0770)
|
err := os.Mkdir(dir1, 0770)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -53,7 +57,7 @@ func TestSupplementaryGroups(t *testing.T) {
|
|||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = asUser(1235, 1235, []int{1234}, func() error { return os.Mkdir(dir1+"/foo", 0700) })
|
err = asUser(1235, 1235, []int{1234}, func() error { return os.Mkdir(dir1+"/dir2", 0700) })
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
|
@ -61,12 +61,14 @@ func doInit() {
|
|||||||
MountInfo = make(map[string]mountInfo)
|
MountInfo = make(map[string]mountInfo)
|
||||||
// Something like /tmp/gocryptfs-test-parent-1234
|
// Something like /tmp/gocryptfs-test-parent-1234
|
||||||
testParentDir := fmt.Sprintf("%s/gocryptfs-test-parent-%d", os.TempDir(), os.Getuid())
|
testParentDir := fmt.Sprintf("%s/gocryptfs-test-parent-%d", os.TempDir(), os.Getuid())
|
||||||
os.MkdirAll(testParentDir, 0700)
|
os.MkdirAll(testParentDir, 0755)
|
||||||
var err error
|
var err error
|
||||||
TmpDir, err = ioutil.TempDir(testParentDir, "")
|
TmpDir, err = ioutil.TempDir(testParentDir, "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
// Open permissions for the allow_other tests
|
||||||
|
os.Chmod(TmpDir, 0755)
|
||||||
DefaultPlainDir = TmpDir + "/default-plain"
|
DefaultPlainDir = TmpDir + "/default-plain"
|
||||||
DefaultCipherDir = TmpDir + "/default-cipher"
|
DefaultCipherDir = TmpDir + "/default-cipher"
|
||||||
}
|
}
|
||||||
@ -104,11 +106,11 @@ func ResetTmpDir(createDirIV bool) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
err = os.Mkdir(DefaultPlainDir, 0700)
|
err = os.Mkdir(DefaultPlainDir, 0755)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
err = os.Mkdir(DefaultCipherDir, 0700)
|
err = os.Mkdir(DefaultCipherDir, 0755)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user