1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-27 00:57:50 +00:00

pks 0.9.4 is a PGP public key server from MIT.

Obtained from:  NetBSD
This commit is contained in:
Kris Kennaway 2001-01-15 04:40:11 +00:00
parent 96e66a00cd
commit 04665ddc39
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=37210
13 changed files with 300 additions and 0 deletions

View File

@ -101,6 +101,7 @@
SUBDIR += pgpdump
SUBDIR += pgpgpg
SUBDIR += pidentd
SUBDIR += pks
SUBDIR += pktsuckers
SUBDIR += portscanner
SUBDIR += portsentry

44
security/pks/Makefile Normal file
View File

@ -0,0 +1,44 @@
# New ports collection makefile for: pks
# Date created: 15 Jan 2001
# Whom: kris@FreeBSD.org
#
# $FreeBSD$
#
PORTNAME= pks
PORTVERSION= 0.9.4
CATEGORIES= security www
MASTER_SITES+= http://www.mit.edu/people/marc/pks/ \
ftp://ftp.neonramp.com/pub/pksd/
PATCH_SITES= http://www.mit.edu/people/marc/pks/ \
ftp://ftp.neonramp.com/pub/pksd/
PATCHFILES= pks094-patch2 \
x509patch
PATCH_DIST_STRIP=-p1
MAINTAINER= kris@FreeBSD.org
LIB_DEPENDS= db2.0:${PORTSDIR}/databases/db
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --datadir=${PREFIX}/share/pks --localstatedir=/var/pks \
--sysconfdir=${PREFIX}/share/examples \
--libdir=${LOCALBASE}/lib
CONFIGURE_ENV= LDFLAGS=-L${LOCALBASE}/lib
MAN5= pksd.conf.5
MAN8= pks-intro.8 pksclient.8 pksd.8 pksdctl.8
post-build:
${SED} -e "s,@PREFIX@,${PREFIX},g" \
< ${FILESDIR}/pksd.sh > ${WRKDIR}/pksd.sh
post-install:
${INSTALL_SCRIPT} ${WRKDIR}/pksd.sh ${PREFIX}/etc/rc.d/pksd.sh
.if !exists(${PREFIX}/etc/pksd.conf)
${INSTALL_DATA} ${WRKSRC}/pksd.conf ${PREFIX}/etc/pksd.conf
.endif
PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
.include <bsd.port.mk>

3
security/pks/distinfo Normal file
View File

@ -0,0 +1,3 @@
MD5 (pks-0.9.4.tar.gz) = 365d062bbc3f7bfda745474693d0fdec
MD5 (pks094-patch2) = 33effba52c7a195d02d42ae41ba2795e
MD5 (x509patch) = 87625aac1b984410cc22c2ca530a95d8

View File

