#include <9pm/u.h>
#include <9pm/libc.h>
#include <9pm/auth.h>
#include "authlocal.h"

int
amount(int fd, char *mntpt, int flags, char *aname)
{
	int afd;
	AuthInfo *ai;

	afd = fauth(fd, aname);
	if(afd >= 0){
		ai = auth_proxy(afd, amount_getkey, "proto=p9any role=client");
		if(ai != nil)
			auth_freeAI(ai);
	}
	return mount(fd, afd, mntpt, flags, aname);
}
