head	1.2;
access;
symbols
	RELEASE_6_0_0:1.1
	RELEASE_5_4_0:1.1
	RELEASE_4_11_0:1.1
	RELEASE_5_3_0:1.1
	RELEASE_4_10_0:1.1
	RELEASE_5_2_1:1.1
	RELEASE_5_2_0:1.1
	RELEASE_4_9_0:1.1
	RELEASE_5_1_0:1.1
	RELEASE_4_8_0:1.1
	RELEASE_5_0_0:1.1
	RELEASE_4_7_0:1.1
	RELEASE_4_6_2:1.1
	RELEASE_4_6_1:1.1
	RELEASE_4_6_0:1.1
	RELEASE_5_0_DP1:1.1
	RELEASE_4_5_0:1.1
	RELEASE_4_4_0:1.1
	RELEASE_4_3_0:1.1;
locks; strict;
comment	@# @;


1.2
date	2005.09.09.14.00.10;	author lawrance;	state dead;
branches;
next	1.1;

1.1
date	2001.01.15.04.40.11;	author kris;	state Exp;
branches;
next	;


desc
@@


1.2
log
@Update to 0.9.6
- Add rcng startup
- No longer touch pksd.conf, only pksd.conf.sample
- Ensure the port builds against db2 from ports by deleting the included
  version.  Add post-patch bits to help this happen.
- Submitter takes maintainership

PR:		ports/85802
Submitted by:	Graham Todd <gtodd@@bellanet.org> (new maintainer)
Approved by:	Jason Harris <jharris@@widomaker.com> (maintainer)
@
text
@$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);
 }
@


1.1
log
@pks 0.9.4 is a PGP public key server from MIT.

Obtained from:  NetBSD
@
text
@@

