fix unveil(2) in vmctl(8), unix socket needs :w:
authorbenno <benno@openbsd.org>
Thu, 1 Sep 2022 15:43:07 +0000 (15:43 +0000)
committerbenno <benno@openbsd.org>
Thu, 1 Sep 2022 15:43:07 +0000 (15:43 +0000)
ok mestre@ martijn@

usr.sbin/vmctl/main.c

index 1182e58..01b0f41 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: main.c,v 1.72 2022/07/30 14:17:42 kn Exp $    */
+/*     $OpenBSD: main.c,v 1.73 2022/09/01 15:43:07 benno Exp $ */
 
 /*
  * Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org>
@@ -196,7 +196,7 @@ vmmaction(struct parse_result *res)
        unsigned int             flags;
 
        if (ctl_sock == -1) {
-               if (unveil(SOCKET_NAME, "r") == -1)
+               if (unveil(SOCKET_NAME, "w") == -1)
                        err(1, "unveil %s", SOCKET_NAME);
                if ((ctl_sock = socket(AF_UNIX,
                    SOCK_STREAM|SOCK_CLOEXEC, 0)) == -1)