Skip to content
This repository was archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
am 132e56b: am e3519d6: Merge "Label /data/.layout_version with its o…
Browse files Browse the repository at this point in the history
…wn type."

* commit '132e56b9417d0c9cb029d2255d40415e5f1aad74':
  Label /data/.layout_version with its own type.
  • Loading branch information
nickkral authored and Android Git Automerger committed May 13, 2014
2 parents a914acb + 132e56b commit 623b636
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions file.te
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ type unlabeled, file_type;
type system_file, file_type;
# Default type for anything under /data.
type system_data_file, file_type, data_file_type;
# /data/.layout_version or other installd-created files that
# are created in a system_data_file directory.
type install_data_file, file_type, data_file_type;
# /data/drm - DRM plugin data
type drm_data_file, file_type, data_file_type;
# /data/anr - ANR traces
Expand Down
1 change: 1 addition & 0 deletions file_contexts
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@
# Data files
#
/data(/.*)? u:object_r:system_data_file:s0
/data/.layout_version u:object_r:install_data_file:s0
/data/backup(/.*)? u:object_r:backup_data_file:s0
/data/secure/backup(/.*)? u:object_r:backup_data_file:s0
/data/security(/.*)? u:object_r:security_file:s0
Expand Down
7 changes: 4 additions & 3 deletions installd.te
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ allow installd system_data_file:dir relabelfrom;
allow installd media_rw_data_file:dir relabelto;

# Create /data/.layout_version.* file
allow installd system_data_file:file create_file_perms;
type_transition installd system_data_file:file install_data_file;
allow installd install_data_file:file create_file_perms;

# Create files under /data/dalvik-cache.
allow installd dalvikcache_data_file:dir create_dir_perms;
Expand All @@ -49,9 +50,9 @@ allow installd unlabeled:dir { getattr search relabelfrom };
allow installd unlabeled:notdevfile_class_set { getattr relabelfrom };

# Upgrade from before system_app_data_file was used for system UID apps.
# Just need enough to relabel it.
# Just need enough to relabel it and to unlink removed package files.
# Directory access covered by earlier rule above.
allow installd system_data_file:notdevfile_class_set { getattr relabelfrom };
allow installd system_data_file:notdevfile_class_set { getattr relabelfrom unlink };

# Manage /data/data subdirectories, including initially labeling them
# upon creation via setfilecon or running restorecon_recursive,
Expand Down

0 comments on commit 623b636

Please sign in to comment.