Blob
1 #include <u.h>2 #include <libc.h>3 #include <auth.h>5 void6 usage(void)7 {8 fprint(2, "usage: auth/userpasswd fmt\n");9 exits("usage");10 }12 void13 main(int argc, char **argv)14 {15 UserPasswd *up;17 ARGBEGIN{18 default:19 usage();20 }ARGEND22 if(argc != 1)23 usage();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");31 quotefmtinstall();32 print("%s\n%s\n", up->user, up->passwd);33 exits(0);34 }