@ -0,0 +1,61 @@
$NetBSD$
--- Makefile.in.orig Thu Jul 27 11:11:28 2000
+++ Makefile.in Thu Jul 27 11:24:02 2000
@@ -9,9 +9,9 @@
SHELL = /bin/sh
## this does recursion for db2, if it's in the tree
-
-SUBDIRS = db2-sleepycat/dist
-
+#
+# We use the installed db2, so we don't need this line anymore
+#
depend all install check clean distclean maintainer-clean::
for i in ${SUBDIRS}; do (test -d $$i && cd $$i && ${MAKE} $@) || exit 1; done
@@ -32,12 +32,13 @@
all-pure:: $(ALL_PURE)
all-utils:: $(UTILS)
-DBDIR = db2-sleepycat/dist
+DBDIR = ${LOCALBASE}/include/db2
CC = @CC@
INSTALL = @INSTALL@
-INSTALL_PROGRAM = $(INSTALL)
-INSTALL_DATA = $(INSTALL)
+INSTALL_PROGRAM = $(BSD_INSTALL_PROGRAM)
+INSTALL_DATA = $(BSD_INSTALL_DATA)
+INSTALL_SCRIPT = $(BSD_INSTALL_SCRIPT)
SOCKLIBS = @LIBS@
VPATH = @srcdir@
@@ -60,7 +61,7 @@
DEFINES = $(DBG) @DEFS@
CFLAGS = @gcc_cflags@ -g -O $(INCLUDES) $(DEFINES)
-LIBDB = $(DBDIR)/libdb.a
+LIBDB = -ldb2
CLEAN = rm -f
@@ -118,6 +119,8 @@
pgpdump: pgpdump.o pgpfile.o $(PGPOBJS) $(UTILOBJS)
pgpsplit: pgpsplit.o $(PGPOBJS) $(UTILOBJS)
+ $(CC) -o $@ pgpsplit.o $(PGPOBJS) $(UTILOBJS) $(LDFLAGS) \
+ $(SOCKLIBS) $(LIBDB)
kvcv: kvcv.o pgpfile.o logging.o $(PGPOBJS) $(UTILOBJS)
@@ -138,7 +141,7 @@
install:: all installdirs
for f in $(ALL); do $(INSTALL_PROGRAM) $$f $(bindir); done
for f in $(SYSCONF); do $(INSTALL_DATA) $$f $(sysconfdir); done
- for f in $(ALL_SH); do $(INSTALL_PROGRAM) $(srcdir)/$$f $(bindir); done
+ for f in $(ALL_SH); do $(INSTALL_SCRIPT) $(srcdir)/$$f $(bindir); done
for f in $(DATA); do $(INSTALL_DATA) $(srcdir)/$$f $(datadir); done
for f in $(MAN5); do $(INSTALL_DATA) $(srcdir)/$$f $(man5dir); done
for f in $(MAN8); do $(INSTALL_DATA) $(srcdir)/$$f $(man8dir); done

View File

@ -0,0 +1,9 @@
--- pksd.c.orig Thu Jul 27 10:16:19 2000
+++ pksd.c Thu Jul 27 10:17:34 2000
@@ -85,6 +85,7 @@
psc.mrc = &mrc;
pwc.port = pc.www_port;
+ pwc.db_dir = pc.db_dir;
pwc.max_reply_keys = pc.max_reply_keys;
pwc.pic = &pic;

View File

