File: shadow.C

package info (click to toggle)
librudiments0 0.27-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 4,528 kB
  • ctags: 2,284
  • sloc: cpp: 14,657; sh: 7,547; ansic: 2,664; makefile: 945; xml: 15
file content (39 lines) | stat: -rw-r--r-- 1,076 bytes parent folder | download
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
// Copyright (c) 2003  David Muse
// See the file COPYING for more information

#include <rudiments/shadowentry.h>

#include <stdio.h>


int main(int argc, const char **argv) {


	// get the shadow entry for "root"
	shadowentry	spent;
	spent.initialize("root");

	// print the components individually
	printf("Individually...\n");
	printf("	Name: %s\n",spent.getName());
	printf("	Encrypted Password: %s\n",spent.getEncryptedPassword());
	printf("	Last Change: %ld\n",
					spent.getLastChangeDate());
	printf("	Days Before Change Allowed: %d\n",
					spent.getDaysBeforeChangeAllowed());
	printf("	Days Before Change Required: %d\n",
					spent.getDaysBeforeChangeRequired());
	printf("	Days Before Expiration Warning: %d\n",
					spent.getDaysBeforeExpirationWarning());
	printf("	Days Of Inactivity Allowed: %d\n",
					spent.getDaysOfInactivityAllowed());
	printf("	Expiration Date: %d\n",
					spent.getExpirationDate());
	printf("	Flag: %d\n",spent.getFlag());
	printf("\n");

	// use the built in print method
	printf("Built In...\n");
	spent.print();
	printf("\n");
}