Date: Fri, 16 Nov 2001 16:00:02 -0800 (PST) From: Ian Dowse <iedowse@maths.tcd.ie> To: freebsd-bugs@FreeBSD.org Subject: Re: misc/15658: edquota misinterprets usernames as uid ranges Message-ID: <200111170000.fAH002Z19736@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR misc/15658; it has been noted by GNATS.
From: Ian Dowse <iedowse@maths.tcd.ie>
To: forrestc@imach.com
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: misc/15658: edquota misinterprets usernames as uid ranges
Date: Fri, 16 Nov 2001 23:52:29 +0000
Hi, could you try the following patch to edquota instead? It looks
as if this will also fix a bug where the code forgets to increment
argv in the -p case.
Ian
Index: edquota.c
===================================================================
RCS file: /dump/FreeBSD-CVS/src/usr.sbin/edquota/edquota.c,v
retrieving revision 1.13
diff -u -r1.13 edquota.c
--- edquota.c 28 Sep 2001 10:22:36 -0000 1.13
+++ edquota.c 16 Nov 2001 23:39:07 -0000
@@ -149,8 +149,8 @@
qup->dqblk.dqb_btime = 0;
qup->dqblk.dqb_itime = 0;
}
- while (argc-- > 0) {
- if (isdigit(*argv[0]) &&
+ for (; argc-- > 0; argv++) {
+ if (strspn(*argv, "0123456789-") == strlen(*argv) &&
(cp = strchr(*argv, '-')) != NULL) {
*cp++ = '\0';
startuid = atoi(*argv);
@@ -168,7 +168,7 @@
}
continue;
}
- if ((id = getentry(*argv++, quotatype)) < 0)
+ if ((id = getentry(*argv, quotatype)) < 0)
continue;
putprivs(id, quotatype, protoprivs);
}
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200111170000.fAH002Z19736>
