diff mbox series

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

Message ID 20171003085028.31779-1-romain.izard.pro@gmail.com
State Accepted
Delegated to: David Oberhollenzer
Headers show
Series mkfs.ubifs: Apply squash-uids to the root node | expand

Commit Message

Romain Izard Oct. 3, 2017, 8:50 a.m. UTC
The root node of the file system needs to be handled as a special case
when removing the owner information from the input.

Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>
---
 ubifs-utils/mkfs.ubifs/mkfs.ubifs.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

David Oberhollenzer Oct. 4, 2017, 8:19 a.m. UTC | #1
Applied to mtd-utils.git

Thanks,

David
diff mbox series

Patch

diff --git a/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c b/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c
index 9e69a4f..d432dfe 100644
--- a/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c
+++ b/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c
@@ -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;