ports/65882: update net/pppd23: fix various problems

Valentin Nechayev netch at netch.kiev.ua
Thu Apr 22 12:40:23 UTC 2004


>Number:         65882
>Category:       ports
>Synopsis:       update net/pppd23: fix various problems
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr 22 05:40:22 PDT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Valentin Nechayev
>Release:        FreeBSD 5.2.1-RELEASE i386
>Organization:
home sweet home
>Environment:
System: FreeBSD grizzly.carrier.kiev.ua 5.2.1-RELEASE FreeBSD 5.2.1-RELEASE #4: Mon Mar 1 20:48:48 EET 2004 root at grizzly.carrier.kiev.ua:/disk2/obj/disk2/src/sys/grizzly i386

>Description:

This fixes a bunch of problems of this port:

1. Reflect changes on FreeBSD 5.* to load if_ppp.ko unless already loaded.
(Thx to zoleg at buryatia dot ru for pointing that)
Current code will try both old and new method.
2. Fix compilation on amd64, va_list problem (method from main tree sources).
3. Reflect internal logf() for GCC 3. (Gcc version is checked on system
version. This is probably ugly but works for system compiler.)
4. Reflect 32bitness of time in `struct lastlog'.

>How-To-Repeat:

>Fix:

Patch to port directory follows. I don't know whether PORTREVISION bump
is needed; add it please if needed.

diff -rNu ../pppd23.orig/Makefile ./Makefile
--- ../pppd23.orig/Makefile	Sat Apr 10 16:40:04 2004
+++ ./Makefile	Thu Apr 22 15:17:08 2004
@@ -18,4 +18,10 @@
 MAN8=		pppd.8 pppstats.8 chat.8
 MANCOMPRESSED=	yes
 
-.include <bsd.port.mk>
+.include <bsd.port.pre.mk>
+
+.if ${OSVERSION} >= 500000
+EXTRA_PATCHES=	${PATCHDIR}/extra-patch-no-logf
+.endif
+
+.include <bsd.port.post.mk>
diff -rNu ../pppd23.orig/files/extra-patch-no-logf ./files/extra-patch-no-logf
--- ../pppd23.orig/files/extra-patch-no-logf	Thu Jan  1 03:00:00 1970
+++ ./files/extra-patch-no-logf	Thu Apr 22 15:16:58 2004
@@ -0,0 +1,9 @@
+--- chat/Makefile.bsd.orig	Thu Apr 22 15:16:08 2004
++++ chat/Makefile.bsd	Thu Apr 22 15:16:35 2004
+@@ -5,4 +5,6 @@
+ MAN8=	chat.8
+ BINDIR=	/usr/sbin
+ 
++CFLAGS+=	-fno-builtin-logf
++
+ .include <bsd.prog.mk>
diff -rNu ../pppd23.orig/files/patch-ab ./files/patch-ab
--- ../pppd23.orig/files/patch-ab	Thu Jan  1 03:00:00 1970
+++ ./files/patch-ab	Thu Apr 22 14:54:47 2004
@@ -0,0 +1,57 @@
+diff -rNu ./pppd/auth.c ../../work/ppp-2.3.11/pppd/auth.c
+--- ./pppd/auth.c	Thu Dec 23 03:25:13 1999
++++ ../../work/ppp-2.3.11/pppd/auth.c	Thu Apr 22 14:49:05 2004
+@@ -1137,7 +1137,7 @@
+ 	    if ((fd = open(_PATH_LASTLOG, O_RDWR, 0)) >= 0) {
+ 		(void)lseek(fd, (off_t)(pw->pw_uid * sizeof(ll)), SEEK_SET);
+ 		memset((void *)&ll, 0, sizeof(ll));
+-		(void)time(&ll.ll_time);
++		ll.ll_time = time(NULL);
+ 		(void)strncpy(ll.ll_line, tty, sizeof(ll.ll_line));
+ 		(void)write(fd, (char *)&ll, sizeof(ll));
+ 		(void)close(fd);
+diff -rNu ./pppd/sys-bsd.c ../../work/ppp-2.3.11/pppd/sys-bsd.c
+--- ./pppd/sys-bsd.c	Thu Apr 22 14:48:03 2004
++++ ../../work/ppp-2.3.11/pppd/sys-bsd.c	Thu Apr 22 14:53:59 2004
+@@ -182,6 +182,7 @@
+     int s, ok;
+     struct ifreq ifr;
+     extern char *no_ppp_msg;
++    const char* modname = "if_ppp";
+ 
+     if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
+ 	return 1;		/* can't tell */
+@@ -189,12 +190,18 @@
+     strlcpy(ifr.ifr_name, "ppp0", sizeof (ifr.ifr_name));
+     ok = ioctl(s, SIOCGIFFLAGS, (caddr_t) &ifr) >= 0;
+     close(s);
++    if (ok)
++	return 1;
++    if (modfind(modname) != -1)
++	return 1;
++    if (getuid() == 0 && kldload(modname) != -1)
++	return 1;
+ 
+     no_ppp_msg = "\
+ This system lacks kernel support for PPP.  To include PPP support\n\
+-in the kernel, please follow the steps detailed in the README.bsd\n\
+-file in the ppp-2.2 distribution.\n";
+-    return ok;
++in the kernel, please add \"device ppp\" to your kernel config or \n\
++load the if_ppp module.\n";                                                    
++    return 0;       
+ }
+ 
+ /*
+diff -rNu ./pppd/utils.c ../../work/ppp-2.3.11/pppd/utils.c
+--- ./pppd/utils.c	Sat Sep 11 14:35:47 1999
++++ ../../work/ppp-2.3.11/pppd/utils.c	Thu Apr 22 14:49:50 2004
+@@ -249,7 +249,7 @@
+ 	    break;
+ 	case 'r':
+ 	    f = va_arg(args, char *);
+-#ifndef __powerpc__
++#if !defined(__powerpc__) && !defined(__amd64__)
+ 	    n = vslprintf(buf, buflen + 1, f, va_arg(args, va_list));
+ #else
+ 	    /* On the powerpc, a va_list is an array of 1 structure */
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list