]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
debugfs: fix rdump and ls to handle uids and gids > 65536 correctly
authorTheodore Ts'o <tytso@mit.edu>
Thu, 25 Feb 2021 22:26:07 +0000 (17:26 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 25 Feb 2021 22:26:07 +0000 (17:26 -0500)
https://github.com/tytso/e2fsprogs/issues/63

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
debugfs/dump.c
debugfs/ls.c

index fdd66198edb1d682b1284f2e48ee20db0f46d8c7..42f5204a8050cf9a1dd8dfb36782f7751ea6a2b5 100644 (file)
@@ -81,12 +81,12 @@ static void fix_perms(const char *cmd, const struct ext2_inode *inode,
                com_err(cmd, errno, "while setting permissions of %s", name);
 
 #ifndef HAVE_FCHOWN
-       i = chown(name, inode->i_uid, inode->i_gid);
+       i = chown(name, inode_uid(*inode), inode_gid(*inode));
 #else
        if (fd != -1)
-               i = fchown(fd, inode->i_uid, inode->i_gid);
+               i = fchown(fd, inode_uid(*inode), inode_gid(*inode));
        else
-               i = chown(name, inode->i_uid, inode->i_gid);
+               i = chown(name, inode_uid(*inode), inode_gid(*inode));
 #endif
        if (i == -1)
                com_err(cmd, errno, "while changing ownership of %s", name);
index fae2a6533dcbff3ab002419f0f3929b97932e9e1..525f084b836de98e8a51c3dc2ac3a5c9171322c8 100644 (file)
@@ -114,7 +114,7 @@ static int list_dir_proc(ext2_ino_t dir EXT2FS_ATTR((unused)),
                } else
                        memset(&inode, 0, sizeof(struct ext2_inode));
                fprintf(ls->f,"/%u/%06o/%d/%d/%.*s/", ino, inode.i_mode,
-                       inode.i_uid, inode.i_gid, thislen, dirent->name);
+                       inode_uid(inode), inode_gid(inode), thislen, dirent->name);
                if (LINUX_S_ISDIR(inode.i_mode))
                        fprintf(ls->f, "/");
                else