Many files:
Checkin of e2fsprogs 0.5b
diff --git a/lib/e2p/ls.c b/lib/e2p/ls.c
index 982f044..f879a3c 100644
--- a/lib/e2p/ls.c
+++ b/lib/e2p/ls.c
@@ -9,13 +9,40 @@
* Public License
*/
+#include <grp.h>
+#include <pwd.h>
#include <stdio.h>
#include <time.h>
+#include <sys/types.h>
#include <linux/ext2_fs.h>
#include "e2p.h"
+static void print_user (unsigned short uid)
+{
+ struct passwd *pw;
+
+ printf ("%u ", uid);
+ pw = getpwuid (uid);
+ if (pw == NULL)
+ printf ("(user unknown)\n");
+ else
+ printf ("(user %s)\n", pw->pw_name);
+}
+
+static void print_group (unsigned short gid)
+{
+ struct group *gr;
+
+ printf ("%u ", gid);
+ gr = getgrgid (gid);
+ if (gr == NULL)
+ printf ("(group unknown)\n");
+ else
+ printf ("(group %s)\n", gr->gr_name);
+}
+
void list_super (struct ext2_super_block * s)
{
printf ("Filesystem magic number: 0x%04X\n", s->s_magic);
@@ -49,4 +76,10 @@
next = s->s_lastcheck + s->s_checkinterval;
printf ("Next check after: %s", ctime (&next));
}
+#ifdef EXT2_DEF_RESUID
+ printf ("Reserved blocks uid: ");
+ print_user (s->s_def_resuid);
+ printf ("Reserved blocks gid: ");
+ print_group (s->s_def_resuid);
+#endif
}