Merge "Fix the cgroup directory owner in createProcessGroupInternal()" am: daf60339ff am: b2839ef496
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2039464 Change-Id: Ib7d033855761e60ad112811e762ff4d822004dc3 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
0278d2c539
1 changed files with 2 additions and 4 deletions
|
|
@ -460,7 +460,6 @@ static int createProcessGroupInternal(uid_t uid, int initialPid, std::string cgr
|
|||
|
||||
struct stat cgroup_stat;
|
||||
mode_t cgroup_mode = 0750;
|
||||
uid_t cgroup_uid = AID_SYSTEM;
|
||||
gid_t cgroup_gid = AID_SYSTEM;
|
||||
int ret = 0;
|
||||
|
||||
|
|
@ -468,11 +467,10 @@ static int createProcessGroupInternal(uid_t uid, int initialPid, std::string cgr
|
|||
PLOG(ERROR) << "Failed to get stats for " << cgroup;
|
||||
} else {
|
||||
cgroup_mode = cgroup_stat.st_mode;
|
||||
cgroup_uid = cgroup_stat.st_uid;
|
||||
cgroup_gid = cgroup_stat.st_gid;
|
||||
}
|
||||
|
||||
if (!MkdirAndChown(uid_path, cgroup_mode, cgroup_uid, cgroup_gid)) {
|
||||
if (!MkdirAndChown(uid_path, cgroup_mode, uid, cgroup_gid)) {
|
||||
PLOG(ERROR) << "Failed to make and chown " << uid_path;
|
||||
return -errno;
|
||||
}
|
||||
|
|
@ -486,7 +484,7 @@ static int createProcessGroupInternal(uid_t uid, int initialPid, std::string cgr
|
|||
|
||||
auto uid_pid_path = ConvertUidPidToPath(cgroup.c_str(), uid, initialPid);
|
||||
|
||||
if (!MkdirAndChown(uid_pid_path, cgroup_mode, cgroup_uid, cgroup_gid)) {
|
||||
if (!MkdirAndChown(uid_pid_path, cgroup_mode, uid, cgroup_gid)) {
|
||||
PLOG(ERROR) << "Failed to make and chown " << uid_pid_path;
|
||||
return -errno;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue