summaryrefslogtreecommitdiff
path: root/quotaio_rpc.c
diff options
context:
space:
mode:
authorjkar8572 <jkar8572>2001-05-02 09:32:22 +0000
committerjkar8572 <jkar8572>2001-05-02 09:32:22 +0000
commit84ec12aa207cb8d5323b63847bfd8115881f2886 (patch)
tree9533951fedda68167081028741a9ec3fd8ad547b /quotaio_rpc.c
parent9c4a512419c660c0513db48e038169167e3e7d25 (diff)
downloadlinuxquota-84ec12aa207cb8d5323b63847bfd8115881f2886.tar.gz
Added mntopt.h to dependencies in Makefile.in.
Fixed MNTTYPE_REISER to proper string. sprintf->snprintf Merged Marco's patch with errstr(), configurable BSD behaviour Fixed bug in quota detection IO code now opens file only RO if possible. IO code now doesn't open file if not required. Fixed bug in quotaon. Updated all manpages.
Diffstat (limited to 'quotaio_rpc.c')
-rw-r--r--quotaio_rpc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/quotaio_rpc.c b/quotaio_rpc.c
index cbdfe8b..3482de8 100644
--- a/quotaio_rpc.c
+++ b/quotaio_rpc.c
@@ -6,9 +6,11 @@
#include <errno.h>
#include <sys/types.h>
+#include "common.h"
#include "quotaio.h"
#include "dqblk_rpc.h"
#include "rquota_client.h"
+#include "pot.h"
static struct dquot *rpc_read_dquot(struct quota_handle *h, qid_t id);
static int rpc_commit_dquot(struct dquot *dquot);
@@ -47,6 +49,11 @@ static struct dquot *rpc_read_dquot(struct quota_handle *h, qid_t id)
static int rpc_commit_dquot(struct dquot *dquot)
{
#ifdef RPC
+ if (QIO_RO(dquot->dq_h)) {
+ errstr(_("Trying to write quota to readonly quotafile on %s\n"), dquot->dq_h->qh_quotadev);
+ errno = EPERM;
+ return -1;
+ }
rpc_rquota_set(QCMD(Q_RPC_SETQUOTA, dquot->dq_h->qh_type), dquot);
return 0;
#else