string_to_av_perm behavior

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



./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
#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);

}
_______________________________________________
Selinux mailing list
Selinux@xxxxxxxxxxxxx
To unsubscribe, send email to Selinux-leave@xxxxxxxxxxxxx.
To get help, send an email containing "help" to Selinux-request@xxxxxxxxxxxxx.

[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux