Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – planix.SVN – Blame – /os/branches/feature-vt/sys/src/cmd/auth/userpasswd.c – Rev 2

Subversion Repositories planix.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#include <u.h>
2
#include <libc.h>
3
#include <auth.h>
4
 
5
void
6
usage(void)
7
{
8
	fprint(2, "usage: auth/userpasswd fmt\n");
9
	exits("usage");
10
}
11
 
12
void
13
main(int argc, char **argv)
14
{
15
	UserPasswd *up;
16
 
17
	ARGBEGIN{
18
	default:
19
		usage();
20
	}ARGEND
21
 
22
	if(argc != 1)
23
		usage();
24
 
25
	up = auth_getuserpasswd(auth_getkey, "proto=pass %s", argv[0]);
26
	if(up == nil)	/* bug in factotum, fixed but need to reboot servers -rsc, 2/10/2002 */
27
		up = auth_getuserpasswd(nil, "proto=pass %s", argv[0]);
28
	if(up == nil)
29
		sysfatal("getuserpasswd: %r");
30
 
31
	quotefmtinstall();
32
	print("%s\n%s\n", up->user, up->passwd);
33
	exits(0);
34
}