175422Srwatson/*-
275422Srwatson * Copyright (c) 2001 Robert N. M. Watson
375422Srwatson * All rights reserved.
475422Srwatson *
575422Srwatson * Redistribution and use in source and binary forms, with or without
675422Srwatson * modification, are permitted provided that the following conditions
775422Srwatson * are met:
875422Srwatson * 1. Redistributions of source code must retain the above copyright
975422Srwatson *    notice, this list of conditions and the following disclaimer.
1075422Srwatson * 2. Redistributions in binary form must reproduce the above copyright
1175422Srwatson *    notice, this list of conditions and the following disclaimer in the
1275422Srwatson *    documentation and/or other materials provided with the distribution.
1375422Srwatson *
1475422Srwatson * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1575422Srwatson * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1675422Srwatson * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1775422Srwatson * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1875422Srwatson * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1975422Srwatson * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2075422Srwatson * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2175422Srwatson * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2275422Srwatson * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2375422Srwatson * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2475422Srwatson * SUCH DAMAGE.
2575422Srwatson *
2675422Srwatson * $FreeBSD$
2775422Srwatson */
2875422Srwatson
2975422Srwatson#include <sys/types.h>
3075422Srwatson
3175422Srwatson#include <stdio.h>
3275422Srwatson#include <unistd.h>
3375422Srwatson
3475422Srwatson#include "scenario.h"
3575422Srwatson
3675422Srwatsonint
3775422Srwatsonmain(int argc, char *argv[])
3875422Srwatson{
3975422Srwatson	int error;
4075422Srwatson
4175422Srwatson	fprintf(stderr, "test capabilities: ");
4275422Srwatson#ifdef SETSUGID_SUPPORTED
4375422Srwatson	fprintf(stderr, "[SETSUGID_SUPPORTED] ");
4475422Srwatson#endif
4575422Srwatson#ifdef SETSUGID_SUPPORTED_BUT_NO_LIBC_STUB
4675422Srwatson	fprintf(stderr, "[SETSUGID_SUPPORTED_BUT_NO_LIBC_STUB] ");
4775422Srwatson#endif
4875422Srwatson#ifdef CHECK_CRED_SET
4975422Srwatson	fprintf(stderr, "[CHECK_CRED_SET] ");
5075422Srwatson#endif
5175422Srwatson	fprintf(stderr, "\n");
5275422Srwatson
5375422Srwatson	error = setugid(1);
5475422Srwatson	if (error) {
5575422Srwatson		perror("setugid");
5675422Srwatson		fprintf(stderr,
5775422Srwatson		    "This test suite requires options REGRESSION\n");
5875422Srwatson		return (-1);
5975422Srwatson	}
6075422Srwatson
6175422Srwatson	enact_scenarios();
6275422Srwatson
6375422Srwatson	return (0);
6475422Srwatson}
6575422Srwatson
66