🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.ibm.pc.rt
Article #150

Patch for quota related utilities

#150
From: brunner
Date: Fri, 21 Jul 1989 18:26
216 lines
7741 bytes
Subject: File System Quotas
Index: /etc/*quot*.c IBM/4.3

Description:
	There's a consistency problem with AOS 4.3BSD systems involving
	Melbourne file system quota utilities which check a file system's
	type. As distributed, quota utilities would exit if the mounted
	file system's type was not either "4.3" or "4.2", depending on
	the utility, and would always exit if the type was "ufs".
Fix:
	Apply the attached patchs.


*** edquota.c	Thu Jun  8 14:24:38 1989
--- edquota.c.new	Thu Jun  8 14:24:11 1989
***************
*** 877,883 ****
  
  	mtab = setmntent(MOUNTED, "r");
  	while (mntp = getmntent(mtab)) {
! 		if (strcmp(mntp->mnt_type, MNTTYPE_43) != 0)
  			continue;
  		if (stat(mntp->mnt_fsname, &statb) < 0)
  			continue;
--- 877,885 ----
  
  	mtab = setmntent(MOUNTED, "r");
  	while (mntp = getmntent(mtab)) {
! 		if ((   (strcmp(mntp->mnt_type, MNTTYPE_42) != 0) &&
! 			(strcmp(mntp->mnt_type, MNTTYPE_43) != 0) &&
! 			(strcmp(mntp->mnt_type, MNTTYPE_UFS) != 0)   ))
  			continue;
  		if (stat(mntp->mnt_fsname, &statb) < 0)
  			continue;
*** quot.c	Thu Jun  8 14:28:58 1989
--- quot.c.new	Wed Jun  7 16:39:14 1989
***************
*** 190,196 ****
  		exit(1);
  	}
  	while (mntp = getmntent(fstab)) {
! 		if (strcmp(mntp->mnt_type, MNTTYPE_43) != 0)
  			continue;
  		cp = rindex(mntp->mnt_fsname, '/');
  		if (cp == 0)
--- 190,198 ----
  		exit(1);
  	}
  	while (mntp = getmntent(fstab)) {
! 		if ((   (strcmp(mntp->mnt_type, MNTTYPE_42) != 0) &&
! 			(strcmp(mntp->mnt_type, MNTTYPE_43) != 0) &&
! 			(strcmp(mntp->mnt_type, MNTTYPE_UFS) != 0)   ))
  			continue;
  		cp = rindex(mntp->mnt_fsname, '/');
  		if (cp == 0)
***************
*** 544,550 ****
  	}
  	while (mntp = getmntent(fstab)) {
  		if (strcmp(mntp->mnt_dir, *devpp) == 0) {
! 			if (strcmp(mntp->mnt_type, MNTTYPE_43) != 0) {
  				fprintf(stderr,
  				    "%s: %s not 4.3 filesystem\n",
  				    progname, *devpp);
--- 546,554 ----
  	}
  	while (mntp = getmntent(fstab)) {
  		if (strcmp(mntp->mnt_dir, *devpp) == 0) {
! 			if ((   (strcmp(mntp->mnt_type, MNTTYPE_42) != 0) &&
! 				(strcmp(mntp->mnt_type, MNTTYPE_43) != 0) &&
! 				(strcmp(mntp->mnt_type, MNTTYPE_UFS) != 0) )) {
  				fprintf(stderr,
  				    "%s: %s not 4.3 filesystem\n",
  				    progname, *devpp);
*** quotacheck.c	Thu Jun  8 14:33:14 1989
--- quotacheck.c.new	Wed Jun  7 17:08:23 1989
***************
*** 599,605 ****
  			exit(8);
  		}
  		while (mntp = getmntent(fstab)) {
! 			if (strcmp(mntp->mnt_type, MNTTYPE_43) != 0 ||
  			    !hasmntopt(mntp, MNTOPT_QUOTA) ||
  			    hasmntopt(mntp, MNTOPT_RO))
  				continue;
--- 599,607 ----
  			exit(8);
  		}
  		while (mntp = getmntent(fstab)) {
! 			if (((strcmp(mntp->mnt_type, MNTTYPE_42) != 0) &&
! 				(strcmp(mntp->mnt_type, MNTTYPE_43) != 0) &&
! 				(strcmp(mntp->mnt_type, MNTTYPE_UFS) != 0)) ||
  			    !hasmntopt(mntp, MNTOPT_QUOTA) ||
  			    hasmntopt(mntp, MNTOPT_RO))
  				continue;
***************
*** 624,630 ****
  			exit(8);
  		}
  		while (mntp = getmntent(mtab)) {
! 			if (strcmp(mntp->mnt_type, MNTTYPE_43) == 0 &&
  			    !hasmntopt(mntp, MNTOPT_RO) &&
  			    (oneof(mntp->mnt_fsname, listp, listcnt) ||
  			     oneof(mntp->mnt_dir, listp, listcnt)) ) {
--- 626,634 ----
  			exit(8);
  		}
  		while (mntp = getmntent(mtab)) {
! 			if (((strcmp(mntp->mnt_type, MNTTYPE_42) != 0) &&
! 				(strcmp(mntp->mnt_type, MNTTYPE_43) != 0) &&
! 				(strcmp(mntp->mnt_type, MNTTYPE_UFS) != 0)) &&
  			    !hasmntopt(mntp, MNTOPT_RO) &&
  			    (oneof(mntp->mnt_fsname, listp, listcnt) ||
  			     oneof(mntp->mnt_dir, listp, listcnt)) ) {
***************
*** 673,679 ****
  			if (mntp->mnt_passno != passno)
  				continue;
  
! 			if (strcmp(mntp->mnt_type, MNTTYPE_43) != 0 ||
  			    hasmntopt(mntp, MNTOPT_RO) ||
  			    (!oneof(mntp->mnt_fsname, listp, listcnt) &&
  			     !oneof(mntp->mnt_dir, listp, listcnt)))
--- 677,685 ----
  			if (mntp->mnt_passno != passno)
  				continue;
  
! 			if (((strcmp(mntp->mnt_type, MNTTYPE_42) != 0) &&
! 				(strcmp(mntp->mnt_type, MNTTYPE_43) != 0) &&
! 				(strcmp(mntp->mnt_type, MNTTYPE_UFS) != 0)) ||
  			    hasmntopt(mntp, MNTOPT_RO) ||
  			    (!oneof(mntp->mnt_fsname, listp, listcnt) &&
  			     !oneof(mntp->mnt_dir, listp, listcnt)))
*** quotaon.c	Thu Jun  8 14:40:53 1989
--- quotaon.c.new	Thu Jun  8 14:40:14 1989
***************
*** 298,304 ****
  		listcnt = 0;
  		fstab = setmntent(MNTTAB, "r");
  		while (mntp = getmntent(fstab)) {
! 			if (strcmp(mntp->mnt_type, MNTTYPE_43) != 0 ||
  			    !hasmntopt(mntp, MNTOPT_QUOTA) ||
  			    hasmntopt(mntp, MNTOPT_RO))
  				continue;
--- 298,306 ----
  		listcnt = 0;
  		fstab = setmntent(MNTTAB, "r");
  		while (mntp = getmntent(fstab)) {
! 			if ((   (strcmp(mntp->mnt_type, MNTTYPE_42) != 0) &&
! 				(strcmp(mntp->mnt_type, MNTTYPE_43) != 0) &&
! 				(strcmp(mntp->mnt_type, MNTTYPE_UFS) != 0)) ||
  			    !hasmntopt(mntp, MNTOPT_QUOTA) ||
  			    hasmntopt(mntp, MNTOPT_RO))
  				continue;
***************
*** 340,346 ****
  	 * record before writing it.
  	 */
  	while ((mntp = getmntent(mtab)) != NULL) {
! 		if (strcmp(mntp->mnt_type, MNTTYPE_43) == 0 &&
  		    !hasmntopt(mntp, MNTOPT_RO) &&
  		    (oneof(mntp->mnt_fsname, listp, listcnt) ||
  		     oneof(mntp->mnt_dir, listp, listcnt)) ) {
--- 342,350 ----
  	 * record before writing it.
  	 */
  	while ((mntp = getmntent(mtab)) != NULL) {
! 		if ((   (strcmp(mntp->mnt_type, MNTTYPE_42) != 0) &&
! 			(strcmp(mntp->mnt_type, MNTTYPE_43) != 0) &&
! 			(strcmp(mntp->mnt_type, MNTTYPE_UFS) != 0)) ||
  		    !hasmntopt(mntp, MNTOPT_RO) &&
  		    (oneof(mntp->mnt_fsname, listp, listcnt) ||
  		     oneof(mntp->mnt_dir, listp, listcnt)) ) {
*** repquota.c	Thu Jun  8 14:46:01 1989
--- repquota.c.new	Thu Jun  8 14:45:43 1989
***************
*** 351,357 ****
  			exit(8);
  		}
  		while (mntp = getmntent(fstab)) {
! 			if (strcmp(mntp->mnt_type, MNTTYPE_42) != 0 ||
  			    !hasmntopt(mntp, MNTOPT_QUOTA) ||
  			    hasmntopt(mntp, MNTOPT_RO))
  				continue;
--- 351,359 ----
  			exit(8);
  		}
  		while (mntp = getmntent(fstab)) {
! 			if ((   (strcmp(mntp->mnt_type, MNTTYPE_42) != 0) &&
! 				(strcmp(mntp->mnt_type, MNTTYPE_43) != 0) &&
! 				(strcmp(mntp->mnt_type, MNTTYPE_UFS) != 0)) ||
  			    !hasmntopt(mntp, MNTOPT_QUOTA) ||
  			    hasmntopt(mntp, MNTOPT_RO))
  				continue;
***************
*** 373,379 ****
  		exit(8);
  	}
  	while (mntp = getmntent(mtab)) {
! 		if (strcmp(mntp->mnt_type, MNTTYPE_42) == 0 &&
  		    !hasmntopt(mntp, MNTOPT_RO) &&
  		    (oneof(mntp->mnt_fsname, listp, listcnt) ||
  		     oneof(mntp->mnt_dir, listp, listcnt)) ) {
--- 375,383 ----
  		exit(8);
  	}
  	while (mntp = getmntent(mtab)) {
! 		if ((   (strcmp(mntp->mnt_type, MNTTYPE_42) != 0) &&
! 			(strcmp(mntp->mnt_type, MNTTYPE_43) != 0) &&
! 			(strcmp(mntp->mnt_type, MNTTYPE_UFS) != 0)) ||
  		    !hasmntopt(mntp, MNTOPT_RO) &&
  		    (oneof(mntp->mnt_fsname, listp, listcnt) ||
  		     oneof(mntp->mnt_dir, listp, listcnt)) ) {

Eric Brunner
uunet!ibmsupt!brunner
Technical Details
Message-ID: <1496@ibmpa.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!ucsd!usc!cs.utexas.edu!uunet!ibmpa!bullhead!brunner
References: <1494@ibmpa.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!ucsd!usc!cs.utexas.edu!uunet!ibmpa!bullhead!brunner
From: brunner@bullhead.uucp
Newsgroups: comp.sys.ibm.pc.rt
Subject: Patch for quota related utilities
Summary: Fixes inconsistency in quota utilities
Keywords: V1.4 quotas Melbourne
Message-ID: <1496@ibmpa.UUCP>
Date: 21 Jul 89 18:26:19 GMT
References: <1494@ibmpa.UUCP>
Sender: news@ibmpa.UUCP
Reply-To: brunner@ibmsupt.UUCP ()
Organization: IBM AWD Palo Alto
Lines: 216