Plan 9 from Bell Labs’s /usr/web/sources/contrib/quanstro/root/sys/src/cmd/auth/factotum/pass.c

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


/*
 * This is just a repository for a password.
 * We don't want to encourage this, there's
 * no server side.
 *
 * Client:
 *	start proto=pass ...
 *	read password
 */

#include "std.h"
#include "dat.h"

static int
passproto(Conv *c)
{
	Key *k;

	k = keyfetch(c, "%A", c->attr);
	if(k == nil)
		return -1;
	c->state = "write";
	convprint(c, "%q %q", 
		strfindattr(k->attr, "user"),
		strfindattr(k->privattr, "!password"));
	return 0;
}

static Role passroles[] = {
	"client",	passproto,
	0
};

Proto pass =
{
	"pass",
	passroles,
	"user? !password?",
	nil,
	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 webmaster@9p.io.