Print this page
3243 Add shadow support to getent(1)


  25  */
  26 
  27 #pragma ident   "%Z%%M% %I%     %E% SMI"
  28 
  29 #include <stdlib.h>
  30 #include <stdio.h>
  31 #include <string.h>
  32 #include <locale.h>
  33 #include <unistd.h>
  34 #include "getent.h"
  35 
  36 static const char *cmdname;
  37 
  38 struct table {
  39         char    *name;                  /* name of the table */
  40         int     (*func)(const char **); /* function to do the lookup */
  41 };
  42 
  43 static struct table t[] = {
  44         { "passwd",     dogetpw },

  45         { "group",      dogetgr },
  46         { "hosts",      dogethost },
  47         { "ipnodes",    dogetipnodes },
  48         { "services",   dogetserv },
  49         { "protocols",  dogetproto },
  50         { "ethers",     dogetethers },
  51         { "networks",   dogetnet },
  52         { "netmasks",   dogetnetmask },
  53         { "project",    dogetproject },
  54         { NULL,         NULL }
  55 };
  56 
  57 static  void usage(void) __NORETURN;
  58 
  59 int
  60 main(int argc, const char **argv)
  61 {
  62         struct table *p;
  63 
  64         (void) setlocale(LC_ALL, "");




  25  */
  26 
  27 #pragma ident   "%Z%%M% %I%     %E% SMI"
  28 
  29 #include <stdlib.h>
  30 #include <stdio.h>
  31 #include <string.h>
  32 #include <locale.h>
  33 #include <unistd.h>
  34 #include "getent.h"
  35 
  36 static const char *cmdname;
  37 
  38 struct table {
  39         char    *name;                  /* name of the table */
  40         int     (*func)(const char **); /* function to do the lookup */
  41 };
  42 
  43 static struct table t[] = {
  44         { "passwd",     dogetpw },
  45         { "shadow",     dogetsp },
  46         { "group",      dogetgr },
  47         { "hosts",      dogethost },
  48         { "ipnodes",    dogetipnodes },
  49         { "services",   dogetserv },
  50         { "protocols",  dogetproto },
  51         { "ethers",     dogetethers },
  52         { "networks",   dogetnet },
  53         { "netmasks",   dogetnetmask },
  54         { "project",    dogetproject },
  55         { NULL,         NULL }
  56 };
  57 
  58 static  void usage(void) __NORETURN;
  59 
  60 int
  61 main(int argc, const char **argv)
  62 {
  63         struct table *p;
  64 
  65         (void) setlocale(LC_ALL, "");