]> git.lizzy.rs Git - plan9front.git/blob - sys/src/libauth/amount.c
Import sources from 2011-03-30 iso image - lib
[plan9front.git] / sys / src / libauth / amount.c
1 #include <u.h>
2 #include <libc.h>
3 #include <auth.h>
4 #include "authlocal.h"
5
6 int
7 amount(int fd, char *mntpt, int flags, char *aname)
8 {
9         int rv, afd;
10         AuthInfo *ai;
11
12         afd = fauth(fd, aname);
13         if(afd >= 0){
14                 ai = auth_proxy(afd, amount_getkey, "proto=p9any role=client");
15                 if(ai != nil)
16                         auth_freeAI(ai);
17         }
18         rv = mount(fd, afd, mntpt, flags, aname);
19         if(afd >= 0)
20                 close(afd);
21         return rv;
22 }