IT. Expert System.

Android Reference

SELinux


android.os

Class SELinux



  • public class SELinux
    extends Object
    This class provides access to the centralized jni bindings for SELinux interaction.
    • Constructor Detail

      • SELinux

        public SELinux()
    • Method Detail

      • isSELinuxEnabled

        public static final boolean isSELinuxEnabled()
        Determine whether SELinux is disabled or enabled.
        Returns:
        a boolean indicating whether SELinux is enabled.
      • isSELinuxEnforced

        public static final boolean isSELinuxEnforced()
        Determine whether SELinux is permissive or enforcing.
        Returns:
        a boolean indicating whether SELinux is enforcing.
      • setSELinuxEnforce

        public static final boolean setSELinuxEnforce(boolean value)
        Set whether SELinux is permissive or enforcing.
        Parameters:
        boolean - representing whether to set SELinux to enforcing
        Returns:
        a boolean representing whether the desired mode was set
      • setFSCreateContext

        public static final boolean setFSCreateContext(String context)
        Sets the security context for newly created file objects.
        Parameters:
        context - a security context given as a String.
        Returns:
        a boolean indicating whether the operation succeeded.
      • setFileContext

        public static final boolean setFileContext(String path,
                             String context)
        Change the security context of an existing file object.
        Parameters:
        path - representing the path of file object to relabel.
        con - new security context given as a String.
        Returns:
        a boolean indicating whether the operation succeeded.
      • getFileContext

        public static final String getFileContext(String path)
        Get the security context of a file object.
        Parameters:
        path - the pathname of the file object.
        Returns:
        a security context given as a String.
      • getPeerContext

        public static final String getPeerContext(FileDescriptor fd)
        Get the security context of a peer socket.
        Parameters:
        fd - FileDescriptor class of the peer socket.
        Returns:
        a String representing the peer socket security context.
      • getContext

        public static final String getContext()
        Gets the security context of the current process.
        Returns:
        a String representing the security context of the current process.
      • getPidContext

        public static final String getPidContext(int pid)
        Gets the security context of a given process id. Use of this function is discouraged for Binder transactions. Use Binder.getCallingSecctx() instead.
        Parameters:
        pid - an int representing the process id to check.
        Returns:
        a String representing the security context of the given pid.
      • getBooleanNames

        public static final String[] getBooleanNames()
        Gets a list of the SELinux boolean names.
        Returns:
        an array of strings containing the SELinux boolean names.
      • getBooleanValue

        public static final boolean getBooleanValue(String name)
        Gets the value for the given SELinux boolean name.
        Parameters:
        String - The name of the SELinux boolean.
        Returns:
        a boolean indicating whether the SELinux boolean is set.
      • setBooleanValue

        public static final boolean setBooleanValue(String name,
                              boolean value)
        Sets the value for the given SELinux boolean name.
        Parameters:
        String - The name of the SELinux boolean.
        Boolean - The new value of the SELinux boolean.
        Returns:
        a boolean indicating whether or not the operation succeeded.
      • checkSELinuxAccess

        public static final boolean checkSELinuxAccess(String scon,
                                 String tcon,
                                 String tclass,
                                 String perm)
        Check permissions between two security contexts.
        Parameters:
        scon - The source or subject security context.
        tcon - The target or object security context.
        tclass - The object security class name.
        perm - The permission name.
        Returns:
        a boolean indicating whether permission was granted.
      • restorecon

        public static boolean restorecon(String pathname)
                                  throws NullPointerException
        Restores a file to its default SELinux security context. If the system is not compiled with SELinux, then true is automatically returned. If SELinux is compiled in, but disabled, then true is returned.
        Parameters:
        pathname - The pathname of the file to be relabeled.
        Returns:
        a boolean indicating whether the relabeling succeeded.
        Throws:
        NullPointerException - if the pathname is a null object.
      • restorecon

        public static boolean restorecon(File file)
                                  throws NullPointerException
        Restores a file to its default SELinux security context. If the system is not compiled with SELinux, then true is automatically returned. If SELinux is compiled in, but disabled, then true is returned.
        Parameters:
        file - The File object representing the path to be relabeled.
        Returns:
        a boolean indicating whether the relabeling succeeded.
        Throws:
        NullPointerException - if the file is a null object.


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 162 / 159412745. Delta: 0.03159 с