packages: bsd-finger/bsd-finger.spec, bsd-finger/bsd-finger-0.16-20000912.p...

draenog draenog at pld-linux.org
Sat Nov 12 03:20:37 CET 2011


Author: draenog                      Date: Sat Nov 12 02:20:37 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- store patches in decompressed files

---- Files affected:
packages/bsd-finger:
   bsd-finger.spec (1.74 -> 1.75) , bsd-finger-0.16-20000912.patch (NONE -> 1.1)  (NEW), bsd-finger-0.16-20000912.patch.gz (1.1 -> NONE)  (REMOVED)

---- Diffs:

================================================================
Index: packages/bsd-finger/bsd-finger.spec
diff -u packages/bsd-finger/bsd-finger.spec:1.74 packages/bsd-finger/bsd-finger.spec:1.75
--- packages/bsd-finger/bsd-finger.spec:1.74	Sat Jan 29 01:06:11 2011
+++ packages/bsd-finger/bsd-finger.spec	Sat Nov 12 03:20:32 2011
@@ -21,7 +21,7 @@
 Patch0:		%{name}-DESTDIR.patch
 Patch1:		%{name}-exact.patch
 # http://www.t17.ds.pwr.wroc.pl/~misiek/ipv6/
-Patch2:		%{name}-0.16-20000912.patch.gz
+Patch2:		%{name}-0.16-20000912.patch
 Patch3:		%{name}-time.patch
 Patch4:		%{name}-gecos.patch
 Patch5:		%{name}-rfc742.patch
@@ -209,6 +209,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.75  2011/11/12 02:20:32  draenog
+- store patches in decompressed files
+
 Revision 1.74  2011/01/29 00:06:11  sparky
 - dropped pre-cvs changelog
 

================================================================
Index: packages/bsd-finger/bsd-finger-0.16-20000912.patch
diff -u /dev/null packages/bsd-finger/bsd-finger-0.16-20000912.patch:1.1
--- /dev/null	Sat Nov 12 03:20:37 2011
+++ packages/bsd-finger/bsd-finger-0.16-20000912.patch	Sat Nov 12 03:20:32 2011
@@ -0,0 +1,101 @@
+;
+; IPv6 enabled finger client/server for PLD GNU Linux
+;               Arkadiusz Mi¶kiewicz <misiek at pld.org.pl>
+;
+diff -urN bsd-finger-0.16.org/finger/net.c bsd-finger-0.16/finger/net.c
+--- bsd-finger-0.16.org/finger/net.c	Tue Sep 12 21:34:24 2000
++++ bsd-finger-0.16/finger/net.c	Tue Sep 12 21:34:50 2000
+@@ -53,59 +53,50 @@
+ 
+ void netfinger(const char *name) {
+ 	register FILE *fp;
+-	struct in_addr defaddr;
+ 	register int c, sawret, ateol;
+-	struct hostent *hp, def;
+-	struct servent *sp;
+-	struct sockaddr_in sn;
+-	int s;
+-	char *alist[1], *host;
++	char *host;
++	char hbuf[NI_MAXHOST];
++	struct addrinfo hints, *res, *res0;
++	int s = -1;
+ 
+ 	host = strrchr(name, '@');
+ 	if (!host) return;
+ 	*host++ = '\0';
+ 
+-	memset(&sn, 0, sizeof(sn));
+-
+-	sp = getservbyname("finger", "tcp");
+-	if (!sp) {
+-		eprintf("finger: tcp/finger: unknown service\n");
++	memset(&hints, 0, sizeof(hints));
++	hints.ai_family = AF_UNSPEC;
++	hints.ai_socktype = SOCK_STREAM;
++	if (getaddrinfo(host, "finger", &hints, &res0)) {
++		eprintf("finger: unknown host: %s\n", host);
+ 		return;
+ 	}
+-	sn.sin_port = sp->s_port;
+-
+-	hp = gethostbyname(host);
+-	if (!hp) {
+-		if (!inet_aton(host, &defaddr)) {
+-			eprintf("finger: unknown host: %s\n", host);
+-			return;
++	for (res = res0; res; res = res->ai_next) {
++		s = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
++		if (s < 0) {
++			if (res->ai_next)
++				continue;
++			else {
++				eprintf("finger: socket: %s\n", strerror(errno));
++				return;
++			}
+ 		}
+-		def.h_name = host;
+-		def.h_addr_list = alist;
+-		def.h_addr = (char *)&defaddr;
+-		def.h_length = sizeof(struct in_addr);
+-		def.h_addrtype = AF_INET;
+-		def.h_aliases = 0;
+-		hp = &def;
+-	}
+-	sn.sin_family = hp->h_addrtype;
+-	if (hp->h_length > (int)sizeof(sn.sin_addr)) {
+-	    hp->h_length = sizeof(sn.sin_addr);
+-	}
+-	memcpy(&sn.sin_addr, hp->h_addr, hp->h_length);
+-
+-	if ((s = socket(hp->h_addrtype, SOCK_STREAM, 0)) < 0) {
+-		eprintf("finger: socket: %s\n", strerror(errno));
+-		return;
+-	}
+-
+-	/* print hostname before connecting, in case it takes a while */
+-	xprintf("[%s]\n", hp->h_name);
+-	if (connect(s, (struct sockaddr *)&sn, sizeof(sn)) < 0) {
+-		eprintf("finger: connect: %s\n", strerror(errno));
+-		close(s);
+-		return;
++		getnameinfo(res->ai_addr, res->ai_addrlen, hbuf, sizeof(hbuf),
++				NULL, 0, 0);
++		/* print hostname before connecting, in case it takes a while */
++		xprintf("[%s]\n", hbuf);
++		if (connect(s, res->ai_addr, res->ai_addrlen) < 0) {
++			if (res->ai_next) {
++				close(s);
++				continue;
++			} else {
++				eprintf("finger: connect: %s\n", strerror(errno));
++				close(s);
++				return;
++			}
++		}
++		break;
+ 	}
++	freeaddrinfo(res0);
+ 
+ 	/* -l flag for remote fingerd  */
+ 	if (lflag) write(s, "/W ", 3);
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/bsd-finger/bsd-finger.spec?r1=1.74&r2=1.75&f=u



More information about the pld-cvs-commit mailing list