From 83a162bfa6e6eba78ae439e193682c19b9cd4744 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Sun, 15 Feb 2026 13:44:39 +0700 Subject: 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. --- testdata/local/put.aww | 2 ++ 1 file changed, 2 insertions(+) (limited to 'testdata') diff --git a/testdata/local/put.aww b/testdata/local/put.aww index 82297e5..78bc950 100644 --- a/testdata/local/put.aww +++ b/testdata/local/put.aww @@ -16,3 +16,5 @@ sudo chmod 0644 /etc/plain.txt #put!awwan:bin+0644 {{.ScriptDir}}/plain.txt /etc/sudoput_with_owner.txt #put:$noparse {{.ScriptDir}}/plain.txt {{.ScriptDir}}/tmp/plain_noparse.txt + +#put!+0644 {{.ScriptDir}}/plain.txt {{.ScriptDir}}/tmp/ -- cgit v1.3