xref: /illumos-gate/usr/src/cmd/tcpd/tcpdmatch.c (revision 55fea89d)
17c478bd9Sstevel@tonic-gate  /*
27c478bd9Sstevel@tonic-gate   * tcpdmatch - explain what tcpd would do in a specific case
3*55fea89dSDan Cross   *
47c478bd9Sstevel@tonic-gate   * usage: tcpdmatch [-d] [-i inet_conf] daemon[@host] [user@]host
5*55fea89dSDan Cross   *
67c478bd9Sstevel@tonic-gate   * -d: use the access control tables in the current directory.
7*55fea89dSDan Cross   *
87c478bd9Sstevel@tonic-gate   * -i: location of inetd.conf file.
9*55fea89dSDan Cross   *
107c478bd9Sstevel@tonic-gate   * All errors are reported to the standard error stream, including the errors
117c478bd9Sstevel@tonic-gate   * that would normally be reported via the syslog daemon.
12*55fea89dSDan Cross   *
137c478bd9Sstevel@tonic-gate   * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
147c478bd9Sstevel@tonic-gate   */
157c478bd9Sstevel@tonic-gate 
167c478bd9Sstevel@tonic-gate #ifndef lint
177c478bd9Sstevel@tonic-gate static char sccsid[] = "@(#) tcpdmatch.c 1.5 96/02/11 17:01:36";
187c478bd9Sstevel@tonic-gate #endif
197c478bd9Sstevel@tonic-gate 
207c478bd9Sstevel@tonic-gate /* System libraries. */
217c478bd9Sstevel@tonic-gate 
227c478bd9Sstevel@tonic-gate #include <sys/types.h>
237c478bd9Sstevel@tonic-gate #include <sys/stat.h>
247c478bd9Sstevel@tonic-gate #include <sys/socket.h>
257c478bd9Sstevel@tonic-gate #include <netinet/in.h>
267c478bd9Sstevel@tonic-gate #include <arpa/inet.h>
277c478bd9Sstevel@tonic-gate #include <netdb.h>
287c478bd9Sstevel@tonic-gate #include <stdio.h>
297c478bd9Sstevel@tonic-gate #include <syslog.h>
307c478bd9Sstevel@tonic-gate #include <setjmp.h>
317c478bd9Sstevel@tonic-gate #include <string.h>
327c478bd9Sstevel@tonic-gate 
337c478bd9Sstevel@tonic-gate extern void exit();
347c478bd9Sstevel@tonic-gate extern int optind;
357c478bd9Sstevel@tonic-gate extern char *optarg;
367c478bd9Sstevel@tonic-gate 
377c478bd9Sstevel@tonic-gate #ifndef	INADDR_NONE
387c478bd9Sstevel@tonic-gate #define	INADDR_NONE	(-1)		/* XXX should be 0xffffffff */
397c478bd9Sstevel@tonic-gate #endif
407c478bd9Sstevel@tonic-gate 
417c478bd9Sstevel@tonic-gate #ifndef S_ISDIR
427c478bd9Sstevel@tonic-gate #define S_ISDIR(m)	(((m) & S_IFMT) == S_IFDIR)
437c478bd9Sstevel@tonic-gate #endif
447c478bd9Sstevel@tonic-gate 
457c478bd9Sstevel@tonic-gate /* Application-specific. */
467c478bd9Sstevel@tonic-gate 
477c478bd9Sstevel@tonic-gate #include "tcpd.h"
487c478bd9Sstevel@tonic-gate #include "inetcf.h"
497c478bd9Sstevel@tonic-gate #include "scaffold.h"
507c478bd9Sstevel@tonic-gate 
517c478bd9Sstevel@tonic-gate static void usage();
527c478bd9Sstevel@tonic-gate static void tcpdmatch();
537c478bd9Sstevel@tonic-gate 
547c478bd9Sstevel@tonic-gate /* The main program */
557c478bd9Sstevel@tonic-gate 
main(argc,argv)567c478bd9Sstevel@tonic-gate int     main(argc, argv)
577c478bd9Sstevel@tonic-gate int     argc;
587c478bd9Sstevel@tonic-gate char  **argv;
597c478bd9Sstevel@tonic-gate {
607c478bd9Sstevel@tonic-gate     struct hostent *hp;
617c478bd9Sstevel@tonic-gate     char   *myname = argv[0];
627c478bd9Sstevel@tonic-gate     char   *client;
637c478bd9Sstevel@tonic-gate     char   *server;
647c478bd9Sstevel@tonic-gate     char   *addr;
657c478bd9Sstevel@tonic-gate     char   *user;
667c478bd9Sstevel@tonic-gate     char   *daemon;
677c478bd9Sstevel@tonic-gate     struct request_info request;
687c478bd9Sstevel@tonic-gate     int     ch;
697c478bd9Sstevel@tonic-gate     char   *inetcf = 0;
707c478bd9Sstevel@tonic-gate     int     count;
717c478bd9Sstevel@tonic-gate     struct sockaddr_gen server_sin;
727c478bd9Sstevel@tonic-gate     struct sockaddr_gen client_sin;
737c478bd9Sstevel@tonic-gate     struct stat st;
747c478bd9Sstevel@tonic-gate 
757c478bd9Sstevel@tonic-gate     /*
767c478bd9Sstevel@tonic-gate      * Show what rule actually matched.
777c478bd9Sstevel@tonic-gate      */
787c478bd9Sstevel@tonic-gate     hosts_access_verbose = 2;
797c478bd9Sstevel@tonic-gate 
807c478bd9Sstevel@tonic-gate     /*
817c478bd9Sstevel@tonic-gate      * Parse the JCL.
827c478bd9Sstevel@tonic-gate      */
837c478bd9Sstevel@tonic-gate     while ((ch = getopt(argc, argv, "di:")) != EOF) {
847c478bd9Sstevel@tonic-gate 	switch (ch) {
857c478bd9Sstevel@tonic-gate 	case 'd':
867c478bd9Sstevel@tonic-gate 	    hosts_allow_table = "hosts.allow";
877c478bd9Sstevel@tonic-gate 	    hosts_deny_table = "hosts.deny";
887c478bd9Sstevel@tonic-gate 	    break;
897c478bd9Sstevel@tonic-gate 	case 'i':
907c478bd9Sstevel@tonic-gate 	    inetcf = optarg;
917c478bd9Sstevel@tonic-gate 	    break;
927c478bd9Sstevel@tonic-gate 	default:
937c478bd9Sstevel@tonic-gate 	    usage(myname);
947c478bd9Sstevel@tonic-gate 	    /* NOTREACHED */
957c478bd9Sstevel@tonic-gate 	}
967c478bd9Sstevel@tonic-gate     }
977c478bd9Sstevel@tonic-gate     if (argc != optind + 2)
987c478bd9Sstevel@tonic-gate 	usage(myname);
997c478bd9Sstevel@tonic-gate 
1007c478bd9Sstevel@tonic-gate     /*
1017c478bd9Sstevel@tonic-gate      * When confusion really strikes...
1027c478bd9Sstevel@tonic-gate      */
1037c478bd9Sstevel@tonic-gate     if (check_path(REAL_DAEMON_DIR, &st) < 0) {
1047c478bd9Sstevel@tonic-gate 	tcpd_warn("REAL_DAEMON_DIR %s: %m", REAL_DAEMON_DIR);
1057c478bd9Sstevel@tonic-gate     } else if (!S_ISDIR(st.st_mode)) {
1067c478bd9Sstevel@tonic-gate 	tcpd_warn("REAL_DAEMON_DIR %s is not a directory", REAL_DAEMON_DIR);
1077c478bd9Sstevel@tonic-gate     }
1087c478bd9Sstevel@tonic-gate 
1097c478bd9Sstevel@tonic-gate     /*
1107c478bd9Sstevel@tonic-gate      * Default is to specify a daemon process name. When daemon@host is
1117c478bd9Sstevel@tonic-gate      * specified, separate the two parts.
1127c478bd9Sstevel@tonic-gate      */
1137c478bd9Sstevel@tonic-gate     if ((server = split_at(argv[optind], '@')) == 0)
1147c478bd9Sstevel@tonic-gate 	server = unknown;
1157c478bd9Sstevel@tonic-gate     if (argv[optind][0] == '/') {
1167c478bd9Sstevel@tonic-gate 	daemon = strrchr(argv[optind], '/') + 1;
1177c478bd9Sstevel@tonic-gate 	tcpd_warn("%s: daemon name normalized to: %s", argv[optind], daemon);
1187c478bd9Sstevel@tonic-gate     } else {
1197c478bd9Sstevel@tonic-gate 	daemon = argv[optind];
1207c478bd9Sstevel@tonic-gate     }
1217c478bd9Sstevel@tonic-gate 
1227c478bd9Sstevel@tonic-gate     /*
1237c478bd9Sstevel@tonic-gate      * Default is to specify a client hostname or address. When user@host is
1247c478bd9Sstevel@tonic-gate      * specified, separate the two parts.
1257c478bd9Sstevel@tonic-gate      */
1267c478bd9Sstevel@tonic-gate     if ((client = split_at(argv[optind + 1], '@')) != 0) {
1277c478bd9Sstevel@tonic-gate 	user = argv[optind + 1];
1287c478bd9Sstevel@tonic-gate     } else {
1297c478bd9Sstevel@tonic-gate 	client = argv[optind + 1];
1307c478bd9Sstevel@tonic-gate 	user = unknown;
1317c478bd9Sstevel@tonic-gate     }
1327c478bd9Sstevel@tonic-gate 
1337c478bd9Sstevel@tonic-gate     /*
1347c478bd9Sstevel@tonic-gate      * Analyze the inetd (or tlid) configuration file, so that we can warn
1357c478bd9Sstevel@tonic-gate      * the user about services that may not be wrapped, services that are not
1367c478bd9Sstevel@tonic-gate      * configured, or services that are wrapped in an incorrect manner. Allow
1377c478bd9Sstevel@tonic-gate      * for services that are not run from inetd, or that have tcpd access
1387c478bd9Sstevel@tonic-gate      * control built into them.
1397c478bd9Sstevel@tonic-gate      */
1407c478bd9Sstevel@tonic-gate     inetcf = inet_cfg(inetcf);
1417c478bd9Sstevel@tonic-gate     inet_set("portmap", WR_NOT);
1427c478bd9Sstevel@tonic-gate     inet_set("rpcbind", WR_NOT);
1437c478bd9Sstevel@tonic-gate     switch (inet_get(daemon)) {
1447c478bd9Sstevel@tonic-gate     case WR_UNKNOWN:
1457c478bd9Sstevel@tonic-gate 	tcpd_warn("%s: no such process name in %s", daemon, inetcf);
1467c478bd9Sstevel@tonic-gate 	break;
1477c478bd9Sstevel@tonic-gate     case WR_NOT:
1487c478bd9Sstevel@tonic-gate 	tcpd_warn("%s: service possibly not wrapped", daemon);
1497c478bd9Sstevel@tonic-gate 	break;
1507c478bd9Sstevel@tonic-gate     }
1517c478bd9Sstevel@tonic-gate 
1527c478bd9Sstevel@tonic-gate     /*
1537c478bd9Sstevel@tonic-gate      * Check accessibility of access control files.
1547c478bd9Sstevel@tonic-gate      */
1557c478bd9Sstevel@tonic-gate     (void) check_path(hosts_allow_table, &st);
1567c478bd9Sstevel@tonic-gate     (void) check_path(hosts_deny_table, &st);
1577c478bd9Sstevel@tonic-gate 
1587c478bd9Sstevel@tonic-gate     /*
1597c478bd9Sstevel@tonic-gate      * Fill in what we have figured out sofar. Use socket and DNS routines
1607c478bd9Sstevel@tonic-gate      * for address and name conversions. We attach stdout to the request so
1617c478bd9Sstevel@tonic-gate      * that banner messages will become visible.
1627c478bd9Sstevel@tonic-gate      */
1637c478bd9Sstevel@tonic-gate     request_init(&request, RQ_DAEMON, daemon, RQ_USER, user, RQ_FILE, 1, 0);
1647c478bd9Sstevel@tonic-gate     sock_methods(&request);
1657c478bd9Sstevel@tonic-gate 
1667c478bd9Sstevel@tonic-gate     /*
1677c478bd9Sstevel@tonic-gate      * If a server hostname is specified, insist that the name maps to at
1687c478bd9Sstevel@tonic-gate      * most one address. eval_hostname() warns the user about name server
1697c478bd9Sstevel@tonic-gate      * problems, while using the request.server structure as a cache for host
1707c478bd9Sstevel@tonic-gate      * address and name conversion results.
1717c478bd9Sstevel@tonic-gate      */
1727c478bd9Sstevel@tonic-gate     if (NOT_INADDR(server) == 0 || HOSTNAME_KNOWN(server)) {
1737c478bd9Sstevel@tonic-gate 	if ((hp = find_inet_addr(server)) == 0)
1747c478bd9Sstevel@tonic-gate 	    exit(1);
1757c478bd9Sstevel@tonic-gate 	memset((char *) &server_sin, 0, sizeof(server_sin));
1767c478bd9Sstevel@tonic-gate 	server_sin.sg_family = hp->h_addrtype;
1777c478bd9Sstevel@tonic-gate 	request_set(&request, RQ_SERVER_SIN, &server_sin, 0);
1787c478bd9Sstevel@tonic-gate 
1797c478bd9Sstevel@tonic-gate 	for (count = 0; (addr = hp->h_addr_list[count]) != 0; count++) {
1807c478bd9Sstevel@tonic-gate 	    memcpy((char *) SGADDRP(&server_sin), addr, hp->h_length);
1817c478bd9Sstevel@tonic-gate 
1827c478bd9Sstevel@tonic-gate 	    /*
1837c478bd9Sstevel@tonic-gate 	     * Force evaluation of server host name and address. Host name
1847c478bd9Sstevel@tonic-gate 	     * conflicts will be reported while eval_hostname() does its job.
1857c478bd9Sstevel@tonic-gate 	     */
1867c478bd9Sstevel@tonic-gate 	    request_set(&request, RQ_SERVER_NAME, "", RQ_SERVER_ADDR, "", 0);
1877c478bd9Sstevel@tonic-gate 	    if (STR_EQ(eval_hostname(request.server), unknown))
1887c478bd9Sstevel@tonic-gate 		tcpd_warn("host address %s->name lookup failed",
1897c478bd9Sstevel@tonic-gate 			  eval_hostaddr(request.server));
1907c478bd9Sstevel@tonic-gate 	}
1917c478bd9Sstevel@tonic-gate 	if (count > 1) {
1927c478bd9Sstevel@tonic-gate 	    fprintf(stderr, "Error: %s has more than one address\n", server);
1937c478bd9Sstevel@tonic-gate 	    fprintf(stderr, "Please specify an address instead\n");
1947c478bd9Sstevel@tonic-gate 	    exit(1);
1957c478bd9Sstevel@tonic-gate 	}
1967c478bd9Sstevel@tonic-gate 	free((char *) hp);
1977c478bd9Sstevel@tonic-gate     } else {
1987c478bd9Sstevel@tonic-gate 	request_set(&request, RQ_SERVER_NAME, server, 0);
1997c478bd9Sstevel@tonic-gate     }
2007c478bd9Sstevel@tonic-gate 
2017c478bd9Sstevel@tonic-gate     /*
2027c478bd9Sstevel@tonic-gate      * If a client address is specified, we simulate the effect of client
2037c478bd9Sstevel@tonic-gate      * hostname lookup failure.
2047c478bd9Sstevel@tonic-gate      */
2057c478bd9Sstevel@tonic-gate     if (numeric_addr(client, NULL, NULL, NULL) == 0) {
2067c478bd9Sstevel@tonic-gate 	request_set(&request, RQ_CLIENT_ADDR, client, 0);
2077c478bd9Sstevel@tonic-gate 	tcpdmatch(&request);
2087c478bd9Sstevel@tonic-gate 	exit(0);
2097c478bd9Sstevel@tonic-gate     }
2107c478bd9Sstevel@tonic-gate 
2117c478bd9Sstevel@tonic-gate     /*
2127c478bd9Sstevel@tonic-gate      * Perhaps they are testing special client hostname patterns that aren't
2137c478bd9Sstevel@tonic-gate      * really host names at all.
2147c478bd9Sstevel@tonic-gate      */
2157c478bd9Sstevel@tonic-gate     if (NOT_INADDR(client) && HOSTNAME_KNOWN(client) == 0) {
2167c478bd9Sstevel@tonic-gate 	request_set(&request, RQ_CLIENT_NAME, client, 0);
2177c478bd9Sstevel@tonic-gate 	tcpdmatch(&request);
2187c478bd9Sstevel@tonic-gate 	exit(0);
2197c478bd9Sstevel@tonic-gate     }
2207c478bd9Sstevel@tonic-gate 
2217c478bd9Sstevel@tonic-gate     /*
2227c478bd9Sstevel@tonic-gate      * Otherwise, assume that a client hostname is specified, and insist that
2237c478bd9Sstevel@tonic-gate      * the address can be looked up. The reason for this requirement is that
2247c478bd9Sstevel@tonic-gate      * in real life the client address is available (at least with IP). Let
2257c478bd9Sstevel@tonic-gate      * eval_hostname() figure out if this host is properly registered, while
2267c478bd9Sstevel@tonic-gate      * using the request.client structure as a cache for host name and
2277c478bd9Sstevel@tonic-gate      * address conversion results.
2287c478bd9Sstevel@tonic-gate      */
2297c478bd9Sstevel@tonic-gate     if ((hp = find_inet_addr(client)) == 0)
2307c478bd9Sstevel@tonic-gate 	exit(1);
2317c478bd9Sstevel@tonic-gate     memset((char *) &client_sin, 0, sizeof(client_sin));
2327c478bd9Sstevel@tonic-gate     client_sin.sg_family = hp->h_addrtype;
2337c478bd9Sstevel@tonic-gate     request_set(&request, RQ_CLIENT_SIN, &client_sin, 0);
2347c478bd9Sstevel@tonic-gate 
2357c478bd9Sstevel@tonic-gate     for (count = 0; (addr = hp->h_addr_list[count]) != 0; count++) {
2367c478bd9Sstevel@tonic-gate 	memcpy((char *) SGADDRP(&client_sin), addr, hp->h_length);
2377c478bd9Sstevel@tonic-gate 
2387c478bd9Sstevel@tonic-gate 	/*
2397c478bd9Sstevel@tonic-gate 	 * Force evaluation of client host name and address. Host name
2407c478bd9Sstevel@tonic-gate 	 * conflicts will be reported while eval_hostname() does its job.
2417c478bd9Sstevel@tonic-gate 	 */
2427c478bd9Sstevel@tonic-gate 	request_set(&request, RQ_CLIENT_NAME, "", RQ_CLIENT_ADDR, "", 0);
2437c478bd9Sstevel@tonic-gate 	if (STR_EQ(eval_hostname(request.client), unknown))
2447c478bd9Sstevel@tonic-gate 	    tcpd_warn("host address %s->name lookup failed",
2457c478bd9Sstevel@tonic-gate 		      eval_hostaddr(request.client));
2467c478bd9Sstevel@tonic-gate 	tcpdmatch(&request);
2477c478bd9Sstevel@tonic-gate 	if (hp->h_addr_list[count + 1])
2487c478bd9Sstevel@tonic-gate 	    printf("\n");
2497c478bd9Sstevel@tonic-gate     }
2507c478bd9Sstevel@tonic-gate     free((char *) hp);
2517c478bd9Sstevel@tonic-gate     exit(0);
2527c478bd9Sstevel@tonic-gate }
2537c478bd9Sstevel@tonic-gate 
2547c478bd9Sstevel@tonic-gate /* Explain how to use this program */
2557c478bd9Sstevel@tonic-gate 
usage(myname)2567c478bd9Sstevel@tonic-gate static void usage(myname)
2577c478bd9Sstevel@tonic-gate char   *myname;
2587c478bd9Sstevel@tonic-gate {
2597c478bd9Sstevel@tonic-gate     fprintf(stderr, "usage: %s [-d] [-i inet_conf] daemon[@host] [user@]host\n",
2607c478bd9Sstevel@tonic-gate 	    myname);
2617c478bd9Sstevel@tonic-gate     fprintf(stderr, "	-d: use allow/deny files in current directory\n");
2627c478bd9Sstevel@tonic-gate     fprintf(stderr, "	-i: location of inetd.conf file\n");
2637c478bd9Sstevel@tonic-gate     exit(1);
2647c478bd9Sstevel@tonic-gate }
2657c478bd9Sstevel@tonic-gate 
2667c478bd9Sstevel@tonic-gate /* Print interesting expansions */
2677c478bd9Sstevel@tonic-gate 
expand(text,pattern,request)2687c478bd9Sstevel@tonic-gate static void expand(text, pattern, request)
2697c478bd9Sstevel@tonic-gate char   *text;
2707c478bd9Sstevel@tonic-gate char   *pattern;
2717c478bd9Sstevel@tonic-gate struct request_info *request;
2727c478bd9Sstevel@tonic-gate {
2737c478bd9Sstevel@tonic-gate     char    buf[BUFSIZ];
2747c478bd9Sstevel@tonic-gate 
2757c478bd9Sstevel@tonic-gate     if (STR_NE(percent_x(buf, sizeof(buf), pattern, request), unknown))
2767c478bd9Sstevel@tonic-gate 	printf("%s %s\n", text, buf);
2777c478bd9Sstevel@tonic-gate }
2787c478bd9Sstevel@tonic-gate 
2797c478bd9Sstevel@tonic-gate /* Try out a (server,client) pair */
2807c478bd9Sstevel@tonic-gate 
tcpdmatch(request)2817c478bd9Sstevel@tonic-gate static void tcpdmatch(request)
2827c478bd9Sstevel@tonic-gate struct request_info *request;
2837c478bd9Sstevel@tonic-gate {
2847c478bd9Sstevel@tonic-gate     int     verdict;
2857c478bd9Sstevel@tonic-gate 
2867c478bd9Sstevel@tonic-gate     /*
2877c478bd9Sstevel@tonic-gate      * Show what we really know. Suppress uninteresting noise.
2887c478bd9Sstevel@tonic-gate      */
2897c478bd9Sstevel@tonic-gate     expand("client:   hostname", "%n", request);
2907c478bd9Sstevel@tonic-gate     expand("client:   address ", "%a", request);
2917c478bd9Sstevel@tonic-gate     expand("client:   username", "%u", request);
2927c478bd9Sstevel@tonic-gate     expand("server:   hostname", "%N", request);
2937c478bd9Sstevel@tonic-gate     expand("server:   address ", "%A", request);
2947c478bd9Sstevel@tonic-gate     expand("server:   process ", "%d", request);
2957c478bd9Sstevel@tonic-gate 
2967c478bd9Sstevel@tonic-gate     /*
2977c478bd9Sstevel@tonic-gate      * Reset stuff that might be changed by options handlers. In dry-run
2987c478bd9Sstevel@tonic-gate      * mode, extension language routines that would not return should inform
2997c478bd9Sstevel@tonic-gate      * us of their plan, by clearing the dry_run flag. This is a bit clumsy
3007c478bd9Sstevel@tonic-gate      * but we must be able to verify hosts with more than one network
3017c478bd9Sstevel@tonic-gate      * address.
3027c478bd9Sstevel@tonic-gate      */
3037c478bd9Sstevel@tonic-gate     rfc931_timeout = RFC931_TIMEOUT;
3047c478bd9Sstevel@tonic-gate     allow_severity = SEVERITY;
3057c478bd9Sstevel@tonic-gate     deny_severity = LOG_WARNING;
3067c478bd9Sstevel@tonic-gate     dry_run = 1;
3077c478bd9Sstevel@tonic-gate 
3087c478bd9Sstevel@tonic-gate     /*
3097c478bd9Sstevel@tonic-gate      * When paranoid mode is enabled, access is rejected no matter what the
3107c478bd9Sstevel@tonic-gate      * access control rules say.
3117c478bd9Sstevel@tonic-gate      */
3127c478bd9Sstevel@tonic-gate #ifdef PARANOID
3137c478bd9Sstevel@tonic-gate     if (STR_EQ(eval_hostname(request->client), paranoid)) {
3147c478bd9Sstevel@tonic-gate 	printf("access:   denied (PARANOID mode)\n\n");
3157c478bd9Sstevel@tonic-gate 	return;
3167c478bd9Sstevel@tonic-gate     }
3177c478bd9Sstevel@tonic-gate #endif
3187c478bd9Sstevel@tonic-gate 
3197c478bd9Sstevel@tonic-gate     /*
3207c478bd9Sstevel@tonic-gate      * Report the access control verdict.
3217c478bd9Sstevel@tonic-gate      */
3227c478bd9Sstevel@tonic-gate     verdict = hosts_access(request);
3237c478bd9Sstevel@tonic-gate     printf("access:   %s\n",
3247c478bd9Sstevel@tonic-gate 	   dry_run == 0 ? "delegated" :
3257c478bd9Sstevel@tonic-gate 	   verdict ? "granted" : "denied");
3267c478bd9Sstevel@tonic-gate }
327