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