plan9port/src/libauth/nsamount.c
Dan Cross fa325e9b42 Trivial changes: whitespace and modes.
Remote whitespace at the ends of lines.
Remove blank lines from the ends of files.
Change modes on source files so that they
are not executable.

Signed-off-by: Dan Cross <cross@gajendra.net>
2020-01-10 14:54:30 +00:00

33 lines
579 B
C

#include <u.h>
#include <libc.h>
#include <auth.h>
#include <thread.h>
#include <9pclient.h>
#include "authlocal.h"
CFsys*
nsamount(char *name, char *aname)
{
CFid *afid, *fid;
AuthInfo *ai;
CFsys *fs;
fs = nsinit(name);
if(fs == nil)
return nil;
if((afid = fsauth(fs, getuser(), aname)) == nil)
goto noauth;
ai = fsauth_proxy(afid, amount_getkey, "proto=p9any role=client");
if(ai != nil)
auth_freeAI(ai);
noauth:
fid = fsattach(fs, afid, getuser(), aname);
fsclose(afid);
if(fid == nil){
_fsunmount(fs);
return nil;
}
fssetroot(fs, fid);
return fs;
}