summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjkar8572 <jkar8572>2004-01-09 11:27:45 +0000
committerjkar8572 <jkar8572>2004-01-09 11:27:45 +0000
commit4a83cdf5b56528dddef46773d2540cc51ed45102 (patch)
tree27ca6f04383311fbe18a784066fdb1b7fae41d79
parentde63cc7548b8f9a53b17ebbdd6a5c077de926517 (diff)
downloadlinuxquota-4a83cdf5b56528dddef46773d2540cc51ed45102.tar.gz
Fixed bug in warnquota.conf parsing. (Jan Kara)
Reverted change in kernel detection via sysctl() - sysctl() obsoleted in 2.6 (Jan Kara)
-rw-r--r--Changelog1
-rw-r--r--quotasys.c5
-rw-r--r--warnquota.c11
3 files changed, 11 insertions, 6 deletions
diff --git a/Changelog b/Changelog
index dc9c107..d7ac286 100644
--- a/Changelog
+++ b/Changelog
@@ -10,6 +10,7 @@ Changes in quota-tools form 3.10 to 3.11
* warnquota(8) can avoid sending e-mail when user is over quota on mail partition (James Bourne)
* fixed bug in quotacheck(8) which counted directories twice sometimes (Jan Kara)
* edquota(8) now allows parameters in VISUAL/EDITOR env. params (Jan Kara)
+* reverted changes in detection of kernel from 3.10 - interface obsoleted in 2.6 kernel (Jan Kara)
Changes in quota-tools from 3.09 to 3.10
* alternative port can be specified to rpc.rquotad by -p option (Jan Kara)
diff --git a/quotasys.c b/quotasys.c
index 4e9a6ff..b0b24fb 100644
--- a/quotasys.c
+++ b/quotasys.c
@@ -21,7 +21,6 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/vfs.h>
-#include <sys/sysctl.h>
#include "pot.h"
#include "bylabel.h"
@@ -598,7 +597,6 @@ void init_kernel_interface(void)
{
struct stat st;
struct sigaction sig, oldsig;
- int ctlname[] = {CTL_FS, FS_DQSTATS, FS_DQ_SYNCS};
/* This signal handling is needed because old kernels send us SIGSEGV as they try to resolve the device */
sig.sa_handler = SIG_IGN;
@@ -615,7 +613,8 @@ void init_kernel_interface(void)
else
if (!quotactl(QCMD(Q_XGETQSTAT, 0), NULL, 0, NULL) || (errno != EINVAL && errno != ENOSYS))
kernel_formats |= (1 << QF_XFS);
- if (!sysctl(ctlname, sizeof(ctlname)/sizeof(int), NULL, NULL, NULL, 0)) {
+ /* Detect new kernel interface; Assume generic interface unless we can prove there is not one... */
+ if (!stat("/proc/sys/fs/quota", &st) || errno != ENOENT) {
kernel_iface = IFACE_GENERIC;
kernel_formats |= (1 << QF_VFSOLD) | (1 << QF_VFSV0);
}
diff --git a/warnquota.c b/warnquota.c
index 6a39ce1..b1a4eb7 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.18 2004/01/07 12:37:48 jkar8572 Exp $
+ * Version: $Id: warnquota.c,v 1.19 2004/01/09 11:27:45 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
@@ -244,12 +244,17 @@ int deliverable(struct dquot *dquot)
|| ((dquot->dq_dqb.dqb_bsoftlimit && toqb(dquot->dq_dqb.dqb_curspace) >= dquot->dq_dqb.dqb_bsoftlimit)
&& (dquot->dq_dqb.dqb_btime && dquot->dq_dqb.dqb_btime <= now))))
return 0;
+ if (!maildev_handle)
+ return 1;
mdquot = maildev_handle->qh_ops->read_dquot(maildev_handle, dquot->dq_id);
if (mdquot &&
((mdquot->dq_dqb.dqb_bhardlimit && toqb(mdquot->dq_dqb.dqb_curspace) >= mdquot->dq_dqb.dqb_bhardlimit)
|| ((mdquot->dq_dqb.dqb_bsoftlimit && toqb(mdquot->dq_dqb.dqb_curspace) >= mdquot->dq_dqb.dqb_bsoftlimit)
- && (mdquot->dq_dqb.dqb_btime && mdquot->dq_dqb.dqb_btime <= now))))
+ && (mdquot->dq_dqb.dqb_btime && mdquot->dq_dqb.dqb_btime <= now)))) {
+ free(mdquot);
return 0;
+ }
+ free(mdquot);
return 1;
}
@@ -659,7 +664,7 @@ int readconfigfile(const char *filename, struct configparams *config)
sstrncpy(config->support, value, CNF_BUFFER);
else if (!strcmp(var, "PHONE"))
sstrncpy(config->phone, value, CNF_BUFFER);
- else if (!strcmp(var, "MAILSERV")) {
+ else if (!strcmp(var, "MAILDEV")) {
/* set the global */
sstrncpy(maildev, value, CNF_BUFFER);
} else if (!strcmp(var, "MESSAGE")) {