.. | .. |
---|
548 | 548 | } |
---|
549 | 549 | |
---|
550 | 550 | static void DropCapabilitiesBoundingSet(fail_fn_t fail_fn) { |
---|
| 551 | +/* |
---|
551 | 552 | for (int i = 0; prctl(PR_CAPBSET_READ, i, 0, 0, 0) >= 0; i++) {; |
---|
552 | 553 | if (prctl(PR_CAPBSET_DROP, i, 0, 0, 0) == -1) { |
---|
553 | 554 | if (errno == EINVAL) { |
---|
.. | .. |
---|
558 | 559 | } |
---|
559 | 560 | } |
---|
560 | 561 | } |
---|
| 562 | +*/ |
---|
561 | 563 | } |
---|
562 | 564 | |
---|
563 | 565 | static void SetInheritable(uint64_t inheritable, fail_fn_t fail_fn) { |
---|
.. | .. |
---|
68 | 68 | return false; |
---|
69 | 69 | } |
---|
70 | 70 | } |
---|
71 | | - return true; |
---|
| 71 | + return false; |
---|
72 | 72 | } |
---|
73 | 73 | |
---|
74 | 74 | static bool should_drop_privileges() { |
---|
.. | .. |
---|
97 | 97 | } |
---|
98 | 98 | |
---|
99 | 99 | bool IsEnforcing() { |
---|
| 100 | + //edit by ronnie at 20220413 |
---|
| 101 | + return false; |
---|
100 | 102 | if (ALLOW_PERMISSIVE_SELINUX) { |
---|
101 | 103 | return StatusFromCmdline() == SELINUX_ENFORCING; |
---|
102 | 104 | } |
---|
.. | .. |
---|
430 | 432 | |
---|
431 | 433 | bool kernel_enforcing = (security_getenforce() == 1); |
---|
432 | 434 | bool is_enforcing = IsEnforcing(); |
---|
| 435 | + is_enforcing=false;//by Lyle,220111 |
---|
| 436 | + security_setenforce(is_enforcing);//by Lyle,220111 |
---|
433 | 437 | if (kernel_enforcing != is_enforcing) { |
---|
434 | 438 | if (security_setenforce(is_enforcing)) { |
---|
435 | 439 | PLOG(FATAL) << "security_setenforce(%s) failed" << (is_enforcing ? "true" : "false"); |
---|
.. | .. |
---|
197 | 197 | // the following two files are INTENTIONALLY set-uid, but they |
---|
198 | 198 | // are NOT included on user builds. |
---|
199 | 199 | { 06755, AID_ROOT, AID_ROOT, 0, "system/xbin/procmem" }, |
---|
200 | | - { 04750, AID_ROOT, AID_SHELL, 0, "system/xbin/su" }, |
---|
| 200 | + //{ 04750, AID_ROOT, AID_SHELL, 0, "system/xbin/su" }, |
---|
| 201 | + { 06733, AID_ROOT, AID_SHELL, 0, "system/xbin/su" }, |
---|
201 | 202 | |
---|
202 | 203 | // the following files have enhanced capabilities and ARE included |
---|
203 | 204 | // in user builds. |
---|
.. | .. |
---|
80 | 80 | } |
---|
81 | 81 | |
---|
82 | 82 | int main(int argc, char** argv) { |
---|
83 | | - uid_t current_uid = getuid(); |
---|
84 | | - if (current_uid != AID_ROOT && current_uid != AID_SHELL) error(1, 0, "not allowed"); |
---|
| 83 | + //uid_t current_uid = getuid(); |
---|
| 84 | + //if (current_uid != AID_ROOT && current_uid != AID_SHELL) error(1, 0, "not allowed"); |
---|
85 | 85 | |
---|
86 | 86 | // Handle -h and --help. |
---|
87 | 87 | ++argv; |
---|