Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-4]: src/usr.sbin/edquota Pull up revision 1.19 (requested by bo...



details:   https://anonhg.NetBSD.org/src/rev/d885adee47ec
branches:  netbsd-1-4
changeset: 469876:d885adee47ec
user:      he <he%NetBSD.org@localhost>
date:      Thu Dec 16 23:55:37 1999 +0000

description:
Pull up revision 1.19 (requested by bouyer):
  Allow use of quotas bigger than 4GB by avoiding integer overflow.

diffstat:

 usr.sbin/edquota/edquota.c |  17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diffs (41 lines):

diff -r 1f50a963a24d -r d885adee47ec usr.sbin/edquota/edquota.c
--- a/usr.sbin/edquota/edquota.c        Thu Dec 16 23:54:46 1999 +0000
+++ b/usr.sbin/edquota/edquota.c        Thu Dec 16 23:55:37 1999 +0000
@@ -44,7 +44,7 @@
 #if 0
 static char sccsid[] = "from: @(#)edquota.c    8.3 (Berkeley) 4/27/95";
 #else
-__RCSID("$NetBSD: edquota.c,v 1.17 1998/03/30 03:33:05 mrg Exp $");
+__RCSID("$NetBSD: edquota.c,v 1.17.2.1 1999/12/16 23:55:37 he Exp $");
 #endif
 #endif /* not lint */
 
@@ -405,9 +405,9 @@
        for (qup = quplist; qup; qup = qup->next) {
                fprintf(fd, "%s: %s %d, limits (soft = %d, hard = %d)\n",
                    qup->fsname, "blocks in use:",
-                   dbtob(qup->dqblk.dqb_curblocks) / 1024,
-                   dbtob(qup->dqblk.dqb_bsoftlimit) / 1024,
-                   dbtob(qup->dqblk.dqb_bhardlimit) / 1024);
+                   (int)(dbtob((u_quad_t)qup->dqblk.dqb_curblocks) / 1024),
+                   (int)(dbtob((u_quad_t)qup->dqblk.dqb_bsoftlimit) / 1024),
+                   (int)(dbtob((u_quad_t)qup->dqblk.dqb_bhardlimit) / 1024));
                fprintf(fd, "%s %d, limits (soft = %d, hard = %d)\n",
                    "\tinodes in use:", qup->dqblk.dqb_curinodes,
                    qup->dqblk.dqb_isoftlimit, qup->dqblk.dqb_ihardlimit);
@@ -460,9 +460,12 @@
                        warnx("%s:%s: bad format", fsp, cp);
                        return (0);
                }
-               dqblk.dqb_curblocks = btodb(dqblk.dqb_curblocks * 1024);
-               dqblk.dqb_bsoftlimit = btodb(dqblk.dqb_bsoftlimit * 1024);
-               dqblk.dqb_bhardlimit = btodb(dqblk.dqb_bhardlimit * 1024);
+               dqblk.dqb_curblocks = btodb((u_quad_t)
+                   dqblk.dqb_curblocks * 1024);
+               dqblk.dqb_bsoftlimit = btodb((u_quad_t)
+                   dqblk.dqb_bsoftlimit * 1024);
+               dqblk.dqb_bhardlimit = btodb((u_quad_t)
+                   dqblk.dqb_bhardlimit * 1024);
                if ((cp = strtok(line2, "\n")) == NULL) {
                        warnx("%s: %s: bad format", fsp, line2);
                        return (0);



Home | Main Index | Thread Index | Old Index