label transitions
I'm now investigating the mechanism used in SELinux to change something's security label.
I know there is a kernel interface and a system call for applications to do it, their name is security_transition_sid.
The configuration language has two constructs: type_transition and type_change. The first is used by the kernel and instructs the security server to return a particular label for a type pair and a class when the security_transition_sid is called to label a new object or a transformed process.
If type_transition is used to label a transformed process, it requires the transition permission of the class process.
What about type_transition for files? I mean I had a look at file_trans_macro and it seems it's not specified anything like the transition process permission to change the type of a file. How can I control the privilege to change the type of a new object?
Is it correct to argue that permissions relabelto, relabelfrom and transition of file class are used to grant applications the ability to change labels with a call to security_transition_sid (with the output label specified via type_change)?
Thanks in advance for your nth answer ;)
Giorgio