aboutsummaryrefslogtreecommitdiff
path: root/awwan_local_test.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2026-02-15 13:44:39 +0700
committerShulhan <ms@kilabit.info>2026-02-15 13:45:38 +0700
commit83a162bfa6e6eba78ae439e193682c19b9cd4744 (patch)
tree8588115d422a34aeaefa22e759ef1f19d992784f /awwan_local_test.go
parent19d58e9a4c900aec1d63de45a655657c760b1235 (diff)
downloadawwan-83a162bfa6e6eba78ae439e193682c19b9cd4744.tar.xz
all: fix chmod/chown if destination is directory
Given the following command #put!+0644 src/file dst/ If the dst is a directory, it would cause the directory permission changes to 0644. This changes fix it by checking if the destination is a directory first. If we cannot stat the dst, skip the chmod/chown command.
Diffstat (limited to 'awwan_local_test.go')
-rw-r--r--awwan_local_test.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/awwan_local_test.go b/awwan_local_test.go
index c12f3ec..b663d67 100644
--- a/awwan_local_test.go
+++ b/awwan_local_test.go
@@ -306,6 +306,11 @@ func TestAwwanLocal_Put(t *testing.T) {
t.Fatal(err)
}
+ err = os.Chmod(filepath.Join(baseDir, `tmp`), 0755)
+ if err != nil {
+ t.Fatal(err)
+ }
+
var cases = []testCase{{
desc: `With text file`,
lineRange: `1`,