diff options
author | jkar8572 <jkar8572> | 2003-10-12 11:42:37 +0000 |
---|---|---|
committer | jkar8572 <jkar8572> | 2003-10-12 11:42:37 +0000 |
commit | 200e51d314cac8ba6952c8fbd233d9b7666b90f9 (patch) | |
tree | ac4f4f7e0e02d15181b16c573ab2a052e910a2e4 | |
parent | d4ecf34de7e1e604497e5d4c75a9851ce07c0477 (diff) |
Updated changelog.
Fixed bug in parsing warnquota.conf.
-rw-r--r-- | Changelog | 2 | ||||
-rw-r--r-- | quotasys.c | 63 | ||||
-rw-r--r-- | warnquota.c | 4 |
3 files changed, 40 insertions, 29 deletions
@@ -1,4 +1,6 @@ Changes in quota-tools from 3.09 to 3.10 +* added option to warnquota(8) to surpress details of report (Marco van Wieringen) +* fixed problems with multiple lines values in warnquota(8) (F. Depke) * changed detection of kernel interface so that it works even without /proc (Jan Kara) * updated Polish messages (Jakub Bogusz) * updated quotactl(2) manpage (Jan Kara) @@ -579,42 +579,51 @@ void init_kernel_interface(void) die(2, _("Can't set signal handler: %s\n"), strerror(errno)); kernel_formats = 0; - if (!stat("/proc/fs/xfs/stat", &st) || quotactl(QCMD(Q_XGETQSTAT, 0), NULL, 0, NULL) != ENOSYS) + if (!stat("/proc/fs/xfs/stat", &st)) kernel_formats |= (1 << QF_XFS); - if (!stat("/proc/sys/fs/quota", &st) || quotactl(QCMD(Q_GETQUOTA, USRQUOTA), NULL, 0, NULL) != ENOSYS) { + else + if (!quotactl(QCMD(Q_XGETQSTAT, 0), NULL, 0, NULL) || (errno != EINVAL && errno != ENOSYS)) + kernel_formats |= (1 << QF_XFS); + if (!stat("/proc/sys/fs/quota", &st)) { kernel_iface = IFACE_GENERIC; kernel_formats |= (1 << QF_VFSOLD) | (1 << QF_VFSV0); } else { - struct v2_dqstats v2_stats; - - if (quotactl(QCMD(Q_V2_GETSTATS, 0), NULL, 0, (void *)&v2_stats) >= 0) { - kernel_formats |= (1 << QF_VFSV0); - kernel_iface = IFACE_VFSV0; + if (!quotactl(QCMD(Q_GETQUOTA, USRQUOTA), NULL, 0, NULL) || (errno != EINVAL && errno != ENOSYS)) { + kernel_iface = IFACE_GENERIC; + kernel_formats |= (1 << QF_VFSOLD) | (1 << QF_VFSV0); } - else if (errno != ENOSYS && errno != ENOTSUP) { - /* RedHat 7.1 (2.4.2-2) newquota check - * Q_V2_GETSTATS in it's old place, Q_GETQUOTA in the new place - * (they haven't moved Q_GETSTATS to its new value) */ - int err_stat = 0; - int err_quota = 0; - char tmp[1024]; /* Just temporary buffer */ - - if (quotactl(QCMD(Q_V1_GETSTATS, 0), NULL, 0, tmp)) - err_stat = errno; - if (quotactl(QCMD(Q_V1_GETQUOTA, 0), "/dev/null", 0, tmp)) - err_quota = errno; - - /* On a RedHat 2.4.2-2 we expect 0, EINVAL - * On a 2.4.x we expect 0, ENOENT - * On a 2.4.x-ac we wont get here */ - if (err_stat == 0 && err_quota == EINVAL) { + else { + struct v2_dqstats v2_stats; + + if (quotactl(QCMD(Q_V2_GETSTATS, 0), NULL, 0, (void *)&v2_stats) >= 0) { kernel_formats |= (1 << QF_VFSV0); kernel_iface = IFACE_VFSV0; } - else { - kernel_formats |= (1 << QF_VFSOLD); - kernel_iface = IFACE_VFSOLD; + else if (errno != ENOSYS && errno != ENOTSUP) { + /* RedHat 7.1 (2.4.2-2) newquota check + * Q_V2_GETSTATS in it's old place, Q_GETQUOTA in the new place + * (they haven't moved Q_GETSTATS to its new value) */ + int err_stat = 0; + int err_quota = 0; + char tmp[1024]; /* Just temporary buffer */ + + if (quotactl(QCMD(Q_V1_GETSTATS, 0), NULL, 0, tmp)) + err_stat = errno; + if (quotactl(QCMD(Q_V1_GETQUOTA, 0), "/dev/null", 0, tmp)) + err_quota = errno; + + /* On a RedHat 2.4.2-2 we expect 0, EINVAL + * On a 2.4.x we expect 0, ENOENT + * On a 2.4.x-ac we wont get here */ + if (err_stat == 0 && err_quota == EINVAL) { + kernel_formats |= (1 << QF_VFSV0); + kernel_iface = IFACE_VFSV0; + } + else { + kernel_formats |= (1 << QF_VFSOLD); + kernel_iface = IFACE_VFSOLD; + } } } } diff --git a/warnquota.c b/warnquota.c index 73c2050..bf365f7 100644 --- a/warnquota.c +++ b/warnquota.c @@ -10,7 +10,7 @@ * * Author: Marco van Wieringen <mvw@planets.elm.net> * - * Version: $Id: warnquota.c,v 1.14 2003/10/12 08:09:18 marcovw Exp $ + * Version: $Id: warnquota.c,v 1.15 2003/10/12 11:42:37 jkar8572 Exp $ * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -458,7 +458,7 @@ int readconfigfile(const char *filename, struct configparams *config) else { len--; if (buff[len-1] == '\\') { /* Should join with next line? */ - bufpos += len-1; + bufpos = len-1; continue; } } |