Merge commit '0b2e8253986c5c761129b58cfdac46d204903de1'
[unleashed.git] / usr / src / lib / libwrap / hosts_ctl.c
blob52d4c97c85465225ef7f50a8424a42831b618a13
1 /*
2 * Copyright 2001 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
4 */
5 #pragma ident "%Z%%M% %I% %E% SMI"
7 /*
8 * hosts_ctl() combines common applications of the host access control
9 * library routines. It bundles its arguments then calls the hosts_access()
10 * access control checker. The host name and user name arguments should be
11 * empty strings, STRING_UNKNOWN or real data. If a match is found, the
12 * optional shell command is executed.
14 * Restriction: this interface does not pass enough information to support
15 * selective remote username lookups or selective hostname double checks.
17 * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
20 static char sccsid[] = "@(#) hosts_ctl.c 1.4 94/12/28 17:42:27";
22 #include <stdio.h>
24 #include "tcpd.h"
26 /* hosts_ctl - limited interface to the hosts_access() routine */
28 int hosts_ctl(daemon, name, addr, user)
29 char *daemon;
30 char *name;
31 char *addr;
32 char *user;
34 struct request_info request;
36 return (hosts_access(request_init(&request,
37 RQ_DAEMON, daemon,
38 RQ_CLIENT_NAME, name,
39 RQ_CLIENT_ADDR, addr,
40 RQ_USER, user,
41 0)));