summaryrefslogtreecommitdiff
path: root/quotasys.c
diff options
context:
space:
mode:
authorjkar8572 <jkar8572>2002-02-25 11:26:16 +0000
committerjkar8572 <jkar8572>2002-02-25 11:26:16 +0000
commit5d3392cbdbb422993125b5aa8a8de402fcbc4b04 (patch)
tree3ed3d0cbab3b3868003d8c8ba68ff7c4be7bbcd3 /quotasys.c
parent207d40e53c0ca06bf484b8975ba95f83656ad086 (diff)
Fixed bug in warnquota option parsing (Michael Meskes)
Quota-tools now ignore automount mountpoints (Phillippe Troin)
Diffstat (limited to 'quotasys.c')
-rw-r--r--quotasys.c13
1 files changed, 13 insertions, 0 deletions
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? */