summaryrefslogtreecommitdiffstats
path: root/httpd
diff options
context:
space:
mode:
authorcvsadm <cvsadm>2005-01-21 00:44:34 +0000
committercvsadm <cvsadm>2005-01-21 00:44:34 +0000
commitb2093e3016027d6b5cf06b3f91f30769bfc099e2 (patch)
treecf58939393a9032182c4fbc4441164a9456e82f8 /httpd
downloadds-b2093e3016027d6b5cf06b3f91f30769bfc099e2.tar.gz
ds-b2093e3016027d6b5cf06b3f91f30769bfc099e2.tar.xz
ds-b2093e3016027d6b5cf06b3f91f30769bfc099e2.zip
Moving NSCP Directory Server from DirectoryBranch to TRUNK, initial drop. (foxworth)ldapserver7x
Diffstat (limited to 'httpd')
-rwxr-xr-xhttpd/autobuild500
-rw-r--r--httpd/src/Makefile229
-rw-r--r--httpd/src/ntnsapi.c383
-rw-r--r--httpd/src/unixso.exp38
-rw-r--r--httpd/src/unixso.mk246
5 files changed, 1396 insertions, 0 deletions
diff --git a/httpd/autobuild b/httpd/autobuild
new file mode 100755
index 00000000..a8b4a2fa
--- /dev/null
+++ b/httpd/autobuild
@@ -0,0 +1,500 @@
+#!/bin/sh
+#
+# BEGIN COPYRIGHT BLOCK
+# Copyright 2001 Sun Microsystems, Inc.
+# Portions copyright 1999, 2001-2003 Netscape Communications Corporation.
+# All rights reserved.
+# END COPYRIGHT BLOCK
+#
+
+UNAME=`../nsarch`
+NSUNAME=`uname -s | sed -e 's%/%_%g'``uname -r`
+DATE="`date +%d-%h`"
+
+# OS tweaks
+
+if [ "$UNAME" = "SUNOS4" ]; then
+ PATH=/usr/local/sun4/bin:/usr/bin/X11:$PATH; export PATH
+ GTAR=/share/builds/f/gtar/bin/sunos-gtar
+ HTTPDLIB=ns-httpd.so
+
+elif [ "$UNAME" = "SOLARIS" ]; then
+ PATH=/usr/ccs/bin:/usr/openwin/bin:$PATH; export PATH
+ OPENWINHOME=/usr/openwin; export OPENWINHOME
+ GTAR=/share/builds/f/gtar/bin/solaris-gtar
+ HTTPDLIB=ns-httpd.so
+
+elif [ "$UNAME" = "SOLARISx86" ]; then
+ PATH=/usr/ccs/bin:/usr/openwin/bin:$PATH; export PATH
+ OPENWINHOME=/usr/openwin; export OPENWINHOME
+ HTTPDLIB=ns-httpd.so
+
+elif [ "$UNAME" = "HPUX" ]; then
+ PATH=/usr/local/hpux/bin:/usr/bin/X11:$PATH; export PATH
+ GTAR=/share/builds/f/gtar/bin/hpux-gtar
+ HTTPDLIB=libnshttpd.sl
+
+elif [ "$UNAME" = "BSDI" ]; then
+ PATH=/usr/local/bin:/usr/X11/bin:$PATH; export PATH
+ GTAR=/share/builds/f/gtar/bin/bsdi-gtar
+
+elif [ "$UNAME" = "OSF1" ]; then
+# NOJAVA=true
+ PATH=/usr/local/dec/bin:/usr/bin/X11:$PATH; export PATH
+ GTAR=/share/builds/f/gtar/bin/osf1-gtar
+ HTTPDLIB=ns-httpd.so
+
+elif [ "$UNAME" = "AIX" ]; then
+ PATH=/usr/local/aix32/bin:/usr/bin/X11:$PATH; export PATH
+ GTAR=/share/builds/f/gtar/bin/aix-gtar
+ HTTPDLIB=ns-httpd.a
+
+elif [ "$UNAME" = "IRIX" ]; then
+ GTAR=/share/builds/f/gtar/bin/irix-gtar
+ HTTPDLIB=ns-httpd.so
+
+elif [ "$UNAME" = "SONY" ]; then
+ PATH=/usr/bin/X11:$PATH; export PATH
+ HTTPDLIB=ns-httpd.so
+
+elif [ "$UNAME" = "NECSVR4" ]; then
+ PATH=/u/malmer/nec/usr/local/bin:/usr/bin/X11:$PATH; export PATH
+ HTTPDLIB=ns-httpd.so
+
+elif [ "$UNAME" = "ReliantUNIX" ]; then
+ PATH=/usr/local/bin:$PATH; export PATH
+ GTAR=tar
+ HTTPDLIB=ns-httpd.so
+
+elif [ "$UNAME" = "SCO" ]; then
+ PATH=/usr/local/bin:/usr/bin/X11:$PATH; export PATH
+ GTAR=/usr/local/bin/gtar
+ HTTPDLIB=ns-httpd.so
+
+elif [ "$UNAME" = "UNIXWARE" ]; then
+ PATH=/usr/local/bin:/usr/bin/X11:$PATH; export PATH
+ GTAR=/usr/local/bin/gtar
+ HTTPDLIB=ns-httpd.so
+
+fi
+
+set -- `getopt p: $*` || {
+ echo "### `basename $0`: ERROR: unknown option" 1>&2
+ exit 1
+}
+
+BuildInPhases=0
+
+while [ "$1" != "--" ] ; do
+ case "$1" in
+ -p) BuildInPhases=1; shift; Phase=$1
+ ;;
+ esac
+ shift
+done
+shift
+
+
+buildit() {
+
+# Initialize some variables
+
+ADMINDIR=../built/$UNAME-$SECTYPE-admserv
+if [ "$PRODUCT" = "personal" ]; then
+ BINDIR=httpd
+ TARNAME=nshttpd.tar
+elif [ "$PRODUCT" = "catalog" ]; then
+ BINDIR=catalog
+ TARNAME=ns-catalog.tar
+elif [ "$PRODUCT" = "rds" ]; then
+ BINDIR=rds
+ TARNAME=ns-rds.tar
+elif [ "$PRODUCT" = "cms" ]; then
+ BINDIR=https
+ TARNAME=ns-cms.tar
+else
+ BINDIR=https
+ TARNAME=nshttps.tar
+fi
+SOURCEDIR=../built/$UNAME-$SECTYPE-$BINDIR
+TARGETDIR=$TYPE/$UNAME-$SECTYPE-$BINDIR
+TARGETUNTAR=$TYPE/$UNAME-$SECTYPE-$BINDIR/untarred
+
+TARGETHTBIN=$TYPE/$UNAME-$SECTYPE-$BINDIR/untarred/bin/$BINDIR
+mkdir -p $TARGETUNTAR 2> /dev/null
+
+if [ $BuildInPhases = 1 ]
+then
+ if [ "$Phase" = "server" ]
+ then
+ buildserver
+ elif [ "$Phase" = "admin" ]
+ then
+ buildadmin
+ elif [ "$Phase" = "batman" ]
+ then
+ buildbatman
+ elif [ "$Phase" = "tar" ]
+ then
+ (cd $TARGETUNTAR; tar cvf ../$TARNAME *)
+ else
+ echo "`basename $0`: ERROR: unknown build phase"
+ exit 1
+ fi
+else
+ buildserver
+ buildadmin
+ buildbatman
+ (cd $TARGETUNTAR; tar cvf ../$TARNAME *)
+fi
+}
+
+buildserver() {
+
+(cd ..; ./config $BOMB $PRODUCT $SECCONFIG $OPTIMIZE)
+gmake
+
+if [ $? -ne 0 ]; then
+ exit 2
+fi
+
+(cd ../mc-icons; gmake)
+if [ $? -ne 0 ]; then
+ exit 2
+fi
+
+(cd ../include; gmake)
+if [ $? -ne 0 ]; then
+ exit 2
+fi
+
+(cd nsapi; gmake)
+if [ $? -ne 0 ]; then
+ exit 2
+fi
+
+(cd extras; gmake)
+if [ $? -ne 0 ]; then
+ exit 2
+fi
+
+if [ "$NOJAVA" != "true" ]; then
+ (cd ../lib/sjava; gmake)
+ if [ $? -ne 0 ]; then
+ exit 2
+ fi
+fi
+
+# generate DBMs in admin/bin directory
+(cd $SOURCEDIR/admin/bin; ./mkdbm)
+
+# Each product has different manuals
+if [ "$BINDIR" = "catalog" -o "$BINDIR" = "rds" ]; then
+ # Batman
+ ADMINMANUALS="html/manual/ag html/manual/design html/manual/beta2"
+else
+ # Enterprise and FastTrack
+ ADMINMANUALS="html/manual/ag html/manual/pg html/manual/javascript"
+fi
+for i in icons html html/info html/manual $ADMINMANUALS bin; do
+ mkdir -p $TARGETUNTAR/bin/$BINDIR/admin/$i
+ cp $SOURCEDIR/admin/$i/* $TARGETHTBIN/admin/$i
+done
+
+/bin/rm -f $TARGETHTBIN/admin/bin/*.o
+$STRIP $TARGETHTBIN/admin/bin/*
+
+for i in misc icons html bin; do
+ mkdir -p $TARGETHTBIN/install/$i
+ cp $SOURCEDIR/install/$i/* $TARGETHTBIN/install/$i
+done
+$STRIP $TARGETHTBIN/install/bin/*
+mv $TARGETHTBIN/install/bin/ns-setup $TARGETDIR
+mv $TARGETHTBIN/install/bin/ns-config $TARGETHTBIN/ns-config
+
+
+mkdir -p $TARGETUNTAR/ns-icons
+cp $SOURCEDIR/mc-icons/* $TARGETUNTAR/ns-icons
+
+if [ -d $SOURCEDIR/nsapi -a "$UNAME" != "BSDI" ]; then
+ mkdir -p $TARGETUNTAR/nsapi
+ cp -r $SOURCEDIR/nsapi/* $TARGETUNTAR/nsapi
+fi
+
+mkdir -p $TARGETUNTAR/extras
+cp -r $SOURCEDIR/extras/* $TARGETUNTAR/extras
+$STRIP $TARGETUNTAR/extras/*/*
+
+cp $SOURCEDIR/ns-httpd $TARGETHTBIN/ns-httpd
+if [ "$HTTPDLIB" != "" ]; then
+ cp $SOURCEDIR/$HTTPDLIB $TARGETHTBIN/$HTTPDLIB
+fi
+$STRIP $TARGETHTBIN/ns-httpd
+if [ "$UNAME" != "IRIX" -a "$UNAME" != "SUNOS4" ]; then
+ $STRIP $TARGETHTBIN/$HTTPDLIB
+fi
+
+if [ "$UNAME" = "AIX" ]; then
+ cp /usr/lib/libsvld.a $TARGETHTBIN/libsvld.a
+fi
+
+
+cp README $TARGETDIR
+cp newinst/misc/license.txt $TARGETDIR
+
+mkdir -p $TARGETUNTAR/userdb
+mkdir -p $TARGETUNTAR/httpacl
+mkdir -p $TARGETUNTAR/authdb
+mkdir -p $TARGETUNTAR/authdb/default
+
+if [ "$PRODUCT" = "enterprise" ]; then
+mkdir -p $TARGETUNTAR/plugins/search/admin
+mkdir -p $TARGETUNTAR/plugins/search/tmp
+chmod a+w $TARGETUNTAR/plugins/search/tmp
+mkdir -p $TARGETUNTAR/plugins/search/collections
+chmod a+w $TARGETUNTAR/plugins/search/collections
+cp -r plugins/search $TARGETUNTAR/plugins
+(cd $TARGETUNTAR/plugins/search; rm -r `find . -name CVS -print`)
+cp $SOURCEDIR/lib/vsearch $TARGETUNTAR/plugins/search/vsearch
+cp $SOURCEDIR/admin/bin/ia* $TARGETUNTAR/plugins/search/vsearch
+$STRIP $TARGETUNTAR/plugins/search/vsearch/ia*
+cp ../lib/libsearch/searching/query.err $TARGETUNTAR/plugins/search/vsearch
+mkdir -p $TARGETUNTAR/plugins/search/ui/icons
+mkdir -p $TARGETUNTAR/plugins/search/ui/usa
+cp ../lib/libsearch/searching/ui/icons/* $TARGETUNTAR/plugins/search/ui/icons
+cp ../lib/libsearch/searching/ui/usa/* $TARGETUNTAR/plugins/search/ui/usa
+
+mkdir -p $TARGETUNTAR/plugins/snmp
+mkdir -p $TARGETUNTAR/plugins/snmp/magt
+mkdir -p $TARGETUNTAR/plugins/snmp/sagt
+if [ -d $SOURCEDIR/plugin/snmp -a -f $SOURCEDIR/plugin/snmp/httpagt ]; then
+ cp $SOURCEDIR/plugin/snmp/httpagt $TARGETUNTAR/plugins/snmp/httpagt
+fi
+cp plugins/snmp/netscape.pub $TARGETUNTAR/plugins/snmp/netscape.mib
+
+mkdir -p $TARGETUNTAR/plugins/mks/bin
+ cp $SOURCEDIR/plugins/mks/bin/*.so $TARGETUNTAR/plugins/mks/bin
+
+if [ "$UNAME" = "SUNOS4" ]; then
+ cp ../../../peer/sunos/magt/* $TARGETUNTAR/plugins/snmp/magt
+ cp ../../../peer/sunos/sagt/* $TARGETUNTAR/plugins/snmp/sagt
+elif [ "$UNAME" = "SOLARIS" ]; then
+ cp ../../../peer/solaris/magt/* $TARGETUNTAR/plugins/snmp/magt
+ cp ../../../peer/solaris/sagt/* $TARGETUNTAR/plugins/snmp/sagt
+elif [ "$UNAME" = "HPUX" ]; then
+ cp ../../../peer/hp/magt/* $TARGETUNTAR/plugins/snmp/magt
+ cp ../../../peer/hp/sagt/* $TARGETUNTAR/plugins/snmp/sagt
+elif [ "$UNAME" = "OSF1" ]; then
+ cp ../../../peer/osf/magt/* $TARGETUNTAR/plugins/snmp/magt
+ cp ../../../peer/osf/sagt/* $TARGETUNTAR/plugins/snmp/sagt
+elif [ "$UNAME" = "AIX" ]; then
+ cp ../../../peer/aix/magt/* $TARGETUNTAR/plugins/snmp/magt
+ cp ../../../peer/aix/sagt/* $TARGETUNTAR/plugins/snmp/sgat
+elif [ "$UNAME" = "IRIX" ]; then
+ cp ../../../peer/irix/magt/* $TARGETUNTAR/plugins/snmp/magt
+ cp ../../../peer/irix/sagt/* $TARGETUNTAR/plugins/snmp/sagt
+fi
+fi # PRODUCT = enterprise
+
+
+if [ "$NOJAVA" != "true" ]; then
+ mkdir -p $TARGETUNTAR/plugins/java/bin
+ cp $SOURCEDIR/lib/libsjava.so $TARGETUNTAR/plugins/java/bin
+
+ mkdir -p $TARGETUNTAR/plugins/java/classes
+ cp ../../sun-java/classsrc/serv2_0.zip $TARGETUNTAR/plugins/java/classes
+
+ cp plugins/java/javac $TARGETUNTAR/plugins/java
+ cp plugins/java/README $TARGETUNTAR/plugins/java
+
+ mkdir -p $TARGETUNTAR/plugins/java/applets
+ cp plugins/java/applets/* $TARGETUNTAR/plugins/java/applets
+
+# mkdir -p $TARGETUNTAR/plugins/java/local-classes
+# cp plugins/java/local-classes/* $TARGETUNTAR/plugins/java/local-classes
+
+# XXXrobm these docs assume that we have Sun's HTML and images
+# mkdir -p $TARGETUNTAR/plugins/java/docs/images
+# cp plugins/java/docs/*.html $TARGETUNTAR/plugins/java/docs
+# cp ../../sun-java/javadoc/*.gif $TARGETUNTAR/plugins/java/docs/images
+fi
+
+mkdir $TARGETUNTAR/install
+cp ./newinst/src/upgrade $TARGETUNTAR/install
+cp ./newinst/src/ObjConf.pm $TARGETUNTAR/install
+cp ./newinst/src/Magnus.pm $TARGETUNTAR/install
+cp ./newinst/src/start $TARGETUNTAR/install
+cp ./newinst/src/stop $TARGETUNTAR/install
+cp ./newinst/src/restart $TARGETUNTAR/install
+cp ./newinst/src/rotate $TARGETUNTAR/install
+cp ./newinst/perl5/$UNAME-perl5/perl $TARGETUNTAR/install
+cp ./newinst/perl5/artistic $TARGETUNTAR/install
+if [ "$UNAME" = "IRIX" ] || [ "$UNAME" = "SOLARIS" ] || [ "$UNAME" = "OSF1" ] ; then
+ cp ./newinst/src/kernelThreads.pl $TARGETUNTAR/install/threads.pl
+fi
+cp $SOURCEDIR/extras/database/mkuser $TARGETUNTAR/install
+cp $SOURCEDIR/extras/database/ndbmdump $TARGETUNTAR/install
+cp $SOURCEDIR/extras/database/rcert11 $TARGETUNTAR/install
+cp $SOURCEDIR/extras/database/rkey11 $TARGETUNTAR/install
+$STRIP $TARGETUNTAR/install/*
+
+if [ "$DO_LIVEWIRE" = "yes" ]; then
+ if [ "$UNAME" = "IRIX" ] ; then
+ PLATSFX=sgi
+ elif [ "$UNAME" = "SOLARIS" ] ; then
+ PLATSFX=sol
+ elif [ "$UNAME" = "HPUX" ] ; then
+ PLATSFX=hpx
+ fi
+ LIVEWIRETAR=livewire_$PLATSFX.tar
+ if [ -d $TARGETUNTAR/LiveWire ]; then
+ rm -rf $TARGETUNTAR/LiveWire
+ fi
+ mkdir $TARGETUNTAR/LiveWire
+ cp ./newinst/src/$LIVEWIRETAR.gz $TARGETUNTAR/LiveWire
+ gunzip $TARGETUNTAR/LiveWire/$LIVEWIRETAR
+ (cd $TARGETUNTAR/LiveWire; tar xf livewire*.tar)
+ cp $TARGETUNTAR/LiveWire/server/* $TARGETUNTAR/bin/$BINDIR
+ cp $TARGETUNTAR/LiveWire/bin/* $TARGETUNTAR/bin/$BINDIR
+ rm -rf $TARGETUNTAR/LiveWire/server $TARGETUNTAR/LiveWire/bin
+ rm $TARGETUNTAR/LiveWire/livewire*.tar
+fi
+
+
+(cd $TARGETUNTAR; find . -name \*.o -print | xargs rm -f)
+
+}
+
+buildadmin() {
+
+# BONEHEAD
+(cd ..; ./config $BOMB admin $SECCONFIG $OPTIMIZE)
+(cd ../admserv; gmake)
+if [ $? -ne 0 ]; then
+ exit 2
+fi
+
+mkdir -p $TARGETUNTAR/admserv
+cp $ADMINDIR/ns-admin $TARGETUNTAR/admserv
+$STRIP $TARGETUNTAR/admserv/ns-admin
+
+for i in icons html html/info bin cfgstuff; do
+ mkdir -p $TARGETUNTAR/bin/admserv/$i
+ cp $ADMINDIR/cgi/$i/* $TARGETUNTAR/bin/admserv/$i
+done
+$STRIP $TARGETUNTAR/bin/admserv/bin/*
+
+}
+
+buildbatman() {
+
+# For AutoCatalog from Batman -Darren
+if [ "$DO_AUTOCATALOG" = "yes" ]; then
+ # We need to re-run config to get our own library versions, etc.
+ (cd ..; ./config $BOMB batman $SECCONFIG $OPTIMIZE)
+
+ # This ugly hack is needed because nspr.a must be rebuilt on
+ # SOLARIS for batman. There are symbols required by the gcc
+ # generated code that SparcWorks doesn't provide - nothing links.
+
+ if [ "$UNAME" = "SOLARIS" ]; then
+ NSPRDIR=../../nspr/src/${NSUNAME}_${NSTAG}.OBJ
+ mv $NSPRDIR/nspr.a $NSPRDIR/GCCnspr.a
+ if [ -f $NSPRDIR/SPARCWKnspr.a ] ; then
+ mv $NSPRDIR/SPARCWKnspr.a $NSPRDIR/nspr.a
+ else
+ rm -f $NSPRDIR/*.o
+ fi
+ fi
+ (NS_USE_NATIVE=1; export NS_USE_NATIVE; cd ../batman; gmake MINIRDS_INSTALLDIR="../../httpd/$TARGETUNTAR/plugins" NSAPIDIR="$TARGETUNTAR/nsapi" minirds)
+ if [ $? -ne 0 ]; then
+ exit 2
+ fi
+ $STRIP $TARGETUNTAR/plugins/autocatalog/bin/*
+ $STRIP $TARGETUNTAR/plugins/autocatalog/*
+ if [ "$UNAME" = "SOLARIS" ] ; then
+ mv $NSPRDIR/nspr.a $NSPRDIR/SPARCWKnspr.a
+ mv $NSPRDIR/GCCnspr.a $NSPRDIR/nspr.a
+ fi
+fi
+
+}
+
+if [ "`echo $* | grep final`" != "" ]; then
+ TYPE=final
+ BOMB=nobomb
+
+elif [ "`echo $* | grep beta`" != "" ]; then
+ TYPE=beta
+ BOMB=bomb
+
+else
+ echo "You must choose to build either a beta or final version."
+ exit 2
+fi
+
+
+if [ "$NOJAVA" = "" -a "`echo $* | grep java`" != "" ]; then
+ NOJAVA=false
+else
+ NOJAVA=true
+fi
+
+if [ "$DO_AUTOCATALOG" = "" -a "`echo $* | grep autocatalog`" != "" ]; then
+ DO_AUTOCATALOG=yes
+else
+ DO_AUTOCATALOG=no
+fi
+# need to export DO_AUTOCATALOG so that it's passed down through all gmakes
+export DO_AUTOCATALOG
+
+if [ "$DO_LIVEWIRE" = "" ]; then
+ if [ "`echo $* | grep livewire`" != "" ]; then
+ DO_LIVEWIRE=yes
+ else
+ DO_LIVEWIRE=no
+ fi
+fi
+export DO_LIVEWIRE
+
+OPTIMIZE=optimize
+NSTAG=OPT
+STRIP=strip
+if [ "`echo $* | grep debug`" != "" ]; then
+ OPTIMIZE=debug
+ NSTAG=DBG
+ STRIP=echo
+fi
+
+NSDISTDIR=../../dist/${NSUNAME}_${NSTAG}.OBJ
+
+if [ "`echo $* | grep personal`" != "" ]; then
+ PRODUCT=personal
+elif [ "`echo $* | grep ns_catalog`" != "" ]; then
+ PRODUCT=catalog
+elif [ "`echo $* | grep ns_rds`" != "" ]; then
+ PRODUCT=rds
+elif [ "`echo $* | grep cms`" != "" ]; then
+ PRODUCT=cms
+else
+ PRODUCT=enterprise
+fi
+
+
+if [ "`echo $* | grep unsecure`" != "" -o "`echo $* | grep all`" != "" ]; then
+ SECTYPE=none
+ SECCONFIG=unsecure
+ buildit
+fi
+
+if [ "`echo $* | grep export`" != "" -o "`echo $* | grep all`" != "" ]; then
+ SECTYPE=export
+ SECCONFIG=export
+ buildit
+fi
+
+if [ "`echo $* | grep domestic`" != "" -o "`echo $* | grep all`" != "" ]; then
+ SECTYPE=domestic
+ SECCONFIG=domestic
+ buildit
+fi
diff --git a/httpd/src/Makefile b/httpd/src/Makefile
new file mode 100644
index 00000000..26ac574c
--- /dev/null
+++ b/httpd/src/Makefile
@@ -0,0 +1,229 @@
+#
+# BEGIN COPYRIGHT BLOCK
+# Copyright 2001 Sun Microsystems, Inc.
+# Portions copyright 1999, 2001-2003 Netscape Communications Corporation.
+# All rights reserved.
+# END COPYRIGHT BLOCK
+#
+# Makefile.cpp for the Netsite Commerce and Communications servers.
+
+MCOM_ROOT = ../../..
+
+MODULE=httpdBinary
+
+ifneq ($(ARCH), WINNT)
+OLD_MCOM_ROOT := $(MCOM_ROOT)
+MCOM_ROOT := $(shell cd $(OLD_MCOM_ROOT); pwd)
+BUILDSO=mocha admin
+endif
+
+HTTPD_DIR=$(OBJDIR)
+OBJDEST=$(HTTPD_DIR)/obj
+
+include ../../nsconfig.mk
+
+MCC_INCLUDE += $(ADMINUTIL_INCLUDE)
+
+ifeq ($(ARCH), WINNT)
+BINS=$(HTTPD_DIR)/httpd.exe
+DLLS=$(HTTPD_DIR)/$(HTTPDLL_NAME).dll
+HTTPD_LIB=$(HTTPD_DIR)/$(HTTPDLL_NAME).lib
+NSAPI20=$(HTTPD_DIR)/ns-httpd20.dll
+LOCAL_LINK_EXE = link -OUT:"$@" /STACK:0x20000,0x2000 /MAP $(ARCH_LINK_DEBUG) $(LCFLAGS) /NOLOGO /PDB:NONE /INCREMENTAL:NO \
+ /SUBSYSTEM:windows $(EXTRA_LIBS)
+EXTRA_LIBS+=$(NSPRLINK)
+
+ifeq ($(BSCINFO), yes)
+BSCS=$(HTTPD_DIR)/httpd.bsc
+endif
+
+else
+BINS=$(HTTPD_DIR)/ns-httpd
+endif
+
+ifeq ($(ARCH), SCO)
+EXTRA_OPTS := -Wl,-Bexport
+endif
+
+ifeq ($(ARCH), UNIXWARE)
+EXTRA_OPTS := -W l,-Bexport
+endif
+
+ifeq ($(ARCH), NCR)
+EXTRA_OPTS := -Wl,-Bexport
+endif
+
+ifeq ($(ARCH), SUNOS4)
+EXTRA_LIBS=-nostdlib /usr/lib/libc.a
+endif
+
+ifeq ($(ARCH), AIX)
+EXTRA_OPTS = -blibpath:../../bin/https:$(DEF_LIBPATH)
+endif
+
+ifeq ($(ARCH), SOLARIS)
+EXTRA_LIBS=$(GCCLIBS)
+endif
+
+ifeq ($(ARCH), WINNT)
+OS_TARGETS= admin libhttpdaemon $(DLLS)
+endif
+
+all: $(OBJDEST) $(OS_TARGETS) $(BINS) $(BSCS)
+
+include unixso.mk
+
+ifeq ($(ARCH), HPUX)
+comma:=,
+#EXTRA_LIBS +=/opt/CC/lib/cxxshl.o
+EXTRA_LIBS += $(NSCP_DISTDIR)/lib/libprstrms.$(LIB_SUFFIX)
+EXTRA_LIBS := $(subst -E,-E$(comma)+s,$(EXTRA_LIBS))
+EXTRA_OPTS := -Wl,+s,-E
+#The extra library below is required to debug shared libraries.
+ifeq ($(BUILD_DEBUG), full)
+EXTRA_LIBS += /opt/langtools/lib/end.o
+endif
+# THIS IS A TEMPORARY SOLUTION TO THE HPUX COMPILER LIMITATION. WE
+# NEED TO INCLUDE ALL OF THE eh/LIBC object files into our main executable
+# to avoid having undefined symbols with plugins.
+LIBCARCHIVE = /opt/CC/lib/eh/libC.a
+endif
+
+$(OBJDEST):
+ mkdir -p $(OBJDEST)
+
+HTTPD_LIBS=$(FRAME) $(HTTPDAEMON)
+
+ifeq ($(ARCH), WINNT)
+ifeq ($(NO_MOCHA), 1)
+MOCHA =
+MCC_SERVER += -DNO_MOCHA
+else
+MOCHA=$(NSCP_DISTDIR)/lib/mocha.lib
+endif
+OSOBJS = ntmagnus.o ntnsapi.o
+HTTPD_LIBS += $(SAFS) $(LIBCRYPT)
+FVERSION_FLAGS+=-s$(BUILD_SECURITY)
+else
+OSOBJS = main.o
+endif
+
+ifneq ($(ARCH), WINNT)
+OBJS=$(addprefix $(OBJDEST)/, $(OSOBJS) index.o shtml.o upload.o \
+ cookie.o nsconfig.o)
+else
+EXEOBJS=$(addprefix $(OBJDEST)/, password.res ntmain.o)
+OBJS=$(addprefix $(OBJDEST)/, $(OSOBJS) index.o shtml.o upload.o \
+ cookie.o nsconfig.o)
+endif
+
+MODULE_CFLAGS=
+
+# Unixware linker braindamage. The libnspr.so won't override select
+# at link time
+ifeq ($(ARCH), UNIXWARE)
+OBJS+=$(HTTPD_DIR)/obj/uxwrap.o
+endif
+
+ifeq ($(ARCH), NCR)
+#OBJS+=$(HTTPD_DIR)/httpd-lib/nspr20/uxwrap.o
+endif
+
+ifdef PRODUCT_IS_DIRECTORY_SERVER
+# Primitive NT link process for nshttpd.dll requires httpdaemon
+ ifeq ($(ARCH), WINNT)
+ DAEMONLIB=$(OBJDIR)/lib/libhttpdaemon
+ else
+ DAEMONLIB=
+ endif
+else
+ DAEMONLIB=$(OBJDIR)/lib/libhttpdaemon
+endif
+
+ifeq ($(ARCH), WINNT)
+# Don't define DEPLIBS for NT because standard macros like LINK_EXE
+# and LINK_DLL automatically pick up DEPLIBS which we don't always wan't.
+# $(LIBDIRMON) (temporily removed)
+DEPLIBS = $(addsuffix .$(LIB_SUFFIX), $(addprefix $(OBJDIR)/lib/lib, $(LIBADMIN) $(LIBLDAPU) $(LIBACCESS) $(HTTPD_LIBS))) \
+ $(addsuffix .$(LIB_SUFFIX), $(OBJDIR)/lib/libmsgdisp)
+DEPLIBS += $(LIBSECURITY) \
+ $(LIBNSPR) \
+ $(LIBLDAP) \
+ $(LIBDBM) \
+ $(ADMINUTIL_DEP)
+
+DEPLINK = /LIBPATH:$(OBJDIR)/lib $(addsuffix .$(LIB_SUFFIX), $(addprefix lib, $(LIBADMIN) $(LIBLDAPU) $(LIBACCESS) $(HTTPD_LIBS))) \
+ libmsgdisp.$(LIB_SUFFIX) $(ADMINUTIL_LINK) $(LDAPLINK) $(SECURITYLINK) \
+ $(NSPRLINK) $(DBMLINK)
+else
+# unixso.mk may define DEPLIBS
+ifndef DEPLIBS
+DEPLIBS = $(addsuffix .$(LIB_SUFFIX), \
+ $(addprefix $(OBJDIR)/lib/lib,$(HTTPD_LIBS)) \
+ $(DAEMONLIB) \
+ $(OBJDIR)/lib/libaccess \
+ $(OBJDIR)/lib/libbase \
+ $(OBJDIR)/lib/libsi18n \
+ $(OBJDIR)/lib/libmsgdisp) \
+ $(LIBSSLIO)
+DEPLIBS += $(SECURITY_DEP) \
+ $(NSPR_DEP) \
+ $(ADMINUTIL_DEP)
+
+DEPLINK = $(addsuffix .$(LIB_SUFFIX), \
+ $(addprefix $(OBJDIR)/lib/lib,$(HTTPD_LIBS)) \
+ $(DAEMONLIB) \
+ $(OBJDIR)/lib/libaccess \
+ $(OBJDIR)/lib/libbase \
+ $(OBJDIR)/lib/libsi18n \
+ $(OBJDIR)/lib/libmsgdisp) \
+ $(SECURITYLINK) \
+ $(NSPRLINK) \
+ $(LIBSSLIO) \
+ $(ADMINUTILLINK)
+endif
+
+endif
+
+ifndef PRODUCT_IS_DIRECTORY_SERVER
+ifeq ($(ARCH), AIX)
+ifdef OLD_AIX_LINKING
+# why is this redefined here?
+CCC = svxlC_r
+endif
+endif
+endif
+ifneq ($(ARCH), WINNT)
+$(BINS): $(DEPLIBS) $(OBJS)
+ifndef PRODUCT_IS_DIRECTORY_SERVER
+ echo "why are we doing this for directory server?"
+ cd $(HTTPD_DIR); $(PURIFY) $(CCC) -o ns-httpd $(OBJS) \
+ $(EXTRA_OPTS) $(DEPLINK) $(EXTRA_LIBS)
+endif # Netscape Directory Server
+else # WINNT
+
+$(MOCHA):
+ cd $(MCOM_ROOT)/mocha; $(MAKE) export $(NSDEFS)
+
+$(DLLS): $(OBJS) $(DEPLIBS) $(OBJDEST)/ns-httpd.res
+ -@echo EXTRA_LIBS = $(EXTRA_LIBS)
+ $(PURIFY) $(LINK_DLL) $(DEPLINK) $(OBJDEST)/ns-httpd.res $(OBJS) $(EXTRA_LIBS)
+ cp $(HTTPD_LIB) $(NSCP_DISTDIR)/lib
+ echo $(DLLS) finished
+
+$(BINS): $(OBJS) $(EXEOBJS) $(HTTPD_LIB)
+ rm -f $@
+ $(PURIFY) $(LOCAL_LINK_EXE) $(EXEOBJS) $(HTTPD_LIB)
+ echo $(BINS) finished
+
+$(NSAPI20): $(HTTPD_LIB) $(OBJDIR)/lib/frame/nsapi20.o
+ $(PURIFY) $(LINK_DLL) $(LIBNSPR) $(HTTPD_LIB) $(OBJDIR)/lib/frame/nsapi20.o $(EXTRA_LIBS)
+
+ifeq ($(BSCINFO), yes)
+$(BSCS): $(OBJS)
+ $(BSCMAKE) $(OBJDEST)/*.sbr
+endif
+endif
+
+
+include $(INCLUDE_DEPENDS)
diff --git a/httpd/src/ntnsapi.c b/httpd/src/ntnsapi.c
new file mode 100644
index 00000000..33fa7955
--- /dev/null
+++ b/httpd/src/ntnsapi.c
@@ -0,0 +1,383 @@
+/** BEGIN COPYRIGHT BLOCK
+ * Copyright 2001 Sun Microsystems, Inc.
+ * Portions copyright 1999, 2001-2003 Netscape Communications Corporation.
+ * All rights reserved.
+ * END COPYRIGHT BLOCK **/
+/*
+ * Aruna Victor
+ * NT NSAPI works differently from UNIX. The DLL doesn't know the addresses
+ * of the functions in the server process and needs to be told them.
+ */
+
+#include <nt/nsapi.h>
+extern int upload_file(pblock *pb, Session *sn, Request *rq);
+
+#ifdef BUILD_DLL
+
+#include <libadmin/libadmin.h>
+#include <libadmin/dstats.h>
+#include <libaccess/nsadb.h>
+#include <libadminutil/admutil.h>
+#include <libadminutil/distadm.h>
+#if 0
+#ifndef NO_MOCHA
+#include <mocha/mo_atom.h>
+#include <mocha/mo_scope.h>
+#include <mocha/mochaapi.h>
+#endif /* NO_MOCHA */
+#endif
+#include <base/fsmutex.h>
+
+extern char *system_winerr(void);
+extern char *system_winsockerr(void);
+
+VOID NsapiDummy()
+{
+ int i = 0;
+ SafTable = (SafFunction **)MALLOC(400 * sizeof(VOID*));
+
+ /* Force references to libadmin */
+
+ /* Functions from libadmin:keyconf.c */
+ SafTable[i++] = (SafFunction *)get_alias_dir;
+ /* Functions from libadmin:objconf.c */
+ SafTable[i++] = (SafFunction *)get_mag_init;
+ /* Functions from libadmin:form_post.c */
+ SafTable[i++] = (SafFunction *)post_begin;
+ /* Functions from libadmin:form_get.c */
+ SafTable[i++] = (SafFunction *)open_html_file;
+ /* Functions from libadmin:userdb.c */
+#if 0
+ SafTable[i++] = (SafFunction *)detect_db_type;
+#endif
+ /* Functions from libadmin:authdb.c */
+ SafTable[i++] = (SafFunction *)list_auth_dbs;
+ /* Functions from libadmin:error.c */
+ SafTable[i++] = (SafFunction *)report_error;
+ /* Functions from libadmin:template.c */
+ SafTable[i++] = (SafFunction *)directive_is;
+ /* Functions from libaccess:pcontrol.c */
+ SafTable[i++] = (SafFunction *)restart_http;
+ /* Functions from libadmin:admserv.c */
+ SafTable[i++] = (SafFunction *)read_server_lst;
+ /* Functions from libadmin:multconf.c */
+ SafTable[i++] = (SafFunction *)make_conflist;
+ /* Functions from libadmin:password */
+ SafTable[i++] = (SafFunction *)pw_enc;
+ /* Functions from libadmin:cron_conf.c */
+#if 0
+ SafTable[i++] = (SafFunction *)cron_conf_create_obj;
+#endif
+ /* Functions from libadmin:dstats.c */
+ SafTable[i++] = (SafFunction *)dstats_open;
+ /* Functions from libadmin:distadm.c */
+ SafTable[i++] = (SafFunction *)ADM_InitializePermissions;
+
+#ifndef NO_MOCHA
+ /* Force references to mocha */
+ /* Functions from mocha:mo_atom.c */
+ SafTable[i++] = (SafFunction *)mocha_Atomize;
+ /* Functions from mocha:mo_fun.c */
+ /* SafTable[i++] = (SafFunction *)mocha_NewFunctionObject; */
+ /* Functions from mocha:mo_scope.c */
+ SafTable[i++] = (SafFunction *)mocha_DefineSymbol;
+ /* Functions from mocha:mochaapi.c */
+ SafTable[i++] = (SafFunction *)MOCHA_CanConvertDatum;
+#endif /* NO_MOCHA */
+
+ /* Force references to base */
+ SafTable[i++] = (SafFunction *)fsmutex_init;
+
+ /* Force references to libmsgdisp */
+ SafTable[i++] = (SafFunction *)NSORB_Init;
+ SafTable[i++] = (SafFunction *)ConsumerCreatePush;
+ SafTable[i++] = (SafFunction *)CMNewBTree;
+ SafTable[i++] = (SafFunction *)NSObjArrayNew;
+}
+#endif /* BUILD_DLL */
+
+VOID InitializeSafFunctions()
+{
+
+ SafTable = (SafFunction **)MALLOC(400 * sizeof(VOID *));
+
+/* Functions from buffer.c */
+
+ SafTable[FILEBUF_OPEN] = (SafFunction *)filebuf_open;
+ SafTable[NETBUF_OPEN] = (SafFunction *)netbuf_open;
+ SafTable[FILEBUF_OPEN_NOSTAT] = (SafFunction *)filebuf_open_nostat;
+ SafTable[PIPEBUF_OPEN] = (SafFunction *)pipebuf_open;
+ SafTable[PIPEBUF_CLOSE] = (SafFunction *)pipebuf_close;
+ SafTable[FILEBUF_OPEN_NOSTAT] = (SafFunction *)filebuf_open_nostat;
+ SafTable[NETBUF_NEXT] = (SafFunction *)netbuf_next;
+ SafTable[PIPEBUF_NEXT] = (SafFunction *)pipebuf_next;
+ SafTable[FILEBUF_CLOSE] = (SafFunction *)filebuf_close;
+ SafTable[NETBUF_CLOSE] = (SafFunction *)netbuf_close;
+ SafTable[FILEBUF_GRAB] = (SafFunction *)filebuf_grab;
+ SafTable[NETBUF_GRAB] = (SafFunction *)netbuf_grab;
+ SafTable[PIPEBUF_GRAB] = (SafFunction *)pipebuf_grab;
+ SafTable[NETBUF_BUF2SD] = (SafFunction *)netbuf_buf2sd;
+ SafTable[FILEBUF_BUF2SD] = (SafFunction *)filebuf_buf2sd;
+ SafTable[PIPEBUF_BUF2SD] = (SafFunction *)pipebuf_buf2sd;
+ SafTable[PIPEBUF_NETBUF2SD] = (SafFunction *)pipebuf_netbuf2sd;
+
+/* Functions from daemon.h */
+ SafTable[NTDAEMON_RUN] = (SafFunction *)daemon_run;
+ SafTable[CHILD_STATUS] = (SafFunction *)child_status;
+
+/* Functions from file.h */
+ SafTable[SYSTEM_STAT] = (SafFunction *)system_stat;
+ SafTable[SYSTEM_FOPENRO] = (SafFunction *)system_fopenRO;
+ SafTable[SYSTEM_FOPENWA] = (SafFunction *)system_fopenWA;
+ SafTable[SYSTEM_FOPENRW] = (SafFunction *)system_fopenRW;
+ SafTable[SYSTEM_NOCOREDUMPS] = (SafFunction *)system_nocoredumps;
+ SafTable[SYSTEM_FWRITE] = (SafFunction *)system_fwrite;
+ SafTable[SYSTEM_FWRITE_ATOMIC] = (SafFunction *)system_fwrite_atomic;
+ SafTable[SYSTEM_WINERR] = (SafFunction *)system_winerr;
+ SafTable[SYSTEM_WINSOCKERR] = (SafFunction *)system_winsockerr;
+
+ SafTable[FILE_NOTFOUND] = (SafFunction *)file_notfound;
+ /* Removed from main code- 9-2-96
+ *
+ SafTable[SYSTEM_INITLOCK] = (SafFunction *)system_initlock;*/
+ SafTable[FILE_UNIX2LOCAL] = (SafFunction *)file_unix2local;
+ SafTable[DIR_OPEN] = (SafFunction *)dir_open;
+ SafTable[DIR_READ] = (SafFunction *)dir_read;
+ SafTable[DIR_CLOSE] = (SafFunction *)dir_close;
+
+/* Functions from cinfo.h */
+ SafTable[CINFO_INIT] = (SafFunction *)cinfo_init;
+ SafTable[CINFO_TERMINATE] = (SafFunction *)cinfo_terminate;
+ SafTable[CINFO_MERGE] = (SafFunction *)cinfo_merge;
+ SafTable[CINFO_FIND] = (SafFunction *)cinfo_find;
+ SafTable[CINFO_LOOKUP] = (SafFunction *)cinfo_lookup;
+ SafTable[CINFO_DUMP_DATABASE] = (SafFunction *)cinfo_dump_database;
+
+/* Functions from ereport.h */
+ SafTable[EREPORT] = (SafFunction *)ereport ;
+ SafTable[EREPORT_INIT] = (SafFunction *)ereport_init;
+ SafTable[EREPORT_TERMINATE] = (SafFunction *)ereport_terminate;
+ SafTable[EREPORT_GETFD] = (SafFunction *)ereport_getfd;
+
+#ifdef NET_SSL
+/* Functions from minissl.h */
+ SafTable[SSL_CLOSE] = (SafFunction *)PR_Close;
+ SafTable[SSL_SOCKET] = (SafFunction *)PR_NewTCPSocket;
+ SafTable[SSL_GET_SOCKOPT] = (SafFunction *)PR_GetSocketOption;
+ SafTable[SSL_SET_SOCKOPT] = (SafFunction *)PR_SetSocketOption;
+ SafTable[SSL_BIND] = (SafFunction *)PR_Bind;
+ SafTable[SSL_LISTEN] = (SafFunction *)PR_Listen;
+ SafTable[SSL_ACCEPT] = (SafFunction *)PR_Accept;
+ SafTable[SSL_READ] = (SafFunction *)PR_Read;
+ SafTable[SSL_WRITE] = (SafFunction *)PR_Write;
+ SafTable[SSL_GETPEERNAME] = (SafFunction *)PR_GetPeerName;
+#endif /* NET_SSL */
+
+
+/* Functions from net.h */
+
+ SafTable[NET_BIND] = (SafFunction *)net_bind;
+ SafTable[NET_READ] = (SafFunction *)net_read;
+ SafTable[NET_WRITE] = (SafFunction *)net_write;
+ /* SafTable[NET_FIND_FQDN] = (SafFunction *)net_find_fqdn; */
+ SafTable[NET_IP2HOST] = (SafFunction *)net_ip2host;
+
+/* Functions from pblock.h */
+ SafTable[PARAM_CREATE] = (SafFunction *)param_create;
+ SafTable[PARAM_FREE] = (SafFunction *)param_free;
+ SafTable[PBLOCK_CREATE] = (SafFunction *)pblock_create;
+ SafTable[PBLOCK_FREE] = (SafFunction *)pblock_free;
+ SafTable[PBLOCK_FINDVAL] = (SafFunction *)pblock_findval;
+ SafTable[PBLOCK_NVINSERT] = (SafFunction *)pblock_nvinsert;
+ SafTable[PBLOCK_NNINSERT] = (SafFunction *)pblock_nninsert;
+ SafTable[PBLOCK_PINSERT] = (SafFunction *)pblock_pinsert;
+ SafTable[PBLOCK_STR2PBLOCK] = (SafFunction *)pblock_str2pblock;
+ SafTable[PBLOCK_PBLOCK2STR] = (SafFunction *)pblock_pblock2str;
+ SafTable[PBLOCK_COPY] = (SafFunction *)pblock_copy;
+ SafTable[PBLOCK_PB2ENV] = (SafFunction *)pblock_pb2env;
+ SafTable[PBLOCK_FR] = (SafFunction *)pblock_fr;
+
+/* Functions from sem.h */
+ SafTable[SEM_INIT] = (SafFunction *)sem_init;
+ SafTable[SEM_TERMINATE] = (SafFunction *)sem_terminate;
+ SafTable[SEM_GRAB] = (SafFunction *)sem_grab;
+ SafTable[SEM_TGRAB] = (SafFunction *)sem_grab;
+ SafTable[SEM_RELEASE] = (SafFunction *)sem_release;
+
+/* Functions from session.h */
+ SafTable[SESSION_CREATE] = (SafFunction *)session_create;
+ SafTable[SESSION_FREE] = (SafFunction *)session_free;
+ SafTable[SESSION_DNS_LOOKUP] = (SafFunction *)session_dns_lookup;
+
+/* Functions from shexp.h */
+ SafTable[SHEXP_VALID] = (SafFunction *)shexp_valid;
+ SafTable[SHEXP_MATCH] = (SafFunction *)shexp_match;
+ SafTable[SHEXP_CMP] = (SafFunction *)shexp_cmp;
+ SafTable[SHEXP_CASECMP] = (SafFunction *)shexp_casecmp;
+
+/* Functions from systhr.h */
+ SafTable[SYSTHREAD_START] = (SafFunction *)systhread_start;
+ SafTable[SYSTHREAD_ATTACH] = (SafFunction *)systhread_attach;
+ SafTable[SYSTHREAD_TERMINATE] = (SafFunction *)systhread_terminate;
+ SafTable[SYSTHREAD_SLEEP] = (SafFunction *)systhread_sleep;
+ SafTable[SYSTHREAD_INIT] = (SafFunction *)systhread_init;
+ SafTable[SYSTHREAD_NEWKEY] = (SafFunction *)systhread_newkey;
+ SafTable[SYSTHREAD_GETDATA] = (SafFunction *)systhread_getdata;
+ SafTable[SYSTHREAD_SETDATA] = (SafFunction *)systhread_setdata;
+
+/* Functions from shmem.h */
+ SafTable[SHMEM_ALLOC] = (SafFunction *)shmem_alloc;
+ SafTable[SHMEM_FREE] = (SafFunction *)shmem_free;
+
+/* Functions from systems.h */
+ SafTable[UTIL_STRCASECMP] = (SafFunction *)util_strcasecmp;
+ SafTable[UTIL_STRNCASECMP] = (SafFunction *)util_strncasecmp;
+
+/* Functions from util.h */
+ SafTable[UTIL_GETLINE] = (SafFunction *)util_getline;
+ SafTable[UTIL_ENV_CREATE] = (SafFunction *)util_env_create;
+ SafTable[UTIL_ENV_STR] = (SafFunction *)util_env_str;
+#if 0
+ /* Removed from ntcgi.c --- obsolete; MB 1-26-96 */
+ SafTable[NTUTIL_ENV_STR] = (SafFunction *)ntutil_env_str;
+#endif
+ SafTable[UTIL_ENV_REPLACE] = (SafFunction *)util_env_replace;
+ SafTable[UTIL_ENV_FREE] = (SafFunction *)util_env_free;
+ SafTable[UTIL_ENV_FIND] = (SafFunction *)util_env_find;
+ SafTable[UTIL_HOSTNAME] = (SafFunction *)util_hostname;
+ SafTable[UTIL_CHDIR2PATH] = (SafFunction *)util_chdir2path;
+ SafTable[UTIL_IS_MOZILLA] = (SafFunction *)util_is_mozilla;
+ SafTable[UTIL_IS_URL] = (SafFunction *)util_is_url;
+ SafTable[UTIL_LATER_THAN] = (SafFunction *)util_later_than;
+ SafTable[UTIL_URI_IS_EVIL] = (SafFunction *)util_uri_is_evil;
+ SafTable[UTIL_URI_PARSE] = (SafFunction *)util_uri_parse;
+ SafTable[UTIL_URI_UNESCAPE] = (SafFunction *)util_uri_unescape;
+ SafTable[UTIL_URI_ESCAPE] = (SafFunction *)util_uri_escape;
+ SafTable[UTIL_URL_ESCAPE] = (SafFunction *)util_url_escape;
+ SafTable[UTIL_SH_ESCAPE] = (SafFunction *)util_sh_escape;
+ SafTable[UTIL_ITOA] = (SafFunction *)util_itoa;
+ SafTable[UTIL_VSPRINTF] = (SafFunction *)util_vsprintf;
+ SafTable[UTIL_SPRINTF] = (SafFunction *)util_sprintf;
+ SafTable[UTIL_VSNPRINTF] = (SafFunction *)util_vsnprintf;
+ SafTable[UTIL_SNPRINTF] = (SafFunction *)util_snprintf;
+
+// SafTable[INITIALIZE_ADMIN_LOGGING] = (SafFunction *)InitializeAdminLogging;
+// SafTable[INITIALIZE_HTTPD_LOGGING] = (SafFunction *)InitializeHttpdLogging;
+// SafTable[TERMINATE_ADMIN_LOGGING] = (SafFunction *)TerminateAdminLogging;
+// SafTable[TERMINATE_HTTPD_LOGGING] = (SafFunction *)TerminateHttpdLogging;
+
+ SafTable[LOG_ERROR_EVENT] = (SafFunction *)LogErrorEvent;
+
+/* Functions from conf.h */
+ SafTable[CONF_INIT] = (SafFunction *)conf_init;
+ SafTable[CONF_TERMINATE] = (SafFunction *)conf_terminate;
+ SafTable[CONF_GETGLOBALS] = (SafFunction *)conf_getglobals;
+ SafTable[CONF_VARS2DAEMON] = (SafFunction *)conf_vars2daemon;
+
+ SafTable[FUNC_INIT] = (SafFunction *)func_init;
+ SafTable[FUNC_FIND] = (SafFunction *)func_find;
+ SafTable[FUNC_EXEC] = (SafFunction *)func_exec;
+ SafTable[FUNC_INSERT] = (SafFunction *)func_insert;
+ SafTable[HTTP_SCAN_HEADERS] = (SafFunction *)http_scan_headers;
+ SafTable[HTTP_START_RESPONSE] = (SafFunction *)http_start_response;
+ SafTable[HTTP_HDRS2_ENV] = (SafFunction *)http_hdrs2env;
+ SafTable[HTTP_STATUS] = (SafFunction *)http_status;
+ SafTable[HTTP_SET_FINFO] = (SafFunction *)http_set_finfo;
+ SafTable[HTTP_DUMP822] = (SafFunction *)http_dump822;
+ SafTable[HTTP_FINISH_REQUEST] = (SafFunction *)http_finish_request;
+ SafTable[HTTP_HANDLE_SESSION] = (SafFunction *)http_handle_session;
+ SafTable[HTTP_URI2URL] = (SafFunction *)http_uri2url;
+
+/* Functions from log.h */
+ SafTable[LOG_ERROR] = (SafFunction *)log_error;
+ SafTable[DIRECTIVE_NAME2NUM] = (SafFunction *)directive_name2num;
+ SafTable[DIRECTIVE_NUM2NAME] = (SafFunction *)directive_num2name;
+ SafTable[OBJECT_CREATE] = (SafFunction *)object_create;
+ SafTable[OBJECT_FREE] = (SafFunction *)object_free;
+ SafTable[OBJECT_ADD_DIRECTIVE] = (SafFunction *)object_add_directive;
+ SafTable[OBJECT_EXECUTE] = (SafFunction *)object_execute;
+ SafTable[OBJSET_SCAN_BUFFER] = (SafFunction *)objset_scan_buffer;
+ SafTable[OBJSET_FREE] = (SafFunction *)objset_free;
+ SafTable[OBJSET_FREE_SETONLY] = (SafFunction *)objset_free_setonly;
+ SafTable[OBJSET_NEW_OBJECT] = (SafFunction *)objset_new_object;
+ SafTable[OBJSET_ADD_OBJECT] = (SafFunction *)objset_add_object;
+ SafTable[OBJSET_FINDBYNAME] = (SafFunction *)objset_findbyname;
+ SafTable[OBJSET_FINDBYPPATH] = (SafFunction *)objset_findbyppath;
+
+ SafTable[REQUEST_CREATE] = (SafFunction *)request_create;
+ SafTable[REQUEST_FREE] = (SafFunction *)request_free;
+ SafTable[REQUEST_RESTART_INTERNAL] = (SafFunction *)request_restart_internal;
+ SafTable[REQUEST_TRANSLATE_URI] = (SafFunction *)request_translate_uri;
+ SafTable[REQUEST_HEADER] = (SafFunction *)request_header;
+ SafTable[REQUEST_STAT_PATH] = (SafFunction *)request_stat_path;
+
+ /* temporarily remove definitions till they are added into the header file. */
+ SafTable[REQUEST_HANDLE_PROCESSED] = (SafFunction *)request_handle_processed;
+
+ SafTable[MAGNUS_ATRESTART] = (SafFunction *)magnus_atrestart;
+
+ SafTable[SYSTEM_FOPENWT] = (SafFunction *)system_fopenWT;
+ SafTable[SYSTEM_MALLOC] = (SafFunction *)system_malloc;
+ SafTable[SYSTEM_FREE] = (SafFunction *)system_free;
+ SafTable[SYSTEM_REALLOC] = (SafFunction *)system_realloc;
+ SafTable[SYSTEM_STRDUP] = (SafFunction *)system_strdup;
+
+ SafTable[UPLOAD_FILE] = (SafFunction *)upload_file;
+
+ SafTable[CRIT_INIT] = (SafFunction *)crit_init;
+ SafTable[CRIT_ENTER] = (SafFunction *)crit_enter;
+ SafTable[CRIT_EXIT] = (SafFunction *)crit_exit;
+ SafTable[CRIT_TERMINATE] = (SafFunction *)crit_terminate;
+ SafTable[SYSTHREAD_CURRENT] = (SafFunction *)systhread_current;
+
+ SafTable[NET_ACCEPT] = (SafFunction *)net_accept;
+ SafTable[NET_CLOSE] = (SafFunction *)net_close;
+ SafTable[NET_CONNECT] = (SafFunction *)net_connect;
+ SafTable[NET_IOCTL] = (SafFunction *)net_ioctl;
+ SafTable[NET_LISTEN] = (SafFunction *)net_listen;
+ SafTable[NET_SETSOCKOPT] = (SafFunction *)net_setsockopt;
+ SafTable[NET_SOCKET] = (SafFunction *)net_socket;
+
+
+ /* msgdisp functions */
+ SafTable[NSORB_INIT] = (SafFunction *)NSORB_Init;
+ SafTable[NSORB_INST_ID] = (SafFunction *)NSORB_InstanceID;
+ SafTable[NSORB_GET_INST] = (SafFunction *)NSORB_GetInstance;
+ SafTable[NSORB_REG_INT] = (SafFunction *)NSORB_RegisterInterface;
+ SafTable[NSORB_FIND_OBJ] = (SafFunction *)NSORB_FindObject;
+ SafTable[NSORB_GET_INTERFACE] = (SafFunction *)NSORB_GetInterface;
+
+ SafTable[ARR_NEW] = (SafFunction *)NSObjArrayNew;
+ SafTable[ARR_FREE] = (SafFunction *)NSObjArrayFree;
+ SafTable[ARR_GET_OBJ] = (SafFunction *)NSObjArrayGetObj;
+ SafTable[ARR_GET_LAST_OBJ] = (SafFunction *)NSObjArrayGetLastObj;
+ SafTable[ARR_NEW_OBJ] = (SafFunction *)NSObjArrayNewObj;
+ SafTable[ARR_GET_NUM_OBJ] = (SafFunction *)NSObjArrayGetNumObj;
+ SafTable[ARR_RESET] = (SafFunction *)NSObjArrayReset;
+ SafTable[ARR_REMOVEOBJ] = (SafFunction *)NSObjArrayRemoveObj;
+ SafTable[ARR_GET_OBJ_NUM] = (SafFunction *)NSObjArrayGetObjNum;
+
+ SafTable[CM_BT_NEW] = (SafFunction *)CMNewBTree;
+ SafTable[CM_BT_ADD_NODE] = (SafFunction *)CMBTreeAddNode;
+ SafTable[CM_BT_FIND_NODE] = (SafFunction *)CMBTreeFindNode;
+ SafTable[CM_BT_DEL_NODE] = (SafFunction *)CMBTreeDeleteNode;
+ SafTable[CM_BT_DESTROY] = (SafFunction *)CMBTreeDestroy;
+ SafTable[CM_BT_GET_NUM] = (SafFunction *)CMBTreeGetNumNode;
+ SafTable[CM_BT_TRAVEL] = (SafFunction *)CMBTreeInorderTravel;
+
+ SafTable[CM_STR_NEW] = (SafFunction *)NewCMStrObj;
+ SafTable[CM_STR_ADD] = (SafFunction *)CMStrObjAdd;
+ SafTable[CM_STR_REL] = (SafFunction *)CMStrObjRelease;
+ SafTable[CM_STR_FREE] = (SafFunction *)CMStrObjFree;
+ SafTable[CM_STR_GET] = (SafFunction *)CMStrObjGetString;
+ SafTable[CM_STR_SIZE] = (SafFunction *)CMStrObjGetSize;
+ SafTable[CM_COPY_STR] = (SafFunction *)CMCopyString;
+ SafTable[CM_MAKE_UID] = (SafFunction *)MakeUID;
+
+ SafTable[MS_NEW] = (SafFunction *)ConsumerNewPush;
+ SafTable[MS_CREATE] = (SafFunction *)ConsumerCreatePush;
+
+
+
+}
+
diff --git a/httpd/src/unixso.exp b/httpd/src/unixso.exp
new file mode 100644
index 00000000..55aae332
--- /dev/null
+++ b/httpd/src/unixso.exp
@@ -0,0 +1,38 @@
+acl_write_rights
+acl_read_rights
+SEC_ERROR_INVALID_AVA
+SEC_ERROR_INPUT_LEN
+SEC_ERROR_BAD_KEY
+SEC_ERROR_EXPIRED_CERTIFICATE
+SSL_ERROR_BAD_CERT_DOMAIN
+SEC_ERROR_UNTRUSTED_CERT
+SEC_ERROR_UNKNOWN_ISSUER
+SEC_ERROR_BAD_SIGNATURE
+SEC_ERROR_IO
+SEC_ERROR_INVALID_TIME
+XP_ERRNO_EWOULDBLOCK
+XP_ERRNO_EAGAIN
+pr_fdTable
+XP_ERRNO_EIO
+XP_ERRNO_EISCONN
+XP_ERRNO_EINVAL
+XP_ERRNO_EBADF
+XP_ERRNO_ECONNREFUSED
+SSL_ERROR_US_ONLY_SERVER
+SSL_ERROR_EXPORT_ONLY_SERVER
+SSL_ERROR_BAD_CERTIFICATE
+SSL_ERROR_UNSUPPORTED_CERTIFICATE_TYPE
+SSL_ERROR_NO_CERTIFICATE
+SSL_ERROR_UNSUPPORTED_VERSION
+SSL_ERROR_NO_CYPHER_OVERLAP
+SSL_ERROR_BAD_SERVER
+SSL_ERROR_BAD_CLIENT
+SEC_ERROR_OUTPUT_LEN
+SEC_ERROR_INVALID_ARGS
+SEC_ERROR_BAD_DATA
+SEC_ERROR_NO_MEMORY
+SEC_ERROR_BAD_DATABASE
+SEC_ERROR_BAD_DER
+SEC_ERROR_INVALID_ALGORITHM
+SEC_ERROR_LIBRARY_FAILURE
+SEC_ERROR_BAD_PASSWORD
diff --git a/httpd/src/unixso.mk b/httpd/src/unixso.mk
new file mode 100644
index 00000000..e60e0226
--- /dev/null
+++ b/httpd/src/unixso.mk
@@ -0,0 +1,246 @@
+#
+# BEGIN COPYRIGHT BLOCK
+# Copyright 2001 Sun Microsystems, Inc.
+# Portions copyright 1999, 2001-2003 Netscape Communications Corporation.
+# All rights reserved.
+# END COPYRIGHT BLOCK
+#
+LIBSECDIR=$(MCOM_ROOT)/lib/libsec/$(NSOBJDIR_NAME)
+
+ifneq ($(ARCH), WINNT)
+
+SRCDIR=$(MCOM_ROOT)/ldapserver/httpd/src
+
+AR = ar
+
+ifeq ($(ARCH), OSF1)
+DLL_LDFLAGS += -soname $(SONAME)
+EXTRA_LIBS += -Wl,-rpath,.:../../lib:../../bin/https:../../plugins/java/bin:../../wai/lib
+ADM_EXTRA = -lcxx -lpthread -lmach -lexc -lc
+AR = rm -f ________64ELEL_ ; ar
+endif
+
+ifeq ($(ARCH), IRIX)
+DLL_LDFLAGS += -soname $(SONAME)
+ifeq ($(USE_N32), 1)
+ DLL_LDFLAGS += -n32 -mips3
+endif
+EXTRA_LIBS += -rpath .:../../lib:../../bin/https:../../plugins/java/bin:../wai/lib
+# IRIX likes it twice!
+SOLINK2=$(SOLINK)
+endif
+
+ifeq ($(ARCH), SOLARIS)
+DLL_LDFLAGS += -h $(SONAME)
+EXTRA_LIBS += -R .:../../lib:../../bin/https:../../plugins/java/bin:../wai/lib
+ADM_EXTRA = $(GCCLIB)
+endif
+
+ifdef USE_LD_RUN_PATH
+EXTRA_LIBS += -L.
+export LD_RUN_PATH=./.:../../lib:../../bin/https:../../plugins/java/bin:../wai/lib
+endif
+
+ifeq ($(ARCH), SONY)
+DLL_LDFLAGS += -soname $(SONAME)
+EXTRA_LIBS += -rpath .
+endif
+
+ifeq ($(ARCH), NEC)
+DLL_LDFLAGS += -h $(SONAME)
+endif
+
+ifeq ($(ARCH), HPUX)
+DLL_LDFLAGS += -L.
+SOLINK=-L. -l$(HTTPDSO_NAME)$(DLL_PRESUF)
+EXTRA_LIBS += -Wl,+b.:../../lib:../../bin/https:../../plugins/java/bin:../wai/lib
+# The line below is required for LiveWire DB2 to work.
+EXTRA_LIBS += -Wl,-uallow_unaligned_data_access -lhppa
+LD=$(CCC)
+# Well HPUX's not happy about including libnspr.sl(-lnspr) into our executable,
+# it's that ___ +eh again.
+NSPRLINK=$(NOTHING)
+#LDAPLINK=-L. $(addsuffix .a, $(addprefix lib, $(LDAP_DOTALIB_NAMES))) \
+# $(addprefix -l, $(LDAP_SOLIB_NAMES))
+endif
+
+ifeq ($(ARCH), AIX)
+MKSHLIB_FLAGS += -berok -brtl
+SOLINK=-L. -L../../lib -lns-dshttpd$(DLL_PRESUF)
+LIBSECDIR=$(MCOM_ROOT)/lib/libsec/$(NSOBJDIR_NAME)
+#LDAPLINK=-L. $(addsuffix .a, $(addprefix lib, $(LDAP_DOTALIB_NAMES))) \
+# $(addprefix -l, $(LDAP_SOLIB_NAMES))
+#NSPRLINK = -L. -lnspr$(DLL_PRESUF)
+#NSPRLINK = -L. -ldsnspr$(DLL_PRESUF)
+ADM_EXTRA := -L. -L../../lib $(LDAPLINK) $(NSPRLINK) $(EXTRA_LIBS)
+#ADM_EXTRA := -L. -L../../lib $(LDAPLINK) $(NSPRLINK) $(EXTRA_LIBS) -L$(LIBSECDIR) -lsec-$(WHICHA)
+ifdef FORTEZZA
+ADM_EXTRA += $(NSCP_DISTDIR)/lib/libci.$(LIB_SUFFIX)
+endif
+DEF_LIBPATH := .:../../lib:$(DEF_LIBPATH)
+endif
+
+ifeq ($(ARCH), SUNOS4)
+EXTRA_LIBS += -L.
+ADM_EXTRA = $(EXTRA_LIBS)
+endif
+
+ifeq ($(ARCH), UnixWare)
+DLL_LDFLAGS += -h $(SONAME)
+NSPRLINK = -L. -ldsnspr$(DLL_PRESUF)
+endif
+
+EXTRA_LIBS += $(MATHLIB)
+
+ifndef SONAME
+SONAME=$(HTTPDSO_NAME)$(DLL_PRESUF).$(DLL_SUFFIX)
+endif
+
+ifndef SOLINK
+SOLINK=./$(HTTPDSO_NAME)$(DLL_PRESUF).$(DLL_SUFFIX)
+endif
+
+#ifndef LDAPLINK
+#LDAPLINK=$(LDAPOBJNAME)
+#endif
+
+ifndef NSPRLINK
+NSPRLINK=libnspr$(DLL_PRESUF).$(DLL_SUFFIX)
+endif
+
+# Temporary directory for the libraries and their object files
+$(OBJDIR)/httpd-lib:
+ifeq ($(ARCH), HPUX)
+ mkdir -p $(OBJDIR)/httpd-lib/nspr20
+endif
+ mkdir -p $(OBJDIR)/httpd-lib/sslio
+ mkdir -p $(OBJDIR)/httpd-lib/arlib
+ mkdir -p $(OBJDIR)/httpd-lib/mocha
+ mkdir -p $(OBJDIR)/httpd-lib/libsec
+ mkdir -p $(OBJDIR)/httpd-lib/libdbm
+ mkdir -p $(OBJDIR)/httpd-lib/xp
+
+# Define a LIBSEC which doesn't include libdbm and xp.
+LIBSECNAME=$(MCOM_LIBDIR)/libsec/$(NSOBJDIR_NAME)/libsec-$(WHICHA).$(LIB_SUFFIX)
+ifndef LIBSECOBJS
+LIBSEC1=$(LIBSECNAME)
+else
+LIBSEC1=$(LIBSECOBJS)
+endif
+
+ifdef PRODUCT_IS_DIRECTORY_SERVER
+ DAEMONLIB=
+else
+ DAEMONLIB=$(OBJDIR)/lib/libhttpdaemon.a
+endif
+
+DEPLIBS = ${DAEMONLIB} $(OBJDIR)/lib/libsi18n.a $(ADMLIB) $(LDAPSDK_DEP)
+
+ifdef FORTEZZA
+LIBSEC1 += $(NSCP_DISTDIR)/lib/libci.$(LIB_SUFFIX)
+endif
+
+DEPLINK = ${DAEMONLIB} $(OBJDIR)/lib/libsi18n.a
+ifneq ($(BUILD_MODULE), HTTP_PERSONAL)
+DEPLINK += $(OBJDIR)/lib/libmsgdisp.a
+endif
+DEPLINK += $(SOLINK) $(LDAPLINK) $(NSPRLINK) $(SOLINK2)
+
+# Relative to the directory that contains the .so
+BUILTDIR = .
+
+ifndef NO_VERITY
+
+ifeq ($(DO_SEARCH), yes)
+ifdef VERITY_TASKSTUB
+TASKSTUB = ./taskstub.o
+else
+TASKSTUB =
+endif
+
+ifndef VERITY_SOLINK
+VERITY_SOLINK=$(TASKSTUB) -L. $(addprefix -l, $(VERITY_LIBNAMES))
+endif
+
+VERITYDEP=$(addprefix $(OBJDIR)/, $(VERITYOBJNAMES) $(TASKSTUB))
+
+$(VERITYDEP) : $(LIBVERITY)
+ cp $(LIBVERITY) $(VERITY_TASKSTUB) $(OBJDIR)
+
+DEPLINK += $(VERITY_SOLINK)
+DEPLIBS += $(VERITYDEP)
+endif
+
+endif
+
+SERVLIBS = $(addprefix $(OBJDIR)/lib/, libadmin.a libframe.a libaccess.a \
+ libldapu.a libbase.a libsi18n.a)
+SERVLIB_DIRS = $(addprefix $(OBJDIR)/lib/, libadmin frame libaccess base \
+ ldaputil libmsgdisp libsi18n)
+SERVLIB_OBJS = $(subst $(OBJDIR)/,$(BUILTDIR)/, \
+ $(filter-out $(OBJDIR)/lib/libadmin/nsnews.o, \
+ $(wildcard $(addsuffix /*.o, $(SERVLIB_DIRS)))))
+
+MOCHA=$(NSCP_DISTDIR)/lib/mocha.a
+
+# Removed for ns-security integration
+#NSLIBS = $(SECLIB) $(LIBSSLIO)
+
+ADMLIB_LIBS = $(SERVLIBS) $(NSLIBS)
+
+mocha:
+ cd $(MCOM_ROOT)/mocha; $(MAKE) export $(NSDEFS)
+
+
+admobjs:
+ifeq ($(ARCH), HPUX)
+ cd $(OBJDIR)/httpd-lib/nspr20; $(AR) x $(LIBNSPR)
+endif
+ cd $(OBJDIR)/httpd-lib/sslio; $(AR) x $(LIBSSLIO)
+ifndef NSPR20
+ cd $(OBJDIR)/httpd-lib/mocha; $(AR) x $(MOCHA)
+endif
+ cd $(OBJDIR)/httpd-lib/libdbm; $(AR) x $(LIBDBM)
+ cd $(OBJDIR)/httpd-lib/xp; $(AR) x $(LIBXP)
+ cd $(OBJDIR)/httpd-lib/libdbm; $(AR) x $(LIBDBM)
+ cd $(OBJDIR)/httpd-lib/xp; $(AR) x $(LIBXP)
+ rm -f $(addprefix $(OBJDIR)/httpd-lib/xp/, xp_time.o xplocale.o \
+ xp_cntxt.o)
+
+#$(LDAPOBJNAME): ldapobjs
+
+#ldapobjs:
+# (cd $(OBJDIR); rm -f $(LDAPOBJNAME))
+# cp $(LIBLDAP) $(OBJDIR)
+
+# Removed for ns-security integration.
+#OBJRULES += ldapobjs
+
+# Removed the httpd-lib from link for ns-security integration.
+#ADMOBJS=$(SERVLIB_OBJS) $(BUILTDIR)/httpd-lib/*/*.o
+#OBJRULES += admobjs
+ADMLIB=$(OBJDIR)/$(SONAME)
+
+$(ADMLIB): $(ADMLIB_LIBS)
+ifeq ($(ARCH), IRIX)
+ ifeq ($(USE_N32), 1) # no -objectlist any more
+ cd $(OBJDIR) ; \
+ $(LINK_DLL) \
+ $(SERVLIB_OBJS) $(ADM_EXTRA)
+ else
+ echo "$(SERVLIB_OBJS)" > /tmp/objectlist
+ tr ' ' '\012' < /tmp/objectlist > /tmp/objectlist.NEW
+ mv /tmp/objectlist.NEW /tmp/objectlist
+ cd $(OBJDIR) ; \
+ $(LINK_DLL) \
+ -objectlist /tmp/objectlist $(ADM_EXTRA)
+ rm /tmp/objectlist
+ endif
+else
+ cd $(OBJDIR) ; \
+ $(LINK_DLL) \
+ $(SERVLIB_OBJS) $(ADM_EXTRA)
+endif
+
+
+endif