e623b7ca46
- resolves: #2115990
33 lines
1010 B
Diff
33 lines
1010 B
Diff
diff --git a/src/api.c b/src/api.c
|
|
index f8c5acd..3f7d831 100644
|
|
--- a/src/api.c
|
|
+++ b/src/api.c
|
|
@@ -52,6 +52,10 @@ const struct cgroup_library_version library_version = {
|
|
.release = CGROUP_VER_RELEASE,
|
|
};
|
|
|
|
+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);
|
|
+
|
|
/*
|
|
* The errno which happend the last time (have to be thread specific)
|
|
*/
|
|
@@ -184,6 +188,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 | FTS_NOSTAT, NULL);
|
|
@@ -201,6 +207,7 @@ static int cg_chown_recursive(char **path, uid_t owner, gid_t group)
|
|
cgroup_warn("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);
|