2N/A/*
2N/A * Copyright 2001 Sun Microsystems, Inc. All rights reserved.
2N/A * Use is subject to license terms.
2N/A */
2N/A#pragma ident "%Z%%M% %I% %E% SMI"
2N/A
2N/A /*
2N/A * hosts_ctl() combines common applications of the host access control
2N/A * library routines. It bundles its arguments then calls the hosts_access()
2N/A * access control checker. The host name and user name arguments should be
2N/A * empty strings, STRING_UNKNOWN or real data. If a match is found, the
2N/A * optional shell command is executed.
2N/A *
2N/A * Restriction: this interface does not pass enough information to support
2N/A * selective remote username lookups or selective hostname double checks.
2N/A *
2N/A * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
2N/A */
2N/A
2N/A#ifndef lint
2N/Astatic char sccsid[] = "@(#) hosts_ctl.c 1.4 94/12/28 17:42:27";
2N/A#endif
2N/A
2N/A#include <stdio.h>
2N/A
2N/A#include "tcpd.h"
2N/A
2N/A/* hosts_ctl - limited interface to the hosts_access() routine */
2N/A
2N/Aint hosts_ctl(daemon, name, addr, user)
2N/Achar *daemon;
2N/Achar *name;
2N/Achar *addr;
2N/Achar *user;
2N/A{
2N/A struct request_info request;
2N/A
2N/A return (hosts_access(request_init(&request,
2N/A RQ_DAEMON, daemon,
2N/A RQ_CLIENT_NAME, name,
2N/A RQ_CLIENT_ADDR, addr,
2N/A RQ_USER, user,
2N/A 0)));
2N/A}