1194267Sed/*-
2330449Seadler * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3330449Seadler *
4194267Sed * Copyright (c) 2009 Ed Schouten <ed@FreeBSD.org>
5194267Sed * All rights reserved.
6194267Sed *
7194267Sed * Redistribution and use in source and binary forms, with or without
8194267Sed * modification, are permitted provided that the following conditions
9194267Sed * are met:
10194267Sed * 1. Redistributions of source code must retain the above copyright
11194267Sed *    notice, this list of conditions and the following disclaimer.
12194267Sed * 2. Redistributions in binary form must reproduce the above copyright
13194267Sed *    notice, this list of conditions and the following disclaimer in the
14194267Sed *    documentation and/or other materials provided with the distribution.
15194267Sed *
16194267Sed * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17194267Sed * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18194267Sed * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19194267Sed * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20194267Sed * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21194267Sed * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22194267Sed * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23194267Sed * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24194267Sed * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25194267Sed * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26194267Sed * SUCH DAMAGE.
27194267Sed */
28194267Sed
29194267Sed#include <sys/cdefs.h>
30194267Sed__FBSDID("$FreeBSD: stable/11/usr.bin/revoke/revoke.c 330449 2018-03-05 07:26:05Z eadler $");
31194267Sed
32194267Sed#include <stdio.h>
33194267Sed#include <stdlib.h>
34194267Sed#include <unistd.h>
35194267Sed
36194267Sedstatic void
37194267Sedusage(void)
38194267Sed{
39194267Sed
40194267Sed	fprintf(stderr, "usage: revoke file ...\n");
41194267Sed	exit(1);
42194267Sed}
43194267Sed
44194267Sedint
45194267Sedmain(int argc, char *argv[])
46194267Sed{
47194267Sed	char **d;
48194267Sed	int error = 0;
49194267Sed
50194267Sed	if (argc == 1)
51194267Sed		usage();
52194267Sed
53194267Sed	for (d = &argv[1]; *d != NULL; d++) {
54194267Sed		if (revoke(*d) != 0) {
55194267Sed			perror(*d);
56194267Sed			error = 1;
57194267Sed		}
58194267Sed	}
59194267Sed
60194267Sed	return (error);
61194267Sed}
62