Skip to contentSkip to conversation

how do I use selabel to get an x selection object context

DISCUSSION Xavier Toth 2 participants 2 messages Jun 11, 2008 – Jun 12, 2008 SELinux security module

lore
Share & tools
lore
#0 lore raw

I could use an example of using selabel to get a x object context if anyone has one.

--
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 9 lines · Xavier Toth

I could use an example of using selabel to get a x object context if anyone has one.

--
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.

Opening a handle:

label_hnd = selabel_open(SELABEL_CTX_X, NULL, 0); if (!label_hnd)

	FatalError("SELinux: Failed to open x_contexts mapping in policy\n");

Doing a lookup:

if (selabel_lookup(label_hnd, &ctx, name, SELABEL_X_SELN) < 0)

	FatalError("SELinux: A lookup failed!");

Closing:

   freecon(ctx);
   selabel_close(label_hnd);
Signature · 7 lines
Eamon Walsh <[email protected]>
National Security Agency

--
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.