From: Niu Yawei Date: Thu, 19 Sep 2013 10:57:22 +0000 (-0400) Subject: LU-1502 mke2fs: don't set uid/gid for root X-Git-Tag: v1.42.7.wc2~4 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=8f41a2b3fa29b028059d9bc3f88fee08a5884dd9;p=tools%2Fe2fsprogs.git LU-1502 mke2fs: don't set uid/gid for root Don't set uid/gid for root directory when mkfs. The expect.1 of m_quota is updated accordingly. Signed-off-by: Niu Yawei Signed-off-by: Vladimir Saveliev Change-Id: I034d9fa68b252b555472d09eb48439a8e78ed342 --- diff --git a/misc/mke2fs.c b/misc/mke2fs.c index 3ba073c..05b2d5e 100644 --- a/misc/mke2fs.c +++ b/misc/mke2fs.c @@ -364,28 +364,6 @@ static void create_root_dir(ext2_filsys fs) com_err("ext2fs_mkdir", retval, _("while creating root dir")); exit(1); } - if (geteuid()) { - retval = ext2fs_read_inode(fs, EXT2_ROOT_INO, &inode); - if (retval) { - com_err("ext2fs_read_inode", retval, - _("while reading root inode")); - exit(1); - } - uid = getuid(); - inode.i_uid = uid; - ext2fs_set_i_uid_high(inode, uid >> 16); - if (uid) { - gid = getgid(); - inode.i_gid = gid; - ext2fs_set_i_gid_high(inode, gid >> 16); - } - retval = ext2fs_write_new_inode(fs, EXT2_ROOT_INO, &inode); - if (retval) { - com_err("ext2fs_write_inode", retval, - _("while setting root inode ownership")); - exit(1); - } - } } static void create_lost_and_found(ext2_filsys fs) diff --git a/tests/m_quota/expect.1 b/tests/m_quota/expect.1 index f1591b8..1c86f59 100644 --- a/tests/m_quota/expect.1 +++ b/tests/m_quota/expect.1 @@ -24,7 +24,7 @@ Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information -test_filesys: 11/32768 files (18.2% non-contiguous), 5709/131072 blocks +test_filesys: 11/32768 files (18.2% non-contiguous), 5703/131072 blocks Exit status is 0 Filesystem volume name: @@ -39,7 +39,7 @@ Filesystem OS type: Linux Inode count: 32768 Block count: 131072 Reserved block count: 6553 -Free blocks: 125363 +Free blocks: 125369 Free inodes: 32757 First block: 1 Block size: 1024 @@ -65,8 +65,8 @@ Group 0: (Blocks 1-8192) Reserved GDT blocks at 3-258 Block bitmap at 259 (+258), Inode bitmap at 260 (+259) Inode table at 261-516 (+260) - 7644 free blocks, 2037 free inodes, 2 directories - Free blocks: 549-8192 + 7650 free blocks, 2037 free inodes, 2 directories + Free blocks: 543-8192 Free inodes: 12-2048 Group 1: (Blocks 8193-16384) Backup superblock at 8193, Group descriptors at 8194-8194