[PATCH RFC 2/3] mke2fs.c: fail on multiple '-E' options

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Make it an error to pass multiple -E options. As per the man page,
multiple extended options must be specified as a comma-separated list,
instead of multiple -E options.

This helps avoid surprises, as the existing behaviour is to process
only the last -E option, and to silently ignore any earlier ones.

Signed-off-by: Ralph Siemsen <ralph.siemsen@xxxxxxxxxx>
---
 misc/mke2fs.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index 3a8ff5b1..59c7be17 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -1796,6 +1796,12 @@ profile_error:
 				_("'-R' is deprecated, use '-E' instead"));
 			/* fallthrough */
 		case 'E':
+			if (extended_opts) {
+				com_err(program_name, 0, "%s",
+					_("Multiple '-E' options are not supported, "
+					  "use one comma-separated value instead"));
+				exit(1);
+			}
 			extended_opts = optarg;
 			break;
 		case 'e':

-- 
2.45.2.121.gc2b3f2b3cd





[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux