Module Name: src
Committed By: tls
Date: Sun Aug 10 06:52:15 UTC 2014
Modified Files:
src/lib/libquota [tls-earlyentropy]: quota_kernel.c quota_nfs.c
Log Message:
Rebase.
To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.18.1 src/lib/libquota/quota_kernel.c
cvs rdiff -u -r1.2 -r1.2.18.1 src/lib/libquota/quota_nfs.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libquota/quota_kernel.c
diff -u src/lib/libquota/quota_kernel.c:1.4 src/lib/libquota/quota_kernel.c:1.4.18.1
--- src/lib/libquota/quota_kernel.c:1.4 Wed Feb 1 06:19:05 2012
+++ src/lib/libquota/quota_kernel.c Sun Aug 10 06:52:15 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: quota_kernel.c,v 1.4 2012/02/01 06:19:05 dholland Exp $ */
+/* $NetBSD: quota_kernel.c,v 1.4.18.1 2014/08/10 06:52:15 tls Exp $ */
/*-
* Copyright (c) 2012 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: quota_kernel.c,v 1.4 2012/02/01 06:19:05 dholland Exp $");
+__RCSID("$NetBSD: quota_kernel.c,v 1.4.18.1 2014/08/10 06:52:15 tls Exp $");
#include <stdlib.h>
#include <err.h>
@@ -220,8 +220,8 @@ __quota_kernel_delete(struct quotahandle
{
struct quotactl_args args;
- args.qc_op = QUOTACTL_DELETE;
- args.u.delete.qc_key = qk;
+ args.qc_op = QUOTACTL_DEL;
+ args.u.del.qc_key = qk;
return __quotactl(qh->qh_mountpoint, &args);
}
Index: src/lib/libquota/quota_nfs.c
diff -u src/lib/libquota/quota_nfs.c:1.2 src/lib/libquota/quota_nfs.c:1.2.18.1
--- src/lib/libquota/quota_nfs.c:1.2 Mon Jan 30 06:39:26 2012
+++ src/lib/libquota/quota_nfs.c Sun Aug 10 06:52:15 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: quota_nfs.c,v 1.2 2012/01/30 06:39:26 dholland Exp $ */
+/* $NetBSD: quota_nfs.c,v 1.2.18.1 2014/08/10 06:52:15 tls Exp $ */
/*-
* Copyright (c) 2011 Manuel Bouyer
* All rights reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: quota_nfs.c,v 1.2 2012/01/30 06:39:26 dholland Exp $");
+__RCSID("$NetBSD: quota_nfs.c,v 1.2.18.1 2014/08/10 06:52:15 tls Exp $");
#include <sys/types.h>
#include <sys/param.h> /* XXX for DEV_BSIZE */
@@ -191,6 +191,20 @@ __quota_nfs_get(struct quotahandle *qh,
free(host);
if (ret != RPC_SUCCESS) {
+ /*
+ * Remap some error codes for callers convenience:
+ * - if the file server does not support any quotas at all,
+ * return ENOENT
+ * - if the server can not be reached something is very
+ * wrong - or we are run inside a virtual rump network
+ * but querying an NFS mount from the host. Make sure
+ * to fail silently and return ENOENT as well.
+ */
+ if (ret == RPC_SYSTEMERROR
+ && rpc_createerr.cf_error.re_errno == EHOSTUNREACH)
+ sverrno = ENOENT;
+ else if (sverrno == ENOTCONN)
+ sverrno = ENOENT;
errno = sverrno;
return -1;
}