Skip to contentSkip to conversation

mkfs.ubifs: Apply squash-uids to the root node

PATCH Applied Romain Izard 2 participants 2 messages Oct 3, 2017 – Oct 4, 2017 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mkfs.ubifs: Apply squash-uids to the root node

The root node of the file system needs to be handled as a special case when removing the owner information from the input.

---
 ubifs-utils/mkfs.ubifs/mkfs.ubifs.c | 2 ++
 1 file changed, 2 insertions(+)
ubifs-utils/mkfs.ubifs/mkfs.ubifs.c +2 -0
index 9e69a4f..d432dfe 100644
@@ -1831,6 +1831,8 @@ static int write_data(void)
 		if (err)
 			return sys_err_msg("bad root file-system directory '%s'",
 					   root);
+		if (squash_owner)
+			root_st.st_uid = root_st.st_gid = 0;
 	} else {
 		root_st.st_mtime = time(NULL);
 		root_st.st_atime = root_st.st_ctime = root_st.st_mtime;
Signature · 1 line
2.11.0