All of lore.kernel.org
 help / color / mirror / Atom feed
* initial_sid context via libsepol
@ 2016-03-04 21:16 Roberts, William C
  2016-03-05 14:43 ` Richard Haines
  0 siblings, 1 reply; 16+ messages in thread
From: Roberts, William C @ 2016-03-04 21:16 UTC (permalink / raw)
  To: selinux@tycho.nsa.gov

[-- Attachment #1: Type: text/plain, Size: 625 bytes --]


How can one obtain the same value as /sys/fs/selinux/initial_contexts/file via libsepol?

I've been digging around libsepol and its not quite clear to me.

It looks as though the record is here:
                context_struct_t *a = &((policydb_t *)pol.db)->ocontexts[OCON_ISID]->context[0];
                context_struct_t *b = &((policydb_t *)pol.db)->ocontexts[OCON_ISID]->context[1];

                printf("%u\n", a->type);
                printf("%u\n",b->type);

Prints:
185
0

Not sure if this is right, and how to format the context struct to a string. I didn't see any helpers.

Thanks,
Bill

[-- Attachment #2: Type: text/html, Size: 3359 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2016-03-09 17:12 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-04 21:16 initial_sid context via libsepol Roberts, William C
2016-03-05 14:43 ` Richard Haines
2016-03-07 15:41   ` Richard Haines
2016-03-07 18:44     ` Stephen Smalley
2016-03-07 20:32       ` Stephen Smalley
2016-03-08  1:32         ` William Roberts
2016-03-08 13:12           ` Richard Haines
2016-03-08 13:35             ` Richard Haines
2016-03-08 13:49             ` Christopher J. PeBenito
2016-03-08 13:42           ` Stephen Smalley
2016-03-09  5:18             ` William Roberts
2016-03-09 14:09               ` Stephen Smalley
2016-03-09 15:37                 ` William Roberts
2016-03-09 17:12                   ` William Roberts
2016-03-09 15:42                 ` Stephen Smalley
2016-03-09 15:45                   ` William Roberts

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.