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