NetBSD Problem Report #18728

Received: (qmail 10996 invoked by uid 605); 19 Oct 2002 20:24:08 -0000
Message-Id: <20021019202403.59E93A@proven.weird.com>
Date: Sat, 19 Oct 2002 16:24:03 -0400 (EDT)
From: woods@weird.com (Greg A. Woods)
Sender: gnats-bugs-owner@netbsd.org
Reply-To: woods@planix.com (Greg A. Woods)
To: gnats-bugs@gnats.netbsd.org
Subject: buildlink2 support and more patches for security/libident
X-Send-Pr-Version: 3.95

>Number:         18728
>Category:       pkg
>Synopsis:       buildlink2 support and more patches for security/libident
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Oct 19 20:25:01 +0000 2002
>Closed-Date:    Tue Oct 22 11:47:20 +0000 2002
>Last-Modified:  Sat Jan 04 21:02:01 +0000 2003
>Originator:     Greg A. Woods
>Release:        pkgsrc-current 2002/10/18
>Organization:
Planix, Inc.; Toronto, Ontario; Canada
>Environment:
System: NetBSD

>Description:

	buildlink2 support and more patches for security/libident

>How-To-Repeat:

>Fix:

cvs diff: Diffing security/libident
Index: security/libident/Makefile
===================================================================
RCS file: /cvs/master/m-NetBSD/main/pkgsrc/security/libident/Makefile,v
retrieving revision 1.8
diff -c -r1.8 Makefile
*** security/libident/Makefile	17 Feb 2001 17:49:50 -0000	1.8
--- security/libident/Makefile	6 Oct 2002 04:24:39 -0000
***************
*** 2,7 ****
--- 2,8 ----
  # FreeBSD ID: Makefile,v 1.6 1998/01/25 20:42:37 torstenb Exp

  DISTNAME=	libident-0.22
+ PKGREVISION=	1
  CATEGORIES=	security devel net
  MASTER_SITES=	ftp://ftp.lysator.liu.se/pub/ident/libs/

***************
*** 9,14 ****
--- 10,16 ----
  COMMENT=	Small library to interface to the ident protocol server (rfc1413)

  USE_LIBTOOL=	# defined
+ USE_BUILDLINK2=	YES

  ALL_TARGET=	netbsd
  MAKE_ENV+=	INSTALL_DATA="${INSTALL_DATA}"
Index: security/libident/buildlink2.mk
===================================================================
RCS file: security/libident/buildlink2.mk
diff -N security/libident/buildlink2.mk
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- security/libident/buildlink2.mk	6 Oct 2002 04:09:32 -0000
***************
*** 0 ****
--- 1,18 ----
+ #ident "@(#):$NetBSD$"
+ 
+ .if !defined(LIBIDENT_BUILDLINK2_MK)
+ 
+ BUILDLINK_PACKAGES+=		libident
+ BUILDLINK_DEPENDS.libident?=	libident>=0.22
+ BUILDLINK_PKGSRCDIR.libident?=	../../security/libident
+ 
+ EVAL_PREFIX+=			BUILDLINK_PREFIX.libident=libident
+ BUILDLINK_PREFIX.libident_DEFAULT=	${LOCALBASE}
+ BUILDLINK_FILES.libident=	include/ident.h
+ BUILDLINK_FILES.libident+=	lib/libident.*
+ 
+ BUILDLINK_TARGETS+=		libident-buildlink
+ 
+ libident-buildlink: _BUILDLINK_USE
+ 
+ .endif	# LIBIDENT_BUILDLINK2_MK
Index: security/libident/distinfo
===================================================================
RCS file: /cvs/master/m-NetBSD/main/pkgsrc/security/libident/distinfo,v
retrieving revision 1.2
diff -c -r1.2 distinfo
*** security/libident/distinfo	19 Apr 2001 15:40:33 -0000	1.2
--- security/libident/distinfo	22 Apr 2002 23:02:30 -0000
***************
*** 3,5 ****
--- 3,6 ----
  SHA1 (libident-0.22.tar.gz) = cf70a9600880085c333d4e8623ece8056a196cc6
  Size (libident-0.22.tar.gz) = 10716 bytes
  SHA1 (patch-aa) = 1d5f7837d8979ea62427731b858399a47fd19a80
