Blame SOURCES/libcgroup-0.37-chmod.patch

0a7b38
diff -up libcgroup-0.41/src/api.c.chmod libcgroup-0.41/src/api.c
0a7b38
--- libcgroup-0.41/src/api.c.chmod	2014-01-13 15:05:56.000000000 +0100
0a7b38
+++ libcgroup-0.41/src/api.c	2014-01-13 20:41:55.255577622 +0100
0a7b38
@@ -153,6 +153,10 @@ static int cg_chown_file(FTS *fts, FTSEN
0a7b38
 	return ret;
0a7b38
 }
0a7b38
 
0a7b38
+int cg_chmod_file(FTS *fts, FTSENT *ent, mode_t dir_mode,
0a7b38
+	int dirm_change, mode_t file_mode, int filem_change,
0a7b38
+	int owner_is_umask);
0a7b38
+
0a7b38
 /*
0a7b38
  * TODO: Need to decide a better place to put this function.
0a7b38
  */
0a7b38
@@ -160,6 +164,8 @@ static int cg_chown_recursive(char **pat
0a7b38
 {
0a7b38
 	int ret = 0;
0a7b38
 	FTS *fts;
0a7b38
+	/* mode 664 */
0a7b38
+	mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH;
0a7b38
 
0a7b38
 	cgroup_dbg("chown: path is %s\n", *path);
0a7b38
 	fts = fts_open(path, FTS_PHYSICAL | FTS_NOCHDIR |
0a7b38
@@ -177,6 +183,7 @@ static int cg_chown_recursive(char **pat
0a7b38
 			cgroup_warn("Warning: fts_read failed\n");
0a7b38
 			break;
0a7b38
 		}
0a7b38
+		cg_chmod_file(fts, ent, mode, 0, mode, 1, 1);
0a7b38
 		ret = cg_chown_file(fts, ent, owner, group);
0a7b38
 	}
0a7b38
 	fts_close(fts);