All of lore.kernel.org
 help / color / mirror / Atom feed
* string_to_av_perm behavior
@ 2015-05-22 16:12 Ted Toth
  2015-05-22 16:20 ` Stephen Smalley
  0 siblings, 1 reply; 8+ messages in thread
From: Ted Toth @ 2015-05-22 16:12 UTC (permalink / raw)
  To: SELinux

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

./avperm
1 - av_perm 0
security class: 66
class db_tuple av select
2 - av_perm 8
3 - av_perm 8

why does the first call to string_to_av_perm return 0 something seem wrong here.

Ted

[-- Attachment #2: avperm.c --]
[-- Type: text/x-csrc, Size: 882 bytes --]

#include <stdio.h>
#include <selinux/selinux.h>
#include <selinux/flask.h>
#include <selinux/av_permissions.h>

int main(int argc, char**argv) {
  const char *perm_name = "select";
  const char *class_name = "db_tuple";
  access_vector_t av_perm;
  security_class_t sec_class;

  av_perm = 0;
  sec_class = SECCLASS_DB_TUPLE;

  av_perm = string_to_av_perm(sec_class, perm_name);
  printf("1 - av_perm %d\n", av_perm);

  sec_class = string_to_security_class(class_name);
  printf("security class: %d\n", sec_class);
  av_perm = 0;
  av_perm = string_to_av_perm(sec_class, perm_name);
  printf("class %s av %s\n", security_class_to_string(SECCLASS_DB_TUPLE), security_av_perm_to_string(SECCLASS_DB_TUPLE, DB_TUPLE__SELECT));
  printf("2 - av_perm %d\n", av_perm);
  av_perm = 0;
  av_perm = string_to_av_perm(SECCLASS_DB_TUPLE, perm_name);
  printf("3 - av_perm %d\n", av_perm);

}

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

end of thread, other threads:[~2015-05-22 16:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-22 16:12 string_to_av_perm behavior Ted Toth
2015-05-22 16:20 ` Stephen Smalley
2015-05-22 16:23   ` Stephen Smalley
2015-05-22 16:26     ` Ted Toth
2015-05-22 16:36       ` Ted Toth
2015-05-22 16:39         ` Stephen Smalley
2015-05-22 16:47           ` Ted Toth
2015-05-22 16:58             ` Stephen Smalley

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.