libcgroup/libcgroup-0.37-chmod.patch
leizhongkai 4a718e1133 libcgroup: new upstream release 0.42.2
fix !I1RU2L

The upstream is migrated from "sourceforge" to "github",
we need to upgrade accordingly.

Signed-off-by: leizhongkai <leizhongkai@huawei.com>
2020-11-04 14:41:23 +08:00

33 lines
1.0 KiB
Diff

diff --git libcgroup-0.42.2/src/api.c libcgroup-0.42.2/src/api.c
index 24ae48d..54a6736 100644
--- libcgroup-0.42.2/src/api.c
+++ libcgroup-0.42.2/src/api.c
@@ -159,6 +159,10 @@ static int cg_chown_file(FTS *fts, FTSENT *ent, uid_t owner, gid_t group)
return ret;
}
+int cg_chmod_file(FTS *fts, FTSENT *ent, mode_t dir_mode,
+ int dirm_change, mode_t file_mode, int filem_change,
+ int owner_is_umask);
+
/*
* TODO: Need to decide a better place to put this function.
*/
@@ -166,6 +170,8 @@ static int cg_chown_recursive(char **path, uid_t owner, gid_t group)
{
int ret = 0;
FTS *fts;
+ /* mode 664 */
+ mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH;
cgroup_dbg("chown: path is %s\n", *path);
fts = fts_open(path, FTS_PHYSICAL | FTS_NOCHDIR |
@@ -183,6 +189,7 @@ static int cg_chown_recursive(char **path, uid_t owner, gid_t group)
cgroup_warn("Warning: fts_read failed\n");
break;
}
+ cg_chmod_file(fts, ent, mode, 0, mode, 1, 1);
ret = cg_chown_file(fts, ent, owner, group);
}
fts_close(fts);