@ -0,0 +1,55 @@
$NetBSD$
--- pks_www.c.orig Wed Jun 2 02:06:01 1999
+++ pks_www.c Thu Jul 27 10:17:35 2000
@@ -113,6 +113,9 @@
w_error(fd, vers, (unsigned char *) str, strlen(str));
}
+static const char homepage_str[] = "/";
+static int homepage_len = sizeof(homepage_str)-1;
+
static const char lookup_str[] = "/pks/lookup";
static int lookup_len = sizeof(lookup_str)-1;
@@ -291,6 +294,34 @@
search = -1;
search_len = 0;
+ if (is_token(uri, urilen, homepage_str, homepage_len, 1)) {
+ FILE *homepage;
+ char homepage_path[2048];
+ char buf[1024];
+ unsigned char *line;
+ xbuffer xb;
+
+ strncpy(homepage_path, conf->db_dir, 2035);
+ strncat(homepage_path, "/index.html", 2046);
+ if ((homepage = fopen(homepage_path,"r")) == NULL) {
+ log_fatal("pks_www", "non-existent homepage");
+ return;
+ }
+
+ xbuffer_alloc(&xb);
+
+ while (line = (unsigned char *) fgets(buf,sizeof(buf), homepage)) {
+ if (!xbuffer_append_str(&xb, line)) {
+ log_fatal("pks_www", "displaying home page");
+ return;
+ }
+ }
+
+ w_reply(fd, vers, xb.buf, xb.len);
+
+ xbuffer_free(&xb);
+ return;
+ }
if (is_token(uri, urilen, lookup_str, lookup_len, 1)) {
long op, op_len, exact, exact_len, fingerprint, fingerprint_len;
int flags;
@@ -498,4 +529,5 @@
void pks_www_init(pks_www_conf *conf)
{
www_init(conf->port, pks_www, conf);
+ www_init(conf->db_dir, pks_www, conf);
}

View File

@ -0,0 +1,9 @@
--- pks_www.h.orig Wed May 19 23:39:52 1999
+++ pks_www.h Thu Jul 27 10:17:35 2000
@@ -13,6 +13,7 @@
typedef struct _pks_www_conf {
int port;
int max_reply_keys;
+ char *db_dir;
pks_incr_conf *pic;
} pks_www_conf;

View File

@ -0,0 +1,52 @@
#!/bin/sh
#
# $NetBSD: pksd.sh,v 1.1.1.1 2000/07/27 16:10:24 jlam Exp $
#
# PROVIDE: pksd
# REQUIRE: DAEMON
name="pksd"
command=${1:-start}
case ${command} in
start)
if [ ! -f /etc/${name}.conf ]
then
exit 0
else
dbdir=`awk '/db_dir/ { print $2 }' < /etc/${name}.conf`
fi
if [ ! -f ${dbdir}/keydb000 -a -x @PREFIX@/bin/pksclient ]
then
@PREFIX@/bin/pksclient ${dbdir} create
fi
if [ -x @PREFIX@/bin/${name} -a -x @PREFIX@/bin/pks-queue-run.sh ]
then
echo "Starting ${name}."
@PREFIX@/bin/${name} /etc/${name}.conf &
sleep 5
@PREFIX@/bin/pks-queue-run.sh /etc/${name}.conf
fi
;;
stop)
if [ ! -f /etc/${name}.conf ]
then
exit 0
else
socket=`awk '/socket_name/ { print $2 }' < /etc/${name}.conf`
fi
if [ -x @PREFIX@/bin/${name}ctl -a -S ${socket} ]
then
echo "Stopping ${name}."
@PREFIX@/bin/${name}ctl ${socket} shutdown
else
echo "couldn't stop ${name}."
fi
;;
restart)
( $0 stop )
sleep 1
$0 start
;;
esac
exit 0

1
security/pks/pkg-comment Normal file
View File

@ -0,0 +1 @@
PGP Public Key Server

View File

@ -0,0 +1,27 @@
#!/bin/sh
#
# $NetBSD$
PKGNAME=$1
STAGE=$2
case ${STAGE} in
DEINSTALL)
;;
POST-DEINSTALL)
cat << EOF
===========================================================================
If you won't be using ${PKGNAME} any longer, you may want to remove the
following directories and files:
/usr/local/etc/pksd.conf
/var/pks
===========================================================================
EOF
;;
*)
echo "Unexpected argument: ${STAGE}"
exit 1
;;
esac
exit 0

4
security/pks/pkg-descr Normal file
View File

@ -0,0 +1,4 @@
This program implements a standard PGP Key Server, which can be assumed
to be in addition to the public key server at MIT.
WWW: http://www.mit.edu/people/marc/pks/

22
security/pks/pkg-install Normal file
View File

@ -0,0 +1,22 @@
#!/bin/sh
#
# $NetBSD$
PKGNAME=$1
STAGE=$2
case ${STAGE} in
PRE-INSTALL)
;;
POST-INSTALL)
DBDIR=/var/pks/db
MAILDIR=/var/pks/incoming
mkdir -p ${DBDIR} ${MAILDIR}
;;
*)
echo "Unexpected argument: ${STAGE}"
exit 1
;;
esac
exit 0

12
security/pks/pkg-plist Normal file
View File

@ -0,0 +1,12 @@
bin/pgpsplit
bin/pks-mail.sh
bin/pks-queue-run.sh
bin/pksclient
bin/pksd
bin/pksdctl
etc/rc.d/pksd.sh
@unexec if cmp -s %D/etc/pksd.conf %D/share/examples/pksd.conf; then rm -f %D/etc/pksd.conf; fi
share/examples/pksd.conf
share/pks/mail_intro
share/pks/pks_help.en
@dirrm share/pks