Index: Makefile =================================================================== RCS file: /home/cvs/ringlet/c/contrib/net/djbdns/Makefile,v retrieving revision 1.2 diff -u -r1.2 Makefile --- djbdns-1.05/Makefile 13 Jun 2001 13:37:26 -0000 1.2 +++ djbdns-1.05/Makefile 24 Jul 2003 11:31:07 -0000 @@ -2,7 +2,7 @@ SHELL=/bin/sh -default: it +default: it it-lib alloc.a: \ makelib alloc.o alloc_re.o getln.o getln2.o stralloc_cat.o \ @@ -194,6 +194,10 @@ it instcheck ./instcheck +check-lib: \ +it-lib instcheck-lib + ./instcheck-lib + chkshsgr: \ load chkshsgr.o ./load chkshsgr @@ -518,22 +522,42 @@ compile hier.c auto_home.h ./compile hier.c +hier-lib.o: \ +compile hier-lib.c auto_home.h + ./compile hier-lib.c + install: \ load install.o hier.o auto_home.o buffer.a unix.a byte.a ./load install hier.o auto_home.o buffer.a unix.a byte.a +install-lib: \ +load install-lib.o hier-lib.o auto_home.o buffer.a unix.a byte.a + ./load install-lib hier-lib.o auto_home.o buffer.a unix.a byte.a + install.o: \ compile install.c buffer.h strerr.h error.h open.h exit.h ./compile install.c +install-lib.o: \ +install.o + cp -p install.o install-lib.o + instcheck: \ load instcheck.o hier.o auto_home.o buffer.a unix.a byte.a ./load instcheck hier.o auto_home.o buffer.a unix.a byte.a +instcheck-lib: \ +load instcheck-lib.o hier-lib.o auto_home.o buffer.a unix.a byte.a + ./load instcheck-lib hier-lib.o auto_home.o buffer.a unix.a byte.a + instcheck.o: \ compile instcheck.c strerr.h error.h exit.h ./compile instcheck.c +instcheck-lib.o: \ +instcheck.o + cp -p instcheck.o instcheck-lib.o + iopause.h: \ choose compile load trypoll.c iopause.h1 iopause.h2 ./choose clr trypoll iopause.h1 iopause.h2 > iopause.h @@ -553,6 +577,10 @@ it: \ prog install instcheck +it-lib: \ +alloc.a buffer.a byte.a dns.a env.a getopt.a unix.a \ +install-lib instcheck-lib + libtai.a: \ makelib tai_add.o tai_now.o tai_pack.o tai_sub.o tai_uint.o \ tai_unpack.o taia_add.o taia_approx.o taia_frac.o taia_less.o \ @@ -780,6 +808,10 @@ setup: \ it install ./install + +setup-lib: \ +it-lib install-lib + ./install-lib sgetopt.o: \ compile sgetopt.c buffer.h sgetopt.h subgetopt.h subgetopt.h Index: TARGETS =================================================================== RCS file: /home/cvs/ringlet/c/contrib/net/djbdns/TARGETS,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 TARGETS --- djbdns-1.05/TARGETS 2 Feb 2001 14:00:16 -0000 1.1.1.1 +++ djbdns-1.05/TARGETS 24 Jul 2003 11:17:30 -0000 @@ -207,10 +207,15 @@ rts prog install.o +install-lib.o hier.o +hier-lib.o install +install-lib instcheck.o +instcheck-lib.o instcheck +instcheck-lib it setup check Index: hier-lib.c =================================================================== RCS file: /home/cvs/ringlet/c/contrib/net/djbdns/hier-lib.c,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 hier-lib.c --- djbdns-1.05/hier-lib.c 2 Feb 2001 14:00:20 -0000 1.1.1.1 +++ djbdns-1.05/hier-lib.c 24 Jul 2003 11:26:19 -0000 @@ -2,41 +2,53 @@ void hier() { - c("/","etc","dnsroots.global",-1,-1,0644); - h(auto_home,-1,-1,02755); - d(auto_home,"bin",-1,-1,02755); - - c(auto_home,"bin","dnscache-conf",-1,-1,0755); - c(auto_home,"bin","tinydns-conf",-1,-1,0755); - c(auto_home,"bin","walldns-conf",-1,-1,0755); - c(auto_home,"bin","rbldns-conf",-1,-1,0755); - c(auto_home,"bin","pickdns-conf",-1,-1,0755); - c(auto_home,"bin","axfrdns-conf",-1,-1,0755); - - c(auto_home,"bin","dnscache",-1,-1,0755); - c(auto_home,"bin","tinydns",-1,-1,0755); - c(auto_home,"bin","walldns",-1,-1,0755); - c(auto_home,"bin","rbldns",-1,-1,0755); - c(auto_home,"bin","pickdns",-1,-1,0755); - c(auto_home,"bin","axfrdns",-1,-1,0755); + d(auto_home,"include",-1,-1,02755); + d(auto_home,"include/djb",-1,-1,02755); + d(auto_home,"lib",-1,-1,02755); - c(auto_home,"bin","tinydns-get",-1,-1,0755); - c(auto_home,"bin","tinydns-data",-1,-1,0755); - c(auto_home,"bin","tinydns-edit",-1,-1,0755); - c(auto_home,"bin","rbldns-data",-1,-1,0755); - c(auto_home,"bin","pickdns-data",-1,-1,0755); - c(auto_home,"bin","axfr-get",-1,-1,0755); + c(auto_home,"include/djb","alloc.h",-1,-1,0755); + c(auto_home,"include/djb","auto_home.h",-1,-1,0755); + c(auto_home,"include/djb","byte.h",-1,-1,0755); + c(auto_home,"include/djb","buffer.h",-1,-1,0755); + c(auto_home,"include/djb","case.h",-1,-1,0755); + c(auto_home,"include/djb","dns.h",-1,-1,0755); + c(auto_home,"include/djb","error.h",-1,-1,0755); + c(auto_home,"include/djb","env.h",-1,-1,0755); + c(auto_home,"include/djb","exit.h",-1,-1,0755); + c(auto_home,"include/djb","fmt.h",-1,-1,0755); + c(auto_home,"include/djb","gen_alloc.h",-1,-1,0755); + c(auto_home,"include/djb","gen_allocdefs.h",-1,-1,0755); + c(auto_home,"include/djb","getln.h",-1,-1,0755); + c(auto_home,"include/djb","ip4.h",-1,-1,0755); + c(auto_home,"include/djb","iopause.h",-1,-1,0755); + c(auto_home,"include/djb","ndelay.h",-1,-1,0755); + c(auto_home,"include/djb","open.h",-1,-1,0755); + c(auto_home,"include/djb","openreadclose.h",-1,-1,0755); + c(auto_home,"include/djb","readclose.h",-1,-1,0755); + c(auto_home,"include/djb","str.h",-1,-1,0755); + c(auto_home,"include/djb","stralloc.h",-1,-1,0755); + c(auto_home,"include/djb","strerr.h",-1,-1,0755); + c(auto_home,"include/djb","scan.h",-1,-1,0755); + c(auto_home,"include/djb","socket.h",-1,-1,0755); + c(auto_home,"include/djb","sgetopt.h",-1,-1,0755); + c(auto_home,"include/djb","subgetopt.h",-1,-1,0755); + c(auto_home,"include/djb","seek.h",-1,-1,0755); + c(auto_home,"include/djb","uint16.h",-1,-1,0755); + c(auto_home,"include/djb","uint32.h",-1,-1,0755); + c(auto_home,"include/djb","uint64.h",-1,-1,0755); + c(auto_home,"include/djb","dns.h",-1,-1,0755); + c(auto_home,"include/djb","dns.h",-1,-1,0755); + c(auto_home,"include/djb","dns.h",-1,-1,0755); + c(auto_home,"include/djb","dns.h",-1,-1,0755); + c(auto_home,"include/djb","dns.h",-1,-1,0755); + c(auto_home,"include/djb","dns.h",-1,-1,0755); - c(auto_home,"bin","dnsip",-1,-1,0755); - c(auto_home,"bin","dnsipq",-1,-1,0755); - c(auto_home,"bin","dnsname",-1,-1,0755); - c(auto_home,"bin","dnstxt",-1,-1,0755); - c(auto_home,"bin","dnsmx",-1,-1,0755); - c(auto_home,"bin","dnsfilter",-1,-1,0755); - c(auto_home,"bin","random-ip",-1,-1,0755); - c(auto_home,"bin","dnsqr",-1,-1,0755); - c(auto_home,"bin","dnsq",-1,-1,0755); - c(auto_home,"bin","dnstrace",-1,-1,0755); - c(auto_home,"bin","dnstracesort",-1,-1,0755); + cto(auto_home,"lib","alloc.a","liballoc.a",-1,-1,0755); + cto(auto_home,"lib","buffer.a","libbuffer.a",-1,-1,0755); + cto(auto_home,"lib","byte.a","libbyte.a",-1,-1,0755); + cto(auto_home,"lib","dns.a","libdns.a",-1,-1,0755); + cto(auto_home,"lib","env.a","libenv.a",-1,-1,0755); + cto(auto_home,"lib","getopt.a","libgetopt.a",-1,-1,0755); + cto(auto_home,"lib","unix.a","libunix.a",-1,-1,0755); } Index: install.c =================================================================== RCS file: /home/cvs/ringlet/c/contrib/net/djbdns/install.c,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 install.c --- djbdns-1.05/install.c 2 Feb 2001 14:00:20 -0000 1.1.1.1 +++ djbdns-1.05/install.c 24 Jul 2003 11:08:53 -0000 @@ -51,10 +51,11 @@ buffer ssin; buffer ssout; -void c(home,subdir,file,uid,gid,mode) +void cto(home,subdir,file,destfile,uid,gid,mode) char *home; char *subdir; char *file; +char *destfile; int uid; int gid; int mode; @@ -75,30 +76,41 @@ if (chdir(subdir) == -1) strerr_die6sys(111,FATAL,"unable to switch to ",home,"/",subdir,": "); - fdout = open_trunc(file); + fdout = open_trunc(destfile); if (fdout == -1) - strerr_die6sys(111,FATAL,"unable to write .../",subdir,"/",file,": "); + strerr_die6sys(111,FATAL,"unable to write .../",subdir,"/",destfile,": "); buffer_init(&ssout,buffer_unixwrite,fdout,outbuf,sizeof outbuf); switch(buffer_copy(&ssout,&ssin)) { case -2: strerr_die4sys(111,FATAL,"unable to read ",file,": "); case -3: - strerr_die6sys(111,FATAL,"unable to write .../",subdir,"/",file,": "); + strerr_die6sys(111,FATAL,"unable to write .../",subdir,"/",destfile,": "); } close(fdin); if (buffer_flush(&ssout) == -1) - strerr_die6sys(111,FATAL,"unable to write .../",subdir,"/",file,": "); + strerr_die6sys(111,FATAL,"unable to write .../",subdir,"/",destfile,": "); if (fsync(fdout) == -1) - strerr_die6sys(111,FATAL,"unable to write .../",subdir,"/",file,": "); + strerr_die6sys(111,FATAL,"unable to write .../",subdir,"/",destfile,": "); if (close(fdout) == -1) /* NFS silliness */ - strerr_die6sys(111,FATAL,"unable to write .../",subdir,"/",file,": "); + strerr_die6sys(111,FATAL,"unable to write .../",subdir,"/",destfile,": "); + + if (chown(destfile,uid,gid) == -1) + strerr_die6sys(111,FATAL,"unable to chown .../",subdir,"/",destfile,": "); + if (chmod(destfile,mode) == -1) + strerr_die6sys(111,FATAL,"unable to chmod .../",subdir,"/",destfile,": "); +} - if (chown(file,uid,gid) == -1) - strerr_die6sys(111,FATAL,"unable to chown .../",subdir,"/",file,": "); - if (chmod(file,mode) == -1) - strerr_die6sys(111,FATAL,"unable to chmod .../",subdir,"/",file,": "); +void c(home,subdir,file,uid,gid,mode) +char *home; +char *subdir; +char *file; +int uid; +int gid; +int mode; +{ + cto(home,subdir,file,file,uid,gid,mode); } void z(home,subdir,file,len,uid,gid,mode) Index: instcheck.c =================================================================== RCS file: /home/cvs/ringlet/c/contrib/net/djbdns/instcheck.c,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 instcheck.c --- djbdns-1.05/instcheck.c 2 Feb 2001 14:00:20 -0000 1.1.1.1 +++ djbdns-1.05/instcheck.c 24 Jul 2003 11:09:56 -0000 @@ -73,10 +73,11 @@ perm("",home,"/",fifo,S_IFIFO,uid,gid,mode); } -void c(home,subdir,file,uid,gid,mode) +void cto(home,subdir,file,destfile,uid,gid,mode) char *home; char *subdir; char *file; +char *destfile; int uid; int gid; int mode; @@ -85,7 +86,18 @@ strerr_die4sys(111,FATAL,"unable to switch to ",home,": "); if (chdir(subdir) == -1) strerr_die6sys(111,FATAL,"unable to switch to ",home,"/",subdir,": "); - perm(".../",subdir,"/",file,S_IFREG,uid,gid,mode); + perm(".../",subdir,"/",destfile,S_IFREG,uid,gid,mode); +} + +void c(home,subdir,file,uid,gid,mode) +char *home; +char *subdir; +char *file; +int uid; +int gid; +int mode; +{ + cto(home,subdir,file,file,uid,gid,mode); } void z(home,file,len,uid,gid,mode)