Skip to content
Snippets Groups Projects
Select Git revision
  • d84d9f861140299e88fe0168652728733d6f96b9
  • master default protected
  • android-7.1.2_r28_klist
  • pie-cts-release
  • pie-vts-release
  • pie-cts-dev
  • oreo-mr1-iot-release
  • sdk-release
  • oreo-m6-s4-release
  • oreo-m4-s12-release
  • pie-release
  • pie-r2-release
  • pie-r2-s1-release
  • oreo-vts-release
  • oreo-cts-release
  • oreo-dev
  • oreo-mr1-dev
  • pie-gsi
  • pie-platform-release
  • pie-dev
  • oreo-cts-dev
  • android-o-mr1-iot-release-1.0.4
  • android-9.0.0_r8
  • android-9.0.0_r7
  • android-9.0.0_r6
  • android-9.0.0_r5
  • android-8.1.0_r46
  • android-8.1.0_r45
  • android-n-iot-release-smart-display-r2
  • android-vts-8.1_r5
  • android-cts-8.1_r8
  • android-cts-8.0_r12
  • android-cts-7.1_r20
  • android-cts-7.0_r24
  • android-o-mr1-iot-release-1.0.3
  • android-cts-9.0_r1
  • android-8.1.0_r43
  • android-8.1.0_r42
  • android-n-iot-release-smart-display
  • android-p-preview-5
  • android-9.0.0_r3
41 results

te_macros

Blame
  • te_macros 11.55 KiB
    #####################################
    # domain_trans(olddomain, type, newdomain)
    # Allow a transition from olddomain to newdomain
    # upon executing a file labeled with type.
    # This only allows the transition; it does not
    # cause it to occur automatically - use domain_auto_trans
    # if that is what you want.
    #
    define(`domain_trans', `
    # Old domain may exec the file and transition to the new domain.
    allow $1 $2:file { getattr open read execute };
    allow $1 $3:process transition;
    # New domain is entered by executing the file.
    allow $3 $2:file { entrypoint open read execute getattr };
    # New domain can send SIGCHLD to its caller.
    allow $3 $1:process sigchld;
    # Enable AT_SECURE, i.e. libc secure mode.
    dontaudit $1 $3:process noatsecure;
    # XXX dontaudit candidate but requires further study.
    allow $1 $3:process { siginh rlimitinh };
    ')
    
    #####################################
    # domain_auto_trans(olddomain, type, newdomain)
    # Automatically transition from olddomain to newdomain
    # upon executing a file labeled with type.
    #
    define(`domain_auto_trans', `
    # Allow the necessary permissions.
    domain_trans($1,$2,$3)
    # Make the transition occur by default.
    type_transition $1 $2:process $3;
    ')
    
    #####################################
    # file_type_trans(domain, dir_type, file_type)
    # Allow domain to create a file labeled file_type in a
    # directory labeled dir_type.
    # This only allows the transition; it does not
    # cause it to occur automatically - use file_type_auto_trans
    # if that is what you want.
    #
    define(`file_type_trans', `
    # Allow the domain to add entries to the directory.
    allow $1 $2:dir ra_dir_perms;
    # Allow the domain to create the file.
    allow $1 $3:notdevfile_class_set create_file_perms;
    allow $1 $3:dir create_dir_perms;
    ')
    
    #####################################
    # file_type_auto_trans(domain, dir_type, file_type)
    # Automatically label new files with file_type when
    # they are created by domain in directories labeled dir_type.
    #
    define(`file_type_auto_trans', `
    # Allow the necessary permissions.
    file_type_trans($1, $2, $3)
    # Make the transition occur by default.
    type_transition $1 $2:dir $3;
    type_transition $1 $2:notdevfile_class_set $3;
    ')
    
    #####################################
    # r_dir_file(domain, type)
    # Allow the specified domain to read directories, files
    # and symbolic links of the specified type.
    define(`r_dir_file', `
    allow $1 $2:dir r_dir_perms;
    allow $1 $2:{ file lnk_file } r_file_perms;