+ SHA1 (patch-zz) = e2834a2572517fbb89bd97953171ee9d8854f2ed
cvs diff: Diffing security/libident/patches
Index: security/libident/patches/patch-zz
===================================================================
RCS file: security/libident/patches/patch-zz
diff -N security/libident/patches/patch-zz
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- security/libident/patches/patch-zz	22 Apr 2002 22:26:28 -0000
***************
*** 0 ****
--- 1,957 ----
+ 1cvs diff: Diffing .
+ Index: INSTALL
+ ===================================================================
+ RCS file: /cvs/misc/lib/libident/INSTALL,v
+ retrieving revision 1.1.1.1
+ retrieving revision 1.2
+ diff -c -r1.1.1.1 -r1.2
+ *** INSTALL	14 Feb 1995 20:48:22 -0000	1.1.1.1
+ --- INSTALL	13 Apr 1998 02:02:51 -0000	1.2
+ ***************
+ *** 4,10 ****
+   
+   where target can be one of:
+   
+ ! 	sunos5, sunos4, svr4, bsd, linux, nextstep3.0 or nextstep3.1
+   
+   For other systems you'll need to hack the Makefile (please do send
+   me any patches you make so I can include them into the next version!)
+ --- 4,11 ----
+   
+   where target can be one of:
+   
+ ! 	sunos5, sunos4, svr4, bsd, bsd2.11, bsd4.4, linux, nextstep3.0,
+ ! 	or nextstep3.1
+   
+   For other systems you'll need to hack the Makefile (please do send
+   me any patches you make so I can include them into the next version!)
+ Index: README
+ ===================================================================
+ RCS file: /cvs/misc/lib/libident/README,v
+ retrieving revision 1.1.1.3
+ retrieving revision 1.2
+ diff -c -r1.1.1.3 -r1.2
+ *** README	13 Apr 1998 00:55:33 -0000	1.1.1.3
+ --- README	22 Apr 2002 21:48:56 -0000	1.2
+ ***************
+ *** 13,19 ****
+   
+   The official FTP site and location for libident is:
+   
+ ! 	ftp://ftp.lysator.liu.se/pub/ident/libs
+   
+   
+   COMMENTS:
+ --- 13,19 ----
+   
+   The official FTP site and location for libident is:
+   
+ ! 	ftp://ftp.lysator.liu.se/pub/ident/libs/
+   
+   
+   COMMENTS:
+ Index: id_close.c
+ ===================================================================
+ RCS file: /cvs/misc/lib/libident/id_close.c,v
+ retrieving revision 1.1.1.1
+ retrieving revision 1.3
+ diff -c -r1.1.1.1 -r1.3
+ Index: id_open.c
+ ===================================================================
+ RCS file: /cvs/misc/lib/libident/id_open.c,v
+ retrieving revision 1.1.1.4
+ retrieving revision 1.2
+ diff -c -r1.1.1.4 -r1.2
+ *** id_open.c	14 Mar 1999 22:37:07 -0000	1.1.1.4
+ --- id_open.c	22 Apr 2002 22:10:04 -0000	1.2
+ ***************
+ *** 38,52 ****
+   #endif
+   
+   
+ - /*
+   ident_t *id_open __P3(struct in_addr *, laddr,
+   		      struct in_addr *, faddr,
+   		      struct timeval *, timeout)
+ - */
+ - 
+ - ident_t *id_open __P((	__STRUCT_IN_ADDR_P laddr,
+ - 			__STRUCT_IN_ADDR_P faddr,
+ - 			__STRUCT_TIMEVAL_P timeout))
+   {
+       ident_t *id;
+       int res, tmperrno;
+ --- 38,46 ----
+ Index: id_parse.c
+ ===================================================================
+ RCS file: /cvs/misc/lib/libident/id_parse.c,v
+ retrieving revision 1.1.1.5
+ retrieving revision 1.5
+ diff -c -r1.1.1.5 -r1.5
+ *** id_parse.c	14 Mar 1999 22:37:07 -0000	1.1.1.5
+ --- id_parse.c	22 Apr 2002 22:10:04 -0000	1.5
+ ***************
+ *** 24,44 ****
+   #include <sys/wait.h>
+   #include <sys/time.h>
+   
+ - #ifdef _AIX
+ - #  include <sys/select.h>
+ - #endif
+ - 
+ - #ifdef _AIX
+ - #  include <sys/select.h>
+ - #endif
+   #ifdef VMS
+   #  include <sys/socket.h>     /* for fd_set */
+   #endif
+   #define IN_LIBIDENT_SRC
+   #include "ident.h"
+   
+   
+ - /*
+   int id_parse __P7(ident_t *, id,
+   		  struct timeval *, timeout,
+   		  int *, lport,
+ --- 24,37 ----
+   #include <sys/wait.h>
+   #include <sys/time.h>
+   
+   #ifdef VMS
+   #  include <sys/socket.h>     /* for fd_set */
+   #endif
+ + 
+   #define IN_LIBIDENT_SRC
+   #include "ident.h"
+   
+   
+   int id_parse __P7(ident_t *, id,
+   		  struct timeval *, timeout,
+   		  int *, lport,
+ ***************
+ *** 46,60 ****
+   		  char **, identifier,
+   		  char **, opsys,
+   		  char **, charset)
+ - */
+ - 
+ - int id_parse __P((  ident_t *id,               
+ -                     __STRUCT_TIMEVAL_P timeout,
+ -                     int *lport,                
+ -                     int *fport,                
+ -                     char **identifier,         
+ -                     char **opsys,              
+ -                     char **charset))           
+   {
+       char c, *cp, *tmp_charset;
+       fd_set rs;
+ --- 39,44 ----
+ ***************
+ *** 98,110 ****
+   	}
+       }
+       
+ !     /* Every octal value is allowed except 0, \n and \r */
+ !     while (pos < sizeof(id->buf) &&
+ ! 	   (res = read(id->fd, id->buf + pos, 1)) == 1 &&
+ ! 	   id->buf[pos] != '\n' && id->buf[pos] != '\r')
+   	pos++;
+       
+ !     if (res < 0)
+   	return -1;
+       
+       if (res == 0)
+ --- 82,102 ----
+   	}
+       }
+       
+ !     /* Every 8-bit value is allowed except 0, \n, and \r */
+ !     while (pos < (sizeof(id->buf) - 1) &&
+ ! 	   (res = read(id->fd, &(id->buf[pos]), 1)) == 1 &&
+ ! 	   id->buf[pos] != '\n' &&
+ ! 	   id->buf[pos] != '\r')
+ !     {
+ ! 	if (id->buf[pos] == '\0')
+ ! 	{
+ ! 	    errno = EINVAL;
+ ! 	    return -1;
+ ! 	}
+   	pos++;
+ +     }
+       
+ !     if (res < 0)		/* errno set by read() */
+   	return -1;
+       
+       if (res == 0)
+ ***************
+ *** 184,190 ****
+   	*/
+   	if (c == ',')
+   	{
+ ! 	    cp = id_strtok((char *)0, ":", &c);
+   	    if (!cp)
+   		return -2;
+   	    
+ --- 176,182 ----
+   	*/
+   	if (c == ',')
+   	{
+ ! 	    cp = id_strtok((char *)0, ",:", &c);
+   	    if (!cp)
+   		return -2;
+   	    
+ Index: id_query.c
+ ===================================================================
+ RCS file: /cvs/misc/lib/libident/id_query.c,v
+ retrieving revision 1.1.1.4
+ retrieving revision 1.5
+ diff -c -r1.1.1.4 -r1.5
+ *** id_query.c	14 Mar 1999 22:37:08 -0000	1.1.1.4
+ --- id_query.c	22 Apr 2002 22:10:04 -0000	1.5
+ ***************
+ *** 18,52 ****
+   #  include <unistd.h>
+   #endif
+   
+ - #include <sys/types.h>
+   #include <sys/wait.h>
+ - #include <sys/time.h>
+   
+ - #ifdef _AIX
+ - #  include <sys/select.h>
+ - #endif
+ - 
+ - #ifdef _AIX
+ - #  include <sys/select.h>
+ - #endif
+   #ifdef VMS
+   #  include <sys/socket.h>     /* for fd_set */
+   #endif
+   #define IN_LIBIDENT_SRC
+   #include "ident.h"
+   
+   
+ - /*
+   int id_query __P4(ident_t *, id,
+   		  int, lport,
+   		  int, fport,
+   		  struct timeval *, timeout)
+ - */
+ - 
+ - int    id_query __P((	ident_t *id,                 
+ - 			int lport,                   
+ - 			int fport,                   
+ - 			__STRUCT_TIMEVAL_P timeout))
+   {
+   #ifdef SIGRETURNTYPE
+       SIGRETURNTYPE (*old_sig)();
+ --- 18,37 ----
+   #  include <unistd.h>
+   #endif
+   
+   #include <sys/wait.h>
+   
+   #ifdef VMS
+   #  include <sys/socket.h>     /* for fd_set */
+   #endif
+ + 
+   #define IN_LIBIDENT_SRC
+   #include "ident.h"
+   
+   
+   int id_query __P4(ident_t *, id,
+   		  int, lport,
+   		  int, fport,
+   		  struct timeval *, timeout)
+   {
+   #ifdef SIGRETURNTYPE
+       SIGRETURNTYPE (*old_sig)();
+ Index: ident.3
+ ===================================================================
+ RCS file: /cvs/misc/lib/libident/ident.3,v
+ retrieving revision 1.1.1.2
+ retrieving revision 1.4
+ diff -c -r1.1.1.2 -r1.4
+ *** ident.3	11 Aug 1995 18:06:59 -0000	1.1.1.2
+ --- ident.3	22 Apr 2002 21:54:23 -0000	1.4
+ ***************
+ *** 1,11 ****
+   .\" Pär Emanuelsson <pell@lysator.liu.se> 1993-03-28
+   .ds : \h'\w'u'u/5'\z"\h'-\w'e'u/5'
+ ! .TH IDENT 3N "4 April 1993" "Lysator ACS"
+   .SH NAME
+ ! ident_lookup, ident_id, ident_free, id_open, id_close, id_query, id_parse,
+ ! id_fileno \- query remote IDENT server
+   .SH SYNOPSIS
+   .nf
+   .B #include <ident.h>
+   .LP
+   .I High-level calls
+ --- 1,21 ----
+   .\" Pär Emanuelsson <pell@lysator.liu.se> 1993-03-28
+   .ds : \h'\w'u'u/5'\z"\h'-\w'e'u/5'
+ ! .TH IDENT 3N "12 April 1998" "Lysator ACS"
+   .SH NAME
+ ! ident_lookup, ident_id, ident_free, id_open, id_close, id_query, id_parse, id_fileno \- query remote IDENT server
+   .SH SYNOPSIS
+   .nf
+ + .B #if TIME_WITH_SYS_TIME
+ + .B # include <sys/time.h>
+ + .B # include <time.h>
+ + .B #else
+ + .B # if HAVE_SYS_TIME_H
+ + .B #  include <sys/time.h>
+ + .B # else
+ + .B #  include <time.h>
+ + .B # endif
+ + .B #endif
+ + .B #include <netinet/in.h>
+   .B #include <ident.h>
+   .LP
+   .I High-level calls
+ ***************
+ *** 18,44 ****
+   .LP
+   .I Low-level calls
+   .LP
+ ! .B id_t *id_open(laddr, faddr, timeout)
+   .B struct in_addr *laddr, *faddr;
+   .B struct timeval *timeout;
+   .LP
+   .B int id_close(id)
+ ! .B id_t *id;
+   .LP
+   .B id_query(id, lport, fport, timeout)
+ ! .B id_t *id;
+   .B int lport, fport;
+   .B struct timeval *timeout;
+   .LP
+   .B int id_parse(id, timeout, lport, fport, identifier,
+ ! .B		opsys, charset)
+ ! .B id_t *id;
+   .B struct timeval *timeout;
+   .B int *lport, *fport;
+   .B char **identifier, **opsys, **charset;
+   .LP
+   .B int id_fileno(id)
+ ! .B id_t *id;
+   .fi
+   .SH DESCRIPTION
+   .LP
+ --- 28,54 ----
+   .LP
+   .I Low-level calls
+   .LP
+ ! .B ident_t *id_open(laddr, faddr, timeout)
+   .B struct in_addr *laddr, *faddr;
+   .B struct timeval *timeout;
+   .LP
+   .B int id_close(id)
+ ! .B ident_t *id;
+   .LP
+   .B id_query(id, lport, fport, timeout)
+ ! .B ident_t *id;
+   .B int lport, fport;
+   .B struct timeval *timeout;
+   .LP
+   .B int id_parse(id, timeout, lport, fport, identifier,
+ ! .B \ \ \ \ \ \ \ \ \ \ \ \ \ opsys, charset)
+ ! .B ident_t *id;
+   .B struct timeval *timeout;
+   .B int *lport, *fport;
+   .B char **identifier, **opsys, **charset;
+   .LP
+   .B int id_fileno(id)
+ ! .B ident_t *id;
+   .fi
+   .SH DESCRIPTION
+   .LP
+ ***************
+ *** 50,57 ****
+   which should be a socket file descriptor.
+   .I timeout
+   is the longest permissible time to block waiting for an answer, and is
+ ! given in seconds. A value of 0 (zero) means wait indefinitely (which in the
+ ! most extreme case will normally be until the underlying network times out).
+   .B ident_lookup
+   returns a pointer to an
+   .I IDENT
+ --- 60,68 ----
+   which should be a socket file descriptor.
+   .I timeout
+   is the longest permissible time to block waiting for an answer, and is
+ ! given in seconds.  A value of 0 (zero) means wait indefinitely (which in
+ ! the most extreme case will normally be until the underlying network
+ ! times out).
+   .B ident_lookup
+   returns a pointer to an
+   .I IDENT
+ ***************
+ *** 65,71 ****
+   	int fport;		/* Far (remote) port */
+   	char *identifier;	/* Normally user name */
+   	char *opsys;		/* OS */
+ ! 	char *charset;		/* Charset (what did you expect?) */
+   } IDENT;
+   .ft R
+   .fi
+ --- 76,82 ----
+   	int fport;		/* Far (remote) port */
+   	char *identifier;	/* Normally user name */
+   	char *opsys;		/* OS */
+ ! 	char *charset;		/* for identifier & opsys */
+   } IDENT;
+   .ft R
+   .fi
+ ***************
+ *** 81,91 ****
+   struct) points to malloc'd data, which can be freed with a call to
+   .B ident_free.
+   .B ident_lookup
+ ! returns 0 on error or timeout. Presently, this should normally be taken to
+ ! mean that the remote site is not running an
+   .SM IDENT
+ ! server, but it might naturally be caused by other network related problems
+ ! as well.
+   .B Note that
+   all fields of the
+   .SM IDENT
+ --- 92,102 ----
+   struct) points to malloc'd data, which can be freed with a call to
+   .B ident_free.
+   .B ident_lookup
+ ! returns 0 on error or timeout.  Presently, this should normally be taken
+ ! to mean that the remote site is not running an
+   .SM IDENT
+ ! server, but it might naturally be caused by other network related
+ ! problems as well.
+   .B Note that
+   all fields of the
+   .SM IDENT
+ ***************
+ *** 110,118 ****
+   .ce
+   .I Low-level calls
+   .LP
+ ! The low-level calls can be used when greater flexibility is needed. For
+ ! example, if non-blocking I/O is needed, or multiple queries to the
+ ! same host are to be made.
+   .LP
+   .B id_open
+   opens a connection to the remote
+ --- 121,129 ----
+   .ce
+   .I Low-level calls
+   .LP
+ ! The low-level calls can be used when greater flexibility is needed.  For
+ ! example, if non-blocking I/O is needed, or multiple queries to the same
+ ! host are to be made.
+   .LP
+   .B id_open
+   opens a connection to the remote
+ ***************
+ *** 128,138 ****
+   .B select(2).
+   .B id_open
+   returns a pointer to an
+ ! .B id_t
+ ! datum, which is an opaque structure to be used as future reference
+ ! to the opened connection. When using non-blocking I/O it might however
+ ! be useful to access the underlying socket file descriptior, which
+ ! can be gotten at through the
+   .B id_fileno
+   macro described below.
+   .LP
+ --- 139,149 ----
+   .B select(2).
+   .B id_open
+   returns a pointer to an
+ ! .B ident_t
+ ! datum, which is an opaque structure to be used as future reference to
+ ! the opened connection.  When using non-blocking I/O it might however be
+ ! useful to access the underlying socket file descriptior, which can be
+ ! gotten at through the
+   .B id_fileno
+   macro described below.
+   .LP
+ ***************
+ *** 156,162 ****
+   .B id_open.
+   If successful,
+   .B id_query
+ ! returns the number of bytes sent to the remote server. If not, -1 is
+   returned and
+   .B errno
+   is set.
+ --- 167,173 ----
+   .B id_open.
+   If successful,
+   .B id_query
+ ! returns the number of bytes sent to the remote server.  If not, -1 is
+   returned and
+   .B errno
+   is set.
+ ***************
+ *** 179,205 ****
+ --- 190,222 ----
+   .RS
+   .TP
+    1
+ + .\"
+   If completely successful.
+   .TP
+   -3
+ + .\"
+   Illegal reply type from remote server.
+   .I identifier
+   is set to the illegal reply.
+   .TP
+   -2
+ + .\"
+   Cannot parse the reply from the server.
+   .I identifier
+   is normally set to the illegal reply.
+   .TP
+   -1
+ + .\"
+   On general errors or timeout.
+   .TP
+    0
+ + .\"
+   When non-blocking mode is set and
+   .B id_parse
+   has not finished parsing the reply from the remote server.
+   .TP
+    2
+ + .\"
+   Indicates the query/reply were successful, but the remote server
+   experienced some error.
+   .I identifier
+ ***************
+ *** 212,229 ****
+   .LP
+   .B id_fileno
+   is a macro that takes an
+ ! .B id_t
+ ! handle and returns the actual socket file descriptor used for
+ ! the connection to the remote server.
+   .SH ERRORS
+   .TP 15
+   ETIMEDOUT
+   The call timed out and non-blocking I/O was not set.
+   .SH EXAMPLES
+   .LP
+ ! Here's an example how to handle the reply from id_reply() in
+ ! the case that non-blocking I/O is set. Note that id_reply() will
+ ! return 0 as long as it's not finished parsing a reply.
+   .LP
+   .RS
+   .nf
+ --- 229,256 ----
+   .LP
+   .B id_fileno
+   is a macro that takes an
+ ! .B ident_t
+ ! handle and returns the actual socket file descriptor used for the
+ ! connection to the remote server.
+   .SH ERRORS
+ + In addition to the
+ + .B errno
+ + values that may be returned by interally used system calls, these
+ + additional values may be returned:
+   .TP 15
+   ETIMEDOUT
+   The call timed out and non-blocking I/O was not set.
+ + .TP 15
+ + ENOTCONN
+ + The connection was lost while reading the reply.
+ + .TP 15
+ + EINVAL
+ + The the reply contained invalid characters.
+   .SH EXAMPLES
+   .LP
+ ! Here's an example how to handle the reply from id_reply() in the case
+ ! that non-blocking I/O is set.  Note that id_reply() will return 0 as
+ ! long as it's not finished parsing a reply.
+   .LP
+   .RS
+   .nf
+ ***************
+ *** 236,259 ****
+   
+    ...
+   
+ ! while ((rcode = id_parse(idp, timeout,
+ ! 			 &lport, &fport, &id, &op, &cs)) == 0)
+ ! 	;
+   
+ ! if (rcode < 0)
+ ! {
+ !   if (errno == ETIMEDOUT)
+ !     foo();	/* Lookup timed out */
+ !   else
+ !     bar();      /* Fatal error */
+ ! }
+ ! else if (rcode == 1)
+ ! {
+ !   /* Valid USERID protocol reply */
+ ! }
+ ! else if (rcode == 2)
+ ! {
+ !   /* Protocol ERROR reply */
+   }
+   .fi
+   .RE
+ --- 263,281 ----
+   
+    ...
+   
+ ! while ((rcode = id_parse(idp, timeout, &lport,
+ !                          &fport, &id, &op, &cs)) == 0)
+ ! 	; /* not finished parsing reply - loop */
+   
+ ! if (rcode < 0) {
+ ! 	if (errno == ETIMEDOUT)
+ ! 		foo();		/* Lookup timed out */
+ ! 	else
+ ! 		bar();		/* Fatal error */
+ ! } else if (rcode == 1) {
+ ! 	/* Valid USERID protocol reply */
+ ! } else if (rcode == 2) {
+ ! 	/* Protocol ERROR reply */
+   }
+   .fi
+   .RE
+ ***************
+ *** 270,276 ****
+   .B ident_lookup
+   and
+   .B ident_id
+ ! the blocking time in extreme cases might be as much as three times
+ ! the value given in the
+   .I timeout
+   parameter.
+ --- 292,298 ----
+   .B ident_lookup
+   and
+   .B ident_id
+ ! the blocking time in extreme cases might be as much as three times the
+ ! value given in the
+   .I timeout
+   parameter.
+ Index: ident.c
+ ===================================================================
+ RCS file: /cvs/misc/lib/libident/ident.c,v
+ retrieving revision 1.1.1.3
+ retrieving revision 1.3
+ diff -c -r1.1.1.3 -r1.3
+ *** ident.c	13 Apr 1998 00:55:46 -0000	1.1.1.3
+ --- ident.c	13 Apr 1998 01:47:34 -0000	1.3
+ ***************
+ *** 18,24 ****
+   
+   #include <errno.h>
+   
+ - #include <sys/types.h>
+   #include <sys/socket.h>
+   
+   #define IN_LIBIDENT_SRC
+ --- 18,23 ----
+ ***************
+ *** 27,34 ****
+   #include <arpa/inet.h>
+   
+   
+ - 
+ - 
+   /* Do a complete ident query and return result */
+   
+   IDENT *ident_lookup __P2(int, fd,
+ --- 26,31 ----
+ ***************
+ *** 39,49 ****
+       
+       len = sizeof(remoteaddr);
+       if (getpeername(fd, (struct sockaddr*) &remoteaddr, &len) < 0)
+ ! 	return 0;
+       
+       len = sizeof(localaddr);
+       if (getsockname(fd, (struct sockaddr *) &localaddr, &len) < 0)
+ ! 	return 0;
+   
+       return ident_query( &localaddr.sin_addr, &remoteaddr.sin_addr,
+   		       ntohs(localaddr.sin_port), ntohs(remoteaddr.sin_port),
+ --- 36,46 ----
+       
+       len = sizeof(remoteaddr);
+       if (getpeername(fd, (struct sockaddr*) &remoteaddr, &len) < 0)
+ ! 	return (IDENT *)0;
+       
+       len = sizeof(localaddr);
+       if (getsockname(fd, (struct sockaddr *) &localaddr, &len) < 0)
+ ! 	return (IDENT *)0;
+   
+       return ident_query( &localaddr.sin_addr, &remoteaddr.sin_addr,
+   		       ntohs(localaddr.sin_port), ntohs(remoteaddr.sin_port),
+ ***************
+ *** 74,80 ****
+       if (!id)
+       {
+   	errno = EINVAL;
+ ! 	return 0;
+       }
+     
+       if (timeout)
+ --- 71,77 ----
+       if (!id)
+       {
+   	errno = EINVAL;
+ ! 	return (IDENT *)0;
+       }
+     
+       if (timeout)
+ ***************
+ *** 85,97 ****
+       if (res < 0)
+       {
+   	id_close(id);
+ ! 	return 0;
+       }
+       
+       ident = (IDENT *) malloc(sizeof(IDENT));
+       if (!ident) {
+   	id_close(id);
+ ! 	return 0;
+       }
+       
+       if (timeout)
+ --- 82,94 ----
+       if (res < 0)
+       {
+   	id_close(id);
+ ! 	return (IDENT *)0;
+       }
+       
+       ident = (IDENT *) malloc(sizeof(IDENT));
+       if (!ident) {
+   	id_close(id);
+ ! 	return (IDENT *)0;
+       }
+       
+       if (timeout)
+ ***************
+ *** 113,119 ****
+       {
+   	free(ident);
+   	id_close(id);
+ ! 	return 0;
+       }
+       
+       id_close(id);
+ --- 110,116 ----
+       {
+   	free(ident);
+   	id_close(id);
+ ! 	return (IDENT *)0;
+       }
+       
+       id_close(id);
+ Index: ident.h
+ ===================================================================
+ RCS file: /cvs/misc/lib/libident/ident.h,v
+ retrieving revision 1.1.1.3
+ retrieving revision 1.4
+ diff -c -r1.1.1.3 -r1.4
+ *** ident.h	13 Apr 1998 00:55:30 -0000	1.1.1.3
+ --- ident.h	22 Apr 2002 22:10:30 -0000	1.4
+ ***************
+ *** 13,22 ****
+   #endif
+   
+   /* Sigh */
+ ! #ifdef __STDC__
+ ! #  if __STDC__ == 1
+ ! #    define IS_STDC 1
+ ! #  endif
+   #endif
+   
+   #ifdef __P
+ --- 13,20 ----
+   #endif
+   
+   /* Sigh */
+ ! #if (0 - __STDC__) <= -1
+ ! #  define IS_STDC 1
+   #endif
+   
+   #ifdef __P
+ ***************
+ *** 45,51 ****
+   
+   #  define __P7(t1,a1,t2,a2,t3,a3,t4,a4,t5,a5,t6,a6,t7,a7) \
+       (t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7 a7)
+ ! #endif
+       
+   #else
+   
+ --- 43,49 ----
+   
+   #  define __P7(t1,a1,t2,a2,t3,a3,t4,a4,t5,a5,t6,a6,t7,a7) \
+       (t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7 a7)
+ ! #endif /* IN_LIBIDENT_SRC */
+       
+   #else
+   
+ ***************
+ *** 82,88 ****
+       t5 a5; \
+       t6 a6; \
+       t7 a7;
+ ! #endif
+   #endif
+   
+   #ifdef IS_STDC
+ --- 80,86 ----
+       t5 a5; \
+       t6 a6; \
+       t7 a7;
+ ! #endif /* IN_LIBIDENT_SRC */
+   #endif
+   
+   #ifdef IS_STDC
+ ***************
+ *** 96,129 ****
+   #  include <bstring.h>
+   #endif
+   #include <sys/types.h>
+   #include <netinet/in.h>
+ - #include <sys/time.h>
+   
+   #if defined(VMS) && !defined(FD_SETSIZE)
+   #  define FD_SETSIZE 64
+   #endif
+   
+ - /*
+ -  * Sigh, GCC v2 complains when using undefined struct tags
+ -  * in function prototypes...
+ -  */
+ - #if defined(__GNUC__) && !defined(INADDR_ANY)
+ - #  define __STRUCT_IN_ADDR_P	void *
+ - #else
+ - #  define __STRUCT_IN_ADDR_P	struct in_addr *
+ - #endif
+ - 
+ - #if defined(__GNUC__) && !defined(DST_NONE)
+ - #  define __STRUCT_TIMEVAL_P	void *
+ - #else
+ - #  define __STRUCT_TIMEVAL_P	struct timeval *
+ - #endif
+ - 
+ - #if defined(__sgi) && defined(_POSIX_SOURCE)
+ - #  undef  __STRUCT_TIMEVAL_P
+ - #  define __STRUCT_TIMEVAL_P	void *
+ - #endif
+ - 	
+   #ifndef IDBUFSIZE
+   #  define IDBUFSIZE 2048
+   #endif
+ --- 94,115 ----
+   #  include <bstring.h>
+   #endif
+   #include <sys/types.h>
+ + #if TIME_WITH_SYS_TIME
+ + # include <sys/time.h>
+ + # include <time.h>
+ + #else
+ + # if HAVE_SYS_TIME_H
+ + #  include <sys/time.h>
+ + # else
+ + #  include <time.h>
+ + # endif
+ + #endif
+   #include <netinet/in.h>
+   
+   #if defined(VMS) && !defined(FD_SETSIZE)
+   #  define FD_SETSIZE 64
+   #endif
+   
+   #ifndef IDBUFSIZE
+   #  define IDBUFSIZE 2048
+   #endif
+ ***************
+ *** 149,167 ****
+   /* Low-level calls and macros */
+   #define id_fileno(ID)	((ID)->fd)
+   
+ ! extern ident_t * id_open __P((__STRUCT_IN_ADDR_P laddr,
+ ! 			   __STRUCT_IN_ADDR_P faddr,
+ ! 			   __STRUCT_TIMEVAL_P timeout));
+     
+   extern int    id_close __P((ident_t *id));
+     
+   extern int    id_query __P((ident_t *id,
+   			    int lport,
+   			    int fport,
+ ! 			    __STRUCT_TIMEVAL_P timeout));
+     
+   extern int    id_parse __P((ident_t *id,
+ ! 			    __STRUCT_TIMEVAL_P timeout,
+   			    int *lport,
+   			    int *fport,
+   			    char **identifier,
+ --- 135,153 ----
+   /* Low-level calls and macros */
+   #define id_fileno(ID)	((ID)->fd)
+   
+ ! extern ident_t * id_open __P((struct in_addr * laddr,
+ ! 			   struct in_addr * faddr,
+ ! 			   struct timeval * timeout));
+     
+   extern int    id_close __P((ident_t *id));
+     
+   extern int    id_query __P((ident_t *id,
+   			    int lport,
+   			    int fport,
+ ! 			    struct timeval * timeout));
+     
+   extern int    id_parse __P((ident_t *id,
+ ! 			    struct timeval * timeout,
+   			    int *lport,
+   			    int *fport,
+   			    char **identifier,
+ ***************
+ *** 174,180 ****
+   
+   extern char  *ident_id __P((int fd, int timeout));
+   
+ ! extern IDENT *ident_query __P(( __STRUCT_IN_ADDR_P laddr, __STRUCT_IN_ADDR_P raddr, int lport, int rport, int timeout));
+   
+   extern void   ident_free __P((IDENT *id));
+   
+ --- 160,166 ----
+   
+   extern char  *ident_id __P((int fd, int timeout));
+   
+ ! extern IDENT *ident_query __P(( struct in_addr * laddr, struct in_addr * raddr, int lport, int rport, int timeout));
+   
+   extern void   ident_free __P((IDENT *id));
+   
+ Index: lookup-tester.c
+ ===================================================================
+ RCS file: /cvs/misc/lib/libident/lookup-tester.c,v
+ retrieving revision 1.1.1.1
+ retrieving revision 1.2
+ diff -c -r1.1.1.1 -r1.2
+ *** lookup-tester.c	14 Feb 1995 20:48:22 -0000	1.1.1.1
+ --- lookup-tester.c	13 Apr 1998 01:48:58 -0000	1.2
+ ***************
+ *** 15,22 ****
+   #  include <unistd.h>
+   #endif
+   
+ - #include <sys/types.h>
+ - 
+   /* Need this to make fileno() visible when compiling with strict ANSI */
+   #ifndef _POSIX_C_SOURCE
+   #  define _POSIX_C_SOURCE
+ --- 15,20 ----
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: wiz 
State-Changed-When: Tue Oct 22 04:45:13 PDT 2002 
State-Changed-Why:  
I changed libident to use buildlink2, and added a buildlink2.mk. 
The buildlink2.mk you provided didn't have the standard RCS Id, and 
it did not define LIBIDENT_BUILDLINK2_MK, so multiple-inclusion-protection 
was broken. 

I won't add your patches to pkgsrc -- I can't evaluate them, and you didn't 
provide any clues on what problems they are solving. Please contact the 
program's author and try to get them included there. 

From: Thomas Klausner <wiz@netbsd.org>
To: gnats-bugs@gnats.netbsd.org
Cc:  
Subject: pr/18728 CVS commit: pkgsrc/security/libident
Date: Tue, 22 Oct 2002 14:44:59 +0300 (EEST)

 Module Name:	pkgsrc
 Committed By:	wiz
 Date:		Tue Oct 22 11:44:58 UTC 2002

 Modified Files:
 	pkgsrc/security/libident: Makefile
 Added Files:
 	pkgsrc/security/libident: buildlink2.mk

 Log Message:
 Convert to buildlink2, and add buildlink2.mk. Inspired by PR 18728.


 To generate a diff of this commit:
 cvs rdiff -r1.8 -r1.9 pkgsrc/security/libident/Makefile
 cvs rdiff -r0 -r1.1 pkgsrc/security/libident/buildlink2.mk

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.


From: woods@weird.com (Greg A. Woods)
To: wiz@netbsd.org
Cc: gnats-bugs@gnats.netbsd.org (NetBSD GNATS submissions and followups),
  pkg-manager@netbsd.org
Subject: Re: pkg/18728
Date: Tue, 22 Oct 2002 14:57:44 -0400 (EDT)

 [ On , October 22, 2002 at 11:47:19 (-0000), wiz@netbsd.org wrote: ]
 > Subject: Re: pkg/18728
 >
 > I won't add your patches to pkgsrc -- I can't evaluate them, and you didn't
 > provide any clues on what problems they are solving.

 You should try.  You might learn something.  They are pretty simple and
 straight forward.  There's even one very serious bug fix (and which it
 is should be quite obvious too).

 Of course they're not all necessary -- some are merely cosmetic fixes to
 the documentation, but there's no reason not to have such fixes in
 pkgsrc.

 Did you even test building it?  Did you try using the result with
 anything?

 > Please contact the
 > program's author and try to get them included there.

 been there, done that, no response.  You are I hope aware that this
 package hasn't been updated by its most recent maintainer for almost
 four years now.

 -- 
 								Greg A. Woods

 +1 416 218-0098;            <g.a.woods@ieee.org>;           <woods@robohack.ca>
 Planix, Inc. <woods@planix.com>; VE3TCP; Secrets of the Weird <woods@weird.com>

From: Thomas Klausner <wiz@netbsd.org>
To: NetBSD GNATS submissions and followups <gnats-bugs@gnats.netbsd.org>,
  "Greg A. Woods; Planix, Inc." <woods@planix.com>
Cc:  
Subject: Re: pkg/18728
Date: Wed, 23 Oct 2002 14:30:08 +0200

 On Tue, Oct 22, 2002 at 02:57:44PM -0400, Greg A. Woods wrote:
 > [ On , October 22, 2002 at 11:47:19 (-0000), wiz@netbsd.org wrote: ]
 > > Subject: Re: pkg/18728
 > >
 > > I won't add your patches to pkgsrc -- I can't evaluate them, and you didn't
 > > provide any clues on what problems they are solving.
 > 
 > You should try.  You might learn something.  They are pretty simple and
 > straight forward.  There's even one very serious bug fix (and which it
 > is should be quite obvious too).

 Thanks for the suggestion, but I have better things to do than read
 code changes to code I don't know, where the submitter of the code
 changes did not even think it worth _his_ time to provide comments on
 the changes -- so why should I think it worth my time to extract
 possible real fixes out of it?

 > been there, done that, no response.  You are I hope aware that this
 > package hasn't been updated by its most recent maintainer for almost
 > four years now.

 That's a pity.
 If you comment your changes, I'll try to integrate them into pkgsrc --
 how does that sound?

 Bye,
  Thomas

 -- 
 Thomas Klausner - wiz@danbala.ifoer.tuwien.ac.at
 Main Rule of Usenet:  Never argue with idiots.  They drag you down to
 their level, then beat you with experience.

From: woods@weird.com (Greg A. Woods)
To: Thomas Klausner <wiz@netbsd.org>
Cc: NetBSD GNATS submissions and followups <gnats-bugs@gnats.netbsd.org>,
  "Greg A. Woods; Planix, Inc." <woods@planix.com>
Subject: Re: pkg/18728
Date: Wed, 23 Oct 2002 11:38:15 -0400 (EDT)

 [ On Wednesday, October 23, 2002 at 14:30:08 (+0200), Thomas Klausner wrote: ]
 > Subject: Re: pkg/18728
 >
 > On Tue, Oct 22, 2002 at 02:57:44PM -0400, Greg A. Woods wrote:
 > > [ On , October 22, 2002 at 11:47:19 (-0000), wiz@netbsd.org wrote: ]
 > > > Subject: Re: pkg/18728
 > > >
 > > > I won't add your patches to pkgsrc -- I can't evaluate them, and you didn't
 > > > provide any clues on what problems they are solving.
 > > 
 > > You should try.  You might learn something.  They are pretty simple and
 > > straight forward.  There's even one very serious bug fix (and which it
 > > is should be quite obvious too).
 > 
 > Thanks for the suggestion, but I have better things to do than read
 > code changes to code I don't know, where the submitter of the code
 > changes did not even think it worth _his_ time to provide comments on
 > the changes -- so why should I think it worth my time to extract
 > possible real fixes out of it?

 Then what the heck are you doing working on this PR!?!?!?!?!?

 I appreciate your dedication to maintaining pkgsrc and your ability to
 work within the bounds of TNF, but if you cannot properly evaluate and
 test the changes I provided then you should either have trusted my
 judgment or not have done anything with the PR at all (except maybe
 facilitate passing it over to someone who could do that testing)!

 I don't need or want you to integrate only half my changes.  That only
 makes tracking and using pkgsrc harder for me and it makes it far less
 likely that I'll submit changes in the future since it's much easier for
 me to just maintain my changes locally.  Take for instance the recent
 flurry of PRs I sent.  I've been sitting on many of those changes for
 many months now and this set of PRs was more an experiment in
 interaction with TNF than anything else.  So far I'm not sure I'm all
 that satisfied with the results, though I'm very well aware that I may
 have to take some of the blame too.  I'm not really blaming you
 personally for any failure either -- just a clash of goals and ideals
 perhaps.

 > That's a pity.
 > If you comment your changes, I'll try to integrate them into pkgsrc --
 > how does that sound?

 I'll comment on whichever changes are non-obvious to you, sure, but I
 expect that you'll also take the time and effort to actually test the
 result for yourself too, and if not then I would request that you pass
 this PR on to someone who can.

 FYI, You can be sure that I am actually using the changes I submitted,
 and in this case I've been using them for quite a long time with several
 other packages.  I don't make changes out of the blue just for fun -- I
 make them because I'm actually using the software in question.

 -- 
 								Greg A. Woods

 +1 416 218-0098;            <g.a.woods@ieee.org>;           <woods@robohack.ca>
 Planix, Inc. <woods@planix.com>; VE3TCP; Secrets of the Weird <woods@weird.com>

From: Thomas Klausner <wiz@netbsd.org>
To: NetBSD GNATS submissions and followups <gnats-bugs@gnats.netbsd.org>,
  "Greg A. Woods; Planix, Inc." <woods@planix.com>
Cc:  
Subject: Re: pkg/18728
Date: Sun, 22 Dec 2002 03:34:51 +0100

 Hi!

 Why this part (for id_parse.c):
 + ***************
 + *** 98,110 ****
 +       }
 +       }
 +       
 + !     /* Every octal value is allowed except 0, \n and \r */
 + !     while (pos < sizeof(id->buf) &&
 + !        (res = read(id->fd, id->buf + pos, 1)) == 1 &&
 + !        id->buf[pos] != '\n' && id->buf[pos] != '\r')
 +       pos++;
 +       
 + !     if (res < 0)
 +       return -1;
 +       
 +       if (res == 0)
 + --- 82,102 ----
 +       }
 +       }
 +       
 + !     /* Every 8-bit value is allowed except 0, \n, and \r */
 + !     while (pos < (sizeof(id->buf) - 1) &&
 + !        (res = read(id->fd, &(id->buf[pos]), 1)) == 1 &&
 + !        id->buf[pos] != '\n' &&
 + !        id->buf[pos] != '\r')
 + !     {
 + !     if (id->buf[pos] == '\0')
 + !     {
 + !         errno = EINVAL;
 + !         return -1;
 + !     }
 +       pos++;
 + +     }
 +       
 + !     if (res < 0)            /* errno set by read() */
 +       return -1;
 +       
 +       if (res == 0)



 Why this one:
 + ***************
 + *** 184,190 ****
 +       */
 +       if (c == ',')
 +       {
 + !         cp = id_strtok((char *)0, ":", &c);
 +           if (!cp)
 +               return -2;
 +           
 + --- 176,182 ----
 +       */
 +       if (c == ',')
 +       {
 + !         cp = id_strtok((char *)0, ",:", &c);
 +           if (!cp)
 +               return -2;


 The other parts of the patch looks like they might get accepted
 by a maintainer, but since pkgsrc is not the place to maintain
 software, and you said that this software is unmaintained, you
 might just maintain it yourself?

 I don't think they belong in pkgsrc though (reducing compilation
 warnings, nit fixes for documentation). Tell me if I overlooked something,
 of course.

 Bye,
  Thomas

 -- 
 Thomas Klausner - wiz@danbala.ifoer.tuwien.ac.at
 What is wanted is not the will to believe, but the will to find
 out, which is the exact opposite. -- Bertrand Russell

From: woods@weird.com (Greg A. Woods)
To: Thomas Klausner <wiz@netbsd.org>
Cc: NetBSD GNATS submissions and followups <gnats-bugs@gnats.netbsd.org>,
Subject: Re: pkg/18728
Date: Sat,  4 Jan 2003 16:01:16 -0500 (EST)

 [ On Sunday, December 22, 2002 at 03:34:51 (+0100), Thomas Klausner wrote: ]
 > Subject: Re: pkg/18728
 >
 > Hi!
 > 
 > Why this part (for id_parse.c):

 I'm pretty sure I was getting crashes without the first part of this fix.

 Here's what I wrote in my local CVS commit:

 ----------------------------
 revision 1.4
 date: 2002/04/22 21:53:41;  author: woods;  state: Exp;  lines: +24 -6
 - one more __STRUCT_TIMEVAL_P function parameter
 - don't over-fill the reply buffer!
 - better error checking of read reply
 - only parse the first subfield of the third field (i.e. stop on the
   first ',' or ':')
 ----------------------------

 > + ***************
 > + *** 98,110 ****
 > +       }
 > +       }
 > +       
 > + !     /* Every octal value is allowed except 0, \n and \r */
 > + !     while (pos < sizeof(id->buf) &&
 > + !        (res = read(id->fd, id->buf + pos, 1)) == 1 &&
 > + !        id->buf[pos] != '\n' && id->buf[pos] != '\r')
 > +       pos++;
 > +       
 > + !     if (res < 0)
 > +       return -1;
 > +       
 > +       if (res == 0)
 > + --- 82,102 ----
 > +       }
 > +       }
 > +       
 > + !     /* Every 8-bit value is allowed except 0, \n, and \r */
 > + !     while (pos < (sizeof(id->buf) - 1) &&
 > + !        (res = read(id->fd, &(id->buf[pos]), 1)) == 1 &&
 > + !        id->buf[pos] != '\n' &&
 > + !        id->buf[pos] != '\r')
 > + !     {
 > + !     if (id->buf[pos] == '\0')
 > + !     {
 > + !         errno = EINVAL;
 > + !         return -1;
 > + !     }
 > +       pos++;
 > + +     }
 > +       
 > + !     if (res < 0)            /* errno set by read() */
 > +       return -1;
 > +       
 > +       if (res == 0)
 > 
 > 
 > 
 > Why this one:
 > + ***************
 > + *** 184,190 ****
 > +       */
 > +       if (c == ',')
 > +       {
 > + !         cp = id_strtok((char *)0, ":", &c);
 > +           if (!cp)
 > +               return -2;
 > +           
 > + --- 176,182 ----
 > +       */
 > +       if (c == ',')
 > +       {
 > + !         cp = id_strtok((char *)0, ",:", &c);
 > +           if (!cp)
 > +               return -2;
 > 
 > 
 > The other parts of the patch looks like they might get accepted
 > by a maintainer, but since pkgsrc is not the place to maintain
 > software, and you said that this software is unmaintained, you
 > might just maintain it yourself?

 I do maintain it -- but so far only for myself!  ;-)

 However I don't really have the time and resources to add this package
 to the many I already make "public" releases of.


 > I don't think they belong in pkgsrc though (reducing compilation
 > warnings, nit fixes for documentation). Tell me if I overlooked something,
 > of course.

 They are necessary fixes for a package.


 Strictly speaking I think this library should be included directly in
 NetBSD as a core component of the base release (to accompany identd).

 -- 
 								Greg A. Woods

 +1 416 218-0098;            <g.a.woods@ieee.org>;           <woods@robohack.ca>
 Planix, Inc. <woods@planix.com>; VE3TCP; Secrets of the Weird <woods@weird.com>
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.