xref: /freebsd/contrib/tcp_wrappers/hosts_ctl.c (revision 14f102ea)
12aef6930SMark Murray  /*
22aef6930SMark Murray   * hosts_ctl() combines common applications of the host access control
32aef6930SMark Murray   * library routines. It bundles its arguments then calls the hosts_access()
42aef6930SMark Murray   * access control checker. The host name and user name arguments should be
52aef6930SMark Murray   * empty strings, STRING_UNKNOWN or real data. If a match is found, the
62aef6930SMark Murray   * optional shell command is executed.
72aef6930SMark Murray   *
82aef6930SMark Murray   * Restriction: this interface does not pass enough information to support
92aef6930SMark Murray   * selective remote username lookups or selective hostname double checks.
102aef6930SMark Murray   *
112aef6930SMark Murray   * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
122aef6930SMark Murray   */
132aef6930SMark Murray 
142aef6930SMark Murray #ifndef lint
152aef6930SMark Murray static char sccsid[] = "@(#) hosts_ctl.c 1.4 94/12/28 17:42:27";
162aef6930SMark Murray #endif
172aef6930SMark Murray 
182aef6930SMark Murray #include <stdio.h>
192aef6930SMark Murray 
202aef6930SMark Murray #include "tcpd.h"
212aef6930SMark Murray 
222aef6930SMark Murray /* hosts_ctl - limited interface to the hosts_access() routine */
232aef6930SMark Murray 
hosts_ctl(char * daemon,char * name,char * addr,char * user)2414f102eaSEd Maste int     hosts_ctl(char *daemon, char *name, char *addr, char *user)
252aef6930SMark Murray {
262aef6930SMark Murray     struct request_info request;
272aef6930SMark Murray 
282aef6930SMark Murray     return (hosts_access(request_init(&request,
292aef6930SMark Murray 				      RQ_DAEMON, daemon,
302aef6930SMark Murray 				      RQ_CLIENT_NAME, name,
312aef6930SMark Murray 				      RQ_CLIENT_ADDR, addr,
322aef6930SMark Murray 				      RQ_USER, user,
332aef6930SMark Murray 				      0)));
342aef6930SMark Murray }
35