summaryrefslogtreecommitdiff
path: root/edquota.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2022-11-01 11:45:06 +0100
committerJan Kara <jack@suse.cz>2022-11-01 11:45:06 +0100
commitf7e24ee92d9bc16557132b33a34a6154aafd99d7 (patch)
tree0fe64b5db5c29afced421d8b2b57ccd9203d3c63 /edquota.c
parent037eaa6037789a3fac082ca1d6e240073943ca1a (diff)
downloadlinuxquota-f7e24ee92d9bc16557132b33a34a6154aafd99d7.tar.gz
edquota: Fix editing of individual user grace times
When user is not over softlimit, there's no point to set the grace time. The kernel will just ignore it. Output error message instead so that user is not confused. Also editing of grace times when quotas are enabled did not really work because we didn't tell the kernel grace times have changed. Fix it. Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'edquota.c')
-rw-r--r--edquota.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/edquota.c b/edquota.c
index a77106c..20ca306 100644
--- a/edquota.c
+++ b/edquota.c
@@ -352,7 +352,8 @@ int main(int argc, char **argv)
goto next_user;
}
}
- if (putprivs(curprivs, COMMIT_LIMITS) == -1)
+ if (putprivs(curprivs,
+ (flags & FL_EDIT_TIMES) ? COMMIT_TIMES : COMMIT_LIMITS) == -1)
ret = -1;
next_user:
freeprivs(curprivs);