summaryrefslogtreecommitdiff
path: root/internal/syscallcompat/sys_common_test.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2019-01-14 21:54:16 +0100
committerJakob Unterwurzacher2019-01-14 21:54:16 +0100
commita7d59032d3790e117a48be6be1fb3a968266093b (patch)
tree5c0b642f701106e1f27db5fea69c45bdc5e3dac0 /internal/syscallcompat/sys_common_test.go
parenta9d8eb49ef91c31fddc3e4f2f76e9b98e1a52a1d (diff)
syscallcompat: rework Fchmodat to FchmodatNofollow
We never want Fchmodat to follow symlinks, so follow what Qemu does, and call our function FchmodatNofollow.
Diffstat (limited to 'internal/syscallcompat/sys_common_test.go')
-rw-r--r--internal/syscallcompat/sys_common_test.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/syscallcompat/sys_common_test.go b/internal/syscallcompat/sys_common_test.go
index 14e1b3f..3729111 100644
--- a/internal/syscallcompat/sys_common_test.go
+++ b/internal/syscallcompat/sys_common_test.go
@@ -175,7 +175,7 @@ func TestFchmodat(t *testing.T) {
defer syscall.Close(dirfd)
// Check that chmod on a regular file works ok
- err = Fchmodat(dirfd, regular, 0111, 0)
+ err = FchmodatNofollow(dirfd, regular, 0111, 0)
if err != nil {
t.Fatal(err)
}
@@ -185,7 +185,7 @@ func TestFchmodat(t *testing.T) {
if st.Mode != 0111 {
t.Errorf("wrong mode: %#0o", st.Mode)
}
- err = Fchmodat(dirfd, regular, 0000, 0)
+ err = FchmodatNofollow(dirfd, regular, 0000, 0)
if err != nil {
t.Error(err)
}
@@ -196,7 +196,7 @@ func TestFchmodat(t *testing.T) {
}
// Check what happens on a symlink
- err = Fchmodat(dirfd, symlink, 0333, 0)
+ err = FchmodatNofollow(dirfd, symlink, 0333, 0)
if err == nil {
syscall.Lstat(tmpDir+"/"+symlink, &st)
st.Mode &= 0777