summaryrefslogtreecommitdiffstats
path: root/usr.bin/quota
diff options
context:
space:
mode:
authoriedowse <iedowse@FreeBSD.org>2002-06-03 12:06:49 +0000
committeriedowse <iedowse@FreeBSD.org>2002-06-03 12:06:49 +0000
commit19859b2689ca07a4f63452b4ca34eb8f43d2b13d (patch)
treef4a9bd2ac6f941dfb537e5311186d83a6b614aaa /usr.bin/quota
parentc76b7b05b987d9699eb2f8960162cf19b08b1f61 (diff)
downloadFreeBSD-src-19859b2689ca07a4f63452b4ca34eb8f43d2b13d.zip
FreeBSD-src-19859b2689ca07a4f63452b4ca34eb8f43d2b13d.tar.gz
Call getmntinfo with MNT_NOWAIT to avoid hanging if any NFS servers
are down. Avoid trying to send RPCs to the pidXXX@machine names used in the special amd(8) mounts. PR: bin/6183 Submitted by: Petr Lampa <lampa@fee.vutbr.cz>
Diffstat (limited to 'usr.bin/quota')
-rw-r--r--usr.bin/quota/quota.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.bin/quota/quota.c b/usr.bin/quota/quota.c
index 046179e..342bdad 100644
--- a/usr.bin/quota/quota.c
+++ b/usr.bin/quota/quota.c
@@ -449,7 +449,7 @@ getprivs(long id, int quotatype)
qup = quphead = (struct quotause *)0;
- nfst = getmntinfo(&fst, MNT_WAIT);
+ nfst = getmntinfo(&fst, MNT_NOWAIT);
if (nfst == 0)
errx(2, "no filesystems mounted!");
setfsent();
@@ -597,6 +597,13 @@ getnfsquota(struct statfs *fst, struct quotause *qup, long id, int quotatype)
return (0);
}
+ /* Avoid attempting the RPC for special amd(8) filesystems. */
+ if (strncmp(fst->f_mntfromname, "pid", 3) == 0 &&
+ strchr(fst->f_mntfromname, '@') != NULL) {
+ *cp = ':';
+ return (0);
+ }
+
gq_args.gqa_pathp = cp + 1;
gq_args.gqa_uid = id;
if (callaurpc(fst->f_mntfromname, RQUOTAPROG, RQUOTAVERS,
OpenPOWER on IntegriCloud