Skip to contentSkip to conversation

We need a tool to extract the file context contents out of a policy package.

DISCUSSION Daniel J Walsh 3 participants 6 messages Mar 11, 2006 – Mar 13, 2006 SELinux security module

lore
Share & tools
lore
#0 lore raw

If we had this we could do something like

fixfiles -P mypolicy.pp

And it would restorecon over the file context.

Dan

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#1 lore raw
Quoted 5 lines · Daniel J Walsh

If we had this we could do something like

fixfiles -P mypolicy.pp

And it would restorecon over the file context.

- what if the contexts used are defined in another module that isn't linked yet?
- what if the contexts are in this module, but it isn't loaded?
- what about genhomedircon processing?

Why can't we do this in semanage_commit()?

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#2 lore raw
Quoted 8 lines · Ivan Gyurdiev
Quoted 5 lines · Daniel J Walsh

If we had this we could do something like

fixfiles -P mypolicy.pp

And it would restorecon over the file context.

- what if the contexts used are defined in another module that isn't linked yet?

Then it will not work, but I don't see that as a real problem.

Quoted 1 line

- what if the contexts are in this module, but it isn't loaded?

Ditto

Quoted 3 lines

- what about genhomedircon processing?

Perhaps, but usually not necessary. We could have fixfiles run genhomedircon before restoring context.

Quoted 1 line

Why can't we do this in semanage_commit()?

I think the indeterminate time could be a problem. semodule -i could take a half hour...

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#3 lore raw
In reply to Daniel J Walsh
Quoted 5 lines · Daniel J Walsh

If we had this we could do something like

fixfiles -P mypolicy.pp

And it would restorecon over the file context.

the file contexts in any given package doesn't represent the file contexts on the system. Further, you'll lose the homedir and local entries (and if there are homedir entries present they'll lose their precedence)

what is the problem you are trying to solve? I think we can do this a better way.

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#4 lore raw
Quoted 10 lines · Joshua Brindle
Quoted 5 lines · Daniel J Walsh

If we had this we could do something like

fixfiles -P mypolicy.pp

And it would restorecon over the file context.

the file contexts in any given package doesn't represent the file contexts on the system. Further, you'll lose the homedir and local entries (and if there are homedir entries present they'll lose their precedence)

what is the problem you are trying to solve? I think we can do this a better way.

If I install a package I need a way of relabeling the files that are being installed. Currently when the policy package gets updated, it does a diff between previous file_context and new file_context and then runs a restorecon on the diff. We currently ignore homedirs. Moving to modules, we need similar capabilities. Relabeling the entire system ever time you update a policy module is not going to work. The current method is not full proof, but it has been fairly effective over the last couple of years.

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#5 lore raw
Quoted 4 lines · Daniel J Walsh
Quoted 3 lines · Joshua Brindle
Quoted 2 lines · Daniel J Walsh

If we had this we could do something like

Quoted 9 lines
Quoted 7 lines
Quoted 3 lines

fixfiles -P mypolicy.pp

And it would restorecon over the file context.

the file contexts in any given package doesn't represent the file contexts on the system. Further, you'll lose the homedir and local entries (and if there are homedir entries present they'll lose their precedence)

what is the problem you are trying to solve? I think we can do this a better way.

If I install a package I need a way of relabeling the files that are being installed. Currently when the policy package gets updated, it does a diff between previous file_context and new file_context and then runs a restorecon on the diff. We currently ignore homedirs. Moving to modules, we need similar capabilities. Relabeling the entire system ever time you update a policy module is not going to work. The current method is not full proof, but it has been fairly effective over the last couple of years.

We can add diffing/restorecon functionality to semanage. I don't know if it is fair to assume that one modules file_contexts won't interact in unexpected ways with other modules and base file_contexts so we should probably always handle the file_contexts in their entirety and never alone.

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.