Skip to content

Commit

Permalink
run-as should accept /data/user/0 symlink
Browse files Browse the repository at this point in the history
This works around b/21028929.
That old bug reappeared in nyc-dev because of file-based-encryption.

Bug: 21028929
Change-Id: I4eb65ee3b57fb86605fa56fd1395a9666f6aef7f
  • Loading branch information
stroyan committed Mar 21, 2016
1 parent 5f31ca2 commit 57288ad
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions run-as/package.c
Expand Up @@ -182,6 +182,10 @@ check_directory_ownership(const char* path, uid_t uid)
if (ret < 0)
return -1;

/* /data/user/0 is a known safe symlink */
if (strcmp("/data/user/0", path) == 0)
return 0;

/* must be a real directory, not a symlink */
if (!S_ISDIR(st.st_mode))
goto BAD;
Expand Down

0 comments on commit 57288ad

Please sign in to comment.