mirror of https://github.com/vitalif/e2fsprogs
tune2fs: more respect for quota config option
Commit 44a2cca3
disabled tune2fs -O quota when the build
didn't have --enable-quota at configure time, but that
wasn't quite enough.
We need to exclude the "-Q" option as well from tune2fs
when --enable-quota isn't specified at configure time.
Otherwise, tune2fs -Q can set the quota feature, but no other
utility will touch the filesystem due to the unknown flag,
if buitl w/o --enable-quota.
So put everything related to "-Q" under #ifdef CONFIG_QUOTA;
usage output (was missing before) and option parsing.
Addresses-Red-Hat-Bugzilla: #1010709
Reported-by: Bert DeKnuydt <Bert.Deknuydt@esat.kuleuven.be>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
debian-1.42.9
parent
f5589f4c18
commit
d82445e903
|
@ -121,6 +121,9 @@ static void usage(void)
|
||||||
"\t[-r reserved_blocks_count] [-u user] [-C mount_count] "
|
"\t[-r reserved_blocks_count] [-u user] [-C mount_count] "
|
||||||
"[-L volume_label]\n"
|
"[-L volume_label]\n"
|
||||||
"\t[-M last_mounted_dir] [-O [^]feature[,...]]\n"
|
"\t[-M last_mounted_dir] [-O [^]feature[,...]]\n"
|
||||||
|
#ifdef CONFIG_QUOTA
|
||||||
|
"\t[-Q quota_options]\n"
|
||||||
|
#endif
|
||||||
"\t[-E extended-option[,...]] [-T last_check_time] "
|
"\t[-E extended-option[,...]] [-T last_check_time] "
|
||||||
"[-U UUID]\n\t[ -I new_inode_size ] device\n"), program_name);
|
"[-U UUID]\n\t[ -I new_inode_size ] device\n"), program_name);
|
||||||
exit(1);
|
exit(1);
|
||||||
|
@ -857,11 +860,15 @@ static void parse_tune2fs_options(int argc, char **argv)
|
||||||
char *tmp;
|
char *tmp;
|
||||||
struct group *gr;
|
struct group *gr;
|
||||||
struct passwd *pw;
|
struct passwd *pw;
|
||||||
|
char optstring[100] = "c:e:fg:i:jlm:o:r:s:u:C:E:I:J:L:M:O:T:U:";
|
||||||
|
|
||||||
|
#ifdef CONFIG_QUOTA
|
||||||
|
strcat(optstring, "Q:");
|
||||||
|
#endif
|
||||||
open_flag = 0;
|
open_flag = 0;
|
||||||
|
|
||||||
printf("tune2fs %s (%s)\n", E2FSPROGS_VERSION, E2FSPROGS_DATE);
|
printf("tune2fs %s (%s)\n", E2FSPROGS_VERSION, E2FSPROGS_DATE);
|
||||||
while ((c = getopt(argc, argv, "c:e:fg:i:jlm:o:r:s:u:C:E:I:J:L:M:O:Q:T:U:")) != EOF)
|
while ((c = getopt(argc, argv, optstring)) != EOF)
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'c':
|
case 'c':
|
||||||
max_mount_count = strtol(optarg, &tmp, 0);
|
max_mount_count = strtol(optarg, &tmp, 0);
|
||||||
|
@ -1015,11 +1022,13 @@ static void parse_tune2fs_options(int argc, char **argv)
|
||||||
features_cmd = optarg;
|
features_cmd = optarg;
|
||||||
open_flag = EXT2_FLAG_RW;
|
open_flag = EXT2_FLAG_RW;
|
||||||
break;
|
break;
|
||||||
|
#ifdef CONFIG_QUOTA
|
||||||
case 'Q':
|
case 'Q':
|
||||||
Q_flag = 1;
|
Q_flag = 1;
|
||||||
parse_quota_opts(optarg);
|
parse_quota_opts(optarg);
|
||||||
open_flag = EXT2_FLAG_RW;
|
open_flag = EXT2_FLAG_RW;
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
case 'r':
|
case 'r':
|
||||||
reserved_blocks = strtoul(optarg, &tmp, 0);
|
reserved_blocks = strtoul(optarg, &tmp, 0);
|
||||||
if (*tmp) {
|
if (*tmp) {
|
||||||
|
|
Loading…
Reference in New Issue