2020-02-03 15:47:43 +00:00
|
|
|
diff --git a/src/api.c b/src/api.c
|
2021-05-17 14:15:55 +00:00
|
|
|
index 4a980a1..df9afe8 100644
|
2020-02-03 15:47:43 +00:00
|
|
|
--- a/src/api.c
|
|
|
|
+++ b/src/api.c
|
2021-05-17 14:15:55 +00:00
|
|
|
@@ -170,6 +170,10 @@ static int cg_chown_file(FTS *fts, FTSENT *ent, uid_t owner, gid_t group)
|
2014-01-14 17:41:57 +00:00
|
|
|
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.
|
|
|
|
*/
|
2021-05-17 14:15:55 +00:00
|
|
|
@@ -177,6 +181,8 @@ static int cg_chown_recursive(char **path, uid_t owner, gid_t group)
|
2014-01-14 17:41:57 +00:00
|
|
|
{
|
|
|
|
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 |
|
2021-05-17 14:15:55 +00:00
|
|
|
@@ -194,6 +200,7 @@ static int cg_chown_recursive(char **path, uid_t owner, gid_t group)
|
2014-01-14 17:41:57 +00:00
|
|
|
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);
|