Home | History | Annotate | Line # | Download | only in libwrap
hosts_ctl.c revision 1.4.66.1
      1  1.4.66.1       riz /*	$NetBSD: hosts_ctl.c,v 1.4.66.1 2012/04/23 16:48:54 riz Exp $	*/
      2       1.2  christos 
      3       1.1       mrg  /*
      4       1.1       mrg   * hosts_ctl() combines common applications of the host access control
      5       1.1       mrg   * library routines. It bundles its arguments then calls the hosts_access()
      6       1.1       mrg   * access control checker. The host name and user name arguments should be
      7       1.1       mrg   * empty strings, STRING_UNKNOWN or real data. If a match is found, the
      8       1.1       mrg   * optional shell command is executed.
      9       1.4    simonb   *
     10       1.1       mrg   * Restriction: this interface does not pass enough information to support
     11       1.1       mrg   * selective remote username lookups or selective hostname double checks.
     12       1.4    simonb   *
     13       1.1       mrg   * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
     14       1.1       mrg   */
     15       1.1       mrg 
     16       1.2  christos #include <sys/cdefs.h>
     17       1.1       mrg #ifndef lint
     18       1.2  christos #if 0
     19       1.1       mrg static char sccsid[] = "@(#) hosts_ctl.c 1.4 94/12/28 17:42:27";
     20       1.2  christos #else
     21  1.4.66.1       riz __RCSID("$NetBSD: hosts_ctl.c,v 1.4.66.1 2012/04/23 16:48:54 riz Exp $");
     22       1.2  christos #endif
     23       1.1       mrg #endif
     24       1.1       mrg 
     25       1.1       mrg #include <stdio.h>
     26       1.1       mrg 
     27       1.1       mrg #include "tcpd.h"
     28       1.1       mrg 
     29       1.1       mrg /* hosts_ctl - limited interface to the hosts_access() routine */
     30       1.1       mrg 
     31  1.4.66.1       riz int
     32  1.4.66.1       riz hosts_ctl(char *daemon, char *name, char *addr, char *user)
     33       1.1       mrg {
     34       1.1       mrg     struct request_info request;
     35       1.1       mrg 
     36       1.1       mrg     return (hosts_access(request_init(&request,
     37       1.1       mrg 				      RQ_DAEMON, daemon,
     38       1.1       mrg 				      RQ_CLIENT_NAME, name,
     39       1.1       mrg 				      RQ_CLIENT_ADDR, addr,
     40       1.1       mrg 				      RQ_USER, user,
     41       1.1       mrg 				      0)));
     42       1.1       mrg }
     43