From dd44e1c28f5fa7d0f5809285c9b832150396a5ae Mon Sep 17 00:00:00 2001 From: Hallvard Furuseth Date: Sat, 27 Mar 1999 18:05:33 +0000 Subject: [PATCH] Initial port of web_ldap to OpenLDAP. Also fixed some doc bugs. --- configure | 2 ++ configure.in | 1 + contrib/Makefile.in | 2 +- contrib/web_ldap/Makefile | 28 ------------------- contrib/web_ldap/Makefile.in | 18 ++++++++++++ contrib/web_ldap/util.c | 10 +++++-- contrib/web_ldap/web_ldap.c | 16 +++++++++-- contrib/web_ldap/web_ldap_usage.html | 41 ++++++++++++++-------------- contrib/web_ldap/web_ldap_usage.txt | 40 +++++++++++++-------------- 9 files changed, 81 insertions(+), 77 deletions(-) delete mode 100644 contrib/web_ldap/Makefile create mode 100644 contrib/web_ldap/Makefile.in diff --git a/configure b/configure index 2353e01941..8400c6d845 100755 --- a/configure +++ b/configure @@ -10642,6 +10642,7 @@ tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \ tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \ contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \ contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \ +contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \ include/portable.h include/ldap_features.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF diff --git a/configure.in b/configure.in index 45a5ac21ac..60e04f4125 100644 --- a/configure.in +++ b/configure.in @@ -1876,6 +1876,7 @@ tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \ tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \ contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \ contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \ +contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \ ,[ date > stamp-h echo Please \"make depend\" to build dependencies diff --git a/contrib/Makefile.in b/contrib/Makefile.in index 927833ee9a..4040f6454f 100644 --- a/contrib/Makefile.in +++ b/contrib/Makefile.in @@ -3,4 +3,4 @@ ## ## doc Makefile.in for OpenLDAP -SUBDIRS= saucer +SUBDIRS= saucer web_ldap diff --git a/contrib/web_ldap/Makefile b/contrib/web_ldap/Makefile deleted file mode 100644 index b2d1fcce86..0000000000 --- a/contrib/web_ldap/Makefile +++ /dev/null @@ -1,28 +0,0 @@ -# -# This file used under Irix (SGI) - please modify for your needs -# - -#CC = cc -signed - -#For Optimization -CFLAGS= -O2 $(CPPFLAGS) - -#For debugging -#CFLAGS= -g $(CPPFLAGS) - -PREFIX=../.. -# PREFIX=/usr/local - -CPPFLAGS= -I$(PREFIX)/include -LDFLAGS= -L$(PREFIX)/libraries - -# CC = cc $(CFLAGS) $(CPPFLAGS) - -# -# Create Executables -# -web_ldap: web_ldap.o util.o - $(CC) -o web_ldap web_ldap.o util.o $(LDFLAGS) -lldap -llber - -clean: - rm -f *.o a.out core web_ldap diff --git a/contrib/web_ldap/Makefile.in b/contrib/web_ldap/Makefile.in new file mode 100644 index 0000000000..d5e5586378 --- /dev/null +++ b/contrib/web_ldap/Makefile.in @@ -0,0 +1,18 @@ +PROGRAMS= web_ldap + +SRCS= web_ldap.c util.c +OBJS= web_ldap.o util.o + +LDAP_INCDIR= ../../include +LDAP_LIBDIR= ../../libraries + +XLIBS = -lldap -llber -llutil +XXLIBS = $(KRB_LIBS) $(LUTIL_LIBS) + +web_ldap: ${OBJS} $(LDAP_LIBDEPEND) + $(LTLINK) -o $@ $(OBJS) $(LIBS) + +install-local: $(PROGRAMS) FORCE + -test -d $(libexecdir) || $(MKDIR) $(libexecdir) + $(LTINSTALL) $(INSTALLFLAGS) -m 755 web_ldap $(libexecdir) + @echo ">> You must copy and edit web_ldap.cfg and web_ldap.html as needed. <<" diff --git a/contrib/web_ldap/util.c b/contrib/web_ldap/util.c index d76f304ecb..1273ba99e6 100644 --- a/contrib/web_ldap/util.c +++ b/contrib/web_ldap/util.c @@ -12,14 +12,18 @@ * time/date functions added - R. Scott Guthrie */ +#include "portable.h" + #include #include -#include -#include #include #include #include -#include + +#include +#include +#include + #include "process_form.h" /*--------------*/ diff --git a/contrib/web_ldap/web_ldap.c b/contrib/web_ldap/web_ldap.c index b6fa2e10c1..c37ef3846c 100644 --- a/contrib/web_ldap/web_ldap.c +++ b/contrib/web_ldap/web_ldap.c @@ -5,23 +5,33 @@ * Jens Moller - Dec 11, 1998 */ +#include "portable.h" + #include #include #include #include #include -#include -#include #include + +#include +#include + #include #include #include #include "maint_form.h" /* for HTML Form manipulations */ /* default values */ +#ifndef LDAP_PORT #define LDAP_PORT 389 -#define SERVER "ldap.bigfoot.com" +#endif +#ifndef SERVER +#define SERVER "ldap.bigfoot.com" +#endif +#ifndef CONFIG #define CONFIG "web_ldap.cfg" +#endif #define MAX_ATTRIB 100 #define MAX_CHARS 256 diff --git a/contrib/web_ldap/web_ldap_usage.html b/contrib/web_ldap/web_ldap_usage.html index 202e9ff615..aaa8d3648b 100644 --- a/contrib/web_ldap/web_ldap_usage.html +++ b/contrib/web_ldap/web_ldap_usage.html @@ -3,17 +3,21 @@ -

web_ldap V 1.1

+

web_ldap version 1.1, OpenLDAP variant

+ +This is an OpenLDAP port of the web_ldap program. +

The files provided in the file set for 'web_ldap' were developed under the GNU General Public License (GPL). Under the GPL, the source code is freely-distributed and available to the general public. There is no warranty on the software, and it does not come with support, however, I would appreciate -it if you emailed me any bug-fixes you create -(jens@colomar.com). +it if you emailed any bug-fixes you create to me +(jens@colomar.com) and +OpenLDAP-bugs@OpenLDAP.org.

-All code here is generic Ansi C, allowing most Unix compilers +All code here is generic ISO C, allowing most Unix compilers to generate the required object files and executable images. It was tested against an Apache HTTPD server and uses no special HTML functionality that does not appear within V 3.x @@ -37,7 +41,7 @@ and a sample makefile. You will need the LDAP SDK for your specific Unix System (both the UofM libraries and Netscape libraries - which are also free - have been tested).

-The tool allows You to specify that actions taken +The tool allows you to specify that actions taken be logged to a file. This provides you a method by which you can build out larger applications and see what is happening.

@@ -66,7 +70,7 @@ When you execute the application from a command line such as: All actions take place in the same directory that the web_ldap program resides in. Most people would typically build an -application of this nature in one of their own directorys and +application of this nature in one of their own directories and this would give them Read/Write access to all of the files associated with the program. Any file restrictions or capabilities that you have will be enabled as part of your session. @@ -94,22 +98,15 @@ If you get errors - start with this simple change.

Building the application:

-Requires Ansi C (your standard OS compiler or GCC should +Requires ISO C (your standard OS compiler or GCC should work fine).

-The make file contains: +Under OpenLDAP, you should build with the following commands after +having configured and built OpenLDAP itself:

-web_ldap: web_ldap.o
-        $(CC) -o web_ldap web_ldap.o util.o \
-	libldap.a liblber.a
-		
-
-web_ldap.o: web_ldap.c
-        $(CC) -c web_ldap.c
-
-util.o: util.c
-        $(CC) -c util.c
-
+	cd contrib/web_ldap
+	make depend
+	make
 

Configuration:

@@ -203,7 +200,7 @@ attribute could have multiple values. This application will list all the values it finds for any given attribute. - +

Where to put the files:

If running this interactively (from a Unix shell prompt), all the files can reside in any of your home directories. @@ -352,4 +349,6 @@ that your modified web_ldap.c program may want to have passed to it.


Jens Moller - Jens@colomar.com - -COLOMAR Group +COLOMAR Group.
+ +OpenLDAP - OpenLDAP-devel@OpenLDAP.org. diff --git a/contrib/web_ldap/web_ldap_usage.txt b/contrib/web_ldap/web_ldap_usage.txt index d002a58c54..343d850c18 100644 --- a/contrib/web_ldap/web_ldap_usage.txt +++ b/contrib/web_ldap/web_ldap_usage.txt @@ -1,13 +1,16 @@ -web_ldap V 1.0 +web_ldap Version 1.1, OpenLDAP variant + +This is an OpenLDAP port of the web_ldap program. The files provided in the file set for 'web_ldap' were developed under the GNU General Public License (GPL). Under the GPL, the source code is freely-distributed and available to the general public. There is no warranty on the software, and it does not come with support, however, I would appreciate -it if you emailed me any bug-fixes you create (jens@colomar.com). +it if you emailed any bug-fixes you create to me (jens@colomar.com) +and OpenLDAP-bugs@OpenLDAP.org. -All code here is generic Ansi C, allowing most Unix compilers +All code here is generic ISO C, allowing most Unix compilers to generate the required object files and executable images. It was tested against an Apache HTTPD server and uses no special HTML functionality that does not appear within V 3.x @@ -60,7 +63,7 @@ When you execute the application from a command line such as: All actions take place in the same directory that the web_ldap program resides in. Most people would typically build an -application of this nature in one of their own directorys and +application of this nature in one of their own directories and this would give them Read/Write access to all of the files associated with the program. Any file restrictions or capabilities that you have will be enabled as part of your session. @@ -88,23 +91,16 @@ If you get errors - start with this simple change. Building the application: -Requires Ansi C (your standard OS compiler or GCC should +Requires ISO C (your standard OS compiler or GCC should work fine). -The make file contains: - -web_ldap: web_ldap.o - $(CC) -o web_ldap web_ldap.o util.o \ - libldap.a liblber.a - +Under OpenLDAP, you should build with the following commands after having +configured and built OpenLDAP itself: -web_ldap.o: web_ldap.c - $(CC) -c web_ldap.c + cd contrib/web_ldap + make depend + make -util.o: util.c - $(CC) -c util.c - - Configuration: @@ -313,9 +309,10 @@ additional HTML code you add may need to to have proper termination syntax (tables are very touchy about this), and you may need to further enhance your changes to compensate. -Please test your results on both Netscape's Web Browser and Internet -Explorer. Nothing is more irritating to end users than getting different -results based on their Web Browser selection. +When creating new applications, please test your results on both +Netscape's Web Browser and Internet Explorer. Nothing is more +irritating to end users than getting different results based on their +Web Browser selection. The Unix Command line will not allow you to pass some characters into an application unless you surround the characters or command with quotes. @@ -343,4 +340,5 @@ options (such as which configuration file to use), or other options that your modified web_ldap.c program may want to have passed to it. -Jens Moller - Jens@colomar.com - COLOMAR Group +Jens Moller - Jens@colomar.com - COLOMAR Group. +OpenLDAP - OpenLDAP-devel@OpenLDAP.org. -- 2.39.5