-# $OpenBSD: Makefile,v 1.6 2024/08/31 20:03:03 jeremy Exp $
+# $OpenBSD: Makefile,v 1.7 2024/09/01 05:48:20 anton Exp $
WARNINGS= yes
${SUDO} ./syscalls
PROGS+= socket
-PROGS+= access
+
+PROGS+=access
+run-regress-access: access
+ ./access ${.CURDIR}/access-expected
.include <bsd.regress.mk>
"frwc", "frxc", "fwxc", "frwxc"};
const char* header = "unveil:access\n";
-int main(int argc, char** argv) {
+int
+main(int argc, char *argv[])
+{
int i;
int log_fd;
FILE *log;
- char expected[PATH_MAX];
- char *exp;
+ const char *expected;
+
+ if (argc != 2) {
+ fprintf(stderr, "usage: access expected-path\n");
+ exit(1);
+ }
+ expected = argv[1];
- UV_SHOULD_SUCCEED(((exp = realpath("access-expected", expected)) == NULL), "realpath");
UV_SHOULD_SUCCEED(((log_fd = mkstemp(uv_file)) == -1), "mkstemp");
UV_SHOULD_SUCCEED(((log = fdopen(log_fd, "w")) == NULL), "fdopen");
UV_SHOULD_SUCCEED((mkdtemp(uv_dir) == NULL), "mkdtmp");