Skip to content
Browse files

Return ENOENT to TAUTH if auth not required.

Returning ecode=0 causes some problems for kernel generic
p9 rpc code.
  • Loading branch information...
1 parent 398c816 commit 9220ecd221b4006f3f48613b9c59904fe8bbea5e @garlick garlick committed Jul 10, 2012
Showing with 3 additions and 1 deletion.
  1. +2 −0 libnpclient/mount.c
  2. +1 −1 libnpfs/fcall.c
View
2 libnpclient/mount.c
@@ -103,6 +103,8 @@ npc_auth (Npcfsys *fs, char *aname, u32 uid, AuthFun auth)
if (afid->fsys->rpc (afid->fsys, tc, &rc) < 0) {
npc_fid_free (afid);
afid = NULL;
+ if (np_rerror() == 0 || np_rerror() == ENOENT)
+ np_uerror(0); /* auth not required */
goto done;
}
if (auth && auth (afid, uid) < 0) {
View
2 libnpfs/fcall.c
@@ -100,7 +100,7 @@ np_auth(Npreq *req, Npfcall *tc)
tc->u.tauth.aname.len, tc->u.tauth.aname.str);
}
if (!auth_required) {
- if (!(rc = np_create_rlerror(0))) {
+ if (!(rc = np_create_rlerror(ENOENT))) {
np_uerror(ENOMEM);
np_logerr (srv, "%s: creating response", a);
}

0 comments on commit 9220ecd

Please sign in to comment.
Something went wrong with that request. Please try again.