summaryrefslogtreecommitdiff
path: root/edquota.c
diff options
context:
space:
mode:
Diffstat (limited to 'edquota.c')
-rw-r--r--edquota.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/edquota.c b/edquota.c
index ef9fc9b..f433417 100644
--- a/edquota.c
+++ b/edquota.c
@@ -333,7 +333,11 @@ int main(int argc, char **argv)
continue;
}
close(tmpfd);
- if ((tmpfd = open(tmpfil, O_RDONLY)) < 0)
+ /*
+ * Open in rw mode because we can reuse the file for
+ * editting next user as well.
+ */
+ if ((tmpfd = open(tmpfil, O_RDWR)) < 0)
die(1, _("Cannot reopen!"));
if (readprivs(curprivs, tmpfd) < 0) {
errstr(_("Cannot read quotas from file.\n"));