[5583] in Athena Bugs

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

important xlogin patch for 7.1

daemon@ATHENA.MIT.EDU (Jonathan I. Kamens)
Fri Jul 20 02:18:42 1990

Date: Fri, 20 Jul 90 02:17:54 -0400
From: "Jonathan I. Kamens" <jik@pit-manager.MIT.EDU>
To: bugs@ATHENA.MIT.EDU
In-Reply-To: bugs[5582]
Cc: release@ATHENA.MIT.EDU, rel-eng@ATHENA.MIT.EDU


  (NOTE: If you respond to this message, please don't leave the "bugs"
cc intact unless you *really* think it should go to bugs.)

  The referenced message in the bugs discuss meeting points out that
in release 7.0, if a user is over quota, he is not told this when
logging in.  The bug report is important correct.

  The cause of the problem is the bug in quota that causes it to dump
core if the user for whom it is trying to look up a quota is not in
the /etc/passwd file.  Xlogin doesn't add the user to the /etc/passwd
file until after it does the quota check, so quota dumps core instead
of reporting that the user is over quota.

  This will not happen in release 7.1, since the bug which causes
quota to dump core is fixed.  However, there is another problem --
since the user is not in the passwd file when his quota is checked,
the over quota message says that "User #XXXXX is over quota on...",
i.e. it shows the UID rather than the username.

  I do not think this is acceptable.... an over quota message is one
of the things that must be as unconfusing as possible to even the most
novice Athena users.  I therefore believe that the patch below, which
modifies xlogin to add the user to the passwd file *before* checking
his quota, should be installed for 7.1.

  jik

*** /tmp/,RCSt1005969	Fri Jul 20 02:11:58 1990
--- verify.c	Fri Jul 20 01:53:35 1990
***************
*** 341,346 ****
--- 341,353 ----
    }
  
  
+ #if defined(KERBEROS) && defined(HESIOD)
+   if ( !in_passwd_file ) {	/* Put entry in password file here. */
+     InsertPasswdEntry(p);
+     insertedp = p;
+   }
+ #endif /* KERBEROS && HESIOD */
+ 
  #ifdef ATTACH
    if (p->pw_uid != ROOT) {
      Debug("Attaching homdir");
***************
*** 376,381 ****
--- 383,393 ----
        free(krb_tkt_file);
      }
  
+ #ifdef HESIOD
+     RemovePwent(p);
+     insertedp = NULL;
+ #endif
+     
      return(FALSE);
    }
  #endif KERBEROS
***************
*** 384,397 ****
  #ifdef KERBEROS
    if (krb_tkt_file != NULL) 
    free(krb_tkt_file);
- 
- #ifdef HESIOD
-   if ( !in_passwd_file ) {	/* Put entry in password file here. */
-     InsertPasswdEntry(p);
-     insertedp = p;
-   }
- #endif HESIOD
- 
  #endif KERBEROS
  
  #ifdef ROOTLOG
--- 396,401 ----
***************
*** 915,930 ****
  		perror("Run_Quota: pipe");
  		return;
  	}
! 	
! 	if (!(pid = fork())) {
  		close(fds[0]);
  		dup2(fds[1], 1);
  		close(fds[1]);
  		if (setuid(p->pw_uid) < 0) {
! 		    fprintf(stderr, "Unable to setuid for quotacheck\n");
  		    exit(-1);
  		}
  		execl(QUOTA_COMMAND, QUOTA_COMMAND, 0);
  		exit (-1);
  	} 
  	close(fds[1]);
--- 919,942 ----
  		perror("Run_Quota: pipe");
  		return;
  	}
! 
! 	pid = fork();
! 	if (pid == -1) {
! 	    perror("forking to check quota");
! 	    return;
! 	}
! 	if (! pid) {
  		close(fds[0]);
  		dup2(fds[1], 1);
+ 		dup2(fds[1], 2);
  		close(fds[1]);
  		if (setuid(p->pw_uid) < 0) {
! 		    fprintf(stderr, "Unable to set UID to check quota.\n");
  		    exit(-1);
  		}
  		execl(QUOTA_COMMAND, QUOTA_COMMAND, 0);
+ 		fprintf(stderr,
+ 		     "Command to check quota did not execute successfully.\n");
  		exit (-1);
  	} 
  	close(fds[1]);
***************
*** 931,937 ****
  	if ((f = fdopen(fds[0], "r")) == NULL) {
  		perror("fdopen: to quota output");
  		return;
! 	} 
  	while (fgets(buff, sizeof(buff), f)) {
  		LoginMessage(buff);
  	}
--- 943,949 ----
  	if ((f = fdopen(fds[0], "r")) == NULL) {
  		perror("fdopen: to quota output");
  		return;
! 	}
  	while (fgets(buff, sizeof(buff), f)) {
  		LoginMessage(buff);
  	}

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