From vs@theater.dyndns.org  Thu Dec 13 09:40:07 2001
Return-Path: <vs@theater.dyndns.org>
Received: from mailout03.sul.t-online.com (mailout03.sul.t-online.com [194.25.134.81])
	by hub.freebsd.org (Postfix) with ESMTP id 6DF9537B405
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 13 Dec 2001 09:40:06 -0800 (PST)
Received: from fwd02.sul.t-online.de 
	by mailout03.sul.t-online.de with smtp 
	id 16EXyc-0005nU-0P; Thu, 13 Dec 2001 16:40:50 +0100
Received: from theater.dyndns.org (320068889749-0001@[80.133.141.78]) by fmrl02.sul.t-online.com
	with esmtp id 16EXyU-13GMfgC; Thu, 13 Dec 2001 16:40:42 +0100
Received: (from vs@localhost)
	by theater.dyndns.org (8.11.6/8.11.4) id fBDFehT06675;
	Thu, 13 Dec 2001 16:40:44 +0100 (CET)
	(envelope-from vs)
Message-Id: <200112131540.fBDFehT06675@theater.dyndns.org>
Date: Thu, 13 Dec 2001 16:40:44 +0100 (CET)
From: Volker Stolz <stolz@i2.informatik.rwth-aachen.de>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] tcpd.h lacks prototype for hosts_ctl
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         32808
>Category:       bin
>Synopsis:       [patch] tcpd.h lacks prototype for hosts_ctl
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Dec 13 09:50:01 PST 2001
>Closed-Date:    
>Last-Modified:  Tue Jul 10 03:41:43 UTC 2012
>Originator:     Volker Stolz
>Release:        FreeBSD 4.4-STABLE i386
>Organization:
Lehrstuhl fr Informatik II
>Environment:
System: FreeBSD erde.ikea.net 4.4-STABLE FreeBSD 4.4-STABLE #6: Sat Oct 13 11:05:01 CEST 2001 root@monster.ikea.net:/opt/obj/opt/src/sys/GATE i386


	
>Description:
hosts_access(3) offers hosts_ctl for checking tcpd access restrictions.
The corresponding prototype in <tcpd.h> is missing, though.
>How-To-Repeat:
Compile an application which uses hosts_ctl -> warning about missing
prototype.

>Fix:
Add

extern int hosts_ctl(char *daemon, char *client_name, char *client_addr, 
                     char *client_user);

or

extern int hosts_ctl();

to tcpd.h. If you go for the first version, it might be worth updating
the prototypes of the other functions as well. I could do this and
provide an entire patch if requested.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->dwmalone 
Responsible-Changed-By: dwmalone 
Responsible-Changed-When: Fri Dec 14 05:57:31 PST 2001 
Responsible-Changed-Why:  
I'm interested in adding prototypes to tcpd.h (though it needs some care 
as it is contributed code). 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=32808 

From: Dan Lukes <dan@obluda.cz>
To: freebsd-gnats-submit@FreeBSD.org, dwmalone@FreeBSD.org,
	stolz@i2.informatik.rwth-aachen.de
