- 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.
- Fix build on amd64
- Reflect internal logf() for GCC 3-x
- Reflect 32bitness of time in `struct lastlog'.

PR:		ports/65882
Submitted by:	maintainer
This commit is contained in:
Kirill Ponomarev 2004-04-28 19:56:35 +00:00
parent 8f8d2bdf2a
commit 3699f82b18
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=107857
3 changed files with 68 additions and 2 deletions

View File

@ -20,8 +20,8 @@ MANCOMPRESSED= yes
.include <bsd.port.pre.mk>
.if ${ARCH} == "amd64"
BROKEN= "Does not compile on amd64"
.if ${OSVERSION} >= 500000
EXTRA_PATCHES= ${PATCHDIR}/extra-patch-no-logf
.endif
.include <bsd.port.post.mk>

View File

@ -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>

57
net/pppd23/files/patch-ab Normal file
View File

@ -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 */