[5029] in Athena Bugs

home help back first fref pref prev next nref lref last post

vax 7.0E: quota

daemon@ATHENA.MIT.EDU (jnrees@ATHENA.MIT.EDU)
Fri Jun 1 17:38:10 1990

From: jnrees@ATHENA.MIT.EDU
To: bugs@ATHENA.MIT.EDU
Date: Fri, 01 Jun 90 17:37:53 EDT

System name:		E40-358D-1
Type and version:	CVAXSTAR 7.0E
Display type:		SM

What were you trying to do?
	Check the quota for a particular group on Jason (7.0E RT)

	jason# quota -g 16519

What's wrong:
	quota core-dumped.

What should have happened:
	quota should have informed me that the particular group was over
quota and that they had 6.2 days to get below quota.  It should not have 
core-dumped. 

Please describe any relevant documentation references:
	man quota

Diagnosis:
	If a particular group or user is over quota and the group is
not in /etc/group or the user is not in /etc/passwd then NULL is
dereferenced.  This bug once existed in two places in the code, and I
had already fixed one of these places, having forgotten that the bug
still lived in another place.

Who this bug will affect:
	If dialup is still losing users from /etc/passwd and
/etc/group while they are still logged in, then this bug could affect
them.  It may also affect users on privatized workstations which don't
have up-to-date /etc/group files.  It will also affect adminstrators
logged in as root on fileservers.  The bug will only cause quota to
bomb if the group or user in question is _over_ quota.

Recommendation:
	In my opinion, this bug does not constitute a 'show stopper'.
It might, however, be a good idea to have fixed versions of the
binaries available in the consult locker.

Diffs-for-those-who-are-interested:

***************
*** 302,308 ****
  {
    struct timeval tv;
    int i;
!   char buf[1024];
    char *id_name, *id_type;
    struct rcquota *rqp;

--- 309,315 ----
  {
    struct timeval tv;
    int i;
!   char buf[1024], idbuf[20];
    char *id_name, *id_type;
    struct rcquota *rqp;

***************
*** 313,322 ****

    for(i=0; i<qvp->rq_ngrps; i++){

!     id_name = (qvp->rq_group ?
!              getgrgid(qvp->gqr_rcquota[i].rq_id)->gr_name :
!              getpwuid(qvp->gqr_rcquota[i].rq_id)->pw_name);
!
      rqp = &(qvp->gqr_rcquota[i]);

      /* Correct for zero quotas... */
--- 320,342 ----

    for(i=0; i<qvp->rq_ngrps; i++){

!     if (qvp->rq_group){
!       if (getgrgid(qvp->gqr_rcquota[i].rq_id))
!         id_name = getgrgid(qvp->gqr_rcquota[i].rq_id)->gr_name;
!       else{
!         sprintf(idbuf, "#%d", qvp->gqr_rcquota[i].rq_id);
!         id_name = idbuf;
!       }
!       }
!     else{
!       if (getpwuid(qvp->gqr_rcquota[i].rq_id))
!       id_name = getpwuid(qvp->gqr_rcquota[i].rq_id)->pw_name;
!       else{
!       sprintf(idbuf, "#%d", qvp->gqr_rcquota[i].rq_id);
!       id_name = idbuf;
!       }
!     }
!
      rqp = &(qvp->gqr_rcquota[i]);

      /* Correct for zero quotas... */

home help back first fref pref prev next nref lref last post