spck-issues icon indicating copy to clipboard operation
spck-issues copied to clipboard

Commiting on Android change all executable files 755 permissions to 644

Open matrixik opened this issue 3 years ago • 8 comments

When repository is edited and commited in Spck Editor on Android all executable files in repository have executable permissions dropped and silently added to commit.

I created example repository: https://github.com/matrixik/spck-bug

Commit where I added shell file with 755 permissions (done on Linux): https://github.com/matrixik/spck-bug/commit/f4b400233b83deb2f5c0bea85f37416426cf5c75

Commit from Spck on Android where I edited only README file: https://github.com/matrixik/spck-bug/commit/73cbc7d9add9217ad9e055bc2750244e158d00b7 (you can see that file echo.sh got changed permissions: 100755 → 100644). Changes to this file was not visible from Spck app.

I saw it by accident in other repository where GitHub actions using scripts from repository written in Bash started failing.

Build: 5.3.3 Android 11 (Google Pixel 4a)

matrixik avatar Jul 09 '21 12:07 matrixik

To find out if this is a git spck or android (iOS) related issue, please check the permissions of your file (in your filesystem via a third party app) after a pull request

Proxtx avatar Jul 09 '21 20:07 Proxtx

I'm on short vacations now, will check it on Wednesday.

matrixik avatar Jul 10 '21 19:07 matrixik

Commit https://github.com/matrixik/spck-bug/commit/f4b400233b83deb2f5c0bea85f37416426cf5c75 files permissions on Linux:

λ ll
total 16K
drwxrwxr-x 9 zybortd zybortd 4,0K 2021-07-14 20:09:52 .git/
-rw-rw-r-- 1 zybortd zybortd 1,1K 2021-07-09 13:52:21 LICENSE
-rw-rw-r-- 1 zybortd zybortd  280 2021-07-09 13:59:17 README.md
-rwxrwxr-x 1 zybortd zybortd   24 2021-07-09 13:56:32 echo.sh*

Commit https://github.com/matrixik/spck-bug/commit/73cbc7d9add9217ad9e055bc2750244e158d00b7 (created with Spck on Android) files permissions on Linux:

λ ll
total 16K
drwxrwxr-x 9 zybortd zybortd 4,0K 2021-07-14 20:10:07 .git/
-rw-rw-r-- 1 zybortd zybortd 1,1K 2021-07-09 13:52:21 LICENSE
-rw-rw-r-- 1 zybortd zybortd  300 2021-07-14 20:10:07 README.md
-rw-rw-r-- 1 zybortd zybortd   24 2021-07-14 20:10:07 echo.sh

So echo.sh still have same group and user but permissions changed from -rwxrwxr-x to -rw-rw-r--.

matrixik avatar Jul 14 '21 18:07 matrixik

On Android (with Termux): Before:

$ ls -all
total 23
drwx------ 3 u0_a267 u0_a267 3488 Jul 14 20:26 .
drwx------ 4 u0_a267 u0_a267 3488 Jul 14 20:25 ..
drwx------ 7 u0_a267 u0_a267 3488 Jul 14 20:26 .git
-rw------- 1 u0_a267 u0_a267 1075 Jul 14 20:25 LICENSE
-rw------- 1 u0_a267 u0_a267  280 Jul 14 20:26 README.md
-rwx------ 1 u0_a267 u0_a267   24 Jul 14 20:26 echo.sh

After:

$ ls -all
total 23
drwx------ 3 u0_a267 u0_a267 3488 Jul 14 20:25 .
drwx------ 4 u0_a267 u0_a267 3488 Jul 14 20:25 ..
drwx------ 7 u0_a267 u0_a267 3488 Jul 14 20:25 .git
-rw------- 1 u0_a267 u0_a267 1075 Jul 14 20:25 LICENSE
-rw------- 1 u0_a267 u0_a267  300 Jul 14 20:25 README.md
-rw------- 1 u0_a267 u0_a267   24 Jul 14 20:25 echo.sh

matrixik avatar Jul 14 '21 18:07 matrixik

So after a pull the permissions stay and after you push they are gone? This means that the problem is ether the git module (third party) or the parsing from the local filesystem to the git module (this would be spck related). Anyways I don't think a fix will happen soon because the dev has been inactive for almost half a year now.

Proxtx avatar Jul 14 '21 18:07 Proxtx

I tried to check a little more. I created test2 branch from commit having proper permissions (on Linux and push). Then check out this branch with spck on Android. Next, without doing any changes, export files as zip to Download folder. Then unpack it with Files by Google. And then list folder with Termux:

~/.../downloads/spck-bug1 $ ls -all
total 12
-rw-rw---- 1 root everybody 1075 Jul 20 19:12 LICENSE
-rw-rw---- 1 root everybody  280 Jul 20 19:12 README.md
-rw-rw---- 1 root everybody   24 Jul 20 19:12 echo.sh

Using unzip in Termux gave same results. Copying (with Files by Google) echo.sh from /Android/data/io.spck/files/spck-bug and checking permissions in Termux also is giving same results.

So for me it's looks like permissions are changed at the moment of selecting branch and not at the moment of creating commit.

matrixik avatar Jul 20 '21 17:07 matrixik

Spck uses a third party zipping i wouldn't be surprised it it changed the permissions. Repeat everything you did but without the exporting the project but checking the files directly from this folder: /storage/emulated/0/Android/data/io.spck/files.

Proxtx avatar Jul 20 '21 17:07 Proxtx

Unfortunately I don't have rooted phone so I'm getting Permission denied errors but copying file outside of this folder (last test I did in my previous message, not zipping) with Files by Google is giving me same result, so I believe this is not a problem of zipping.

matrixik avatar Jul 20 '21 18:07 matrixik