diff options
author | pav <pav@FreeBSD.org> | 2005-02-20 04:42:39 +0800 |
---|---|---|
committer | pav <pav@FreeBSD.org> | 2005-02-20 04:42:39 +0800 |
commit | 88e7098386802a91a3ae9007eb24ccd0036157a4 (patch) | |
tree | 7490cc93bff9b85aebe1f3e364462827311c0cd0 /dns/dhid/files | |
parent | 5c4da98a7359a7f45816fa7dd81409bce0159380 (diff) | |
download | freebsd-ports-gnome-88e7098386802a91a3ae9007eb24ccd0036157a4.tar.gz freebsd-ports-gnome-88e7098386802a91a3ae9007eb24ccd0036157a4.tar.zst freebsd-ports-gnome-88e7098386802a91a3ae9007eb24ccd0036157a4.zip |
- Update to 5.2
PR: ports/77127
Submitted by: Thomas Melzer <tmelzer@tomesoft.de>
Approved by: maintainer timeout (14 days)
Diffstat (limited to 'dns/dhid/files')
-rw-r--r-- | dns/dhid/files/dhid.sh | 3 | ||||
-rw-r--r-- | dns/dhid/files/patch-aa | 19 | ||||
-rw-r--r-- | dns/dhid/files/patch-ab | 31 | ||||
-rw-r--r-- | dns/dhid/files/patch-ac | 79 | ||||
-rw-r--r-- | dns/dhid/files/patch-ad | 63 | ||||
-rw-r--r-- | dns/dhid/files/patch-ae | 19 | ||||
-rw-r--r-- | dns/dhid/files/patch-af | 32 |
7 files changed, 229 insertions, 17 deletions
diff --git a/dns/dhid/files/dhid.sh b/dns/dhid/files/dhid.sh index 510f4ab70d16..e9bfaab48b19 100644 --- a/dns/dhid/files/dhid.sh +++ b/dns/dhid/files/dhid.sh @@ -1,4 +1,5 @@ #!/bin/sh +PATH=/bin:/sbin:/usr/bin:/usr/sbin if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then echo "$0: Cannot determine the PREFIX" >&2 @@ -7,7 +8,7 @@ fi case "$1" in start) - [ -x "${PREFIX}/sbin/dhid" -a -f "${PREFIX}/etc/dhid.conf" ] && ${PREFIX}/sbin/dhid > /dev/null && echo -n ' dhid' + [ -x "${PREFIX}/sbin/dhid" -a -f "${PREFIX}/etc/dhid.conf" ] && su -m dhis -c ${PREFIX}/sbin/dhid > /dev/null && echo -n ' dhid' ;; stop) killall dhid && echo -n ' dhid' diff --git a/dns/dhid/files/patch-aa b/dns/dhid/files/patch-aa index ff0171d63d58..58a6413fc8c0 100644 --- a/dns/dhid/files/patch-aa +++ b/dns/dhid/files/patch-aa @@ -1,13 +1,22 @@ ---- dhid.h.orig Sun Jan 14 19:39:01 2001 -+++ dhid.h Sun Jan 14 19:41:37 2001 -@@ -73,8 +73,8 @@ - #define OFFLINE_REQ 0x00000451 +--- dhid.h.orig Thu Nov 20 21:02:38 2003 ++++ dhid.h Sat Feb 19 21:14:47 2005 +@@ -56,7 +56,7 @@ + + #define DHIS_VERSION 52 /* DHIS Version */ + +-#define MAX_HOSTNAME 64 ++#define MAX_HOSTNAME 256 + #define MAX_PASS 16 /* Characters in password */ + + /* Message opcodes */ +@@ -72,8 +72,8 @@ + #define OFFLINE_REQ 0x00000551 -#define DHID_CONF "/etc/dhid.conf" -#define DHID_PID "/etc/dhid.pid" +#define DHID_CONF "__PREFIX__/etc/dhid.conf" -+#define DHID_PID "/var/run/dhid.pid" ++#define DHID_PID "/var/run/dhis/dhid.pid" #define DEF_ISPORT 58800 #define FAIL_ALLOW 3 diff --git a/dns/dhid/files/patch-ab b/dns/dhid/files/patch-ab index a818e892bcfd..be0e9576fdec 100644 --- a/dns/dhid/files/patch-ab +++ b/dns/dhid/files/patch-ab @@ -1,17 +1,26 @@ ---- Makefile.orig Sun Jan 14 19:39:56 2001 -+++ Makefile Sun Jan 14 19:40:37 2001 -@@ -25,13 +25,10 @@ - # - # DHIS(c) Dynamic Host Information System Release 4.0 - --CC=cc -+CC?=cc +--- Makefile.orig Wed Sep 12 12:12:02 2001 ++++ Makefile Sat Feb 19 21:19:11 2005 +@@ -29,8 +29,8 @@ # Add -lnsl and -lsocket to LIBS in SysV systems # --CFLAGS=-I/usr/local/include -DQRC=1 +-CFLAGS=-I/usr/local/include -DQRC=1 -Wall -LFLAGS=-L/usr/local/lib --LIBS=-lgmp ++CFLAGS=-I__PREFIX__/include -DQRC=1 -Wall ++#LFLAGS=-L/usr/local/lib + LIBS=-lgmp # Use these and comment the above if you wish to compile dhid without - # secure public key authentication or don't have the GMP library +@@ -46,10 +46,10 @@ + all: dhid genkeys + + dhid: conf.o network.o main.o +- $(CC) $(LFLAGS) -o dhid conf.o network.o main.o $(LIBS) ++ $(CC) $(LDFLAGS) -o dhid conf.o network.o main.o $(LIBS) + + genkeys: genkeys.c +- $(CC) $(CFLAGS) $(LFLAGS) -o genkeys genkeys.c $(LIBS) ++ $(CC) $(CFLAGS) $(LDFLAGS) -o genkeys genkeys.c $(LIBS) + + main.o: dhid.h main.c + $(CC) $(CFLAGS) -c main.c diff --git a/dns/dhid/files/patch-ac b/dns/dhid/files/patch-ac new file mode 100644 index 000000000000..5994ae7827f1 --- /dev/null +++ b/dns/dhid/files/patch-ac @@ -0,0 +1,79 @@ +--- main.c.orig Thu Nov 20 22:11:59 2003 ++++ main.c Sat Feb 19 21:22:50 2005 +@@ -74,7 +74,7 @@ + unsigned char linecmd[512]; + struct in_addr sa; + sa.s_addr=cp->laddr; +- sprintf(linecmd,"%s %d %s %s",cp->off_cmd,cp->id, ++ snprintf(linecmd,sizeof(linecmd),"%s %d %s %s",cp->off_cmd,cp->id, + inet_ntoa((struct in_addr)sa) + ,cp->off_cmdp); + cmd_fork(linecmd); +@@ -106,7 +106,7 @@ + unsigned char linecmd[512]; + struct in_addr sa; + sa.s_addr=cp->laddr; +- sprintf(linecmd,"%s %d %s %s",cp->off_cmd,cp->id, ++ snprintf(linecmd,sizeof(linecmd),"%s %d %s %s",cp->off_cmd,cp->id, + inet_ntoa((struct in_addr)sa) + ,cp->off_cmdp); + cmd_fork(linecmd); +@@ -189,7 +189,7 @@ + unsigned char linecmd[512]; + struct in_addr sa; + sa.s_addr=cp->laddr; +- sprintf(linecmd,"%s %d %s %s",cp->on_cmd,cp->id, ++ snprintf(linecmd,sizeof(linecmd),"%s %d %s %s",cp->on_cmd,cp->id, + inet_ntoa((struct in_addr)sa) + ,cp->on_cmdp); + cmd_fork(linecmd); +@@ -223,8 +223,8 @@ + return; + cp->cserver=sp; + cp->stage=AUTH_STAGE; +- if(cp->atype==APASS) strcpy(m.pass,cp->pass); +- else memset(m.pass,0,16); ++ if(cp->atype==APASS) strlcpy(m.pass,cp->pass,sizeof(m.pass)); ++ else memset(m.pass,0,sizeof(m.pass)); + m.hdr.opcode=AUTH_REQ; + m.hdr.hostid=cp->id; + m.refresh=cp->refresh; +@@ -289,25 +289,19 @@ + int c; + extern char *optarg; + +- strcpy(conf_file,DHID_CONF); +- strcpy(pid_file,DHID_PID); ++ strlcpy(conf_file,DHID_CONF,sizeof(conf_file)); ++ strlcpy(pid_file,DHID_PID,sizeof(pid_file)); + + while((c=getopt(argc,argv,"hf:p:P:"))!=EOF) + switch(c) { + case('p'): rport=atoi(optarg); break; +- case('P'): strncpy(pid_file,optarg,sizeof(pid_file)); break; +- case('f'): strncpy(conf_file,optarg,sizeof(conf_file)); break; ++ case('P'): strlcpy(pid_file,optarg,sizeof(pid_file)); break; ++ case('f'): strlcpy(conf_file,optarg,sizeof(conf_file)); break; + case('h'): usage(argv); + default: usage(argv); + } + + +- if(getuid()) { +- syslog(LOG_ERR,"%s must be executed by root",argv[0]); +- exit(1); +- } +- +- + close(0); + close(1); + close(2); +@@ -376,7 +370,7 @@ + unsigned char linecmd[512]; + struct in_addr sa; + sa.s_addr=cp->laddr; +- sprintf(linecmd,"%s %d %s %s",cp->off_cmd,cp->id, ++ snprintf(linecmd,sizeof(linecmd),"%s %d %s %s",cp->off_cmd,cp->id, + inet_ntoa((struct in_addr)sa) + ,cp->off_cmdp); + cmd_fork(linecmd); diff --git a/dns/dhid/files/patch-ad b/dns/dhid/files/patch-ad new file mode 100644 index 000000000000..2bdf658d8808 --- /dev/null +++ b/dns/dhid/files/patch-ad @@ -0,0 +1,63 @@ +--- conf.c.orig Wed Sep 12 12:32:09 2001 ++++ conf.c Sat Feb 19 21:26:06 2005 +@@ -155,7 +155,7 @@ + cp->id=atoi(line_entry(2,line)); + + if(!strcmp(line_entry(1,line),"hostpass")) { +- strcpy(cp->pass,line_entry(2,line)); ++ strlcpy(cp->pass,line_entry(2,line),sizeof(cp->pass)); + cp->atype=APASS; + } + if(!strcmp(line_entry(1,line),"isaddr")) { +@@ -180,32 +180,32 @@ + sp->addr=0; + sp->hostname[0]='\0'; + +- strcpy(str2,line_entry(2,line)); ++ strlcpy(str2,line_entry(2,line),sizeof(str2)); + +- strcpy(str,dot_entry(1,str2)); +- strcpy(str3,dot_entry(2,str2)); ++ strlcpy(str,dot_entry(1,str2),sizeof(str)); ++ strlcpy(str3,dot_entry(2,str2),sizeof(str3)); + + if(isdigit(str[0])) sp->addr=inet_addr(str); +- else strcpy(sp->hostname,str); ++ else strlcpy(sp->hostname,str,sizeof(sp->hostname)); + if(str3[0]!='\0') sp->port=atoi(str3); + } + if(!strcmp(line_entry(1,line),"refresh")) { +- strcpy(str,line_entry(2,line)); ++ strlcpy(str,line_entry(2,line),sizeof(str)); + cp->refresh=atoi(str); + } + if(!strcmp(line_entry(1,line),"oncmd")) { +- strcpy(cp->on_cmd,line_entry(2,line)); +- strcpy(cp->on_cmdp,line_ptr(3,line)); ++ strlcpy(cp->on_cmd,line_entry(2,line),sizeof(cp->on_cmd)); ++ strlcpy(cp->on_cmdp,line_ptr(3,line),sizeof(cp->on_cmdp)); + } + if(!strcmp(line_entry(1,line),"offcmd")) { +- strcpy(cp->off_cmd,line_entry(2,line)); +- strcpy(cp->off_cmdp,line_ptr(3,line)); ++ strlcpy(cp->off_cmd,line_entry(2,line),sizeof(cp->off_cmd)); ++ strlcpy(cp->off_cmdp,line_ptr(3,line),sizeof(cp->off_cmdp)); + } + + + if(!strcmp(line_entry(1,line),"authp")) { + #ifdef QRC +- strcat(keyp,line_entry(2,line)); ++ strlcat(keyp,line_entry(2,line),sizeof(keyp)); + cp->atype=AQRC; + #else + syslog(LOG_ERR,"QRC authentication not available in this client" +@@ -216,7 +216,7 @@ + } + if(!strcmp(line_entry(1,line),"authq")) { + #ifdef QRC +- strcat(keyq,line_entry(2,line)); ++ strlcat(keyq,line_entry(2,line),sizeof(keyq)); + cp->atype=AQRC; + #else + syslog(LOG_ERR,"QRC authentication not available in this client" diff --git a/dns/dhid/files/patch-ae b/dns/dhid/files/patch-ae new file mode 100644 index 000000000000..cfdb5c27e90d --- /dev/null +++ b/dns/dhid/files/patch-ae @@ -0,0 +1,19 @@ +--- genkeys.c.orig Wed Sep 12 12:13:07 2001 ++++ genkeys.c Sat Feb 19 21:27:32 2005 +@@ -46,12 +46,12 @@ + static int seed=0; + + if(!seed) { seed++; srandom(time(NULL)); } +- memset(buff,0,256); +- memset(temp,0,128); ++ memset(buff,0,sizeof(buff)); ++ memset(temp,0,sizeof(temp)); + + do { +- sprintf(temp,"%lu",(unsigned long int)random()); +- strcat(buff,temp); ++ snprintf(temp,sizeof(temp),"%lu",(unsigned long int)random()); ++ strlcat(buff,temp,sizeof(buff)); + + } while(strlen(buff) < n); + buff[n]='\0'; diff --git a/dns/dhid/files/patch-af b/dns/dhid/files/patch-af new file mode 100644 index 000000000000..cad212e50d09 --- /dev/null +++ b/dns/dhid/files/patch-af @@ -0,0 +1,32 @@ +--- network.c.orig Wed Sep 12 12:13:18 2001 ++++ network.c Sat Feb 19 21:29:32 2005 +@@ -290,12 +290,12 @@ + static int seed=0; + + if(!seed) { seed++; srandom(time(NULL)); } +- memset(buff,0,256); +- memset(temp,0,128); ++ memset(buff,0,sizeof(buff)); ++ memset(temp,0,sizeof(temp)); + + do { +- sprintf(temp,"%u",(unsigned)random()); +- strcat(buff,temp); ++ snprintf(temp,sizeof(temp),"%u",(unsigned)random()); ++ strlcat(buff,temp,sizeof(buff)); + + } while(strlen(buff) < n); + buff[n]='\0'; +@@ -441,10 +441,10 @@ + if(j<0) return; + + buff[0]='\0'; +- for(i=0;i<j;i++) strcat(buff,"0"); /* Place 0's */ ++ for(i=0;i<j;i++) strlcat(buff,"0",sizeof(buff)); /* Place 0's */ + + mpz_get_str(buff2,10,x); /* Add x */ +- strcat(buff,buff2); ++ strlcat(buff,buff2,sizeof(buff)); + + /* Now copy n digits to str */ + cp1=str; |