Index: head/net/mopd/Makefile =================================================================== --- head/net/mopd/Makefile (revision 550627) +++ head/net/mopd/Makefile (revision 550628) @@ -1,30 +1,33 @@ # Created by: David O'Brien (obrien@NUXI.com) # $FreeBSD$ PORTNAME= mopd PORTVERSION= 2.5.3 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= net MASTER_SITES= LOCAL/cy EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX} MAINTAINER= ports@FreeBSD.org COMMENT= MOP Loader Daemon for netbooting DEC machines + +LICENSE= BSD4CLAUSE +LICENSE_FILE= ${PATCHDIR}/LICENSE.txt USES= uidfix MAKE_ENV= BINDIR=${PREFIX}/sbin MANDIR=${PREFIX}/man/man NO_MANCOMPRESS=true OPTIONS_DEFINE= DOCS DOCS_DISTFILES= ${DISTNAME}${EXTRACT_SUFX} \ VAX-netboot-HOWTO VS3100-console-cmds.txt do-configure: @${REINPLACE_CMD} -e 's/MAN=/MAN8=/' ${WRKSRC}/mopd/Makefile post-install-DOCS-on: @${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${DISTDIR}/VAX-netboot-HOWTO \ ${DISTDIR}/VS3100-console-cmds.txt ${STAGEDIR}${DOCSDIR} .include Index: head/net/mopd/files/patch-pf-snit.c =================================================================== --- head/net/mopd/files/patch-pf-snit.c (revision 550627) +++ head/net/mopd/files/patch-pf-snit.c (nonexistent) @@ -1,22 +0,0 @@ ---- otherOS/pf-snit.c 1996/09/21 19:12:50 1.2 -+++ otherOS/pf-snit.c 2000/02/20 17:45:34 1.3 -@@ -239,7 +239,8 @@ - struct ifreq ifr; - int fd; - -- strcpy(ifr.ifr_name, interface); -+ strncpy(ifr.ifr_name, interface, sizeof (ifr.ifr_name) -1); -+ ifr.ifr_name[sizeof(ifr.ifr_name) - 1] = 0; - - ifr.ifr_addr.sa_family = AF_UNSPEC; - bcopy(addr, ifr.ifr_addr.sa_data, 6); -@@ -274,7 +275,8 @@ - struct ifreq ifr; - int fd; - -- strcpy(ifr.ifr_name, interface); -+ strncpy(ifr.ifr_name, interface, sizeof (ifr.ifr_name) -1); -+ ifr.ifr_name[sizeof(ifr.ifr_name) - 1] = 0; - - ifr.ifr_addr.sa_family = AF_UNSPEC; - bcopy(addr, ifr.ifr_addr.sa_data, 6); Property changes on: head/net/mopd/files/patch-pf-snit.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/net/mopd/files/patch-file.c =================================================================== --- head/net/mopd/files/patch-file.c (revision 550627) +++ head/net/mopd/files/patch-file.c (nonexistent) @@ -1,37 +0,0 @@ ---- common/file.c.orig Sat Aug 17 00:39:41 1996 -+++ common/file.c Mon Aug 23 16:36:03 2004 -@@ -44,6 +44,7 @@ - #endif - #if defined(__FreeBSD__) - #include -+#include - #endif - #if !defined(MID_VAX) - #define MID_VAX 140 -@@ -345,7 +346,7 @@ - mid = MID_ARM6; - break; - #endif -- default: -+ default: break; - /*###352 [cc] syntax error before `}'%%%*/ - } - -@@ -522,7 +523,7 @@ - ex.a_trsize= mopFileGetBX((u_char *)&ex_swap, 24, 4); - ex.a_drsize= mopFileGetBX((u_char *)&ex_swap, 28, 4); - break; -- default: -+ default: break; - /*###525 [cc] syntax error before `}'%%%*/ - } - -@@ -575,7 +576,7 @@ - printf("arm32"); - break; - #endif -- default: -+ default: break; - } - printf(") Magic: "); - switch (N_GETMAGIC (ex)) { Property changes on: head/net/mopd/files/patch-file.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/net/mopd/files/patch-pf.c =================================================================== --- head/net/mopd/files/patch-pf.c (revision 550627) +++ head/net/mopd/files/patch-pf.c (nonexistent) @@ -1,31 +0,0 @@ ---- common/pf.c.orig Tue Aug 6 07:20:27 1996 -+++ common/pf.c Wed Oct 15 13:02:19 2003 -@@ -56,7 +56,7 @@ - #include - - #include --#include -+ - - #include "common/mopdef.h" - -@@ -174,7 +174,8 @@ - struct ifreq ifr; - int fd; - -- strcpy(ifr.ifr_name, interface); -+ strncpy(ifr.ifr_name, interface,sizeof(ifr.ifr_name) - 1); -+ ifr.ifr_name[sizeof(ifr.ifr_name) - 1] = 0; - - ifr.ifr_addr.sa_family = AF_UNSPEC; - bcopy(addr, ifr.ifr_addr.sa_data, 6); -@@ -209,7 +210,8 @@ - struct ifreq ifr; - int fd; - -- strcpy(ifr.ifr_name, interface); -+ strncpy(ifr.ifr_name, interface, sizeof (ifr.ifr_name) - 1); -+ ifr.ifr_name[sizeof(ifr.ifr_name) - 1] = 0; - - ifr.ifr_addr.sa_family = AF_UNSPEC; - bcopy(addr, ifr.ifr_addr.sa_data, 6); Property changes on: head/net/mopd/files/patch-pf.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/net/mopd/files/patch-device.c =================================================================== --- head/net/mopd/files/patch-device.c (revision 550627) +++ head/net/mopd/files/patch-device.c (nonexistent) @@ -1,38 +0,0 @@ ---- common/device.c 1996/09/21 13:49:16 1.1 -+++ common/device.c 2000/02/20 17:45:33 1.4 -@@ -111,7 +113,8 @@ - { - struct if_info *p, tmp; - -- strcpy(tmp.if_name,ifname); -+ strncpy(tmp.if_name,ifname,sizeof(tmp.if_name) - 1); -+ tmp.if_name[sizeof(tmp.if_name) - 1] = 0; - tmp.iopen = pfInit; - - switch (proto) { -@@ -138,7 +141,8 @@ - p->next = iflist; - iflist = p; - -- strcpy(p->if_name,tmp.if_name); -+ strncpy(p->if_name,tmp.if_name, IFNAME_SIZE -1); -+ p->if_name[IFNAME_SIZE -1] = 0; - p->iopen = tmp.iopen; - p->write = pfWrite; - p->read = tmp.read; -@@ -185,12 +199,12 @@ - if ((strlen(dev) == 2) && - (dev[0] == 'e') && - ((dev[1] == 'n') || (dev[1] == 't'))) { -- sprintf(interface,"ent%d\0",unit); -+ snprintf(interface,sizeof(interface),"ent%d\0",unit); - } else { -- sprintf(interface,"%s%d\0",dev,unit); -+ snprintf(interface,sizeof(interface),"%s%d\0",dev,unit); - } - #else -- sprintf(interface,"%s",ifname); -+ snprintf(interface,sizeof(interface),"%s",ifname); - #endif /* _AIX */ - - /* Ok, init it just once */ Property changes on: head/net/mopd/files/patch-device.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/net/mopd/files/patch-process.c =================================================================== --- head/net/mopd/files/patch-process.c (revision 550627) +++ head/net/mopd/files/patch-process.c (nonexistent) @@ -1,81 +0,0 @@ ---- mopd/process.c 1996/09/21 19:12:26 1.2 -+++ mopd/process.c 2000/07/04 23:46:23 1.8 -@@ -267,7 +267,7 @@ - dllist[slot].a_lseek = 0; - - dllist[slot].count = 0; -- if (dllist[slot].dl_bsz >= 1492) -+ if ((dllist[slot].dl_bsz >= 1492) || (dllist[slot].dl_bsz == 0)) - dllist[slot].dl_bsz = 1492; - if (dllist[slot].dl_bsz == 1030) /* VS/uVAX 2000 needs this */ - dllist[slot].dl_bsz = 1000; -@@ -350,10 +350,10 @@ - close(dllist[slot].ldfd); - dllist[slot].ldfd = 0; - dllist[slot].status = DL_STATUS_FREE; -- sprintf(line, -+ snprintf(line,sizeof(line), - "%x:%x:%x:%x:%x:%x Load completed", - dst[0],dst[1],dst[2],dst[3],dst[4],dst[5]); -- syslog(LOG_INFO, line); -+ syslog(LOG_INFO, "%s", line); - return; - } - -@@ -438,7 +438,7 @@ - { - u_char tmpc; - u_short moplen; -- u_char pfile[17], mopcode; -+ u_char pfile[129], mopcode; - char filename[FILENAME_MAX]; - char line[100]; - int i,nfd,iindex; -@@ -487,6 +487,8 @@ - rpr_pgty = mopGetChar(pkt,index); /* Program Type */ - - tmpc = mopGetChar(pkt,index); /* Software ID Len */ -+ if (tmpc > sizeof(pfile) - 1) -+ return; - for (i = 0; i < tmpc; i++) { - pfile[i] = mopGetChar(pkt,index); - pfile[i+1] = '\0'; -@@ -513,31 +515,32 @@ - bcopy((char *)src, (char *)(dl_rpr->eaddr), 6); - mopProcessInfo(pkt,index,moplen,dl_rpr,trans); - -- sprintf(filename,"%s/%s.SYS", MOP_FILE_PATH, pfile); -+ snprintf(filename,sizeof(filename), -+ "%s/%s.SYS", MOP_FILE_PATH, pfile); - if ((mopCmpEAddr(dst,dl_mcst) == 0)) { - if ((nfd = open(filename, O_RDONLY, 0)) != -1) { - close(nfd); - mopSendASV(src, ii->eaddr, ii, trans); -- sprintf(line, -+ snprintf(line,sizeof(line), - "%x:%x:%x:%x:%x:%x (%d) Do you have %s? (Yes)", - src[0],src[1],src[2], - src[3],src[4],src[5],trans,pfile); - } else { -- sprintf(line, -+ snprintf(line,sizeof(line), - "%x:%x:%x:%x:%x:%x (%d) Do you have %s? (No)", - src[0],src[1],src[2], - src[3],src[4],src[5],trans,pfile); - } -- syslog(LOG_INFO, line); -+ syslog(LOG_INFO, "%s", line); - } else { - if ((mopCmpEAddr(dst,ii->eaddr) == 0)) { - dl_rpr->ldfd = open(filename, O_RDONLY, 0); - mopStartLoad(src, ii->eaddr, dl_rpr, trans); -- sprintf(line, -+ snprintf(line,sizeof(line), - "%x:%x:%x:%x:%x:%x Send me %s", - src[0],src[1],src[2], - src[3],src[4],src[5],pfile); -- syslog(LOG_INFO, line); -+ syslog(LOG_INFO, "%s", line); - } - } - Property changes on: head/net/mopd/files/patch-process.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/net/mopd/files/patch-put.c =================================================================== --- head/net/mopd/files/patch-put.c (revision 550627) +++ head/net/mopd/files/patch-put.c (nonexistent) @@ -1,50 +0,0 @@ ---- common/put.c.orig Fri Aug 16 15:43:15 1996 -+++ common/put.c Sun Mar 5 09:32:05 2000 -@@ -35,6 +35,9 @@ - #include - #include - #include "common/mopdef.h" -+#ifdef __FreeBSD__ -+#include -+#endif - - void - mopPutChar(pkt, index, value) -@@ -137,10 +140,7 @@ - mopPutChar (pkt, index, 0x00); - mopPutChar (pkt, index, 0x2b); - } --#if !defined(__FreeBSD__) -- mopPutChar(pkt, index, (proto / 256)); -- mopPutChar(pkt, index, (proto % 256)); --#else -+#if defined(__FreeBSD__) && __FreeBSD_version < 220000 - if (trans == TRANS_8023) { - mopPutChar(pkt, index, (proto / 256)); - mopPutChar(pkt, index, (proto % 256)); -@@ -148,6 +148,9 @@ - mopPutChar(pkt, index, (proto % 256)); - mopPutChar(pkt, index, (proto / 256)); - } -+#else -+ mopPutChar(pkt, index, (proto / 256)); -+ mopPutChar(pkt, index, (proto % 256)); - #endif - if (trans == TRANS_ETHER) - mopPutShort(pkt, index, 0); -@@ -170,12 +173,12 @@ - break; - case TRANS_8023: - index = 12; --#if !defined(__FreeBSD__) -- mopPutChar(pkt, &index, ((len - 14) / 256)); -+#if defined(__FreeBSD__) && __FreeBSD_version < 220000 - mopPutChar(pkt, &index, ((len - 14) % 256)); -+ mopPutChar(pkt, &index, ((len - 14) / 256)); - #else -- mopPutChar(pkt, &index, ((len - 14) % 256)); - mopPutChar(pkt, &index, ((len - 14) / 256)); -+ mopPutChar(pkt, &index, ((len - 14) % 256)); - #endif - break; - } Property changes on: head/net/mopd/files/patch-put.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/net/mopd/files/LICENSE.txt =================================================================== --- head/net/mopd/files/LICENSE.txt (nonexistent) +++ head/net/mopd/files/LICENSE.txt (revision 550628) @@ -0,0 +1,26 @@ +Copyright (c) 1993-90 Mats O Jansson. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + This product includes software developed by Mats O Jansson. +4. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Property changes on: head/net/mopd/files/LICENSE.txt ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/net/mopd/files/patch-common_device.c =================================================================== --- head/net/mopd/files/patch-common_device.c (nonexistent) +++ head/net/mopd/files/patch-common_device.c (revision 550628) @@ -0,0 +1,47 @@ +--- common/device.c.orig 1996-08-08 00:01:54 UTC ++++ common/device.c +@@ -35,7 +35,7 @@ static char rcsid[] = "$Id: device.c,v 1.21 1996/08/08 + #include "common/common.h" + #include "common/mopdef.h" + +-struct if_info *iflist; /* Interface List */ ++/*extern*/ struct if_info *iflist; /* Interface List */ + + void mopReadDL(); + void mopReadRC(); +@@ -111,7 +111,8 @@ deviceOpen(ifname, proto, trans) + { + struct if_info *p, tmp; + +- strcpy(tmp.if_name,ifname); ++ strncpy(tmp.if_name,ifname,sizeof(tmp.if_name) - 1); ++ tmp.if_name[sizeof(tmp.if_name) - 1] = 0; + tmp.iopen = pfInit; + + switch (proto) { +@@ -138,7 +139,8 @@ deviceOpen(ifname, proto, trans) + p->next = iflist; + iflist = p; + +- strcpy(p->if_name,tmp.if_name); ++ strncpy(p->if_name,tmp.if_name, IFNAME_SIZE -1); ++ p->if_name[IFNAME_SIZE -1] = 0; + p->iopen = tmp.iopen; + p->write = pfWrite; + p->read = tmp.read; +@@ -185,12 +187,12 @@ deviceInitOne(ifname) + if ((strlen(dev) == 2) && + (dev[0] == 'e') && + ((dev[1] == 'n') || (dev[1] == 't'))) { +- sprintf(interface,"ent%d\0",unit); ++ snprintf(interface,sizeof(interface),"ent%d\0",unit); + } else { +- sprintf(interface,"%s%d\0",dev,unit); ++ snprintf(interface,sizeof(interface),"%s%d\0",dev,unit); + } + #else +- sprintf(interface,"%s",ifname); ++ snprintf(interface,sizeof(interface),"%s",ifname); + #endif /* _AIX */ + + /* Ok, init it just once */ Property changes on: head/net/mopd/files/patch-common_device.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/net/mopd/files/patch-common_file.c =================================================================== --- head/net/mopd/files/patch-common_file.c (nonexistent) +++ head/net/mopd/files/patch-common_file.c (revision 550628) @@ -0,0 +1,37 @@ +--- common/file.c.orig 1996-08-16 22:39:41 UTC ++++ common/file.c +@@ -44,6 +44,7 @@ static char rcsid[] = "$Id: file.c,v 1.4 1996/08/16 22 + #endif + #if defined(__FreeBSD__) + #include ++#include + #endif + #if !defined(MID_VAX) + #define MID_VAX 140 +@@ -345,7 +346,7 @@ getMID(old_mid,new_mid) + mid = MID_ARM6; + break; + #endif +- default: ++ default: break; + /*###352 [cc] syntax error before `}'%%%*/ + } + +@@ -522,7 +523,7 @@ GetAOutFileInfo(fd, load, xfr, a_text, a_text_fill, + ex.a_trsize= mopFileGetBX((u_char *)&ex_swap, 24, 4); + ex.a_drsize= mopFileGetBX((u_char *)&ex_swap, 28, 4); + break; +- default: ++ default: break; + /*###525 [cc] syntax error before `}'%%%*/ + } + +@@ -575,7 +576,7 @@ GetAOutFileInfo(fd, load, xfr, a_text, a_text_fill, + printf("arm32"); + break; + #endif +- default: ++ default: break; + } + printf(") Magic: "); + switch (N_GETMAGIC (ex)) { Property changes on: head/net/mopd/files/patch-common_file.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/net/mopd/files/patch-common_loop-bsd.c =================================================================== --- head/net/mopd/files/patch-common_loop-bsd.c (nonexistent) +++ head/net/mopd/files/patch-common_loop-bsd.c (revision 550628) @@ -0,0 +1,11 @@ +--- common/loop-bsd.c.orig 1996-08-16 22:41:43 UTC ++++ common/loop-bsd.c +@@ -89,7 +89,7 @@ mopReadDL() + * The list of all interfaces that are being listened to. loop() + * "selects" on the descriptors in this list. + */ +-struct if_info *iflist; ++extern struct if_info *iflist; + + void mopProcess __P((struct if_info *, u_char *)); + Property changes on: head/net/mopd/files/patch-common_loop-bsd.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/net/mopd/files/patch-common_pf.c =================================================================== --- head/net/mopd/files/patch-common_pf.c (nonexistent) +++ head/net/mopd/files/patch-common_pf.c (revision 550628) @@ -0,0 +1,32 @@ +--- common/pf.c.orig 1996-08-06 14:20:27 UTC ++++ common/pf.c +@@ -56,8 +56,8 @@ static char rcsid[] = "$Id: pf.c,v 1.16 1996/08/06 14: + #include + + #include +-#include + ++ + #include "common/mopdef.h" + + /* +@@ -174,7 +174,8 @@ pfAddMulti(s, interface, addr) + struct ifreq ifr; + int fd; + +- strcpy(ifr.ifr_name, interface); ++ strncpy(ifr.ifr_name, interface,sizeof(ifr.ifr_name) - 1); ++ ifr.ifr_name[sizeof(ifr.ifr_name) - 1] = 0; + + ifr.ifr_addr.sa_family = AF_UNSPEC; + bcopy(addr, ifr.ifr_addr.sa_data, 6); +@@ -209,7 +210,8 @@ pfDelMulti(s, interface, addr) + struct ifreq ifr; + int fd; + +- strcpy(ifr.ifr_name, interface); ++ strncpy(ifr.ifr_name, interface, sizeof (ifr.ifr_name) - 1); ++ ifr.ifr_name[sizeof(ifr.ifr_name) - 1] = 0; + + ifr.ifr_addr.sa_family = AF_UNSPEC; + bcopy(addr, ifr.ifr_addr.sa_data, 6); Property changes on: head/net/mopd/files/patch-common_pf.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/net/mopd/files/patch-common_put.c =================================================================== --- head/net/mopd/files/patch-common_put.c (nonexistent) +++ head/net/mopd/files/patch-common_put.c (revision 550628) @@ -0,0 +1,50 @@ +--- common/put.c.orig 1996-08-16 22:43:15 UTC ++++ common/put.c +@@ -35,6 +35,9 @@ static char rcsid[] = "$Id: put.c,v 1.5 1996/08/16 22: + #include + #include + #include "common/mopdef.h" ++#ifdef __FreeBSD__ ++#include ++#endif + + void + mopPutChar(pkt, index, value) +@@ -137,10 +140,7 @@ mopPutHeader(pkt, index, dst, src, proto, trans) + mopPutChar (pkt, index, 0x00); + mopPutChar (pkt, index, 0x2b); + } +-#if !defined(__FreeBSD__) +- mopPutChar(pkt, index, (proto / 256)); +- mopPutChar(pkt, index, (proto % 256)); +-#else ++#if defined(__FreeBSD__) && __FreeBSD_version < 220000 + if (trans == TRANS_8023) { + mopPutChar(pkt, index, (proto / 256)); + mopPutChar(pkt, index, (proto % 256)); +@@ -148,6 +148,9 @@ mopPutHeader(pkt, index, dst, src, proto, trans) + mopPutChar(pkt, index, (proto % 256)); + mopPutChar(pkt, index, (proto / 256)); + } ++#else ++ mopPutChar(pkt, index, (proto / 256)); ++ mopPutChar(pkt, index, (proto % 256)); + #endif + if (trans == TRANS_ETHER) + mopPutShort(pkt, index, 0); +@@ -170,12 +173,12 @@ mopPutLength(pkt, trans, len) + break; + case TRANS_8023: + index = 12; +-#if !defined(__FreeBSD__) +- mopPutChar(pkt, &index, ((len - 14) / 256)); ++#if defined(__FreeBSD__) && __FreeBSD_version < 220000 + mopPutChar(pkt, &index, ((len - 14) % 256)); ++ mopPutChar(pkt, &index, ((len - 14) / 256)); + #else +- mopPutChar(pkt, &index, ((len - 14) % 256)); + mopPutChar(pkt, &index, ((len - 14) / 256)); ++ mopPutChar(pkt, &index, ((len - 14) % 256)); + #endif + break; + } Property changes on: head/net/mopd/files/patch-common_put.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/net/mopd/files/patch-mopchk_Makefile =================================================================== --- head/net/mopd/files/patch-mopchk_Makefile (nonexistent) +++ head/net/mopd/files/patch-mopchk_Makefile (revision 550628) @@ -0,0 +1,11 @@ +--- mopchk/Makefile.orig 1996-08-16 22:46:38 UTC ++++ mopchk/Makefile +@@ -9,7 +9,7 @@ LDADD= -lkvm + + version.c version.h: ${.CURDIR}/../common/VERSION + rm -f version.c; \ +- sed 's/.*/char version[] = "&";/' ${.ALLSRC} > version.c ++ sed 's/.*/static char version[] = "&";/' ${.ALLSRC} > version.c + set `sed 's/\([0-9]*\)\.\([0-9]*\).*/\1 \2/' ${.ALLSRC}` ; \ + { echo '#define VERSION_MAJOR' $$1 ; \ + echo '#define VERSION_MINOR' $$2 ; } > version.h Property changes on: head/net/mopd/files/patch-mopchk_Makefile ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/net/mopd/files/patch-mopchk_mopchk.c =================================================================== --- head/net/mopd/files/patch-mopchk_mopchk.c (nonexistent) +++ head/net/mopd/files/patch-mopchk_mopchk.c (revision 550628) @@ -0,0 +1,11 @@ +--- mopchk/mopchk.c.orig 1996-08-16 22:47:15 UTC ++++ mopchk/mopchk.c +@@ -48,7 +48,7 @@ static char rcsid[] = "$Id: mopchk.c,v 1.5 1996/08/16 + * The list of all interfaces that are being listened to. rarp_loop() + * "selects" on the descriptors in this list. + */ +-struct if_info *iflist; ++extern struct if_info *iflist; + + #ifdef NO__P + void Usage (/* void */); Property changes on: head/net/mopd/files/patch-mopchk_mopchk.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/net/mopd/files/patch-mopd_Makefile =================================================================== --- head/net/mopd/files/patch-mopd_Makefile (nonexistent) +++ head/net/mopd/files/patch-mopd_Makefile (revision 550628) @@ -0,0 +1,11 @@ +--- mopd/Makefile.orig 1996-08-16 22:36:26 UTC ++++ mopd/Makefile +@@ -11,7 +11,7 @@ LDADD= -lkvm + + version.c version.h: ${.CURDIR}/../common/VERSION + rm -f version.c; \ +- sed 's/.*/char version[] = "&";/' ${.ALLSRC} > version.c ++ sed 's/.*/char version[] = "&";/' ${.ALLSRC} > version.c + set `sed 's/\([0-9]*\)\.\([0-9]*\).*/\1 \2/' ${.ALLSRC}` ; \ + { echo '#define VERSION_MAJOR' $$1 ; \ + echo '#define VERSION_MINOR' $$2 ; } > version.h Property changes on: head/net/mopd/files/patch-mopd_Makefile ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/net/mopd/files/patch-mopd_mopd.c =================================================================== --- head/net/mopd/files/patch-mopd_mopd.c (nonexistent) +++ head/net/mopd/files/patch-mopd_mopd.c (revision 550628) @@ -0,0 +1,11 @@ +--- mopd/mopd.c.orig 1996-03-31 19:21:00 UTC ++++ mopd/mopd.c +@@ -54,7 +54,7 @@ static char rcsid[] = "$Id: mopd.c,v 1.14 1996/03/31 1 + * The list of all interfaces that are being listened to. + * "selects" on the descriptors in this list. + */ +-struct if_info *iflist; ++extern struct if_info *iflist; + + #ifdef NO__P + void Loop (/* void */); Property changes on: head/net/mopd/files/patch-mopd_mopd.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/net/mopd/files/patch-mopd_process.c =================================================================== --- head/net/mopd/files/patch-mopd_process.c (nonexistent) +++ head/net/mopd/files/patch-mopd_process.c (revision 550628) @@ -0,0 +1,81 @@ +--- mopd/process.c.orig 1996-08-22 17:07:38 UTC ++++ mopd/process.c +@@ -265,7 +265,7 @@ mopStartLoad(dst, src, dl_rpr, trans) + dllist[slot].a_lseek = 0; + + dllist[slot].count = 0; +- if (dllist[slot].dl_bsz >= 1492) ++ if ((dllist[slot].dl_bsz >= 1492) || (dllist[slot].dl_bsz == 0)) + dllist[slot].dl_bsz = 1492; + if (dllist[slot].dl_bsz == 1030) /* VS/uVAX 2000 needs this */ + dllist[slot].dl_bsz = 1000; +@@ -348,10 +348,10 @@ mopNextLoad(dst, src, new_count, trans) + close(dllist[slot].ldfd); + dllist[slot].ldfd = 0; + dllist[slot].status = DL_STATUS_FREE; +- sprintf(line, ++ snprintf(line,sizeof(line), + "%x:%x:%x:%x:%x:%x Load completed", + dst[0],dst[1],dst[2],dst[3],dst[4],dst[5]); +- syslog(LOG_INFO, line); ++ syslog(LOG_INFO, "%s", line); + return; + } + +@@ -436,7 +436,7 @@ mopProcessDL(fd, ii, pkt, index, dst, src, trans, len) + { + u_char tmpc; + u_short moplen; +- u_char pfile[17], mopcode; ++ u_char pfile[129], mopcode; + char filename[FILENAME_MAX]; + char line[100]; + int i,nfd,iindex; +@@ -485,6 +485,8 @@ mopProcessDL(fd, ii, pkt, index, dst, src, trans, len) + rpr_pgty = mopGetChar(pkt,index); /* Program Type */ + + tmpc = mopGetChar(pkt,index); /* Software ID Len */ ++ if (tmpc > sizeof(pfile) - 1) ++ return; + for (i = 0; i < tmpc; i++) { + pfile[i] = mopGetChar(pkt,index); + pfile[i+1] = '\0'; +@@ -511,31 +513,32 @@ mopProcessDL(fd, ii, pkt, index, dst, src, trans, len) + bcopy((char *)src, (char *)(dl_rpr->eaddr), 6); + mopProcessInfo(pkt,index,moplen,dl_rpr,trans); + +- sprintf(filename,"%s/%s.SYS", MOP_FILE_PATH, pfile); ++ snprintf(filename,sizeof(filename), ++ "%s/%s.SYS", MOP_FILE_PATH, pfile); + if ((mopCmpEAddr(dst,dl_mcst) == 0)) { + if ((nfd = open(filename, O_RDONLY, 0)) != -1) { + close(nfd); + mopSendASV(src, ii->eaddr, ii, trans); +- sprintf(line, ++ snprintf(line,sizeof(line), + "%x:%x:%x:%x:%x:%x (%d) Do you have %s? (Yes)", + src[0],src[1],src[2], + src[3],src[4],src[5],trans,pfile); + } else { +- sprintf(line, ++ snprintf(line,sizeof(line), + "%x:%x:%x:%x:%x:%x (%d) Do you have %s? (No)", + src[0],src[1],src[2], + src[3],src[4],src[5],trans,pfile); + } +- syslog(LOG_INFO, line); ++ syslog(LOG_INFO, "%s", line); + } else { + if ((mopCmpEAddr(dst,ii->eaddr) == 0)) { + dl_rpr->ldfd = open(filename, O_RDONLY, 0); + mopStartLoad(src, ii->eaddr, dl_rpr, trans); +- sprintf(line, ++ snprintf(line,sizeof(line), + "%x:%x:%x:%x:%x:%x Send me %s", + src[0],src[1],src[2], + src[3],src[4],src[5],pfile); +- syslog(LOG_INFO, line); ++ syslog(LOG_INFO, "%s", line); + } + } + Property changes on: head/net/mopd/files/patch-mopd_process.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/net/mopd/files/patch-mopprobe_Makefile =================================================================== --- head/net/mopd/files/patch-mopprobe_Makefile (nonexistent) +++ head/net/mopd/files/patch-mopprobe_Makefile (revision 550628) @@ -0,0 +1,11 @@ +--- mopprobe/Makefile.orig 1996-08-16 22:48:44 UTC ++++ mopprobe/Makefile +@@ -9,7 +9,7 @@ LDADD= -lkvm + + version.c version.h: ${.CURDIR}/../common/VERSION + rm -f version.c; \ +- sed 's/.*/char version[] = "&";/' ${.ALLSRC} > version.c ++ sed 's/.*/static char version[] = "&";/' ${.ALLSRC} > version.c + set `sed 's/\([0-9]*\)\.\([0-9]*\).*/\1 \2/' ${.ALLSRC}` ; \ + { echo '#define VERSION_MAJOR' $$1 ; \ + echo '#define VERSION_MINOR' $$2 ; } > version.h Property changes on: head/net/mopd/files/patch-mopprobe_Makefile ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/net/mopd/files/patch-mopprobe_mopprobe.c =================================================================== --- head/net/mopd/files/patch-mopprobe_mopprobe.c (nonexistent) +++ head/net/mopd/files/patch-mopprobe_mopprobe.c (revision 550628) @@ -0,0 +1,11 @@ +--- mopprobe/mopprobe.c.orig 1996-08-11 22:31:43 UTC ++++ mopprobe/mopprobe.c +@@ -52,7 +52,7 @@ static char rcsid[] = "$Id: mopprobe.c,v 1.11 1996/08/ + * The list of all interfaces that are being listened to. rarp_loop() + * "selects" on the descriptors in this list. + */ +-struct if_info *iflist; ++extern struct if_info *iflist; + + #ifdef NO__P + void Loop (/* void */); Property changes on: head/net/mopd/files/patch-mopprobe_mopprobe.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/net/mopd/files/patch-moptrace_Makefile =================================================================== --- head/net/mopd/files/patch-moptrace_Makefile (nonexistent) +++ head/net/mopd/files/patch-moptrace_Makefile (revision 550628) @@ -0,0 +1,11 @@ +--- moptrace/Makefile.orig 1996-08-16 22:49:27 UTC ++++ moptrace/Makefile +@@ -11,7 +11,7 @@ LDADD= -lkvm + + version.c version.h: ${.CURDIR}/../common/VERSION + rm -f version.c; \ +- sed 's/.*/char version[] = "&";/' ${.ALLSRC} > version.c ++ sed 's/.*/static char version[] = "&";/' ${.ALLSRC} > version.c + set `sed 's/\([0-9]*\)\.\([0-9]*\).*/\1 \2/' ${.ALLSRC}` ; \ + { echo '#define VERSION_MAJOR' $$1 ; \ + echo '#define VERSION_MINOR' $$2 ; } > version.h Property changes on: head/net/mopd/files/patch-moptrace_Makefile ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/net/mopd/files/patch-moptrace_moptrace.c =================================================================== --- head/net/mopd/files/patch-moptrace_moptrace.c (nonexistent) +++ head/net/mopd/files/patch-moptrace_moptrace.c (revision 550628) @@ -0,0 +1,11 @@ +--- moptrace/moptrace.c.orig 1996-08-07 22:48:04 UTC ++++ moptrace/moptrace.c +@@ -52,7 +52,7 @@ static char rcsid[] = "$Id: moptrace.c,v 1.10 1996/08/ + * The list of all interfaces that are being listened to. + * "selects" on the descriptors in this list. + */ +-struct if_info *iflist; ++extern struct if_info *iflist; + + #ifdef NO__P + void Loop (/* void */); Property changes on: head/net/mopd/files/patch-moptrace_moptrace.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/net/mopd/files/patch-otherOS_Makefile =================================================================== --- head/net/mopd/files/patch-otherOS_Makefile (nonexistent) +++ head/net/mopd/files/patch-otherOS_Makefile (revision 550628) @@ -0,0 +1,11 @@ +--- otherOS/Makefile.orig 1996-08-13 18:44:15 UTC ++++ otherOS/Makefile +@@ -164,7 +164,7 @@ VERSION: + + version.o: version.c + version.c version.h: VERSION +- rm -f version.c ; sed 's/.*/char version[] = "&";/' VERSION > version.c ++ rm -f version.c ; sed 's/.*/static char version[] = "&";/' VERSION > version.c + set `sed 's/\([0-9]*\)\.\([0-9]*\).*/\1 \2/' VERSION` ; \ + { echo '#define VERSION_MAJOR' $$1 ; \ + echo '#define VERSION_MINOR' $$2 ; } > version.h Property changes on: head/net/mopd/files/patch-otherOS_Makefile ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/net/mopd/files/patch-otherOS_loop.c =================================================================== --- head/net/mopd/files/patch-otherOS_loop.c (nonexistent) +++ head/net/mopd/files/patch-otherOS_loop.c (revision 550628) @@ -0,0 +1,11 @@ +--- otherOS/loop.c.orig 1996-08-07 23:49:12 UTC ++++ otherOS/loop.c +@@ -39,7 +39,7 @@ static char rcsid[] = "$Id: loop.c,v 1.8 1996/08/07 23 + * The list of all interfaces that are being listened to. loop() + * "selects" on the descriptors in this list. + */ +-struct if_info *iflist; ++extern struct if_info *iflist; + u_char buf[BUFSIZE]; + + void mopProcess (/* struct if_info *, u_char * */); Property changes on: head/net/mopd/files/patch-otherOS_loop.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/net/mopd/files/patch-otherOS_pf-snit.c =================================================================== --- head/net/mopd/files/patch-otherOS_pf-snit.c (nonexistent) +++ head/net/mopd/files/patch-otherOS_pf-snit.c (revision 550628) @@ -0,0 +1,22 @@ +--- otherOS/pf-snit.c.orig 1996-08-08 11:48:50 UTC ++++ otherOS/pf-snit.c +@@ -237,7 +237,8 @@ pfAddMulti(s, interface, addr) + struct ifreq ifr; + int fd; + +- strcpy(ifr.ifr_name, interface); ++ strncpy(ifr.ifr_name, interface, sizeof (ifr.ifr_name) -1); ++ ifr.ifr_name[sizeof(ifr.ifr_name) - 1] = 0; + + ifr.ifr_addr.sa_family = AF_UNSPEC; + bcopy(addr, ifr.ifr_addr.sa_data, 6); +@@ -272,7 +273,8 @@ char *interface, *addr; + struct ifreq ifr; + int fd; + +- strcpy(ifr.ifr_name, interface); ++ strncpy(ifr.ifr_name, interface, sizeof (ifr.ifr_name) -1); ++ ifr.ifr_name[sizeof(ifr.ifr_name) - 1] = 0; + + ifr.ifr_addr.sa_family = AF_UNSPEC; + bcopy(addr, ifr.ifr_addr.sa_data, 6); Property changes on: head/net/mopd/files/patch-otherOS_pf-snit.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property