diff options
author | joerg <joerg> | 2006-03-14 02:21:46 +0000 |
---|---|---|
committer | joerg <joerg> | 2006-03-14 02:21:46 +0000 |
commit | 935756feed65c40cd2e5b6c5a175f012ddc2df77 (patch) | |
tree | 39f5cbbeedad4ca1fa6e6a32df61d07ed90caddc /net | |
parent | d957945740c92605bec66334238b2d37466fd4bf (diff) | |
download | pkgsrc-935756feed65c40cd2e5b6c5a175f012ddc2df77.tar.gz |
Fix errno and strerror. Prefer NAME_MAX. Fix a number of sprintf usages
to use snprintf while here.
Diffstat (limited to 'net')
-rw-r--r-- | net/cmu-dhcpd/distinfo | 5 | ||||
-rw-r--r-- | net/cmu-dhcpd/patches/patch-ad | 115 | ||||
-rw-r--r-- | net/cmu-dhcpd/patches/patch-ae | 12 | ||||
-rw-r--r-- | net/cmu-dhcpd/patches/patch-af | 22 |
4 files changed, 153 insertions, 1 deletions
diff --git a/net/cmu-dhcpd/distinfo b/net/cmu-dhcpd/distinfo index ffcfa9049f6..4ec9597cb8a 100644 --- a/net/cmu-dhcpd/distinfo +++ b/net/cmu-dhcpd/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.3 2005/02/24 12:13:44 agc Exp $ +$NetBSD: distinfo,v 1.4 2006/03/14 02:21:46 joerg Exp $ SHA1 (CMU-dhcp-3.3.7+PU-9.tar.Z) = 9c7eb8f498eddd35d0eb9ceaa90451f06bb5cf27 RMD160 (CMU-dhcp-3.3.7+PU-9.tar.Z) = b426f5580771ef635a34c336d0422cc31dd934d2 @@ -6,3 +6,6 @@ Size (CMU-dhcp-3.3.7+PU-9.tar.Z) = 752011 bytes SHA1 (patch-aa) = bbedb6f3c01d6459f5e0623e8e165ecef6d09374 SHA1 (patch-ab) = 94a2fa4094d8a494db3188dc1a415ed5eb2642bb SHA1 (patch-ac) = 0729cc8ff71b57fba0975b802ed4cbcfaeb78a5b +SHA1 (patch-ad) = 25771145085881630fbc807ad2537e254f144161 +SHA1 (patch-ae) = 648f6fe130c060c926ba6d43508701bbf7c0cfbd +SHA1 (patch-af) = 2d355ecde64da2ea5d9f1afdb608884691ccd0f0 diff --git a/net/cmu-dhcpd/patches/patch-ad b/net/cmu-dhcpd/patches/patch-ad new file mode 100644 index 00000000000..b6f241a7163 --- /dev/null +++ b/net/cmu-dhcpd/patches/patch-ad @@ -0,0 +1,115 @@ +$NetBSD: patch-ad,v 1.1 2006/03/14 02:21:46 joerg Exp $ + +--- hashf.c.orig 2006-03-14 02:10:26.000000000 +0000 ++++ hashf.c +@@ -33,6 +33,7 @@ SOFTWARE. + + + #include <sys/types.h> ++#include <limits.h> + #include <stdlib.h> + + #ifndef USE_BFUNCS +@@ -168,10 +169,14 @@ hashf_Exists(hashtable, hashcode, compar + hash_datum *key; + { + FILE *fp; ++#if defined(NAME_MAX) ++ char name[NAME_MAX],buf[MAXELEMENTLEN]; ++#else + char name[MAXNAMLEN],buf[MAXELEMENTLEN]; ++#endif + int len,rc; + +- sprintf(name,"%s/%X",hashtable->dirname,hashcode % hashtable->size); ++ snprintf(name,sizeof(name),"%s/%X",hashtable->dirname,hashcode % hashtable->size); + fp=fopen(name,"r"); + if(!fp) + return FALSE; +@@ -215,10 +220,14 @@ hashf_Insert(hashtable, hashcode, compar + unsigned long elen; + { + FILE *fp; ++#if defined(NAME_MAX) ++ char name[NAME_MAX],buf[MAXELEMENTLEN]; ++#else + char name[MAXNAMLEN],buf[MAXELEMENTLEN]; ++#endif + int rc,len; + hashcode %= hashtable->size; +- sprintf(name,"%s/%X",hashtable->dirname,hashcode); ++ snprintf(name,sizeof(name),"%s/%X",hashtable->dirname,hashcode); + + fp=fopen(name,"a+"); + if(!fp) +@@ -265,10 +274,14 @@ hashf_Delete(hashtable, hashcode, compar + hash_datum *key; + { + FILE *fp,*tmp; ++#if defined(NAME_MAX) ++ char name[NAME_MAX],buf[MAXELEMENTLEN]; ++#else + char name[MAXNAMLEN],buf[MAXELEMENTLEN]; ++#endif + int rc,len; + hashcode %= hashtable->size; +- sprintf(name,"%s/%X",hashtable->dirname,hashcode); ++ snprintf(name,sizeof(name),"%s/%X",hashtable->dirname,hashcode); + + fp=fopen(name,"r"); + if(!fp) +@@ -331,10 +344,14 @@ hashf_Replace(hashtable, hashcode, compa + unsigned long elen; + { + FILE *fp,*tmp; ++#if defined(NAME_MAX) ++ char name[NAME_MAX],buf[MAXELEMENTLEN]; ++#else + char name[MAXNAMLEN],buf[MAXELEMENTLEN]; ++#endif + int rc,len; + char write,done; +- sprintf(name,"%s/%X",hashtable->dirname,hashcode % hashtable->size); ++ snprintf(name,sizeof(name),"%s/%X",hashtable->dirname,hashcode % hashtable->size); + + fp=fopen(name,"r"); + if(!fp) +@@ -432,11 +449,15 @@ hashf_Lookup(hashtable, hashcode, compar + int *length; + { + FILE *fp; +- char name[MAXNAMLEN],buf[MAXELEMENTLEN]; ++#if defined(NAME_MAX) ++ char name[NAME_MAX],buf[MAXELEMENTLEN]; ++#else ++ char name[MAXNAMLEN],buf[MAXELEMENTLEN]; ++#endif + int len,rc; + hash_datum *p; + +- sprintf(name,"%s/%X",hashtable->dirname,hashcode % hashtable->size); ++ snprintf(name,sizeof(name),"%s/%X",hashtable->dirname,hashcode % hashtable->size); + fp=fopen(name,"r"); + if(!fp) + return NULL; +@@ -479,7 +500,11 @@ hashf_NextEntry(hashtable,length) + int *length; + { + unsigned long len; ++#if defined(NAME_MAX) ++ char name[NAME_MAX]; ++#else + char name[MAXNAMLEN]; ++#endif + int rc; + hash_datum *p; + struct dirent *direntry; +@@ -494,7 +519,7 @@ hashf_NextEntry(hashtable,length) + }while(direntry->d_name[0]=='.'); + if(hashtable->next) + fclose(hashtable->next); +- sprintf(name,"%s/%s",hashtable->dirname,direntry->d_name); ++ snprintf(name,sizeof(name),"%s/%s",hashtable->dirname,direntry->d_name); + hashtable->next=fopen(name,"r"); + rc=fread(&len,4,1,hashtable->next); + if(rc==0) diff --git a/net/cmu-dhcpd/patches/patch-ae b/net/cmu-dhcpd/patches/patch-ae new file mode 100644 index 00000000000..c6e2ceea0ac --- /dev/null +++ b/net/cmu-dhcpd/patches/patch-ae @@ -0,0 +1,12 @@ +$NetBSD: patch-ae,v 1.1 2006/03/14 02:21:46 joerg Exp $ + +--- ping.c.orig 2006-03-14 02:14:39.000000000 +0000 ++++ ping.c +@@ -47,7 +47,6 @@ SOFTWARE. + + static char buffer[MAXPACKET]; + static unsigned short sequence =0; +-extern int errno; + #define MAX_DUP_CHK (8 * 128) + static int mx_dup_ck = MAX_DUP_CHK; + static char rcvd_tbl[MAX_DUP_CHK / 8]; diff --git a/net/cmu-dhcpd/patches/patch-af b/net/cmu-dhcpd/patches/patch-af new file mode 100644 index 00000000000..1cdc72fbec9 --- /dev/null +++ b/net/cmu-dhcpd/patches/patch-af @@ -0,0 +1,22 @@ +$NetBSD: patch-af,v 1.1 2006/03/14 02:21:46 joerg Exp $ + +--- report.c.orig 2006-03-14 02:15:23.000000000 +0000 ++++ report.c +@@ -10,6 +10,7 @@ + #endif + + #include <stdio.h> ++#include <string.h> + + #include "defaults.h" + #include "report.h" +@@ -138,9 +139,6 @@ report(priority, fmt, va_alist) + char * + get_errmsg() + { +- extern int errno; +- extern char *strerror(); +- + return strerror(errno); + } + |