`id -Gn' (invoked by groups) would fail without giving a diagnostic
authorJim Meyering <jim@meyering.net>
Mon, 26 Jun 2000 06:32:58 +0000 (06:32 +0000)
committerJim Meyering <jim@meyering.net>
Mon, 26 Jun 2000 06:32:58 +0000 (06:32 +0000)
on malconfigured systems.
(print_user): Give a diagnostic if number->name lookup fails.
(print_group): Likewise.

src/id.c

index e574883188ad80b42e00e708f24eb384d911bc2b..50f5a73da12ece4861dac43ed50553fb9129cd74 100644 (file)
--- a/src/id.c
+++ b/src/id.c
@@ -208,7 +208,10 @@ print_user (uid_t uid)
     {
       pwd = getpwuid (uid);
       if (pwd == NULL)
-       problems++;
+       {
+         error (0, 0, _("cannot find name for user ID %u"), uid);
+         problems++;
+       }
     }
 
   if (pwd == NULL)
@@ -228,7 +231,10 @@ print_group (gid_t gid)
     {
       grp = getgrgid (gid);
       if (grp == NULL)
-       problems++;
+       {
+         error (0, 0, _("cannot find name for group ID %u"), gid);
+         problems++;
+       }
     }
 
   if (grp == NULL)