]> granicus.if.org Git - strace/commitdiff
Upgrade invalid -e kvm= argument to a fatal error
authorDmitry V. Levin <ldv@altlinux.org>
Tue, 10 Jul 2018 16:10:38 +0000 (16:10 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 10 Jul 2018 16:10:38 +0000 (16:10 +0000)
* filter_qualify.c (qualify_kvm): Call error_msg_and_die instead of
error_msg in case of invalid -e kvm= argument.
* tests/options-syntax.test: Check it.

filter_qualify.c
tests/options-syntax.test

index e28c67298b27888a446ec2208f2c98ddef868580..95b67e99aea5033008430aa55e7c21e561e5ee98 100644 (file)
@@ -415,7 +415,7 @@ qualify_kvm(const char *const str)
                else
                        error_msg("-e kvm=vcpu option needs Linux 4.16.0 or higher");
        } else {
-               error_msg("unknown value for -e kvm= option: %s", str);
+               error_msg_and_die("invalid -e kvm= argument: '%s'", str);
        }
 }
 #endif
index 1a290d01408024c0974861ca70b0df979bef61e2..28762bc57814bd31c4bf7a191b528d043a005f36 100755 (executable)
@@ -66,6 +66,7 @@ check_h "incorrect personality designator '42' in qualification 'getcwd@42'" -e
 check_h "incorrect personality designator '42' in qualification '23@42'" -e trace=23@42,123
 
 check_e "invalid system call '/getcwd@ohmy'" -e trace=/getcwd@ohmy
+check_e "invalid -e kvm= argument: 'chdir'" -e kvm=chdir
 
 case "$STRACE_NATIVE_ARCH" in
 x86_64)