--- libident-0.22.orig/id_open.c +++ libident-0.22/id_open.c @@ -3,6 +3,7 @@ ** ** Author: Peter Eriksson ** Fixes: Pär Emanuelsson +** QNX mod: Sven Behnsen (inserted by PH) */ #ifdef NeXT3 @@ -50,7 +51,11 @@ { ident_t *id; int res, tmperrno; +#ifdef INET6 + struct sockaddr_in6 sin_laddr, sin_faddr; +#else struct sockaddr_in sin_laddr, sin_faddr; +#endif fd_set rs, ws, es; #ifndef OLD_SETSOCKOPT int on = 1; @@ -60,7 +65,11 @@ if ((id = (ident_t *) malloc(sizeof(*id))) == 0) return 0; +#ifdef INET6 + if ((id->fd = socket(AF_INET6, SOCK_STREAM, 0)) < 0) +#else if ((id->fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) +#endif { free(id); return 0; @@ -72,9 +81,11 @@ goto ERROR; #ifndef VMS +#ifndef __QNX__ if (fcntl(id->fd, F_SETFL, res | FNDELAY) < 0) goto ERROR; #endif +#endif } /* We silently ignore errors if we can't change LINGER */ @@ -94,9 +105,15 @@ id->buf[0] = '\0'; bzero((char *)&sin_laddr, sizeof(sin_laddr)); +#ifdef INET6 + sin_laddr.sin6_family = AF_INET6; + sin_laddr.sin6_addr = *laddr; + sin_laddr.sin6_port = 0; +#else sin_laddr.sin_family = AF_INET; sin_laddr.sin_addr = *laddr; sin_laddr.sin_port = 0; +#endif if (bind(id->fd, (struct sockaddr *) &sin_laddr, sizeof(sin_laddr)) < 0) { @@ -107,9 +124,15 @@ } bzero((char *)&sin_faddr, sizeof(sin_faddr)); +#ifdef INET6 + sin_faddr.sin6_family = AF_INET6; + sin_faddr.sin6_addr = *faddr; + sin_faddr.sin6_port = htons(IDPORT); +#else sin_faddr.sin_family = AF_INET; sin_faddr.sin_addr = *faddr; sin_faddr.sin_port = htons(IDPORT); +#endif errno = 0; res = connect(id->fd, (struct sockaddr *) &sin_faddr, sizeof(sin_faddr)); @@ -131,7 +154,12 @@ FD_SET(id->fd, &ws); FD_SET(id->fd, &es); -#ifdef __hpux +/* Modern versions of HP-UX use the correct types for the arguments +of select(). Older versions do not. Luckily older versions also define +"hpux" whereas modern versions use only "__hpux" (to be more standard). +Changed this test from __hpux to hpux on 2-Feb-99 (PH). */ + +#if defined(hpux) || defined(__H3050) || defined(__H3050R) if ((res = select(FD_SETSIZE, (int *) &rs, (int *) &ws, (int *) &es, timeout)) < 0) #else if ((res = select(FD_SETSIZE, &rs, &ws, &es, timeout)) < 0) --- libident-0.22.orig/ident.3 +++ libident-0.22/ident.3 @@ -1,6 +1,6 @@ .\" Pär Emanuelsson 1993-03-28 .ds : \h'\w'u'u/5'\z"\h'-\w'e'u/5' -.TH IDENT 3N "4 April 1993" "Lysator ACS" +.TH IDENT 3 "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 @@ -156,7 +156,7 @@ .B id_open. If successful, .B id_query -returns the number of bytes sent to the remote server. If not, -1 is +returns the number of bytes sent to the remote server. If not, \-1 is returned and .B errno is set. @@ -181,17 +181,17 @@ 1 If completely successful. .TP --3 +\-3 Illegal reply type from remote server. .I identifier is set to the illegal reply. .TP --2 +\-2 Cannot parse the reply from the server. .I identifier is normally set to the illegal reply. .TP --1 +\-1 On general errors or timeout. .TP 0 --- libident-0.22.orig/id_query.c +++ libident-0.22/id_query.c @@ -2,6 +2,7 @@ ** id_query.c Transmit a query to an IDENT server ** ** Author: Peter Eriksson +** Also fiddled by: Philip Hazel */ #ifdef NeXT3 @@ -64,7 +65,12 @@ FD_ZERO(&ws); FD_SET(id->fd, &ws); -#ifdef __hpux +/* Modern versions of HP-UX use the correct types for the arguments +of select(). Older versions do not. Luckily older versions also define +"hpux" whereas modern versions use only "__hpux" (to be more standard). +Changed this test from __hpux to hpux on 2-Feb-99 (PH). */ + +#if defined(hpux) || defined(__H3050) || defined(__H3050R) if ((res = select(FD_SETSIZE, (int *)0, (int *)&ws, (int *)0, timeout)) < 0) #else if ((res = select(FD_SETSIZE, (fd_set *)0, &ws, (fd_set *)0, timeout)) < 0) --- libident-0.22.orig/Makefile +++ libident-0.22/Makefile @@ -6,12 +6,12 @@ SHELL=/bin/sh RM=rm -f RANLIB=ranlib -AR=ar cq +AR=ar INSTROOT=/usr/local LIBDIR=$(INSTROOT)/lib INCDIR=$(INSTROOT)/include -MANDIR=$(INSTROOT)/man/man3 +MANDIR=$(INSTROOT)/share/man/man3 # # Add -g for debugging information @@ -19,12 +19,19 @@ # Add -DHAVE_ANSIHEADERS if your system have the ANSI C header files # needed for our purposes (stdlib, string, unistd). # -CFLAGS = -O - -LDLIBS = +CFLAGS = -O -DINET6 #-I/usr/local/v6/include + +LDLIBS = #-L/usr/local/v6/lib -linet6 #-lresolv LIBIDENT = libident.a +SHLIBIDENT = libident.so +SHLIB0 = libident.so.0 +SHLIB = libident.so.0.22 OBJS = ident.o id_open.o id_close.o id_query.o id_parse.o support.o version.o +SHOBJS=$(OBJS:.o=.sh.o) + +%.sh.o: %.c + $(CC) $(CFLAGS) -fPIC -c $*.c -o $@ # fail: @@ -33,6 +40,7 @@ @echo aix @echo bsd @echo bsd2.11 + @echo freebsd @echo dynix @echo hpux @echo irix @@ -48,13 +56,16 @@ @echo other -all: $(LIBIDENT) +all: $(LIBIDENT) $(SHLIBIDENT) $(LIBIDENT): $(OBJS) -$(RM) $(LIBIDENT) - $(AR) $(LIBIDENT) $(OBJS) + $(AR) cq $(LIBIDENT) $(OBJS) -$(RANLIB) $(LIBIDENT) +$(SHLIBIDENT): $(SHOBJS) + $(CC) -shared -D_REENTRANT -lc -Wl,-soname,$(SHLIB0) -o $@ $(SHOBJS) + testers: lookup-tester ident-tester ident-tester: $(LIBIDENT) ident-tester.o @@ -82,16 +93,23 @@ # install: + -$(RM) $(LIBDIR)/$(SHLIB) $(LIBDIR)/$(SHLIB0) + install -o root -g root -m 644 $(SHLIBIDENT) $(LIBDIR)/$(SHLIB) + cd $(LIBDIR) && ln -s $(SHLIB) $(SHLIB0) + +install-dev: -$(RM) $(LIBDIR)/$(LIBIDENT) - cp $(LIBIDENT) $(LIBDIR)/$(LIBIDENT) + install -o root -g root -m 644 $(LIBIDENT) $(LIBDIR)/$(LIBIDENT) -$(RANLIB) $(LIBDIR)/$(LIBIDENT) + cd $(LIBDIR) && ln -s $(SHLIB0) $(SHLIBIDENT) -$(RM) $(INCDIR)/ident.h - cp ident.h $(INCDIR)/ident.h + install -o root -g root -m 644 ident.h $(INCDIR)/ident.h -$(RM) $(MANDIR)/ident.3 - cp ident.3 $(MANDIR)/ident.3 + install -o root -g root -m 644 ident.3 $(MANDIR)/ident.3 clean: -$(RM) $(LIBIDENT) ident-tester lookup-tester *~ core *.o \#* + -$(RM) $(SHLIBIDENT) # @@ -126,6 +144,8 @@ bsd2.11: @$(MAKE) all CC="$(CC)" CFLAGS="-O -DSIGRETURNTYPE=int -DHAVE_ANSIHEADERS" +freebsd: + @$(MAKE) all CC="$(CC)" CFLAGS="-O -DHAVE_ANSIHEADERS -DINET6" # # @@ -140,7 +160,7 @@ # # linux: - @$(MAKE) all CC="gcc" CFLAGS="-O -DHAVE_ANSIHEADERS" + @$(MAKE) all CC="gcc" CFLAGS="-O -DHAVE_ANSIHEADERS -DINET6 -I/usr/inet6/include" # # --- libident-0.22.orig/id_parse.c +++ libident-0.22/id_parse.c @@ -3,6 +3,7 @@ ** ** Author: Peter Eriksson ** Fiddling: Pär Emanuelsson +** Also by: Philip Hazel */ #ifdef NeXT3 @@ -84,7 +85,12 @@ FD_ZERO(&rs); FD_SET(id->fd, &rs); -#ifdef __hpux +/* Modern versions of HP-UX use the correct types for the arguments +of select(). Older versions do not. Luckily older versions also define +"hpux" whereas modern versions use only "__hpux" (to be more standard). +Changed this test from __hpux to hpux on 2-Feb-99 (PH). */ + +#if defined(hpux) || defined(__H3050) || defined(__H3050R) if ((res = select(FD_SETSIZE, (int *) &rs, (int *)0, (int *)0, timeout)) < 0) #else if ((res = select(FD_SETSIZE, &rs, (fd_set *)0, (fd_set *)0, timeout)) < 0) @@ -113,6 +119,16 @@ return -1; } + /******/ + /* The original code did not contain this next statement. It was inserted by + PH to fix a bug. If the buffer gets entirely filled, the loop above exits + with the value of "pos" one greater than the buffer size. However, the code + below assumes that "pos" is pointing to the final character. */ + + if (pos >= sizeof(id->buf)) + return 0; /* Not properly terminated */ + /******/ + if (id->buf[pos] != '\n' && id->buf[pos] != '\r') return 0; /* Not properly terminated string */ @@ -208,6 +224,9 @@ else cp = id_strtok((char *)0, "\n\r", &c); + if (!cp) /* Added by PH to fix segfault */ + return -2; + if (identifier) { *identifier = id_strdup(cp); --- libident-0.22.orig/ident-tester.c +++ libident-0.22/ident-tester.c @@ -30,6 +30,26 @@ /* ** Return the name of the connecting host, or the IP number as a string. */ +#ifdef INET6 +char *gethost __P1(struct in6_addr *, addr) +{ + static char str[512]; + struct hostent *hp; +#ifndef linux + int h_error; +#endif + +#ifdef linux + hp = gethostbyaddr((char *) addr, sizeof(struct in6_addr), AF_INET6); +#else + hp = getipnodebyaddr((char *) addr, sizeof(struct in6_addr), AF_INET6, + &h_error); +#endif + if (hp) + return (char *) hp->h_name; + else + return inet_ntop(AF_INET6, addr, str, sizeof str); +#else char *gethost __P1(struct in_addr *, addr) { struct hostent *hp; @@ -40,20 +60,26 @@ return (char *) hp->h_name; else return inet_ntoa(*addr); +#endif } -void +int main __P2(int, argc, char **, argv) { +#ifdef INET6 + char str[512]; + struct sockaddr_in6 laddr, faddr; +#else struct sockaddr_in laddr, faddr; +#endif int len, res, lport, fport; ident_t *id; char *identifier, *opsys, *charset; puts("Welcome to the IDENT server tester, version 1.9\r\n"); - printf("(Linked with libident-%s)\r\n\n", id_version); + printf("(Linked with %s)\r\n\n", _id_version); fflush(stdout); @@ -63,7 +89,12 @@ len = sizeof(laddr); getsockname(0, (struct sockaddr *) &laddr, &len); +#ifdef INET6 + printf("Connecting to Ident server at %s...\r\n", + inet_ntop(AF_INET6, &faddr.sin6_addr, str, sizeof str)); +#else printf("Connecting to Ident server at %s...\r\n", inet_ntoa(faddr.sin_addr)); +#endif fflush(stdout); #ifdef LOG_LOCAL3 @@ -72,7 +103,11 @@ openlog("tidentd", 0); #endif +#ifdef INET6 + id = id_open(&laddr.sin6_addr, &faddr.sin6_addr, NULL); +#else id = id_open(&laddr.sin_addr, &faddr.sin_addr, NULL); +#endif if (!id) { if (errno) @@ -83,22 +118,35 @@ perror("Connection denied"); fflush(stderr); +#ifdef INET6 + hs = gethost(&faddr.sin6_addr); +#else hs = gethost(&faddr.sin_addr); +#endif errno = saved_errno; syslog(LOG_DEBUG, "Error: id_open(): host=%s, error=%m", hs); } else puts("Connection denied."); - exit(0); + return 0; } printf("Querying for lport %d, fport %d....\r\n", +#ifdef INET6 + (int) ntohs(faddr.sin6_port), + (int) ntohs(laddr.sin6_port)); +#else (int) ntohs(faddr.sin_port), (int) ntohs(laddr.sin_port)); +#endif fflush(stdout); errno = 0; +#ifdef INET6 + if (id_query(id, ntohs(faddr.sin6_port), ntohs(laddr.sin6_port), 0) < 0) +#else if (id_query(id, ntohs(faddr.sin_port), ntohs(laddr.sin_port), 0) < 0) +#endif { if (errno) { @@ -108,7 +156,11 @@ perror("id_query()"); fflush(stderr); +#ifdef INET6 + hs = gethost(&faddr.sin6_addr); +#else hs = gethost(&faddr.sin_addr); +#endif errno = saved_errno; syslog(LOG_DEBUG, "Error: id_query(): host=%s, error=%m", hs); @@ -118,7 +170,7 @@ puts("Query failed.\n"); } - exit(0); + return 0; } printf("Reading response data...\r\n"); @@ -139,7 +191,11 @@ char *hs; perror("id_parse()"); +#ifdef INET6 + hs = gethost(&faddr.sin6_addr); +#else hs = gethost(&faddr.sin_addr); +#endif errno = saved_errno; syslog(LOG_DEBUG, "Error: id_parse(): host=%s, error=%m", hs); } @@ -151,7 +207,11 @@ case -2: { int saved_errno = errno; +#ifdef INET6 + char *hs = gethost(&faddr.sin6_addr); +#else char *hs = gethost(&faddr.sin_addr); +#endif errno = saved_errno; syslog(LOG_DEBUG, "Error: id_parse(): host=%s, Parse Error: %s", @@ -167,7 +227,11 @@ case -3: { int saved_errno = errno; +#ifdef INET6 + char *hs = gethost(&faddr.sin6_addr); +#else char *hs = gethost(&faddr.sin_addr); +#endif errno = saved_errno; @@ -184,7 +248,11 @@ case 0: { int saved_errno = errno; +#ifdef INET6 + char *hs = gethost(&faddr.sin6_addr); +#else char *hs = gethost(&faddr.sin_addr); +#endif errno = saved_errno; @@ -197,7 +265,11 @@ case 2: { int saved_errno = errno; +#ifdef INET6 + char *hs = gethost(&faddr.sin6_addr); +#else char *hs = gethost(&faddr.sin_addr); +#endif errno = saved_errno; @@ -215,10 +287,18 @@ if (charset) syslog(LOG_INFO, "Reply: Userid: host=%s, opsys=%s, charset=%s, userid=%s", +#ifdef INET6 + gethost(&faddr.sin6_addr), opsys, charset, identifier); +#else gethost(&faddr.sin_addr), opsys, charset, identifier); +#endif else syslog(LOG_INFO, "Reply: Userid: host=%s, opsys=%s, userid=%s", +#ifdef INET6 + gethost(&faddr.sin6_addr), opsys, identifier); +#else gethost(&faddr.sin_addr), opsys, identifier); +#endif printf("Userid response is:\r\n"); printf(" Lport........ %d\r\n", lport); @@ -227,7 +307,11 @@ printf(" Charset...... %s\r\n", charset ? charset : ""); printf(" Identifier... %s\r\n", identifier); +#ifdef INET6 + if (id_query(id, ntohs(faddr.sin6_port), ntohs(laddr.sin6_port), 0) >= 0) +#else if (id_query(id, ntohs(faddr.sin_port), ntohs(laddr.sin_port), 0) >= 0) +#endif { if (id_parse(id, NULL, &lport, &fport, @@ -240,6 +324,6 @@ fflush(stdout); sleep(1); - exit(0); + return 0; } --- libident-0.22.orig/ident.c +++ libident-0.22/ident.c @@ -34,7 +34,11 @@ IDENT *ident_lookup __P2(int, fd, int, timeout) { +#ifdef INET6 + struct sockaddr_in6 localaddr, remoteaddr; +#else struct sockaddr_in localaddr, remoteaddr; +#endif int len; len = sizeof(remoteaddr); @@ -45,17 +49,30 @@ if (getsockname(fd, (struct sockaddr *) &localaddr, &len) < 0) return 0; +#ifdef INET6 + return ident_query( &localaddr.sin6_addr, &remoteaddr.sin6_addr, + ntohs(localaddr.sin6_port), ntohs(remoteaddr.sin6_port), +#else return ident_query( &localaddr.sin_addr, &remoteaddr.sin_addr, ntohs(localaddr.sin_port), ntohs(remoteaddr.sin_port), +#endif timeout); } +#ifdef INET6 +IDENT *ident_query __P5(struct in6_addr *, laddr, + struct in6_addr *, raddr, + int, lport, + int, rport, + int, timeout) +#else IDENT *ident_query __P5(struct in_addr *, laddr, struct in_addr *, raddr, int, lport, int, rport, int, timeout) +#endif { int res; ident_t *id; --- libident-0.22.orig/lookup-tester.c +++ libident-0.22/lookup-tester.c @@ -26,7 +26,7 @@ #define IN_LIBIDENT_SRC #include "ident.h" -void +int main __P2(int, argc, char **, argv) { @@ -68,6 +68,6 @@ fflush(stdout); sleep(1); - exit(0); + return 0; } --- libident-0.22.orig/support.c +++ libident-0.22/support.c @@ -3,6 +3,7 @@ ** ** Author: Pr Emanuelsson ** Hacked by: Peter Eriksson +** Also by: Philip Hazel */ #include #include @@ -53,13 +54,13 @@ { while (*bp) bp++; - return cs; + return cp; /* Fix by PH - was "return cs" */ } /* ** Skip leading spaces */ - while (isspace(*bp)) + while (isspace((unsigned char)*bp)) bp++; /* @@ -76,7 +77,7 @@ ** Remove trailing spaces */ *dc = *bp; - for (dc = bp-1; dc > cp && isspace(*dc); dc--) + for (dc = bp-1; dc > cp && isspace((unsigned char)*dc); dc--) ; *++dc = '\0'; --- libident-0.22.orig/version.c +++ libident-0.22/version.c @@ -1 +1 @@ -char id_version[] = "0.21"; +char _id_version[] = "libident 0.22 Debian "; --- libident-0.22.orig/ident.h +++ libident-0.22/ident.h @@ -3,6 +3,9 @@ ** ** Author: Peter Eriksson ** Intruder: Pär Emanuelsson +** QNX mod: Sven Behnsen (inserted by PH) +** ultrix mod: Harald Meland (inserted by PH) +** HI-UX mods: Nick Maclaren (inserted by PH) */ #ifndef __IDENT_H__ @@ -12,6 +15,10 @@ extern "C" { #endif +#ifdef __QNX__ +#include +#endif + /* Sigh */ #ifdef __STDC__ # if __STDC__ == 1 @@ -98,6 +105,9 @@ #include #include #include +#ifndef ultrix +#include +#endif #if defined(VMS) && !defined(FD_SETSIZE) # define FD_SETSIZE 64 @@ -110,10 +120,14 @@ #if defined(__GNUC__) && !defined(INADDR_ANY) # define __STRUCT_IN_ADDR_P void * #else +#ifdef INET6 +# define __STRUCT_IN_ADDR_P struct in6_addr * +#else # define __STRUCT_IN_ADDR_P struct in_addr * #endif +#endif -#if defined(__GNUC__) && !defined(DST_NONE) +#if defined(__GNUC__) && !defined(DST_NONE) && !defined(linux) # define __STRUCT_TIMEVAL_P void * #else # define __STRUCT_TIMEVAL_P struct timeval * @@ -178,7 +192,7 @@ extern void ident_free __P((IDENT *id)); -extern char id_version[]; +extern char _id_version[]; #ifdef IN_LIBIDENT_SRC --- libident-0.22.orig/debian/in.identtestd.8 +++ libident-0.22/debian/in.identtestd.8 @@ -0,0 +1,62 @@ +.TH IN.IDENTTESTD 8 "" libident "Library functions" +.UC 3 + +.SH NAME +in.identtestd \- a small daemon that can be used to test Ident servers + +.SH SYNOPSIS +in.identtestd + +.SH DESCRIPTION +.I in.identtestd +is a small daemon (to be started from inetd) +that does an ident lookup on you if you telnet into it. Can be used +to verify that your Ident server is working correctly. + +The source code can be found in the debian \fIlibident\fR source package, as +\fBident-tester.c\fR. + +.SH EXAMPLE +A typical entry in /etc/inetd.conf would be: +.PP +.nf +9999 stream tcp nowait root /usr/sbin/in.identtestd in.identtestd +.fi +.PP +With the above entry in place and active, execute "telnet hostname 9999" +from either this system, or another system. It should show something like: + +.in +4 +.nf +Trying hostname... +Connected to hostname. +Escape character is '^]'. +Welcome to the IDENT server tester, version 1.9 + +(Linked with libident 0.22 Debian) + +Connecting to Ident server at 192.168.1.1... +Querying for lport 1109, fport 9999.... +Reading response data... +Userid response is: + Lport........ 1109 + Fport........ 9999 + Opsys........ UNIX + Charset...... + Identifier... paul +Connection closed by foreign host. +.fi +.in -4 + +.SH AUTHOR +Peter Eriksson +.br +Manpage written for debian by Paul Slootman . +.LP +.SH SEE ALSO +.I ident\c +\&(3), +.I identd\c +\&(8), +.I tcpd\c +\&(8) --- libident-0.22.orig/debian/shlibs +++ libident-0.22/debian/shlibs @@ -0,0 +1 @@ +libident 0 libident (>= 0.22-3) --- libident-0.22.orig/debian/rules +++ libident-0.22/debian/rules @@ -0,0 +1,114 @@ +#!/usr/bin/make -f +# -*- makefile -*- + +package = $(shell grep "^Package: " debian/control |head -n 1|sed 's/Package: \(.*\)/\1/g') +source = $(shell grep "^Source: " debian/control |head -n 1|sed 's/Source: \(.*\)/\1/g') +version = $(shell grep "^$(source) " debian/changelog|head -n 1|sed 's/.*(\(.*\)\-[^\-]*).*/\1/g') +revision = $(shell grep "^$(source) " debian/changelog|head -n 1|sed 's/.*([^\-]*\-\(.*\)).*/\1/g') + +installexe = install -g root -o root -m 755 +installbin = $(installexe) +installdoc = install -g root -o root -m 644 + +tmpdir = $(shell pwd)/debian/tmp +tmpdir-dev = $(tmpdir)-dev +instdirs = $(tmpdir) \ + $(tmpdir)/DEBIAN \ + $(tmpdir)/usr/share/doc/libident \ + $(tmpdir)/usr/sbin \ + $(tmpdir)/usr/lib \ + $(tmpdir)/usr/share/man/man8 \ + $(tmpdir-dev) \ + $(tmpdir-dev)/DEBIAN \ + $(tmpdir-dev)/usr \ + $(tmpdir-dev)/usr/share/doc \ + $(tmpdir-dev)/usr/include \ + $(tmpdir-dev)/usr/lib \ + $(tmpdir-dev)/usr/share/man/man3 + +CC=gcc +CFLAGS=-g -Wall -DHAVE_ANSIHEADERS -D_REENTRANT +LDFLAGS= + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + installbin += -s +endif + +build: + $(checkdir) + echo 'char _id_version[] = "libident' $(version) Debian $(debian)'";' \ + >version.c + $(MAKE) all INSTROOT=/usr CC="$(CC)" CFLAGS="$(CFLAGS)" + $(MAKE) testers CC="$(CC)" CFLAGS="$(CFLAGS)" + touch build + +clean: + $(checkdir) + -rm -f build stamp-build + -$(MAKE) -i clean + -rm -rf *~ debian/tmp* debian/*~ debian/files* \ + debian/substvars* *.orig ./#*# + +binary-indep: +# None + @echo 'No independent package components.' ; false + +binary binary-arch: checkroot build $(instdirs) + $(MAKE) INSTROOT=$(tmpdir-dev)/usr install-dev + $(MAKE) INSTROOT=$(tmpdir)/usr install + $(installdoc) debian/copyright \ + $(tmpdir)/usr/share/doc/libident + $(installdoc) README \ + $(tmpdir)/usr/share/doc/libident + $(installdoc) debian/changelog \ + $(tmpdir)/usr/share/doc/libident/changelog.Debian + $(installdoc) debian/in.identtestd.8 \ + $(tmpdir)/usr/share/man/man8 + $(installbin) -s ident-tester \ + $(tmpdir)/usr/sbin/in.identtestd + gzip -v9 $(tmpdir)/usr/share/man/man?/* + gzip -v9 $(tmpdir-dev)/usr/share/man/man?/* + for manalias in ident_lookup ident_id ident_free id_open id_close id_query \ + id_parse id_fileno ; do \ + ln -s ident.3.gz $(tmpdir-dev)/usr/share/man/man3/$$manalias.3.gz ; \ + done + # dont compress copyright + gzip -v9 $(tmpdir)/usr/share/doc/libident/README + gzip -v9 $(tmpdir)/usr/share/doc/libident/changelog.Debian + strip --strip-debug $(tmpdir-dev)/usr/lib/libident.a + strip --strip-unneeded $(tmpdir)/usr/lib/libident.so.$(version) + strip --remove-section=.comment $(tmpdir)/usr/lib/libident.so.$(version) + ln -s libident $(tmpdir-dev)/usr/share/doc/libident-dev + dpkg-shlibdeps $(tmpdir)/usr/sbin/in.identtestd + dpkg-gencontrol -P$(tmpdir) -plibident -isp + dpkg-gencontrol -P$(tmpdir-dev) -plibident-dev -isp + $(installexe) debian/postinst $(tmpdir)/DEBIAN/postinst + $(installexe) debian/postrm $(tmpdir)/DEBIAN/postrm + $(installdoc) debian/shlibs $(tmpdir)/DEBIAN + $(installexe) debian/postinst-dev $(tmpdir-dev)/DEBIAN/postinst + chown -R root.root $(tmpdir) $(tmpdir-dev) + chmod -R g-ws $(tmpdir) $(tmpdir-dev) + dpkg --build $(tmpdir) .. + dpkg --build $(tmpdir-dev) .. + +define checkdir + test -f id_open.c && test -f debian/rules +endef + +checkroot: + $(checkdir) + test root = "`whoami`" + +.PHONY: binary binary-arch binary-indep clean checkroot + +zapdirs: + -rm -rf $(tmpdir) $(tmpdir-dev) + +$(instdirs): zapdirs + install -d -m 755 $@ + chmod g-s $@ --- libident-0.22.orig/debian/control +++ libident-0.22/debian/control @@ -0,0 +1,27 @@ +Source: libident +Maintainer: Paul Slootman +Section: libs +Priority: important +Standards-Version: 3.6.1 + +Package: libident +Architecture: any +Section: libs +Depends: ${shlibs:Depends} +Suggests: libident-dev +Description: simple RFC1413 client library - runtime + This is a small library to interface to the Ident protocol server; + "ident" enables a remote host to find out who's the owner of a + network connection. + . + /usr/sbin/in.identtestd is a small daemon (to be started from inetd) + that does an ident lookup on you if you telnet into it. Can be used + to verify that your Ident server is working correctly. + +Package: libident-dev +Architecture: any +Section: libdevel +Priority: optional +Depends: libident(=${Source-Version}), ${shlibs:Depends} +Description: simple RFC1413 client library - development + This is a small library to interface to the Ident protocol server. --- libident-0.22.orig/debian/changelog +++ libident-0.22/debian/changelog @@ -0,0 +1,155 @@ +libident (0.22-3build2) karmic; urgency=low + + * No-change rebuild to gain FORTIFY defaults. + + -- Kees Cook Sat, 09 May 2009 10:10:45 -0700 + +libident (0.22-3build1) gutsy; urgency=low + + * No-change upload to include stack protector. + + -- Kees Cook Tue, 31 Jul 2007 10:43:36 -0700 + +libident (0.22-3) unstable; urgency=low + + * acknowledge NMUs. + closes:#209057,#103890,#176348,#187072,#190712,#198996,#208040 + (with a different fix for 198996, remove the bashisms instead of forcing bash) + * fix section and priorities. + closes:#209102 + * Added IPv6 patches from http://kebo.vlsm.org/debian-ipv6/patch/libident/ + * Added misc patches, collected in the exim fork of libident. + * Updated to Debian policy version 3.6.1. + * fix XSI:isms in shell tests and deprecated head usage. + closes:#256234 + * Include section info in package. + closes:#288750 + * Take options out of $(AR) in Makefile, to facilitate cross-building. + closes:#282911 + * Upload of new version mentioned in #231723 will follow after checking it... + + -- Paul Slootman Fri, 04 Mar 2005 15:16:38 +0100 + +libident (0.22-2.2) unstable; urgency=low + + * Non-maintainer upload. + * Remove obsolete 'undef LD_PRELOAD', to get the source building on + the autobuilders. (Closes: #209057) + + -- Petter Reinholdtsen Sun, 7 Sep 2003 13:24:18 +0200 + +libident (0.22-2.1) unstable; urgency=low + + * Non-maintainer upload. + * Add missing manpage symlinks. (Closes: #103890) + * Rebuilding library should fix prelinking problem. (Closes: #176348) + * New upload will end up in the pool archive structure. + Not really a bug, but it will solve it. (Closes: #187072) + * Fix typo in in.identtestd(8). (Closes: #190712) + * Set SHELL=/bin/bash in debian/rules to avoid build errors when using + a POSIX shell. Patch from Göran Weinholt. (Closes: #198996) + * Add -D_REENTRANT when compiling the static library, to make sure the + package follow Debian policy 11.2. (Closes: #208040) + + -- Petter Reinholdtsen Sun, 31 Aug 2003 19:09:22 +0200 + +libident (0.22-2) unstable; urgency=low + + * updated to debian policy version 3.0.1. + + -- Paul Slootman Thu, 28 Oct 1999 16:45:24 +0200 + +libident (0.22-1) unstable; urgency=low + + * new upstream source. + * added workaround for ident servers that return a different format string, + i.e. "%u,%U,%g,%G,%l,%L,%p,%c,%C" (Red Hat 5.0?) to prevent possible + segmentation violation. Fix obtained from exim mailing list, originally + from Darrell Fuhriman . + + -- Paul Slootman Wed, 13 Jan 1999 13:11:30 +0100 + +libident (0.21-7) unstable; urgency=low + + * fixed the shlibs dependency version number. + * updated to debian policy version 2.4.1.4. + + -- Paul Slootman Thu, 1 Oct 1998 09:20:56 +0200 + +libident (0.21-6) unstable; urgency=low + + * provide versionless .so link in -dev package. fixes:#26453 + * provide symlink /usr/doc/libident-dev to libident in -dev package. + + -- Paul Slootman Mon, 7 Sep 1998 15:46:20 +0200 + +libident (0.21-5) unstable; urgency=low + + * Didn't conform to policy (no separate -dev package). fixes:#22092 + * libident-dev now contains the man3 manpage, the include file, and the + static library + * libident now contains the tester program and the shared library. + * manpage ident.3 now compressed. fixes:#20342 + * debian/files and debian/substvars now removed in clean target. fixes:#25403 + + -- Paul Slootman Tue, 25 Aug 1998 10:07:48 +0200 + +libident (0.21-4) unstable; urgency=high + + * new maintainer + * don't strip libs _completely_! fixes #17670,#17009,16487 + * added dependency info + * wrote manpage for in.identtestd + * should now adhere to debian policy version 2.4.0.0 + + -- Paul Slootman Thu, 19 Mar 1998 18:53:23 +0100 + +libident (0.21-3) unstable; urgency=low + + * Changed architecture to "all" from i386. Couldn't see any reason not + to. If anyone knows different, speak up. Closes Bug #13700. + + -- Rob Browning Thu, 11 Dec 1997 00:19:27 -0600 + +libident (0.21-2) unstable; urgency=low + + * new maintainer + * recompiled for libc6 + * strip libs and binaries + + -- Rob Browning Mon, 8 Dec 1997 18:52:07 -0600 + +libident (0.21-1) unstable; urgency=low + + * new upstream source + + -- Dale Scheetz Thu, 20 Feb 1997 15:17:38 -0500 + +libident (0.17-4) unstable; urgency=low + + * changed architecture from all to i386 + + -- Dale Scheetz Fri, 27 Sep 1996 09:26:20 -0400 + +libident (0.17-3) unstable; urgency=low + + * Updated source package to Standards-Version 2.1.0.0. + + -- Dale Scheetz Thu, 26 Sep 1996 18:46:11 -0400 + +Libident 0.17 Debian 2 - dcs + +*updated architecture and naming in debian.rules/control + +Libident 0.17 Debian 1 - dcs + +*upgraded to lates version + +Libident 0.16 Debian 2 - dcs + +*Rebuild as ELF +*New package maintainer: Dale Scheetz + +Libident 0.16 Debian 1 - iwj +Initial release, tested using built-in test program. + --- libident-0.22.orig/debian/copyright +++ libident-0.22/debian/copyright @@ -0,0 +1,16 @@ +COPYRIGHT ISSUES: + + This version of 'libident' is hereby released into the + Public Domain. It may be distributed for a fee or without + a fee. We only ask you not to pretend you wrote it. + +If you make any changes, please send sources or a diff of it to +us (pen@lysator.liu.se or pell@lysator.liu.se), so we can keep +_one_ unified version of libident available... + + +FTP SITE: + +The official FTP site and location for libident is: + + ftp://ftp.lysator.liu.se/pub/ident/libs --- libident-0.22.orig/debian/postinst-dev +++ libident-0.22/debian/postinst-dev @@ -0,0 +1,7 @@ +#!/bin/sh -e + +if [ "$1" = "configure" ]; then + if [ -L /usr/doc/libident-dev ]; then + rm -f /usr/doc/libident-dev + fi +fi --- libident-0.22.orig/debian/postinst +++ libident-0.22/debian/postinst @@ -0,0 +1,8 @@ +#!/bin/sh -e + +if [ "$1" = "configure" ]; then + ldconfig + if [ -L /usr/doc/libident ]; then + rm -f /usr/doc/libident + fi +fi --- libident-0.22.orig/debian/postrm +++ libident-0.22/debian/postrm @@ -0,0 +1,5 @@ +#!/bin/sh -e + +if [ "$1" = "remove" ]; then + ldconfig +fi