Sample Header Ad - 728x90

Terminal - restorecon -R isn' running recursively

0 votes
0 answers
130 views
Device info: I'm running Phh-Treble GSI Android 13 on a Lenovo TB-9707F device. Rooted Tablet. I'm trying to run restorecon -R on a folder to recursively restore SElinux context for the whole tree. If seems that the -R option doesn't work since the results are that it's only restoring the context fof the folder. How can I get it to recursively restore fod the entire tree. In the following code you can see that when I run restorecon -Rnv on the folder it shows it will only change the folder. Adding the * shows it will change all in files inside tha initial folder. But, again nothing further down the tree.
root:.../ext4-fs/Other# restorecon -Rvn _backup
SELinux: Loaded file_contexts
SELinux:  Relabeling /data/data/com.termux/files/home/ext4-fs/Other/_backup from u:object_r:unlabeled:s0:c232,c256,c512,c768 to u:object_r:app_data_file:s0:c156,c257,c512,c768.
root:.../ext4-fs/Other# restorecon -Rvn _backup/
SELinux: Loaded file_contexts
SELinux:  Relabeling /data/data/com.termux/files/home/ext4-fs/Other/_backup from u:object_r:unlabeled:s0:c232,c256,c512,c768 to u:object_r:app_data_file:s0:c156,c257,c512,c768.
root:.../ext4-fs/Other# restorecon -Rvn _backup/*
SELinux: Loaded file_contexts
SELinux:  Relabeling /data/data/com.termux/files/home/ext4-fs/Other/_backup/Package.list from u:object_r:unlabeled:s0:c232,c256,c512,c768 to u:object_r:app_data_file:s0:c156,c257,c512,c768.
SELinux:  Relabeling /data/data/com.termux/files/home/ext4-fs/Other/_backup/Package.list.txt from u:object_r:unlabeled:s0:c232,c256,c512,c768 to u:object_r:app_data_file:s0:c156,c257,c512,c768.
SELinux:  Relabeling /data/data/com.termux/files/home/ext4-fs/Other/_backup/Repo.keys from u:object_r:unlabeled:s0:c232,c256,c512,c768 to u:object_r:app_data_file:s0:c156,c257,c512,c768.
SELinux:  Relabeling /data/data/com.termux/files/home/ext4-fs/Other/_backup/desktop-files from u:object_r:unlabeled:s0:c232,c256,c512,c768 to u:object_r:app_data_file:s0:c156,c257,c512,c768.
SELinux:  Relabeling /data/data/com.termux/files/home/ext4-fs/Other/_backup/sources.list from u:object_r:unlabeled:s0:c232,c256,c512,c768 to u:object_r:app_data_file:s0:c156,c257,c512,c768.
SELinux:  Relabeling /data/data/com.termux/files/home/ext4-fs/Other/_backup/sources.list.d from u:object_r:unlabeled:s0:c232,c256,c512,c768 to u:object_r:app_data_file:s0:c156,c257,c512,c768.
SELinux:  Relabeling /data/data/com.termux/files/home/ext4-fs/Other/_backup/sources.list.save from u:object_r:unlabeled:s0:c232,c256,c512,c768 to u:object_r:app_data_file:s0:c156,c257,c512,c768.
root:.../ext4-fs/Other#
Asked by Sruly (1028 rep)
Dec 15, 2023, 11:27 AM