Set uid/gid of newly created user dirs to system/system.

Bug: 23395513
Change-Id: I3d76b77339f995103c0aec09c6de77b3c8cdc0dd
This commit is contained in:
Paul Crowley 2015-08-24 14:53:28 +01:00
parent 008c1ac225
commit 480fcd2750

View file

@ -15,6 +15,8 @@
#include <cutils/properties.h>
#include <openssl/sha.h>
#include <private/android_filesystem_config.h>
#include "unencrypted_properties.h"
#include "key_control.h"
#include "cryptfs.h"
@ -585,6 +587,9 @@ int e4crypt_create_new_user_dir(const char *user_handle, const char *path) {
if (chmod(path, S_IRWXU | S_IRWXG | S_IXOTH) < 0) {
return -1;
}
if (chown(path, AID_SYSTEM, AID_SYSTEM) < 0) {
return -1;
}
if (e4crypt_crypto_complete(DATA_MNT_POINT) == 0) {
// ext4enc:TODO handle errors from this.
e4crypt_set_user_policy(DATA_MNT_POINT, user_handle, path, true);