From cf3cc77d928280a6e83203736af5a86b3af7b172 Mon Sep 17 00:00:00 2001 From: semarie Date: Thu, 8 Oct 2015 10:09:09 +0000 Subject: [PATCH] allow a test to manage itself the tame(2) call. --- regress/sys/kern/tame/generic/manager.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/regress/sys/kern/tame/generic/manager.c b/regress/sys/kern/tame/generic/manager.c index 0cc70cab032..c3d0abbc042 100644 --- a/regress/sys/kern/tame/generic/manager.c +++ b/regress/sys/kern/tame/generic/manager.c @@ -1,4 +1,4 @@ -/* $OpenBSD: manager.c,v 1.4 2015/09/24 06:52:22 semarie Exp $ */ +/* $OpenBSD: manager.c,v 1.5 2015/10/08 10:09:09 semarie Exp $ */ /* * Copyright (c) 2015 Sebastien Marie * @@ -175,15 +175,19 @@ _start_test(int *ret, const char *test_name, const char *request, int i; /* early print testname */ - printf("test(%s): tame=(\"%s\",", test_name, request); - if (paths) { - printf("{"); - for (i = 0; paths[i] != NULL; i++) - printf("\"%s\",", paths[i]); - printf("NULL})"); + printf("test(%s): tame=", test_name); + if (request) { + printf("(\"%s\",", request); + if (paths) { + printf("{"); + for (i = 0; paths[i] != NULL; i++) + printf("\"%s\",", paths[i]); + printf("NULL})"); + } else + printf("NULL)"); } else - printf("NULL)"); - + printf("not-called"); + /* unlink previous coredump (if exists) */ if (clear_coredump(ret, test_name) == -1) return; @@ -223,7 +227,7 @@ _start_test(int *ret, const char *test_name, const char *request, setsid(); /* set tame policy */ - if (tame(request, paths) != 0) + if (request && tame(request, paths) != 0) err(errno, "tame"); /* reset errno and launch test */ -- 2.20.1