cwfs: cleanup

This commit is contained in:
cinap_lenrek 2011-05-01 07:41:21 +00:00
parent db7290d79e
commit 09a848d825
3 changed files with 12 additions and 7 deletions

View file

@ -242,7 +242,7 @@ authorize(Chan* chan, Fcall* f)
}
/* fake read to get auth info */
authread(chan, af, nil, 0);
authread(af, nil, 0);
uid = af->uid;
if(db)
print("authorize: uid is %d\n", uid);
@ -283,6 +283,7 @@ attach(Chan* chan, Fcall* f, Fcall* r)
error = Ebadu;
goto out;
}
chan->err[0] = 0;
}
file->uid = u;
@ -1001,7 +1002,7 @@ fs_read(Chan* chan, Fcall* f, Fcall* r, uchar* data)
goto out;
}
if(file->qid.type & QTAUTH){
nread = authread(chan, file, (uchar*)data, count);
nread = authread(file, (uchar*)data, count);
if(nread < 0)
error = Eauth2;
goto out;
@ -1198,7 +1199,7 @@ fs_write(Chan* chan, Fcall* f, Fcall* r)
}
if(file->qid.type & QTAUTH){
nwrite = authwrite(chan, file, (uchar*)f->data, count);
nwrite = authwrite(file, (uchar*)f->data, count);
if(nwrite < 0)
error = Eauth2;
goto out;

View file

@ -119,11 +119,13 @@ authfree(void *auth)
}
int
authread(Chan *chan, File *file, uchar *data, int count)
authread(File *file, uchar *data, int count)
{
AuthInfo *ai;
AuthRpc *rpc;
Chan *chan;
chan = file->cp;
if((rpc = file->auth) == nil){
snprint(chan->err, sizeof(chan->err),
"not an auth fid");
@ -162,10 +164,12 @@ authread(Chan *chan, File *file, uchar *data, int count)
}
int
authwrite(Chan *chan, File *file, uchar *data, int count)
authwrite(File *file, uchar *data, int count)
{
AuthRpc *rpc;
Chan *chan;
chan = file->cp;
if((rpc = file->auth) == nil){
snprint(chan->err, sizeof(chan->err),
"not an auth fid");

View file

@ -4,8 +4,8 @@ void arpstart(void);
void arginit(void);
void* authnew(void);
void authfree(void*);
int authread(Chan*, File*, uchar*, int);
int authwrite(Chan*, File*, uchar*, int);
int authread(File*, uchar*, int);
int authwrite(File*, uchar*, int);
void cdiag(char*, int);
int cnumb(void);
Device* config(void);