示例#1
0
def interface(args):
    from sepolicy.interface import get_admin, get_user, get_all_interfaces
    if args.list_admin:
        print_interfaces(get_admin(args.file), args, "_admin")
    if args.list_user:
        print_interfaces(get_user(args.file), args, "_role")
    if args.list:
        print_interfaces(get_all_interfaces(args.file), args)
    if args.interfaces:
        print_interfaces(args.interfaces, args)
示例#2
0
 def __call__(self, parser, namespace, values, option_string=None):
     from sepolicy.interface import get_admin
     newval = getattr(namespace, self.dest)
     if not newval:
         newval = []
     admins = get_admin()
     if values not in admins:
         raise ValueError("%s must be an SELinux admin domain:\nValid admin domains: %s" % (values, ", ".join(admins)))
     newval.append(values)
     setattr(namespace, self.dest, newval)
示例#3
0
 def __call__(self, parser, namespace, values, option_string=None):
     from sepolicy.interface import get_admin
     newval = getattr(namespace, self.dest)
     if not newval:
         newval = []
     admins = get_admin()
     if values not in admins:
         raise ValueError("%s must be an SELinux admin domain:\nValid admin domains: %s" % (values, ", ".join(admins)))
     newval.append(values)
     setattr(namespace, self.dest, newval)
示例#4
0
def interface(args):
    from sepolicy.interface import get_admin, get_user, get_interface_dict, get_all_interfaces
    if args.list_admin:
        print_interfaces(get_admin(args.file), args, "_admin")
    if args.list_user:
        print_interfaces(get_user(args.file), args, "_role")
    if args.list:
        print_interfaces(get_all_interfaces(args.file), args)
    if args.interfaces:
        print_interfaces(args.interfaces, args)
示例#5
0
def interface(args):
    from sepolicy.interface import get_admin, get, get_user
    if args.list_admin:
        for a in get_admin():
            print a
    if args.list_user:
        for a in get_user():
            print a
    if args.list:
        for m in get():
            print m