Skip to contentSkip to conversation

Add "/usr/(.*/)?bin(/.*)?" pattern back

PATCH New Nicolas Iooss 2 participants 2 messages Aug 17, 2017 – Aug 19, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add "/usr/(.*/)?bin(/.*)?" pattern back

Commit 2e7553db639b ("Create / to /usr equivalence for bin, sbin, and lib, from Russell Coker.") removed from corecommands.fc:

    /usr/(.*/)?bin(/.*)?    gen_context(system_u:object_r:bin_t,s0)

Consequently files like /usr/x86_64-w64-mingw32/bin/objdump get labeled as usr_t:

    $ matchpathcon /usr/x86_64-w64-mingw32/bin/objdump
    /usr/x86_64-w64-mingw32/bin/objdump system_u:object_r:usr_t

Make such files labeled as bin_t again.

---
 policy/modules/kernel/corecommands.fc | 1 +
 1 file changed, 1 insertion(+)
policy/modules/kernel/corecommands.fc +1 -0
index ce4218fed6dd..6573d890d941 100644
@@ -135,6 +135,7 @@ ifdef(`distro_gentoo',`
 # /usr
 #
 /usr/(.*/)?Bin(/.*)?			gen_context(system_u:object_r:bin_t,s0)
+/usr/(.*/)?bin(/.*)?			gen_context(system_u:object_r:bin_t,s0)
 /usr/bin(/.*)?				gen_context(system_u:object_r:bin_t,s0)
 /usr/bin/d?ash			--	gen_context(system_u:object_r:shell_exec_t,s0)
 /usr/bin/bash			--	gen_context(system_u:object_r:shell_exec_t,s0)
Signature · 1 line
2.14.1
#1 lore raw

PATCH 1/1 Add "/usr/(.*/)?bin(/.*)?" pattern back

Quoted 21 lines · Nicolas Iooss via refpolicy

Commit 2e7553db639b ("Create / to /usr equivalence for bin, sbin, and lib, from Russell Coker.") removed from corecommands.fc:

     /usr/(.*/)?bin(/.*)?    gen_context(system_u:object_r:bin_t,s0)

Consequently files like /usr/x86_64-w64-mingw32/bin/objdump get labeled as usr_t:

     $ matchpathcon /usr/x86_64-w64-mingw32/bin/objdump
     /usr/x86_64-w64-mingw32/bin/objdump system_u:object_r:usr_t

Make such files labeled as bin_t again.

---
  policy/modules/kernel/corecommands.fc | 1 +
  1 file changed, 1 insertion(+)
policy/modules/kernel/corecommands.fc +0 -0
index ce4218fed6dd..6573d890d941 100644

policy/modules/kernel/corecommands.fc ifdef(`distro_gentoo',` · line 141

Quoted 7 lines
policy/modules/kernel/corecommands.fc +1 -0
@@ -135,6 +135,7 @@ ifdef(`distro_gentoo',`
  # /usr
  #
  /usr/(.*/)?Bin(/.*)?			gen_context(system_u:object_r:bin_t,s0)
+/usr/(.*/)?bin(/.*)?			gen_context(system_u:object_r:bin_t,s0)
  /usr/bin(/.*)?				gen_context(system_u:object_r:bin_t,s0)
  /usr/bin/d?ash			--	gen_context(system_u:object_r:shell_exec_t,s0)
  /usr/bin/bash			--	gen_context(system_u:object_r:shell_exec_t,s0)

Merged.

Signature · 1 line
Chris PeBenito