summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog2
-rw-r--r--quotasys.c13
-rw-r--r--warnquota.c4
3 files changed, 17 insertions, 2 deletions
diff --git a/Changelog b/Changelog
index 160ae01..aeb1124 100644
--- a/Changelog
+++ b/Changelog
@@ -5,6 +5,8 @@ Changes in quota-tools from 3.03 to 3.04
* make install now creates man directories (Jan Kara)
* added -q <quotatab> and -c <configfile> options to warnquota(8) (Jan Kara)
* added some notes about quotatab to warnquota manpage (Jan Kara)
+* fixed bug in options parsing of warnquota(8) (Michael Meskes)
+* Ignore automount mountpoints (Philippe Troin)
Changes in quota-tools from 3.02 to 3.03
diff --git a/quotasys.c b/quotasys.c
index dd12cf4..04288a7 100644
--- a/quotasys.c
+++ b/quotasys.c
@@ -16,6 +16,7 @@
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/vfs.h>
#include "pot.h"
#include "bylabel.h"
@@ -619,6 +620,7 @@ static int cache_mnt_table(void)
FILE *mntf;
struct mntent *mnt;
struct stat st;
+ struct statfs fsstat;
int allocated = 0, i = 0, flags;
dev_t dev = 0;
char mntpointbuf[PATH_MAX];
@@ -651,6 +653,17 @@ static int cache_mnt_table(void)
free((char *)devname);
continue;
}
+ if (statfs(mntpointbuf, &fsstat) != 0) {
+ errstr(_("Can't statfs() %s: %s\n"), mntpointbuf, strerror(errno));
+ free((char *)devname);
+ continue;
+ }
+ /* Do not scan quotas on "magic" automount points */
+ if (fsstat.f_blocks == 0 && fsstat.f_bfree == 0 && fsstat.f_bavail == 0) {
+ free((char *)devname);
+ continue;
+ }
+
flags = 0;
if (strcmp(mnt->mnt_type, MNTTYPE_NFS)) {
if (stat(devname, &st) < 0) { /* Can't stat mounted device? */
diff --git a/warnquota.c b/warnquota.c
index 43e47a1..530889d 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.8 2002/02/22 14:58:32 jkar8572 Exp $
+ * Version: $Id: warnquota.c,v 1.9 2002/02/25 11:26:16 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
@@ -468,7 +468,7 @@ static void parse_options(int argcnt, char **argstr)
{
int ret;
- while ((ret = getopt(argcnt, argstr, "VF:hc:q:"))) {
+ while ((ret = getopt(argcnt, argstr, "VF:hc:q:")) != -1) {
switch (ret) {
case '?':
case 'h':