]> www.infradead.org Git - mtd-utils.git/commitdiff
mkfs.ubifs: Apply squash-uids to the root node
authorRomain Izard <romain.izard.pro@gmail.com>
Tue, 3 Oct 2017 08:50:28 +0000 (10:50 +0200)
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>
Wed, 4 Oct 2017 08:14:19 +0000 (10:14 +0200)
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>
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
ubifs-utils/mkfs.ubifs/mkfs.ubifs.c

index 9e69a4fddf4d5e6ab51662e76c46fc9ab01dfedc..d432dfe9a09252f60c516c6b8a3d22f8178946bf 100644 (file)
@@ -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;