./c0de/c/shadowpw.txt

0.
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
 /*  This source will/should print out SHADOWPW passwd files.   */
 
 struct  SHADOWPW {                              /* see getpwent(3) */
          char *pw_name;
          char *pw_passwd;
          int  pw_uid;
          int  pw_gid;
          int  pw_quota;
          char *pw_comment;
          char *pw_gecos;
          char *pw_dir;
          char *pw_shell;
 };
 struct passwd *getpwent(), *getpwuid(), *getpwnam();
 
 #ifdef   elxsis?
 
 /* Name of the shadow password file. Contains password and aging info */
 
 #define  SHADOWPW "/etc/shadowpw"
 #define  SHADOWPW_PAG "/etc/shadowpw.pag"
 #define  SHADOWPW_DIR "/etc/shadowpw.dir"
 /*
  *  Shadow password file pwd->pw_gecos field contains:
  *
  *  <type>,<period>,<last_time>,<old_time>,<old_password>
  *
  *  <type>      = Type of password criteria to enforce (type int).
  *             BSD_CRIT (0), normal BSD.
  *             STR_CRIT (1), strong passwords.
  *  <period>  = Password aging period (type long).
  *             0, no aging.
  *             else, number of seconds in aging period.
  *  <last_time>         = Time (seconds from epoch) of the last password
  *             change (type long).
  *             0, never changed.n
  *  <old_time>  = Time (seconds from epoch) that the current password
  *             was made the <old_password> (type long).
  *             0, never changed.ewromsinm
  *  <old_password> = Password (encrypted) saved for an aging <period> to
  *             prevent reuse during that period (type char [20]).
  *             "*******", no <old_password>.
  */
 
 /* number of tries to change an aged password */
 
 #define  CHANGE_TRIES 3
 
 /* program to execute to change passwords */
 
 #define  PASSWD_PROG "/bin/passwd"
 
 /* Name of the password aging exempt user names and max number of entires */
 
 #define  EXEMPTPW "/etc/exemptpw"
 #define MAX_EXEMPT 100
 
 /* Password criteria to enforce */
 
 #define BSD_CRIT 0     /* Normal BSD password criteria */
 #define STR_CRIT 1      /* Strong password criteria */
 #define MAX_CRIT 1
 #endif   elxsi
 #define NULL 0
 main()
 {
        struct passwd *p;
        int i;
        for (;1;) {;
          p=getpwent();
          if (p==NULL) return;
          printpw(p);
        }
 }
 
 printpw(a)
 struct SHADOWPW *a;
 {
        printf("%s:%s:%d:%d:%s:%s:%s\n",
           a->pw_name,a->pw_passwd,a->pw_uid,a->pw_gid,
           a->pw_gecos,a->pw_dir,a->pw_shell);
 }
 
 /* SunOS 5.0           /etc/shadow */
 /* SunOS4.1+c2     /etc/security/passwd.adjunct */
 
 

Back