Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F148622187
D30050.id88439.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
825 B
Referenced Files
None
Subscribers
None
D30050.id88439.diff
View Options
Index: usr.sbin/bhyve/bhyverun.c
===================================================================
--- usr.sbin/bhyve/bhyverun.c
+++ usr.sbin/bhyve/bhyverun.c
@@ -69,6 +69,7 @@
#include <sysexits.h>
#include <stdbool.h>
#include <stdint.h>
+#include <uuid.h>
#ifdef BHYVE_SNAPSHOT
#include <ucl.h>
#include <unistd.h>
@@ -1077,6 +1078,16 @@
fbsdrun_addcpu(ctx, BSP, vcpu, rip);
}
+bool
+is_valid_uuid(const char* uuid_str)
+{
+ uuid_t uuid;
+ uint32_t uuid_status;
+
+ uuid_from_string(uuid_str, &uuid, &uuid_status);
+ return (uuid_status == uuid_s_ok);
+}
+
int
main(int argc, char *argv[])
{
@@ -1196,6 +1207,9 @@
rtc_localtime = 0;
break;
case 'U':
+ if (! is_valid_uuid(optarg)) {
+ errx(EX_USAGE, "invalid UUID '%s'", optarg);
+ }
guest_uuid_str = optarg;
break;
case 'w':
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 20, 5:04 AM (6 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30000120
Default Alt Text
D30050.id88439.diff (825 B)
Attached To
Mode
D30050: Adds uuid validation to bhyve(8) arg parsing
Attached
Detach File
Event Timeline
Log In to Comment