--- /dev/null
+--- apache_1.3.12/src/main/buff.c~ Sun Feb 27 07:16:27 2000
++++ apache_1.3.12/src/main/buff.c Sun Feb 27 07:39:15 2000
+@@ -1133,6 +1133,102 @@
+ }
+ #endif
+
++/* The SGI Performance patch replaces writev_it_all by ap_bwritev
++ * We don't want this, as it breaks mod_ssl ... the code is commented
++ * out for now.
++ *
++ * static int writev_it_all(BUFF *fb, struct iovec *vec, int nvec)
++ * {
++ * return (ap_bwritev(fb, vec, nvec) >= 0) ? 0 : -1;
++ * }
++ *
++ */
++
++/*
++ * Write data using writev() if available, write() otherwise.
++ * Returns number of bytes written or -1 on error.
++ * Note that it may modify iov;
++ */
++API_EXPORT(int)
++ap_bwritev(BUFF *fb, struct iovec *iov, int iovcnt)
++{
++ int rval;
++
++ if ((fb->flags & (B_EOUT | B_WRERR | B_WR)) == B_WR) {
++#ifndef NO_WRITEV
++ int i, len;
++
++ rval = 0;
++
++ len = 0;
++ for (i = 0; i < iovcnt; i++)
++ len += iov[i].iov_len;
++
++ while (len > 0) {
++ int w;
++
++ w = (iovcnt > 1) ? (int) writev(fb->fd, iov, iovcnt) :
++ (int) write(fb->fd, iov->iov_base, iov->iov_len);
++ if (w >= 0) {
++ rval += w;
++ fb->bytes_sent += w;
++
++ len -= w;
++ if (len == 0)
++ break; /* shortcut the common case */
++
++ while (w > iov[0].iov_len) {
++ w -= iov[0].iov_len;
++ iov++;
++ iovcnt--;
++ }
++ iov[0].iov_base = (char *) iov[0].iov_base + w;
++ iov[0].iov_len -= w;
++ } else if (errno != EINTR && errno != EAGAIN) {
++ doerror(fb, B_WR);
++ rval = -1;
++ break;
++ }
++
++ if (fb->flags & B_EOUT) { /* set asynchronously */
++ rval = -1;
++ break;
++ }
++ }
++#else
++ int i;
++
++ rval = 0;
++ for (i = 0; i < iovcnt; i++) {
++ while (iov[i].iov_len > 0) {
++ int w;
++
++ w = write(fb->fd, iov[i].iov_base, iov[i].iov_len);
++ if (w >= 0) {
++ rval += w;
++ fb->bytes_sent += w;
++ iov[i].iov_base = (char *) iov[i].iov_base + w;
++ iov[i].iov_len -= w;
++ } else if (errno != EINTR && errno != EAGAIN) {
++ doerror(fb, B_WR);
++ rval = -1;
++ break;
++ }
++
++ if (fb->flags & B_EOUT) { /* set asynchronously */
++ rval = -1;
++ break;
++ }
++ }
++ }
++#endif
++ } else
++ rval = -1;
++
++ return rval;
++}
++
++
+ /* A wrapper for buff_write which deals with error conditions and
+ * bytes_sent. Also handles non-blocking writes.
+ */
--- /dev/null
+If you use -fpic instead of -fPIC, linker fall down, go boom.
+--- apache_1.3.14/src/Configure.fpic Fri Dec 1 15:25:17 2000
++++ apache_1.3.14/src/Configure Fri Dec 1 15:25:42 2000
+@@ -1034,14 +1034,14 @@
+ LDFLAGS_MOD_SHLIB=$LDFLAGS_SHLIB
+ ;;
+ *-linux1)
+- CFLAGS_SHLIB="-fpic"
++ CFLAGS_SHLIB="-fPIC"
+ LDFLAGS_SHLIB="-Bshareable"
+ LDFLAGS_MOD_SHLIB=$LDFLAGS_SHLIB
+ LDFLAGS_SHLIB_EXPORT="-rdynamic"
+ ;;
+ *-linux2)
+ LD_SHLIB="gcc"
+- CFLAGS_SHLIB="-fpic"
++ CFLAGS_SHLIB="-fPIC"
+ LDFLAGS_SHLIB="-shared"
+ LDFLAGS_MOD_SHLIB=$LDFLAGS_SHLIB
+ LDFLAGS_SHLIB_EXPORT="-rdynamic"
--- /dev/null
+Greg Kroah-Hartman's patch, dated 8 Jan 2001.
+diff -aur apache_1.3.14/src/support/htdigest.c apache_1.3.14-mkstemp/src/support/htdigest.c
+--- apache_1.3.14/src/support/htdigest.c Tue Jan 25 23:36:53 2000
++++ apache_1.3.14-mkstemp/src/support/htdigest.c Tue Jan 9 20:42:42 2001
+@@ -93,7 +93,7 @@
+
+ #define MAX_STRING_LEN 256
+
+-char *tn;
++char tn[MAX_STRING_LEN];
+
+
+ static void getword(char *word, char *line, char stop)
+@@ -156,7 +156,7 @@
+ ap_getpass("Re-type new password: ", pwv, sizeof(pwv));
+ if (strcmp(pwin, pwv) != 0) {
+ fprintf(stderr, "They don't match, sorry.\n");
+- if (tn) {
++ if (strlen(tn)) {
+ unlink(tn);
+ }
+ exit(1);
+@@ -187,7 +187,7 @@
+ static void interrupted(void)
+ {
+ fprintf(stderr, "Interrupted.\n");
+- if (tn)
++ if (strlen(tn))
+ unlink(tn);
+ exit(1);
+ }
+@@ -215,8 +215,9 @@
+ char x[MAX_STRING_LEN];
+ char command[MAX_STRING_LEN];
+ int found;
++ int tfd;
+
+- tn = NULL;
++ strcpy (tn, "/tmp/htdigest-XXXXXX");
+ signal(SIGINT, (void (*)(int)) interrupted);
+ if (argc == 5) {
+ if (strcmp(argv[1], "-c"))
+@@ -235,8 +236,12 @@
+ else if (argc != 4)
+ usage();
+
+- tn = tmpnam(NULL);
+- if (!(tfp = fopen(tn, "w"))) {
++ tfd = mkstemp (tn);
++ if (tfd == -1) {
++ fprintf(stderr, "Could not open temp file.\n");
++ exit(1);
++ }
++ if (!(tfp = fdopen(tfd, "w"))) {
+ fprintf(stderr, "Could not open temp file.\n");
+ exit(1);
+ }
+diff -aur apache_1.3.14/src/support/htpasswd.c apache_1.3.14-mkstemp/src/support/htpasswd.c
+--- apache_1.3.14/src/support/htpasswd.c Thu Jun 1 19:42:33 2000
++++ apache_1.3.14-mkstemp/src/support/htpasswd.c Tue Jan 9 20:41:36 2001
+@@ -125,7 +125,7 @@
+ * This needs to be declared statically so the signal handler can
+ * access it.
+ */
+-static char *tempfilename;
++static char tempfilename[MAX_STRING_LEN];
+ /*
+ * If our platform knows about the tmpnam() external buffer size, create
+ * a buffer to pass in. This is needed in a threaded environment, or
+@@ -285,7 +285,7 @@
+ static void interrupted(void)
+ {
+ fprintf(stderr, "Interrupted.\n");
+- if (tempfilename != NULL) {
++ if (strlen(tempfilename) > 0) {
+ unlink(tempfilename);
+ }
+ exit(ERR_INTERRUPTED);
+@@ -377,8 +377,10 @@
+ int noninteractive = 0;
+ int i;
+ int args_left = 2;
++ int tfd;
++
++ memset (tempfilename, 0x00, sizeof(tempfilename));
+
+- tempfilename = NULL;
+ signal(SIGINT, (void (*)(int)) interrupted);
+
+ /*
+@@ -560,8 +562,9 @@
+ * to add or update. Let's do it..
+ */
+ errno = 0;
+- tempfilename = tmpnam(tname_buf);
+- if ((tempfilename == NULL) || (*tempfilename == '\0')) {
++ strcpy(tempfilename, "/tmp/htpasswd-XXXXXX");
++ tfd = mkstemp(tempfilename);
++ if (tfd == -1) {
+ fprintf(stderr, "%s: unable to generate temporary filename\n",
+ argv[0]);
+ if (errno == 0) {
+@@ -570,7 +573,7 @@
+ perror("tmpnam");
+ exit(ERR_FILEPERM);
+ }
+- ftemp = fopen(tempfilename, "w+");
++ ftemp = fdopen(tfd, "w+");
+ if (ftemp == NULL) {
+ fprintf(stderr, "%s: unable to create temporary file '%s'\n", argv[0],
+ tempfilename);