[774] in testers
quota permission error
daemon@ATHENA.MIT.EDU (daemon@ATHENA.MIT.EDU)
Wed May 16 17:11:35 1990
From: jnrees@ATHENA.MIT.EDU
Date: Wed, 16 May 90 17:11:10 -0400
To: testers@ATHENA.MIT.EDU
Cc: jfc@ATHENA.MIT.EDU
Currently, rpc.rcquotad will return a Q_EPERM status if the user
sending the request has no NFS mapping on the server, whether or not
quotas are enabled on the mounted filesystem. On receiving this
status, quota prints out:
"quota permission error, host: %s\n"
which could be annoying to see for several servers which have been
attached -n, especially if you're not using the '-v' flag to quota.
So....
I've changed rpc.rcquotad so that it will only return Q_EPERM if there
is no NFS mapping _and_ the disk partition in question has quotas
turned on (this simply involved switching the order of those two
checks). I've also changed quota so that is message is somewhat more
meaningful, and maybe less distressing:
"Warning: no NFS mapping on host: %s\n"
It will only be printed if the -v option is in effect.
The new versions can be picked up in /mit/groupquota/src, or use the
diffs below:
For quota.c:
551c551,552
< fprintf(stderr, "quota permission error, host: %s\n", hostp);
---
> if (vflag)
> fprintf(stderr, "Warning: no NFS mapping on host: %s\n", hostp);
For rpc.rcquotad.c
129,133c129,130
< /* Authentication Scheme, if addr and uid are mapped here
< then we're all set. */
< if (nfsmapctl(3, &transp->xp_raddr, transp->xp_addrlen,
< gqa.gqa_uid, &cred) < 0){
< gqr.gqr_status = Q_EPERM;
---
> if (!(fsqp = findfsq(gqa.gqa_pathp))){
> gqr.gqr_status = Q_NOQUOTA;
134a132
> else
136,139c134,138
< else{
<
< if (!(fsqp = findfsq(gqa.gqa_pathp))){
< gqr.gqr_status = Q_NOQUOTA;
---
> /* Authentication Scheme, if addr and uid are mapped here
> then we're all set. */
> if (nfsmapctl(3, &transp->xp_raddr, transp->xp_addrlen,
> gqa.gqa_uid, &cred) < 0){
> gqr.gqr_status = Q_EPERM;
140a140
>
171d170
< }
236d234
< char qfilename[MAXPATHLEN];
244,246c242
< sprintf(qfilename, "%s/%s", mntp->mnt_dir, QFNAME);
< if (stat(qfilename, &sb) < 0)
< continue;
---
> continue;