-/* $OpenBSD: main.c,v 1.64 2021/04/02 19:07:18 dv Exp $ */
+/* $OpenBSD: main.c,v 1.65 2021/05/12 20:13:00 dv Exp $ */
/*
* Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org>
switch (ch) {
case 'b':
base = optarg;
- if (unveil(base, "r") == -1)
- err(1, "unveil");
break;
case 'i':
input = optarg;
- if (unveil(input, "r") == -1)
- err(1, "unveil");
break;
case 's':
if (parse_size(res, optarg) != 0)
type = parse_disktype(argv[0], &disk);
- if (pledge("stdio rpath wpath cpath unveil", NULL) == -1)
+ if (pledge("stdio rpath wpath cpath", NULL) == -1)
err(1, "pledge");
- if (unveil(disk, "rwc") == -1)
- err(1, "unveil");
if (input) {
if (base && input)
return ctl_convert(input, disk, type, res->size);
}
- if (unveil(NULL, NULL))
- err(1, "unveil");
-
if (base && type != VMDF_QCOW2)
errx(1, "base images require qcow2 disk format");
if (res->size == 0 && !base) {
goto done;
}
- /* We can only lock unveil after opening the disk and all base images */
- if (unveil(NULL, NULL))
- err(1, "unveil");
-
if (dstsize == 0)
dstsize = src.size;
else
-/* $OpenBSD: vmctl.c,v 1.77 2021/03/22 18:50:11 kn Exp $ */
+/* $OpenBSD: vmctl.c,v 1.78 2021/05/12 20:13:00 dv Exp $ */
/*
* Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org>
} else if (ret == 0)
break;
- /*
- * This might be called after unveil is already
- * locked but it is save to ignore the EPERM error
- * here as the subsequent open would fail as well.
- */
- if ((ret = unveil(path, "r")) != 0 &&
- (ret != EPERM))
- err(1, "unveil");
if ((basefd[i + 1] = open(path, O_RDONLY)) == -1) {
log_warn("%s: failed to open base %s",
__func__, path);
return (ret);
}
-