1*0Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 2*0Sstevel@tonic-gate 3*0Sstevel@tonic-gate /**************************************************************************** 4*0Sstevel@tonic-gate Copyright (c) 1999,2000 WU-FTPD Development Group. 5*0Sstevel@tonic-gate All rights reserved. 6*0Sstevel@tonic-gate 7*0Sstevel@tonic-gate Portions Copyright (c) 1980, 1985, 1988, 1989, 1990, 1991, 1993, 1994 8*0Sstevel@tonic-gate The Regents of the University of California. 9*0Sstevel@tonic-gate Portions Copyright (c) 1993, 1994 Washington University in Saint Louis. 10*0Sstevel@tonic-gate Portions Copyright (c) 1996, 1998 Berkeley Software Design, Inc. 11*0Sstevel@tonic-gate Portions Copyright (c) 1989 Massachusetts Institute of Technology. 12*0Sstevel@tonic-gate Portions Copyright (c) 1998 Sendmail, Inc. 13*0Sstevel@tonic-gate Portions Copyright (c) 1983, 1995, 1996, 1997 Eric P. Allman. 14*0Sstevel@tonic-gate Portions Copyright (c) 1997 by Stan Barber. 15*0Sstevel@tonic-gate Portions Copyright (c) 1997 by Kent Landfield. 16*0Sstevel@tonic-gate Portions Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997 17*0Sstevel@tonic-gate Free Software Foundation, Inc. 18*0Sstevel@tonic-gate 19*0Sstevel@tonic-gate Use and distribution of this software and its source code are governed 20*0Sstevel@tonic-gate by the terms and conditions of the WU-FTPD Software License ("LICENSE"). 21*0Sstevel@tonic-gate 22*0Sstevel@tonic-gate If you did not receive a copy of the license, it may be obtained online 23*0Sstevel@tonic-gate at http://www.wu-ftpd.org/license.html. 24*0Sstevel@tonic-gate 25*0Sstevel@tonic-gate $Id: hostacc.h,v 1.9 2000/07/01 18:17:39 wuftpd Exp $ 26*0Sstevel@tonic-gate 27*0Sstevel@tonic-gate ****************************************************************************/ 28*0Sstevel@tonic-gate /* 29*0Sstevel@tonic-gate * hostacc.h - Header file used in the implementation of 30*0Sstevel@tonic-gate * host access for the WU-FTPD FTP daemon 31*0Sstevel@tonic-gate * 32*0Sstevel@tonic-gate * INITIAL AUTHOR - Bart Muijzer <bartm@cv.ruu.nl> 33*0Sstevel@tonic-gate */ 34*0Sstevel@tonic-gate 35*0Sstevel@tonic-gate #ifdef HOST_ACCESS 36*0Sstevel@tonic-gate 37*0Sstevel@tonic-gate #include <stdio.h> 38*0Sstevel@tonic-gate #ifdef HAVE_SYS_SYSLOG_H 39*0Sstevel@tonic-gate #include <sys/syslog.h> 40*0Sstevel@tonic-gate #endif 41*0Sstevel@tonic-gate #if defined(HAVE_SYSLOG_H) || (!defined(AUTOCONF) && !defined(HAVE_SYS_SYSLOG_H)) 42*0Sstevel@tonic-gate #include <syslog.h> 43*0Sstevel@tonic-gate #endif 44*0Sstevel@tonic-gate #include <string.h> 45*0Sstevel@tonic-gate #include <stdlib.h> 46*0Sstevel@tonic-gate #include <errno.h> 47*0Sstevel@tonic-gate 48*0Sstevel@tonic-gate #include "pathnames.h" /* From the ftpd sources */ 49*0Sstevel@tonic-gate 50*0Sstevel@tonic-gate /* 51*0Sstevel@tonic-gate * Host Access types, as stored in the ha_type field, 52*0Sstevel@tonic-gate * and some other constants. All of this is tunable as 53*0Sstevel@tonic-gate * long as you don't depend on the values. 54*0Sstevel@tonic-gate */ 55*0Sstevel@tonic-gate 56*0Sstevel@tonic-gate #define ALLOW 1 57*0Sstevel@tonic-gate #define DENY 2 58*0Sstevel@tonic-gate 59*0Sstevel@tonic-gate #define MAXLEN 1024 /* Maximum length of one line in config file */ 60*0Sstevel@tonic-gate #define MAXHST 12 /* Max. number of hosts allowed on one line */ 61*0Sstevel@tonic-gate 62*0Sstevel@tonic-gate /* ------------------------------------------------------------------------- */ 63*0Sstevel@tonic-gate 64*0Sstevel@tonic-gate /* 65*0Sstevel@tonic-gate * Structure holding all host-access information 66*0Sstevel@tonic-gate */ 67*0Sstevel@tonic-gate 68*0Sstevel@tonic-gate typedef struct { 69*0Sstevel@tonic-gate short ha_type; /* ALLOW | DENY */ 70*0Sstevel@tonic-gate char *ha_login; /* Loginname to investigate */ 71*0Sstevel@tonic-gate char *ha_hosts[MAXHST]; /* Array of hostnames */ 72*0Sstevel@tonic-gate } hacc_t; 73*0Sstevel@tonic-gate 74*0Sstevel@tonic-gate /* ------------------------------------------------------------------------ */ 75*0Sstevel@tonic-gate 76*0Sstevel@tonic-gate static int sethacc(void); 77*0Sstevel@tonic-gate static int endhacc(void); 78*0Sstevel@tonic-gate static hacc_t *gethacc(void); 79*0Sstevel@tonic-gate static void fatalmsg(char *pcMsg); 80*0Sstevel@tonic-gate static char *strnsav(char *pcStr, int iLen); 81*0Sstevel@tonic-gate 82*0Sstevel@tonic-gate #endif /* HOST_ACCESS */ 83