Cc:  
Subject: Re: bin/32808: [PATCH] tcpd.h lacks prototype for hosts_ctl
Date: Mon, 6 Sep 2004 11:00:04 +0200 (CEST)

 Well, it's open so long. Bellow are the patch that adds prototype to tcpd.h
 with care, as it is contributed code.
 
 David, if you disagree with this patch, commit the hosts_ctl prototype add only.
 It's true bug, other are cosmetics changes only. Thank you
 
  							Dan
 
 
 *** contrib/tcp_wrappers/tcpd.h.ORIG	Thu Feb  3 11:26:59 2000
 --- contrib/tcp_wrappers/tcpd.h	Mon Sep  6 08:55:07 2004
 ***************
 *** 6,11 ****
 --- 6,22 ----
      * $FreeBSD: src/contrib/tcp_wrappers/tcpd.h,v 1.2 2000/02/03 10:26:59 shin Exp $
      */
 
 + #ifndef __TCPD_H__
 + #define __TCPD_H__
 + 
 + #ifndef __P
 + # if defined(__STDC__) || defined (__cplusplus)
 + #  define       __P(x)  x
 + # else
 + #  define       __P(x)  ()
 + # endif
 + #endif
 +
    /* Structure to describe one communications endpoint. */
 
    #define STRING_LENGTH	128		/* hosts, users, processes */
 ***************
 *** 67,86 ****
    /* Global functions. */
 
    #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT)
 ! extern void fromhost();			/* get/validate client host info */
    #else
    #define fromhost sock_host		/* no TLI support needed */
    #endif
 
 ! extern int hosts_access();		/* access control */
 ! extern void shell_cmd();		/* execute shell command */
 ! extern char *percent_x();		/* do %<char> expansion */
 ! extern void rfc931();			/* client name from RFC 931 daemon */
 ! extern void clean_exit();		/* clean up and exit */
 ! extern void refuse();			/* clean up and exit */
 ! extern char *xgets();			/* fgets() on steroids */
 ! extern char *split_at();		/* strchr() and split */
 ! extern unsigned long dot_quad_addr();	/* restricted inet_addr() */
 
    /* Global variables. */
 
 --- 78,103 ----
    /* Global functions. */
 
    #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT)
 ! extern void 
 ! fromhost __P((struct request_info *request));	/* get/validate client host info */
    #else
    #define fromhost sock_host		/* no TLI support needed */
    #endif
 
 ! extern int hosts_access __P((struct request_info *));
 ! extern int hosts_ctl __P((char *, char *, char *, char *));
 ! extern void shell_cmd __P((char *command));
 ! extern char *percent_x __P((char *, int, char *, struct request_info *));
 ! #ifdef INET6
 ! extern void rfc931 __P((struct sockaddr *, struct sockaddr *));
 ! #else
 ! extern void rfc931 __P((struct sockaddr_in *, struct sockaddr_in *));
 ! #endif
 ! extern void clean_exit __P((struct request_info *));
 ! extern void refuse __P((struct request_info *));
 ! extern char *xgets __P((char *, int, FILE *));
 ! extern char *split_at __P((char *, int));
 ! extern unsigned long dot_quad_addr __P((char *));
 
    /* Global variables. */
 
 ***************
 *** 97,109 ****
      * attributes. Each attribute has its own key.
      */
 
 ! #ifdef __STDC__
 ! extern struct request_info *request_init(struct request_info *,...);
 ! extern struct request_info *request_set(struct request_info *,...);
 ! #else
 ! extern struct request_info *request_init();	/* initialize request */
 ! extern struct request_info *request_set();	/* update request structure */
 ! #endif
 
    #define RQ_FILE		1		/* file descriptor */
    #define RQ_DAEMON	2		/* server process (argv[0]) */
 --- 114,121 ----
      * attributes. Each attribute has its own key.
      */
 
 ! extern struct request_info *request_init __P((struct request_info *,...));
 ! extern struct request_info *request_set __P((struct request_info *,...));
 
    #define RQ_FILE		1		/* file descriptor */
    #define RQ_DAEMON	2		/* server process (argv[0]) */
 ***************
 *** 123,149 ****
      * host_info structures serve as caches for the lookup results.
      */
 
 ! extern char *eval_user();		/* client user */
 ! extern char *eval_hostname();		/* printable hostname */
 ! extern char *eval_hostaddr();		/* printable host address */
 ! extern char *eval_hostinfo();		/* host name or address */
 ! extern char *eval_client();		/* whatever is available */
 ! extern char *eval_server();		/* whatever is available */
    #define eval_daemon(r)	((r)->daemon)	/* daemon process name */
    #define eval_pid(r)	((r)->pid)	/* process id */
 
    /* Socket-specific methods, including DNS hostname lookups. */
 
 ! extern void sock_host();		/* look up endpoint addresses */
 ! extern void sock_hostname();		/* translate address to hostname */
 ! extern void sock_hostaddr();		/* address to printable address */
    #define sock_methods(r) \
    	{ (r)->hostname = sock_hostname; (r)->hostaddr = sock_hostaddr; }
 
    /* The System V Transport-Level Interface (TLI) interface. */
 
    #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT)
 ! extern void tli_host();			/* look up endpoint addresses etc. */
    #endif
 
     /*
 --- 135,161 ----
      * host_info structures serve as caches for the lookup results.
      */
 
 ! extern char *eval_user __P((struct request_info *));
 ! extern char *eval_hostname __P((struct host_info *));
 ! extern char *eval_hostaddr __P((struct host_info *));
 ! extern char *eval_hostinfo __P((struct host_info *));		/* host name or address */
 ! extern char *eval_client __P((struct request_info *));
 ! extern char *eval_server __P((struct request_info *));
    #define eval_daemon(r)	((r)->daemon)	/* daemon process name */
    #define eval_pid(r)	((r)->pid)	/* process id */
 
    /* Socket-specific methods, including DNS hostname lookups. */
 
 ! extern void sock_host __P((struct request_info *));
 ! extern void sock_hostname __P((struct host_info *));
 ! extern void sock_hostaddr __P((struct host_info *));
    #define sock_methods(r) \
    	{ (r)->hostname = sock_hostname; (r)->hostaddr = sock_hostaddr; }
 
    /* The System V Transport-Level Interface (TLI) interface. */
 
    #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT)
 ! extern void tli_host __P((struct request_info *));
    #endif
 
     /*
 ***************
 *** 152,164 ****
      * everyone would have to include <setjmp.h>.
      */
 
 ! #ifdef __STDC__
 ! extern void tcpd_warn(char *, ...);	/* report problem and proceed */
 ! extern void tcpd_jump(char *, ...);	/* report problem and jump */
 ! #else
 ! extern void tcpd_warn();
 ! extern void tcpd_jump();
 ! #endif
 
    struct tcpd_context {
        char   *file;			/* current file */
 --- 164,171 ----
      * everyone would have to include <setjmp.h>.
      */
 
 ! extern void tcpd_warn __P((char *, ...));	/* report problem and proceed */
 ! extern void tcpd_jump __P((char *, ...));	/* report problem and jump */
 
    struct tcpd_context {
        char   *file;			/* current file */
 ***************
 *** 184,225 ****
      * behavior.
      */
 
 ! extern void process_options();		/* execute options */
    extern int dry_run;			/* verification flag */
 
    /* Bug workarounds. */
 
    #ifdef INET_ADDR_BUG			/* inet_addr() returns struct */
    #define inet_addr fix_inet_addr
 ! extern long fix_inet_addr();
    #endif
 
    #ifdef BROKEN_FGETS			/* partial reads from sockets */
    #define fgets fix_fgets
 ! extern char *fix_fgets();
    #endif
 
    #ifdef RECVFROM_BUG			/* no address family info */
    #define recvfrom fix_recvfrom
 ! extern int fix_recvfrom();
    #endif
 
    #ifdef GETPEERNAME_BUG			/* claims success with UDP */
    #define getpeername fix_getpeername
 ! extern int fix_getpeername();
    #endif
 
    #ifdef SOLARIS_24_GETHOSTBYNAME_BUG	/* lists addresses as aliases */
    #define gethostbyname fix_gethostbyname
 ! extern struct hostent *fix_gethostbyname();
    #endif
 
    #ifdef USE_STRSEP			/* libc calls strtok() */
    #define strtok	fix_strtok
 ! extern char *fix_strtok();
    #endif
 
    #ifdef LIBC_CALLS_STRTOK		/* libc calls strtok() */
    #define strtok	my_strtok
 ! extern char *my_strtok();
    #endif
 --- 191,238 ----
      * behavior.
      */
 
 ! extern void process_options __P((char *, struct request_info *));
    extern int dry_run;			/* verification flag */
 
    /* Bug workarounds. */
 
    #ifdef INET_ADDR_BUG			/* inet_addr() returns struct */
    #define inet_addr fix_inet_addr
 ! extern long fix_inet_addr __P((char *));
    #endif
 
    #ifdef BROKEN_FGETS			/* partial reads from sockets */
    #define fgets fix_fgets
 ! extern char *fix_fgets __P((char *. int, FILE *));
    #endif
 
    #ifdef RECVFROM_BUG			/* no address family info */
    #define recvfrom fix_recvfrom
 ! extern int fix_recvfrom __P((int, char *, int, int, struct sockaddr *, int));
    #endif
 
    #ifdef GETPEERNAME_BUG			/* claims success with UDP */
    #define getpeername fix_getpeername
 ! extern int fix_getpeername __P((int, struct sockaddr *, int));
 ! #endif
 ! 
 ! #ifdef USE_GETDOMAIN			/* no yp_default_domain() */
 ! extern int yp_get_default_domain __P((char **));
    #endif
 
    #ifdef SOLARIS_24_GETHOSTBYNAME_BUG	/* lists addresses as aliases */
    #define gethostbyname fix_gethostbyname
 ! extern struct hostent *fix_gethostbyname __P((char *));
    #endif
 
    #ifdef USE_STRSEP			/* libc calls strtok() */
    #define strtok	fix_strtok
 ! extern char *fix_strtok __P((char *, char *));
    #endif
 
    #ifdef LIBC_CALLS_STRTOK		/* libc calls strtok() */
    #define strtok	my_strtok
 ! extern char *my_strtok __P((char *, char *));
    #endif
 + 
 + #endif  /* __TCPD_H__ */
Responsible-Changed-From-To: dwmalone->freebsd-bugs 
Responsible-Changed-By: eadler 
Responsible-Changed-When: Tue Jul 10 03:41:42 UTC 2012 
Responsible-Changed-Why:  
over to the pool (approved by bugmeister) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=32808 
>Unformatted:
