diff options
author | Jan Kara <jack@suse.cz> | 2011-03-09 15:37:37 +0100 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2011-03-09 15:37:37 +0100 |
commit | 418a9f20ee870953790b4331327ccb24ca8f1e47 (patch) | |
tree | 381d86736a481c986561fe173e2bb9736649e6dc | |
parent | 8d4c4a761c27a81d96ae8c49e1b8d32d66b6751e (diff) | |
download | linuxquota-418a9f20ee870953790b4331327ccb24ca8f1e47.tar.gz |
Forbid grace time setting over RPC
Testing revealed that it's not easy to set even individual grace times
over RPC protocol. Since the usage of it is limited, just disallow that.
Signed-off-by: Jan Kara <jack@suse.cz>
-rw-r--r-- | edquota.8 | 2 | ||||
-rw-r--r-- | edquota.c | 8 | ||||
-rw-r--r-- | setquota.8 | 2 | ||||
-rw-r--r-- | setquota.c | 6 |
4 files changed, 11 insertions, 7 deletions
@@ -38,8 +38,6 @@ edquota \- edit user quotas .BR \-u \ | .B \-g ] [ -.B \-rm -] [ .B \-F .I format-name ] [ @@ -80,8 +80,8 @@ void usage(void) #endif errstr(_("Usage:\n\tedquota %1$s[-u] [-F formatname] [-p username] [-f filesystem] username ...\n\ \tedquota %1$s-g [-F formatname] [-p groupname] [-f filesystem] groupname ...\n\ -\tedquota %1$s[-u|g] [-F formatname] [-f filesystem] -t\n\ -\tedquota %1$s[-u|g] [-F formatname] [-f filesystem] -T username|groupname ...\n"), rpcflag); +\tedquota [-u|g] [-F formatname] [-f filesystem] -t\n\ +\tedquota [-u|g] [-F formatname] [-f filesystem] -T username|groupname ...\n"), rpcflag); fputs(_("\n\ -u, --user edit user data\n\ -g, --group edit group data\n"), stderr); @@ -183,6 +183,10 @@ int parse_options(int argc, char **argv) errstr(_("Prototype name does not make sense when editing grace period or times.\n")); usage(); } + if (flags & FL_REMOTE && (flags & (FL_EDIT_TIMES | FL_EDIT_PERIOD))) { + errstr(_("Cannot change grace times over RPC protocol.\n")); + usage(); + } return optind; } @@ -84,8 +84,6 @@ setquota \- set disk quotas .B setquota .B \-T [ -.B \-rm -] [ .B \-u | .B \-g @@ -58,7 +58,7 @@ static void usage(void) setquota [-u|-g] %1$s[-F quotaformat] <-p protouser|protogroup> <user|group> -a|<filesystem>...\n\ setquota [-u|-g] %1$s[-F quotaformat] -b [-c] -a|<filesystem>...\n\ setquota [-u|-g] [-F quotaformat] -t <blockgrace> <inodegrace> -a|<filesystem>...\n\ - setquota [-u|-g] %1$s[-F quotaformat] <user|group> -T <blockgrace> <inodegrace> -a|<filesystem>...\n\n\ + setquota [-u|-g] [-F quotaformat] <user|group> -T <blockgrace> <inodegrace> -a|<filesystem>...\n\n\ -u, --user set limits for user\n\ -g, --group set limits for group\n\ -a, --all set limits for all filesystems\n\ @@ -202,6 +202,10 @@ static void parse_options(int argcnt, char **argstr) errstr(_("Batch mode and prototype user cannot be used together.\n")); usage(); } + if (flags & FL_RPC && (flags & (FL_GRACE | FL_INDIVIDUAL_GRACE))) { + errstr(_("Cannot set grace times over RPC protocol.\n")); + usage(); + } if (flags & FL_GRACE) otherargs = 2; else if (flags & FL_INDIVIDUAL_GRACE) |