Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permission denied for files copied or created in home folder using MiXplorer #7002

Closed
Mark-Joy opened this issue Jun 14, 2021 · 3 comments
Closed

Comments

@Mark-Joy
Copy link

Problem description
In MiXplorer (with root access), create or copy any file to home folder. Permission 777 is granted automatically by MiX. Owner is UID of termux app.
Example:
-rwxrwxrwx 1 u0_a485 u0_a485 62 Jun 14 06:14 hello2

Open termux (home folder)

~ $ whoami
u0_a485
~ $ cat ./hello2
cat: ./hello2: Permission denied
~ $ ./hello2
bash: ./hello2: Permission denied
~ $ tsu u0_a485
:/data/data/com.termux/files/home $ cat hello2
#!/data/data/com.termux/files/usr/bin/bash
echo Hello World!!

Steps to reproduce
As above steps. In below clip, I also compare files hello2 with hello. File hello is created by nano in termux

Screenrecorder.mp4

Expected behavior
Files should be accessed or executed without tsu

@agnostic-apollo
Copy link
Member

Likely issue is wrong selinux context of file.

Check with /system/bin/ls -lZ hello2 under root (tsu) shell. Termux ls will just show ? instead of context since its not supported. Restore context with /system/bin/restorecon -v hello2.

@Mark-Joy
Copy link
Author

It works. Thank you.
So is it MiXplorer causing the issue?
How to fix it without calling restorecon on every files?

.../files/home # /system/bin/ls -lZ hello2
-rwxrwxrwx 1 u0_a485 u0_a485 u:object_r:app_data_file:s0:c247,c257,c512,c768 62 2021-06-14 06:14 hello2
.../files/home # /system/bin/ls -lZ hello
-rwx------ 1 u0_a485 u0_a485 u:object_r:app_data_file:s0:c229,c257,c512,c768 62 2021-06-14 06:14 hello

.../files/home # /system/bin/restorecon -v hello2       SELinux: Loaded file_contexts
SELinux:  Relabeling /data/data/com.termux/files/home/hello2 from u:object_r:app_data_file:s0:c247,c257,c512,c768 to u:object_r:app_data_file:s0:c229,c257,c512,c768.
.../files/home # exit
exit
~ $ ./hello2
Hello World!!
~ $

@agnostic-apollo
Copy link
Member

agnostic-apollo commented Jun 14, 2021

Welcome. Report the issue to MiXplorer dev, maybe he can add support/option for running restorecon automatically on file creation/pasting or inheriting it from parent directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants