Home | History | Annotate | Line # | Download | only in libwrap
hosts_ctl.c revision 1.4.66.2
      1  1.4.66.2       riz /*	$NetBSD: hosts_ctl.c,v 1.4.66.2 2012/04/23 23:40:41 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.2       riz __RCSID("$NetBSD: hosts_ctl.c,v 1.4.66.2 2012/04/23 23:40:41 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.2       riz int     hosts_ctl(daemon, name, addr, user)
     32  1.4.66.2       riz char   *daemon;
     33  1.4.66.2       riz char   *name;
     34  1.4.66.2       riz char   *addr;
     35  1.4.66.2       riz char   *user;
     36       1.1       mrg {
     37       1.1       mrg     struct request_info request;
     38       1.1       mrg 
     39       1.1       mrg     return (hosts_access(request_init(&request,
     40       1.1       mrg 				      RQ_DAEMON, daemon,
     41       1.1       mrg 				      RQ_CLIENT_NAME, name,
     42       1.1       mrg 				      RQ_CLIENT_ADDR, addr,
     43       1.1       mrg 				      RQ_USER, user,
     44       1.1       mrg 				      0)));
     45       1.1       mrg }
     46