Plan 9 from Bell Labs’s /usr/web/sources/contrib/fgb/cmd/getpass.c

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#include <u.h>
#include <libc.h>
#include <auth.h>

void
main(int argc, char *argv[])
{
	UserPasswd *up;

	ARGBEGIN{
	}ARGEND

	if(argc != 2){
		fprint(2, "usage: aux/getpass service dom\n");
		exits("usage");
	}

	up=auth_getuserpasswd(auth_getkey, "proto=pass service=%s server=%q", argv[0], argv[1]);
	if(up == nil)
		sysfatal("factotum cannot get key %r");

	print("%s %s\n", up->user, up->passwd);
	exits(nil);
}

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].