Check valid options were given
authorGlenn L McGrath <bug1@ihug.co.nz>
Fri, 23 Jan 2004 21:40:19 +0000 (21:40 -0000)
committerGlenn L McGrath <bug1@ihug.co.nz>
Fri, 23 Jan 2004 21:40:19 +0000 (21:40 -0000)
coreutils/install.c

index 3128c5bd9177919c0526c09ffadd0e43f8e8fae2..84e60f93478e1f679e9c7cbfc73ac68a075dad06 100644 (file)
@@ -54,8 +54,14 @@ extern int install_main(int argc, char **argv)
        int i;
 
        /* -c exists for backwards compatability, its needed */
+       bb_opt_complementaly = "s~d:d~s";
        flags = bb_getopt_ulflags(argc, argv, "cdpsg:m:o:", &gid_str, &mode_str, &uid_str);     /* 'a' must be 2nd */
 
+       /* Check valid options were given */
+       if(flags & 0x80000000UL) {
+               bb_show_usage();
+       }
+
        /* preserve access and modification time, this is GNU behaviour, BSD only preserves modification time */
        if (flags & INSTALL_OPT_PRESERVE_TIME) {
                copy_flags |= FILEUTILS_PRESERVE_STATUS;