'chcon'에 해당되는 글 1건

  1. 2021.01.05 chcon 예제 (change context)
android2021. 1. 5. 16:05

adb push 후, 파일의 selinux label이 틀어지는 경우가 종종 있다.

아마 vendor 쪽에 파일을 push하면 system_file label이 자동으로 붙기 때문인 것으로 생각된다.

 

어쨌든, 그럴 경우 chcon 이용하여 아래와 같이 label 수정하면 된다.

 

#chcon u:object_r:vendor_file:s0 hello

 

:/vendor/lib/modules # ls -lZ


-rw-r--r-- 1 root root u:object_r:system_file:s0  2565848 2021-01-05 06:48 hello
total 16084
-rw-r--r-- 1 root root u:object_r:system_file:s0  2565848 2021-01-05 06:48 hello
-rw-r--r-- 1 root root u:object_r:vendor_file:s0   103408 2009-01-01 00:00 foo

:/vendor/lib/modules # chcon u:object_r:vendor_file:s0 hello
:/vendor/lib/modules # ls -lZ
total 16084
-rw-r--r-- 1 root root u:object_r:vendor_file:s0  2565848 2021-01-05 06:48 hello
-rw-r--r-- 1 root root u:object_r:vendor_file:s0   103408 2009-01-01 00:00 foo

 

 

 

 

 

'android' 카테고리의 다른 글

RecyclerView  (0) 2022.03.07
Fragment간 데이터 주고 받기  (0) 2022.03.07
Android X란?  (0) 2020.07.23
native service를 aidl로 binding  (0) 2020.07.17
ForegroundService test  (0) 2020.07.08
Posted by easy16