15091a29rwatson/*-
25091a29rwatson * Copyright (c) 2001 Robert N. M. Watson
35091a29rwatson * All rights reserved.
45091a29rwatson *
55091a29rwatson * Redistribution and use in source and binary forms, with or without
65091a29rwatson * modification, are permitted provided that the following conditions
75091a29rwatson * are met:
85091a29rwatson * 1. Redistributions of source code must retain the above copyright
95091a29rwatson *    notice, this list of conditions and the following disclaimer.
105091a29rwatson * 2. Redistributions in binary form must reproduce the above copyright
115091a29rwatson *    notice, this list of conditions and the following disclaimer in the
125091a29rwatson *    documentation and/or other materials provided with the distribution.
135091a29rwatson *
145091a29rwatson * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
155091a29rwatson * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
165091a29rwatson * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
175091a29rwatson * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
185091a29rwatson * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
195091a29rwatson * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
205091a29rwatson * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
215091a29rwatson * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
225091a29rwatson * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
235091a29rwatson * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
245091a29rwatson * SUCH DAMAGE.
255091a29rwatson *
265091a29rwatson * $FreeBSD$
275091a29rwatson */
285091a29rwatson
295091a29rwatson#include <sys/types.h>
305091a29rwatson
315091a29rwatson#include <stdio.h>
325091a29rwatson#include <unistd.h>
335091a29rwatson
345091a29rwatson#include "scenario.h"
355091a29rwatson
365091a29rwatsonint
375091a29rwatsonmain(int argc, char *argv[])
385091a29rwatson{
395091a29rwatson	int error;
405091a29rwatson
415091a29rwatson	fprintf(stderr, "test capabilities: ");
425091a29rwatson#ifdef SETSUGID_SUPPORTED
435091a29rwatson	fprintf(stderr, "[SETSUGID_SUPPORTED] ");
445091a29rwatson#endif
455091a29rwatson#ifdef SETSUGID_SUPPORTED_BUT_NO_LIBC_STUB
465091a29rwatson	fprintf(stderr, "[SETSUGID_SUPPORTED_BUT_NO_LIBC_STUB] ");
475091a29rwatson#endif
485091a29rwatson#ifdef CHECK_CRED_SET
495091a29rwatson	fprintf(stderr, "[CHECK_CRED_SET] ");
505091a29rwatson#endif
515091a29rwatson	fprintf(stderr, "\n");
525091a29rwatson
535091a29rwatson	error = setugid(1);
545091a29rwatson	if (error) {
555091a29rwatson		perror("setugid");
565091a29rwatson		fprintf(stderr,
575091a29rwatson		    "This test suite requires options REGRESSION\n");
585091a29rwatson		return (-1);
595091a29rwatson	}
605091a29rwatson
615091a29rwatson	enact_scenarios();
625091a29rwatson
635091a29rwatson	return (0);
645091a29rwatson}
655091a29rwatson
66