From bacb29f5e40e872832c243810e61684ea87874f3 Mon Sep 17 00:00:00 2001 From: Rich Megginson Date: Jun 01 2006 19:43:54 +0000 Subject: Initial import of code from ldapserver, modified to use autoconf for build --- diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/AUTHORS diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/ChangeLog diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..a53449e --- /dev/null +++ b/LICENSE @@ -0,0 +1,13 @@ +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..235755f --- /dev/null +++ b/Makefile.am @@ -0,0 +1,191 @@ +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2006 Red Hat, Inc. +# All rights reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# END COPYRIGHT BLOCK + +# look for included m4 files in the ./m4/ directory +ACLOCAL_AMFLAGS = -I m4 + +cgibindir = @cgibindir@ +htmldir = @htmldir@ +pbhtmldir = @pbhtmldir@ +# config is a bit of a misnomer - these are really configurable templates +configdir = @configdir@ +pbconfigdir = @pbconfigdir@ +# the context dir is where the application specific config files go +contextdir = @contextdir@ + +DSGW_VER_STR := "Fedora-Directory-Gateway/1.0.2" + +DEFS = -DDSGW_VER_STR=\"$(DSGW_VER_STR)\" + +INCLUDES = @adminutil_inc@ @icu_inc@ @ldapsdk_inc@ @nss_inc@ @nspr_inc@ + +LIBS = @adminutil_lib@ -ladmsslutil@adminutil_ver@ -ladminutil@adminutil_ver@ @icu_lib@ -licui18n -licuuc -licudata @ldapsdk_lib@ -lssldap50 -lprldap50 -lldap50 @nss_lib@ -lssl3 -lnss3 @nspr_lib@ -lnspr4 -lplc4 + +# these are programs which we do not want to link with nss +NEED_SECGLUE = unauth search csearch newentry tutor lang +# these are programs which are not used at runtime but may be useful +# to administer the cookie repository +#CKUTILPROGS= ckput ckget ckdump ckpurge ckdel + +cgibin_PROGRAMS = auth doauth edit domodify dnedit dosearch $(NEED_SECGLUE) $(CKUTILPROGS) + +noinst_PROGRAMS = propmaker +# I need propmaker to build with no libraries - I don't know of any other way to set +# the LIBS for a specific program (no, propmaker_LIBS doesn't work) - LDADD is the +# last thing on the link line before LIBS, so just have it terminate the command +# there and use true to make the LIBS a no-op +propmaker_LDADD = ; true # hackery + +COMMON_SOURCES = htmlout.c htmlparse.c error.c cgiutil.c dsgwutil.c ldaputil.c \ + entrydisplay.c config.c cookie.c emitauth.c emitf.c collate.c vcard.c \ + Versiongw.c utf8compare.c dsgwgetlang.c +if NEED_LDIF +COMMON_SOURCES += line64.c fileurl.c +endif + +unauth_SOURCES = unauth.c $(COMMON_SOURCES) secglue.c +search_SOURCES = search.c $(COMMON_SOURCES) secglue.c +csearch_SOURCES = csearch.c $(COMMON_SOURCES) secglue.c +newentry_SOURCES = newentry.c $(COMMON_SOURCES) secglue.c +tutor_SOURCES = tutor.c $(COMMON_SOURCES) secglue.c +lang_SOURCES = lang.c $(COMMON_SOURCES) secglue.c + +auth_SOURCES = auth.c $(COMMON_SOURCES) +doauth_SOURCES = doauth.c $(COMMON_SOURCES) +edit_SOURCES = edit.c $(COMMON_SOURCES) +domodify_SOURCES = domodify.c $(COMMON_SOURCES) +dnedit_SOURCES = dnedit.c $(COMMON_SOURCES) +dosearch_SOURCES = dosearch.c $(COMMON_SOURCES) + +auth_DEPENDENCIES = resource_bundles + +# ckput_SOURCES = ckput.c $(COMMON_SOURCES) +# ckget_SOURCES = ckget.c $(COMMON_SOURCES) +# ckdump_SOURCES = ckdump.c $(COMMON_SOURCES) +# ckpurge_SOURCES = ckpurge.c $(COMMON_SOURCES) +# ckdel_SOURCES = ckdel.c $(COMMON_SOURCES) + +############## Data Files ################ +dist_html_DATA = \ + html/aim-online.gif html/eduser.html html/newentrytitle.html \ + html/alert.gif html/emptyFrame.html html/organization.gif \ + html/alert.html html/exit1.gif html/orgicon.gif \ + html/auth.html html/forward1.gif html/orgunit.gif \ + html/authroot.html html/greeting.html html/person.gif \ + html/authtitle.html html/group.gif html/right_bottom.gif \ + html/back1.gif html/index1.gif html/right_off.gif \ + html/clear.gif html/index.html html/right_on.gif \ + html/confirm.gif html/left_bottom.gif html/rolodex.gif \ + html/confirm.html html/left_off.gif html/searchtitle.html \ + html/content1.gif html/left_on.gif html/style.css \ + html/country.gif html/maintitle.html html/transparent.gif \ + html/csearchtitle.html html/dc.gif html/message.gif + +dist_pbhtml_DATA = \ + pbhtml/16-conference.gif pbhtml/department.gif pbhtml/person.gif \ + pbhtml/16-person.gif pbhtml/emptyFrame.html pbhtml/phone.html \ + pbhtml/32-alert.gif pbhtml/get_cert.gif pbhtml/phone.js \ + pbhtml/32-conference.gif pbhtml/get_cert_sm.gif pbhtml/pixel.gif \ + pbhtml/32-message.gif pbhtml/index.html pbhtml/report.html \ + pbhtml/32-office.gif pbhtml/intro.html pbhtml/rolodex.gif \ + pbhtml/32-person.gif pbhtml/pbrd.jpg pbhtml/style.css \ + pbhtml/aim-online.gif pbhtml/modify.html pbhtml/tiny_cert.gif \ + pbhtml/alert.html pbhtml/nonemp.html pbhtml/tiny_vcard.gif \ + pbhtml/carded.html pbhtml/nullStringError.html pbhtml/vendor.gif \ + pbhtml/clear.gif pbhtml/office.gif pbhtml/view_vcard.gif \ + pbhtml/conference.gif pbhtml/orgicon.gif pbhtml/view_vcard_sm.gif \ + pbhtml/confirm.html + +dist_config_DATA = \ + config/authPassword.html config/dsgw-l10n.conf \ + config/authSearch.html config/dsgwsearchprefs.conf \ + config/csearchAttr.html config/dsgw.tmpl \ + config/csearchBase.html config/edit-passwd.html \ + config/csearch.html config/list-Anything.html \ + config/csearchMatch.html config/list-Auth.html \ + config/csearchString.html config/list-Domaincomponent.html \ + config/csearchType.html config/list-fa-Groups.html \ + config/display-country.html config/list-fa-People.html \ + config/display-dc.html config/list-Groups.html \ + config/display-dnedit.html config/list-NT-Groups.html \ + config/display-dneditpeople.html config/list-NT-People.html \ + config/display-group.html config/list-Organizations.html \ + config/display-groupun.html config/list-Org-Units.html \ + config/display-ntgroup.html config/list-People.html \ + config/display-ntperson.html config/list-urlsearch.html \ + config/display-org.html \ + config/display-orgperson.html config/newentry.html \ + config/display-orgunit.html config/newentryName.html \ + config/display-person.html config/newentryType.html \ + config/search.html \ + config/dsgwfilter.conf config/searchString.html \ + config/en/dsgwcollate.conf config/en/dsgw-l10n.conf + +dist_pbconfig_DATA = \ + pbconfig/authPassword.html pbconfig/dsgwsearchprefs.conf \ + pbconfig/authSearch.html pbconfig/edit-passwd.html \ + pbconfig/display-orgperson.html pbconfig/list-Auth.html \ + pbconfig/display-orgunit.html pbconfig/list-People.html \ + pbconfig/display-room.html \ + pbconfig/dsgwfilter.conf pbconfig/pb.tmpl + +nodist_context_DATA = setup + +# add more here for localized bundles +nodist_property_DATA = dsgw_root.res + +MOSTLYCLEANFILES = dsgw.conf dsgw_root.res dsgw.properties + +# Resource Bundle Compiler +if WINNT +ICU_GENRB = @icu_bin@/genrb.exe +else +ICU_GENRB = sh genrb_wrapper.sh @icu_bin@ @icu_lib@ +endif + +# The root resource bundle is based on English (en) locale; +# This bundle must be always distributed and there is no need to have +# *_en.properties resource bundle source files. +RESOURCE_BUNDLES_ROOT = dsgw_root.res + +# French resource bundles (for the French localization in the future) +RESOURCE_BUNDLES_FR = dsgw_fr.res + +# German resource bundles (for the German localization in the future) +RESOURCE_BUNDLES_DE = dsgw_de.res + +# By default create only the default root bundle (english). +# Other locales should be created during the localization process. +# RESOURCE_BUNDLES_ROOT must be always compiled. +resource_bundles: $(RESOURCE_BUNDLES_ROOT) + +.PHONY: resource_bundles + +dsgw.properties: ./propmaker dbtdsgw.h + ./propmaker $@ + +dsgw_root.res : dsgw.properties + $(ICU_GENRB) -s. -d. --encoding 8859-1 --package-name dsgw $+ + +%_fr.res : %_fr.properties + $(ICU_GENRB) -s. -d. --encoding 8859-2 --package-name dsgw $+ + +%_de.res : %_de.properties + $(ICU_GENRB) -s. -d. --encoding 8859-2 --package-name dsgw $+ diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..386d87c --- /dev/null +++ b/Makefile.in @@ -0,0 +1,1044 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2006 Red Hat, Inc. +# All rights reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# END COPYRIGHT BLOCK + + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = . +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +cgibin_PROGRAMS = auth$(EXEEXT) doauth$(EXEEXT) edit$(EXEEXT) \ + domodify$(EXEEXT) dnedit$(EXEEXT) dosearch$(EXEEXT) \ + $(am__EXEEXT_1) +noinst_PROGRAMS = propmaker$(EXEEXT) +@NEED_LDIF_TRUE@am__append_1 = line64.c fileurl.c +subdir = . +DIST_COMMON = README $(am__configure_deps) $(dist_config_DATA) \ + $(dist_html_DATA) $(dist_pbconfig_DATA) $(dist_pbhtml_DATA) \ + $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/config-h.in $(srcdir)/setup.in \ + $(top_srcdir)/configure AUTHORS ChangeLog NEWS depcomp \ + install-sh missing +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/httpd.m4 \ + $(top_srcdir)/m4/nspr.m4 $(top_srcdir)/m4/nss.m4 \ + $(top_srcdir)/m4/mozldap.m4 $(top_srcdir)/m4/icu.m4 \ + $(top_srcdir)/m4/adminutil.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno configure.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = setup +am__EXEEXT_1 = unauth$(EXEEXT) search$(EXEEXT) csearch$(EXEEXT) \ + newentry$(EXEEXT) tutor$(EXEEXT) lang$(EXEEXT) +am__installdirs = "$(DESTDIR)$(cgibindir)" "$(DESTDIR)$(configdir)" \ + "$(DESTDIR)$(htmldir)" "$(DESTDIR)$(pbconfigdir)" \ + "$(DESTDIR)$(pbhtmldir)" "$(DESTDIR)$(contextdir)" \ + "$(DESTDIR)$(propertydir)" +cgibinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(cgibin_PROGRAMS) $(noinst_PROGRAMS) +am__auth_SOURCES_DIST = auth.c htmlout.c htmlparse.c error.c cgiutil.c \ + dsgwutil.c ldaputil.c entrydisplay.c config.c cookie.c \ + emitauth.c emitf.c collate.c vcard.c Versiongw.c utf8compare.c \ + dsgwgetlang.c line64.c fileurl.c +@NEED_LDIF_TRUE@am__objects_1 = line64.$(OBJEXT) fileurl.$(OBJEXT) +am__objects_2 = htmlout.$(OBJEXT) htmlparse.$(OBJEXT) error.$(OBJEXT) \ + cgiutil.$(OBJEXT) dsgwutil.$(OBJEXT) ldaputil.$(OBJEXT) \ + entrydisplay.$(OBJEXT) config.$(OBJEXT) cookie.$(OBJEXT) \ + emitauth.$(OBJEXT) emitf.$(OBJEXT) collate.$(OBJEXT) \ + vcard.$(OBJEXT) Versiongw.$(OBJEXT) utf8compare.$(OBJEXT) \ + dsgwgetlang.$(OBJEXT) $(am__objects_1) +am_auth_OBJECTS = auth.$(OBJEXT) $(am__objects_2) +auth_OBJECTS = $(am_auth_OBJECTS) +auth_LDADD = $(LDADD) +am__csearch_SOURCES_DIST = csearch.c htmlout.c htmlparse.c error.c \ + cgiutil.c dsgwutil.c ldaputil.c entrydisplay.c config.c \ + cookie.c emitauth.c emitf.c collate.c vcard.c Versiongw.c \ + utf8compare.c dsgwgetlang.c line64.c fileurl.c secglue.c +am_csearch_OBJECTS = csearch.$(OBJEXT) $(am__objects_2) \ + secglue.$(OBJEXT) +csearch_OBJECTS = $(am_csearch_OBJECTS) +csearch_LDADD = $(LDADD) +am__dnedit_SOURCES_DIST = dnedit.c htmlout.c htmlparse.c error.c \ + cgiutil.c dsgwutil.c ldaputil.c entrydisplay.c config.c \ + cookie.c emitauth.c emitf.c collate.c vcard.c Versiongw.c \ + utf8compare.c dsgwgetlang.c line64.c fileurl.c +am_dnedit_OBJECTS = dnedit.$(OBJEXT) $(am__objects_2) +dnedit_OBJECTS = $(am_dnedit_OBJECTS) +dnedit_LDADD = $(LDADD) +am__doauth_SOURCES_DIST = doauth.c htmlout.c htmlparse.c error.c \ + cgiutil.c dsgwutil.c ldaputil.c entrydisplay.c config.c \ + cookie.c emitauth.c emitf.c collate.c vcard.c Versiongw.c \ + utf8compare.c dsgwgetlang.c line64.c fileurl.c +am_doauth_OBJECTS = doauth.$(OBJEXT) $(am__objects_2) +doauth_OBJECTS = $(am_doauth_OBJECTS) +doauth_LDADD = $(LDADD) +am__domodify_SOURCES_DIST = domodify.c htmlout.c htmlparse.c error.c \ + cgiutil.c dsgwutil.c ldaputil.c entrydisplay.c config.c \ + cookie.c emitauth.c emitf.c collate.c vcard.c Versiongw.c \ + utf8compare.c dsgwgetlang.c line64.c fileurl.c +am_domodify_OBJECTS = domodify.$(OBJEXT) $(am__objects_2) +domodify_OBJECTS = $(am_domodify_OBJECTS) +domodify_LDADD = $(LDADD) +am__dosearch_SOURCES_DIST = dosearch.c htmlout.c htmlparse.c error.c \ + cgiutil.c dsgwutil.c ldaputil.c entrydisplay.c config.c \ + cookie.c emitauth.c emitf.c collate.c vcard.c Versiongw.c \ + utf8compare.c dsgwgetlang.c line64.c fileurl.c +am_dosearch_OBJECTS = dosearch.$(OBJEXT) $(am__objects_2) +dosearch_OBJECTS = $(am_dosearch_OBJECTS) +dosearch_LDADD = $(LDADD) +am__edit_SOURCES_DIST = edit.c htmlout.c htmlparse.c error.c cgiutil.c \ + dsgwutil.c ldaputil.c entrydisplay.c config.c cookie.c \ + emitauth.c emitf.c collate.c vcard.c Versiongw.c utf8compare.c \ + dsgwgetlang.c line64.c fileurl.c +am_edit_OBJECTS = edit.$(OBJEXT) $(am__objects_2) +edit_OBJECTS = $(am_edit_OBJECTS) +edit_LDADD = $(LDADD) +am__lang_SOURCES_DIST = lang.c htmlout.c htmlparse.c error.c cgiutil.c \ + dsgwutil.c ldaputil.c entrydisplay.c config.c cookie.c \ + emitauth.c emitf.c collate.c vcard.c Versiongw.c utf8compare.c \ + dsgwgetlang.c line64.c fileurl.c secglue.c +am_lang_OBJECTS = lang.$(OBJEXT) $(am__objects_2) secglue.$(OBJEXT) +lang_OBJECTS = $(am_lang_OBJECTS) +lang_LDADD = $(LDADD) +am__newentry_SOURCES_DIST = newentry.c htmlout.c htmlparse.c error.c \ + cgiutil.c dsgwutil.c ldaputil.c entrydisplay.c config.c \ + cookie.c emitauth.c emitf.c collate.c vcard.c Versiongw.c \ + utf8compare.c dsgwgetlang.c line64.c fileurl.c secglue.c +am_newentry_OBJECTS = newentry.$(OBJEXT) $(am__objects_2) \ + secglue.$(OBJEXT) +newentry_OBJECTS = $(am_newentry_OBJECTS) +newentry_LDADD = $(LDADD) +propmaker_SOURCES = propmaker.c +propmaker_OBJECTS = propmaker.$(OBJEXT) +propmaker_DEPENDENCIES = ; true +am__search_SOURCES_DIST = search.c htmlout.c htmlparse.c error.c \ + cgiutil.c dsgwutil.c ldaputil.c entrydisplay.c config.c \ + cookie.c emitauth.c emitf.c collate.c vcard.c Versiongw.c \ + utf8compare.c dsgwgetlang.c line64.c fileurl.c secglue.c +am_search_OBJECTS = search.$(OBJEXT) $(am__objects_2) \ + secglue.$(OBJEXT) +search_OBJECTS = $(am_search_OBJECTS) +search_LDADD = $(LDADD) +am__tutor_SOURCES_DIST = tutor.c htmlout.c htmlparse.c error.c \ + cgiutil.c dsgwutil.c ldaputil.c entrydisplay.c config.c \ + cookie.c emitauth.c emitf.c collate.c vcard.c Versiongw.c \ + utf8compare.c dsgwgetlang.c line64.c fileurl.c secglue.c +am_tutor_OBJECTS = tutor.$(OBJEXT) $(am__objects_2) secglue.$(OBJEXT) +tutor_OBJECTS = $(am_tutor_OBJECTS) +tutor_LDADD = $(LDADD) +am__unauth_SOURCES_DIST = unauth.c htmlout.c htmlparse.c error.c \ + cgiutil.c dsgwutil.c ldaputil.c entrydisplay.c config.c \ + cookie.c emitauth.c emitf.c collate.c vcard.c Versiongw.c \ + utf8compare.c dsgwgetlang.c line64.c fileurl.c secglue.c +am_unauth_OBJECTS = unauth.$(OBJEXT) $(am__objects_2) \ + secglue.$(OBJEXT) +unauth_OBJECTS = $(am_unauth_OBJECTS) +unauth_LDADD = $(LDADD) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I. +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(auth_SOURCES) $(csearch_SOURCES) $(dnedit_SOURCES) \ + $(doauth_SOURCES) $(domodify_SOURCES) $(dosearch_SOURCES) \ + $(edit_SOURCES) $(lang_SOURCES) $(newentry_SOURCES) \ + propmaker.c $(search_SOURCES) $(tutor_SOURCES) \ + $(unauth_SOURCES) +DIST_SOURCES = $(am__auth_SOURCES_DIST) $(am__csearch_SOURCES_DIST) \ + $(am__dnedit_SOURCES_DIST) $(am__doauth_SOURCES_DIST) \ + $(am__domodify_SOURCES_DIST) $(am__dosearch_SOURCES_DIST) \ + $(am__edit_SOURCES_DIST) $(am__lang_SOURCES_DIST) \ + $(am__newentry_SOURCES_DIST) propmaker.c \ + $(am__search_SOURCES_DIST) $(am__tutor_SOURCES_DIST) \ + $(am__unauth_SOURCES_DIST) +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +dist_configDATA_INSTALL = $(INSTALL_DATA) +dist_htmlDATA_INSTALL = $(INSTALL_DATA) +dist_pbconfigDATA_INSTALL = $(INSTALL_DATA) +dist_pbhtmlDATA_INSTALL = $(INSTALL_DATA) +nodist_contextDATA_INSTALL = $(INSTALL_DATA) +nodist_propertyDATA_INSTALL = $(INSTALL_DATA) +DATA = $(dist_config_DATA) $(dist_html_DATA) $(dist_pbconfig_DATA) \ + $(dist_pbhtml_DATA) $(nodist_context_DATA) \ + $(nodist_property_DATA) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = -DDSGW_VER_STR=\"$(DSGW_VER_STR)\" +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +HTTPD = @HTTPD@ +ICU_CONFIG = @ICU_CONFIG@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @adminutil_lib@ -ladmsslutil@adminutil_ver@ -ladminutil@adminutil_ver@ @icu_lib@ -licui18n -licuuc -licudata @ldapsdk_lib@ -lssldap50 -lprldap50 -lldap50 @nss_lib@ -lssl3 -lnss3 @nspr_lib@ -lnspr4 -lplc4 +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +NEED_LDIF_FALSE = @NEED_LDIF_FALSE@ +NEED_LDIF_TRUE = @NEED_LDIF_TRUE@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POW_LIB = @POW_LIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WINNT_FALSE = @WINNT_FALSE@ +WINNT_TRUE = @WINNT_TRUE@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_STRIP = @ac_ct_STRIP@ +adminutil_inc = @adminutil_inc@ +adminutil_lib = @adminutil_lib@ +adminutil_ver = @adminutil_ver@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +cgibindir = @cgibindir@ +# config is a bit of a misnomer - these are really configurable templates +configdir = @configdir@ +# the context dir is where the application specific config files go +contextdir = @contextdir@ +cookiedir = @cookiedir@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +icu_bin = @icu_bin@ +icu_inc = @icu_inc@ +icu_lib = @icu_lib@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +ldapsdk_inc = @ldapsdk_inc@ +ldapsdk_lib = @ldapsdk_lib@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +nspr_inc = @nspr_inc@ +nspr_lib = @nspr_lib@ +nss_inc = @nss_inc@ +nss_lib = @nss_lib@ +oldincludedir = @oldincludedir@ +pbconfigdir = @pbconfigdir@ +pbhtmldir = @pbhtmldir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +propertydir = @propertydir@ +sbindir = @sbindir@ +securitydir = @securitydir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ + +# look for included m4 files in the ./m4/ directory +ACLOCAL_AMFLAGS = -I m4 +DSGW_VER_STR := "Fedora-Directory-Gateway/1.0.2" +INCLUDES = @adminutil_inc@ @icu_inc@ @ldapsdk_inc@ @nss_inc@ @nspr_inc@ + +# these are programs which we do not want to link with nss +NEED_SECGLUE = unauth search csearch newentry tutor lang +# I need propmaker to build with no libraries - I don't know of any other way to set +# the LIBS for a specific program (no, propmaker_LIBS doesn't work) - LDADD is the +# last thing on the link line before LIBS, so just have it terminate the command +# there and use true to make the LIBS a no-op +propmaker_LDADD = ; true # hackery +COMMON_SOURCES = htmlout.c htmlparse.c error.c cgiutil.c dsgwutil.c \ + ldaputil.c entrydisplay.c config.c cookie.c emitauth.c emitf.c \ + collate.c vcard.c Versiongw.c utf8compare.c dsgwgetlang.c \ + $(am__append_1) +unauth_SOURCES = unauth.c $(COMMON_SOURCES) secglue.c +search_SOURCES = search.c $(COMMON_SOURCES) secglue.c +csearch_SOURCES = csearch.c $(COMMON_SOURCES) secglue.c +newentry_SOURCES = newentry.c $(COMMON_SOURCES) secglue.c +tutor_SOURCES = tutor.c $(COMMON_SOURCES) secglue.c +lang_SOURCES = lang.c $(COMMON_SOURCES) secglue.c +auth_SOURCES = auth.c $(COMMON_SOURCES) +doauth_SOURCES = doauth.c $(COMMON_SOURCES) +edit_SOURCES = edit.c $(COMMON_SOURCES) +domodify_SOURCES = domodify.c $(COMMON_SOURCES) +dnedit_SOURCES = dnedit.c $(COMMON_SOURCES) +dosearch_SOURCES = dosearch.c $(COMMON_SOURCES) +auth_DEPENDENCIES = resource_bundles + +# ckput_SOURCES = ckput.c $(COMMON_SOURCES) +# ckget_SOURCES = ckget.c $(COMMON_SOURCES) +# ckdump_SOURCES = ckdump.c $(COMMON_SOURCES) +# ckpurge_SOURCES = ckpurge.c $(COMMON_SOURCES) +# ckdel_SOURCES = ckdel.c $(COMMON_SOURCES) + +############## Data Files ################ +dist_html_DATA = \ + html/aim-online.gif html/eduser.html html/newentrytitle.html \ + html/alert.gif html/emptyFrame.html html/organization.gif \ + html/alert.html html/exit1.gif html/orgicon.gif \ + html/auth.html html/forward1.gif html/orgunit.gif \ + html/authroot.html html/greeting.html html/person.gif \ + html/authtitle.html html/group.gif html/right_bottom.gif \ + html/back1.gif html/index1.gif html/right_off.gif \ + html/clear.gif html/index.html html/right_on.gif \ + html/confirm.gif html/left_bottom.gif html/rolodex.gif \ + html/confirm.html html/left_off.gif html/searchtitle.html \ + html/content1.gif html/left_on.gif html/style.css \ + html/country.gif html/maintitle.html html/transparent.gif \ + html/csearchtitle.html html/dc.gif html/message.gif + +dist_pbhtml_DATA = \ + pbhtml/16-conference.gif pbhtml/department.gif pbhtml/person.gif \ + pbhtml/16-person.gif pbhtml/emptyFrame.html pbhtml/phone.html \ + pbhtml/32-alert.gif pbhtml/get_cert.gif pbhtml/phone.js \ + pbhtml/32-conference.gif pbhtml/get_cert_sm.gif pbhtml/pixel.gif \ + pbhtml/32-message.gif pbhtml/index.html pbhtml/report.html \ + pbhtml/32-office.gif pbhtml/intro.html pbhtml/rolodex.gif \ + pbhtml/32-person.gif pbhtml/pbrd.jpg pbhtml/style.css \ + pbhtml/aim-online.gif pbhtml/modify.html pbhtml/tiny_cert.gif \ + pbhtml/alert.html pbhtml/nonemp.html pbhtml/tiny_vcard.gif \ + pbhtml/carded.html pbhtml/nullStringError.html pbhtml/vendor.gif \ + pbhtml/clear.gif pbhtml/office.gif pbhtml/view_vcard.gif \ + pbhtml/conference.gif pbhtml/orgicon.gif pbhtml/view_vcard_sm.gif \ + pbhtml/confirm.html + +dist_config_DATA = \ + config/authPassword.html config/dsgw-l10n.conf \ + config/authSearch.html config/dsgwsearchprefs.conf \ + config/csearchAttr.html config/dsgw.tmpl \ + config/csearchBase.html config/edit-passwd.html \ + config/csearch.html config/list-Anything.html \ + config/csearchMatch.html config/list-Auth.html \ + config/csearchString.html config/list-Domaincomponent.html \ + config/csearchType.html config/list-fa-Groups.html \ + config/display-country.html config/list-fa-People.html \ + config/display-dc.html config/list-Groups.html \ + config/display-dnedit.html config/list-NT-Groups.html \ + config/display-dneditpeople.html config/list-NT-People.html \ + config/display-group.html config/list-Organizations.html \ + config/display-groupun.html config/list-Org-Units.html \ + config/display-ntgroup.html config/list-People.html \ + config/display-ntperson.html config/list-urlsearch.html \ + config/display-org.html \ + config/display-orgperson.html config/newentry.html \ + config/display-orgunit.html config/newentryName.html \ + config/display-person.html config/newentryType.html \ + config/search.html \ + config/dsgwfilter.conf config/searchString.html \ + config/en/dsgwcollate.conf config/en/dsgw-l10n.conf + +dist_pbconfig_DATA = \ + pbconfig/authPassword.html pbconfig/dsgwsearchprefs.conf \ + pbconfig/authSearch.html pbconfig/edit-passwd.html \ + pbconfig/display-orgperson.html pbconfig/list-Auth.html \ + pbconfig/display-orgunit.html pbconfig/list-People.html \ + pbconfig/display-room.html \ + pbconfig/dsgwfilter.conf pbconfig/pb.tmpl + +nodist_context_DATA = setup + +# add more here for localized bundles +nodist_property_DATA = dsgw_root.res +MOSTLYCLEANFILES = dsgw.conf dsgw_root.res dsgw.properties +@WINNT_FALSE@ICU_GENRB = sh genrb_wrapper.sh @icu_bin@ @icu_lib@ + +# Resource Bundle Compiler +@WINNT_TRUE@ICU_GENRB = @icu_bin@/genrb.exe + +# The root resource bundle is based on English (en) locale; +# This bundle must be always distributed and there is no need to have +# *_en.properties resource bundle source files. +RESOURCE_BUNDLES_ROOT = dsgw_root.res + +# French resource bundles (for the French localization in the future) +RESOURCE_BUNDLES_FR = dsgw_fr.res + +# German resource bundles (for the German localization in the future) +RESOURCE_BUNDLES_DE = dsgw_de.res +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .c .o .obj +am--refresh: + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ + cd $(srcdir) && $(AUTOMAKE) --foreign \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.h: stamp-h1 + @if test ! -f $@; then \ + rm -f stamp-h1; \ + $(MAKE) stamp-h1; \ + else :; fi + +stamp-h1: $(srcdir)/config-h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config-h.in: $(am__configure_deps) + cd $(top_srcdir) && $(AUTOHEADER) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 +setup: $(top_builddir)/config.status $(srcdir)/setup.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +install-cgibinPROGRAMS: $(cgibin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(cgibindir)" || $(mkdir_p) "$(DESTDIR)$(cgibindir)" + @list='$(cgibin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(cgibinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(cgibindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(cgibinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(cgibindir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-cgibinPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(cgibin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(cgibindir)/$$f'"; \ + rm -f "$(DESTDIR)$(cgibindir)/$$f"; \ + done + +clean-cgibinPROGRAMS: + -test -z "$(cgibin_PROGRAMS)" || rm -f $(cgibin_PROGRAMS) + +clean-noinstPROGRAMS: + -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) +auth$(EXEEXT): $(auth_OBJECTS) $(auth_DEPENDENCIES) + @rm -f auth$(EXEEXT) + $(LINK) $(auth_LDFLAGS) $(auth_OBJECTS) $(auth_LDADD) $(LIBS) +csearch$(EXEEXT): $(csearch_OBJECTS) $(csearch_DEPENDENCIES) + @rm -f csearch$(EXEEXT) + $(LINK) $(csearch_LDFLAGS) $(csearch_OBJECTS) $(csearch_LDADD) $(LIBS) +dnedit$(EXEEXT): $(dnedit_OBJECTS) $(dnedit_DEPENDENCIES) + @rm -f dnedit$(EXEEXT) + $(LINK) $(dnedit_LDFLAGS) $(dnedit_OBJECTS) $(dnedit_LDADD) $(LIBS) +doauth$(EXEEXT): $(doauth_OBJECTS) $(doauth_DEPENDENCIES) + @rm -f doauth$(EXEEXT) + $(LINK) $(doauth_LDFLAGS) $(doauth_OBJECTS) $(doauth_LDADD) $(LIBS) +domodify$(EXEEXT): $(domodify_OBJECTS) $(domodify_DEPENDENCIES) + @rm -f domodify$(EXEEXT) + $(LINK) $(domodify_LDFLAGS) $(domodify_OBJECTS) $(domodify_LDADD) $(LIBS) +dosearch$(EXEEXT): $(dosearch_OBJECTS) $(dosearch_DEPENDENCIES) + @rm -f dosearch$(EXEEXT) + $(LINK) $(dosearch_LDFLAGS) $(dosearch_OBJECTS) $(dosearch_LDADD) $(LIBS) +edit$(EXEEXT): $(edit_OBJECTS) $(edit_DEPENDENCIES) + @rm -f edit$(EXEEXT) + $(LINK) $(edit_LDFLAGS) $(edit_OBJECTS) $(edit_LDADD) $(LIBS) +lang$(EXEEXT): $(lang_OBJECTS) $(lang_DEPENDENCIES) + @rm -f lang$(EXEEXT) + $(LINK) $(lang_LDFLAGS) $(lang_OBJECTS) $(lang_LDADD) $(LIBS) +newentry$(EXEEXT): $(newentry_OBJECTS) $(newentry_DEPENDENCIES) + @rm -f newentry$(EXEEXT) + $(LINK) $(newentry_LDFLAGS) $(newentry_OBJECTS) $(newentry_LDADD) $(LIBS) +propmaker$(EXEEXT): $(propmaker_OBJECTS) $(propmaker_DEPENDENCIES) + @rm -f propmaker$(EXEEXT) + $(LINK) $(propmaker_LDFLAGS) $(propmaker_OBJECTS) $(propmaker_LDADD) $(LIBS) +search$(EXEEXT): $(search_OBJECTS) $(search_DEPENDENCIES) + @rm -f search$(EXEEXT) + $(LINK) $(search_LDFLAGS) $(search_OBJECTS) $(search_LDADD) $(LIBS) +tutor$(EXEEXT): $(tutor_OBJECTS) $(tutor_DEPENDENCIES) + @rm -f tutor$(EXEEXT) + $(LINK) $(tutor_LDFLAGS) $(tutor_OBJECTS) $(tutor_LDADD) $(LIBS) +unauth$(EXEEXT): $(unauth_OBJECTS) $(unauth_DEPENDENCIES) + @rm -f unauth$(EXEEXT) + $(LINK) $(unauth_LDFLAGS) $(unauth_OBJECTS) $(unauth_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Versiongw.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auth.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cgiutil.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/collate.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/config.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cookie.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/csearch.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnedit.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/doauth.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/domodify.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dosearch.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsgwgetlang.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsgwutil.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edit.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/emitauth.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/emitf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/entrydisplay.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fileurl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htmlout.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htmlparse.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lang.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ldaputil.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/line64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/newentry.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/propmaker.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/search.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/secglue.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tutor.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unauth.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utf8compare.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vcard.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` +uninstall-info-am: +install-dist_configDATA: $(dist_config_DATA) + @$(NORMAL_INSTALL) + test -z "$(configdir)" || $(mkdir_p) "$(DESTDIR)$(configdir)" + @list='$(dist_config_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(dist_configDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(configdir)/$$f'"; \ + $(dist_configDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(configdir)/$$f"; \ + done + +uninstall-dist_configDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_config_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(configdir)/$$f'"; \ + rm -f "$(DESTDIR)$(configdir)/$$f"; \ + done +install-dist_htmlDATA: $(dist_html_DATA) + @$(NORMAL_INSTALL) + test -z "$(htmldir)" || $(mkdir_p) "$(DESTDIR)$(htmldir)" + @list='$(dist_html_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(dist_htmlDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \ + $(dist_htmlDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \ + done + +uninstall-dist_htmlDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_html_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(htmldir)/$$f'"; \ + rm -f "$(DESTDIR)$(htmldir)/$$f"; \ + done +install-dist_pbconfigDATA: $(dist_pbconfig_DATA) + @$(NORMAL_INSTALL) + test -z "$(pbconfigdir)" || $(mkdir_p) "$(DESTDIR)$(pbconfigdir)" + @list='$(dist_pbconfig_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(dist_pbconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pbconfigdir)/$$f'"; \ + $(dist_pbconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pbconfigdir)/$$f"; \ + done + +uninstall-dist_pbconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_pbconfig_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pbconfigdir)/$$f'"; \ + rm -f "$(DESTDIR)$(pbconfigdir)/$$f"; \ + done +install-dist_pbhtmlDATA: $(dist_pbhtml_DATA) + @$(NORMAL_INSTALL) + test -z "$(pbhtmldir)" || $(mkdir_p) "$(DESTDIR)$(pbhtmldir)" + @list='$(dist_pbhtml_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(dist_pbhtmlDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pbhtmldir)/$$f'"; \ + $(dist_pbhtmlDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pbhtmldir)/$$f"; \ + done + +uninstall-dist_pbhtmlDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_pbhtml_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pbhtmldir)/$$f'"; \ + rm -f "$(DESTDIR)$(pbhtmldir)/$$f"; \ + done +install-nodist_contextDATA: $(nodist_context_DATA) + @$(NORMAL_INSTALL) + test -z "$(contextdir)" || $(mkdir_p) "$(DESTDIR)$(contextdir)" + @list='$(nodist_context_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(nodist_contextDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(contextdir)/$$f'"; \ + $(nodist_contextDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(contextdir)/$$f"; \ + done + +uninstall-nodist_contextDATA: + @$(NORMAL_UNINSTALL) + @list='$(nodist_context_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(contextdir)/$$f'"; \ + rm -f "$(DESTDIR)$(contextdir)/$$f"; \ + done +install-nodist_propertyDATA: $(nodist_property_DATA) + @$(NORMAL_INSTALL) + test -z "$(propertydir)" || $(mkdir_p) "$(DESTDIR)$(propertydir)" + @list='$(nodist_property_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(nodist_propertyDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(propertydir)/$$f'"; \ + $(nodist_propertyDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(propertydir)/$$f"; \ + done + +uninstall-nodist_propertyDATA: + @$(NORMAL_UNINSTALL) + @list='$(nodist_property_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(propertydir)/$$f'"; \ + rm -f "$(DESTDIR)$(propertydir)/$$f"; \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) config-h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) config-h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) config-h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) config-h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + $(am__remove_distdir) + mkdir $(distdir) + $(mkdir_p) $(distdir)/. $(distdir)/config $(distdir)/config/en $(distdir)/html $(distdir)/m4 $(distdir)/pbconfig $(distdir)/pbhtml + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r $(distdir) +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + +dist dist-all: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && cd $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' +distuninstallcheck: + @cd $(distuninstallcheck_dir) \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) $(DATA) config.h +installdirs: + for dir in "$(DESTDIR)$(cgibindir)" "$(DESTDIR)$(configdir)" "$(DESTDIR)$(htmldir)" "$(DESTDIR)$(pbconfigdir)" "$(DESTDIR)$(pbhtmldir)" "$(DESTDIR)$(contextdir)" "$(DESTDIR)$(propertydir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-cgibinPROGRAMS clean-generic clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-hdr distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-cgibinPROGRAMS install-dist_configDATA \ + install-dist_htmlDATA install-dist_pbconfigDATA \ + install-dist_pbhtmlDATA install-nodist_contextDATA \ + install-nodist_propertyDATA + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-cgibinPROGRAMS uninstall-dist_configDATA \ + uninstall-dist_htmlDATA uninstall-dist_pbconfigDATA \ + uninstall-dist_pbhtmlDATA uninstall-info-am \ + uninstall-nodist_contextDATA uninstall-nodist_propertyDATA + +.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ + clean-cgibinPROGRAMS clean-generic clean-noinstPROGRAMS ctags \ + dist dist-all dist-bzip2 dist-gzip dist-shar dist-tarZ \ + dist-zip distcheck distclean distclean-compile \ + distclean-generic distclean-hdr distclean-tags distcleancheck \ + distdir distuninstallcheck dvi dvi-am html html-am info \ + info-am install install-am install-cgibinPROGRAMS install-data \ + install-data-am install-dist_configDATA install-dist_htmlDATA \ + install-dist_pbconfigDATA install-dist_pbhtmlDATA install-exec \ + install-exec-am install-info install-info-am install-man \ + install-nodist_contextDATA install-nodist_propertyDATA \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-cgibinPROGRAMS \ + uninstall-dist_configDATA uninstall-dist_htmlDATA \ + uninstall-dist_pbconfigDATA uninstall-dist_pbhtmlDATA \ + uninstall-info-am uninstall-nodist_contextDATA \ + uninstall-nodist_propertyDATA + + +# By default create only the default root bundle (english). +# Other locales should be created during the localization process. +# RESOURCE_BUNDLES_ROOT must be always compiled. +resource_bundles: $(RESOURCE_BUNDLES_ROOT) + +.PHONY: resource_bundles + +dsgw.properties: ./propmaker dbtdsgw.h + ./propmaker $@ + +dsgw_root.res : dsgw.properties + $(ICU_GENRB) -s. -d. --encoding 8859-1 --package-name dsgw $+ + +%_fr.res : %_fr.properties + $(ICU_GENRB) -s. -d. --encoding 8859-2 --package-name dsgw $+ + +%_de.res : %_de.properties + $(ICU_GENRB) -s. -d. --encoding 8859-2 --package-name dsgw $+ +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/NEWS diff --git a/README b/README new file mode 100644 index 0000000..5084b7e --- /dev/null +++ b/README @@ -0,0 +1,20 @@ + +Developers: +* Building - standard autotools - Do not edit configure or Makefile or Makefile.in - + Instead, change Makefile.am or configure.ac, then run autoreconf -fvi - do not + attempt to run aclocal or automake or autoconf - only use autoreconf -fvi - this + also applies to the files in m4/ + +* Build process +0. Properties are in dbtdsgw.h - this file is used to generate the resource bundles + and is also used in the source code to refer to the resource key +1. build propmaker +2. use propmaker to parse dbtdsgw.h and generate dsgw.properties +3. use genrb_wrapper.sh to "compile" dsgw.properties into dsgw_root.res +4. build the executable CGI programs +5. For a make install, copy the files to their desired directories - if you just + want to see how the files with be laid out in the file system, use + make DESTDIR=built/ install # create destination directory structure under built/ + OR + make DESTDIR=/tmp/dsgwbuild/ # create dest dir under /tmp/dsgwbuild/ + rpmbuild will typically do something like the latter diff --git a/Versiongw.c b/Versiongw.c new file mode 100644 index 0000000..659a3e0 --- /dev/null +++ b/Versiongw.c @@ -0,0 +1,39 @@ +/** --- BEGIN COPYRIGHT BLOCK --- + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + --- END COPYRIGHT BLOCK --- */ + +char *Versionstr = DSGW_VER_STR; diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 0000000..aef181a --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,850 @@ +# generated automatically by aclocal 1.9.6 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION so it can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], + [AM_AUTOMAKE_VERSION([1.9.6])]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 7 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE]) +AC_SUBST([$1_FALSE]) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH]) +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +#serial 3 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 12 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.58])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +]) +]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $1 | $1:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"$am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_MKDIR_P +# --------------- +# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. +# +# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories +# created by `make install' are always world readable, even if the +# installer happens to have an overly restrictive umask (e.g. 077). +# This was a mistake. There are at least two reasons why we must not +# use `-m 0755': +# - it causes special bits like SGID to be ignored, +# - it may be too restrictive (some setups expect 775 directories). +# +# Do not use -m 0755 and let people choose whatever they expect by +# setting umask. +# +# We cannot accept any implementation of `mkdir' that recognizes `-p'. +# Some implementations (such as Solaris 8's) are not thread-safe: if a +# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' +# concurrently, both version can detect that a/ is missing, but only +# one can create it and the other will error out. Consequently we +# restrict ourselves to GNU make (using the --version option ensures +# this.) +AC_DEFUN([AM_PROG_MKDIR_P], +[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # We used to keeping the `.' as first argument, in order to + # allow $(mkdir_p) to be used without argument. As in + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. However this is wrong + # for two reasons: + # 1. if the package is installed by a user who cannot write `.' + # make install will fail, + # 2. the above comment should most certainly read + # $(mkdir_p) $(DESTDIR)$(somedir) + # so it does not work when $(somedir) is undefined and + # $(DESTDIR) is not. + # To support the latter case, we have to write + # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), + # so the `.' trick is pointless. + mkdir_p='mkdir -p --' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +fi +AC_SUBST([mkdir_p])]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + diff --git a/auth.c b/auth.c new file mode 100644 index 0000000..a2f4156 --- /dev/null +++ b/auth.c @@ -0,0 +1,148 @@ +/** --- BEGIN COPYRIGHT BLOCK --- + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + --- END COPYRIGHT BLOCK --- */ +/* + * auth.c -- CGI authentication form generator -- HTTP gateway + */ + +#include "dsgw.h" +#include "dbtdsgw.h" + +static void post_request(); +static void get_request(char *binddn); + +int main( + int argc, + char **argv +#ifdef DSGW_DEBUG + ,char *env[] +#endif +) { + int reqmethod; + char *binddn = NULL; + char *qs = NULL; + + if (( qs = getenv( "QUERY_STRING" )) != NULL && *qs != '\0' ) { + /* parse the query string: */ + auto char *p, *iter = NULL; + qs = dsgw_ch_strdup( qs ); + for ( p = ldap_utf8strtok_r( qs, "&", &iter ); p != NULL; + p = ldap_utf8strtok_r( NULL, "&", &iter )) { + + /*Get the context.*/ + if ( !strncasecmp( p, "context=", 8 )) { + context = dsgw_ch_strdup( p + 8 ); + dsgw_form_unescape( context ); + continue; + } + + /*Get the dn*/ + if ( !strncasecmp( p, "dn=", 3 )) { + binddn = dsgw_ch_strdup( p + 3 ); + dsgw_form_unescape( binddn ); + continue; + } + } + free( qs ); qs = NULL; + } + + reqmethod = dsgw_init( argc, argv, DSGW_METHOD_POST | DSGW_METHOD_GET ); + +#ifdef DSGW_DEBUG + dsgw_logstringarray( "env", env ); +#endif + + if ( reqmethod == DSGW_METHOD_POST ) { + post_request(); + } else { + get_request(binddn); + } + + exit( 0 ); +} + +static void +get_request(char *binddn) +{ + dsgw_send_header(); + + if ( binddn != NULL ) { + if ( !strcmp( binddn, MGRDNSTR )) { + if ( gc->gc_rootdn == NULL ) { + dsgw_error( DSGW_ERR_NO_MGRDN, + XP_GetClientStr (DBT_noDirMgrIsDefined_), + DSGW_ERROPT_EXIT, 0, NULL ); + } + binddn = dsgw_ch_strdup( gc->gc_rootdn ); + } else if ( *binddn == '\0' ) { + binddn = NULL; + } else { + binddn = dsgw_ch_strdup( binddn ); + dsgw_form_unescape( binddn ); + } + } + dsgw_emit_auth_form( binddn ); + if ( binddn != NULL ) { + free( binddn ); + } +} + + + +static void +post_request() +{ + char *binddn = NULL; + char *dorootbind = NULL; + + dsgw_send_header(); + /* + * If the "authasrootdn" CGI variable is present and has the value + * "true" then the user clicked on the "authenticate as directory + * manager" button. In that case, try to bind as the root dn given + * in the dsgw config file. + */ + dorootbind = dsgw_get_cgi_var( "authasrootdn", DSGW_CGIVAR_OPTIONAL ); + if ( dorootbind != NULL && !strcasecmp( dorootbind, "true" )) { + binddn = dsgw_ch_strdup( gc->gc_rootdn ); + } else { + binddn = dsgw_get_escaped_cgi_var( "escapedbinddn", "binddn", + DSGW_CGIVAR_OPTIONAL ); + } + + dsgw_emit_auth_form( binddn ); +} diff --git a/build_RHATdsgw_pkg b/build_RHATdsgw_pkg new file mode 100755 index 0000000..b8d0abf --- /dev/null +++ b/build_RHATdsgw_pkg @@ -0,0 +1,222 @@ +#!/bin/sh +# --- BEGIN COPYRIGHT BLOCK --- +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# (C) 2006 Red Hat, Inc. +# All rights reserved. +# --- END COPYRIGHT BLOCK --- + +# Usage: $0 [ -debug ] +# if exist, build debug version +debug_opt=full +if [ "$1" = "" ]; then + debug_opt=optimize +fi + +# Always switch into the base directory of this +# shell script prior to executing it so that all +# of its output is written to this directory +cd `dirname $0` + +# This script may ONLY be run on Solaris! +OS=`uname` +if [ ${OS} != "SunOS" ]; then + echo "The '$0' script is ONLY executable on a 'Solaris' machine!" + exit 255 +fi + +# define platform-specific NSPR variables unique to this script +BITSIZE=32-bit +PACKAGE=RHATdsgw +PLATFORM=sparc + +# initialize environment variables for this script + +# set LD_LIBRARY_PATH for Solaris +LD_LIBRARY_PATH=/opt/SUNWspro/lib:/opt/lib:/usr/local/lib:/usr/lib:/lib:${LD_LIBRARY_PATH} +export LD_LIBRARY_PATH + +# set PATH for Solaris +PATH=/opt/SUNWspro/bin:/opt/bin:/usr/local/bin:/tools/ns/bin:/usr/sbin:/usr/bin:/bin:${PATH} +export PATH + +# define the remaining NSS variables for this script +SRC_PACKAGE=RHATdsgw +LINUX_PACKAGE=dsgw +VERSION=1.0 +RELEASE=1 +PKG_HOME=`pwd` +SPEC_FILENAME=${LINUX_PACKAGE}-${VERSION}.spec +SGTARS_HOSTNAME=tsunami.sfbay.redhat.com +SGTARS_REPOSITORY=/share/builds/sandbox/dirsec/7.2.0/sgtars +SGTARS_SOURCE_TARBALL=${SRC_PACKAGE}-${VERSION}-${RELEASE}.src.tar.gz +DEFAULT_SGTARS_URL="http://${SGTARS_HOSTNAME}${SGTARS_REPOSITORY}/${SGTARS_SOURCE_TARBALL}" + +# define subroutines for this script +usage() { + echo + echo "Usage: $0 [ -debug ]" + echo + echo " NOTE: This script first checks for the existence" + echo " of a 'SGTARS' directory AND" + echo " a 'SGTARS/${SGTARS_SOURCE_TARBALL}' package" + echo " in the current directory;" + echo " if present, then the Solaris PKGS will be" + echo " created using the source code and spec file" + echo " obtained from this package." + echo + echo " If this directory and/or package are NOT present," + echo " then this script uses the contents of the" + echo " 'SGTARS_URL' environment variable" + echo " (which should contain a complete URL" + echo " ending in '${SGTARS_SOURCE_TARBALL}')." + echo + echo " If the 'SGTARS_URL' environment variable is left" + echo " undefined, this script obtains the Source tarball" + echo " from the default URL:" + echo + echo " 'http://${SGTARS_HOSTNAME}" + echo " ${SGTARS_REPOSITORY}" + echo " /${SGTARS_SOURCE_TARBALL}'." + echo +} + +mkdirs() { + for d in "$@" ; do + if [ -d $d ]; then + mv $d $d.deleted + rm -rf $d.deleted & + fi + mkdir -p $d + done +} + +# check the number of arguments supplied to this script +if [ $# -gt 1 ]; then + usage + exit 255 +fi + +# remove any old PKG directories +echo "Removing any old PKG directories . . ." +if [ -d ${PKG_HOME}/BUILD ]; then + rm -rf ${PKG_HOME}/BUILD +fi +if [ -d ${PKG_HOME}/PKGMAPS ]; then + rm -rf ${PKG_HOME}/PKGMAPS +fi +if [ -d ${PKG_HOME}/PKGS/${PLATFORM} ]; then + rm -rf ${PKG_HOME}/PKGS/${PLATFORM} +fi +if [ -d ${PKG_HOME}/SOURCES ]; then + rm -rf ${PKG_HOME}/SOURCES +fi +if [ -d ${PKG_HOME}/SPECS ]; then + rm -rf ${PKG_HOME}/SPECS +fi +echo "Finished." + +echo "Changing current working directory to ${PKG_HOME}." +cd ${PKG_HOME} + +# create new PKG directories +echo "Creating PKG directories . . ." +mkdirs BUILD PKGMAPS +mkdirs PKGMAPS/copyright +mkdirs PKGMAPS/depend +mkdirs PKGMAPS/pkginfo +mkdirs PKGMAPS/proto +mkdirs PKGMAPS/scripts +if [ ! -d PKGS ]; then + mkdirs PKGS +fi +mkdirs PKGS/${PLATFORM} +mkdirs SOURCES SPECS +if [ ! -d SPKGS ]; then + mkdirs SPKGS +fi +echo "Finished." + +# populate SOURCES and SPECS directories from Source tarball +echo "Extracting source and spec file from Source tarball . . . " +if [ -d SGTARS ] && + [ -f "SGTARS/${SGTARS_SOURCE_TARBALL}" ] +then + # pull source and spec file from Source tarball recently created by Linux + gtar -zxvf SGTARS/${SGTARS_SOURCE_TARBALL} -C ${PKG_HOME} +elif [ ! -z "${SGTARS_URL}" ]; then + # retrieve Source tarball from location specified by + # the SGTARS_URL environment variable + wget -q ${SGTARS_URL} + if [ $? -ne 0 ]; then + usage + exit 255 + fi + gtar -zxvf ${SGTARS_SOURCE_TARBALL} + rm -rf ${SGTARS_SOURCE_TARBALL} +else + # retrieve Source tarball from location specified by + # the DEFAULT_SGTARS_URL environment variable + wget -q ${DEFAULT_SGTARS_URL} + if [ $? -ne 0 ]; then + usage + exit 255 + fi + gtar -zxvf ${SGTARS_SOURCE_TARBALL} + rm -rf ${SGTARS_SOURCE_TARBALL} +fi +echo "done." + +# build the ${BITSIZE} PKGS and Source PKGS as DaTaStReAm packages +cd ${PKG_HOME} +echo "Executing ${BITSIZE} pkgbuild of ${SPEC_FILENAME} file . . . " +if [ ! -f SPKGS/${SRC_PACKAGE}-src-${VERSION}-${RELEASE}.src.pkg ]; then + pkgbuild --pkgformat=datastream --define "brand fedora" --define "_topdir ${PKG_HOME}" --define="build_debug $debug_opt" --define "optflags -xs -xO4" --define "_target ${PLATFORM}" -ba ${PKG_HOME}/SPECS/${SPEC_FILENAME} +else + pkgbuild --pkgformat=datastream --define "brand fedora" --define "_topdir ${PKG_HOME}" --define="build_debug $debug_opt" --define "optflags -xs -xO4" --define "_target ${PLATFORM}" -bb ${PKG_HOME}/SPECS/${SPEC_FILENAME} +fi +echo "Finished doing ${BITSIZE} pkgbuild of ${SPEC_FILENAME} file." + +# rename the ${BITSIZE} DaTaStReAm packages +echo "Renaming ${BITSIZE} PKGS files . . . " +mv PKGS/${PACKAGE}-${VERSION}.${PLATFORM}.pkg PKGS/${PLATFORM}/${PACKAGE}-${VERSION}-${RELEASE}.${PLATFORM}.pkg +mv PKGS/${PACKAGE}-devel-${VERSION}.${PLATFORM}.pkg PKGS/${PLATFORM}/${PACKAGE}-devel-${VERSION}-${RELEASE}.${PLATFORM}.pkg +echo "Finished renaming ${BITSIZE} PKGS files." +if [ ! -f SPKGS/${SRC_PACKAGE}-src-${VERSION}-${RELEASE}.src.pkg ]; then + echo "Renaming SPKGS files . . . " + mv SPKGS/${PACKAGE}-src-${VERSION}.src.pkg SPKGS/${SRC_PACKAGE}-src-${VERSION}-${RELEASE}.src.pkg + echo "Finished renaming SPKGS files." +fi + +echo "Removing SPECS directory." +if [ -d ${PKG_HOME}/SPECS ]; then + rm -rf ${PKG_HOME}/SPECS +fi + +echo "Removing SOURCES directory." +if [ -d ${PKG_HOME}/SOURCES ]; then + rm -rf ${PKG_HOME}/SOURCES +fi + +echo "Removing PKGMAPS directory." +if [ -d ${PKG_HOME}/PKGMAPS ]; then + rm -rf ${PKG_HOME}/PKGMAPS +fi + +echo "Removing BUILD directory." +if [ -d ${PKG_HOME}/BUILD ]; then + rm -rf ${PKG_HOME}/BUILD +fi diff --git a/build_RHATdsgwx_pkg b/build_RHATdsgwx_pkg new file mode 100755 index 0000000..bf6d512 --- /dev/null +++ b/build_RHATdsgwx_pkg @@ -0,0 +1,223 @@ +#!/bin/sh +# --- BEGIN COPYRIGHT BLOCK --- +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# (C) 2006 Red Hat, Inc. +# All rights reserved. +# --- END COPYRIGHT BLOCK --- + +# Usage: $0 [ -debug ] +# if exist, build debug version +debug_opt=full +if [ "$1" = "" ]; then + debug_opt=optimize +fi + +# Always switch into the base directory of this +# shell script prior to executing it so that all +# of its output is written to this directory +cd `dirname $0` + +# This script may ONLY be run on Solaris! +OS=`uname` +if [ ${OS} != "SunOS" ]; then + echo "The '$0' script is ONLY executable on a 'Solaris' machine!" + exit 255 +fi + +# define platform-specific NSPR variables unique to this script +BITSIZE=64-bit +PACKAGE=RHATdsgwx +PLATFORM=sparcv9 + +# initialize environment variables for this script + +# set LD_LIBRARY_PATH for Solaris +LD_LIBRARY_PATH=/opt/SUNWspro/lib/v9:/opt/lib:/usr/local/lib:/usr/lib/sparcv9:/lib:${LD_LIBRARY_PATH} +export LD_LIBRARY_PATH + +# set PATH for Solaris +PATH=/opt/SUNWspro/bin:/opt/bin:/usr/local/bin:/tools/ns/bin:/usr/sbin:/usr/bin:/bin:${PATH} +export PATH + +# define the remaining NSS variables for this script +SRC_PACKAGE=RHATdsgw +LINUX_PACKAGE=dsgw +VERSION=1.0 +RELEASE=1 +PKG_HOME=`pwd` +SPEC_FILENAME=${LINUX_PACKAGE}-${VERSION}.spec +SGTARS_HOSTNAME=tsunami.sfbay.redhat.com +SGTARS_REPOSITORY=/share/builds/sandbox/dirsec/7.2.0/sgtars +SGTARS_SOURCE_TARBALL=${SRC_PACKAGE}-${VERSION}-${RELEASE}.src.tar.gz +DEFAULT_SGTARS_URL="http://${SGTARS_HOSTNAME}${SGTARS_REPOSITORY}/${SGTARS_SOURCE_TARBALL}" + +# define subroutines for this script +usage() { + echo + echo "Usage: $0 [ -debug ]" + echo + echo " NOTE: This script first checks for the existence" + echo " of a 'SGTARS' directory AND" + echo " a 'SGTARS/${SGTARS_SOURCE_TARBALL}' package" + echo " in the current directory;" + echo " if present, then the Solaris PKGS will be" + echo " created using the source code and spec file" + echo " obtained from this package." + echo + echo " If this directory and/or package are NOT present," + echo " then this script uses the contents of the" + echo " 'SGTARS_URL' environment variable" + echo " (which should contain a complete URL" + echo " ending in '${SGTARS_SOURCE_TARBALL}')." + echo + echo " If the 'SGTARS_URL' environment variable is left" + echo " undefined, this script obtains the Source tarball" + echo " from the default URL:" + echo + echo " 'http://${SGTARS_HOSTNAME}" + echo " ${SGTARS_REPOSITORY}" + echo " /${SGTARS_SOURCE_TARBALL}'." + echo +} + +mkdirs() { + for d in "$@" ; do + if [ -d $d ]; then + mv $d $d.deleted + rm -rf $d.deleted & + fi + mkdir -p $d + done +} + +# check the number of arguments supplied to this script +if [ $# -gt 1 ]; then + usage + exit 255 +fi + +# remove any old PKG directories +echo "Removing any old PKG directories . . ." +if [ -d ${PKG_HOME}/BUILD ]; then + rm -rf ${PKG_HOME}/BUILD +fi +if [ -d ${PKG_HOME}/PKGMAPS ]; then + rm -rf ${PKG_HOME}/PKGMAPS +fi +if [ -d ${PKG_HOME}/PKGS/${PLATFORM} ]; then + rm -rf ${PKG_HOME}/PKGS/${PLATFORM} +fi +if [ -d ${PKG_HOME}/SOURCES ]; then + rm -rf ${PKG_HOME}/SOURCES +fi +if [ -d ${PKG_HOME}/SPECS ]; then + rm -rf ${PKG_HOME}/SPECS +fi +echo "Finished." + +echo "Changing current working directory to ${PKG_HOME}." +cd ${PKG_HOME} + +# create new PKG directories +echo "Creating PKG directories . . ." +mkdirs BUILD PKGMAPS +mkdirs PKGMAPS/copyright +mkdirs PKGMAPS/depend +mkdirs PKGMAPS/pkginfo +mkdirs PKGMAPS/proto +mkdirs PKGMAPS/scripts +if [ ! -d PKGS ]; then + mkdirs PKGS +fi +mkdirs PKGS/${PLATFORM} +mkdirs SOURCES SPECS +if [ ! -d SPKGS ]; then + mkdirs SPKGS +fi +echo "Finished." + +# populate SOURCES and SPECS directories from Source tarball +echo "Extracting source and spec file from Source tarball . . . " +if [ -d SGTARS ] && + [ -f "SGTARS/${SGTARS_SOURCE_TARBALL}" ] +then + # pull source and spec file from Source tarball recently created by Linux + gtar -zxvf SGTARS/${SGTARS_SOURCE_TARBALL} -C ${PKG_HOME} +elif [ ! -z "${SGTARS_URL}" ]; then + # retrieve Source tarball from location specified by + # the SGTARS_URL environment variable + wget -q ${SGTARS_URL} + if [ $? -ne 0 ]; then + usage + exit 255 + fi + gtar -zxvf ${SGTARS_SOURCE_TARBALL} + rm -rf ${SGTARS_SOURCE_TARBALL} +else + # retrieve Source tarball from location specified by + # the DEFAULT_SGTARS_URL environment variable + wget -q ${DEFAULT_SGTARS_URL} + if [ $? -ne 0 ]; then + usage + exit 255 + fi + gtar -zxvf ${SGTARS_SOURCE_TARBALL} + rm -rf ${SGTARS_SOURCE_TARBALL} +fi +echo "done." + +# build the ${BITSIZE} PKGS and Source PKGS as DaTaStReAm packages +cd ${PKG_HOME} +echo "Executing ${BITSIZE} pkgbuild of ${SPEC_FILENAME} file . . . " +if [ ! -f SPKGS/${SRC_PACKAGE}-src-${VERSION}-${RELEASE}.src.pkg ]; then + pkgbuild --pkgformat=datastream --define "brand fedora" --define "_topdir ${PKG_HOME}" --define="build_debug $debug_opt" --define "optflags -xs -xO4" --define "_target ${PLATFORM}" -ba ${PKG_HOME}/SPECS/${SPEC_FILENAME} +else + pkgbuild --pkgformat=datastream --define "brand fedora" --define "_topdir ${PKG_HOME}" --define="build_debug $debug_opt" --define "optflags -xs -xO4" --define "_target ${PLATFORM}" -bb ${PKG_HOME}/SPECS/${SPEC_FILENAME} +fi +echo "Finished doing ${BITSIZE} pkgbuild of ${SPEC_FILENAME} file." + +# rename the ${BITSIZE} DaTaStReAm packages +echo "Renaming ${BITSIZE} PKGS files . . . " +mv PKGS/${PACKAGE}-${VERSION}.${PLATFORM}.pkg PKGS/${PLATFORM}/${PACKAGE}-${VERSION}-${RELEASE}.${PLATFORM}.pkg +mv PKGS/${PACKAGE}-devel-${VERSION}.${PLATFORM}.pkg PKGS/${PLATFORM}/${PACKAGE}-devel-${VERSION}-${RELEASE}.${PLATFORM}.pkg +echo "Finished renaming ${BITSIZE} PKGS files." +if [ ! -f SPKGS/${SRC_PACKAGE}-src-${VERSION}-${RELEASE}.src.pkg ]; then + echo "Renaming SPKGS files . . . " + mv SPKGS/${PACKAGE}-src-${VERSION}.src.pkg SPKGS/${SRC_PACKAGE}-src-${VERSION}-${RELEASE}.src.pkg + echo "Finished renaming SPKGS files." +fi + +echo "Removing SPECS directory." +if [ -d ${PKG_HOME}/SPECS ]; then + rm -rf ${PKG_HOME}/SPECS +fi + +echo "Removing SOURCES directory." +if [ -d ${PKG_HOME}/SOURCES ]; then + rm -rf ${PKG_HOME}/SOURCES +fi + +echo "Removing PKGMAPS directory." +if [ -d ${PKG_HOME}/PKGMAPS ]; then + rm -rf ${PKG_HOME}/PKGMAPS +fi + +echo "Removing BUILD directory." +if [ -d ${PKG_HOME}/BUILD ]; then + rm -rf ${PKG_HOME}/BUILD +fi + diff --git a/build_dsgw_rpm b/build_dsgw_rpm new file mode 100755 index 0000000..af018a0 --- /dev/null +++ b/build_dsgw_rpm @@ -0,0 +1,248 @@ +#!/bin/sh +# --- BEGIN COPYRIGHT BLOCK --- +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# (C) 2006 Red Hat, Inc. +# All rights reserved. +# --- END COPYRIGHT BLOCK --- + +# Usage: $0 [ -debug ] +# if exist, build debug version +debug_opt=full +if [ "$1" = "" ]; then + debug_opt=optimize +fi + +# Always switch into the base directory of this +# shell script prior to executing it so that all +# of its output is written to this directory +cd `dirname $0` + +# This script may ONLY be run on Linux! +OS=`uname` +if [ ${OS} != "Linux" ]; then + echo "The '$0' script is ONLY executable on a 'Linux' machine!" + exit 255 +fi + +# initialize environment variables for this script +unset LD_LIBRARY_PATH + +CVSROOT=:pserver:anonymous@cvs.fedora.redhat.com:/cvs/dirsec +export CVSROOT + +# define the remaining Dsgw +PACKAGE=dsgw +SUN_PACKAGE=RHATdsgw +VERSION=1.0 +RELEASE=1 +PRJ=${PACKAGE}-${VERSION} +RPM_HOME=`pwd` +DSGW_SPEC_TEMPLATE=${PACKAGE}.spec.template +DSGW_SPEC_FILENAME=${PACKAGE}.spec +SPEC_FILENAME=${PRJ}.spec +SGTARS_SOURCE_TARBALL=${SUN_PACKAGE}-${VERSION}-${RELEASE}.src.tar.gz +#DSGW_TAG_FLAG="-r DSGW_1_0_0_TAG" +DSGW_TAG_FLAG= + +# define subroutines for this script +usage() { + echo + echo "Usage: $0 [ -debug ]" + echo +} + +mkdirs() { + for d in "$@" ; do + if [ -d $d ]; then + mv $d $d.deleted + rm -rf $d.deleted & + fi + mkdir -p $d + done +} + +create_linux_specfile='{ + header_marker = "##################################################"; + linux_marker = "### L I N U X "; + solaris_marker = "### S O L A R I S "; + changelog_marker = "### C H A N G E L O G "; + + while( getline < FILENAME > 0 ) { + # save header for later + if( substr( $0, 0, 50 ) == header_marker ) { + header = $0; + + # search for linux section + while( getline < FILENAME > 0 ) { + if( substr( $0, 0, 50 ) == linux_marker ) { + # print linux section + print header; + print $0; + while( getline < FILENAME > 0 ) { + if( substr( $0, 0, 50 ) != solaris_marker ) { + print $0; + } else { + break; + } + } + + # suppress solaris section + while( getline < FILENAME > 0 ) { + if( substr( $0, 0, 50 ) != changelog_marker ) { + continue; + } else { + break; + } + } + + # print changelog section + print $0; + while( getline < FILENAME > 0 ) { + print $0; + } + } + } + } else { + print $0; + } + } +}' + +create_solaris_specfile='{ + header_marker = "##################################################"; + solaris_marker = "### S O L A R I S "; + + while( getline < FILENAME > 0 ) { + # save header for later + if( substr( $0, 0, 50 ) == header_marker ) { + header = $0; + + # search for solaris section + while( getline < FILENAME > 0 ) { + if( substr( $0, 0, 50 ) == solaris_marker ) { + # print solaris and changelog section + print header; + print $0; + while( getline < FILENAME > 0 ) { + print $0; + } + } + } + } else { + print $0; + } + } +}' + +# check the number of arguments supplied to this script +if [ $# -gt 1 ] ; then + usage + exit 255 +fi + +# remove any old RPM directories +echo "Removing any old RPM directories . . ." +if [ -d ${RPM_HOME}/BUILD ]; then + rm -rf ${RPM_HOME}/BUILD +fi +if [ -d ${RPM_HOME}/SOURCES ]; then + rm -rf ${RPM_HOME}/SOURCES +fi +if [ -d ${RPM_HOME}/SPECS ]; then + rm -rf ${RPM_HOME}/SPECS +fi +echo "Finished." + +echo "Changing current working directory to ${RPM_HOME}." +cd ${RPM_HOME} + +# create new RPM directories +echo "Creating new RPM directories . . ." +mkdirs BUILD +if [ ! -d ${RPM_HOME}/RPMS ]; then + mkdirs ${RPM_HOME}/RPMS +fi +if [ ! -d ${RPM_HOME}/SGTARS ]; then + mkdirs ${RPM_HOME}/SGTARS +fi +mkdirs SOURCES SPECS +if [ ! -d ${RPM_HOME}/SRPMS ]; then + mkdirs ${RPM_HOME}/SRPMS +fi +echo "Finished." + +# check out source from CVS +cvs co $DSGW_TAG_FLAG $PACKAGE + +# create a tarball from the checked out code +echo "Creating tarball of Dsgw source code . . ." +mv ${PACKAGE} ${PRJ} +tar cvf SOURCES/${PRJ}.tar ${PRJ} +gzip SOURCES/${PRJ}.tar +echo "Finished." + +# remove the checked out code +echo "Removing checked out Dsgw source code . . ." +rm -rf ${PRJ} +echo "Finished." + +# create a spec file from the dsgw template +echo cp ${DSGW_SPEC_TEMPLATE} SPECS/${DSGW_SPEC_FILENAME} +cp ${DSGW_SPEC_TEMPLATE} SPECS/${DSGW_SPEC_FILENAME} + +# build Source tarball (including any patches) for use by other platforms +if [ ! -f ${RPM_HOME}/SGTARS/${SGTARS_SOURCE_TARBALL} ]; then + gawk "$create_solaris_specfile" SPECS/${DSGW_SPEC_FILENAME} > SPECS/${SPEC_FILENAME} + echo "Creating Source tarball of ${PRJ} . . . " + gtar -zcvf SGTARS/${SGTARS_SOURCE_TARBALL} SOURCES SPECS/${SPEC_FILENAME} + echo "Finished creating Source tarball of ${PRJ}." + rm -rf SPECS/${SPEC_FILENAME} +fi + +# Generate a Linux-specific specfile +gawk "$create_linux_specfile" SPECS/${DSGW_SPEC_FILENAME} > SPECS/${SPEC_FILENAME} +rm -rf SPECS/${DSGW_SPEC_FILENAME} + +# build the ${BITSIZE} RPM and Source RPM +echo "Executing ${BITSIZE} rpmbuild of ${SPEC_FILENAME} file . . . " +if [ ! -f SRPMS/${PACKAGE}-${VERSION}-${RELEASE}.src.rpm ]; then + echo rpmbuild --define "brand fedora" --define="_topdir ${RPM_HOME}" --define="build_debug ${debug_opt}" --target ${PLATFORM} -ba --clean --rmsource --rmspec SPECS/${SPEC_FILENAME} + rpmbuild --define "brand fedora" --define="_topdir ${RPM_HOME}" --define="build_debug ${debug_opt}" --target ${PLATFORM} -ba --clean --rmsource --rmspec SPECS/${SPEC_FILENAME} +else + echo rpmbuild --define "brand fedora" --define="_topdir ${RPM_HOME}" --define="build_debug ${debug_opt}" --target ${PLATFORM} -bb --clean --rmsource --rmspec SPECS/${SPEC_FILENAME} + rpmbuild --define "brand fedora" --define="_topdir ${RPM_HOME}" --define="build_debug ${debug_opt}" --target ${PLATFORM} -bb --clean --rmsource --rmspec SPECS/${SPEC_FILENAME} +fi +echo "Finished doing rpmbuild of ${SPEC_FILENAME} file." + +echo "Removing BUILD directory . . ." +if [ -d ${RPM_HOME}/BUILD ]; then + rm -rf ${RPM_HOME}/BUILD +fi +echo "Finished." + +echo "Removing SOURCES directory . . ." +if [ -d ${RPM_HOME}/SOURCES ]; then + rm -rf ${RPM_HOME}/SOURCES +fi +echo "Finished." + +echo "Removing SPECS directory . . ." +if [ -d ${RPM_HOME}/SPECS ]; then + rm -rf ${RPM_HOME}/SPECS +fi +echo "Finished." + diff --git a/cgiutil.c b/cgiutil.c new file mode 100644 index 0000000..965a28f --- /dev/null +++ b/cgiutil.c @@ -0,0 +1,542 @@ +/** --- BEGIN COPYRIGHT BLOCK --- + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + --- END COPYRIGHT BLOCK --- */ +/* + * cgiutil.c -- CGI-related utility functions -- HTTP gateway + * + * Note: tihs code is derived from the extras/changepw.c code that ships + * with the FastTrack 2.0 server + */ + +#include "dsgw.h" +#include "dbtdsgw.h" + +#include +#include +#include + +/* globals */ +static char **formvars = NULL; + +/* functions */ +static char **dsgw_string_to_vec(char *in); + +static void +dsgw_vec_convert (char** vec) + /* Convert input from the charset named in it (if any) to UTF_8. + Either return s, or free(s) and return the converted string. + */ +{ + static const char* prefix = "charset="; + const size_t prefix_len = strlen (prefix); + char** v; + + if (vec) for (v = vec; *v; ++v) { + if (!strncmp (*v, prefix, prefix_len)) { + char* charset = *v + prefix_len; + UConverter* converter = NULL; + UErrorCode err = U_ZERO_ERROR; + if ( ! is_UTF_8 (charset) && (converter = ucnv_open(charset, &err)) && + (err == U_ZERO_ERROR) ) { + for (v = vec; *v; ++v) { + char* s = strchr (*v, '='); + if (s != NULL) { + char *t = NULL; + const size_t nlen = (++s) - *v; + const size_t slen = strlen (s); + size_t tlen = 0; + size_t reallen = 0; + int result; + + if (ucnv_getMaxCharSize(converter) == 1) { + tlen = slen + 2; /* best case - ascii or other 7/8 bit */ + } else { /* assume worst case utf8 - each char is 3 bytes */ + tlen = (slen * 3) + 2; + } + do { + char *tptr; + size_t realSlen = 0; + err = U_ZERO_ERROR; + + if (t) { + t = dsgw_ch_realloc(t, nlen + tlen); + } else { + t = dsgw_ch_malloc(nlen + tlen); + } + tptr = t + nlen; + + /* copy the converted characters into t after the '=', and + leave room for the trailing 0 */ + result = dsgw_convert(DSGW_TO_UTF8, converter, + &tptr, (tlen - nlen - 1), &reallen, + s, slen, &realSlen, &err); + tlen += slen; /* if failed, make more room */ + } while (result == 0); + if ((result == 1) && (err == U_ZERO_ERROR)) { + memcpy (t, *v, nlen); + t[nlen+reallen] = '\0'; + free (*v); + *v = t; + } else { + free (t); + } + ucnv_reset (converter); /* back to initial shift state */ + } + } + ucnv_close (converter); + } + if (U_FAILURE(err)) { + dsgw_error(DSGW_ERR_CHARSET_NOT_SUPPORTED, charset, 0, 0, 0); + } + break; + } + } +} + +/* Read in the variables from stdin, unescape them, and then put them in + * the static vector. + * + * Return 0 if all goes well; DSGW error code otherwise + */ +int +dsgw_post_begin(FILE *in) +{ + char *ct, *vars = NULL, *tmp = NULL; + int cl; + + if (( ct = getenv( "CONTENT_TYPE" )) == NULL || + strcasecmp( ct, "application/x-www-form-urlencoded" ) != 0 || + ( tmp = getenv( "CONTENT_LENGTH" )) == NULL ) { + return( DSGW_ERR_BADFORMDATA ); + } + + cl = atoi(tmp); + + vars = (char *)dsgw_ch_malloc(cl+1); + + if ( fread(vars, 1, cl, in) != cl ) { + return( DSGW_ERR_BADFORMDATA ); + } + + vars[cl] = '\0'; +#ifdef DSGW_DEBUG + dsgw_log ("vars=\"%s\"\n", vars); +#endif + formvars = dsgw_string_to_vec (vars); + free( vars ); + dsgw_vec_convert (formvars); + +#ifdef DSGW_DEBUG + dsgw_logstringarray( "formvars", formvars ); +if (0) { + char** var = formvars; + if (var) { + printf ("Content-type: text/html;charset=UTF-8\n\n\n"); + for (; *var; ++var) { + printf ("%s
\n", *var); + } + printf ("\n"); + exit (1); + } +} +#endif + + return( 0 ); +} + + +/* Unescape the %xx variables as they're sent in. */ +void +dsgw_form_unescape(char *str) +{ + register int x = 0, y = 0; + int l = strlen(str); + char digit; + + while(x < l) { + if((str[x] == '%') && (x < (l - 2))) { + ++x; + digit = (str[x] >= 'A' ? + ((str[x] & 0xdf) - 'A')+10 : (str[x] - '0')); + digit *= 16; + + ++x; + digit += (str[x] >= 'A' ? + ((str[x] & 0xdf) - 'A')+10 : (str[x] - '0')); + + str[y] = digit; + } + else if(str[x] == '+') { + str[y] = ' '; + } else { + str[y] = str[x]; + } + x++; + y++; + } + str[y] = '\0'; +} + + +/* Return the value of a POSTed variable, or NULL if none was sent. */ +char * +dsgw_get_cgi_var(char *varname, int required) +{ + register int x = 0; + int len = strlen(varname); + char *ans = NULL; + + while(formvars != NULL && formvars[x]) { + /* We want to get rid of the =, so len, len+1 */ + if((!strncmp(formvars[x], varname, len)) && + (*(formvars[x]+len) == '=')) { + ans = dsgw_ch_strdup(formvars[x] + len + 1); + if(!strcmp(ans, "")) { + free(ans); + ans = NULL; + } + break; + } else + x++; + } + + if ( required == DSGW_CGIVAR_REQUIRED && ans == NULL ) { + char errbuf[ 256 ]; + PR_snprintf( errbuf, sizeof(errbuf), + XP_GetClientStr(DBT_missingFormDataElement100s_), varname ); + dsgw_error( DSGW_ERR_BADFORMDATA, errbuf, DSGW_ERROPT_EXIT, 0, NULL ); + } + + return ans; +} + + +/* + * Return integer equivalent of POSTed value. If no variable POSTed, + * return defval. + */ +int +dsgw_get_int_var( char *varname, int required, int defval ) +{ + char *val; + int rc; + + if (( val = dsgw_get_cgi_var( varname, required )) == NULL ) { + rc = defval; + } else { + rc = atoi( val ); + free( val ); + } + + return( rc ); +} + + +/* + * Return non-zero if POSTed variable is "true" or "yes". If !required + * and no variable POSTed, return defval. + */ +int +dsgw_get_boolean_var( char *varname, int required, int defval ) +{ + char *val; + int rc; + + if (( val = dsgw_get_cgi_var( varname, required )) == NULL ) { + rc = defval; + } else { + rc = ( strcasecmp( val, "true" ) == 0 || + strcasecmp( val, "yes" ) == 0 ); + free( val ); + } + + return( rc ); +} + + +/* + * If a CGI variable named "varname_escaped" was POST'd, unescape it and + * return its value. + * Otherwise if "varname" is not NULL and a CGI variable called "varname" + * was POST'd, return its value. + * Otherwise return NULL. + */ +char * +dsgw_get_escaped_cgi_var( char *varname_escaped, char *varname, int required ) +{ + char *val; + + if (( val = dsgw_get_cgi_var( varname_escaped, + ( varname == NULL ) ? required: DSGW_CGIVAR_OPTIONAL )) != NULL ) { + dsgw_form_unescape( val ); + } else if ( varname != NULL ) { + val = dsgw_get_cgi_var( varname, required ); + } + + return( val ); +} + + +/* Convert the input from stdin to a usable variable vector. */ +static char ** +dsgw_string_to_vec(char *in) +{ + char **ans; + int vars = 0; + register int x = 0; + char *tmp; + + while(in[x]) + if(in[x++]=='=') + vars++; + + ans = (char **) dsgw_ch_malloc((sizeof(char *)) * (vars+1)); + if (ans) { + x=0; + /* strtok() is not MT safe, but it is okay to call here because it is used in monothreaded env */ + tmp = strtok(in, "&"); + if (tmp && *tmp && strchr(tmp, '=')) { + ans[x]=dsgw_ch_strdup(tmp); + dsgw_form_unescape(ans[x++]); + + while((x <= vars) && (tmp = strtok(NULL, "&"))) { + if ( strchr( tmp, '=' ) == NULL ) { + break; + } + ans[x] = dsgw_ch_strdup(tmp); + dsgw_form_unescape(ans[x++]); + } + } + ans[x] = NULL; + } + + return(ans); +} + + +/* + * Step through all the CGI POSTed variables. A malloc'd copy of the variable + * name is returned and *valuep is set to point to the value (not malloc'd). + * If there are no more variables, NULL is returned. + * + * The first time this is called, *indexp should be zero. On subsequent + * calls, pass the same indexp as on the first call. + */ +char * +dsgw_next_cgi_var( int *indexp, char **valuep ) +{ + char *name; + int namelen; + + if ( formvars == NULL || formvars[ *indexp ] == NULL ) { + return( NULL ); + } + + if (( *valuep = strchr( formvars[ *indexp ], '=' )) == NULL ) { + namelen = strlen( formvars[ *indexp ] ); + } else { + namelen = *valuep - formvars[ *indexp ]; + ++(*valuep); + } + name = dsgw_ch_malloc( namelen + 1 ); + memcpy( name, formvars[ *indexp ], namelen ); + name[ namelen ] = '\0'; + + *indexp += 1; + + return( name ); +} + +/* + * converts a buffer of characters to/from UTF8 from/to a native charset + * the given converter will handle the native charset + * returns 0 if not all of source was converted, 1 if all of source + * was converted, -1 upon error + * all of source will be converted if there is enough room in dest to contain + * the entire conversion, or if dest is null and we are malloc'ing space for dest + */ +int +dsgw_convert( + int direction, /* false for native->utf8, true for utf8->native */ + UConverter *nativeConv, /* convert from/to native charset */ + char **dest, /* *dest is the destination buffer - if *dest == NULL, it will be malloced */ + size_t destSize, /* size of dest buffer (ignored if *dest == NULL) */ + size_t *nDest, /* number of chars written to dest */ + const char *source, /* source buffer to convert - either in native encoding (from) or utf8 (to) */ + size_t sourceSize, /* size of source buffer - if 0, assume source is NULL terminated */ + size_t *nSource, /* number of chars read from source buffer */ + UErrorCode *pErrorCode /* will be reset each time through */ +) +{ +#define CHUNK_SIZE 1024 + UChar pivotBuffer[CHUNK_SIZE]; + UChar *pivot, *pivot2; + static UConverter *utf8Converter = NULL; + UConverter *inConverter, *outConverter; + char *myDest; + const char *mySource; + const char *destLimit; + const char *sourceLimit; + int destAlloc = 0; /* set to true if we allocated *dest */ + + *pErrorCode = U_ZERO_ERROR; + + if(sourceSize<0 || source==NULL || nDest==NULL || nSource==NULL) + { + *pErrorCode=U_ILLEGAL_ARGUMENT_ERROR; + return -1; + } + + *nSource = 0; + *nDest = 0; + + /* if source size is 0, assume source is null terminated and use strlen */ + if(sourceSize==0) { + sourceSize = strlen(source); + } + + /* create the converters */ + if (!utf8Converter) { + utf8Converter = ucnv_open(UNICODE_ENCODING_UTF_8, pErrorCode); + if(U_FAILURE(*pErrorCode)) { + return -1; + } + } + /* reset utf8Converter if done or error */ + + if (direction) { + inConverter = utf8Converter; /* source is utf8 */ + outConverter = nativeConv; /* dest is native charset */ + } else { + inConverter = nativeConv; /* source is native charset */ + outConverter = utf8Converter; /* dest is utf8 */ + } + + /* if dest is NULL, allocate space for it - may be reallocated later */ + if (!*dest) { + /* good approximation of size is n chars in source * max dest char size */ + destSize = ucnv_getMaxCharSize(outConverter) * sourceSize; + *dest = dsgw_ch_malloc(destSize); + destAlloc = 1; + } + + /* set up the other variables */ + mySource = source; + sourceLimit = source + sourceSize; + pivot = pivot2 = pivotBuffer; + myDest = *dest; + destLimit = *dest + destSize; + + /* + * loops until the input buffer is completely consumed + * or an error is encountered; + * first we convert from inConverter codepage to Unicode + * then from Unicode to outConverter codepage + */ + do { + pivot = pivotBuffer; + ucnv_toUnicode(inConverter, + &pivot, pivotBuffer + CHUNK_SIZE, + &mySource, sourceLimit, + NULL, + TRUE, + pErrorCode); + + /* U_BUFFER_OVERFLOW_ERROR only means that the pivot buffer is full */ + if(U_SUCCESS(*pErrorCode) || (*pErrorCode == U_BUFFER_OVERFLOW_ERROR)) { + pivot2 = pivotBuffer; + + /* convert and write bytes from the pivot buffer to the dest - + if dest is allocated and we run out of space in dest, grow + dest and try again - otherwise, just bail out and let the + caller know that their dest buffer is full and they need + to try again */ + do { + *pErrorCode = U_ZERO_ERROR; + ucnv_fromUnicode(outConverter, + &myDest, destLimit, + (const UChar **)&pivot2, pivot, + NULL, + (UBool)(mySource == sourceLimit), + pErrorCode); + + /* we overflowed dest and dest is allocated, so let's increase + the dest size */ + if ((*pErrorCode == U_BUFFER_OVERFLOW_ERROR) && destAlloc) { + /* figure out where myDest was pointing */ + size_t myDestOffset = myDest - *dest; + /* probably don't need this much more room . . . */ + destSize += CHUNK_SIZE; + /* realloc *dest for new size */ + *dest = dsgw_ch_realloc(*dest, destSize); + /* reset myDest in new *dest */ + myDest = *dest + myDestOffset; + /* set new destLimit */ + destLimit = *dest + destSize; + } else { + break; /* skip it */ + } + } while(*pErrorCode == U_BUFFER_OVERFLOW_ERROR); + /* + * If this overflows the fixed size dest, then we must stop + * converting and return what we already have + * in this case, pErrorCode will be buffer overflow error because + * we have overflowed the dest buffer + * the outer while loop will break because !U_SUCCESS + */ + } + } while(U_SUCCESS(*pErrorCode) && mySource != sourceLimit); + + *nSource = mySource - source; /* n chars read from source */ + *nDest = myDest - *dest; /* n chars written to dest */ + + if (U_SUCCESS(*pErrorCode) && mySource == sourceLimit) { + /* reset internal converter */ + ucnv_reset(utf8Converter); + return 1; /* converted entire string */ + } + + if (mySource != sourceLimit) { + /* not done with conversion yet */ + /* no reset here - preserve state for next call */ + return 0; + } + + /* error */ + ucnv_reset(utf8Converter); + return -1; +} diff --git a/ckdel.c b/ckdel.c new file mode 100644 index 0000000..596499b --- /dev/null +++ b/ckdel.c @@ -0,0 +1,65 @@ +/** --- BEGIN COPYRIGHT BLOCK --- + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + --- END COPYRIGHT BLOCK --- */ + +#include +#include "dsgw.h" + +#include +#include + +main( int argc, char **argv) +{ + char cookie[ 512 ]; + char *ptr; + int rc; + + printf( "Remove an entry to the cookie database\n" ); + + printf( "cookie: " ); + fgets( cookie, sizeof(cookie), stdin ); + if (ptr = strchr(cookie, '\n')) { + *ptr = 0; + } + + rc = dsgw_delcookie( cookie ); + if ( rc == 0 ) { + printf( "Cookie deleted\n" ); + } else { + printf( "Failed, rc = %d\n", rc ); + } +} diff --git a/ckdump.c b/ckdump.c new file mode 100644 index 0000000..7b0cc54 --- /dev/null +++ b/ckdump.c @@ -0,0 +1,63 @@ +/** --- BEGIN COPYRIGHT BLOCK --- + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + --- END COPYRIGHT BLOCK --- */ + +#include +#include "dsgw.h" + +#include +#include + +main() +{ +#ifdef notdef /* this was some testing code... */ +{ + char *ck, *r, *d, *p; + int rc; + + ck = dsgw_get_auth_cookie(); + rc = dsgw_parse_cookie( ck, &r, &d ); + if ( rc == 0 ) { + (void) dsgw_ckdn2passwd( r, d, &p ); + printf( "Got pw of <%s>\n", ( p == NULL ) ? "NULL" : p ); + } +} +#endif /* notdef */ + printf( "Dump the cookie database\n" ); + + dsgw_traverse_db(); +} diff --git a/ckget.c b/ckget.c new file mode 100644 index 0000000..df48500 --- /dev/null +++ b/ckget.c @@ -0,0 +1,83 @@ +/** --- BEGIN COPYRIGHT BLOCK --- + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + --- END COPYRIGHT BLOCK --- */ + +#include +#include "dsgw.h" + +#include +#include + +main() +{ + char *p; + time_t expires; + char dn[ 512 ]; + char cookie[ 512 ]; + int rc; + char *pw; + + + printf( "Retrieve an entry from the cookie database\n" ); + + printf( "cookie: " ); + fgets( cookie, sizeof(cookie), stdin ); + if (p = strchr(cookie, '\n')) { + *p = 0; + } + printf( "dn: " ); + fgets( dn, sizeof(dn), stdin ); + if (p = strchr(dn, '\n')) { + *p = 0; + } + + rc = dsgw_ckdn2passwd( cookie, dn, &pw ); + if ( rc == 0 ) { + printf( "Cookie valid, password is <%s>\n", pw ); + } else { + if ( rc == DSGW_CKDB_KEY_NOT_PRESENT ) { + printf( "Cookie/DN pair not found in database\n" ); + } else if ( rc == DSGW_CKDB_EXPIRED ) { + printf( "Cookie/DN pair expired\n" ); + } else { + printf( "Unknown DB error\n" ); + } + } + if ( pw != NULL ) { + free( pw ); + } +} diff --git a/ckpurge.c b/ckpurge.c new file mode 100644 index 0000000..1f9bc30 --- /dev/null +++ b/ckpurge.c @@ -0,0 +1,59 @@ +/** --- BEGIN COPYRIGHT BLOCK --- + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + --- END COPYRIGHT BLOCK --- */ + +#include +#include "dsgw.h" + +#include +#include + +main() +{ + int np = 0; + time_t last; + FILE *fp; + + printf( "purge the cookie database\n" ); + + fp = dsgw_opencookiedb(); + last = dsgw_getlastpurged( fp ); + dsgw_closecookiedb( fp ); + printf( "database was last purged at %s\n", ctime( &last )); + np = dsgw_purgedatabase( NULL ); + printf( "%d records purged\n", np ); +} diff --git a/ckput.c b/ckput.c new file mode 100644 index 0000000..30ad46f --- /dev/null +++ b/ckput.c @@ -0,0 +1,99 @@ +/** --- BEGIN COPYRIGHT BLOCK --- + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + --- END COPYRIGHT BLOCK --- */ + +#include +#include "dsgw.h" + +#include + +main( int argc, char **argv) +{ + char *p; + char dn[ 512 ]; + char pw[ 512 ]; + char lifesec[ 512 ]; + int rc; + int c; + extern char *optarg; + time_t lifetime; + + printf( "Add an entry to the cookie database\n" ); + + dn[0] = pw[0] = lifesec[0] = 0; + if ( argc > 1 ) { + while (( c = getopt( argc, argv, "d:l:p:" )) != EOF ) { + switch ( c ) { + case 'd': + PL_strncpyz( dn, optarg, sizeof(dn) ); + break; + case 'l': + PL_strncpyz( lifesec, optarg, sizeof(lifesec) ); + break; + case 'p': + PL_strncpyz( pw, optarg, sizeof(pw) ); + break; + } + } + } + + if ( strlen( dn ) == 0 || strlen( pw ) == 0 || strlen( lifesec ) == 0 ) { + printf( "dn: " ); + fgets( dn, sizeof(dn), stdin ); + if (p = strchr(dn, '\n')) { + *p = 0; + } + printf( "passwd: " ); + fgets( pw, sizeof(pw), stdin ); + if (p = strchr(pw, '\n')) { + *p = 0; + } + printf( "expires in how many seconds? " ); + fgets( lifesec, sizeof(lifesec), stdin ); + if (p = strchr(lifesec, '\n')) { + *p = 0; + } + } + + lifetime = atol( lifesec ); + p = dsgw_mkcookie( dn, pw, lifetime, &rc ); + if ( p == NULL ) { + fprintf( stderr, "Error storing cookie: error %d\n", rc ); + } else { + printf( "success, cookie is %s\n", p ); + } +} diff --git a/collate.c b/collate.c new file mode 100644 index 0000000..66146c3 --- /dev/null +++ b/collate.c @@ -0,0 +1,427 @@ +/** --- BEGIN COPYRIGHT BLOCK --- + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + --- END COPYRIGHT BLOCK --- */ +/* + * collate.c -- routines to collate character strings + */ + +#include +#include "dsgw.h" +#include /* ldap_utf8* */ + +#include /* Collation */ +#include /* Conversion */ +#include /* UTF8 conversion */ + +#ifdef _WINDOWS +#undef strcasecmp +#define strcasecmp _strcmpi +#endif + +/* + Convert the given string s, encoded in UTF8, into a Unicode (UTF16 or 32, depending on sizeof(UChar)) + string for use with collation and key generation + The given string U will be filled in if it's capacity (given by Ulen) is big enough, + otherwise, it will be malloced (or realloced if already allocated) +*/ +static UErrorCode +SetUnicodeStringFromUTF_8 (UChar** U, int32_t* Ulen, int *isAlloced, const char *s) + /* Copy the UTF-8 string bv into the UnicodeString U, + but remove leading and trailing whitespace, and + convert consecutive whitespaces into a single space. + Ulen is set to the number of UChars in the array (not necessarily the number of bytes!) + */ +{ + int32_t len = 0; /* length of non-space string */ + int32_t needLen = 0; /* number of bytes needed for string */ + UErrorCode err = U_ZERO_ERROR; + const char* begin; /* will point to beginning of non-space in s */ + + /* first, set s to the first non-space char in bv->bv_val */ + while (s && *s && ldap_utf8isspace((char *)s)) { /* cast away const */ + const char *next = LDAP_UTF8NEXT((char *)s); /* cast away const */ + s = next; + } + begin = s; + + if (!s || !*s) { + return U_INVALID_FORMAT_ERROR; /* don't know what else to use here */ + } + + /* next, find the length of the non-space string */ + while (s && *s && !ldap_utf8isspace((char *)s)) { /* cast away const */ + const char *next = LDAP_UTF8NEXT((char *)s); /* cast away const */ + len += (next - s); /* count bytes, not chars */ + needLen++; /* needLen counts chars */ + s = next; + } + + if (needLen == 0) { /* bogus */ + return U_INVALID_FORMAT_ERROR; /* don't know what else to use here */ + } + + needLen++; /* +1 for trailing UChar space */ + if (needLen > *Ulen) { /* need more space */ + if (*isAlloced) { /* realloc space */ + *U = (UChar *)dsgw_ch_realloc((char *)*U, sizeof(UChar) * needLen); + } else { /* must use malloc */ + *U = (UChar *)dsgw_ch_malloc(sizeof(UChar) * needLen); + *isAlloced = 1; /* no longer using fixed buffer */ + } + *Ulen = needLen; + } + u_strFromUTF8(*U, sizeof(UChar) * (*Ulen), NULL, begin, len, &err); + + return err; +} + +static UCollator* +get_collator (int flavor) +{ + static UCollator* collator[2] = {NULL, NULL}; +/* dsgw_emitf("get_collator (%i)
\n", flavor); */ + if (collator[flavor] == NULL && + gc->gc_ClientLanguage && gc->gc_ClientLanguage[0]) { + /* Try to create a Collation for the client's preferred language */ + ACCEPT_LANGUAGE_LIST langlist; + size_t langs; +/* dsgw_emitf ("ClientLanguage = \"%s\"
\n", gc->gc_ClientLanguage); */ + langs = AcceptLangList (gc->gc_ClientLanguage, langlist); + if (langs <= 0) { +dsgw_emitf ("AcceptLangList (%s) = %lu
\n", + gc->gc_ClientLanguage, (unsigned long)langs); + } else { + UCollator* fallback_collator = NULL; + UCollator* default_collator = NULL; + UErrorCode err = U_ZERO_ERROR; + size_t i; + + for (i = 0; i < langs; ++i) { + /* Try to create a Collation for langs[i] */ + char* lang = langlist[i]; + collator[flavor] = ucol_open(lang, &err); + if (err == U_ZERO_ERROR && collator[flavor]) { +dsgw_emitf("\n", lang); + break; + } else { + if (err == U_USING_FALLBACK_WARNING) { + if (fallback_collator == NULL) { + fallback_collator = collator[flavor]; +dsgw_emitf("\n", lang); + } else { + ucol_close (collator[flavor]); + } + } else if (err == U_USING_DEFAULT_WARNING) { + if (default_collator == NULL) { + default_collator = collator[flavor]; +dsgw_emitf("\n", lang); + } else { + ucol_close (collator[flavor]); + } + } else { +dsgw_emitf("New Collator error (%s) == %i
\n", lang, err); + } + collator[flavor] = NULL; + } + } + if (collator[flavor] == NULL) { + if (fallback_collator != NULL) { + collator[flavor] = fallback_collator; + fallback_collator = NULL; + } else if (default_collator != NULL) { + collator[flavor] = default_collator; + default_collator = NULL; + } + } + if (collator[flavor] != NULL) { + switch (flavor) { + case CASE_EXACT: +dsgw_emits("\n"); + ucol_setAttribute (collator[flavor], UCOL_STRENGTH, UCOL_TERTIARY, &err); + break; + default: /* CASE_IGNORE */ + if (dsgw_scriptorder()->so_caseIgnoreAccents) { +dsgw_emits("\n"); + ucol_setAttribute (collator[flavor], UCOL_STRENGTH, UCOL_PRIMARY, &err); + } else { +dsgw_emits("\n"); + ucol_setAttribute (collator[flavor], UCOL_STRENGTH, UCOL_SECONDARY, &err); + } + break; + } + } + if (default_collator != NULL) { + ucol_close (default_collator); + default_collator = NULL; + } + if (fallback_collator != NULL) { + ucol_close (fallback_collator); + fallback_collator = NULL; + } + } + } + return collator[flavor]; +} + +static int +valcmp (const char** L, const char** R) +{ + return strcmp (*L, *R); +} + +static int +valcasecmp (const char** L, const char** R) +{ + return strcasecmp (*L, *R); +} + +static int +strXcollate (int flavor, const char* L, const char* R) +{ + UCollator* collator = get_collator (flavor); + if (collator != NULL) { + UChar LuBuffer[128]; + UChar* Lu = LuBuffer; + int32_t LuLen = u_strlen(LuBuffer); + int LuisAlloced = 0; + if (SetUnicodeStringFromUTF_8 (&Lu, &LuLen, &LuisAlloced, L) == U_ZERO_ERROR) { + UChar RuBuffer[128]; + UChar* Ru = RuBuffer; + int32_t RuLen = u_strlen(RuBuffer); + int RuisAlloced = 0; + if (SetUnicodeStringFromUTF_8 (&Ru, &RuLen, &RuisAlloced, R) == U_ZERO_ERROR) { + UCollationResult colres = ucol_strcoll(collator, Lu, LuLen, Ru, RuLen); + int result = 0; + switch (colres) { + case UCOL_LESS: + result = -1; + break; + case UCOL_GREATER: + result = 1; + break; + default: + break; + } +#ifdef DSGW_DEBUG + { + auto char* Le = dsgw_strdup_escaped (L); + auto char* Re = dsgw_strdup_escaped (R); + dsgw_log ("strXcollate:%s %s %s\n", + Le, result < 0 ? "<" : (result == 0 ? "=" : ">"), Re); + free (Le); + free (Re); + } +#endif + if (RuisAlloced) { + free(Ru); + Ru = NULL; + } + if (LuisAlloced) { + free(Lu); + Lu = NULL; + } + + return result; + } + if (LuisAlloced) { + free(Lu); + Lu = NULL; + } + } + } + return flavor ? strcasecmp (L, R) : strcmp (L, R); +} + +static int +strcollate (const char* L, const char* R) +{ + return strXcollate (CASE_EXACT, L, R); +} + +static int +strcasecollate (const char* L, const char* R) +{ + return strXcollate (CASE_INSENSITIVE, L, R); +} + +static int +valcollate (const char** L, const char** R) +{ + return strXcollate (CASE_EXACT, *L, *R); +} + +static int +valcasecollate (const char** L, const char** R) +{ + return strXcollate (CASE_INSENSITIVE, *L, *R); +} + +strcmp_t +dsgw_strcmp (int flavor) +{ + if (get_collator (flavor) != NULL) { + return flavor ? strcasecollate : strcollate; + } + return flavor ? strcasecmp : strcmp; +} + +valcmp_t +dsgw_valcmp (int flavor) +{ + if (get_collator (flavor) != NULL) { + return flavor ? valcasecollate : valcollate; + } + return flavor ? valcasecmp : valcmp; +} + +static size_t +dsgw_scriptof (const char* s, scriptrange_t** ranges) +{ + auto size_t result = 0; + if (s && ranges) { + auto unsigned long u; + while ((u = LDAP_UTF8GETCC (s)) != 0) { + auto size_t ss; + auto scriptrange_t* sr; + for (ss = 0; (sr = ranges[ss]) != NULL; ++ss) { + do { + if (sr->sr_min <= u && u <= sr->sr_max) { + break; + } + } while ((sr = sr->sr_next) != NULL); + if (sr) { + if (result < ss) result = ss; + break; + } + } + if (!sr) { + result = ss; + break; + } + } + } +#ifdef DSGW_DEBUG + dsgw_log ("script %lu\n", (unsigned long)result); +#endif + return result; +} + +static struct berval key_first = {0, 0}; +static struct berval key_last = {0, 0}; + +struct berval* dsgw_key_first = &key_first; +struct berval* dsgw_key_last = &key_last; + +void LDAP_C LDAP_CALLBACK +dsgw_keyfree( void *arg, const struct berval* key ) +{ + if (key->bv_val) free (key->bv_val); + else if (key == dsgw_key_first || key == dsgw_key_last) return; + free ((void*)key); +} + +int LDAP_C LDAP_CALLBACK +dsgw_keycmp( void *arg, const struct berval *L, const struct berval *R ) +{ + int result = 0; + if (L == R) { + } else if (L->bv_val == NULL) { /* L is either first or last */ + result = (L == dsgw_key_last) ? 1 : -1; + } else if (R->bv_val == NULL) { /* R is either first or last */ + result = (R == dsgw_key_last) ? -1 : 1; + } else + /* copied from slapi_berval_cmp(), in ../../servers/slapd/plugin.c: */ + if (L->bv_len < R->bv_len) { + result = memcmp (L->bv_val, R->bv_val, L->bv_len); + if (result == 0) + result = -1; + } else { + result = memcmp (L->bv_val, R->bv_val, R->bv_len); + if (result == 0 && (L->bv_len > R->bv_len)) + result = 1; + } + return result; +} + +struct berval* +dsgw_strkeygen (int flavor, const char* s) +{ + auto struct berval* v = (struct berval*)dsgw_ch_malloc (sizeof (struct berval)); + auto UCollator* collator = get_collator (flavor); + v->bv_val = NULL; + if (collator != NULL) { + UChar uBuffer[128]; + UChar* u = uBuffer; + int32_t uLen = u_strlen(uBuffer); + int uisAlloced = 0; + if (SetUnicodeStringFromUTF_8 (&u, &uLen, &uisAlloced, s) == U_ZERO_ERROR) { + char keyBuffer[128]; /* try to use static space buffer to avoid malloc */ + int32_t keyLen = sizeof(keyBuffer); + char* key = keyBuffer; /* but key can grow if necessary */ + int32_t realLen = ucol_getSortKey(collator, u, uLen, (uint8_t *)key, keyLen); + if (realLen > keyLen) { /* need more space */ + key = (char*)dsgw_ch_malloc(sizeof(char) * realLen); + keyLen = ucol_getSortKey(collator, u, uLen, (uint8_t *)key, realLen); + } + v->bv_len = realLen + 2; + v->bv_val = dsgw_ch_malloc (v->bv_len); + memcpy(v->bv_val+1, key, realLen); + if (uisAlloced) { + free(u); + u = NULL; + } + if (key != keyBuffer) { + free(key); + key = NULL; + } + } + } + if (v->bv_val == NULL) { + v->bv_len = (s ? strlen (s) : 0) + 2; + v->bv_val = dsgw_ch_malloc (v->bv_len); + if (v->bv_len > 2) memcpy (v->bv_val+1, s, v->bv_len-2); + if (flavor) { + register char* t; + for (t = v->bv_val+1; *t; ++t) { + if (isascii (*t)) *t = tolower (*t); + } + } + } + v->bv_val[0] = (char) dsgw_scriptof (s, dsgw_scriptorder()->so_sort); + v->bv_val[v->bv_len-1] = '\0'; + return v; +} diff --git a/config-h.in b/config-h.in new file mode 100644 index 0000000..907daf2 --- /dev/null +++ b/config-h.in @@ -0,0 +1,194 @@ +/* config-h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ +#undef HAVE_DOPRNT + +/* Define to 1 if you have the header file. */ +#undef HAVE_FCNTL_H + +/* Define to 1 if you have the `ftruncate' function. */ +#undef HAVE_FTRUNCATE + +/* Define to 1 if you have the `getcwd' function. */ +#undef HAVE_GETCWD + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the `isascii' function. */ +#undef HAVE_ISASCII + +/* Define to 1 if you have the `c' library (-lc). */ +#undef HAVE_LIBC + +/* Define to 1 if you have the `crypt' library (-lcrypt). */ +#undef HAVE_LIBCRYPT + +/* Define to 1 if you have the `cxx' library (-lcxx). */ +#undef HAVE_LIBCXX + +/* Define to 1 if you have the `m' library (-lm). */ +#undef HAVE_LIBM + +/* Define to 1 if you have the `pthread' library (-lpthread). */ +#undef HAVE_LIBPTHREAD + +/* Define to 1 if you have the `w' library (-lw). */ +#undef HAVE_LIBW + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIMITS_H + +/* Define to 1 if you have the `localtime_r' function. */ +#undef HAVE_LOCALTIME_R + +/* Define to 1 if your system has a GNU libc compatible `malloc' function, and + to 0 otherwise. */ +#undef HAVE_MALLOC + +/* Define to 1 if you have the `memmove' function. */ +#undef HAVE_MEMMOVE + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `memset' function. */ +#undef HAVE_MEMSET + +/* Define to 1 if your system has a GNU libc compatible `realloc' function, + and to 0 otherwise. */ +#undef HAVE_REALLOC + +/* Define to 1 if you have the `select' function. */ +#undef HAVE_SELECT + +/* Define to 1 if `stat' has the bug that it succeeds when given the + zero-length file name argument. */ +#undef HAVE_STAT_EMPTY_STRING_BUG + +/* Define to 1 if stdbool.h conforms to C99. */ +#undef HAVE_STDBOOL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the `strcasecmp' function. */ +#undef HAVE_STRCASECMP + +/* Define to 1 if you have the `strchr' function. */ +#undef HAVE_STRCHR + +/* Define to 1 if you have the `strdup' function. */ +#undef HAVE_STRDUP + +/* Define to 1 if you have the `strerror' function. */ +#undef HAVE_STRERROR + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the `strncasecmp' function. */ +#undef HAVE_STRNCASECMP + +/* Define to 1 if you have the `strpbrk' function. */ +#undef HAVE_STRPBRK + +/* Define to 1 if you have the `strrchr' function. */ +#undef HAVE_STRRCHR + +/* Define to 1 if you have the `strstr' function. */ +#undef HAVE_STRSTR + +/* Define to 1 if you have the `strtoul' function. */ +#undef HAVE_STRTOUL + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_FILE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_PARAM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SELECT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SOCKET_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the `vprintf' function. */ +#undef HAVE_VPRINTF + +/* Define to 1 if the system has the type `_Bool'. */ +#undef HAVE__BOOL + +/* Define to 1 if `lstat' dereferences a symlink specified with a trailing + slash. */ +#undef LSTAT_FOLLOWS_SLASHED_SYMLINK + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to the type of arg 1 for `select'. */ +#undef SELECT_TYPE_ARG1 + +/* Define to the type of args 2, 3 and 4 for `select'. */ +#undef SELECT_TYPE_ARG234 + +/* Define to the type of arg 5 for `select'. */ +#undef SELECT_TYPE_ARG5 + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define to 1 if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME + +/* Define to 1 if your declares `struct tm'. */ +#undef TM_IN_SYS_TIME + +/* Version number of package */ +#undef VERSION + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to rpl_malloc if the replacement function should be used. */ +#undef malloc + +/* Define to rpl_realloc if the replacement function should be used. */ +#undef realloc + +/* Define to `unsigned' if does not define. */ +#undef size_t diff --git a/config.c b/config.c new file mode 100644 index 0000000..f9c5533 --- /dev/null +++ b/config.c @@ -0,0 +1,1544 @@ +/** --- BEGIN COPYRIGHT BLOCK --- + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + --- END COPYRIGHT BLOCK --- */ +/* + * config.c -- parse config file for directory server gateway + */ + + +#include /* ULONG_MAX */ +#include +#include /* strtoul */ +#include +#if !defined( XP_WIN32 ) +#include +#endif + +#include "dsgw.h" +#include "dbtdsgw.h" + +extern char *get_userdb_dir(void); /* Can't include libadmin.h, so this */ +static void adderr( dsgwconfig *gc, char *str, char *filename, int lineno ); +static void fp_parse_line( char *line, int *argcp, char **argv ); +static void fp_getline_init( int *lineno ); +static char *fp_getline( FILE *fp, int *lineno ); +static void add_location( int *loccountp, dsgwloc **locarrayp, + char *locsuffix, char **argv ); +static int add_newtype( dsgwnewtype **newentlistp, int loccount, + dsgwloc *locarray, int argc, char **argv ); +static void add_tmplset( dsgwtmplset **tslp, int argc, char **argv ); +static void add_vcardproperty( dsgwvcprop **vcpropp, int argc, char **argv ); +static void add_avset( dsgwavset **avsp, char **argv ); +static void add_includeset( dsgwinclset **isp, char **argv ); +static void add_l10nset( dsgwsubst **l10np, char **argv ); +static void read_dsgwconfig( char *filename, char *locsuffix, + int templatesonly, int binddnfile ); +static int dsgw_valid_context(); +static int browser_is_msie40(); +static int browser_ignores_acceptcharset(); +static char *dsgw_ch_strdup_tolower( const char *s ); +static void set_dsgwcharset(); +#ifdef XP_WIN32 +static void dsgw_unix2dospath( char *path ); +#endif + + +#define MAXARGS 100 +/* + * Open and parse the dsgw config file. If an error occurs, this function + * does not return. + */ +dsgwconfig * +dsgw_read_config() +{ + char *scriptname; + char *p, *fname; + int servurllen = 0; + int len; + char *path; + + /* + * First, make sure that the context is valid. Don't want anything + * tricky in there like dots or slashes. + */ + if (!dsgw_valid_context ()) { + dsgw_error( DSGW_ERR_BADFILEPATH, context, + DSGW_ERROPT_EXIT, 0, NULL ); + } + + /* gc is a global */ + if (( gc = (dsgwconfig *) dsgw_ch_malloc( sizeof( dsgwconfig ))) == NULL ) { + dsgw_error( DSGW_ERR_NOMEMORY, + XP_GetClientStr(DBT_initializingConfigInfo_), + DSGW_ERROPT_EXIT, 0, NULL ); + } + memset( gc, 0, sizeof( dsgwconfig )); + + /* + * set non-zero configuration defaults + */ + gc->gc_ldapport = LDAP_PORT; + gc->gc_configerrstr = dsgw_ch_strdup( "" ); + gc->gc_sslrequired = DSGW_SSLREQ_NEVER; + gc->gc_authlifetime = DSGW_DEF_AUTH_LIFETIME; + gc->gc_configdir = DSGW_CONFIGDIR_HTTP; /* may be overridden below */ + gc->gc_docdir = DSGW_DOCDIR_HTTP; + gc->gc_tmpldir = DSGW_TMPLDIR_HTTP; /* may be overridden below */ + gc->gc_urlpfxmain = DSGW_URLPREFIX_MAIN_HTTP; /* may be overridden below */ + /*gc->gc_urlpfxcgi = DSGW_URLPREFIX_CGI_HTTP;*/ + gc->gc_urlpfxcgi = DSGW_URLPREFIX_BIN; /* may be overridden below */ + gc->gc_binddn = gc->gc_bindpw = ""; + gc->gc_charset = NULL; /* implicitly ISO-8859-1 */ + gc->gc_ClientLanguage = ""; + gc->gc_AdminLanguage = ""; + gc->gc_DefaultLanguage = ""; + gc->gc_httpversion = 0; + gc->gc_orgchartsearchattr = "uid"; + /* + * Figure out whether we are running under the admin server or not. This + * also determines where our config and html files are. The hackage is: + * if we're running under the admin server: + * configdir is ../../../../admin-serv/config + * htmldir is ../html + * urlpfxmain is "" + * urlpfxcgi is "" + * dbswitchfile is NSHOME/userdb/dbswitch.conf + * + * If we're running under any other HTTP server: + * configdir is ../config + * htmldir is ../config (yes, that's right) + * urlpfxmain is "lang?context=dsgw&file=" + * gc_urlpfxcgi is "/ds" + * dbswitchfile is not used + */ + + /* Get the admin server name and chop off the version number */ + /* vs = dsgw_ch_strdup( ADMSERV_VERSION_STRING ); + if (( p = strchr( vs, '/')) != NULL ) { + *p = '\0'; + }*/ + + /*ss = getenv( "SERVER_SOFTWARE" ); + if ( ss != NULL ) { + if ( !strncasecmp( vs, ss, strlen( vs ))) { + char *server_names;*/ + /* We're running under the admin server */ + /* gc->gc_admserv = 1; + gc->gc_configdir = DSGW_CONFIGDIR_ADMSERV; + gc->gc_tmpldir = DSGW_TMPLDIR_ADMSERV; + gc->gc_urlpfxmain = DSGW_URLPREFIX_MAIN_ADMSERV; + gc->gc_urlpfxcgi = DSGW_URLPREFIX_CGI_ADMSERV;*/ + /* Check if running an end-user CGI under the admin server */ + /* if (( server_names = getenv( "SERVER_NAMES" )) != NULL && + strlen( server_names ) >= 4 && + strncmp( server_names, "user", 4 ) == 0 ) { + gc->gc_enduser = 1; + } + } + }*/ + + /* + * Get the strlen of the http://admin/port because getvp returns + * that in the url, so we can't compare scriptname against what + * getvp returns. We need to skip past the server url part. + */ + servurllen = strlen(dsgw_server_url()); + + /* Set mode (based on which CGI is currently running) */ + if (( scriptname = getenv( "SCRIPT_NAME" )) == NULL ) { + gc->gc_mode = 0; + } else { + if ( !strncmp( scriptname, dsgw_getvp( DSGW_CGINUM_DOSEARCH ) + servurllen, + strlen( scriptname ))) { + gc->gc_mode = DSGW_MODE_DOSEARCH; + } else if ( !strncmp( scriptname, dsgw_getvp( DSGW_CGINUM_BROWSE ) + servurllen, + strlen( scriptname ))) { + gc->gc_mode = DSGW_MODE_BROWSE; + } else if ( !strncmp( scriptname, dsgw_getvp( DSGW_CGINUM_SEARCH ) + servurllen, + strlen( scriptname ))) { + gc->gc_mode = DSGW_MODE_SEARCH; + } else if ( !strncmp( scriptname, dsgw_getvp( DSGW_CGINUM_CSEARCH )+ servurllen, + strlen( scriptname ))) { + gc->gc_mode = DSGW_MODE_CSEARCH; + } else if ( !strncmp( scriptname, dsgw_getvp( DSGW_CGINUM_AUTH )+ servurllen, + strlen( scriptname ))) { + gc->gc_mode = DSGW_MODE_AUTH; + } else if ( !strncmp( scriptname, dsgw_getvp( DSGW_CGINUM_EDIT )+ servurllen, + strlen( scriptname ))) { + gc->gc_mode = DSGW_MODE_EDIT; + } else if ( !strncmp( scriptname, dsgw_getvp( DSGW_CGINUM_DOMODIFY )+ servurllen, + strlen( scriptname ))) { + gc->gc_mode = DSGW_MODE_DOMODIFY; + } else { + gc->gc_mode = DSGW_MODE_UNKNOWN; + } + } + + if (( p = getenv( "SERVER_PROTOCOL" )) != NULL ) { + char *pp; + + pp = strchr(p, '/'); + if (pp != NULL) { + gc->gc_httpversion = (float)atof(++pp); + } + } + + if (( p = getenv( "DefaultLanguage" )) != NULL ) { + gc->gc_DefaultLanguage = p; + } + + if (( p = getenv( "AdminLanguage" )) != NULL ) { + gc->gc_AdminLanguage = p; + } + + if (( p = getenv( "ClientLanguage" )) != NULL ) { + gc->gc_ClientLanguage = p; + } + + /* Accept-Language from user overrides ClientLanguage from environment */ + if (( p = getenv( "HTTP_ACCEPT_LANGUAGE" )) != NULL ) { + gc->gc_ClientLanguage = p; + } + + /* Set rest of config. by reading the appropriate config files */ + path = dsgw_ch_malloc( MAXPATHLEN ); + + /* + * If there is no config file name (context), then use + * DSGW_CONFIGFILE in the config directory + */ + if (context == NULL) { + PR_snprintf( path, MAXPATHLEN, "%s$$LANGDIR/%s", + DSGW_CONFIGDIR_HTTP, DSGW_CONFIGFILE); + len = strlen( DSGW_CONFIGDIR_HTTP ) + strlen( DSGW_CONFIGFILE ) + 32; + } else { + PR_snprintf( path, MAXPATHLEN, "%s$$LANGDIR/%s.conf", + DSGW_CONTEXTDIR_HTTP, context); + /* increased the length from 11 -- fix for auth crash on AIX */ + len = strlen( DSGW_CONTEXTDIR_HTTP ) + strlen( context ) + 32; + } + /* allocate buffers with enough extra room to fit "$$LANGDIR/" */ + if ( NULL != gc->gc_ClientLanguage ) { + len += strlen( gc->gc_ClientLanguage ); + } + fname = dsgw_ch_malloc( len+MAXPATHLEN ); + if ( GetFileForLanguage( path, gc->gc_ClientLanguage, fname ) < 0 ) { + if (context == NULL) { + PR_snprintf( fname, len+MAXPATHLEN, "%s%s", DSGW_CONFIGDIR_HTTP, + DSGW_CONFIGFILE); + } else { + PR_snprintf( fname, len+MAXPATHLEN, "%s%s.conf", + DSGW_CONTEXTDIR_HTTP, context); + } + } + free( path ); + + if (context != NULL) { + char urlpfx[MAXPATHLEN]; + /*set the urlpfxmain to be "lang?context=CONTEXT&file="*/ + /*sprintf(urlpfx, "%slang?context=%s&file=", DSGW_URLPREFIX_CGI_HTTP, context);*/ + PR_snprintf(urlpfx, MAXPATHLEN, "%s?context=%s&file=", dsgw_getvp(DSGW_CGINUM_LANG), context); + gc->gc_urlpfxmain = dsgw_ch_strdup( urlpfx ); + } + + read_dsgwconfig( fname, NULL, gc->gc_admserv, 0 ); + free( fname ); + + if ( browser_ignores_acceptcharset() ) { + set_dsgwcharset(); + } else { + /* Accept-Charset from user overrides charset from configuration */ + if (( p = getenv( "HTTP_ACCEPT_CHARSET" )) != NULL ) { + gc->gc_charset = p; + /* IE 4.0 doesn't send HTTP_ACCEPT_CHARSET, so we test for it specially -RJP */ + } else if (browser_is_msie40() ) { + gc->gc_charset = MSIE40_DEFAULT_CHARSET; + } else { /* charset file overrides charset from configuration */ + set_dsgwcharset(); + } + } + + return( gc ); +} + + +/* + * Read the gateway config file (dsgw.conf). + */ +static void +read_dsgwconfig( char *filename, char *locsuffix, int templatesonly, int binddnfile ) +{ + char buf[ MAXPATHLEN + 100 ]; + int cargc; + char *cargv[ MAXARGS ]; + FILE *fp; + char *line; + int lineno; + int rc; + LDAPURLDesc *ludp; + + if (( fp = fopen( filename, "r" )) == NULL ) { + if ( strstr( filename, "dsgw-l10n.conf" ) != NULL ) { + return; /* ignore if it's dsgw-l10n.conf */ + } + PR_snprintf( buf, sizeof(buf), + XP_GetClientStr(DBT_cannotOpenConfigFileSN_), filename ); + dsgw_error( DSGW_ERR_BADCONFIG, buf, DSGW_ERROPT_EXIT, 0, NULL ); + } + fp_getline_init( &lineno ); + + while ( (line = fp_getline( fp, &lineno )) != NULL ) { + /* skip comments and blank lines */ + if ( line[0] == '#' || line[0] == '\0' ) { + continue; + } + + fp_parse_line( line, &cargc, cargv ); + + if ( cargc < 1 ) { + continue; + } + + if ( strcasecmp( cargv[0], "requireauth" ) == 0 ) { + if ( templatesonly ) continue; + gc->gc_authrequired = 1; + } + + if ( strcasecmp( cargv[0], "authlifetime" ) == 0 ) { + if ( templatesonly ) continue; + if ( cargc < 2 ) { + adderr( gc, XP_GetClientStr(DBT_missingArgumentForAuthlifetimeDi_), + filename, lineno ); + continue; + } + gc->gc_authlifetime = (time_t) atol( cargv[ 1 ]); + } else if ( strcasecmp( cargv[ 0 ], "changeHTML" ) == 0 ) { + auto dsgwsubst *sub; + if ( templatesonly ) continue; + if ( cargc < 2 || cargv[ 1 ][ 0 ] == '\0') continue; + sub = (dsgwsubst *)dsgw_ch_malloc( sizeof( dsgwsubst )); + memset( sub, 0, sizeof( dsgwsubst )); + sub->dsgwsubst_from = dsgw_ch_strdup( cargv[ 1 ] ); + if ( cargc > 2 ) { + sub->dsgwsubst_to = dsgw_ch_strdup( cargv[ 2 ] ); + if ( cargc > 3 ) { + auto size_t i; + sub->dsgwsubst_charsets = (char **)dsgw_ch_malloc + (sizeof(char*) * (cargc - 2)); + for (i = 3; i < cargc; ++i) { + sub->dsgwsubst_charsets[ i-3 ] = dsgw_ch_strdup( cargv[ i ] ); + } + sub->dsgwsubst_charsets[ i-3 ] = NULL; + } + } + { /* append sub to gc->gc_changeHTML: */ + auto dsgwsubst **s = &(gc->gc_changeHTML); + while (*s) s = &((*s)->dsgwsubst_next); + *s = sub; + } + + } else if ( strcasecmp( cargv[0], "dirmgr" ) == 0 ) { + if ( templatesonly ) continue; + if ( cargc < 2 ) { + adderr( gc, XP_GetClientStr(DBT_missingArgumentForDirmgrDirectiv_), + filename, lineno ); + continue; + } + gc->gc_rootdn = dsgw_ch_strdup( cargv[ 1 ]); + } else if ( strcasecmp( cargv[0], "url-orgchart-base" ) == 0 ) { + if ( templatesonly ) continue; + if ( cargc < 2 ) { + adderr( gc, XP_GetClientStr(DBT_missingArgumentForOrgChartURLDirectiv_), + filename, lineno ); + continue; + } + gc->gc_orgcharturl = dsgw_ch_strdup( cargv[ 1 ]); + } else if ( strcasecmp( cargv[0], "orgchart-attrib-farleft-rdn" ) == 0 ) { + if ( templatesonly ) continue; + if ( cargc < 2 ) { + adderr( gc, XP_GetClientStr(DBT_missingArgumentForOrgChartSearchAttr_), + filename, lineno ); + continue; + } + gc->gc_orgchartsearchattr = dsgw_ch_strdup( cargv[ 1 ]); + } else if ( strcasecmp( cargv[0], "enable-aim-presence" ) == 0 ) { + if ( templatesonly ) continue; + if (cargc < 2 || strcasecmp(cargv[1], "true") == 0) { + gc->gc_aimpresence = 1; + } else { + gc->gc_aimpresence = 0; + } + } else if ( strcasecmp( cargv[0], "baseurl" ) == 0 ) { + if ( templatesonly ) continue; + if ( cargc < 2 ) { + adderr( gc, XP_GetClientStr(DBT_missingArgumentForBaseurlDirecti_), + filename, lineno ); + continue; + } + gc->gc_baseurl = dsgw_ch_strdup( cargv[ 1 ]); + if (( rc = ldap_url_parse( gc->gc_baseurl, &ludp )) != 0 ) { + switch ( rc ) { + case LDAP_URL_ERR_NODN: + adderr( gc, XP_GetClientStr(DBT_badUrlProvidedForBaseurlDirectiv_), filename, lineno ); + break; + case LDAP_URL_ERR_MEM: + dsgw_error( DSGW_ERR_NOMEMORY, + XP_GetClientStr(DBT_parsingBaseurlDirective_), + DSGW_ERROPT_EXIT, 0, NULL ); + break; + case LDAP_URL_ERR_NOTLDAP: + adderr( gc, XP_GetClientStr(DBT_badUrlProvidedForBaseurlDirectiv_1), filename, lineno ); + break; + } + } else { + gc->gc_ldapserver = ludp->lud_host; + gc->gc_ldapport = ludp->lud_port; + if ( ludp->lud_dn == NULL ) { + gc->gc_ldapsearchbase = dsgw_ch_strdup( "" ); + } else { + gc->gc_ldapsearchbase = ludp->lud_dn; + } + if (( ludp->lud_options & LDAP_URL_OPT_SECURE ) != 0 ) { + gc->gc_ldapssl = 1; + } + } + + } else if ( strcasecmp( cargv[0], "template" ) == 0 ) { + if ( cargc < 3 ) { + adderr( gc, XP_GetClientStr(DBT_missingArgumentsForTemplateDirec_), + filename, lineno ); + continue; + } + dsgw_addtemplate( &gc->gc_templates, cargv[1], cargc - 2, + &cargv[2] ); + + } else if ( strcasecmp( cargv[0], "sslrequired" ) == 0 ) { + if ( templatesonly ) continue; + if ( cargc < 2 ) { + adderr( gc, XP_GetClientStr(DBT_missingArgumentForSslrequiredDir_), + filename, lineno ); + continue; + } + if ( strcasecmp( cargv[1], "never" ) == 0 ) { + gc->gc_sslrequired = DSGW_SSLREQ_NEVER; + } else if ( strcasecmp( cargv[1], "whenauthenticated" ) == 0 ) { + gc->gc_sslrequired = DSGW_SSLREQ_WHENAUTHENTICATED; + } else if ( strcasecmp( cargv[1], "always" ) == 0 ) { + gc->gc_sslrequired = DSGW_SSLREQ_ALWAYS; + } else { + adderr( gc, XP_GetClientStr(DBT_unknownArgumentToSslrequiredDire_), filename, lineno ); + } + + } else if ( strcasecmp( cargv[0], "securitypath" ) == 0 ) { + if ( templatesonly ) continue; + if ( cargc < 2 ) { + adderr( gc, XP_GetClientStr(DBT_missingArgumentForSecuritypathDi_), + filename, lineno ); + continue; + } + gc->gc_securitypath = dsgw_ch_strdup( cargv[1] ); + + } else if ( strcasecmp( cargv[0], "htmldir" ) == 0 ) { + int lenth = 0; + + if ( cargc < 2 ) { + adderr( gc, XP_GetClientStr(DBT_missingArgumentForHtmlpathDi_), + filename, lineno ); + continue; + } + + lenth = strlen(cargv[1]); + + /*See if the user put a slash at the end of the htmldir directive..*/ + if (cargv[1][lenth - 1] == '/' || cargv[1][lenth - 1] == '\\') { + gc->gc_docdir = dsgw_ch_strdup( cargv[1] ); + } else { + /*If not, put it there*/ + lenth ++; + gc->gc_docdir = dsgw_ch_malloc ((lenth+MAXPATHLEN) *sizeof (char)); + PR_snprintf(gc->gc_docdir, lenth + MAXPATHLEN, "%s/", cargv[1]); + } + /* The nametrans used. For the gw, it's /dsgw/html/ */ + } else if ( strcasecmp( cargv[0], "gwnametrans" ) == 0 ) { + if ( cargc < 2 ) { + adderr( gc, XP_GetClientStr(DBT_missingArgumentForNametransDi_), + filename, lineno ); + continue; + } + + /* + * This is needed for redirection. Can't use relative paths + * for Location:. If the gateway/phonebook/userDefinedGateway + * is running under a web server, it should be the html nametrans + * used to map to the html files. If it's under the admin server, + * it should be /dsgw/DIRECTORY_OF_HTML_FILES/ (which should be + * the same as the nameTrans. + */ + gc->gc_gwnametrans = dsgw_ch_strdup( cargv[1] ); + + } else if ( strcasecmp( cargv[0], "configdir" ) == 0 ) { + int lenth = 0; + + if ( cargc < 2 ) { + adderr( gc, XP_GetClientStr(DBT_missingArgumentForConfigpathDi_), + filename, lineno ); + continue; + } + + lenth = strlen(cargv[1]); + + /*See if the user put a slash at the end of the htmldir directive..*/ + if (cargv[1][lenth - 1] == '/' || cargv[1][lenth - 1] == '\\') { + gc->gc_configdir = dsgw_ch_strdup( cargv[1] ); + } else { + /*If not, put it there*/ + lenth ++; + gc->gc_configdir = dsgw_ch_malloc ((lenth+MAXPATHLEN) * sizeof (char)); + PR_snprintf(gc->gc_configdir, lenth + MAXPATHLEN, "%s/", + cargv[1]); + } + + gc->gc_tmpldir = dsgw_ch_strdup( gc->gc_configdir ); + + } else if ( strcasecmp( cargv[0], "location-suffix" ) == 0 ) { + if ( templatesonly ) continue; + if ( cargc < 2 ) { + adderr( gc, + XP_GetClientStr(DBT_missingArgumentForLocationSuffix_), + filename, lineno ); + continue; + } + if ( locsuffix != NULL ) { + free( locsuffix ); + } + locsuffix = dsgw_ch_strdup( cargv[1] ); + + } else if ( strcasecmp( cargv[0], "location" ) == 0 ) { + if ( templatesonly ) continue; + if ( cargc < 4 ) { + adderr( gc, + XP_GetClientStr(DBT_threeArgumentsAreRequiredForTheL_), + filename, lineno ); + continue; + } + add_location( &gc->gc_newentryloccount, &gc->gc_newentrylocs, + locsuffix, &cargv[1] ); + + } else if ( strcasecmp( cargv[0], "newtype" ) == 0 ) { + if ( templatesonly ) continue; + if ( cargc < 3 ) { + adderr( gc, + XP_GetClientStr(DBT_atLeastTwoArgumentsAreRequiredFo_), + filename, lineno ); + continue; + } + if ( add_newtype( &gc->gc_newentrytypes, gc->gc_newentryloccount, + gc->gc_newentrylocs, cargc - 1, &cargv[1] ) < 0 ) { + adderr( gc, XP_GetClientStr(DBT_unknownLocationInNewtypeDirectiv_), + filename, lineno ); + } + + } else if ( strcasecmp( cargv[0], "tmplset" ) == 0 ) { + if ( cargc != 4 && cargc != 5 ) { + adderr( gc, + XP_GetClientStr(DBT_threeOrFourArgumentsAreRequiredF_), + filename, lineno ); + continue; + } + add_tmplset( &gc->gc_tmplsets, cargc - 1, &cargv[1] ); + + } else if ( strcasecmp( cargv[0], "attrvset" ) == 0 ) { + if ( cargc != 5 ) { + adderr( gc, + XP_GetClientStr(DBT_fourArgumentsAreRequiredForTheAt_), + filename, lineno ); + continue; + } + add_avset( &gc->gc_avsets, &cargv[1] ); + + } else if ( strcasecmp( cargv[0], "includeset" ) == 0 ) { + if ( cargc != 3 ) { + adderr( gc, + XP_GetClientStr(DBT_twoArgumentsAreRequiredForTheInc_), + filename, lineno ); + continue; + } + add_includeset( &gc->gc_includesets, &cargv[1] ); + + } else if ( strcasecmp( cargv[0], "charset" ) == 0 ) { + if ( cargc < 2 ) { + adderr( gc, XP_GetClientStr(DBT_missingArgumentForCharsetDirecti_), + filename, lineno ); + continue; + } + gc->gc_charset = dsgw_ch_strdup( cargv[1] ); + +/* the following is not needed because AdminServer */ +/* puts these into environment from ns-admin.conf */ +#ifdef NEED_LANG_FROM_DSGW_CONF + } else if ( strcasecmp( cargv[0], "ClientLanguage" ) == 0 ) { + if ( cargc < 2 ) { + adderr( gc, + XP_GetClientStr(DBT_missingArgumentForClientlanguage_), + filename, lineno ); + continue; + } + gc->gc_ClientLanguage = dsgw_ch_strdup( cargv[1] ); + + } else if ( strcasecmp( cargv[0], "AdminLanguage" ) == 0 ) { + if ( cargc < 2 ) { + adderr( gc, + XP_GetClientStr(DBT_missingArgumentForAdminlanguageD_), + filename, lineno ); + continue; + } + gc->gc_AdminLanguage = dsgw_ch_strdup( cargv[1] ); + + } else if ( strcasecmp( cargv[0], "DefaultLanguage" ) == 0 ) { + if ( cargc < 2 ) { + adderr( gc, + XP_GetClientStr(DBT_missingArgumentForDefaultlanguag_), + filename, lineno ); + continue; + } + gc->gc_DefaultLanguage = dsgw_ch_strdup( cargv[1] ); +#endif + + } else if ( strcasecmp( cargv[0], "NLS" ) == 0 ) { + if ( cargc < 2 ) { + adderr( gc, + XP_GetClientStr(DBT_missingArgumentForNLS_), + filename, lineno ); + continue; + } + gc->gc_NLS = dsgw_ch_strdup( cargv[1] ); + + } else if ( strcasecmp( cargv[0], "vcard-property" ) == 0 ) { + if ( cargc != 4 && cargc != 5 ) { + adderr( gc, + XP_GetClientStr(DBT_threeOrFourArgumentsAreRequiredF_2), + filename, lineno ); + continue; + } + if ( strcmp( cargv[2], "cis" ) != 0 + && strcmp( cargv[2], "mls" ) != 0 ) { + adderr( gc, + XP_GetClientStr(DBT_vcardPropertySyntaxMustBeCisOrMl_), + filename, lineno ); + continue; + } + add_vcardproperty( &gc->gc_vcardproperties, cargc - 1, &cargv[1] ); + + } else if ( strcasecmp( cargv[0], "ignoreAcceptCharsetFrom" ) == 0 ) { + int i; + gc->gc_clientIgnoreACharset = (char **)dsgw_ch_malloc( cargc ); + --cargc; + for (i = 0; i < cargc; i++) + gc->gc_clientIgnoreACharset[i] = dsgw_ch_strdup_tolower( cargv[i+1] ); + gc->gc_clientIgnoreACharset[i] = NULL; + + } else if ( strcasecmp( cargv[0], "translate" ) == 0 ) { + if ( cargc != 3 ) { + adderr( gc, + XP_GetClientStr(DBT_twoArgumentsAreRequiredForTheInc_), + filename, lineno ); + continue; + } + add_l10nset( &gc->gc_l10nsets, &cargv[1] ); + + /* include another config file */ + } else if ( strcasecmp( cargv[0], "include" ) == 0 ) { + char *tmpfname = NULL; + char *path = NULL; + char *p; + int len; + + if ( cargc < 2 ) { + adderr( gc, XP_GetClientStr(DBT_missingFilenameForIncludeDirecti_), + filename, lineno ); + continue; + } + len = strlen( cargv[1] ) + 11; + tmpfname = dsgw_ch_malloc( len ); + p = strrchr( cargv[1], '/' ); + if ( p != NULL ) { + *p++ = '\0'; + sprintf( tmpfname, "%s/$$LANGDIR/%s", cargv[1], p); + *(--p) = DSGW_PATHSEP_CHAR; + } else { + p = cargv[1]; + sprintf( tmpfname, "$$LANGDIR/%s", p); + } + + /* allocate buffers with enough extra room to fit "$$LANGDIR/" */ + if ( NULL != gc->gc_ClientLanguage ) { + len += strlen( gc->gc_ClientLanguage ); + } + path = dsgw_ch_malloc( len ); + if ( GetFileForLanguage( tmpfname, gc->gc_ClientLanguage, path ) < 0 ) + strcpy( path, cargv[1] ); + +#ifdef DSGW_DEBUG + dsgw_log( "tmpfile: %s, path: %s, lang: %s\n", + tmpfname, path, gc->gc_ClientLanguage ); +#endif + read_dsgwconfig( path, locsuffix, templatesonly, 0 ); + if ( tmpfname ) free( tmpfname ); + if ( path ) free( path ); + + /*Special file that has binddn and password*/ + } else if ( strcasecmp( cargv[0], "binddnfile" ) == 0 ) { + char *tmpfname; + + if ( cargc < 2 ) { + adderr( gc, XP_GetClientStr(DBT_missingFilenameForBinddnfileDirecti_), + filename, lineno ); + continue; + } + + /* Make sure it has at least 1 slash in it */ + if ( strstr(cargv[1], "/") == NULL) { + adderr( gc, XP_GetClientStr(DBT_badFilenameForBinddnfileDirecti_), + filename, lineno ); + continue; + } + + /* ... and no ".."'s */ + if ( strstr(cargv[1], "..") != NULL) { + adderr( gc, XP_GetClientStr(DBT_badFilenameForBinddnfileDirecti_), + filename, lineno ); + continue; + } + + /* And no "dsgw" in it */ + if ( strstr(cargv[1], "/dsgw/") != NULL) { + adderr( gc, XP_GetClientStr(DBT_badFilenameForBinddnfileDirecti_), + filename, lineno ); + continue; + } + + + tmpfname = dsgw_ch_strdup( cargv[1] ); + read_dsgwconfig( tmpfname, locsuffix, templatesonly, 1 /*binddn file*/ ); + free( tmpfname ); + /* + * Only consider the binddn directive if this file was + * included from another file with the binddnfile + * directive. This is to prevent the stupid user from + * inlining the binddn and bindpw in dsgw.conf. This is + * bad because you can read dsgw.conf with a browser if + * you set up your web server to serve up the gateway. + * Just goto http://host/dsgw/context/dsgw.conf . It is + * my hope that the binddn file will be outside + * NS-HOME/dsgw, because people can get at it if it's in + * there. + */ + } else if ( strcasecmp( cargv[0], "binddn" ) == 0 ) { + if (!binddnfile) { + adderr( gc, XP_GetClientStr(DBT_wrongPlaceForBinddnDirectiv_), + filename, lineno ); + continue; + } + if ( templatesonly ) continue; + if ( cargc < 2 ) { + adderr( gc, XP_GetClientStr(DBT_missingArgumentForBinddnDirectiv_), + filename, lineno ); + continue; + } + gc->gc_binddn = dsgw_ch_strdup( cargv[ 1 ]); + + } else if ( strcasecmp( cargv[0], "bindpw" ) == 0 ) { + if (!binddnfile) { + adderr( gc, XP_GetClientStr(DBT_wrongPlaceForBinddnDirectiv_), + filename, lineno ); + continue; + } + + if ( templatesonly ) continue; + if ( cargc < 2 ) { + adderr( gc, XP_GetClientStr(DBT_missingArgumentForBindpwDirectiv_), + filename, lineno ); + continue; + } + gc->gc_bindpw = dsgw_ch_strdup( cargv[ 1 ]); + + } else { + adderr( gc, XP_GetClientStr(DBT_unknownDirectiveInConfigFileN_), + filename, lineno ); + } + } + + if ( gc == NULL || gc->gc_configerr > 0 ) { + dsgw_error( DSGW_ERR_BADCONFIG, ( gc->gc_configerrstr == NULL ) ? + "" : gc->gc_configerrstr, DSGW_ERROPT_EXIT, 0, NULL ); + } +} + +/* pass 0 for lineno if it is unknown or not applicable */ +static void +adderr( dsgwconfig *gc, char *str, char *filename, int lineno ) +{ + char *lbuf = dsgw_ch_malloc( MAXPATHLEN + 200 ); + + gc->gc_configerr++; + if ( lineno == 0 ) { + PR_snprintf( lbuf, MAXPATHLEN + 200, + XP_GetClientStr(DBT_configFileS_), filename ); + } else { + PR_snprintf( lbuf, MAXPATHLEN + 200, + XP_GetClientStr(DBT_configFileSLineD_), filename, lineno ); + } + gc->gc_configerrstr = dsgw_ch_realloc( gc->gc_configerrstr, + strlen( gc->gc_configerrstr ) + strlen( str ) + + strlen( lbuf ) + 6 ); + strcat( gc->gc_configerrstr, lbuf ); + strcat( gc->gc_configerrstr, str ); + strcat( gc->gc_configerrstr, "
\n" ); + free( lbuf ); +} + + +static void +add_location( int *loccountp, dsgwloc **locarrayp, char *locsuffix, + char **argv ) +{ + int len; + dsgwloc *locp; + + *locarrayp = (dsgwloc *)dsgw_ch_realloc( *locarrayp, + ( *loccountp + 1 ) * sizeof( dsgwloc )); + locp = &((*locarrayp)[ *loccountp ]); + locp->dsloc_handle = dsgw_ch_strdup( argv[0] ); + locp->dsloc_fullname = dsgw_ch_strdup( argv[1] ); + len = strlen( argv[2] ); + + if ( argv[2][ len - 1 ] == '#' ) { + /* '#' implies that locsuffix is not to be appended */ + locp->dsloc_dnsuffix = dsgw_ch_strdup( argv[2] ); + locp->dsloc_dnsuffix[ len - 1 ] = '\0'; + + } else if ( locsuffix != NULL && *locsuffix != '\0' ) { + /* append suffix, preceded by ", " if location arg. is not "" */ + locp->dsloc_dnsuffix = dsgw_ch_malloc( len + strlen( locsuffix ) + 3 ); + if ( argv[2][0] != '\0' ) { + strcpy( locp->dsloc_dnsuffix, argv[2] ); + strcat( locp->dsloc_dnsuffix, ", " ); + strcat( locp->dsloc_dnsuffix, locsuffix ); + } else { + strcpy( locp->dsloc_dnsuffix, locsuffix ); + } + + } else { + locp->dsloc_dnsuffix = dsgw_ch_strdup( argv[2] ); + } + ++(*loccountp); +} + + +static int +add_newtype( dsgwnewtype **newentlistp, int loccount, dsgwloc *locarray, + int argc, char **argv ) +{ + int i, j; + dsgwnewtype *ntp, *prevntp; + + ntp = (dsgwnewtype *)dsgw_ch_malloc( sizeof( dsgwnewtype )); + ntp->dsnt_template = dsgw_ch_strdup( argv[0] ); + ntp->dsnt_fullname = dsgw_ch_strdup( argv[1] ); + ntp->dsnt_rdnattr = dsgw_ch_strdup( argv[2] ); + ntp->dsnt_next = NULL; + ntp->dsnt_loccount = argc - 3; + argv = &argv[3]; + + /* fill dsnt_locations array with indexes into gc->gc_newentrylocs */ + if ( ntp->dsnt_loccount <= 0 ) { + ntp->dsnt_locations = NULL; + } else { + int foundit; + ntp->dsnt_locations = (int *)dsgw_ch_malloc( ntp->dsnt_loccount * + sizeof( int )); + for ( i = 0; i < ntp->dsnt_loccount; ++i ) { + foundit = 0; + for ( j = 0; j < loccount && !foundit; ++j ) { + if ( strcasecmp( argv[ i ], locarray[ j ].dsloc_handle ) + == 0 ) { + ntp->dsnt_locations[ i ] = j; + foundit = 1; + } + } + /* if ( j >= loccount ) { */ + if ( !foundit ) { + return( -1 ); /* unknown location -- error */ + } + } + } + + /* append to linked list of new entry structures */ + if ( *newentlistp == NULL ) { + *newentlistp = ntp; + } else { + for ( prevntp = *newentlistp; prevntp->dsnt_next != NULL; + prevntp = prevntp->dsnt_next ) { + ; + } + prevntp->dsnt_next = ntp; + } + + return( 0 ); +} + + +static void +add_tmplset( dsgwtmplset **tslp, int argc, char **argv ) +{ + dsgwtmplset *prevtsp, *tsp; + dsgwview *prevvp, *vp; + + prevtsp = NULL; + tsp = *tslp; + while ( tsp != NULL ) { + if ( strcasecmp( tsp->dstset_name, argv[0] ) == 0 ) { + break; + } + prevtsp = tsp; + tsp = tsp->dstset_next; + } + + if ( tsp == NULL ) { /* new template set */ + tsp = (dsgwtmplset *)dsgw_ch_malloc( sizeof( dsgwtmplset )); + memset( tsp, 0, sizeof( dsgwtmplset )); + tsp->dstset_name = dsgw_ch_strdup( argv[0] ); + if ( prevtsp == NULL ) { + *tslp = tsp; + } else { + prevtsp->dstset_next = tsp; + } + } + + /* add a new view to the end of this template set's view list */ + vp = (dsgwview *)dsgw_ch_malloc( sizeof( dsgwview )); + memset( vp, 0, sizeof( dsgwview )); + vp->dsview_caption = dsgw_ch_strdup( argv[1] ); + vp->dsview_template = dsgw_ch_strdup( argv[2] ); + if ( argc > 3 ) { + vp->dsview_jscript = dsgw_ch_strdup( argv[3] ); + } + + if ( tsp->dstset_viewlist == NULL ) { + tsp->dstset_viewlist = vp; + } else { + for ( prevvp = tsp->dstset_viewlist; prevvp->dsview_next != NULL; + prevvp = prevvp->dsview_next ) { + ; + } + prevvp->dsview_next = vp; + } + ++tsp->dstset_viewcount; +} + + +static void +add_avset( dsgwavset **avsp, char **argv ) /* 4 args. in argv[] */ +{ + dsgwavset *prevavp, *avp; + + /* is this the first element of a set? */ + prevavp = NULL; + for ( avp = *avsp; avp != NULL; avp = avp->dsavset_next ) { + if ( strcasecmp( avp->dsavset_handle, argv[0] ) == 0 ) { + break; + } + prevavp = avp; + } + + if ( avp == NULL ) { /* first element: add a new set */ + avp = (dsgwavset *)dsgw_ch_malloc( sizeof( dsgwavset )); + memset( avp, 0, sizeof( dsgwavset )); + avp->dsavset_handle = dsgw_ch_strdup( argv[0] ); + if ( prevavp == NULL ) { + *avsp = avp; + } else { + prevavp->dsavset_next = avp; + } + } + + ++avp->dsavset_itemcount; + avp->dsavset_values = (char **)dsgw_ch_realloc( avp->dsavset_values, + avp->dsavset_itemcount * sizeof( char * )); + avp->dsavset_values[ avp->dsavset_itemcount - 1 ] = + dsgw_ch_strdup( argv[1] ); + avp->dsavset_prefixes = (char **)dsgw_ch_realloc( avp->dsavset_prefixes, + avp->dsavset_itemcount * sizeof( char * )); + avp->dsavset_prefixes[ avp->dsavset_itemcount - 1 ] = + dsgw_ch_strdup( argv[2] ); + avp->dsavset_suffixes = (char **)dsgw_ch_realloc( avp->dsavset_suffixes, + avp->dsavset_itemcount * sizeof( char * )); + avp->dsavset_suffixes[ avp->dsavset_itemcount - 1 ] = + dsgw_ch_strdup( argv[3] ); +} + + +static void +add_includeset( dsgwinclset **isp, char **argv ) /* 2 args. in argv[] */ +{ + dsgwinclset *previsp, *tmpisp; + + /* is this the first element of a set? */ + previsp = NULL; + for ( tmpisp = *isp; tmpisp != NULL; tmpisp = tmpisp->dsiset_next ) { + if ( strcasecmp( tmpisp->dsiset_handle, argv[0] ) == 0 ) { + break; + } + previsp = tmpisp; + } + + if ( tmpisp == NULL ) { /* first element: add a new set */ + tmpisp = (dsgwinclset *)dsgw_ch_malloc( sizeof( dsgwinclset )); + memset( tmpisp, 0, sizeof( dsgwinclset )); + tmpisp->dsiset_handle = dsgw_ch_strdup( argv[0] ); + if ( previsp == NULL ) { + *isp = tmpisp; + } else { + previsp->dsiset_next = tmpisp; + } + } + + ++tmpisp->dsiset_itemcount; + tmpisp->dsiset_filenames = + (char **)dsgw_ch_realloc( tmpisp->dsiset_filenames, + tmpisp->dsiset_itemcount * sizeof( char * )); + tmpisp->dsiset_filenames[ tmpisp->dsiset_itemcount - 1 ] = + dsgw_ch_strdup( argv[1] ); +} + +static void +add_l10nset( dsgwsubst **l10np, char **argv ) /* 2 args, in argv[] */ +{ + dsgwsubst *tmpsp; + + tmpsp = (dsgwsubst *)dsgw_ch_malloc( sizeof( dsgwsubst )); + tmpsp->dsgwsubst_from = dsgw_ch_strdup( argv[0] ); + tmpsp->dsgwsubst_to = dsgw_ch_strdup( argv[1] ); + tmpsp->dsgwsubst_next = *l10np; + *l10np = tmpsp; +} + +static void +add_vcardproperty( dsgwvcprop **vcpropp, int argc, char **argv ) +{ + dsgwvcprop *prevvcp, *newvcp, *vcp; + + newvcp = (dsgwvcprop *)dsgw_ch_malloc( sizeof( dsgwvcprop )); + newvcp->dsgwvcprop_next = NULL; + newvcp->dsgwvcprop_property = dsgw_ch_strdup( argv[0] ); + newvcp->dsgwvcprop_syntax = dsgw_ch_strdup( argv[1] ); + newvcp->dsgwvcprop_ldaptype = dsgw_ch_strdup( argv[2] ); + if ( argc == 3 ) { + newvcp->dsgwvcprop_ldaptype2 = NULL; + } else { + newvcp->dsgwvcprop_ldaptype2 = dsgw_ch_strdup( argv[3] ); + } + + prevvcp = NULL; + for ( vcp = *vcpropp; vcp != NULL; vcp = vcp->dsgwvcprop_next ) { + prevvcp = vcp; + } + + if ( prevvcp == NULL ) { + *vcpropp = newvcp; + } else { + prevvcp->dsgwvcprop_next = newvcp; + } +} + + +static char * +strtok_quote( char *line, char *sep ) + /* This implementation can't handle characters > 127 in sep. + But it works fine for sep == " \t". + */ +{ + int inquote; + char *tmp; + static char *next; + + if ( line != NULL ) { + next = line; + } + while ( *next && strchr( sep, *next ) ) { + next++; + } + + if ( *next == '\0' ) { + next = NULL; + return( NULL ); + } + tmp = next; + + for ( inquote = 0; *next; ) { + switch ( *next ) { + case '"': + if ( inquote ) { + inquote = 0; + } else { + inquote = 1; + } + strcpy( next, next + 1 ); + break; + +#ifndef _WIN32 + case '\\': + strcpy( next, next + 1 ); + break; +#endif + + default: + if ( ! inquote ) { + if ( strchr( sep, *next ) != NULL ) { + *next++ = '\0'; + return( tmp ); + } + } + next++; + break; + } + } + + return( tmp ); +} + +static char buf[BUFSIZ]; +static char *line; +static int lmax, lcur; + +#define CATLINE( buf ) { \ + int len; \ + len = strlen( buf ); \ + while ( lcur + len + 1 > lmax ) { \ + lmax += BUFSIZ; \ + line = (char *) dsgw_ch_realloc( line, lmax ); \ + } \ + strcpy( line + lcur, buf ); \ + lcur += len; \ +} + + + +static void +fp_parse_line( + char *line, + int *argcp, + char **argv +) +{ + char * token, buf[ 20 ]; + + *argcp = 0; + for ( token = strtok_quote( line, " \t" ); token != NULL; + token = strtok_quote( NULL, " \t" ) ) { + if ( *argcp == MAXARGS ) { + PR_snprintf( buf, sizeof(buf), + XP_GetClientStr(DBT_maxD_), MAXARGS ); + dsgw_error( DSGW_ERR_CONFIGTOOMANYARGS, buf, + DSGW_ERROPT_EXIT, 0, NULL ); + } + argv[(*argcp)++] = token; + } + argv[*argcp] = NULL; +} + + + +static char * +fp_getline( FILE *fp, int *lineno ) +{ + char *p; + + lcur = 0; + + while ( fgets( buf, sizeof(buf), fp ) != NULL ) { + if ( (p = strchr( buf, '\n' )) != NULL ) { + *p = '\0'; + } + if ( lcur > 0 && ! ldap_utf8isspace( buf ) ) { + return( line ); /* return previously saved line */ + } + CATLINE( buf ); + (*lineno)++; + if ( ! ldap_utf8isspace( buf )) { + return( line ); /* return this line */ + } + } + buf[0] = '\0'; + + return( lcur > 0 ? line : NULL ); +} + +static void +fp_getline_init( int *lineno ) +{ + *lineno = 0; + buf[0] = '\0'; +} + +#ifdef XP_WIN32 +/* convert forward slashes to backwards ones */ +static void +dsgw_unix2dospath( char *path ) +{ + if( path ) { + while( *path ) { + if( *path == '/' ) { + *path = '\\'; + } + path++; + } + } +} +#endif + +/* + * Function: dsgw_valid_context + * + * Returns: 1 if context doesn't have / . \ ,etc, 0 else + * + * Description: context is the name of the config file + * that is passed into the CGI. + * Let's say context = pb + * then it gets translated into: ../context/pb.conf + * so we have to make sure that context + * only contains numbers or letters, and nothing else + * + * Author: RJP + * + */ +static int +dsgw_valid_context() +{ + char *local_context = NULL; + + /*Get a local pointer to the global context*/ + local_context = context; + + if (local_context == NULL) { + return(1); + } + + for ( ; *local_context; LDAP_UTF8INC(local_context)) { + + if (!ldap_utf8isalnum(local_context)) { + + /*Allow dashes and underscores*/ + if (*local_context == '-' || *local_context == '_') { + continue; + } + return(0); + } + } + return(1); + +} + +/* + * Function: dsgw_valid_docname + * + * Returns: 1 if context doesn't have / . \ ,etc, 0 else + * + * Description: Checks to make sure that filename contains + * only alphanumeric values and one dot + * + * Author: RJP + * + */ +int +dsgw_valid_docname(char *filename) +{ + int dots = 0; + char *local_filename = NULL; + + local_filename = filename; + + if (local_filename == NULL) { + return(1); + } + + for ( ; *local_filename; LDAP_UTF8INC(local_filename)) { + + /*If it's not a number or a letter...*/ + if (!ldap_utf8isalnum(local_filename)) { + + /*If it's a dot, and there haven't been any other dots...*/ + /* ... but disallow a dot as the first char */ + if (*local_filename == '.') { + if (local_filename == filename) { + return (0); /* illegal - filename begins with . */ + } + if (dots == 0) { + /*Then increment the dot count and continue...*/ + dots ++; /* contains a . somewhere e.g. foo.html */ + continue; + } + } + + /*Allow dashes and underscores*/ + if (*local_filename == '-' || *local_filename == '_') { + continue; + } + + return (0); + } + } + + return(1); +} + +/* + * Function: dsgw_get_docdir + * + * Returns: a pointer to the html directory + * + * Description: Just returns gc->gc_docdir + * + * Author: RJP + * + */ +char * +dsgw_get_docdir(void) +{ + return(gc->gc_docdir); +} + +/* + * Function: browser_is_msie40 + * + * Returns: 1 if HTTP_USER_AGENT is MSIE 4.0 or greater, 0 else + * + * Description: MSIE 4.0 doesn't return HTTP_ACCEPT_CHARSET, + * but it does understand utf-8, so we need to + * make a special case for it. If the browser + * being used is MSIE 4.0 or greater, this function + * returns 1. + * + * Author: RJP + * + */ +static int +browser_is_msie40() +{ + char *p = NULL; + char *browzer = NULL; + char version[6]; + int i; + + /* Get the browser name */ + if (( p = getenv( "HTTP_USER_AGENT" )) == NULL ) { + return(0); + } + + /* Try to find MSIE in there */ + browzer = strstr (p, "MSIE "); + + /* If nothing, then we're done */ + if (browzer == NULL) { + return (0); + } + + /* Skip to the version */ + browzer += 5; + + /* Accumulate the version */ + for (i=0; i < 5 && *browzer != '.' ; i++, browzer++) { + version[i] = *browzer; + } + + /* Null terminate */ + version[i] = '\0'; + + if (atoi(version) > 3) { + return(1); + } + + return(0); + +} + +/* + * Function: browser_ignores_acceptcharset + * + * Returns: 1 if ignoreAcceptCharsetFrom contains the current HTTP_USER_AGENT, + * 0 else + * + * Description: bug fix for #97908: + * The dsgw doesn't respect the "charset" variable in the dsgw.conf file. + * E.g., ignoreAcceptCharsetFrom Mozilla/4.01x-NSCP Mozilla/4.03C-NSCP + * + */ +static int +browser_ignores_acceptcharset() +{ + char *p = NULL; + char *browzer = NULL; + int i; + + if ( gc->gc_clientIgnoreACharset == NULL || + gc->gc_clientIgnoreACharset[0] == NULL ) + return 0; + + /* Get the browser name */ + if (( p = getenv( "HTTP_USER_AGENT" )) == NULL ) { + return 0; + } + browzer = dsgw_ch_strdup_tolower( p ); + + for ( i = 0; gc->gc_clientIgnoreACharset[i]; i++ ) { + if ( strstr( browzer, gc->gc_clientIgnoreACharset[i] ) != NULL ) + return 1; + } + free( browzer ); + return 0; +} + +static void +set_dsgwcharset() +{ + auto char* fname = dsgw_file2path (gc->gc_configdir, "dsgwcharset.conf"); + auto FILE* f = fopen (fname, "r"); + if (f != NULL) { + auto char buf[BUFSIZ]; + if (fgets (buf, sizeof(buf), f)) { + auto const size_t buflen = strlen (buf); + if (buf[buflen-1] == '\n') { + buf[buflen-1] = '\0'; + } + gc->gc_charset = dsgw_ch_strdup (buf); + } + fclose (f); + } + free (fname); +} + +static char * +dsgw_ch_strdup_tolower( const char *s ) +{ + int len, i; + char *p, *sp, *dp; + + len = strlen( s ) + 1; + dp = p = dsgw_ch_malloc( len ); + sp = (char *)s; + for (i = 0; i < len; i++, dp++, sp++) + *dp = tolower(*sp); + return( p ); +} + +static scriptrange_t** +parse_scriptranges (char** cargv, size_t cargc) +{ + auto scriptrange_t** result = (scriptrange_t**) + dsgw_ch_calloc (cargc + 1, sizeof(scriptrange_t*)); + auto size_t i; + for (i = 0; i < cargc; ++i) { + auto scriptrange_t** last = result+i; + auto char* token; + auto char* cursor = NULL; + for (token = ldap_utf8strtok_r (cargv[i], ",;", &cursor); token; + token = ldap_utf8strtok_r (NULL, ",;", &cursor)) { +#ifdef DSGW_DEBUG + dsgw_log ("parse_scriptranges %s\n", token); +#endif + *last = dsgw_ch_malloc (sizeof(scriptrange_t)); + (*last)->sr_min = (*token == '-') ? 0 : strtoul (token, &token, 16); + (*last)->sr_max = (*token != '-') ? (*last)->sr_min + : ((*++token == '\0') ? ULONG_MAX : strtoul (token, &token, 16)); + last = &((*last)->sr_next); + } + *last = NULL; + } + result[cargc] = NULL; + return result; +} + +scriptorder_t* +dsgw_scriptorder() +{ + static scriptorder_t* result = NULL; + if (result == NULL) { + auto char* simplename = "dsgwcollate.conf"; + auto char* fname = dsgw_file2path (gc->gc_configdir, simplename); + auto FILE* fp; + result = (scriptorder_t*) dsgw_ch_calloc (1, sizeof(scriptorder_t)); + if (NULL == fname) { +#ifdef DSGW_DEBUG + dsgw_log ("dsgw_scriptorder can't find %s\n", simplename); +#endif + } else if (NULL == (fp = fopen (fname, "r"))) { +#ifdef DSGW_DEBUG + dsgw_log ("dsgw_scriptorder can't open %s\n", fname); +#endif + } else { + auto char* line; + auto int lineno; + fp_getline_init( &lineno ); + while ( (line = fp_getline( fp, &lineno )) != NULL ) { + auto int cargc; + auto char* cargv[ MAXARGS ]; + /* skip comments and blank lines */ + if ( line[0] == '#' || line[0] == '\0' ) { + continue; + } + fp_parse_line( line, &cargc, cargv ); + if ( !strcasecmp (cargv[0], "caseIgnoreAccents")) { + result->so_caseIgnoreAccents = 1; + } else if ( !strcasecmp (cargv[0], "sort")) { + result->so_sort = parse_scriptranges (cargv+1, cargc-1); + } else if ( !strcasecmp (cargv[0], "display")) { + result->so_display = parse_scriptranges (cargv+1, cargc-1); + } else { +#ifdef DSGW_DEBUG + dsgw_log ("%s/%i: unknown keyword %s\n", fname, lineno, cargv[0]); +#endif + } + } + fclose (fp); +#ifdef DSGW_DEBUG + dsgw_log ("dsgw_scriptorder %s line %i\n", fname, lineno); +#endif + } + if (fname) free (fname); + } + return result; +} diff --git a/config.h.in b/config.h.in new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/config.h.in diff --git a/config/authPassword.html b/config/authPassword.html new file mode 100644 index 0000000..2b8eecf --- /dev/null +++ b/config/authPassword.html @@ -0,0 +1,61 @@ + + + + +Authenticate... + + + + + + + +

+Password for + +: +

+

+ + + +
+ + + diff --git a/config/authSearch.html b/config/authSearch.html new file mode 100644 index 0000000..ca7bbb4 --- /dev/null +++ b/config/authSearch.html @@ -0,0 +1,66 @@ + + + + +Authenticate... + + + + + + +The first step in authenticating to the directory is identifying +yourself.
Please type your name: + +

+

+ + + +
+ +

+ + (only available to Directory Administrators) + + + + + + diff --git a/config/csearch.html b/config/csearch.html new file mode 100644 index 0000000..a417f2e --- /dev/null +++ b/config/csearch.html @@ -0,0 +1,59 @@ + + + + +Netscape Directory Server Gateway: Advanced Search + + + + + + + + + + + + + + + + + + diff --git a/config/csearchAttr.html b/config/csearchAttr.html new file mode 100644 index 0000000..f64c9e9 --- /dev/null +++ b/config/csearchAttr.html @@ -0,0 +1,54 @@ + + + + + + + + + + + + +
+where the + + +
+ diff --git a/config/csearchBase.html b/config/csearchBase.html new file mode 100644 index 0000000..a33e737 --- /dev/null +++ b/config/csearchBase.html @@ -0,0 +1,53 @@ + + + + + + + + + + + +
+within + +
+ + diff --git a/config/csearchMatch.html b/config/csearchMatch.html new file mode 100644 index 0000000..605db6c --- /dev/null +++ b/config/csearchMatch.html @@ -0,0 +1,52 @@ + + + + + + + + + + +
+ +
+ + + diff --git a/config/csearchString.html b/config/csearchString.html new file mode 100644 index 0000000..4b41be6 --- /dev/null +++ b/config/csearchString.html @@ -0,0 +1,57 @@ + + + + + + + + + + + +
+ + + +
+ + + + + diff --git a/config/csearchType.html b/config/csearchType.html new file mode 100644 index 0000000..0cef8b5 --- /dev/null +++ b/config/csearchType.html @@ -0,0 +1,55 @@ + + + + + + + + + + + +
+Find + + +
+ + + diff --git a/config/de/authPassword.html b/config/de/authPassword.html new file mode 100644 index 0000000..165d976 --- /dev/null +++ b/config/de/authPassword.html @@ -0,0 +1,60 @@ + + + + +Beglaubigen... + + + + + + +

+Kennwort für + +: +

+

+ + + +
+ + + diff --git a/config/de/authSearch.html b/config/de/authSearch.html new file mode 100644 index 0000000..5deb8ef --- /dev/null +++ b/config/de/authSearch.html @@ -0,0 +1,64 @@ + + + + +Beglaubigen... + + + + + +Um Ihren Zugriff zu dem Verzeichnis zu beglaubigen, müssen Sie sich zunächst zu erkennen geben.
Geben Sie Ihren Namen ein: + +

+

+ + + +
+ +

+ + (nur für Verzeichnis-Administratoren verfügbar) + + + + + + diff --git a/config/de/csearchAttr.html b/config/de/csearchAttr.html new file mode 100644 index 0000000..e99a4b3 --- /dev/null +++ b/config/de/csearchAttr.html @@ -0,0 +1,48 @@ + + + + + + + + + +
wobei: + +
diff --git a/config/de/csearchBase.html b/config/de/csearchBase.html new file mode 100644 index 0000000..b4554ee --- /dev/null +++ b/config/de/csearchBase.html @@ -0,0 +1,48 @@ + + + + + + + + +
innerhalb von: + +
+ diff --git a/config/de/csearchString.html b/config/de/csearchString.html new file mode 100644 index 0000000..a5f9b98 --- /dev/null +++ b/config/de/csearchString.html @@ -0,0 +1,59 @@ + + + + + + + + + + + +
+ + + + innerhalb von: + +
+ + + + + diff --git a/config/de/csearchType.html b/config/de/csearchType.html new file mode 100644 index 0000000..b617baf --- /dev/null +++ b/config/de/csearchType.html @@ -0,0 +1,49 @@ + + + + + + + + + +
Suchen: + +
+ diff --git a/config/de/display-country.html b/config/de/display-country.html new file mode 100644 index 0000000..1d7e553 --- /dev/null +++ b/config/de/display-country.html @@ -0,0 +1,85 @@ + + + + + + +Land - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + +
+Land + + +
+ + + + + + + + + + + +
Landesname: + +Beschreibung: + +
Siehe auch: + +
URL: + +
+ +


+ +Eintrag zuletzt geändert am + + von + + + + + + diff --git a/config/de/display-dnedit.html b/config/de/display-dnedit.html new file mode 100644 index 0000000..c9f816b --- /dev/null +++ b/config/de/display-dnedit.html @@ -0,0 +1,107 @@ + + + + + + +Bearbeiten +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + + + + + + + + +Bearbeiten + +: + + + + + + + + + + + + +
+Suchen von + + +passend zu  + + + +
+ +
+ +

+

+ +
+ + + + + +
+ + + + + + + diff --git a/config/de/display-dneditpeople.html b/config/de/display-dneditpeople.html new file mode 100644 index 0000000..a22bd64 --- /dev/null +++ b/config/de/display-dneditpeople.html @@ -0,0 +1,106 @@ + + + + + + +Bearbeiten +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + + + + + + + + +Bearbeiten + +: + + + + + + + + + +
+Suchen von + + +passend zu  + + + +
+ + + + + + + diff --git a/config/de/display-group.html b/config/de/display-group.html new file mode 100644 index 0000000..c56efc3 --- /dev/null +++ b/config/de/display-group.html @@ -0,0 +1,181 @@ + + + + + + + +<!-- IF "Adding" --> +Neuer +<!-- ENDIF // Adding --> +Gruppeneintrag - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + +
+Gruppe + + +Neue Gruppe - + + + +
+ + + + + + + +
+ + + + + + + +   + + + +   + + + + + +   + + + +
+ + + + + + + + + + +
+ +* bezeichnet einen Pflichteintrag
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Name: + +* + + + +
Beschreibung: + +
Eigentümer:
+ + + +
+ +
Siehe auch:
+ + + +
+ + + + + +Sie müssen diesen Eintrag speichern, bevor Sie diese Felder bearbeiten können. + +
Gruppenmitglieder:
+ + + +
+ +
+ + +
+Eintrag zuletzt geändert am + + von + + + + + + + + diff --git a/config/de/display-groupun.html b/config/de/display-groupun.html new file mode 100644 index 0000000..edf523d --- /dev/null +++ b/config/de/display-groupun.html @@ -0,0 +1,181 @@ + + + + + + + +<!-- IF "Adding" --> +Neuer +<!-- ENDIF // Adding --> +Gruppeneintrag - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + +
+Gruppe + + +Neue Gruppe - + + + +
+ + + + + + + +
+ + + + + + + +   + + + +   + + + + + +   + + + +
+ + + + + + + + + + +
+ +* bezeichnet einen Pflichteintrag
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Name: + +* + + + +
Beschreibung: + +
Eigentümer:
+ + + +
+ +
Siehe auch:
+ + + +
+ + + + + +Sie müssen diesen Eintrag speichern, bevor Sie diese Felder bearbeiten können. + +
Gruppenmitglieder:
+ + + +
+ +
+ + +
+Eintrag zuletzt geändert am + + von + + + + + + + + diff --git a/config/de/display-mailgroup.html b/config/de/display-mailgroup.html new file mode 100644 index 0000000..76a9528 --- /dev/null +++ b/config/de/display-mailgroup.html @@ -0,0 +1,155 @@ + + + + + + + +<!-- IF "Adding" --> +Neuer +<!-- ENDIF // Adding --> +E-Mail-Gruppeneintrag - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + +
+Gruppe + + +Neue E-Mail-Gruppe + + + + +
+ + + + +
+ + + + + + + +   + + + +   + + + + + + + +   + + + +
+ + + + + + + +
+ + + + + + + + + + + + + + +
+ + + + + + + +
Name: + +Beschreibung: + +
Eigentümer: + +
Siehe auch: + +
+ + + +
Gruppenmitglieder: + +
E-Mail-Mitglieder: + +
+ + +
+Eintrag zuletzt geändert am + + von + + + + + + + + diff --git a/config/de/display-ntgroup.html b/config/de/display-ntgroup.html new file mode 100644 index 0000000..d42b7ac --- /dev/null +++ b/config/de/display-ntgroup.html @@ -0,0 +1,247 @@ + + + + + + + +<!-- IF "Adding" --> +Neuer +<!-- ENDIF // Adding --> +NT-Gruppeneintrag - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + +
+Gruppe + + +Neue NT-Gruppe - + + + +
+ + + + + + + +
+ + + + + + + +   + + + +   + + + + + +   + + + +
+ + + + + + + + + + + +
+ +* bezeichnet einen Pflichteintrag
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name: + +* + + + +
NT-Gruppenname: + +* + + + + + + + +
NT-Gruppentyp: + +* + + + + + + + +
NT-Gruppendomäne + +* + + + +
Beschreibung: + +
Lokal: + +
Geschäftsbereich: + +
Eigentümer:
+ + + +
+ +
Siehe auch:
+ + + +
+ + + + + +Sie müssen diesen Eintrag speichern, bevor Sie diese Felder bearbeiten können. + +
NT-Gruppenmitglieder:
+ + + +
+ +
NT-Gruppe löschen, wenn Gruppe gelöscht wird: + +
Neues NT-Gruppenkonto erstellen: + +
+ + +
+Eintrag zuletzt geändert am + + von + + + + + + + + diff --git a/config/de/display-ntperson.html b/config/de/display-ntperson.html new file mode 100644 index 0000000..8a8a974 --- /dev/null +++ b/config/de/display-ntperson.html @@ -0,0 +1,536 @@ + + + + + + + + +<!-- IF "Adding" --> +Neuer +<!-- ENDIF // Adding --> +NT-Benutzereintrag - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + + + + + + + + +
+ + + +BORDER=0> + + +Benutzer (Anklicken, um Karte anzuzeigen) + + + + + > +Click to display organization chart + + + +Neuer NT-Benutzer - + + +
+ + + + +>Download Certificate + + + + +   + +>Play Audio Clip + + + + + + + + +
+ + +   + + + + + + +   + + + +   + + + + + +   + + + + + +
+ + + + + + + + + + + + + + +* bezeichnet einen Pflichteintrag
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Kontaktinformationen
Vorname: + +Vollständiger Name: + +* + + + +
Nachname: + +* + + + +
Directory-Server-Kennwort: + + Kennwort zur Bestätigung wiederholen: + +
Telefon: + +E-Mail-Adresse: + +
Fax: + +Benutzer-ID: + +
Pager: + +Mobiltelefon: + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Windows NT Kontoinformationen
NT-Benutzer-ID: + +* + + + + + + + + +NT-Domäne: + +* + + + +
NT-Benutzerkonto löschen, wenn Benutzer gelöscht wird: + +
Neues NT-Benutzerkonto erstellen: + +
NT-Benutzer-Kommentar: + +Eindeutige NT-Benutzer-ID: + +
NT-Kennwort abgelaufen: + +Anzahl falscher NT-Kennworteingaben: + +
Letzte NT-Anmeldung: + +Letzte NT-Abmeldung: + +
Verfalldatum NT-Benutzerkonto: + +Anzahl NT-Anmeldungen: + +
NT-Anmelde-Server: + +NT-Arbeitsstationen: + +
NT-Codeseite: + +NT-Landescode: + +
Primäre NT-Gruppen-ID: + +NT-Profil: + +
NT-Basisverzeichnis: + +Laufwerk des NT-Basisverzeichnisses: + +
NT-Skriptpfad: + +Maximaler NT-Speicherplatz: + +
NT-Einheiten pro Woche: + +Rechte des NT-Benutzers: + +
Operator-Rechte des NT-Benutzers: + +Div. betr. NT-Benutzerkonto: Funktionen: + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Branchen- und Positionsinformationen
Branche: + +Titel: + +
Geschäftsbereich: + +Leiter:
+ + + +
+Sie müssen diesen Eintrag speichern, bevor Sie diese Felder bearbeiten können. + + + + + +
Raum: + +Sekr.:
+ + + +
+ +
Abt.-Nr.: + +MA-Nr.: + +
Kfz-Kennzeichen: + +    
Postadresse: + +
+ + + + + + + + + + + + + + + + + + + + +--> + +
+Zusätzliche Informationen
Beschreibung: + +
Siehe auch:
+ + + +
+ +Sie müssen diesen Eintrag speichern, bevor Sie diese Felder bearbeiten können. + + + + + +
URL: + +
+ + +Eintrag zuletzt geändert am + + von + + + + + + + + diff --git a/config/de/display-org.html b/config/de/display-org.html new file mode 100644 index 0000000..94fe6da --- /dev/null +++ b/config/de/display-org.html @@ -0,0 +1,167 @@ + + + + + + + +<!-- IF "Adding" --> +Neue +<!-- ENDIF // Adding --> +Firma - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + +
+Firma + + + +Neue Firma - + + + +
+ + + + + + + +
+ + + + + + + +   + + + +   + + + + + +   + + + +
+ + + + + + + + + + +
+ +* bezeichnet einen Pflichteintrag
+ + + + + + + + + + + + + + + + + + + + + + +
Firmenname: + +* + + + +Beschreibung: + +
Telefon: + +Branche: + +
Fax: + +Standort: + +
Postadresse: + +
Siehe auch: + +
+ + +
+Eintrag zuletzt geändert am + + von + + + + + + + + diff --git a/config/de/display-orgperson.html b/config/de/display-orgperson.html new file mode 100644 index 0000000..1e745cc --- /dev/null +++ b/config/de/display-orgperson.html @@ -0,0 +1,376 @@ + + + + + + + + +<!-- IF "Adding" --> +Neuer +<!-- ENDIF // Adding --> +Personeneintrag - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + + + + + + + + + +
+ + + +BORDER=0> + + + +Benutzer (Anklicken, um Karte anzuzeigen) + + + + > +Click to display organization chart + + + +Neue Person - + + +
+ + + + +>Zertifikat laden + + + + +   + +>Audio-Clip abspielen + + + + + + + + +
+ + +   + + + + + + +   + + + +   + + + + + +   + + + + + +
+ + + + + + + + + + + + + +* bezeichnet einen Pflichteintrag
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Kontaktinformationen
Vorname: + +Vollständiger Name: + +* + + + +
Nachname: + +* + + + +
Kennwort: + + Kennwort zur Bestätigung wiederholen: + +
Telefon: + +E-Mail-Adresse: + +
Fax: + +Benutzer-ID: + +
Pager: + +Mobiltelefon: + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Branchen- und Positionsinformationen
Branche: + +Titel: + +
Geschäftsbereich: + +Leiter:
+ + + +
+Sie müssen diesen Eintrag speichern, bevor Sie diese Felder bearbeiten können. + + + + + +
Raum: + +Sekr.:
+ + + +
+ +
Abt.-Nr.: + +MA-Nr.: + +
Kfz-Kennzeichen: + +    
Postadresse: + +
+ + + + + + + + + + + + + + + + + + + + +--> + +
+Zusätzliche Informationen
Beschreibung: + +
Siehe auch:
+ + + +
+ +Sie müssen diesen Eintrag speichern, bevor Sie dieses Feld bearbeiten können. + + + + + +
URL: + +
+ + +Eintrag zuletzt geändert am + + von + + + + + + + + diff --git a/config/de/display-orgunit.html b/config/de/display-orgunit.html new file mode 100644 index 0000000..d91afec --- /dev/null +++ b/config/de/display-orgunit.html @@ -0,0 +1,167 @@ + + + + + + + +<!-- IF "Adding" --> +Neuer +<!-- ENDIF // Adding --> +Gesch��ftsbereich - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + +
+Geschäftsbereich + + + +Neuer Geschäftsbereich - + + + +
+ + + + + + + +
+ + + + + + + +   + + + +   + + + + + +   + + + +
+ + + + + + + + + + +
+ +* bezeichnet einen Pflichteintrag
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Name des Geschäftsbereichs:* + + + + +Beschreibung: + +
Telefon: + +Branche: + +
Fax: + +Standort: + +
Postadresse: + +
Siehe auch: + +
+ + +
+Eintrag zuletzt geändert am + + von + + + + + + + + diff --git a/config/de/display-person.html b/config/de/display-person.html new file mode 100644 index 0000000..1d5b9f4 --- /dev/null +++ b/config/de/display-person.html @@ -0,0 +1,262 @@ + + + + + + + + +<!-- IF "Adding" --> +Neuer +<!-- ENDIF // Adding --> +Personeneintrag - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + + + + + + + +
+ +Benutzer (Anklicken, um Karte anzuzeigen) + + + + > +Click to display organization chart + + + +Neue Person - + + +
+ + + + + + + +
+ + +   + + + + + + +   + + + +   + + + + + +   + + + + + +
+ + + + + + + + + + +
+ +* bezeichnet einen Pflichteintrag
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Nachname: + +* + + + +Vollständiger Name: + +

Kennwort: + + Kennwort zur Bestätigung wiederholen: + +

Telefon: + +E-Mail-Adresse: + +
Fax: + +Benutzer-ID: + +
Pager: + +Mobiltelefon: + +

Titel: + +
Postadresse: + +

Beschreibung: + +
Siehe auch:
+ + + +
+ +Sie müssen diesen Eintrag speichern, bevor Sie diese Felder bearbeiten können. + + + + + +
URL: + +
Lieblingsgetränk: + +
+ + +
+Eintrag zuletzt geändert am + + von + + + + + + + + diff --git a/config/de/display-umperson.html b/config/de/display-umperson.html new file mode 100644 index 0000000..b5fb42c --- /dev/null +++ b/config/de/display-umperson.html @@ -0,0 +1,231 @@ + + + + + + + + +<!-- IF "Adding" --> +Neuer +<!-- ENDIF // Adding --> +Personeneintrag - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + + +
+ +> +Person + + + > +Click to display organization chart + + + +Neue Person - + + +
+ + +>Audio-Clip abspielen + + + + + + + +
+ + + + + + + +   + + + +   + + + + + +   + + + + + +
+ + + + + + + + +
+ +* bezeichnet einen Pflichteintrag
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Nachname: + +* + + + +Vollständiger Name: + +* + + + +
Telefon: + +E-Mail-Adresse: + +
Fax: + +Eindeutiger Name: + +
Pager: + +Mobiltelefon: + +

Titel: + +
Postadresse: + +

Beschreibung: + +
Siehe auch:
+ +
+ +
URL: + +
Lieblingsgetränk: + +
+ + +
+Eintrag zuletzt geändert am + + von + + + + + + + + diff --git a/config/de/dsgw-l10n.conf b/config/de/dsgw-l10n.conf new file mode 100644 index 0000000..3155f83 --- /dev/null +++ b/config/de/dsgw-l10n.conf @@ -0,0 +1,50 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# To localize the search type menu: +# Locate dsgw-l10n.conf in config//. +# dsgw-l10n.conf contains translated words for search type pulldown menu. +# dsgw-l10n.conf sample: +# Note: the sample part should have double #'s for L10n. +## translate People +## translate NT-People +## translate Groups +## translate NT-Groups +## translate Organizations +## translate Org-Units +## translate Anything diff --git a/config/de/dsgw.conf b/config/de/dsgw.conf new file mode 100644 index 0000000..555de71 --- /dev/null +++ b/config/de/dsgw.conf @@ -0,0 +1,165 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# The baseurl directive gives the server, port, and base dn where searches +# should be rooted. The format is: +# +# ldap://host.domain[:port]/basedn +# - or - +# ldaps://host.domain:port/basedn (for SSL) +# +# Where: +# - "host.domain" is the fully-qualified domain name of the directory server +# - "port" is the port used by the directory server. If you are using an +# "ldaps" URL (that is, if the gateway is using SSL to communicate with the +# directory server), then the port number is required. Otherwise, it is +# optional and defaults to the standard LDAP port (389). +# - "basedn" is the distinguished name of the place in the directory tree +# where searches should start. Typically, this is the same as the +# "suffix" directive in your slapd.conf file. +# +# examples: +# baseurl "ldap://mars.aceindustry.com/o=Ace Industry, c=US" +# - causes the gateway to use the directory server running on host +# "mars.aceindustry.com". Since no port was given, the default LDAP +# port (389) is used. Searches in the gateway search for entries +# contained within o=Ace Industry, c=US. +# +# baseurl "ldaps://mars.aceindustry.com:636/o=Ace Industry, c=US" +# - same as above, but uses SSL to connect to the directory server, +# and contacts the server on port 636. + +baseurl "ldap://ggood.mcom.com:389/o=Netscape Communications Corp., c=US" +#baseurl "ldap://belltower.mcom.com:9000/o=Ace%20Industry,%20c=US" +#baseurl "ldap://belltower:9000/o=Netscape Communications Corp., c=US" +#baseurl "ldap://ldap.itd.umich.edu:389/o=University of Michigan, c=US" + +# The dirmgr directive specifies the "Manager" DN for your directory. +dirmgr "cn=Directory Manager, o=Netscape Communications Corp., c=US" + +# The securitypath directive gives the full path name to your +# security databases. +#securitypath /tmp/ssl + +# If the requireauth directive is present, users must authenticate to the +# directory before they may perform any operations. XXX: not implemented +# in 1.0b2. +#requireauth + +# The authlifetime directive specifies how long authentication credentials +# are valid (in seconds). +authlifetime 7200 + +# The default character set, for communication with HTTP clients. +# A client may override this default, using an HTTP Accept-Charset header. +# Or, this default may be overridden for a specific language, by creating +# a LANG/dsgwcharset.conf file which contains the charset name. +# For compatibility with HTTP clients that can't handle an HTTP response +# with a charset parameter in the content-type, comment out this directive; +# responses will be sent in ISO-8859-1, with no explicit charset parameter. +# RFC 1345 defines the syntax of charset names. There is a registry of +# charsets, at ftp://ftp.isi.edu/in-notes/iana/assignments/character-sets +# charset UTF-8 + +# The NLS (internationalization) directory. The directory of this name +# should contain a locales directory, which contains configuration files. +NLS ../../../lib/nls + +location-suffix "o=Netscape Communications Corp., c=US" + +# Mapping between config/display-XXX.html templates and LDAP objectClasses. +# This can be generated by using ds/templateindex. The format is: +# +# template TEMPLATENAME OBJECTCLASSES +# +# where "display-TEMPLATENAME.html" is the name of a display template +# that is found in this config directory (e.g., "display-group.html") and +# OBJECTCLASSES is a list of one or more objectClass values. For a given +# template to be used, all the objectClass values listed must be present +# in the directory entry, so the order of these template lines is +# significant (e.g. note that the more specific "umperson" and +# "orgperson" templates are listed before the one for an ordinary "person"). +# +template group groupOfNames +template groupun groupOfUniqueNames +template mailgroup rfc822mailgroup +template org organization +template orgunit organizationalUnit +template ntperson person inetOrgPerson nTUser +template umperson person umichPerson +template orgperson person inetOrgPerson +template person person +template country country + +# +# The remainder of this file contains information about the locations and +# types for new entries. +# +# "location" lines define places in the directory where new entries can be added +# The format of each line is: +# location HANDLE FRIENDLYNAME DN +# where HANDLE is a short name which is used in the "newtype" lines (see below) +# and FRIENDLYNAME is a human-readable name for the location +# and DN is the Distinguished Name for this location (if it does not end with +# '#', the location-suffix is appended to to construct a full DN; if it +# does end with `#', it assumed to be a full DN and the `#' is removed). +# +location country "USA" "c=US#" +location org "Eigene Firma" "" +location groups "Gruppen in Firma" "ou=Groups" +location acct "Buchhaltung" "ou=Accounting" +location hr "Personal" "ou=Human Resources" +location pay "Lohnbuchhaltung" "ou=Payroll" +location pd "Produktentwicklung" "ou=Product Development" +location test "Produkttests" "ou=Product Testing" + +# "newtype" lines define the types of new entries that may be added +# The format of each line is: +# newtype TEMPLATENAME FRIENDLYNAME RDNATTR LOCATIONS... +# where TEMPLATENAME corresponds to an existing add-TEMPLATENAME.html file +# and FRIENDLYNAME is a human-readable name for this type of entry +# and RDNATTR is the attribute that is used to name entries of this type +# and LOCATIONS is a blank-separated list of locations where these types of +# entries can be added (corresponding to a HANDLE on a "location" +# config. file line). +# +newtype orgperson "Person" cn acct hr pay pd test +newtype ntperson "NT-Benutzer" cn acct hr pay pd test +newtype groupun "Gruppe" cn groups +newtype orgunit "Organisationseinheit" ou org +newtype org "Firma" o country diff --git a/config/de/dsgw.tmpl b/config/de/dsgw.tmpl new file mode 100644 index 0000000..7066812 --- /dev/null +++ b/config/de/dsgw.tmpl @@ -0,0 +1,154 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK + +# The htmldir directive tells the CGIs where to find the html files +htmldir ../html + +# The configdir directive tells the CGIs where to find the +# templates/configuration files +configdir ../config + +# The gwnametrans directive tells the CGIs what url to output +# for http redirection. It should be the same nameTrans set +# in the webserver, if any is being is used. +gwnametrans /clients/dsgw/html/ + +# The authlifetime directive specifies how long authentication credentials +# are valid (in seconds). +authlifetime 7200 + +# The libNLS data directory. This directory should contain a directory +# named "locales", which contains the configuration files LANG.ctx and +# LANG.txt for each supported language (locale). +NLS ../../../lib/nls + +# The default character set, for communication with HTTP clients. +# A client may override this default, using an HTTP Accept-Charset header. +# Or, this default may be overridden for a specific language, by creating +# a LANG/dsgwcharset.conf file which contains the charset name. +# For compatibility with HTTP clients that can't handle an HTTP response +# with a charset parameter in the content-type, comment out this directive; +# responses will be sent in ISO-8859-1, with no explicit charset parameter. +# RFC 1345 defines the syntax of charset names. There is a registry of +# charsets, at ftp://ftp.isi.edu/in-notes/iana/assignments/character-sets +# charset UTF-8 + +# Substitute ideographic space for non-breaking space in Asian charsets: +changeHTML "  " " " Shift_JIS Big5 EUC-KR +changeHTML " " " " Shift_JIS Big5 EUC-KR + +# Mapping between config/display-XXX.html templates and LDAP objectClasses. +# This can be generated by using ds/templateindex. The format is: +# +# template TEMPLATENAME OBJECTCLASSES +# +# where "display-TEMPLATENAME.html" is the name of a display template +# that is found in this config directory (e.g., "display-group.html") and +# OBJECTCLASSES is a list of one or more objectClass values. For a given +# template to be used, all the objectClass values listed must be present +# in the directory entry, so the order of these template lines is +# significant (e.g. note that the more specific "orgperson" template is +# listed before the one for an ordinary "person"). +# +template group groupOfNames +template ntgroup groupOfUniqueNames ntGroup +template groupun groupOfUniqueNames +template org organization +template orgunit organizationalUnit +template ntperson person inetOrgPerson nTUser +template orgperson person inetOrgPerson +template person person +template country country + +# +# The remainder of this file contains information about the locations and +# types for new entries. +# +# "location" lines define places in the directory where new entries can be added +# The format of each line is: +# location HANDLE FRIENDLYNAME DN +# where HANDLE is a short name which is used in the "newtype" lines (see below) +# and FRIENDLYNAME is a human-readable name for the location +# and DN is the Distinguished Name for this location (if it does not end with +# '#', the location-suffix is appended to to construct a full DN; if it +# does end with `#', it assumed to be a full DN and the `#' is removed). +# +location country "USA" "c=US#" +location org "Diese Organisation" "" +location groups "Gruppen" "ou=Groups" +location people "Personen" "ou=People" +location special "Spezialbenutzer" "ou=Special Users" + +# "newtype" lines define the types of new entries that may be added +# The format of each line is: +# newtype TEMPLATENAME FRIENDLYNAME RDNATTR LOCATIONS... +# where TEMPLATENAME corresponds to an existing display-TEMPLATENAME.html file +# and FRIENDLYNAME is a human-readable name for this type of entry +# and RDNATTR is the attribute that is used to name entries of this type +# and LOCATIONS is a blank-separated list of locations where these types of +# entries can be added (corresponding to a HANDLE on a "location" +# config. file line). +# +newtype orgperson "Person" uid people special +newtype ntperson "NT-Benutzer" uid people special +newtype ntgroup "NT-Gruppe" cn groups +newtype groupun "Gruppe" cn groups +newtype orgunit "Geschäftsbereich" ou people org +newtype org "Firma" o country + +# Mappings between VCard properties and LDAP attribute types: +# The format of each line is: +# vcard-property VCARDPROP SYNTAX LDAPATTR [LDAPATTR2] +# where VCARDPROP is the name of a VCard property +# and SYNTAX is "cis" for simple strings and "mls" for multiline strings +# and LDAPATTR is the LDAP attribute that corresponds to VCARDPROP +# and LDAPATTR2 is an optional secondary LDAP attribute which is added to +# the property value by appending a semicolon and then the attr2 value. +vcard-property FN cis cn +vcard-property N cis sn givenName +vcard-property ORG cis o ou +vcard-property ROLE cis businessCategory +vcard-property ADR;WORK mls postalAddress +vcard-property ADR;HOME mls homePostalAddress +vcard-property EMAIL;INTERNET cis mail +vcard-property TITLE cis title +vcard-property TEL;WORK cis telephoneNumber +vcard-property TEL;FAX cis facsimileTelephoneNumber +vcard-property TEL;CELL cis mobile +vcard-property TEL;HOME cis homePhone +vcard-property NOTE cis description diff --git a/config/de/dsgw_adm.conf b/config/de/dsgw_adm.conf new file mode 100644 index 0000000..d139037 --- /dev/null +++ b/config/de/dsgw_adm.conf @@ -0,0 +1,78 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# Mapping between config/display-XXX.html templates and LDAP objectClasses. +# This can be generated by using the templateindex program. The format is: +# +# template TEMPLATENAME OBJECTCLASSES +# +# where "display-TEMPLATENAME.html" is the name of a display template +# that is found in this config directory (e.g., "display-group.html") and +# OBJECTCLASSES is a list of one or more objectClass values. For a given +# template to be used, all the objectClass values listed must be present +# in the directory entry, so the order of these template lines is +# significant (e.g. note that the more specific "orgperson" template is +# listed before the one for an ordinary "person"). +# +template group groupOfNames +template groupun groupOfUniqueNames +template org organization +template orgunit organizationalUnit +template orgperson person inetOrgPerson +template person person +template country country +template licensed-user nsLicenseUser + +# Attribute Value Sets (used with DS_ATTRVAL_SET directives) +# attrvset HANDLE VALUE PREFIX SUFFIX +# +attrvset CAL news "" "Netscape Collabra Server" +attrvset CAL slapd "" "Netscape Directory Server" + + +# Template Set definitions +# Note: templates must be defined before they can be mentioned on +# a tmplset line. +# +# tmplset SETNAME VIEWNAME TEMPLATENAME [HREF-LOCATION] +# +tmplset person "Allgemein" orgperson +tmplset person "Kennwort:" passwd +tmplset person "Lizenzen" licensed-user +tmplset group "Allgemein" group +tmplset groupun "Allgemein" groupun diff --git a/config/de/dsgwfilter.conf b/config/de/dsgwfilter.conf new file mode 100644 index 0000000..936d99d --- /dev/null +++ b/config/de/dsgwfilter.conf @@ -0,0 +1,171 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# ldap filter file +# +# lines like this that start with # or empty lines are ignored +# +# syntax: +# +# +# [] +# [] +# +# [] ... +# +# The should describe the filter. It should correctly complete +# the phrases (in the resource database) DBT_Found0EntriesWhere_, +# DBT_Found1EntryWhere_ and DBT_FoundEntriesWhere_; for example: +# +# Found 1 entry where the '%v'. +# Found no entries where the '%v'. +# Found 3 entries where the '%v'. +# +# The should begin with the article ("the" in English) for +# languages that require agreement between article and noun (e.g +# genders in Spanish or French). +# +# The scope is optional, and should be one of: +# "base" +# "onelevel" +# "subtree" +# if it is included. + +# +# Directory Server gateway +# + +"dsgw-people" + "=" " " "(%v))" "LDAP-Filter ist" + + "^[+]*[0-9][ 0-9-]*$" " " "(telephoneNumber=*%v))" "Telefonnummer endet mit" + + "@" " " "(mail=%v))" "E-Mail-Adresse ist" + "(mail=%v*))" "E-Mail-Adresse beginnt mit" + + "^.[. _].*" ". _" "(cn=%v1* %v2-))" "Erste Initiale + Name ist" + + ".*[. _].$" ". _" "(cn=%v1-*))" "Name + letzte Initiale ist" + + "[. _]" ". _" "(|(sn=%v1-)(cn=%v1-)))" "Name ist" + "(|(cn=*%v1-*)(sn=*%v1-*)(cn~=%v1-)(sn~=%v1-)))" "Name ähnlich wie oder enthält" + + "^\*$" " " "(|(cn=*)(sn=*)(uid=*)))" "Name oder Benutzer-ID ist" + + ".*" ". " "(|(cn=%v1)(sn=%v1)(uid=%v1)))" "Name oder Benutzer-ID ist" + "(|(cn=*%v1*)(sn=*%v1*)(cn~=%v1)(sn~=%v1)))" "Name ähnlich wie oder enthält" + + +"dsgw-groups" + "=" " " "(%v))" "LDAP-Filter ist" + + "^\*$" " " "(cn=*))" "Name ist" + + ".*" ". _" "(cn=%v1-))" "Name ist" + "(cn=*%v1-*))" "Name enthält" + "(cn~=%v1-))" "Name ähnlich wie" + +"dsgw-ntgroups" + "=" " " "(%v))" "LDAP-Filter ist" + + "^\*$" " " "(cn=*))" "Name ist" + + ".*" ". _" "(cn=%v1-))" "Name ist" + "(cn=*%v1-*))" "Name enthält" + "(cn~=%v1-))" "Name ähnlich wie" + "(ntgroupdomainid=%v:*))" "NT-Domäne:" + "(ntgroupdomainid=*:%v))" "NT-Gruppe ist" + +"dsgw-organizations" + "=" " " "(%v))" "LDAP-Filter ist" + + "\." " " "(associatedDomain=%v))" "Zugehörige Domäne ist" + + "^\*$" " " "(o=*))" "Name ist" + + ".*" " " "(o=%v))" "Name ist" + "(o=*%v*))" "Name enthält" + "(o~=%v))" "Name ähnlich wie" + +"dsgw-orgunits" + "=" " " "(%v))" "LDAP-Filter ist" + + "\." " " "(associatedDomain=%v))" "Zugehörige Domäne ist" + + "^\*$" " " "(ou=*))" "Name ist" + + ".*" " " "(ou=%v))" "Name ist" + "(ou=*%v*))" "Name enthält" + "(ou~=%v))" "Name ähnlich wie" + +"dsgw-anything" + "=" " " "(%v)" "LDAP-Filter ist" + + "[. _]" ". _" "(|(sn=%v1-)(cn=%v1-)(o=%v1-)(ou=%v1-))" "Name ist" + "(|(sn~=%v1-)(cn~=%v1-)(o=%v1-)(ou=%v1-))" "Name ähnlich wie" + + "^\*$" " " "(|(cn=*)(sn=*)(o=*)(ou=*))" "Name ist" + + ".*" ". " "(|(cn=%v1)(sn=%v1)(o=%v1)(ou=%v1))" "Name ist" + "(|(cn=*%v1*)(sn=*%v1*)(cn~=%v1)(sn~=%v1)(o=%v1)(ou=%v1))" "Name ähnlich wie oder enthält" + + +"dsgw-ntpeople" + "=" " " "(%v))" "LDAP-Filter ist" + + "^[+]*[0-9][ 0-9-]*$" " " "(telephoneNumber=*%v))" "Telefonnummer endet mit" + + "@" " " "(mail=%v))" "E-Mail-Adresse ist" + "(mail=%v*))" "E-Mail-Adresse beginnt mit" + + "^.[. _].*" ". _" "(cn=%v1* %v2-))" "Erste Initiale + Name ist" + + ".*[. _].$" ". _" "(cn=%v1-*))" "Name + letzte Initiale ist" + + "[. _]" ". _" "(|(sn=%v1-)(cn=%v1-)))" "Name ist" + "(|(cn=*%v1-*)(sn=*%v1-*)(cn~=%v1-)(sn~=%v1-)))" "Name ähnlich wie oder enthält" + + "^\*$" " " "(|(cn=*)(sn=*)))" "Name ist" + + ".*" ". " "(|(cn=%v1)(sn=%v1)))" "Name ist" + "(ntuserlogonserver=%v))" "NT-Anmelde-Server ist" + "(ntuserdomainid=%v:*))" "NT-Domänenname ist:" + "(ntuserdomainid=*:%v))" "NT-Benutzername ist" + "(|(cn=*%v1*)(sn=*%v1*)(cn~=%v1)(sn~=%v1)))" "Name ähnlich wie oder enthält" + +# Do not remove this line, or place any directives after it. diff --git a/config/de/dsgwfilter_adm.conf b/config/de/dsgwfilter_adm.conf new file mode 100644 index 0000000..b69ac1f --- /dev/null +++ b/config/de/dsgwfilter_adm.conf @@ -0,0 +1,105 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# ldap filter file +# +# lines like this that start with # or empty lines are ignored +# +# syntax: +# +# +# [] +# [] +# +# [] ... +# +# The should describe the filter. It should correctly complete +# the phrases (in the resource database) DBT_Found0EntriesWhere_, +# DBT_Found1EntryWhere_ and DBT_FoundEntriesWhere_; for example (en): +# +# Found 1 entry where the '%v'. +# Found no entries where the '%v'. +# Found 3 entries where the '%v'. +# +# The should begin with the article ("the" in English) for +# languages that require agreement between article and noun (e.g +# genders in Spanish or French). +# +# The scope is optional, and should be one of: +# "base" +# "onelevel" +# "subtree" +# if it is included. + +# +# Directory Server gateway - for Netscape Admin Server +# + +"dsgw-people" + "=" " " "(%v))" "LDAP-Filter ist" + + "^[+]*[0-9][ 0-9-]*$" " " "(telephoneNumber=*%v))" "Telefonnummer endet mit" + + "@" " " "(mail=%v))" "E-Mail-Adresse ist" + "(mail=%v*))" "E-Mail-Adresse beginnt mit" + + "^.[. _].*" ". _" "(cn=%v1* %v2-))" "erste Initiale + Name ist" + + ".*[. _].$" ". _" "(cn=%v1-*))" "Name + letzte Initiale ist" + + "[. _]" ". _" "(|(sn=%v1-)(cn=%v1-)))" "Name ist" + "(|(cn=*%v1-*)(sn=*%v1-*)(cn~=%v1-)(sn~=%v1-)))" "Name sounds like or contains" + + ".*" ". " "(uid=%v1))" "Anmelde-ID ist" + "(|(cn=%v1)(sn=%v1)))" "Name ist" + "(|(cn=*%v1*)(sn=*%v1*)(cn~=%v1)(sn~=%v1)))" "Name ähnlich wie oder enthält" + + +"dsgw-groups" + "=" " " "(%v))" "LDAP-Filter ist" + + ".*" ". _" "(cn=%v1-))" "Name ist" + "(cn~=%v1-))" "Name ähnlich wie" + +"dsgw-orgunits" + "=" " " "(%v))" "LDAP-Filter ist" + + ".*" ". _" "(ou=%v1-))" "Name des Geschäftsbereichs ist" + "(ou~=%v1-))" "Name des Geschäftsbereichs ähnlich wie + +#Do not remove this line, or place any additional lines after it. diff --git a/config/de/dsgwsearchprefs.conf b/config/de/dsgwsearchprefs.conf new file mode 100644 index 0000000..bb58da5 --- /dev/null +++ b/config/de/dsgwsearchprefs.conf @@ -0,0 +1,245 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# dsgwsearchprefs.conf - directory server gateway search object definitions + + +# the current version of this file format is 1 +Version 1 + + +# Name for this search object +People +# options (the only one supported right now is "internal" which means that +# this search object should not be presented directly to the user) +# use "" for none +"" +# Label to place before text box user types in +"Suchen nach:" +# Filter prefix to append to all searches +"(&(objectClass=person)" +# Tag to use for "Fewer Choices" searches - from ldapfilter.conf file +"dsgw-people" +# If a search results in > 1 match, retrieve this attribute to help +# user disambiguate the entries... +not-used-by-dsgw +# ...and label it with this string: +not-used-by-dsgw +# Search scope to use when searching +subtree +# Follows a list of "More Choices" search options. Format is: +# Label, attribute, select-bitmap, extra attr display name, extra attr ldap name +# If last two are null, "Fewer Choices" name/attributes used. +# Label should begin with the article ("the" in English) for +# languages that require agreement between article and noun +# (e.g genders in Spanish or French). + +"Vollständiger Name" cn 111111 "" "" +"Nachname" sn 111111 "" "" +"Telefon" "telephoneNumber" 111011 "" "" +"E-Mail-Adresse" "mail" 111111 "" "" +"Benutzer-ID" "uid" 111111 "" "" +"Titel" title 111111 "" "" +END +# Match types +"ist" "(%a=%v))" +"ist nicht" "(!(%a=%v)))" +"Mit Mustervergleich" "(%a~=%v))" +"beginnt mit" "(%a=%v*))" +"endet mit" "(%a=*%v))" +"enthält" "(%a=*%v*))" +END + + +"NT-People" +"" +"Suchen nach:" +"(&(objectClass=ntuser)" +"dsgw-ntpeople" +not-used-by-dsgw +not-used-by-dsgw +subtree +"Vollständiger Name" cn 111111 "" "" +"Nachname" sn 111111 "" "" +"Telefon" "telephoneNumber" 111011 "" "" +"E-Mail-Adresse" "mail" 111111 "" "" +"Benutzer-ID:" "uid" 111111 "" "" +"Titel" title 111111 "" "" +"NT-Benutzername" "ntuserdomainid" 110000 "" "" +"NT-Domäne" "ntuserdomainid" 101000 "" "" +"NT-Anmelde-Server:" "ntuserlogonserver" 111111 "" "" +END +"ist" "(%a=%v))" +"ist nicht" "(!(%a=%v)))" +"Mit Mustervergleich" "(%a~=%v))" +"beginnt mit" "(%a=%v*))" +"endet mit" "(%a=*%v))" +"enthält" "(%a=*%v*))" +END + + +Groups +"" +"Suchen nach:" +"(&(|(objectClass=rfc822MailGroup)(objectClass=groupOfNames)(objectClass=groupOfUniqueNames)(objectClass=groupOfCertificates))" +"dsgw-groups" +not-used-by-dsgw +not-used-by-dsgw +subtree +"Name" cn 111111 "" "" +"Beschreibung:" description 111111 "" "" +"Besitzer (DN)" "owner" 000011 "owner" "Owner" +"Mitglied (DN)" "uniquemember" 000011 "" "" +END +"ist" "(%a=%v))" +"ist nicht" "(!(%a=%v)))" +"Mit Mustervergleich" "(%a~=%v))" +"beginnt mit" "(%a=%v*))" +"endet mit" "(%a=*%v))" +"enthält" "(%a=*%v*))" +END + +NT-Groups +"" +"Suchen nach:" +"(&(objectClass=ntGroup)" +"dsgw-ntgroups" +not-used-by-dsgw +not-used-by-dsgw +subtree +"Name" cn 111111 "" "" +"NT-Domäne" "ntgroupdomainid" 110000 "" "" +"NT-Gruppenname:" "ntgroupdomainid" 101000 "" "" +"Beschreibung:" description 111111 "" "" +"Besitzer (DN)" "owner" 000011 "owner" "Owner" +"Mitglied (DN)" "uniquemember" 000011 "" "" +END +"ist" "(%a=%v))" +"ist nicht" "(!(%a=%v)))" +"Mit Mustervergleich" "(%a~=%v))" +"beginnt mit" "(%a=%v*))" +"endet mit" "(%a=*%v))" +"enthält" "(%a=*%v*))" +END + + +Organizations +"" +"Suchen nach:" +"(&(objectClass=organization)" +"dsgw-organizations" +not-used-by-dsgw +not-used-by-dsgw +subtree +"Name" o 111111 "" "" +"Standort:" l 111111 "" "" +"Telefon" telephoneNumber 111011 "" "" +"Beschreibung:" description 111011 "" "" +END +"ist" "(%a=%v))" +"ist nicht" "(!(%a=%v)))" +"Mit Mustervergleich" "(%a~=%v))" +"beginnt mit" "(%a=%v*))" +"endet mit" "(%a=*%v))" +"enthält" "(%a=*%v*))" +END + + +"Org-Units" +"" +"Suchen nach:" +"(&(objectClass=organizationalUnit)" +"dsgw-orgunits" +not-used-by-dsgw +not-used-by-dsgw +subtree +"Name" ou 111111 "" "" +"Standort:" l 111111 "" "" +"Telefon" telephoneNumber 111011 "" "" +"Beschreibung:" description 111011 "" "" +END +"ist" "(%a=%v))" +"ist nicht" "(!(%a=%v)))" +"Mit Mustervergleich" "(%a~=%v))" +"beginnt mit" "(%a=%v*))" +"endet mit" "(%a=*%v))" +"enthält" "(%a=*%v*))" +END + +Anything +"" +"Suchen nach:" +"" +"dsgw-anything" +not-used-by-dsgw +not-used-by-dsgw +subtree +"Allg. Name:" cn 111111 "" "" +"Beschreibung:" description 111111 "" "" +END +"ist" "(%a=%v)" +"ist nicht" "(!(%a=%v))" +"Mit Mustervergleich" "(%a~=%v)" +"beginnt mit" "(%a=%v*)" +"endet mit" "(%a=*%v)" +"enthält" "(%a=*%v*)" +END + +Auth +internal +"Beglaubigen als:" +"(&(objectClass=person)" +"dsgw-people" +not-used-by-dsgw +not-used-by-dsgw +subtree +"Allg. Name:" cn 111111 "" "" +"Vorname" sn 111111 "" "" +"Telefon" "telephoneNumber" 111011 "" "" +"E-Mail-Adresse" "mail" 111111 "" "" +"Benutzer-ID:" "uid" 111111 "" "" +"Titel" title 111111 "" "" +END +"ist" "(%a=%v))" +"ist nicht" "(!(%a=%v)))" +"Mit Mustervergleich" "(%a~=%v))" +"beginnt mit" "(%a=%v*))" +"endet mit" "(%a=*%v))" +"enthält" "(%a=*%v*))" +END + diff --git a/config/de/edit-passwd.html b/config/de/edit-passwd.html new file mode 100644 index 0000000..984dbf6 --- /dev/null +++ b/config/de/edit-passwd.html @@ -0,0 +1,109 @@ + + + + + +Kennwort ändern - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + +

Kennwort ändern für + +

+ +
+ +

+ + + + + + + + + + + + + + + +
+Altes Kennwort: + + +
+Altes Kennwort: + + +
+Neues Kennwort: + + +
+Neues Kennwort zur Bestätigung wiederholen: + + +
+ +

+ + + +
+ + + + + + + +
+ + + + + diff --git a/config/de/list-Anything.html b/config/de/list-Anything.html new file mode 100644 index 0000000..3a34bdd --- /dev/null +++ b/config/de/list-Anything.html @@ -0,0 +1,73 @@ + + +

+ +
+

+ + + + + +
NameTelefon +E-Mail-Adresse Beschreibung + + + + +
+ + + + + + + + + +
+ + +

+

+Versuchen Sie es mit einem anderen Suchbegriff. +
+ + + diff --git a/config/de/list-Auth.html b/config/de/list-Auth.html new file mode 100644 index 0000000..ac0063a --- /dev/null +++ b/config/de/list-Auth.html @@ -0,0 +1,104 @@ + + + + + +
+ + + +> +
+ + + +
+ +

+ +Klicken Sie auf den Eintrag, den Sie zur Beglaubigung verwenden möchten. + +

+ + + + +
Beglaubigen als Titel + + + + +
+ + + + + + +
+ +Gehen Sie zurück, und versuchen Sie es neu. + +

+ +
+ + +
+ + + +
+
+ + diff --git a/config/de/list-Groups.html b/config/de/list-Groups.html new file mode 100644 index 0000000..db35320 --- /dev/null +++ b/config/de/list-Groups.html @@ -0,0 +1,69 @@ + + +
+ +
+

+ + + + + +
Gruppe +Beschreibung + + + + +
+ + + + + +
+ + +

+

+Versuchen Sie es mit einem anderen Suchbegriff. +
+ + + diff --git a/config/de/list-NT-Groups.html b/config/de/list-NT-Groups.html new file mode 100644 index 0000000..f554236 --- /dev/null +++ b/config/de/list-NT-Groups.html @@ -0,0 +1,75 @@ + + +
+ +
+

+ + + + + +
LDAP-Gruppenname +NT-Domänenname +NT-Gruppenname: +Beschreibung + + + + +
+ + + + + + + + + +
+ + +

+

+Versuchen Sie es mit einem anderen Suchbegriff. +
+ + + diff --git a/config/de/list-NT-People.html b/config/de/list-NT-People.html new file mode 100644 index 0000000..74493fe --- /dev/null +++ b/config/de/list-NT-People.html @@ -0,0 +1,79 @@ + + +
+ +
+

+ + + + + + + + + + + + + + + +
NameNT-DomäneNT-Benutzer-IDTelephoneNumber +
+ + onMouseOver="window.status='Für Details zu diesem Eintrag hier klicken'; return true"> + + + + + + + + +
+ + +

+

+Versuchen Sie es mit einem anderen Suchbegriff. +
+ + + diff --git a/config/de/list-Org-Units.html b/config/de/list-Org-Units.html new file mode 100644 index 0000000..9ff5e0c --- /dev/null +++ b/config/de/list-Org-Units.html @@ -0,0 +1,69 @@ + + +
+ +
+

+ + + + +
GeschäftsbereichBeschreibungTelefon + + + + +
+ + + + + + + +
+ + +

+

+Versuchen Sie es mit einem anderen Suchbegriff. +
+ + + diff --git a/config/de/list-Organizations.html b/config/de/list-Organizations.html new file mode 100644 index 0000000..556f22a --- /dev/null +++ b/config/de/list-Organizations.html @@ -0,0 +1,69 @@ + + +
+ +
+

+ + + + +
FirmaBeschreibungTelefon + + + + +
+ + + + + + + +
+ + +

+

+Versuchen Sie es mit einem anderen Suchbegriff. +
+ + + diff --git a/config/de/list-People.html b/config/de/list-People.html new file mode 100644 index 0000000..c651a33 --- /dev/null +++ b/config/de/list-People.html @@ -0,0 +1,79 @@ + + +
+ +
+

+ + + + + + + + + + + + + + + +
NameTelefonE-Mail-AdresseTitle +
+ + onMouseOver="window.status='Für Details zu diesem Eintrag hier klicken'; return true"> + + + + + + + + +
+ + +

+

+Versuchen Sie es mit einem anderen Suchbegriff. +
+ + + diff --git a/config/de/list-fa-Groups.html b/config/de/list-fa-Groups.html new file mode 100644 index 0000000..8a942aa --- /dev/null +++ b/config/de/list-fa-Groups.html @@ -0,0 +1,53 @@ + + + + + +
+ + + + +
+ + + + + + diff --git a/config/de/list-fa-People.html b/config/de/list-fa-People.html new file mode 100644 index 0000000..8a942aa --- /dev/null +++ b/config/de/list-fa-People.html @@ -0,0 +1,53 @@ + + + + + +
+ + + + +
+ + + + + + diff --git a/config/de/list-urlsearch.html b/config/de/list-urlsearch.html new file mode 100644 index 0000000..0e2f074 --- /dev/null +++ b/config/de/list-urlsearch.html @@ -0,0 +1,69 @@ + + +
+ +
+

+ + + + +
Name Telefon E-Mail-Adresse + + + + +
+ + + + + + + +
+ + +

+

+Versuchen Sie es mit einem anderen Suchbegriff. +
+ + + diff --git a/config/de/newentry.html b/config/de/newentry.html new file mode 100644 index 0000000..a92b731 --- /dev/null +++ b/config/de/newentry.html @@ -0,0 +1,56 @@ + + + + +Netscape Directory Server Gateway Neuer Eintrag + + + + + + + + +<BODY> +Sie ben&ouml;tigen einen Client, der Rahmen darstellen kann, um dieses Dokument zu betrachten. +</BODY> + + diff --git a/config/de/newentryName.html b/config/de/newentryName.html new file mode 100644 index 0000000..850fbb6 --- /dev/null +++ b/config/de/newentryName.html @@ -0,0 +1,79 @@ + + + + + + +

+ +Schritt 2. +Geben Sie einen Namen für die neue + +. +

+ += + + +

+Schritt 3. + + +Wählen Sie aus der untenstehenden Liste den Verzeichnisstandort für diese Person. + +. Wenn Sie "Andere" wählen, müssen Sie den gesamten unverwechselbaren Namen des Standorts eingeben, an dem dieser Eintrag hinzugefügt werden soll. +

+ + + + +

+Schritt 4. + + +Klicken Sie auf "Weiter". Es erscheint ein Formular, in dem Sie Angaben machen oder ändern können. Wenn Sie alle Angaben gemacht haben, speichern Sie den Eintrag. +

+

+
+ + + + +
+ diff --git a/config/de/newentryType.html b/config/de/newentryType.html new file mode 100644 index 0000000..f9c82f3 --- /dev/null +++ b/config/de/newentryType.html @@ -0,0 +1,45 @@ + + + + + +Schritt 1. +Wählen Sie die Art des zu erstellenden Eintrags. + + diff --git a/config/de/search.html b/config/de/search.html new file mode 100644 index 0000000..e10db0a --- /dev/null +++ b/config/de/search.html @@ -0,0 +1,49 @@ + + + + +Netscape Directory Server Gateway: Standardsuche + + + + + + + + diff --git a/config/de/searchString.html b/config/de/searchString.html new file mode 100644 index 0000000..7669734 --- /dev/null +++ b/config/de/searchString.html @@ -0,0 +1,61 @@ + + + + + + + + + + + + +
Suchen: + +innerhalb von: + +
Suchen nach: + +   + +
+ + + + diff --git a/config/display-country.html b/config/display-country.html new file mode 100644 index 0000000..552ab5b --- /dev/null +++ b/config/display-country.html @@ -0,0 +1,92 @@ + + + + + + +Country - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + +
+Country + + +
+ + + + + + + + + + + + + + + + + +
 
Country Name: + +Description: + +
See Also: + +
URL: + +
 
+ +
This entry was last modified on + + by + + +
+ + + diff --git a/config/display-dc.html b/config/display-dc.html new file mode 100644 index 0000000..c926e77 --- /dev/null +++ b/config/display-dc.html @@ -0,0 +1,219 @@ + + + + + + + + + +<!-- IF "Adding" --> +New +<!-- ENDIF // Adding --> +Domaincomponent - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + +
Domaincomponent Entry
+ + + + +
+ + + + +
+ +
+ + + + + +
+Domaincomponent + + +New Domaincomponent - + + +
+ + + + + + + +
+ + + + + + + +   + + + +   + + + + + +   + + + +
+ + + + + + + + + + + +
 * Indicates a required field
+ + + + + + + + + + + + + + + + + + + + + + + + +
 
+ class="bold" + +>Domaincomponent Name: + +* + + + + + class="bold" + +>Description: + +
+ class="bold" + +>Phone: + + + class="bold" + +>Business Category: + +
+ class="bold" + +>Fax: + + + class="bold" + +>Location: + +
+ class="bold" + +>Mailing Address: + +
+ class="bold" + +>See Also: + +
 
+ + +
+ This entry was last modified on + + by + + +
+ + + + + + diff --git a/config/display-dnedit.html b/config/display-dnedit.html new file mode 100644 index 0000000..46a3863 --- /dev/null +++ b/config/display-dnedit.html @@ -0,0 +1,116 @@ + + + + + + +Edit +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + +
+Edit + +: + +
+ +
+ +
+ + + + + + + + + + + +
+ + + + + + + + + +
+Find + + +matching  + + + +
+ +
+ +

+ + +
+ + + + + +

+ + + + + + + diff --git a/config/display-dneditpeople.html b/config/display-dneditpeople.html new file mode 100644 index 0000000..69b6bfa --- /dev/null +++ b/config/display-dneditpeople.html @@ -0,0 +1,114 @@ + + + + + + +Edit +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + + +
+Edit + +: + +
+ + + + + + + + + + + + + +
+ + + + + + + + + +
+Find + + +matching  + + + +
+ +
+ +

+ + +
+ + + + + +

+ + + + + + + diff --git a/config/display-group.html b/config/display-group.html new file mode 100644 index 0000000..ec90d6e --- /dev/null +++ b/config/display-group.html @@ -0,0 +1,217 @@ + + + + + + + +<!-- IF "Adding" --> +New +<!-- ENDIF // Adding --> +Group Entry - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + + + +
Group Entry
+ + + + +
+ + + + +
+ +
+ + + + +
+Group + +New Group - + + +
+ + + + + + + +
+ + + + + + + +   + + + +   + + + + + +   + + + +
+ + + + + + + + + + + +
  * Indicates a required field
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
+ class="bold" + +>Name: + +* + + + +
+ class="bold" + +>Description: + +
+ class="bold" + +>Owner:
+ + + +
+ +
+ class="bold" + +>See Also:
+ + + +
+ + + +You must save this entry before you can edit these fields. + +
+ class="bold" + +>Group Members:
+ + + +
+ +
 
+ + +
 This entry was last modified on + + by + + +
+ + + + + + diff --git a/config/display-groupun.html b/config/display-groupun.html new file mode 100644 index 0000000..e45cacd --- /dev/null +++ b/config/display-groupun.html @@ -0,0 +1,217 @@ + + + + + + + +<!-- IF "Adding" --> +New +<!-- ENDIF // Adding --> +Group Entry - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + + + +
Group Entry
+ + + + +
+ + + + +
+ +
+ + + + +
+Group + +New Group - + + +
+ + + + + + + +
+ + + + + + + +   + + + +   + + + + + +   + + + +
+ + + + + + + + + + + +
 * Indicates a required field
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
 
+ class="bold" + +>Name: + +* + + + +
+ class="bold" + +>Description: + +
+ class="bold" + +>Owner:
+ + + +
+ +
+ class="bold" + +>See Also:
+ + + +
+ + + +You must save this entry before you can edit these fields. + +
+ class="bold" + +>Group Members:
+ + + +
+ +
 
+ + +
+  This entry was last modified on + + by + + +
+ + + + + + diff --git a/config/display-ntgroup.html b/config/display-ntgroup.html new file mode 100644 index 0000000..69736ed --- /dev/null +++ b/config/display-ntgroup.html @@ -0,0 +1,256 @@ + + + + + + + +<!-- IF "Adding" --> +New +<!-- ENDIF // Adding --> +NT Group Entry - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + + + +
NT Group Entry
+ + + + +
+ + + + +
+ +
+ + + + +
+Group + +New NT Group - + + +
+ + + + + + + +
+ + + + + + + +   + + + +   + + + + + +   + + + +
+ + + + + + + + + + + + +
  * Indicates a required field
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
+ class="bold" + +>Name: + +* + + + +
+ class="bold" + +>NT Group Name: + +* + + + + + + + +
+ class="bold" + +>Description: + +
+ class="bold" + +>Owner:
+ + + +
+ +
+ class="bold" + +>See Also:
+ + + +
+ + + +You must save this entry before you can edit these fields. + +
+ class="bold" + +>NT Group Members:
+ + + +
+ +
+ class="bold" + +>Delete NT Group if Group deleted: + +
Create New NT Group: + +
 
+ + + +
+  This entry was last modified on + + by + + +
+ + + + + + diff --git a/config/display-ntperson.html b/config/display-ntperson.html new file mode 100644 index 0000000..a8ec9a4 --- /dev/null +++ b/config/display-ntperson.html @@ -0,0 +1,690 @@ + + + + + + + + +<!-- IF "Adding" --> +New +<!-- ENDIF // Adding --> +NT Person Entry - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + + + + + +
NT Person Entry
+ + + + +
+ + + + +
+ +
+ + + + + + + + +
+ + + +BORDER=0> + + +NT Person (click to show card) + + + > +Click to display organization chart + + + +New NT Person - + + +
+ + + + +>Download Certificate + + + + +   + +>Play Audio Clip + + + + + + + + +
+ + +   + + + + + + +   + + + +   + + + + + +   + + + + + +
+ + + + + + + + + + + + + + + +
  * Indicates a required field

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Contact Information
+ class="bold" + +>First Name: + + + class="bold" + +>Common Name: + +* + + + +
+ class="bold" + +>Last Name: + +* + + + + + class="bold" + +>E-Mail Address: + +
Directory Password: + + Repeat password to confirm: + +
+ class="bold" + +>Phone: + + + class="bold" + +>AIM ID: + + + + +
+ class="bold" + +>Fax: + + + class="bold" + +>User ID: + +
+ class="bold" + +>Pager: + + + class="bold" + +>Mobile Phone: + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Windows NT Account Information
+ class="bold" + +>NT User Id: + +* + + + + + + + + +
+ class="bold" + +>Delete NT Account if Person deleted: + +
Create New NT Account : + +
NT User Comment: + +NT User Unique Id: + +
NT Password Expired: + +NT Bad Password Count: + +
NT Last Logon Date: + +NT Last Logoff Date: + +
NT Account Expiration Date: + +Number of NT Logons: + +
NT Logon Server: + +NT Workstations: + +
NT Code Page: + +NT Country Code: + +
NT Primary Group Id: + +NT Profile: + +
NT Home Directory: + +NT Home Directory Drive: + +
NT Script Path: + +NT Max Storage: + +
NT Units Per Week: + +NT User's Privileges: + +
NT User's Operator Privileges: + +NT User Account Misc. Features: + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Business and Location Information
+ class="bold" + +>Business Category: + + + class="bold" + +>Title: + +
+ class="bold" + +>Organizational Unit: + + + class="bold" + +>Manager:
+ + + +
+You must save this entry before you can edit these fields. + + + + +
+ class="bold" + +>Room Number: + + + class="bold" + +>Admin.:
+ + + +
+ +
+ class="bold" + +>Dept#: + + + class="bold" + +>Emp#: + +
+ class="bold" + +>Car License#: + +    
+ class="bold" + +>Mailing Address: + +
+ + + + + + + + + + + + + + + + + + + + class="bold" + +>Unique ID: + +--> + +
+Additional Information
+ class="bold" + +>Description: + +
+ class="bold" + +>See Also:
+ + + +
+ +You must save this entry before you can edit this field. + + + + + +
+ class="bold" + +>URL: + +
+ +
 
+ + + +
+  This entry was last modified on + + by + + +
+ + + + + + + diff --git a/config/display-org.html b/config/display-org.html new file mode 100644 index 0000000..84ccb72 --- /dev/null +++ b/config/display-org.html @@ -0,0 +1,220 @@ + + + + + + + +<!-- IF "Adding" --> +New +<!-- ENDIF // Adding --> +Organization - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + + + +
Organization Entry
+ + + + +
+ + + + +
+ +
+ + + + +
+Organization + + + +New Organization - + + + +
+ + + + + + + +
+ + + + + + + +   + + + +   + + + + + +   + + + +
+ + + + + + + + + + + +
 * Indicates a required field
+ + + + + + + + + + + + + + + + + + + + + + + + +
 
+ class="bold" + +>Organization Name: + +* + + + + + class="bold" + +>Description: + +
+ class="bold" + +>Phone: + + + class="bold" + +>Business Category: + +
+ class="bold" + +>Fax: + + + class="bold" + +>Location: + +
+ class="bold" + +>Mailing Address: + +
+ class="bold" + +>See Also: + +
 
+ + +
+  This entry was last modified on + + by + + +
+ + + + + + diff --git a/config/display-orgperson.html b/config/display-orgperson.html new file mode 100644 index 0000000..b248e46 --- /dev/null +++ b/config/display-orgperson.html @@ -0,0 +1,532 @@ + + + + + + + + +<!-- IF "Adding" --> +New +<!-- ENDIF // Adding --> +Person Entry - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + + + + + + +
Person Entry
+ + + + +
+ + + + +
+ +
+ + + + + + + + +
+ + + +BORDER=0> + + +Person (click to show card) + + + > +Click to display organization chart + + + +New Person - + + +
+ + + + +>Download Certificate + + + + +   + +>Play Audio Clip + + + + + + + + +
+ + +   + + + + + + +   + + + +   + + + + + +   + + + + + +
+ + + + + + + + + + + + + + +
  * Indicates a required field
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Contact Information +
+ class="bold" + +>First Name: + + + class="bold" + +>Common Name: + +* + + + +
+ class="bold" + +>Last Name: + +* + + + + + class="bold" + +>E-Mail Address: + +
Password: + + Repeat password to confirm: + +
+ class="bold" + +>Phone: + + + class="bold" + +>AIM ID: + + + + +
+ class="bold" + +>Fax: + + + class="bold" + +>User ID: + +
+ class="bold" + +>Pager: + + + class="bold" + +>Mobile Phone: + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Business and Location Information
+ class="bold" + +>Business Category: + + + class="bold" + +>Title: + +
+ class="bold" + +>Organizational Unit: + + + class="bold" + +>Manager:
+ + + +
+You must save this entry before you can edit these fields. + + + + + +
+ class="bold" + +>Room Number: + + + class="bold" + +>Admin.:
+ + + +
+ +
+ class="bold" + +>Dept#: + + + class="bold" + +>Emp#: + +
+ class="bold" + +>Car License#: + +    
+ class="bold" + +>Mailing Address: + +
+ + + + + + + + + + + + + + + + + + + + class="bold" + +>Unique ID: + +--> + + +
+Additional Information
+ class="bold" + +>Description: + +
+ class="bold" + +>See Also:
+ + + +
+ +You must save this entry before you can edit this field. + + + + + +
+ class="bold" + +>URL: + +
+ +
 
+ + + +
+  This entry was last modified on + + by + + +
+ + + + + + + diff --git a/config/display-orgunit.html b/config/display-orgunit.html new file mode 100644 index 0000000..3d04ee2 --- /dev/null +++ b/config/display-orgunit.html @@ -0,0 +1,222 @@ + + + + + + + +<!-- IF "Adding" --> +New +<!-- ENDIF // Adding --> +Organizational Unit - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + + + +
Organizational Unit Entry
+ + + + +
+ + + + +
+ +
+ + + + + +
+Org Unit + + + +New Organizational Unit - + + + +
+ + + + + + + +
+ + + + + + + +   + + + +   + + + + + +   + + + +
+ + + + + + + + + + + +
 * Indicates a required field
+ + + + + + + + + + + + + + + + + + + + + + + +
 
+ class="bold" + +>Unit Name: + +* + + + + + class="bold" + +>Description: + +
+ class="bold" + +>Phone: + + + class="bold" + +>Business Category: + +
+ class="bold" + +>Fax: + + + class="bold" + +>Location: + +
+ class="bold" + +>Mailing Address: + +
+ class="bold" + +>See Also: + +
 
+ + + +
+  This entry was last modified on + + by + + +
+ + + + + + + diff --git a/config/display-person.html b/config/display-person.html new file mode 100644 index 0000000..fc481b3 --- /dev/null +++ b/config/display-person.html @@ -0,0 +1,397 @@ + + + + + + + + +<!-- IF "Adding" --> +New +<!-- ENDIF // Adding --> +Person Entry - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + + + + + +
Person Entry
+ + + + +
+ + + + +
+ +
+ + + + + + + +
+Person (click to show card) + + >Click to display organization chart + +New Person - + + +
+ + + + + + + +
+ + +   + + + + + + +   + + + +   + + + + + +   + + + + + +
+ + + + + + + + + + + + +
  * Indicates a required field

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Contact Information +
+ class="bold" + +>Last Name: + + + class="bold" + +>Common Name: + +* + + + +
+ class="bold" + +>E-Mail Address: + +
Password: + + Repeat password to confirm: + +
+ class="bold" + +>Phone: + + + class="bold" + +>AIM ID: + + + + +
+ class="bold" + +>Fax: + + + class="bold" + +>User ID: + +
+ class="bold" + +>Pager: + + + class="bold" + +>Mobile Phone: + +
+ + + + + + + + + + + + + + +
+Business and Location Information
+ class="bold" + +>Title: + +
+ class="bold" + +>Mailing Address: + +
+ + + + + + + + + + + + + + + + + + + + class="bold" + +>Unique ID: + +--> + +
+Additional Information
+ class="bold" + +>Description: + +
+ class="bold" + +>See Also:
+ + + +
+ +You must save this entry before you can edit this field. + + + + + +
+ class="bold" + +>URL: + +
+ +
 
+ + + +
+  This entry was last modified on + + by + + +
+ + + + + + + + diff --git a/config/dsgw-l10n.conf b/config/dsgw-l10n.conf new file mode 100644 index 0000000..3155f83 --- /dev/null +++ b/config/dsgw-l10n.conf @@ -0,0 +1,50 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# To localize the search type menu: +# Locate dsgw-l10n.conf in config//. +# dsgw-l10n.conf contains translated words for search type pulldown menu. +# dsgw-l10n.conf sample: +# Note: the sample part should have double #'s for L10n. +## translate People +## translate NT-People +## translate Groups +## translate NT-Groups +## translate Organizations +## translate Org-Units +## translate Anything diff --git a/config/dsgw.tmpl b/config/dsgw.tmpl new file mode 100644 index 0000000..6725b30 --- /dev/null +++ b/config/dsgw.tmpl @@ -0,0 +1,191 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK + +baseurl "ldap://@host@:@port@/@suffix@" + +dirmgr "@dirmgr@" + +location-suffix @suffix@ + +securitypath "@contextdir@" + +url-orgchart-base http://@host@:@port@/clients/orgchart/bin/org?context=dsgw&data= + +# The attribute the orgchart uses to search for entries. +# This value should correspond to the value of attrib-farleft-rdn +# in the orgchart's config.txt configuration file. +orgchart-attrib-farleft-rdn uid + +# Check for Aim presence when the user's entry is displayed +enable-aim-presence true + +# The htmldir directive tells the CGIs where to find the html files +htmldir ../html + +# The configdir directive tells the CGIs where to find the +# templates/configuration files +configdir ../config + +# The gwnametrans directive tells the CGIs what url to output +# for http redirection. It should be the same nameTrans set +# in the webserver, if any is being is used. +gwnametrans /clients/dsgw/html/ + +# The authlifetime directive specifies how long authentication credentials +# are valid (in seconds). +authlifetime 7200 + +# The default character set, for communication with HTTP clients. +# A client may override this default, using an HTTP Accept-Charset header. +# Or, this default may be overridden for a specific language, by creating +# a LANG/dsgwcharset.conf file which contains the charset name. +# For compatibility with HTTP clients that can't handle an HTTP response +# with a charset parameter in the content-type, comment out this directive; +# responses will be sent in ISO-8859-1, with no explicit charset parameter. +# RFC 1345 defines the syntax of charset names. There is a registry of +# charsets, at ftp://ftp.isi.edu/in-notes/iana/assignments/character-sets +# charset UTF-8 + +# ignoreAcceptCharsetFrom [ ] +# where each of whose values is the version string (or part of the version +# string) sent by an HTTP client which can't / doesn't want to handle UTF-8. +# Charset from dsgwcharset.conf or charset directive is used (in the order). +# ignoreAcceptCharsetFrom Mozilla/4.01x-NSCP Mozilla/3 + +# Substitute ideographic space for non-breaking space in Asian charsets: +changeHTML "  " " " Shift_JIS Big5 EUC-KR EUC-JP +changeHTML " " " " Shift_JIS Big5 EUC-KR EUC-JP + +# Mapping between config/display-XXX.html templates and LDAP objectClasses. +# This can be generated by using ds/templateindex. The format is: +# +# template TEMPLATENAME OBJECTCLASSES +# +# where "display-TEMPLATENAME.html" is the name of a display template +# that is found in this config directory (e.g., "display-group.html") and +# OBJECTCLASSES is a list of one or more objectClass values. For a given +# template to be used, all the objectClass values listed must be present +# in the directory entry, so the order of these template lines is +# significant (e.g. note that the more specific "orgperson" template is +# listed before the one for an ordinary "person"). +# +template group groupOfNames +template ntgroup groupOfUniqueNames ntGroup +template groupun groupOfUniqueNames +template org organization +template dc domain +template orgunit organizationalUnit +template ntperson person inetOrgPerson nTUser +template orgperson person inetOrgPerson +template person person +template country country + +# +# The remainder of this file contains information about the locations and +# types for new entries. +# +# "location" lines define places in the directory where new entries can be added +# The format of each line is: +# location HANDLE FRIENDLYNAME DN +# where HANDLE is a short name which is used in the "newtype" lines (see below) +# and FRIENDLYNAME is a human-readable name for the location +# and DN is the Distinguished Name for this location (if it does not end with +# '#', the location-suffix is appended to to construct a full DN; if it +# does end with `#', it assumed to be a full DN and the `#' is removed). +# +location country "United States" "c=US#" +location org "This Organization" "" +location dc "This Domaincomponent" "" +location groups "Groups" "ou=Groups" +location people "People" "ou=People" +location special "Special Users" "ou=Special Users" + +# "newtype" lines define the types of new entries that may be added +# The format of each line is: +# newtype TEMPLATENAME FRIENDLYNAME RDNATTR LOCATIONS... +# where TEMPLATENAME corresponds to an existing display-TEMPLATENAME.html file +# and FRIENDLYNAME is a human-readable name for this type of entry +# and RDNATTR is the attribute that is used to name entries of this type +# and LOCATIONS is a blank-separated list of locations where these types of +# entries can be added (corresponding to a HANDLE on a "location" +# config. file line). +# +newtype orgperson "Person" uid people special +newtype ntperson "NT Person" uid people special +newtype ntgroup "NT Group" cn groups +newtype groupun "Group" cn groups +newtype orgunit "Organizational Unit" ou people org +newtype org "Organization" o country +newtype dc "Domaincomponent" dc dc org country people + +# Mappings between VCard properties and LDAP attribute types: +# The format of each line is: +# vcard-property VCARDPROP SYNTAX LDAPATTR [LDAPATTR2] +# where VCARDPROP is the name of a VCard property +# and SYNTAX is "cis" for simple strings and "mls" for multiline strings +# and LDAPATTR is the LDAP attribute that corresponds to VCARDPROP +# and LDAPATTR2 is an optional secondary LDAP attribute which is added to +# the property value by appending a semicolon and then the attr2 value. +vcard-property FN cis cn +vcard-property N cis sn givenName +vcard-property ORG cis o ou +vcard-property ROLE cis businessCategory +vcard-property ADR;WORK mls postalAddress +vcard-property ADR;HOME mls homePostalAddress +vcard-property EMAIL;INTERNET cis mail +vcard-property TITLE cis title +vcard-property TEL;WORK cis telephoneNumber +vcard-property TEL;FAX cis facsimileTelephoneNumber +vcard-property TEL;CELL cis mobile +vcard-property TEL;HOME cis homePhone +vcard-property NOTE cis description + +# To localize the search type menu: +# Locate dsgw-l10n.conf in config//. +# dsgw-l10n.conf contains translated words for search type pulldown menu. +# dsgw-l10n.conf sample: +# translate People +# translate NT-People +# translate Groups +# translate NT-Groups +# translate Organizations +# translate Org-Units +# translate Anything +# +include "../config/dsgw-l10n.conf" + diff --git a/config/dsgw_adm.conf b/config/dsgw_adm.conf new file mode 100644 index 0000000..409d0ce --- /dev/null +++ b/config/dsgw_adm.conf @@ -0,0 +1,78 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# Mapping between config/display-XXX.html templates and LDAP objectClasses. +# This can be generated by using the templateindex program. The format is: +# +# template TEMPLATENAME OBJECTCLASSES +# +# where "display-TEMPLATENAME.html" is the name of a display template +# that is found in this config directory (e.g., "display-group.html") and +# OBJECTCLASSES is a list of one or more objectClass values. For a given +# template to be used, all the objectClass values listed must be present +# in the directory entry, so the order of these template lines is +# significant (e.g. note that the more specific "orgperson" template is +# listed before the one for an ordinary "person"). +# +template group groupOfNames +template groupun groupOfUniqueNames +template org organization +template orgunit organizationalUnit +template orgperson person inetOrgPerson +template person person +template country country +template licensed-user nsLicenseUser + +# Attribute Value Sets (used with DS_ATTRVAL_SET directives) +# attrvset HANDLE VALUE PREFIX SUFFIX +# +attrvset CAL news "" "Netscape Collabra Server" +attrvset CAL slapd "" "Netscape Directory Server" + + +# Template Set definitions +# Note: templates must be defined before they can be mentioned on +# a tmplset line. +# +# tmplset SETNAME VIEWNAME TEMPLATENAME [HREF-LOCATION] +# +tmplset person "General" orgperson +tmplset person "Password" passwd +tmplset person "Licenses" licensed-user +tmplset group "General" group +tmplset groupun "General" groupun diff --git a/config/dsgwfilter.conf b/config/dsgwfilter.conf new file mode 100644 index 0000000..fa9bd21 --- /dev/null +++ b/config/dsgwfilter.conf @@ -0,0 +1,184 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# ldap filter file +# +# lines like this that start with # or empty lines are ignored +# +# syntax: +# +# +# [] +# [] +# +# [] ... +# +# The should describe the filter. It should correctly complete +# the phrases (in the resource database) DBT_Found0EntriesWhere_, +# DBT_Found1EntryWhere_ and DBT_FoundEntriesWhere_; for example: +# +# Found 1 entry where the '%v'. +# Found no entries where the '%v'. +# Found 3 entries where the '%v'. +# +# The should begin with the article ("the" in English) for +# languages that require agreement between article and noun (e.g +# genders in Spanish or French). +# +# The scope is optional, and should be one of: +# "base" +# "onelevel" +# "subtree" +# if it is included. + +# +# Directory Server gateway +# + +"dsgw-people" + "=" " " "(%v))" "LDAP filter is" + + "^[+]*[0-9][ 0-9-]*$" " " "(telephoneNumber=*%v))" "phone number ends with" + + "@" " " "(mail=%v))" "email address is" + "(mail=%v*))" "email address starts with" + + "^.[. _].*" ". _" "(cn=%v1* %v2-))" "first initial + name is" + + ".*[. _].$" ". _" "(cn=%v1-*))" "name + last initial is" + + "[. _]" ". _" "(|(sn=%v1-)(cn=%v1-)))" "name is" + "(|(cn=*%v1-*)(sn=*%v1-*)(cn~=%v1-)(sn~=%v1-)))" "name sounds like or contains" + + "^\*$" " " "(|(cn=*)(sn=*)(uid=*)))" "name or user id is" + + "^.$" ". " "(|(cn=%v)(sn=%v)(uid=%v)))" "name or user id is" + + "^..$" ". " "(|(cn=%v*)(cn=*%v)(sn=%v*)(sn=*%v)(uid=%v*)(uid=*%v)))" "name or user id is" + + ".*" ". " "(|(cn=%v1)(sn=%v1)(uid=%v1)))" "name or user id is" + "(|(cn=*%v1*)(sn=*%v1*)(cn~=%v1)(sn~=%v1)))" "name sounds like or contains" + + +"dsgw-groups" + "=" " " "(%v))" "LDAP filter is" + + "^\*$" " " "(cn=*))" "name is" + + ".*" ". _" "(cn=%v1-))" "name is" + "(cn=*%v1-*))" "name contains" + "(cn~=%v1-))" "name sounds like" + +"dsgw-ntgroups" + "=" " " "(%v))" "LDAP filter is" + + "^\*$" " " "(cn=*))" "name is" + + ".*" ". _" "(cn=%v1-))" "name is" + "(cn=*%v1-*))" "name contains" + "(cn~=%v1-))" "name sounds like" + "(ntuserdomainid=%v))" "NT Group is" + +"dsgw-organizations" + "=" " " "(%v))" "LDAP filter is" + +# "\." " " "(associatedDomain=%v))" "associated domain is" + + "^\*$" " " "(o=*))" "name is" + + ".*" " " "(o=%v))" "name is" + "(o=*%v*))" "name contains" + "(o~=%v))" "name sounds like" + +"dsgw-domaincomponents" + "=" " " "(%v))" "LDAP filter is" + + "\." " " "(associatedDomain=%v))" "associated domain is" + + "^\*$" " " "(dc=*))" "name is" + + ".*" " " "(dc=%v))" "name is" + "(dc=*%v*))" "name contains" + "(dc~=%v))" "name sounds like" + +"dsgw-orgunits" + "=" " " "(%v))" "LDAP filter is" + + "\." " " "(associatedDomain=%v))" "associated domain is" + + "^\*$" " " "(ou=*))" "name is" + + ".*" " " "(ou=%v))" "name is" + "(ou=*%v*))" "name contains" + "(ou~=%v))" "name sounds like" + +"dsgw-anything" + "=" " " "(%v)" "LDAP filter is" + + "[ ]" " " "(|(sn=%v1-)(cn=%v1-)(o=%v1-)(ou=%v1-))" "name is" + "(|(sn~=%v1-)(cn~=%v1-)(o=%v1-)(ou=%v1-))" "name sounds like" + + "^\*$" " " "(|(cn=*)(sn=*)(o=*)(ou=*))" "name is" + + ".*" " " "(|(cn=%v1)(sn=%v1)(o=%v1)(ou=%v1))" "name is" + "(|(cn=*%v1*)(sn=*%v1*)(cn~=%v1)(sn~=%v1)(o=%v1)(ou=%v1))" "name sounds like or contains" + + +"dsgw-ntpeople" + "=" " " "(%v))" "LDAP filter is" + + "^[+]*[0-9][ 0-9-]*$" " " "(telephoneNumber=*%v))" "phone number ends with" + + "@" " " "(mail=%v))" "email address is" + "(mail=%v*))" "email address starts with" + + "^.[. _].*" ". _" "(cn=%v1* %v2-))" "first initial + name is" + + ".*[. _].$" ". _" "(cn=%v1-*))" "name + last initial is" + + "[. _]" ". _" "(|(sn=%v1-)(cn=%v1-)))" "name is" + "(|(cn=*%v1-*)(sn=*%v1-*)(cn~=%v1-)(sn~=%v1-)))" "name sounds like or contains" + + "^\*$" " " "(|(cn=*)(sn=*)))" "name is" + + ".*" ". " "(|(cn=%v1)(sn=%v1)))" "name is" + "(ntuserlogonserver=%v))" "NT logon server is" + "(ntuserdomainid=%v))" "NT username is" + "(|(cn=*%v1*)(sn=*%v1*)(cn~=%v1)(sn~=%v1)))" "name sounds like or contains" + +# Do not remove this line, or place any directives after it. diff --git a/config/dsgwfilter_adm.conf b/config/dsgwfilter_adm.conf new file mode 100644 index 0000000..9d6c9fb --- /dev/null +++ b/config/dsgwfilter_adm.conf @@ -0,0 +1,105 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# ldap filter file +# +# lines like this that start with # or empty lines are ignored +# +# syntax: +# +# +# [] +# [] +# +# [] ... +# +# The should describe the filter. It should correctly complete +# the phrases (in the resource database) DBT_Found0EntriesWhere_, +# DBT_Found1EntryWhere_ and DBT_FoundEntriesWhere_; for example (en): +# +# Found 1 entry where the '%v'. +# Found no entries where the '%v'. +# Found 3 entries where the '%v'. +# +# The should begin with the article ("the" in English) for +# languages that require agreement between article and noun (e.g +# genders in Spanish or French). +# +# The scope is optional, and should be one of: +# "base" +# "onelevel" +# "subtree" +# if it is included. + +# +# Directory Server gateway - for Netscape Admin Server +# + +"dsgw-people" + "=" " " "(%v))" "LDAP filter is" + + "^[+]*[0-9][ 0-9-]*$" " " "(telephoneNumber=*%v))" "phone number ends with" + + "@" " " "(mail=%v))" "email address is" + "(mail=%v*))" "email address starts with" + + "^.[. _].*" ". _" "(cn=%v1* %v2-))" "first initial + name is" + + ".*[. _].$" ". _" "(cn=%v1-*))" "name + last initial is" + + "[. _]" ". _" "(|(sn=%v1-)(cn=%v1-)))" "name is" + "(|(cn=*%v1-*)(sn=*%v1-*)(cn~=%v1-)(sn~=%v1-)))" "name sounds like or contains" + + ".*" ". " "(uid=%v1))" "login id is" + "(|(cn=%v1)(sn=%v1)))" "name is" + "(|(cn=*%v1*)(sn=*%v1*)(cn~=%v1)(sn~=%v1)))" "name sounds like or contains" + + +"dsgw-groups" + "=" " " "(%v))" "LDAP filter is" + + ".*" ". _" "(cn=%v1-))" "name is" + "(cn~=%v1-))" "name sounds like" + +"dsgw-orgunits" + "=" " " "(%v))" "LDAP filter is" + + ".*" ". _" "(ou=%v1-))" "unit name is" + "(ou~=%v1-))" "unit name sounds like" + +#Do not remove this line, or place any additional lines after it. diff --git a/config/dsgwsearchprefs.conf b/config/dsgwsearchprefs.conf new file mode 100644 index 0000000..57a8811 --- /dev/null +++ b/config/dsgwsearchprefs.conf @@ -0,0 +1,264 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# dsgwsearchprefs.conf - directory server gateway search object definitions + + +# the current version of this file format is 1 +Version 1 + + +# Name for this search object +People +# options (the only one supported right now is "internal" which means that +# this search object should not be presented directly to the user) +# use "" for none +"" +# Label to place before text box user types in +"Search For:" +# Filter prefix to append to all searches +"(&(objectClass=person)" +# Tag to use for "Fewer Choices" searches - from ldapfilter.conf file +"dsgw-people" +# If a search results in > 1 match, retrieve this attribute to help +# user disambiguate the entries... +not-used-by-dsgw +# ...and label it with this string: +not-used-by-dsgw +# Search scope to use when searching +subtree +# Follows a list of "More Choices" search options. Format is: +# Label, attribute, select-bitmap, extra attr display name, extra attr ldap name +# If last two are null, "Fewer Choices" name/attributes used. +# Label should begin with the article ("the" in English) for +# languages that require agreement between article and noun +# (e.g genders in Spanish or French). +"full name" cn 111111 "" "" +"last name" sn 111111 "" "" +"phone number" "telephoneNumber" 111011 "" "" +"e-mail address" "mail" 111111 "" "" +"user id" "uid" 111111 "" "" +"title" title 111111 "" "" +END +# Match types +"is" "(%a=%v))" +"is not" "(!(%a=%v)))" +"sounds like" "(%a~=%v))" +"starts with" "(%a=%v*))" +"ends with" "(%a=*%v))" +"contains" "(%a=*%v*))" +END + + +"NT-People" +"" +"Search For:" +"(&(objectClass=ntuser)" +"dsgw-ntpeople" +not-used-by-dsgw +not-used-by-dsgw +subtree +"full name" cn 111111 "" "" +"last name" sn 111111 "" "" +"phone number" "telephoneNumber" 111011 "" "" +"e-mail address" "mail" 111111 "" "" +"user id" "uid" 111111 "" "" +"title" title 111111 "" "" +"NT username" "ntuserdomainid" 110000 "" "" +"NT logon server" "ntuserlogonserver" 111111 "" "" +END +"is" "(%a=%v))" +"is not" "(!(%a=%v)))" +"sounds like" "(%a~=%v))" +"starts with" "(%a=%v*))" +"ends with" "(%a=*%v))" +"contains" "(%a=*%v*))" +END + + +Groups +"" +"Search For:" +"(&(|(objectClass=rfc822MailGroup)(objectClass=groupOfNames)(objectClass=groupOfUniqueNames)(objectClass=groupOfCertificates))" +"dsgw-groups" +not-used-by-dsgw +not-used-by-dsgw +subtree +"name" cn 111111 "" "" +"description" description 111111 "" "" +"owner (DN)" "owner" 000011 "owner" "Owner" +"member (DN)" "uniquemember" 000011 "" "" +END +"is" "(%a=%v))" +"is not" "(!(%a=%v)))" +"sounds like" "(%a~=%v))" +"starts with" "(%a=%v*))" +"ends with" "(%a=*%v))" +"contains" "(%a=*%v*))" +END + +NT-Groups +"" +"Search For:" +"(&(objectClass=ntGroup)" +"dsgw-ntgroups" +not-used-by-dsgw +not-used-by-dsgw +subtree +"name" cn 111111 "" "" +"NT groupname" "ntuserdomainid" 110000 "" "" +"description" description 111111 "" "" +"owner (DN)" "owner" 000011 "owner" "Owner" +"member (DN)" "uniquemember" 000011 "" "" +END +"is" "(%a=%v))" +"is not" "(!(%a=%v)))" +"sounds like" "(%a~=%v))" +"starts with" "(%a=%v*))" +"ends with" "(%a=*%v))" +"contains" "(%a=*%v*))" +END + + +Organizations +"" +"Search For:" +"(&(objectClass=organization)" +"dsgw-organizations" +not-used-by-dsgw +not-used-by-dsgw +subtree +"name" o 111111 "" "" +"location" l 111111 "" "" +"phone number" telephoneNumber 111011 "" "" +"description" description 111011 "" "" +END +"is" "(%a=%v))" +"is not" "(!(%a=%v)))" +"sounds like" "(%a~=%v))" +"starts with" "(%a=%v*))" +"ends with" "(%a=*%v))" +"contains" "(%a=*%v*))" +END + + +Domaincomponent +"" +"Search For:" +"(&(objectClass=domain)" +"dsgw-domaincomponent" +not-used-by-dsgw +not-used-by-dsgw +subtree +"name" o 111111 "" "" +"location" l 111111 "" "" +"phone number" telephoneNumber 111011 "" "" +"description" description 111011 "" "" +END +"is" "(%a=%v))" +"is not" "(!(%a=%v)))" +"sounds like" "(%a~=%v))" +"starts with" "(%a=%v*))" +"ends with" "(%a=*%v))" +"contains" "(%a=*%v*))" +END + + +"Org-Units" +"" +"Search For:" +"(&(objectClass=organizationalUnit)" +"dsgw-orgunits" +not-used-by-dsgw +not-used-by-dsgw +subtree +"name" ou 111111 "" "" +"location" l 111111 "" "" +"phone number" telephoneNumber 111011 "" "" +"description" description 111111 "" "" +END +"is" "(%a=%v))" +"is not" "(!(%a=%v)))" +"sounds like" "(%a~=%v))" +"starts with" "(%a=%v*))" +"ends with" "(%a=*%v))" +"contains" "(%a=*%v*))" +END + +Anything +"" +"Search For:" +"" +"dsgw-anything" +not-used-by-dsgw +not-used-by-dsgw +subtree +"common name" cn 111111 "" "" +"description" description 111111 "" "" +END +"is" "(%a=%v)" +"is not" "(!(%a=%v))" +"sounds like" "(%a~=%v)" +"starts with" "(%a=%v*)" +"ends with" "(%a=*%v)" +"contains" "(%a=*%v*)" +END + +Auth +internal +"Authenticate As:" +"(&(objectClass=person)" +"dsgw-people" +not-used-by-dsgw +not-used-by-dsgw +subtree +"common name" cn 111111 "" "" +"surname" sn 111111 "" "" +"phone number" "telephoneNumber" 111011 "" "" +"e-mail address" "mail" 111111 "" "" +"user id" "uid" 111111 "" "" +"title" title 111111 "" "" +END +"is" "(%a=%v))" +"is not" "(!(%a=%v)))" +"sounds like" "(%a~=%v))" +"starts with" "(%a=%v*))" +"ends with" "(%a=*%v))" +"contains" "(%a=*%v*))" +END + diff --git a/config/edit-passwd.html b/config/edit-passwd.html new file mode 100644 index 0000000..8f04358 --- /dev/null +++ b/config/edit-passwd.html @@ -0,0 +1,109 @@ + + + + + +Change Password - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + +

Change password for + +

+ +
+ +

+ + + + + + + + + + + + + + + +
+Enter the old password: + + +
+Enter the old password: + + +
+Enter the new password: + + +
+Enter the new password again to confirm: + + +
+ +

+ + + +
+ + + + + + + +
+ + + + + diff --git a/config/en-us/dsgw-l10n.conf b/config/en-us/dsgw-l10n.conf new file mode 100644 index 0000000..3155f83 --- /dev/null +++ b/config/en-us/dsgw-l10n.conf @@ -0,0 +1,50 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# To localize the search type menu: +# Locate dsgw-l10n.conf in config//. +# dsgw-l10n.conf contains translated words for search type pulldown menu. +# dsgw-l10n.conf sample: +# Note: the sample part should have double #'s for L10n. +## translate People +## translate NT-People +## translate Groups +## translate NT-Groups +## translate Organizations +## translate Org-Units +## translate Anything diff --git a/config/en-us/dsgwcollate.conf b/config/en-us/dsgwcollate.conf new file mode 100644 index 0000000..5c75591 --- /dev/null +++ b/config/en-us/dsgwcollate.conf @@ -0,0 +1,40 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# Ignore accents (diacritical marks) when doing case-insensitive comparison. +caseIgnoreAccents diff --git a/config/en/dsgw-l10n.conf b/config/en/dsgw-l10n.conf new file mode 100644 index 0000000..3155f83 --- /dev/null +++ b/config/en/dsgw-l10n.conf @@ -0,0 +1,50 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# To localize the search type menu: +# Locate dsgw-l10n.conf in config//. +# dsgw-l10n.conf contains translated words for search type pulldown menu. +# dsgw-l10n.conf sample: +# Note: the sample part should have double #'s for L10n. +## translate People +## translate NT-People +## translate Groups +## translate NT-Groups +## translate Organizations +## translate Org-Units +## translate Anything diff --git a/config/en/dsgwcollate.conf b/config/en/dsgwcollate.conf new file mode 100644 index 0000000..376297b --- /dev/null +++ b/config/en/dsgwcollate.conf @@ -0,0 +1,73 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# Case 1. en and en-* +# +# Ignore accents (diacritical marks) when doing case-insensitive comparison. +caseIgnoreAccents + +# Case 2. Latin-1 languages do not need this file + +# Case 3. ja and languages that have "yomi (phonetic representation)" +# +# Each line in this file defines a crude string collation. +# There are two such collations, one for sorting a displayed list, and +# another for selecting one of several alternative values to display: +# +## sort 20,A0,3000-30FF 3190- +## display 20,A0,3000,3190- 3001-30FF +# +# In each line, each parameter defines a "script" as a set of Unicodes; +# a character is considered to be part of the first script it matches. +# An implicit final script contains characters that don't match any +# parameter. Strings are collated in order of these scripts. +# A mixed-script string is collated with the last script it contains. +# Strings in the same script category are sorted by another algorithm, +# which is not defined here. +# +# In this file, the sort scripts are Kana, Kanji and everything else, +# and the display scripts are Kanji, Kana and everything else. So, +# lists are sorted with pure Kana values first, Kanji values and mixed +# Kanji/Kana values next, and finally values containing other characters. +# When choosing a value to display, pure Kanji is preferred, Kana or +# mixed Kanji/Kana is the next choice, and anything else is the last. +# These choices aim to sort by Yomi (stored in Kana), but display Kanji. +# +# Insignificant characters (such as whitespace) should be included in +# the first script on each line. + diff --git a/config/es/authPassword.html b/config/es/authPassword.html new file mode 100644 index 0000000..684b304 --- /dev/null +++ b/config/es/authPassword.html @@ -0,0 +1,60 @@ + + + + +Autenticar... + + + + + + +

+Contraseña para + +: +

+

+ + + +
+ + + diff --git a/config/es/authSearch.html b/config/es/authSearch.html new file mode 100644 index 0000000..4e08ff8 --- /dev/null +++ b/config/es/authSearch.html @@ -0,0 +1,64 @@ + + + + +Autenticar... + + + + + +El primer paso para autenticarse en el directorio es identificarse.
Escriba su nombre: + +

+

+ + + +
+ +

+ + (sólo disponible para administradores de directorios) + + + + + + diff --git a/config/es/csearch.html b/config/es/csearch.html new file mode 100644 index 0000000..3ef2fb0 --- /dev/null +++ b/config/es/csearch.html @@ -0,0 +1,54 @@ + + + + +Netscape Directory Server Gateway : Advanced Search + + + + + + + + + + + + + diff --git a/config/es/csearchAttr.html b/config/es/csearchAttr.html new file mode 100644 index 0000000..f336103 --- /dev/null +++ b/config/es/csearchAttr.html @@ -0,0 +1,49 @@ + + + + + + + + + +
donde el: + +
+ diff --git a/config/es/csearchBase.html b/config/es/csearchBase.html new file mode 100644 index 0000000..5efcc64 --- /dev/null +++ b/config/es/csearchBase.html @@ -0,0 +1,48 @@ + + + + + + + + +
en: + +
+ diff --git a/config/es/csearchString.html b/config/es/csearchString.html new file mode 100644 index 0000000..df3224f --- /dev/null +++ b/config/es/csearchString.html @@ -0,0 +1,59 @@ + + + + + + + + + + + +
+ + + + dentro de: + +
+ + + + + diff --git a/config/es/csearchType.html b/config/es/csearchType.html new file mode 100644 index 0000000..49d2547 --- /dev/null +++ b/config/es/csearchType.html @@ -0,0 +1,50 @@ + + + + + + + + + +
Buscar: + +
+ + diff --git a/config/es/display-country.html b/config/es/display-country.html new file mode 100644 index 0000000..8a269a3 --- /dev/null +++ b/config/es/display-country.html @@ -0,0 +1,85 @@ + + + + + + +País: +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + +
+País + + +
+ + + + + + + + + + + +
Nombre del país: + +Descripción + +
Ver también: + +
Página web: + +
+ +


+ +Esta entrada fue modificada por última vez el + + por + + + + + + diff --git a/config/es/display-dnedit.html b/config/es/display-dnedit.html new file mode 100644 index 0000000..b3c6dc5 --- /dev/null +++ b/config/es/display-dnedit.html @@ -0,0 +1,107 @@ + + + + + + +Modificar +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + + + + + + + + +Modificar + +: + + + + + + + + + + + + +
+Buscar + + +que concuerden con  + + + +
+ +
+ +

+

+ +
+ + + + + +
+ + + + + + + diff --git a/config/es/display-dneditpeople.html b/config/es/display-dneditpeople.html new file mode 100644 index 0000000..9e9e3c6 --- /dev/null +++ b/config/es/display-dneditpeople.html @@ -0,0 +1,106 @@ + + + + + + +Modificar +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + + + + + + + + +Modificar + +: + + + + + + + + + +
+Buscar + + +que concuerden con  + + + +
+ + + + + + + diff --git a/config/es/display-group.html b/config/es/display-group.html new file mode 100644 index 0000000..07717fc --- /dev/null +++ b/config/es/display-group.html @@ -0,0 +1,180 @@ + + + + + + + +<!-- IF "Adding" --> +Nueva +<!-- ENDIF // Adding --> +Entrada de grupo: +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + +
+Grupo + + +Nuevo grupo: + + + +
+ + + + + + + +
+ + + + + + + +   + + + +   + + + + + +   + + + +
+ + + + + + + + + +
+ +El asterisco (*) indica los campos obligatorios
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Nombre: + +* + + + +
Descripción: + +
Propietario:
+ + + +
+ +
Ver también:
+ + + +
+ + + + + +Tiene que guardar esta entrada para poder modificar este campo. + +
Miembros del grupo:
+ + + +
+ +
+ + +
+Esta entrada fue modificada por última vez el + + por + + + + + + + + diff --git a/config/es/display-groupun.html b/config/es/display-groupun.html new file mode 100644 index 0000000..123fe1f --- /dev/null +++ b/config/es/display-groupun.html @@ -0,0 +1,180 @@ + + + + + + + +<!-- IF "Adding" --> +Nueva +<!-- ENDIF // Adding --> +Entrada de grupo: +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + +
+Grupo + + +Nuevo grupo: + + + +
+ + + + + + + +
+ + + + + + + +   + + + +   + + + + + +   + + + +
+ + + + + + + + + +
+ +El asterisco (*) indica los campos obligatorios
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Nombre: + +* + + + +
Description: + +
Propietario:
+ + + +
+ +
Ver también:
+ + + +
+ + + + + +Tiene que guardar esta entrada para poder modificar este campo. + +
Miembros del grupo:
+ + + +
+ +
+ + +
+Esta entrada fue modificada por última vez el + + por + + + + + + + + diff --git a/config/es/display-ntgroup.html b/config/es/display-ntgroup.html new file mode 100644 index 0000000..dc6f0bc --- /dev/null +++ b/config/es/display-ntgroup.html @@ -0,0 +1,246 @@ + + + + + + + +<!-- IF "Adding" --> +Nueva +<!-- ENDIF // Adding --> +Entrada de grupo NT: +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + +
+Grupo + + +Nuevo grupo NT: + + + +
+ + + + + + + +
+ + + + + + + +   + + + +   + + + + + +   + + + +
+ + + + + + + + + + +
+ +El asterisco (*) indica los campos obligatorios
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Nombre: + +* + + + +
Nombre de grupo NT: + +* + + + + + + + +
Tipo del grupo NT: + +* + + + + + + + +
Dominio del grupo NT: + +* + + + +
Descripción: + +
Escenario: + +
Departamento: + +
Propietario:
+ + + +
+ +
Ver también
+ + + +
+ + + + + +Tiene que guardar esta entrada para poder modificar el campo. + +
Miembros del grupo NT
+ + + +
+ +
Borrar grupo NT si el grupo borrado es: + +
Crear nuevo grupo NT: + +
+ + +
+Esta entrada fue modificada por última vez el + + por + + + + + + + + diff --git a/config/es/display-ntperson.html b/config/es/display-ntperson.html new file mode 100644 index 0000000..6215a70 --- /dev/null +++ b/config/es/display-ntperson.html @@ -0,0 +1,524 @@ + + + + + + + + +<!-- IF "Adding" --> +Nueva +<!-- ENDIF // Adding --> +Entrada personal NT: +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + + + + + + + + +
+ + + +BORDER=0> + + +Persona (haga clic para ver la tarjeta) + + + + + > +Click to display organization chart + + + +Nueva persona NT: + + +
+ + + + +>Recibir certificado + + + + +   + +>Play Audio Clip + + + + + + + + +
+ + +   + + + + + + +   + + + +   + + + + + +   + + + + + +
+ + + + + + + + + + + + + +El asterisco (*) indica los campos obligatorios
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Información de contacto
Nombre: + +Nombre y apellidos: + +* + + + +
Apellidos: + +* + + + +
Contraseña del directorio: + + Repítala para confirmar: + +
Teléfono: + +Dirección electrónica: + +
Fax: + +Identificación de usuario: + +
Localizador: + +Teléfono móvil: + +
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Información sobre cuenta Windows NT
Identificación de usuario NT: + +* + + + + + + + + +Nombre de dominio NT: + +* + + + +
Borrar cuenta NT si la persona borrada es: + +
Crear nueva cuenta NT: + +
Comentario del usuario NT: + +Identificador exclusivo usuario NT: + +
Caducidad contraseña NT: + +Nº de contraseñas erróneas NT: + +
Última fecha de entrada NT: + +Última fecha de salida NT + +
Fecha de caducidad cuenta NT: + +Nº de accesos NT: + +
Servidor de acceso NT: + +Estaciones NT: + +
Pág. de códigos NT: + +Cógido de país NT: + +
Identif. grupo principal NT: + +Perfil NT: + +
Directorio principal NT: + +Unidad directorio ppal. NT: + +
Vía de acceso a guión NT: + +Almacenamiento máx. NT: + +
Unidades NT por semana + +Privilegios de usuario NT: + +
Privilegios de operador usuario NT: + +Funciones varias cta. usuario NT: + +
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Información sobre actividad profesional y ubicación
Categoría comercial: + +Cargo: + +
Departamento: + +Responsable:
+ + + +
+Tiene que guardar esta entrada para poder modificar este campo. + + + + + +
Nº de despacho + +Admin.:
+ + + +
+ +
Nº de dpto.: + +Nº empleado: + +
C. identidad/pasaporte: + +    
Dirección postal: + +
+ + + + + + + + + + + + + + + + +--> +
+Información adicional
Descripción: + +
Ver también:
+ + + +
+ +Tiene que guardar esta entrada para poder modificar este campo. + + + + + +
Página web: + +
+ +Esta entrada fue modificada por última vez el + + por + + + + + + + + + diff --git a/config/es/display-org.html b/config/es/display-org.html new file mode 100644 index 0000000..1586425 --- /dev/null +++ b/config/es/display-org.html @@ -0,0 +1,166 @@ + + + + + + + +<!-- IF "Adding" --> +Nueva +<!-- ENDIF // Adding --> +Empresa: +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + +
+Empresa + + + +Nueva empresa: + + + +
+ + + + + + + +
+ + + + + + + +   + + + +   + + + + + +   + + + +
+ + + + + + + + + +
+ +El asterisco (*) indica los campos obligatorios
+ + + + + + + + + + + + + + + + + + + + + + +
Nombre de la empresa: + +* + + + +Descripción: + +
Teléfono: + +Categoría comercial: + +
Fax: + +Dirección: + +
Dirección postal: + +
Ver también: + +
+ + +
+Esta entrada fue modificada por última vez el + + por + + + + + + + + diff --git a/config/es/display-orgperson.html b/config/es/display-orgperson.html new file mode 100644 index 0000000..d38e863 --- /dev/null +++ b/config/es/display-orgperson.html @@ -0,0 +1,373 @@ + + + + + + + + +<!-- IF "Adding" --> +Nueva +<!-- ENDIF // Adding --> +Entrada personal: +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + + + + + + + + + +
+ + + +BORDER=0> + + +Persona (haga clic para ver la tarjeta) + + + + > +Click to display organization chart + + + +Nueva persona: + + +
+ + + + +>Recibir certificado + + + + +   + +>Reproducir fragmento de sonido + + + + + + + + +
+ + +   + + + + + + +   + + + +   + + + + + +   + + + + + +
+ + + + + + + + + + + + +El asterisco (*) indica los campos obligatorios
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Información de contacto
Nombre: + +Nombre y apellidos: + +* + + + +
Apellidos: + +* + + + +
Contraseña: + + Repetir la contraseña para confirmarla: + +
Teléfono: + +Dirección electrónica: + +
Fax: + +Identificador de usuario: + +
Buscapersonas: + +Teléfono móvil: + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Información sobre actividad comercial y ubicación
Categoría comercial: + +Cargo: + +
Departamento: + +Responsable:
+ + + +
+Tiene que guardar esta entrada para poder modificar este campo. + + + + + +
Nº de despacho: + +Admin.:
+ + + +
+ +
Nº de dpto.: + +Nº empleado: + +
C. identidad/pasaporte: + +    
Dirección postal: + +
+ + + + + + + + + + + + + + + + + + + + +--> + +
+Información adicional
Descripción: + +
Ver también:
+ + + +
+ +Tiene que guardar esta entrada para poder modificar este campo. + + + + + +
Página web: + +
+ + +Esta entrada fue modificada por última vez el + + por + + + + + + + + diff --git a/config/es/display-orgunit.html b/config/es/display-orgunit.html new file mode 100644 index 0000000..003340c --- /dev/null +++ b/config/es/display-orgunit.html @@ -0,0 +1,166 @@ + + + + + + + +<!-- IF "Adding" --> +Nuevo +<!-- ENDIF // Adding --> +Departamento: +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + +
+Departamento + + + +Nuevo Departamento: + + + +
+ + + + + + + +
+ + + + + + + +   + + + +   + + + + + +   + + + +
+ + + + + + + + + +
+ +El asterisco (*) indica los campos obligatorios.
+ + + + + + + + + + + + + + + + + + + + + + +
Nombre del dpto.: + +* + + + +Descripción: + +
Teléfono: + +Categoría comercial: + +
Fax: + +Dirección: + +
Dirección postal: + +
Ver también: + +
+ + +
+Esta entrada fue modificada por última vez el + + por + + + + + + + + diff --git a/config/es/display-person.html b/config/es/display-person.html new file mode 100644 index 0000000..500a9d7 --- /dev/null +++ b/config/es/display-person.html @@ -0,0 +1,260 @@ + + + + + + + + +<!-- IF "Adding" --> +Nueva +<!-- ENDIF // Adding --> +Entrada personal: +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + + + + + + + +
+ +Persona (haga clic para ver la tarjeta) + + + + > +Click to display organization chart + + + +Nueva persona: + + +
+ + + + + + + +
+ + +   + + + + + + +   + + + +   + + + + + +   + + + + + +
+ + + + + + + + + +
+ +El asterisco (*) indica los campos obligatorios
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Apellidos: + +* + + + +Nombre y apellidos: + +

Contraseña: + + Repita la contraseña para confirmarla: + +

Teléfono: + +Dirección electrónica: + +
Fax: + +User ID: + +
Buscapersonas: + +Teléfono móvil: + +

Cargo: + +
Dirección postal: + +

Descripción: + +
Ver también:
+ + + +
+ +Tiene que guardar esta entrada para poder modificar el campo. + + + + + +
Página web: + +
Bebida favorita: + +
+ + +
+Esta entrada fue modificada por última vez el + + por + + + + + + + + diff --git a/config/es/dsgw-l10n.conf b/config/es/dsgw-l10n.conf new file mode 100644 index 0000000..3155f83 --- /dev/null +++ b/config/es/dsgw-l10n.conf @@ -0,0 +1,50 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# To localize the search type menu: +# Locate dsgw-l10n.conf in config//. +# dsgw-l10n.conf contains translated words for search type pulldown menu. +# dsgw-l10n.conf sample: +# Note: the sample part should have double #'s for L10n. +## translate People +## translate NT-People +## translate Groups +## translate NT-Groups +## translate Organizations +## translate Org-Units +## translate Anything diff --git a/config/es/dsgw.tmpl b/config/es/dsgw.tmpl new file mode 100644 index 0000000..dad6b67 --- /dev/null +++ b/config/es/dsgw.tmpl @@ -0,0 +1,154 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK + +# The htmldir directive tells the CGIs where to find the html files +htmldir ../html + +# The configdir directive tells the CGIs where to find the +# templates/configuration files +configdir ../config + +# The gwnametrans directive tells the CGIs what url to output +# for http redirection. It should be the same nameTrans set +# in the webserver, if any is being is used. +gwnametrans /clients/dsgw/html/ + +# The authlifetime directive specifies how long authentication credentials +# are valid (in seconds). +authlifetime 7200 + +# The libNLS data directory. This directory should contain a directory +# named "locales", which contains the configuration files LANG.ctx and +# LANG.txt for each supported language (locale). +NLS ../../../lib/nls + +# The default character set, for communication with HTTP clients. +# A client may override this default, using an HTTP Accept-Charset header. +# Or, this default may be overridden for a specific language, by creating +# a LANG/dsgwcharset.conf file which contains the charset name. +# For compatibility with HTTP clients that can't handle an HTTP response +# with a charset parameter in the content-type, comment out this directive; +# responses will be sent in ISO-8859-1, with no explicit charset parameter. +# RFC 1345 defines the syntax of charset names. There is a registry of +# charsets, at ftp://ftp.isi.edu/in-notes/iana/assignments/character-sets +# charset UTF-8 + +# Substitute ideographic space for non-breaking space in Asian charsets: +changeHTML "  " " " Shift_JIS Big5 EUC-KR +changeHTML " " " " Shift_JIS Big5 EUC-KR + +# Mapping between config/display-XXX.html templates and LDAP objectClasses. +# This can be generated by using ds/templateindex. The format is: +# +# template TEMPLATENAME OBJECTCLASSES +# +# where "display-TEMPLATENAME.html" is the name of a display template +# that is found in this config directory (e.g., "display-group.html") and +# OBJECTCLASSES is a list of one or more objectClass values. For a given +# template to be used, all the objectClass values listed must be present +# in the directory entry, so the order of these template lines is +# significant (e.g. note that the more specific "orgperson" template is +# listed before the one for an ordinary "person"). +# +template group groupOfNames +template ntgroup groupOfUniqueNames ntGroup +template groupun groupOfUniqueNames +template org organization +template orgunit organizationalUnit +template ntperson person inetOrgPerson nTUser +template orgperson person inetOrgPerson +template person person +template country country + +# +# The remainder of this file contains information about the locations and +# types for new entries. +# +# "location" lines define places in the directory where new entries can be added +# The format of each line is: +# location HANDLE FRIENDLYNAME DN +# where HANDLE is a short name which is used in the "newtype" lines (see below) +# and FRIENDLYNAME is a human-readable name for the location +# and DN is the Distinguished Name for this location (if it does not end with +# '#', the location-suffix is appended to to construct a full DN; if it +# does end with `#', it assumed to be a full DN and the `#' is removed). +# +location country "España" "c=ES#" +location org "Esta empresa" "" +location groups "Grupos" "ou=Groups" +location people "Personas" "ou=People" +location special "Usuarios especiales" "ou=Special Users" + +# "newtype" lines define the types of new entries that may be added +# The format of each line is: +# newtype TEMPLATENAME FRIENDLYNAME RDNATTR LOCATIONS... +# where TEMPLATENAME corresponds to an existing display-TEMPLATENAME.html file +# and FRIENDLYNAME is a human-readable name for this type of entry +# and RDNATTR is the attribute that is used to name entries of this type +# and LOCATIONS is a blank-separated list of locations where these types of +# entries can be added (corresponding to a HANDLE on a "location" +# config. file line). +# +newtype orgperson "Persona" uid people special +newtype ntperson "Persona NT" uid people special +newtype ntgroup "Grupo NT" cn groups +newtype groupun "Grupo" cn groups +newtype orgunit "Departamento" ou people org +newtype org "Empresa" o country + +# Mappings between VCard properties and LDAP attribute types: +# The format of each line is: +# vcard-property VCARDPROP SYNTAX LDAPATTR [LDAPATTR2] +# where VCARDPROP is the name of a VCard property +# and SYNTAX is "cis" for simple strings and "mls" for multiline strings +# and LDAPATTR is the LDAP attribute that corresponds to VCARDPROP +# and LDAPATTR2 is an optional secondary LDAP attribute which is added to +# the property value by appending a semicolon and then the attr2 value. +vcard-property FN cis cn +vcard-property N cis sn givenName +vcard-property ORG cis o ou +vcard-property ROLE cis businessCategory +vcard-property ADR;WORK mls postalAddress +vcard-property ADR;HOME mls homePostalAddress +vcard-property EMAIL;INTERNET cis mail +vcard-property TITLE cis title +vcard-property TEL;WORK cis telephoneNumber +vcard-property TEL;FAX cis facsimileTelephoneNumber +vcard-property TEL;CELL cis mobile +vcard-property TEL;HOME cis homePhone +vcard-property NOTE cis description diff --git a/config/es/dsgw_adm.conf b/config/es/dsgw_adm.conf new file mode 100644 index 0000000..0ca5940 --- /dev/null +++ b/config/es/dsgw_adm.conf @@ -0,0 +1,78 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# Mapping between config/display-XXX.html templates and LDAP objectClasses. +# This can be generated by using the templateindex program. The format is: +# +# template TEMPLATENAME OBJECTCLASSES +# +# where "display-TEMPLATENAME.html" is the name of a display template +# that is found in this config directory (e.g., "display-group.html") and +# OBJECTCLASSES is a list of one or more objectClass values. For a given +# template to be used, all the objectClass values listed must be present +# in the directory entry, so the order of these template lines is +# significant (e.g. note that the more specific "orgperson" template is +# listed before the one for an ordinary "person"). +# +template group groupOfNames +template groupun groupOfUniqueNames +template org organization +template orgunit organizationalUnit +template orgperson person inetOrgPerson +template person person +template country country +template licensed-user nsLicenseUser + +# Attribute Value Sets (used with DS_ATTRVAL_SET directives) +# attrvset HANDLE VALUE PREFIX SUFFIX +# +attrvset CAL news "" "Netscape Collabra Server" +attrvset CAL slapd "" "Netscape Directory Server" + + +# Template Set definitions +# Note: templates must be defined before they can be mentioned on +# a tmplset line. +# +# tmplset SETNAME VIEWNAME TEMPLATENAME [HREF-LOCATION] +# +tmplset person "General" orgperson +tmplset person "Contraseña" passwd +tmplset person "Licencia" licensed-user +tmplset group "General" group +tmplset groupun "General" groupun diff --git a/config/es/dsgwfilter.conf b/config/es/dsgwfilter.conf new file mode 100644 index 0000000..d2e069f --- /dev/null +++ b/config/es/dsgwfilter.conf @@ -0,0 +1,171 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# ldap filter file +# +# lines like this that start with # or empty lines are ignored +# +# syntax: +# +# +# [] +# [] +# +# [] ... +# +# The should describe the filter. It should correctly complete +# the phrases (in the resource database) DBT_Found0EntriesWhere_, +# DBT_Found1EntryWhere_ and DBT_FoundEntriesWhere_; for example: +# +# Found 1 entry where the '%v'. +# Found no entries where the '%v'. +# Found 3 entries where the '%v'. +# +# The should begin with the article ("the" in English) for +# languages that require agreement between article and noun (e.g +# genders in Spanish or French). +# +# The scope is optional, and should be one of: +# "base" +# "onelevel" +# "subtree" +# if it is included. + +# +# Directory Server gateway +# + +"dsgw-people" + "=" " " "(%v))" "LDAP filtro es" + + "^[+]*[0-9][ 0-9-]*$" " " "(telephoneNumber=*%v))" "número de teléfono termina en" + + "@" " " "(mail=%v))" "dirección electrónica es" + "(mail=%v*))" "dirección electrónica comienza por" + + "^.[. _].*" ". _" "(cn=%v1* %v2-))" "primera inicial + nombre es" + + ".*[. _].$" ". _" "(cn=%v1-*))" "nombre + última inicial es" + + "[. _]" ". _" "(|(sn=%v1-)(cn=%v1-)))" "nombre es" + "(|(cn=*%v1-*)(sn=*%v1-*)(cn~=%v1-)(sn~=%v1-)))" "nombre suena como o contiene" + + "^\*$" " " "(|(cn=*)(sn=*)(uid=*)))" "nombre o identificación de usuario es" + + ".*" ". " "(|(cn=%v1)(sn=%v1)(uid=%v1)))" "nombre o identificación de usuario es" + "(|(cn=*%v1*)(sn=*%v1*)(cn~=%v1)(sn~=%v1)))" "nombre suena como o contiene" + + +"dsgw-groups" + "=" " " "(%v))" "LDAP filter es" + + "^\*$" " " "(cn=*))" "nombre es" + + ".*" ". _" "(cn=%v1-))" "nombre es" + "(cn=*%v1-*))" "nombre contiene" + "(cn~=%v1-))" "nombre suena como" + +"dsgw-ntgroups" + "=" " " "(%v))" "LDAP filter es" + + "^\*$" " " "(cn=*))" "nombre es" + + ".*" ". _" "(cn=%v1-))" "nombre es" + "(cn=*%v1-*))" "nombre suena como" + "(cn~=%v1-))" "nombre suena como" + "(ntgroupdomainid=%v:*))" "Dominio NT nombre es" + "(ntgroupdomainid=*:%v))" "Grupo NT es" + +"dsgw-organizations" + "=" " " "(%v))" "LDAP filter es" + + "\." " " "(associatedDomain=%v))" "Dominio asociado es" + + "^\*$" " " "(o=*))" "nombre es" + + ".*" " " "(o=%v))" "nombre es" + "(o=*%v*))" "nombre contiene" + "(o~=%v))" "nombre suena como" + +"dsgw-orgunits" + "=" " " "(%v))" "LDAP filter es" + + "\." " " "(associatedDomain=%v))" "Dominio asociado es" + + "^\*$" " " "(ou=*))" "nombre es" + + ".*" " " "(ou=%v))" "nombre es" + "(ou=*%v*))" "nombre contiene" + "(ou~=%v))" "nombre suena como" + +"dsgw-anything" + "=" " " "(%v)" "LDAP filter es" + + "[. _]" ". _" "(|(sn=%v1-)(cn=%v1-)(o=%v1-)(ou=%v1-))" "nombre es" + "(|(sn~=%v1-)(cn~=%v1-)(o=%v1-)(ou=%v1-))" "nombre suena como" + + "^\*$" " " "(|(cn=*)(sn=*)(o=*)(ou=*))" "nombre es" + + ".*" ". " "(|(cn=%v1)(sn=%v1)(o=%v1)(ou=%v1))" "nombre es" + "(|(cn=*%v1*)(sn=*%v1*)(cn~=%v1)(sn~=%v1)(o=%v1)(ou=%v1))" "nombre suena como o contiene" + + +"dsgw-ntpeople" + "=" " " "(%v))" "LDAP filter es" + + "^[+]*[0-9][ 0-9-]*$" " " "(telephoneNumber=*%v))" "número de teléfono termina en" + + "@" " " "(mail=%v))" "dirección electrónica es" + "(mail=%v*))" "dirección electrónica comienza por" + + "^.[. _].*" ". _" "(cn=%v1* %v2-))" "primera inicial + nombre es" + + ".*[. _].$" ". _" "(cn=%v1-*))" "nombre + última inicial es" + + "[. _]" ". _" "(|(sn=%v1-)(cn=%v1-)))" "nombre es" + "(|(cn=*%v1-*)(sn=*%v1-*)(cn~=%v1-)(sn~=%v1-)))" "nombre suena como o contiene" + + "^\*$" " " "(|(cn=*)(sn=*)))" "nombre es" + + ".*" ". " "(|(cn=%v1)(sn=%v1)))" "nombre es" + "(ntuserlogonserver=%v))" "Servidor de acceso NT" + "(ntuserdomainid=%v:*))" "Dominio NT nombre es" + "(ntuserdomainid=*:%v))" "Nombre de usuario NT" + "(|(cn=*%v1*)(sn=*%v1*)(cn~=%v1)(sn~=%v1)))" "nombre suena como o contiene" + +# Do not remove this line, or place any directives after it. diff --git a/config/es/dsgwfilter_adm.conf b/config/es/dsgwfilter_adm.conf new file mode 100644 index 0000000..95bca87 --- /dev/null +++ b/config/es/dsgwfilter_adm.conf @@ -0,0 +1,105 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# ldap filter file +# +# lines like this that start with # or empty lines are ignored +# +# syntax: +# +# +# [] +# [] +# +# [] ... +# +# The should describe the filter. It should correctly complete +# the phrases (in the resource database) DBT_Found0EntriesWhere_, +# DBT_Found1EntryWhere_ and DBT_FoundEntriesWhere_; for example (en): +# +# Found 1 entry where the '%v'. +# Found no entries where the '%v'. +# Found 3 entries where the '%v'. +# +# The should begin with the article ("the" in English) for +# languages that require agreement between article and noun (e.g +# genders in Spanish or French). +# +# The scope is optional, and should be one of: +# "base" +# "onelevel" +# "subtree" +# if it is included. + +# +# Directory Server gateway - for Netscape Admin Server +# + +"dsgw-people" + "=" " " "(%v))" "LDAP filtro es" + + "^[+]*[0-9][ 0-9-]*$" " " "(telephoneNumber=*%v))" "número de teléfono termina en" + + "@" " " "(mail=%v))" "dirección electrónica es" + "(mail=%v*))" "dirección electrónica comienza por" + + "^.[. _].*" ". _" "(cn=%v1* %v2-))" "primera inicial + nombre es" + + ".*[. _].$" ". _" "(cn=%v1-*))" "nombre + última inicial es" + + "[. _]" ". _" "(|(sn=%v1-)(cn=%v1-)))" "name is" + "(|(cn=*%v1-*)(sn=*%v1-*)(cn~=%v1-)(sn~=%v1-)))" "nombre suena como o contiene" + + ".*" ". " "(uid=%v1))" "identificación de acceso es" + "(|(cn=%v1)(sn=%v1)))" "nombre es" + "(|(cn=*%v1*)(sn=*%v1*)(cn~=%v1)(sn~=%v1)))" "nombre suena como o contiene" + + +"dsgw-groups" + "=" " " "(%v))" "LDAP filter is" + + ".*" ". _" "(cn=%v1-))" "nombre es" + "(cn~=%v1-))" "nombre suena como" + +"dsgw-orgunits" + "=" " " "(%v))" "LDAP filtro es" + + ".*" ". _" "(ou=%v1-))" "nombre de la unidad es" + "(ou~=%v1-))" "nombre de la unidad suena como" + +#Do not remove this line, or place any additional lines after it. diff --git a/config/es/dsgwsearchprefs.conf b/config/es/dsgwsearchprefs.conf new file mode 100644 index 0000000..e63d325 --- /dev/null +++ b/config/es/dsgwsearchprefs.conf @@ -0,0 +1,245 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# dsgwsearchprefs.conf - directory server gateway search object definitions + + +# the current version of this file format is 1 +Version 1 + + +# Name for this search object +People +# options (the only one supported right now is "internal" which means that +# this search object should not be presented directly to the user) +# use "" for none +"" +# Label to place before text box user types in +"Search For:" +# Filter prefix to append to all searches +"(&(objectClass=person)" +# Tag to use for "Fewer Choices" searches - from ldapfilter.conf file +"dsgw-people" +# If a search results in > 1 match, retrieve this attribute to help +# user disambiguate the entries... +not-used-by-dsgw +# ...and label it with this string: +not-used-by-dsgw +# Search scope to use when searching +subtree +# Follows a list of "More Choices" search options. Format is: +# Label, attribute, select-bitmap, extra attr display name, extra attr ldap name +# If last two are null, "Fewer Choices" name/attributes used. +# Label should begin with the article ("the" in English) for +# languages that require agreement between article and noun +# (e.g genders in Spanish or French). + +"nombre y apellidos" cn 111111 "" "" +"apellidos" sn 111111 "" "" +"número de teléfono" "telephoneNumber" 111011 "" "" +"dirección electrónica" "mail" 111111 "" "" +"identificación de usuario" "uid" 111111 "" "" +"cargo" title 111111 "" "" +END +# Match types +"es" "(%a=%v))" +"no es" "(!(%a=%v)))" +"suena como" "(%a~=%v))" +"comienza por" "(%a=%v*))" +"termina en" "(%a=*%v))" +"contiene" "(%a=*%v*))" +END + + +"NT-People" +"" +"Search For:" +"(&(objectClass=ntuser)" +"dsgw-ntpeople" +not-used-by-dsgw +not-used-by-dsgw +subtree +"nombre y apellidos" cn 111111 "" "" +"apellidos" sn 111111 "" "" +"número de teléfono" "telephoneNumber" 111011 "" "" +"dirección electrónica" "mail" 111111 "" "" +"identificación de usuario" "uid" 111111 "" "" +"cargo" title 111111 "" "" +"Nombre de usuario NT" "ntuserdomainid" 110000 "" "" +"Dominio NT" "ntuserdomainid" 101000 "" "" +"Servidor de acceso NT" "ntuserlogonserver" 111111 "" "" +END +"es" "(%a=%v))" +"no es" "(!(%a=%v)))" +"suena como" "(%a~=%v))" +"comienza por" "(%a=%v*))" +"termina en" "(%a=*%v))" +"contiene" "(%a=*%v*))" +END + + +Groups +"" +"Search For:" +"(&(|(objectClass=rfc822MailGroup)(objectClass=groupOfNames)(objectClass=groupOfUniqueNames)(objectClass=groupOfCertificates))" +"dsgw-groups" +not-used-by-dsgw +not-used-by-dsgw +subtree +"nombre" cn 111111 "" "" +"descripción" description 111111 "" "" +"propietario (DN)" "owner" 000011 "owner" "Owner" +"miembro (DN)" "member" 000011 "" "" +END +"es" "(%a=%v))" +"no es" "(!(%a=%v)))" +"suena como" "(%a~=%v))" +"comienza por" "(%a=%v*))" +"termina en" "(%a=*%v))" +"contiene" "(%a=*%v*))" +END + +NT-Groups +"" +"Search For:" +"(&(objectClass=ntGroup)" +"dsgw-ntgroups" +not-used-by-dsgw +not-used-by-dsgw +subtree +"nombre" cn 111111 "" "" +"Dominio NT" "ntgroupdomainid" 111111 "" "" +"nombre de grupo NT" "ntgroupdomainid" 111111 "" "" +"descripción" description 111111 "" "" +"propietario (DN)" "owner" 000011 "owner" "Owner" +"miembro (DN)" "uniquemember" 000011 "" "" +END +"es" "(%a=%v))" +"no es" "(!(%a=%v)))" +"suena como" "(%a~=%v))" +"comienza por" "(%a=%v*))" +"termina en" "(%a=*%v))" +"contiene" "(%a=*%v*))" +END + + +Organizations +"" +"Search For:" +"(&(objectClass=organization)" +"dsgw-organizations" +not-used-by-dsgw +not-used-by-dsgw +subtree +"nombre" o 111111 "" "" +"dirección" l 111111 "" "" +"número de teléfono" telephoneNumber 111011 "" "" +"descripción" description 111011 "" "" +END +"es" "(%a=%v))" +"no es" "(!(%a=%v)))" +"suena como" "(%a~=%v))" +"comienza por" "(%a=%v*))" +"termina en" "(%a=*%v))" +"contiene" "(%a=*%v*))" +END + + +"Org-Units" +"" +"Search For:" +"(&(objectClass=organizationalUnit)" +"dsgw-orgunits" +not-used-by-dsgw +not-used-by-dsgw +subtree +"nombre" ou 111111 "" "" +"dirección" l 111111 "" "" +"número de teléfono" telephoneNumber 111011 "" "" +"descripción" description 111111 "" "" +END +"es" "(%a=%v))" +"no es" "(!(%a=%v)))" +"suena como" "(%a~=%v))" +"comienza por" "(%a=%v*))" +"termina en" "(%a=*%v))" +"contiene" "(%a=*%v*))" +END + +Anything +"" +"Search For:" +"" +"dsgw-anything" +not-used-by-dsgw +not-used-by-dsgw +subtree +"nombre común" cn 111111 "" "" +"descripción" description 111111 "" "" +END +"es" "(%a=%v)" +"no es" "(!(%a=%v))" +"suena como" "(%a~=%v)" +"comienza por" "(%a=%v*)" +"termina en" "(%a=*%v)" +"contiene" "(%a=*%v*)" +END + +Auth +internal +"Authenticate As:" +"(&(objectClass=person)" +"dsgw-people" +not-used-by-dsgw +not-used-by-dsgw +subtree +"nombre común" cn 111111 "" "" +"apellido" sn 111111 "" "" +"número de teléfono" "telephoneNumber" 111011 "" "" +"dirección electrónica" "mail" 111111 "" "" +"identificación de usuario" "uid" 111111 "" "" +"cargo" title 111111 "" "" +END +"es" "(%a=%v))" +"no es" "(!(%a=%v)))" +"suena como" "(%a~=%v))" +"comienza por" "(%a=%v*))" +"termina en" "(%a=*%v))" +"contiene" "(%a=*%v*))" +END + diff --git a/config/es/edit-passwd.html b/config/es/edit-passwd.html new file mode 100644 index 0000000..8341a7d --- /dev/null +++ b/config/es/edit-passwd.html @@ -0,0 +1,109 @@ + + + + + +Cambiar la contraseña: +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + +

Cambiar la contraseña de + +

+ +
+ +

+ + + + + + + + + + + + + + + +
+Escriba la contraseña antigua: + + +
+Escriba la contraseña antigua: + + +
+Escriba la nueva: + + +
+Vuelva a escribir la nueva para confirmarla: + + +
+ +

+ + + +
+ + + + + + + +
+ + + + + diff --git a/config/es/list-Anything.html b/config/es/list-Anything.html new file mode 100644 index 0000000..5b1b402 --- /dev/null +++ b/config/es/list-Anything.html @@ -0,0 +1,73 @@ + + +

+ +
+

+ + + + + +
Nombre Número de teléfono +Dirección electrónica Descripción + + + + +
+ + + + + + + + + +
+ + +

+

+Pruebe con otra búsqueda. +
+ + + diff --git a/config/es/list-Auth.html b/config/es/list-Auth.html new file mode 100644 index 0000000..bd3c091 --- /dev/null +++ b/config/es/list-Auth.html @@ -0,0 +1,104 @@ + + + + + +
+ + +> + +
+ + + +
+ +

+ +Haga clic en el nombre de la entrada que desee usar para la autenticación. + +

+ + + + +
Autenticar como Cargo + + + + +
+ + + + + + +
+ +Retroceda y vuelva a intentarlo. + +

+ +
+ + +
+ + + +
+
+ + diff --git a/config/es/list-Groups.html b/config/es/list-Groups.html new file mode 100644 index 0000000..cc1f591 --- /dev/null +++ b/config/es/list-Groups.html @@ -0,0 +1,69 @@ + + +
+ +
+

+ + + + + +
Nombre del grupo +Descripción + + + + +
+ + + + + +
+ + +

+

+Pruebe con otra búsqueda. +
+ + + diff --git a/config/es/list-NT-Groups.html b/config/es/list-NT-Groups.html new file mode 100644 index 0000000..3c039c2 --- /dev/null +++ b/config/es/list-NT-Groups.html @@ -0,0 +1,75 @@ + + +
+ +
+

+ + + + + +
Nombre de grupo LDAP +Nombre de dominio NT +Nombre de grupo NT +Descripción + + + + +
+ + + + + + + + + +
+ + +

+

+Pruebe con otra búsqueda. +
+ + + diff --git a/config/es/list-NT-People.html b/config/es/list-NT-People.html new file mode 100644 index 0000000..ea93641 --- /dev/null +++ b/config/es/list-NT-People.html @@ -0,0 +1,79 @@ + + +
+ +
+

+ + + + + + + + + + + + + + + +
NombreDominio NTNombre de usuarioNúmero de teléfono +
+ + onMouseOver="window.status='Haga clic aquí para ver esta entrada en detalle'; return true"> + + + + + + + + +
+ + +

+

+Pruebe con otra búsqueda. +
+ + + diff --git a/config/es/list-Org-Units.html b/config/es/list-Org-Units.html new file mode 100644 index 0000000..649a49a --- /dev/null +++ b/config/es/list-Org-Units.html @@ -0,0 +1,69 @@ + + +
+ +
+

+ + + + +
Departamento Descripción Número de teléfono + + + + +
+ + + + + + + +
+ + +

+

+Pruebe con otra búsqueda. +
+ + + diff --git a/config/es/list-Organizations.html b/config/es/list-Organizations.html new file mode 100644 index 0000000..cc49d3d --- /dev/null +++ b/config/es/list-Organizations.html @@ -0,0 +1,69 @@ + + +
+ +
+

+ + + + +
Empresa Descripción Número de teléfono + + + + +
+ + + + + + + +
+ + +

+

+Pruebe con otra búsqueda. +
+ + + diff --git a/config/es/list-People.html b/config/es/list-People.html new file mode 100644 index 0000000..4b85c3e --- /dev/null +++ b/config/es/list-People.html @@ -0,0 +1,79 @@ + + +
+ +
+

+ + + + + + + + + + + + + + + +
NombreNúmero de teléfonoDirección electrónicaCargo +
+ + onMouseOver="window.status='Haga clic aquí para ver esta entrada en detalle'; return true"> + + + + + + + + +
+ + +

+

+Pruebe con otra búsqueda. +
+ + + diff --git a/config/es/list-fa-Groups.html b/config/es/list-fa-Groups.html new file mode 100644 index 0000000..d2fef48 --- /dev/null +++ b/config/es/list-fa-Groups.html @@ -0,0 +1,53 @@ + + + + + +
+ + + + +
+ + + + + + diff --git a/config/es/list-fa-People.html b/config/es/list-fa-People.html new file mode 100644 index 0000000..f36d222 --- /dev/null +++ b/config/es/list-fa-People.html @@ -0,0 +1,53 @@ + + + + + +
+ + + + +
+ + + + + + diff --git a/config/es/list-urlsearch.html b/config/es/list-urlsearch.html new file mode 100644 index 0000000..a4b7146 --- /dev/null +++ b/config/es/list-urlsearch.html @@ -0,0 +1,69 @@ + + +
+ +
+

+ + + + +
Nombre Número de teléfono Dirección electrónica + + + + +
+ + + + + + + +
+ + +

+

+Pruebe con otra búsqueda. +
+ + + diff --git a/config/es/newentry.html b/config/es/newentry.html new file mode 100644 index 0000000..751b2f7 --- /dev/null +++ b/config/es/newentry.html @@ -0,0 +1,57 @@ + + + + +Pasarela de Netscape Directory Server: Nueva entrada + + + + + + + + + +<BODY> +Tiene que emplear un programa de acceso que admita marcos para poder ver este documento. +</BODY> + + diff --git a/config/es/newentryName.html b/config/es/newentryName.html new file mode 100644 index 0000000..672c9a0 --- /dev/null +++ b/config/es/newentryName.html @@ -0,0 +1,79 @@ + + + + + + +

+ +Paso 2. +Dé un nombre al nuevo + +. +

+ += + + +

+Paso 3. + + +Elija la dirección de directorio de este + + o elija Otros e introduzca el nombre unívoco completo al que debe añadirse esta entrada. +

+ + + + +

+Paso 4. + + +Haga clic en Continuar para abrir el cuadro de la entrada. Modifique la información contenida o introduzca nuevos datos y guarde la entrada al terminar. +

+

+
+ + + + +
+ diff --git a/config/es/newentryType.html b/config/es/newentryType.html new file mode 100644 index 0000000..67e6a7a --- /dev/null +++ b/config/es/newentryType.html @@ -0,0 +1,45 @@ + + + + + +Paso 1. +Elija el tipo de entrada que desee crear. + + diff --git a/config/es/ns-license-schema.conf b/config/es/ns-license-schema.conf new file mode 100644 index 0000000..bf89525 --- /dev/null +++ b/config/es/ns-license-schema.conf @@ -0,0 +1,49 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +attribute nsLicensedFor cis +attribute nsLicenseStartTime cis +attribute nsLicenseEndTime cis + +objectclass nsLicenseUser + requires + objectClass + allows + nsLicensedFor + nsLicenseStartTime + nsLicenseEndTime diff --git a/config/es/search.html b/config/es/search.html new file mode 100644 index 0000000..62801e3 --- /dev/null +++ b/config/es/search.html @@ -0,0 +1,49 @@ + + + + +Pasarela de Netscape Directory Server: Standard Search + + + + + + + + diff --git a/config/es/searchString.html b/config/es/searchString.html new file mode 100644 index 0000000..ab5df97 --- /dev/null +++ b/config/es/searchString.html @@ -0,0 +1,61 @@ + + + + + + + + + + + + +
Buscar: + +en: + +
Buscar esto: + +   + +
+ + + + diff --git a/config/fr/authPassword.html b/config/fr/authPassword.html new file mode 100644 index 0000000..aee3597 --- /dev/null +++ b/config/fr/authPassword.html @@ -0,0 +1,60 @@ + + + + +Authentification... + + + + + + +

+Mot de passe pour + +: +

+

+ + + +
+ + + diff --git a/config/fr/authSearch.html b/config/fr/authSearch.html new file mode 100644 index 0000000..a3e7d29 --- /dev/null +++ b/config/fr/authSearch.html @@ -0,0 +1,65 @@ + + + + +Authentification... + + + + + +Vous devez d'abord vous identifier avant de pouvoir authentifier votre +accès au système.
Veuillez entrer votre nom : + +

+

+ + + +
+ +

+ + (seuls les administrateurs d'annuaires y ont accès) + + + + + + diff --git a/config/fr/csearch.html b/config/fr/csearch.html new file mode 100644 index 0000000..0efccd2 --- /dev/null +++ b/config/fr/csearch.html @@ -0,0 +1,54 @@ + + + + +Netscape Directory Server Gateway : Advanced Search + + + + + + + + + + + + + diff --git a/config/fr/csearchAttr.html b/config/fr/csearchAttr.html new file mode 100644 index 0000000..769c202 --- /dev/null +++ b/config/fr/csearchAttr.html @@ -0,0 +1,48 @@ + + + + + + + + + +
où�: + +
diff --git a/config/fr/csearchBase.html b/config/fr/csearchBase.html new file mode 100644 index 0000000..03c550d --- /dev/null +++ b/config/fr/csearchBase.html @@ -0,0 +1,48 @@ + + + + + + + + +
dans: + +
+ diff --git a/config/fr/csearchString.html b/config/fr/csearchString.html new file mode 100644 index 0000000..c1353e7 --- /dev/null +++ b/config/fr/csearchString.html @@ -0,0 +1,59 @@ + + + + + + + + + + + +
+ + + + dans : + +
+ + + + + diff --git a/config/fr/csearchType.html b/config/fr/csearchType.html new file mode 100644 index 0000000..479d892 --- /dev/null +++ b/config/fr/csearchType.html @@ -0,0 +1,49 @@ + + + + + + + + + +
Rechercher : + +
+ diff --git a/config/fr/display-country.html b/config/fr/display-country.html new file mode 100644 index 0000000..4ac80e3 --- /dev/null +++ b/config/fr/display-country.html @@ -0,0 +1,85 @@ + + + + + + +Pays - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + +
+Country + + +
+ + + + + + + + + + + +
Nom de pays : + +Description: + +
Voir également : + +
URL : + +
+ +


+ +La dernière modification de cette entrée date du + + par + + + + + + diff --git a/config/fr/display-dnedit.html b/config/fr/display-dnedit.html new file mode 100644 index 0000000..8b22350 --- /dev/null +++ b/config/fr/display-dnedit.html @@ -0,0 +1,107 @@ + + + + + + +Edition +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + + + + + + + + +Edition + +: + + + + + + + + + + + + +
+Rechercher + + +correspondant é  + + + +
+ +
+ +

+

+ +
+ + + + + +
+ + + + + + + diff --git a/config/fr/display-dneditpeople.html b/config/fr/display-dneditpeople.html new file mode 100644 index 0000000..1d639e4 --- /dev/null +++ b/config/fr/display-dneditpeople.html @@ -0,0 +1,108 @@ + + + + + + +Modification +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + + + + + + + + +Modification + +: + + + + + + + + + + +
+Rechercher + + +correspondant é  + + + +
+ + + + + + + + diff --git a/config/fr/display-group.html b/config/fr/display-group.html new file mode 100644 index 0000000..111b5bd --- /dev/null +++ b/config/fr/display-group.html @@ -0,0 +1,181 @@ + + + + + + + +<!-- IF "Adding" --> +Nouvelle +<!-- ENDIF // Adding --> +Entrée de groupe +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + +
+Groupe + + +Nouveau groupe - + + + +
+ + + + + + + +
+ + + + + + + +   + + + +   + + + + + +   + + + +
+ + + + + + + + + + +
+ +* Indique une zone d'entrée obligatoire
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Nom : + +* + + + +
Description : + +
Propriétaire :
+ + + +
+ +
Voir également :
+ + + +
+ + + + + +Vous devez enregistrer cette entrée pour pouvoir modifier ces champs. + +
Membres du groupe :
+ + + +
+ +
+ + +
+La dernière modification de cette entrée date du + + par + + + + + + + + + + diff --git a/config/fr/display-groupun.html b/config/fr/display-groupun.html new file mode 100644 index 0000000..5b37039 --- /dev/null +++ b/config/fr/display-groupun.html @@ -0,0 +1,181 @@ + + + + + + + +<!-- IF "Adding" --> +Nouvelle +<!-- ENDIF // Adding --> +Entrée de groupe +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + +
+Groupe + + +Nouveau groupe - + + + +
+ + + + + + + +
+ + + + + + + +   + + + +   + + + + + +   + + + +
+ + + + + + + + + + +
+ +* Indique une zone d'entrée obligatoire
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Nom : + +* + + + +
Description : + +
Propriétaire :
+ + + +
+ +
Voir également :
+ + + +
+ + + + + +Vous devez enregistrer cette entrée pour pouvoir modifier ces champs. + +
Membres du groupe :
+ + + +
+ +
+ + +
+La dernière modification de cette entrée date du + + par + + + + + + + + diff --git a/config/fr/display-mailgroup.html b/config/fr/display-mailgroup.html new file mode 100644 index 0000000..1e5b62d --- /dev/null +++ b/config/fr/display-mailgroup.html @@ -0,0 +1,156 @@ + + + + + + + +<!-- IF "Adding" --> +Nouvelle +<!-- ENDIF // Adding --> +entrȨe de groupe de courrier - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + +
+Groupe + + +Nouveau groupe de courrier + + + + +
+ + + + +
+ + + + + + + +   + + + +   + + + + + + + +   + + + +
+ + + + + + + +
+ + + + + + + + + + + + + + +
+ + + + + + + +
Nom : + +Description : + +
Propriétaire : + +
Voir également : + +
+ + + +
Membres du groupe : + +
Membres de courrier électronique : + +
+ + +
+La dernière modification de cette entrée date du + + par + + + + + + + + + diff --git a/config/fr/display-ntgroup.html b/config/fr/display-ntgroup.html new file mode 100644 index 0000000..796975d --- /dev/null +++ b/config/fr/display-ntgroup.html @@ -0,0 +1,249 @@ + + + + + + + +<!-- IF "Adding" --> +Nouvelle +<!-- ENDIF // Adding --> +Entrée du groupe NT - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + +
+Groupe + + +Nouveau groupe NT - + + + +
+ + + + + + + +
+ + + + + + + +   + + + +   + + + + + +   + + + +
+ + + + + + + + + + + +
+ +* Indique une zone d'entrée obligatoire
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Nom : + +* + + + +
Nom du groupe NT : + +* + + + + + + + +
Type de groupe NT : + +* + + + + + + + +
Domaine du groupe NT : + +* + + + +
Description : + +
Lieu : + +
Service de la société : + +
Propriétaire :
+ + + +
+ +
Voir également :
+ + + +
+ + + + + +Vous devez enregistrer cette entrée pour pouvoir modifier ces champs. + +
Membres du groupe NT :
+ + + +
+ +
Supprimer le groupe NT si le groupe est supprimé : + +
Créer un nouveau groupe NT : + +
+ + +
+La dernière modification de cette entrée date du + + par + + + + + + + + + + diff --git a/config/fr/display-ntperson.html b/config/fr/display-ntperson.html new file mode 100644 index 0000000..7e3ce3c --- /dev/null +++ b/config/fr/display-ntperson.html @@ -0,0 +1,539 @@ + + + + + + + + +<!-- IF "Adding" --> +Nouvelle +<!-- ENDIF // Adding --> +Entrée de personne NT- +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + + + + + + + + +
+ + + +BORDER=0> + + +Personne (cliquez pour afficher la carte) + + + + + > +Click to display organization chart + + + +Nouvelle personne NT + + +
+ + + + +>Download Certificate + + + + +   + +>Play Audio Clip + + + + + + + + +
+ + +   + + + + + + +   + + + +   + + + + + +   + + + + + +
+ + + + + + + + + + + + +
+ +* Indique une zone d'entrée obligatoire
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Contacts
Prénom : + +Nom complet : + +* + + + +
Nom de famille : + +* + + + +
Mot de passe du Directory Server : + + Retaper le mot de passe pour confirmation + +
Téléphone : + +Adresse électronique : + +
Télécopie : + +Id utilisateur : + +
Téléavertisseur : + +Téléphone mobile : + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Informations sur le compte Windows NT
Id utilisateur NT : + +* + + + + + + + + +Nom de domaine NT : + +* + + + +
Supprimer le compte NT si la personne est supprimée + +
Créer un nouveau compte NT + +
Commentaire utilisateur NT + +Id utilisateur NT unique : + +
Mot de passe NT périmé : + +Compte de mots de passe NT incorrect : + +
Dernière date de connexion au système NT : + +Dernière date de déconnexion du système NT : + +
Date d'expiration du compte NT : + +Nombre de connexions NT : + +
Serveur de connexions NT : + +Postes de travail NT : + +
Page de codes NT : + +Code de pays NT : + +
Id de groupe principal NT : + +Profil NT : + +
Annuaire personnel NT : + +Lecteur d'annuaire personnel NT : + +
Chemin script NT : + +Mise en mémoire maximale NT : + +
Unités NT par semaine : + +Privilèges de l'utilisateur NT : + +
Privilèges de l'utilisateur NT : + +Diverses fonctions de compte de personne NT : Features: + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Informations sur l'activité et l'emplacement
Secteur d'activité : + +Titre : + +
Unité organisationnelle : + +Gestionnaire :
+ + + +
+Vous devez enregistrer cette entrée pour pouvoir modifier ces champs. + + + + + +
Numéro de poste : + +Admin.:
+ + + +
+ +
N° de service : + +N° d'employé : + +
N° de permis de circulation : + +    
Adresse postale : + +
+ + + + + + + + + + + + + + + + + + + + +--> + +
+Informations supplémentaires
Description: + +
Voir également :
+ + + +
+ +Vous devez enregistrer cette entrée pour pouvoir modifier ce champ. + + + + + +
URL: + +
+ + +La dernière modification de cette entrée date du + + Dans + + + + + + + + + + diff --git a/config/fr/display-org.html b/config/fr/display-org.html new file mode 100644 index 0000000..a722375 --- /dev/null +++ b/config/fr/display-org.html @@ -0,0 +1,168 @@ + + + + + + + +<!-- IF "Adding" --> +Nouvelle +<!-- ENDIF // Adding --> +Organisation - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + +
+Organization + + + +Nouvelle organisation - + + + +
+ + + + + + + +
+ + + + + + + +   + + + +   + + + + + +   + + + +
+ + + + + + + + + + +
+ +* Indique une zone d'entrée obligatoire
+ + + + + + + + + + + + + + + + + + + + + + +
Nom de l'organisation : + +* + + + +Description: + +
Téléphone : + +Catégorie commerciale : + +
Télécopie : + +Emplacement : + +
Adresse postale : + +
Voir également : + +
+ + +
+La dernière modification de cette entrée date du + + par + + + + + + + + + diff --git a/config/fr/display-orgperson.html b/config/fr/display-orgperson.html new file mode 100644 index 0000000..3e42872 --- /dev/null +++ b/config/fr/display-orgperson.html @@ -0,0 +1,377 @@ + + + + + + + + +<!-- IF "Adding" --> +Nouvelle +<!-- ENDIF // Adding --> +Entrée de personne +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + + + + + + + + + +
+ + + +BORDER=0> + + +Personne (cliquez pour afficher la carte) + + + + > +Click to display organization chart + + + +Nouvelle personne - + + +
+ + + + +>Télécharger un certificat + + + + +   + +>Lire le clip audio + + + + + + + + +
+ + +   + + + + + + +   + + + +   + + + + + +   + + + + + +
+ + + + + + + + + + + + + +* Indique une zone d'entrée obligatoire
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Contacts
Prénom : + +Nom complet : + +* + + + +
Nom : + +* + + + +
Mot de passe : + + Retaper le mot de passe pour confirmation : + +
Téléphone : + +Adresse électronique : + +
Télécopie : + +Id d'utilisateur : + +
Radiomessagerie : + +Téléphone mobile : + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Informations sur l'activité et l'emplacement
Secteur d'activité : + +Titre : + +
Service de la société : + +Responsable :
+ + + +
+Vous devez enregistrer cette entrée avant de pouvoir modifier ces champs. + + + + + +
Numéro de poste : + +Admin. :
+ + + +
+ +
N° de service : + +N° d'employé : + +
N° d'immatriculation : + +    
Adresse postale : + +
+ + + + + + + + + + + + + + + + + + + + +--> + +
+ Informations supplémentaires
Description : + +
Voir également :
+ + + +
+ +Vous devez enregistrer cette entrée avant de pouvoir modifier ce champ. + + + + + +
URL : + +
+ + +La dernière modification de cette entrée date du + + par + + + + + + + + + + diff --git a/config/fr/display-orgunit.html b/config/fr/display-orgunit.html new file mode 100644 index 0000000..f846fb9 --- /dev/null +++ b/config/fr/display-orgunit.html @@ -0,0 +1,167 @@ + + + + + + + +<!-- IF "Adding" --> +Nouvelle +<!-- ENDIF // Adding --> +Unité organisationnelle - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + +
+Unité Org + + + +Nouvelle unité organisationnelle - + + + +
+ + + + + + + +
+ + + + + + + +   + + + +   + + + + + +   + + + +
+ + + + + + + + + + +
+ +* Indique une zone d'entrée obligatoire
+ + + + + + + + + + + + + + + + + + + + + + +
Nom de l'unité : + +* + + + +Description : + +
Téléphone : + +Catégorie commerciale : + +
Télécopie : + +Emplacement : + +
Adresse postale : + +
Voir également : + +
+ + +
+La dernière modification de cette entrée date du + + par + + + + + + + + diff --git a/config/fr/display-person.html b/config/fr/display-person.html new file mode 100644 index 0000000..38df091 --- /dev/null +++ b/config/fr/display-person.html @@ -0,0 +1,264 @@ + + + + + + + + +<!-- IF "Adding" --> +Nouvelle +<!-- ENDIF // Adding --> +Entrée de personne +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + + + + + + + +
+ +Personne (cliquez pour afficher la carte) + + + + > +Click to display organization chart + + + +Nouvelle personne + + +
+ + + + + + + +
+ + +   + + + + + + +   + + + +   + + + + + +   + + + + + +
+ + + + + + + + + + +
+ +* Indique une zone d'entrée obligatoire
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Nom : + +* + + + +Nom complet : + +

Mot de passe : + + Retaper le mot de passe pour confirmation : + +

Téléphone : + +Adresse électronique : + +
Télécopie : + +Id d'utilisateur : + +
Radiomessagerie : + +Téléphone mobile : + +

Titre : + +
Adresse postale : + +

Description : + +
Voir également :
+ + + +
+ +Vous devez enregistrer cette entrée avant de pouvoir modifier ce champ. + + + + + +
URL : + +
Boisson favorite : + +
+ + +
+La dernière modification de cette entrée date du + + par + + + + + + + + + + diff --git a/config/fr/display-umperson.html b/config/fr/display-umperson.html new file mode 100644 index 0000000..6230979 --- /dev/null +++ b/config/fr/display-umperson.html @@ -0,0 +1,231 @@ + + + + + + + + +<!-- IF "Adding" --> +Nouvelle +<!-- ENDIF // Adding --> +entrée de personne U-M - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + + +
+ +> +Personne + + + > +Click to display organization chart + + + +Nouvel personne U-M - + + +
+ + +>Lecture de clip audio + + + + + + + +
+ + + + + + + +   + + + +   + + + + + +   + + + + + +
+ + + + + + + + +
+ +* Indique une zone d'entrȨe obligatoire
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Nom de famille : + +* + + + +Nom complet : + +* + + + +
Téléphone : + +Adresse électronique : + +
Télécopie : + +Nom unique : + +
Téléavertisseur : + +Téléphone mobile : + +

Titre : + +
Adresse postale : + +

Description : + +
Voir également :
+ +
+ +
URL : + +
Boisson favorite : + +
+ + +
+La dernière modification de cette entrée date du + + par + + + + + + + + diff --git a/config/fr/dsgw-l10n.conf b/config/fr/dsgw-l10n.conf new file mode 100644 index 0000000..3155f83 --- /dev/null +++ b/config/fr/dsgw-l10n.conf @@ -0,0 +1,50 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# To localize the search type menu: +# Locate dsgw-l10n.conf in config//. +# dsgw-l10n.conf contains translated words for search type pulldown menu. +# dsgw-l10n.conf sample: +# Note: the sample part should have double #'s for L10n. +## translate People +## translate NT-People +## translate Groups +## translate NT-Groups +## translate Organizations +## translate Org-Units +## translate Anything diff --git a/config/fr/dsgw.conf b/config/fr/dsgw.conf new file mode 100644 index 0000000..acb108a --- /dev/null +++ b/config/fr/dsgw.conf @@ -0,0 +1,165 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# The baseurl directive gives the server, port, and base dn where searches +# should be rooted. The format is: +# +# ldap://host.domain[:port]/basedn +# - or - +# ldaps://host.domain:port/basedn (for SSL) +# +# Where: +# - "host.domain" is the fully-qualified domain name of the directory server +# - "port" is the port used by the directory server. If you are using an +# "ldaps" URL (that is, if the gateway is using SSL to communicate with the +# directory server), then the port number is required. Otherwise, it is +# optional and defaults to the standard LDAP port (389). +# - "basedn" is the distinguished name of the place in the directory tree +# where searches should start. Typically, this is the same as the +# "suffix" directive in your slapd.conf file. +# +# examples: +# baseurl "ldap://mars.aceindustry.com/o=Ace Industry, c=US" +# - causes the gateway to use the directory server running on host +# "mars.aceindustry.com". Since no port was given, the default LDAP +# port (389) is used. Searches in the gateway search for entries +# contained within o=Ace Industry, c=US. +# +# baseurl "ldaps://mars.aceindustry.com:636/o=Ace Industry, c=US" +# - same as above, but uses SSL to connect to the directory server, +# and contacts the server on port 636. + +baseurl "ldap://ggood.mcom.com:389/o=Netscape Communications Corp., c=US" +#baseurl "ldap://belltower.mcom.com:9000/o=Ace%20Industry,%20c=US" +#baseurl "ldap://belltower:9000/o=Netscape Communications Corp., c=US" +#baseurl "ldap://ldap.itd.umich.edu:389/o=University of Michigan, c=US" + +# The dirmgr directive specifies the "Manager" DN for your directory. +dirmgr "cn=Directory Manager, o=Netscape Communications Corp., c=US" + +# The securitypath directive gives the full path name to your +# security databases. +#securitypath /tmp/ssl + +# If the requireauth directive is present, users must authenticate to the +# directory before they may perform any operations. XXX: not implemented +# in 1.0b2. +#requireauth + +# The authlifetime directive specifies how long authentication credentials +# are valid (in seconds). +authlifetime 7200 + +# The default character set, for communication with HTTP clients. +# A client may override this default, using an HTTP Accept-Charset header. +# Or, this default may be overridden for a specific language, by creating +# a LANG/dsgwcharset.conf file which contains the charset name. +# For compatibility with HTTP clients that can't handle an HTTP response +# with a charset parameter in the content-type, comment out this directive; +# responses will be sent in ISO-8859-1, with no explicit charset parameter. +# RFC 1345 defines the syntax of charset names. There is a registry of +# charsets, at ftp://ftp.isi.edu/in-notes/iana/assignments/character-sets +# charset UTF-8 + +# The NLS (internationalization) directory. The directory of this name +# should contain a locales directory, which contains configuration files. +NLS ../../../lib/nls + +location-suffix "o=Netscape Communications Corp., c=US" + +# Mapping between config/display-XXX.html templates and LDAP objectClasses. +# This can be generated by using ds/templateindex. The format is: +# +# template TEMPLATENAME OBJECTCLASSES +# +# where "display-TEMPLATENAME.html" is the name of a display template +# that is found in this config directory (e.g., "display-group.html") and +# OBJECTCLASSES is a list of one or more objectClass values. For a given +# template to be used, all the objectClass values listed must be present +# in the directory entry, so the order of these template lines is +# significant (e.g. note that the more specific "umperson" and +# "orgperson" templates are listed before the one for an ordinary "person"). +# +template group groupOfNames +template groupun groupOfUniqueNames +template mailgroup rfc822mailgroup +template org organization +template orgunit organizationalUnit +template ntperson person inetOrgPerson nTUser +template umperson person umichPerson +template orgperson person inetOrgPerson +template person person +template country country + +# +# The remainder of this file contains information about the locations and +# types for new entries. +# +# "location" lines define places in the directory where new entries can be added +# The format of each line is: +# location HANDLE FRIENDLYNAME DN +# where HANDLE is a short name which is used in the "newtype" lines (see below) +# and FRIENDLYNAME is a human-readable name for the location +# and DN is the Distinguished Name for this location (if it does not end with +# '#', the location-suffix is appended to to construct a full DN; if it +# does end with `#', it assumed to be a full DN and the `#' is removed). +# +location country "Etats-Unis" "c=US#" +location org "Cette organisation" "" +location groups "Services" "ou=Groups" +location acct "Comptabilité" "ou=Accounting" +location hr "Ressources humaines" "ou=Human Resources" +location pay "Comptabilité de paye" "ou=Payroll" +location pd "Développement des produits" "ou=Product Development" +location test "Test de produit" "ou=Product Testing" + +# "newtype" lines define the types of new entries that may be added +# The format of each line is: +# newtype TEMPLATENAME FRIENDLYNAME RDNATTR LOCATIONS... +# where TEMPLATENAME corresponds to an existing add-TEMPLATENAME.html file +# and FRIENDLYNAME is a human-readable name for this type of entry +# and RDNATTR is the attribute that is used to name entries of this type +# and LOCATIONS is a blank-separated list of locations where these types of +# entries can be added (corresponding to a HANDLE on a "location" +# config. file line). +# +newtype orgperson "Utilisateur" cn acct hr pay pd test +newtype ntperson "Utilisateur NT" cn acct hr pay pd test +newtype groupun "Groupe" cn groups +newtype orgunit "Service" ou org +newtype org "Organisation" o country diff --git a/config/fr/dsgw.tmpl b/config/fr/dsgw.tmpl new file mode 100644 index 0000000..9d3da73 --- /dev/null +++ b/config/fr/dsgw.tmpl @@ -0,0 +1,151 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK + +# The htmldir directive tells the CGIs where to find the html files +htmldir ../html + +# The configdir directive tells the CGIs where to find the +# templates/configuration files +configdir ../config + +# The gwnametrans directive tells the CGIs what url to output +# for http redirection. It should be the same nameTrans set +# in the webserver, if any is being is used. +gwnametrans /clients/dsgw/html/ + +# The authlifetime directive specifies how long authentication credentials +# are valid (in seconds). +authlifetime 7200 + +# The default character set, for communication with HTTP clients. +# A client may override this default, using an HTTP Accept-Charset header. +# Or, this default may be overridden for a specific language, by creating +# a LANG/dsgwcharset.conf file which contains the charset name. +# For compatibility with HTTP clients that can't handle an HTTP response +# with a charset parameter in the content-type, comment out this directive; +# responses will be sent in ISO-8859-1, with no explicit charset parameter. +# RFC 1345 defines the syntax of charset names. There is a registry of +# charsets, at ftp://ftp.isi.edu/in-notes/iana/assignments/character-sets +# charset UTF-8 + +# The NLS (internationalization) directory. The directory of this name +# should contain a locales directory, which contains configuration files. +NLS ../../../lib/nls + +# Mapping between config/display-XXX.html templates and LDAP objectClasses. +# This can be generated by using ds/templateindex. The format is: +# +# template TEMPLATENAME OBJECTCLASSES +# +# where "display-TEMPLATENAME.html" is the name of a display template +# that is found in this config directory (e.g., "display-group.html") and +# OBJECTCLASSES is a list of one or more objectClass values. For a given +# template to be used, all the objectClass values listed must be present +# in the directory entry, so the order of these template lines is +# significant (e.g. note that the more specific "orgperson" template is +# listed before the one for an ordinary "person"). +# +template group groupOfNames +template ntgroup groupOfUniqueNames ntGroup +template groupun groupOfUniqueNames +template org organization +template orgunit organizationalUnit +template ntperson person inetOrgPerson nTUser +template orgperson person inetOrgPerson +template person person +template country country + +# +# The remainder of this file contains information about the locations and +# types for new entries. +# +# "location" lines define places in the directory where new entries can be added +# The format of each line is: +# location HANDLE FRIENDLYNAME DN +# where HANDLE is a short name which is used in the "newtype" lines (see below) +# and FRIENDLYNAME is a human-readable name for the location +# and DN is the Distinguished Name for this location (if it does not end with +# '#', the location-suffix is appended to to construct a full DN; if it +# does end with `#', it assumed to be a full DN and the `#' is removed). +# +location country "États-Unis" "c=US#" +location org "Cette société" "" +location groups "Groupes" "ou=Groups" +location people "Utilisateurs" "ou=People" +location special "Utilisateurs particuliers" "ou=Special Users" + +# "newtype" lines define the types of new entries that may be added +# The format of each line is: +# newtype TEMPLATENAME FRIENDLYNAME RDNATTR LOCATIONS... +# where TEMPLATENAME corresponds to an existing display-TEMPLATENAME.html file +# and FRIENDLYNAME is a human-readable name for this type of entry +# and RDNATTR is the attribute that is used to name entries of this type +# and LOCATIONS is a blank-separated list of locations where these types of +# entries can be added (corresponding to a HANDLE on a "location" +# config. file line). +# +newtype orgperson "Personne" uid people special +newtype ntperson "Personne NT" uid people special +newtype ntgroup "Groupe NT" cn groups +newtype groupun "Groupe" cn groups +newtype orgunit "Service de la société" ou people org +newtype org "Société" o country + +# Mappings between VCard properties and LDAP attribute types: +# The format of each line is: +# vcard-property VCARDPROP SYNTAX LDAPATTR [LDAPATTR2] +# where VCARDPROP is the name of a VCard property +# and SYNTAX is "cis" for simple strings and "mls" for multiline strings +# and LDAPATTR is the LDAP attribute that corresponds to VCARDPROP +# and LDAPATTR2 is an optional secondary LDAP attribute which is added to +# the property value by appending a semicolon and then the attr2 value. +vcard-property FN cis cn +vcard-property N cis sn givenName +vcard-property ORG cis o ou +vcard-property ROLE cis businessCategory +vcard-property ADR;WORK mls postalAddress +vcard-property ADR;HOME mls homePostalAddress +vcard-property EMAIL;INTERNET cis mail +vcard-property TITLE cis title +vcard-property TEL;WORK cis telephoneNumber +vcard-property TEL;FAX cis facsimileTelephoneNumber +vcard-property TEL;CELL cis mobile +vcard-property TEL;HOME cis homePhone +vcard-property NOTE cis description + + diff --git a/config/fr/dsgw_adm.conf b/config/fr/dsgw_adm.conf new file mode 100644 index 0000000..8c3e8e8 --- /dev/null +++ b/config/fr/dsgw_adm.conf @@ -0,0 +1,80 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# Mapping between config/display-XXX.html templates and LDAP objectClasses. +# This can be generated by using the templateindex program. The format is: +# +# template TEMPLATENAME OBJECTCLASSES +# +# where "display-TEMPLATENAME.html" is the name of a display template +# that is found in this config directory (e.g., "display-group.html") and +# OBJECTCLASSES is a list of one or more objectClass values. For a given +# template to be used, all the objectClass values listed must be present +# in the directory entry, so the order of these template lines is +# significant (e.g. note that the more specific "orgperson" template is +# listed before the one for an ordinary "person"). +# +template group groupOfNames +template groupun groupOfUniqueNames +template org organization +template orgunit organizationalUnit +template orgperson person inetOrgPerson +template person person +template country country +template licensed-user nsLicenseUser + +# Attribute Value Sets (used with DS_ATTRVAL_SET directives) +# attrvset HANDLE VALUE PREFIX SUFFIX +# +attrvset CAL news "" "Netscape Collabra Server" +attrvset CAL slapd "" "Netscape Directory Server" + + +# Template Set definitions +# Note: templates must be defined before they can be mentioned on +# a tmplset line. +# +# tmplset SETNAME VIEWNAME TEMPLATENAME [HREF-LOCATION] +# +tmplset person "Général" orgperson +tmplset person "Mot de passe" passwd +tmplset person "Licences" licensed-user +tmplset group "Général" group +tmplset groupun "Général" groupun + + diff --git a/config/fr/dsgwfilter.conf b/config/fr/dsgwfilter.conf new file mode 100644 index 0000000..0361cda --- /dev/null +++ b/config/fr/dsgwfilter.conf @@ -0,0 +1,173 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# ldap filter file +# +# lines like this that start with # or empty lines are ignored +# +# syntax: +# +# +# [] +# [] +# +# [] ... +# +# The should describe the filter. It should correctly complete +# the phrases (in the resource database) DBT_Found0EntriesWhere_, +# DBT_Found1EntryWhere_ and DBT_FoundEntriesWhere_; for example: +# +# Found 1 entry where the '%v'. +# Found no entries where the '%v'. +# Found 3 entries where the '%v'. +# +# The should begin with the article ("the" in English) for +# languages that require agreement between article and noun (e.g +# genders in Spanish or French). +# +# The scope is optional, and should be one of: +# "base" +# "onelevel" +# "subtree" +# if it is included. + +# +# Directory Server gateway +# + +"dsgw-people" + "=" " " "(%v))" "le filtre LDAP est" + + "^[+]*[0-9][ 0-9-]*$" " " "(telephoneNumber=*%v))" "le numéro de téléphone se termine par" + + "@" " " "(mail=%v))" "l'adresse électronique est" + "(mail=%v*))" "l'adresse électronique commence par" + + "^.[. _].*" ". _" "(cn=%v1* %v2-))" "première initiale + nom est" + + ".*[. _].$" ". _" "(cn=%v1-*))" "nom + dernière initiale est" + + "[. _]" ". _" "(|(sn=%v1-)(cn=%v1-)))" "le nom est" + "(|(cn=*%v1-*)(sn=*%v1-*)(cn~=%v1-)(sn~=%v1-)))" "le nom ressemble à ou contient" + + "^\*$" " " "(|(cn=*)(sn=*)(uid=*)))" "le nom ou l'id d'utilisateur est" + + ".*" ". " "(|(cn=%v1)(sn=%v1)(uid=%v1)))" "le nom ou l'id d'utilisateur est" + "(|(cn=*%v1*)(sn=*%v1*)(cn~=%v1)(sn~=%v1)))" "le nom ressemble à ou contient" + + +"dsgw-groups" + "=" " " "(%v))" "le filtre LDAP est" + + "^\*$" " " "(cn=*))" "le nom est" + + ".*" ". _" "(cn=%v1-))" "le nom est" + "(cn=*%v1-*))" "le nom contient" + "(cn~=%v1-))" "le nom ressemble à" + +"dsgw-ntgroups" + "=" " " "(%v))" "le filtre LDAP est" + + "^\*$" " " "(cn=*))" "le nom est " + + ".*" ". _" "(cn=%v1-))" "le nom est" + "(cn=*%v1-*))" "le nom contient" + "(cn~=%v1-))" "le nom ressemble à" + "(ntgroupdomainid=%v:*))" "le nom du domaine NT est" + "(ntgroupdomainid=*:%v))" "le groupe NT est" + +"dsgw-organizations" + "=" " " "(%v))" "le filtre LDAP est" + + "\." " " "(associatedDomain=%v))" "le domaine associé est" + + "^\*$" " " "(o=*))" "le nom est" + + ".*" " " "(o=%v))" "le nom est" + "(o=*%v*))" "le nom contient" + "(o~=%v))" "le nom ressemble à" + +"dsgw-orgunits" + "=" " " "(%v))" "le filtre LDAP est" + + "\." " " "(associatedDomain=%v))" "le domaine associé est" + + "^\*$" " " "(ou=*))" "le nom est" + + ".*" " " "(ou=%v))" "le nom est" + "(ou=*%v*))" "le nom contient" + "(ou~=%v))" "le nom ressemble à" + +"dsgw-anything" + "=" " " "(%v)" "le filtre LDAP est" + + "[. _]" ". _" "(|(sn=%v1-)(cn=%v1-)(o=%v1-)(ou=%v1-))" "le nom est" + "(|(sn~=%v1-)(cn~=%v1-)(o=%v1-)(ou=%v1-))" "le nom ressemble à" + + "^\*$" " " "(|(cn=*)(sn=*)(o=*)(ou=*))" "le nom est" + + ".*" ". " "(|(cn=%v1)(sn=%v1)(o=%v1)(ou=%v1))" "le nom est" + "(|(cn=*%v1*)(sn=*%v1*)(cn~=%v1)(sn~=%v1)(o=%v1)(ou=%v1))" "le nom ressemble à ou contient" + + +"dsgw-ntpeople" + "=" " " "(%v))" "le filtre LDAP est" + + "^[+]*[0-9][ 0-9-]*$" " " "(telephoneNumber=*%v))" "le numéro de téléphone se termine par" + + "@" " " "(mail=%v))" "l'adresse électronique est" + "(mail=%v*))" "l'adresse électronique commence par" + + "^.[. _].*" ". _" "(cn=%v1* %v2-))" "première initiale + nom est" + + ".*[. _].$" ". _" "(cn=%v1-*))" "nom + dernière initiale est" + + "[. _]" ". _" "(|(sn=%v1-)(cn=%v1-)))" "le nom est" + "(|(cn=*%v1-*)(sn=*%v1-*)(cn~=%v1-)(sn~=%v1-)))" "le nom ressemble à ou contient" + + "^\*$" " " "(|(cn=*)(sn=*)))" "le nom est" + + ".*" ". " "(|(cn=%v1)(sn=%v1)))" "le nom est" + "(ntuserlogonserver=%v))" "le serveur de connexions NT est" + "(ntuserdomainid=%v:*))" "le nom du domaine NT est" + "(ntuserdomainid=*:%v))" "le nom d'utilisateur NT est" + "(|(cn=*%v1*)(sn=*%v1*)(cn~=%v1)(sn~=%v1)))" "le nom ressemble à ou contient" + +# Do not remove this line, or place any directives after it. + + diff --git a/config/fr/dsgwfilter_adm.conf b/config/fr/dsgwfilter_adm.conf new file mode 100644 index 0000000..dc4ed8a --- /dev/null +++ b/config/fr/dsgwfilter_adm.conf @@ -0,0 +1,107 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# ldap filter file +# +# lines like this that start with # or empty lines are ignored +# +# syntax: +# +# +# [] +# [] +# +# [] ... +# +# The should describe the filter. It should correctly complete +# the phrases (in the resource database) DBT_Found0EntriesWhere_, +# DBT_Found1EntryWhere_ and DBT_FoundEntriesWhere_; for example (en): +# +# Found 1 entry where the '%v'. +# Found no entries where the '%v'. +# Found 3 entries where the '%v'. +# +# The should begin with the article ("the" in English) for +# languages that require agreement between article and noun (e.g +# genders in Spanish or French). +# +# The scope is optional, and should be one of: +# "base" +# "onelevel" +# "subtree" +# if it is included. + +# +# Directory Server gateway - for Netscape Admin Server +# + +"dsgw-people" + "=" " " "(%v))" "le filtre LDAP est" + + "^[+]*[0-9][ 0-9-]*$" " " "(telephoneNumber=*%v))" "le numéro de téléphone se termine par" + + "@" " " "(mail=%v))" "l'adresse électronique est" + "(mail=%v*))" "l'adresse électronique commence par" + + "^.[. _].*" ". _" "(cn=%v1* %v2-))" "première initiale + nom est" + + ".*[. _].$" ". _" "(cn=%v1-*))" "nom + dernière initiale est" + + "[. _]" ". _" "(|(sn=%v1-)(cn=%v1-)))" "le nom est" + "(|(cn=*%v1-*)(sn=*%v1-*)(cn~=%v1-)(sn~=%v1-)))" "le nom ressemble à ou contient " + + ".*" ". " "(uid=%v1))" "l'id de connexion est" + "(|(cn=%v1)(sn=%v1)))" "le nom est" + "(|(cn=*%v1*)(sn=*%v1*)(cn~=%v1)(sn~=%v1)))" "le nom ressemble à ou contient" + + +"dsgw-groups" + "=" " " "(%v))" "le filtre LDAP est" + + ".*" ". _" "(cn=%v1-))" "le nom est" + "(cn~=%v1-))" "le nom ressemble à" + +"dsgw-orgunits" + "=" " " "(%v))" "le filtre LDAP" + + ".*" ". _" "(ou=%v1-))" "le nom du service est" + "(ou~=%v1-))" "le nom du service ressemble à" + +#Do not remove this line, or place any additional lines after it. + + diff --git a/config/fr/dsgwsearchprefs.conf b/config/fr/dsgwsearchprefs.conf new file mode 100644 index 0000000..29258f8 --- /dev/null +++ b/config/fr/dsgwsearchprefs.conf @@ -0,0 +1,246 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# dsgwsearchprefs.conf - directory server gateway search object definitions + + +# the current version of this file format is 1 +Version 1 + + +# Name for this search object +People +# options (the only one supported right now is "internal" which means that +# this search object should not be presented directly to the user) +# use "" for none +"" +# Label to place before text box user types in +"Rechercher :" +# Filter prefix to append to all searches +"(&(objectClass=person)" +# Tag to use for "Fewer Choices" searches - from ldapfilter.conf file +"dsgw-people" +# If a search results in > 1 match, retrieve this attribute to help +# user disambiguate the entries... +not-used-by-dsgw +# ...and label it with this string: +not-used-by-dsgw +# Search scope to use when searching +subtree +# Follows a list of "More Choices" search options. Format is: +# Label, attribute, select-bitmap, extra attr display name, extra attr ldap name +# If last two are null, "Fewer Choices" name/attributes used. +# Label should begin with the article ("the" in English) for +# languages that require agreement between article and noun +# (e.g genders in Spanish or French). +"nom complet" cn 111111 "" "" +"nom" sn 111111 "" "" +"numéro de téléphone" "telephoneNumber" 111011 "" "" +"adresse électronique" "mail" 111111 "" "" +"id utilisateur" "uid" 111111 "" "" +"titre" title 111111 "" "" +END +# Match types +"est" "(%a=%v))" +"n'est pas" "(!(%a=%v)))" +"ressemble à" "(%a~=%v))" +"commence par" "(%a=%v*))" +"se termine par" "(%a=*%v))" +"contient" "(%a=*%v*))" +END + + +"NT-People" +"" +"Rechercher :" +"(&(objectClass=ntuser)" +"dsgw-ntpeople" +not-used-by-dsgw +not-used-by-dsgw +subtree +"nom complet" cn 111111 "" "" +"nom" sn 111111 "" "" +"numéro de téléphone" "telephoneNumber" 111011 "" "" +"adresse électronique" "mail" 111111 "" "" +"id utilisateur" "uid" 111111 "" "" +"titre" title 111111 "" "" +"nom d'utilisateur NT" "ntuserdomainid" 110000 "" "" +"domaine NT" "ntuserdomainid" 101000 "" "" +"serveur de connexions NT" "ntuserlogonserver" 111111 "" "" +END +"est" "(%a=%v))" +"n'est pas" "(!(%a=%v)))" +"ressemble à" "(%a~=%v))" +"commence par" "(%a=%v*))" +"se termine par" "(%a=*%v))" +"contient" "(%a=*%v*))" +END + + +Groups +"" +"Rechercher :" +"(&(|(objectClass=rfc822MailGroup)(objectClass=groupOfNames)(objectClass=groupOfUniqueNames)(objectClass=groupOfCertificates))" +"dsgw-groups" +not-used-by-dsgw +not-used-by-dsgw +subtree +"nom" cn 111111 "" "" +"description" description 111111 "" "" +"propriétaire (DN)" "owner" 000011 "owner" "Owner" +"membre (DN)" "uniquemember" 000011 "" "" +END +"est" "(%a=%v))" +"n'est pas" "(!(%a=%v)))" +"ressemble à" "(%a~=%v))" +"commence par" "(%a=%v*))" +"se termine par" "(%a=*%v))" +"contient" "(%a=*%v*))" +END + +NT-Groups +"" +"Rechercher :" +"(&(objectClass=ntGroup)" +"dsgw-ntgroups" +not-used-by-dsgw +not-used-by-dsgw +subtree +"nom" cn 111111 "" "" +"domaine NT" "ntgroupdomainid" 110000 "" "" +"nom du groupe NT" "ntgroupdomainid" 101000 "" "" +"description" description 111111 "" "" +"propriétaire (DN)" "owner" 000011 "owner" "Owner" +"membre (DN)" "uniquemember" 000011 "" "" +END +"est" "(%a=%v))" +"n'est pas" "(!(%a=%v)))" +"ressemble à" "(%a~=%v))" +"commence par" "(%a=%v*))" +"se termine par" "(%a=*%v))" +"contient" "(%a=*%v*))" +END + + +Organizations +"" +"Rechercher :" +"(&(objectClass=organization)" +"dsgw-organizations" +not-used-by-dsgw +not-used-by-dsgw +subtree +"nom" o 111111 "" "" +"emplacement" l 111111 "" "" +"numéro de téléphone" telephoneNumber 111011 "" "" +"description" description 111011 "" "" +END +"est" "(%a=%v))" +"n'est pas" "(!(%a=%v)))" +"ressemble à" "(%a~=%v))" +"commence par" "(%a=%v*))" +"se termine par" "(%a=*%v))" +"contient" "(%a=*%v*))" +END + + +"Org-Units" +"" +"Rechercher :" +"(&(objectClass=organizationalUnit)" +"dsgw-orgunits" +not-used-by-dsgw +not-used-by-dsgw +subtree +"nom" ou 111111 "" "" +"emplacement" l 111111 "" "" +"numéro de téléphone" telephoneNumber 111011 "" "" +"description" description 111111 "" "" +END +"est" "(%a=%v))" +"n'est pas" "(!(%a=%v)))" +"ressemble à" "(%a~=%v))" +"commence par" "(%a=%v*))" +"se termine par" "(%a=*%v))" +"contient" "(%a=*%v*))" +END + +Anything +"" +"Rechercher :" +"" +"dsgw-anything" +not-used-by-dsgw +not-used-by-dsgw +subtree +"nom commun" cn 111111 "" "" +"description" description 111111 "" "" +END +"est" "(%a=%v)" +"n'est pas" "(!(%a=%v))" +"ressemble à" "(%a~=%v)" +"commence par" "(%a=%v*)" +"se termine par" "(%a=*%v)" +"contient" "(%a=*%v*)" +END + +Auth +internal +"Authentifier en tant que :" +"(&(objectClass=person)" +"dsgw-people" +not-used-by-dsgw +not-used-by-dsgw +subtree +"nom commun" cn 111111 "" "" +"nom de famille" sn 111111 "" "" +"numéro de téléphone" "telephoneNumber" 111011 "" "" +"adresse électronique" "mail" 111111 "" "" +"id utilisateur" "uid" 111111 "" "" +"titre" title 111111 "" "" +END +"est" "(%a=%v))" +"n'est pas" "(!(%a=%v)))" +"ressemble à" "(%a~=%v))" +"commence par" "(%a=%v*))" +"se termine par" "(%a=*%v))" +"contient" "(%a=*%v*))" +END + + + diff --git a/config/fr/edit-passwd.html b/config/fr/edit-passwd.html new file mode 100644 index 0000000..ea0ae2d --- /dev/null +++ b/config/fr/edit-passwd.html @@ -0,0 +1,109 @@ + + + + + +Modification du mot de passe - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + +

Modification du mot de passe + +

+ +
+ +

+ + + + + + + + + + + + + + + +
+Entrer l'ancien mot de passe : + + +
+Entrer l'ancien mot de passe : + + +
+Entrer le nouveau mot de passe : + + +
+Retaper le nouveau mot de passe pour confirmation : + + +
+ +

+ + + +
+ + + + + + + +
+ + + + + diff --git a/config/fr/list-Anything.html b/config/fr/list-Anything.html new file mode 100644 index 0000000..233acb6 --- /dev/null +++ b/config/fr/list-Anything.html @@ -0,0 +1,73 @@ + + +

+ +
+

+ + + + + +
NomNuméro de téléphone +Adresse électroniqueDescription + + + + +
+ + + + + + + + + +
+ + +

+

+Veuillez effectuer une recherche différente. +
+ + + diff --git a/config/fr/list-Auth.html b/config/fr/list-Auth.html new file mode 100644 index 0000000..4303909 --- /dev/null +++ b/config/fr/list-Auth.html @@ -0,0 +1,106 @@ + + + + + +
+ + + + +> +
+ + + +
+ +

+ +Veuillez cliquer sur le nom de l'entrée que vous désirez utiliser pour l'authentification. + +

+ + + + +
Authentifier en tant que Titre + + + + +
+ + + + + + +
+ +Veuillez revenir en arrière et essayer de nouveau. + +

+ +
+ + +
+ + + +
+
+ + + + diff --git a/config/fr/list-Groups.html b/config/fr/list-Groups.html new file mode 100644 index 0000000..46f3874 --- /dev/null +++ b/config/fr/list-Groups.html @@ -0,0 +1,69 @@ + + +
+ +
+

+ + + + + +
Nom du groupe +Description + + + + +
+ + + + + +
+ + +

+

+Veuillez effectuer une recherche différente. +
+ + + diff --git a/config/fr/list-NT-Groups.html b/config/fr/list-NT-Groups.html new file mode 100644 index 0000000..5f41c62 --- /dev/null +++ b/config/fr/list-NT-Groups.html @@ -0,0 +1,77 @@ + + +
+ +
+

+ + + + + +
Nom du groupe LDAP +Nom du domaine NT +Nom du groupe NT +Description + + + + +
+ + + + + + + + + +
+ + +

+

+Veuillez effectuer une recherche différente. +
+ + + + + diff --git a/config/fr/list-NT-People.html b/config/fr/list-NT-People.html new file mode 100644 index 0000000..ce98289 --- /dev/null +++ b/config/fr/list-NT-People.html @@ -0,0 +1,81 @@ + + +
+ +
+

+ + + + + + + + + + + + + + + +
NomDomaine NTNom d'utilisateur NTNuméro de téléphone +
+ + onMouseOver="window.status='Cliquez ici pour afficher cette entrée en détail'; return true"> + + + + + + + + +
+ + +

+

+Veuillez effectuer une recherche différente. +
+ + + + + diff --git a/config/fr/list-Org-Units.html b/config/fr/list-Org-Units.html new file mode 100644 index 0000000..69ce0cd --- /dev/null +++ b/config/fr/list-Org-Units.html @@ -0,0 +1,69 @@ + + +
+ +
+

+ + + + +
Unité organisationnelleDescription Numéro de téléphone + + + + +
+ + + + + + + +
+ + +

+

+Veuillez effectuer une recherche différente. +
+ + + diff --git a/config/fr/list-Organizations.html b/config/fr/list-Organizations.html new file mode 100644 index 0000000..c79cdd6 --- /dev/null +++ b/config/fr/list-Organizations.html @@ -0,0 +1,69 @@ + + +
+ +
+

+ + + + +
OrganisationDescription Numéro de téléphone + + + + +
+ + + + + + + +
+ + +

+

+Veuillez effectuer une recherche différente. +
+ + + diff --git a/config/fr/list-People.html b/config/fr/list-People.html new file mode 100644 index 0000000..10a7809 --- /dev/null +++ b/config/fr/list-People.html @@ -0,0 +1,81 @@ + + +
+ +
+

+ + + + + + + + + + + + + + + +
NomNuméro de téléphoneAdresse électroniqueTitre +
+ + onMouseOver="window.status='Cliquez ici pour afficher cette entrée en détail'; return true"> + + + + + + + + +
+ + +

+

+Veuillez effectuer une recherche différente. +
+ + + + + diff --git a/config/fr/list-fa-Groups.html b/config/fr/list-fa-Groups.html new file mode 100644 index 0000000..2977c23 --- /dev/null +++ b/config/fr/list-fa-Groups.html @@ -0,0 +1,53 @@ + + + + + +
+ + + + +
+ + + + + + diff --git a/config/fr/list-fa-People.html b/config/fr/list-fa-People.html new file mode 100644 index 0000000..2977c23 --- /dev/null +++ b/config/fr/list-fa-People.html @@ -0,0 +1,53 @@ + + + + + +
+ + + + +
+ + + + + + diff --git a/config/fr/list-urlsearch.html b/config/fr/list-urlsearch.html new file mode 100644 index 0000000..e221e52 --- /dev/null +++ b/config/fr/list-urlsearch.html @@ -0,0 +1,69 @@ + + +
+ +
+

+ + + + +
NomNuméro de téléphoneAdresse électronique + + + + +
+ + + + + + + +
+ + +

+

+Veuillez effectuer une recherche différente. +
+ + + diff --git a/config/fr/newentry.html b/config/fr/newentry.html new file mode 100644 index 0000000..c7d2d96 --- /dev/null +++ b/config/fr/newentry.html @@ -0,0 +1,58 @@ + + + + +Passerelle Netscape Directory Server : New Entry + + + + + + + + + +<BODY> +Vous devez utiliser un client qui g&egrave;re la fonction de cadres pour pouvoir afficher ce document. +</BODY> + + + diff --git a/config/fr/newentryName.html b/config/fr/newentryName.html new file mode 100644 index 0000000..15b15fb --- /dev/null +++ b/config/fr/newentryName.html @@ -0,0 +1,79 @@ + + + + + + +

+ +Etape 2 +Fournir un nom pour la nouvelle + +. +

+ += + + +

+Etape 3 + + +Utilisez le menu déroulant ci-dessous pour sélectionner une adresse d'annuaire pour cette + +personne. Si vous sélectionnez Autre, vous devez entrer le nom distinctif complet de l'emplacement où cette entrée doit être ajoutée. +

+ + + + +

+Etape 4 + +Cliquez sur Continuer. Une fenêtre modifiable de l'entrée est affichée. Lorsque vous avez terminé d'entrer les informations demandées, enregistrez l'entrée. +

+

+
+ + + + +
+ + diff --git a/config/fr/newentryType.html b/config/fr/newentryType.html new file mode 100644 index 0000000..935edbc --- /dev/null +++ b/config/fr/newentryType.html @@ -0,0 +1,45 @@ + + + + + +Etape 1 +Sélectionner le type d'entrée à créer. + + diff --git a/config/fr/search.html b/config/fr/search.html new file mode 100644 index 0000000..c8575c4 --- /dev/null +++ b/config/fr/search.html @@ -0,0 +1,49 @@ + + + + +Passerelle Netscape Directory Server : Standard Search + + + + + + + + diff --git a/config/fr/searchString.html b/config/fr/searchString.html new file mode 100644 index 0000000..00b94cf --- /dev/null +++ b/config/fr/searchString.html @@ -0,0 +1,61 @@ + + + + + + + + + + + + +
Rechercher : + +dans : + +
Rechercher : + +   + +
+ + + + diff --git a/config/ja/authPassword.html b/config/ja/authPassword.html new file mode 100644 index 0000000..11dabdc --- /dev/null +++ b/config/ja/authPassword.html @@ -0,0 +1,60 @@ + + + + +認証... + + + + + + +

+パスワード + +: +

+

+ + + +
+ + + diff --git a/config/ja/authSearch.html b/config/ja/authSearch.html new file mode 100644 index 0000000..635ffae --- /dev/null +++ b/config/ja/authSearch.html @@ -0,0 +1,64 @@ + + + + +Authenticate... + + + + + +Directory への認証における最初のステップは、身分を証明することです。
名前をタイプしてください。 + +

+

+ + + +
+ +

+ + (Directory Administratorに限り利用可能) + + + + + + diff --git a/config/ja/csearch.html b/config/ja/csearch.html new file mode 100644 index 0000000..7fb509f --- /dev/null +++ b/config/ja/csearch.html @@ -0,0 +1,54 @@ + + + + +Netscape Directory Server Gateway: Advanced Search + + + + + + + + + + + + + diff --git a/config/ja/csearchAttr.html b/config/ja/csearchAttr.html new file mode 100644 index 0000000..6c9d4f6 --- /dev/null +++ b/config/ja/csearchAttr.html @@ -0,0 +1,48 @@ + + + + + + + + + +
+ +
diff --git a/config/ja/csearchBase.html b/config/ja/csearchBase.html new file mode 100644 index 0000000..0abfb02 --- /dev/null +++ b/config/ja/csearchBase.html @@ -0,0 +1,48 @@ + + + + + + + + +
存在する場所: + +
+ diff --git a/config/ja/csearchString.html b/config/ja/csearchString.html new file mode 100644 index 0000000..06e39aa --- /dev/null +++ b/config/ja/csearchString.html @@ -0,0 +1,59 @@ + + + + + + + + + +
+ +を、 + +  から + + + +
+ + + + + diff --git a/config/ja/csearchType.html b/config/ja/csearchType.html new file mode 100644 index 0000000..f836440 --- /dev/null +++ b/config/ja/csearchType.html @@ -0,0 +1,49 @@ + + + + + + + + + +
検索: + +
+ diff --git a/config/ja/display-country.html b/config/ja/display-country.html new file mode 100644 index 0000000..ed111e5 --- /dev/null +++ b/config/ja/display-country.html @@ -0,0 +1,85 @@ + + + + + + +国 - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + +
+Country + + +
+ + + + + + + + + + + +
国名: + +記述: + +
参照: + +
URL: + +
+ +


+ +このエントリの最終変更日: + +変更者: + + + + + + diff --git a/config/ja/display-dnedit.html b/config/ja/display-dnedit.html new file mode 100644 index 0000000..abf96ed --- /dev/null +++ b/config/ja/display-dnedit.html @@ -0,0 +1,107 @@ + + + + + + +Edit +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + + + + + + + + +修正 + +: + + + + + + + + + + + + +
+一致する + + +を検索  + + + +
+ +
+ +

+

+ +
+ + + + + +
+ + + + + + + diff --git a/config/ja/display-dneditpeople.html b/config/ja/display-dneditpeople.html new file mode 100644 index 0000000..a04e5f2 --- /dev/null +++ b/config/ja/display-dneditpeople.html @@ -0,0 +1,106 @@ + + + + + + +Edit +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + + + + + + + + +修正 + +: + + + + + + + + + +
+一致する + + +を検索  + + + +
+ +
+ + + + + + + diff --git a/config/ja/display-group.html b/config/ja/display-group.html new file mode 100644 index 0000000..86ac39a --- /dev/null +++ b/config/ja/display-group.html @@ -0,0 +1,181 @@ + + + + + + + +<!-- IF "Adding" --> +New +<!-- ENDIF // Adding --> +Group Entry - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + +
+グループ + + +新規グループ - + + + +
+ + + + + + + +
+ + + + + + + +   + + + +   + + + + + +   + + + +
+ + + + + + + + + + +
+ +* は必要なフィールドを示しています。
+ + + + + + + + + + + + + + + + + + + + + + + + + +
名前: + +* + + + +
記述: + +
所有者:
+ + + +
+ +
参照:
+ + + +
+ + + + + +これらのフィールドを修正する前にこのエントリを保存する必要があります。 + +
グループ メンバー:
+ + + +
+ +
+ + +
+このエントリの最終変更日: + + 変更者: + + + + + + + + diff --git a/config/ja/display-groupun.html b/config/ja/display-groupun.html new file mode 100644 index 0000000..6c8817d --- /dev/null +++ b/config/ja/display-groupun.html @@ -0,0 +1,181 @@ + + + + + + + +<!-- IF "Adding" --> +New +<!-- ENDIF // Adding --> +Group Entry - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + +
+グループ + + +新規グループ - + + + +
+ + + + + + + +
+ + + + + + + +   + + + +   + + + + + +   + + + +
+ + + + + + + + + + +
+ +* は必要なフィールドを示しています。
+ + + + + + + + + + + + + + + + + + + + + + + + + +
名前: + +* + + + +
記述: + +
所有者:
+ + + +
+ +
参照:
+ + + +
+ + + + + +これらのフィールドを修正する前にこのエントリを保存する必要があります。 + +
グループ メンバー:
+ + + +
+ +
+ + +
+このエントリの最終変更日: + + 変更者: + + + + + + + + diff --git a/config/ja/display-mailgroup.html b/config/ja/display-mailgroup.html new file mode 100644 index 0000000..6cf4b05 --- /dev/null +++ b/config/ja/display-mailgroup.html @@ -0,0 +1,155 @@ + + + + + + + +<!-- IF "Adding" --> +新規 +<!-- ENDIF // Adding --> +メール グループのエントリ - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + +
+グループ + + +新規メール グループ + + + + +
+ + + + +
+ + + + + + + +   + + + +   + + + + + + + +   + + + +
+ + + + + + + +
+ + + + + + + + + + + + + + +
+ + + + + + + +
名前: + +記述: + +
所有者: + +
参照: + +
+ + + +
グループ メンバー: + +
電子メールメンバー: + +
+ + +
+このエントリの最終変更日: + +変更者: + + + + + + + + diff --git a/config/ja/display-ntgroup.html b/config/ja/display-ntgroup.html new file mode 100644 index 0000000..b16850f --- /dev/null +++ b/config/ja/display-ntgroup.html @@ -0,0 +1,249 @@ + + + + + + + +<!-- IF "Adding" --> +New +<!-- ENDIF // Adding --> +NT Group Entry - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + + + +
+グループ + + +新規NTグループ - + + + +
+ + + + + + + +
+ + + + + + + +   + + + +   + + + + + +   + + + +
+ + + + + + + + + + + +
+ +* は必要なフィールドを示しています。
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
名前: + +* + + + +
NTグループ名: + +* + + + + + + + +
NTグループ タイプ: + +* + + + + + + + +
NTグループ ドメイン: + +* + + + +
記述: + +
言語情報: + +
機関単位: + +
所有者:
+ + + +
+ +
参照:
+ + + +
+ + + + + +これらのフィールドを修正する前にこのエントリを保存する必要があります。 + +
NTグループ メンバー:
+ + + +
+ +
グループを削除した場合はNTグループを削除: + +
新規NTグループの作成 : + +
+ + +
+このエントリの最終変更日: + + 変更者: + + + + + + + + diff --git a/config/ja/display-ntperson.html b/config/ja/display-ntperson.html new file mode 100644 index 0000000..bb9943b --- /dev/null +++ b/config/ja/display-ntperson.html @@ -0,0 +1,537 @@ + + + + + + + + +<!-- IF "Adding" --> +New +<!-- ENDIF // Adding --> +NT Person Entry - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + + + + + + + + + +
+ + + +BORDER=0> + + +ユーザ(クリックするとカードが表示されます) + + + + + > +Click to display organization chart + + + +新規NTユーザ - + + +
+ + + + +>Download Certificate + + + + +   + +>Play Audio Clip + + + + + + + + +
+ + +   + + + + + + +   + + + +   + + + + + +   + + + + + +
+ + + + + + + + + + + + + + +* は必要なフィールドを示しています。
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+連絡先
姓: + +* + + + +氏名: + +* + + + +
名: + +
Directory Password: + + Repeat password to confirm: + +
電話: + +電子メールアドレス: + +
ファックス: + +ユーザ ID: + +
ポケットベル: + +携帯電話: + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+WindowsNTアカウント情報
NTユーザ ID: + +* + + + + + + + + +NTドメイン名: + +* + + + +
ユーザを削除した場合は NTアカウントを削除: + +
新規NTアカウントの作成 : + +
NTユーザに関するコメント: + +NTユーザの固有 ID: + +
NTパスワード失効: + +NT不良パスワード回数: + +
NTの最終ログオン日: + +NT の最終ログオフ日: + +
NTアカウント失効日: + +NTへのログオン数: + +
NTログオンサーバ: + +NTワークステーション: + +
NTコードページ: + +NT国コード: + +
NT主要グループ ID: + +NTプロファイル: + +
NTホームディレクトリ: + +NT ホーム ディレクトリドライブ: + +
NTスクリプトパス: + +NT最大記憶容量: + +
NTユニット/週: + +NTユーザの特権: + +
NTユーザのオペレータ特権: + +NT ユーザ アカウントのその他の機能: + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+事業および場所に関する情報
事業カテゴリ: + +役職: + +
機関単位: + +マネージャ:
+ + + +
+これらのフィールドを修正する前にこのエントリを保存する必要があります。 + + + + + +
部屋番号: + +管理者:
+ + + +
+ +
部署番号: + +社員番号: + +
自動車のナンバープレート番号: + +    
住所: + +
+ + + + + + + + + + + + + + + + + + + + +--> + +
+追加情報
記述: + +
参照:
+ + + +
+ +このフィールドを修正する前にこのエントリを保存する必要があります。 + + + + + +
URL: + +
+ + +このエントリの最終変更日: + + 変更者: + + + + + + + + diff --git a/config/ja/display-org.html b/config/ja/display-org.html new file mode 100644 index 0000000..5b1bf8d --- /dev/null +++ b/config/ja/display-org.html @@ -0,0 +1,167 @@ + + + + + + + +<!-- IF "Adding" --> +New +<!-- ENDIF // Adding --> +Organization - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + +
+機関 + + + +新規機関 - + + + +
+ + + + + + + +
+ + + + + + + +   + + + +   + + + + + +   + + + +
+ + + + + + + + + + +
+ +* は必要なフィールドを示しています。
+ + + + + + + + + + + + + + + + + + + + + + +
機関名: + +* + + + +記述: + +
電話: + +事業カテゴリ: + +
ファックス: + +場所: + +
住所: + +
参照: + +
+ + +
+このエントリの最終変更日: + +変更者: + + + + + + + + diff --git a/config/ja/display-orgperson.html b/config/ja/display-orgperson.html new file mode 100644 index 0000000..4f3f173 --- /dev/null +++ b/config/ja/display-orgperson.html @@ -0,0 +1,376 @@ + + + + + + + + +<!-- IF "Adding" --> +New +<!-- ENDIF // Adding --> +Person Entry - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + + + + + + + + + + +
+ + + +BORDER=0> + + +ユーザ (クリックするとカードが表示されます) + + + + > +Click to display organization chart + + + +新規ユーザ - + + +
+ + + + +>証明書のダウンロード + + + + +   + +>オーディオクリップの再生 + + + + + + + + +
+ + +   + + + + + + +   + + + +   + + + + + +   + + + + + +
+ + + + + + + + + + + + + +* は必要なフィールドを示しています。
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+連絡先
姓: + +* + + + +氏名: + +* + + + +
名: + +
パスワード: + + 確認のためパスワードを再度入力: + +
電話: + +電子メールアドレス: + +
ファックス: + +ユーザ ID: + +
ポケットベル: + +携帯電話: + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+事業および場所に関する情報
事業カテゴリ: + +役職: + +
機関単位: + +マネージャ:
+ + + +
+これらのフィールドを修正する前にこのエントリを保存する必要があります。 + + + + + +
部屋番号: + +管理者:
+ + + +
+ +
部署番号: + +社員番号: + +
自動車のナンバープレート番号: + +    
住所: + +
+ + + + + + + + + + + + + + + + + + + + +--> + +
+追加情報
記述: + +
参照:
+ + + +
+ +このフィールドを修正する前にこのエントリを保存する必要があります。 + + + + + +
URL: + +
+ + +このエントリの最終変更日: + + 変更者: + + + + + + + + diff --git a/config/ja/display-orgunit.html b/config/ja/display-orgunit.html new file mode 100644 index 0000000..c85aa27 --- /dev/null +++ b/config/ja/display-orgunit.html @@ -0,0 +1,167 @@ + + + + + + + +<!-- IF "Adding" --> +新規 +<!-- ENDIF // Adding --> +機関単位 - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + + +
+機関単位 + + + +新規機関単位 - + + + +
+ + + + + + + +
+ + + + + + + +   + + + +   + + + + + +   + + + +
+ + + + + + + + + +
+ +* は必要なフィールドを示しています。
+ + + + + + + + + + + + + + + + + + + + + + +
単位名: + +* + + + +記述: + +
電話: + +事業カテゴリ: + +
ファックス: + +場所: + +
住所: + +
参照: + +
+ + +
+このエントリの最終変更日: + +変更者: + + + + + + + + diff --git a/config/ja/display-person.html b/config/ja/display-person.html new file mode 100644 index 0000000..38d16db --- /dev/null +++ b/config/ja/display-person.html @@ -0,0 +1,261 @@ + + + + + + + + +<!-- IF "Adding" --> +New +<!-- ENDIF // Adding --> +Person Entry - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + + + + + + + +
+ +ユーザ(クリックするとカードが表示されます) + + + + > +Click to display organization chart + + + +新規ユーザ - + + +
+ + + + + + + +
+ + +   + + + + + + +   + + + +   + + + + + +   + + + + + +
+ + + + + + + + + + +
+ +* は必要なフィールドを示しています。
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
苗字: + +* + + + +氏名: + +

パスワード: + + 確認のためパスワードを再度入力: + +

電話: + +電子メールアドレス: + +
ファックス: + +ユーザ ID: + +
ポケットベル: + +携帯電話: + +

役職: + +
住所: + +

記述: + +
参照:
+ + + +
+ +このフィールドを修正する前にこのエントリを保存する必要があります。 + + + + + +
URL: + +
好きな飲物: + +
+ + +
+このエントリの最終変更日: + + 変更者: + + + + + + + + diff --git a/config/ja/display-umperson.html b/config/ja/display-umperson.html new file mode 100644 index 0000000..1c28a70 --- /dev/null +++ b/config/ja/display-umperson.html @@ -0,0 +1,230 @@ + + + + + + + + +<!-- IF "Adding" --> +新規 +<!-- ENDIF // Adding --> +ミシガン大学ユーザのエントリ - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + + +
+ +> +ユーザ + + + > +Click to display organization chart + + + +新規ミシガン大学ユーザ - + + +
+ + +>オーディオクリップの再生 + + + + + + + +
+ + + + + + + +   + + + +   + + + + + +   + + + + + +
+ + + + + + + +
+ +* は必要なフィールドを示しています。
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
苗字: + +* + + + +氏名: + +* + + + +
電話: + +電子メールアドレス: + +
ファックス: + +固有の名前: + +
ポケットベル: + +携帯電話: + +

役職: + +
住所: + +

記述: + +
参照:
+ +
+ +
URL: + +
好きな飲物: + +
+ + +
+このエントリの最終変更日: + +変更者: + + + + + + + + diff --git a/config/ja/dsgw-l10n.conf b/config/ja/dsgw-l10n.conf new file mode 100644 index 0000000..3155f83 --- /dev/null +++ b/config/ja/dsgw-l10n.conf @@ -0,0 +1,50 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# To localize the search type menu: +# Locate dsgw-l10n.conf in config//. +# dsgw-l10n.conf contains translated words for search type pulldown menu. +# dsgw-l10n.conf sample: +# Note: the sample part should have double #'s for L10n. +## translate People +## translate NT-People +## translate Groups +## translate NT-Groups +## translate Organizations +## translate Org-Units +## translate Anything diff --git a/config/ja/dsgw.conf b/config/ja/dsgw.conf new file mode 100644 index 0000000..bc6851f --- /dev/null +++ b/config/ja/dsgw.conf @@ -0,0 +1,165 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# The baseurl directive gives the server, port, and base dn where searches +# should be rooted. The format is: +# +# ldap://host.domain[:port]/basedn +# - or - +# ldaps://host.domain:port/basedn (for SSL) +# +# Where: +# - "host.domain" is the fully-qualified domain name of the directory server +# - "port" is the port used by the directory server. If you are using an +# "ldaps" URL (that is, if the gateway is using SSL to communicate with the +# directory server), then the port number is required. Otherwise, it is +# optional and defaults to the standard LDAP port (389). +# - "basedn" is the distinguished name of the place in the directory tree +# where searches should start. Typically, this is the same as the +# "suffix" directive in your slapd.conf file. +# +# examples: +# baseurl "ldap://mars.aceindustry.com/o=Ace Industry, c=US" +# - causes the gateway to use the directory server running on host +# "mars.aceindustry.com". Since no port was given, the default LDAP +# port (389) is used. Searches in the gateway search for entries +# contained within o=Ace Industry, c=US. +# +# baseurl "ldaps://mars.aceindustry.com:636/o=Ace Industry, c=US" +# - same as above, but uses SSL to connect to the directory server, +# and contacts the server on port 636. + +baseurl "ldap://ggood.mcom.com:389/o=Netscape Communications Corp., c=US" +#baseurl "ldap://belltower.mcom.com:9000/o=Ace%20Industry,%20c=US" +#baseurl "ldap://belltower:9000/o=Netscape Communications Corp., c=US" +#baseurl "ldap://ldap.itd.umich.edu:389/o=University of Michigan, c=US" + +# The dirmgr directive specifies the "Manager" DN for your directory. +dirmgr "cn=Directory Manager, o=Netscape Communications Corp., c=US" + +# The securitypath directive gives the full path name to your +# security databases. +#securitypath /tmp/ssl + +# If the requireauth directive is present, users must authenticate to the +# directory before they may perform any operations. XXX: not implemented +# in 1.0b2. +#requireauth + +# The authlifetime directive specifies how long authentication credentials +# are valid (in seconds). +authlifetime 7200 + +# The default character set, for communication with HTTP clients. +# A client may override this default, using an HTTP Accept-Charset header. +# Or, this default may be overridden for a specific language, by creating +# a LANG/dsgwcharset.conf file which contains the charset name. +# For compatibility with HTTP clients that can't handle an HTTP response +# with a charset parameter in the content-type, comment out this directive; +# responses will be sent in ISO-8859-1, with no explicit charset parameter. +# RFC 1345 defines the syntax of charset names. There is a registry of +# charsets, at ftp://ftp.isi.edu/in-notes/iana/assignments/character-sets +# charset UTF-8 + +# The NLS (internationalization) directory. The directory of this name +# should contain a locales directory, which contains configuration files. +NLS ../../../lib/nls + +location-suffix "o=Netscape Communications Corp., c=US" + +# Mapping between config/display-XXX.html templates and LDAP objectClasses. +# This can be generated by using ds/templateindex. The format is: +# +# template TEMPLATENAME OBJECTCLASSES +# +# where "display-TEMPLATENAME.html" is the name of a display template +# that is found in this config directory (e.g., "display-group.html") and +# OBJECTCLASSES is a list of one or more objectClass values. For a given +# template to be used, all the objectClass values listed must be present +# in the directory entry, so the order of these template lines is +# significant (e.g. note that the more specific "umperson" and +# "orgperson" templates are listed before the one for an ordinary "person"). +# +template group groupOfNames +template groupun groupOfUniqueNames +template mailgroup rfc822mailgroup +template org organization +template orgunit organizationalUnit +template ntperson person inetOrgPerson nTUser +template umperson person umichPerson +template orgperson person inetOrgPerson +template person person +template country country + +# +# The remainder of this file contains information about the locations and +# types for new entries. +# +# "location" lines define places in the directory where new entries can be added +# The format of each line is: +# location HANDLE FRIENDLYNAME DN +# where HANDLE is a short name which is used in the "newtype" lines (see below) +# and FRIENDLYNAME is a human-readable name for the location +# and DN is the Distinguished Name for this location (if it does not end with +# '#', the location-suffix is appended to to construct a full DN; if it +# does end with `#', it assumed to be a full DN and the `#' is removed). +# +location country "米国" "c=US#" +location org "現在の機関" "" +location groups "機関グループ" "ou=Groups" +location acct "経理" "ou=Accounting" +location hr "人事" "ou=Human Resources" +location pay "会計" "ou=Payroll" +location pd "製品開発" "ou=Product Development" +location test "製品テスト" "ou=Product Testing" + +# "newtype" lines define the types of new entries that may be added +# The format of each line is: +# newtype TEMPLATENAME FRIENDLYNAME RDNATTR LOCATIONS... +# where TEMPLATENAME corresponds to an existing add-TEMPLATENAME.html file +# and FRIENDLYNAME is a human-readable name for this type of entry +# and RDNATTR is the attribute that is used to name entries of this type +# and LOCATIONS is a blank-separated list of locations where these types of +# entries can be added (corresponding to a HANDLE on a "location" +# config. file line). +# +newtype orgperson "ユーザ" cn acct hr pay pd test +newtype ntperson "NTユーザ" cn acct hr pay pd test +newtype groupun "グループ" cn groups +newtype orgunit "機関単位" ou org +newtype org "機関" o country diff --git a/config/ja/dsgw.tmpl b/config/ja/dsgw.tmpl new file mode 100644 index 0000000..8d4b034 --- /dev/null +++ b/config/ja/dsgw.tmpl @@ -0,0 +1,149 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK + +# The htmldir directive tells the CGIs where to find the html files +htmldir ../html + +# The configdir directive tells the CGIs where to find the +# templates/configuration files +configdir ../config + +# The gwnametrans directive tells the CGIs what url to output +# for http redirection. It should be the same nameTrans set +# in the webserver, if any is being is used. +gwnametrans /clients/dsgw/html/ + +# The authlifetime directive specifies how long authentication credentials +# are valid (in seconds). +authlifetime 7200 + +# The default character set, for communication with HTTP clients. +# A client may override this default, using an HTTP Accept-Charset header. +# Or, this default may be overridden for a specific language, by creating +# a LANG/dsgwcharset.conf file which contains the charset name. +# For compatibility with HTTP clients that can't handle an HTTP response +# with a charset parameter in the content-type, comment out this directive; +# responses will be sent in ISO-8859-1, with no explicit charset parameter. +# RFC 1345 defines the syntax of charset names. There is a registry of +# charsets, at ftp://ftp.isi.edu/in-notes/iana/assignments/character-sets +# charset UTF-8 + +# The NLS (internationalization) directory. The directory of this name +# should contain a locales directory, which contains configuration files. +NLS ../../../lib/nls + +# Mapping between config/display-XXX.html templates and LDAP objectClasses. +# This can be generated by using ds/templateindex. The format is: +# +# template TEMPLATENAME OBJECTCLASSES +# +# where "display-TEMPLATENAME.html" is the name of a display template +# that is found in this config directory (e.g., "display-group.html") and +# OBJECTCLASSES is a list of one or more objectClass values. For a given +# template to be used, all the objectClass values listed must be present +# in the directory entry, so the order of these template lines is +# significant (e.g. note that the more specific "orgperson" template is +# listed before the one for an ordinary "person"). +# +template group groupOfNames +template ntgroup groupOfUniqueNames ntGroup +template groupun groupOfUniqueNames +template org organization +template orgunit organizationalUnit +template ntperson person inetOrgPerson nTUser +template orgperson person inetOrgPerson +template person person +template country country + +# +# The remainder of this file contains information about the locations and +# types for new entries. +# +# "location" lines define places in the directory where new entries can be added +# The format of each line is: +# location HANDLE FRIENDLYNAME DN +# where HANDLE is a short name which is used in the "newtype" lines (see below) +# and FRIENDLYNAME is a human-readable name for the location +# and DN is the Distinguished Name for this location (if it does not end with +# '#', the location-suffix is appended to to construct a full DN; if it +# does end with `#', it assumed to be a full DN and the `#' is removed). +# +location country "米国" "c=US#" +location org "この組織 -" "" +location groups "グループ" "ou=Groups" +location people "ユーザー" "ou=People" +location special "特別ユーザー" "ou=Special Users" + +# "newtype" lines define the types of new entries that may be added +# The format of each line is: +# newtype TEMPLATENAME FRIENDLYNAME RDNATTR LOCATIONS... +# where TEMPLATENAME corresponds to an existing display-TEMPLATENAME.html file +# and FRIENDLYNAME is a human-readable name for this type of entry +# and RDNATTR is the attribute that is used to name entries of this type +# and LOCATIONS is a blank-separated list of locations where these types of +# entries can be added (corresponding to a HANDLE on a "location" +# config. file line). +# +newtype orgperson "ユーザー" uid people special +newtype ntperson "NTユーザー" uid people special +newtype ntgroup "NTグループ" cn groups +newtype groupun "グループ" cn groups +newtype orgunit "組織単位" ou people org +newtype org "組織" o country + +# Mappings between VCard properties and LDAP attribute types: +# The format of each line is: +# vcard-property VCARDPROP SYNTAX LDAPATTR [LDAPATTR2] +# where VCARDPROP is the name of a VCard property +# and SYNTAX is "cis" for simple strings and "mls" for multiline strings +# and LDAPATTR is the LDAP attribute that corresponds to VCARDPROP +# and LDAPATTR2 is an optional secondary LDAP attribute which is added to +# the property value by appending a semicolon and then the attr2 value. +vcard-property FN cis cn +vcard-property N cis sn givenName +vcard-property ORG cis o ou +vcard-property ROLE cis businessCategory +vcard-property ADR;WORK mls postalAddress +vcard-property ADR;HOME mls homePostalAddress +vcard-property EMAIL;INTERNET cis mail +vcard-property TITLE cis title +vcard-property TEL;WORK cis telephoneNumber +vcard-property TEL;FAX cis facsimileTelephoneNumber +vcard-property TEL;CELL cis mobile +vcard-property TEL;HOME cis homePhone +vcard-property NOTE cis description diff --git a/config/ja/dsgw_adm.conf b/config/ja/dsgw_adm.conf new file mode 100644 index 0000000..94aa2a9 --- /dev/null +++ b/config/ja/dsgw_adm.conf @@ -0,0 +1,78 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# Mapping between config/display-XXX.html templates and LDAP objectClasses. +# This can be generated by using the templateindex program. The format is: +# +# template TEMPLATENAME OBJECTCLASSES +# +# where "display-TEMPLATENAME.html" is the name of a display template +# that is found in this config directory (e.g., "display-group.html") and +# OBJECTCLASSES is a list of one or more objectClass values. For a given +# template to be used, all the objectClass values listed must be present +# in the directory entry, so the order of these template lines is +# significant (e.g. note that the more specific "orgperson" template is +# listed before the one for an ordinary "person"). +# +template group groupOfNames +template groupun groupOfUniqueNames +template org organization +template orgunit organizationalUnit +template orgperson person inetOrgPerson +template person person +template country country +template licensed-user nsLicenseUser + +# Attribute Value Sets (used with DS_ATTRVAL_SET directives) +# attrvset HANDLE VALUE PREFIX SUFFIX +# +attrvset CAL news "" "Netscape Collabra Server" +attrvset CAL slapd "" "Netscape Directory Server" + + +# Template Set definitions +# Note: templates must be defined before they can be mentioned on +# a tmplset line. +# +# tmplset SETNAME VIEWNAME TEMPLATENAME [HREF-LOCATION] +# +tmplset person "一般" orgperson +tmplset person "パスワード" passwd +tmplset person "ライセンス" licensed-user +tmplset group "一般" group +tmplset groupun "一般" groupun diff --git a/config/ja/dsgwcharset.conf b/config/ja/dsgwcharset.conf new file mode 100644 index 0000000..17e7c53 --- /dev/null +++ b/config/ja/dsgwcharset.conf @@ -0,0 +1,39 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +Shift_JIS diff --git a/config/ja/dsgwcollate.conf b/config/ja/dsgwcollate.conf new file mode 100644 index 0000000..d6e45c4 --- /dev/null +++ b/config/ja/dsgwcollate.conf @@ -0,0 +1,63 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# Each line in this file defines a crude string collation. +# There are two such collations, one for sorting a displayed list, and +# another for selecting one of several alternative values to display: + +sort 20,A0,3000-30FF 3190- +display 20,A0,3000,3190- 3001-30FF + +# In each line, each parameter defines a "script" as a set of Unicodes; +# a character is considered to be part of the first script it matches. +# An implicit final script contains characters that don't match any +# parameter. Strings are collated in order of these scripts. +# A mixed-script string is collated with the last script it contains. +# Strings in the same script category are sorted by another algorithm, +# which is not defined here. + +# In this file, the sort scripts are Kana, Kanji and everything else, +# and the display scripts are Kanji, Kana and everything else. So, +# lists are sorted with pure Kana values first, Kanji values and mixed +# Kanji/Kana values next, and finally values containing other characters. +# When choosing a value to display, pure Kanji is preferred, Kana or +# mixed Kanji/Kana is the next choice, and anything else is the last. +# These choices aim to sort by Yomi (stored in Kana), but display Kanji. + +# Insignificant characters (such as whitespace) should be included in +# the first script on each line. diff --git a/config/ja/dsgwfilter.conf b/config/ja/dsgwfilter.conf new file mode 100644 index 0000000..0fc0578 --- /dev/null +++ b/config/ja/dsgwfilter.conf @@ -0,0 +1,171 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# ldap filter file +# +# lines like this that start with # or empty lines are ignored +# +# syntax: +# +# +# [] +# [] +# +# [] ... +# +# The should describe the filter. It should correctly complete +# the phrases (in the resource database) DBT_Found0EntriesWhere_, +# DBT_Found1EntryWhere_ and DBT_FoundEntriesWhere_; for example: +# +# Found 1 entry where the '%v'. +# Found no entries where the '%v'. +# Found 3 entries where the '%v'. +# +# The should begin with the article ("the" in English) for +# languages that require agreement between article and noun (e.g +# genders in Spanish or French). +# +# The scope is optional, and should be one of: +# "base" +# "onelevel" +# "subtree" +# if it is included. + +# +# Directory Server gateway +# + +"dsgw-people" + "=" " " "(%v))" "LDAPフィルタ: " + + "^[+]*[0-9][ 0-9-]*$" " " "(telephoneNumber=*%v))" "電話番号の末尾に一致する" + + "@" " " "(mail=%v))" "電子メール アドレスに一致する" + "(mail=%v*))" "電子メール アドレスの先頭文字に一致する" + + "^.[. _].*" ". _" "(cn=%v1* %v2-))" "名の頭文字と名前に一致する" + + ".*[. _].$" ". _" "(cn=%v1-*))" "名前と姓の頭文字に一致する" + + "[. _]" ". _" "(|(sn=%v1-)(cn=%v1-)))" "名前に一致する" + "(|(cn=*%v1-*)(sn=*%v1-*)(cn~=%v1-)(sn~=%v1-)))" "類似しているか、含まれる" + + "^\*$" " " "(|(cn=*)(sn=*)(uid=*)))" "名前またはユーザIDに一致する" + + ".*" ". " "(|(cn=%v1)(sn=%v1)(uid=%v1)))" "名前またはユーザIDに一致する" + "(|(cn=*%v1*)(sn=*%v1*)(cn~=%v1)(sn~=%v1)))" "類似しているか、含まれる" + + +"dsgw-groups" + "=" " " "(%v))" "LDAPフィルタ: " + + "^\*$" " " "(cn=*))" "名前に一致する" + + ".*" ". _" "(cn=%v1-))" "名前に一致する" + "(cn=*%v1-*))" "含まれる" + "(cn~=%v1-))" "類似した" + +"dsgw-ntgroups" + "=" " " "(%v))" "LDAPフィルタ: " + + "^\*$" " " "(cn=*))" "名前に一致する" + + ".*" ". _" "(cn=%v1-))" "名前に一致する" + "(cn=*%v1-*))" "含まれる" + "(cn~=%v1-))" "類似した" + "(ntgroupdomainid=%v:*))" "NTドメイン名に一致する" + "(ntgroupdomainid=*:%v))" "NTグループに一致する" + +"dsgw-organizations" + "=" " " "(%v))" "LDAPフィルタ: " + + "\." " " "(associatedDomain=%v))" "関連ドメインに一致する" + + "^\*$" " " "(o=*))" "名前に一致する" + + ".*" " " "(o=%v))" "名前に一致する" + "(o=*%v*))" "含まれる" + "(o~=%v))" "類似した" + +"dsgw-orgunits" + "=" " " "(%v))" "LDAPフィルタ: " + + "\." " " "(associatedDomain=%v))" "関連ドメインに一致する" + + "^\*$" " " "(ou=*))" "名前に一致する" + + ".*" " " "(ou=%v))" "名前に一致する" + "(ou=*%v*))" "含まれる" + "(ou~=%v))" "類似した" + +"dsgw-anything" + "=" " " "(%v)" "LDAPフィルタ: " + + "[. _]" ". _" "(|(sn=%v1-)(cn=%v1-)(o=%v1-)(ou=%v1-))" "名前に一致する" + "(|(sn~=%v1-)(cn~=%v1-)(o=%v1-)(ou=%v1-))" "類似した" + + "^\*$" " " "(|(cn=*)(sn=*)(o=*)(ou=*))" "名前に一致する" + + ".*" ". " "(|(cn=%v1)(sn=%v1)(o=%v1)(ou=%v1))" "名前に一致する" + "(|(cn=*%v1*)(sn=*%v1*)(cn~=%v1)(sn~=%v1)(o=%v1)(ou=%v1))" "類似しているか、含まれる" + + +"dsgw-ntpeople" + "=" " " "(%v))" "LDAPフィルタ: " + + "^[+]*[0-9][ 0-9-]*$" " " "(telephoneNumber=*%v))" "電話番号の末尾に一致する" + + "@" " " "(mail=%v))" "電子メール アドレスに一致する" + "(mail=%v*))" "電子メール アドレスの先頭文字に一致する" + + "^.[. _].*" ". _" "(cn=%v1* %v2-))" "名の頭文字と名前に一致する" + + ".*[. _].$" ". _" "(cn=%v1-*))" "名前と姓の頭文字に一致する" + + "[. _]" ". _" "(|(sn=%v1-)(cn=%v1-)))" "名前に一致する" + "(|(cn=*%v1-*)(sn=*%v1-*)(cn~=%v1-)(sn~=%v1-)))" "類似しているか、含まれる" + + "^\*$" " " "(|(cn=*)(sn=*)))" "名前に一致する" + + ".*" ". " "(|(cn=%v1)(sn=%v1)))" "名前に一致する" + "(ntuserlogonserver=%v))" "NT ログオンサーバに一致する" + "(ntuserdomainid=%v:*))" "NTドメイン名に一致する" + "(ntuserdomainid=*:%v))" "NTユーザ名に一致する" + "(|(cn=*%v1*)(sn=*%v1*)(cn~=%v1)(sn~=%v1)))" "類似しているか、含まれる" + +# Do not remove this line, or place any directives after it. diff --git a/config/ja/dsgwfilter_adm.conf b/config/ja/dsgwfilter_adm.conf new file mode 100644 index 0000000..9900d84 --- /dev/null +++ b/config/ja/dsgwfilter_adm.conf @@ -0,0 +1,105 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# ldap filter file +# +# lines like this that start with # or empty lines are ignored +# +# syntax: +# +# +# [] +# [] +# +# [] ... +# +# The should describe the filter. It should correctly complete +# the phrases (in the resource database) DBT_Found0EntriesWhere_, +# DBT_Found1EntryWhere_ and DBT_FoundEntriesWhere_; for example (en): +# +# Found 1 entry where the '%v'. +# Found no entries where the '%v'. +# Found 3 entries where the '%v'. +# +# The should begin with the article ("the" in English) for +# languages that require agreement between article and noun (e.g +# genders in Spanish or French). +# +# The scope is optional, and should be one of: +# "base" +# "onelevel" +# "subtree" +# if it is included. + +# +# Directory Server gateway - for Netscape Admin Server +# + +"dsgw-people" + "=" " " "(%v))" "LDAPフィルタ: " + + "^[+]*[0-9][ 0-9-]*$" " " "(telephoneNumber=*%v))" "電話番号の末尾: " + + "@" " " "(mail=%v))" " 電子メールアドレス: " + "(mail=%v*))" "電子メールアドレスの先頭文字: " + + "^.[. _].*" ". _" "(cn=%v1* %v2-))" "名の頭文字と名前: " + + ".*[. _].$" ". _" "(cn=%v1-*))" "名前と苗字の頭文字: " + + "[. _]" ". _" "(|(sn=%v1-)(cn=%v1-)))" "名前: " + "(|(cn=*%v1-*)(sn=*%v1-*)(cn~=%v1-)(sn~=%v1-)))" "名前 sounds like or contains" + + ".*" ". " "(uid=%v1))" "ログインID: " + "(|(cn=%v1)(sn=%v1)))" "名前: " + "(|(cn=*%v1*)(sn=*%v1*)(cn~=%v1)(sn~=%v1)))" "次に類似した名前またはそれを含む名前: " + + +"dsgw-groups" + "=" " " "(%v))" "LDAPフィルタ: " + + ".*" ". _" "(cn=%v1-))" "名前: " + "(cn~=%v1-))" "u次に類似した名前" + +"dsgw-orgunits" + "=" " " "(%v))" "LDAPフィルタ: " + + ".*" ". _" "(ou=%v1-))" "単位名:" + "(ou~=%v1-))" "次に類似した単位名: " + +#Do not remove this line, or place any additional lines after it. diff --git a/config/ja/dsgwsearchprefs.conf b/config/ja/dsgwsearchprefs.conf new file mode 100644 index 0000000..93c5378 --- /dev/null +++ b/config/ja/dsgwsearchprefs.conf @@ -0,0 +1,245 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# dsgwsearchprefs.conf - directory server gateway search object definitions + + +# the current version of this file format is 1 +Version 1 + + +# Name for this search object +People +# options (the only one supported right now is "internal" which means that +# this search object should not be presented directly to the user) +# use "" for none +"" +# Label to place before text box user types in +"検索対象:" +# Filter prefix to append to all searches +"(&(objectClass=person)" +# Tag to use for "Fewer Choices" searches - from ldapfilter.conf file +"dsgw-people" +# If a search results in > 1 match, retrieve this attribute to help +# user disambiguate the entries... +not-used-by-dsgw +# ...and label it with this string: +not-used-by-dsgw +# Search scope to use when searching +subtree +# Follows a list of "More Choices" search options. Format is: +# Label, attribute, select-bitmap, extra attr display name, extra attr ldap name +# If last two are null, "Fewer Choices" name/attributes used. +# Label should begin with the article ("the" in English) for +# languages that require agreement between article and noun +# (e.g genders in Spanish or French). +"氏名" cn 111111 "" "" +"姓" sn 111111 "" "" +"電話番号" "telephoneNumber" 111011 "" "" +"電子メールアドレス" "mail" 111111 "" "" +"ユーザID" "uid" 111111 "" "" +"役職" title 111111 "" "" +END +# Match types +"に一致する" "(%a=%v))" +"に一致しない" "(!(%a=%v)))" +"に類似する" "(%a~=%v))" +"の先頭に一致する" "(%a=%v*))" +"の末尾に一致する" "(%a=*%v))" +"に含まれる" "(%a=*%v*))" +END + + +"NT-People" +"" +"検索対象:" +"(&(objectClass=ntuser)" +"dsgw-ntpeople" +not-used-by-dsgw +not-used-by-dsgw +subtree +"氏名" cn 111111 "" "" +"姓" sn 111111 "" "" +"電話番号" "telephoneNumber" 111011 "" "" +"電子メールアドレス" "mail" 111111 "" "" +"ユーザID" "uid" 111111 "" "" +"役職" title 111111 "" "" +"NTユーザ名" "ntuserdomainid" 110000 "" "" +"NTドメイン" "ntuserdomainid" 101000 "" "" +"NT ログオンサーバ" "ntuserlogonserver" 111111 "" "" +END +"に一致する" "(%a=%v))" +"に一致しない" "(!(%a=%v)))" +"に類似する" "(%a~=%v))" +"の先頭に一致する" "(%a=%v*))" +"の末尾に一致する" "(%a=*%v))" +"に含まれる" "(%a=*%v*))" +END + +Groups +"" +"検索対象:" +"(&(|(objectClass=rfc822MailGroup)(objectClass=groupOfNames)(objectClass=groupOfUniqueNames)(objectClass=groupOfCertificates))" +"dsgw-groups" +not-used-by-dsgw +not-used-by-dsgw +subtree +"名前" cn 111111 "" "" +"説明" description 111111 "" "" +"所有者 (DN)" "owner" 000011 "owner" "Owner" +"メンバー (DN)" "member" 000011 "" "" +END +"に一致する" "(%a=%v))" +"に一致しない" "(!(%a=%v)))" +"に類似する" "(%a~=%v))" +"の先頭に一致する" "(%a=%v*))" +"の末尾に一致する" "(%a=*%v))" +"に含まれる" "(%a=*%v*))" +END + + +NT-Groups +"" +"検索対象:" +"(&(objectClass=ntGroup)" +"dsgw-ntgroups" +not-used-by-dsgw +not-used-by-dsgw +subtree +"名前" cn 111111 "" "" +"NTグループ名" "ntgroupdomainid" 110000 "" "" +"NTドメイン名" "ntgroupdomainid" 101000 "" "" +"説明" description 111111 "" "" +"所有者 (DN)" "owner" 000011 "owner" "Owner" +"メンバー (DN)" "uniquemember" 000011 "" "" +END +"に一致する" "(%a=%v))" +"に一致しない" "(!(%a=%v)))" +"に類似する" "(%a~=%v))" +"の先頭に一致する" "(%a=%v*))" +"の末尾に一致する" "(%a=*%v))" +"に含まれる" "(%a=*%v*))" +END + + +Organizations +"" +"検索対象:" +"(&(objectClass=organization)" +"dsgw-organizations" +not-used-by-dsgw +not-used-by-dsgw +subtree +"名前" o 111111 "" "" +"場所" l 111111 "" "" +"電話番号" telephoneNumber 111011 "" "" +"説明" description 111011 "" "" +END +"に一致する" "(%a=%v))" +"に一致しない" "(!(%a=%v)))" +"に類似する" "(%a~=%v))" +"の先頭に一致する" "(%a=%v*))" +"の末尾に一致する" "(%a=*%v))" +"に含まれる" "(%a=*%v*))" +END + + +"Org-Units" +"" +"検索対象:" +"(&(objectClass=organizationalUnit)" +"dsgw-orgunits" +not-used-by-dsgw +not-used-by-dsgw +subtree +"名前" ou 111111 "" "" +"場所" l 111111 "" "" +"電話番号" telephoneNumber 111011 "" "" +"説明" description 111111 "" "" +END +"に一致する" "(%a=%v))" +"に一致しない" "(!(%a=%v)))" +"に類似する" "(%a~=%v))" +"の先頭に一致する" "(%a=%v*))" +"の末尾に一致する" "(%a=*%v))" +"に含まれる" "(%a=*%v*))" +END + +Anything +"" +"検索対象:" +"" +"dsgw-anything" +not-used-by-dsgw +not-used-by-dsgw +subtree +"一般名" cn 111111 "" "" +"説明" description 111111 "" "" +END +"に一致する" "(%a=%v)" +"に一致しない" "(!(%a=%v))" +"に類似する" "(%a~=%v)" +"の先頭に一致する" "(%a=%v*)" +"の末尾に一致する" "(%a=*%v)" +"に含まれる" "(%a=*%v*)" +END + + +Auth +internal +"認証の種別:" +"(&(objectClass=person)" +"dsgw-people" +not-used-by-dsgw +not-used-by-dsgw +subtree +"一般名" cn 111111 "" "" +"姓" sn 111111 "" "" +"電話番号" "telephoneNumber" 111011 "" "" +"電子メールアドレス" "mail" 111111 "" "" +"ユーザID" "uid" 111111 "" "" +"役職" title 111111 "" "" +END +"に一致する" "(%a=%v))" +"に一致しない" "(!(%a=%v)))" +"に類似する" "(%a~=%v))" +"の先頭に一致する" "(%a=%v*))" +"の末尾に一致する" "(%a=*%v))" +"に含まれる" "(%a=*%v*))" +END + diff --git a/config/ja/edit-passwd.html b/config/ja/edit-passwd.html new file mode 100644 index 0000000..5193f6f --- /dev/null +++ b/config/ja/edit-passwd.html @@ -0,0 +1,109 @@ + + + + + +Change Password - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + +

パスワード変更 + +

+ +
+ +

+ + + + + + + + + + + + + + + +
+古いパスワードを入力: + + +
+古いパスワードを入力: + + +
+新規パスワードを入力: + + +
+確認のため新規パスワードを再度入力: + + +
+ +

+ + + +
+ + + + + + + +
+ + + + + diff --git a/config/ja/list-Anything.html b/config/ja/list-Anything.html new file mode 100644 index 0000000..476916a --- /dev/null +++ b/config/ja/list-Anything.html @@ -0,0 +1,73 @@ + + +

+ +
+

+ + + + + +
名前 電話番号 +電子メールアドレス 記述 + + + + +
+ + + + + + + + + +
+ + +

+

+別の検索を試みてください。 +
+ + + diff --git a/config/ja/list-Auth.html b/config/ja/list-Auth.html new file mode 100644 index 0000000..5c0b22a --- /dev/null +++ b/config/ja/list-Auth.html @@ -0,0 +1,104 @@ + + + + + +
+ + + +> +
+ + + +
+ +

+ +認証に使用するエントリ名をクリックしてください。 + +

+ + + + +
認証の種別 役職 + + + + +
+ + + + + + +
+ +元に戻って再実行してください。 + +

+ +
+ + +
+ + + +
+
+ + diff --git a/config/ja/list-Groups.html b/config/ja/list-Groups.html new file mode 100644 index 0000000..2ffcfc6 --- /dev/null +++ b/config/ja/list-Groups.html @@ -0,0 +1,69 @@ + + +
+ +
+

+ + + + + +
グループ名 +記述 + + + + +
+ + + + + +
+ + +

+

+別の検索を試みてください。 +
+ + + diff --git a/config/ja/list-NT-Groups.html b/config/ja/list-NT-Groups.html new file mode 100644 index 0000000..b81084c --- /dev/null +++ b/config/ja/list-NT-Groups.html @@ -0,0 +1,75 @@ + + +
+ +
+

+ + + + + +
LDAP グループ名 +NTドメイン名 +NTグループ名 +記述 + + + + +
+ + + + + + + + + +
+ + +

+

+別の検索を試みてください。 +
+ + + diff --git a/config/ja/list-NT-People.html b/config/ja/list-NT-People.html new file mode 100644 index 0000000..cb44d91 --- /dev/null +++ b/config/ja/list-NT-People.html @@ -0,0 +1,79 @@ + + +
+ +
+

+ + + + + + + + + + + + + + + +
名前NTドメインNTユーザ名電話番号 +
+ + onMouseOver="window.status='このエントリの詳細を表示するにはここをクリックしてください。'; return true"> + + + + + + + + +
+ + +

+

+別の検索を試みてください。 +
+ + + diff --git a/config/ja/list-Org-Units.html b/config/ja/list-Org-Units.html new file mode 100644 index 0000000..aebc292 --- /dev/null +++ b/config/ja/list-Org-Units.html @@ -0,0 +1,69 @@ + + +
+ +
+

+ + + + +
機関単位 記述 電話番号 + + + + +
+ + + + + + + +
+ + +

+

+別の検索を試みてください。 +
+ + + diff --git a/config/ja/list-Organizations.html b/config/ja/list-Organizations.html new file mode 100644 index 0000000..20338bb --- /dev/null +++ b/config/ja/list-Organizations.html @@ -0,0 +1,69 @@ + + +
+ +
+

+ + + + +
機関 記述 電話番号 + + + + +
+ + + + + + + +
+ + +

+

+別の検索を試みてください。 +
+ + + diff --git a/config/ja/list-People.html b/config/ja/list-People.html new file mode 100644 index 0000000..eea6029 --- /dev/null +++ b/config/ja/list-People.html @@ -0,0 +1,79 @@ + + +
+ +
+

+ + + + + + + + + + + + + + + +
名前電話番号電子メール アドレス役職 +
+ + onMouseOver="window.status='Click here to view this entry in detail'; return true"> + + + + + + + + +
+ + +

+

+別の検索を試みてください。 +
+ + + diff --git a/config/ja/list-fa-Groups.html b/config/ja/list-fa-Groups.html new file mode 100644 index 0000000..f36d222 --- /dev/null +++ b/config/ja/list-fa-Groups.html @@ -0,0 +1,53 @@ + + + + + +
+ + + + +
+ + + + + + diff --git a/config/ja/list-fa-People.html b/config/ja/list-fa-People.html new file mode 100644 index 0000000..f36d222 --- /dev/null +++ b/config/ja/list-fa-People.html @@ -0,0 +1,53 @@ + + + + + +
+ + + + +
+ + + + + + diff --git a/config/ja/list-urlsearch.html b/config/ja/list-urlsearch.html new file mode 100644 index 0000000..2f3ce38 --- /dev/null +++ b/config/ja/list-urlsearch.html @@ -0,0 +1,69 @@ + + +
+ +
+

+ + + + +
名前 電話番号 電子メール アドレス + + + + +
+ + + + + + + +
+ + +

+

+別の検索を試みてください。 +
+ + + diff --git a/config/ja/newentry.html b/config/ja/newentry.html new file mode 100644 index 0000000..8fc5d7b --- /dev/null +++ b/config/ja/newentry.html @@ -0,0 +1,57 @@ + + + + +Netscape Directory Server Gateway: New Entry + + + + + + + + + +<BODY> +このドキュメントを表示するにはフレームをサポートするクライアントが必要です。 +</BODY> + + diff --git a/config/ja/newentryName.html b/config/ja/newentryName.html new file mode 100644 index 0000000..569bb18 --- /dev/null +++ b/config/ja/newentryName.html @@ -0,0 +1,79 @@ + + + + + + +

+ +ステップ 2. +新規のエントリ名を入力します。 + +. +

+ += + + +

+ステップ 3. + + +ポップアップメニューから Directory の場所を選択します。 + +. [その他]を選択する場合は、このエントリの追加場所に、完全識別名を入力する必要があります。 +

+ + + + +

+ステップ 4. + + +[次へ]をクリックしてください。このエントリの修正可能なビューが表示されます。情報の入力が終わったら、エントリを保存します。 +

+

+
+ + + + +
+ diff --git a/config/ja/newentryType.html b/config/ja/newentryType.html new file mode 100644 index 0000000..6d3043c --- /dev/null +++ b/config/ja/newentryType.html @@ -0,0 +1,45 @@ + + + + + +ステップ 1. +作成するエントリ タイプを選択します。 + + diff --git a/config/ja/search.html b/config/ja/search.html new file mode 100644 index 0000000..acce939 --- /dev/null +++ b/config/ja/search.html @@ -0,0 +1,49 @@ + + + + +Netscape Directory Server Gateway: Standard Search + + + + + + + + diff --git a/config/ja/searchString.html b/config/ja/searchString.html new file mode 100644 index 0000000..12546df --- /dev/null +++ b/config/ja/searchString.html @@ -0,0 +1,61 @@ + + + + + + + + + + + + +
検索: + +存在する場所: + +
検索対象: + +   + +
+ + + + diff --git a/config/ko/dsgw-l10n.conf b/config/ko/dsgw-l10n.conf new file mode 100644 index 0000000..3155f83 --- /dev/null +++ b/config/ko/dsgw-l10n.conf @@ -0,0 +1,50 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# To localize the search type menu: +# Locate dsgw-l10n.conf in config//. +# dsgw-l10n.conf contains translated words for search type pulldown menu. +# dsgw-l10n.conf sample: +# Note: the sample part should have double #'s for L10n. +## translate People +## translate NT-People +## translate Groups +## translate NT-Groups +## translate Organizations +## translate Org-Units +## translate Anything diff --git a/config/ko/dsgwcharset.conf b/config/ko/dsgwcharset.conf new file mode 100644 index 0000000..85edff8 --- /dev/null +++ b/config/ko/dsgwcharset.conf @@ -0,0 +1,39 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +euc-kr diff --git a/config/list-Anything.html b/config/list-Anything.html new file mode 100644 index 0000000..738787f --- /dev/null +++ b/config/list-Anything.html @@ -0,0 +1,151 @@ + + +Search for Anything + + + + + + + + + + + + + + + + +
+ +
  +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ Name + + Phone + + E-mail + + Description +
+ + + + + + + +
+
+  
+ Click on an entry's Name to bring up more information about that entry. +
+ + +

+

+ + + + +
+ + + + +
+
+ + + + + + + + + + +
+ + +   + +

+ No match found. +

+
+ +

+ No entries match the requested search term. Please try a different search. +

+
+
+
+
+
+

+ + + + diff --git a/config/list-Auth.html b/config/list-Auth.html new file mode 100644 index 0000000..78f043b --- /dev/null +++ b/config/list-Auth.html @@ -0,0 +1,109 @@ + + + + + +Authenticate as... + + + + +
+ + +> + +
+ + + +
+ +

+ +Please click on the name of the entry you would like to use for authentication. +

+

+ + + + +
Authenticate As Title + + + + +
+ + + + + + +
+ +

Please go back and try again.
+ +
+ +
+ + +
+ + + +
+
+ + diff --git a/config/list-Domaincomponent.html b/config/list-Domaincomponent.html new file mode 100644 index 0000000..6bdaa73 --- /dev/null +++ b/config/list-Domaincomponent.html @@ -0,0 +1,146 @@ + + + + +Search for Domaincomponents + + + + + + + + + + + + + + + +
+ +
  +
+ + + + + + + + + + + + + + + + + + + + +
+ Domaincomponent + + Description + + Phone +
+ + + + + +
+ +
+  
+ Click on an domaincomponent's name to bring up more information about that entry. +
+ + +

+

+ + + + +
+ + + + +
+
+ + + + + + + + + + +
+ + +   + +

+ No match found. +

+
+ +

+ No entries match the requested search term. Please try a different search. +

+
+
+
+
+
+

+ + + + diff --git a/config/list-Groups.html b/config/list-Groups.html new file mode 100644 index 0000000..18389c2 --- /dev/null +++ b/config/list-Groups.html @@ -0,0 +1,141 @@ + + + + +Search for Groups + + + + + + + + + + + + + + + + +
+ +
  +
+ + + + + + + + + + + + + + + + + + +
+ Group Name + + Description +
+  + + +
+ +
+  
+ Click on a Group's Name to bring up more information about that entry. +
+ + +

+

+ + + + +
+ + + + +
+
+ + + + + + + + + + +
+ + +   + +

+ No match found. +

+
+ +

+ No entries match the requested search term. Please try a different search. +

+
+
+
+
+
+

+ + + + diff --git a/config/list-NT-Groups.html b/config/list-NT-Groups.html new file mode 100644 index 0000000..19c5d10 --- /dev/null +++ b/config/list-NT-Groups.html @@ -0,0 +1,144 @@ + + + + +Search for NT Groups + + + + + + + + + + + + + + + +
+ +
  +
+ + + + + + + + + + + + + + + + + + + +
+ LDAP Group Name + + NT Group Name + + Description +
+ + + + + +
+
+  
+ Click on an entry's Name to bring up more information about that entry. +
+ + +

+

+ + + + +
+ + + + +
+
+ + + + + + + + + + +
+ + +   + +

+ No match found. +

+
+ +

+ No entries match the requested search term. Please try a different search. +

+
+
+
+
+
+

+ + + + diff --git a/config/list-NT-People.html b/config/list-NT-People.html new file mode 100644 index 0000000..c2f63f8 --- /dev/null +++ b/config/list-NT-People.html @@ -0,0 +1,180 @@ + + + + +Search for NT-People" + + + + + + + + + + + + + + + + + + +
+ +
  +
+ + + + + + + + + + + + + + + + + + + + + +
+ Name + + NT Domain + + NT Username + + AIM ID + + Phone +
+ + + + + + + + +
+ +
+  
+ Click on an entry's ID to bring up more information about that entry. +
+ + +

+

+ + + + +
+ + + + +
+
+ + + + + + + + + + +
+ + +   + +

+ No match found. +

+
+ +

+ No entries match the requested search term. Please try a different search. +

+
+
+
+
+
+

+ + + + diff --git a/config/list-Org-Units.html b/config/list-Org-Units.html new file mode 100644 index 0000000..c52070e --- /dev/null +++ b/config/list-Org-Units.html @@ -0,0 +1,149 @@ + + + + +Search for Organizational Units + + + + + + + + + + + + + + + +
+ +
  +
+ + + + + + + + + + + + + + + + + + + +
+ Organizational Unit + + Description + + Phone +
+ + + + + +
+ +
+  
+ Click on an entry's ID to bring up more information about that entry. +
+ + +

+

+ + + + +
+ + + + +
+
+ + + + + + + + + + +
+ + +   + +

+ + No match found. + +

+
+ +

+ + No entries match the requested search term. Please try a different search. + +

+
+
+
+
+
+

+ + + + diff --git a/config/list-Organizations.html b/config/list-Organizations.html new file mode 100644 index 0000000..b7eeb4f --- /dev/null +++ b/config/list-Organizations.html @@ -0,0 +1,158 @@ + + + + +Search for Organizations + + + + + + + + + + + + + + + +
+ +
  +
+ + + + + + + + + + + + + + + + + + + + +
+ Organization + + Description + + Phone +
+ + + + + + + + + + + +
+ +
+  
+ + Click on an organization's name to bring up more information about that entry. + +
+ + +

+

+ + + + +
+ + + + +
+
+ + + + + + + + + + +
+ + +   + +

+ + No match found. + +

+
+ +

+ + No entries match the requested search term. Please try a different search. + +

+
+
+
+
+
+

+ + + + diff --git a/config/list-People.html b/config/list-People.html new file mode 100644 index 0000000..6484296 --- /dev/null +++ b/config/list-People.html @@ -0,0 +1,207 @@ + + + + +Search for People + + + + + + + + + + + + + + + + + +
+ + + +
  +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Name + + ID + + Phone + + E-mail + + AIM ID + + Group +
+ + + + + + + + + + + + + + + + + + + + +
+ +
+  
+ + Click on an entry's ID to bring up more information about that entry. + +
+ + +

+

+ + + + +
+ + + + +
+
+ + + + + + + + + + +
+ + +   + +

+ + No match found. + +

+
+ +

+ + No entries match the requested search term. Please try a different search. + +

+
+
+
+
+
+

+ + + + diff --git a/config/list-fa-Groups.html b/config/list-fa-Groups.html new file mode 100644 index 0000000..fd384c4 --- /dev/null +++ b/config/list-fa-Groups.html @@ -0,0 +1,57 @@ + + + +Search for People + + + + + +
+ + + + +
+ + + + + + diff --git a/config/list-fa-People.html b/config/list-fa-People.html new file mode 100644 index 0000000..fd384c4 --- /dev/null +++ b/config/list-fa-People.html @@ -0,0 +1,57 @@ + + + +Search for People + + + + + +
+ + + + +
+ + + + + + diff --git a/config/list-urlsearch.html b/config/list-urlsearch.html new file mode 100644 index 0000000..34bd64d --- /dev/null +++ b/config/list-urlsearch.html @@ -0,0 +1,160 @@ + + + + +URL-based Search + + + + + + + + + + + + + + + +
+ + + +
  +
+ + + + + + + + + + + + + + + + + + + + + +
+ Name + + Phone + + E-mail +
+ + + + + + + + + + + +
+ +
+  
+ + Click on an entry's Name to bring up more information about that entry. + +
+ + +

+

+ + + + +
+ + + + +
+
+ + + + + + + + + + +
+ + +   + +

+ + No match found. + +

+
+ +

+ + No entries match the requested search term. Please try a different search. + +

+
+
+
+
+
+

+ + + diff --git a/config/newentry.html b/config/newentry.html new file mode 100644 index 0000000..fdc17ce --- /dev/null +++ b/config/newentry.html @@ -0,0 +1,57 @@ + + + + +Netscape Directory Server Gateway: New Entry + + + + + + + + + +<BODY> +You must use a client that supports frames to view this document. +</BODY> + + diff --git a/config/newentryName.html b/config/newentryName.html new file mode 100644 index 0000000..71ca351 --- /dev/null +++ b/config/newentryName.html @@ -0,0 +1,93 @@ + + + + + + + +

+ +

+
+Step 2. Provide a name for the new + +. +
+ +: + + +

+ +Step 3. + + +Select a directory location for this + +, or select Other and enter the complete +distinguished name where this entry should be added. +

+ + + + +
+ + +

+ +Step 4. + + +Click Continue. You will be presented with an editable view +of the entry. When you are done filling in information, +save the entry. +

+ +

+ + + +
+ + + diff --git a/config/newentryType.html b/config/newentryType.html new file mode 100644 index 0000000..7790efe --- /dev/null +++ b/config/newentryType.html @@ -0,0 +1,56 @@ + + + + + + + + +
+Create New Entry +
+ +Step 1. Select the type of entry to create. + + +
+ + + + diff --git a/config/ns-license-schema.conf b/config/ns-license-schema.conf new file mode 100644 index 0000000..bf89525 --- /dev/null +++ b/config/ns-license-schema.conf @@ -0,0 +1,49 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +attribute nsLicensedFor cis +attribute nsLicenseStartTime cis +attribute nsLicenseEndTime cis + +objectclass nsLicenseUser + requires + objectClass + allows + nsLicensedFor + nsLicenseStartTime + nsLicenseEndTime diff --git a/config/search.html b/config/search.html new file mode 100644 index 0000000..390aaad --- /dev/null +++ b/config/search.html @@ -0,0 +1,49 @@ + + + + +Netscape Directory Server Gateway: Standard Search + + + + + + + + diff --git a/config/searchString.html b/config/searchString.html new file mode 100644 index 0000000..a9bed05 --- /dev/null +++ b/config/searchString.html @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + +
+Find + + +within + + + +
+Search for + + + + + +
+ + + + + + diff --git a/config/zh/dsgw-l10n.conf b/config/zh/dsgw-l10n.conf new file mode 100644 index 0000000..3155f83 --- /dev/null +++ b/config/zh/dsgw-l10n.conf @@ -0,0 +1,50 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# To localize the search type menu: +# Locate dsgw-l10n.conf in config//. +# dsgw-l10n.conf contains translated words for search type pulldown menu. +# dsgw-l10n.conf sample: +# Note: the sample part should have double #'s for L10n. +## translate People +## translate NT-People +## translate Groups +## translate NT-Groups +## translate Organizations +## translate Org-Units +## translate Anything diff --git a/config/zh/dsgwcharset.conf b/config/zh/dsgwcharset.conf new file mode 100644 index 0000000..2cef263 --- /dev/null +++ b/config/zh/dsgwcharset.conf @@ -0,0 +1,39 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +big5 diff --git a/configure b/configure new file mode 100755 index 0000000..cd96887 --- /dev/null +++ b/configure @@ -0,0 +1,8389 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.59 for dsgw 1.1. +# +# Report bugs to . +# +# Copyright (C) 2003 Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_config_libobj_dir=. +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Identity of this package. +PACKAGE_NAME='dsgw' +PACKAGE_TARNAME='dsgw' +PACKAGE_VERSION='1.1' +PACKAGE_STRING='dsgw 1.1' +PACKAGE_BUGREPORT='http://bugzilla.redhat.com/' + +ac_unique_file="dsgwutil.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif +#if HAVE_STRINGS_H +# include +#endif +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP LIBOBJS POW_LIB HTTPD PKG_CONFIG ICU_CONFIG nspr_inc nspr_lib nss_inc nss_lib ldapsdk_inc ldapsdk_lib adminutil_inc adminutil_lib adminutil_ver icu_lib icu_inc icu_bin cgibindir propertydir htmldir pbhtmldir configdir pbconfigdir contextdir securitydir cookiedir NEED_LDIF_TRUE NEED_LDIF_FALSE WINNT_TRUE WINNT_FALSE LTLIBOBJS' +ac_subst_files='' + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +ac_prev= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_option in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "enable_$ac_feature='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_confdir=`(dirname "$0") 2>/dev/null || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi +fi +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures dsgw 1.1 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +_ACEOF + + cat <<_ACEOF +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of dsgw 1.1:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-admserv=PATH Install DSGW with Admin Server - PATH is server root + --with-nspr=PATH Netscape Portable Runtime (NSPR) directory + --with-nspr-inc=PATH Netscape Portable Runtime (NSPR) include file directory + --with-nspr-lib=PATH Netscape Portable Runtime (NSPR) library directory + --with-nss=PATH Network Security Services (NSS) directory + --with-nss-inc=PATH Network Security Services (NSS) include directory + --with-nss-lib=PATH Network Security Services (NSS) library directory + --with-ldapsdk=PATH Mozilla LDAP SDK directory + --with-ldapsdk-inc=PATH Mozilla LDAP SDK include directory + --with-ldapsdk-lib=PATH Mozilla LDAP SDK library directory + --with-icu=PATH ICU directory + --with-icu-inc=PATH ICU include directory + --with-icu-lib=PATH ICU library directory + --with-icu-bin=PATH ICU binary directory + --with-adminutil=PATH Adminutil directory + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +_ACEOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d $ac_dir || continue + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_srcdir/configure.gnu; then + echo + $SHELL $ac_srcdir/configure.gnu --help=recursive + elif test -f $ac_srcdir/configure; then + echo + $SHELL $ac_srcdir/configure --help=recursive + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi + cd $ac_popdir + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\_ACEOF +dsgw configure 1.1 +generated by GNU Autoconf 2.59 + +Copyright (C) 2003 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit 0 +fi +exec 5>config.log +cat >&5 <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by dsgw $as_me 1.1, which was +generated by GNU Autoconf 2.59. Invocation command line was + + $ $0 $@ + +_ACEOF +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_sep= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------- ## +## Output files. ## +## ------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + sed "/^$/d" confdefs.h | sort + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ac_config_headers="$ac_config_headers config.h:config-h.in" + + +# this is a file that must be in the source dir + + +am__api_version="1.9" +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 +echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { (exit 1); exit 1; }; } +fi +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done + + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&2;} + { (exit 1); exit 1; }; } + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +test "$program_prefix" != NONE && + program_transform_name="s,^,$program_prefix,;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$,$program_suffix,;$program_transform_name" +# Double any \ or $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm conftest.sed + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 +echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # We used to keeping the `.' as first argument, in order to + # allow $(mkdir_p) to be used without argument. As in + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. However this is wrong + # for two reasons: + # 1. if the package is installed by a user who cannot write `.' + # make install will fail, + # 2. the above comment should most certainly read + # $(mkdir_p) $(DESTDIR)$(somedir) + # so it does not work when $(somedir) is undefined and + # $(DESTDIR) is not. + # To support the latter case, we have to write + # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), + # so the `.' trick is pointless. + mkdir_p='mkdir -p --' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +fi + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$AWK" && break +done + +echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +all: + @echo 'ac_maketemp="$(MAKE)"' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftest.make +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SET_MAKE= +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='dsgw' + VERSION='1.1' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +install_sh=${install_sh-"$am_aux_dir/install-sh"} + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + STRIP=$ac_ct_STRIP +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' + + + + + + +# Checks for programs. +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; + * ) + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cc_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std1 is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std1. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +DEPDIR="${am__leading_dot}deps" + + ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi + + +echo "$as_me:$LINENO: result: $_am_result" >&5 +echo "${ECHO_T}$_am_result" >&6 +rm -f confinc confmf + +# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then + enableval="$enable_dependency_tracking" + +fi; +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + + +if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + + +depcc="$CC" am_compiler_list= + +echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + + +if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done + + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +# Checks for libraries. +# FIXME: Replace `main' with a function in `-lc': + + +echo "$as_me:$LINENO: checking for main in -lc" >&5 +echo $ECHO_N "checking for main in -lc... $ECHO_C" >&6 +if test "${ac_cv_lib_c_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lc $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_c_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_c_main=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_c_main" >&5 +echo "${ECHO_T}$ac_cv_lib_c_main" >&6 +if test $ac_cv_lib_c_main = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBC 1 +_ACEOF + + LIBS="-lc $LIBS" + +fi + +# FIXME: Replace `main' with a function in `-lcrypt': + +echo "$as_me:$LINENO: checking for main in -lcrypt" >&5 +echo $ECHO_N "checking for main in -lcrypt... $ECHO_C" >&6 +if test "${ac_cv_lib_crypt_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypt $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_crypt_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_crypt_main=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_crypt_main" >&5 +echo "${ECHO_T}$ac_cv_lib_crypt_main" >&6 +if test $ac_cv_lib_crypt_main = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBCRYPT 1 +_ACEOF + + LIBS="-lcrypt $LIBS" + +fi + +# FIXME: Replace `main' with a function in `-lcxx': + +echo "$as_me:$LINENO: checking for main in -lcxx" >&5 +echo $ECHO_N "checking for main in -lcxx... $ECHO_C" >&6 +if test "${ac_cv_lib_cxx_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcxx $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_cxx_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_cxx_main=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_cxx_main" >&5 +echo "${ECHO_T}$ac_cv_lib_cxx_main" >&6 +if test $ac_cv_lib_cxx_main = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBCXX 1 +_ACEOF + + LIBS="-lcxx $LIBS" + +fi + +# FIXME: Replace `main' with a function in `-lm': + +echo "$as_me:$LINENO: checking for main in -lm" >&5 +echo $ECHO_N "checking for main in -lm... $ECHO_C" >&6 +if test "${ac_cv_lib_m_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_m_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_m_main=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_m_main" >&5 +echo "${ECHO_T}$ac_cv_lib_m_main" >&6 +if test $ac_cv_lib_m_main = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBM 1 +_ACEOF + + LIBS="-lm $LIBS" + +fi + +# FIXME: Replace `main' with a function in `-lpthread': + +echo "$as_me:$LINENO: checking for main in -lpthread" >&5 +echo $ECHO_N "checking for main in -lpthread... $ECHO_C" >&6 +if test "${ac_cv_lib_pthread_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_pthread_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_pthread_main=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_main" >&5 +echo "${ECHO_T}$ac_cv_lib_pthread_main" >&6 +if test $ac_cv_lib_pthread_main = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBPTHREAD 1 +_ACEOF + + LIBS="-lpthread $LIBS" + +fi + +# FIXME: Replace `main' with a function in `-lw': + +echo "$as_me:$LINENO: checking for main in -lw" >&5 +echo $ECHO_N "checking for main in -lw... $ECHO_C" >&6 +if test "${ac_cv_lib_w_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lw $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_w_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_w_main=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_w_main" >&5 +echo "${ECHO_T}$ac_cv_lib_w_main" >&6 +if test $ac_cv_lib_w_main = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBW 1 +_ACEOF + + LIBS="-lw $LIBS" + +fi + + +# Checks for header files. +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep + + +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + + + + + + + + + +for ac_header in fcntl.h limits.h stdlib.h string.h strings.h sys/file.h sys/param.h sys/socket.h sys/time.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to http://bugzilla.redhat.com/ ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +# Checks for typedefs, structures, and compiler characteristics. +echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 +if test "${ac_cv_c_const+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset x; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *ccp; + char **p; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + ccp = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++ccp; + p = (char**) ccp; + ccp = (char const *const *) p; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + } +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_const=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_c_const=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +echo "${ECHO_T}$ac_cv_c_const" >&6 +if test $ac_cv_c_const = no; then + +cat >>confdefs.h <<\_ACEOF +#define const +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5 +echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6 +if test "${ac_cv_header_stdbool_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#ifndef bool +# error bool is not defined +#endif +#ifndef false +# error false is not defined +#endif +#if false +# error false is not 0 +#endif +#ifndef true +# error true is not defined +#endif +#if true != 1 +# error true is not 1 +#endif +#ifndef __bool_true_false_are_defined +# error __bool_true_false_are_defined is not defined +#endif + + struct s { _Bool s: 1; _Bool t; } s; + + char a[true == 1 ? 1 : -1]; + char b[false == 0 ? 1 : -1]; + char c[__bool_true_false_are_defined == 1 ? 1 : -1]; + char d[(bool) -0.5 == true ? 1 : -1]; + bool e = &s; + char f[(_Bool) -0.0 == false ? 1 : -1]; + char g[true]; + char h[sizeof (_Bool)]; + char i[sizeof s.t]; + +int +main () +{ + return !a + !b + !c + !d + !e + !f + !g + !h + !i; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_stdbool_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdbool_h=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5 +echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6 +echo "$as_me:$LINENO: checking for _Bool" >&5 +echo $ECHO_N "checking for _Bool... $ECHO_C" >&6 +if test "${ac_cv_type__Bool+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((_Bool *) 0) + return 0; +if (sizeof (_Bool)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type__Bool=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type__Bool=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5 +echo "${ECHO_T}$ac_cv_type__Bool" >&6 +if test $ac_cv_type__Bool = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE__BOOL 1 +_ACEOF + + +fi + +if test $ac_cv_header_stdbool_h = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_STDBOOL_H 1 +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for size_t" >&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6 +if test "${ac_cv_type_size_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((size_t *) 0) + return 0; +if (sizeof (size_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_size_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_size_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +echo "${ECHO_T}$ac_cv_type_size_t" >&6 +if test $ac_cv_type_size_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned +_ACEOF + +fi + +echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 +echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 +if test "${ac_cv_header_time+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include + +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_time=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_time=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 +echo "${ECHO_T}$ac_cv_header_time" >&6 +if test $ac_cv_header_time = yes; then + +cat >>confdefs.h <<\_ACEOF +#define TIME_WITH_SYS_TIME 1 +_ACEOF + +fi + +echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 +echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6 +if test "${ac_cv_struct_tm+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +int +main () +{ +struct tm *tp; tp->tm_sec; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_struct_tm=time.h +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_struct_tm=sys/time.h +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 +echo "${ECHO_T}$ac_cv_struct_tm" >&6 +if test $ac_cv_struct_tm = sys/time.h; then + +cat >>confdefs.h <<\_ACEOF +#define TM_IN_SYS_TIME 1 +_ACEOF + +fi + + +# Checks for library functions. + +for ac_header in stdlib.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to http://bugzilla.redhat.com/ ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 +echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6 +if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_malloc_0_nonnull=no +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#if STDC_HEADERS || HAVE_STDLIB_H +# include +#else +char *malloc (); +#endif + +int +main () +{ +exit (malloc (0) ? 0 : 1); + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_malloc_0_nonnull=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_func_malloc_0_nonnull=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 +echo "${ECHO_T}$ac_cv_func_malloc_0_nonnull" >&6 +if test $ac_cv_func_malloc_0_nonnull = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_MALLOC 1 +_ACEOF + +else + cat >>confdefs.h <<\_ACEOF +#define HAVE_MALLOC 0 +_ACEOF + + case $LIBOBJS in + "malloc.$ac_objext" | \ + *" malloc.$ac_objext" | \ + "malloc.$ac_objext "* | \ + *" malloc.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS malloc.$ac_objext" ;; +esac + + +cat >>confdefs.h <<\_ACEOF +#define malloc rpl_malloc +_ACEOF + +fi + + + +echo "$as_me:$LINENO: checking for working memcmp" >&5 +echo $ECHO_N "checking for working memcmp... $ECHO_C" >&6 +if test "${ac_cv_func_memcmp_working+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_memcmp_working=no +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* Some versions of memcmp are not 8-bit clean. */ + char c0 = 0x40, c1 = 0x80, c2 = 0x81; + if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) + exit (1); + + /* The Next x86 OpenStep bug shows up only when comparing 16 bytes + or more and with at least one buffer not starting on a 4-byte boundary. + William Lewis provided this test program. */ + { + char foo[21]; + char bar[21]; + int i; + for (i = 0; i < 4; i++) + { + char *a = foo + i; + char *b = bar + i; + strcpy (a, "--------01111111"); + strcpy (b, "--------10000000"); + if (memcmp (a, b, 16) >= 0) + exit (1); + } + exit (0); + } + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_memcmp_working=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_func_memcmp_working=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_func_memcmp_working" >&5 +echo "${ECHO_T}$ac_cv_func_memcmp_working" >&6 +test $ac_cv_func_memcmp_working = no && case $LIBOBJS in + "memcmp.$ac_objext" | \ + *" memcmp.$ac_objext" | \ + "memcmp.$ac_objext "* | \ + *" memcmp.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" ;; +esac + + + +for ac_header in stdlib.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to http://bugzilla.redhat.com/ ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +echo "$as_me:$LINENO: checking for GNU libc compatible realloc" >&5 +echo $ECHO_N "checking for GNU libc compatible realloc... $ECHO_C" >&6 +if test "${ac_cv_func_realloc_0_nonnull+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_realloc_0_nonnull=no +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#if STDC_HEADERS || HAVE_STDLIB_H +# include +#else +char *realloc (); +#endif + +int +main () +{ +exit (realloc (0, 0) ? 0 : 1); + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_realloc_0_nonnull=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_func_realloc_0_nonnull=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_func_realloc_0_nonnull" >&5 +echo "${ECHO_T}$ac_cv_func_realloc_0_nonnull" >&6 +if test $ac_cv_func_realloc_0_nonnull = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_REALLOC 1 +_ACEOF + +else + cat >>confdefs.h <<\_ACEOF +#define HAVE_REALLOC 0 +_ACEOF + + case $LIBOBJS in + "realloc.$ac_objext" | \ + *" realloc.$ac_objext" | \ + "realloc.$ac_objext "* | \ + *" realloc.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS realloc.$ac_objext" ;; +esac + + +cat >>confdefs.h <<\_ACEOF +#define realloc rpl_realloc +_ACEOF + +fi + + + + + +for ac_header in sys/select.h sys/socket.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to http://bugzilla.redhat.com/ ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +echo "$as_me:$LINENO: checking types of arguments for select" >&5 +echo $ECHO_N "checking types of arguments for select... $ECHO_C" >&6 +if test "${ac_cv_func_select_args+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + for ac_arg234 in 'fd_set *' 'int *' 'void *'; do + for ac_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do + for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#if HAVE_SYS_SELECT_H +# include +#endif +#if HAVE_SYS_SOCKET_H +# include +#endif + +int +main () +{ +extern int select ($ac_arg1, + $ac_arg234, $ac_arg234, $ac_arg234, + $ac_arg5); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_select_args="$ac_arg1,$ac_arg234,$ac_arg5"; break 3 +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done + done +done +# Provide a safe default value. +: ${ac_cv_func_select_args='int,int *,struct timeval *'} + +fi +echo "$as_me:$LINENO: result: $ac_cv_func_select_args" >&5 +echo "${ECHO_T}$ac_cv_func_select_args" >&6 +ac_save_IFS=$IFS; IFS=',' +set dummy `echo "$ac_cv_func_select_args" | sed 's/\*/\*/g'` +IFS=$ac_save_IFS +shift + +cat >>confdefs.h <<_ACEOF +#define SELECT_TYPE_ARG1 $1 +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define SELECT_TYPE_ARG234 ($2) +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define SELECT_TYPE_ARG5 ($3) +_ACEOF + +rm -f conftest* + +echo "$as_me:$LINENO: checking whether lstat dereferences a symlink specified with a trailing slash" >&5 +echo $ECHO_N "checking whether lstat dereferences a symlink specified with a trailing slash... $ECHO_C" >&6 +if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + rm -f conftest.sym conftest.file +echo >conftest.file +if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then + if test "$cross_compiling" = yes; then + ac_cv_func_lstat_dereferences_slashed_symlink=no +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +struct stat sbuf; + /* Linux will dereference the symlink and fail. + That is better in the sense that it means we will not + have to compile and use the lstat wrapper. */ + exit (lstat ("conftest.sym/", &sbuf) ? 0 : 1); + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_lstat_dereferences_slashed_symlink=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_func_lstat_dereferences_slashed_symlink=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +else + # If the `ln -s' command failed, then we probably don't even + # have an lstat function. + ac_cv_func_lstat_dereferences_slashed_symlink=no +fi +rm -f conftest.sym conftest.file + +fi +echo "$as_me:$LINENO: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5 +echo "${ECHO_T}$ac_cv_func_lstat_dereferences_slashed_symlink" >&6 + +test $ac_cv_func_lstat_dereferences_slashed_symlink = yes && + +cat >>confdefs.h <<_ACEOF +#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1 +_ACEOF + + +if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then + case $LIBOBJS in + "lstat.$ac_objext" | \ + *" lstat.$ac_objext" | \ + "lstat.$ac_objext "* | \ + *" lstat.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS lstat.$ac_objext" ;; +esac + +fi + +echo "$as_me:$LINENO: checking whether stat accepts an empty string" >&5 +echo $ECHO_N "checking whether stat accepts an empty string... $ECHO_C" >&6 +if test "${ac_cv_func_stat_empty_string_bug+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_stat_empty_string_bug=yes +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +struct stat sbuf; + exit (stat ("", &sbuf) ? 1 : 0); + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_stat_empty_string_bug=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_func_stat_empty_string_bug=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_func_stat_empty_string_bug" >&5 +echo "${ECHO_T}$ac_cv_func_stat_empty_string_bug" >&6 +if test $ac_cv_func_stat_empty_string_bug = yes; then + case $LIBOBJS in + "stat.$ac_objext" | \ + *" stat.$ac_objext" | \ + "stat.$ac_objext "* | \ + *" stat.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS stat.$ac_objext" ;; +esac + + +cat >>confdefs.h <<_ACEOF +#define HAVE_STAT_EMPTY_STRING_BUG 1 +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for working strtod" >&5 +echo $ECHO_N "checking for working strtod... $ECHO_C" >&6 +if test "${ac_cv_func_strtod+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_strtod=no +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +double strtod (); +int +main() +{ + { + /* Some versions of Linux strtod mis-parse strings with leading '+'. */ + char *string = " +69"; + char *term; + double value; + value = strtod (string, &term); + if (value != 69 || term != (string + 4)) + exit (1); + } + + { + /* Under Solaris 2.4, strtod returns the wrong value for the + terminating character under some conditions. */ + char *string = "NaN"; + char *term; + strtod (string, &term); + if (term != string && *(term - 1) == 0) + exit (1); + } + exit (0); +} + +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_strtod=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_func_strtod=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_func_strtod" >&5 +echo "${ECHO_T}$ac_cv_func_strtod" >&6 +if test $ac_cv_func_strtod = no; then + case $LIBOBJS in + "strtod.$ac_objext" | \ + *" strtod.$ac_objext" | \ + "strtod.$ac_objext "* | \ + *" strtod.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS strtod.$ac_objext" ;; +esac + +echo "$as_me:$LINENO: checking for pow" >&5 +echo $ECHO_N "checking for pow... $ECHO_C" >&6 +if test "${ac_cv_func_pow+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define pow to an innocuous variant, in case declares pow. + For example, HP-UX 11i declares gettimeofday. */ +#define pow innocuous_pow + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char pow (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef pow + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char pow (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_pow) || defined (__stub___pow) +choke me +#else +char (*f) () = pow; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != pow; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_pow=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_pow=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_pow" >&5 +echo "${ECHO_T}$ac_cv_func_pow" >&6 + +if test $ac_cv_func_pow = no; then + echo "$as_me:$LINENO: checking for pow in -lm" >&5 +echo $ECHO_N "checking for pow in -lm... $ECHO_C" >&6 +if test "${ac_cv_lib_m_pow+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char pow (); +int +main () +{ +pow (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_m_pow=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_m_pow=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_m_pow" >&5 +echo "${ECHO_T}$ac_cv_lib_m_pow" >&6 +if test $ac_cv_lib_m_pow = yes; then + POW_LIB=-lm +else + { echo "$as_me:$LINENO: WARNING: cannot find library containing definition of pow" >&5 +echo "$as_me: WARNING: cannot find library containing definition of pow" >&2;} +fi + +fi + +fi + + +for ac_func in vprintf +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +echo "$as_me:$LINENO: checking for _doprnt" >&5 +echo $ECHO_N "checking for _doprnt... $ECHO_C" >&6 +if test "${ac_cv_func__doprnt+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define _doprnt to an innocuous variant, in case declares _doprnt. + For example, HP-UX 11i declares gettimeofday. */ +#define _doprnt innocuous__doprnt + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char _doprnt (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef _doprnt + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char _doprnt (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub__doprnt) || defined (__stub____doprnt) +choke me +#else +char (*f) () = _doprnt; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != _doprnt; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func__doprnt=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func__doprnt=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5 +echo "${ECHO_T}$ac_cv_func__doprnt" >&6 +if test $ac_cv_func__doprnt = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_DOPRNT 1 +_ACEOF + +fi + +fi +done + + + + + + + + + + + + + + + + + + +for ac_func in ftruncate getcwd isascii localtime_r memmove memset select strcasecmp strchr strdup strerror strncasecmp strpbrk strrchr strstr strtoul +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +# Check for web server +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2006 Red Hat, Inc. +# All rights reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# END COPYRIGHT BLOCK + + +# Check whether --with-admserv or --without-admserv was given. +if test "${with_admserv+set}" = set; then + withval="$with_admserv" + + if test "$withval" + then + echo "$as_me:$LINENO: result: using $withval" >&5 +echo "${ECHO_T}using $withval" >&6 + HAVE_ADMSERV=1 + basedir="$withval/clients/dsgw" + htmldir="$basedir/html" + pbhtmldir="$basedir/pbhtml" + configdir="$basedir/config" + pbconfigdir="$basedir/pbconfig" + contextdir="$basedir/context" + cgibindir="$basedir/bin" + propertydir=$contextdir + securitydir=$contextdir + manualuri="/manual" + cgiuri="/clients/dsgw/bin/" + cookiedir="$basedir/cookies" + else + echo + { { echo "$as_me:$LINENO: error: $withval not found" >&5 +echo "$as_me: error: $withval not found" >&2;} + { (exit 1); exit 1; }; } + fi + +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi; + +if test -z "$HAVE_ADMSERV" ; then + # Extract the first word of "httpd", so it can be a program name with args. +set dummy httpd; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_HTTPD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $HTTPD in + [\\/]* | ?:[\\/]*) + ac_cv_path_HTTPD="$HTTPD" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/opt/hpws/apache/bin:/usr/local/apache/sbin:/usr/local/apache2/sbin:/usr/sbin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_HTTPD="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +HTTPD=$ac_cv_path_HTTPD + +if test -n "$HTTPD"; then + echo "$as_me:$LINENO: result: $HTTPD" >&5 +echo "${ECHO_T}$HTTPD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + if test -z "$HTTPD" -o ! -x "$HTTPD" ; then + { { echo "$as_me:$LINENO: error: Apache2 httpd server not found" >&5 +echo "$as_me: error: Apache2 httpd server not found" >&2;} + { (exit 1); exit 1; }; } + fi + + httpd_root=`$HTTPD -V | grep HTTPD_ROOT | cut -f2 -d=` + httpd_root=`eval echo $httpd_root` + httpd_conf_rel=`$HTTPD -V | grep SERVER_CONFIG_FILE | cut -f2 -d=` + httpd_conf_rel=`eval echo $httpd_conf_rel` + + httpd_conf=${httpd_root}/${httpd_conf_rel} + + htmlbasedir=`grep \^DocumentRoot $httpd_conf|awk '{print $2}'` + htmlbasedir=`eval echo $htmlbasedir` + # these directories are html based + htmldir="$htmlbasedir/dsgw/html" + pbhtmldir="$htmlbasedir/dsgw/pbhtml" + configdir="$htmlbasedir/dsgw/config" + pbconfigdir="$htmlbasedir/dsgw/pbconfig" + manualuri="/dirsvr/manual" + + # CGI program directory + cgibindir=`grep '^ScriptAlias.*/cgi-bin/' $httpd_conf|awk '{print $3}'` + cgibindir=`eval echo $cgibindir` + cgiuri=`grep '^ScriptAlias.*/cgi-bin/' $httpd_conf|awk '{print $2}'` + + # configuration files and etc. + contextdir=/etc/dsgw + propertydir=$contextdir + securitydir=$contextdir + cookiedir=/var/run/dsgw/cookies +fi + + +# Check for library dependencies +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2006 Red Hat, Inc. +# All rights reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# END COPYRIGHT BLOCK + +{ echo "$as_me:$LINENO: checking for NSPR..." >&5 +echo "$as_me: checking for NSPR..." >&6;} + +# check for --with-nspr +echo "$as_me:$LINENO: checking for --with-nspr" >&5 +echo $ECHO_N "checking for --with-nspr... $ECHO_C" >&6 + +# Check whether --with-nspr or --without-nspr was given. +if test "${with_nspr+set}" = set; then + withval="$with_nspr" + + if test -e "$withval"/include/nspr.h -a -d "$withval"/lib + then + echo "$as_me:$LINENO: result: using $withval" >&5 +echo "${ECHO_T}using $withval" >&6 + NSPRDIR=$withval + nspr_inc="-I$NSPRDIR/include" + nspr_lib="-L$NSPRDIR/lib" + else + echo + { { echo "$as_me:$LINENO: error: $withval not found" >&5 +echo "$as_me: error: $withval not found" >&2;} + { (exit 1); exit 1; }; } + fi + +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi; + +# check for --with-nspr-inc +echo "$as_me:$LINENO: checking for --with-nspr-inc" >&5 +echo $ECHO_N "checking for --with-nspr-inc... $ECHO_C" >&6 + +# Check whether --with-nspr-inc or --without-nspr-inc was given. +if test "${with_nspr_inc+set}" = set; then + withval="$with_nspr_inc" + + if test -e "$withval"/nspr.h + then + echo "$as_me:$LINENO: result: using $withval" >&5 +echo "${ECHO_T}using $withval" >&6 + nspr_inc="-I$withval" + else + echo + { { echo "$as_me:$LINENO: error: $withval not found" >&5 +echo "$as_me: error: $withval not found" >&2;} + { (exit 1); exit 1; }; } + fi + +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi; + +# check for --with-nspr-lib +echo "$as_me:$LINENO: checking for --with-nspr-lib" >&5 +echo $ECHO_N "checking for --with-nspr-lib... $ECHO_C" >&6 + +# Check whether --with-nspr-lib or --without-nspr-lib was given. +if test "${with_nspr_lib+set}" = set; then + withval="$with_nspr_lib" + + if test -d "$withval" + then + echo "$as_me:$LINENO: result: using $withval" >&5 +echo "${ECHO_T}using $withval" >&6 + nspr_lib="-L$withval" + else + echo + { { echo "$as_me:$LINENO: error: $withval not found" >&5 +echo "$as_me: error: $withval not found" >&2;} + { (exit 1); exit 1; }; } + fi + +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi; + +# if NSPR is not found yet, try pkg-config + +# last resort +if test -z "$nspr_inc" -o -z "$nspr_lib"; then + echo "$as_me:$LINENO: checking for nspr with pkg-config" >&5 +echo $ECHO_N "checking for nspr with pkg-config... $ECHO_C" >&6 + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG + +if test -n "$PKG_CONFIG"; then + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + if test -n "$PKG_CONFIG"; then + if $PKG_CONFIG --exists nspr; then + nspr_inc=`$PKG_CONFIG --cflags-only-I nspr` + nspr_lib=`$PKG_CONFIG --libs-only-L nspr` + else + { { echo "$as_me:$LINENO: error: NSPR not found, specify with --with-nspr." >&5 +echo "$as_me: error: NSPR not found, specify with --with-nspr." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi + +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2006 Red Hat, Inc. +# All rights reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# END COPYRIGHT BLOCK + +{ echo "$as_me:$LINENO: checking for NSS..." >&5 +echo "$as_me: checking for NSS..." >&6;} + +# check for --with-nss +echo "$as_me:$LINENO: checking for --with-nss" >&5 +echo $ECHO_N "checking for --with-nss... $ECHO_C" >&6 + +# Check whether --with-nss or --without-nss was given. +if test "${with_nss+set}" = set; then + withval="$with_nss" + + if test -e "$withval"/include/nss.h -a -d "$withval"/lib + then + echo "$as_me:$LINENO: result: using $withval" >&5 +echo "${ECHO_T}using $withval" >&6 + NSSDIR=$withval + nss_inc="-I$NSSDIR/include" + nss_lib="-L$NSSDIR/lib" + else + echo + { { echo "$as_me:$LINENO: error: $withval not found" >&5 +echo "$as_me: error: $withval not found" >&2;} + { (exit 1); exit 1; }; } + fi + +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi; + +# check for --with-nss-inc +echo "$as_me:$LINENO: checking for --with-nss-inc" >&5 +echo $ECHO_N "checking for --with-nss-inc... $ECHO_C" >&6 + +# Check whether --with-nss-inc or --without-nss-inc was given. +if test "${with_nss_inc+set}" = set; then + withval="$with_nss_inc" + + if test -e "$withval"/nss.h + then + echo "$as_me:$LINENO: result: using $withval" >&5 +echo "${ECHO_T}using $withval" >&6 + nss_inc="-I$withval" + else + echo + { { echo "$as_me:$LINENO: error: $withval not found" >&5 +echo "$as_me: error: $withval not found" >&2;} + { (exit 1); exit 1; }; } + fi + +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi; + +# check for --with-nss-lib +echo "$as_me:$LINENO: checking for --with-nss-lib" >&5 +echo $ECHO_N "checking for --with-nss-lib... $ECHO_C" >&6 + +# Check whether --with-nss-lib or --without-nss-lib was given. +if test "${with_nss_lib+set}" = set; then + withval="$with_nss_lib" + + if test -d "$withval" + then + echo "$as_me:$LINENO: result: using $withval" >&5 +echo "${ECHO_T}using $withval" >&6 + nss_lib="-L$withval" + else + echo + { { echo "$as_me:$LINENO: error: $withval not found" >&5 +echo "$as_me: error: $withval not found" >&2;} + { (exit 1); exit 1; }; } + fi + +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi; + +# if NSS is not found yet, try pkg-config + +# last resort +if test -z "$nss_inc" -o -z "$nss_lib"; then + echo "$as_me:$LINENO: checking for nss with pkg-config" >&5 +echo $ECHO_N "checking for nss with pkg-config... $ECHO_C" >&6 + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG + +if test -n "$PKG_CONFIG"; then + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + if test -n "$PKG_CONFIG"; then + if $PKG_CONFIG --exists nss; then + nss_inc=`$PKG_CONFIG --cflags-only-I nss` + nss_lib=`$PKG_CONFIG --libs-only-L nss` + else + { { echo "$as_me:$LINENO: error: NSS not found, specify with --with-nss." >&5 +echo "$as_me: error: NSS not found, specify with --with-nss." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi + +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2006 Red Hat, Inc. +# All rights reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# END COPYRIGHT BLOCK + +{ echo "$as_me:$LINENO: checking for LDAPSDK..." >&5 +echo "$as_me: checking for LDAPSDK..." >&6;} + +# check for --with-ldapsdk +echo "$as_me:$LINENO: checking for --with-ldapsdk" >&5 +echo $ECHO_N "checking for --with-ldapsdk... $ECHO_C" >&6 + +# Check whether --with-ldapsdk or --without-ldapsdk was given. +if test "${with_ldapsdk+set}" = set; then + withval="$with_ldapsdk" + + if test -e "$withval"/include/ldap.h -a -d "$withval"/lib + then + echo "$as_me:$LINENO: result: using $withval" >&5 +echo "${ECHO_T}using $withval" >&6 + LDAPSDKDIR=$withval + ldapsdk_inc="-I$LDAPSDKDIR/include" + ldapsdk_lib="-L$LDAPSDKDIR/lib" + else + echo + { { echo "$as_me:$LINENO: error: $withval not found" >&5 +echo "$as_me: error: $withval not found" >&2;} + { (exit 1); exit 1; }; } + fi + +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi; + +# check for --with-ldapsdk-inc +echo "$as_me:$LINENO: checking for --with-ldapsdk-inc" >&5 +echo $ECHO_N "checking for --with-ldapsdk-inc... $ECHO_C" >&6 + +# Check whether --with-ldapsdk-inc or --without-ldapsdk-inc was given. +if test "${with_ldapsdk_inc+set}" = set; then + withval="$with_ldapsdk_inc" + + if test -e "$withval"/ldap.h + then + echo "$as_me:$LINENO: result: using $withval" >&5 +echo "${ECHO_T}using $withval" >&6 + ldapsdk_inc="-I$withval" + else + echo + { { echo "$as_me:$LINENO: error: $withval not found" >&5 +echo "$as_me: error: $withval not found" >&2;} + { (exit 1); exit 1; }; } + fi + +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi; + +# check for --with-ldapsdk-lib +echo "$as_me:$LINENO: checking for --with-ldapsdk-lib" >&5 +echo $ECHO_N "checking for --with-ldapsdk-lib... $ECHO_C" >&6 + +# Check whether --with-ldapsdk-lib or --without-ldapsdk-lib was given. +if test "${with_ldapsdk_lib+set}" = set; then + withval="$with_ldapsdk_lib" + + if test -d "$withval" + then + echo "$as_me:$LINENO: result: using $withval" >&5 +echo "${ECHO_T}using $withval" >&6 + ldapsdk_lib="-L$withval" + else + echo + { { echo "$as_me:$LINENO: error: $withval not found" >&5 +echo "$as_me: error: $withval not found" >&2;} + { (exit 1); exit 1; }; } + fi + +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi; + +# if LDAPSDK is not found yet, try pkg-config + +# last resort +if test -z "$ldapsdk_inc" -o -z "$ldapsdk_lib"; then + echo "$as_me:$LINENO: checking for mozldap with pkg-config" >&5 +echo $ECHO_N "checking for mozldap with pkg-config... $ECHO_C" >&6 + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG + +if test -n "$PKG_CONFIG"; then + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + if test -n "$PKG_CONFIG"; then + if $PKG_CONFIG --exists mozldap; then + nspr_inc=`$PKG_CONFIG --cflags-only-I mozldap` + nspr_lib=`$PKG_CONFIG --libs-only-L mozldap` + else + { { echo "$as_me:$LINENO: error: LDAPSDK not found, specify with --with-ldapsdk-inc|-lib." >&5 +echo "$as_me: error: LDAPSDK not found, specify with --with-ldapsdk-inc|-lib." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +if test -z "$ldapsdk_inc" -o -z "$ldapsdk_lib"; then + { { echo "$as_me:$LINENO: error: LDAPSDK not found, specify with --with-ldapsdk-inc|-lib." >&5 +echo "$as_me: error: LDAPSDK not found, specify with --with-ldapsdk-inc|-lib." >&2;} + { (exit 1); exit 1; }; } +fi + +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2006 Red Hat, Inc. +# All rights reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# END COPYRIGHT BLOCK + +{ echo "$as_me:$LINENO: checking for LIBICU..." >&5 +echo "$as_me: checking for LIBICU..." >&6;} + +# check for --with-icu +echo "$as_me:$LINENO: checking for --with-icu" >&5 +echo $ECHO_N "checking for --with-icu... $ECHO_C" >&6 + +# Check whether --with-icu or --without-icu was given. +if test "${with_icu+set}" = set; then + withval="$with_icu" + + if test -d "$withval"/lib + then + echo "$as_me:$LINENO: result: using $withval" >&5 +echo "${ECHO_T}using $withval" >&6 + ICUDIR=$withval + icu_lib="-L$ICUDIR/lib" + else + echo + { { echo "$as_me:$LINENO: error: $withval not found" >&5 +echo "$as_me: error: $withval not found" >&2;} + { (exit 1); exit 1; }; } + fi + icu_inc=$withval/include + icu_bin=$withval/bin + +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi; + +# check for --with-icu-inc +echo "$as_me:$LINENO: checking for --with-icu-inc" >&5 +echo $ECHO_N "checking for --with-icu-inc... $ECHO_C" >&6 + +# Check whether --with-icu-inc or --without-icu-inc was given. +if test "${with_icu_inc+set}" = set; then + withval="$with_icu_inc" + + if test -d "$withval" + then + echo "$as_me:$LINENO: result: using $withval" >&5 +echo "${ECHO_T}using $withval" >&6 + icu_inc="-I$withval" + else + echo + { { echo "$as_me:$LINENO: error: $withval not found" >&5 +echo "$as_me: error: $withval not found" >&2;} + { (exit 1); exit 1; }; } + fi + +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi; + +# check for --with-icu-lib +echo "$as_me:$LINENO: checking for --with-icu-lib" >&5 +echo $ECHO_N "checking for --with-icu-lib... $ECHO_C" >&6 + +# Check whether --with-icu-lib or --without-icu-lib was given. +if test "${with_icu_lib+set}" = set; then + withval="$with_icu_lib" + + if test -d "$withval" + then + echo "$as_me:$LINENO: result: using $withval" >&5 +echo "${ECHO_T}using $withval" >&6 + icu_lib="-L$withval" + else + echo + { { echo "$as_me:$LINENO: error: $withval not found" >&5 +echo "$as_me: error: $withval not found" >&2;} + { (exit 1); exit 1; }; } + fi + +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi; + +# check for --with-icu-bin +echo "$as_me:$LINENO: checking for --with-icu-bin" >&5 +echo $ECHO_N "checking for --with-icu-bin... $ECHO_C" >&6 + +# Check whether --with-icu-bin or --without-icu-bin was given. +if test "${with_icu_bin+set}" = set; then + withval="$with_icu_bin" + + if test -d "$withval" + then + echo "$as_me:$LINENO: result: using $withval" >&5 +echo "${ECHO_T}using $withval" >&6 + icu_bin="$withval" + else + echo + { { echo "$as_me:$LINENO: error: $withval not found" >&5 +echo "$as_me: error: $withval not found" >&2;} + { (exit 1); exit 1; }; } + fi + +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi; +# if not found yet, try pkg-config + +# last resort +if test -z "$icu_lib"; then + echo "$as_me:$LINENO: checking for icu with icu-config" >&5 +echo $ECHO_N "checking for icu with icu-config... $ECHO_C" >&6 + # Extract the first word of "icu-config", so it can be a program name with args. +set dummy icu-config; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_ICU_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $ICU_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ICU_CONFIG="$ICU_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ICU_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +ICU_CONFIG=$ac_cv_path_ICU_CONFIG + +if test -n "$ICU_CONFIG"; then + echo "$as_me:$LINENO: result: $ICU_CONFIG" >&5 +echo "${ECHO_T}$ICU_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + if test -n "$ICU_CONFIG"; then + icu_lib=`$ICU_CONFIG --ldflags-searchpath` + icu_inc=`$ICU_CONFIG --cppflags-searchpath` + icu_bin=`$ICU_CONFIG --bindir` + else + { { echo "$as_me:$LINENO: error: ICU not found, specify with --with-icu." >&5 +echo "$as_me: error: ICU not found, specify with --with-icu." >&2;} + { (exit 1); exit 1; }; } + fi +fi + +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2006 Red Hat, Inc. +# All rights reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# END COPYRIGHT BLOCK + +{ echo "$as_me:$LINENO: checking for ADMINUTIL..." >&5 +echo "$as_me: checking for ADMINUTIL..." >&6;} + +# check for --with-adminutil +echo "$as_me:$LINENO: checking for --with-adminutil" >&5 +echo $ECHO_N "checking for --with-adminutil... $ECHO_C" >&6 + +# Check whether --with-adminutil or --without-adminutil was given. +if test "${with_adminutil+set}" = set; then + withval="$with_adminutil" + + if test -d "$withval"/include -a -d "$withval"/lib + then + echo "$as_me:$LINENO: result: using $withval" >&5 +echo "${ECHO_T}using $withval" >&6 + ADMINUTILDIR=$withval + adminutil_lib="-L$ADMINUTILDIR/lib" + # check for version - only needed for older adminutil versions + for file in $ADMINUTILDIR/lib/* ; do + echo $file | grep 'libadminutil[0-9][0-9]' && adminutil_ver=`echo $file | sed -e 's/.*libadminutil\([0-9][0-9]\).*/\1/'` ; break + done + # use the latest one + adminutil_incdir=`ls -1d $ADMINUTILDIR/include/adminutil-* | sort -n | tail -1` + if ! test -n "$adminutil_incdir" -a -d "$adminutil_incdir" ; then + adminutil_incdir=$ADMINUTILDIR/include + fi + if ! test -e "$adminutil_incdir/libadminutil/admutil.h" ; then + { { echo "$as_me:$LINENO: error: $withval include dir not found" >&5 +echo "$as_me: error: $withval include dir not found" >&2;} + { (exit 1); exit 1; }; } + fi + adminutil_inc="-I$adminutil_incdir" + else + echo + { { echo "$as_me:$LINENO: error: $withval not found" >&5 +echo "$as_me: error: $withval not found" >&2;} + { (exit 1); exit 1; }; } + fi + +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi; + +# if ADMINUTIL is not found yet, try pkg-config + +# last resort +if test -z "$adminutil_inc" -o -z "$adminutil_lib"; then + echo "$as_me:$LINENO: checking for adminutil with pkg-config" >&5 +echo $ECHO_N "checking for adminutil with pkg-config... $ECHO_C" >&6 + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG + +if test -n "$PKG_CONFIG"; then + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + if test -n "$PKG_CONFIG"; then + if $PKG_CONFIG --exists adminutil; then + adminutil_inc=`$PKG_CONFIG --cflags-only-I adminutil` + adminutil_lib=`$PKG_CONFIG --libs-only-L adminutil` + else + { { echo "$as_me:$LINENO: error: ADMINUTIL not found, specify with --with-adminutil." >&5 +echo "$as_me: error: ADMINUTIL not found, specify with --with-adminutil." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi + +if test -z "$adminutil_inc" -o -z "$adminutil_lib"; then + { { echo "$as_me:$LINENO: error: ADMINUTIL not found, specify with --with-adminutil." >&5 +echo "$as_me: error: ADMINUTIL not found, specify with --with-adminutil." >&2;} + { (exit 1); exit 1; }; } +fi + + +# write out paths for binary components + + + + + + + + + + + + + +# write out paths for data/config files + + + + + + + + + + +# need a check here to see if the ldif functions are exported from libldap +# for now, just assume they are not + + +if true; then + NEED_LDIF_TRUE= + NEED_LDIF_FALSE='#' +else + NEED_LDIF_TRUE='#' + NEED_LDIF_FALSE= +fi + +# WINNT should be true if building on Windows system not using +# cygnus, mingw, or the like and using cmd.exe as the shell + + +if false; then + WINNT_TRUE= + WINNT_FALSE='#' +else + WINNT_TRUE='#' + WINNT_FALSE= +fi + + + ac_config_files="$ac_config_files Makefile setup" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${NEED_LDIF_TRUE}" && test -z "${NEED_LDIF_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"NEED_LDIF\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"NEED_LDIF\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${WINNT_TRUE}" && test -z "${WINNT_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"WINNT\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"WINNT\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + +exec 6>&1 + +# Open the log real soon, to keep \$[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + +This file was extended by dsgw $as_me 1.1, which was +generated by GNU Autoconf 2.59. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\_ACEOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +dsgw config.status 1.1 +configured by $0, generated by GNU Autoconf 2.59, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2003 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." +srcdir=$srcdir +INSTALL="$INSTALL" +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_shift=: + ;; + -*) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; + esac + + case $ac_option in + # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +# +# INIT-COMMANDS section. +# + +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF + + + +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "setup" ) CONFIG_FILES="$CONFIG_FILES setup" ;; + "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config-h.in" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF + +# +# CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@CYGPATH_W@,$CYGPATH_W,;t t +s,@PACKAGE@,$PACKAGE,;t t +s,@VERSION@,$VERSION,;t t +s,@ACLOCAL@,$ACLOCAL,;t t +s,@AUTOCONF@,$AUTOCONF,;t t +s,@AUTOMAKE@,$AUTOMAKE,;t t +s,@AUTOHEADER@,$AUTOHEADER,;t t +s,@MAKEINFO@,$MAKEINFO,;t t +s,@install_sh@,$install_sh,;t t +s,@STRIP@,$STRIP,;t t +s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t +s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t +s,@mkdir_p@,$mkdir_p,;t t +s,@AWK@,$AWK,;t t +s,@SET_MAKE@,$SET_MAKE,;t t +s,@am__leading_dot@,$am__leading_dot,;t t +s,@AMTAR@,$AMTAR,;t t +s,@am__tar@,$am__tar,;t t +s,@am__untar@,$am__untar,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@DEPDIR@,$DEPDIR,;t t +s,@am__include@,$am__include,;t t +s,@am__quote@,$am__quote,;t t +s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t +s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t +s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t +s,@CCDEPMODE@,$CCDEPMODE,;t t +s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t +s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t +s,@CPP@,$CPP,;t t +s,@EGREP@,$EGREP,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@POW_LIB@,$POW_LIB,;t t +s,@HTTPD@,$HTTPD,;t t +s,@PKG_CONFIG@,$PKG_CONFIG,;t t +s,@ICU_CONFIG@,$ICU_CONFIG,;t t +s,@nspr_inc@,$nspr_inc,;t t +s,@nspr_lib@,$nspr_lib,;t t +s,@nss_inc@,$nss_inc,;t t +s,@nss_lib@,$nss_lib,;t t +s,@ldapsdk_inc@,$ldapsdk_inc,;t t +s,@ldapsdk_lib@,$ldapsdk_lib,;t t +s,@adminutil_inc@,$adminutil_inc,;t t +s,@adminutil_lib@,$adminutil_lib,;t t +s,@adminutil_ver@,$adminutil_ver,;t t +s,@icu_lib@,$icu_lib,;t t +s,@icu_inc@,$icu_inc,;t t +s,@icu_bin@,$icu_bin,;t t +s,@cgibindir@,$cgibindir,;t t +s,@propertydir@,$propertydir,;t t +s,@htmldir@,$htmldir,;t t +s,@pbhtmldir@,$pbhtmldir,;t t +s,@configdir@,$configdir,;t t +s,@pbconfigdir@,$pbconfigdir,;t t +s,@contextdir@,$contextdir,;t t +s,@securitydir@,$securitydir,;t t +s,@cookiedir@,$cookiedir,;t t +s,@NEED_LDIF_TRUE@,$NEED_LDIF_TRUE,;t t +s,@NEED_LDIF_FALSE@,$NEED_LDIF_FALSE,;t t +s,@WINNT_TRUE@,$WINNT_TRUE,;t t +s,@WINNT_FALSE@,$WINNT_FALSE,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t +CEOF + +_ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + esac + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@abs_srcdir@,$ac_abs_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t +s,@builddir@,$ac_builddir,;t t +s,@abs_builddir@,$ac_abs_builddir,;t t +s,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_HEADER section. +# + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' +ac_dC=' ' +ac_dD=',;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' +ac_uC=' ' +ac_uD=',;t' + +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + # Do quote $f, to prevent DOS paths from being IFS'd. + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + +_ACEOF + +# Transform confdefs.h into two sed scripts, `conftest.defines' and +# `conftest.undefs', that substitutes the proper values into +# config.h.in to produce config.h. The first handles `#define' +# templates, and the second `#undef' templates. +# And first: Protect against being on the right side of a sed subst in +# config.status. Protect against being in an unquoted here document +# in config.status. +rm -f conftest.defines conftest.undefs +# Using a here document instead of a string reduces the quoting nightmare. +# Putting comments in sed scripts is not portable. +# +# `end' is used to avoid that the second main sed command (meant for +# 0-ary CPP macros) applies to n-ary macro definitions. +# See the Autoconf documentation for `clear'. +cat >confdef2sed.sed <<\_ACEOF +s/[\\&,]/\\&/g +s,[\\$`],\\&,g +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp +t end +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp +: end +_ACEOF +# If some macros were called several times there might be several times +# the same #defines, which is useless. Nevertheless, we may not want to +# sort them, since we want the *last* AC-DEFINE to be honored. +uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines +sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs +rm -f confdef2sed.sed + +# This sed command replaces #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +cat >>conftest.undefs <<\_ACEOF +s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, +_ACEOF + +# Break up conftest.defines because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS +echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS +echo ' :' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.defines >/dev/null +do + # Write a limited-size here document to $tmp/defines.sed. + echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#define' lines. + echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/defines.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines +echo ' fi # grep' >>$CONFIG_STATUS +echo >>$CONFIG_STATUS + +# Break up conftest.undefs because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #undef templates' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.undefs >/dev/null +do + # Write a limited-size here document to $tmp/undefs.sed. + echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#undef' + echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/undefs.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail + rm -f conftest.undefs + mv conftest.tail conftest.undefs +done +rm -f conftest.undefs + +cat >>$CONFIG_STATUS <<\_ACEOF + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + echo "/* Generated by configure. */" >$tmp/config.h + else + echo "/* $ac_file. Generated by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + rm -f $tmp/in + if test x"$ac_file" != x-; then + if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + rm -f $ac_file + mv $tmp/config.h $ac_file + fi + else + cat $tmp/config.h + rm -f $tmp/config.h + fi +# Compute $ac_file's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $ac_file | $ac_file:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || +$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X$ac_file : 'X\(//\)[^/]' \| \ + X$ac_file : 'X\(//\)$' \| \ + X$ac_file : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X$ac_file | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'`/stamp-h$_am_stamp_count +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_COMMANDS section. +# +for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_dir=`(dirname "$ac_dest") 2>/dev/null || +$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_dest" : 'X\(//\)[^/]' \| \ + X"$ac_dest" : 'X\(//\)$' \| \ + X"$ac_dest" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_dest" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 +echo "$as_me: executing $ac_dest commands" >&6;} + case $ac_dest in + depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`(dirname "$mf") 2>/dev/null || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`(dirname "$file") 2>/dev/null || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p $dirpart/$fdir + else + as_dir=$dirpart/$fdir + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 +echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} + { (exit 1); exit 1; }; }; } + + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done + ;; + esac +done +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi + diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..4b73be4 --- /dev/null +++ b/configure.ac @@ -0,0 +1,116 @@ +# -*- Autoconf -*- +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2006 Red Hat, Inc. +# All rights reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# END COPYRIGHT BLOCK +# Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.59) + +AC_INIT([dsgw], [1.1], [http://bugzilla.redhat.com/]) + +AC_CONFIG_HEADERS([config.h:config-h.in]) + +# this is a file that must be in the source dir +AC_CONFIG_SRCDIR([dsgwutil.c]) + +AM_INIT_AUTOMAKE([1.9 foreign]) + +# Checks for programs. +AC_PROG_CC +AC_PROG_INSTALL + +# Checks for libraries. +# FIXME: Replace `main' with a function in `-lc': +AC_CHECK_LIB([c], [main]) +# FIXME: Replace `main' with a function in `-lcrypt': +AC_CHECK_LIB([crypt], [main]) +# FIXME: Replace `main' with a function in `-lcxx': +AC_CHECK_LIB([cxx], [main]) +# FIXME: Replace `main' with a function in `-lm': +AC_CHECK_LIB([m], [main]) +# FIXME: Replace `main' with a function in `-lpthread': +AC_CHECK_LIB([pthread], [main]) +# FIXME: Replace `main' with a function in `-lw': +AC_CHECK_LIB([w], [main]) + +# Checks for header files. +AC_HEADER_STDC +AC_CHECK_HEADERS([fcntl.h limits.h stdlib.h string.h strings.h sys/file.h sys/param.h sys/socket.h sys/time.h unistd.h]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_HEADER_STDBOOL +AC_TYPE_SIZE_T +AC_HEADER_TIME +AC_STRUCT_TM + +# Checks for library functions. +AC_FUNC_MALLOC +AC_FUNC_MEMCMP +AC_FUNC_REALLOC +AC_FUNC_SELECT_ARGTYPES +AC_FUNC_STAT +AC_FUNC_STRTOD +AC_FUNC_VPRINTF +AC_CHECK_FUNCS([ftruncate getcwd isascii localtime_r memmove memset select strcasecmp strchr strdup strerror strncasecmp strpbrk strrchr strstr strtoul]) + +# Check for web server +m4_include(m4/httpd.m4) + +# Check for library dependencies +m4_include(m4/nspr.m4) +m4_include(m4/nss.m4) +m4_include(m4/mozldap.m4) +m4_include(m4/icu.m4) +m4_include(m4/adminutil.m4) + +# write out paths for binary components +AC_SUBST(nspr_inc) +AC_SUBST(nspr_lib) +AC_SUBST(nss_inc) +AC_SUBST(nss_lib) +AC_SUBST(ldapsdk_inc) +AC_SUBST(ldapsdk_lib) +AC_SUBST(adminutil_inc) +AC_SUBST(adminutil_lib) +AC_SUBST(adminutil_ver) +AC_SUBST(icu_lib) +AC_SUBST(icu_inc) +AC_SUBST(icu_bin) + +# write out paths for data/config files +AC_SUBST(cgibindir) +AC_SUBST(propertydir) +AC_SUBST(htmldir) +AC_SUBST(pbhtmldir) +AC_SUBST(configdir) +AC_SUBST(pbconfigdir) +AC_SUBST(contextdir) +AC_SUBST(securitydir) +AC_SUBST(cookiedir) + +# need a check here to see if the ldif functions are exported from libldap +# for now, just assume they are not +AM_CONDITIONAL([NEED_LDIF], true) +# WINNT should be true if building on Windows system not using +# cygnus, mingw, or the like and using cmd.exe as the shell +AM_CONDITIONAL([WINNT], false) + +AC_CONFIG_FILES([Makefile setup]) +AC_OUTPUT diff --git a/cookie.c b/cookie.c new file mode 100644 index 0000000..da7d2a8 --- /dev/null +++ b/cookie.c @@ -0,0 +1,993 @@ +/** --- BEGIN COPYRIGHT BLOCK --- + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + --- END COPYRIGHT BLOCK --- */ +/* + * cookie.c -- routines to generate and manipulate cookies for dsgw + */ + +#include "dsgw.h" + +#include +#if !defined( XP_WIN32 ) +#include +#endif + +#include +#include "ecl-exp.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef _WIN32 +#include +#include +#include +#include +#include +#else /* _WIN32 */ +#include +#endif /* _WIN32 */ + +#include +#include +#include + + +static char *dsgw_MungeString(const char *unmunged_string); +static char *dsgw_UnMungeString(const char *munged_string); +static char *dsgw_encDec(CK_ATTRIBUTE_TYPE operation, const char *msg); +void dsgw_initNSS(void); + +static char tokDes[34] = "Communicator Generic Crypto Svcs"; +static char ptokDes[34] = "Internal (Software) Token "; + +int dsgw_NSSInitializedAlready = 0; + +/* Table for converting binary values to and from hexadecimal */ +static char hex[] = "0123456789abcdef"; + +#define CKLEN 32 +#define RNDBUFLEN ( CKLEN / 2 ) +#define CKBUFSIZ 255 +/* + * Given a buffer buf of length len, return a pointer to a string containing + * the hex-encoded version of buf. The caller is responsible for freeing + * the memory this routine allocates. + */ +static char * +buf2str( unsigned char *buf, int len ) +{ + char *obuf; + int i; + char *p; + + if ( buf == NULL ) { + return NULL; + } + + p = obuf = dsgw_ch_malloc( CKLEN + 1 ); + for ( i = 0; i < len; i++) { + *p++ = hex[( buf[ i ] >> 4 ) & 0xf ]; + *p++ = hex[( buf[ i ]) & 0xf ]; + } + *p++ = '\0'; + return obuf; +} + + + +/* + * Generate a random string of hex-encoded digits, CKLEN characters in + * length. This routine allocates memory which the caller is responsible + * for freeing. + */ +char * +dsgw_mkrndstr() +{ + unsigned char buf[ RNDBUFLEN ]; + + PK11_ConfigurePKCS11(NULL, NULL, tokDes, ptokDes, NULL, NULL, NULL, NULL, 0, 0 ); + /*NSS_NoDB_Init(NULL);*/ + dsgw_initNSS(); + PK11_GenerateRandom(buf, sizeof(buf)); + return( buf2str( buf, sizeof(buf) )); +} + + +FILE * +dsgw_opencookiedb() +{ + FILE *fp; + time_t now; + int newfile = 0; + char cdb[MAXPATHLEN]; /*DSGW_COOKIEDB_FNAME + context*/ + +#ifdef XP_WIN32 +#ifndef F_OK +#define F_OK 0 +#endif +#endif + PR_snprintf(cdb, sizeof(cdb), "%s.%s", DSGW_COOKIEDB_FNAME, context); + + if ( access( cdb, F_OK ) == 0 ) { + fp = fopen( cdb, "r+" ); + } else { + newfile = 1; + fp = fopen( cdb, "w" ); + } + if ( fp == NULL ) { + return NULL; + } + /* fseek( fp, 0L, SEEK_SET ); */ +#ifdef XP_WIN32 + (void) chmod( cdb, _S_IREAD | _S_IWRITE ); +#else + (void) chmod( cdb, S_IRUSR | S_IWUSR ); +#endif + + /* acquire a lock */ +#ifdef _WIN32 + while ( _locking( _fileno( fp ), LK_NBLCK, 0xFFFFFFFF ) != 0 ) { +#else +#ifdef USE_LOCKF + while ( lockf( fileno( fp ), F_LOCK, 0 ) != 0 ) { +#else /* _WIN32 */ + while ( flock( fileno( fp ), LOCK_EX ) != 0 ) { +#endif +#endif /* _WIN32 */ + ; /* NULL */ + } + if ( newfile ) { + time( &now ); + fprintf( fp, "lastpurge: %-20lu\n", now ); + fflush( fp ); + fseek( fp, 0L, SEEK_SET ); + } + return fp; +} + + +void +dsgw_closecookiedb( FILE *fp ) +{ +#ifdef _WIN32 + _locking( _fileno( fp ), LK_UNLCK, 0xFFFFFFFF ); +#else /* _WIN32 */ +#ifdef USE_LOCKF + lockf( fileno( fp ), F_ULOCK, 0 ); +#else + flock( fileno( fp ), LOCK_UN ); +#endif +#endif /* _WIN32 */ + fclose( fp ); +} + + + +/* + * Return a pointer to the password associated with the given + * cookie and dn. If the cookie was not found in the database, + * or if the cookie has expired, 1 is returned. On success, 0 is returned + * and ret_pw is set to the password from the database. As a side effect, + * if the database has not been purged of expired entries in more than + * 10 minutes, the database is purged. + * + * As a special case, if the cookie is expired and gc->gc_mode is + * DSGW_MODE_DOMODIFY (that is, the user is saving a modified entry), then + * return 0 if the cookie has been expired for no more than 5 minutes. + * This keeps users from being frustrated by getting an editable view of + * an entry and having the cookie expire while editing. + * The caller is responsible for freeing ret_pw. + */ +int +dsgw_ckdn2passwd( char *rndstr, char *dn, char **ret_pw ) +{ + FILE *fp; + char buf[ CKBUFSIZ ]; + char *p, *pw, *lifetimestr, *cdn; + time_t now; + int expired = 0; + + if ( !strcmp( rndstr, DSGW_UNAUTHSTR )) { + *ret_pw = NULL; + return 0; + } + + if (( fp = dsgw_opencookiedb()) == NULL ) { + return DSGW_CKDB_CANTOPEN; + } + + for (;;) { + if ( fgets( buf, sizeof(buf), fp ) == NULL ) { + dsgw_closecookiedb( fp ); +#ifdef DSGW_DEBUG + dsgw_log( "dsgw_ckdn2passwd: cookie <%s> not found in db\n", + rndstr ); +#endif + return DSGW_CKDB_KEY_NOT_PRESENT; + } + +#ifdef DSGW_DEBUG + dsgw_log( "dsgw_ckdn2passwd: retrieved buf from db: <%s>\n", buf ); +#endif + if ( buf[ strlen( buf ) - 1 ] == '\n' ) { + buf[ strlen( buf ) - 1 ] = '\0'; + } + + if ( strncmp( buf, rndstr, strlen( rndstr ))) { + continue; + } + + if (( p = strchr( buf, ':' )) == NULL ) { + dsgw_closecookiedb( fp ); +#ifdef DSGW_DEBUG + dsgw_log( "dsgw_ckdn2passwd: colon 1 missing\n" ); +#endif + return DSGW_CKDB_DBERROR; + } + *p++ = '\0'; + lifetimestr = p; + if (( p = strchr( lifetimestr, ':' )) == NULL ) { + dsgw_closecookiedb( fp ); +#ifdef DSGW_DEBUG + dsgw_log( "dsgw_ckdn2passwd: colon 2 missing\n" ); +#endif + return DSGW_CKDB_DBERROR; + } + *p++ = '\0'; + pw = p; + + if (( p = strchr( pw, ':' )) == NULL ) { + dsgw_closecookiedb( fp ); +#ifdef DSGW_DEBUG + dsgw_log( "dsgw_ckdn2passwd: colon 3 missing\n" ); +#endif + return DSGW_CKDB_DBERROR; + } + *p++ = '\0'; + cdn = p; + + if ( strcmp( dn, cdn )) { + dsgw_closecookiedb( fp ); +#ifdef DSGW_DEBUG + dsgw_log( "dsgw_ckdn2passwd: dn <%s> != cdn <%s>\n", dn, cdn ); +#endif + return DSGW_CKDB_KEY_NOT_PRESENT; + } + + /* expired? */ + time( &now ); + if ( gc->gc_mode == DSGW_MODE_DOMODIFY ) { + if ( now > ( atoi( lifetimestr ) + DSGW_MODIFY_GRACEPERIOD )) { + expired = 1; + } else { +#ifdef DSGW_DEBUG + dsgw_log( "dsgw_ckdn2passwd: cookie expired (%ld > %ld) but within domodify grace period\n", now, atoi( lifetimestr )); +#endif + } + } else if ( now > atoi( lifetimestr )) { + expired = 1; + } + + if ( expired != 0 ) { + dsgw_closecookiedb( fp ); +#ifdef DSGW_DEBUG + dsgw_log( "dsgw_ckdn2passwd: expired (%ld > %ld)\n", now, atoi( lifetimestr )); +#endif + return DSGW_CKDB_EXPIRED; + } + + *ret_pw = dsgw_UnMungeString( pw ); + dsgw_closecookiedb( fp ); + return ( *ret_pw == NULL ) ? 1 : 0; + } +} + + + +/* + * Store the given cookie and password into the database. The cookie + * is marked to expire at the time given by "expires". Returns 0 if + * successful, otherwise returns an error as given in dsgw.h. + * As a side effect, if the database has not been purged of expired + * entries in more than 10 minutes, the database is purged. + * + * Note: DNs are stored unescaped in the cookie database. Passwords + * are stored as "munged" values (encrypted using a hard-coded key and + * then converted to ASCII as described in RFC-1113) to make them a bit + * less obvious and to avoid problems which might arise from embedded ":" + * characters in the password (":" is the field separator in the database). + */ +int +dsgw_storecookie( char *rndstr, char *dn, char *password, time_t lifetime ) +{ + FILE *fp; + char *epw; + time_t now, lp; + + if (( fp = dsgw_opencookiedb()) == NULL ) { + return DSGW_CKDB_CANTOPEN; + } + + /* append record */ + if ( fseek( fp, 0L, SEEK_END ) < 0 ) { + return DSGW_CKDB_CANTAPPEND; + } + if (( epw = dsgw_MungeString( password )) == NULL ) { + return DSGW_CKDB_CANTAPPEND; /* error msg is close enough */ + } + + time( &now ); + if ( fprintf( fp, "%s:%lu:%s:%s\n", rndstr, lifetime + now, epw, dn ) + < 0 ) { + free( epw ); + return DSGW_CKDB_CANTAPPEND; + } + + fflush( fp ); + + dsgw_closecookiedb( fp ); + fp = dsgw_opencookiedb(); + lp = dsgw_getlastpurged( fp ); + dsgw_closecookiedb( fp ); + + if ( lp + DSGW_CKPURGEINTERVAL < now ) { + dsgw_purgedatabase( NULL ); + } +#ifdef DSGW_DEBUG + dsgw_log( "dsgw_storecookie: stored %s:%lu:%s:%s\n", rndstr, lifetime + now, epw, dn ); +#endif + free( epw ); + return 0; +} + + +/* + * Remove a cookie from the database. + * Format of cookie argument is "nsdsgwauth=cookie-string:escaped-dn" + */ +int +dsgw_delcookie( char *cookie ) +{ + FILE *fp; + char *rndstr, *dn, *dnp, *dbdn, *p; + char buf[ CKBUFSIZ ]; + int rc; + long buflen; + + /* Parse the given cookie - find the random string */ + if (( rndstr = strchr( cookie, '=' )) == NULL ) { + /* malformed cookie */ + return -1; + } else { + /* Get the escaped DN */ + rndstr++; + if (( dn = strchr( rndstr, ':' )) == NULL ) { + /* malformed cookie */ + return -1; + } else { + *dn++ = '\0'; + dsgw_form_unescape( dn ); + } + } + + /* + * Open the cookie database, find the rndstr, make sure the DNs + * match, and delete that entry if found. + */ + if (( fp = dsgw_opencookiedb()) == NULL ) { + return -1; + } + fgets( buf, sizeof(buf), fp ); + if ( strncmp( buf, "lastpurge:", 10 )) { + dsgw_closecookiedb( fp ); + return -1; + } + rc = DSGW_CKDB_KEY_NOT_PRESENT; + for (;;) { + if ( fgets( buf, sizeof(buf), fp ) == NULL ) { + break; + } + if ( strncmp( buf, rndstr, CKLEN )) { + continue; + } + buflen = strlen( buf ); + /* Found the random string - check DN */ + if (( dbdn = strrchr( buf, ':' )) == NULL ) { + continue; + } else { + dbdn++; + if ( dbdn[ strlen( dbdn) - 1 ] == '\n' ) { + dbdn[ strlen( dbdn) - 1 ] = '\0'; + } + if ( strcmp( dbdn, dn )) { + continue; + } else { + /* Found it. Set the expiration time to zero and obliterate + * the password. + */ + p = strchr( buf, ':' ); + for ( p++; *p != ':'; p++ ) { + *p = '0'; /* yes, '0', not '\0' */ + } + dnp = strrchr( buf, ':' ); + for ( p++; p < dnp; p++ ) { + *p = 'x'; + } + p++; + fseek( fp, -buflen, SEEK_CUR ); + fputs( buf, fp ); + fputs( "\n", fp ); + fflush( fp ); + rc = 0; + } + } + } + + dsgw_closecookiedb( fp ); + + if ( rc == 0 ) { + dsgw_purgedatabase( dn ); + } + + return rc; +} + + + + + + +/* + * Retrieve the time of the last database purge. Returns zero on error. + * The caller must open and lock the cookie database before calling this + * routine. The file pointer's position in the file is preserved. + */ +time_t +dsgw_getlastpurged( FILE *fp ) +{ + char buf[ CKBUFSIZ ]; + char *p; + size_t pos; + time_t ret; + + if ( fp == NULL ) { + return (time_t) 0L; + } + + pos = ftell( fp ); + fseek( fp, 0L, SEEK_SET ); + + fgets( buf, sizeof(buf), fp ); + if ( strncmp( buf, "lastpurge:", 10 )) { + ret = (time_t) 0L; + } else { + p = buf + 10; + if ( *p != '\0' ) { + ret = (time_t) atol( p ); + } else { + ret = (time_t) 0L; + } + } + fseek( fp, pos, SEEK_SET ); + return ret; +} + + +/* + * Purge the database of any expired entries. Returns the number of + * entries purged, or -1 if an error occurred. If "dn" is non-NULL, + * then this routine will also remove any entries where the DN matches + * "dn". + */ +#define DSGW_CK_DEBUG 1 +int +dsgw_purgedatabase( char *dn ) +{ + FILE *fp, *ofp; + time_t now; + char buf[ CKBUFSIZ ]; + char *exp; + char expbuf[ 32 ]; + char *nbuf; + int purged = 0; +#ifdef _WIN32 + int fh; +#endif + size_t osize; /* original size of file */ + size_t csize; /* current size of file */ + char cdb[MAXPATHLEN]; /*DSGW_COOKIEDB_FNAME + context*/ + + PR_snprintf(cdb, sizeof(cdb), "%s.%s", DSGW_COOKIEDB_FNAME, context); + + if (( fp = dsgw_opencookiedb()) == NULL ) { + return -1; + } + + fseek( fp, 0L, SEEK_END ); + osize = ftell( fp ); + fseek( fp, 0L, SEEK_SET ); + + if (( ofp = fopen( cdb, "r+" )) == NULL ) { + dsgw_closecookiedb( fp ); + return -1; + } + + /* re-write the last purge time */ + time( &now ); + fprintf( ofp, "lastpurge: %-20lu\n", now ); + + for (;;) { + char *p; + char *dbdn; + int nukeit; + size_t maxlen = sizeof(expbuf); + + nukeit = 0; + + if ( fgets( buf, sizeof(buf), fp ) == NULL ) { + break; + } + if ( strncmp( buf, "lastpurge:", 10 ) == 0 ) { + continue; + } + if (( p = strchr( buf, ':' )) == NULL ) { + fclose( ofp ); + dsgw_closecookiedb( fp ); + return -1; + } + exp = ++p; + if (( p = strchr( exp, ':' )) == NULL ) { + fclose( ofp ); + dsgw_closecookiedb( fp ); + return -1; + } + if ((p - exp) < maxlen) { + maxlen = p - exp; + } else { + maxlen--; /* need a length, not a count */ + } + strncpy( expbuf, exp, maxlen ); + expbuf[ maxlen ] = '\0'; + time( &now ); + + /* Get the entry's DN */ + dbdn = strrchr( buf, ':' ); + dbdn++; + dbdn = strdup( dbdn ); + if ( dbdn[ strlen( dbdn) - 1 ] == '\n' ) { + dbdn[ strlen( dbdn) - 1 ] = '\0'; + } + + /* Should we delete? */ + if ( dn != NULL ) { + if (( dbdn != NULL ) && !strcmp( dn, dbdn )) { + /* Entry's DN is the same as the "dn" parameter - delete */ + nukeit = 1; + } + } + + free( dbdn ); + if ( !nukeit && ( now > atol( expbuf ))) { + /* expired */ + nukeit = 1; + } + + if ( !nukeit ) { + /* Entry should stay */ + fputs( buf, ofp ); + } else { + /* Entry should be purged */ + purged++; + } + } + + /* + * Overwrite the rest of the file so we don't leave passwords + * laying around. + */ + csize = ftell( ofp ); + nbuf = dsgw_ch_malloc( osize - csize + 2 ); + memset( nbuf, 'x', osize - csize + 1 ); + nbuf[ osize - csize + 1 ] = '\0'; + fputs( nbuf, ofp ); + free( nbuf ); +#ifdef _WIN32 + dsgw_closecookiedb( fp ); + fflush( ofp ); + fclose( ofp ); + fh = open( cdb, _O_RDWR | _O_TEXT ); + chsize( fh, csize ); + close( fh ); +#else /* _WIN32 */ + fclose( ofp ); + ftruncate( fileno( fp ), csize ); + dsgw_closecookiedb( fp ); +#endif /* _WIN32 */ + return purged; +} + + + +/* + * for debugging - traverse and print the db + */ +void +dsgw_traverse_db() +{ + FILE *fp; + char *exp; + int total, expired; + time_t now; + char buf[ CKBUFSIZ ]; + char expbuf[ 32 ]; + + total = expired = 0; + + if (( fp = dsgw_opencookiedb()) == NULL ) { + fprintf( stderr, "can't open db\n" ); + return; + } + + if ( fgets( buf, sizeof(buf), fp ) == NULL ) { + dsgw_closecookiedb( fp ); + printf( "Cookie database is empty (no lastpurge line)\n" ); + return; + } + puts( buf ); + + for (;;) { + size_t maxlen = sizeof(expbuf); + char *p; + if ( fgets( buf, sizeof(buf), fp ) == NULL ) { + dsgw_closecookiedb( fp ); + printf( "%d entries, %d expired\n", total, expired ); + return; + } + if (( p = strchr( buf, ':' )) == NULL ) { + dsgw_closecookiedb( fp ); + return; + } + exp = ++p; + if (( p = strchr( exp, ':' )) == NULL ) { + dsgw_closecookiedb( fp ); + return; + } + printf( "%s", buf ); + if ((p - exp + 1) < maxlen) { + maxlen = p - exp + 1; + } else { + maxlen--; /* need a length, not a count */ + } + strncpy( expbuf, exp, maxlen ); + expbuf[ maxlen ] = '\0'; + time( &now ); + total++; + if ( now > atol( expbuf )) { + /* not yet expired */ + printf( " (expired)\n" ); + expired++; + } else { + printf( "\n" ); + } + } +} + + + +/* + * Generate a complete authentication cookie header line and store + * the relevant parts iit in the database. + * Return a pointer to the cookie. This routine allocates memory, which + * the caller is responsible for freeing. + * On error, this routine returns NULL and sets err to point to an + * error code. + */ +char * +dsgw_mkcookie( char *dn, char *password, time_t lifetime, int *err ) +{ + char *r; + char *ckbuf; + char *edn; + int rc; + + if ( dn == NULL ) { + *err = DSGW_CKDB_NODN; + return NULL; + } + edn = dsgw_strdup_escaped( dn ); + + if (( r = dsgw_mkrndstr()) == NULL ) { + *err = DSGW_CKDB_RNDSTRFAIL; + return NULL; + } + rc = dsgw_storecookie( r, dn, password, lifetime ); + if ( rc != 0 ) { + free( r ); + free( edn ); + *err = rc; + return NULL; + } + + /* richm: replace with PR_smprintf */ + ckbuf = dsgw_ch_malloc( strlen( DSGW_CKHDR ) + strlen( r ) + + strlen( edn ) + strlen( DSGW_AUTHCKNAME ) + 2 + 20 ); + ckbuf[ 0 ] = '\0'; + strcpy( ckbuf, DSGW_CKHDR ); + strcat( ckbuf, DSGW_AUTHCKNAME ); + strcat( ckbuf, "=" ); + strcat( ckbuf, r ); + strcat( ckbuf, ":" ); + strcat( ckbuf, edn ); + strcat( ckbuf, "; path=/" ); + + free( r ); + free( edn ); + return ckbuf; +} + + + +/* + * Password obfuscation, etc. + * There is no real security here -- we just encrypt using a hard-coded key. + * The original functions these are based on are called SECMOZ_MungeString() + * and SECMOZ_UnMungeString(). They can be found in ns/lib/libsec/secmoz.c + * (they don't get built as part of the server builds). The only change I + * made was to swap a few of the bytes in the secmoz_tmmdi array and add one + * to all of them. -- Mark Smith + */ + +static unsigned char dsgw_tmmdi[] = { /* tmmdi == They Made Me Do It */ + 0x87, /* repka, paquin */ + 0x9d, /* freier, elgamal */ + 0xdf, /* jonm, bobj */ + 0xef, /* fur, sharoni */ + 0xd1, /* jsw, karlton */ + 0xec, /* ari, sk */ + 0x3f, /* terry, atotic */ + 0xc7 /* jevering, kent */ +}; + +static char * +dsgw_MungeString(const char *unmunged_string) +{ + return(dsgw_encDec(CKA_ENCRYPT, unmunged_string)); +} +static char * +dsgw_UnMungeString(const char *munged_string) +{ + return(dsgw_encDec(CKA_DECRYPT, munged_string)); +} + +/* + * key import and encryption (using RC4) + */ +static char * +dsgw_encDec(CK_ATTRIBUTE_TYPE operation, const char *msg) +{ + CK_MECHANISM_TYPE type = CKM_RC4; + PK11SlotInfo *slot = 0; + PK11SymKey *key = 0; + SECItem *params = 0; + PK11Context *context = 0; + unsigned char *output; + unsigned char *input; + char *edStr; + int outLen; + unsigned int len; + SECStatus s; + SECItem keyItem = { siBuffer, dsgw_tmmdi, sizeof dsgw_tmmdi }; + int noGood = 0; + unsigned int inlen; + + if (msg == NULL) { + return NULL; + } + + if (*msg == '\0') { + return PL_strdup(msg); + } + + if (operation == CKA_DECRYPT) { + input = ATOB_AsciiToData(msg, &inlen); + if (msg == NULL) + return NULL; + } else { + inlen = PL_strlen(msg); + input = (unsigned char *) msg; + } + + output = (unsigned char *) malloc(inlen + 65); + if (output == NULL) { + return NULL; + } + + /* Initialization */ + /*NSS_NoDB_Init(".");*/ + dsgw_initNSS(); + + /* + * Choose a "slot" to use. Slots store keys (either + * temporarily or permanently) and perform + * cryptogrphic operations. + * + * Use the built-in key slot. Another way to choose + * a slot is using PK11_GetBestSlot(), which chooses + * based on the mechanism. + */ + slot = PK11_GetInternalKeySlot(); + if (!slot) + { + noGood = 1; + goto dsgw_encDec_done; + } + + /* + * Get the encryption key. Params may be passed in here, + * but most symmetric key generation requires only the key + * length. + * + * Warning: the key length is in bytes + * + * The key can also be imported (not recommended). See importKey() + * below for example code. + */ + /* This code generates a random key + key = PK11_KeyGen(slot, type, 0, 128/8, 0); + if (!key) + { + goto dsgw_encDec_done; + }*/ + /* Here we are using a static key. This sucks, but we don't really + * have much of a choice.*/ + key = PK11_ImportSymKey(slot, CKM_RC4, PK11_OriginGenerated, operation, &keyItem, 0); + + /* + * Some encryption algorithms require parameters. NSS provides + * a generic way to create parameters for any algorithm. + */ + params = PK11_GenerateNewParam(type, key); + if (!params) + { + noGood = 1; + goto dsgw_encDec_done; + } + + /*if (params->data) printBuffer(params->data, params->len);*/ + + /* + * Cryptographic operations are performed using a "context" + * Create one for doing encryption using the key and parameters + * generated above. + */ + context = PK11_CreateContextBySymKey(type, operation, key, params); + if (!context) + { + noGood = 1; + goto dsgw_encDec_done; + } + + /* + * Encrypt the data. In general, the input data should be in multiples + * of the cipher's block size, and the output size will match the input + * size. However, this will not be true for mechanisms that provide + * padding. + */ + s = PK11_CipherOp(context, output, &outLen, inlen + 64, input, (int) inlen); + if (s != SECSuccess) + { + noGood = 1; + goto dsgw_encDec_done; + } + + /*printBuffer(output, outLen);*/ + + /* + * When a mechanism that provides padding is used, there may be additional + * data available after the last input data is processed. + * + * NOTE: The type of the length output here is different than in PK11_CipherOp + */ + s = PK11_DigestFinal(context, &output[outLen], &len, sizeof output - outLen); + if (s != SECSuccess) + { + noGood = 1; + goto dsgw_encDec_done; + } + + /*if (len != 0) printBuffer(&output[outLen], len);*/ + + outLen += len; + + /* + * Terminate the cryptographic operation. Destroying the + * context also performs this function. + */ + PK11_Finalize(context); + + /* + * Delete the encryption context block, this releases the reference to the key + * and frees the context's copy of the parameters, etc. + * + * The second argument should always be PR_TRUE to free the context structure + * itself, in addition to the contents. + */ + PK11_DestroyContext(context, PR_TRUE); + context = 0; + +dsgw_encDec_done: + if (context) PK11_DestroyContext(context, PR_TRUE); /* freeit ?? */ + if (params) SECITEM_ZfreeItem(params, PR_TRUE); + if (key) PK11_FreeSymKey(key); + if (slot) PK11_FreeSlot(slot); + + if (noGood == 1) { + return(NULL); + } + + if (operation == CKA_DECRYPT) { + edStr = (char *) output; + edStr[outLen] = '\0'; + } else { + edStr = BTOA_DataToAscii(output, outLen); + free(output); + } + + return(edStr); +} + + +void +dsgw_initNSS(void) +{ + if (dsgw_NSSInitializedAlready == 1) { + return; + } + + if (gc->gc_ldapssl && gc->gc_securitypath != NULL ) { + NSS_Init(gc->gc_securitypath); + } else { + NSS_NoDB_Init(NULL); + } + dsgw_NSSInitializedAlready = 1; +} diff --git a/csearch.c b/csearch.c new file mode 100644 index 0000000..178b5e3 --- /dev/null +++ b/csearch.c @@ -0,0 +1,364 @@ +/** --- BEGIN COPYRIGHT BLOCK --- + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + --- END COPYRIGHT BLOCK --- */ +/* + * csearch.c -- CGI program to generate complex search form -- HTTP gateway + */ + +#include "dsgw.h" +#include "dbtdsgw.h" + +static void get_request(char *fname); +static void emit_file(char* filename, struct ldap_searchobj* sop); + + +int main( argc, argv, env ) + int argc; + char *argv[]; +#ifdef DSGW_DEBUG + char *env[]; +#endif +{ + int reqmethod; + char *qs = NULL; + char *fname = NULL; + + /* Parse out the file=blah.html from the query string*/ + if (( qs = getenv( "QUERY_STRING" )) != NULL && *qs != '\0' ) { + /* parse the query string: */ + auto char *p, *iter = NULL; + qs = dsgw_ch_strdup( qs ); + for ( p = ldap_utf8strtok_r( qs, "&", &iter ); p != NULL; + p = ldap_utf8strtok_r( NULL, "&", &iter )) { + + /* + * Get the conf file name. It'll be translated + * into /dsgw/context/CONTEXT.conf if + * CONTEXT is all alphanumeric (no slahes, + * or dots). CONTEXT is passed into the cgi. + * if context=CONTEXT is not there, or PATH_INFO + * was used, then use dsgw.conf + */ + if ( !strncasecmp( p, "context=", 8 )) { + context = dsgw_ch_strdup( p + 8 ); + dsgw_form_unescape( context ); + continue; + } + + if ( !strncasecmp( p, "file=", 5 )) { + fname = dsgw_ch_strdup( p + 5 ); + dsgw_form_unescape( fname ); + continue; + } + } + free( qs ); qs = NULL; + } + + + reqmethod = dsgw_init( argc, argv, DSGW_METHOD_POST | DSGW_METHOD_GET ); + dsgw_send_header(); + +#ifdef DSGW_DEBUG + dsgw_logstringarray( "env", env ); +{ + char buf[ 1024 ]; + getcwd( buf, sizeof(buf)); + dsgw_log( "cwd: \"%s\"\n", buf ); +} +#endif + + if ( reqmethod == DSGW_METHOD_POST || reqmethod == DSGW_METHOD_GET ) { + get_request(fname); + } + + exit( 0 ); +} + + +static void +get_request(char *fname) +{ + auto char* filename = NULL; + struct ldap_searchobj* sop = NULL; + + if ( fname == NULL || *fname == '\0' ) { + filename = "csearch.html"; + dsgw_init_searchprefs( &sop ); + } else if ( !strcmp( fname, "type" )) { + filename = "csearchType.html"; + } else if ( !strcmp( fname, "attr" )) { + filename = "csearchAttr.html"; + } else if ( !strcmp( fname, "match" )) { + filename = "csearchMatch.html"; + } else if ( !strcmp( fname, "string" )) { + filename = "csearchString.html"; + } else if ( !strcmp( fname, "base" )) { + filename = "csearchBase.html"; + } + if (filename) { + emit_file (filename, sop); + } + fflush(stdout); +} + + +static void +dsgw_emit_options (struct ldap_searchobj** sop, char* searchType, char* searchAttr) + /* Emit HTML \n", + so->so_objtypeprompt, + dsgw_get_translation( so->so_objtypeprompt )); + } else if (!*searchType || !strcmp (searchType, so->so_objtypeprompt)) { + auto struct ldap_searchattr *sa; + for (sa = so->so_salist; sa != NULL; + sa = sa->sa_next) { + if (!searchAttr) { /* emit searchAttr option */ + dsgw_emitf ("\n", + sa->sa_attrlabel); + } else if (!*searchAttr || !strcmp (searchAttr, sa->sa_attrlabel)) { + auto int mi; + auto struct ldap_searchmatch *sm; + for (mi=0, sm = so->so_smlist; sm != NULL; + ++mi, sm = sm->sm_next) { /* emit searchMatch option */ + if (sa->sa_matchtypebitmap & (1L << mi)) { + dsgw_emitf ("\n", + sm->sm_matchprompt); + } + } + break; + } + } + break; + } + } +} + + +static void +emit_file (char* filename, struct ldap_searchobj* sop) +{ + auto FILE* html = dsgw_open_html_file( filename, DSGW_ERROPT_EXIT ); + auto char line[ BIG_LINE ]; + auto int argc; + auto char **argv; + + while ( dsgw_next_html_line( html, line )) { + if ( dsgw_parse_line( line, &argc, &argv, 0, dsgw_simple_cond_is_true, NULL )) { + if ( dsgw_directive_is( line, "HEAD" )) { + dsgw_head_begin(); + dsgw_emits ("\n"); + + } else if ( dsgw_directive_is( line, "DS_CSEARCH_SCRIPT" )) { + dsgw_emits("\n" ); + + } else if ( dsgw_directive_is( line, "EVALUATE" )) { + auto int i; + for (i = 0; i < argc; ++i) { + if (!strcmp (argv[i], "parent.searchBase")) { + dsgw_emits (gc->gc_ldapsearchbase); + } else if (!strcmp (argv[i], "parent.UFNsearchBase")) { +#ifdef NOTFORNOW + /* ldap_dn2ufn currently gobbles up 'dc' so don't use */ + /* it for now */ + auto char* ufn = ldap_dn2ufn (gc->gc_ldapsearchbase); + dsgw_emits (ufn); + free( ufn ); +#else + dsgw_emits (gc->gc_ldapsearchbase); +#endif + } + } + + } else if ( dsgw_directive_is( line, "DS_CSEARCH_TYPE_BODY" )) { + dsgw_emitf ("\n", dsgw_html_body_colors, + "onLoad=\"parent.searchTypeSet(document.searchTypeForm.searchType.options" + "[document.searchTypeForm.searchType.selectedIndex].value);\""); + + } else if ( dsgw_directive_is( line, "DS_CSEARCH_ATTR_BODY" )) { + dsgw_emitf ("\n", dsgw_html_body_colors, + "onLoad=\"parent.searchAttrSet(document.searchAttrForm.searchAttr.options" + "[document.searchAttrForm.searchAttr.selectedIndex].value);\""); + + } else if ( dsgw_directive_is( line, "DS_CSEARCH_MATCH_BODY" )) { + dsgw_emitf ("\n", dsgw_html_body_colors, + "onLoad=\"parent.searchMatchSet(document.searchMatchForm.searchMatch.options" + "[document.searchMatchForm.searchMatch.selectedIndex].value);\""); + + } else if ( dsgw_directive_is( line, "DS_CSEARCH_STRING_BODY" )) { + dsgw_emitf ("\n", dsgw_html_body_colors, + "onLoad=\"document.searchStringForm.searchstring.select();" + "document.searchStringForm.searchstring.focus();\""); + dsgw_emit_alertForm(); + + } else if ( dsgw_directive_is( line, "DS_CSEARCH_BASE_BODY" )) { + dsgw_emitf ("\n", dsgw_html_body_colors); + + } else if ( dsgw_directive_is( line, "DS_CSEARCH_TYPE_FORM" )) { + dsgw_form_begin ("searchTypeForm", + "action=\"%s?file=attr\" target=searchAttrFrame", + dsgw_getvp( DSGW_CGINUM_CSEARCH)); + dsgw_emits("\n"); + + } else if ( dsgw_directive_is( line, "DS_CSEARCH_ATTR_FORM" )) { + dsgw_form_begin ("searchAttrForm", + "action=\"%s?file=match\" target=searchMatchFrame", + dsgw_getvp( DSGW_CGINUM_CSEARCH)); + dsgw_emits("\n"); + { + auto char* searchType = dsgw_get_cgi_var ("searchType", DSGW_CGIVAR_OPTIONAL); + if (searchType && *searchType) { + dsgw_emitf ("\n", + searchType); + } + } + + } else if ( dsgw_directive_is( line, "DS_CSEARCH_MATCH_FORM" )) { + dsgw_form_begin ("searchMatchForm", NULL); + dsgw_emits("\n"); + + } else if ( dsgw_directive_is( line, "DS_CSEARCH_STRING_FORM" )) { + dsgw_form_begin ("searchStringForm", "action=\"%s\" %s %s", + dsgw_getvp( DSGW_CGINUM_DOSEARCH ), + "onSubmit=\"return parent.setHiddenFields(this)\"", + argc > 0 ? argv[0] : ""); + dsgw_emitf ("\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n", + gc->gc_ldapsearchbase, gc->gc_ldapserver, gc->gc_ldapport, context); + + } else if ( dsgw_directive_is( line, "DS_CSEARCH_TYPE_SELECT" )) { + dsgw_emitf ("\n" + "\n", + XP_GetClientStr( DBT_Retry_ )); + dsgw_emit_homebutton(); + dsgw_emits ( "\n" ); + dsgw_emit_helpbutton( "AUTHPROBLEM" ); + } else { + dsgw_emitf( "\n" + "\n" + "\n" + "\n" + "\n", + XP_GetClientStr( DBT_Retry_ ), + XP_GetClientStr( DBT_closeWindow_5 )); + dsgw_emit_helpbutton( "AUTHPROBLEM" ); + } + dsgw_emits( "\n" + "\n" + "\n" ); + fflush( stdout ); + return; +} diff --git a/domodify.c b/domodify.c new file mode 100644 index 0000000..94853c9 --- /dev/null +++ b/domodify.c @@ -0,0 +1,1043 @@ +/** --- BEGIN COPYRIGHT BLOCK --- + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + --- END COPYRIGHT BLOCK --- */ +/* + * domodify.c -- LDAP modify CGI handler -- HTTP gateway + */ + +#include "dsgw.h" +#include "dbtdsgw.h" + +#define DSGW_CHANGETYPE_UNKNOWN 0 +#define DSGW_CHANGETYPE_MODIFY 1 +#define DSGW_CHANGETYPE_ADD 2 +#define DSGW_CHANGETYPE_DELETE 3 +#define DSGW_CHANGETYPE_MODRDN 4 + +static void post_request(); +static int entry_modify_or_add( LDAP *ld, char *dn, int add, int *pwdchangedp ); +static int entry_delete( LDAP *ld, char *dn ); +static int entry_modrdn( LDAP *ld, char *dn, char *newrdn, int deleteoldrdn ); +static int gather_passwd_changes( char *dn, LDAPMod ***pmodsp, + int adding_entry, int *pwdchangedp ); +static void modify_error( int lderr, char *lderrtxt ); +static void addmodifyop( LDAPMod ***pmodsp, int modop, char *attr, + char *value, int vlen ); +static void remove_modifyops( LDAPMod **pmods, char *attr ); +static int starts_with( char *s, char *startswith ); +static char **post2multilinevals( char *postedval ); +static char **post2vals( char *postedval ); +static int require_oldpasswd( char *modifydn ); +static int value_is_unique( LDAP *ld, char *dn, char *attr, char *value ); +static int verbose = 0; +static int quiet = 0; +static int display_results_inline = 0; + + +int main( argc, argv, env ) + int argc; + char *argv[]; +#ifdef DSGW_DEBUG + char *env[]; +#endif +{ + + (void)dsgw_init( argc, argv, DSGW_METHOD_POST ); + dsgw_send_header(); + +#ifdef DSGW_DEBUG + dsgw_logstringarray( "env", env ); +#endif + + post_request(); + + exit( 0 ); +} + + +static void +post_request() +{ + LDAP *ld; + int rc, changetype, dnlen, i, passwd_changed, discard_authcreds; + char *s, *encodeddn, *dn, *newrdn, *changedesc, **rdns, **oldrdns, + *jscomp, *entry_name, *new_name, *success_msg; + char *old_dn; + char buf[ 256 ]; + + passwd_changed = discard_authcreds = 0; + s = dsgw_get_cgi_var( "changetype", DSGW_CGIVAR_REQUIRED ); + changedesc = XP_GetClientStr(DBT_Editing_); + + if ( strcasecmp( s, "modify" ) == 0 ) { + changetype = DSGW_CHANGETYPE_MODIFY; + } else if ( strcasecmp( s, "add" ) == 0 ) { + changetype = DSGW_CHANGETYPE_ADD; + changedesc = XP_GetClientStr(DBT_Adding_); + } else if ( strcasecmp( s, "delete" ) == 0 ) { + changetype = DSGW_CHANGETYPE_DELETE; + changedesc = XP_GetClientStr(DBT_Deleting_); + } else if ( strcasecmp( s, "modrdn" ) == 0 ) { + changetype = DSGW_CHANGETYPE_MODRDN; + changedesc = XP_GetClientStr(DBT_Renaming_); + } else { + changetype = DSGW_CHANGETYPE_UNKNOWN; + } + + encodeddn = dsgw_get_cgi_var( "dn", DSGW_CGIVAR_REQUIRED ); + + /* undo extra level of escaping on DN */ + dn = dsgw_ch_strdup( encodeddn ); + dsgw_form_unescape( dn ); + old_dn = dn; + + quiet = dsgw_get_boolean_var( "quiet", DSGW_CGIVAR_OPTIONAL, 0 ); + + verbose = dsgw_get_boolean_var( "verbose", DSGW_CGIVAR_OPTIONAL, 0 ); + if ( verbose ) { + quiet = 0; /* verbose overrides quiet */ + } + + if ( dsgw_init_ldap( &ld, NULL, 0, 0) != DSGW_BOUND_ASUSER ) { + dsgw_emitf( XP_GetClientStr(DBT_warningNoAuthenticationContinuin_) ); + } + + if ( !quiet ) { + PR_snprintf( buf, sizeof(buf), + XP_GetClientStr(DBT_SDirectoryEntry_), changedesc ); + dsgw_html_begin( buf, 1 ); + } else { + dsgw_html_begin( NULL, 0 ); + } + + dsgw_emits( "\n\n" ); + + rdns = ldap_explode_dn( dn, 1 ); + if ( rdns == NULL || rdns[ 0 ] == NULL ) { + entry_name = dn; + } else { + entry_name = dsgw_ch_strdup( rdns[ 0 ] ); + } + new_name = success_msg = ""; + dsgw_emitf( "%s %s...\n\n\n", changedesc, entry_name ); + if ( rdns != NULL ) { + ldap_value_free( rdns ); + } + + if ( verbose ) { + dsgw_emitf( XP_GetClientStr(DBT_PreEntryDnSPrePN_), dn ); + } + + /* + * For end-user CGIs under admin server, if we're talking to a local DB, + * then there's no access control, and therefore we need to disallow + * people from changing entries other than their own. Do that check right + * here. + */ + if ( gc->gc_enduser && gc->gc_localdbconf != NULL ) { + char *bdn; + (void)dsgw_get_adm_identity( ld, NULL, &bdn, NULL, DSGW_ERROPT_EXIT ); + /* Make sure DN we're bound as matches the DN being modified */ + if ( dsgw_dn_cmp( dn, bdn ) == 0 ) { + /* Not the same - generate an error and bail out */ + dsgw_error( DSGW_ERR_LOCALDB_PERMISSION_DENIED, NULL, + DSGW_ERROPT_EXIT, 0, NULL ); + } + } + + rc = LDAP_SUCCESS; + switch( changetype ) { + case DSGW_CHANGETYPE_MODIFY: + if ( dsgw_get_boolean_var( "changed_DN", DSGW_CGIVAR_OPTIONAL, 0 )) { + /* Collect all the inputs named "replace_DN_attr", where + attr is an LDAP attribute type. Construct an AVA from + each such input, and combine the AVAs to form newrdn. + */ + auto int i = 0; + auto char *varname, *val; + auto size_t newrdn_len; + newrdn = NULL; + while ( (varname = dsgw_next_cgi_var( &i, &val )) != NULL) { + if ( starts_with( varname, "replace_" )) { + auto char* attr = varname; + auto int is_rdn = 0; + { + auto char* p; + while (( p = strchr( attr, '_' )) != NULL ) { + attr = p + 1; + if ( starts_with( attr, "DN_" )) { + is_rdn = 1; + } /* ignore any other prefixes */ + } + } + if (is_rdn && strlen(val) > 0) { + auto const size_t attrlen = strlen (attr); + auto const size_t val_len = strlen (val); + auto const size_t ava_len = attrlen + 1 + val_len; + auto char* ava; + if (newrdn == NULL) { + ava = newrdn = dsgw_ch_malloc (ava_len + 1); + newrdn_len = ava_len; + } else { + newrdn = dsgw_ch_realloc (newrdn, newrdn_len + ava_len + 2); + memcpy (newrdn + newrdn_len, "+", 1); + ava = newrdn + newrdn_len + 1; + newrdn_len += (ava_len + 1); + } + memcpy (ava, attr, attrlen); + memcpy (ava + attrlen, "=", 1); + memcpy (ava + attrlen + 1, val, val_len + 1); + } + } + free (varname); + } + if (newrdn) goto continue_modrdn; + /* else failed to compute newrdn */ + } + break; + case DSGW_CHANGETYPE_MODRDN: + newrdn = dsgw_get_cgi_var( "newrdn", DSGW_CGIVAR_REQUIRED ); + continue_modrdn: + dsgw_remove_leading_and_trailing_spaces( &newrdn ); + rc = entry_modrdn( ld, dn, newrdn, dsgw_get_boolean_var( "deleteoldrdn", + DSGW_CGIVAR_OPTIONAL, 0 )); + + if ( rc == LDAP_SUCCESS ) { + + /* construct the new DN so we can insert correct "edit" link */ + if (( oldrdns = ldap_explode_dn( dn, 0 )) == NULL ) { + dsgw_error( DSGW_ERR_NOMEMORY, NULL, DSGW_ERROPT_EXIT, + 0, NULL ); + } + + dnlen = strlen( newrdn ) + 1; /* room for "," */ + for ( i = 1; oldrdns[ i ] != NULL; ++i ) { + dnlen += ( 1 + strlen( oldrdns[ i ] )); + } + dn = dsgw_ch_malloc( dnlen + 1 ); + *dn = '\0'; + strcat( dn, newrdn ); + for ( i = 1; oldrdns[ i ] != NULL; ++i ) { + strcat( dn, "," ); + strcat( dn, oldrdns[ i ] ); + } + ldap_value_free( oldrdns ); + free( encodeddn ); + encodeddn = dsgw_strdup_escaped( dn ); + + success_msg = XP_GetClientStr(DBT_renamedBSBToBSB_); + if (( rdns = ldap_explode_rdn( newrdn, 1 )) == NULL + || rdns[ 0 ] == NULL ) { + new_name = newrdn; + } else { + new_name = dsgw_ch_strdup (rdns[ 0 ]); + ldap_value_free( rdns ); + } + } + break; + default: + break; + } + + switch( changetype ) { + case DSGW_CHANGETYPE_MODIFY: + if (rc != LDAP_SUCCESS) break; + case DSGW_CHANGETYPE_ADD: + rc = entry_modify_or_add( ld, dn, changetype == DSGW_CHANGETYPE_ADD, + &passwd_changed ); + if ( changetype == DSGW_CHANGETYPE_MODIFY ) { + success_msg = XP_GetClientStr(DBT_changesToBSBHaveBeenSaved_); + } else { + success_msg = XP_GetClientStr(DBT_BSBHasBeenAdded_); + } + break; + case DSGW_CHANGETYPE_DELETE: + rc = entry_delete( ld, dn ); + success_msg = XP_GetClientStr(DBT_BSBHasBeenDeleted_); + break; + case DSGW_CHANGETYPE_MODRDN: + break; + default: + rc = LDAP_PARAM_ERROR; + } + + /* + * If we are not running under the admin. server AND the operation + * succeeded and the user is bound as the entry they just changed, + * AND one of these conditions is true: + * 1. we changed the password + * 2. we did a modrdn + * 3. we deleted the entry + * then the auth. credentials should be discarded. If we do discard, we + * print an informative message for the user. + */ + if ( !gc->gc_admserv && rc == LDAP_SUCCESS && + ( changetype == DSGW_CHANGETYPE_DELETE || dn != old_dn || + ( changetype == DSGW_CHANGETYPE_MODIFY && passwd_changed )) && + dsgw_bound_as_dn( old_dn, 0 )) { + char *authck; + + /* first, remove the cookie from the cookie database (ignore errors) */ + if (( authck = dsgw_get_auth_cookie()) != NULL ) { + (void)dsgw_delcookie( authck ); + } + + /* output JavaScript to clear the cookie in the user's browser */ + dsgw_emits( "\n" ); + dsgw_emitf( XP_GetClientStr(DBT_PBNoteBBecauseYouSTheEntryYouWer_), + ( changetype == DSGW_CHANGETYPE_DELETE ) ? XP_GetClientStr(DBT_deleted_) : + ( dn != old_dn ) ? XP_GetClientStr(DBT_renamed_) : + XP_GetClientStr(DBT_changedThePasswordOf_) ); + } + + if ( rc == LDAP_SUCCESS ) { + /* + * check for "completion_javascript" form var and + * execute it if present. + */ + jscomp = dsgw_get_cgi_var( "completion_javascript", + DSGW_CGIVAR_OPTIONAL ); + if ( jscomp != NULL ) { + char *entry_name_js; + char *new_name_js; + + entry_name_js = dsgw_escape_quotes( entry_name ); + new_name_js = dsgw_escape_quotes( new_name ); + dsgw_emits( "\n" ); + } + } else { + jscomp = NULL; + } + + if (( jscomp == NULL || changetype == DSGW_CHANGETYPE_DELETE ) + && !gc->gc_admserv ) { + dsgw_form_begin( NULL, NULL ); + dsgw_emits( "\n
\n" ); + /* + * Show framed button. If the modify succeeded, it is "Close". + * If the modify failed, it is "Go Back." + */ + dsgw_emits( "
\n" ); + if ( rc == LDAP_SUCCESS ) { + dsgw_emitf( "\n", + XP_GetClientStr(DBT_closeWindow_) ); + } else { + dsgw_emitf( "\n", + XP_GetClientStr(DBT_goBack_) ); + } + dsgw_emits( "\n
\n" ); + } + + if ( !quiet ) { + dsgw_html_end(); + } + ldap_unbind( ld ); + if (old_dn != dn) free ( old_dn ); + free( dn ); +} + +static int +entry_modify_or_add( LDAP *ld, char *dn, int add, int *pwdchangedp ) +{ + int lderr, i, j, opoffset, modop, mls, unique, unchanged_count; + char *varname, *varvalue, *attr, *p, **vals, **unchanged_attrs; + char *ntuserid = NULL; + + LDAPMod **pmods; + + int msgid; + LDAPMessage *res = NULL; + char *errmsg = NULL; + int isNtUser = 0; + + pmods = NULL; + unchanged_attrs = NULL; + unchanged_count = 0; + + /* + * Gather up password changes (if present in CGI POST) + */ + if (( lderr = gather_passwd_changes( dn, &pmods, add, pwdchangedp )) + != LDAP_SUCCESS ) { + return( lderr ); + } + + if ( verbose ) { + dsgw_emitf( "
\n" );
+    }
+
+    /*
+     * Gather up other changes:  each attribute value is POSTed in a variable
+     * named:
+     *      add_[unique_]ATTR
+     *      replace_[unique_][DN_]ATTR
+     * or   delete_[unique_]ATTR
+     *
+     * where ATTR is the LDAP attribute name and "unique_" is optional (if
+     * present, we check to make sure the value is not in use before accepting
+     * a replace or add).
+     *
+     * Additionally, if a variable name changed_ATTR is POSTed and its value
+     * is not "true", it is assumed that no values have changed for that
+     * ATTRibute.  If no "changed_ATTR" variable is POSTed, we assume that
+     * ATTR has in fact changed.
+     */
+    i = 0;
+    while (( varname = dsgw_next_cgi_var( &i, &varvalue )) != NULL ) {
+	if ( varvalue != NULL && *varvalue == '\0' ) {
+	    varvalue = NULL;
+	} else {
+	    dsgw_remove_leading_and_trailing_spaces( &varvalue );
+	}
+
+	opoffset = -1;
+	if ( starts_with( varname, "add_" )) {
+	    modop = LDAP_MOD_ADD;
+	    opoffset = 4;
+	    attr = varname + opoffset;
+	    if (!isNtUser && (strcasecmp(DSGW_OC_NTUSER, attr) == 0)) {
+		isNtUser = 1;
+	    }
+	} else if ( starts_with( varname, "replace_" )) {
+	    modop = LDAP_MOD_REPLACE;
+	    opoffset = 8;
+		attr = varname + opoffset;
+	} else if ( starts_with( varname, "delete_" )) {
+	    modop = LDAP_MOD_DELETE;
+	    opoffset = 7;
+	} else if ( !strcmp( varname, "changed_DN" )) {
+	    /* ignore it */
+	} else if ( starts_with( varname, "changed_" )) {
+	    attr = varname + 8;
+	    if ( verbose && strcasecmp( varvalue, "true" ) == 0 ) {
+		dsgw_emitf( XP_GetClientStr(DBT_attributeSWasChangedBrN_), attr );
+	    }
+	    if ( varvalue != NULL && strcasecmp( varvalue, "true" ) != 0 ) {
+		unchanged_attrs = (char **)dsgw_ch_realloc( unchanged_attrs,
+			( 2 + unchanged_count ) * sizeof( char * ));
+		unchanged_attrs[ unchanged_count++ ] = dsgw_ch_strdup( attr );
+		unchanged_attrs[ unchanged_count ] = NULL;
+
+		if ( pmods != NULL ) {
+		    remove_modifyops( pmods, attr );
+		}
+	    }
+	}
+
+	if ( opoffset >= 0 ) {
+	    attr = varname + opoffset;
+	    mls = 0;
+	    unique = 0;
+	    while (( p = strchr( attr, '_' )) != NULL ) {
+		if ( starts_with( attr, "mls_" )) {
+		    mls = 1;
+		} else if ( starts_with( attr, "unique_" )) {
+		    unique = 1;
+		} /* ignore any other prefixes */
+		attr = p + 1;
+	    }
+
+	    for ( j = 0; j < unchanged_count; ++j ) {
+			if ( strcasecmp( unchanged_attrs[ j ], attr ) == 0 ) {
+		    	break;
+			}
+	    }
+
+	    if ( j >= unchanged_count ) {
+		if ( varvalue == NULL || *varvalue == '\0' ) {
+		    vals = NULL;
+		    varvalue = NULL;
+		} else {
+		    varvalue = dsgw_ch_strdup( varvalue );
+		    if ( mls ) {
+			vals = post2multilinevals( varvalue );
+		    } else {
+			vals = post2vals( varvalue );
+		    }
+		}
+		if ( vals == NULL ) {
+		    if ( modop != LDAP_MOD_ADD ) {
+			addmodifyop( &pmods, modop, attr, NULL, 0 );
+		    }
+		} else {
+		    for ( j = 0; vals[ j ] != NULL; ++j ) {
+			    if ( unique && modop != LDAP_MOD_DELETE && ( lderr =
+				   value_is_unique( ld, dn, attr, vals[ j ] )) !=
+				   LDAP_SUCCESS ) {
+			       return( lderr );
+			    }
+				
+			    if( isNtUser && (strcasecmp( DSGW_ATTRTYPE_NTUSERDOMAINID, attr) == 0)) {
+				if( !ntuserid  ) {
+				    ntuserid = strdup( vals[ j ] );
+				}
+			    }
+				addmodifyop( &pmods, modop, attr, vals[ j ],
+					strlen( vals[ j ] ));
+		    }
+		    free( vals );
+		}
+		if ( varvalue != NULL ) {
+		    free( varvalue );
+		}
+	    }
+	}
+
+	free( varname );
+    }
+
+    /* if the admin is adding an NT person, there must be an ntuserid */
+    if( (isNtUser) && (ntuserid == NULL) ) {
+	dsgw_error( DSGW_ERR_USERID_REQUIRED, NULL, 0, 0, NULL );
+	return(LDAP_PARAM_ERROR);
+    }
+
+    /* if an ntuserid is being added, it must be the correct length */
+    if( (isNtUser) && ntuserid && (strlen( ntuserid ) > MAX_NTUSERID_LEN)) {
+	dsgw_error( DSGW_ERR_USERID_MAXLEN_EXCEEDED, NULL, 0, 0, NULL );
+	return(LDAP_PARAM_ERROR);
+    }
+
+    if ( verbose && pmods != NULL ) {
+	int		j, notascii;
+	unsigned long	k;
+	struct berval	*bvp;
+
+	for ( i = 0; pmods[ i ] != NULL; ++i ) {
+	    modop = pmods[ i ]->mod_op & ~LDAP_MOD_BVALUES;
+	    dsgw_emitf( "%s %s:\n", modop == LDAP_MOD_REPLACE ?
+		    "replace" : modop == LDAP_MOD_ADD ?
+		    "add" : "delete", pmods[ i ]->mod_type );
+	    if ( pmods[ i ]->mod_bvalues != NULL ) {
+		for ( j = 0; pmods[ i ]->mod_bvalues[ j ] != NULL; ++j ) {
+		    bvp = pmods[ i ]->mod_bvalues[ j ];
+		    notascii = 0;
+		    for ( k = 0; k < bvp->bv_len; ++k ) {
+			if ( !isascii( bvp->bv_val[ k ] )) {
+			    notascii = 1;
+			    break;
+			}
+		    }
+		    if ( notascii ) {
+			dsgw_emitf( XP_GetClientStr(DBT_TnotAsciiLdBytesN_), bvp->bv_len );
+		    } else {
+			dsgw_emitf( "\t\"%s\"\n", bvp->bv_val );
+		    }
+		}
+	    }
+	}
+    }
+
+    if ( verbose ) {
+	dsgw_emitf( "
\n" ); + fflush( stdout ); + } + + dsgw_emitf( "\n" ); + + /* + * apply the changes using LDAP + */ + if ( pmods == NULL ) { + if ( add ) { + dsgw_emits( XP_GetClientStr(DBT_noValuesWereEnteredPleaseTryAgai_) ); + lderr = LDAP_PARAM_ERROR; + } else { /* no changes -- just report success */ + lderr = LDAP_SUCCESS; + if ( !quiet ) { + dsgw_emitf( XP_GetClientStr(DBT_PSuccessfullyEditedEntryYourChan_) ); + } + } + } else { + if ( !quiet ) { + dsgw_emitf( XP_GetClientStr(DBT_PSendingSToTheDirectoryServerN_), + add ? XP_GetClientStr(DBT_information_) : XP_GetClientStr(DBT_changes_)); + fflush( stdout ); + } + + if ( add ) { + lderr = ldap_add_ext( ld, dn, pmods, NULL, NULL, &msgid ); + } else { + lderr = ldap_modify_ext( ld, dn, pmods, NULL, NULL, &msgid ); + } + + if( lderr == LDAP_SUCCESS ) { + if(( lderr = ldap_result( ld, msgid, 1, (struct timeval *)NULL, &res )) == -1 ) { + lderr = ldap_get_lderrno( ld, NULL, &errmsg ); + modify_error( lderr, errmsg ); + } else { + lderr = ldap_result2error( ld, res, 1 ); + if ( lderr == LDAP_SUCCESS ) { + if ( !quiet ) { + if ( add ) { + dsgw_emitf( XP_GetClientStr(DBT_PSuccessfullyAddedEntryN_) ); + } else { + dsgw_emitf( XP_GetClientStr(DBT_PSuccessfullyEditedEntryYourChan_) ); + } + } + } else { + (void)ldap_get_lderrno( ld, NULL, &errmsg ); + modify_error( lderr, errmsg ); + + /* Do some checks for password policy infractions. */ + if( lderr == LDAP_CONSTRAINT_VIOLATION ) { + if( errmsg && strstr( errmsg, "invalid password syntax" ) ) + dsgw_emitf( "
(%s)", XP_GetClientStr(DBT_InvalidPasswordSyntax_) ); + else if( errmsg && strstr( errmsg, "password in history" ) ) + dsgw_emitf( "
(%s)", XP_GetClientStr(DBT_PasswordInHistory_) ); + } + } + } + } else { + (void)ldap_get_lderrno( ld, NULL, &errmsg ); + modify_error( lderr, errmsg ); + } + + ldap_mods_free( pmods, 1 ); + } + + dsgw_emitf( "
\n" ); + return( lderr ); +} + + +static int +entry_delete( LDAP *ld, char *dn ) +{ + int lderr; + char *errmsg = NULL; + + dsgw_emitf( "\n" ); + if (( lderr = ldap_delete_s( ld, dn )) == LDAP_SUCCESS ) { + if ( !quiet ) { + dsgw_emitf( XP_GetClientStr(DBT_PSuccessfullyDeletedEntryN_) ); + } + } else { + (void)ldap_get_lderrno( ld, NULL, &errmsg ); + modify_error( lderr, errmsg ); + } + + dsgw_emitf( "\n" ); + return( lderr ); +} + + +static int +entry_modrdn( LDAP *ld, char *dn, char *newrdn, int deleteoldrdn ) +{ + int lderr; + char *errmsg = NULL; + + if ( verbose ) { + dsgw_emitf( XP_GetClientStr(DBT_PreTheNewNameForTheEntryIsSNPreH_), + newrdn ); + } + + dsgw_emitf( "\n" ); + if (( lderr = ldap_modrdn2_s( ld, dn, newrdn, deleteoldrdn )) + == LDAP_SUCCESS ) { + if ( !quiet ) { + dsgw_emitf( XP_GetClientStr(DBT_PSuccessfullyRenamedEntryN_) ); + } + } else { + (void)ldap_get_lderrno( ld, NULL, &errmsg ); + modify_error( lderr, errmsg ); + } + + dsgw_emitf( "\n" ); + return( lderr ); +} + + +static int +gather_passwd_changes( char *dn, LDAPMod ***pmodsp, int adding_entry, + int *pwdchangedp ) +{ + int lderr, lockpasswd; + char *bindpasswd, *newpasswd, *newpasswdconfirm, *errstring; + + lockpasswd = dsgw_get_boolean_var( "lockpasswd", 0, 0 ); + if ( lockpasswd ) { + /* + * the userPassword attribute to a special value that no password + * submitted by a user can ever match. + */ + time_t curtime; + struct tm *gmtp; + char *tstr; + + /* get string representation of current GMT time */ + curtime = time( NULL ); + gmtp = gmtime( &curtime ); + tstr = asctime( gmtp ); + + /* remove trailing newline */ + tstr[ strlen( tstr ) - 1 ] = '\0'; + + /* allocate room for "{crypt}LOCKED [" + tstr + " GMT]" + zero byte */ + newpasswd = dsgw_ch_malloc( 15 + strlen( tstr ) + 5 + 1 ); + sprintf( newpasswd, XP_GetClientStr(DBT_CryptLockedSGmt_), tstr ); + + } else if (( newpasswd = dsgw_get_cgi_var( "newpasswd", + DSGW_CGIVAR_OPTIONAL )) == NULL ) { + return( LDAP_SUCCESS ); /* not setting password -- nothing to do */ + } + + lderr = LDAP_PARAM_ERROR; /* pessimistic */ + + if ( !adding_entry && ( bindpasswd = dsgw_get_cgi_var( "passwd", + DSGW_CGIVAR_OPTIONAL )) == NULL && require_oldpasswd( dn )) { + errstring = XP_GetClientStr(DBT_youMustProvideTheOldPassword_); + } else if ( !lockpasswd && + (( newpasswdconfirm = dsgw_get_cgi_var( "newpasswdconfirm", + DSGW_CGIVAR_OPTIONAL )) == NULL || strcmp( newpasswd, + newpasswdconfirm ) != 0 )) { + errstring = XP_GetClientStr(DBT_theNewAndConfirmingPasswordsDoNo_); + } else { + addmodifyop( pmodsp, adding_entry ? LDAP_MOD_ADD : LDAP_MOD_REPLACE, + DSGW_ATTRTYPE_USERPASSWORD, newpasswd, strlen( newpasswd )); + *pwdchangedp = 1; + lderr = LDAP_SUCCESS; + } + + if ( lderr != LDAP_SUCCESS ) { + dsgw_emitf( "\n%s\n\n", errstring ); + } + + return( lderr ); +} + + +static void +modify_error( int lderr, char *lderrtxt ) +{ + dsgw_error( DSGW_ERR_LDAPGENERAL, dsgw_ldaperr2string( lderr ), + ( display_results_inline ? DSGW_ERROPT_INLINE : 0 ), + lderr, lderrtxt ); +} + + +/* + * this "addmodifyop" routine is lifted with minor changes from + * ldap/tools/ldapmodify.c + */ +static void +addmodifyop( LDAPMod ***pmodsp, int modop, char *attr, char *value, int vlen ) +{ + LDAPMod **pmods; + int i, j; + struct berval *bvp; + + if ( attr == NULL || *attr == '\0' ) { + return; + } + + pmods = *pmodsp; + modop |= LDAP_MOD_BVALUES; + + i = 0; + if ( pmods != NULL ) { + for ( ; pmods[ i ] != NULL && pmods[ i ]->mod_type != NULL; ++i ) { + if ( strcasecmp( pmods[ i ]->mod_type, attr ) == 0 && + pmods[ i ]->mod_op == modop ) { + break; + } + } + } + + if ( pmods == NULL || pmods[ i ] == NULL ) { + pmods = (LDAPMod **)dsgw_ch_realloc( pmods, (i + 2) * + sizeof( LDAPMod * )); + *pmodsp = pmods; + pmods[ i + 1 ] = NULL; + pmods[ i ] = (LDAPMod *)dsgw_ch_malloc( sizeof( LDAPMod )); + memset( pmods[ i ], 0, sizeof( LDAPMod )); + pmods[ i ]->mod_op = modop; + pmods[ i ]->mod_type = dsgw_ch_strdup( attr ); + } + + if ( value != NULL ) { + j = 0; + if ( pmods[ i ]->mod_bvalues != NULL ) { + for ( ; pmods[ i ]->mod_bvalues[ j ] != NULL; ++j ) { + ; + } + } + pmods[ i ]->mod_bvalues = + (struct berval **)dsgw_ch_realloc( pmods[ i ]->mod_bvalues, + (j + 2) * sizeof( struct berval * )); + pmods[ i ]->mod_bvalues[ j + 1 ] = NULL; + bvp = (struct berval *)dsgw_ch_malloc( sizeof( struct berval )); + pmods[ i ]->mod_bvalues[ j ] = bvp; + + bvp->bv_len = vlen; + bvp->bv_val = (char *)dsgw_ch_malloc( vlen + 1 ); + memcpy( bvp->bv_val, value, vlen ); + bvp->bv_val[ vlen ] = '\0'; + } +} + + +/* remove all modify ops that refer to "attr" */ +static void +remove_modifyops( LDAPMod **pmods, char *attr ) +{ + int i, found_attr; + + if ( pmods == NULL ) { + return; + } + + do { + found_attr = 0; + for ( i = 0 ; pmods[ i ] != NULL; ++i ) { + if ( strcasecmp( pmods[ i ]->mod_type, attr ) == 0 ) { + found_attr = 1; + break; + } + } + + if ( found_attr ) { + if ( pmods[ i ]->mod_bvalues != NULL ) { + ber_bvecfree( pmods[ i ]->mod_bvalues ); + } + free( pmods[ i ] ); + + for ( ; pmods[ i + 1 ] != NULL; ++i ) { + pmods[ i ] = pmods[ i + 1 ]; + } + pmods[ i ] = NULL; + } + + } while ( found_attr ); +} + + +static int +starts_with( char *s, char *startswith ) +{ + int len; + + len = strlen( startswith ); + return ( strlen( s ) > len && strncmp( s, startswith, len ) == 0 ); +} + + +/* + * there is one value in "postedval" but newlines must be changed to "$", + * '$' characters must be changed to \24, and '\' chars. changed to \5C + */ +static char ** +post2multilinevals( char *postedval ) +{ + int specials; + char *p, *r, **vals; + + vals = dsgw_ch_malloc( 2 * sizeof( char * )); + vals[ 1 ] = NULL; + + specials = 0; + for ( p = postedval; *p != '\0'; ++p ) { + if ( *p == '$' || *p == '\\' || *p == '\n' || *p == '\r') { + ++specials; + } + } + + /* allocate enough room to handle any necessary escaping */ + r = vals[ 0 ] = dsgw_ch_malloc( 2 * specials + strlen( postedval ) + 1 ); + + /* copy and escape as appropriate */ + for ( p = postedval; *p != '\0'; ++p ) { + if ( *p == '\n' || *p == '\r' ) { /* change to "$" */ + *r++ = '$'; + if ( *(p+1) != '\0' && *(p+1) != *p && + ( *(p+1) == '\n' || *(p+1) == '\r' )) { + ++p; /* skip next char. if sequence is "\r\n" or "\n\r" */ + } + } else if ( *p == '$' ) { /* change to "\24" */ + *r++ = '\\'; + *r++ = '2'; + *r++ = '4'; + } else { + *r++ = *p; + if ( *p == '\\' ) { /* change to "\5C" */ + *r++ = '5'; + *r++ = 'C'; + } + } + } + + *r = '\0'; + + return( vals ); +} + + +/* values are delimited by newlines, preceded by optional carriage returns */ +static char ** +post2vals( char *postedval ) +{ + int count, len; + char *p, *q, **vals; + + vals = NULL; + + count = 0; + for ( p = postedval; p != NULL && *p != '\0'; p = q ) { + /* skip any leading CRs or NLs */ + while (( *p == '\n' || *p == '\r' ) && *p != '\0' ) { + ++p; + } + if ( *p == '\0' ) { + break; + } + + /* find end of this line */ + if (( q = strchr( p, '\n' )) != NULL ) { + *q++ = '\0'; + } + + /* remove CR, if any */ + len = strlen( p ) - 1; + if ( p[ len ] == '\r' ) { + p[ len ] = '\0'; + } + + /* add to values array */ + vals = dsgw_ch_realloc( vals, ( count + 2 ) * sizeof( char * )); + vals[ count++ ] = p; + } + vals[ count ] = NULL; + + return( vals ); +} + + +/* + * Determine if we should insist that the old password for the entry + * we are modifying (modifydn) be POSTed. The rule we use is simply + * this: if the binddn and modifydn are the same, require the old + * password. This allows directory admins. to reset passwords while + * preventing normal users from having their password changed if they + * just happen to walk away from their computer for a while when they + * are authenticated to the gateway. + */ +static int +require_oldpasswd( char *modifydn ) +{ + return( dsgw_bound_as_dn( modifydn, 1 )); +} + + +/* + * search directory to find out if an attribute value is unique. If the + * value doesn't already exist or if it exists only in the same entry we + * are changing, we return LDAP_SUCCESS. If it does exist, we return + * LDAP_TYPE_OR_VALUE_EXISTS. If some other error occurs, we return another + * LDAP error code. + */ +static int +value_is_unique( LDAP *ld, char *dn, char *attr, char *value ) +{ + int rc, count; + char *attrs[2], *buf, *tmpdn, *attrdesc, *errmsg = NULL; + LDAPMessage *res, *e; + + /* allocate room for "(attr=value)" filter */ + buf = dsgw_ch_malloc( strlen( attr ) + strlen( value ) + 4 ); + sprintf( buf, "(%s=%s)", attr, value ); + + attrs[ 0 ] = attr; + attrs[ 1 ] = NULL; + + rc = ldap_search_s( ld, gc->gc_ldapsearchbase, LDAP_SCOPE_SUBTREE, + buf, attrs, 1, &res ); + free( buf ); + + if ( rc != LDAP_SUCCESS || res == NULL ) { + (void)ldap_get_lderrno( ld, NULL, &errmsg ); + modify_error( rc, errmsg ); + return( rc ); + } + + if (( count = ldap_count_entries( ld, res )) == 0 ) { + rc = LDAP_SUCCESS; + } else if ( count > 1 ) { + rc = LDAP_TYPE_OR_VALUE_EXISTS; + } else { /* found one entry: see if it is the entry we are modifying */ + if (( e = ldap_first_entry( ld, res )) == NULL || + ( tmpdn = ldap_get_dn( ld, e )) == NULL ) { + rc = ldap_get_lderrno( ld, NULL, NULL ); + } else if ( dsgw_dn_cmp( dn, tmpdn ) != 0 ) { + rc = LDAP_SUCCESS; /* same entry */ + } else { + rc = LDAP_TYPE_OR_VALUE_EXISTS; + } + } + + ldap_msgfree( res ); + + if ( rc == LDAP_TYPE_OR_VALUE_EXISTS ) { + buf = dsgw_ch_malloc( strlen( attr ) + 6 ); /* room for "desc_" */ + sprintf( buf, "desc_%s", attr ); + if (( attrdesc = dsgw_get_cgi_var( buf, DSGW_CGIVAR_OPTIONAL )) + == NULL ) { + attrdesc = attr; + } + free( buf ); + + dsgw_emits( "\n\n" ); + dsgw_emitf( XP_GetClientStr(DBT_BrTheSBSBIsAlreadyInUsePleaseCho_), attrdesc, value ); + dsgw_emits( "\n\n" ); + } + + return( rc ); +} diff --git a/dosearch.c b/dosearch.c new file mode 100644 index 0000000..5fbbd29 --- /dev/null +++ b/dosearch.c @@ -0,0 +1,382 @@ +/** --- BEGIN COPYRIGHT BLOCK --- + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + --- END COPYRIGHT BLOCK --- */ +/* + * dosearch.c -- CGI search handler -- HTTP gateway + */ + +#include "dsgw.h" + +static void get_request(char* hostport, char *dn, char *ldapquery); +static void post_request(); + + +int main( argc, argv, env ) + int argc; + char *argv[]; +#ifdef DSGW_DEBUG + char *env[]; +#endif +{ + int reqmethod; + char *qs = NULL; + char *dn = NULL; + char *hostport = NULL; + char *ldapquery = NULL; +#ifndef __LP64__ +#ifdef HPUX +#ifndef __ia64 + /* call the static constructors in libnls */ + _main(); +#endif +#endif +#endif + /* + * Parse out the GET args, if any. See the comments under + * get_request for an explanation of what's going on here + */ + if (( qs = getenv( "QUERY_STRING" )) != NULL && *qs != '\0' ) { + /* parse the query string: */ + auto char *p, *iter = NULL; + qs = dsgw_ch_strdup( qs ); + + for ( p = ldap_utf8strtok_r( qs, "&", &iter ); p != NULL; + p = ldap_utf8strtok_r( NULL, "&", &iter )) { + + /* + * Get the conf file name. It'll be translated + * into /dsgw/context/CONTEXT.conf if + * CONTEXT is all alphanumeric (no slahes, + * or dots). CONTEXT is passed into the cgi. + * if context=CONTEXT is not there, or PATH_INFO + * was used, then use dsgw.conf + */ + if ( !strncasecmp( p, "context=", 8 )) { + context = dsgw_ch_strdup( p + 8 ); + dsgw_form_unescape( context ); + continue; + } + + if ( !strncasecmp( p, "hp=", 3 )) { + hostport = dsgw_ch_strdup( p + 3 ); + dsgw_form_unescape( hostport ); + continue; + } + + if ( !strncasecmp( p, "ldq=", 4 )) { + ldapquery = dsgw_ch_strdup( p + 4 ); + dsgw_form_unescape( ldapquery ); + continue; + } + + if ( !strncasecmp( p, "dn=", 3 )) { + dn = dsgw_ch_strdup( p + 3 ); + dsgw_form_unescape( dn ); + continue; + } + + /* + * If it doesn't match any of the above, then + * tack it onto the end of ldapquery. + */ + if (ldapquery != NULL) { + ldapquery = dsgw_ch_realloc(ldapquery, sizeof(char *) * (strlen(ldapquery) + strlen(p) + 2)); + sprintf( ldapquery, "%s&%s", ldapquery, p ); + } + } + + free( qs ); qs = NULL; + } + + + reqmethod = dsgw_init( argc, argv, DSGW_METHOD_POST | DSGW_METHOD_GET ); + + /* + * Note: we don't call dsgw_send_header() here like we usually do because + * on a GET we may be asked to return a MIME type other than the default + * of text/html. For GET requests, we send the headers inside + * ldaputil.c:dsgw_ldapurl_search(). For POST requests, we send them + * below in post_request(). + */ + +#ifdef DSGW_DEBUG + dsgw_logstringarray( "env", env ); +#endif + + if ( reqmethod == DSGW_METHOD_GET ) { + get_request(hostport, dn, ldapquery); + } else { + post_request(); + } + + exit( 0 ); +} + + +static void +get_request(char* hostport, char *dn, char *ldapquery) +{ + int urllen = 0; + int argslen = 0; + char *p = NULL; + char *ldapurl = NULL; + + /* + * The following comment is kept here only as a reminder of the past. + * It is no longer relevant. See the next comment. - RJP + * + * On a GET request, we do an LDAP URL search (which will just display + * a single entry if all that is included is "host:port/DN"). + * The HTTP URL should be: + * .../dosearch[/host[:port]][?[dn=baseDN&][LDAPquery]] + * This will be converted to the LDAP URL: + * ldap://[host[:port]]/[baseDN][?LDAPquery] + * + * For compatibility with prior versions, the HTTP URL may be: + * .../dosearch/host[:port]/[baseDN][?LDAPquery] + * In this case, the host:port is required, since PATH_INFO can't + * start with a '/' (web server sees that as a different program). + * This older HTTP URL format is deprecated, because PATH_INFO is + * not 8-bit clean on Japanese Windows NT. + */ + + /* + * The only form supported now is: + * .../dosearch?context=BLAH[&hp=host[:port]][&dn=baseDN][&ldq=LDAPquery]] + * -RJP + */ + argslen = 0; + + /* get the length of all the args (dn, hostport, ldapquery)*/ + if (hostport != NULL) { + argslen += strlen(hostport); + } + + if (dn != NULL) { + argslen += strlen(dn); + } + + if (ldapquery != NULL) { + argslen += strlen(ldapquery); + } + + /* If nothing was supplied, exit*/ + if ( argslen == 0 ) { + dsgw_error( DSGW_ERR_MISSINGINPUT, NULL, DSGW_ERROPT_EXIT, 0, NULL ); + } + + /* Malloc the ldapurl*/ + urllen = LDAP_URL_PREFIX_LEN + argslen + 3; + p = ldapurl = (char *)dsgw_ch_malloc( urllen ); + + /*Slap on ldap:// */ + strcpy( p, LDAP_URL_PREFIX ); + p += LDAP_URL_PREFIX_LEN; + + /*Slap on host:port if there is one*/ + if ( hostport != NULL ) { + strcpy( p, hostport ); + } + + strcat( ldapurl, "/" ); + + /*Slap on /dn, if there is a dn */ + if ( dn != NULL ) { + strcat( ldapurl, dn ); + } + + /*Slap on ?ldapquery */ + if ( ldapquery != NULL ) { + sprintf( ldapurl + strlen( ldapurl ), "?%s", ldapquery ); + } + +#ifdef DSGW_DEBUG + dsgw_log( "get_request: processing LDAP URL \"%s\"\n", ldapurl ); +#endif + dsgw_ldapurl_search( NULL, ldapurl); +} + + +static void +post_request() +{ + char *modestr, *searchstring, *type, *base; + LDAP *ld; + LDAPFiltDesc *lfdp; + struct ldap_searchobj *solistp, *sop; + int authmode, mode, options; + + dsgw_send_header(); + + options = 0; + modestr = dsgw_get_cgi_var( "mode", DSGW_CGIVAR_REQUIRED ); + searchstring = dsgw_get_cgi_var( "searchstring", DSGW_CGIVAR_OPTIONAL ); + dsgw_remove_leading_and_trailing_spaces( &searchstring ); +#ifdef DSGW_DEBUG + if (searchstring) { + dsgw_log ("searchstring=\"%s\"\n", searchstring); + } else { + dsgw_log ("searchstring=NULL"); + } +#endif + + authmode = 0; + if ( strcasecmp( modestr, DSGW_SRCHMODE_AUTH ) == 0 ) { + /* + * treat authenticate as a variant of the smart search mode + */ + authmode = 1; + mode = DSGW_SRCHMODE_SMART_ID; + options |= DSGW_DISPLAY_OPT_AUTH; + } else if ( strcasecmp( modestr, DSGW_SRCHMODE_SMART ) == 0 ) { + mode = DSGW_SRCHMODE_SMART_ID; + } else if ( strcasecmp( modestr, DSGW_SRCHMODE_COMPLEX ) == 0 ) { + mode = DSGW_SRCHMODE_COMPLEX_ID; + } else if ( strcasecmp( modestr, DSGW_SRCHMODE_PATTERN ) == 0 ) { + mode = DSGW_SRCHMODE_PATTERN_ID; + } else { + dsgw_error( DSGW_ERR_SEARCHMODE, modestr, 0, 0, NULL ); + } + + if ( mode != DSGW_SRCHMODE_PATTERN_ID + && ( searchstring == NULL || *searchstring == '\0' )) { + dsgw_error( DSGW_ERR_NOSEARCHSTRING, NULL, DSGW_ERROPT_EXIT, 0, NULL ); + } + + if (( type = dsgw_get_cgi_var( "type", authmode ? DSGW_CGIVAR_OPTIONAL : + DSGW_CGIVAR_REQUIRED )) == NULL ) { + type = DSGW_SRCHTYPE_AUTH; + } + + if (( base = dsgw_get_cgi_var( "base", DSGW_CGIVAR_OPTIONAL )) == NULL ) { + base = gc->gc_ldapsearchbase; + } + + /* check for options (carried in boolean CGI variables) */ + if ( dsgw_get_boolean_var( "listifone", DSGW_CGIVAR_OPTIONAL, 0 )) { + options |= DSGW_DISPLAY_OPT_LIST_IF_ONE; + } + + if ( dsgw_get_boolean_var( "editable", DSGW_CGIVAR_OPTIONAL, 0 )) { + options |= DSGW_DISPLAY_OPT_EDITABLE; + } + + if ( dsgw_get_boolean_var( "link2edit", DSGW_CGIVAR_OPTIONAL, 0 )) { + options |= DSGW_DISPLAY_OPT_LINK2EDIT; + } + + if ( dsgw_get_boolean_var( "dnlist_js", DSGW_CGIVAR_OPTIONAL, 0 )) { + options |= DSGW_DISPLAY_OPT_DNLIST_JS; + } + + (void) dsgw_init_ldap( &ld, &lfdp, ( authmode == 1 ) ? 1 : 0, 0); + + if ( mode != DSGW_SRCHMODE_PATTERN_ID ) { + dsgw_init_searchprefs( &solistp ); + + if (( sop = dsgw_type2searchobj( solistp, type )) == NULL ) { + ldap_unbind( ld ); + dsgw_error( DSGW_ERR_UNKSRCHTYPE, type, DSGW_ERROPT_EXIT, 0, NULL ); + } + } + + switch( mode ) { + case DSGW_SRCHMODE_SMART_ID: + /* + * smart search mode -- try to do the right kind of search for the + * client based on what the user entered in the search box + */ + dsgw_smart_search( ld, sop, lfdp, base, searchstring, options ); + break; + + case DSGW_SRCHMODE_COMPLEX_ID: { + /* + * complex search mode -- construct a specific filter based on + * user's form selections + */ + int scope; + char *attrlabel, *matchprompt; + struct ldap_searchattr *sap; + struct ldap_searchmatch *smp; + + attrlabel = dsgw_get_cgi_var( "attr", DSGW_CGIVAR_REQUIRED ); + if (( sap = dsgw_label2searchattr( sop, attrlabel )) == NULL ) { + ldap_unbind( ld ); + dsgw_error( DSGW_ERR_UNKATTRLABEL, attrlabel, DSGW_ERROPT_EXIT, + 0, NULL ); + } + + matchprompt = dsgw_get_cgi_var( "match", DSGW_CGIVAR_REQUIRED ); + if (( smp = dsgw_prompt2searchmatch( sop, matchprompt )) == NULL ) { + ldap_unbind( ld ); + dsgw_error( DSGW_ERR_UNKMATCHPROMPT, matchprompt, + DSGW_ERROPT_EXIT, 0, NULL ); + } + + scope = dsgw_get_int_var( "scope", DSGW_CGIVAR_OPTIONAL, + sop->so_defaultscope ); + dsgw_pattern_search( ld, sop->so_objtypeprompt, + sap->sa_attrlabel, smp->sm_matchprompt, searchstring, + smp->sm_filter, sop->so_filterprefix, NULL, sap->sa_attr, + base, scope, searchstring, options ); + } + break; + + case DSGW_SRCHMODE_PATTERN_ID: { + /* + * pattern-based search mode (no searchprefs or filter file used) + */ + char *attr, *pattern, *prefix, *suffix, *searchdesc; + int scope; + + attr = dsgw_get_cgi_var( "attr", DSGW_CGIVAR_REQUIRED ); + pattern = dsgw_get_cgi_var( "filterpattern", DSGW_CGIVAR_REQUIRED ); + prefix = dsgw_get_cgi_var( "filterprefix", DSGW_CGIVAR_OPTIONAL ); + suffix = dsgw_get_cgi_var( "filtersuffix", DSGW_CGIVAR_OPTIONAL ); + scope = dsgw_get_int_var( "scope", DSGW_CGIVAR_OPTIONAL, + LDAP_SCOPE_SUBTREE ); + options |= DSGW_DISPLAY_OPT_CUSTOM_SEARCHDESC; + searchdesc = dsgw_get_cgi_var( "searchdesc", DSGW_CGIVAR_OPTIONAL ); + dsgw_pattern_search( ld, type, searchdesc, NULL, NULL, + pattern, prefix, suffix, attr, + base, scope, searchstring, options ); + } + break; + } + + ldap_unbind( ld ); +} diff --git a/dsgw-httpd.conf.in b/dsgw-httpd.conf.in new file mode 100644 index 0000000..8028036 --- /dev/null +++ b/dsgw-httpd.conf.in @@ -0,0 +1,46 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# Copyright (C) 2006 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# This file is the Apache config file that can be dropped into +# the /etc/httpd/conf.d directory to enable the dsgw. It uses ScriptAlias to +# enable incoming requests for CGIs in @cgiurl@ to execute CGIs in @cgibindir@ +# It then uses access control to allow clients to access files in the html +# directory @htmldir@, the html template directory @configdir@, and the +# CGI bin directory @cgibindir@ + +ScriptAlias @cgiuri@ "@cgibindir@" + + + AllowOverride None + Options None + Order allow,deny + Allow from all + + + + AllowOverride None + Options None + Order allow,deny + Allow from all + + + + AllowOverride None + Options None + Order allow,deny + Allow from all + diff --git a/dsgw.h b/dsgw.h new file mode 100644 index 0000000..caf9b3d --- /dev/null +++ b/dsgw.h @@ -0,0 +1,1094 @@ +/** --- BEGIN COPYRIGHT BLOCK --- + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + --- END COPYRIGHT BLOCK --- */ +/* + * dsgw.h -- defines for HTTP gateway + */ + +#include +#include +#include +#include +#include +#ifdef LINUX +#include +#endif +#include +#include +#include +#include + +#if defined( XP_WIN32 ) + +#include "proto-ntutil.h" + +#endif + +#include + +#ifdef AIXV4 +#include +#endif /* AIXV4 */ + +#include "dsgwi18n.h" + +#include +#include +#include + +#if defined( XP_WIN32 ) +#define DSGW_PATHSEP_CHAR '\\' +#define DSGW_PATHSEP_STR "\\" +#define DSGW_NULL_DEVICE "nul:" +#define DSGW_DELETE_CMD "del /Q" +#else +#define DSGW_PATHSEP_CHAR '/' +#define DSGW_PATHSEP_STR "/" +#define DSGW_NULL_DEVICE "/dev/null" +#define DSGW_DELETE_CMD "rm" +#endif + +#define MSIE40_DEFAULT_CHARSET "iso-8859-1,*,utf-8" + +/* Used to name the converter used to convert from the users charset to UTF8 */ +#define UNICODE_ENCODING_UTF_8 "UTF-8" +#define ISO_8859_1_ENCODING "ISO_8859-1" + +extern char *context ; +extern char *langwich; /* The language chosen by libsi18n. */ +extern char *countri; /* The language chosen by libsi18n. */ + +/* + * define DSGW_DEBUG to cause extensive debugging output to be written + * to /tmp/CGINAME and CGI's output written to /tmp/CGINAME.out + */ +/* #define DSGW_DEBUG */ /* turn on debugging output */ + +#define DSGW_UTF8_NBSP "\302\240" /* u00A8, in UTF-8 */ + +/* + * XXX the next group of #defines assume that HTTP server has cd'd to + * our CGI dir. + */ +#define SERVER_ROOT_PATH "../../.." +#define DSGW_CONFIGDIR_HTTP "../config/" +#define DSGW_CONFIGDIR_ADMSERV "../config/" +/*#define DSGW_CONFIGDIR_ADMSERV SERVER_ROOT_PATH "/admin-serv/config/"*/ +#define DSGW_DBSWITCH_FILE "dbswitch.conf" +#define DSGW_DBSWITCH_TMPFILE "dbswitch.tmp" +#define DSGW_TMPLDIR_HTTP "../config/" +#define DSGW_TMPLDIR_ADMSERV "../html/" +#define DSGW_DOCDIR_HTTP "../html" +#define DSGW_CONTEXTDIR_HTTP "../context/" +#define DSGW_HTMLDIR "../html" +#define DSGW_MANROOT SERVER_ROOT_PATH "/manual/" +#define DSGW_MANUALSHORTCUT ".MANUAL" +#define DSGW_MANUALSHORTCUT_LEN 7 +#define DSGW_ADMSERV_BINDIR "/admin-serv/bin/" +#define DSGW_USER_ADM_BINDIR "/user-environment/bin/" +#define DSGW_LCACHECONF_PPATH "ldap/config/" /* partial path from /userdb */ +#define DSGW_LCACHECONF_FILE "lcache.conf" +#define DSGW_TOOLSDIR "/ldap/tools" +#define DSGW_LDAPSEARCH "ldapsearch" +#define DSGW_LDAPMODIFY "ldapmodify" + +#define DSGW_SEARCHPREFSFILE "dsgwsearchprefs.conf" +#define DSGW_FILTERFILE "dsgwfilter.conf" +#define DSGW_CONFIGFILE "dsgw.conf" + +#define DSGW_CONFIG_LISTPREFIX "list-" +#define DSGW_CONFIG_DISPLAYPREFIX "display-" +#define DSGW_CONFIG_EDITPREFIX "edit-" +#define DSGW_CONFIG_ADDPREFIX "add-" + +#define DSGW_SRCHMODE_SMART "smart" +#define DSGW_SRCHMODE_SMART_ID 1 +#define DSGW_SRCHMODE_COMPLEX "complex" +#define DSGW_SRCHMODE_COMPLEX_ID 2 +#define DSGW_SRCHMODE_PATTERN "pattern" +#define DSGW_SRCHMODE_PATTERN_ID 3 +#define DSGW_SRCHMODE_AUTH "auth" +#define DSGW_SRCHMODE_AUTH_ID 4 + +#define DSGW_SRCHTYPE_AUTH "auth" + +#define LDAP_URL_PREFIX "ldap://" +#define LDAP_URL_PREFIX_LEN 7 +#define LDAPDB_URL_PREFIX "ldapdb://" +#define LDAPDB_URL_PREFIX_LEN 9 + +/* attribute types */ +#define DSGW_ATTRTYPE_OBJECTCLASS "objectClass" +#define DSGW_ATTRTYPE_HASUBORDINATES "hasSubordinates" +#define DSGW_ATTRTYPE_USERPASSWORD "userPassword" + +#define DSGW_ATTRTYPE_NTUSERDOMAINID "nTUserDomainId" +#define DSGW_ATTRTYPE_USERID "uid" + +#define DSGW_OC_NTUSER "ntuser" + +#define DSGW_ATTRTYPE_AIMSTATUSTEXT "nsaimstatustext" + +#if defined( XP_WIN32 ) +#include +#else +/* + * For Gateway's running on UNIX Platforms. + * These are all defined in on Win32. + */ + +/* + * Special Values and Constants - User + */ + +/* + * Privilege levels (USER_INFO_X field usriX_priv (X = 0/1)). + */ + +#define USER_PRIV_MASK 0x3 +#define USER_PRIV_GUEST 0 +#define USER_PRIV_USER 1 +#define USER_PRIV_ADMIN 2 + +/* + * Bit masks for field usriX_flags of USER_INFO_X (X = 0/1). + */ + +#define UF_SCRIPT 0x0001 +#define UF_ACCOUNTDISABLE 0x0002 +#define UF_HOMEDIR_REQUIRED 0x0008 +#define UF_LOCKOUT 0x0010 +#define UF_PASSWD_NOTREQD 0x0020 +#define UF_PASSWD_CANT_CHANGE 0x0040 + +/* + * Account type bits as part of usri_flags. + */ + +#define UF_TEMP_DUPLICATE_ACCOUNT 0x0100 +#define UF_NORMAL_ACCOUNT 0x0200 +#define UF_INTERDOMAIN_TRUST_ACCOUNT 0x0800 +#define UF_WORKSTATION_TRUST_ACCOUNT 0x1000 +#define UF_SERVER_TRUST_ACCOUNT 0x2000 + +#define UF_MACHINE_ACCOUNT_MASK ( UF_INTERDOMAIN_TRUST_ACCOUNT | \ + UF_WORKSTATION_TRUST_ACCOUNT | \ + UF_SERVER_TRUST_ACCOUNT ) + +#define UF_ACCOUNT_TYPE_MASK ( \ + UF_TEMP_DUPLICATE_ACCOUNT | \ + UF_NORMAL_ACCOUNT | \ + UF_INTERDOMAIN_TRUST_ACCOUNT | \ + UF_WORKSTATION_TRUST_ACCOUNT | \ + UF_SERVER_TRUST_ACCOUNT \ + ) + +#define UF_DONT_EXPIRE_PASSWD 0x10000 + + +#define UF_SETTABLE_BITS ( \ + UF_SCRIPT | \ + UF_ACCOUNTDISABLE | \ + UF_LOCKOUT | \ + UF_HOMEDIR_REQUIRED | \ + UF_PASSWD_NOTREQD | \ + UF_PASSWD_CANT_CHANGE | \ + UF_ACCOUNT_TYPE_MASK | \ + UF_DONT_EXPIRE_PASSWD \ + ) + +/* + * Bit masks for field usri2_auth_flags of USER_INFO_2. + */ + +#define AF_OP_PRINT 0x1 +#define AF_OP_COMM 0x2 +#define AF_OP_SERVER 0x4 +#define AF_OP_ACCOUNTS 0x8 +#define AF_SETTABLE_BITS (AF_OP_PRINT | AF_OP_COMM | \ + AF_OP_SERVER | AF_OP_ACCOUNTS) + +#endif /* XP_WIN32 */ + +#define MAX_NTUSERID_LEN 20 + +/* Types of privs in usri3_priv of struct USER_INFO_3 */ +#define DSGW_NT_UP_GUEST "Guest" +#define DSGW_NT_UP_USER "User" +#define DSGW_NT_UP_ADMIN "Admin" + +/* Meaning of flags in usri3_flags of struct USER_INFO_3 */ +#define DSGW_NT_UF_SCRIPT "Logon Script Executed" +#define DSGW_NT_UF_ACCOUNT_DISABLED "Account Disabled" +#define DSGW_NT_UF_HOMEDIR_REQD "Home Directory Required" +#define DSGW_NT_UF_PASSWD_NOTREQD "Password Not Required" +#define DSGW_NT_UF_PASSWD_CANT_CHANGE "User Cannot Change Password" +#define DSGW_NT_UF_LOCKOUT "Account Locked Out" +#define DSGW_NT_UF_DONT_EXPIRE_PASSWORD "Password Never Expires" + +#define DSGW_NT_UF_NORMAL_ACCOUNT "Default Account Type" +#define DSGW_NT_UF_TEMP_DUPLICATE_ACCOUNT "Temporary Account Type" +#define DSGW_NT_UF_TEMP_WRKSTN_TRUST_ACCOUNT "Workstation Account Type" +#define DSGW_NT_UF_TEMP_SERVER_TRUST_ACCOUNT "Server Account Type" +#define DSGW_NT_UF_TEMP_INTERDOMAIN_TRUST_ACCOUNT "Interdomain Trust Account Type" + +#define DSGW_NT_AF_OP_PRINT "Print Operator" +#define DSGW_NT_AF_OP_COMM "Backup Operator" +#define DSGW_NT_AF_OP_SERVER "Server Operator" +#define DSGW_NT_AF_OP_ACCOUNTS "Accounts Operator" + +/* HTTP request methods flags */ +#define DSGW_METHOD_GET 0x01 +#define DSGW_METHOD_POST 0x02 + +/* URL prefixes specific to our gateway */ +#define DSGW_URLPREFIX_MAIN_HTTP "lang?file=" +#define DSGW_URLPREFIX_MAIN_ADMSERV "" +/*#define DSGW_URLPREFIX_CGI_HTTP "../bin/"*/ +#define DSGW_URLPREFIX_CGI_HTTP "" +#define DSGW_URLPREFIX_CGI_ADMSERV "" +#define DSGW_URLPREFIX_BIN "/clients/dsgw/bin/" + +#define DSGW_URLPREFIX_MAIN DSGW_URLPREFIX_MAIN_HTTP + +#define DSGW_CGINAME_DOSEARCH "dosearch" +#define DSGW_CGINAME_BROWSE "browse" +#define DSGW_CGINAME_SEARCH "search" +#define DSGW_CGINAME_CSEARCH "csearch" +#define DSGW_CGINAME_AUTH "auth" +#define DSGW_CGINAME_EDIT "edit" +#define DSGW_CGINAME_DOMODIFY "domodify" +#define DSGW_CGINAME_TUTOR "tutor" +#define DSGW_CGINAME_DNEDIT "dnedit" +#define DSGW_CGINAME_LANG "lang" + +/* definitions for modes - they type of operation we are performing */ +/* These definitions need to match, one-for-one, the DSGW_CGINAMEs */ +#define DSGW_MODE_DOSEARCH 1 +#define DSGW_CGINUM_DOSEARCH DSGW_MODE_DOSEARCH +#define DSGW_MODE_BROWSE 2 +#define DSGW_CGINUM_BROWSE DSGW_MODE_BROWSE +#define DSGW_MODE_SEARCH 3 +#define DSGW_CGINUM_SEARCH DSGW_MODE_SEARCH +#define DSGW_MODE_CSEARCH 4 +#define DSGW_CGINUM_CSEARCH DSGW_MODE_CSEARCH +#define DSGW_MODE_AUTH 5 +#define DSGW_CGINUM_AUTH DSGW_MODE_AUTH +#define DSGW_MODE_EDIT 6 +#define DSGW_CGINUM_EDIT DSGW_MODE_EDIT +#define DSGW_MODE_DOMODIFY 7 +#define DSGW_CGINUM_DOMODIFY DSGW_MODE_DOMODIFY +#define DSGW_MODE_TUTOR 8 +#define DSGW_CGINUM_TUTOR DSGW_MODE_TUTOR +#define DSGW_MODE_DNEDIT 9 +#define DSGW_CGINUM_DNEDIT DSGW_MODE_DNEDIT +#define DSGW_MODE_LANG 10 +#define DSGW_CGINUM_LANG DSGW_MODE_LANG +#define DSGW_MODE_LASTMODE DSGW_MODE_LANG +#define DSGW_MODE_NUMMODES DSGW_MODE_LASTMODE +#define DSGW_MODE_UNKNOWN 99 + +/* error codes -- messages are in dsgw_errs[] array in error.c */ +#define DSGW_ERR_BADMETHOD 1 +#define DSGW_ERR_BADFORMDATA 2 +#define DSGW_ERR_NOMEMORY 3 +#define DSGW_ERR_MISSINGINPUT 4 +#define DSGW_ERR_BADFILEPATH 5 +#define DSGW_ERR_BADCONFIG 6 +#define DSGW_ERR_LDAPINIT 7 +#define DSGW_ERR_LDAPGENERAL 8 +#define DSGW_ERR_UNKSRCHTYPE 9 +#define DSGW_ERR_NOFILTERS 10 +#define DSGW_ERR_OPENHTMLFILE 11 +#define DSGW_ERR_SEARCHMODE 12 +#define DSGW_ERR_UNKATTRLABEL 13 +#define DSGW_ERR_UNKMATCHPROMPT 14 +#define DSGW_ERR_LDAPURL_NODN 15 +#define DSGW_ERR_LDAPURL_BADSCOPE 16 +#define DSGW_ERR_LDAPURL_NOTLDAP 17 +#define DSGW_ERR_LDAPURL_BAD 18 +#define DSGW_ERR_INTERNAL 19 +#define DSGW_ERR_OPENDIR 20 +#define DSGW_ERR_WRITEINDEXFILE 21 +#define DSGW_ERR_OPENINDEXFILE 22 +#define DSGW_ERR_SSLINIT 23 +#define DSGW_ERR_NO_MGRDN 24 +/* + * Note: do not add more error codes here! The cookie error codes use the + * same error code space as all the others. Go to the end of the "more error + * codes" section and add new error codes there. + */ + +/* Cookie db routines - error codes */ +#define DSGW_CKDB_KEY_NOT_PRESENT 25 +#define DSGW_CKDB_DBERROR 26 +#define DSGW_CKDB_EXPIRED 27 +#define DSGW_CKDB_RNDSTRFAIL 28 +#define DSGW_CKDB_NODN 29 +#define DSGW_CKDB_CANTOPEN 30 +#define DSGW_CKDB_CANTAPPEND 31 + +/* more error codes */ +#define DSGW_ERR_NOSECPATH 32 +#define DSGW_ERR_NOSEARCHSTRING 33 +#define DSGW_ERR_CONFIGTOOMANYARGS 34 +#define DSGW_ERR_ADMSERV_CREDFAIL 35 +#define DSGW_ERR_LDAPDBURL_NODN 36 +#define DSGW_ERR_LDAPDBURL_NOTLDAPDB 37 +#define DSGW_ERR_LDAPDBURL_BAD 38 +#define DSGW_ERR_LCACHEINIT 39 +#define DSGW_ERR_WSAINIT 40 +#define DSGW_ERR_SERVICETYPE 41 +#define DSGW_ERR_DBCONF 42 +#define DSGW_ERR_USERDB_PATH 43 +#define DSGW_ERR_UPDATE_DBSWITCH 44 +#define DSGW_ERR_ENTRY_NOT_FOUND 45 +#define DSGW_ERR_DB_ERASE 46 +#define DSGW_ERR_LOCALDB_PERMISSION_DENIED 47 +#define DSGW_ERR_NOATTRVALUE 48 +#define DSGW_ERR_USERID_REQUIRED 49 +#define DSGW_ERR_DOMAINID_NOTUNIQUE 50 +#define DSGW_ERR_USERID_DOMAINID_REQUIRED 51 +#define DSGW_ERR_USERID_MAXLEN_EXCEEDED 52 +#define DSGW_ERR_CHARSET_NOT_SUPPORTED 53 + +/* Return codes from dsgw_init_ldap() */ +#define DSGW_BOUND_ASUSER 1 +#define DSGW_BOUND_ANONYMOUS 2 + +/* NT Domain Id seperator */ +#define DSGW_NTDOMAINID_SEP ':' + +/* Cookie names */ +#define DSGW_BROWSESBCKNAME "nsdsgwbrowseSB" +#define DSGW_SEARCHSBCKNAME "nsdsgwsearchSB" +#define DSGW_AUTHCKNAME "nsdsgwauth" +#define DSGW_CKHDR "Set-cookie: " +#define DSGW_EXPSTR "expires=" +#define DSGW_UNAUTHSTR "[unauthenticated]" + +/* Name of cookie database - context will be appended to "cookies" for multiple GW's*/ +#define DSGW_COOKIEDB_FNAME SERVER_ROOT_PATH "/bin/slapd/authck/cookies" + +/* Default lifetime of authentication cookies (in seconds) */ +#define DSGW_DEF_AUTH_LIFETIME ( 60 * 60 ) /* one hour */ + +#define DSGW_SECS_PER_DAY ( 60 * 60 * 24 ) /* one day */ + +#define DSGW_CKPURGEINTERVAL ( 60 * 10 ) /* Ten minutes */ + +#define DSGW_MODIFY_GRACEPERIOD ( 60 * 5 ) /* Five minutes */ + +/* String used as DN in auth CGI to indicate "I want to bind as the root dn" */ +#define MGRDNSTR "MANAGER" + +/* + * Enum for NT Domain checking + */ +typedef enum _LDAPDomainIdStatus { + LDAPDomainIdStatus_Unique = 0, + LDAPDomainIdStatus_Nonunique = -1, + LDAPDomainIdStatus_NullAttr = -2, + LDAPDomainIdStatus_NullId = -3 +} LDAPDomainIdStatus; + +/* + * Structure used to associate LDAP objectClasses with display templates. + * These are defined by "template" config. file lines. + */ +typedef struct dsgwtmpl { + char *dstmpl_name; + char **dstmpl_ocvals; + struct dsgwtmpl *dstmpl_next; +} dsgwtmpl; + +/* + * Structures used to keep track of template sets which are used to support + * more than one way to view an entry. These are defined by "tmplset" + * config. file lines. + */ +typedef struct dsgwview { + char *dsview_caption; + char *dsview_template; + char *dsview_jscript; + struct dsgwview *dsview_next; +} dsgwview; + +typedef struct dsgwtmplset { + char *dstset_name; + dsgwview *dstset_viewlist; + int dstset_viewcount; + struct dsgwtmplset *dstset_next; +} dsgwtmplset; + +/* + * Structure used to hold information about Attribute Value Sets that are + * used with DS_ATTRVAL_SET entry display directives. These sets are defined + * by "attrvset" config. file lines. + */ +typedef struct dsgwavset { + char *dsavset_handle; + int dsavset_itemcount; + char **dsavset_values; + char **dsavset_prefixes; + char **dsavset_suffixes; + struct dsgwavset *dsavset_next; +} dsgwavset; + +/* + * Structure used to hold information about file include sets that are used + * with INCLUDESET directives. These sets are defined by "includeset" config. + * file lines. + */ +typedef struct dsgwinclset { + char *dsiset_handle; + int dsiset_itemcount; + char **dsiset_filenames; + struct dsgwinclset *dsiset_next; +} dsgwinclset; + +/* + * structure used to track locations where new entries can be added + * these are created based on the "location" config. file lines + */ +typedef struct dsgwloc { + char *dsloc_handle; /* short name */ + char *dsloc_fullname; /* friendly name */ + char *dsloc_dnsuffix; /* new entry location (a full DN) */ +} dsgwloc; + +/* + * structure used to track types of new entries that can be added + * these are created based on the "newtype" config. file lines + */ +typedef struct dsgwnewtype { + char *dsnt_template; /* name of add-XXX.html template */ + char *dsnt_fullname; /* friendly name */ + char *dsnt_rdnattr; /* attribute used to construct RDN */ + int *dsnt_locations; /* indexes into gc_locations array */ + int dsnt_loccount; /* number of dsnt_locations */ + struct dsgwnewtype *dsnt_next; +} dsgwnewtype; + +/* + * Structure used to hold mapping from LDAP attrs. to VCard properties + */ +typedef struct dsgwvcprop { + char *dsgwvcprop_property; /* VCard property name */ + char *dsgwvcprop_ldaptype; /* LDAP attribute type */ + char *dsgwvcprop_ldaptype2; /* only used for "n" prop. */ + char *dsgwvcprop_syntax; /* cis or mls only please! */ + struct dsgwvcprop *dsgwvcprop_next; +} dsgwvcprop; + +/* substring substitution structure */ +typedef struct dsgwsubst { + char *dsgwsubst_from; + char *dsgwsubst_to; + char **dsgwsubst_charsets; /* NULL => any charset */ + struct dsgwsubst *dsgwsubst_next; +} dsgwsubst; + +/* Configuration information structure */ +typedef struct dsgwconfig_t { + int gc_admserv; /* non-zero if running under admserv */ + int gc_enduser; /* if non-zero, running end-user CGI */ + char *gc_baseurl; + char *gc_ldapserver; + int gc_ldapport; + char *gc_ldapsearchbase; + char *gc_rootdn; + int gc_ldapssl; /* if non-zero, do LDAP over SSL */ + char *gc_securitypath; + int gc_configerr; /* if non-zero, there were cf errs */ + char *gc_configdir; /* path to our config files */ + char *gc_tmpldir; /* path to our HTML template files */ + char *gc_docdir; /* path to the HTML files*/ + char *gc_gwnametrans; /* The nametrans for the gateway (for FT)*/ + char *gc_urlpfxmain; /* URL prefix for dsgw main page */ + char *gc_urlpfxcgi; /* URL prefix for dsgw CGIs */ + char *gc_configerrstr; + char *gc_localdbconf; /* NULL if local DB not being used */ + /* otherwise - name of localdb conf */ + char *gc_binddn; /* DN to bind as if user info unknown */ + char *gc_bindpw; /* passwd to use if user info unknown */ + float gc_httpversion; /* client's HTTP version */ + char *gc_charset; /* character set used by CGIs & HTML */ + char *gc_NLS; /* directory used by libnls */ + char *gc_ClientLanguage; /* preferred language list */ + char *gc_AdminLanguage; /* administrator language list */ + char *gc_DefaultLanguage; /* default language list for either */ + char **gc_clientIgnoreACharset; /* browsers uses default charset + instead of accept-charsets */ + char *gc_orgcharturl; /* http base url for orgchart*/ + char *gc_orgchartsearchattr; /* Search attribute the orgchart uses*/ + int gc_aimpresence; /* enable aim presence*/ + dsgwtmpl *gc_templates; /* linked list */ + dsgwnewtype *gc_newentrytypes; /* linked list */ + dsgwloc *gc_newentrylocs; /* array of structures */ + int gc_newentryloccount; + dsgwtmplset *gc_tmplsets; /* linked list */ + dsgwavset *gc_avsets; /* linked list */ + dsgwinclset *gc_includesets; /* linked list */ + dsgwvcprop *gc_vcardproperties; /* linked list */ + int gc_httpskeysize; /* if non-zero, HTTPS is being used */ + int gc_sslrequired; + time_t gc_authlifetime; /* lifetime of cookies, in seconds */ + int gc_authrequired; /* if non-zero, disallow access unless + authenticated */ +#define DSGW_SSLREQ_NEVER 0 +#define DSGW_SSLREQ_WHENAUTHENTICATED 1 +#define DSGW_SSLREQ_ALWAYS 2 + dsgwsubst *gc_changeHTML; /* linked list */ + dsgwsubst *gc_l10nsets; /* linked list */ + /* + * The following aren't strictly config file options, but are put + * into the gc struct. + */ + int gc_mode; /* Mode (CGI being executed) */ +} dsgwconfig; + +/* + * Structure used to return broken-out ldapdb:// URL info + */ +typedef struct ldapdb_url_desc { + char *ludb_path; + char *ludb_dn; +} LDAPDBURLDesc; + + +/* template stuff */ +/* The number of templates defined */ +#define MAXTEMPLATE 30 + +/* The maximum number of variables for a given template */ +#define MAXVARS 4 + +/* The structure of a directive is fairly simple. You have: + * + * " +#define DIRECTIVE_END '>' + +/* A really big form line */ +#define BIG_LINE 1024 + +/* struct to track saved lines */ +typedef struct savedlines { + int svl_count; + int svl_current; + char **svl_line; +} savedlines; + + +typedef struct dsgwtmplinfo { + char *dsti_template; + int dsti_type; +#define DSGW_TMPLTYPE_LIST 1 +#define DSGW_TMPLTYPE_DISPLAY 2 +#define DSGW_TMPLTYPE_EDIT 3 +#define DSGW_TMPLTYPE_ADD 4 + unsigned long dsti_options; +#define DSGW_DISPLAY_OPT_LIST_IF_ONE 0x00000001 +#define DSGW_DISPLAY_OPT_AUTH 0x00000002 +#define DSGW_DISPLAY_OPT_EDITABLE 0x00000004 +#define DSGW_DISPLAY_OPT_ADDING 0x00000008 +#define DSGW_DISPLAY_OPT_LINK2EDIT 0x00000010 +#define DSGW_DISPLAY_OPT_DNLIST_JS 0x00000020 +#define DSGW_DISPLAY_OPT_CUSTOM_SEARCHDESC 0x00000040 + char **dsti_attrs; + unsigned long *dsti_attrflags; +#define DSGW_DSTI_ATTR_SEEN 0x00000001 + char **dsti_attrsonly_attrs; + char *dsti_sortbyattr; + int dsti_entrycount; + char *dsti_search2s; + char *dsti_search3s; + char *dsti_search4s; + char *dsti_searcherror; + char *dsti_searchlderrtxt; + LDAP *dsti_ld; + LDAPMessage *dsti_entry; + LDAPMessage *dsti_attrsonly_entry; + char *dsti_entrydn; + FILE *dsti_fp; + char **dsti_rdncomps; /* only set for new entries */ + savedlines *dsti_preludelines; /* only output once */ + savedlines *dsti_entrylines; /* output once for each entry */ +} dsgwtmplinfo; + + +/* + * HTML template directives that are specific to DSGW + * Note that most of these supported only in entrydisplay.c + */ +#define DRCT_DS_ENTRYBEGIN "DS_ENTRYBEGIN" +#define DRCT_DS_ENTRYEND "DS_ENTRYEND" +#define DRCT_DS_ATTRIBUTE "DS_ATTRIBUTE" +#define DRCT_DS_ATTRVAL_SET "DS_ATTRVAL_SET" +#define DRCT_DS_OBJECTCLASS "DS_OBJECTCLASS" +#define DRCT_DS_SORTENTRIES "DS_SORTENTRIES" +#define DRCT_DS_SEARCHDESC "DS_SEARCHDESC" +#define DRCT_DS_POSTEDVALUE "DS_POSTEDVALUE" +#define DRCT_DS_EDITBUTTON "DS_EDITBUTTON" +#define DRCT_DS_DELETEBUTTON "DS_DELETEBUTTON" +#define DRCT_DS_SAVEBUTTON "DS_SAVEBUTTON" +#define DRCT_DS_RENAMEBUTTON "DS_RENAMEBUTTON" +#define DRCT_DS_EDITASBUTTON "DS_EDITASBUTTON" +#define DRCT_DS_NEWPASSWORD "DS_NEWPASSWORD" +#define DRCT_DS_CONFIRM_NEWPASSWORD "DS_CONFIRM_NEWPASSWORD" +#define DRCT_DS_OLDPASSWORD "DS_OLDPASSWORD" +#define DRCT_DS_HELPBUTTON "DS_HELPBUTTON" +#define DRCT_DS_CLOSEBUTTON "DS_CLOSEBUTTON" +#define DRCT_DS_BEGIN_ENTRYFORM "DS_BEGIN_ENTRYFORM" +#define DRCT_DS_END_ENTRYFORM "DS_END_ENTRYFORM" +#define DRCT_DS_EMIT_BASE_HREF "DS_EMIT_BASE_HREF" +#define DRCT_DS_DNATTR "DS_DNATTR" +#define DRCT_DS_DNDESC "DS_DNDESC" +#define DRCT_DS_DNEDITBUTTON "DS_DNEDITBUTTON" +#define DRCT_DS_BEGIN_DNSEARCHFORM "DS_BEGIN_DNSEARCHFORM" +#define DRCT_DS_END_DNSEARCHFORM "DS_END_DNSEARCHFORM" +#define DRCT_DS_CONFIG_INFO "DS_CONFIG_INFO" +#define DRCT_DS_GATEWAY_VERSION "DS_GATEWAY_VERSION" +#define DRCT_DS_VIEW_SWITCHER "DS_VIEW_SWITCHER" +#define DRCT_DS_STD_COMPLETION_JS "DS_STD_COMPLETION_JS" +#define DRCT_HEAD "HEAD" +#define DRCT_DS_ALERT_NOENTRIES "DS_ALERT_NOENTRIES" +#define DRCT_DS_ORGCHARTLINK "DS_ORGCHARTLINK" + +/* + * directives supported inside dsgw_parse_line() itself (usable anywhere) + * Note that these are in addition to ones in the htmlparse.c templates array + */ +#define DRCT_DS_LAST_OP_INFO "DS_LAST_OP_INFO" + +/* + * directives supported by genscreen + */ +#define DRCT_DS_LOCATIONPOPUP "DS_LOCATIONPOPUP" + +/* + * these next few are supported by dsconfig + */ +#define DRCT_DS_INLINE_POST_RESULTS "DS_INLINE_POST_RESULTS" +#define DRCT_DS_CHECKED_IF_LOCAL "DS_CHECKED_IF_LOCAL" +#define DRCT_DS_CHECKED_IF_REMOTE "DS_CHECKED_IF_REMOTE" +#define DRCT_DS_HOSTNAME_VALUE "DS_HOSTNAME_VALUE" +#define DRCT_DS_PORT_VALUE "DS_PORT_VALUE" +#define DRCT_DS_CHECKED_IF_SSL "DS_CHECKED_IF_SSL" +#define DRCT_DS_CHECKED_IF_NOSSL "DS_CHECKED_IF_NOSSL" +#define DRCT_DS_SSL_CONFIG_VALUE "DS_SSL_CONFIG_VALUE" +#define DRCT_DS_BASEDN_VALUE "DS_BASEDN_VALUE" +#define DRCT_DS_BINDDN_VALUE "DS_BINDDN_VALUE" +#define DRCT_DS_BINDPASSWD_VALUE "DS_BINDPASSWD_VALUE" +#define DRCT_DS_NOCERTFILE_WARNING "DS_NOCERTFILE_WARNING" + +/* + * directives supported by dsimpldif + */ +#define DS_LDIF_FILE "DS_LDIF_FILE" +#define DS_CHECKED_IF_ERASE "DS_CHECKED_IF_ERASE" +#define DS_CHECKED_IF_NOTERASE "DS_CHECKED_IF_NOTERASE" +#define DS_CHECKED_IF_STOP "DS_CHECKED_IF_STOP" +#define DS_CHECKED_IF_NOTSTOP "DS_CHECKED_IF_NOTSTOP" + +#define DSGW_ARG_BUTTON_LABEL "label" +#define DSGW_ARG_BUTTON_NAME "name" + +/* + * directives supported by dsexpldif + */ +#define DS_SUFFIX "DS_SUFFIX" + +/* conditionals -- replaces "xxx" in directives */ +#define DSGW_COND_FOUNDENTRIES "FoundEntries" +#define DSGW_COND_ADDING "Adding" +#define DSGW_COND_EDITING "Editing" +#define DSGW_COND_DISPLAYING "Displaying" +#define DSGW_COND_BOUND "Bound" +#define DSGW_COND_BOUNDASTHISENTRY "BoundAsThisEntry" +#define DSGW_COND_ADMSERV "AdminServer" +#define DSGW_COND_LOCALDB "DirectoryIsLocalDB" +#define DSGW_COND_ATTRHASVALUES "AttributeHasValues" +#define DSGW_COND_ATTRHASTHISVALUE "AttributeHasThisValue" +#define DSGW_COND_POSTEDFORMVALUE "PostedFormValue" +#define DSGW_COND_DISPLAYORGCHART "DisplayOrgChart" +#define DSGW_COND_DISPLAYAIMPRESENCE "DisplayAimPresence" + +/* global variables */ +extern char *progname; /* set in dsgwutil.c:dsgw_init() */ +extern char *dsgw_last_op_info; /* set in edit.c and genscreen.c */ +extern char *dsgw_dnattr; /* set in edit.c */ +extern char *dsgw_dndesc; /* set in edit.c */ +extern int http_hdr_sent; /* set in dsgwutil.c:dsgw_send_header() */ +extern char *dsgw_html_body_colors; /* set in htmlparse.c */ +extern int dsgw_NSSInitializedAlready; /* set in cookie.c:dsgw_NSSInit */ + +/* function prototypes */ +/* + * in cgiutil.c + */ +int dsgw_post_begin( FILE *in ); +void dsgw_form_unescape( char *str ); +char *dsgw_get_cgi_var( char *varname, int required ); +int dsgw_get_int_var( char *varname, int required, int defval ); +int dsgw_get_boolean_var( char *varname, int required, int defval ); +char *dsgw_get_escaped_cgi_var( char *varname_escaped, char *varname, + int required ); +#define DSGW_CGIVAR_OPTIONAL 0 +#define DSGW_CGIVAR_REQUIRED 1 +char *dsgw_next_cgi_var( int *indexp, char **valuep ); + +/* + * in dsgwutil.c: + */ +extern dsgwconfig *gc; +int dsgw_init( int argc, char **argv, int methods_handled ); +int dsgw_simple_cond_is_true( int argc, char **argv, void *arg ); +char *dsgw_file2path( char *prefix, char *filename ); +char *dsgw_file2htmlpath( char *prefix, char *filename ); +void *dsgw_ch_malloc( size_t n ); +void *dsgw_ch_calloc( size_t nelem, size_t elsize ); +void *dsgw_ch_realloc( void *p, size_t n ); +char *dsgw_ch_strdup( const char *s ); +char *dsgw_escape_quotes( char *in ); +char *dsgw_get_translation( char *in ); +void dsgw_send_header(); +void dsgw_add_header( char *line ); +char *dsgw_get_auth_cookie(); +void dsgw_emit_helpbutton( char *topic ); +void dsgw_emit_homebutton(); +char *dsgw_build_urlprefix(); +void dsgw_init_searchprefs( struct ldap_searchobj **solistp ); +void dsgw_addtemplate( dsgwtmpl **tlpp, char *template, int count, + char **ocvals ); +dsgwtmpl *dsgw_oc2template( char **ocvals ); +void dsgw_remove_leading_and_trailing_spaces( char **sp ); +int dsgw_parse_cookie( char *cookie, char **rndstr, char **dn ); +char *dsgw_getvp( int cginum ); +#ifdef DSGW_DEBUG +void dsgw_log( char *fmt, ... ) +#ifdef __GNUC__ + __attribute__ ((format (printf, 1, 2))); +#else + ; +#endif +void dsgw_logstringarray( char *arrayname, char **strs ); +void dsgw_log_out (const char* s, size_t n); +#else +#define dsgw_log_out(s,n) ; +#endif /* DSGW_DEBUG */ +void dsgw_head_begin(); +void dsgw_quote_emptyFrame(); +void dsgw_password_expired_alert( char *binddn ); +time_t dsgw_current_time(); +time_t dsgw_time_plus_sec (time_t l, long r); +char *dsgw_server_url(); + +/* + * in entrydisplay.c + */ +dsgwtmplinfo *dsgw_display_init( int tmpltype, char *template, + unsigned long options ); +void dsgw_display_entry( dsgwtmplinfo *tip, LDAP *ld, LDAPMessage *entry, + LDAPMessage *attrsonly_entry, char *dn ); +void dsgw_display_done( dsgwtmplinfo *tip ); +char *dsgw_mls_convertlines( char *val, char *sep, int *linesp, int emitlines, + int quote_html_specials ); +void dsgw_set_searchdesc( dsgwtmplinfo *tip, char*, char*, char*); +void dsgw_set_search_result( dsgwtmplinfo *tip, int entrycount, + char *searcherror, char *lderrtxt ); + +/* + * in error.c + */ +void dsgw_error( int errcode, char *extra, int options, int lderr, + char *lderrtxt ); +#define DSGW_ERROPT_EXIT 0x01 +#define DSGW_ERROPT_IGNORE 0x02 +#define DSGW_ERROPT_TERSE 0x04 +#define DSGW_ERROPT_INLINE 0x08 +#define DSGW_ERROPT_DURINGBIND 0x10 +int dsgw_dn2passwd_error( int ckrc, int skipauthwarning ); +char* dsgw_err2string( int err ); +char *dsgw_ldaperr2string( int lderr ); + +/* + * in htmlout.c + */ +void dsgw_html_begin( char *title, int titleinbody ); +void dsgw_html_end( void ); +void dsgw_html_href( char *urlprefix, char *url, char *label, char *value, + char *extra ); +void dsgw_strcat_escaped( char *s1, const char *s2 ); +char *dsgw_strdup_escaped( const char *s ); +void dsgw_substitute_and_output( char *s, char *tag, char *value, int escape ); +void dsgw_form_begin( const char* name, const char* format, ... ) +#ifdef __GNUC__ + __attribute__ ((format (printf, 2, 3))); +#else + ; +#endif +char *dsgw_strdup_with_entities( char *s, int *madecopyp ); +void dsgw_HTML_emits( char * ); +void dsgw_emit_cgi_var( int argc, char **argv ); +void dsgw_emit_button( int argc, char **argv, const char* format, ... ) +#ifdef __GNUC__ + __attribute__ ((format (printf, 3, 4))); +#else + ; +#endif +void dsgw_emit_alertForm(); +void dsgw_emit_alert( const char* frame, const char* windowOptions, const char* fmt, ... ) +#ifdef __GNUC__ + __attribute__ ((format (printf, 3, 4))); +#else + ; +#endif +void dsgw_emit_confirmForm(); +void dsgw_emit_confirm( const char* frame, const char* yes, const char* no, + const char* windowOptions, int enquote, const char* fmt, ... ) +#ifdef __GNUC__ + __attribute__ ((format (printf, 6, 7))); +#else + ; +#endif + +/* + * in htmlparse.c: + */ +typedef int (*condfunc)( int argc, char **argv, void *arg ); +int dsgw_parse_line( char *line_input, int *argc, char ***argv, int parseonly, + condfunc conditionalfn, void *condarg ); +char *get_arg_by_name( char *name, int argc, char **argv ); +int dsgw_get_arg_pos_by_name( char *name, int argc, char **argv ); +FILE *dsgw_open_html_file( char *filename, int erropts ); +int dsgw_next_html_line(FILE *f, char *line); +void dsgw_argv_free( char **argv ); +savedlines *dsgw_savelines_alloc( void ); +void dsgw_savelines_free( savedlines *svlp ); +void dsgw_savelines_save( savedlines *svlp, char *line ); +void dsgw_savelines_rewind( savedlines *svlp ); +char *dsgw_savelines_next( savedlines *svlp ); +int dsgw_directive_is(char *target, char *directive); + +/* + * in ldaputil.c + */ +int dsgw_init_ldap( LDAP **ldp, LDAPFiltDesc **lfdpp, int skipac, int skipauthwarning ); +int dsgw_get_adm_identity( LDAP *ld, char **uidp, char **dnp, char **pwdp, + int erropts ); +void dsgw_ldap_error( LDAP *ld, int erropts ); +struct ldap_searchobj *dsgw_type2searchobj( struct ldap_searchobj *solistp, + char *type ); +struct ldap_searchattr *dsgw_label2searchattr( struct ldap_searchobj *sop, + char *label ); +struct ldap_searchmatch *dsgw_prompt2searchmatch( struct ldap_searchobj *sop, + char *prompt ); +void dsgw_smart_search( LDAP *ld, struct ldap_searchobj *sop, + LDAPFiltDesc *lfdp, char *base, char *value, unsigned long options ); +void dsgw_pattern_search( LDAP *ld, char *listtmpl, + char *searchdesc2, char *searchdesc3, char *searchdesc4, + char *filtpattern, char *filtprefix, char *filtsuffix, char *attr, + char *base, int scope, char *value, unsigned long options ); +void dsgw_ldapurl_search( LDAP *ld, char *ldapurl ); +void dsgw_read_entry( LDAP *ld, char *dn, char **ocvals, char *tmplname, + char **attrs, unsigned long options ); +int dsgw_ldap_entry_exists( LDAP *ld, char *dn, char **matchedp, + unsigned long erropts ); +char **dsgw_rdn_values( char *dn ); +char *dsgw_get_binddn( void ); +int dsgw_bound_as_dn( char *dn, int def_answer ); +int dsgw_dn_cmp( char *dn1, char *dn2 ); +int dsgw_is_dnparent( char *dn1, char *dn2 ); +char *dsgw_dn_parent( char *dn ); +void dsgw_emit_location_popup( LDAP *ld, int argc, char **argv, int erropts ); + +/* + * in config.c + */ +dsgwconfig *dsgw_read_config(); +int dsgw_update_dbswitch( dsgwconfig *cfgp, char *handle, int erropts ); +int dsgw_valid_docname(char *filename); +char *dsgw_get_docdir(void) ; + +typedef struct scriptrange { + unsigned long sr_min; + unsigned long sr_max; + struct scriptrange* sr_next; +} scriptrange_t; + +typedef struct scriptorder { + unsigned so_caseIgnoreAccents; + scriptrange_t** so_sort; + scriptrange_t** so_display; +} scriptorder_t; + +scriptorder_t* dsgw_scriptorder(); + + +/* + * in cookie.c + */ +char *dsgw_mkcookie(); +int dsgw_ckdn2passwd( char *cookie, char *dn, char **ret_pw ); +int dsgw_storecookie( char *cookie, char *dn, char *password, time_t expires ); +void dsgw_traverse_db(); +char *dsgw_t2gmts( time_t cktime ); +int dsgw_delcookie( char *cookie ); +void dsgw_closecookiedb( FILE *fp ); +FILE *dsgw_opencookiedb(); +time_t dsgw_getlastpurged( FILE *fp ); +int dsgw_purgedatabase( char *dn ); + +/* + * in emitauth.c + */ +void dsgw_emit_auth_form( char *binddn ); +void dsgw_emit_auth_dest( char *binddn, char* authdesturl ); + +/* + * in emitf.c + */ +int dsgw_emits (const char* s); /* like fputs(s, stdout) */ +int dsgw_emitf (const char* format, ...) /* like printf */ +#ifdef __GNUC__ + __attribute__ ((format (printf, 1, 2))); +#else + ; +#endif +int dsgw_emitfv (const char* format, va_list argl); +char* dsgw_emit_converts_to (char* charset); +int is_UTF_8 (const char* charset); +void* dsgw_emitn (void*, const char* buf, size_t len); +size_t dsgw_fputn (FILE*, const char* buf, size_t len); + +#define QUOTATION_JAVASCRIPT 2 +#define QUOTATION_JAVASCRIPT_MULTILINE 3 +void dsgw_quotation_begin (int kind); +void dsgw_quotation_end(); +int dsgw_quote_emits (int kind, const char* s); +int dsgw_quote_emitf (int kind, const char* format, ...) +#ifdef __GNUC__ + __attribute__ ((format (printf, 2, 3))); +#else + ; +#endif + +/* + * in collate.c + */ +#define CASE_EXACT 0 +#define CASE_INSENSITIVE 1 + +typedef int (*strcmp_t) (const char*, const char*); +strcmp_t dsgw_strcmp (int); + +typedef int (*valcmp_t) (const char**, const char**); +valcmp_t dsgw_valcmp (int); + +extern struct berval* dsgw_strkeygen (int, const char*); +extern struct berval* dsgw_key_first; +extern struct berval* dsgw_key_last; + +int LDAP_C LDAP_CALLBACK dsgw_keycmp (void*, const struct berval*, const struct berval*); +void LDAP_C LDAP_CALLBACK dsgw_keyfree(void*, const struct berval*); + +/* + * in vcard.c + */ +void dsgw_vcard_from_entry( LDAP *ld, char *dn, char *mimetype ); + +/* + * utf8compare.c + */ +int dsgw_utf8casecmp(unsigned char *s0, unsigned char *s1); +int dsgw_utf8ncasecmp(unsigned char *s0, unsigned char *s1, int n); + +/* + * dsgwutil.c + */ +/******************** Accept Language List ************************/\ + +/* AcceptLangList + * + * Will parse an Accept-Language string of the form + * "en;q=1.0,fr;q=0.9..." + * The ACCEPT_LANGUAGE_LIST array will be loaded with the ordered + * language elements based on the priority of the languages specified. + * The number of languages will be returned as the result of the + * call. + */ +size_t +AcceptLangList( + const char * acceptLanguage, + ACCEPT_LANGUAGE_LIST acceptLanguageList +); + +/* + * converts a buffer of characters to/from UTF8 from/to a native charset + * the given converter will handle the native charset + * returns 0 if not all of source was converted, 1 if all of source + * was converted, -1 upon error + * all of source will be converted if there is enough room in dest to contain + * the entire conversion, or if dest is null and we are malloc'ing space for dest + */ +int +dsgw_convert( + int direction, /* DSGW_TO_UTF8 or DSGW_FROM_UTF8 */ + UConverter *nativeConv, /* convert from/to native charset */ + char **dest, /* *dest is the destination buffer - if *dest == NULL, it will be malloced */ + size_t destSize, /* size of dest buffer (ignored if *dest == NULL) */ + size_t *nDest, /* number of chars written to dest */ + const char *source, /* source buffer to convert - either in native encoding (to) or utf8 (from) */ + size_t sourceSize, /* size of source buffer - if 0, assume source is NULL terminated */ + size_t *nSource, /* number of chars read from source buffer */ + UErrorCode *pErrorCode /* will be reset each time through */ +); +#define DSGW_TO_UTF8 0 +#define DSGW_FROM_UTF8 1 diff --git a/dsgw.spec.template b/dsgw.spec.template new file mode 100644 index 0000000..8e70a7d --- /dev/null +++ b/dsgw.spec.template @@ -0,0 +1,377 @@ +# BEGIN COPYRIGHT BLOCK +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# (C) 2006 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK + +############################################################################### +### L I N U X ### +############################################################################### + +%ifos Linux +%define nspr_name dirsec-nspr +%define nspr_devel_name dirsec-nspr-devel +%define nspr_version 4.6 +%define nss_name dirsec-nss +%define nss_devel_name dirsec-nss-devel +%define nss_version 3.11 +%define ldapcsdk_name mozldap +%define ldapcsdk_devel_name mozldap-devel +%define ldapcsdk_version 5.17 +# this is for the icu supplied with Fedora Core 5 and later +# dirsec version just uses icu and icu-devel +%define icu_name libicu +%define icu_bin_name icu +%define icu_devel_name libicu-devel +%define icu_version 3.4 +%define adminutil_name adminutil +%define adminutil_devel_name adminutil-devel +%define adminutil_version 1.0 +%define major 1 +%define minor 1 +%define brand fedora + +%ifarch i386 +Summary: Directory Server Gateway/Phonebook Web Application +%endif +%ifarch x86_64 ppc64 ia64 s390x +Summary: Directory Server Gateway/Phonebook Web Application [64-bit] +%endif +Name: dsgw +Version: %{major}.%{minor} +Release: 1 +License: GPL +URL: http://directory.fedora.redhat.com/wiki/DSGW +Group: System Environment/Daemons +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildRequires: %{nss_name} >= %{nss_version} +BuildRequires: %{nss_devel_name} >= %{nss_version} +BuildRequires: %{nspr_name} >= %{nspr_version} +BuildRequires: %{nspr_devel_name} >= %{nspr_version} +BuildRequires: %{ldapcsdk_name} >= %{ldapcsdk_version} +BuildRequires: %{ldapcsdk_devel_name} >= %{ldapcsdk_version} +BuildRequires: %{icu_name} >= %{icu_version} +BuildRequires: %{icu_bin_name} >= %{icu_version} +BuildRequires: %{icu_devel_name} >= %{icu_version} +BuildRequires: %{adminutil_name} >= %{adminutil_version} +BuildRequires: %{adminutil_devel_name} >= %{adminutil_version} +BuildRequires: gawk +Requires: %{nspr_name} >= %{nspr_version} +Requires: %{nss_name} >= %{nss_version} +Requires: %{ldapcsdk_name} >= %{ldapcsdk_version} +Requires: %{icu_name} >= %{icu_version} +Requires: %{adminutil_name} >= %{adminutil_version} + +Source0: %{name}-%{version}.tar.gz + +%define srcroot %{name}-%{version} + +%description +DSGW stands for Directory Server GateWay. This is a CGI based HTML phonebook and +user self service application for LDAP data. The HTML pages are customizable +templates that you can add/remove fields from. + +End User services +* Search and retrieve information about other LDAP users +* Self service editing of account information, including password change + +Administrator services +* Create and edit user and group entries + +%prep +%setup -q + +%build +PKG_CONFIG_PATH=%{_libdir}/pkgconfig ; export PKG_CONFIG_PATH + +# get nspr locations +NSPR_INCLUDE_DIR=`pkg-config --variable=includedir %{nspr_name}`; export NSPR_INCLUDE_DIR +NSPR_LIB_DIR=`pkg-config --variable=libdir %{nspr_name}`; export NSPR_LIB_DIR + +# get nss locations +NSS_INCLUDE_DIR=`pkg-config --variable=includedir %{nss_name}`; export NSS_INCLUDE_DIR +NSS_LIB_DIR=`pkg-config --variable=libdir %{nss_name}`; export NSS_LIB_DIR + +# get LDAP C SDK locations +LDAPCSDK_INCLUDE_DIR=`pkg-config --variable=includedir %{ldapcsdk_name}`; export LDAPCSDK_INCLUDE_DIR +LDAPCSDK_LIB_DIR=`pkg-config --variable=libdir %{ldapcsdk_name}`; export LDAPCSDK_LIB_DIR + +# get ICU location - ICU on Fedora Core 5 doesn't use pkg-config - it uses icu-config +ICU_PREFIX=`pkg-config --variable=prefix %{icu_name}` +if test -n "$ICU_PREFIX"; then +ICU_INCLUDE_DIR=`pkg-config --variable=includedir %{icu_name}`; export ICU_INCLUDE_DIR +ICU_LIB_DIR=`pkg-config --variable=libdir %{icu_name}`; export ICU_LIB_DIR +ICU_BIN_DIR=$ICU_PREFIX/bin; export ICU_BIN_DIR +else +ICU_INCLUDE_DIR=`icu-config --cppflags-searchpath | sed -e 's/-I//'` +ICU_LIB_DIR=`icu-config --ldflags-searchpath | sed -e 's/-I//'` +ICU_BIN_DIR=`icu-config --bindir` +fi + +# get adminutil locations +ADMINUTIL_INCLUDE_DIR=`pkg-config --variable=includedir %{adminutil_name}` +ADMINUTIL_LIB_DIR=`pkg-config --variable=libdir %{adminutil_name}` + +# force the use of the admin server +%configure --with-admserv=/opt/%{brand}-ds \ + --with-nspr-inc=$NSPR_INCLUDE_DIR -with-nspr-lib=$NSPR_LIB_DIR \ + --with-nss-inc=$NSS_INCLUDE_DIR -with-nss-lib=$NSS_LIB_DIR \ + --with-ldapsdk-inc=$LDAPCSDK_INCLUDE_DIR -with-ldapsdk-lib=$LDAPCSDK_LIB_DIR \ + --with-icu-inc=$ICU_INCLUDE_DIR -with-icu-lib=$ICU_LIB_DIR \ + --with-icu-bin=$ICU_BIN_DIR \ + --with-adminutil-inc=$ADMINUTIL_INCLUDE_DIR -with-adminutil-lib=$ADMINUTIL_LIB_DIR + +make + +%install +%{__rm} -rf $RPM_BUILD_ROOT +make DESTDIR=$RPM_BUILD_ROOT install + +%clean +%{__rm} -rf $RPM_BUILD_ROOT + +%files + +%endif # Linux + + +############################################################################### +### S O L A R I S ### +############################################################################### + +%ifos Solaris +%ifarch sparc +%define nspr_name RHATdirsec-nspr +%define nspr_devel_name RHATdirsec-nspr-devel +%define nss_name RHATdirsec-nss +%define nss_devel_name RHATdirsec-nss-devel +%define icu_name RHATicu +%define icu_devel_name RHATicu-devel +%define ldapcsdk_name RHATmozldap +%define ldapcsdk_devel_name RHATmozldap-devel +%define mylibdir %{_libdir} +%endif +%ifarch sparcv9 +%define nspr_name RHATdirsec-nsprx +%define nspr_devel_name RHATdirsec-nsprx-devel +%define nss_name RHATdirsec-nssx +%define nss_devel_name RHATdirsec-nssx-devel +%define icu_name RHATicux +%define icu_devel_name RHATicux-devel +%define ldapcsdk_name RHATmozldapx +%define ldapcsdk_devel_name RHATmozldapx-devel +%define mylibdir %{_libdir}/sparcv9 +%endif + +%define dirsec_nspr_name dirsec-nspr +%define nspr_version 4.6 +%define dirsec_nss_name dirsec-nss +%define nss_version 3.11 +%define dirsec_ldapcsdk_name mozldap +%define ldapcsdk_version 5.17 +%define dirsec_icu_name icu +%define icu_version 3.4 +%define major 1 +%define minor 0 + +%ifarch sparc +%define package_name RHATadminutil +%endif +%ifarch sparcv9 +%define package_name RHATadminutilx +%endif + +Name: adminutil +Version: %{major}.%{minor} +Release: 1 +%ifarch sparc +Summary: Administration Utility +%endif +%ifarch sparcv9 +Summary: Administration Utility [64-bit] +%endif +SUNW_Pkg: %{package_name} +BuildRequires: %{nspr_name} >= %{nspr_version} +BuildRequires: %{nspr_devel_name} >= %{nspr_version} +BuildRequires: %{nss_name} >= %{nss_version} +BuildRequires: %{nss_devel_name} >= %{nss_version} +BuildRequires: %{ldapcsdk_name} >= %{ldapcsdk_version} +BuildRequires: %{ldapcsdk_devel_name} >= %{ldapcsdk_version} +BuildRequires: %{icu_name} >= %{icu_version} +BuildRequires: %{icu_devel_name} >= %{icu_version} +Requires: %{nspr_name} >= %{nspr_version} +Requires: %{nss_name} >= %{nss_version} +Requires: %{ldapcsdk_name} >= %{ldapcsdk_version} +Requires: %{icu_name} >= %{icu_version} + +License: MPL/GPL/LGPL +URL: http://directory.fedora.redhat.com/wiki/AdminUtil +Group: System Environment/Libraries +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(/usr/xpg4/bin/id -u -n) + +Source0: %{name}-%{version}.tar.gz +Source1: %{name}.pc.in + +%define srcroot %{name}-%{version} + +%description +AdminUtil is a set of utility functions written in C, which are divided into 2 groups: libadminutil and libadmsslutil. They are mainly used in the Admin Server / CGI services to communicate with the configuration Directory Server. It covers, e.g., login to Admin Server using the authentication with the Directory Server. AdminUtil is needed to build the Admin Server as well as the Directory Server's admin components. + +%package devel +%ifarch sparc +Summary: Development libraries for Administration Utility +%endif +%ifarch sparcv9 +Summary: Development libraries for Administration Utility [64-bit] +%endif +SUNW_Pkg: %{package_name}-devel +Requires: %{package_name} >= %{version}-%{release} +Group: Development/Libraries + +%description devel +Header and Library files for doing development with the Administration Utility. + +%prep + +%setup -q + +%build +%ifarch sparcv9 +USE_64=1; export USE_64 +%endif + +PKG_CONFIG_PATH=%{mylibdir}/pkgconfig ; export PKG_CONFIG_PATH + +# get nspr locations +NSPR_INCLUDE_DIR=`pkg-config --variable=includedir %{dirsec_nspr_name}`; export NSPR_INCLUDE_DIR +NSPR_LIB_DIR=`pkg-config --variable=libdir %{dirsec_nspr_name}`; export NSPR_LIB_DIR + +# get nss locations +NSS_INCLUDE_DIR=`pkg-config --variable=includedir %{dirsec_nss_name}`; export NSS_INCLUDE_DIR +NSS_LIB_DIR=`pkg-config --variable=libdir %{dirsec_nss_name}`; export NSS_LIB_DIR + +# get LDAP C SDK locations +LDAPCSDK_INCLUDE_DIR=`pkg-config --variable=includedir %{dirsec_ldapcsdk_name}`; export LDAPCSDK_INCLUDE_DIR +LDAPCSDK_LIB_DIR=`pkg-config --variable=libdir %{dirsec_ldapcsdk_name}`; export LDAPCSDK_LIB_DIR + +# get ICU location +ICU_PREFIX=`pkg-config --variable=prefix %{dirsec_icu_name}` +ICU_INCLUDE_DIR=`pkg-config --variable=includedir %{dirsec_icu_name}`; export ICU_INCLUDE_DIR +ICU_LIB_DIR=`pkg-config --variable=libdir %{dirsec_icu_name}`; export ICU_LIB_DIR +ICU_BIN_DIR=$ICU_PREFIX/bin; export ICU_BIN_DIR + +# Make all with the optimize mode +# (replace "optimize" with "debug" for the debug build) +gzip -cd %{SOURCE0} | tar xvf - +cd %{srcroot} +make BUILD_DEBUG=%{build_debug} + +# Set up our package file +mkdir -p $RPM_BUILD_ROOT%{mylibdir}/pkgconfig +cat %{SOURCE1} | sed -e "s,%%libdir%%,%{mylibdir},g" \ + -e "s,%%baselib%%,%{_libdir},g" \ + -e "s,%%prefix%%,%{_prefix},g" \ + -e "s,%%exec_prefix%%,%{_prefix},g" \ + -e "s,%%includedir%%,%{_includedir}/%{name},g" \ + -e "s,%%NSPR_VERSION%%,%{nspr_version},g" \ + -e "s,%%NSS_VERSION%%,%{nss_version},g" \ + -e "s,%%MOZLDAP_VERSION%%,%{ldapcsdk_version},g" \ + -e "s,%%ICU_VERSION%%,%{icu_version},g" \ + -e "s,%%ADMINUTIL_VERSION%%,%{version},g" > \ + $RPM_BUILD_ROOT%{mylibdir}/pkgconfig/%{name}.pc + +%install +# There is no make install target so we'll do it ourselves. + +# Create directories required by our packages +mkdir -p $RPM_BUILD_ROOT%{_includedir}/%{name} +mkdir -p $RPM_BUILD_ROOT%{_includedir}/%{name}/libadminutil +mkdir -p $RPM_BUILD_ROOT%{_includedir}/%{name}/libadmsslutil +mkdir -p $RPM_BUILD_ROOT%{mylibdir}/%{name}/%{name}-properties + +# Copy the binary libraries we want +for file in libadminutil.so libadmsslutil.so +do + install -m 644 %{srcroot}/built/%{name}/*.OBJ/lib/$file $RPM_BUILD_ROOT%{mylibdir}/%{name} +done + +# Copy the resource file +for file in libadminutil_root.res +do + install -m 644 %{srcroot}/built/%{name}/*.OBJ/lib/%{name}-properties/$file $RPM_BUILD_ROOT%{mylibdir}/%{name}/%{name}-properties +done + +# Copy the include files +for file in %{srcroot}/include/libadminutil/*.h +do + install -m 644 $file $RPM_BUILD_ROOT%{_includedir}/%{name}/libadminutil +done +for file in %{srcroot}/include/libadmsslutil/*.h +do + install -m 644 $file $RPM_BUILD_ROOT%{_includedir}/%{name}/libadmsslutil +done + +# Rename the libraries and create the symlinks +cd $RPM_BUILD_ROOT/%{mylibdir}/%{name} +for file in libadminutil.so libadmsslutil.so +do + mv $file $file.%{major}.%{minor} + ln -s $file.%{major}.%{minor} $file.%{major} + ln -s $file.%{major} $file +done + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%attr(0755,root,sys) %dir %{_prefix} +%attr(0755,root,bin) %dir %{_libdir} +%ifarch sparcv9 +%attr(0755,root,bin) %dir %{mylibdir} +%endif +%attr(0755,root,bin) %dir %{mylibdir}/%{name} +%attr(0755,root,bin) %{mylibdir}/%{name}/libadminutil.so +%attr(0755,root,bin) %{mylibdir}/%{name}/libadmsslutil.so +%attr(0755,root,bin) %{mylibdir}/%{name}/libadminutil.so.%{major} +%attr(0755,root,bin) %{mylibdir}/%{name}/libadmsslutil.so.%{major} +%attr(0755,root,bin) %{mylibdir}/%{name}/libadminutil.so.%{major}.%{minor} +%attr(0755,root,bin) %{mylibdir}/%{name}/libadmsslutil.so.%{major}.%{minor} +%attr(0755,root,bin) %dir %{mylibdir}/%{name}/%{name}-properties +%attr(0644,root,bin) %{mylibdir}/%{name}/%{name}-properties/libadminutil_root.res + +%files devel +%attr(0755,root,sys) %dir %{_prefix} +%attr(0755,root,sys) %dir %{_libdir} +%ifarch sparcv9 +%attr(0755,root,sys) %dir %{mylibdir} +%endif +%attr(0755,root,sys) %dir %{mylibdir}/pkgconfig +%attr(0644,root,root) %{mylibdir}/pkgconfig/%{name}.pc +%attr(0755,root,bin) %dir %{_includedir} +%attr(0755,root,other) %dir %{_includedir}/%{name} +%attr(0755,root,other) %dir %{_includedir}/%{name}/libadminutil +%attr(0755,root,other) %dir %{_includedir}/%{name}/libadmsslutil +%attr(0644,root,root) %{_includedir}/%{name}/libadminutil/*.h +%attr(0644,root,root) %{_includedir}/%{name}/libadmsslutil/*.h + +%endif # Solaris + +############################################################################### +### C H A N G E L O G ### +############################################################################### + +%changelog diff --git a/dsgwgetlang.c b/dsgwgetlang.c new file mode 100644 index 0000000..1e4a189 --- /dev/null +++ b/dsgwgetlang.c @@ -0,0 +1,334 @@ +/** BEGIN COPYRIGHT BLOCK + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + * END COPYRIGHT BLOCK **/ + +#include +#include +#include +#include +#include + +#include "libadminutil/resource.h" +#include "dsgwi18n.h" + +static char *database_name; +static Resource *i18nResource; + +/********************************************************************* + strReplace replaces the first instance of from in target with to. + from can be "": to is inserted at start of target. + to can be "": from is removed from target. + if from is not found, 0 is returned; else 1 is returned. + *********************************************************************/ + +static int +strReplace(char* target,char* from,char* to) +{ + /* replace /from/to/ in target */ + + char* pFrom; + char* pOldTail; + int lenTo; + + pFrom = strstr(target,from); + if (pFrom) { + pOldTail = pFrom+strlen(from); + lenTo = strlen(to); + memmove(pFrom+lenTo,pOldTail,strlen(pOldTail)+1); + memcpy(pFrom,to,lenTo); + return 1; + } + + return 0; +} + +/********************************************************************* + statFileDir is a wrapper to stat() that strips trailing slashes + because stat() on Windows seems to return -1 otherwise. +*********************************************************************/ + +static int +statFileDir(const char *path, struct stat *info) { + int ret, pathlen; + char *newpath = strdup(path); + + if(newpath == NULL) + return -1; + + for (pathlen = (strlen(newpath) - 1); pathlen >= 0; pathlen--) { + if (newpath[pathlen] == '/' || newpath[pathlen] == '\\') { + newpath[pathlen] = '\0'; + } else { + break; + } + } + + ret = stat(newpath, info); + + if (newpath) + free(newpath); + + return ret; +} + +/********************************************************************* + GetLanguage is reserved for future use. These APIs are not belong + to this file. It needs to be moved to somewhere which knows what's + the current language setting. + *********************************************************************/ + +static char emptyString[] = ""; + +static char client_language[128] = "en"; +static char admin_language[128] = "en"; +static char default_language[128] = "en"; + +PR_IMPLEMENT( void ) +SetLanguage(int type, char *language) +{ + switch(type) { + case CLIENT_LANGUAGE: + if (language) + strcpy(client_language, language); + break; + case ADMIN_LANGUAGE: + if (language) + strcpy(admin_language, language); + break; + case DEFAULT_LANGUAGE: + if (language) + strcpy(default_language, language); + break; + } + return ; +} + + + +PR_IMPLEMENT( char* ) +GetClientLanguage(void) +{ + if (client_language) + return client_language; + else + return emptyString; +} + +PR_IMPLEMENT( char* ) +GetAdminLanguage(void) +{ + if (admin_language) + return admin_language; + else + return emptyString; +} + +PR_IMPLEMENT( char* ) +GetDefaultLanguage(void) +{ + if (default_language) + return default_language; + else + return "en"; +} + +/********************************************************************* + GetFileForLanguage looks for a file in the appropriate language. + *********************************************************************/ + +PR_IMPLEMENT( int ) +GetFileForLanguage(char* filePath,char* language,char* existingFilePath) +{ + /* Input: filePath,language + * filePath is of the form "/xxx/xxx/$$LANGDIR/xxx/xxx/filename" + * or of the form "/xxx/xxx/xxx/xxx/filename". + * filename may or may not have an extension. + * language is an Accept-Language list; each language-range will be + * tried as a subdirectory name and possibly as a filename modifier. + * "*" is ignored - default always provided if needed. + * "-" is replaced by "_". + * $$LANGDIR is a special string replaced by language. It is optional. + * For the default case, $$LANGDIR/ is replaced by nothing + * (so // is not created). + * + * Returned: existingPath + * existingFilePath is the path of a satisfactory, existing file. + * if no file is found, an empty string "" is returned. + * + * int returned: -1 if no file found (existingFilePath = "") + * 0 if default file is returned + * 1 if language file is returned (any in list) + * + * Example: + * filePath = "/path/$$LANGDIR/filename.ext" + * language = "language" + * GetDefaultLanguage() --> "default" + * LANG_DELIMIT = "_" + * + * 1. Try: "/path/language/filename.ext" + * 2. Try: "/path/filename_language.ext" + * 3. Try: "/path/default/filename.ext" + * 4. Try: "/path/filename_default.ext" + * 5. Try: "/path/filename.ext" + * else: "" + * + * Example: + * language = "en-us;q=0.6,ja;q=0.8,en-ca" + * + * 1. Try: "/path/en-ca/filename.ext" + * 2. Try: "/path/filename_en_ca.ext" + * 3. Try: "/path/ja/filename.ext" + * 4. Try: "/path/filename_ja.ext" + * 5. Try: "/path/en_us/filename.ext" + * 6. Try: "/path/filename_en_us.ext" + * 7. Try: "/path/default/filename.ext" + * 8. Try: "/path/filename_default.ext" + * 9. Try: "/path/filename.ext" + * else: "" + * + */ + +#define LANG_DELIMIT '_' + + int pattern; + char* pDot; + char* pSlash; + + /* PRFileInfo info; */ + struct stat info; + + char lang_modifier[MAX_ACCEPT_LENGTH+1]; + + ACCEPT_LANGUAGE_LIST acceptLanguageList; + int numLang; + int iLang; + int iCase; + + + /* escape in case XP_InitStringDatabase has not been called */ + if (filePath==NULL) { + *existingFilePath = '\0'; + return -1; + } + + pattern = (strstr(filePath,"$$LANGDIR/")!=NULL); + + for ( iCase=1 ; iCase>=0 ; iCase-- ) { + if (iCase==1) { /* iCase=1 tries requested language */ + numLang = XP_AccLangList(language,acceptLanguageList); + } else { /* iCase=0 tries default language */ + numLang = XP_AccLangList(GetDefaultLanguage(),acceptLanguageList); + } + + for ( iLang=0 ; iLang=pDot) { + pDot = strchr(existingFilePath,'\0'); + } + sprintf(lang_modifier,"%c%s",LANG_DELIMIT,acceptLanguageList[iLang]); + strReplace(pDot,emptyString,lang_modifier); + + if (statFileDir(existingFilePath,&info)==0) { + return iCase; + } + + /* + if (PR_GetFileInfo(existingFilePath,&info)==PR_SUCCESS) { + return iCase; + } + */ + } + } + } + + /* Try: /path/filename.ext */ + { + strcpy(existingFilePath,filePath); + strReplace(existingFilePath,"$$LANGDIR/",emptyString); + + if (statFileDir(existingFilePath,&info)==0) { + return 0; + } + + /* + if (PR_GetFileInfo(existingFilePath,&info)==PR_SUCCESS) { + return 0; + } + */ + } + + /* Else: */ + *existingFilePath = '\0'; + return -1; +} + +PR_IMPLEMENT( char * ) +XP_GetClientStr(int key) +{ + char keybuf[256]; + PR_snprintf(keybuf, sizeof(keybuf), "%s%d", database_name, key); + return (char *)res_getstring(i18nResource, keybuf, GetClientLanguage()); +} + +PR_IMPLEMENT( void ) +XP_InitStringDatabase(const char *path, const char *dbname) +{ + database_name = strdup(dbname); + i18nResource = res_init_resource(path, database_name); +} diff --git a/dsgwi18n.h b/dsgwi18n.h new file mode 100644 index 0000000..839668d --- /dev/null +++ b/dsgwi18n.h @@ -0,0 +1,150 @@ +/** BEGIN COPYRIGHT BLOCK + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + * END COPYRIGHT BLOCK **/ + +#ifndef DSGWI18N_H +#define DSGWI18N_H + +#include "prtypes.h" + +#include "libadminutil/resource.h" + +/* + * Function prototypes for application and libraries + */ + + +#ifdef __cplusplus +extern "C" +{ +#endif + +/* Given the LibraryName, Language and Token, extracts the string corresponding + to that library and token from the database in the language requested and + returns a pointer to the string. Note: Use the macros XP_GetClientStr() and + XP_GetAdminStr() defined below to simplify source code. */ + +/*****************/ +/* SetLanguage() */ +/*****************/ +enum +{ + CLIENT_LANGUAGE, + ADMIN_LANGUAGE, + DEFAULT_LANGUAGE +}; + +PR_EXTERN( void ) +SetLanguage(int type, char *language); + +/* Set language for Client, Admin and Default, XP_GetStringFromDatabase will + base on the setting to retrieve correct string for specific language */ + +/***********************/ +/* GetClientLanguage() */ +/***********************/ + +PR_EXTERN( char* ) +GetClientLanguage(void); + +/* Returns a pointer to a string with the name of the language requested by + the current client; intended to be passed to XP_GetStringFromDatabase() + and used by the front end macro XP_GetClientStr(). */ + +/**********************/ +/* GetAdminLanguage() */ +/**********************/ + +PR_EXTERN( char* ) +GetAdminLanguage(void); + +/* Returns a pointer to a string with the name of the language requested by + the administrator; intended to be passed to XP_GetStringFromDatabase() + and used by the front end macro XP_GetAdminStr(). */ + +/************************/ +/* GetDefaultLanguage() */ +/************************/ + +PR_EXTERN( char* ) +GetDefaultLanguage(void); + +/* Returns a pointer to a string with the name of the default language + for the installation from the configuration file. */ + +/************************/ +/* GetFileForLanguage() */ +/************************/ + +PR_EXTERN( int ) +GetFileForLanguage(char* filepath,char* language,char* existingFilepath); + +/* Looks for a file in the appropriate language. + + Input: filePath,language + filePath is of the form "/xxx/xxx/$$LANGDIR/xxx/xxx/filename" + or of the form "/xxx/xxx/xxx/xxx/filename". + filename may or may not have an extension. + language is an Accept-Language list; each language-range will be + tried as a subdirectory name and possibly as a filename modifier. + "*" is ignored - default always provided if needed. + "-" is replaced by "_". + $$LANGDIR is a special string replaced by language. It is optional. + For the default case, $$LANGDIR/ is replaced by nothing + (so // is not created). + + Returned: existingPath + existingFilePath is the path of a satisfactory, existing file. + if no file is found, an empty string "" is returned. + + int returned: -1 if no file found (existingFilePath = "") + 0 if default file is returned + 1 if language file is returned (any in list) */ + +PR_EXTERN( char * ) +XP_GetClientStr(int); + +/* Return a string from the resource database */ + +PR_EXTERN( void ) +XP_InitStringDatabase(const char *path, const char *dbname); + +#ifdef __cplusplus +} +#endif + +#endif /* DSGWI18N_H */ diff --git a/dsgwutil.c b/dsgwutil.c new file mode 100644 index 0000000..36729b8 --- /dev/null +++ b/dsgwutil.c @@ -0,0 +1,1341 @@ +/** --- BEGIN COPYRIGHT BLOCK --- + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + --- END COPYRIGHT BLOCK --- */ +/* + * dsgwutil.c -- misc. utility functions -- HTTP gateway + */ + +#include /* PATH_MAX */ +#include "dsgw.h" +#include "dbtdsgw.h" +#include "dsgwi18n.h" +#include "libadminutil/distadm.h" +#include "prprf.h" + +#ifdef DSGW_DEBUG +#include +#include +#endif /* DSGW_DEBUG */ + +static char **vpmap = NULL; + +extern char *Versionstr; /* from Versiongw.c */ + +char *progname; /* set by dsgw_init() */ +dsgwconfig *gc; /* set by dsgw_init() */ +int http_hdr_sent = 0; /* non-zero if header has been sent */ +char **header_lines = NULL; /* null-terminated array of hdr lines */ +char *dsgw_html_body_colors = ""; /* reset by dsgw_init() */ + +/*Global context variable, telling the CGI's where to look for the config file*/ +char *context = NULL; /* Gotten from the QUERY_STRING */ +char *langwich = NULL; /* The language that libsi18n + picks from acceptlang*/ +char *countri = NULL; /* The country that libsi18n + picks from acceptlang*/ + + +static void figure_out_langwich(void); + +/* + * dsgw_init -- initialize a dsgw CGI program: + * set "progname" global based on "progpath" (normally argv[0]) + * check that REQUEST_METHOD is in "methods_handled" mask + * if request method is "POST", read HTML form variables from stdin + * handles the context variable if the CGI was called with a post. + * The context variable tells dsgw_read_config what config file + * to read. + * + * If an fatal error occurs, -1 is returned. + * If all goes well, returns either DSGW_METHOD_GET or DSGW_METHOD_POST + */ +int +dsgw_init( int argc, char **argv, int methods_handled ) +{ + char *m, *s; + int method; + int c, err; + + (void)ADMUTIL_Init(); + + /* initialize the string database */ + XP_InitStringDatabase("../property", "dsgw"); + /* set default default languages for string database */ + SetLanguage(CLIENT_LANGUAGE, ""); + SetLanguage(ADMIN_LANGUAGE, ""); + SetLanguage(DEFAULT_LANGUAGE, ""); + + if (( progname = strchr( argv[0], '/' )) == NULL ) { + progname = dsgw_ch_strdup( argv[0] ); +#ifdef _WIN32 + if (( s = strrchr( progname, '.' )) != NULL + && strcasecmp( s, ".EXE" ) == 0 ) { + *s = '\0'; + } +#endif /* _WIN32 */ + } else { + ++progname; + } + + while (( c = getopt( argc, argv, "v" )) != EOF ) { + if ( c == 'v' ) { + printf( "%s\n", Versionstr ); + } + exit( 0 ); + } + +#ifdef DSGW_DEBUG + dsgw_log( "%s started\n", Versionstr ); +#endif + err = method = 0; + + /*Have to get the context before we read the config file.*/ + if (( m = getenv( "REQUEST_METHOD" )) != NULL ) { + if ( strcasecmp( m, "GET" ) == 0 || strcasecmp( m, "HEAD" ) == 0 ) { + method = DSGW_METHOD_GET; + } else if ( strcasecmp( m, "POST" ) == 0 ) { + method = DSGW_METHOD_POST; + if (( err = dsgw_post_begin( stdin )) == 0 ) { + context = dsgw_get_cgi_var( "context", DSGW_CGIVAR_OPTIONAL ); + } + } + } + + if ( method == 0 || ( methods_handled & method ) == 0 ) { + dsgw_error( DSGW_ERR_BADMETHOD, NULL, DSGW_ERROPT_EXIT, 0, NULL ); + } + + /*If no context was given, try default.conf.*/ + if (context == NULL) { + context = dsgw_ch_strdup("default"); + } + + gc = dsgw_read_config(); + + gc->gc_charset = dsgw_emit_converts_to (gc->gc_charset); + { + /* eliminate elements of gc_changeHTML that don't apply to gc_charset: */ + auto dsgwsubst **s = &(gc->gc_changeHTML); + auto char *charset = gc->gc_charset; + if ( charset == NULL ) charset = ""; /* Latin-1, implicitly */ + while ( *s ) { + auto char **c = (*s)->dsgwsubst_charsets; + if ( c && *c ) { + for ( ; *c; ++c ) { + if ( strcasecmp( *c, charset ) == 0 ) { + break; + } + } + if ( *c == NULL ) { + *s = (*s)->dsgwsubst_next; /* eliminate **s */ + /* This is quick and dirty: we just created garbage. */ + continue; + } + } + s = &((*s)->dsgwsubst_next); + } + } + + /* set languages for string database */ + SetLanguage(CLIENT_LANGUAGE,gc->gc_ClientLanguage); + SetLanguage(ADMIN_LANGUAGE,gc->gc_AdminLanguage); + SetLanguage(DEFAULT_LANGUAGE,gc->gc_DefaultLanguage); + + /* Figure out the language that libsi18n is using */ + figure_out_langwich(); + + /* Get the port and servername */ + if (method == DSGW_METHOD_POST) { + if (( s = dsgw_get_cgi_var( "ldapport", DSGW_CGIVAR_OPTIONAL )) != NULL ) { + gc->gc_ldapport = atoi( s ); + free( s ); + } + if (( s = dsgw_get_cgi_var( "ldapserver", DSGW_CGIVAR_OPTIONAL )) != NULL ) { + gc->gc_ldapserver = s; + } + + } + + if (( s = getenv( "HTTPS" )) == NULL || strcasecmp( s, "on" ) == 0 || + ( s = getenv( "HTTPS_KEYSIZE" )) == NULL ) { + gc->gc_httpskeysize = 0; + } else { + gc->gc_httpskeysize = atoi( s ); + } + + /* set default color scheme */ + if ( method == DSGW_METHOD_POST && ( s = dsgw_get_cgi_var( "colors", + DSGW_CGIVAR_OPTIONAL )) != NULL ) { + dsgw_html_body_colors = s; + } else if ( gc->gc_admserv ) { /* use same color scheme as libadmin */ + dsgw_html_body_colors = "BGCOLOR=\"#C0C0C0\" LINK=\"#0000EE\" " + "VLINK=\"#551A8B\" ALINK=\"#FF0000\""; + } else { + dsgw_html_body_colors = "BGCOLOR=\"white\""; + } + + return( method ); +} + + +/* + * function called back by dsgw_parse_line() to evaluate IF directives. + * return non-zero for true, zero for false. + */ +int +dsgw_simple_cond_is_true( int argc, char **argv, void *arg /* UNUSED */ ) +{ + if ( strcasecmp( argv[0], DSGW_COND_ADMSERV ) == 0 ) { + return( gc->gc_admserv ); + } + + if ( strcasecmp( argv[0], DSGW_COND_LOCALDB ) == 0 ) { + return( gc->gc_localdbconf != NULL ); + } + + if ( strcasecmp( argv[0], DSGW_COND_POSTEDFORMVALUE ) == 0 ) { + /* + * format of IF statment is: + * <-- IF "PostedFormValue" "VARNAME" "VALUE" --> + * where VARNAME is the name of a POSTed CGI variable to look for and + * VALUE is an optional value to test it against. If VALUE is omitted, + * the test is just for the presence of a variable named VARNAME. + */ + char *postedvalue; + + if ( argc < 2 || ( postedvalue = dsgw_get_cgi_var( argv[1], + DSGW_CGIVAR_OPTIONAL )) == NULL ) { + return( 0 ); /* VARNAME is missing or not posted */ + } else if ( argc < 3 ) { + return( 1 ); /* VALUE is missing, so return true */ + } else { + return( strcasecmp( postedvalue, argv[ 2 ] ) == 0 ); + } + } + + return( 0 ); +} + + +/* + * return a pointer to a malloc'd string containing the path to + * config. file "filename", based on the DSGW_CONFIGDIR define. + * If "filename" contains "..", or "//" this is treated as a fatal + * error. If "prefix" is not NULL, it is pre-pended to "filename" + */ +char * +dsgw_file2path( char *prefix, char *filename ) +{ + char *path, *pattern; + int len; + + if ( strstr( filename, "//" ) != NULL || + strstr( filename, ".." ) != NULL ) { + dsgw_error( DSGW_ERR_BADFILEPATH, filename, DSGW_ERROPT_EXIT, 0, NULL ); + } + + if ( prefix == NULL ) { + prefix = ""; + } + + /* allocate buffers with enough extra room to fit "$$LANGDIR/" */ + len = strlen( prefix ) + strlen( filename ) + 11; + if ( NULL != gc->gc_ClientLanguage ) { + len += strlen( gc->gc_ClientLanguage ); + } + path = dsgw_ch_malloc( len ); + pattern = dsgw_ch_malloc( len ); + + /* call GetFileForLanguage() to do its I18n magic */ + sprintf( pattern, "%s$$LANGDIR/%s", prefix, filename ); + if ( GetFileForLanguage( pattern, gc->gc_ClientLanguage, path ) < 0 ) { + sprintf( path, "%s%s", prefix, filename ); /* fallback */ + } + free( pattern ); + + return( path ); +} + + + +/* + * return a pointer to a malloc'd string containing the path to + * config. file "filename", based on the DSGW_HTMLDIR define. + * If "filename" contains "..", or "//" this is treated as a fatal + * error. If "prefix" is not NULL, it is pre-pended to "filename" + */ +char * +dsgw_file2htmlpath( char *prefix, char *filename ) +{ + char *path, *pattern; + int len; + + if ( strstr( filename, "//" ) != NULL || + strstr( filename, ".." ) != NULL ) { + dsgw_error( DSGW_ERR_BADFILEPATH, filename, DSGW_ERROPT_EXIT, 0, NULL ); + } + + if ( prefix == NULL ) { + prefix = ""; + } + + /* allocate buffers with enough extra room to fit "$$LANGDIR/" */ + /*len = strlen( DSGW_HTMLDIR ) + strlen( prefix ) + strlen( filename ) + 11;*/ + len = strlen( gc->gc_docdir ) + strlen( prefix ) + strlen( filename ) + 11; + if ( NULL != gc->gc_ClientLanguage ) { + len += strlen( gc->gc_ClientLanguage ); + } + + path = dsgw_ch_malloc( len ); + pattern = dsgw_ch_malloc( len ); + + /* call GetFileForLanguage() to do its I18n magic */ + sprintf( pattern, "%s%s$$LANGDIR/%s", gc->gc_docdir, prefix, filename ); + if ( GetFileForLanguage( pattern, gc->gc_ClientLanguage, path ) < 0 ) { + /* use fallback */ + sprintf( path, "%s/%s%s", gc->gc_docdir, prefix, filename ); + } + free( pattern ); + + return( path ); +} + + +/* + * malloc that checks for NULL return value and exits upon failure + */ +void * +dsgw_ch_malloc( size_t n ) +{ + void *p; + + if (( p = malloc( n )) == NULL ) { + dsgw_error( DSGW_ERR_NOMEMORY, NULL, DSGW_ERROPT_EXIT, 0, NULL ); + } + + return( p ); +} + +void * +dsgw_ch_calloc( size_t nelem, size_t elsize ) +{ + register void *p = calloc( nelem, elsize ); + if ( p == NULL ) { + dsgw_error( DSGW_ERR_NOMEMORY, NULL, DSGW_ERROPT_EXIT, 0, NULL ); + } + return( p ); +} + +/* + * realloc that checks for NULL return value and exits upon failure + * we also handle p == NULL by doing a malloc + */ +void * +dsgw_ch_realloc( void *p, size_t n ) +{ + if ( p == NULL ) { + p = malloc( n ); + } else { + p = realloc( p, n ); + } + + if ( p == NULL ) { + dsgw_error( DSGW_ERR_NOMEMORY, NULL, DSGW_ERROPT_EXIT, 0, NULL ); + } + + return( p ); +} + + +/* + * strdup that checks for NULL return value and exits upon failure + */ +char * +dsgw_ch_strdup( const char *s ) +{ + int len; + char *p; + + len = strlen( s ) + 1; + p = dsgw_ch_malloc( len ); + memcpy( p, s, len ); + return( p ); +} + + + +/* + * Escape any single- or double-quotes with a '\'. Used when generating + * JavaScript code. Returns a malloc'd string which the caller is + * responsible for freeing. + */ +char * +dsgw_escape_quotes( char *in ) +{ + char *out; + char *p, *t; + int nq = 0; + + + if ( in == NULL ) { + return NULL; + } + /* count number of quotes */ + for ( p = in; *p != '\0'; p++ ) { + if ( *p == '\'' || *p == '"' ) { + nq++; + } + } + out = dsgw_ch_malloc(( p - in ) + nq + 1 ); + for ( p = in, t = out; *p != '\0'; p++ ) { + if ( *p == '\'' || *p == '"' ) { + *t++ = '\\'; + } + *t++ = *p; + } + *t = '\0'; + return out; +} + +char * +dsgw_get_translation( char *in ) +{ + dsgwsubst *p; + +#ifdef DSGW_DEBUG + dsgw_log( "L10n map table:\n" ); + for ( p = gc->gc_l10nsets; p ; p = p->dsgwsubst_next ) { + dsgw_log( "%s -> %s\n", p->dsgwsubst_from, p->dsgwsubst_to ); + } +#endif + + for ( p = gc->gc_l10nsets; p ; p = p->dsgwsubst_next ) { + if ( !strcasecmp( in, p->dsgwsubst_from )) + return p->dsgwsubst_to; + } + return in; +} + +static void +dsgw_puts (const char* s) +{ + dsgw_fputn (stdout, s, strlen(s)); +} + +#define CONTENT_TYPE "Content-type" +#define TYPE_HTML "text/html" +#define VARY "Vary" +#define VARYLIST "Accept-Language,Accept-Charset,User-Agent" + +static const char* ct_prefix = CONTENT_TYPE ": " TYPE_HTML; +static const char* cs_prefix = ";charset="; +static const char* vr_prefix = VARY ": "; + +/* + * Send the headers we've accumulated. + */ +void +dsgw_send_header() +{ + int i; + + if ( http_hdr_sent ) { + return; + } + if ( header_lines == NULL ) { + dsgw_puts (ct_prefix); + if ( gc != NULL && gc->gc_charset != NULL && *gc->gc_charset != '\0' ) { + dsgw_puts (cs_prefix); dsgw_puts (gc->gc_charset ); + } + dsgw_puts ("\n"); + /* send Vary tag if HTTP/1.1 or greater */ + if ( NULL != gc && gc->gc_httpversion >= 1.1 ) { + dsgw_puts (vr_prefix); dsgw_puts (VARYLIST); dsgw_puts ("\n"); + } + } else for ( i = 0; header_lines[ i ] != NULL; i++ ) { + dsgw_puts (header_lines[ i ]); + dsgw_puts ("\n"); + } + dsgw_puts ("\n"); + http_hdr_sent = 1; +} + + +/* + * Add a line to the array of header lines. + */ +void +dsgw_add_header( char *line ) +{ + int i; + + if ( header_lines == NULL ) { + header_lines = ( char ** ) dsgw_ch_malloc( 3 * sizeof( char * )); + if ( gc != NULL && gc->gc_charset != NULL && *gc->gc_charset != '\0' ) { + header_lines[ 0 ] = dsgw_ch_malloc( strlen( ct_prefix ) + + strlen( cs_prefix ) + strlen( gc->gc_charset ) + 1 ); + sprintf( header_lines[ 0 ], "%s%s%s", ct_prefix, cs_prefix, + gc->gc_charset ); + } else { + header_lines[ 0 ] = dsgw_ch_strdup( ct_prefix ); + } + /* send Vary tag if HTTP/1.1 or greater */ + if ( gc->gc_httpversion >= 1.1 ) { + header_lines[ 1 ] = + dsgw_ch_malloc( strlen( vr_prefix ) + sizeof( VARYLIST ) ); + /* (char *) */ /* string literal */ + sprintf( header_lines[ 1 ], "%s%s", vr_prefix, VARYLIST ); + header_lines[ 2 ] = NULL; + } else { + header_lines[ 1 ] = NULL; + } + } + for ( i = 0; header_lines[ i ] != NULL; i++ ); + header_lines = (char **) dsgw_ch_realloc( header_lines, + ( i + 2 ) * sizeof( char * )); + header_lines[ i ] = dsgw_ch_strdup( line ); + header_lines[ i + 1 ] = NULL; +} + + +/* + * Check the environment for an authentication cookie. Returns the + * entire auth cookie if present, or returns NULL if no such cookie + * exists. The returned string must be freed by the caller. + */ +char * +dsgw_get_auth_cookie() +{ + char *p, *e, *ckhdr; + + ckhdr = getenv( "HTTP_COOKIE" ); + + if ( ckhdr == NULL ) { + return NULL; + } else { + ckhdr = strdup( ckhdr ); + } + + if (( p = strstr( ckhdr, DSGW_AUTHCKNAME )) == NULL ) { + free( ckhdr ); + return NULL; + } + + if (( e = strchr( p, ';' )) != NULL ) { + *e = '\0'; + } + + p = strdup( p ); + free( ckhdr ); + return p; +} + + + +/* + * Break a cookie into its random string and DN parts. The DN is returned + * unescaped. The caller is responsible for freeing the returned DN + * and random string. Returns 0 on success, -1 on error. If the + * cookie has the value "[unauthenticated]", then 0 is returned and + * dn is set to NULL; + */ +int +dsgw_parse_cookie( char *cookie, char **rndstr, char **dn ) +{ + char *p, *r; + int rlen; + + if ( cookie == NULL ) { + *rndstr = *dn = NULL; + return -1; + } + + /* Make sure cookie starts with "nsdsgwauth" */ + if ( strncmp( cookie, DSGW_AUTHCKNAME, strlen( DSGW_AUTHCKNAME ))) { + /* Cookie didn't start with "nsdsgwauth" */ + *rndstr = *dn = NULL; + return -1; + } + + r = cookie + strlen( DSGW_AUTHCKNAME ); + if ( *r == '=' ) { + r++; + } + + /* Is cookie value "[unauthenticated]" ? */ + if ( !strncmp( r, DSGW_UNAUTHSTR, strlen( DSGW_UNAUTHSTR ))) { + *rndstr = strdup( DSGW_UNAUTHSTR ); + *dn = NULL; + return 0; + } + + /* find start of DN */ + if (( p = strrchr( cookie, ':' )) == NULL ) { + *rndstr = *dn = NULL; + return -1; + } + + rlen = p - r + 1; + *(rndstr) = dsgw_ch_malloc( rlen ); + *(rndstr)[ 0 ] = '\0'; + strncat( *rndstr, r, rlen-1 ); + (*rndstr)[ rlen - 1 ] = '\0'; + + p++; + *dn = strdup( p ); + dsgw_form_unescape( *dn ); + + return 0; +} + +/* + * Generate a "go home" button with a link to the main entry point for + * the gateway. The caller is responsible for any surrounding + * HTML, e.g.
and tags. + */ +void +dsgw_emit_homebutton() +{ + dsgw_emitf( "", XP_GetClientStr(DBT_returnToMain_), gc->gc_urlpfxmain /*DSGW_URLPREFIX_MAIN*/ ); +} + + +/* + * Generate a help button with a link to the tutor program for + * the given help topic. The caller is responsible for any surrounding + * HTML, e.g. and
tags. + */ +void +dsgw_emit_helpbutton( char *topic ) +{ + char *tutorvp; + if ( topic == NULL ) { + return; + } + + tutorvp = dsgw_getvp( DSGW_CGINUM_TUTOR ); + + /* + * the following is based on code that was found in + * ldapserver/lib/libadmin/template.c inside the + * helpJavaScriptForTopic() function. We need our own copy because + * we use a different tutor CGI. Sigh. + */ + dsgw_emitf( "\n", + XP_GetClientStr(DBT_help_1),tutorvp, topic, context, + tutorvp, topic, context ); +} + + +/* + * Return malloc'd URL prefix that consists of: + * prefix + '/' + HOST:PORT + '/' (not anymore - RJP) + * prefix + ? + context=CONTEXT&hp=HOST:PORT&dn= + */ +char * +dsgw_build_urlprefix() +{ + char *prefix = dsgw_getvp( DSGW_CGINUM_DOSEARCH ); + char *p, *urlprefix; + + p = ( gc->gc_ldapserver == NULL ? "" : gc->gc_ldapserver ); + urlprefix = dsgw_ch_malloc( 16 /* room for "?:port#&dn=" + zero-term. */ + + strlen( prefix ) + strlen( p ) +strlen(context) + 9); + sprintf( urlprefix, "%s?context=%s&hp=%s", prefix, context, p ); + if ( gc->gc_ldapport != 0 && gc->gc_ldapport != LDAP_PORT ) { + sprintf( urlprefix + strlen( urlprefix ), ":%d", gc->gc_ldapport ); + } + strcat( urlprefix,"&dn=" ); + return( urlprefix ); +} + + +void +dsgw_addtemplate( dsgwtmpl **tlpp, char *template, int count, char **ocvals ) +{ + int i; + dsgwtmpl *prevtp, *tp; + + tp = (dsgwtmpl *)dsgw_ch_malloc( sizeof( dsgwtmpl )); + memset( tp, 0, sizeof( dsgwtmpl )); + tp->dstmpl_name = dsgw_ch_strdup( template ); + + /* each argument is one objectClass */ + tp->dstmpl_ocvals = dsgw_ch_malloc(( count + 1 ) * sizeof( char * )); + for ( i = 0; i < count; ++i ) { + tp->dstmpl_ocvals[ i ] = dsgw_ch_strdup( ocvals[ i ] ); + } + tp->dstmpl_ocvals[ count ] = NULL; + + if ( *tlpp == NULL ) { + *tlpp = tp; + } else { + for ( prevtp = *tlpp; prevtp->dstmpl_next != NULL; + prevtp = prevtp->dstmpl_next ) { + ; + } + prevtp->dstmpl_next = tp; + } +} + + +dsgwtmpl * +dsgw_oc2template( char **ocvals ) +{ + int i, j, needcnt, matchcnt; + dsgwtmpl *tp; + + for ( tp = gc->gc_templates; tp != NULL; tp = tp->dstmpl_next ) { + needcnt = matchcnt = 0; + for ( i = 0; tp->dstmpl_ocvals[ i ] != NULL; ++i ) { + for ( j = 0; ocvals[ j ] != NULL; ++j ) { + if ( strcasecmp( ocvals[ j ], tp->dstmpl_ocvals[ i ] ) == 0 ) { + ++matchcnt; + } + } + ++needcnt; + } + + if ( matchcnt == needcnt ) { + return( tp ); + } + } + + return( NULL ); +} + + + +void +dsgw_init_searchprefs( struct ldap_searchobj **solistp ) +{ + char *path; + + path = dsgw_file2path( gc->gc_configdir, DSGW_SEARCHPREFSFILE ); + if ( ldap_init_searchprefs( path, solistp ) != 0 ) { + dsgw_error( DSGW_ERR_BADCONFIG, path, DSGW_ERROPT_EXIT, 0, NULL ); + } + free( path ); +} + + +void +dsgw_remove_leading_and_trailing_spaces( char **sp ) +{ + auto char *s, *p; + + if ( sp == NULL || *sp == NULL ) { + return; + } + + s = *sp; + + /* skip past any leading spaces */ + while ( ldap_utf8isspace( s )) { + LDAP_UTF8INC (s); + } + + /* truncate to remove any trailing spaces */ + if ( *s != '\0' ) { + p = s + strlen( s ); + LDAP_UTF8DEC (p); + while (ldap_utf8isspace( p )) { + LDAP_UTF8DEC (p); + } + *LDAP_UTF8INC(p) = '\0'; + } + *sp = s; +} + + +/* + * Return the virtual path prefix for the CGI program specified by + * cginum. + */ +char * +dsgw_getvp( int cginum ) +{ + char *cginame; + char *surl; + /*char *extpath;*/ + int i; + + if ( cginum < 1 || cginum > DSGW_MODE_NUMMODES ) { + return ""; + } + if ( vpmap == NULL ) { + /* note: slot zero of vpmap isn't used */ + vpmap = dsgw_ch_malloc(( DSGW_MODE_NUMMODES + 1 ) * sizeof( char * )); + for ( i = 0; i <= DSGW_MODE_NUMMODES; i++ ) { + vpmap[ i ] = NULL; + } + } + + if ( vpmap[ cginum ] == NULL ) { + switch ( cginum ) { + case DSGW_CGINUM_DOSEARCH: + cginame = DSGW_CGINAME_DOSEARCH; + break; + case DSGW_CGINUM_BROWSE: + cginame = DSGW_CGINAME_BROWSE; + break; + case DSGW_CGINUM_SEARCH: + cginame = DSGW_CGINAME_SEARCH; + break; + case DSGW_CGINUM_CSEARCH: + cginame = DSGW_CGINAME_CSEARCH; + break; + case DSGW_CGINUM_AUTH: + cginame = DSGW_CGINAME_AUTH; + break; + case DSGW_CGINUM_EDIT: + cginame = DSGW_CGINAME_EDIT; + break; + case DSGW_CGINUM_DOMODIFY: + cginame = DSGW_CGINAME_DOMODIFY; + break; + case DSGW_CGINUM_DNEDIT: + cginame = DSGW_CGINAME_DNEDIT; + break; + case DSGW_CGINUM_TUTOR: + cginame = DSGW_CGINAME_TUTOR; + break; + case DSGW_CGINUM_LANG: + cginame = DSGW_CGINAME_LANG; + break; + default: + return ""; + } + + if (( surl = dsgw_server_url() ) == NULL ) { + surl = ""; + } + + /*if ( gc->gc_admserv ) { + * + * include "/admin-serv/" or "/user-environment/" if appropriate + * + * if ( gc->gc_enduser ) { + * extpath = DSGW_USER_ADM_BINDIR; + * } else { + * extpath = DSGW_ADMSERV_BINDIR; + * } + * } else { + * extpath = ""; + * } + */ + vpmap[ cginum ] = dsgw_ch_malloc( strlen( gc->gc_urlpfxcgi ) + strlen( surl ) + /*+ strlen( extpath ) */ + + strlen( cginame ) + 2 ); + + sprintf( vpmap[ cginum ], "%s%s%s", surl, + /*extpath, */ + gc->gc_urlpfxcgi, cginame ); + + /*sprintf( vpmap[ cginum ], "%s%s%s", extpath, gc->gc_urlpfxcgi, cginame );*/ + } + return( vpmap[ cginum ]); +} + + +#ifdef DSGW_DEBUG +#include /* FILE */ + +/* Returns a directory path used for tmp log files. */ +char * +dsgw_get_tmp_log_dir() +{ + static char tmp_log[MAXPATHLEN]; + char *install_dir = NULL; + +#if defined( XP_WIN32 ) + int ilen; + char *pch; + char tmp_dir[_MAX_PATH]; +#endif + install_dir = getenv("NETSITE_ROOT"); + if (install_dir != NULL) { + PR_snprintf(tmp_log, sizeof(tmp_log), "%s/tmp/dsgw", install_dir); +#if defined( XP_WIN32 ) + for(ilen=0; ilen < strlen(tmp_log); ilen++) + { + if(tmp_log[ilen]=='/') + tmp_log[ilen]='\\'; + } +#endif /* XP_WIN32 */ + } else { +#if defined( XP_WIN32 ) + GetTempPath( ilen+1, tmp_dir ); + ilen = strlen(tmp_dir); + /* Remove trailing slash. */ + pch = tmp_dir[ilen-1]; + if( pch == '\\' || pch == '/' ) + tmp_dir[ilen-1] = '\0'; + PR_snprintf(tmp_log, sizeof(tmp_log), "%s\\DSGW", tmp_dir); +#else + PR_snprintf(tmp_log, sizeof(tmp_log), "/tmp/dsgw"); +#endif + } + return tmp_log; +} + +static FILE* log_out_fp = NULL; + +void +dsgw_log_out (const char* s, size_t n) +{ + if ( log_out_fp == NULL ) { + char fname[ 256 ]; + char* format = +#if defined( XP_WIN32 ) + "%s\\log%.50s.out"; +#else + "%s/%.50s.out"; +#endif + PR_snprintf( fname, sizeof(fname), format, dsgw_get_tmp_log_dir(), progname ); + log_out_fp = fopen( fname, "w" ); + } + if (log_out_fp != NULL) { + fwrite (s, sizeof(char), n, log_out_fp); + fflush (log_out_fp); + } +} + + +/* + * logging function -- called like printf(); syslog-like output is written + * to a file called /tmp/progname where progname is derived from argv[0] + */ +static FILE* logfp = NULL; +void +dsgw_log( char *fmt, ... ) +{ + time_t t; + char timebuf[ 20 ]; + va_list ap; + + t = time( NULL ); + + if ( logfp == NULL ) { + char fname[ 256 ]; + char* format = +#if defined( XP_WIN32 ) + "%s\\log%.50s"; +#else + "%s/%.50s"; +#endif + PR_snprintf( fname, sizeof(fname), format, dsgw_get_tmp_log_dir(), progname ); + if (( logfp = fopen( fname, "a+" )) == NULL ) { + return; + } + } + + memcpy( timebuf, ctime( &t ), sizeof(timebuf)-1 ); + timebuf[ sizeof(timebuf)-1 ] = '\0'; + fprintf( logfp, "%s %s: ", timebuf, progname ); + + va_start( ap, fmt ); + (void)vfprintf( logfp, fmt, ap ); + va_end( ap ); + fflush( logfp ); +} + + +/* + * log the contents of a NULL-terminated array of character strings + */ +void +dsgw_logstringarray( char *arrayname, char **strs ) +{ + int i; + + if ( strs == NULL || strs[ 0 ] == NULL ) { + dsgw_log( "Array %s: empty\n", arrayname ); + } else { + dsgw_log( "Array %s:\n", arrayname ); + + for ( i = 0; strs[ i ] != NULL; ++i ) { + dsgw_log( "\t%2d: \"%s\"\n", i, strs[ i ] ); + } + } +} +#endif /* DSGW_DEBUG */ + +void +dsgw_head_begin() +{ + dsgw_emits (""); + if ( gc != NULL && gc->gc_charset != NULL && *gc->gc_charset != '\0' ) { + dsgw_emitf ("", + CONTENT_TYPE, TYPE_HTML, cs_prefix, gc->gc_charset); + } +} + +void +dsgw_quote_emptyFrame() +{ + dsgw_quotation_begin( QUOTATION_JAVASCRIPT_MULTILINE ); + dsgw_emits( "" ); + dsgw_emitf( "", dsgw_html_body_colors ); + dsgw_quotation_end(); +} + +/* This function contains code to alert the user that their password has + already expired. It gives them an opportunity to change it. */ +void +dsgw_password_expired_alert( char *dn ) +{ +#ifdef NOTFORNOW + char *ufn; +#endif + char *encodeddn = dsgw_strdup_escaped( dn ); + + dsgw_send_header(); + dsgw_emits( "" ); + dsgw_head_begin(); + + dsgw_emits( "\n" + "Password Expired\n" + "\n" + "\n\n" + "
\n", + dsgw_html_body_colors ); + dsgw_emitf( XP_GetClientStr( DBT_PasswordExpiredFor_ ), dn ); + dsgw_emits( "
\n" ); + dsgw_emits( XP_GetClientStr( DBT_YourPasswordHasExpired_ )); + dsgw_emits( XP_GetClientStr( DBT_YouMustChangeYourPasswd_ )); + dsgw_emits( "

\n" + "

\n" + "\n" + "\n\n" ); +} + +/* Pulled from ldapserver/ldap/servers/slapd/time.c */ + +time_t +dsgw_current_time() +{ + return( time( (time_t *)0 )); +} + +#define mktime_r(from) mktime (from) + +time_t +dsgw_time_plus_sec (time_t l, long r) + /* return the point in time 'r' seconds after 'l'. */ +{ + /* On many (but not all) platforms this is simply l + r; + perhaps it would be better to implement it that way. */ + struct tm t; + if (r == 0) return l; /* performance optimization */ +#ifdef _WIN32 + { + struct tm *pt = localtime( &l ); + memcpy(&t, pt, sizeof(struct tm) ); + } +#else + localtime_r (&l, &t); +#endif + /* Conceptually, we want to do: t.tm_sec += r; + but to avoid overflowing fields: */ + r += t.tm_sec; t.tm_sec = r % 60; r /= 60; + r += t.tm_min; t.tm_min = r % 60; r /= 60; + r += t.tm_hour; t.tm_hour = r % 24; r /= 24; + t.tm_mday += r; /* may be > 31; mktime_r() must handle this */ + + /* These constants are chosen to work when the maximum + field values are 127 (the worst case) or more. + Perhaps this is excessively conservative. */ + return mktime_r (&t); +} + +/* + * Function: figure_out_langwich + * + * Returns: nothing + * + * Description: figures out the language/locale that libsi18n will + * use. This is so that non libsi18n functions can display + * stuff in the same language. + * + * Author: RJP + * + */ +static void +figure_out_langwich(void) +{ + char *path = NULL; + char *iter = NULL; + char *p = NULL; + char *before = NULL; + + /* Get a path to the html directory */ + path = dsgw_file2path( gc->gc_configdir, "dsgwfilter.conf"); + + before = path; + + /* Find the lang subdirectory part */ + for ( p = ldap_utf8strtok_r( path, DSGW_PATHSEP_STR, &iter ); + p != NULL && *p != '\0' && strcmp(p, "dsgwfilter.conf") != 0; + p = ldap_utf8strtok_r( NULL, DSGW_PATHSEP_STR, &iter )){ + before = p; + } + + /* If there is one, copy it. */ + if (before != NULL && *before != '\0') { + langwich = dsgw_ch_strdup(before); + } + + iter = NULL; + + /* split off any country specification */ + ldap_utf8strtok_r( langwich, "-", &iter ); + countri = iter; + + free (path); + +} + +/* + * Accept-Language = "Accept-Language" ":" + * 1#( language-range [ ";" "q" "=" qvalue ] ) + * language-range = ( ( 1*8ALPHA *( "-" 1*8ALPHA ) ) | "*" ) + * + * NLS_AccLangList() assumes that "Accept-Language:" has already + * been stripped off. It takes as input + * + * 1#( ( ( 1*8ALPHA *( "-" 1*8ALPHA ) ) | "*" ) [ ";" "q" "=" qvalue ] ) + * + * and returns a list of languages, ordered by qvalues, in + * the array NLS_ACCEPT_LANGUAGE_LIST. + * + * If there are to many languages (>NLS_MAX_ACCEPT_LANGUAGE) the excess + * is ignored. If the language-range is too long (>NLS_MAX_ACCEPT_LENGTH), + * the language-range is ignored. In these cases, NLS_AccLangList() + * will quietly return, perhaps with numLang = 0. numLang is + * returned by the function. + */ + + +size_t +AcceptLangList(const char* AcceptLanguage, + ACCEPT_LANGUAGE_LIST AcceptLanguageList) +{ + char* input; + char* cPtr; + char* cPtr1; + char* cPtr2; + int i; + int j; + int countLang = 0; + + input = dsgw_ch_strdup(AcceptLanguage); + if (input == (char*)NULL){ + return 0; + } + + cPtr1 = input-1; + cPtr2 = input; + + /* put in standard form */ + while (*(++cPtr1)) { + if (isalpha(*cPtr1)) *cPtr2++ = tolower(*cPtr1); /* force lower case */ + else if (isspace(*cPtr1)); /* ignore any space */ + else if (*cPtr1=='-') *cPtr2++ = '_'; /* "-" -> "_" */ + else if (*cPtr1=='*'); /* ignore "*" */ + else *cPtr2++ = *cPtr1; /* else unchanged */ + } + *cPtr2 = '\0'; + + countLang = 0; + + if (strchr(input,';')) { + /* deal with the quality values */ + + float qvalue[MAX_ACCEPT_LANGUAGE]; + float qSwap; + float bias = 0.0f; + char* ptrLanguage[MAX_ACCEPT_LANGUAGE]; + char* ptrSwap; + + cPtr = strtok(input,","); + while (cPtr) { + qvalue[countLang] = 1.0f; + if ((cPtr1 = strchr(cPtr,';'))) { + sscanf(cPtr1,";q=%f",&qvalue[countLang]); + *cPtr1 = '\0'; + } + if (strlen(cPtr)=MAX_ACCEPT_LANGUAGE) break; /* quit if too many */ + } + cPtr = strtok(NULL,","); + } + + /* sort according to decending qvalue */ + /* not a very good algorithm, but count is not likely large */ + for ( i=0 ; i=MAX_ACCEPT_LANGUAGE) break; /* quit if too many */ + } + cPtr = strtok(NULL,","); + } + } + + free(input); + + return countLang; +} + +char * +dsgw_server_url() +{ + static char *server_url = NULL; + + if (!server_url) { + char *p = getenv("SERVER_URL"); /* set by admin server, not plain apache */ + if (p) { + server_url = PL_strdup(p); + } else { + char *httpsstr = ""; + if (getenv("HTTPS") && !PL_strcasecmp(getenv("HTTPS"), "on")) { + httpsstr = "s"; + } + server_url = PR_smprintf("http%s://%s:%s", httpsstr, + getenv("HTTP_HOST"), getenv("SERVER_PORT")); + } + } + + return server_url; +} diff --git a/edit.c b/edit.c new file mode 100644 index 0000000..a08f4ad --- /dev/null +++ b/edit.c @@ -0,0 +1,287 @@ +/** --- BEGIN COPYRIGHT BLOCK --- + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + --- END COPYRIGHT BLOCK --- */ +/* + * edit.c -- CGI editable entry display -- HTTP gateway + */ + +#include "dsgw.h" +#include "dbtdsgw.h" + +static void get_request(char *dn, char *tmplname, + unsigned long options); + + +int main( argc, argv, env ) + int argc; + char *argv[]; +#ifdef DSGW_DEBUG + char *env[]; +#endif +{ + + + char *dn, *tmplname, *p; + unsigned long options; + + /* + * If the QUERY_STRING is non-NULL, it looks like this: + * + * template [&CONTEXT=context] [ &INFO=infostring ] [ &ADD ] [ &DN=dn ] \ + * [&DNATTR=attrname&DNDESC=description] + * + * where: + * "template" is the name of the edit template to use for display, + * "dn" is escaped dn, + * "infostring" is a message used to replace DS_LAST_OP_INFO directives + * "attrname" is the name of a DN-valued attribute + * "dndesc" is the destriptive name of the above DN-valued attribute + * + * If "&ADD" is present, we check to make sure the entry + * does not exist, then we check that the parent entry exists, and then + * we present an "add entry" form. + * + * Note: original form http://host/edit/dn[/...]?template[&...] is + * supported for keeping backward compatibility. + * But passing DN as PATH_INFO is NOT recommended. + * Since PATH_INFO is passed to CGI as is (non-escaped), + * the content has a risk to get broken especially when + * it contains 8-bit UTF-8 data. (This is a known problem + * on localized Windows machines.) + */ + + options = DSGW_DISPLAY_OPT_EDITABLE; + dn = NULL; +#ifndef __LP64__ +#ifdef HPUX +#ifndef __ia64 + /* call the static constructors in libnls */ + _main(); +#endif +#endif +#endif + + if (( tmplname = getenv( "QUERY_STRING" )) != NULL && *tmplname != '\0' ) { + tmplname = dsgw_ch_strdup( tmplname ); + while ( tmplname != NULL && ((( p = strrchr( tmplname, '&' )) != NULL ) || (p=tmplname) != NULL )) { + if (p == tmplname) { + tmplname = NULL; + } else { + *p++ = '\0'; + } + + if ( strcasecmp( p, "add" ) == 0 ) { + options |= DSGW_DISPLAY_OPT_ADDING; + if (( p = strrchr( tmplname, '&' )) != NULL ) { + *p++ = '\0'; + } + } + + if ( p != NULL && strncasecmp( p, "info=", 5 ) == 0 ) { + dsgw_last_op_info = dsgw_ch_strdup( p + 5 ); + dsgw_form_unescape( dsgw_last_op_info ); + continue; + } + if ( p != NULL && strncasecmp( p, "dn=", 3 ) == 0 ) { + dn = dsgw_ch_strdup( p + 3 ); + dsgw_form_unescape( dn ); + continue; + } + if ( p != NULL && strncasecmp( p, "dnattr=", 7 ) == 0 ) { + dsgw_dnattr = dsgw_ch_strdup( p + 7 ); + dsgw_form_unescape( dsgw_dnattr ); + continue; + } + if ( p != NULL && strncasecmp( p, "dndesc=", 7 ) == 0 ) { + dsgw_dndesc = dsgw_ch_strdup( p + 7 ); + dsgw_form_unescape( dsgw_dndesc ); + continue; + } + if ( p != NULL && strncasecmp( p, "context=", 8 ) == 0) { + context = dsgw_ch_strdup( p + 8 ); + dsgw_form_unescape( context ); + continue; + } + + /* + * If none of the if-statements above matched, + * then it's the template name + */ + tmplname = p; + break; + } + + } else { + tmplname = NULL; + } + + (void)dsgw_init( argc, argv, DSGW_METHOD_GET ); + dsgw_send_header(); + +#ifdef DSGW_DEBUG + dsgw_logstringarray( "env", env ); +#endif + + get_request(dn, tmplname, options); + + exit( 0 ); +} + + +static void +get_request(char *dn, char *tmplname, unsigned long options) +{ + LDAP *ld; + + if ( dn == NULL ) { /* not found in QUERY_STRING */ + dsgw_error( DSGW_ERR_MISSINGINPUT, NULL, DSGW_ERROPT_EXIT, 0, NULL ); + } + +#ifdef DSGW_DEBUG + dsgw_log( "get_request: dn: \"%s\", tmplname: \"%s\" " + "dnattr: \"%s\", dndesc: \"%s\"\n", dn, + ( tmplname == NULL ) ? "(null)" : tmplname, + ( dsgw_dnattr == NULL ) ? "(null)" : dsgw_dnattr, + ( dsgw_dndesc == NULL ) ? "(null)" : dsgw_dndesc ); +#endif + + (void)dsgw_init_ldap( &ld, NULL, 0, 0); + + if (( options & DSGW_DISPLAY_OPT_ADDING ) == 0 ) { + /* + * editing an existing entry -- if no DN is provided and we are running + * under the admin server, try to get DN from admin. server + */ + if ( *dn == '\0' ) { + (void)dsgw_get_adm_identity( ld, NULL, &dn, NULL, + DSGW_ERROPT_EXIT ); + } + + dsgw_read_entry( ld, dn, NULL, tmplname, NULL, options ); + + } else { + dsgwtmplinfo *tip; + char *matched; + + /* + * new entry -- check to make sure it doesn't exist + */ + if ( dsgw_ldap_entry_exists( ld, dn, &matched, DSGW_ERROPT_EXIT )) { + char **rdns; + + dsgw_html_begin( XP_GetClientStr(DBT_entryAlreadyExists_), 1 ); + dsgw_emits( XP_GetClientStr(DBT_anEntryNamed_) ); + rdns = ldap_explode_dn( dn, 1 ); + dsgw_html_href( + dsgw_build_urlprefix(), + dn, ( rdns == NULL || rdns[ 0 ] == NULL ) ? dn : rdns[ 0 ], + NULL, XP_GetClientStr(DBT_onmouseoverWindowStatusClickHere_) ); + if ( rdns != NULL ) { + ldap_value_free( rdns ); + } + dsgw_emits( XP_GetClientStr(DBT_alreadyExistsPPleaseChooseAnothe_) ); + + dsgw_form_begin( NULL, NULL ); + dsgw_emits( "\n
\n" ); + dsgw_emits( "
\n" ); + dsgw_emitf( "", XP_GetClientStr(DBT_closeWindow_1) ); + dsgw_emits( "\n" ); + dsgw_emit_helpbutton( "ENTRYEXISTS" ); + dsgw_emits( "\n
\n" ); + dsgw_html_end(); + } else if ( !dsgw_is_dnparent( matched, dn ) && + !dsgw_dn_cmp( dn, gc->gc_ldapsearchbase )) { + char *parent = NULL; + /* + * The parent entry does not exist, and the dn being added is not + * the same as the suffix for which the gateway is configured. + */ + dsgw_html_begin( XP_GetClientStr(DBT_parentEntryDoesNotExist_), 1 ); + dsgw_emitf( XP_GetClientStr(DBT_youCannotAddAnEntryByTheNamePBSB_), + dn ); + parent = dsgw_dn_parent( dn ); + if ( parent == NULL || strlen( parent ) == 0 ) { + dsgw_emits( XP_GetClientStr(DBT_itsParentN_) ); + } else { + dsgw_emitf( XP_GetClientStr(DBT_anEntryNamedPBSBN_), parent ); + free( parent ); + } + dsgw_form_begin( NULL, NULL ); + dsgw_emits( "\n
\n" ); + dsgw_emits( "
\n" ); + dsgw_emitf( "", XP_GetClientStr(DBT_closeWindow_2) ); + dsgw_emits( "\n" ); + dsgw_emit_helpbutton( "ADD_NOPARENT" ); + dsgw_emits( "\n
\n" ); + dsgw_html_end(); + } else { + /* + * The parent exists, or the user is adding the entry whose DN + * is the same as the suffix for which the gateway is configured. + * Display the "add entry" form. + */ + + if ( tmplname == NULL ) { +#ifdef DSGW_DEBUG + dsgw_log( "NULL tmplname\n" ); +#endif + dsgw_error( DSGW_ERR_MISSINGINPUT, + XP_GetClientStr(DBT_missingTemplate_), + DSGW_ERROPT_EXIT, 0, NULL ); + } + + tip = dsgw_display_init( DSGW_TMPLTYPE_DISPLAY, tmplname, options ); + + dsgw_display_entry( tip, ld, NULL, NULL, dn ); + dsgw_display_done( tip ); + } + } + + ldap_unbind( ld ); +} + + + + + + + + + + diff --git a/emitauth.c b/emitauth.c new file mode 100644 index 0000000..732ede7 --- /dev/null +++ b/emitauth.c @@ -0,0 +1,334 @@ +/** --- BEGIN COPYRIGHT BLOCK --- + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + --- END COPYRIGHT BLOCK --- */ +/* + * emitauth.c -- generate authentication form -- HTTP gateway + */ + +#include "dsgw.h" +#include "dbtdsgw.h" + +static int isexp = 0; /* Why is this static? */ + +static void +emit_authinfo( int isEditing, int isPwForm, char *binddn ) +{ + char *cookie, *dn, *rndstr, *pw; + int rc; + int isauth = 0; + + /* try to get the DN the user is bound as, and determine if + * authentication credentials have expired. + */ + if (( cookie = dsgw_get_auth_cookie()) != NULL ) { + if ( dsgw_parse_cookie( cookie, &rndstr, &dn ) == 0 ) { + if ( dn == NULL ) { + isauth = 0; + } else { + if (( rc = dsgw_ckdn2passwd( rndstr, dn, &pw )) == 0 ) { + isauth = 1; + } else { + isauth = 0; + if ( rc == DSGW_CKDB_EXPIRED ) { + isexp = 1; + } + } + } + } else { + isauth = 0; + } + } else { + isauth = 0; + } + + dsgw_emitf( "
\n" + "%s\n" + "
\n" + "

", XP_GetClientStr(DBT_authenticateLogInToTheDirectory_) ); + + if ( isPwForm ) { +#ifdef NOTFORNOW + /* ldap_dn2ufn currently gobble up 'dc' so don't use it for */ + /* now */ + auto char *ufn = ldap_dn2ufn( binddn ); + dsgw_emitf( XP_GetClientStr(DBT_youAreAboutToAuthenticate_), ufn); + free( ufn ); +#else + dsgw_emitf( XP_GetClientStr(DBT_youAreAboutToAuthenticate_), binddn); +#endif + } else if ( isEditing ) { + dsgw_emits( XP_GetClientStr(DBT_beforeYouCanEditOrAddEntriesYouM_) ); + } else { + dsgw_emits( XP_GetClientStr(DBT_fromThisScreenYouMayAuthenticate_) ); + } + if ( isEditing ) { + return; + } + dsgw_emitf( "


\n" + "
\n" + "%s\n" + "
\n" + "

\n", XP_GetClientStr(DBT_authenticationStatus_) ); + + if ( isauth ) { + auto char *ufn; + dsgw_emits( XP_GetClientStr(DBT_FormNyouAreCurrentlyAuthenticate_) ); + ufn = ldap_dn2ufn( dn ); + dsgw_emitf( "%s\n", ufn ); + free( ufn ); + dsgw_emitf( "%s
" + "

\n" + "\n" + "\n" + "
\n" + "
\n", + XP_GetClientStr(DBT_NifYouWishToDiscardYourAuthentic_), + XP_GetClientStr(DBT_discardAuthenticationCredentials_2) ); + } else if ( isexp ) { + dsgw_emits( XP_GetClientStr(DBT_yourAuthenticationCredentialsFor_) ); + dsgw_emitf( "%s ", dn ); + dsgw_emits( XP_GetClientStr(DBT_haveExpiredN_) ); + } else { + dsgw_emits( XP_GetClientStr(DBT_currentlyYouAreNotAuthenticatedT_) ); + } +} + + +static void +emit_file (char* filename, char* authdesturl, char *user ) +{ + auto FILE* html = dsgw_open_html_file( filename, DSGW_ERROPT_EXIT ); + auto char line[ BIG_LINE ]; + auto int argc; + auto char **argv, *escaped_dn; + + if ( user != NULL ) { + escaped_dn = dsgw_strdup_escaped( user ); + } else { + escaped_dn = ""; + } + + while ( dsgw_next_html_line( html, line )) { + if ( dsgw_parse_line( line, &argc, &argv, 0, dsgw_simple_cond_is_true, NULL )) { + if ( dsgw_directive_is( line, DRCT_HEAD )) { + dsgw_head_begin(); + dsgw_emits ("\n"); + + } else if ( dsgw_directive_is( line, "DS_AUTH_SEARCH_SCRIPT" )) { + dsgw_emits ("\n"); + + } else if ( dsgw_directive_is( line, "DS_AUTH_SEARCH_BODY" )) { + dsgw_emitf ("\n", + dsgw_html_body_colors); + dsgw_emit_alertForm(); + + } else if ( dsgw_directive_is( line, "DS_AUTH_SEARCH_INFO" )) { + emit_authinfo( authdesturl != NULL, 0, NULL ); + + } else if ( dsgw_directive_is( line, "DS_AUTH_SEARCH_FORM" )) { + dsgw_form_begin ("authSearchForm", "action=\"dosearch\"" + ); + dsgw_emits ("\n\n"); + if ( authdesturl != NULL ) { + dsgw_emitf ("\n", + authdesturl); + } + + } else if ( dsgw_directive_is( line, "DS_AUTH_SEARCH_NAME" )) { + dsgw_emitf ("\n", + ( user == NULL ) ? "" : user ); + + } else if ( dsgw_directive_is( line, "DS_AUTH_SEARCH_BUTTONS" )) { + if ( authdesturl == NULL ) { + dsgw_emitf ("\n" + "\n" + "\n", + XP_GetClientStr(DBT_continue_) ); + } else { + dsgw_emitf ("\n" + "\n" + "\n" + "\n" + "\n", + XP_GetClientStr(DBT_continue_1), XP_GetClientStr(DBT_cancel_) ); + } + dsgw_emit_helpbutton ("AUTHHELP_ID" ); + + } else if ( dsgw_directive_is( line, "DS_AUTH_AS_ROOT_FORM" )) { + dsgw_form_begin ("AuthAsRootDNForm", "action=\"auth\""); + dsgw_emits ("\n"); + dsgw_emits ("\n"); + if ( authdesturl != NULL ) { + dsgw_emitf ("\n", + authdesturl ); + } + + } else if ( dsgw_directive_is( line, "DS_AUTH_PASSWORD_SCRIPT" )) { + dsgw_emits ("\n\n", + XP_GetClientStr (DBT_discardAuthenticationCredentials_1), context); + + } else if ( dsgw_directive_is( line, "DS_AUTH_PASSWORD_BODY" )) { + dsgw_emitf ("\n", + dsgw_html_body_colors ); + + } else if ( dsgw_directive_is( line, "DS_AUTH_PASSWORD_INFO" )) { + emit_authinfo( authdesturl != NULL, 1, user ); + + } else if ( dsgw_directive_is( line, "DS_AUTH_PASSWORD_FORM" )) { + dsgw_form_begin( "authPwForm", "action=\"doauth\"" ); + dsgw_emits ("\n" ); + dsgw_emitf ( + "\n", + escaped_dn ); + if ( authdesturl != NULL ) { + dsgw_emitf ("\n", + authdesturl ); + } + + } else if ( dsgw_directive_is( line, "DS_AUTH_PASSWORD_NAME" )) { + auto char** xdn = ldap_explode_dn( user, 1 ); + dsgw_emits( xdn[ 0 ] ); + ldap_value_free( xdn ); + + } else if ( dsgw_directive_is( line, "DS_AUTH_PASSWORD_BUTTONS" )) { + if ( authdesturl == NULL ) { + dsgw_emitf ("\n" + "\n" + "\n", + XP_GetClientStr(DBT_continue_2) ); + } else { + dsgw_emitf ("\n" + "\n" + "\n" + "\n" + "\n", + XP_GetClientStr(DBT_continue_3), XP_GetClientStr(DBT_cancel_1) ); + } + dsgw_emit_helpbutton ("AUTHHELP_PW" ); + + } else if ( dsgw_directive_is( line, "DS_HELP_BUTTON" ) && argc > 0) { + dsgw_emit_helpbutton (argv[0]); + } else { + dsgw_emits (line); + } + dsgw_argv_free( argv ); + } + } + fflush (stdout); + fclose (html); +} + + +void +dsgw_emit_auth_form( char *binddn ) +{ + dsgw_emit_auth_dest( binddn, dsgw_get_cgi_var( "authdesturl", DSGW_CGIVAR_OPTIONAL )); +} + +void +dsgw_emit_auth_dest( char *binddn, char* authdesturl ) +{ + /* + * If dn is NULL, then we don't know who we want to bind as yet. + * Generate a simplified search form. This form needs to post: + * mode=auth + * searchstring + * authdesturl + * + * If dn was given, then prompt for the password. Needs to post: + * password + * authdesturl + * binddn + */ + if ( binddn == NULL ) { + emit_file( "authSearch.html", authdesturl, + dsgw_get_cgi_var( "authhint", DSGW_CGIVAR_OPTIONAL )); + } else { + emit_file( "authPassword.html", authdesturl, binddn ); + } +} + + + + + + + diff --git a/emitf.c b/emitf.c new file mode 100644 index 0000000..a635282 --- /dev/null +++ b/emitf.c @@ -0,0 +1,863 @@ +/** --- BEGIN COPYRIGHT BLOCK --- + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + --- END COPYRIGHT BLOCK --- */ +#include /* va_list etc. */ +#include /* sprintf */ +#include /* malloc, realloc, free */ +#include /* strchr, strpbrk etc. */ +#include "dsgw.h" /* dsgw_ch_malloc, dsgw_ch_strdup */ + +typedef void* (*dsgw_producer) (void*, const char*, size_t); + +static size_t +produce_fill (dsgw_producer produce, void** parm, + size_t fill, unsigned zero) +{ + static const char* zeroes = "00000000"; + static const char* blanks = " "; + size_t result = 0; + while (fill > 0) { + long n = fill; + if (n > 8) n = 8; + if (zero) { + *parm = produce (*parm, zeroes, n); + } else { + *parm = produce (*parm, blanks, n); + } + if (*parm == NULL) return result; + result += n; + fill -= n; + } + return result; +} + +#define FLAG_LEFT 1 /* align left */ +#define FLAG_ZERO 2 /* zero fill */ +#define FLAG_CONST 4 + +static size_t +produce_string (dsgw_producer produce, void** parm, + const char* str, unsigned flags, int width, int precision) +{ + size_t fill; + size_t bytes; + size_t result = 0; + if (*parm == NULL) return result; + if (width < 0) { + width = - width; + flags ^= FLAG_LEFT; + } + if (width == 0 && precision < 0) { + fill = 0; + bytes = strlen (str); + } else { + char* s = (char*)str; /* cast away const (for LDAP_UTF8INC) */ + size_t chars = 0; + while (*s && ((precision < 0) || (chars < precision))) { + LDAP_UTF8INC(s); + ++chars; + } + fill = (width > chars) ? (width - chars) : 0; + bytes = (s - str); + } + if (fill && ! (flags & FLAG_LEFT)) { + result += produce_fill (produce, parm, fill, flags & FLAG_ZERO); + } + if (bytes) { + *parm = produce (*parm, str, bytes); + if (*parm == NULL) return result; + result += bytes; + } + if (fill && (flags & FLAG_LEFT)) { + result += produce_fill (produce, parm, fill, flags & FLAG_ZERO); + } + return result; +} + +static const char* type_chars = "%dioxXueEgGfcsp"; + +static size_t +count_slots (const char* s) +{ + size_t n = 0; + while ((s = strchr (s, '%')) != NULL) { + const char* l = strpbrk (s+1, type_chars); + const char* c; + if (l == NULL) { + n += 3; + break; + } + ++n; + for (c = s+1; c != l; ++c) { + if (*c == '*') ++n; + } + s = *l ? l+1 : l; + } + return n; +} + +typedef struct { + char type; +#define TYPE_I 0 +#define TYPE_U 1 +#define TYPE_F 2 +#define TYPE_LI 3 +#define TYPE_LU 4 +#define TYPE_LF 5 +#define TYPE_S 6 +#define TYPE_P 7 +#define TYPE_PERCENT 8 /* e.g. %% */ +#define TYPE_WIDTH 9 +#define TYPE_PRECISION 10 + + unsigned char flags; + int arg; /* An index into an array of dsgw_arg_t, + or (if flags & FLAG_CONST) the width or precision value. */ +} dsgw_slot_t; + +typedef union { + int i; + unsigned int u; + double f; + long li; + unsigned long lu; + long double lf; + const char* s; + void* p; +} dsgw_arg_t; + +#define DEFSLOTC 8 /* A format string rarely contains more slots. */ +#define DEFFMTC 16 /* A single format rarely contains more chars. */ + +static size_t +dsgw_vxprintf (dsgw_producer produce, void* parm, + const char* format, va_list argl) + /* This function works like vsprintf(), except it: + - supports parameter reordering, using %posp$. + - is UTF8-aware. + - delivers output by calling the function 'produce'. + - returns the total number of bytes produced. + This function interprets all string parameters as UTF8. + */ +{ + size_t result = 0; /* total number of bytes produced */ + + /* Each place that 'format' refers to an argument is called a 'slot'. */ + dsgw_slot_t defslot[DEFSLOTC]; + dsgw_slot_t* slot = defslot; /* in order of their appearance in format */ + dsgw_slot_t* islot = NULL; /* next slot to process */ + dsgw_slot_t* aslot = NULL; /* another cursor */ + + dsgw_arg_t defargv[DEFSLOTC]; + dsgw_arg_t* argv = defargv; /* in order of their appearance in argl */ + size_t argi = 0; /* index of next argument (in argl/argv) */ + + char deffmt[DEFFMTC]; + char* fmt = deffmt; + size_t fmtc = sizeof(deffmt); + + const char* next; + const char* f; + + char buf [1024] = {0}; + int i; + + i = count_slots (format); +/*fprintf (stderr, "slots: %i\n", i);*/ + if (i > DEFSLOTC) { /* defslot isn't big enough. */ + slot = (dsgw_slot_t*) malloc (i * sizeof(dsgw_slot_t)); + } + + /* get slot types from format: */ + islot = slot; + next = format; + while ((f = strchr (next, '%')) != NULL) { + const char* l = f+1; + unsigned flags = 0; + int number = -1; + char size; + + if (*l >= '1' && *l <= '9') { + number = 0; + do { number = (number * 10) + (*l++ - '0'); + } while (*l >= '0' && *l <= '9'); + } + if (*l == '$') { + ++l; + if (number > 0) { + argi = number - 1; + } + number = -1; + } + if (number >= 0) { /* width */ + islot->arg = number; + flags |= FLAG_CONST; + } else { + while (1) { /* flags */ + switch (*l) { + case '-': flags |= FLAG_LEFT; ++l; continue; + case '0': flags |= FLAG_ZERO; ++l; continue; + case '+': + case ' ': + case '#': ++l; continue; + default: break; + } + break; + } + if (*l == '*') { /* width */ + number = 0; + ++l; + islot->arg = argi++; + } else if (*l >= '1' && *l <= '9') { /* width */ + number = 0; + do { number = (number * 10) + (*l++ - '0'); + } while (*l >= '0' && *l <= '9'); + islot->arg = number; + flags |= FLAG_CONST; + } + } + if (number >= 0) { + islot->type = TYPE_WIDTH; + islot->flags = flags; + flags &= ~ FLAG_CONST; + ++islot; + } + if (*l == '.') { + islot->type = TYPE_PRECISION; + ++l; + if (*l == '*') { + ++l; + islot->arg = argi++; + islot->flags = 0; + } else { + number = 0; + while (*l >= '0' && *l <= '9') + number = (number * 10) + (*l++ - '0'); + islot->arg = number; + islot->flags = FLAG_CONST; + } + ++islot; + } + switch (*l) { /* size modifier */ + case 'h': + case 'l': + case 'L': size = *l++; break; + default: size = '\0'; + } + islot->flags = 0; + switch (*l) { /* type */ + case 'd': + case 'i': islot->type = (size == 'l') ? TYPE_LI : TYPE_I; break; + case 'o': + case 'x': case 'X': + case 'u': islot->type = (size == 'l') ? TYPE_LU : TYPE_U; break; + case 'e': case 'E': + case 'g': case 'G': + case 'f': islot->type = (size == 'L') ? TYPE_LF : TYPE_F; break; + case 'c': islot->type = TYPE_I; break; + case 's': islot->type = TYPE_S; break; + case 'p': islot->type = TYPE_P; break; + case '%': islot->type = TYPE_PERCENT; + islot->flags = FLAG_CONST; break; + default: /* unknown type */ + goto bail; /* don't produce anything. */ + /* It might be more helpful to produce the slots up to + this one, and maybe output this format substring, too. + That way, someone reading the output might get a clue + what went wrong. + */ + } + if (islot->type != TYPE_PERCENT) { + islot->arg = argi++; + } + ++islot; + next = *l ? l+1 : l; + } + + /* argi = the length of argl/argv: */ + argi = 0; + for (aslot = slot; aslot != islot; ++aslot) { + if (argi <= aslot->arg && ! (aslot->flags & FLAG_CONST)) { + argi = aslot->arg + 1; + } + } + if (argi > DEFSLOTC) { /* defargv isn't big enough */ + argv = (dsgw_arg_t*) malloc (argi * sizeof(dsgw_arg_t)); + } + + /* copy arguments from argl to argv: */ +/*fprintf (stderr, "slot:type:value:");*/ + for (i = 0; i < argi; ++i) { + for (aslot = slot; aslot != islot; ++aslot) { + if ( ! (aslot->flags & FLAG_CONST) && aslot->arg == i) { + break; + } + } + if (aslot == islot) { /* No slot refers to this arg. */ + if (va_arg (argl, const char*)); /* Skip over it. */ + } else { +/*fprintf (stderr, " %i:%i", (int)(aslot-slot), aslot->type);*/ + switch (aslot->type) { + case TYPE_U: argv[i].u = va_arg (argl, unsigned); break; + case TYPE_F: argv[i].f = va_arg (argl, double); break; + case TYPE_LI: argv[i].li = va_arg (argl, long); break; + case TYPE_LU: argv[i].lu = va_arg (argl, unsigned long); break; + case TYPE_LF: argv[i].lf = va_arg (argl, long double); break; + case TYPE_P: argv[i].p = va_arg (argl, void*); break; + case TYPE_S: argv[i].s = va_arg (argl, const char*); +/*fprintf (stderr, ":\"%s\"", argv[i].s);*/ + break; + case TYPE_PERCENT: break; /* no arg */ + case TYPE_WIDTH: + case TYPE_PRECISION: + case TYPE_I: argv[i].i = va_arg (argl, int); +/*fprintf (stderr, ":%i", argv[i].i);*/ + do { + switch (aslot->type) { + case TYPE_WIDTH: + case TYPE_PRECISION: + if ( ! (aslot->flags & FLAG_CONST) && aslot->arg == i) { + aslot->arg = argv[i].i; + aslot->flags |= FLAG_CONST; + } + break; + default: break; + } + } while (++aslot != islot); + break; + } + } + } +/*fprintf (stderr, "\n");*/ + + /* produce output: */ + islot = slot; + next = format; + while (parm && (f = strchr (next, '%'))) { + const char* l = strpbrk (f+1, type_chars); + if (l == NULL) { + break; + } + if (parm && f != next) { /* produce the substring next..f-1 */ + const size_t n = (f - next); + parm = produce (parm, next, n); + if (parm) result += n; + } + next = l + 1; + { /* fmt = f..l */ + const char* dollar; + const size_t fc = (next - f); + if (fmtc <= fc) { + fmtc = fc + 1; + if (fmt == deffmt) fmt = malloc (fmtc); + else fmt = realloc (fmt, fmtc); + } + memcpy (fmt, f, fc); + fmt[fc] = '\0'; + if ((dollar = strchr (fmt, '$')) != NULL) { + /* remove posp$ from the beginning of fmt */ + memmove (fmt + 1, dollar + 1, fc - (dollar - fmt)); + } +/*fprintf (stderr, "fmt: \"%s\"\n", fmt);*/ + } + /* produce a single argument */ + switch (islot->type) { + case TYPE_I: PR_snprintf (buf, sizeof(buf), fmt, argv[islot->arg].i); break; + case TYPE_U: PR_snprintf (buf, sizeof(buf), fmt, argv[islot->arg].u); break; + case TYPE_F: PR_snprintf (buf, sizeof(buf), fmt, argv[islot->arg].f); break; + case TYPE_LI: PR_snprintf (buf, sizeof(buf), fmt, argv[islot->arg].li); break; + case TYPE_LU: PR_snprintf (buf, sizeof(buf), fmt, argv[islot->arg].lu); break; + case TYPE_LF: PR_snprintf (buf, sizeof(buf), fmt, argv[islot->arg].lf); break; + case TYPE_P: PR_snprintf (buf, sizeof(buf), fmt, argv[islot->arg].p); break; + case TYPE_WIDTH: + case TYPE_PRECISION: + switch ((++islot)->type) { + case TYPE_I: PR_snprintf (buf, sizeof(buf), fmt, argv[islot->arg].i); break; + case TYPE_U: PR_snprintf (buf, sizeof(buf), fmt, argv[islot->arg].u); break; + case TYPE_F: PR_snprintf (buf, sizeof(buf), fmt, argv[islot->arg].f); break; + case TYPE_LI: PR_snprintf (buf, sizeof(buf), fmt, argv[islot->arg].li); break; + case TYPE_LU: PR_snprintf (buf, sizeof(buf), fmt, argv[islot->arg].lu); break; + case TYPE_LF: PR_snprintf (buf, sizeof(buf), fmt, argv[islot->arg].lf); break; + case TYPE_P: PR_snprintf (buf, sizeof(buf), fmt, argv[islot->arg].p); break; + case TYPE_WIDTH: + case TYPE_PRECISION: + switch ((++islot)->type) { + case TYPE_I: PR_snprintf (buf, sizeof(buf), fmt, argv[islot->arg].i); break; + case TYPE_U: PR_snprintf (buf, sizeof(buf), fmt, argv[islot->arg].u); break; + case TYPE_F: PR_snprintf (buf, sizeof(buf), fmt, argv[islot->arg].f); break; + case TYPE_LI: PR_snprintf (buf, sizeof(buf), fmt, argv[islot->arg].li); break; + case TYPE_LU: PR_snprintf (buf, sizeof(buf), fmt, argv[islot->arg].lu); break; + case TYPE_LF: PR_snprintf (buf, sizeof(buf), fmt, argv[islot->arg].lf); break; + case TYPE_P: PR_snprintf (buf, sizeof(buf), fmt, argv[islot->arg].p); break; + case TYPE_WIDTH: + case TYPE_PRECISION: goto bail; /* how did this happen? */ + case TYPE_PERCENT: + case TYPE_S: /* with width and precision */ + result += produce_string (produce, &parm, + (islot->type == TYPE_S) ? argv[islot->arg].s : "%", + islot[-2].flags, islot[-2].arg, islot[-1].arg); + goto skip_buf; + } + break; + case TYPE_PERCENT: + case TYPE_S: /* with width or precision (not both) */ + if (islot[-1].type == TYPE_WIDTH) { + result += produce_string (produce, &parm, + (islot->type == TYPE_S) ? argv[islot->arg].s : "%", + islot[-1].flags, islot[-1].arg, -1); + } else { + result += produce_string (produce, &parm, + (islot->type == TYPE_S) ? argv[islot->arg].s : "%", + 0, 0, islot[-1].arg); + } + goto skip_buf; + } + break; + case TYPE_PERCENT: + case TYPE_S: /* with neither width nor precision */ + result += produce_string (produce, &parm, + (islot->type == TYPE_S) ? argv[islot->arg].s : "%", + 0, 0, -1); + goto skip_buf; + } + if (parm && *buf) { /* produce buf */ + const size_t n = strlen (buf); + parm = produce (parm, buf, n); + if (parm) result += n; + } + skip_buf: + ++islot; + } + if (parm && *next) { /* produce the remainder of format */ + const size_t n = strlen (next); + parm = produce (parm, next, n); + if (parm) result += n; + } + + bail: + if (fmt != deffmt) free (fmt); + if (argv != defargv) free (argv); + if (slot != defslot) free (slot); +/*fprintf (stderr, "------\n");*/ + return result; +} + +size_t +dsgw_fputn (FILE* f, const char* s, size_t n) +{ + auto const size_t result = + fwrite (s, sizeof(char), n, f); + dsgw_log_out (s, result); + return result; +} + +static const char* +strnbrk (const char* str, size_t n, const char* brk) +{ + for (; n > 0; ++str, --n) { + if (strchr (brk, *str)) { + return str; + } + } + return NULL; +} + +static int quotation_depth = 0; +static int quotation_type[4]; /* maximum depth */ +#define QUOTATION_JAVASCRIPT_ENDOFLINE 1 + +static size_t +dsgw_emitr (int depth, const char* s, size_t n) +{ + static const char* linebreak = "' +\n'"; + static const size_t linebreak_len = 5; + auto size_t result = 0; + if (n == 0) { + return 0; + } else if (depth == 0) { + return dsgw_fputn (stdout, s, n); + } + --depth; + switch (quotation_type[depth]) { + case QUOTATION_JAVASCRIPT: + case QUOTATION_JAVASCRIPT_MULTILINE: + case QUOTATION_JAVASCRIPT_ENDOFLINE: + { + auto const char* t; + for (t = s; (t = strnbrk (t, n, "'\\\n")) != NULL; ++t) { + switch (*t) { + case '\n': /* output \n */ + if (t != s) { + if (quotation_type[depth] == QUOTATION_JAVASCRIPT_ENDOFLINE) { + dsgw_emitr (depth, linebreak, linebreak_len); + } + result += dsgw_emitr (depth, s, t - s); + } + if (dsgw_emitr (depth, "\\n", 2) > 1) ++result; + if (quotation_type[depth] == QUOTATION_JAVASCRIPT_MULTILINE) { + quotation_type[depth] = QUOTATION_JAVASCRIPT_ENDOFLINE; + } + break; + default: /* insert \ */ + if (quotation_type[depth] == QUOTATION_JAVASCRIPT_ENDOFLINE) { + quotation_type[depth] = QUOTATION_JAVASCRIPT_MULTILINE; + dsgw_emitr (depth, linebreak, linebreak_len); + } + result += dsgw_emitr (depth, s, t - s); + dsgw_emitr (depth, "\\", 1); + result += dsgw_emitr (depth, t, 1); + break; + } + n -= (t - s) + 1; + s = t + 1; + } + } + if (n > 0 && + quotation_type[depth] == QUOTATION_JAVASCRIPT_ENDOFLINE) { + quotation_type[depth] = QUOTATION_JAVASCRIPT_MULTILINE; + dsgw_emitr (depth, linebreak, linebreak_len); + } + break; + default: + break; + } + if (n > 0) { + result += dsgw_emitr (depth, s, n); + } + return result; +} + +static size_t +dsgw_emitq (FILE* f, const char* s, size_t n) +{ + if (f == stdout && quotation_depth > 0) { + return dsgw_emitr (quotation_depth, s, n); + } + return dsgw_fputn (f, s, n); +} + +void +dsgw_quotation_begin (int kind) +{ + if (quotation_depth >= 4) exit (4); + switch (kind) { + case QUOTATION_JAVASCRIPT: + case QUOTATION_JAVASCRIPT_MULTILINE: + dsgw_emitq (stdout, "'", 1); + break; + default: + break; + } + quotation_type[quotation_depth++] = kind; +} + +void +dsgw_quotation_end() +{ + if (quotation_depth > 0) switch (quotation_type[--quotation_depth]) { + case QUOTATION_JAVASCRIPT: + case QUOTATION_JAVASCRIPT_MULTILINE: + case QUOTATION_JAVASCRIPT_ENDOFLINE: + dsgw_emitq (stdout, "'", 1); + break; + default: + break; + } +} + +int +dsgw_quote_emits (int kind, const char* s) +{ + int result; + dsgw_quotation_begin (kind); + result = dsgw_emits (s); + dsgw_quotation_end(); + return result; +} + +int +dsgw_quote_emitf (int kind, const char* format, ...) +{ + int result; + va_list argl; + va_start (argl, format); + dsgw_quotation_begin (kind); + result = dsgw_emitfv (format, argl); + dsgw_quotation_end(); + va_end (argl); + return result; +} + +static UConverter* emit_converter = NULL; + +/* given string is utf8 - emit_converter converts given string + to some natural language encoding requested by the client */ +void* +dsgw_emitn (void* parm, const char* s, size_t n) +{ + if (emit_converter == NULL) { + if (dsgw_emitq ((FILE*)parm, s, n) != n) { + return NULL; + } + } else { +#define CONVERT_BUFSIZE 2048 + char buf [CONVERT_BUFSIZE]; /* faster than malloc/free */ + char *bufptr = buf; + size_t len = 0; + size_t slen = 0; + UErrorCode err = U_ZERO_ERROR; + int result; + + do { + bufptr = buf; /* reset to beginning of buf */ + s += slen; /* advance pointer to next unconverted chars */ + /* convert as many chars from s as will fit in buf */ + result = dsgw_convert(DSGW_FROM_UTF8, emit_converter, + &bufptr, sizeof(buf), &len, + s, n, &slen, &err); + /* write the converted chars to the output */ + n = dsgw_emitq ((FILE*)parm, buf, len); + } while ((result == 0) && (n == len)); + + ucnv_reset (emit_converter); + if (n != len) { + return NULL; + } + } + return parm; +} + +int +dsgw_emits (const char* s) + /* This function works like fputs(s, stdout), except it + converts from UTF8 to the client's preferred charset. + */ +{ + size_t n = strlen (s); + if (n > 0 && dsgw_emitn (stdout, s, n) == NULL) { + return EOF; + } + return n; +} + +int +dsgw_emitfv (const char* format, va_list argl) + /* This function works like vprintf(), except it: + - supports parameter reordering, using %posp$. + - is UTF8-aware. + - converts to the client's preferred charset. + This function interprets all string parameters as UTF8. + */ +{ + return( dsgw_vxprintf (dsgw_emitn, stdout, format, argl)); +} + +int +dsgw_emitf (const char* format, ...) +{ + int rc; + + va_list argl; + va_start (argl, format); + rc = dsgw_emitfv (format, argl); + va_end (argl); + + return( rc ); +} + +typedef struct struct_item_t { + char* i_val; + double i_q; +} item_t; + +static size_t +list_count (const char* list) +{ + const char* s; + size_t n = 1; + if (list == NULL || *list == '\0') return 0; + for (s = list - 1; (s = strchr (s + 1, ',')) != NULL; ++n); + return n; +} + +static item_t* +list_parse (char* slist, size_t items) +{ + char* s = slist; + item_t* item; + size_t i = 0; + if (items <= 0) return NULL; + item = (item_t*) dsgw_ch_malloc (items * sizeof(item_t)); + while (ldap_utf8isspace (s)) LDAP_UTF8INC(s); + while (s && *s) { + if (i >= items) exit (1); + item[i].i_q = 1.0; + item[i++].i_val = s; + if ((s = strchr (s, ',')) != NULL) { + *s = '\0'; + while (ldap_utf8isspace (LDAP_UTF8INC(s))); + } + } + if (i != items) exit (1); + for (i = 0; i < items; ++i) { + if ((s = strchr (item[i].i_val, ';')) != NULL) { + *s = '\0'; + do { + while (ldap_utf8isspace (LDAP_UTF8INC(s))); + if (*s == 'q' || *s == 'Q') { + while (ldap_utf8isspace (LDAP_UTF8INC(s))); + if (*s == '=') { + item[i].i_q = strtod(++s, &s); + } + } + } while ((s = strchr (s, ';')) != NULL); + } + /* Remove trailing whitespace from item[i].i_val: */ + s = item[i].i_val; + s += strlen (s); + while (ldap_utf8isspace (LDAP_UTF8DEC(s))); + s[1] = '\0'; +/*printf("%s;q=%.2f\n", item[i].i_val, item[i].i_q);*/ + } + return item; +} + +static void +list_sort (item_t item[], size_t items) +{ + /* This implementation is suboptimal, but adequate. */ + int sorted; + size_t i; + do { + sorted = 1; + for (i = 0; i+1 < items ; ++i) { + if (item[i].i_q < item[i+1].i_q) { /* swap i & i+1 */ + auto item_t temp; + memcpy (&temp, &item[i], sizeof(item_t)); + memcpy (&item[i], &item[i+1], sizeof(item_t)); + memcpy (&item[i+1], &temp, sizeof(item_t)); + sorted = 0; + } + } + } while ( ! sorted); +} + +int +is_UTF_8 (const char* charset) +{ + return charset != NULL && + (!strcasecmp (charset, UNICODE_ENCODING_UTF_8) || + !strcasecmp (charset, "UNICODE-1-1-UTF-8")); +} + +static int +charset_is_supported (char* s) +{ + UConverter* converter; + UErrorCode err = U_ZERO_ERROR; + if (is_UTF_8 (s)) { + return 1; + } + converter = ucnv_open (s, &err); + if (err == U_ZERO_ERROR) { + ucnv_close (converter); + return 1; + } + return 0; +} + +static char* +choose_charset (char* slist) + /* Return the best charset from the given list. */ +{ + const size_t items = list_count (slist); + char* sbuf; + item_t* item; + size_t i; + + if (items <= 0) return slist; + sbuf = dsgw_ch_strdup (slist); + item = list_parse (sbuf, items); + for (i = 0; i < items; ++i) { + if (is_UTF_8 (item[i].i_val)) { + break; /* choose this one */ + } + } + if (i >= items) { + list_sort (item, items); + for (i = 0; i < items; ++i) { + auto char* charset = item[i].i_val; + if (!strcmp ("*", charset)) { + i = items; /* choose UTF_8 */ + } else if (charset_is_supported (charset)) { + break; /* choose this one */ + } + } + } + if (i >= items) { + strcpy (sbuf, UNICODE_ENCODING_UTF_8); + } else if (sbuf != item[i].i_val) { + memmove (sbuf, item[i].i_val, strlen(item[i].i_val) + 1); + } + free (item); + return sbuf; +} + +char* +dsgw_emit_converts_to (char* charset) +{ + const char* target; + if (emit_converter != NULL) { + ucnv_close (emit_converter); + emit_converter = NULL; + } + if (charset) charset = choose_charset (charset); + if (charset && *charset) { + target = charset; + } else { + target = ISO_8859_1_ENCODING; + } + if ( ! is_UTF_8 (target)) { + UErrorCode err = U_ZERO_ERROR; + emit_converter = ucnv_open(target, &err); + if (err != U_ZERO_ERROR) { + emit_converter = NULL; + charset = UNICODE_ENCODING_UTF_8; + } + } + return charset; +} diff --git a/entrydisplay.c b/entrydisplay.c new file mode 100644 index 0000000..a5ca95d --- /dev/null +++ b/entrydisplay.c @@ -0,0 +1,3201 @@ +/** --- BEGIN COPYRIGHT BLOCK --- + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + --- END COPYRIGHT BLOCK --- */ +/* + * entrydisplay.c -- output entries one at a time or in a list -- HTTP gateway + */ + +#include "dsgw.h" +#include "dbtdsgw.h" +#include /* ldap_utf8* */ +#include +#include +#include +#include + +/* + * Note: the value of the following DSGW_ATTRHTML_XXX #defines must match + * their position in the attrhtmltypes[] and attrhtmlvals[] arrays. + */ +#define DSGW_ATTRHTML_HIDDEN 0 +#define DSGW_ATTRHTML_TEXT 1 +#define DSGW_ATTRHTML_TEXTAREA 2 +#define DSGW_ATTRHTML_RADIO 3 +#define DSGW_ATTRHTML_CHECKBOX 4 +#define DSGW_ATTRHTML_PASSWORD 5 +static char *attrhtmltypes[] = { + "hidden", + "text", + "textarea", + "radio", + "checkbox", + "password", + NULL +}; +static int attrhtmlvals[] = { + DSGW_ATTRHTML_HIDDEN, + DSGW_ATTRHTML_TEXT, + DSGW_ATTRHTML_TEXTAREA, + DSGW_ATTRHTML_RADIO, + DSGW_ATTRHTML_CHECKBOX, + DSGW_ATTRHTML_PASSWORD, +}; + +#define DSGW_ATTROPT_SORT 0x00000001 +#define DSGW_ATTROPT_NOLINK 0x00000002 +#define DSGW_ATTROPT_DNTAGS 0x00000004 +#define DSGW_ATTROPT_DATEONLY 0x00000008 /* only for syntax=time */ +#define DSGW_ATTROPT_READONLY 0x00000010 /* over-rides ..._EDITABLE */ +#define DSGW_ATTROPT_DNPICKER 0x00000020 /* display dns for find-n-add */ +#define DSGW_ATTROPT_UNIQUE 0x00000040 /* attr values must be unique */ +#define DSGW_ATTROPT_LINK 0x00000080 /* link to attribute value */ +#define DSGW_ATTROPT_TYPEONLY 0x00000100 /* retrieve attr. type only */ +#define DSGW_ATTROPT_NO_ENTITIES 0x00000200 /* don't use entities */ +#define DSGW_ATTROPT_HEX 0x00000400 /* display as hex value */ +#define DSGW_ATTROPT_DECIMAL 0x00000800 /* display as decimal value */ +#define DSGW_ATTROPT_QUOTED 0x00001000 /* quote the result */ +#define DSGW_ATTROPT_EDITABLE 0x10000000 /* not exposed in HTML */ +#define DSGW_ATTROPT_ADDING 0x20000000 /* not exposed in HTML */ +#define DSGW_ATTROPT_LINK2EDIT 0x40000000 /* not exposed in HTML */ +static char *attroptions[] = { + "sort", + "nolink", + "dntags", + "dateonly", + "readonly", + "dnpicker", + "unique", + "link", + "typeonly", + "noentities", + "hex", + "decimal", + "quoted", + NULL +}; + +static unsigned long attroptvals[] = { + DSGW_ATTROPT_SORT, + DSGW_ATTROPT_NOLINK, + DSGW_ATTROPT_DNTAGS, + DSGW_ATTROPT_DATEONLY, + DSGW_ATTROPT_READONLY, + DSGW_ATTROPT_DNPICKER, + DSGW_ATTROPT_UNIQUE, + DSGW_ATTROPT_LINK, + DSGW_ATTROPT_TYPEONLY, + DSGW_ATTROPT_NO_ENTITIES, + DSGW_ATTROPT_HEX, + DSGW_ATTROPT_DECIMAL, + DSGW_ATTROPT_QUOTED, +}; + + +#define DSGW_ATTRARG_ATTR "attr" +#define DSGW_ATTRARG_SYNTAX "syntax" +#define DSGW_ATTRARG_HTMLTYPE "type" +#define DSGW_ATTRARG_OPTIONS "options" +#define DSGW_ATTRARG_DEFAULT "defaultvalue" +#define DSGW_ATTRARG_WITHIN "within" /* overrides href & hrefextra */ +#define DSGW_ATTRARG_HREF "href" +#define DSGW_ATTRARG_HREFEXTRA "hrefextra" +#define DSGW_ATTRARG_LABEL "label" /* only used with syntax=dn */ +#define DSGW_ATTRARG_DNCOMP "dncomponents" /* only used with syntax=dn */ +#define DSGW_ATTRARG_TRUESTR "true" /* only used with syntax=bool */ +#define DSGW_ATTRARG_FALSESTR "false" /* only used with syntax=bool */ +#define DSGW_ATTRARGS_SIZE "size" +#define DSGW_ATTRARGS_ROWS "rows" +#define DSGW_ATTRARGS_COLS "cols" +#define DSGW_ATTRARGS_NUMFIELDS "numfields" +#define DSGW_ATTRARGS_VALUE "value" +#define DSGW_ATTRARG_MIMETYPE "mimetype" +#define DSGW_ATTRARG_SCRIPT "script" + +#define DSGW_ARG_BUTTON_PROMPT "prompt" +#define DSGW_ARG_BUTTON_TEMPLATE "template" +#define DSGW_ARG_BUTTON_CHECKSUBMIT "checksubmit" +#define DSGW_ARG_BUTTON_TOPIC "topic" +#define DSGW_ARG_DNEDIT_LABEL "label" +#define DSGW_ARG_DNEDIT_TEMPLATE "template" +#define DSGW_ARG_DNEDIT_ATTR "attr" +#define DSGW_ARG_DNEDIT_DESC "desc" + +#define DSGW_ARG_FABUTTON_LABEL "label" +#define DSGW_ARG_FABUTTON_ATTRNAME "attr" +#define DSGW_ARG_FABUTTON_ATTRDESC "attrdesc" + +#define DSGW_ARG_AVSET_SET "set" + +/* + * structure used simply to avoid passing a lot of parameters in call to + * the attribute syntax handlers + */ +struct dsgw_attrdispinfo { + struct attr_handler *adi_handlerp; + char *adi_attr; + int adi_argc; + char **adi_argv; + char **adi_vals; + char *adi_rdn; /* a copy of adi_vals[i] (possibly NULL) */ + int adi_htmltype; + unsigned long adi_opts; +}; +/* adi_rdn should be generalized, to support an RDN + that contains several values of one attribute type. +*/ + +typedef void (*attrdisplay)( struct dsgw_attrdispinfo *adip ); +typedef void (*attredit)( struct dsgw_attrdispinfo *adip ); + +struct attr_handler { + char *ath_syntax; /* dn, tel, cis, etc. */ + attrdisplay ath_display; /* function to display values */ + attredit ath_edit; /* function to display for editing */ + int ath_compare; /* compare function */ +}; + +/* functions local to this file */ +static void append_to_array( char ***ap, int *countp, char *s ); +static unsigned long get_attr_options( int argc, char **argv ); +static void output_prelude( dsgwtmplinfo *tip ); +static void output_nonentry_line( dsgwtmplinfo *tip, char *line ); +static struct attr_handler *syntax2attrhandler( char *syntax ); +static int numfields( int argc, char **argv, int valcount ); +static void element_sizes( int argc, char **argv, char **vals, int valcount, + int *rowsp, int *colsp ); +#define DSGW_TEXTOPT_FOCUSHANDLERS 0x0001 +#define DSGW_TEXTOPT_CHANGEHANDLERS 0x0002 +static void output_text_elements( int argc, char **argv, char *attr, + char **vals, const char* rdn, char *prefix, int htmltype, unsigned long opts ); +static void output_textarea( int argc, char **argv, char *attr, + char **vals, int valcount, char *prefix, unsigned long opts ); +static void emit_value( char *val, int quote_html_specials ); +static void output_text_checkbox_or_radio( struct dsgw_attrdispinfo *adip, + char *prefix, int htmltype ); +static void do_attribute( dsgwtmplinfo *tip, char *dn, unsigned long dispopts, + int argc, char **argv ); +static void do_orgchartlink( dsgwtmplinfo *tip, char *dn, unsigned long dispopts, + int argc, char **argv ); +static void do_attrvalset( dsgwtmplinfo *tip, char *dn, unsigned long dispopts, + int argc, char **argv ); +static void do_editbutton( char *dn, char *encodeddn, int argc, char **argv ); +static void do_savebutton( unsigned long dispopts, int argc, char **argv ); +static void do_deletebutton( int argc, char **argv ); +static void do_editasbutton( int argc, char **argv ); +static void do_dneditbutton( unsigned long dispopts, int argc, char **argv ); +static void do_searchdesc( dsgwtmplinfo *tip, int argc, char **argv ); +static void do_passwordfield( unsigned long dispopts, int argc, char **argv, + char *fieldname ); +static void do_helpbutton( unsigned long dispopts, int argc, char **argv ); +static void do_closebutton( unsigned long dispopts, int argc, char **argv ); +static void do_viewswitcher( char *template, char *dn, int argc, char **argv ); +static int did_output_as_special( int argc, char **argv, char *label, + char *val ); +static char *time2text( char *ldtimestr, int dateonly ); +static long gtime( struct tm *tm ); +static int looks_like_dn( char *s ); +static void do_std_completion_js( char *template, int argc, char **argv ); +static int condition_is_true( int argc, char **argv, void *arg ); +static char ** dsgw_get_values( LDAP *ld, LDAPMessage *entry, + const char *target, int binary_value ); +static void dsgw_value_free( void **ldvals, int binary ) ; +static char *dsgw_time(time_t secs_since_1970); + +/* attribute syntax handler routines */ +#if NEEDED_FOR_DEBUGGING +static void ntdomain_display( struct dsgw_attrdispinfo *adip ); +#endif +static void ntuserid_display( struct dsgw_attrdispinfo *adip ); +static void str_display( struct dsgw_attrdispinfo *adip ); +static void str_edit( struct dsgw_attrdispinfo *adip ); +static void dn_display( struct dsgw_attrdispinfo *adip ); +static void dn_edit( struct dsgw_attrdispinfo *adip ); +static void mail_display( struct dsgw_attrdispinfo *adip ); +static void mls_display( struct dsgw_attrdispinfo *adip ); +static void mls_edit( struct dsgw_attrdispinfo *adip ); +static void binvalue_display( struct dsgw_attrdispinfo *adip ); +static void url_display( struct dsgw_attrdispinfo *adip ); +static void bool_display( struct dsgw_attrdispinfo *adip ); +static void bool_edit( struct dsgw_attrdispinfo *adip ); +static void time_display( struct dsgw_attrdispinfo *adip ); + + +/* static variables */ +#define DSGW_MOD_PREFIX_NORMAL 0 +#define DSGW_MOD_PREFIX_UNIQUE 1 +static char *replace_prefixes[] = { "replace_", "replace_unique_" }; +static char *replace_mls_prefixes[] = { "replace_mls_", "replace_mls_unique_" }; +static char *add_prefixes[] = { "add_", "add_unique_" }; +static char *add_mls_prefixes[] = { "add_mls_", "add_mls_unique_" }; + +struct attr_handler attrhandlers[] = { + { "cis", str_display, str_edit, CASE_INSENSITIVE }, + { "dn", dn_display, dn_edit, CASE_INSENSITIVE }, + { "mail", mail_display, str_edit, CASE_INSENSITIVE }, + { "mls", mls_display, mls_edit, CASE_INSENSITIVE }, + { "tel", str_display, str_edit, CASE_INSENSITIVE }, + { "url", url_display, str_edit, CASE_EXACT }, + { "ces", str_display, str_edit, CASE_EXACT }, + { "bool", bool_display, bool_edit, CASE_INSENSITIVE }, + { "time", time_display, str_edit, CASE_INSENSITIVE }, + { "ntuserid", ntuserid_display, str_edit, CASE_INSENSITIVE }, + { "ntgroupname", ntuserid_display, str_edit, CASE_INSENSITIVE }, + { "binvalue", binvalue_display, str_edit, CASE_INSENSITIVE }, +}; +#define DSGW_AH_COUNT ( sizeof( attrhandlers ) / sizeof( struct attr_handler )) + + +static char * +template_filename( int tmpltype, char *template ) +{ + char *fn, *prefix, *suffix = ".html"; + + if ( tmpltype == DSGW_TMPLTYPE_LIST ) { + prefix = DSGW_CONFIG_LISTPREFIX; + } else if ( tmpltype == DSGW_TMPLTYPE_EDIT ) { + prefix = DSGW_CONFIG_EDITPREFIX; + } else if ( tmpltype == DSGW_TMPLTYPE_ADD ) { + prefix = DSGW_CONFIG_ADDPREFIX; + } else { + prefix = DSGW_CONFIG_DISPLAYPREFIX; + } + + fn = dsgw_ch_malloc( strlen( prefix ) + strlen( template ) + + strlen( suffix ) + 1 ); + sprintf( fn, "%s%s%s", prefix, template, suffix ); + + return( fn ); +} + +static void +do_postedvalue( int argc, char **argv ) +{ + dsgw_emits( "VALUE=\"" ); + dsgw_emit_cgi_var( argc, argv ); + dsgw_emits( "\"\n" ); +} + +static int +dsgw_display_line( dsgwtmplinfo *tip, char *line, int argc, char **argv ) +{ + if ( dsgw_directive_is( line, DRCT_DS_POSTEDVALUE )) { + do_postedvalue( argc, argv ); + } else if ( dsgw_directive_is( line, DRCT_DS_HELPBUTTON )) { + do_helpbutton( tip->dsti_options, argc, argv ); + } else if ( dsgw_directive_is( line, DRCT_DS_CLOSEBUTTON )) { + do_closebutton( tip->dsti_options, argc, argv ); + } else if ( dsgw_directive_is( line, DRCT_DS_OBJECTCLASS )) { + /* omit objectClass lines */ + } else if ( dsgw_directive_is( line, DRCT_HEAD )) { + dsgw_head_begin(); + dsgw_emits ("\n"); + } else { + return 0; + } + return 1; +} + +dsgwtmplinfo * +dsgw_display_init( int tmpltype, char *template, unsigned long options ) +{ + dsgwtmplinfo *tip; + int argc, attrcount, attrsonlycount, skip_line, in_entry; + char **argv, *attr, *filename, line[ BIG_LINE ]; + unsigned long aopts; + + /* template is passed in from the user - make sure it looks like a valid name */ + if (!dsgw_valid_docname(template)) { + dsgw_error( DSGW_ERR_BADFILEPATH, template, + DSGW_ERROPT_EXIT, 0, NULL ); + } + + tip = (dsgwtmplinfo *)dsgw_ch_malloc( sizeof( dsgwtmplinfo )); + memset( tip, 0, sizeof( dsgwtmplinfo )); + tip->dsti_type = tmpltype; + tip->dsti_options = options; + tip->dsti_template = dsgw_ch_strdup( template ); + + if (( options & DSGW_DISPLAY_OPT_ADDING ) != 0 ) { + options |= DSGW_DISPLAY_OPT_EDITABLE; /* add implies editable */ + + if ( tmpltype != DSGW_TMPLTYPE_ADD ) { + /* + * if we are going to display an "add" view of an entry and + * an add template has not been explicitly requested, first look + * for a file called "add-TEMPLATE.html" and fall back on using + * whatever we would use if just editing an existing entry. + */ + filename = template_filename( DSGW_TMPLTYPE_ADD, template ); + tip->dsti_fp = dsgw_open_html_file( filename, DSGW_ERROPT_IGNORE ); + free( filename ); + } + } + + if ( tip->dsti_fp == NULL && ( options & DSGW_DISPLAY_OPT_EDITABLE ) != 0 + && tmpltype != DSGW_TMPLTYPE_EDIT ) { + /* + * if we are going to display an editable view of an entry and + * an edit template has not been explicitly requested, first look + * for a file called "edit-TEMPLATE.html" and fall back on using + * "list-TEMPLATE.html" or "display-TEMPLATE.html", as indicated by + * the value of tmpltype. + */ + filename = template_filename( DSGW_TMPLTYPE_EDIT, template ); + tip->dsti_fp = dsgw_open_html_file( filename, DSGW_ERROPT_IGNORE ); + free( filename ); + } + + if ( tip->dsti_fp == NULL ) { + filename = template_filename( tmpltype, template ); + tip->dsti_fp = dsgw_open_html_file( filename, DSGW_ERROPT_EXIT ); + free( filename ); + } + + tip->dsti_preludelines = dsgw_savelines_alloc(); + tip->dsti_entrylines = dsgw_savelines_alloc(); + in_entry = 0; + + /* prime attrs array so we always retrieve objectClass values */ + attrcount = 1; + tip->dsti_attrs = (char **)dsgw_ch_realloc( tip->dsti_attrs, + 2 * sizeof( char * )); + tip->dsti_attrs[ 0 ] = dsgw_ch_strdup( DSGW_ATTRTYPE_OBJECTCLASS ); + tip->dsti_attrs[ 1 ] = NULL; + attrsonlycount = 0; + tip->dsti_attrsonly_attrs = NULL; + + while ( dsgw_next_html_line( tip->dsti_fp, line )) { + skip_line = 0; + if ( dsgw_parse_line( line, &argc, &argv, 1, condition_is_true, tip )) { + if ( in_entry && dsgw_directive_is( line, DRCT_DS_ENTRYEND )) { + dsgw_argv_free( argv ); + break; /* the rest is read inside dsgw_display_done */ + } + if ( dsgw_directive_is( line, DRCT_DS_ENTRYBEGIN )) { + in_entry = skip_line = 1; + } else if ( dsgw_directive_is( line, DRCT_DS_ATTRIBUTE ) || + dsgw_directive_is( line, DRCT_DS_ATTRVAL_SET )) { + aopts = get_attr_options( argc, argv ); + if (( attr = get_arg_by_name( DSGW_ATTRARG_ATTR, argc, + argv )) != NULL && strcasecmp( attr, "dn" ) != 0 && + (strcasecmp(attr,DSGW_ATTRTYPE_AIMSTATUSTEXT) != 0 || gc->gc_aimpresence == 1) && + ( aopts & DSGW_ATTROPT_LINK ) == 0 ) { + if (( aopts & DSGW_ATTROPT_TYPEONLY ) == 0 ) { + append_to_array( &tip->dsti_attrs, &attrcount, attr ); + } else { + append_to_array( &tip->dsti_attrsonly_attrs, + &attrsonlycount, attr ); + } + } + } else if ( dsgw_directive_is( line, DRCT_DS_ORGCHARTLINK )) { + aopts = get_attr_options( argc, argv ); + if (( aopts & DSGW_ATTROPT_TYPEONLY ) == 0 ) { + append_to_array( &tip->dsti_attrs, &attrcount, gc->gc_orgchartsearchattr ); + } else { + append_to_array( &tip->dsti_attrsonly_attrs, + &attrsonlycount, gc->gc_orgchartsearchattr); + } + } else if ( dsgw_directive_is( line, DRCT_DS_SORTENTRIES )) { + if (( attr = get_arg_by_name( DSGW_ATTRARG_ATTR, argc, + argv )) == NULL ) { + tip->dsti_sortbyattr = NULL; /* no attr=, so sort by DN */ + } else { + tip->dsti_sortbyattr = dsgw_ch_strdup( attr ); + } + skip_line = 1; /* completely done with directive */ + } + dsgw_argv_free( argv ); + } + + if ( !skip_line ) { + if ( in_entry ) { /* in entry */ + dsgw_savelines_save( tip->dsti_entrylines, line ); + } else { /* in prelude */ + dsgw_savelines_save( tip->dsti_preludelines, line ); + } + } + } + + if ( attrcount > 0 ) { + tip->dsti_attrflags = (unsigned long *)dsgw_ch_malloc( attrcount + * sizeof( unsigned long )); + memset( tip->dsti_attrflags, 0, attrcount * sizeof( unsigned long )); + } + + /* + * Add the sortattr to the list of attrs retrieved, if it's not + * already in the list. + */ + if ( tip->dsti_sortbyattr != NULL ) { + int i, found = 0; + for ( i = 0; i < attrcount; i++ ) { + if ( !strcasecmp( tip->dsti_sortbyattr, tip->dsti_attrs[ i ])) { + found = 1; + break; + } + } + if ( !found ) { + append_to_array( &tip->dsti_attrs, &attrcount, + tip->dsti_sortbyattr ); + } + } + + return( tip ); +} + + +void +dsgw_display_entry( dsgwtmplinfo *tip, LDAP *ld, LDAPMessage *entry, + LDAPMessage *attrsonly_entry, char *dn ) +{ + int argc, editable, adding; + char **argv, *encodeddn, *line; + + editable = (( tip->dsti_options & DSGW_DISPLAY_OPT_EDITABLE ) != 0 ); + adding = (( tip->dsti_options & DSGW_DISPLAY_OPT_ADDING ) != 0 ); + + if ( entry == NULL && !adding ) { + dsgw_error( DSGW_ERR_MISSINGINPUT, NULL, DSGW_ERROPT_EXIT, 0, NULL ); + } + + tip->dsti_ld = ld; + tip->dsti_entry = entry; + tip->dsti_attrsonly_entry = attrsonly_entry; + + if ( dn == NULL ) { + if ( entry == NULL ) { + dn = "dn=unknown"; + } else if (( dn = ldap_get_dn( ld, entry )) == NULL ) { + dsgw_ldap_error( ld, DSGW_ERROPT_EXIT ); + } + } + tip->dsti_entrydn = dsgw_ch_strdup( dn ); + encodeddn = dsgw_strdup_escaped( dn ); + + if ( adding ) { + tip->dsti_rdncomps = dsgw_rdn_values( dn ); + } + + if ( tip->dsti_preludelines != NULL ) { + output_prelude( tip ); + } + + + dsgw_savelines_rewind( tip->dsti_entrylines ); + while (( line = dsgw_savelines_next( tip->dsti_entrylines )) != NULL ) { + if ( dsgw_parse_line( line, &argc, &argv, 0, condition_is_true, tip )) { + if ( dsgw_directive_is( line, DRCT_DS_ATTRIBUTE )) { + do_attribute( tip, dn, tip->dsti_options, argc, argv ); + + } else if ( dsgw_directive_is( line, DRCT_DS_ATTRVAL_SET )) { + do_attrvalset( tip, dn, tip->dsti_options, argc, argv ); + + } else if ( dsgw_directive_is( line, DRCT_DS_ORGCHARTLINK )) { + do_orgchartlink( tip, dn, tip->dsti_options, argc, argv ); + + } else if ( dsgw_directive_is( line, DRCT_DS_EMIT_BASE_HREF )) { + char *p; + char *sname = dsgw_ch_strdup( getenv( "SCRIPT_NAME" )); + if (( p = strrchr( sname, '/' )) != NULL ) { + *p = '\0'; + } + dsgw_emitf( "\n", + dsgw_server_url(), sname ); + + } else if ( dsgw_directive_is( line, DRCT_DS_BEGIN_DNSEARCHFORM )) { + dsgw_form_begin ( "searchForm", "action=\"%s\" %s %s", + dsgw_getvp( DSGW_CGINUM_DOSEARCH ), + "target=stagingFrame", + "onSubmit=\"return parent.processSearch(searchForm);\"" ); + dsgw_emitf( "\n\n", encodeddn ); + + } else if ( dsgw_directive_is( line, DRCT_DS_BEGIN_ENTRYFORM )) { + if ( editable ) { + dsgw_form_begin("modifyEntryForm","ACTION=\"%s\"", + dsgw_getvp( DSGW_CGINUM_DOMODIFY )); + dsgw_emits( "\n\n" ); + dsgw_emitf( "\n", + encodeddn ); + dsgw_emits( "\n"); + dsgw_emits( "\n"); + + } else { + dsgw_form_begin("editEntryForm", "action=\"%s\" %s", + dsgw_getvp( DSGW_CGINUM_AUTH ), + "target=\"_blank\"" ); + dsgw_emits( "\n" ); + } + + } else if ( dsgw_directive_is( line, DRCT_DS_END_ENTRYFORM )) { + dsgw_emitf( "\n" ); + dsgw_emit_confirmForm(); + + } else if ( dsgw_directive_is( line, DRCT_DS_END_DNSEARCHFORM )) { + dsgw_emitf( "\n" ); + dsgw_emit_alertForm(); + dsgw_emit_confirmForm(); + + } else if ( dsgw_directive_is( line, DRCT_DS_EDITBUTTON )) { + if ( !editable ) do_editbutton( dn, encodeddn, argc, argv ); + + } else if ( dsgw_directive_is( line, DRCT_DS_DELETEBUTTON )) { + if ( editable && !adding ) do_deletebutton( argc, argv ); + + } else if ( dsgw_directive_is( line, DRCT_DS_RENAMEBUTTON )) { + /* if ( editable && !adding ) do_renamebutton( dn, argc, argv ); */ + + } else if ( dsgw_directive_is( line, DRCT_DS_EDITASBUTTON )) { + if ( editable ) do_editasbutton( argc, argv ); + + } else if ( dsgw_directive_is( line, DRCT_DS_SAVEBUTTON )) { + if ( editable ) do_savebutton( tip->dsti_options, argc, argv ); + + } else if ( dsgw_display_line( tip, line, argc, argv )) { + + } else if ( dsgw_directive_is( line, DRCT_DS_NEWPASSWORD )) { + if ( editable ) do_passwordfield( tip->dsti_options, argc, + argv, "newpasswd" ); + + } else if ( dsgw_directive_is( line, DRCT_DS_CONFIRM_NEWPASSWORD )) { + if ( editable ) do_passwordfield( tip->dsti_options, argc, + argv, "newpasswdconfirm" ); + + } else if ( dsgw_directive_is( line, DRCT_DS_OLDPASSWORD )) { + if ( editable ) do_passwordfield( tip->dsti_options, argc, + argv, "passwd" ); + + } else if ( dsgw_directive_is( line, DRCT_DS_DNATTR )) { + if ( dsgw_dnattr != NULL ) dsgw_emits( dsgw_dnattr ); + + } else if ( dsgw_directive_is( line, DRCT_DS_DNDESC )) { + if ( dsgw_dndesc != NULL ) dsgw_emits( dsgw_dndesc ); + + } else if ( dsgw_directive_is( line, DRCT_DS_DNEDITBUTTON )) { + if ( editable ) { + do_dneditbutton( tip->dsti_options, argc, argv ); + } + + } else if ( dsgw_directive_is( line, "DS_DNADDBUTTON" )) { + dsgw_emits ("\n"); + + } else if ( dsgw_directive_is( line, "DS_DNREMOVEBUTTON" )) { + dsgw_emits ("\n"); + + } else if ( dsgw_directive_is( line, DRCT_DS_VIEW_SWITCHER ) && + tip->dsti_entry != NULL ) { + do_viewswitcher( tip->dsti_template, tip->dsti_entrydn, + argc, argv ); + + } else if ( dsgw_directive_is( line, DRCT_DS_STD_COMPLETION_JS )) { + do_std_completion_js( tip->dsti_template, argc, argv ); + + } else { + dsgw_emits( line ); + } + + dsgw_argv_free( argv ); + } + } + + free( encodeddn ); +} + +static void +dsgw_setstr (char** into, const char* from) +{ + if (from) { + auto const size_t len = strlen (from) + 1; + *into = dsgw_ch_realloc (*into, len); + memmove (*into, from, len); + } else if (*into) { + free (*into); + *into = NULL; + } +} + +void +dsgw_set_searchdesc( dsgwtmplinfo *tip, char *s2, char *s3, char *s4 ) +{ + dsgw_setstr( &(tip->dsti_search2s), s2 ); + dsgw_setstr( &(tip->dsti_search3s), s3 ); + dsgw_setstr( &(tip->dsti_search4s), s4 ); +} + +void +dsgw_set_search_result( dsgwtmplinfo *tip, int entrycount, char *searcherror, + char *lderrtxt ) +{ + tip->dsti_entrycount = entrycount; + dsgw_setstr( &(tip->dsti_searcherror), searcherror ); + dsgw_setstr( &(tip->dsti_searchlderrtxt), lderrtxt ); +} + + +void +dsgw_display_done( dsgwtmplinfo *tip ) +{ + char line[ BIG_LINE ], *jscomp; + + if ( tip->dsti_preludelines != NULL ) { + output_prelude( tip ); + } + + while ( dsgw_next_html_line( tip->dsti_fp, line )) { + output_nonentry_line( tip, line ); + } + + /* + * check for "completion_javascript" form var and + * execute it if present. + */ + jscomp = dsgw_get_cgi_var( "completion_javascript", + DSGW_CGIVAR_OPTIONAL ); + if ( jscomp != NULL ) { + dsgw_emits( "\n" ); + } + + fflush( stdout ); + fflush( stdout ); + + dsgw_savelines_free( tip->dsti_entrylines ); + fclose( tip->dsti_fp ); + if ( tip->dsti_attrs != NULL ) { + ldap_value_free( tip->dsti_attrs ); + } + if ( tip->dsti_attrflags != NULL ) { + free( tip->dsti_attrflags ); + } + if ( tip->dsti_rdncomps != NULL ) { + ldap_value_free( tip->dsti_rdncomps ); + } + free( tip ); +} + + +static void +output_prelude( dsgwtmplinfo *tip ) +{ + int editable, adding; + char *line, *encodeddn; + + if ( tip->dsti_preludelines != NULL ) { /* output the prelude */ + dsgw_savelines_rewind( tip->dsti_preludelines ); + while (( line = dsgw_savelines_next( tip->dsti_preludelines )) + != NULL ) { + output_nonentry_line( tip, line ); + } + dsgw_savelines_free( tip->dsti_preludelines ); + tip->dsti_preludelines = NULL; + } + + /* output any JavaScript functions we want to include before the entry */ + dsgw_emits( "\n" ); +} + + +static void +output_nonentry_line( dsgwtmplinfo *tip, char *line ) +{ + int argc; + char **argv; + + if ( dsgw_parse_line( line, &argc, &argv, 0, condition_is_true, tip )) { + if ( dsgw_directive_is( line, DRCT_DS_SEARCHDESC )) { + do_searchdesc( tip, argc, argv ); + } else if ( dsgw_display_line ( tip, line, argc, argv )) { + } else { + dsgw_emits( line ); + } + dsgw_argv_free( argv ); + } +} + +static char* +find_RDN (char* DN, char* attr, char** vals) + /* Return a copy of the vals[i] that is + part of the RDN of the given DN. + */ +{ + if (DN && *DN && vals && *vals) { + auto char** RDNs = ldap_explode_dn (DN, 0); + auto char** AVAs = ldap_explode_rdn (RDNs[0], 0); + ldap_value_free (RDNs); + if (AVAs) { + auto char** val = NULL; + auto char** AVA; + for (AVA = AVAs; *AVA; ++AVA) { + auto char* RDN = strchr (*AVA, '='); + if (RDN) { + *RDN++ = '\0'; + if (!strcasecmp (*AVA, attr)) { + for (val = vals; *val; ++val) { + if (!strcmp (RDN, *val)) { + break; + } + } + if (*val) break; + /* bug: what if there are other AVAs + that also match attr and one of vals? + Even if this algorithm could find them, + it couldn't return them (the function + return value can't express multiple + values). + */ + } + } + } + ldap_value_free (AVAs); + if (val) return *val; + } + } + return NULL; +} + +/*static int + *is_aim_online(dsgwtmplinfo *tip) + *{ + * char **ldvals = (char **) dsgw_get_values(tip->dsti_ld, tip->dsti_entry, DSGW_ATTRTYPE_AIMSTATUSTEXT, 0); + * + * if (ldvals == NULL || *ldvals == NULL || strcmp(*ldvals, "") == 0 ) { + * return(0); + * } + * return(1); + * + *} + */ +static void +do_orgchartlink( dsgwtmplinfo *tip, char *dn, unsigned long dispopts, + int argc, char **argv ) +{ + char **ldvals = (char **) dsgw_get_values(tip->dsti_ld, tip->dsti_entry, gc->gc_orgchartsearchattr, 0); + char *escaped_value; + + if (gc->gc_orgcharturl == NULL || ldvals == NULL || *ldvals == NULL || strcmp(*ldvals,"") == 0) { + dsgw_emits("\"javascript:void(0)\""); + return; + } + dsgw_emits("\""); + dsgw_emits(gc->gc_orgcharturl); + escaped_value = dsgw_ch_malloc( 3 * strlen( ldvals[0] ) + 1 ); + *escaped_value = '\0'; + dsgw_strcat_escaped( escaped_value, ldvals[0]); + dsgw_emits(escaped_value); + dsgw_emits("\"\n"); + + return; +} + +static void +do_attribute( dsgwtmplinfo *tip, char *dn, unsigned long dispopts, + int argc, char **argv ) +{ + char *attr, *syntax, *defval, *tmpvals[ 2 ], *s; + char **ldvals, **vals; + unsigned long options; + int i, len, attrindex, htmltype; + struct dsgw_attrdispinfo adi; + int editable = 0; + int tagged_attrs = 0; + int binary_value = 0; + + if (( attr = get_arg_by_name( DSGW_ATTRARG_ATTR, argc, argv )) == NULL ) { + dsgw_emitf( XP_GetClientStr(DBT_missingS_), DSGW_ATTRARG_ATTR ); + return; + } + if (( syntax = get_arg_by_name( DSGW_ATTRARG_SYNTAX, argc, argv )) + == NULL ) { + syntax = "cis"; + } + + if (( s = get_arg_by_name( DSGW_ATTRARG_HTMLTYPE, argc, argv )) == NULL ) { + htmltype = DSGW_ATTRHTML_TEXT; + } else { + for ( i = 0; attrhtmltypes[ i ] != NULL; ++i ) { + if ( strcasecmp( s, attrhtmltypes[ i ] ) == 0 ) { + htmltype = attrhtmlvals[ i ]; + break; + } + } + if ( attrhtmltypes[ i ] == NULL ) { + dsgw_emitf( XP_GetClientStr(DBT_unknownSS_), DSGW_ATTRARG_HTMLTYPE, s ); + return; + } + } + + options = get_attr_options( argc, argv ); + + if (( options & DSGW_ATTROPT_TYPEONLY ) != 0 ) { + return; /* don't actually display attr. if we only retrieved types */ + } + + if (( options & DSGW_ATTROPT_LINK ) != 0 ) { + /* + * Output a "dosearch" URL that will retrieve this attribute. + * These used to look like: + * .../dosearch/:?dn=&&& + * + * Now, thanks to me, they look like: + * .../dosearch?context=&hp=:&dn=&ldq= + * - RJP + */ + char *urlprefix, *escapeddn, *mimetype, *prefix, *suffix; + + urlprefix = dsgw_build_urlprefix(); + escapeddn = dsgw_strdup_escaped( dn ); + mimetype = get_arg_by_name( DSGW_ATTRARG_MIMETYPE, argc, argv ); + if (( prefix = get_arg_by_name( "prefix", argc, argv )) == NULL ) { + prefix = ""; + } + if (( suffix = get_arg_by_name( "suffix", argc, argv )) == NULL ) { + suffix = ""; + } + + /* XXXmcs + * always reference first value for now ( "&0" ) unless returning + * link to a vCard (in which case we leave the &0 off) + */ + dsgw_emitf("%s\"%s%s&ldq=%s&%s%s\"%s\n", prefix, urlprefix, escapeddn, attr, + ( mimetype == NULL ) ? "" : mimetype, + ( strcasecmp( "_vcard", attr ) == 0 ) ? "" : "&0", suffix ); + free( urlprefix ); + free( escapeddn ); + return; + } + + if (( dispopts & DSGW_DISPLAY_OPT_EDITABLE ) != 0 + && ( options & DSGW_ATTROPT_READONLY ) == 0 ) { + options |= DSGW_ATTROPT_EDITABLE; + editable = 1; + if (( dispopts & DSGW_DISPLAY_OPT_ADDING ) != 0 ) { + options |= DSGW_ATTROPT_ADDING; + } + } + + if (( dispopts & DSGW_DISPLAY_OPT_LINK2EDIT ) != 0 ) { + options |= DSGW_ATTROPT_LINK2EDIT; + } + if ((options & DSGW_ATTROPT_QUOTED ) != 0 ) { + options &= ~DSGW_ATTROPT_EDITABLE;/* always read-only */ + options &= ~DSGW_ATTROPT_ADDING; /* always read-only */ + options |= DSGW_ATTROPT_READONLY; + } + + ldvals = vals = NULL; + + if ( strcasecmp( attr, "dn" ) == 0 ) { /* dn pseudo-attribute */ + tmpvals[ 0 ] = dn; + tmpvals[ 1 ] = NULL; + vals = tmpvals; + options &= ~DSGW_ATTROPT_EDITABLE; /* always read-only */ + options &= ~DSGW_ATTROPT_ADDING; /* always read-only */ + options |= DSGW_ATTROPT_READONLY; + } else if( strcasecmp( syntax, "binvalue" ) == 0) { + + binary_value = 1; + /* Only display tagged stuff on searches */ + if (editable){ + ldvals = (char **) ldap_get_values_len(tip->dsti_ld, tip->dsti_entry, attr); + tagged_attrs = 0; + } else { + ldvals = (char **) dsgw_get_values(tip->dsti_ld, tip->dsti_entry, attr, 1 /*binary value*/); + tagged_attrs = 1; + } + + if (ldvals != NULL) { + vals = ldvals; + } + } else if ( tip->dsti_entry != NULL) { + + /* Only display tagged stuff on searches */ + if ( editable){ + ldvals = (char **) ldap_get_values( tip->dsti_ld, tip->dsti_entry, attr); + tagged_attrs = 0; + } else { + ldvals = (char **) dsgw_get_values( tip->dsti_ld, tip->dsti_entry, attr, 0 ); + tagged_attrs = 1; + } + if (ldvals != NULL) { + vals = ldvals; + } + } + + if (vals == NULL && (options & DSGW_ATTROPT_QUOTED ) != 0 ) { + dsgw_emits( "\"\"" ); + return; + } + + if ( vals == NULL && tip->dsti_rdncomps != NULL + && ( options & DSGW_ATTROPT_ADDING ) != 0 ) { + /* + * include values from the DN of new entry being added + */ + len = strlen( attr ); + ldvals = NULL; + + for ( i = 0; tip->dsti_rdncomps[ i ] != NULL; ++i ) { + if (( s = strchr( tip->dsti_rdncomps[ i ], '=' )) != NULL && + s - tip->dsti_rdncomps[ i ] == len && + strncasecmp( attr, tip->dsti_rdncomps[ i ], len ) == 0 ) { + tmpvals[ 0 ] = ++s; + tmpvals[ 1 ] = NULL; + vals = tmpvals; + break; + } + } + } + + if ( vals == NULL && ( defval = get_arg_by_name( DSGW_ATTRARG_DEFAULT, + argc, argv )) != NULL ) { + tmpvals[ 0 ] = defval; + tmpvals[ 1 ] = NULL; + vals = tmpvals; + } + + if ( vals == NULL && ( options & DSGW_ATTROPT_EDITABLE ) == 0 ) { + if ( htmltype != DSGW_ATTRHTML_HIDDEN ) { + dsgw_HTML_emits( DSGW_UTF8_NBSP ); + } + } else { + if (( adi.adi_handlerp = syntax2attrhandler( syntax )) == NULL ) { + dsgw_emitf( XP_GetClientStr(DBT_unknownSyntaxSN_), syntax ); + } else { + if ( vals != NULL && vals[1] != NULL + && ( options & DSGW_ATTROPT_SORT ) != 0 ) { + ldap_sort_values( tip->dsti_ld, vals, + dsgw_valcmp (adi.adi_handlerp->ath_compare)); + } + adi.adi_attr = attr; + adi.adi_argc = argc; + adi.adi_argv = argv; + adi.adi_vals = vals; + adi.adi_rdn = NULL; + adi.adi_htmltype = htmltype; + adi.adi_opts = options; + + if (( options & DSGW_ATTROPT_EDITABLE ) == 0 ) { + (*adi.adi_handlerp->ath_display)( &adi ); + } else { + if (( options & DSGW_ATTROPT_ADDING ) == 0 ) { + /* set flag to track attrs. we have seen */ + for ( attrindex = 0; tip->dsti_attrs[ attrindex ] != NULL; + ++attrindex ) { + if ( strcasecmp( attr, tip->dsti_attrs[ attrindex ] ) + == 0 ) { + break; + } + } + if ( tip->dsti_attrs[ attrindex ] != NULL ) { + if ( ! (tip->dsti_attrflags[ attrindex ] & DSGW_DSTI_ATTR_SEEN)) { + tip->dsti_attrflags[ attrindex ] |= DSGW_DSTI_ATTR_SEEN; + dsgw_emitf( "\n", + attr ); + } + adi.adi_rdn = find_RDN( dn, attr, vals ); + } + } + + /* display for editing */ + (*adi.adi_handlerp->ath_edit)( &adi ); + } + } + } + + if ( ldvals != NULL ) { + if (tagged_attrs) { + dsgw_value_free( (void **) ldvals, binary_value ); + } else { + if (binary_value) { + ldap_value_free_len( (struct berval **) ldvals ); + } else { + ldap_value_free( ldvals ); + } + } + } +} + + + +static void +append_to_array( char ***ap, int *countp, char *s ) +{ + char **a; + int count; + + a = *ap; + count = *countp; + + a = (char **)dsgw_ch_realloc( a, ( count + 2 ) * sizeof( char * )); + a[ count++ ] = dsgw_ch_strdup( s ); + a[ count ] = NULL; + + *ap = a; + *countp = count; +} + + +static unsigned long +get_attr_options( int argc, char **argv ) +{ + int i; + unsigned long opts; + char *s; + + opts = 0; + + if (( s = get_arg_by_name( DSGW_ATTRARG_OPTIONS, argc, argv )) != NULL ) { + char *p, *q; + + for ( p = dsgw_ch_strdup( s ); p != NULL; p = q ) { + if (( q = strchr( p, ',' )) != NULL ) { + *q++ = '\0'; + } + for ( i = 0; attroptions[ i ] != NULL; ++i ) { + if ( strcasecmp( p, attroptions[ i ] ) == 0 ) { + opts |= attroptvals[ i ]; + break; + } + } + if ( attroptions[ i ] == NULL ) { + dsgw_emitf( XP_GetClientStr(DBT_unknownOptionS_), p ); + break; + } + } + free( p ); + } + + return( opts ); +} + + +static struct attr_handler * +syntax2attrhandler( char *syntax ) +{ + int i; + + for ( i = 0; i < DSGW_AH_COUNT; ++i ) { + if ( strcasecmp( syntax, attrhandlers[ i ].ath_syntax ) == 0 ) { + return( &attrhandlers[ i ] ); + } + } + + return( NULL ); +} + + +static int +numfields( int argc, char **argv, int valcount ) +{ + char *s; + int fields; + + if (( s = get_arg_by_name( DSGW_ATTRARGS_NUMFIELDS, argc, + argv )) == NULL ) { + fields = 1; + } else { + if ( *s == '+' || *s == ' ') { + /* "numfields=+N" means show N more than number of values */ + fields = valcount + atoi( s + 1 ); + } else { + if ( *s == '>' ) ++s; + /* "numfields=N" or "=>N" means show at least N fields */ + fields = atoi( s ); + } + } + + if ( fields < 1 ) { + fields = 1; + } else if ( fields < valcount ) { + fields = valcount; + } + + return( fields ); +} + +/* + * calculate size of TEXT or TEXTAREA elements based on arguments, + * the number of values, and the length of longest value. + */ +static void +element_sizes( int argc, char **argv, char **vals, int valcount, + int *rowsp, int *colsp ) +{ + int i, len, maxlen; + char *s; + + /* set *colsp (number of columns in each input item) */ + if ( colsp != NULL ) { + /* + * columns are set using the "cols=N" or "size=N" argument + * "cols=>N" can be used to indicate at least N columns should be shown + * "cols=+N" can be used to size to N more than longest value + * in the absence of any of these, we set columns to one more than + * the longest value in the "vals" array + */ + if (( s = get_arg_by_name( DSGW_ATTRARGS_COLS, argc, argv )) == NULL ) { + s = get_arg_by_name( DSGW_ATTRARGS_SIZE, argc, argv ); + } + + if ( s != NULL && *s != '+' && *s != ' ' && *s != '>' ) { + *colsp = atoi( s ); /* extact width specified */ + } else if ( valcount == 0 ) { + if ( s != NULL && *s == '>' ) { + *colsp = atoi( s + 1 ); + } else { + *colsp = 0; /* use default width */ + } + } else { + /* determine ( length of longest value ) + 1 */ + maxlen = 0; + for ( i = 0; i < valcount; ++i ) { + if (( len = strlen( vals[ i ] )) > maxlen ) { + maxlen = len; + } + } + ++maxlen; + + if ( s != NULL ) { + i = atoi( s + 1 ); + if ( *s == ' ' || *s == '+' ) { + maxlen += i; + } else { /* '>' */ + if ( maxlen < i ) { + maxlen = i; + } + } + } + *colsp = maxlen; + } + } + + /* set *rowsp (number of rows in each input item) */ + if ( rowsp != NULL ) { + /* + * rows are set using "rows=M" ("=>M" and "=+M" are supported also) + * in the absense of this, we set it to the number of values in the + * "vals" array + */ + if (( s = get_arg_by_name( DSGW_ATTRARGS_ROWS, argc, argv )) == NULL ) { + *rowsp = valcount; + } else if ( *s == ' ' || *s == '+' ) { + *rowsp = valcount + atoi( s + 1 ); + } else if ( *s == '>' ) { + if (( *rowsp = atoi( s + 1 )) < valcount ) { + *rowsp = valcount; + } + } else { + *rowsp = atoi( s ); + } + } +} + + +static void +output_text_elements( int argc, char **argv, char *attr, char **vals, + const char* rdn, char *prefix, int htmltype, unsigned long opts ) +{ + int i, valcount, fields, cols; + + if ( vals == NULL ) { + valcount = 0; + } else { + for ( valcount = 0; vals[ valcount ] != NULL; ++valcount ) { + /* just count vals */ + } + } + + fields = numfields( argc, argv, valcount ); + element_sizes( argc, argv, vals, valcount, NULL, &cols ); + + for ( i = 0; i < fields; ++i ) { + auto const int is_rdn = (i < valcount && vals[ i ] == rdn); + + dsgw_emitf( " 0 ) { + dsgw_emitf( " SIZE=%d", cols ); + } + + if ( i < valcount ) { + dsgw_emitf( " VALUE=\"%s\"", vals[ i ] ); + } + + if (( opts & DSGW_TEXTOPT_CHANGEHANDLERS ) != 0 ) { + dsgw_emitf( " onChange=\"aChg('%s')\"", is_rdn ? "DN" : attr ); + } + if (( opts & DSGW_TEXTOPT_FOCUSHANDLERS ) != 0 ) { + dsgw_emitf( " onFocus=\"aFoc('%s')\"", is_rdn ? "DN" : attr ); + } + + dsgw_emitf( ">%s\n%s", + is_rdn ? " DN" : "", + ( i < fields - 1 && + htmltype != DSGW_ATTRHTML_HIDDEN ) ? "
\n" : "" ); + } +} + + +static void +output_textarea( int argc, char **argv, char *attr, char **vals, + int valcount, char *prefix, unsigned long opts ) +{ + int i, rows, cols; + + element_sizes( argc, argv, vals, valcount, &rows, &cols ); + + dsgw_emits( " 0 ) { + if ( rows == 1 ) { + rows = 2; /* one line TEXTAREAs are ugly! */ + } + dsgw_emitf( " ROWS=%d", rows ); + } + + if ( cols > 0 ) { + dsgw_emitf( " COLS=%d", cols ); + } + + if (( opts & DSGW_TEXTOPT_CHANGEHANDLERS ) != 0 ) { + dsgw_emitf( " onChange=\"aChg('%s')\"", attr ); + } + if (( opts & DSGW_TEXTOPT_FOCUSHANDLERS ) != 0 ) { + dsgw_emitf( " onFocus=\"aFoc('%s')\"", attr ); + } + + dsgw_emits( ">\n" ); + + for ( i = 0; i < valcount; ++i ) { + dsgw_emits( vals[ i ] ); + dsgw_emits( "\n" ); + } + + dsgw_emits( "\n" ); +} + + +static void +output_text_checkbox_or_radio( struct dsgw_attrdispinfo *adip, char *prefix, + int htmltype ) +{ + int i, checked; + char *value; + + /* + * for checkboxes or radio buttons that are associated with string values, + * we "check the box" if the value found in the "value=XXX" parameter is + * present. + */ + checked = 0; + if (( value = get_arg_by_name( DSGW_ATTRARGS_VALUE, adip->adi_argc, + adip->adi_argv )) == NULL ) { + value = "TRUE"; /* assume LDAP Boolean value */ + } + if ( adip->adi_vals == NULL ) { + if ( *value == '\0' ) { + /* + * There are no existing values in the entry and this checkbox or + * radio button has a zero-length value associated with it. We + * check this box/enable this radio button as a special case to + * support an "off" or "none of the rest" scenario. + */ + checked = 1; + } + + } else { + for ( i = 0; adip->adi_vals[ i ] != NULL; ++i ) { + if ( dsgw_valcmp(adip->adi_handlerp->ath_compare)( (const char **)&value, + (const char **)&(adip->adi_vals[ i ]) ) == 0 ) { + checked = 1; + break; + } + } + } + dsgw_emitf( "\n", + ( htmltype == DSGW_ATTRHTML_RADIO ) ? "radio" : "checkbox", + prefix, adip->adi_attr, value, checked ? " CHECKED" : "", + adip->adi_attr ); +} + + +static void +emit_value( char *val, int quote_html_specials ) +{ + int freeit; + + if ( quote_html_specials ) { + val = dsgw_strdup_with_entities( val, &freeit ); + } else { + freeit = 0; + } + + dsgw_emits( val ); + + if ( freeit ) { + free( val ); + } +} + + +/* + * Default display handler for binary values + */ +static void +binvalue_display( struct dsgw_attrdispinfo *adip ) +{ + int i; + struct berval **list_of_binvals; + char *checked = " CHECKED"; + char *selected = " SELECTED"; + int iValue; + + list_of_binvals = (struct berval **)adip->adi_vals; + + for ( i = 0; list_of_binvals[ i ] != NULL; ++i ) + { + char szFlags[512], szFormat[512]; + struct berval bin_data = *list_of_binvals[i]; + + if( !bin_data.bv_val || !bin_data.bv_len ) + continue; + + /* Now interpret the binary value if it has NT semantics */ + if( !strcasecmp( adip->adi_attr, "ntuserpriv") ) + { + + memcpy( &iValue, bin_data.bv_val, sizeof( iValue ) ); + fprintf( stdout, "%s
\n", adip->adi_attr, + (iValue == USER_PRIV_GUEST) ? checked : "", DSGW_NT_UP_GUEST); + fprintf( stdout, "%s
\n", adip->adi_attr, + (iValue == USER_PRIV_USER) ? checked : "", DSGW_NT_UP_USER); + fprintf( stdout, "%s
\n", adip->adi_attr, + (iValue == USER_PRIV_ADMIN) ? checked : "", DSGW_NT_UP_ADMIN); + } + else if ( strcasecmp( adip->adi_attr, "ntuserflags" ) == 0 ) + { + memcpy( &iValue, bin_data.bv_val, sizeof( iValue ) ); + fprintf( stdout, "\n" ); + } + else if ( strcasecmp( adip->adi_attr, "ntuserauthflags" ) == 0 ) + { + memcpy( &iValue, bin_data.bv_val, sizeof( iValue ) ); + fprintf( stdout, "\n" ); + } + else if ( bin_data.bv_val && ( bin_data.bv_len != 0 )) + { + if( bin_data.bv_len == 4 ) + { + memcpy( &iValue, bin_data.bv_val, sizeof( iValue ) ); + + if(( adip->adi_opts & DSGW_ATTROPT_DECIMAL ) != 0 ) + PR_snprintf( szFormat, sizeof(szFormat), "%%lu" ); + else + PR_snprintf( szFormat, sizeof(szFormat), "%%#0%lu.%lux", bin_data.bv_len*2, bin_data.bv_len*2 ); + PR_snprintf( szFlags, sizeof(szFlags), szFormat, iValue ); + + fputs( szFlags, stdout ); + + if ( list_of_binvals[ i + 1 ] != NULL ) + { + fputs( "
\n", stdout ); + } + } + } + } +} + +#if NEEDED_FOR_DEBUGGING +/* + * display handler for NT Domain Identifier string + */ +static void +ntdomain_display( struct dsgw_attrdispinfo *adip ) +{ + int i; + + /* Write values with a break (
) separating them, + removing all after ":" */ + for ( i = 0; adip->adi_vals[ i ] != NULL; ++i ) { + if ( !did_output_as_special( adip->adi_argc, adip->adi_argv, + adip->adi_vals[ i ], adip->adi_vals[ i ] )) { + char *pch = strchr( adip->adi_vals[ i ], DSGW_NTDOMAINID_SEP ); + if( pch ) + *pch = (char )NULL; + if ((adip->adi_opts & DSGW_ATTROPT_QUOTED ) != 0 ) { + dsgw_emits( "\"" ); + } + + fputs( adip->adi_vals[ i ], stdout ); + if ((adip->adi_opts & DSGW_ATTROPT_QUOTED ) != 0 ) { + dsgw_emits( "\"" ); + } + } + + if ( adip->adi_vals[ i + 1 ] != NULL ) { + fputs( "
\n", stdout ); + } + } + +} +#endif + + +/* + * display handler for simple strings + */ +static void +str_display( struct dsgw_attrdispinfo *adip ) +{ + int i; + + if ( adip->adi_htmltype == DSGW_ATTRHTML_CHECKBOX || + adip->adi_htmltype == DSGW_ATTRHTML_RADIO ) { + output_text_checkbox_or_radio( adip, "", adip->adi_htmltype ); + return; + } + + /* just write values with a break (
) separating them */ + for ( i = 0; adip->adi_vals[ i ] != NULL; ++i ) { + + if ( !did_output_as_special( adip->adi_argc, adip->adi_argv, + adip->adi_vals[ i ], adip->adi_vals[ i ] ) && + adip->adi_htmltype != DSGW_ATTRHTML_HIDDEN ) { + if ((adip->adi_opts & DSGW_ATTROPT_QUOTED ) != 0 ) { + dsgw_emits( "\"" ); + } + emit_value( adip->adi_vals[ i ], + (( adip->adi_opts & DSGW_ATTROPT_NO_ENTITIES ) == 0 )); + if ((adip->adi_opts & DSGW_ATTROPT_QUOTED ) != 0 ) { + dsgw_emits( "\"" ); + } + } + + if ( adip->adi_htmltype != DSGW_ATTRHTML_HIDDEN && + adip->adi_vals[ i + 1 ] != NULL ) { + dsgw_emits( "
\n" ); + } + } + +} + + +static void +ntuserid_display( struct dsgw_attrdispinfo *adip ) +{ + int i; + + for ( i = 0; adip->adi_vals[ i ] != NULL; ++i ) { + if ( !did_output_as_special( adip->adi_argc, adip->adi_argv, + adip->adi_vals[ i ], adip->adi_vals[ i ] )) { + char *pch = adip->adi_vals[ i ]; + if( pch ) { + + if ((adip->adi_opts & DSGW_ATTROPT_QUOTED ) != 0 ) { + dsgw_emits( "\"" ); + } + + fputs( pch, stdout ); + if ((adip->adi_opts & DSGW_ATTROPT_QUOTED ) != 0 ) { + dsgw_emits( "\"" ); + } + } + } + + if ( adip->adi_vals[ i + 1 ] != NULL ) { + fputs( "
\n", stdout ); + } + } + +} + + + +/* + * edit handler for simple strings + */ +static void +str_edit( struct dsgw_attrdispinfo *adip ) +{ + int valcount, adding, pre_idx; + char *prefix; + unsigned long textopts; + + adding = (( adip->adi_opts & DSGW_ATTROPT_ADDING ) != 0 ); + if (( adip->adi_opts & DSGW_ATTROPT_UNIQUE ) == 0 ) { + pre_idx = DSGW_MOD_PREFIX_NORMAL; + } else { + pre_idx = DSGW_MOD_PREFIX_UNIQUE; + } + prefix = adding ? add_prefixes[ pre_idx ] : replace_prefixes[ pre_idx ]; + + textopts = DSGW_TEXTOPT_CHANGEHANDLERS; + if ( !adding ) { + textopts |= DSGW_TEXTOPT_FOCUSHANDLERS; + } + + switch( adip->adi_htmltype ) { + case DSGW_ATTRHTML_TEXTAREA: + if ( adip->adi_vals == NULL ) { + valcount = 0; + } else { + for ( valcount = 0; adip->adi_vals[ valcount ] != NULL; + ++valcount ) { + ; + } + } + output_textarea( adip->adi_argc, adip->adi_argv, adip->adi_attr, + adip->adi_vals, valcount, prefix, textopts ); + break; + + case DSGW_ATTRHTML_TEXT: + case DSGW_ATTRHTML_HIDDEN: + output_text_elements( adip->adi_argc, adip->adi_argv, adip->adi_attr, + adip->adi_vals, adip->adi_rdn, prefix, adip->adi_htmltype, textopts ); + break; + + case DSGW_ATTRHTML_CHECKBOX: + case DSGW_ATTRHTML_RADIO: + output_text_checkbox_or_radio( adip, prefix, adip->adi_htmltype ); + break; + + default: + dsgw_emitf( XP_GetClientStr(DBT_HtmlTypeSNotSupportedBrN_), + attrhtmltypes[ adip->adi_htmltype ] ); + } +} + + +/* + * display handler for multi-line strings, e.g. postalAddress + * these are funny in that over LDAP, lines are separated by " $ " + * this only support "htmltype=text" + */ +static void +mls_display( struct dsgw_attrdispinfo *adip ) +{ + int i; + + for ( i = 0; adip->adi_vals[ i ] != NULL; ++i ) { + if ( !did_output_as_special( adip->adi_argc, adip->adi_argv, + adip->adi_vals[ i ], adip->adi_vals[ i ] )) { + (void)dsgw_mls_convertlines( adip->adi_vals[ i ], "
\n", NULL, + 1, ( adip->adi_opts & DSGW_ATTROPT_NO_ENTITIES ) == 0 ); + } + + if ( adip->adi_vals[ i + 1 ] != NULL ) { + dsgw_emits( "

\n" ); + } + } +} + + +/* + * edit handler for multi-line strings + */ +static void +mls_edit( struct dsgw_attrdispinfo *adip ) +{ + char *prefix, **valscopy, *tval[ 2 ]; + int i, valcount, adding, pre_idx, *lines; + unsigned long textopts; + + adding = (( adip->adi_opts & DSGW_ATTROPT_ADDING ) != 0 ); + textopts = DSGW_TEXTOPT_CHANGEHANDLERS; + if ( !adding ) { + textopts |= DSGW_TEXTOPT_FOCUSHANDLERS; + } + + if (( adip->adi_opts & DSGW_ATTROPT_UNIQUE ) == 0 ) { + pre_idx = DSGW_MOD_PREFIX_NORMAL; + } else { + pre_idx = DSGW_MOD_PREFIX_UNIQUE; + } + prefix = adding ? add_mls_prefixes[ pre_idx ] : + replace_mls_prefixes[ pre_idx ]; + + if ( adip->adi_vals == NULL ) { + valscopy = NULL; + } else { + for ( valcount = 0; adip->adi_vals[ valcount ] != NULL; ++valcount ) { + ; + } + valscopy = (char **)dsgw_ch_malloc( (valcount + 1) * sizeof( char * )); + lines = (int *)dsgw_ch_malloc( valcount * sizeof( int )); + for ( i = 0; i < valcount; ++i ) { + valscopy[ i ] = dsgw_mls_convertlines( adip->adi_vals[ i ], "\n", + &lines[ i ], 0, 0 ); + } + valscopy[ valcount ] = NULL; + } + + if ( adip->adi_htmltype == DSGW_ATTRHTML_TEXTAREA ) { + if ( adip->adi_vals == NULL ) { + output_textarea( adip->adi_argc, adip->adi_argv, adip->adi_attr, + NULL, 0, prefix, textopts ); + } else { + tval[ 1 ] = NULL; + for ( i = 0; i < valcount; ++i ) { + tval[ 0 ] = valscopy[ i ]; + output_textarea( adip->adi_argc, adip->adi_argv, + adip->adi_attr, tval, 1, prefix, textopts ); + if ( i < valcount - 1 ) { + dsgw_emits( "
\n" ); + } + } + } + } else { + output_text_elements( adip->adi_argc, adip->adi_argv, adip->adi_attr, + valscopy, NULL, prefix, adip->adi_htmltype, textopts ); + /* Bug: what if adip->adi_rdn != NULL? In this case, + the element of valscopy that is a copy of adi_rdn + should be passed to output_text_elements (as the rdn). + */ + } + + if ( valscopy != NULL ) { + ldap_value_free( valscopy ); + free( lines ); + } +} + + +/* + * convert all occurrences of "$" in val to sep + * un-escape any \HH sequences + * if linesp != NULL, set *linesp equal to number of lines in val + * if emitlines is zero, a malloc'd string is returned. + * if emitlines is non-zero, values are written to stdout (respecting the + * quote_html_specials flag) and NULL is returned. + */ +char * +dsgw_mls_convertlines( char *val, char *sep, int *linesp, int emitlines, + int quote_html_specials ) +{ + char *valcopy, *p, *q, *curline; + int i, c, lines, seplen; + + if ( sep == NULL ) { + sep = ""; + seplen = 0; + } else { + seplen = strlen( sep ); + } + + lines = 0; + for ( q = val; *q != '\0'; ++q ) { + if ( *q == '$' ) { + ++lines; + } + } + + if ( linesp != NULL ) { + *linesp = lines; + } + + valcopy = dsgw_ch_malloc( strlen( val ) + lines * seplen + 1 ); + + /* + * p points to the place we are copying to + * q points to the place within the original value that we are examining + * curline points to the start of the current line + */ + p = curline = valcopy; + for ( q = val; *q != '\0'; ++q ) { + if ( *q == '$' ) { /* line separator */ + if ( emitlines ) { + *p = '\0'; + emit_value( curline, quote_html_specials ); + emit_value( sep, 0 ); + } + strcpy( p, sep ); + p += seplen; + curline = p; + } else if ( *q == '\\' ) { /* undo hex escapes */ + if ( *++q == '\0' ) { + break; + } + c = toupper( *q ); + i = ( c >= 'A' ? ( c - 'A' + 10 ) : c - '0' ); + i <<= 4; + if ( *++q == '\0' ) { + break; + } + c = toupper( *q ); + i += ( c >= 'A' ? ( c - 'A' + 10 ) : c - '0' ); + *p++ = i; + } else { + *p++ = *q; + } + } + + *p = '\0'; + + if ( emitlines ) { + if ( p > curline ) { + emit_value( curline, quote_html_specials ); + } + free( valcopy ); + valcopy = NULL; + } + + return( valcopy ); +} + + +static void +dn_edit( struct dsgw_attrdispinfo *adip ) +{ + if (( adip->adi_opts & DSGW_ATTROPT_DNPICKER ) != 0 ) { + dn_display( adip ); + } else { + str_edit( adip ); + } + return; +} + + +static void +dn_display( struct dsgw_attrdispinfo *adip ) +{ + int i, j, len, dncomps; + char *p, *staticlabel, *tmps = NULL, *label, *urlprefix, **rdns = NULL; + + staticlabel = get_arg_by_name( DSGW_ATTRARG_LABEL, adip->adi_argc, + adip->adi_argv ); + + if (( p = get_arg_by_name( DSGW_ATTRARG_DNCOMP, adip->adi_argc, + adip->adi_argv )) == NULL ) { + dncomps = 1; + } else { + dncomps = atoi( p ); /* 0 or "all" means show all components */ + } + + if (( adip->adi_opts & DSGW_ATTROPT_LINK2EDIT ) != 0 ) { + auto const char* vp = dsgw_getvp( DSGW_CGINUM_EDIT ); + /* urlprefix = vp + "?&context=CONTEXT&dn=": */ + auto const size_t vplen = strlen (vp); + urlprefix = dsgw_ch_malloc (vplen + 6 + strlen(context) + 9); + memcpy( urlprefix, vp, vplen ); + strcat( urlprefix, "?&context="); + strcat( urlprefix, context); + strcat( urlprefix, "&dn="); + } else { + urlprefix = dsgw_build_urlprefix(); + } +#ifdef DSGW_DEBUG + dsgw_log( "dn_display: urlprefix is %s\n", urlprefix ); +#endif + + for ( i = 0; adip->adi_vals != NULL && adip->adi_vals[ i ] != NULL; ++i ) { + if ( staticlabel != NULL ) { + label = staticlabel; + } else if ( !looks_like_dn( adip->adi_vals[ i ]) || + ( rdns = ldap_explode_dn( adip->adi_vals[ i ], + ( adip->adi_opts & DSGW_ATTROPT_DNTAGS ) == 0 )) == NULL ) { + /* explode DN failed -- show entire DN */ + label = adip->adi_vals[ i ]; + tmps = NULL; + } else { + len = 1; /* room for zero-termination */ + for ( j = 0; rdns[ j ] != NULL && ( dncomps == 0 || j < dncomps ); + ++ j ) { + len += ( 2 + strlen( rdns[ j ] )); /* rdn + ", " */ + } + label = p = tmps = dsgw_ch_malloc( len ); + for ( j = 0; rdns[ j ] != NULL && ( dncomps == 0 || j < dncomps ); + ++ j ) { + if ( j > 0 ) { + strcpy( p, ", " ); + p += 2; + } + strcpy( p, rdns[ j ] ); + p += strlen( p ); + } + } + + if ( !did_output_as_special( adip->adi_argc, adip->adi_argv, label, + adip->adi_vals[ i ] )) { + if (( adip->adi_opts & DSGW_ATTROPT_NOLINK ) == 0 && + looks_like_dn( adip->adi_vals[ i ] )) { + if (( adip->adi_opts & DSGW_ATTROPT_DNPICKER ) != 0 ) { + dsgw_emits( "" ); + } + /* Don't display a link for the rootdn */ + if ( gc->gc_rootdn && dsgw_dn_cmp(adip->adi_vals[i], gc->gc_rootdn)) { + if ((adip->adi_opts & DSGW_ATTROPT_QUOTED ) != 0 ) { + dsgw_emits( "\"" ); + } + dsgw_emits( label ); + if ((adip->adi_opts & DSGW_ATTROPT_QUOTED ) != 0 ) { + dsgw_emits( "\"" ); + } + } else { + dsgw_html_href( urlprefix, adip->adi_vals[ i ], label, + adip->adi_vals[ i ], + get_arg_by_name( DSGW_ATTRARG_HREFEXTRA, + adip->adi_argc, adip->adi_argv )); + } + if (( adip->adi_opts & DSGW_ATTROPT_DNPICKER ) != 0 ) { + dsgw_emits( "\nadi_vals[ i ], adip->adi_attr ); + dsgw_emitf( "onClick=\"aChg('%s');\"\n\n", + adip->adi_attr ); + } + } else { + if ((adip->adi_opts & DSGW_ATTROPT_QUOTED ) != 0 ) { + dsgw_emits( "\"" ); + } + + emit_value( label, + (( adip->adi_opts & DSGW_ATTROPT_NO_ENTITIES ) == 0 )); + if ((adip->adi_opts & DSGW_ATTROPT_QUOTED ) != 0 ) { + dsgw_emits( "\"" ); + } + } + } + + if ( !( adip->adi_opts & DSGW_ATTROPT_DNPICKER ) && + adip->adi_vals[ i + 1 ] != NULL ) { + dsgw_emits( "
\n" ); + } + + if ( tmps != NULL ) { + free( tmps ); + } + + if ( rdns != NULL ) { + ldap_value_free( rdns ); + } + } + + + /* Output a javascript array of values for this attribute */ + if (( adip->adi_opts & DSGW_ATTROPT_DNPICKER ) != 0 ) { + dsgw_emits( "\n" ); + } + + free( urlprefix ); +} + + +static void +mail_display( struct dsgw_attrdispinfo *adip ) +{ + int i; + + for ( i = 0; adip->adi_vals[ i ] != NULL; ++i ) { + if ( !did_output_as_special( adip->adi_argc, adip->adi_argv, + adip->adi_vals[ i ], adip->adi_vals[ i ] )) { + if (( adip->adi_opts & DSGW_ATTROPT_NOLINK ) == 0 ) { + dsgw_html_href( "mailto:", adip->adi_vals[ i ], adip->adi_vals[ i ], NULL, + get_arg_by_name( DSGW_ATTRARG_HREFEXTRA, + adip->adi_argc, adip->adi_argv )); + } else { + if ((adip->adi_opts & DSGW_ATTROPT_QUOTED ) != 0 ) { + dsgw_emits( "\"" ); + } + + emit_value( adip->adi_vals[ i ], + (( adip->adi_opts & DSGW_ATTROPT_NO_ENTITIES ) == 0 )); + if ((adip->adi_opts & DSGW_ATTROPT_QUOTED ) != 0 ) { + dsgw_emits( "\"" ); + } + + } + } + + if ( adip->adi_vals[ i + 1 ] != NULL ) { + dsgw_emits( "
\n" ); + } + } + +} + + +static void +url_display( struct dsgw_attrdispinfo *adip ) +{ + int i; + char *savep, *label; + + for ( i = 0; adip->adi_vals[ i ] != NULL; ++i ) { + if (( label = strchr( adip->adi_vals[ i ], ' ' )) == NULL ) { + label = adip->adi_vals[ i ]; + savep = NULL; + } else { + savep = label; + *label++ = '\0'; + } + + if ( !did_output_as_special( adip->adi_argc, adip->adi_argv, label, + adip->adi_vals[ i ] )) { + if (( adip->adi_opts & DSGW_ATTROPT_NOLINK ) == 0 ) { + dsgw_html_href( NULL, adip->adi_vals[ i ], label, NULL, + get_arg_by_name( DSGW_ATTRARG_HREFEXTRA, + adip->adi_argc, adip->adi_argv )); + } else { + if ((adip->adi_opts & DSGW_ATTROPT_QUOTED ) != 0 ) { + dsgw_emits( "\"" ); + } + + emit_value( adip->adi_vals[ i ], + (( adip->adi_opts & DSGW_ATTROPT_NO_ENTITIES ) == 0 )); + if ((adip->adi_opts & DSGW_ATTROPT_QUOTED ) != 0 ) { + dsgw_emits( "\"" ); + } + + } + } + + if ( savep != NULL ) { + *savep = ' '; + } + + if ( adip->adi_vals[ i + 1 ] != NULL ) { + dsgw_emits( "
\n" ); + } + } + +} + + +static void +bool_display( struct dsgw_attrdispinfo *adip ) +{ + int boolval, free_onclick, pre_idx; + char *usestr, *truestr, *falsestr, *checked; + char *nameprefix, *onclick; + + if ( adip->adi_vals == NULL || adip->adi_vals[ 0 ] == NULL ) { + return; + } + + checked = " CHECKED"; + + if (( adip->adi_opts & DSGW_ATTROPT_EDITABLE ) == 0 ) { + nameprefix = onclick = ""; + free_onclick = 0; + } else { + char *onclickfmt = " onClick=\"aChg('%s')\""; + + if (( adip->adi_opts & DSGW_ATTROPT_UNIQUE ) == 0 ) { + pre_idx = DSGW_MOD_PREFIX_NORMAL; + } else { + pre_idx = DSGW_MOD_PREFIX_UNIQUE; + } + nameprefix = (( adip->adi_opts & DSGW_ATTROPT_ADDING ) == 0 ) ? + replace_prefixes[ pre_idx ] : add_prefixes[ pre_idx ]; + onclick = dsgw_ch_malloc( strlen( onclickfmt ) + + strlen( adip->adi_attr ) + 1 ); + sprintf( onclick, onclickfmt, adip->adi_attr ); + free_onclick = 1; + } + + if (( truestr = get_arg_by_name( DSGW_ATTRARG_TRUESTR, adip->adi_argc, + adip->adi_argv )) == NULL ) { + truestr = DSGW_ATTRARG_TRUESTR; + } + if (( falsestr = get_arg_by_name( DSGW_ATTRARG_FALSESTR, adip->adi_argc, + adip->adi_argv )) == NULL ) { + falsestr = DSGW_ATTRARG_FALSESTR; + } + + boolval = ( toupper( adip->adi_vals[ 0 ][ 0 ] ) == 'T' ); + + if ( adip->adi_htmltype == DSGW_ATTRHTML_RADIO ) { + dsgw_emitf( "%s
\n", nameprefix, adip->adi_attr, + boolval ? checked : "", onclick, truestr ); + dsgw_emitf( "%s
\n", nameprefix, adip->adi_attr, + boolval ? "" : checked, onclick, falsestr ); + } else if ( adip->adi_htmltype == DSGW_ATTRHTML_CHECKBOX ) { + dsgw_emitf( "%s\n", nameprefix, adip->adi_attr, + boolval ? checked : "", onclick, truestr ); + } else { + usestr = boolval ? truestr : falsestr; + if ( !did_output_as_special( adip->adi_argc, adip->adi_argv, usestr, + adip->adi_vals[ 0 ] )) { + if ((adip->adi_opts & DSGW_ATTROPT_QUOTED ) != 0 ) { + dsgw_emits( "\"" ); + } + + dsgw_emits( boolval ? truestr : falsestr ); + if ((adip->adi_opts & DSGW_ATTROPT_QUOTED ) != 0 ) { + dsgw_emits( "\"" ); + } + } + } +} + + +static void +bool_edit( struct dsgw_attrdispinfo *adip ) +{ + if ( adip->adi_htmltype == DSGW_ATTRHTML_RADIO || + adip->adi_htmltype == DSGW_ATTRHTML_CHECKBOX ) { + bool_display( adip ); + } else { + str_edit( adip ); + } +} + + +static void +time_display( struct dsgw_attrdispinfo *adip ) +{ + int i; + + for ( i = 0; adip->adi_vals[ i ] != NULL; ++i ) { + if ( !did_output_as_special( adip->adi_argc, adip->adi_argv, + adip->adi_vals[ i ], adip->adi_vals[ i ] )) { + if ((adip->adi_opts & DSGW_ATTROPT_QUOTED ) != 0 ) { + dsgw_emits( "\"" ); + } + dsgw_emits( time2text( adip->adi_vals[ i ], + ( adip->adi_opts & DSGW_ATTROPT_DATEONLY ) != 0 ) ); + if ((adip->adi_opts & DSGW_ATTROPT_QUOTED ) != 0 ) { + dsgw_emits( "\"" ); + } + } + + if ( adip->adi_vals[ i + 1 ] != NULL ) { + dsgw_emits( "
\n" ); + } + } + +} + + +/* + * handle special "within=", "href=", and "script=" options + * return 0 if nothing was output or 1 if something was. + */ +static int +did_output_as_special( int argc, char **argv, char *label, char *val ) +{ + char *href = NULL; + char *within = NULL; + char *script = NULL; + char *newval = NULL; + + if (( href = get_arg_by_name( DSGW_ATTRARG_HREF, argc, argv )) == NULL && + ( within = get_arg_by_name( DSGW_ATTRARG_WITHIN, argc, + argv )) == NULL && + ( script = get_arg_by_name( DSGW_ATTRARG_SCRIPT, argc, + argv )) == NULL ) { + return( 0 ); + } + + if ( within != NULL ) { + dsgw_substitute_and_output( within, "--value--", val, 1 ); + } else if (href != NULL) { + dsgw_html_href( NULL, href, label, val, + get_arg_by_name( DSGW_ATTRARG_HREFEXTRA, argc, argv )); + } else if (script != NULL) { + newval = dsgw_strdup_escaped ( val ); + if (newval != NULL && *newval != '\0') { + fputs( newval, stdout ); + free( newval ); + } + } + + return( 1 ); +} + + +/* + * The GET2BYTENUM() macro, time2text(), and gtime() functions are taken + * with slight changes (to handle 4-digit years) from libldap/tmplout.c + */ +#define GET2BYTENUM( p ) (( *p - '0' ) * 10 + ( *(p+1) - '0' )) +#define BSIZ 1024 + +static char * +time2text( char *ldtimestr, int dateonly ) +{ + int len; + struct tm t; + char *p, zone; + time_t gmttime; + char *timestr = NULL; + + memset( (char *)&t, 0, sizeof( struct tm )); + if (( len = strlen( ldtimestr )) < 13 ) { + return( ldtimestr ); + } + if ( len > 15 ) { /* throw away excess from 4-digit year time string */ + len = 15; + } else if ( len == 14 ) { + len = 13; /* assume we have a time w/2-digit year (len=13) */ + } + + for ( p = ldtimestr; p - ldtimestr + 1 < len; ++p ) { + if ( !ldap_utf8isdigit( p )) { + return( ldtimestr ); + } + } + + p = ldtimestr; + t.tm_year = GET2BYTENUM( p ); p += 2; + if ( len == 15 ) { + t.tm_year = 100 * (t.tm_year - 19); + t.tm_year += GET2BYTENUM( p ); p += 2; + } + else { + /* 2 digit years...assumed to be in the range (19)70 through + (20)69 ...less than 70 (for now, 38) means 20xx */ + if(t.tm_year < 70) { + t.tm_year += 100; + } + } + + t.tm_mon = GET2BYTENUM( p ) - 1; p += 2; + t.tm_mday = GET2BYTENUM( p ); p += 2; + t.tm_hour = GET2BYTENUM( p ); p += 2; + t.tm_min = GET2BYTENUM( p ); p += 2; + t.tm_sec = GET2BYTENUM( p ); p += 2; + + if (( zone = *p ) == 'Z' ) { /* GMT */ + zone = '\0'; /* no need to indicate on screen, so we make it null */ + } + + gmttime = gtime( &t ); + + /* Try to get the localized string */ + timestr = dsgw_time(gmttime); + + /* Localized time string getter failed, try ctime()*/ + if (timestr == NULL){ + timestr = ctime( &gmttime ); + + /* replace trailing newline */ + timestr[ strlen( timestr ) - 1 ] = zone; + if ( dateonly ) { + strcpy( timestr + 11, timestr + 20 ); + } + } + + return(timestr); +} + + + + + +/* gtime.c - inverse gmtime */ + +#if !defined( MACOS ) && !defined( _WINDOWS ) && !defined( DOS ) +#include +#endif /* !MACOS */ + +/* gtime(): the inverse of localtime(). + This routine was supplied by Mike Accetta at CMU many years ago. + */ + +static int dmsize[] = { + 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 +}; + +#define dysize(y) \ + (((y) % 4) ? 365 : (((y) % 100) ? 366 : (((y) % 400) ? 365 : 366))) + +/* +#define YEAR(y) ((y) >= 100 ? (y) : (y) + 1900) +*/ +#define YEAR(y) (((y) < 1900) ? ((y) + 1900) : (y)) + + +/* */ + +static long gtime ( struct tm *tm ) +{ + register int i, + sec, + mins, + hour, + mday, + mon, + year; + register long result; + + if ((sec = tm -> tm_sec) < 0 || sec > 59 + || (mins = tm -> tm_min) < 0 || mins > 59 + || (hour = tm -> tm_hour) < 0 || hour > 24 + || (mday = tm -> tm_mday) < 1 || mday > 31 + || (mon = tm -> tm_mon + 1) < 1 || mon > 12) + return ((long) -1); + if (hour == 24) { + hour = 0; + mday++; + } + year = YEAR (tm -> tm_year); + + result = 0L; + for (i = 1970; i < year; i++) + result += dysize (i); + if (dysize (year) == 366 && mon >= 3) + result++; + while (--mon) + result += dmsize[mon - 1]; + result += mday - 1; + result = 24 * result + hour; + result = 60 * result + mins; + result = 60 * result + sec; + + return result; +} + + +static int +looks_like_dn( char *s ) +{ + return( strchr( s, '=' ) != NULL ); +} + + +static void +do_searchdesc( dsgwtmplinfo *tip, int argc, char** argv) +{ + auto unsigned fmt = 0; + auto unsigned opt = 0; + { + auto int i; + for (i = 0; i < argc; ++i) { + if (!strcasecmp (argv[i], "VERBOSE")) { + opt |= 1; + } + } + } + switch ( tip->dsti_entrycount ) { + case 0: + fmt = opt & 1 + ? ((tip->dsti_options & DSGW_DISPLAY_OPT_CUSTOM_SEARCHDESC) + ? DBT_SearchFound0Entries_ + : DBT_SearchFound0EntriesWhere_) + : ((tip->dsti_options & DSGW_DISPLAY_OPT_CUSTOM_SEARCHDESC) + ? DBT_Found0Entries_ + : DBT_Found0EntriesWhere_); + case 1: + fmt = opt & 1 + ? ((tip->dsti_options & DSGW_DISPLAY_OPT_CUSTOM_SEARCHDESC) + ? DBT_SearchFound1Entry_ + : DBT_SearchFound1EntryWhere_) + : ((tip->dsti_options & DSGW_DISPLAY_OPT_CUSTOM_SEARCHDESC) + ? DBT_Found1Entry_ + : DBT_Found1EntryWhere_); + default: + fmt = opt & 1 + ? ((tip->dsti_options & DSGW_DISPLAY_OPT_CUSTOM_SEARCHDESC) + ? DBT_SearchFoundEntries_ + : DBT_SearchFoundEntriesWhere_) + : ((tip->dsti_options & DSGW_DISPLAY_OPT_CUSTOM_SEARCHDESC) + ? DBT_FoundEntries_ + : DBT_FoundEntriesWhere_); + } + { + auto char* format = XP_GetClientStr (fmt); + if (format == NULL || *format == '\0') { + format = "Found %1$li entries where the %2$s %3$s '%4$s'.\n"; + } + dsgw_emitf (format, (long)tip->dsti_entrycount, /* %1$li */ + tip->dsti_search2s ? tip->dsti_search2s : "", /* %2$s */ + tip->dsti_search3s ? tip->dsti_search3s : "", /* %3$s */ + tip->dsti_search4s ? tip->dsti_search4s : "");/* %4$s */ + } + if ( tip->dsti_searcherror != NULL && *tip->dsti_searcherror != '\0' ) { + dsgw_emitf( "
%s\n", tip->dsti_searcherror ); + } + if ( tip->dsti_searchlderrtxt != NULL && + *tip->dsti_searchlderrtxt != '\0' ) { + dsgw_emitf( "
(%s)\n", tip->dsti_searchlderrtxt ); + } +} + + +static void +do_editbutton( char *dn, char *encodeddn, int argc, char **argv ) +{ + char *buttonlabel, **rdns; + + if (( buttonlabel = get_arg_by_name( DSGW_ARG_BUTTON_LABEL, argc, + argv )) == NULL ) { + buttonlabel = XP_GetClientStr(DBT_edit_); + } + + if (( rdns = ldap_explode_dn( dn, 1 )) != NULL ) { + dsgw_emitf( + "\n", + rdns[ 0 ] ); + ldap_value_free( rdns ); + } + + dsgw_emitf( "\n" + "\n", buttonlabel, encodeddn ); +} + + +static void +do_savebutton( unsigned long dispopts, int argc, char **argv ) +{ + char *buttonlabel, *checksubmit; + + if (( buttonlabel = get_arg_by_name( DSGW_ARG_BUTTON_LABEL, argc, + argv )) == NULL ) { + buttonlabel = XP_GetClientStr(DBT_saveChanges_); + } + + dsgw_emitf( "\n", + ( dispopts & DSGW_DISPLAY_OPT_ADDING ) == 0 + ? "modify" : "add" ); +} + + +static void +do_deletebutton( int argc, char **argv ) +{ + char *buttonlabel, *prompt; + + if (( buttonlabel = get_arg_by_name( DSGW_ARG_BUTTON_LABEL, argc, + argv )) == NULL ) { + buttonlabel = XP_GetClientStr(DBT_delete_); + } + + if (( prompt = get_arg_by_name( DSGW_ARG_BUTTON_PROMPT, argc, + argv )) == NULL ) { + prompt = XP_GetClientStr(DBT_deleteThisEntry_); + } + + dsgw_emitf("\n"); +} + + +static void +do_editasbutton( int argc, char **argv ) +{ + char *template, *buttonlabel; + + if (( template = get_arg_by_name( DSGW_ARG_BUTTON_TEMPLATE, argc, + argv )) == NULL ) { + template = ""; + } + + if (( buttonlabel = get_arg_by_name( DSGW_ARG_BUTTON_LABEL, argc, + argv )) == NULL ) { + buttonlabel = XP_GetClientStr(DBT_editAs_); + } + + dsgw_emitf( "\n", buttonlabel, template ); +} + + +static void +do_passwordfield( unsigned long dispopts, int argc, char **argv, + char *fieldname ) +{ + output_text_elements( argc, argv, fieldname, NULL, NULL, "", + DSGW_ATTRHTML_PASSWORD, dispopts ); +} + + +static void +do_helpbutton( unsigned long dispopts, int argc, char **argv ) +{ + char *topic; + + if (( topic = get_arg_by_name( DSGW_ARG_BUTTON_TOPIC, argc, + argv )) == NULL ) { + topic = ""; + } + + dsgw_emit_helpbutton( topic ); +} + + +static void +do_closebutton( unsigned long dispopts, int argc, char **argv ) +{ + dsgw_emit_button( argc, argv, "onClick=\"%s\"", + ( dispopts & DSGW_DISPLAY_OPT_EDITABLE ) == 0 + ? "top.close()" : "closeIfOK()" ); +} + + +static void +do_dneditbutton( unsigned long dispopts, int argc, char **argv ) +{ + char *label, *template, *attr, *desc; + + if (( label = get_arg_by_name( DSGW_ARG_DNEDIT_LABEL, argc, + argv )) == NULL ) { + label = XP_GetClientStr(DBT_edit_1); + } + if (( template = get_arg_by_name( DSGW_ARG_DNEDIT_TEMPLATE, argc, + argv )) == NULL ) { + template = "dnedit"; + } + if (( attr = get_arg_by_name( DSGW_ARG_DNEDIT_ATTR, argc, + argv )) == NULL ) { + dsgw_emits( "\n" ); + return; + } + if (( desc = get_arg_by_name( DSGW_ARG_DNEDIT_DESC, argc, + argv )) == NULL ) { + desc = attr; + } + + dsgw_emitf( "\n", label, template, + attr, desc ); +} + + +static void +do_viewswitcher( char *template, char *dn, int argc, char **argv ) +{ + dsgwtmplset *tsp; + dsgwview *vp; + char *s, *altprefix, *altsuffix, *curprefix, *cursuffix; + + /* first we see if this template is part of a template set */ + for ( tsp = gc->gc_tmplsets; tsp != NULL; tsp = tsp->dstset_next ) { + for ( vp = tsp->dstset_viewlist; vp != NULL; vp = vp->dsview_next ) { + if ( strcasecmp( vp->dsview_template, template ) == 0 ) { + break; + } + } + if ( vp != NULL ) { + break; + } + } + + if ( tsp == NULL || tsp->dstset_viewcount == 1 ) { + return; /* not part of a set at all or only one view in the set */ + } + + /* emit view switcher prefix */ + if (( s = get_arg_by_name( "prefix", argc, argv )) == NULL ) { + s = "\n"; + } + dsgw_emits( s ); + + /* retrieve view item prefix and suffix arguments */ + if (( altprefix = get_arg_by_name( "altprefix", argc, argv )) == NULL ) { + altprefix = "\n"; + } + if (( curprefix = get_arg_by_name( "curprefix", argc, argv )) == + NULL ) { + curprefix = "\n"; + } + + /* emit one table cell item (or similar) for each available view */ + for ( vp = tsp->dstset_viewlist; vp != NULL; vp = vp->dsview_next ) { + if ( strcasecmp( vp->dsview_template, template ) == 0 ) { + dsgw_emitf( "%s%s%s", curprefix, vp->dsview_caption, + cursuffix ); + } else { + dsgw_emitf( "%s\ndsview_jscript == NULL ) { + dsgw_emitf( "javascript:EditEntryAs('%s')", + vp->dsview_template ); + } else { + dsgw_substitute_and_output( vp->dsview_jscript, "--dn--", + dn, 1 ); + } + dsgw_emitf( "\">%s\n%s", vp->dsview_caption, altsuffix ); + } + } + + /* emit view switcher suffix */ + if (( s = get_arg_by_name( "suffix", argc, argv )) == NULL ) { + s = "
\n"; + } + if (( altsuffix = get_arg_by_name( "altsuffix", argc, argv )) == NULL ) { + altsuffix = "\n"; + } + if (( cursuffix = get_arg_by_name( "currentsuffix", argc, argv )) == + NULL ) { + cursuffix = "
\n"; + } + dsgw_emits( s ); +} + + +static void +do_attrvalset( dsgwtmplinfo *tip, char *dn, unsigned long dispopts, + int argc, char **argv ) +{ + dsgwavset *avp; + char *s, *valuearg, *prefix, *suffix; + int i, setpos, len, maxvallen; + + /* + * locate "set" element in argv array so we can replace it later + * with "value=" + */ + if (( setpos = dsgw_get_arg_pos_by_name( DSGW_ARG_AVSET_SET, argc, + argv )) < 0 ) { + dsgw_emitf( XP_GetClientStr(DBT_missingSN_), DSGW_ARG_AVSET_SET ); + return; + } + s = &argv[ setpos ][ 4 ]; + + for ( avp = gc->gc_avsets; avp != NULL; avp = avp->dsavset_next ) { + if ( strcasecmp( s, avp->dsavset_handle ) == 0 ) { + break; + } + } + if ( avp == NULL ) { + dsgw_emitf( XP_GetClientStr(DBT_unknownSetSN_), s ); + return; + } + + prefix = get_arg_by_name( "prefix", argc, argv ); + suffix = get_arg_by_name( "suffix", argc, argv ); + + /* repeatedly call on do_attribute() to perform all the difficult work */ + maxvallen = 0; + valuearg = NULL; + for ( i = 0; i < avp->dsavset_itemcount; ++i ) { + if ( prefix != NULL ) { + dsgw_emits( prefix ); + } + dsgw_emits( avp->dsavset_prefixes[ i ] ); + + /* construct "value=XXX" arg. and place in argv array */ + if (( len = strlen( avp->dsavset_values[ i ] )) > maxvallen || + valuearg == NULL ) { + maxvallen = len; + valuearg = dsgw_ch_realloc( valuearg, maxvallen + 7 ); + } + PR_snprintf( valuearg, maxvallen + 7, "value=%s", avp->dsavset_values[ i ] ); + argv[ setpos ] = valuearg; + + do_attribute( tip, dn, dispopts, argc, argv ); + + dsgw_emits( avp->dsavset_suffixes[ i ] ); + if ( suffix != NULL ) { + dsgw_emitf( "%s\n", suffix ); + } + } +} + + +static void +do_std_completion_js( char *template, int argc, char **argv ) +{ + if ( template != NULL ) { + dsgw_emitf( + "\\' + dsmodify_info +" + " \\'
\\' );" + " else " + "parent.document.location.href=\\'%s?%s" + "&context=%s&dn=\\' + dsmodify_dn + \\'&info=\\' + escape(dsmodify_info)\">\n", + dsgw_getvp( DSGW_CGINUM_EDIT ), template, context ); + } +} + + +/* + * function called back by dsgw_parse_line() to evaluate IF directives. + * return non-zero for true, zero for false. + */ +static int +condition_is_true( int argc, char **argv, void *arg ) +{ + dsgwtmplinfo *tip; + + if ( argc < 1 ) { + return( 0 ); + } + + tip = (dsgwtmplinfo *)arg; + + if ( strcasecmp( argv[0], DSGW_COND_FOUNDENTRIES ) == 0 ) { + return( tip->dsti_entrycount > 0 ); + } + + if ( strcasecmp( argv[0], DSGW_COND_ADDING ) == 0 ) { + return(( tip->dsti_options & DSGW_DISPLAY_OPT_ADDING ) != 0 ); + } + + if ( strcasecmp( argv[0], DSGW_COND_EDITING ) == 0 ) { + return(( tip->dsti_options & DSGW_DISPLAY_OPT_EDITABLE ) != 0 && + ( tip->dsti_options & DSGW_DISPLAY_OPT_ADDING ) == 0 ); + } + + if ( strcasecmp( argv[0], DSGW_COND_DISPLAYING ) == 0 ) { + return(( tip->dsti_options & DSGW_DISPLAY_OPT_EDITABLE ) == 0 ); + } + + if ( strcasecmp( argv[0], DSGW_COND_BOUND ) == 0 ) { + return( dsgw_get_binddn() != NULL ); + } + + if ( strcasecmp( argv[0], DSGW_COND_BOUNDASTHISENTRY ) == 0 ) { + return( dsgw_bound_as_dn( tip->dsti_entrydn, 0 )); + } + + if ( strcasecmp( argv[0], DSGW_COND_DISPLAYORGCHART ) == 0 ) { + return(gc->gc_orgcharturl != NULL && ((tip->dsti_options & DSGW_DISPLAY_OPT_ADDING ) == 0)); + } + + if ( strcasecmp( argv[0], DSGW_COND_DISPLAYAIMPRESENCE ) == 0 ) { + return((gc->gc_aimpresence == 1) && ((tip->dsti_options & DSGW_DISPLAY_OPT_ADDING ) == 0)); + } + + if ( strcasecmp( argv[0], DSGW_COND_ATTRHASVALUES ) == 0 ) { + /* + * format of IF statment is: + * <-- IF "AttributeHasValues" "ATTRIBUTE" "MINIMUM_COUNT" --> + * MINIMUM_COUNT is an optional number. + */ + char **vals; + int rc, minimum; + + if ( argc < 2 || tip->dsti_entry == NULL || + ( vals = (char **) ldap_get_values( tip->dsti_ld, tip->dsti_entry, + argv[1])) == NULL ) { + /* check "attrsonly" information if applicable */ + if ( argc < 3 && tip->dsti_attrsonly_entry != NULL ) { + (void)ldap_get_values( tip->dsti_ld, tip->dsti_attrsonly_entry, argv[1]); + if ( ldap_get_lderrno( tip->dsti_ld, NULL, NULL ) + == LDAP_SUCCESS ) { + return( 1 ); + } + } + return( 0 ); + } + minimum = ( argc < 3 ) ? 1 : atoi( argv[ 2 ] ); + rc = ( minimum <= 1 || ldap_count_values( vals ) >= minimum ); + ldap_value_free( vals ); + return( rc ); + } + + if ( strcasecmp( argv[0], DSGW_COND_ATTRHASTHISVALUE ) == 0 ) { + /* + * format of IF statment is: + * <-- IF "AttributeHasThisValue" "ATTRIBUTE" "SYNTAX" "VALUE" --> + */ + char **vals; + int i, rc; + struct attr_handler *ahp; + + if ( argc < 4 || tip->dsti_entry == NULL || + ( vals = (char **) ldap_get_values( tip->dsti_ld, tip->dsti_entry, + argv[1])) == NULL ) { + return( 0 ); + } + if (( ahp = syntax2attrhandler( argv[2] )) == NULL ) { + dsgw_emitf( XP_GetClientStr(DBT_unknownSyntaxSN_1), argv[2] ); + return( 0 ); + } + + rc = 0; + for ( i = 0; vals[ i ] != NULL; ++i ) { + if ( dsgw_valcmp(ahp->ath_compare)( (const char **)&vals[i], + (const char **)&argv[3] ) == 0 ) { + rc = 1; + break; + } + } + ldap_value_free( vals ); + return( rc ); + } + + /* pass unrecognized conditionals to simple conditional handler */ + return( dsgw_simple_cond_is_true( argc, argv, NULL )); +} + +/* + * Function: dsgw_get_values + * + * Returns: an array of values + * + * Description: This function returns the values of + * an attribute, taking into account any + * possible language or phonetic tags. + * pass in something like "cn" and this function + * will return all cn's, tagged or not. + * If binary_value is 1, then it'll handle + * everything as binary values. + * + * Author: RJP + * + */ +static char ** +dsgw_get_values( LDAP *ld, LDAPMessage *entry, + const char *target, int binary_value ) +{ + BerElement *ber = NULL; + char *attr = NULL; + char *new_target = NULL; + int new_target_size = 0; + char **val_youse = NULL; + char **temp_vals = NULL; + int i = 0; + int j = 0; + int temp_val_count = 0; + + /* Allocate a new target that is the original plus a semicolon*/ + new_target = (char *) dsgw_ch_malloc (sizeof(char) * (strlen(target) + 2) ); + sprintf (new_target, "%s;", target); + + new_target_size = strlen(new_target); + + /* + * Go through the attributes and + * compare the new_target with the attr name + */ + for ( attr = ldap_first_attribute( ld, entry, &ber ); attr != NULL; + attr = ldap_next_attribute( ld, entry, ber ) ) { + + /* If the "target;" matches the attribute name, get the values*/ + if ( strcasecmp(attr, target) == 0 || + strncasecmp (attr, new_target, new_target_size) == 0) { + if (binary_value) { + temp_vals = (char **) ldap_get_values_len( ld, entry, attr ); + } else { + temp_vals = (char **) ldap_get_values( ld, entry, attr ); + } + + if (temp_vals == NULL) { + continue; + } + + /* Find the next open spot in val_youse*/ + if (val_youse) { + for (; val_youse[i] != NULL; i++) ; + } + + /* Count the number of values in temp_vals */ + for (temp_val_count = 0; temp_vals[temp_val_count] != NULL; + temp_val_count++); + + /* Realloc */ + val_youse = (char **) dsgw_ch_realloc (val_youse, sizeof(char *) * (temp_val_count + i + 1) ); + + /* Start there and copy over the pointers from temp_vals */ + for (j = 0; j < temp_val_count; j++, i++) { + val_youse[i] = temp_vals[j]; + } + + val_youse[i] = NULL; + + ldap_memfree(temp_vals); + + } + } + + /* Free the BerElement from memory when done */ + + if ( ber != NULL ) { + + ldap_ber_free( ber, 0 ); + + } + + free (new_target); + + return(val_youse); +} + +/* + * Function: dsgw_value_free + * + * Returns: nothing + * + * Description: frees a half libldap and half dsge malloc'd array. + * Sorry. This really sucks, I know, but I didn't + * want to copy all that data around. + * + * Author: RJP + * + */ +static void +dsgw_value_free( void **ldvals, int binary ) +{ + int i; + + for (i = 0; ldvals[i] != NULL; i ++) { + if (binary) { + struct berval *delete_me = NULL; + + delete_me = (struct berval *) ldvals[i]; + + ldap_memfree(delete_me->bv_val); + ldap_memfree(delete_me); + } else { + ldap_memfree (ldvals[i]); + } + } + + free(ldvals); + + +} +/* + * Function: dsgw_time + * + * Returns: a string not unlike the string returned from ctime() + * except it's localized + * + * Description: this function takes the number of seconds since 1970 + * and converts it to a localized string version of that. + * First it tries to use the clientLanguage, if that fails, + * It tries the default language. if that fails, it returns + * NULL + * + * Author: RJP + * + */ +static char * +dsgw_time(time_t secs_since_1970) +{ + UDateFormat *edatefmt; + UErrorCode err = U_ZERO_ERROR; + UChar *dstr0; + static char obuf[BSIZ]; + UDate tmp_dat; + char *locale = NULL; + int32_t myStrlen = 0; + + /* Create a Date/Time Format using the locale */ + if (countri) { + locale = PR_smprintf("%s_%s", langwich, countri); + } else { + locale = PR_smprintf("%s", langwich); + } + + edatefmt = udat_open( + UDAT_DEFAULT, /* default date style for locale */ + UDAT_DEFAULT, /* default time style for locale */ + locale, + NULL, 0, /* use default timezone */ + NULL, 0, /* no pattern */ + &err); + + PR_smprintf_free(locale); + locale = NULL; + + if (!edatefmt || (err != U_ZERO_ERROR)) { + if (edatefmt) { + udat_close(edatefmt); + } + err = U_ZERO_ERROR; + edatefmt = udat_open( + UDAT_DEFAULT, /* default date style for locale */ + UDAT_DEFAULT, /* default time style for locale */ + gc->gc_DefaultLanguage, /* default language */ + NULL, 0, /* use default timezone */ + NULL, 0, /* no pattern */ + &err); + } + + if (!edatefmt || (err != U_ZERO_ERROR)) { + dsgw_error( DSGW_ERR_LDAPGENERAL, NULL, DSGW_ERROPT_EXIT, err, NULL ); + /*fprintf(stderr, "ERROR: NLS_NewDateTimeFormat(0): %d\n", err);*/ + } + + /* Get Current Date/Time */ + tmp_dat = (UDate) secs_since_1970; + tmp_dat *= 1000.00; + + /* Format using the first Date/Time format */ + myStrlen = udat_format(edatefmt, tmp_dat, NULL, myStrlen, NULL, &err); + if(err == U_BUFFER_OVERFLOW_ERROR){ + err = U_ZERO_ERROR; + dstr0 = (UChar*)dsgw_ch_malloc(sizeof(UChar) * (myStrlen+1) ); + myStrlen = udat_format(edatefmt, tmp_dat, dstr0, myStrlen+1, NULL, &err); + } + + if (err != U_ZERO_ERROR) { + dsgw_error( DSGW_ERR_LDAPGENERAL, NULL, DSGW_ERROPT_EXIT, err, NULL ); + /*fprintf(stderr, "ERROR: NLS_FormatDate(1): %d\n", err);*/ + } + + /* convert to utf8 */ + u_strToUTF8(obuf, sizeof(obuf), NULL, dstr0, myStrlen, &err); + + if (err != U_ZERO_ERROR) { + dsgw_error( DSGW_ERR_LDAPGENERAL, NULL, DSGW_ERROPT_EXIT, err, NULL ); + /*fprintf(stderr, "ERROR: NLS_NewEncodingConverter(0): %d\n", err);*/ + } + /*fprintf(stdout, "Date(0): %s\n", obuf);*/ + + /* Clean up -- but may not be enough... :) */ + free(dstr0); + + udat_close(edatefmt); + edatefmt = NULL; + + return( (char *) obuf); +} diff --git a/error.c b/error.c new file mode 100644 index 0000000..79c33c0 --- /dev/null +++ b/error.c @@ -0,0 +1,570 @@ +/** --- BEGIN COPYRIGHT BLOCK --- + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + --- END COPYRIGHT BLOCK --- */ +/* + * error.c -- error handling functions -- HTTP gateway + */ + +#include "dsgw.h" +#include "dbtdsgw.h" + +static char *dsgw_ldaperr2longstring( int err, int options ); + +struct dsgwerr { + int dsgwerr_code; + int dsgwerr_msg; +}; + + +/* all of the DSGW_ERR_... #defines are in dsgw.h */ +static struct dsgwerr dsgw_errs[] = { + { DSGW_ERR_BADMETHOD, + DBT_unknownHttpRequestMethod_ }, + { DSGW_ERR_BADFORMDATA, + DBT_invalidOrIncompleteHtmlFormData_ }, + { DSGW_ERR_NOMEMORY, + DBT_outOfMemory_ }, + { DSGW_ERR_MISSINGINPUT, + DBT_requiredQueryFormInputIsMissing_ }, + { DSGW_ERR_BADFILEPATH, + DBT_illegalCharacterInFilePath_ }, + { DSGW_ERR_BADCONFIG, + DBT_badOrMissingConfigurationFile_ }, + { DSGW_ERR_LDAPINIT, + DBT_unableToInitializeLdap_ }, + { DSGW_ERR_LDAPGENERAL, + DBT_anErrorOccurredWhileContactingTh_ }, + { DSGW_ERR_UNKSRCHTYPE, + DBT_unknownSearchObjectType_ }, + { DSGW_ERR_UNKATTRLABEL, + DBT_unknownAttributeLabel_ }, + { DSGW_ERR_UNKMATCHPROMPT, + DBT_unknownMatchPrompt_ }, + { DSGW_ERR_NOFILTERS, + DBT_noSearchFiltersForObjectType_ }, + { DSGW_ERR_OPENHTMLFILE, + DBT_unableToOpenHtmlTemplateFile_ }, + { DSGW_ERR_SEARCHMODE, + DBT_unknownSearchModeUseSmartComplex_ }, + { DSGW_ERR_LDAPURL_NODN, + DBT_distinguishedNameMissingInUrl_ }, + { DSGW_ERR_LDAPURL_BADSCOPE, + DBT_unknownScopeInUrlShouldBeBaseSub_ }, + { DSGW_ERR_LDAPURL_NOTLDAP, + DBT_unrecognizedUrlOrUnknownError_ }, + { DSGW_ERR_LDAPURL_BAD, + DBT_badUrlFormat_ }, + { DSGW_ERR_INTERNAL, + DBT_internalError_ }, + { DSGW_ERR_WRITEINDEXFILE, + DBT_unableToWriteTemplateIndexFile_ }, + { DSGW_ERR_OPENINDEXFILE, + DBT_unableToOpenTemplateIndexFile_ }, + { DSGW_ERR_OPENDIR, + DBT_unableToReadDirectory_ }, + { DSGW_ERR_SSLINIT, + DBT_ldapSslInitializationFailedCheck_ }, + { DSGW_ERR_NOSECPATH, + DBT_forTheUsersAndGroupsFormsToWorkO_ }, + { DSGW_CKDB_KEY_NOT_PRESENT, + DBT_authenticationCredentialsNotFoun_ }, + { DSGW_CKDB_DBERROR, + DBT_errorRetrievingDataFromTheAuthen_ }, + { DSGW_CKDB_EXPIRED, + DBT_yourAuthenticationCredentialsHav_ }, + { DSGW_CKDB_RNDSTRFAIL, + DBT_unableToCreateRandomString_ }, + { DSGW_CKDB_NODN, + DBT_noDistinguishedNameWasProvidedWh_ }, + { DSGW_CKDB_CANTOPEN, + DBT_cannotOpenAuthenticationDatabase_ }, + { DSGW_CKDB_CANTAPPEND, + DBT_couldNotAppendDataToTheAuthentic_ }, + { DSGW_ERR_NO_MGRDN, + DBT_noDirectoryManagerIsDefined_ }, + { DSGW_ERR_NOSEARCHSTRING, + DBT_noSearchStringWasProvidedPleaseT_ }, + { DSGW_ERR_CONFIGTOOMANYARGS, + DBT_tooManyArgumentsOnOneLineInTheCo_ }, + { DSGW_ERR_WSAINIT, + DBT_failedToInitializeWindowsSockets_ }, + { DSGW_ERR_ADMSERV_CREDFAIL, + DBT_authenticationCredentialsCouldNo_ }, + { DSGW_ERR_LDAPDBURL_NODN, + DBT_distinguishedNameMissingInLdapdb_ }, + { DSGW_ERR_LDAPDBURL_NOTLDAPDB, + DBT_unrecognizedUrlOrUnknownError_1 }, + { DSGW_ERR_LDAPDBURL_BAD, + DBT_badUrlFormat_1 }, + { DSGW_ERR_LCACHEINIT, + DBT_anErrorOccurredWhileInitializing_ }, + { DSGW_ERR_SERVICETYPE, + DBT_unknownDirectoryServiceTypeUseLo_ }, + { DSGW_ERR_DBCONF, + DBT_anErrorOccurredWhileReadingTheDb_ }, + { DSGW_ERR_USERDB_PATH, + DBT_nshomeUserdbPathWasNull_ }, + { DSGW_ERR_UPDATE_DBSWITCH, + DBT_theDirectoryServiceConfiguration_ }, + { DSGW_ERR_ENTRY_NOT_FOUND, + DBT_theEntryCouldNotBeReadFromTheDir_ }, + { DSGW_ERR_DB_ERASE, + DBT_theLdapDatabaseCouldNotBeErased_ }, + { DSGW_ERR_LOCALDB_PERMISSION_DENIED, + DBT_youMayNotChangeEntriesBesidesYou_ }, + { DSGW_ERR_NOATTRVALUE, + DBT_theAttributeValueRequestedWasNot_ }, + { DSGW_ERR_USERID_REQUIRED, + /* "A value must be specified for NT User Id" */ + DBT_aValueMustBeSpecifiedForNTUserId }, + { DSGW_ERR_DOMAINID_NOTUNIQUE, + /* "The combination of NT User Id, NT Domain Id */ + /* is not unique in the directory" */ + DBT_theCombinationOfNTUserIdNTDomain_ }, + { DSGW_ERR_USERID_DOMAINID_REQUIRED, + /* "Values must be specified for both NT */ + /* User Id and NT Domain Id" */ + DBT_valuesMustBeSpecifiedForBothNTUser_ }, + { DSGW_ERR_USERID_MAXLEN_EXCEEDED, + /* "The NT User Id value must not exceed 20 characters in length." */ + DBT_theNTUserIdValueMustNotExceed_ }, + { DSGW_ERR_CHARSET_NOT_SUPPORTED, + /* "The charset %s is not supported" */ + DBT_theCharsetIsNotSupported }, +}; +#define DSGW_ERROR_CNT ( sizeof( dsgw_errs ) / sizeof( struct dsgwerr )) + + + +/* + * dsgw_error -- report error as HTML text + */ +void +dsgw_error( int err, char *extra, int options, int ldaperr, char *lderrtxt ) +{ + char *msg, *prelude = XP_GetClientStr(DBT_problem_); + + if (( options & DSGW_ERROPT_IGNORE ) != 0 ) { + return; + } + + if (( options & DSGW_ERROPT_INLINE ) == 0 ) { + dsgw_send_header(); + dsgw_html_begin( prelude, 1 ); + } + + msg = dsgw_err2string( err ); + + dsgw_emitf( "\n%s\n\n", msg ); + if ( extra != NULL ) { + if ( lderrtxt == NULL ) { + dsgw_emitf( "
(%s)", extra ); + } else { + dsgw_emitf( "
(%s - %s)", extra, lderrtxt ); + } + } else if ( lderrtxt != NULL ) { + dsgw_emitf( "
(%s)", lderrtxt ); + } + +#ifdef DSGW_DEBUG + if ( extra == NULL ) { + dsgw_log( "%s: %s\n", prelude, msg ); + } else { + dsgw_log( "%s: %s (%s)\n", prelude, msg, extra ); + } +#endif + if ( ldaperr != 0 ) { + msg = dsgw_ldaperr2longstring( ldaperr, options ); + dsgw_emitf("

%s", msg ); + } + + if (( options & DSGW_ERROPT_INLINE ) == 0 ) { + dsgw_html_end(); + } + + if (( options & DSGW_ERROPT_EXIT ) != 0 ) { + exit( 0 ); + } +} + + +/* + * special handling for cookie expired or cookie database problems + * delete cookie on both server and client + * send helpful error with appropriate buttons: + * * if searching, display an error message, and a re-auth button, along + * with a help button. + * * if authenticating, (does this ever happen?) + * * if generating an editable view, display an error messge, and tell + * user to bring main window to front and requthenticate. + * * if submitting a modify operation, include an "Authenticate" button + * which brings up a new auth window, which only offers you a + * "close" button when finished. + * + * returns 1 if the CGI should exit. + * 0 if it should continue. - RJP + */ +int +dsgw_dn2passwd_error( int ckrc, int skipauthwarning ) +{ + char *authck; + + /* + * cookie is expired or bad -- delete it on both server and client sides + * + */ + if (( authck = dsgw_get_auth_cookie()) != NULL ) { + dsgw_delcookie( authck ); + } + + /* pop up a javascript alert */ + if (gc->gc_mode == DSGW_MODE_DOSEARCH) { + /* Just display a helpful error message */ + if (ckrc != DSGW_CKDB_KEY_NOT_PRESENT && !skipauthwarning) { + dsgw_send_header(); + dsgw_emit_alertForm(); + dsgw_emits( "\n"); + } + return(0); + } + dsgw_send_header(); + + dsgw_html_begin( XP_GetClientStr(DBT_authenticationProblem_), 1 ); + + dsgw_emits( "\n" ); + + dsgw_emits( dsgw_err2string( ckrc ) ); + + if (gc->gc_mode == DSGW_MODE_EDIT || gc->gc_mode == DSGW_MODE_DOMODIFY) { + + dsgw_emits( XP_GetClientStr(DBT_NPYouMustReAuthenticateBeforeCon_1) ); + dsgw_emits( "

\n" ); + dsgw_form_begin( NULL, NULL ); + dsgw_emits("\n

\n" ); + dsgw_emits( "
\n" ); + dsgw_emitf( "\n", + XP_GetClientStr(DBT_closeWindow_4) ); + dsgw_emits( "\n" ); + dsgw_emit_helpbutton( "AUTHEXPIRED" ); + dsgw_emits( "\n
\n" ); + + } + + dsgw_html_end(); + return(1); +} + + +char * +dsgw_err2string( int err ) +{ + int i; + + for ( i = 0; i < DSGW_ERROR_CNT; ++i ) { + if ( dsgw_errs[ i ].dsgwerr_code == err ) { + return( XP_GetClientStr(dsgw_errs[ i ].dsgwerr_msg) ); + } + } + + return( XP_GetClientStr(DBT_unknownError_) ); +} + + +static char * +dsgw_ldaperr2longstring( int err, int options ) +{ + char *s = ""; + + switch ( err ) { + case LDAP_SUCCESS: + s = XP_GetClientStr(DBT_theOperationWasSuccessful_); + break; + case LDAP_OPERATIONS_ERROR: + s = XP_GetClientStr(DBT_anInternalErrorOccurredInTheServ_); + break; + case LDAP_PROTOCOL_ERROR: + s = XP_GetClientStr(DBT_theServerCouldNotUnderstandTheRe_); + break; + case LDAP_TIMELIMIT_EXCEEDED: + s = XP_GetClientStr(DBT_aTimeLimitWasExceededInRespondin_); + break; + case LDAP_SIZELIMIT_EXCEEDED: + s = XP_GetClientStr(DBT_aSizeLimitWasExceededInRespondin_); + break; + case LDAP_COMPARE_FALSE: + break; + case LDAP_COMPARE_TRUE: + break; + case LDAP_STRONG_AUTH_NOT_SUPPORTED: + s = XP_GetClientStr(DBT_theGatewayAttemptedToAuthenticat_); + break; + case LDAP_STRONG_AUTH_REQUIRED: + s = XP_GetClientStr(DBT_theGatewayAttemptedToAuthenticat_1); + break; +#ifdef LDAP_REFERRAL /* new in LDAPv3 */ + case LDAP_REFERRAL: +#endif + case LDAP_PARTIAL_RESULTS: + s = XP_GetClientStr(DBT_yourRequestCouldNotBeFulfilledPr_); + break; +#ifdef LDAP_ADMIN_LIMIT_EXCEEDED /* new in LDAPv3 */ + case LDAP_ADMIN_LIMIT_EXCEEDED: + s = XP_GetClientStr(DBT_yourRequestExceededAnAdministrat_); + break; +#endif +#ifdef LDAP_UNAVAILABLE_CRITICAL_EXTENSION /* new in LDAPv3 */ + case LDAP_UNAVAILABLE_CRITICAL_EXTENSION: + s = XP_GetClientStr(DBT_aCriticalExtensionThatTheGateway_); + break; +#endif + case LDAP_NO_SUCH_ATTRIBUTE: + s = XP_GetClientStr(DBT_theServerWasUnableToProcessTheRe_); + break; + case LDAP_UNDEFINED_TYPE: + break; + case LDAP_INAPPROPRIATE_MATCHING: + break; + case LDAP_CONSTRAINT_VIOLATION: + s = XP_GetClientStr(DBT_theServerWasUnableToFulfillYourR_); + break; + case LDAP_TYPE_OR_VALUE_EXISTS: + s = XP_GetClientStr(DBT_theServerCouldNotAddAValueToTheE_); + break; + case LDAP_INVALID_SYNTAX: + break; + case LDAP_NO_SUCH_OBJECT: + if (( options & DSGW_ERROPT_DURINGBIND ) == 0 ) { + s = XP_GetClientStr(DBT_theServerCouldNotLocateTheEntryI_); + } else { + s = XP_GetClientStr(DBT_theServerCouldNotLocateTheEntryY_); + } + break; + case LDAP_ALIAS_PROBLEM: + break; + case LDAP_INVALID_DN_SYNTAX: + s = XP_GetClientStr(DBT_aDistinguishedNameWasNotInThePro_); + break; + case LDAP_IS_LEAF: + break; + case LDAP_ALIAS_DEREF_PROBLEM: + break; + case LDAP_INAPPROPRIATE_AUTH: + s = XP_GetClientStr(DBT_theEntryYouAttemptedToAuthentica_); + break; + case LDAP_INVALID_CREDENTIALS: + s = XP_GetClientStr(DBT_thePasswordOrOtherAuthentication_); + break; + case LDAP_INSUFFICIENT_ACCESS: + s = XP_GetClientStr(DBT_youDoNotHaveSufficientPrivileges_); + break; + case LDAP_BUSY: + s = XP_GetClientStr(DBT_theServerIsTooBusyToServiceYourR_); + break; + case LDAP_UNAVAILABLE: + s = XP_GetClientStr(DBT_theLdapServerCouldNotBeContacted_); + break; + case LDAP_UNWILLING_TO_PERFORM: + s = XP_GetClientStr(DBT_theServerWasUnwilliingToProcessY_); + break; + case LDAP_LOOP_DETECT: + break; + case LDAP_NAMING_VIOLATION: + break; + case LDAP_OBJECT_CLASS_VIOLATION: + s = XP_GetClientStr(DBT_theDirectoryServerCouldNotHonorY_); + break; + case LDAP_NOT_ALLOWED_ON_NONLEAF: + s = XP_GetClientStr(DBT_theDirectoryServerWillNotAllowYo_); + break; + case LDAP_NOT_ALLOWED_ON_RDN: + break; + case LDAP_ALREADY_EXISTS: + s = XP_GetClientStr(DBT_theServerWasUnableToAddANewEntry_); + break; + case LDAP_NO_OBJECT_CLASS_MODS: + break; + case LDAP_RESULTS_TOO_LARGE: + break; +#ifdef LDAP_AFFECTS_MULTIPLE_DSAS /* new in LDAPv3 */ + case LDAP_AFFECTS_MULTIPLE_DSAS: + s = XP_GetClientStr(DBT_yourRequestWouldAffectSeveralDir_); + break; +#endif + case LDAP_OTHER: + break; + case LDAP_SERVER_DOWN: + s = XP_GetClientStr(DBT_theDirectoryServerCouldNotBeCont_); + break; + case LDAP_LOCAL_ERROR: + break; + case LDAP_ENCODING_ERROR: + s = XP_GetClientStr(DBT_anErrorOccuredWhileSendingDataTo_); + break; + case LDAP_DECODING_ERROR: + s = XP_GetClientStr(DBT_anErrorOccuredWhileReadingDataFr_); + break; + case LDAP_TIMEOUT: + s = XP_GetClientStr(DBT_theServerDidNotRespondToTheReque_); + break; + case LDAP_AUTH_UNKNOWN: + s = XP_GetClientStr(DBT_theServerDoesNotSupportTheAuthen_); + break; + case LDAP_FILTER_ERROR: + s = XP_GetClientStr(DBT_theSearchFilterConstructedByTheG_); + break; + case LDAP_USER_CANCELLED: + s = XP_GetClientStr(DBT_theOperationWasCancelledAtYourRe_); + break; + case LDAP_PARAM_ERROR: + break; + case LDAP_NO_MEMORY: + s = XP_GetClientStr(DBT_anInternalErrorOccurredInTheLibr_); + break; + case LDAP_CONNECT_ERROR: + s = XP_GetClientStr(DBT_aConnectionToTheServerCouldNotBe_); + break; + default: + s = XP_GetClientStr(DBT_anUnknownErrorWasEncountered_); + } + return s; +} + +static struct dsgwerr LDAP_errs[] = { + { LDAP_SUCCESS, DBT_LDAP_SUCCESS}, + { LDAP_OPERATIONS_ERROR, DBT_LDAP_OPERATIONS_ERROR}, + { LDAP_PROTOCOL_ERROR, DBT_LDAP_PROTOCOL_ERROR}, + { LDAP_TIMELIMIT_EXCEEDED, DBT_LDAP_TIMELIMIT_EXCEEDED}, + { LDAP_SIZELIMIT_EXCEEDED, DBT_LDAP_SIZELIMIT_EXCEEDED}, + { LDAP_COMPARE_FALSE, DBT_LDAP_COMPARE_FALSE}, + { LDAP_COMPARE_TRUE, DBT_LDAP_COMPARE_TRUE}, + { LDAP_STRONG_AUTH_NOT_SUPPORTED, DBT_LDAP_STRONG_AUTH_NOT_SUPPORTED}, + { LDAP_STRONG_AUTH_REQUIRED, DBT_LDAP_STRONG_AUTH_REQUIRED}, + { LDAP_PARTIAL_RESULTS, DBT_LDAP_PARTIAL_RESULTS}, + { LDAP_REFERRAL, DBT_LDAP_REFERRAL}, + { LDAP_ADMINLIMIT_EXCEEDED, DBT_LDAP_ADMINLIMIT_EXCEEDED}, + { LDAP_UNAVAILABLE_CRITICAL_EXTENSION, DBT_LDAP_UNAVAILABLE_CRITICAL_EXTENSION}, + { LDAP_CONFIDENTIALITY_REQUIRED,DBT_LDAP_CONFIDENTIALITY_REQUIRED}, + { LDAP_SASL_BIND_IN_PROGRESS, DBT_LDAP_SASL_BIND_IN_PROGRESS}, + + { LDAP_NO_SUCH_ATTRIBUTE, DBT_LDAP_NO_SUCH_ATTRIBUTE}, + { LDAP_UNDEFINED_TYPE, DBT_LDAP_UNDEFINED_TYPE}, + { LDAP_INAPPROPRIATE_MATCHING, DBT_LDAP_INAPPROPRIATE_MATCHING}, + { LDAP_CONSTRAINT_VIOLATION, DBT_LDAP_CONSTRAINT_VIOLATION}, + { LDAP_TYPE_OR_VALUE_EXISTS, DBT_LDAP_TYPE_OR_VALUE_EXISTS}, + { LDAP_INVALID_SYNTAX, DBT_LDAP_INVALID_SYNTAX}, + + { LDAP_NO_SUCH_OBJECT, DBT_LDAP_NO_SUCH_OBJECT}, + { LDAP_ALIAS_PROBLEM, DBT_LDAP_ALIAS_PROBLEM}, + { LDAP_INVALID_DN_SYNTAX, DBT_LDAP_INVALID_DN_SYNTAX}, + { LDAP_IS_LEAF, DBT_LDAP_IS_LEAF}, + { LDAP_ALIAS_DEREF_PROBLEM, DBT_LDAP_ALIAS_DEREF_PROBLEM}, + + { LDAP_INAPPROPRIATE_AUTH, DBT_LDAP_INAPPROPRIATE_AUTH}, + { LDAP_INVALID_CREDENTIALS, DBT_LDAP_INVALID_CREDENTIALS}, + { LDAP_INSUFFICIENT_ACCESS, DBT_LDAP_INSUFFICIENT_ACCESS}, + { LDAP_BUSY, DBT_LDAP_BUSY}, + { LDAP_UNAVAILABLE, DBT_LDAP_UNAVAILABLE}, + { LDAP_UNWILLING_TO_PERFORM, DBT_LDAP_UNWILLING_TO_PERFORM}, + { LDAP_LOOP_DETECT, DBT_LDAP_LOOP_DETECT}, + + { LDAP_NAMING_VIOLATION, DBT_LDAP_NAMING_VIOLATION}, + { LDAP_OBJECT_CLASS_VIOLATION, DBT_LDAP_OBJECT_CLASS_VIOLATION}, + { LDAP_NOT_ALLOWED_ON_NONLEAF, DBT_LDAP_NOT_ALLOWED_ON_NONLEAF}, + { LDAP_NOT_ALLOWED_ON_RDN, DBT_LDAP_NOT_ALLOWED_ON_RDN}, + { LDAP_ALREADY_EXISTS, DBT_LDAP_ALREADY_EXISTS}, + { LDAP_NO_OBJECT_CLASS_MODS, DBT_LDAP_NO_OBJECT_CLASS_MODS}, + { LDAP_RESULTS_TOO_LARGE, DBT_LDAP_RESULTS_TOO_LARGE}, + { LDAP_AFFECTS_MULTIPLE_DSAS, DBT_LDAP_AFFECTS_MULTIPLE_DSAS}, + + { LDAP_OTHER, DBT_LDAP_OTHER}, + { LDAP_SERVER_DOWN, DBT_LDAP_SERVER_DOWN}, + { LDAP_LOCAL_ERROR, DBT_LDAP_LOCAL_ERROR}, + { LDAP_ENCODING_ERROR, DBT_LDAP_ENCODING_ERROR}, + { LDAP_DECODING_ERROR, DBT_LDAP_DECODING_ERROR}, + { LDAP_TIMEOUT, DBT_LDAP_TIMEOUT}, + { LDAP_AUTH_UNKNOWN, DBT_LDAP_AUTH_UNKNOWN}, + { LDAP_FILTER_ERROR, DBT_LDAP_FILTER_ERROR}, + { LDAP_USER_CANCELLED, DBT_LDAP_USER_CANCELLED}, + { LDAP_PARAM_ERROR, DBT_LDAP_PARAM_ERROR}, + { LDAP_NO_MEMORY, DBT_LDAP_NO_MEMORY}, + { LDAP_CONNECT_ERROR, DBT_LDAP_CONNECT_ERROR}, + { LDAP_NOT_SUPPORTED, DBT_LDAP_NOT_SUPPORTED}, + { LDAP_CONTROL_NOT_FOUND, DBT_LDAP_CONTROL_NOT_FOUND}, + { LDAP_NO_RESULTS_RETURNED, DBT_LDAP_NO_RESULTS_RETURNED}, + { LDAP_MORE_RESULTS_TO_RETURN, DBT_LDAP_MORE_RESULTS_TO_RETURN}, + { LDAP_CLIENT_LOOP, DBT_LDAP_CLIENT_LOOP}, + { LDAP_REFERRAL_LIMIT_EXCEEDED, DBT_LDAP_REFERRAL_LIMIT_EXCEEDED}}; + +#define LDAP_ERROR_CNT ( sizeof( LDAP_errs ) / sizeof( struct dsgwerr )) + +char * +dsgw_ldaperr2string( int lderr ) +{ + auto int msgno = 0; + auto int i; + + for ( i = 0; i < LDAP_ERROR_CNT; ++i ) { + if ( LDAP_errs[ i ].dsgwerr_code == lderr ) { + msgno = LDAP_errs[ i ].dsgwerr_msg; + break; + } + } + if (msgno != 0) { + auto char* msg = XP_GetClientStr(msgno); + if (msg && *msg) return dsgw_ch_strdup( msg ); + } + { /* get the message string from the LDAP SDK: */ + auto char* fmt = XP_GetClientStr(DBT_errorS_); + auto char* s = ldap_err2string( lderr ); + auto char* msg = dsgw_ch_malloc( strlen( fmt ) + strlen( s ) + 20); + PR_snprintf( msg, strlen(fmt) + strlen(s) + 20, fmt, s, lderr ); + return msg; + } +} diff --git a/fileurl.c b/fileurl.c new file mode 100644 index 0000000..55b8ece --- /dev/null +++ b/fileurl.c @@ -0,0 +1,321 @@ +/** BEGIN COPYRIGHT BLOCK + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/* + * LDIF tools fileurl.c -- functions for handling file URLs. + * Used by ldif_parse_line. + */ + +#include +#include +#include +#include +#include "fileurl.h" +#include /* for isalpha() */ + +static int str_starts_with( char *s, char *prefix ); +static void hex_unescape( char *s ); +static int unhex( char c ); +static void strcpy_escaped_and_convert( char *s1, char *s2 ); + +/* + * Convert a file URL to a local path. + * + * If successful, LDIF_FILEURL_SUCCESS is returned and *localpathp is + * set point to an allocated string. If not, an different LDIF_FILEURL_ + * error code is returned. + * + * See RFCs 1738 and 2396 for a specification for file URLs... but + * Netscape Navigator seems to be a bit more lenient in what it will + * accept, especially on Windows). + * + * This function parses file URLs of these three forms: + * + * file:///path + * file:/path + * file://localhost/path + * file://host/path (rejected with a ...NONLOCAL error) + * + * On Windows, we convert leading drive letters of the form C| to C: + * and if a drive letter is present we strip off the slash that precedes + * path. Otherwise, the leading slash is returned. + * + */ +int +ldif_fileurl2path( char *fileurl, char **localpathp ) +{ + char *path; + + /* + * Make sure this is a file name or URL we can handle. + */ + if ( *fileurl == '/' || + ( isalpha( fileurl[0] ) && ( fileurl[1] == '|' || fileurl[1] == ':' ) ) ) { + path = fileurl; + goto path_ready; + } else if ( !str_starts_with( fileurl, "file:" )) { + return( LDIF_FILEURL_NOTAFILEURL ); + } + + path = fileurl + 5; /* skip past "file:" scheme prefix */ + + if ( *path != '/' ) { + return( LDIF_FILEURL_MISSINGPATH ); + } + + ++path; /* skip past '/' at end of "file:/" */ + + if ( *path == '/' ) { + ++path; /* remainder is now host/path or /path */ + if ( *path != '/' ) { + /* + * Make sure it is for the local host. + */ + if ( str_starts_with( path, "localhost/" )) { + path += 9; + } else { + return( LDIF_FILEURL_NONLOCAL ); + } + } + } else { /* URL is of the form file:/path */ + --path; + } + + /* + * The remainder is now of the form /path. On Windows, skip past the + * leading slash if a drive letter is present. + */ +#ifdef _WIN32 + if ( isalpha( path[1] ) && ( path[2] == '|' || path[2] == ':' )) { + ++path; + } +#endif /* _WIN32 */ + + + path_ready: + /* + * Duplicate the path so we can safely alter it. + * Unescape any %HH sequences. + */ + if (( path = strdup( path )) == NULL ) { + return( LDIF_FILEURL_NOMEMORY ); + } + hex_unescape( path ); + +#ifdef _WIN32 + /* + * Convert forward slashes to backslashes for Windows. Also, + * if we see a drive letter / vertical bar combination (e.g., c|) + * at the beginning of the path, replace the '|' with a ':'. + */ + { + char *p; + + for ( p = path; *p != '\0'; ++p ) { + if ( *p == '/' ) { + *p = '\\'; + } + } + } + + if ( isalpha( path[0] ) && path[1] == '|' ) { + path[1] = ':'; + } +#endif /* _WIN32 */ + + *localpathp = path; + return( LDIF_FILEURL_SUCCESS ); +} + + +/* + * Convert a local path to a file URL. + * + * If successful, LDIF_FILEURL_SUCCESS is returned and *urlp is + * set point to an allocated string. If not, an different LDIF_FILEURL_ + * error code is returned. At present, the only possible error is + * LDIF_FILEURL_NOMEMORY. + * + * This function produces file URLs of the form file:path. + * + * On Windows, we convert leading drive letters to C|. + * + */ +int +ldif_path2fileurl( char *path, char **urlp ) +{ + char *p, *url, *prefix ="file:"; + + if ( NULL == path ) { + path = "/"; + } + + /* + * Allocate space for the URL, taking into account that path may + * expand during the hex escaping process. + */ + if (( url = malloc( strlen( prefix ) + 3 * strlen( path ) + 1 )) == NULL ) { + return( LDIF_FILEURL_NOMEMORY ); + } + + strcpy( url, prefix ); + p = url + strlen( prefix ); + +#ifdef _WIN32 + /* + * On Windows, convert leading drive letters (e.g., C:) to the correct URL + * syntax (e.g., C|). + */ + if ( isalpha( path[0] ) && path[1] == ':' ) { + *p++ = path[0]; + *p++ = '|'; + path += 2; + *p = '\0'; + } +#endif /* _WIN32 */ + + /* + * Append the path, encoding any URL-special characters using the %HH + * convention. + * On Windows, convert backwards slashes in the path to forward ones. + */ + strcpy_escaped_and_convert( p, path ); + + *urlp = url; + return( LDIF_FILEURL_SUCCESS ); +} + + +/* + * Return a non-zero value if the string s begins with prefix and zero if not. + */ +static int +str_starts_with( char *s, char *prefix ) +{ + size_t prefix_len; + + if ( s == NULL || prefix == NULL ) { + return( 0 ); + } + + prefix_len = strlen( prefix ); + if ( strlen( s ) < prefix_len ) { + return( 0 ); + } + + return( strncmp( s, prefix, prefix_len ) == 0 ); +} + + +/* + * Remove URL hex escapes from s... done in place. The basic concept for + * this routine is borrowed from the WWW library HTUnEscape() routine. + * + */ +static void +hex_unescape( char *s ) +{ + char *p; + + for ( p = s; *s != '\0'; ++s ) { + if ( *s == '%' ) { + if ( *++s != '\0' ) { + *p = unhex( *s ) << 4; + } + if ( *++s != '\0' ) { + *p++ += unhex( *s ); + } + } else { + *p++ = *s; + } + } + + *p = '\0'; +} + + +/* + * Return the integer equivalent of one hex digit (in c). + * + */ +static int +unhex( char c ) +{ + return( c >= '0' && c <= '9' ? c - '0' + : c >= 'A' && c <= 'F' ? c - 'A' + 10 + : c - 'a' + 10 ); +} + + +#define HREF_CHAR_ACCEPTABLE( c ) (( c >= '-' && c <= '9' ) || \ + ( c >= '@' && c <= 'Z' ) || \ + ( c == '_' ) || \ + ( c >= 'a' && c <= 'z' )) + +/* + * Like strcat(), except if any URL-special characters are found in s2 + * they are escaped using the %HH convention and backslash characters are + * converted to forward slashes on Windows. + * + * Maximum space needed in s1 is 3 * strlen( s2 ) + 1. + * + */ +static void +strcpy_escaped_and_convert( char *s1, char *s2 ) +{ + char *p, *q; + char *hexdig = "0123456789ABCDEF"; + + p = s1 + strlen( s1 ); + for ( q = s2; *q != '\0'; ++q ) { +#ifdef _WIN32 + if ( *q == '\\' ) { + *p++ = '/'; + } else +#endif /* _WIN32 */ + + if ( HREF_CHAR_ACCEPTABLE( *q )) { + *p++ = *q; + } else { + *p++ = '%'; + *p++ = hexdig[ 0x0F & ((*(unsigned char*)q) >> 4) ]; + *p++ = hexdig[ 0x0F & *q ]; + } + } + + *p = '\0'; +} diff --git a/fileurl.h b/fileurl.h new file mode 100644 index 0000000..e0acddf --- /dev/null +++ b/fileurl.h @@ -0,0 +1,72 @@ +/** BEGIN COPYRIGHT BLOCK + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/* + * LDIF tools fileurl.h -- defines for file URL functions. + * Used by ldif_parse_line. + */ + +/* + * ldif_fileurl2path() convert a file URL to a local path. + * + * If successful, LDIF_FILEURL_SUCCESS is returned and *localpathp is + * set point to an allocated string. If not, an differnet LDIF_FILEURL_ + * error code is returned. + */ +int ldif_fileurl2path( char *fileurl, char **localpathp ); + + +/* + * Convert a local path to a file URL. + * + * If successful, LDIF_FILEURL_SUCCESS is returned and *urlp is + * set point to an allocated string. If not, an different LDIF_FILEURL_ + * error code is returned. At present, the only possible error is + * LDIF_FILEURL_NOMEMORY. + * + */ +int ldif_path2fileurl( char *path, char **urlp ); + + +/* + * Possible return codes for ldif_fileurl2path and ldif_path2fileurl. + */ +#define LDIF_FILEURL_SUCCESS 0 +#define LDIF_FILEURL_NOTAFILEURL 1 +#define LDIF_FILEURL_MISSINGPATH 2 +#define LDIF_FILEURL_NONLOCAL 3 +#define LDIF_FILEURL_NOMEMORY 4 diff --git a/genrb_wrapper.sh b/genrb_wrapper.sh new file mode 100755 index 0000000..694b9ce --- /dev/null +++ b/genrb_wrapper.sh @@ -0,0 +1,44 @@ +#!/bin/sh +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# + +# END COPYRIGHT BLOCK + +# A wrapper for ICU utility genrb on Unix. +# Sets LD_LIBRARY_PATH before invoking the command + +if [ $# -lt 3 ]; then + echo Usage: $0 path_to_icu_bin_dir path_to_icu_lib_dir [ genrb parameters ] + exit 1 +fi + +ICU_BINDIR=$1 +shift +ICU_LIBDIR=$1 +shift + +LD_LIBRARY_PATH=$ICU_LIBDIR:$LD_LIBRARY_PATH + +# HP SHLIB_PATH +SHLIB_PATH=$ICU_LIBDIR:$SHLIB_PATH + +export LD_LIBRARY_PATH SHLIB_PATH +echo $ICU_BINDIR/genrb $@ +exec $ICU_BINDIR/genrb $@ diff --git a/getopt.c b/getopt.c new file mode 100644 index 0000000..4f73d45 --- /dev/null +++ b/getopt.c @@ -0,0 +1,146 @@ +/** --- BEGIN COPYRIGHT BLOCK --- + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + --- END COPYRIGHT BLOCK --- */ +/* + * Copyright (c) 1987 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that: (1) source distributions retain this entire copyright + * notice and comment, and (2) distributions including binaries display + * the following acknowledgement: ``This product includes software + * developed by the University of California, Berkeley and its contributors'' + * in the documentation or other materials provided with the distribution + * and in all advertising materials mentioning features or use of this + * software. Neither the name of the University nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#ifdef _WINDOWS + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)getopt.c 4.12 (Berkeley) 6/1/90"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include +#include +#include "lber.h" +#define index strchr +#define rindex strrchr + +/* + * get option letter from argument vector + */ +int opterr = 1, /* if error message should be printed */ + optind = 1, /* index into parent argv vector */ + optopt; /* character checked for validity */ +char *optarg; /* argument associated with option */ + +#define BADCH (int)'?' +#define EMSG "" + +int getopt(int nargc, char *const *nargv, const char *ostr) +{ + static char *place = EMSG; /* option letter processing */ + register char *oli; /* option letter list index */ + char *p; + + if (!*place) { /* update scanning pointer */ + if (optind >= nargc || *(place = nargv[optind]) != '-') { + place = EMSG; + return(EOF); + } + if (place[1] && *++place == '-') { /* found "--" */ + ++optind; + place = EMSG; + return(EOF); + } + } /* option letter okay? */ + if ((optopt = (int)*place++) == (int)':' || + !(oli = index(ostr, optopt))) { + /* + * if the user didn't specify '-' as an option, + * assume it means EOF. + */ + if (optopt == (int)'-') + return(EOF); + if (!*place) + ++optind; + if (opterr) { + if (!(p = rindex(*nargv, '/'))) + p = *nargv; + else + ++p; + (void)fprintf(stderr, "%s: illegal option -- %c\n", + p, optopt); + } + return(BADCH); + } + if (*++oli != ':') { /* don't need argument */ + optarg = NULL; + if (!*place) + ++optind; + } + else { /* need an argument */ + if (*place) /* no white space */ + optarg = place; + else if (nargc <= ++optind) { /* no arg */ + place = EMSG; + if (!(p = rindex(*nargv, '/'))) + p = *nargv; + else + ++p; + if (opterr) + (void)fprintf(stderr, + "%s: option requires an argument -- %c\n", + p, optopt); + return(BADCH); + } + else /* white space */ + optarg = nargv[optind]; + place = EMSG; + ++optind; + } + return(optopt); /* dump back option letter */ +} + +#endif diff --git a/html/aim-online.gif b/html/aim-online.gif new file mode 100644 index 0000000..b364017 Binary files /dev/null and b/html/aim-online.gif differ diff --git a/html/alert.gif b/html/alert.gif new file mode 100644 index 0000000..ba9c07e Binary files /dev/null and b/html/alert.gif differ diff --git a/html/alert.html b/html/alert.html new file mode 100644 index 0000000..d15c414 --- /dev/null +++ b/html/alert.html @@ -0,0 +1,55 @@ + + + + +<!-- DS_POSTEDVALUE "NAME=TITLE" --> + + + + + + + +
Alert + +
+
+ +
+ diff --git a/html/auth.html b/html/auth.html new file mode 100644 index 0000000..1fee031 --- /dev/null +++ b/html/auth.html @@ -0,0 +1,57 @@ + + + + +Directory Server Gateway: Authenticate + + + + + + + + +<H3>Frames-capable browser required</H3> +Sorry, but in order to use the Directory Server Gateway, you +must use a browser which supports HTML forms and JavaScript, such +as Mozilla Firefox. To learn how to obtain Firefox, visit the +<A HREF="http://www.mozilla.org">Mozilla Home Page</A>. + + diff --git a/html/authroot.html b/html/authroot.html new file mode 100644 index 0000000..19dc0a8 --- /dev/null +++ b/html/authroot.html @@ -0,0 +1,57 @@ + + + + +Directory Server Gateway: Authenticate + + + + + + + +<H3>Frames-capable browser required</H3> +Sorry, but in order to use the Directory Server Gateway, you +must use a browser which supports HTML forms and JavaScript, such +as Mozilla Firefox. To learn how to obtain Firefox, visit the +<A HREF="http://www.mozilla.org">Mozilla Home Page</A>. + + diff --git a/html/authtitle.html b/html/authtitle.html new file mode 100644 index 0000000..6ad0255 --- /dev/null +++ b/html/authtitle.html @@ -0,0 +1,187 @@ + + + +Directory Server + + + + + + + + + +
+ + + + + + + + + + + + + +
+
Directory Server Gateway
+
+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
Standard Search
+
+ + + + + + + + + + + + + + + + +
Advanced Search
+
+ + + + + + + + + + + + + + + + +
New Entry
+
+ + + + + + + + + + + + + + + + + + +
Authentication
+
+ + + + + + + + + + +
+ +
+
+ + diff --git a/html/back1.gif b/html/back1.gif new file mode 100644 index 0000000..7eaf5c4 Binary files /dev/null and b/html/back1.gif differ diff --git a/html/clear.gif b/html/clear.gif new file mode 100644 index 0000000..35d42e8 Binary files /dev/null and b/html/clear.gif differ diff --git a/html/confirm.gif b/html/confirm.gif new file mode 100644 index 0000000..453d1b2 Binary files /dev/null and b/html/confirm.gif differ diff --git a/html/confirm.html b/html/confirm.html new file mode 100644 index 0000000..762f56c --- /dev/null +++ b/html/confirm.html @@ -0,0 +1,61 @@ + + + + + + + + + + +
Confirm + +
+
+ + + +
+ + + +
+ diff --git a/html/content1.gif b/html/content1.gif new file mode 100644 index 0000000..bea2b97 Binary files /dev/null and b/html/content1.gif differ diff --git a/html/country.gif b/html/country.gif new file mode 100644 index 0000000..910c2dc Binary files /dev/null and b/html/country.gif differ diff --git a/html/csearchtitle.html b/html/csearchtitle.html new file mode 100644 index 0000000..e6a09d8 --- /dev/null +++ b/html/csearchtitle.html @@ -0,0 +1,187 @@ + + + +Directory Server + + + + + + + + + +
+ + + + + + + + + + + + + +
+
Directory Server Gateway
+
+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
Standard Search
+
+ + + + + + + + + + + + + + + + + + +
Advanced Search
+
+ + + + + + + + + + + + + + + + +
New Entry
+
+ + + + + + + + + + + + + + + + +
Authentication
+
+ + + + + + + + + + +
+ +
+
+ + diff --git a/html/dc.gif b/html/dc.gif new file mode 100644 index 0000000..6324da4 Binary files /dev/null and b/html/dc.gif differ diff --git a/html/de/adsearch_off.gif b/html/de/adsearch_off.gif new file mode 100644 index 0000000..517952b Binary files /dev/null and b/html/de/adsearch_off.gif differ diff --git a/html/de/adsearch_on.gif b/html/de/adsearch_on.gif new file mode 100644 index 0000000..12ab8de Binary files /dev/null and b/html/de/adsearch_on.gif differ diff --git a/html/de/auth.html b/html/de/auth.html new file mode 100644 index 0000000..4d1e202 --- /dev/null +++ b/html/de/auth.html @@ -0,0 +1,55 @@ + + + + +Netscape Directory Server Gateway: Beglaubigen + + + + + + + + +<H3>Browser muä Rahmen verarbeiten kȸnnen</H3> +Um das Netscape Directory Server Gateway zu verwenden, muä Ihr Browser HTML-Formulare und JavaScript verarbeiten kȸnnen, wie zum Beispiel Netscape Navigator Version 3 oder hȸher. Wie Sie Netscape Navigator bekommen, erfahren Sie auf der <A HREF="http://home.netscape.com">Netscape-Startseite</A>. + + + diff --git a/html/de/authen_off.gif b/html/de/authen_off.gif new file mode 100644 index 0000000..dc9642f Binary files /dev/null and b/html/de/authen_off.gif differ diff --git a/html/de/authen_on.gif b/html/de/authen_on.gif new file mode 100644 index 0000000..bb1525b Binary files /dev/null and b/html/de/authen_on.gif differ diff --git a/html/de/authroot.html b/html/de/authroot.html new file mode 100644 index 0000000..eaca935 --- /dev/null +++ b/html/de/authroot.html @@ -0,0 +1,53 @@ + + + + +Netscape Directory Server Gateway: Beglaubigen + + + + + + + +<H3>Browser muä Rahmen verarbeiten kȸnnen</H3> +Um das Netscape Directory Server Gateway zu verwenden, muä Ihr Browser HTML-Formulare und JavaScript verarbeiten kȸnnen, wie zum Beispiel Netscape Navigator Version 3 oder hȸher. Wie Sie Netscape Navigator bekommen, erfahren Sie auf der <A HREF="http://home.netscape.com">Netscape-Startseite</A>. + + diff --git a/html/de/authtitle.html b/html/de/authtitle.html new file mode 100644 index 0000000..09530ec --- /dev/null +++ b/html/de/authtitle.html @@ -0,0 +1,68 @@ + + + +Netscape Directory Server + + + + +Netscape Directory Server
+ + + + + +StandardsucheErweiterte SucheNeuer EintragBeglaubigung + + + diff --git a/html/de/back.gif b/html/de/back.gif new file mode 100644 index 0000000..024df22 Binary files /dev/null and b/html/de/back.gif differ diff --git a/html/de/back1.gif b/html/de/back1.gif new file mode 100644 index 0000000..a514ef9 Binary files /dev/null and b/html/de/back1.gif differ diff --git a/html/de/content.gif b/html/de/content.gif new file mode 100644 index 0000000..a7eb427 Binary files /dev/null and b/html/de/content.gif differ diff --git a/html/de/content1.gif b/html/de/content1.gif new file mode 100644 index 0000000..e595536 Binary files /dev/null and b/html/de/content1.gif differ diff --git a/html/de/csearchtitle.html b/html/de/csearchtitle.html new file mode 100644 index 0000000..eea0234 --- /dev/null +++ b/html/de/csearchtitle.html @@ -0,0 +1,68 @@ + + + +Netscape Directory Server + + + + +Netscape Directory Server
+ + + + + +StandardsucheErweiterte SucheNeuer EintragBeglaubigung + + + diff --git a/html/de/eduser.html b/html/de/eduser.html new file mode 100644 index 0000000..1ccdd7b --- /dev/null +++ b/html/de/eduser.html @@ -0,0 +1,61 @@ + +Benutzer-Management + + +
+

Benutzer bearbeiten
+ +
+ + + + + +Bearbeiten des Benutzers: + +

+ +

+ + + + +
+
diff --git a/html/de/exit1.gif b/html/de/exit1.gif new file mode 100644 index 0000000..8a9e3c1 Binary files /dev/null and b/html/de/exit1.gif differ diff --git a/html/de/forward1.gif b/html/de/forward1.gif new file mode 100644 index 0000000..5636496 Binary files /dev/null and b/html/de/forward1.gif differ diff --git a/html/de/greeting.html b/html/de/greeting.html new file mode 100644 index 0000000..91203e1 --- /dev/null +++ b/html/de/greeting.html @@ -0,0 +1,95 @@ + + + +Netscape Directory Server + + + +
+
+Netscape Directory Server Gateway +
+

+Mit dieser Schnittstelle können Sie Einträge zur Speicherung im Netscape Directory Server suchen, ändern oder erstellen. +

+Die Schaltflächen oben im Fenster sind bei der Arbeit mit dem Directory Server Gateway ständig verfügbar. Durch Anklicken dieser Schaltflächen können Sie die folgenden Aktionen ausführen lassen: +

+ + + + + + + + + + + + + + + + + +
+Standardsuche + +Die Standardsuche ist die einfachste Möglichkeit zum Durchsuchen des Verzeichnisses. Hierbei wird Ihre Eingabe analysiert und danach automatisch eine oder mehrere passende Verzeichnis-Suchmethoden aktiviert. +
+Erweiterte Suche + +Bei der Erweiterten Suche geben Sie genau ein, was Sie suchen, nach welchem Attribut Sie suchen und welche Art der Übereinstimmung mit den Suchkriterien erforderlich ist. +
+Neuer Eintrag + +Mit "Neuer Eintrag" können Sie neue Einträge im Verzeichnis vornehmen.. Unter Umständen hat der Systemverwalter das Verzeichnis so eingerichtet, daß Sie zum Hinzufügen neuer Einträge eine besondere Berechtigung benötigen. Wenn Sie nicht sicher sind, wenden Sie sich an Ihren Systemverwalter. +
+Beglaubigung + +Mit den Beblaubigungs-Eingabefenstern melden Sie sich im Verzeichnis an und ab. Sie müssen sich beglaubigen lassen, bevor Sie Einträge im dem Verzeichnis ändern und hinzufügen können. Sie müssen sich außerdem je nach Vorgabe des Systemverwalters auch beglaubigen lassen, bevor Sie ein Verzeichnis durchsuchen können. +
+ + + diff --git a/html/de/index.html b/html/de/index.html new file mode 100644 index 0000000..81dedd1 --- /dev/null +++ b/html/de/index.html @@ -0,0 +1,52 @@ + + + +Netscape Directory Server Gateway + + + + + + +<H3>Browser muä Rahmen verarbeiten kȸnnen</H3> +Um das Netscape Directory Server Gateway zu verwenden, muä Ihr Browser HTML-Formulare und JavaScript verarbeiten kȸnnen, wie zum Beispiel Netscape Navigator Version 3 oder hȸher. Wie Sie Netscape Navigator bekommen, erfahren Sie auf der <A HREF="http://home.netscape.com">Netscape-Startseite</A>. + + + diff --git a/html/de/index1.gif b/html/de/index1.gif new file mode 100644 index 0000000..75d0366 Binary files /dev/null and b/html/de/index1.gif differ diff --git a/html/de/maintitle.html b/html/de/maintitle.html new file mode 100644 index 0000000..df1b303 --- /dev/null +++ b/html/de/maintitle.html @@ -0,0 +1,68 @@ + + + +Netscape Directory Server + + + + +Netscape Directory Server
+ + + + + +StandardsucheErweiterte SucheNeuer EintragBeglaubigung + + + diff --git a/html/de/newentry_off.gif b/html/de/newentry_off.gif new file mode 100644 index 0000000..9b30247 Binary files /dev/null and b/html/de/newentry_off.gif differ diff --git a/html/de/newentry_on.gif b/html/de/newentry_on.gif new file mode 100644 index 0000000..2512140 Binary files /dev/null and b/html/de/newentry_on.gif differ diff --git a/html/de/newentrytitle.html b/html/de/newentrytitle.html new file mode 100644 index 0000000..207714a --- /dev/null +++ b/html/de/newentrytitle.html @@ -0,0 +1,68 @@ + + + +Netscape Directory Server + + + + +Netscape Directory Server
+ + + + + +StandardsucheErweiterte SucheNeuer EintragBeglaubigung + + + diff --git a/html/de/searchtitle.html b/html/de/searchtitle.html new file mode 100644 index 0000000..1046fc7 --- /dev/null +++ b/html/de/searchtitle.html @@ -0,0 +1,68 @@ + + + +Netscape Directory Server + + + + +Netscape Directory Server
+ + + + + +StandardsucheErweiterte SucheNeuer EintragBeglaubigung + + + diff --git a/html/de/stsearch_off.gif b/html/de/stsearch_off.gif new file mode 100644 index 0000000..015e1e5 Binary files /dev/null and b/html/de/stsearch_off.gif differ diff --git a/html/de/stsearch_on.gif b/html/de/stsearch_on.gif new file mode 100644 index 0000000..f444659 Binary files /dev/null and b/html/de/stsearch_on.gif differ diff --git a/html/de/title.gif b/html/de/title.gif new file mode 100644 index 0000000..5fca8c9 Binary files /dev/null and b/html/de/title.gif differ diff --git a/html/eduser.html b/html/eduser.html new file mode 100644 index 0000000..7b412b9 --- /dev/null +++ b/html/eduser.html @@ -0,0 +1,62 @@ + +User Management + + +

+

Edit +User
+ +
+ + + + + +Edit the user named: + +

+ +

+ + + + +
+
diff --git a/html/emptyFrame.html b/html/emptyFrame.html new file mode 100644 index 0000000..ca3671b --- /dev/null +++ b/html/emptyFrame.html @@ -0,0 +1,38 @@ + + diff --git a/html/es/adsearch_off.gif b/html/es/adsearch_off.gif new file mode 100644 index 0000000..6a0864b Binary files /dev/null and b/html/es/adsearch_off.gif differ diff --git a/html/es/adsearch_on.gif b/html/es/adsearch_on.gif new file mode 100644 index 0000000..37ec8ad Binary files /dev/null and b/html/es/adsearch_on.gif differ diff --git a/html/es/auth.html b/html/es/auth.html new file mode 100644 index 0000000..604186f --- /dev/null +++ b/html/es/auth.html @@ -0,0 +1,54 @@ + + + + +Pasarela de Netscape Directory Server: Autenticar + + + + + + + + +<H3>Es necesario un navegador que admita marcos</H3> +Lo siento, pero para poder usar la Pasarela de Netscape Directory Server, debe emplear un navegador que admita formularios HTML y JavaScript, como Netscape Navigator versi&oacute;n 3 o posterior. Para conseguir Navigator, visite la <A HREF="http://home.es.netscape.com/es/">P&aacute;gina principal de Netscape</A>. + + diff --git a/html/es/authen_off.gif b/html/es/authen_off.gif new file mode 100644 index 0000000..aa979df Binary files /dev/null and b/html/es/authen_off.gif differ diff --git a/html/es/authen_on.gif b/html/es/authen_on.gif new file mode 100644 index 0000000..862644a Binary files /dev/null and b/html/es/authen_on.gif differ diff --git a/html/es/authroot.html b/html/es/authroot.html new file mode 100644 index 0000000..78dfc38 --- /dev/null +++ b/html/es/authroot.html @@ -0,0 +1,53 @@ + + + + +Pasarela de Netscape Directory Server: Autenticar + + + + + + + +<H3>Es necesario un navegador que admita marcos</H3> +Lo siento, pero para poder usar la Pasarela de Netscape Directory Server, debe emplear un navegador que admita formularios HTML y JavaScript, como Netscape Navigator versi&oacute;n 3 o posterior. Para conseguir Navigator, visite la <A HREF="http://home.es.netscape.com/es/">P&aacute;gina principal de Netscape</A>. + + diff --git a/html/es/authtitle.html b/html/es/authtitle.html new file mode 100644 index 0000000..a58e7a1 --- /dev/null +++ b/html/es/authtitle.html @@ -0,0 +1,68 @@ + + + +Netscape Directory Server + + + + +Netscape Directory Server
+ + + + + +Búsqueda normalBúsqueda avanzadaNueva entradaAutenticación + + + diff --git a/html/es/back1.gif b/html/es/back1.gif new file mode 100644 index 0000000..df7c791 Binary files /dev/null and b/html/es/back1.gif differ diff --git a/html/es/blank.gif b/html/es/blank.gif new file mode 100644 index 0000000..afa7fb8 Binary files /dev/null and b/html/es/blank.gif differ diff --git a/html/es/content1.gif b/html/es/content1.gif new file mode 100644 index 0000000..01e8364 Binary files /dev/null and b/html/es/content1.gif differ diff --git a/html/es/country.gif b/html/es/country.gif new file mode 100644 index 0000000..d64220f Binary files /dev/null and b/html/es/country.gif differ diff --git a/html/es/csearchtitle.html b/html/es/csearchtitle.html new file mode 100644 index 0000000..d9f32a1 --- /dev/null +++ b/html/es/csearchtitle.html @@ -0,0 +1,68 @@ + + + +Netscape Directory Server + + + + +Netscape Directory Server
+ + + + + +Búsqueda normalBúsqueda avanzadaNueva entradaAutenticación + + + diff --git a/html/es/eduser.html b/html/es/eduser.html new file mode 100644 index 0000000..3e50632 --- /dev/null +++ b/html/es/eduser.html @@ -0,0 +1,61 @@ + +Administración de usuarios + + +
+

Modificar usuario
+ +
+ + + + + +Modificar este usuario: + +

+ +

+ + + + +
+
diff --git a/html/es/exit1.gif b/html/es/exit1.gif new file mode 100644 index 0000000..035d4dd Binary files /dev/null and b/html/es/exit1.gif differ diff --git a/html/es/forward1.gif b/html/es/forward1.gif new file mode 100644 index 0000000..34bca12 Binary files /dev/null and b/html/es/forward1.gif differ diff --git a/html/es/greeting.html b/html/es/greeting.html new file mode 100644 index 0000000..f5cd731 --- /dev/null +++ b/html/es/greeting.html @@ -0,0 +1,95 @@ + + + +Netscape Directory Server + + + +
+
+Bienvenido a la Pasarela de Netscape Directory Server +
+

+Mediante esta interfaz puede buscar, modificar y crear entradas que quedan almacenadas en el Netscape Directory Server. +

+Siempre que utilice la Pasarela de Netscape Directory Server dispondrá de la barra de herramientas de la parte superior de esta ventana. Puede hacer clic en los botones para llevar a cabo cualquiera de las siguientes tareas: +

+ + + + + + + + + + + + + + + + + +
+Búsqueda normal + +Con esta función puede buscar fácilmente información del directorio. Esta función examina los datos que haya introducido y selecciona automáticamente uno o varios métodos de búsqueda en el directorio. +
+Búsqueda avanzada + +Con esta función puede especificar exactamente lo que esté buscando, los atributos que desee buscar y el tipo de concordancia que desee aplicar. +
+Nueva entrada + +Con esta función puede crear nuevas entradas en el directorio. Según la configuración de directorio aplicada por el administrador del sistema, deberá disponer de un permiso especial para añadir entradas nuevas. Si no está seguro, consulte al administrador del sistema. +
+Autenticar + +Con esta función puede usar las pantallas de autenticación para entrar y salir del directorio. Debe autenticarse para poder modificar o añadir entradas al directorio. Es posible que también tenga que hacerlo para poder buscar en el directorio si el administrador del sistema lo estableció de ese modo. +
+ + + diff --git a/html/es/group.gif b/html/es/group.gif new file mode 100644 index 0000000..c746e5f Binary files /dev/null and b/html/es/group.gif differ diff --git a/html/es/index.html b/html/es/index.html new file mode 100644 index 0000000..2ef8fdb --- /dev/null +++ b/html/es/index.html @@ -0,0 +1,51 @@ + + + +Pasarela de Netscape Directory Server + + + + + + +<H3>Es necesario un navegador que admita marcos</H3> +Lo siento, pero para poder usar la Pasarela de Netscape Directory Server, debe emplear un navegador que admita formularios HTML y JavaScript, como Netscape Navigator versi&oacute;n 3 o posterior. Para conseguir Navigator, visite la <A HREF="http://home.es.netscape.com/es/">P&aacute;gina principal de Netscape</A>. + + diff --git a/html/es/index1.gif b/html/es/index1.gif new file mode 100644 index 0000000..c19d802 Binary files /dev/null and b/html/es/index1.gif differ diff --git a/html/es/maintitle.html b/html/es/maintitle.html new file mode 100644 index 0000000..b64a4ba --- /dev/null +++ b/html/es/maintitle.html @@ -0,0 +1,68 @@ + + + +Netscape Directory Server + + + + +Netscape Directory Server
+ + + + + +Búsqueda normalBúsqueda avanzadaNueva entradaAutenticación + + + diff --git a/html/es/newentry_off.gif b/html/es/newentry_off.gif new file mode 100644 index 0000000..d973312 Binary files /dev/null and b/html/es/newentry_off.gif differ diff --git a/html/es/newentry_on.gif b/html/es/newentry_on.gif new file mode 100644 index 0000000..27c8058 Binary files /dev/null and b/html/es/newentry_on.gif differ diff --git a/html/es/newentrytitle.html b/html/es/newentrytitle.html new file mode 100644 index 0000000..eb62d64 --- /dev/null +++ b/html/es/newentrytitle.html @@ -0,0 +1,68 @@ + + + +Netscape Directory Server + + + + +Netscape Directory Server
+ + + + + +Búsqueda normalBúsqueda avanzadaNueva entradaAutenticación + + + diff --git a/html/es/organization.gif b/html/es/organization.gif new file mode 100644 index 0000000..2d0b153 Binary files /dev/null and b/html/es/organization.gif differ diff --git a/html/es/orgunit.gif b/html/es/orgunit.gif new file mode 100644 index 0000000..0c8be34 Binary files /dev/null and b/html/es/orgunit.gif differ diff --git a/html/es/person.gif b/html/es/person.gif new file mode 100644 index 0000000..6304481 Binary files /dev/null and b/html/es/person.gif differ diff --git a/html/es/searchtitle.html b/html/es/searchtitle.html new file mode 100644 index 0000000..308346c --- /dev/null +++ b/html/es/searchtitle.html @@ -0,0 +1,68 @@ + + + +Netscape Directory Server + + + + +Netscape Directory Server
+ + + + + +Búsqueda normalBúsqueda avanzadaNueva entradaAutenticación + + + diff --git a/html/es/stsearch_off.gif b/html/es/stsearch_off.gif new file mode 100644 index 0000000..165a8ad Binary files /dev/null and b/html/es/stsearch_off.gif differ diff --git a/html/es/stsearch_on.gif b/html/es/stsearch_on.gif new file mode 100644 index 0000000..13552eb Binary files /dev/null and b/html/es/stsearch_on.gif differ diff --git a/html/es/title.gif b/html/es/title.gif new file mode 100644 index 0000000..11bbaaf Binary files /dev/null and b/html/es/title.gif differ diff --git a/html/exit1.gif b/html/exit1.gif new file mode 100644 index 0000000..56e23fa Binary files /dev/null and b/html/exit1.gif differ diff --git a/html/forward1.gif b/html/forward1.gif new file mode 100644 index 0000000..ad75557 Binary files /dev/null and b/html/forward1.gif differ diff --git a/html/fr/adsearch_off.gif b/html/fr/adsearch_off.gif new file mode 100644 index 0000000..b49ccfe Binary files /dev/null and b/html/fr/adsearch_off.gif differ diff --git a/html/fr/adsearch_on.gif b/html/fr/adsearch_on.gif new file mode 100644 index 0000000..b477d5e Binary files /dev/null and b/html/fr/adsearch_on.gif differ diff --git a/html/fr/auth.html b/html/fr/auth.html new file mode 100644 index 0000000..1b720bb --- /dev/null +++ b/html/fr/auth.html @@ -0,0 +1,55 @@ + + + + +Passerelle Netscape Directory Server : Authentication + + + + + + + + +<H3>Un navigateur supportant la fonction de cadres est requis</H3> +Afin de pouvoir utiliser la passerelle Netscape Directory Server, vous devez utiliser un navigateur compatible avec les formulaires HTML et JavaScript, comme la version 3 ou toute version ult��rieure de Netscape Navigator. Pour savoir comment vous procurer Navigator, consultez la page d'accueil de Netscape �� l'adresse : <A HREF="http://home.netscape.com"> +</A>. + + diff --git a/html/fr/authen_off.gif b/html/fr/authen_off.gif new file mode 100644 index 0000000..8d069b9 Binary files /dev/null and b/html/fr/authen_off.gif differ diff --git a/html/fr/authen_on.gif b/html/fr/authen_on.gif new file mode 100644 index 0000000..80674d2 Binary files /dev/null and b/html/fr/authen_on.gif differ diff --git a/html/fr/authroot.html b/html/fr/authroot.html new file mode 100644 index 0000000..0f857a7 --- /dev/null +++ b/html/fr/authroot.html @@ -0,0 +1,53 @@ + + + + +Passerelle Netscape Directory Server : authentification + + + + + + + +<H3> Un navigateur supportant la fonction de cadres est requis</H3> +Afin de pouvoir utiliser la passerelle Netscape Directory Server, vous devez utiliser un navigateur compatible avec les formulaires HTML et JavaScript, comme la version 3 ou toute version ultȨrieure de Netscape Navigator. Pour savoir comment vous procurer Navigator, consultez la page d'accueil de Netscape �� l'adresse : <A HREF="http://home.netscape.com">la page d'accueil de Netscape</A>. + + diff --git a/html/fr/authtitle.html b/html/fr/authtitle.html new file mode 100644 index 0000000..75ca9ee --- /dev/null +++ b/html/fr/authtitle.html @@ -0,0 +1,68 @@ + + + +Netscape Directory Server + + + + +Netscape Directory Server
+ + + + + +Recherche standardRecherche avancéeNouvelle entréeAuthentification + + + diff --git a/html/fr/back.gif b/html/fr/back.gif new file mode 100644 index 0000000..cc84892 Binary files /dev/null and b/html/fr/back.gif differ diff --git a/html/fr/back1.gif b/html/fr/back1.gif new file mode 100644 index 0000000..ff77612 Binary files /dev/null and b/html/fr/back1.gif differ diff --git a/html/fr/content.gif b/html/fr/content.gif new file mode 100644 index 0000000..b0cd53c Binary files /dev/null and b/html/fr/content.gif differ diff --git a/html/fr/content1.gif b/html/fr/content1.gif new file mode 100644 index 0000000..c54e36b Binary files /dev/null and b/html/fr/content1.gif differ diff --git a/html/fr/csearchtitle.html b/html/fr/csearchtitle.html new file mode 100644 index 0000000..6fc5386 --- /dev/null +++ b/html/fr/csearchtitle.html @@ -0,0 +1,68 @@ + + + +Netscape Directory Server + + + + +Netscape Directory Server
+ + + + + +Recherche standardRecherche avancéeNouvelle entréeAuthentification + + + diff --git a/html/fr/eduser.html b/html/fr/eduser.html new file mode 100644 index 0000000..d674ee8 --- /dev/null +++ b/html/fr/eduser.html @@ -0,0 +1,63 @@ + +Gestion des utilisateurs + + +

+

Modifier l'utilisateur
+ +
+ + + + + +Modifier l'utilisateur nommé : + +

+ +

+ + + + +
+
+ + diff --git a/html/fr/exit1.gif b/html/fr/exit1.gif new file mode 100644 index 0000000..70af2da Binary files /dev/null and b/html/fr/exit1.gif differ diff --git a/html/fr/forward1.gif b/html/fr/forward1.gif new file mode 100644 index 0000000..1b80382 Binary files /dev/null and b/html/fr/forward1.gif differ diff --git a/html/fr/greeting.html b/html/fr/greeting.html new file mode 100644 index 0000000..ca4a478 --- /dev/null +++ b/html/fr/greeting.html @@ -0,0 +1,96 @@ + + + +Netscape Directory Server + + + +
+
+Bienvenue dans la passerelle de Netscape Directory Server. +
+

+Cette interface peut être utilisée pour rechercher, modifier et créer des entrées stockées dans Netscape Directory Server. +

+La barre d'outils qui apparaît dans la partie supérieure de cette fenêtre est toujours affichée lorsque vous utilisez la passerelle Directory Server. Vous pouvez cliquer sur ces boutons pour effectuer les tâches suivantes : +

+ + + + + + + + + + + + + + + + + +
+Recherche standard + +La recherche standard est la manière la plus simple d'effectuer une recherche dans un annuaire. Elle examine les données saisies et sélectionne automatiquement une ou plusieurs méthodes de recherche d'annuaires. +
+Recherche avancée + +Le bouton Recherche avancée vous permet de spécifier votre recherche avec exactitude à l'aide d'options de critères de recherche et de type de correspondance. +
+Nouvelle entrée + +Le bouton Nouvelle entrée vous permet de créer de nouvelles entrées dans l'annuaire. Selon la façon dont l'administrateur système a configuré votre annuaire, vous devez peut-être obtenir de celui-ci le privilège d'ajouter de nouvelles entrées. Dans le doute, consultez votre administrateur système. +
+Authentification + +Les écrans d'authentification vous permettent de vous connecter et de vous déconnecter d'un annuaire. Vous devez vous authentifier avant de modifier ou d'ajouter des entrées à l'annuaire. +
+ + + + diff --git a/html/fr/index.html b/html/fr/index.html new file mode 100644 index 0000000..1d62471 --- /dev/null +++ b/html/fr/index.html @@ -0,0 +1,51 @@ + + + +Passerelle Netscape Directory Server + + + + + + +<H3> Un navigateur supportant la fonction de cadres est requis</H3> +Afin de pouvoir utiliser la passerelle Netscape Directory Server, vous devez utiliser un navigateur compatible avec les formulaires HTML et JavaScript, comme la version 3 ou toute version ultȨrieure de Netscape Navigator. Pour savoir comment vous procurer Navigator, consultez la page d'accueil de Netscape �� l'adresse : <A HREF="http://home.netscape.com">la page d'accueil de Netscape</A>. + + diff --git a/html/fr/index1.gif b/html/fr/index1.gif new file mode 100644 index 0000000..75d0366 Binary files /dev/null and b/html/fr/index1.gif differ diff --git a/html/fr/maintitle.html b/html/fr/maintitle.html new file mode 100644 index 0000000..5944927 --- /dev/null +++ b/html/fr/maintitle.html @@ -0,0 +1,69 @@ + + + +Netscape Directory Server + + + + +Netscape Directory Server
+ + + + + +Recherche standardRecherche avancéeNouvelle entréeAuthentification + + + + diff --git a/html/fr/newentry_off.gif b/html/fr/newentry_off.gif new file mode 100644 index 0000000..d98c6fb Binary files /dev/null and b/html/fr/newentry_off.gif differ diff --git a/html/fr/newentry_on.gif b/html/fr/newentry_on.gif new file mode 100644 index 0000000..25e4b2d Binary files /dev/null and b/html/fr/newentry_on.gif differ diff --git a/html/fr/newentrytitle.html b/html/fr/newentrytitle.html new file mode 100644 index 0000000..9298b6f --- /dev/null +++ b/html/fr/newentrytitle.html @@ -0,0 +1,69 @@ + + + +Netscape Directory Server + + + + +Netscape Directory Server
+ + + + + +Recherche standardRecherche avancéeNouvelle entréeAuthentification + + + + diff --git a/html/fr/searchtitle.html b/html/fr/searchtitle.html new file mode 100644 index 0000000..28a54d3 --- /dev/null +++ b/html/fr/searchtitle.html @@ -0,0 +1,69 @@ + + + +Netscape Directory Server + + + + +Netscape Directory Server
+ + + + + +Recherche standardRecherche avancéeNouvelle entréeAuthentification + + + + diff --git a/html/fr/stsearch_off.gif b/html/fr/stsearch_off.gif new file mode 100644 index 0000000..fce290f Binary files /dev/null and b/html/fr/stsearch_off.gif differ diff --git a/html/fr/stsearch_on.gif b/html/fr/stsearch_on.gif new file mode 100644 index 0000000..8224c0a Binary files /dev/null and b/html/fr/stsearch_on.gif differ diff --git a/html/fr/title.gif b/html/fr/title.gif new file mode 100644 index 0000000..818f6fa Binary files /dev/null and b/html/fr/title.gif differ diff --git a/html/greeting.html b/html/greeting.html new file mode 100644 index 0000000..63c67df --- /dev/null +++ b/html/greeting.html @@ -0,0 +1,120 @@ + + + +Directory Server + + + + + + +

+ + + + + + + + + + + + + + + + +
+You are using the Directory Server Gateway. This interface can be +used to search for, modify, and create entries that are stored in the Fedora Directory Server. +

+You are currently viewing the Standard Search screen, which provides an +easy and convenient way to search the directory. Standard Search +examines what you type and automatically selects one or more methods +for searching the directory. Enter a name, telephone number, user id, +or e-mail address in the Search For field and click the +Search button to quickly locate directory entries. Click the Help +button if you need additional assistance. + +

+The toolbar you see at the top of this window is always available when you +are using the Directory Server Gateway. In addition to Standard Search, +you can click the other buttons to perform a variety of tasks. +If you want to modify your own directory entry, first search for it using +Standard or Advanced Search and then click the Edit Person button +within the entry display. + +

+ + Advanced
Search
+
+With Advanced Search, you can specify exactly what you are looking +for, what attribute you wish to search for, and what type of matching +you wish to allow. + +
+ + New Entry + + +New Entry allows you to create new entries in the directory. Depending +on how the system administrator has set up your directory you may need +to be granted special permission to add new entries. If you are not sure, ask +your system administrator. + +
+ + Authenticate + + +You use the authentication screens to log into and out of the directory. +You need to authenticate before you can modify or add entries to the +directory. You may also need to authenticate before searching the +directory, if your system administrator requires it. +
+ + + diff --git a/html/group.gif b/html/group.gif new file mode 100644 index 0000000..182c717 Binary files /dev/null and b/html/group.gif differ diff --git a/html/index.html b/html/index.html new file mode 100644 index 0000000..0c880c7 --- /dev/null +++ b/html/index.html @@ -0,0 +1,55 @@ + + + +Directory Server Gateway + + + + + + +<H3>Frames-capable browser required</H3> +Sorry, but in order to use the Directory Server Gateway, you +must use a browser which supports HTML forms and JavaScript, such +as Mozilla Firefox. To learn how to obtain Firefox, visit the +<A HREF="http://www.mozilla.org">Mozilla Home Page</A>. + + diff --git a/html/index1.gif b/html/index1.gif new file mode 100644 index 0000000..ed37959 Binary files /dev/null and b/html/index1.gif differ diff --git a/html/ja/adsearch_off.gif b/html/ja/adsearch_off.gif new file mode 100644 index 0000000..da91834 Binary files /dev/null and b/html/ja/adsearch_off.gif differ diff --git a/html/ja/adsearch_on.gif b/html/ja/adsearch_on.gif new file mode 100644 index 0000000..9a2b143 Binary files /dev/null and b/html/ja/adsearch_on.gif differ diff --git a/html/ja/auth.html b/html/ja/auth.html new file mode 100644 index 0000000..0098402 --- /dev/null +++ b/html/ja/auth.html @@ -0,0 +1,54 @@ + + + + +Netscape Directory Server Gateway: Authentication + + + + + + + + +<H3>フレーム機能をサポートするブラウザが必要です</H3> +Netscape Directory Server Gatewayを使用するには、Netscape Navigatorパージョン3以降のようなHTMLフォームとJavaScriptをサポートするブラウザが必要です。Navigatorの入手方法については<A HREF="http://home.netscape.com">Netscapeのホームページ</A>をご覧ください。 + + diff --git a/html/ja/authen_off.gif b/html/ja/authen_off.gif new file mode 100644 index 0000000..9e8570a Binary files /dev/null and b/html/ja/authen_off.gif differ diff --git a/html/ja/authen_on.gif b/html/ja/authen_on.gif new file mode 100644 index 0000000..f2e8616 Binary files /dev/null and b/html/ja/authen_on.gif differ diff --git a/html/ja/authroot.html b/html/ja/authroot.html new file mode 100644 index 0000000..52a0044 --- /dev/null +++ b/html/ja/authroot.html @@ -0,0 +1,54 @@ + + + + +Netscape Directory Server Gateway: 認証 + + + + + + + +<H3>フレーム機能をサポートするブラウザが必要です</H3> +Netscape Directory Server Gatewayを使用するには、Netscape Navigatorパージョン3以降のようなHTMLフォームとJavaScriptをサポートするブラウザが必要です。Navigatorの入手方法については<A HREF="http://home.netscape.com">Netscape +のホームページ</A>をご覧ください。 + + diff --git a/html/ja/authtitle.html b/html/ja/authtitle.html new file mode 100644 index 0000000..e796518 --- /dev/null +++ b/html/ja/authtitle.html @@ -0,0 +1,68 @@ + + + +Netscape Directory Server + + + + +Netscape Directory Server
+ + + + + +標準検索拡張検索新規エントリ認証 + + + diff --git a/html/ja/back.gif b/html/ja/back.gif new file mode 100644 index 0000000..31080b3 Binary files /dev/null and b/html/ja/back.gif differ diff --git a/html/ja/back1.gif b/html/ja/back1.gif new file mode 100644 index 0000000..c63d5be Binary files /dev/null and b/html/ja/back1.gif differ diff --git a/html/ja/content.gif b/html/ja/content.gif new file mode 100644 index 0000000..ca1149f Binary files /dev/null and b/html/ja/content.gif differ diff --git a/html/ja/content1.gif b/html/ja/content1.gif new file mode 100644 index 0000000..fcd29c1 Binary files /dev/null and b/html/ja/content1.gif differ diff --git a/html/ja/csearchtitle.html b/html/ja/csearchtitle.html new file mode 100644 index 0000000..846156a --- /dev/null +++ b/html/ja/csearchtitle.html @@ -0,0 +1,68 @@ + + + +Netscape Directory Server + + + + +Netscape Directory Server
+ + + + + +標準検索拡張検索新規エントリ認証 + + + diff --git a/html/ja/eduser.html b/html/ja/eduser.html new file mode 100644 index 0000000..88d7fee --- /dev/null +++ b/html/ja/eduser.html @@ -0,0 +1,61 @@ + +ユーザ管理 + + +
+

ユーザの編集
+ +
+ + + + + +次の名前のユーザを編集: + +

+ +

+ + + + +
+
diff --git a/html/ja/exit1.gif b/html/ja/exit1.gif new file mode 100644 index 0000000..cd41fa1 Binary files /dev/null and b/html/ja/exit1.gif differ diff --git a/html/ja/forward1.gif b/html/ja/forward1.gif new file mode 100644 index 0000000..873ccc3 Binary files /dev/null and b/html/ja/forward1.gif differ diff --git a/html/ja/greeting.html b/html/ja/greeting.html new file mode 100644 index 0000000..f6ada80 --- /dev/null +++ b/html/ja/greeting.html @@ -0,0 +1,96 @@ + + + +Netscape Directory Server + + + +
+
+Netscape Directory Server Gateway にようこそ +
+

+このインタフェースは、Netscape Directory Server に保存されているエントリの検索、変更、および作成に使用できます。 +

+Directory Server Gateway のご使用中は、このウィンドウ上部のツールバーをいつでもご利用いただけます。 ボタンをクリックすれば以下のタスクを実行できます。 +

+ + + + + + + + + + + + + + + + + +
+標準検索 + +[標準検索]はディレクトリ検索の最も簡単な方法です。 ユーザの入力に基づいて、1つ以上のディレクトリ検索方法が自動的に選択されます。 +
+拡張検索 + +[拡張検索]を使用すると、検索対象、検索属性、および一致タイプを指定できます。 +
+新規エントリ + +[新規エントリ]でディレクトリに新規エントリを作成することができます。 システム管理者によるディレクトリの設定方法によっては、新規エントリを追加するのに特別な許可を持っていなければならないこともあります。 不明の場合は、システム管理者にお尋ねください。 +
+認証 + +ディレクトリにログインまたはログアウトするには認証画面を使用します。 ディレクトリの変更またはエントリの追加を行う前には認証が必要です。 システム管理者が義務付けている場合は、ディレクトリ検索の前にも認証が必要な場合があります。 +
+ + + + diff --git a/html/ja/index.html b/html/ja/index.html new file mode 100644 index 0000000..95c9753 --- /dev/null +++ b/html/ja/index.html @@ -0,0 +1,51 @@ + + + +Netscape Directory Server Gateway + + + + + + +<H3>フレーム機能をサポートするブラウザが必要です</H3> +Netscape Directory Server Gatewayを使用するには、Netscape Navigatorパージョン3以降のようなHTMLフォームとJavaScriptをサポートするブラウザが必要です。Navigatorの入手方法については<A HREF="http://home.netscape.com">Netscapeのホームページ</A>をご覧ください。 + + diff --git a/html/ja/index1.gif b/html/ja/index1.gif new file mode 100644 index 0000000..514f57e Binary files /dev/null and b/html/ja/index1.gif differ diff --git a/html/ja/maintitle.html b/html/ja/maintitle.html new file mode 100644 index 0000000..9db1831 --- /dev/null +++ b/html/ja/maintitle.html @@ -0,0 +1,68 @@ + + + +Netscape Directory Server + + + + +Netscape Directory Server
+ + + + + +標準検索拡張検索新規エントリ認証 + + + diff --git a/html/ja/newentry_off.gif b/html/ja/newentry_off.gif new file mode 100644 index 0000000..cb8553d Binary files /dev/null and b/html/ja/newentry_off.gif differ diff --git a/html/ja/newentry_on.gif b/html/ja/newentry_on.gif new file mode 100644 index 0000000..c8ca450 Binary files /dev/null and b/html/ja/newentry_on.gif differ diff --git a/html/ja/newentrytitle.html b/html/ja/newentrytitle.html new file mode 100644 index 0000000..4fa7775 --- /dev/null +++ b/html/ja/newentrytitle.html @@ -0,0 +1,68 @@ + + + +Netscape Directory Server + + + + +Netscape Directory Server
+ + + + + +標準検索拡張検索新規エントリ認証 + + + diff --git a/html/ja/searchtitle.html b/html/ja/searchtitle.html new file mode 100644 index 0000000..55b1e1e --- /dev/null +++ b/html/ja/searchtitle.html @@ -0,0 +1,68 @@ + + + +Netscape Directory Server + + + + +Netscape Directory Server
+ + + + + +標準検索拡張検索新規エントリ認証 + + + diff --git a/html/ja/stsearch_off.gif b/html/ja/stsearch_off.gif new file mode 100644 index 0000000..4238e2f Binary files /dev/null and b/html/ja/stsearch_off.gif differ diff --git a/html/ja/stsearch_on.gif b/html/ja/stsearch_on.gif new file mode 100644 index 0000000..b1b7786 Binary files /dev/null and b/html/ja/stsearch_on.gif differ diff --git a/html/ja/title.gif b/html/ja/title.gif new file mode 100644 index 0000000..155ae7d Binary files /dev/null and b/html/ja/title.gif differ diff --git a/html/left_bottom.gif b/html/left_bottom.gif new file mode 100644 index 0000000..fa1746c Binary files /dev/null and b/html/left_bottom.gif differ diff --git a/html/left_off.gif b/html/left_off.gif new file mode 100644 index 0000000..ff44de6 Binary files /dev/null and b/html/left_off.gif differ diff --git a/html/left_on.gif b/html/left_on.gif new file mode 100644 index 0000000..b5f0ae4 Binary files /dev/null and b/html/left_on.gif differ diff --git a/html/maintitle.html b/html/maintitle.html new file mode 100644 index 0000000..987c38b --- /dev/null +++ b/html/maintitle.html @@ -0,0 +1,183 @@ + + + +Directory Server + + + + + + + + + +
+ + + + + + + + + + + + + +
+
Directory Server Gateway
+
+ + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
Standard Search
+
+ + + + + + + + + + + + + + + + +
Advanced Search
+
+ + + + + + + + + + + + + + + + +
New Entry
+
+ + + + + + + + + + + + + + + + +
Authentication
+
+ + + + + + + + + + +
+ +
+
+ + diff --git a/html/message.gif b/html/message.gif new file mode 100644 index 0000000..e46c67a Binary files /dev/null and b/html/message.gif differ diff --git a/html/newentrytitle.html b/html/newentrytitle.html new file mode 100644 index 0000000..b8e28a4 --- /dev/null +++ b/html/newentrytitle.html @@ -0,0 +1,187 @@ + + + +Directory Server + + + + + + + + + +
+ + + + + + + + + + + + + +
+
Directory Server Gateway
+
+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
Standard Search
+
+ + + + + + + + + + + + + + + + +
Advanced Search
+
+ + + + + + + + + + + + + + + + + + +
New Entry
+
+ + + + + + + + + + + + + + + + +
Authentication
+
+ + + + + + + + + + +
+ +
+
+ + diff --git a/html/organization.gif b/html/organization.gif new file mode 100644 index 0000000..6324da4 Binary files /dev/null and b/html/organization.gif differ diff --git a/html/orgicon.gif b/html/orgicon.gif new file mode 100644 index 0000000..034f2c2 Binary files /dev/null and b/html/orgicon.gif differ diff --git a/html/orgunit.gif b/html/orgunit.gif new file mode 100644 index 0000000..56b7c59 Binary files /dev/null and b/html/orgunit.gif differ diff --git a/html/person.gif b/html/person.gif new file mode 100644 index 0000000..958547e Binary files /dev/null and b/html/person.gif differ diff --git a/html/right_bottom.gif b/html/right_bottom.gif new file mode 100644 index 0000000..9bf54fa Binary files /dev/null and b/html/right_bottom.gif differ diff --git a/html/right_off.gif b/html/right_off.gif new file mode 100644 index 0000000..b360dbb Binary files /dev/null and b/html/right_off.gif differ diff --git a/html/right_on.gif b/html/right_on.gif new file mode 100644 index 0000000..268a050 Binary files /dev/null and b/html/right_on.gif differ diff --git a/html/rolodex.gif b/html/rolodex.gif new file mode 100644 index 0000000..515c0d2 Binary files /dev/null and b/html/rolodex.gif differ diff --git a/html/searchtitle.html b/html/searchtitle.html new file mode 100644 index 0000000..5f260f1 --- /dev/null +++ b/html/searchtitle.html @@ -0,0 +1,188 @@ + + + +Directory Server + + + + + + + + + +
+ + + + + + + + + + + + + +
+
Directory Server Gateway
+
+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
Standard Search
+
+ + + + + + + + + + + + + + + + +
Advanced Search
+
+ + + + + + + + + + + + + + + + +
New Entry
+
+ + + + + + + + + + + + + + + + +
Authentication
+
+ + + + + + + + + + +
+ +
+
+ + + diff --git a/html/style.css b/html/style.css new file mode 100644 index 0000000..61b8489 --- /dev/null +++ b/html/style.css @@ -0,0 +1,180 @@ +/* --- BEGIN COPYRIGHT BLOCK --- + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + * --- END COPYRIGHT BLOCK --- */ + +/* ======================================================= * + * Style sheet for the Directory Express application * + * ======================================================= */ + +/* All Links */ +A:link {font-family: verdana, Arial, Helvetica, sans-serif; color: #0033cc; font-size: 11px} +A:active {color: #0033cc; font-size: 11px;} +A:visited {color: #0033cc; font-size: 11px;} + +/*All Regular Table Data--for the whole application*/ +body { + background-color: #FFFFFF; + font-family: Verdana, Arial, Helvetica, san-serif; + font-size: 11px; +} + +td { + font-family: verdana, Arial, Helvetica, sans-serif; + font-size: 11px; + color: #000000; + vertical-align : middle; +} + +th { + font-family: verdana, Arial, Helvetica, sans-serif; + font-size: 12px; + font-weight: bold; + color: #ffffff; + vertical-align : middle; + background-color: #666666; +} + + +p { + font-family: verdana, Arial, Helvetica, sans-serif; + font-size: 11px; + color: #000000; +} + + +td.bold { + font-family: verdana, Arial, Helvetica, sans-serif; + font-size: 11px; + vertical-align : middle; + color: #000000; + font-weight: bold; +} + +td.boldbig { + font-family: verdana, Arial, Helvetica, sans-serif; + font-size: 12px; + vertical-align : middle; + color: #000000; + font-weight: bold; +} + +input { + font-family: verdana, Arial, Helvetica, sans-serif; + font-size: 11px; + /*color: #000000;*/ +} + + +A.searchlinknorm:link {color: #CCFFFF} +A.searchlinknorm:visited {color: #CCFFFF} +A.searchlinknorm:active {color: #CCFFFF} + +A.searchlinkspec:link {color: #FF0000} +A.searchlinkspec:visited {color: #FF0000} +A.searchlinkspec:active {color: #CCFFFF} + +/* *********Search frame*************/ + +body.Search { + background-color: #003366; + font-family: Verdana, Arial, Helvetica, san-serif; + color: #ccffff; + font-size: 12px; +} + +td.appName { + font-family: verdana, Arial, Helvetica, sans-serif; + font-size: 16px; + vertical-align : middle; + color: #ffffff; + font-weight: bold; +} + +.apptext { + font-family: verdana, Arial, Helvetica, sans-serif; + font-size: 12px; + vertical-align: middle; + color: #ccffff; +} + +/* Special Links */ +.linknodec {text-decoration:none; color:#000000; font-family: verdana, Arial, Helvetica, sans-serif; font-size: 11px} + +.link3 {color: #ccffff; font-size: 11px;} +.link3:Link {color: #ccffff; font-size: 11px;} +.link3:Active {color: #ccffff; font-size: 11px;} +.link3:Visited {color: #ccffff; font-size: 11px;} +.link3:Hover {color: #ccffff; font-size: 11px;} + +.link6 {color: #dddddd; font-size: 12px; font-weight: bold; text-decoration: none;} +.link6:Link {color: #dddddd; font-size: 12px; font-weight: bold; text-decoration: none;} +.link6:Hover {color: #dddddd; font-size: 12px; font-weight: bold; text-decoration: none;} +.link6:Visited {color: #dddddd; font-size: 12px; font-weight: bold; text-decoration: none;} +.link6:Active {color: #dddddd; font-size: 12px; font-weight: bold; text-decoration: none;} + +.link7 {color: #ffffff; font-size: 12px; font-weight: bold; text-decoration: none;} +.link7:Link {color: #ffffff; font-size: 12px; font-weight: bold; text-decoration: none;} +.link7:Hover {color: #ffffff; font-size: 12px; font-weight: bold; text-decoration: none;} +.link7:Visited {color: #ffffff; font-size: 12px; font-weight: bold; text-decoration: none;} +.link7:Active {color: #ffffff; font-size: 12px; font-weight: bold; text-decoration: none;} + +.link14 {color: #ffffff; font-size: 11px;} +.link14:Link {color: #ffffff; font-size: 11px;} +.link14:Hover {color: #ffffff; font-size: 11px;} +.link14:Visited {color: #ffffff; font-size: 11px;} +.link14:Active {color: #ffffff; font-size: 11px;} + +/* Fonts */ +.text8 {color: #0099cc; font-size: 11px; font-family: Verdana, Arial, Helvetica; font-weight: bold;} +.text15 {color: #ffffff; font-size: 12px; font-family: Verdana, Arial, Helvetica; font-weight: bold;} +.text30 {color: #CCFFFF; font-size: 8px; font-family: Verdana, Arial, Helvetica;} +.text31 {color: #000000; font-size: 14px; font-family: Verdana, Arial, Helvetica; font-weight: bold;} +.text22 {color: #000000; font-size: 11px; font-family: Verdana, Arial, Helvetica;} + +.bgColor1 {background-color: #000000;} +.bgColor4 {background-color: #cccccc;} +.bgColor7 {background-color: #66ccff;} +.bgColor9 {background-color: #666666;} +.bgColor16 {background-color: #0033CC;} + +/* background colors for tabs and tab area */ +.bgAtTab {background-color: #999999;} +.bgAtTabHighlight {background-color: #ffffff;} +.bgRegTab {background-color: #666666;} +.bgRegTabHighlight {background-color: #999999;} +.bgInsideRule {background-color: #66ccff;} +.bgDarkRule {background-color: #000000;} diff --git a/html/transparent.gif b/html/transparent.gif new file mode 100644 index 0000000..afa7fb8 Binary files /dev/null and b/html/transparent.gif differ diff --git a/htmlout.c b/htmlout.c new file mode 100644 index 0000000..4d72971 --- /dev/null +++ b/htmlout.c @@ -0,0 +1,459 @@ +/** --- BEGIN COPYRIGHT BLOCK --- + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + --- END COPYRIGHT BLOCK --- */ +/* + * htmlout.c -- routines to output HTML elements -- HTTP gateway + */ + +#include "dsgw.h" +#include "dbtdsgw.h" + +#define DSGW_POSTEDVARARG_NAME "name" + +static char* +dsgw_change( char *s, dsgwsubst *changes ) +{ + auto dsgwsubst *ch; + if ( changes == NULL ) return s; + for ( ch = changes; ch; ch = ch->dsgwsubst_next ) { + if ( strstr( s, ch->dsgwsubst_from ) ) { + break; + } + } + if ( ch != NULL ) { + auto char *cs = dsgw_ch_strdup( s ); + for ( ch = changes; ch; ch = ch->dsgwsubst_next ) { + auto const size_t from_len = strlen( ch->dsgwsubst_from ); + auto const size_t to_len = strlen( ch->dsgwsubst_to ); + auto const long change_len = to_len - from_len; + auto char *p; + for ( p = cs; (p = strstr( p, ch->dsgwsubst_from )) != NULL; p += to_len ) { + if ( change_len ) { + if ( change_len > 0 ) { /* allocate more space: */ + auto const size_t offset = p - cs; + cs = dsgw_ch_realloc( cs, strlen( cs ) + change_len + 1 ); + p = cs + offset; + } + memmove( p + to_len, p + from_len, strlen( p + from_len ) + 1 ); + } + if ( to_len != 0 ) { + memcpy( p, ch->dsgwsubst_to, to_len ); + } + } + } + return cs; + } + return s; +} + +void +dsgw_HTML_emits( char *s ) +{ + auto char *sc = dsgw_change( s, gc->gc_changeHTML ); + dsgw_emits( sc ); + if ( sc != s ) free( sc ); +} + +void +dsgw_html_begin( char *title, int titleinbody ) +{ + static int header_done = 0; + + if ( !header_done ) { + dsgw_emits( "" ); + dsgw_head_begin(); + dsgw_emits( "\n" ); + if ( title != NULL ) { + dsgw_emitf( "%s\n", title ); + } + dsgw_emitf( "\n\n", dsgw_html_body_colors ); + } else { + dsgw_emits( "\n


\n" ); + } + + if (( title != NULL ) && ( header_done || titleinbody )) { + dsgw_emitf( "
\n" + "
\n" + "%s
\n

\n", title ); + } + + header_done = 1; +} + + +void +dsgw_html_end() +{ + dsgw_emits( "\n" ); + + /* make sure everything has been written to the server before we exit */ + fflush( stdout ); + fflush( stderr ); +} + + +/* + * output a hypertext reference/URL: + * if "urlprefix" != NULL, it is prepended to "url" and "url" is hex-escaped. + * if "urlprefix" == NULL, "url" is assumed to be already escaped as needed. + * + * if "value" != NULL, any occurrence of "--value--" in "url" is replaced by + * a URL-escaped version of the actual value. + * if "value" == NULL, no substitution is done. + * + * if "label" == NULL or is of zero length, the closing ">LABEL" is omitted. + */ +void +dsgw_html_href( char *urlprefix, char *url, char *label, char *value, + char *extra ) +{ + char *escaped_url, *tag = "--value--"; + char *newlabel = NULL; + int freenewlabel; + + if ( urlprefix == NULL ) { + dsgw_emits( "%s\n", newlabel ); + if ( freenewlabel ) { + free( newlabel ); + } + } else { + dsgw_emits( ">\n" ); + } + + if ( escaped_url != NULL ) { + free( escaped_url ); + } +} + + +void +dsgw_substitute_and_output( char *s, char *tag, char *value, int escape ) +{ + char *p, *escval; + + escval = NULL; + + while ( ( p = strstr( s, tag )) != NULL ) { + if ( p > s ) { + dsgw_emitn( stdout, s, p - s ); + } + if ( escape ) { + if ( escval == NULL ) { + escval = dsgw_strdup_escaped( value ); + } + dsgw_emits( escval ); + } else { + dsgw_emits( value ); + } + + s = p + strlen( tag ); + } + + if ( escval != NULL ) { + free( escval ); + } + + if ( *s != '\0' ) { + dsgw_emits( s ); + } +} + + +char * +dsgw_strdup_escaped( const char *s ) +{ + char *p; + + p = dsgw_ch_malloc( 3 * strlen( s ) + 1 ); + *p = '\0'; + dsgw_strcat_escaped( p, s ); + return( p ); +} + + +/* this macro was copied from libldap/tmplout.c */ + +#define HREF_CHAR_ACCEPTABLE( c ) (( c >= '-' && c <= '9' ) || \ + ( c >= '@' && c <= 'Z' ) || \ + ( c == '_' ) || \ + ( c >= 'a' && c <= 'z' )) + +/* this function is copied from libldap/tmplout.c:strcat_escaped */ +void +dsgw_strcat_escaped( char *s1, const char *s2 ) +{ + unsigned char *q; + char *p, *hexdig = "0123456789ABCDEF"; + + p = s1 + strlen( s1 ); + for ( q = (unsigned char *)s2; *q != '\0'; ++q ) { + if ( HREF_CHAR_ACCEPTABLE( *q )) { + *p++ = *q; + } else { + *p++ = '%'; + *p++ = hexdig[ 0x0F & ((*(unsigned char*)q) >> 4) ]; + *p++ = hexdig[ 0x0F & *q ]; + } + } + + *p = '\0'; +} + + +#define DSGW_MAX_ENTITY_LEN 6 /* " */ +static char *specials = "&\"<>"; +static char *entities[] = { "&", """, "<", ">" }; +static int entitylen[] = { 5, 6, 4, 4 }; + +char * +dsgw_strdup_with_entities( char *s, int *madecopyp ) +{ +/* + * If the UTF8 string "s" contains any HTML special characters, make a + * duplicate where the appropriate HTML "entities" have been substituted + * for the special chars. For example, "" will be translated + * to "<mcs@ace.com>". + * + * If "s" does not contain any special characters, it is returned and + * *madecopyp is set to 0. + * Otherwise a malloc'd string is returned and *madecopyp is set to 1. + */ + int spcount, idx; + char *p, *q, *r, *d; + + spcount = 0; + for ( p = s; *p != '\0'; LDAP_UTF8INC( p )) { + if ( ((*p) & 0x80) == 0 && strchr( specials, *p ) != NULL ) { + ++spcount; + } + } + + if ( spcount == 0 ) { + *madecopyp = 0; + return( s ); + } + + d = r = dsgw_ch_malloc( strlen( s ) + 1 + spcount * DSGW_MAX_ENTITY_LEN ); + for ( p = s; *p != '\0'; LDAP_UTF8INC( p )) { + if ( ((*p) & 0x80) == 0 && ( q = strchr( specials, *p )) != NULL ) { + idx = ( q - specials ); + memcpy( r, entities[ idx ], entitylen[ idx ] ); + r += entitylen[ idx ]; + } else { + r += LDAP_UTF8COPY( r, p ); + } + } + *r = '\0'; + + *madecopyp = 1; + return( d ); +} + + +void +dsgw_form_begin( const char* name, const char* format, ... ) +{ + dsgw_emits ("

"); + dsgw_emitf("", context); + dsgw_emitf ("", + (gc->gc_charset && *(gc->gc_charset)) ? gc->gc_charset : ISO_8859_1_ENCODING ); +} + +void +dsgw_emit_cgi_var( int argc, char **argv ) +{ + char *name, *postedvalue; + + if (( name = get_arg_by_name( DSGW_POSTEDVARARG_NAME, argc, argv )) + == NULL ) { + dsgw_emitf( XP_GetClientStr(DBT_missingS_1), DSGW_POSTEDVARARG_NAME ); + } else if (( postedvalue = dsgw_get_cgi_var( name, DSGW_CGIVAR_OPTIONAL )) + != NULL ) { + dsgw_emits( postedvalue ); + } +} + +void +dsgw_emit_button( int argc, char **argv, const char* format, ... ) +{ + auto char *name = get_arg_by_name( DSGW_ARG_BUTTON_NAME, argc, argv ); + auto char *label = get_arg_by_name( DSGW_ARG_BUTTON_LABEL, argc, argv ); + + if ( !label ) label = XP_GetClientStr( DBT_closeWindow_3 ); + + dsgw_emitf( "" ); +} + +void +dsgw_emit_alertForm () +{ + dsgw_form_begin ("alertForm", "action=\"%s\" target=alertWindow", + DSGW_URLPREFIX_MAIN_HTTP "alert.html"); + dsgw_emitf ("", XP_GetClientStr(DBT_alertTitle_)); + dsgw_emits ("" + "
\n"); +} + +void +dsgw_emit_confirmForm () +{ + dsgw_form_begin ("confirmForm", "action=\"%s\" target=confirmWindow", + DSGW_URLPREFIX_MAIN_HTTP "confirm.html"); + dsgw_emitf ("", XP_GetClientStr(DBT_confirmTitle_)); + dsgw_emits ("" + "" + "" + "\n"); +} + +static const char* +defaultWindowOptions = "width=350,height=130,resizable"; + +void +dsgw_emit_alert (const char* frame, const char* windowOptions, const char* format, ...) +{ + if (!windowOptions) windowOptions = defaultWindowOptions; + dsgw_emits (" var aw = window.open("); + dsgw_emits ("''"); +/* dsgw_quote_emits (QUOTATION_JAVASCRIPT, DSGW_URLPREFIX_MAIN_HTTP "emptyFrame.html"); */ + dsgw_emits ( ", 'alertWindow', "); + dsgw_quote_emits (QUOTATION_JAVASCRIPT, windowOptions); + dsgw_emits ( ");\n" + " aw.focus();\n" + " window."); /* Navigator 3 needs this */ + if (frame) dsgw_emitf ("%s.", frame); + dsgw_emits ( "document.alertForm.MSG.value ="); + dsgw_quotation_begin (QUOTATION_JAVASCRIPT); + if (format) { + va_list argl; + va_start (argl, format); + dsgw_emitfv (format, argl); + va_end (argl); + } + dsgw_quotation_end(); + dsgw_emits ( ";\n" + " window."); + if (frame) dsgw_emitf ("%s.", frame); + dsgw_emits ("document.alertForm.submit();\n"); +} + +void +dsgw_emit_confirm (const char* frame, const char* yes, const char* no, + const char* windowOptions, int enquote, const char* format, ...) +{ + if (!windowOptions) windowOptions = defaultWindowOptions; + dsgw_emits (" cw = window.open ('', 'confirmWindow', "); + dsgw_quote_emits (QUOTATION_JAVASCRIPT, windowOptions); + dsgw_emits ( ");\n" + " cw.focus();\n" + " if (cw.opener == null) cw.opener = self;\n" /* Navigator 2 needs this */ + " window."); /* Navigator 3 needs this */ + if (frame) dsgw_emitf ("%s.", frame); + dsgw_emits ( "document.confirmForm.MSG.value = "); + if (enquote) dsgw_quotation_begin (QUOTATION_JAVASCRIPT); + if (format) { + va_list argl; + va_start (argl, format); + dsgw_emitfv (format, argl); + va_end (argl); + } + if (enquote) dsgw_quotation_end(); + dsgw_emits ( ";\n"); + + dsgw_emits (" window."); + if (frame) dsgw_emitf ("%s.", frame); + dsgw_emits ( "document.confirmForm.YES.value = "); + dsgw_quote_emits (QUOTATION_JAVASCRIPT, yes ? yes : ""); + dsgw_emits ( ";\n"); + + dsgw_emits (" window."); + if (frame) dsgw_emitf ("%s.", frame); + dsgw_emits ( "document.confirmForm.NO.value = "); + dsgw_quote_emits (QUOTATION_JAVASCRIPT, no ? no : ""); + dsgw_emits ( ";\n"); + + dsgw_emits (" window."); + if (frame) dsgw_emitf ("%s.", frame); + dsgw_emits ( "document.confirmForm.submit();\n"); +} diff --git a/htmlparse.c b/htmlparse.c new file mode 100644 index 0000000..02a3c97 --- /dev/null +++ b/htmlparse.c @@ -0,0 +1,844 @@ +/** --- BEGIN COPYRIGHT BLOCK --- + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + --- END COPYRIGHT BLOCK --- */ +/* + * htmlparse.c -- routines to parse HTML templates -- HTTP gateway. + * Stolen from libadmin/template.c and libadmin/form_get.c, originally + * by Mike McCool. + */ + +#include +#include +#include +#include +#include "dsgw.h" +#include "dbtdsgw.h" + +extern char *Versionstr; /* from Versiongw.c */ + +/* global variables */ +char *dsgw_last_op_info; /* set in edit.c */ +char *dsgw_dnattr; /* set in edit.c */ +char *dsgw_dndesc; /* set in edit.c */ + +/* + * Save yourself a lot of grief and put a space after the name. + */ + +static struct template_s templates[] = { + {"IF ", "FUNC conditional"}, + {"ELSE ", "FUNC conditional"}, + {"ELIF ", "FUNC conditional"}, + {"ENDIF ", "FUNC conditional"}, + {"TITLE ", "FUNC title"}, + {"BODY ", "FUNC body"}, + {"COLORS ", "FUNC colors"}, + {"PAGEHEADER ", "FUNC pageheader"}, + {"BEGININFO ", "\n" + "" + "
" + "%s
\n"}, + {"ADDINFO ", "
"}, + {"ENDINFO ", "
\n
\n"}, + {"SUBMIT ", "FUNC submit\n"}, + {"BEGINELEM ", "
"},
+  {"ELEM ", "\n%s"},
+  {"ENDELEM ", "
\n"}, + {"ELEMADD ", "%s"}, + {"ELEMDIV ", "\n"}, + {"INDEX ", "%s\n"}, + {"HELPBUTTON", "FUNC helpbutton"}, + {"DIALOGSUBMIT", "FUNC dialogsubmit"}, + {DRCT_DS_LAST_OP_INFO, "FUNC emit_last_op_info"}, + {DRCT_DS_GATEWAY_VERSION, "FUNC emit_version_str"}, + {DRCT_DS_ALERT_NOENTRIES " ", "FUNC emit_alert_noentries"}, + {"ENDHTML", ""}, + {"GCONTEXT ", "context=%s"}, + {"PCONTEXT ", "\n"}, + { NULL, NULL } +}; + +/* global to track output status */ +#define DSGW_PARSE_STATUS_NO_IF_SEEN -1 +#define DSGW_PARSE_STATUS_NO_OUTPUT 0 +#define DSGW_PARSE_STATUS_OUTPUT 1 +static int parse_status = DSGW_PARSE_STATUS_NO_IF_SEEN; + +static int dsgw_get_directive(char *string); +static char **dsgw_get_vars(char *string, int *argc); +static void dsgw_pageheader(int argc, char **argv); +static void dsgw_title(int argc, char **argv); +static void dsgw_body(int argc, char **argv); +static void dsgw_colors(int argc, char **argv); +static void dsgw_submit(int verify, char **vars); +static void dsgw_dialogsubmit(void); +static void dsgw_conditional(char *name, int argc, char **argv, + condfunc conditionalfn, void *condarg); +static int dsgw_condition_true( int argc, char **argv, + condfunc conditionalfn, void *condarg ); +static void emit_last_op_info(int argc, char **argv); +static void emit_version_str( void ); +static void emit_alert_noentries( void ); +static void template_error( char *msg ); + +/* Filter a page. Takes the page to filter as an argument. Uses above + * filters to process. If we encounter a directive we don't know about, + * we set argc and argv, and return -1. The caller is responsible for + * figuring out what to do with the directive and arg vector. + * + * If parseonly is non-zero, this routine will just parse lines that contain + * directives -- nothing will be written to stdout. + */ +int +dsgw_parse_line( +char *line_input, +int *argc, +char ***argv, +int parseonly, +condfunc conditionalfn, +void *condarg +) +{ + register int index; + char *position; + int dirlen = strlen(DIRECTIVE_START); + char **vars; + int func_flag = 0; + + + *argc = 0; + *argv = NULL; + if ( !strncmp( line_input, DIRECTIVE_START, dirlen )) { + position = (char *) ( line_input + dirlen ); + if ( parseonly ) { + index = -1; /* treat all directives as "unknown" */ + } else { + index = dsgw_get_directive( position ); + } + + /* did we get one? */ + if ( index != -1 ) { + /* if so, get the vars. */ + position += strlen( templates[index].name ); + vars = dsgw_get_vars( position, argc ); + /* Dispatch the correct function (done for readability) */ + if ( !strncmp(templates[ index ].format, "FUNC ", 5 )) { + func_flag = 1; + } + + /* Don't check the parse_status for conditionals -RJP */ + if (func_flag == 1 && + !strncmp( templates[index].format+5, "conditional", 11 )) { + dsgw_conditional( templates[index].name, *argc, vars, + conditionalfn, condarg ); + /* But do so for the other directives */ + } else if (func_flag == 1 && parse_status != DSGW_PARSE_STATUS_NO_OUTPUT) { + if ( !strncmp( templates[ index ].format+5, "pageheader",10 )) + dsgw_pageheader( *argc, vars ); + else if ( !strncmp( templates[index].format+5,"title",5)) + dsgw_title( *argc, vars ); + else if ( !strncmp( templates[index].format+5,"body",4)) + dsgw_body( *argc, vars ); + else if ( !strncmp( templates[index].format+5,"colors",6)) + dsgw_colors( *argc, vars ); + else if ( !strncmp( templates[ index ].format+5, "submit",6 )) + dsgw_submit( 0, vars ); + else if ( !strncmp( templates[ index ].format+5, "verify",6 )) + dsgw_submit( 1, vars ); + else if ( !strncmp( templates[index].format+5, + "dialogsubmit",12 )) + dsgw_dialogsubmit(); + else if ( !strncmp( templates[index].format+5, "helpbutton", 10 ) && ( *argc > 0 )) + dsgw_emit_helpbutton( vars[ 0 ] ); + else if ( !strncmp( templates[index].format+5,"emit_last_op_info", 17 )) + emit_last_op_info( *argc, vars ); + else if ( !strncmp( templates[index].format+5, "emit_version_str", 16 )) + emit_version_str(); + else if ( !strncmp( templates[index].format+5, "emit_alert_noentries", 20 )) + emit_alert_noentries(); + else { /* We don't know what this template is. Send it back. */ + *argv = vars; + return -1; + } + /* + * Handle the context case specially, because there is no + * vars generated, yet the format has a %s in it. Handle + * both the GCONTEXT and the PCONTEXT case (GET AND POST) + */ + } else if ( parse_status != DSGW_PARSE_STATUS_NO_OUTPUT && + !strcmp(templates[ index ].name + 1, "CONTEXT ")) { + char line[ BIG_LINE ]; + PR_snprintf( line, sizeof(line), templates[ index ].format, context); + dsgw_emits( line ); + + } else if ( parse_status != DSGW_PARSE_STATUS_NO_OUTPUT ) { + /* I just can't believe there's no easy way to create + * a va_list. */ + char line[ BIG_LINE ]; + PR_snprintf( line, sizeof(line), templates[ index ].format, + ( *argc > 0 && vars[ 0 ] != NULL ) ? vars[ 0 ]: "", + ( *argc > 1 && vars[ 1 ] != NULL ) ? vars[ 1 ]: "", + ( *argc > 2 && vars[ 2 ] != NULL ) ? vars[ 2 ]: "", + ( *argc > 3 && vars[ 3 ] != NULL ) ? vars[ 3 ]: ""); + dsgw_emits( line ); + } + } else if ( parse_status != DSGW_PARSE_STATUS_NO_OUTPUT ) { + /* We found a directive, but we can't identify it. Return non-zero + * value so caller knows to deal with it. + */ + vars = dsgw_get_vars( position, argc ); + *argv = vars; + return -1; + } + } else if ( !parseonly && parse_status != DSGW_PARSE_STATUS_NO_OUTPUT ) { + auto char *gcontext = NULL; + auto char *start_of_newline = (char *) dsgw_ch_strdup(line_input); + auto char *new_line_input = start_of_newline; + + /* We found no directive at the beginning. Look for GCONTEXT + * It could be anywhere in the line. Sorry, but that's the way + * It has to be. - RJP + */ + for (gcontext = strstr(new_line_input, GCONTEXT_DIRECTIVE); + gcontext != NULL; + gcontext = strstr(new_line_input, GCONTEXT_DIRECTIVE)){ + + *gcontext = '\0'; + /* + * Print the new_line_input (everything up to the first + * GCONTEXT_DIRECTIVE + */ + dsgw_HTML_emits( new_line_input ); + + + /*Now print "context=whatever"*/ + dsgw_emitf("context=%s", context); + + /* Now skip past the directive */ + new_line_input = gcontext + strlen(GCONTEXT_DIRECTIVE); + } + + /* If there's anything left, output it*/ + if (*new_line_input) { + dsgw_HTML_emits( new_line_input ); + } + + free ((void*)start_of_newline); + } + + /* If we're here, we either handled it correctly or the line was benign.*/ + return 0; +} + + +FILE * +dsgw_open_html_file(char *filename, int erropts) +{ + FILE *f; + char *tfname = NULL; + + tfname = dsgw_file2path( gc->gc_tmpldir, filename); + if (!(f = fopen(tfname, "r"))) { + /* punt */ + dsgw_error(DSGW_ERR_OPENHTMLFILE, tfname, erropts, 0, NULL ); + } + + free( tfname ); + + return f; +} + + +#define DSGW_INCLUDE_DRCT "\n" + "\n"); + } + + dsgw_emits("
"); + + if(!verify) { + char outstr[256]; + PR_snprintf(outstr, sizeof(outstr), "\n", + XP_GetClientStr(DBT_ok_1)); + dsgw_emits(outstr); + } else { + char outstr[256]; + PR_snprintf(outstr, sizeof(outstr), "\n", + XP_GetClientStr(DBT_ok_2)); + dsgw_emits(outstr); + } + { + char outstr[256]; + PR_snprintf(outstr, sizeof(outstr), "\n", + XP_GetClientStr(DBT_reset_)); + dsgw_emits(outstr); + } + + dsgw_emits("
" + "" + "" + "" + "" + "
\n"); + + dsgw_emits("\n"); + + dsgw_emits("\n"); +} + + +static void +dsgw_dialogsubmit(void) +{ + char outstr[256]; + + dsgw_emits("
"); + + PR_snprintf(outstr, sizeof(outstr), "\n", + XP_GetClientStr(DBT_done_)); + dsgw_emits(outstr); + PR_snprintf(outstr, sizeof(outstr), "\n", + XP_GetClientStr(DBT_cancel_2)); + dsgw_emits(outstr); + + dsgw_emits("
" + "" + "" + "
\n"); + + dsgw_emits("\n"); + + dsgw_emits("\n"); +} + + +static void +dsgw_conditional( char *name, int argc, char **argv, condfunc conditionalfn, + void *condarg ) +{ +#define DSGW_COND_STATUS_NO_COND_SEEN 0 +#define DSGW_COND_STATUS_IN_IF 1 +#define DSGW_COND_STATUS_IN_ELSE 2 +#define DSGW_COND_STATUS_IN_ELIF 3 + + static int cond_status = DSGW_COND_STATUS_NO_COND_SEEN; + static int cond_was_true = 0; + + if ( strncmp( name, "IF", 2 ) == 0 ) { + if ( cond_status != DSGW_COND_STATUS_NO_COND_SEEN ) { + template_error( XP_GetClientStr(DBT_foundAnotherIfNestedIfsAreNotSup_) ); + return; + } + cond_was_true = dsgw_condition_true( argc, argv, conditionalfn, + condarg ); + parse_status = cond_was_true ? DSGW_PARSE_STATUS_OUTPUT + : DSGW_PARSE_STATUS_NO_OUTPUT; + cond_status = DSGW_COND_STATUS_IN_IF; + + } else if ( strncmp( name, "ELSE", 4 ) == 0 ) { + if ( cond_status == DSGW_COND_STATUS_NO_COND_SEEN ) { + template_error( XP_GetClientStr(DBT_foundElseButDidnTSeeAnIf_) ); + return; + } + if ( cond_status == DSGW_COND_STATUS_IN_ELSE ) { + template_error( XP_GetClientStr(DBT_foundElseAfterElseExpectingEndif_) ); + return; + } + parse_status = cond_was_true ? DSGW_PARSE_STATUS_NO_OUTPUT + : DSGW_PARSE_STATUS_OUTPUT; + cond_status = DSGW_COND_STATUS_IN_ELSE; + + } else if ( strncmp( name, "ELIF", 4 ) == 0 ) { + if ( cond_status == DSGW_COND_STATUS_NO_COND_SEEN ) { + template_error( XP_GetClientStr(DBT_foundElifButDidnTSeeAnIf_) ); + return; + } + if ( cond_status == DSGW_COND_STATUS_IN_ELSE ) { + template_error( XP_GetClientStr(DBT_foundElifAfterElseExpectingEndif_) ); + return; + } + + if ( cond_was_true ) { + parse_status = DSGW_PARSE_STATUS_NO_OUTPUT; + } else { + cond_was_true = dsgw_condition_true( argc, argv, conditionalfn, + condarg ); + parse_status = cond_was_true ? DSGW_PARSE_STATUS_OUTPUT + : DSGW_PARSE_STATUS_NO_OUTPUT; + } + cond_status = DSGW_COND_STATUS_IN_ELIF; + + } else if ( strncmp( name, "ENDIF", 5 ) == 0 ) { + if ( cond_status == DSGW_COND_STATUS_NO_COND_SEEN ) { + template_error( XP_GetClientStr(DBT_foundEndifButDidnTSeeAnIf_) ); + } + parse_status = DSGW_PARSE_STATUS_NO_IF_SEEN; + cond_status = DSGW_COND_STATUS_NO_COND_SEEN; + } +} + + +static void +emit_last_op_info( int argc, char **argv ) +{ + char *s; + + if ( dsgw_last_op_info != NULL ) { + if (( s = get_arg_by_name( "prefix", argc, argv )) != NULL ) { + dsgw_emits( s ); + } + + dsgw_emits( dsgw_last_op_info ); + + if (( s = get_arg_by_name( "suffix", argc, argv )) != NULL ) { + dsgw_emits( s ); + } + } +} + + +static void +emit_version_str() +{ + dsgw_emits( Versionstr ); +} + + +static void +emit_alert_noentries() +{ + dsgw_emit_alertForm(); + dsgw_emits( "\n"); +} + + +static void +template_error( char *msg ) +{ + dsgw_emitf( XP_GetClientStr(DBT_BrBTemplateErrorBSBrN_), msg ); +} + + +static int +dsgw_condition_true( int argc, char **argv, condfunc conditionalfn, + void *condarg ) +{ + char *save_argv0; + int rc; + + if ( argc < 1 || conditionalfn == NULL ) { + return( 1 ); /* unknown, but we default to true */ + } + + if ( argv[0][0] == '!' ) { /* NOT */ + save_argv0 = argv[0]; + argv[0] = save_argv0 + 1; + } else { + save_argv0 = NULL; + } + + rc = (*conditionalfn)( argc, argv, condarg ); + + if ( save_argv0 != NULL ) { + argv[0] = save_argv0; + rc = !rc; /* '!' was seen -- reverse the result */ + } + + return( rc ); +} + +static int +dsgw_get_directive( +char *string +) +{ + int index = -1; + register int x; + + for ( x = 0; templates[ x ].name != NULL; x++ ) { + if ( !strncmp( string, templates[ x ].name, + strlen( templates[ x ].name ))) { + index = x; + break; + } + } + return index; +} + +int +dsgw_directive_is(char *target, char *directive) +{ + char *position = (target + strlen(DIRECTIVE_START)); + return(!(strncmp(directive, position, strlen(directive)))); +} + +static char ** +dsgw_get_vars( +char *string, +int *argc +) +{ + char **vars = (char **) NULL; + register int x; + int isvar; + char scratch[BIG_LINE]; + char lastchar, *p; + int numvars = 0; + + isvar = -1; + x = 0; + scratch[0] = '\0'; + lastchar = ' '; + + while ( *string != '\0' ) { + if (( *string == '\"' ) && ( lastchar != '\\' )) { + if ( isvar != -1 ) { + numvars++; + vars = (char **)dsgw_ch_realloc( vars, + ( numvars + 1 ) * sizeof ( char * )); + vars[ numvars - 1 ] = (char *) dsgw_ch_strdup( scratch ); + if (( p = strchr( vars[ numvars - 1 ], '=' )) != NULL ) { + dsgw_form_unescape( p + 1 ); + } + vars[ numvars ] = NULL; + isvar = -1; + } else { + isvar = 0; + } + } else { + if ( isvar != -1 ) { + /* check for scratch overflow */ + if ((strlen(string) + isvar) < sizeof(scratch)) { + isvar += LDAP_UTF8COPY(scratch + isvar, string); + scratch[ isvar ] = '\0'; + } else { + char msg[BUFSIZ]; + /* error - buffer overflow */ + PR_snprintf(msg, sizeof(msg), XP_GetClientStr(DBT_invalidTemplateVarLen), + strlen(string), string); + template_error(msg); + *argc = 0; + return NULL; + } + } else { + if ( *string == DIRECTIVE_END ) { + break; + } + } + } + lastchar = *string; + LDAP_UTF8INC(string); + } + *argc = numvars; + return vars; +} + + + + +/* + * Search the given arg vector for a "tag=value" string where "tag" is + * the same string as "name". If found, return a pointer to the beginning + * of the "value" string. If the value string is missing (e.g. "tag=" + * was given), return a zero-length string. If no matching tag was found, + * return NULL. + */ +char * +get_arg_by_name( char *name, int argc, char **argv ) +{ + int i; + + if (( i = dsgw_get_arg_pos_by_name( name, argc, argv )) >= 0 ) { + return( &argv[ i ][ strlen( name ) + 1 ] ); + } else { + return( NULL ); + } +} + + +int +dsgw_get_arg_pos_by_name( char *name, int argc, char **argv ) +{ + int i; + int nl = strlen( name ); + + for ( i = 0; i < argc; i++ ) { + if ( argv[ i ] != NULL ) { + if ( !strncasecmp( name, argv[ i ], nl )) { + if (( argv[ i ][ nl ] == '=' )) { + return( i ); + } + } + } + } + return( -1 ); +} + + +void +dsgw_argv_free( char **argv ) +{ + char **p; + + if ( argv != NULL ) { + for ( p = argv; *p != NULL; ++p ) { + free( *p ); + } + free( argv ); + } +} + + +savedlines * +dsgw_savelines_alloc() +{ + savedlines *slp; + + slp = dsgw_ch_malloc( sizeof( savedlines )); + memset( slp, 0, sizeof( savedlines )); + return( slp ); +} + + +void +dsgw_savelines_free( savedlines *svlp ) +{ + int i; + + for ( i = 0; i < svlp->svl_count; ++i ) { + free( svlp->svl_line[ i ] ); + } + free( svlp ); +} + + +void +dsgw_savelines_rewind( savedlines *svlp ) +{ + svlp->svl_current = 0; +} + + +void +dsgw_savelines_save( savedlines *svlp, char *line ) +{ + svlp->svl_line = (char **)dsgw_ch_realloc( svlp->svl_line, + (1 + svlp->svl_count ) * sizeof( char * )); + svlp->svl_line[ svlp->svl_count++ ] = dsgw_ch_strdup( line ); +} + + +char * +dsgw_savelines_next( savedlines *svlp ) +{ + char *p; + + if ( svlp->svl_current >= svlp->svl_count ) { + return( NULL ); + } + + p = svlp->svl_line[ svlp->svl_current ]; + ++svlp->svl_current; + + return( p ); +} diff --git a/install-sh b/install-sh new file mode 100755 index 0000000..4d4a951 --- /dev/null +++ b/install-sh @@ -0,0 +1,323 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2005-05-14.22 + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. It can only install one file at a time, a restriction +# shared with many OS's install programs. + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +chmodcmd="$chmodprog 0755" +chowncmd= +chgrpcmd= +stripcmd= +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src= +dst= +dir_arg= +dstarg= +no_target_directory= + +usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: +-c (ignored) +-d create directories instead of installing files. +-g GROUP $chgrpprog installed files to GROUP. +-m MODE $chmodprog installed files to MODE. +-o USER $chownprog installed files to USER. +-s $stripprog installed files. +-t DIRECTORY install into DIRECTORY. +-T report an error if DSTFILE is a directory. +--help display this help and exit. +--version display version info and exit. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG +" + +while test -n "$1"; do + case $1 in + -c) shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + --help) echo "$usage"; exit $?;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -s) stripcmd=$stripprog + shift + continue;; + + -t) dstarg=$2 + shift + shift + continue;; + + -T) no_target_directory=true + shift + continue;; + + --version) echo "$0 $scriptversion"; exit $?;; + + *) # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + test -n "$dir_arg$dstarg" && break + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dstarg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dstarg" + shift # fnord + fi + shift # arg + dstarg=$arg + done + break;; + esac +done + +if test -z "$1"; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call `install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +for src +do + # Protect names starting with `-'. + case $src in + -*) src=./$src ;; + esac + + if test -n "$dir_arg"; then + dst=$src + src= + + if test -d "$dst"; then + mkdircmd=: + chmodcmd= + else + mkdircmd=$mkdirprog + fi + else + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dstarg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + + dst=$dstarg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst ;; + esac + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dstarg: Is a directory" >&2 + exit 1 + fi + dst=$dst/`basename "$src"` + fi + fi + + # This sed command emulates the dirname command. + dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'` + + # Make sure that the destination directory exists. + + # Skip lots of stat calls in the usual case. + if test ! -d "$dstdir"; then + defaultIFS=' + ' + IFS="${IFS-$defaultIFS}" + + oIFS=$IFS + # Some sh's can't handle IFS=/ for some reason. + IFS='%' + set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` + shift + IFS=$oIFS + + pathcomp= + + while test $# -ne 0 ; do + pathcomp=$pathcomp$1 + shift + if test ! -d "$pathcomp"; then + $mkdirprog "$pathcomp" + # mkdir can fail with a `File exist' error in case several + # install-sh are creating the directory concurrently. This + # is OK. + test -d "$pathcomp" || exit + fi + pathcomp=$pathcomp/ + done + fi + + if test -n "$dir_arg"; then + $doit $mkdircmd "$dst" \ + && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } + + else + dstfile=`basename "$dst"` + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + trap '(exit $?); exit' 1 2 13 15 + + # Copy the file name to the temp name. + $doit $cpprog "$src" "$dsttmp" && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && + + # Now rename the file to the real destination. + { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ + || { + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + if test -f "$dstdir/$dstfile"; then + $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ + || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ + || { + echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 + (exit 1); exit 1 + } + else + : + fi + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" + } + } + fi || { (exit 1); exit 1; } +done + +# The final little trick to "correctly" pass the exit status to the exit trap. +{ + (exit 0); exit 0 +} + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/lang.c b/lang.c new file mode 100644 index 0000000..621ea6c --- /dev/null +++ b/lang.c @@ -0,0 +1,289 @@ +/** --- BEGIN COPYRIGHT BLOCK --- + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + --- END COPYRIGHT BLOCK --- */ +/* + * Convert a document from ../html, or redirect the server to it. + */ + +#include "dsgw.h" +#include "dbtdsgw.h" + +#ifdef XP_WIN +#define PATH_SLASH "\\" +#else +#define PATH_SLASH "/" +#endif + +static int +doc_is_UTF_8 (const char* docname) +{ + static const char* suffixes [] = {".html", ".htm", NULL}; + const size_t doclen = strlen (docname); + const char** suf = suffixes; + for (suf = suffixes; *suf; ++suf) { + const size_t suflen = strlen (*suf); + if (doclen >= suflen && !strcasecmp (*suf, docname + doclen - suflen)) { + return 1; + } + } + return 0; +} + +static const char* +skip_prefix (const char* prefix, const char* s) +{ + const size_t prelen = strlen (prefix); + if (!strncmp (prefix, s, prelen)) return s + prelen; + return s; +} + +static int +doc_convert( FILE** fpp, char* stop_at_directive, int erropts ) +{ + char **argv, line[ BIG_LINE ]; + int argc; + + while ( dsgw_next_html_line( *fpp, line )) { + if ( dsgw_parse_line( line, &argc, &argv, 0, dsgw_simple_cond_is_true, + NULL )) { + if ( stop_at_directive != NULL && + dsgw_directive_is( line, stop_at_directive )) { + return( 0 ); + + } else if ( dsgw_directive_is( line, DRCT_HEAD )) { + dsgw_head_begin(); + dsgw_emits ("\n"); + + } else if ( dsgw_directive_is( line, DRCT_DS_POSTEDVALUE )) { + dsgw_emit_cgi_var (argc, argv); + + } else if ( dsgw_directive_is( line, DRCT_DS_CLOSEBUTTON )) { + dsgw_emit_button (argc, argv, "onClick=\"top.close()\""); + + } else if ( dsgw_directive_is( line, "DS_CONFIRM_SCRIPT" )) { + { + auto char* yes = dsgw_get_cgi_var ("YES", DSGW_CGIVAR_OPTIONAL); + auto char* no = dsgw_get_cgi_var ("NO", DSGW_CGIVAR_OPTIONAL); + dsgw_emitf ("\n"); + } + + } else if ( dsgw_directive_is( line, "DS_CONFIRM_BUTTON_OK" )) { + dsgw_emitf ("\n", + XP_GetClientStr(DBT_ok_2)); + + } else if ( dsgw_directive_is( line, "DS_CONFIRM_BUTTON_CANCEL" )) { + dsgw_emitf ("\n", + XP_GetClientStr(DBT_cancel_2)); + + } else { + dsgw_emits (line); + } + } + } + fclose( *fpp ); + *fpp = NULL; + return( 0 ); +} + +int +main( int argc, char *argv[] +#ifdef DSGW_DEBUG + , char *env[] +#endif + ) +{ + /*static char* docdir = ".." PATH_SLASH "html" PATH_SLASH;*/ + static char* docdir = NULL; + static char* helpdir = NULL; + char* docname = NULL; + char* tfname; + int result = 0; + char *qs = NULL; + int manual_file = 0; /* Flag: is the file a documentation file? */ + + /* Parse out the file=blah.html */ + if (( qs = getenv( "QUERY_STRING" )) != NULL && *qs != '\0' ) { + /* parse the query string: */ + auto char *p, *iter = NULL; + qs = dsgw_ch_strdup( qs ); + + for ( p = ldap_utf8strtok_r( qs, "&", &iter ); p != NULL; + p = ldap_utf8strtok_r( NULL, "&", &iter )) { + + /* + * Get the conf file name. It'll be translated + * into /dsgw/context/CONTEXT.conf if + * CONTEXT is all alphanumeric (no slahes, + * or dots). CONTEXT is passed into the cgi. + * if context=CONTEXT is not there, or PATH_INFO + * was used, then use dsgw.conf + */ + if ( !strncasecmp( p, "context=", 8 )) { + context = dsgw_ch_strdup( p + 8 ); + dsgw_form_unescape( context ); + continue; + } + + + /*Get the filename and check it for naughtiness -RJP*/ + if ( !strncasecmp( p, "file=", 5 )) { + + /*If there is no file specified, go with index.html*/ + if (strlen(p) == 5) { + docname = dsgw_ch_strdup("index.html"); + } else { + docname = dsgw_ch_strdup( p + 5 ); + dsgw_form_unescape( docname ); + } + + + /*If we're handling a help page, forgo the filename check*/ + if ( strlen( docname ) > DSGW_MANUALSHORTCUT_LEN && + strncmp( docname, DSGW_MANUALSHORTCUT, + DSGW_MANUALSHORTCUT_LEN ) == 0 ) { + manual_file = 1; + } + + /* + * Make sure the person isn't trying to get + * some file not in the gateway. + */ + if (manual_file == 0 && !dsgw_valid_docname(docname)) { + dsgw_error( DSGW_ERR_BADFILEPATH, docname, + DSGW_ERROPT_EXIT, 0, NULL ); + } + continue; + } + + + } + + free( qs ); qs = NULL; + } + + (void)dsgw_init( argc, argv, DSGW_METHOD_GET | DSGW_METHOD_POST ); + docdir = dsgw_get_docdir(); + + /*If there is no docname, default to index.html*/ + if (docname == NULL) { + docname = dsgw_ch_strdup("index.html"); + } + + if (!strcmp (docname, "/")) { + printf( "Location: %s?context=%s\n\n", + dsgw_getvp( DSGW_CGINUM_SEARCH ), context ); + return( result ); + } else { + char* p; + if (*docname == '/') ++docname; + docname = dsgw_ch_strdup( docname ); + if (( p = strrchr( docname, '&' )) != NULL ) { + *p++ = '\0'; + if ( strncasecmp( p, "info=", 5 ) == 0 ) { + dsgw_last_op_info = dsgw_ch_strdup( p + 5 ); + dsgw_form_unescape( dsgw_last_op_info ); + } + } + } + + if (manual_file) { + /* check filename */ + char *mandocname = dsgw_ch_strdup(docname + DSGW_MANUALSHORTCUT_LEN); + if (*mandocname == '/') { + if (!dsgw_valid_docname(mandocname+1)) { + dsgw_error( DSGW_ERR_BADFILEPATH, mandocname, + DSGW_ERROPT_EXIT, 0, NULL ); + } + } else { + if (!dsgw_valid_docname(mandocname)) { + dsgw_error( DSGW_ERR_BADFILEPATH, mandocname, + DSGW_ERROPT_EXIT, 0, NULL ); + } + } + + helpdir = dsgw_file2path ( DSGW_MANROOT, "slapd/gw/manual/" ); + tfname = (char *)dsgw_ch_malloc( strlen( helpdir ) + + strlen( mandocname ) + + 1 ); + sprintf( tfname, "%s%s", + helpdir, mandocname); + free( helpdir ); + free( mandocname ); + + } else { + tfname = dsgw_file2path (docdir, docname); + } + + if ( ! doc_is_UTF_8 (tfname)) { /* Redirect the Web server: */ + printf ("Location: %s%s%s\n\n", + dsgw_server_url(), gc->gc_gwnametrans, skip_prefix (docdir, tfname)); + /* It's tempting to also redirect if is_UTF_8(gc->gc_charset). + But it would be wrong: the Web server would transmit an + HTTP Content-type with no charset parameter. The header + must include ";charset=UTF-8". So we transmit it: + */ + } else { /* Transmit the document: */ + const int erropts = DSGW_ERROPT_EXIT; + auto FILE* docfile; + + dsgw_send_header(); +#ifdef DSGW_DEBUG + dsgw_logstringarray( "env", env ); +#endif + if ((docfile = fopen(tfname, "r")) == NULL) { + dsgw_error( DSGW_ERR_OPENHTMLFILE, tfname, erropts, 0, NULL ); + return( -1 ); + } + result = doc_convert( &docfile, NULL, erropts ); + } +/* + * XXXmcs: the following free() causes a crash on NT... so don't do it! + */ + + return result; +} diff --git a/ldaputil.c b/ldaputil.c new file mode 100644 index 0000000..27b2d2f --- /dev/null +++ b/ldaputil.c @@ -0,0 +1,1568 @@ +/** --- BEGIN COPYRIGHT BLOCK --- + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + --- END COPYRIGHT BLOCK --- */ +/* + * ldaputil.c -- LDAP utility functions -- HTTP gateway + */ + +#include "dsgw.h" +#include "dbtdsgw.h" +#include "disptmpl.h" +#if XP_WIN32 +#include +#include +#include +#endif +#include +#include "libadminutil/distadm.h" + +static dsgwtmplinfo *init_listdisplay( char *tmplname, unsigned long options ); +static int do_search( dsgwtmplinfo *tip, LDAP *ld, char *base, int scope, + char *filter, LDAPMessage **msgpp ); +static void handle_search_results( dsgwtmplinfo *tip, LDAP *ld, int rc, + LDAPMessage *msgp, unsigned long options ); +static int LDAP_CALL LDAP_CALLBACK + get_rebind_credentials( LDAP *ld, char **whop, char **credp, + int *methodp, int freeit, void *arg ); +static void strcpy_special_undo( char *d, char *s ); +static int entry2htmlwrite( void *fp, char *buf, int len ); +static void emit_one_loc_dn( char *dn, char *friendlyname, char *rootname, + int only_one ); +static char *uid2dn( LDAP *ld, char *uid, char *base, int *ldaprc, + char **lderrtxtp, char **errsp ); +static void return_one_attr( LDAP *ld, LDAPMessage *entry, char *attrtype, + char *mimetype, int valindex ); +static void break_up_one_attr( char *attr, char **attrtypep, char **mimetypep, + int *valindexp ); + +/* binddn and bindpasswd are used in get_rebind_credentials() */ +static char *binddn = NULL, *bindpasswd = NULL; + +/*static CERTCertDBHandle certdbh;*/ +static char * certdbh; + + +/* + * initialize various LDAP library things -- any non-NULL parameters are + * initialized and set. If an error occurs, this function will not + * return at all. + * If an LDAP connection was opened, this function will return either + * DSGW_BOUND_ASUSER if a valid cookie was found in the environment + * and we were able to bind to the directory as that user. If no + * cookie was found, or the cookie would not be used to bind, then + * an anonymous bind is performed and DSGW_BOUND_ANONYMOUS is returned. + * If skipac (skip authentication check) is non-zero, then this + * function will always authenticate as NULL. + * + * If we are configured to use a local LDAP database instead of a real + * directory server, we always do an unauthenticated bind but we return + * DSGW_BOUND_ASUSER. This is done to keep our CGIs that check for a + * return code of DSGW_BOUND_ASUSER happy. + * + * If skipauthwarning is set, then we don't display the javascript + * auth warning for searches. - RJP + */ +int +dsgw_init_ldap( LDAP **ldp, LDAPFiltDesc **lfdpp, int skipac, int skipauthwarning ) +{ + char *path; + char *userid, *dn, *rndstr, *passwd, *cookie, *p; + int ret = 0, optval, limit; +#ifdef XP_WIN32 + WSADATA wsadata; +#endif + + /* LDAP search filters */ + if ( lfdpp != NULL ) { + path = dsgw_file2path( gc->gc_configdir, DSGW_FILTERFILE ); + if (( *lfdpp = ldap_init_getfilter( path )) == NULL ) { + dsgw_error( DSGW_ERR_BADCONFIG, path, DSGW_ERROPT_EXIT, 0, NULL ); + } + free( path ); + ret = 0; + } + +#ifdef XP_WIN32 + + if( ret = WSAStartup(0x0101, &wsadata ) != 0 ) + dsgw_error( DSGW_ERR_WSAINIT, NULL, DSGW_ERROPT_EXIT, 0, NULL ); + +#endif /* XP_WIN32 */ + + /* LDAP connection */ + if ( ldp != NULL ) { + if ( gc == NULL ) { + dsgw_error( DSGW_ERR_INTERNAL, + XP_GetClientStr(DBT_ldapInitLcacheInitAttemptedBefor_), + DSGW_ERROPT_EXIT, 0, NULL ); + } + if ( gc->gc_localdbconf == NULL ) { + /* "Real LDAP server" case */ + if ( gc->gc_ldapssl ) { + if ( gc->gc_securitypath == NULL ) { + dsgw_error( DSGW_ERR_NOSECPATH, NULL, DSGW_ERROPT_EXIT, + 0, NULL ); + } + if ( ldapssl_client_init( gc->gc_securitypath, + &certdbh ) < 0 ) { + dsgw_error( DSGW_ERR_SSLINIT, gc->gc_securitypath, + DSGW_ERROPT_EXIT, 0, NULL ); + } + *ldp = ldapssl_init( gc->gc_ldapserver, gc->gc_ldapport, 1 ); + dsgw_NSSInitializedAlready = 1; + } else { + *ldp = ldap_init( gc->gc_ldapserver, gc->gc_ldapport ); + } + if ( *ldp == NULL ) { + dsgw_error( DSGW_ERR_LDAPINIT, NULL, DSGW_ERROPT_EXIT, 0, + NULL ); + } + + } + rndstr = dn = NULL; + passwd = dsgw_get_cgi_var( "passwd", DSGW_CGIVAR_OPTIONAL ); + + if (( p = dsgw_get_cgi_var( "ldapsizelimit", DSGW_CGIVAR_OPTIONAL )) + != NULL ) { + limit = atoi( p ); + (void) ldap_set_option( *ldp, LDAP_OPT_SIZELIMIT, &limit ); + } + + if (( p = dsgw_get_cgi_var( "ldaptimelimit", DSGW_CGIVAR_OPTIONAL )) + != NULL ) { + limit = atoi( p ); + (void) ldap_set_option( *ldp, LDAP_OPT_TIMELIMIT, &limit ); + } + + /* + * we don't bother with authentication if: + * the "skipac" flag is non-zero OR + * no "passwd" form element was passed in and we are using local db + */ + if ( !skipac && ( passwd != NULL || gc->gc_localdbconf == NULL )) { + /* + * There are several ways in which authentication might + * happen. + */ + if ( gc->gc_admserv ) { + /* + * We're running under the admin server, so ask libadmin + * for the user's credentials. If a password comes as a form + * field, it overrides value we get from admin server + */ + (void)dsgw_get_adm_identity( *ldp, &userid, &dn, + ( passwd == NULL ) ? &passwd : NULL, DSGW_ERROPT_EXIT ); + +#ifdef DSGW_DEBUG + dsgw_log( "dsgw_init_ldap: run under admserv, user id = %s, " + "dn = %s, passwd = %s, skipac = %d, dn = 0x%x\n", + userid == NULL ? "NULL" : userid, + dn == NULL ? "NULL" : dn, + passwd == NULL ? "NULL" : passwd, + skipac, dn ); +#endif + } else { + /* + * Not running under admin server. The DN and password + * might come in as form fields, or the authentication + * might be accomplished via a client-side cookie which + * gets looked up in the gateway's cookie database. + */ + + /* check for dn/binddn in request */ + if ( passwd != NULL ) { + if (( dn = dsgw_get_escaped_cgi_var( "escapedbinddn", + "binddn", DSGW_CGIVAR_OPTIONAL )) == NULL && + ( dn = dsgw_get_cgi_var( "dn", + DSGW_CGIVAR_OPTIONAL )) == NULL ) { + free( passwd ); + passwd = NULL; + } else { + /* got DN: undo extra level of escaping */ + dsgw_form_unescape( dn ); + } + } + + if ( passwd == NULL ) { + /* Check for a valid authentication cookie */ + cookie = dsgw_get_auth_cookie(); + if ( cookie != NULL ) { + if ( dsgw_parse_cookie( cookie, &rndstr, &dn ) == 0 ) { + int ckrc; + if (( ckrc = dsgw_ckdn2passwd( rndstr, dn, + &passwd )) != 0 ) { + + passwd = NULL; + dn = NULL; + /* + * Delete the cookie and print out the error message. + * dn2passwd_error() returns 1 if the CGI should exit, + * 0 if it should continue. + */ + if (dsgw_dn2passwd_error( ckrc, skipauthwarning )) { + exit( 0 ); + } + + } + } + } + + if ( rndstr != NULL ) { + free( rndstr ); + } + if ( cookie != NULL ) { + free( cookie ); + } + } + } + } + + /* + * try to use LDAP version 3 but fall back to v2 if bind fails + */ + optval = LDAP_VERSION3; + (void)ldap_set_option( *ldp, LDAP_OPT_PROTOCOL_VERSION, &optval ); + + /* + * If everything above failed to set the dn/password, then use + * the binddn and bindpw, if any. + */ + if (dn == NULL && passwd == NULL && + strlen(gc->gc_binddn) > 0 && strlen(gc->gc_bindpw) > 0) { + dn = dsgw_ch_strdup(gc->gc_binddn); + passwd = dsgw_ch_strdup(gc->gc_bindpw); + } + + if (( ret = ldap_simple_bind_s( *ldp, dn, passwd )) + == LDAP_PROTOCOL_ERROR ) { + optval = LDAP_VERSION2; + (void)ldap_set_option( *ldp, LDAP_OPT_PROTOCOL_VERSION, + &optval ); + ret = ldap_simple_bind_s( *ldp, dn, passwd ); + } + + if ( ret != LDAP_SUCCESS ){ + dsgw_ldap_error( *ldp, DSGW_ERROPT_DURINGBIND ); + + /* Display back button */ + dsgw_form_begin( NULL, NULL ); + dsgw_emits( "\n
\n" ); + dsgw_emits( "
\n" ); + dsgw_emitf( "\n", + XP_GetClientStr(DBT_goBack_) ); + dsgw_emits( "\n
\n" ); + exit(0); + } + + if (( dn != NULL ) && ( passwd != NULL )) { + ret = DSGW_BOUND_ASUSER; + binddn = dn; + bindpasswd = passwd; + ldap_set_rebind_proc( *ldp, get_rebind_credentials, NULL ); + } else if ( gc->gc_localdbconf != NULL ) { + ret = DSGW_BOUND_ASUSER; /* a small, harmless lie */ + } else { + ret = DSGW_BOUND_ANONYMOUS; + } + + } + return ret; +} + + +/* + * get user identity from the admin. server (if running under it) + * if uidp is non-NULL, it is set to point to user's login id. + * if dnp is non-NULL, it is set to point to user's DN. + * if pwdp is non-NULL, it is set to point to user's password. + * Returns: 0 if all goes well, -1 if an error occurs. + * + * Note that ld is used only if dnp != NULL, and then only if the admin server + * returns NULL when asked for the DN. + */ +int +dsgw_get_adm_identity( LDAP *ld, char **uidp, char **dnp, char **pwdp, + int erropts ) +{ + int rc, need_to_get_dn; + char *uid; + static int adm_inited = 0; + + if ( !gc->gc_admserv ) { + dsgw_error( DSGW_ERR_ADMSERV_CREDFAIL, + XP_GetClientStr(DBT_notRunningUnderTheAdministration_), + erropts, 0, NULL ); + return( -1 ); + } + + if ( !adm_inited ) { + if ( ADM_InitializePermissions( &rc ) < 0 ) { + dsgw_error( DSGW_ERR_ADMSERV_CREDFAIL, + XP_GetClientStr(DBT_couldNotInitializePermissions_), + erropts, 0, NULL ); + return( -1 ); + } + adm_inited = 1; + } + + need_to_get_dn = ( dnp != NULL ); + + if ( need_to_get_dn && ADM_GetUserDNString( &rc, dnp ) < 0 ) { + dsgw_error( DSGW_ERR_ADMSERV_CREDFAIL, + XP_GetClientStr(DBT_couldNotMapUsernameToADnErrorFro_), + erropts, 0, NULL ); + return( -1 ); + } + + /* + * get userid if: + * 1. requested by caller (uidp != NULL) + * or 2. DN was requested but Admin Server didn't return the DN + */ + if (( uidp != NULL || ( need_to_get_dn && *dnp == NULL )) && + ( ADM_GetCurrentUsername( &rc, &uid ) < 0 || uid == NULL )) { + dsgw_error( DSGW_ERR_ADMSERV_CREDFAIL, + XP_GetClientStr(DBT_couldNotGetCurrentUsername_), erropts, + 0, NULL ); + return( -1 ); + } + + if ( uidp != NULL ) { + *uidp = uid; + } + + if ( need_to_get_dn && *dnp == NULL ) { + /* + * try to map userid to DN using LDAP search + */ + int lderr; + char *errstr, *lderrtxt; + + if (( *dnp = uid2dn( ld, uid, gc->gc_ldapsearchbase, &lderr, + &lderrtxt, &errstr )) == NULL ) { + dsgw_error( DSGW_ERR_ADMSERV_CREDFAIL, errstr, erropts, lderr, + lderrtxt ); + return( -1 ); + } + } + + if ( pwdp != NULL && ADM_GetCurrentPassword( &rc, pwdp ) < 0 ) { + dsgw_error( DSGW_ERR_ADMSERV_CREDFAIL, + XP_GetClientStr(DBT_couldNotGetCurrentUserPassword_), erropts, + 0, NULL ); + return( -1 ); + } + + return( 0 ); +} + + +void +dsgw_ldap_error( LDAP *ld, int erropts ) +{ + int lderr; + char *lderrtxt = NULL; + + lderr = ldap_get_lderrno( ld, NULL, &lderrtxt ); + dsgw_error( DSGW_ERR_LDAPGENERAL, dsgw_ldaperr2string( lderr ), + erropts, lderr, lderrtxt ); +} + + +struct ldap_searchobj * +dsgw_type2searchobj( struct ldap_searchobj *solistp, char *type ) +{ + struct ldap_searchobj *sop; + + for ( sop = ldap_first_searchobj( solistp ); sop != NULL; + sop = ldap_next_searchobj( solistp, sop )) { + if ( strcasecmp( type, sop->so_objtypeprompt ) == 0 ) { + return( sop ); + } + } + + return( NULL ); +} + + +struct ldap_searchattr * +dsgw_label2searchattr( struct ldap_searchobj *sop, char *label ) +{ + struct ldap_searchattr *sap; + + for ( sap = sop->so_salist; sap != NULL; sap = sap->sa_next ) { + if ( strcasecmp( label, sap->sa_attrlabel ) == 0 ) { + return( sap ); + } + } + + return( NULL ); +} + + +struct ldap_searchmatch * +dsgw_prompt2searchmatch( struct ldap_searchobj *sop, char *prompt ) +{ + struct ldap_searchmatch *smp; + + for ( smp = sop->so_smlist; smp != NULL; smp = smp->sm_next ) { + if ( strcasecmp( prompt, smp->sm_matchprompt ) == 0 ) { + return( smp ); + } + } + + return( NULL ); +} + + +static dsgwtmplinfo * +init_listdisplay( char *tmplname, unsigned long options ) +{ + char *s; + + if (( s = dsgw_get_cgi_var( "listtemplate", DSGW_CGIVAR_OPTIONAL )) + != NULL ) { + tmplname = s; + } + + return( dsgw_display_init( DSGW_TMPLTYPE_LIST, tmplname, options )); +} + + +void +dsgw_smart_search( LDAP *ld, struct ldap_searchobj *sop, LDAPFiltDesc *lfdp, + char *base, char *value, unsigned long options ) +{ + int rc; + LDAPFiltInfo *lfip; + dsgwtmplinfo *tip; + LDAPMessage *msgp; + + ldap_setfilteraffixes( lfdp, sop->so_filterprefix, NULL ); + tip = init_listdisplay( sop->so_objtypeprompt, options ); + + if (( lfip = ldap_getfirstfilter( lfdp, sop->so_filtertag, value )) + == NULL ) { + dsgw_error( DSGW_ERR_NOFILTERS, sop->so_objtypeprompt, + DSGW_ERROPT_EXIT, 0, NULL ); + } + + for ( ; lfip != NULL; lfip = ldap_getnextfilter( lfdp )) { + dsgw_set_searchdesc( tip, NULL, lfip->lfi_desc, value ); + + rc = do_search( tip, ld, base, sop->so_defaultscope, lfip->lfi_filter, + &msgp ); + + if ( rc != LDAP_SUCCESS || + ( msgp != NULL && ldap_count_entries( ld, msgp ) > 0 )) { + if ( strstr( lfip->lfi_filter, "~=" ) != NULL ) { + /* always list if approximate filter used to find entry */ + options |= DSGW_DISPLAY_OPT_LIST_IF_ONE; + } + break; /* error or got some entries: stop searching */ + } + } + + handle_search_results( tip, ld, rc, msgp, options ); +} + + +void +dsgw_pattern_search( LDAP *ld, char *listtmpl, + char *searchdesc2, char *searchdesc3, char *searchdesc4, + char *filtpattern, char *filtprefix, char *filtsuffix, char *attr, + char *base, int scope, char *value, unsigned long options ) +{ + char buf[ 4096 ]; + int rc; + dsgwtmplinfo *tip; + LDAPMessage *msgp; + + tip = init_listdisplay( listtmpl, options ); + + ldap_build_filter( buf, sizeof( buf ), filtpattern, + filtprefix, filtsuffix, attr, value, NULL ); + + dsgw_set_searchdesc( tip, searchdesc2, searchdesc3, searchdesc4 ); + + rc = do_search( tip, ld, base, scope, buf, &msgp ); + handle_search_results( tip, ld, rc, msgp, options ); +} + + +/* + * Perform URL-based search. + * Note that if "ld" is NULL, this routine sets gc->gc_ldapserver and + * gc->gc_ldapport globals itself, calls dsgw_init_ldap(), and then does + * the URL-based search. If "ld" is not NULL, no initialization is done + * here. + */ +void +dsgw_ldapurl_search( LDAP *ld, char *ldapurl ) +{ + int rc, ec, saveport, did_init_ldap; + LDAPMessage *msgp; + LDAPURLDesc *ludp; + char *saveserver; + unsigned long no_options = 0; + int one_attr = 0; + + if (( rc = ldap_url_parse( ldapurl, &ludp )) != 0 ) { + switch ( rc ) { + case LDAP_URL_ERR_NODN: + ec = DSGW_ERR_LDAPURL_NODN; + break; + case LDAP_URL_ERR_BADSCOPE: + ec = DSGW_ERR_LDAPURL_BADSCOPE; + break; + case LDAP_URL_ERR_MEM: + ec = DSGW_ERR_NOMEMORY; + break; + case LDAP_URL_ERR_NOTLDAP: + default: + ec = DSGW_ERR_LDAPURL_NOTLDAP; + break; + } + dsgw_error( ec, ldapurl, DSGW_ERROPT_EXIT, 0, NULL ); + } + + if ( ld == NULL ) { + saveserver = gc->gc_ldapserver; + gc->gc_ldapserver = ludp->lud_host; + saveport = gc->gc_ldapport; + gc->gc_ldapport = ludp->lud_port; + one_attr = ( ludp->lud_attrs != NULL && ludp->lud_attrs[ 0 ] != NULL && ludp->lud_attrs[ 1 ] == NULL ); + (void)dsgw_init_ldap( &ld, NULL, 0, one_attr ); + did_init_ldap = 1; + } else { + did_init_ldap = 0; + } + + /* XXX a bit of a hack: if it looks like only a DN was included, we + * assume that a read of the entry is desired. + */ + if ( ludp->lud_scope == LDAP_SCOPE_BASE && strcasecmp( ludp->lud_filter, + "(objectClass=*)" ) == 0 ) { + dsgw_read_entry( ld, ludp->lud_dn, NULL, NULL, ludp->lud_attrs, + no_options ); + } else { + dsgwtmplinfo *tip; + + dsgw_send_header(); + tip = init_listdisplay( "urlsearch", no_options ); + dsgw_set_searchdesc( tip, NULL, XP_GetClientStr(DBT_theLDAPFilterIs_), ldapurl ); + rc = do_search( tip, ld, ludp->lud_dn, ludp->lud_scope, + ludp->lud_filter, &msgp ); + handle_search_results( tip, ld, rc, msgp, no_options ); + } + + if ( did_init_ldap ) { + ldap_unbind( ld ); + gc->gc_ldapserver = saveserver; + gc->gc_ldapport = saveport; + } +} + + +/* + * do the actual search over LDAP. Return an LDAP error code. + */ +static int +do_search( dsgwtmplinfo *tip, LDAP *ld, char *base, int scope, char *filter, + LDAPMessage **msgpp ) +{ + char **attrlist, *attrs[ 3 ]; + + *msgpp = NULL; + + if ( tip == NULL || tip->dsti_attrs == NULL ) { + attrs[ 0 ] = DSGW_ATTRTYPE_OBJECTCLASS; + if ( tip != NULL && tip->dsti_sortbyattr != NULL ) { + attrs[ 1 ] = tip->dsti_sortbyattr; + attrs[ 2 ] = NULL; + } else { + attrs[ 1 ] = NULL; + } + attrlist = attrs; + } else { + attrlist = tip->dsti_attrs; + } +#ifdef DSGW_DEBUG + dsgw_log ("ldap_search_s(ld,\"%s\",%i,\"%s\")\n", base, scope, filter); +#endif + return( ldap_search_s( ld, base, scope, filter, attrlist, 0, msgpp )); +} + + +static int +is_subtype( const char *sub, const char *sup ) +{ + auto const size_t subLen = strlen( sub ); + auto const size_t supLen = strlen( sup ); + if ( subLen < supLen ) return 0; + if ( subLen == supLen ) return !strcasecmp( sub, sup ); + if ( sub[supLen] != ';' ) return 0; + return !strncasecmp( sub, sup, strlen( sup )); +} + +static const struct berval* LDAP_C LDAP_CALLBACK +dsgw_keygen( void *arg, LDAP *ld, LDAPMessage *entry ) +{ + auto const char* sortbyattr = (char*)arg; + auto struct berval* result = NULL; + + if (sortbyattr == NULL) { /* sort by DN */ + auto char* DN = ldap_get_dn( ld, entry ); + if (DN) { + result = dsgw_strkeygen( CASE_INSENSITIVE, DN ); + ldap_memfree( DN ); + } + } else { + auto char* attr; + auto BerElement *ber; + for (attr = ldap_first_attribute( ld, entry, &ber ); attr != NULL; + attr = ldap_next_attribute ( ld, entry, ber ) ) { + auto char **vals; + if ( is_subtype( attr, sortbyattr ) && + NULL != ( vals = ldap_get_values( ld, entry, attr ))) { + auto size_t i; + for ( i = 0; vals[i] != NULL; ++i ) { + auto struct berval* key = dsgw_strkeygen( CASE_INSENSITIVE, vals[i] ); + if ( result == NULL || dsgw_keycmp( NULL, key, result ) < 0 ) { + auto struct berval* tmp = result; + result = key; + key = tmp; +#ifdef DSGW_DEBUG + { + auto char* ev = dsgw_strdup_escaped( vals[i] ); + auto char* DN = ldap_get_dn( ld, entry ); + dsgw_log( "dsgw_keygen(%s,%s) %p %s\n", sortbyattr, DN, (void*)result, ev ); + ldap_memfree( DN ); + free( ev ); + } +#endif + } + if ( key != NULL ) { + dsgw_keyfree( arg, key ); + } + } + ldap_value_free( vals ); + } + ldap_memfree( attr ); + } + if ( ber != NULL ) { + ldap_ber_free( ber, 0 ); + } + } + return result ? result : /* no such attribute */ dsgw_key_last; +} + +static void +handle_search_results( dsgwtmplinfo *tip, LDAP *ld, int rc, LDAPMessage *msgp, + unsigned long options ) +{ + int count; + LDAPMessage *entry; + char *dn, *errortext, *lderrtxt, **ocvals; + + count = ( msgp == NULL ) ? 0 : ldap_count_entries( ld, msgp ); + if ( rc == LDAP_SUCCESS ) { + errortext = NULL; + lderrtxt = NULL; + } else { + errortext = dsgw_ldaperr2string( rc ); + (void)ldap_get_lderrno( ld, NULL, &lderrtxt ); + } + dsgw_set_search_result( tip, count, errortext, lderrtxt ); + + if ( count > 0 ) { + entry = ldap_first_entry( ld, msgp ); + + if ( count == 1 && ( options & DSGW_DISPLAY_OPT_LIST_IF_ONE ) == 0 ) { + /* found exactly one entry: read and display it */ + dn = ldap_get_dn( ld, entry ); + ocvals = ldap_get_values( ld, entry, DSGW_ATTRTYPE_OBJECTCLASS ); + ldap_msgfree( msgp ); + + dsgw_read_entry( ld, dn, ocvals, NULL, NULL, options ); + + if ( ocvals != NULL ) { + ldap_value_free( ocvals ); + } + return; + } + + /* list entries */ +#ifdef DSGW_DEBUG + dsgw_log( "handle_search_results: sort entries by %s\n", + tip->dsti_sortbyattr ? tip->dsti_sortbyattr : "DN" ); +#endif + ldap_keysort_entries( ld, &msgp, tip->dsti_sortbyattr, + dsgw_keygen, dsgw_keycmp, dsgw_keyfree ); + for ( entry = ldap_first_entry( ld, msgp ); entry != NULL; + entry = ldap_next_entry( ld, entry )) { + dsgw_display_entry( tip, ld, entry, NULL, NULL ); + } + if ( options & DSGW_DISPLAY_OPT_DNLIST_JS ) { + int i; + char *edn, *js0, *js1; + char **xdn; + char **sn; + + dsgw_emits( "\n" ); + } + ldap_msgfree( msgp ); + } else { + /* Count <= 0 */ + if ( options & DSGW_DISPLAY_OPT_DNLIST_JS ) { + dsgw_emitf( "\n" ); + } + } + + dsgw_display_done( tip ); +} + + +/* + * read and display a single entry. If ocvals is non-NULL, it should + * contain the list of objectClass values for this entry. + */ +void +dsgw_read_entry( LDAP *ld, char *dn, char **ocvals, char *tmplname, + char **attrs, unsigned long options ) +{ + int rc, one_attr, freeocvals, valindex; + char *tmpattr, *attr0, *mimetype; + LDAPMessage *msgp, *entry, *aomsgp, *aoentry; + dsgwtmpl *tmpl; + dsgwtmplinfo *tip; + + if (( options & DSGW_DISPLAY_OPT_AUTH ) != 0 ) { + /* + * XXX hack -- if we are trying to authenticate, we don't generate an + * entry display at all. Instead, we generate an authenticate form. + */ + dsgw_send_header(); + dsgw_emit_auth_form( dn ); + return; + } + + one_attr = ( attrs != NULL && attrs[ 0 ] != NULL && attrs[ 1 ] == NULL ); + if ( one_attr ) { + break_up_one_attr( attrs[ 0 ], &tmpattr, &mimetype, &valindex ); + if ( strcasecmp( tmpattr, "_vcard" ) == 0 ) { /* VCards are special */ + dsgw_vcard_from_entry( ld, dn, mimetype ); + return; + } + attr0 = attrs[ 0 ]; /* replace first & only attr. */ + attrs[ 0 ] = tmpattr; + } else { + attr0 = NULL; + } + + if ( tmplname == NULL && ( tmplname = dsgw_get_cgi_var( "displaytemplate", + DSGW_CGIVAR_OPTIONAL )) == NULL && attrs == NULL ) { + /* determine what display template to use based on objectClass values */ + freeocvals = 0; + if ( ocvals == NULL ) { /* read entry to get objectClasses */ + char *attrs[ 2 ]; + + attrs[ 0 ] = DSGW_ATTRTYPE_OBJECTCLASS; + attrs[ 1 ] = NULL; + + if (( rc = ldap_search_s( ld, dn, LDAP_SCOPE_BASE, "objectClass=*", + attrs, 0, &msgp )) != LDAP_SUCCESS || + ( entry = ldap_first_entry( ld, msgp )) == NULL ) { + dsgw_ldap_error( ld, DSGW_ERROPT_EXIT ); + } + ocvals = ldap_get_values( ld, msgp, DSGW_ATTRTYPE_OBJECTCLASS ); + freeocvals = 1; + ldap_msgfree( msgp ); + } + + + if ( ocvals == NULL || ( tmpl = dsgw_oc2template( ocvals )) == NULL ) { + tmplname = NULL; + } else { + tmplname = tmpl->dstmpl_name; + } + + if ( freeocvals ) { + ldap_value_free( ocvals ); + } + } + + if ( tmplname == NULL ) { + tip = NULL; + + if ( !one_attr ) { + char *title; + + if (( title = ldap_dn2ufn( dn )) == NULL ) { + title = dn; + } + dsgw_send_header(); + dsgw_html_begin( title, 1 ); + dsgw_emitf( "\n%s\n\n", + XP_GetClientStr(DBT_noteThereIsNoDisplayTemplateForT_) ); + } + + } else if (( tip = dsgw_display_init( DSGW_TMPLTYPE_DISPLAY, tmplname, + options )) != NULL ) { + dsgw_send_header(); + attrs = tip->dsti_attrs; + } + + /* now read the attributes needed for the template */ + if (( rc = ldap_search_s( ld, dn, LDAP_SCOPE_BASE, "objectClass=*", + attrs, 0, &msgp )) != LDAP_SUCCESS ) { + dsgw_ldap_error( ld, DSGW_ERROPT_EXIT ); + } + + if (( entry = ldap_first_entry( ld, msgp )) == NULL ) { + ldap_msgfree( msgp ); + dsgw_ldap_error( ld, DSGW_ERROPT_EXIT ); + } + + /* and retrieve attribute types only if we need any of them */ + if ( one_attr || tip == NULL || tip->dsti_attrsonly_attrs == NULL ) { + aomsgp = NULL; + } else { + if (( rc = ldap_search_s( ld, dn, LDAP_SCOPE_BASE, "objectClass=*", + tip->dsti_attrsonly_attrs, 1, &aomsgp )) != LDAP_SUCCESS ) { + dsgw_ldap_error( ld, DSGW_ERROPT_EXIT ); + } + + /* + * if no entries were returned, "aoentry" will be set to NULL by the + * next statement. We don't treat that as an error since we know the + * entry exists. It probably just means none of the "attrsonly" types + * were present in the entry. + */ + aoentry = ldap_first_entry( ld, aomsgp ); + } + + /* display it (finally!) */ + if ( one_attr ) { + return_one_attr( ld, entry, attrs[ 0 ], mimetype, valindex ); + } else if ( tip == NULL ) { + /* no template available -- display in an ugly but complete manner */ + if (( rc = ldap_entry2html( ld, NULL, entry, NULL, NULL, NULL, + entry2htmlwrite, stdout, "\n", 0, LDAP_DISP_OPT_HTMLBODYONLY, + NULL, NULL )) != LDAP_SUCCESS ) { + dsgw_ldap_error( ld, DSGW_ERROPT_EXIT ); + } + dsgw_html_end(); + } else { + /* use template to create a nicely formatted display */ + dsgw_display_entry( tip, ld, entry, aoentry, NULL ); + dsgw_display_done( tip ); + } + + if ( attr0 != NULL ) { + attrs[ 0 ] = attr0; /* if we replaced this, put original back */ + } + + if ( msgp != NULL ) { + ldap_msgfree( msgp ); + } + if ( aomsgp != NULL ) { + ldap_msgfree( aomsgp ); + } +} + + +/* + * return 1 if the entry already exists, 0 if not, -1 if some error occurs + */ +int +dsgw_ldap_entry_exists( LDAP *ld, char *dn, char **matchedp, + unsigned long erropts ) +{ + LDAPMessage *msgp; + int rc; + + msgp = NULL; + if ( matchedp != NULL ) { + *matchedp = NULL; + } + + if (( rc = do_search( NULL, ld, dn, LDAP_SCOPE_BASE, "(objectClass=*)", + &msgp )) != LDAP_SUCCESS && rc != LDAP_NO_SUCH_OBJECT ) { + dsgw_ldap_error( ld, erropts ); + } + + if ( msgp == NULL || rc == LDAP_NO_SUCH_OBJECT ) { + rc = 0; + if ( matchedp != NULL ) { + (void)ldap_get_lderrno( ld, matchedp, NULL ); + } + } else { + rc = ( ldap_count_entries( ld, msgp ) > 0 ? 1 : 0 ); + ldap_msgfree( msgp ); + } + + return( rc ); +} + + +static int +entry2htmlwrite( void *fp, char *buf, int len ) +{ + return( fwrite( buf, len, 1, (FILE *)fp ) == 0 ? -1 : len ); +} + + +/* + * return 1 if the entry's parent exists, 0 if not, -1 if some error occurs. + * If the entry is the same as gc->gc_ldapsearchbase, then we return 1, + * so we don't prevent people from adding their organizational entry. + */ +int +dsgw_ldap_parent_exists( LDAP *ld, char *dn, unsigned long erropts ) +{ + LDAPMessage *msgp; + int rc; + + /* Is "dn" == gc->gc_ldapsearchbase? */ + msgp = NULL; + if (( rc = do_search( NULL, ld, dn, LDAP_SCOPE_BASE, "(objectClass=*)", + &msgp )) != LDAP_SUCCESS && rc != LDAP_NO_SUCH_OBJECT ) { + dsgw_ldap_error( ld, erropts ); + } + + if ( msgp == NULL ) { + rc = 0; + } else { + rc = ( ldap_count_entries( ld, msgp ) > 0 ? 1 : 0 ); + ldap_msgfree( msgp ); + } + + return( rc ); +} + + + +/* + * this function is called back by LIBLDAP when chasing referrals + */ +static int LDAP_CALL LDAP_CALLBACK +get_rebind_credentials( LDAP *ld, char **whop, char **credp, + int *methodp, int freeit, void *arg ) +{ + if ( !freeit ) { + *whop = binddn; + *credp = bindpasswd; + *methodp = LDAP_AUTH_SIMPLE; + } + + return( LDAP_SUCCESS ); +} + + +char * +dsgw_get_binddn() +{ + return( binddn ); +} + +/* + * return 1 if bound using "dn" + * return 0 if definitely bound as someone else + * return "def_answer" is we can't tell for sure + */ +int +dsgw_bound_as_dn( char *dn, int def_answer ) +{ + int i, rc; + char **rdns1, **rdns2; + + if ( binddn == NULL ) { + /* + * not authenticated: if not using local db or using it as an + * end-user, return the default + */ + if ( gc->gc_localdbconf == NULL || gc->gc_enduser ) { + return( def_answer ); + } + + /* + * if using local db as an admin, return "bound as someone else" + * since there is no access control enforced anyways. + */ + return( 0 ); + } + + /* first try a simple case-insensitive comparison */ + if ( strcasecmp( binddn, dn ) == 0 ) { + return( 1 ); /* DNs are the same */ + } + + /* + * These DNs may not have the same spacing or punctuation. Compare RDN + * components to eliminate any differences. + */ + if (( rdns1 = ldap_explode_dn( binddn, 0 )) == NULL ) { + return( def_answer ); /* we don't know: return the default */ + } + + if (( rdns2 = ldap_explode_dn( dn, 0 )) == NULL ) { + ldap_value_free( rdns1 ); + return( def_answer ); /* we don't know: return the default */ + } + + for ( i = 0; rdns1[ i ] != NULL && rdns2[ i ] != NULL; ++i ) { + if ( strcasecmp( rdns1[ i ], rdns2[ i ] ) != 0 ) { + break; /* DNs are not the same */ + } + } + + rc = ( rdns1[ i ] == NULL && rdns2[ i ] == NULL ); + + ldap_value_free( rdns1 ); + ldap_value_free( rdns2 ); + + return( rc ); +} + + + +/* + * Compare 2 DNs. Return 1 if they are equivalent, 0 if not. + */ +int +dsgw_dn_cmp( char *dn1, char *dn2 ) +{ + int i, rc; + char **rdns1, **rdns2; + + /* first try a simple case-insensitive comparison */ + if ( dsgw_utf8casecmp( (unsigned char *)dn1, (unsigned char *)dn2 ) == 0 ) { + return( 1 ); /* DNs are the same */ + } + + /* + * These DNs may not have the same spacing or punctuation. Compare RDN + * components to eliminate any differences. + */ + if (( rdns1 = ldap_explode_dn( dn1, 0 )) == NULL ) { + return( 0 ); /* we don't know: return 0 */ + } + + if (( rdns2 = ldap_explode_dn( dn2, 0 )) == NULL ) { + ldap_value_free( rdns1 ); + return( 0 ); /* we don't know: return 0 */ + } + + for ( i = 0; rdns1[ i ] != NULL && rdns2[ i ] != NULL; ++i ) { + if ( dsgw_utf8casecmp( (unsigned char *)rdns1[ i ], (unsigned char *)rdns2[ i ] ) != 0 ) { + break; /* DNs are not the same */ + } + } + + rc = ( rdns1[ i ] == NULL && rdns2[ i ] == NULL ); + + ldap_value_free( rdns1 ); + ldap_value_free( rdns2 ); + + return( rc ); +} + + +/* + * Return the parent of dn. The caller is responsible for freeing the + * returned value. Returns NULL on error. + */ +char * +dsgw_dn_parent( char *dn ) +{ + char *dnp; + int i; + char **rdns; + + if ( dn == NULL ) { + return( NULL ); + } + + dnp = dsgw_ch_malloc( strlen( dn )); + dnp[ 0 ] = '\0'; + if (( rdns = ldap_explode_dn( dn, 0 )) == NULL ) { + return NULL; + } + for ( i = 1; rdns[ i ] != NULL; i++ ) { + strcat( dnp, rdns[ i ] ); + strcat( dnp, "," ); + } + /* Get rid of the trailing "," we just appended */ + dnp[ strlen( dnp ) - 1 ] = '\0'; + ldap_value_free( rdns ); + return( dnp ); +} + + +/* + * Return 1 if dn1 is the immediate ancestor of dn2, 0 otherwise. + */ +int +dsgw_is_dnparent( char *dn1, char *dn2 ) +{ + char *dnp; + int rc; + + /* A null or zero-length DN cannot have a parent */ + if ( dn2 == NULL || strlen( dn2 ) == 0 ) { + return 0; + } + + dnp = dsgw_dn_parent( dn2 ); + rc = dsgw_dn_cmp( dn1, dnp ); + free( dnp ); + + return rc; +} + + +/* + * return malloc'd array of RDN attribute value pairs + * each element of the array is a string that looks like: TAG=VALUE + * this is used to extract values from the RDN when a new entry is added + */ +char ** +dsgw_rdn_values( char *dn ) +{ + char **rdns, **rdncomps, *val; + int i; + + if (( rdns = ldap_explode_dn( dn, 0 )) == NULL ) { + return( NULL ); + } + + rdncomps = ldap_explode_rdn( rdns[0], 0 ); + ldap_value_free( rdns ); + if ( rdncomps == NULL ) { + return( NULL ); + } + + for ( i = 0; rdncomps[ i ] != NULL; ++i ) { + if (( val = strchr( rdncomps[ i ], '=' )) == NULL ) { + ldap_value_free( rdncomps ); + return( NULL ); + } + ++val; + strcpy_special_undo( val, val ); /* undo in place */ + } + + return( rdncomps ); +} + + +/* + * the following routine was lifted from servers/slapd/ava.c + * it removes special quoting, etc. from values that appear in an LDAP DN + */ +static void +strcpy_special_undo( char *d, char *s ) +{ + int quote; + + quote = 0; + if ( *s == '"' ) { + s++; + quote = 1; + } + for ( ; *s; LDAP_UTF8INC(s)) { + switch ( *s ) { + case '"': + break; + case '\\': + s++; + /* FALL */ + default: + d += LDAP_UTF8COPY (d, s); + break; + } + } + *d = '\0'; LDAP_UTF8DEC(d); + if ( quote && *d == '"' ) { + *d = '\0'; + } +} + + +static char * +uid2dn( LDAP *ld, char *uid, char *base, int *ldaprc, char **lderrtxtp, + char **errsp ) +{ + char *attrs[] = { "objectclass", NULL }; + char filtbuf[ 85 ]; /* max of 80 char. uid + "uid=" + zero terminator */ + int rc, count; + LDAPMessage *result; + LDAPMessage *e; + char *dn; + + *ldaprc = LDAP_SUCCESS; /* optimistic */ + *errsp = *lderrtxtp = NULL; + + if ( ld == NULL || uid == NULL || strlen( uid ) > 80 ) { + *errsp = XP_GetClientStr(DBT_invalidUserIdOrNullLdapHandle_); + return NULL; + } + PR_snprintf( filtbuf, sizeof(filtbuf), "uid=%s", uid ); + + if (( rc = ldap_search_s( ld, base, LDAP_SCOPE_SUBTREE, filtbuf, + attrs, 1, &result )) != LDAP_SUCCESS ) { + *ldaprc = rc; + (void)ldap_get_lderrno( ld, NULL, lderrtxtp ); + return NULL; + } + if (( count = ldap_count_entries( ld, result )) != 1 ) { + /* Search either returned no entries, or more than one entry */ + ldap_msgfree( result ); + if ( count == 0 ) { + *errsp = XP_GetClientStr(DBT_noMatchForUserId_); + } else { + *errsp = XP_GetClientStr(DBT_moreThanOneMatchForUserId_); + } + return NULL; + } + + dn = NULL; + if (( e = ldap_first_entry( ld, result )) == NULL || + ( dn = ldap_get_dn( ld, e )) == NULL ) { + *ldaprc = ldap_get_lderrno( ld, NULL, NULL ); + } + ldap_msgfree( result ); + return( dn ); +} + + +/* + * Emit an HTML "SELECT" object that contains all the o's and ou's that + * are underneath our default searchbase. If there are none other than + * the searchbase, we emit a hidden HTML TEXT object that contains the + * searchbase and the "prefix" and "suffix" are not used. The values for + * the SELECT options and for the TEXT object are all escaped DNs. + * + * Location popup directives look like this: + * <-- DS_LOCATIONPOPUP "name=VARNAME" "prefix=PREFIX" "suffix=SUFFIX" --> + * + * If "prefix" and/or "suffix" are omitted, they default to "". + * If "name" is omitted it defaults to "base". + * + * If there are "location" directives in the dsgw.conf file, we use those + * instead of actually searching the directory. + */ +void +dsgw_emit_location_popup( LDAP *ld, int argc, char **argv, int erropts ) +{ + char line[BIG_LINE]; + char *varname, *prefix, *suffix, *rootname, *dn; + int i, count, did_init_ldap; + LDAPMessage *res, *e; + + if (( varname = get_arg_by_name( "name", argc, argv )) == NULL ) { + varname = "base"; + } + if (( prefix = get_arg_by_name( "prefix", argc, argv )) == NULL ) { + prefix = ""; + } + if (( suffix = get_arg_by_name( "suffix", argc, argv )) == NULL ) { + suffix = ""; + } + rootname = get_arg_by_name( "rootname", argc, argv ); + + did_init_ldap = 0; + res = NULL; + + if ( gc->gc_newentryloccount > 0 ) { + count = gc->gc_newentryloccount; + } else { + char *attrs[ 3 ]; + int rc; + + if ( ld == NULL ) { + (void)dsgw_init_ldap( &ld, NULL, 0, 0 ); + did_init_ldap = 1; + } + attrs[ 0 ] = "o"; + attrs[ 1 ] = "ou"; + attrs[ 2 ] = NULL; + + rc = ldap_search_s( ld, gc->gc_ldapsearchbase, LDAP_SCOPE_SUBTREE, + "(|(objectclass=organization)(objectclass=organizationalunit))", + attrs, 1, &res ); + if ( rc != LDAP_SUCCESS || res == NULL ) { + dsgw_ldap_error( ld, erropts ); + return; + } + + count = ldap_count_entries( ld, res ); + if ( gc->gc_ldapsearchbase == NULL || *gc->gc_ldapsearchbase == '\0' ) { + ++count; /* include base DN even if it is "" */ + } else { + /* + * check to see if search base was one of the entries returned + * we want to always list the base entry, so we need to check + */ + for ( e = ldap_first_entry( ld, res ); e != NULL; + e = ldap_next_entry( ld, e )) { + if (( dn = ldap_get_dn( ld, e )) == NULL ) { + dsgw_ldap_error( ld, erropts ); + ldap_msgfree( res ); + return; + } + + rc = dsgw_dn_cmp( dn, gc->gc_ldapsearchbase ); + free( dn ); + if ( rc ) { /* base DN was returned */ + break; + } + } + if ( e == NULL ) { + ++count; /* include base DN even if was not returned */ + } + } + } + + if ( count > 1 ) { + PR_snprintf( line, sizeof(line), "%s\ngc_newentryloccount > 0 ) { + for ( i = 0; i < gc->gc_newentryloccount; ++i ) { + emit_one_loc_dn( gc->gc_newentrylocs[ i ].dsloc_dnsuffix, + gc->gc_newentrylocs[i].dsloc_fullname, rootname, + ( count < 2 )); + } + } else { + /* always include the base dn first */ + emit_one_loc_dn( gc->gc_ldapsearchbase, NULL, rootname, ( count < 2 )); + + /* XXXmcs it would be nice to do a more intelligent sort here */ +#ifdef DSGW_DEBUG + dsgw_log( "dsgw_emit_location_popup: ldap_sort_entries(NULL)\n" ); +#endif + ldap_sort_entries( ld, &res, NULL, dsgw_strcmp (CASE_INSENSITIVE)); + + for ( e = ldap_first_entry( ld, res ); e != NULL; + e = ldap_next_entry( ld, e )) { + if (( dn = ldap_get_dn( ld, e )) == NULL ) { + dsgw_ldap_error( ld, erropts ); + ldap_msgfree( res ); + return; + } + + if ( !dsgw_dn_cmp( dn, gc->gc_ldapsearchbase )) { + emit_one_loc_dn( dn, NULL, rootname, ( count < 2 )); + } + free( dn ); + } + } + + if ( count > 1 ) { + PR_snprintf( line, sizeof(line), "\n%s\n", suffix ); + dsgw_emits( line ); + } + + if ( res != NULL ) { + ldap_msgfree( res ); + } + if ( did_init_ldap ) { + ldap_unbind( ld ); + } +} + + +static void +emit_one_loc_dn( char *dn, char *friendlyname, char *rootname, int only_one ) +{ + char *escapeddn, **rdns, line[ BIG_LINE ]; + + rdns = NULL; + escapeddn = dsgw_strdup_escaped( dn ); + + if ( !only_one ) { + dsgw_emits( "%s\n", escapeddn, + only_one ? "" : friendlyname ); + free( escapeddn ); + if ( rdns != NULL ) { + ldap_value_free( rdns ); + } + dsgw_emits( line ); +} + + +/* + * Return a MIME document that contains a single value. + * XXX: does this really belong in ldaputil.c? + */ +static void +return_one_attr( LDAP *ld, LDAPMessage *entry, char *attrtype, char *mimetype, + int valindex ) +{ + char *val; + struct berval **bvals; + unsigned long vlen; + + if (( bvals = ldap_get_values_len( ld, entry, attrtype )) == NULL ) { + dsgw_error( DSGW_ERR_NOATTRVALUE, attrtype, DSGW_ERROPT_EXIT, 0, NULL ); + } + + if ( valindex > ldap_count_values_len( bvals )) { + dsgw_error( DSGW_ERR_NOATTRVALUE, attrtype, DSGW_ERROPT_EXIT, 0, NULL ); + } + + val = bvals[ valindex ]->bv_val; + vlen = bvals[ valindex ]->bv_len; + + fprintf( stdout, "Content-Type: %s\n", mimetype ); + fprintf( stdout, "Content-Length: %ld\n\n", vlen ); + +#ifdef XP_WIN32 + /* flush any data on stdout before changing the mode */ + fflush( stdout ); + + /* set the mode to binary + so windows doesn't replace with carriage + return line feed and mess everything up + */ + _setmode( _fileno( stdout ), _O_BINARY ); +#endif + + fwrite( val, vlen, 1, stdout ); + +#ifdef XP_WIN32 + /* flush any remaining binary data */ + fflush( stdout ); + + /* set the mode back to text */ + _setmode( _fileno( stdout ), _O_TEXT ); +#endif + + ldap_value_free_len( bvals ); + free( attrtype ); +} + + +/* + * The general format of attrtype is: + * [ & ] [ & ] + * This routine breaks it up. Callers should free( *attrtypep ) after they + * are done using attrtypep and mimetypep. + */ +static void +break_up_one_attr( char *attr, char **attrtypep, char **mimetypep, + int *valindexp ) +{ + char *p; + + *attrtypep = dsgw_ch_strdup( attr ); + + *mimetypep = "text/plain"; /* default */ + *valindexp = 0; /* default: retrieve first value */ + + if (( p = strchr( *attrtypep, '&' )) != NULL ) { + *p++ = '\0'; + if ( *p != '\0' ) { + *mimetypep = p; + if (( p = strchr( *mimetypep, '&' )) != NULL ) { + *p++ = '\0'; + *valindexp = atoi( p ); + } + } + } +} diff --git a/ldif.h b/ldif.h new file mode 100644 index 0000000..3f04db8 --- /dev/null +++ b/ldif.h @@ -0,0 +1,108 @@ +/** BEGIN COPYRIGHT BLOCK + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/* + * Copyright (c) 1996 Regents of the University of Michigan. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that this notice is preserved and that due credit is given + * to the University of Michigan at Ann Arbor. The name of the University + * may not be used to endorse or promote products derived from this + * software without specific prior written permission. This software + * is provided ``as is'' without express or implied warranty. + */ + +#ifndef _LDIF_H +#define _LDIF_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define LDIF_VERSION_ONE 1 /* LDIF standard version */ + +#define LDIF_MAX_LINE_WIDTH 76 /* maximum length of LDIF lines */ + +/* + * Macro to calculate maximum number of bytes that the base64 equivalent + * of an item that is "vlen" bytes long will take up. Base64 encoding + * uses one byte for every six bits in the value plus up to two pad bytes. + */ +#define LDIF_BASE64_LEN(vlen) (((vlen) * 4 / 3 ) + 3) + +/* + * Macro to calculate maximum size that an LDIF-encoded type (length + * tlen) and value (length vlen) will take up: room for type + ":: " + + * first newline + base64 value + continued lines. Each continued line + * needs room for a newline and a leading space character. + */ +#define LDIF_SIZE_NEEDED(tlen,vlen) \ + ((tlen) + 4 + LDIF_BASE64_LEN(vlen) \ + + ((LDIF_BASE64_LEN(vlen) + tlen + 3) / LDIF_MAX_LINE_WIDTH * 2 )) + +/* + * Options for ldif_put_type_and_value_with_options() and + * ldif_type_and_value_with_options(). + */ +#define LDIF_OPT_NOWRAP 0x01UL +#define LDIF_OPT_VALUE_IS_URL 0x02UL +#define LDIF_OPT_MINIMAL_ENCODING 0x04UL + +int ldif_parse_line( char *line, char **type, char **value, int *vlen, char **errcode); +char * ldif_getline( char **next ); +void ldif_put_type_and_value( char **out, char *t, char *val, int vlen ); +void ldif_put_type_and_value_nowrap( char **out, char *t, char *val, int vlen ); +void ldif_put_type_and_value_with_options( char **out, char *t, char *val, + int vlen, unsigned long options ); +char *ldif_type_and_value( char *type, char *val, int vlen ); +char *ldif_type_and_value_nowrap( char *type, char *val, int vlen ); +char *ldif_type_and_value_with_options( char *type, char *val, int vlen, + unsigned long options ); +int ldif_base64_decode( char *src, unsigned char *dst ); +int ldif_base64_encode( unsigned char *src, char *dst, int srclen, + int lenused ); +int ldif_base64_encode_nowrap( unsigned char *src, char *dst, int srclen, + int lenused ); +char *ldif_get_entry( FILE *fp, int *lineno ); + + +#ifdef __cplusplus +} +#endif + +#endif /* _LDIF_H */ diff --git a/line64.c b/line64.c new file mode 100644 index 0000000..48fbeda --- /dev/null +++ b/line64.c @@ -0,0 +1,776 @@ +/* --- BEGIN COPYRIGHT BLOCK --- + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + * --- END COPYRIGHT BLOCK --- */ + +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public License + * Version 1.0 (the "NPL"); you may not use this file except in + * compliance with the NPL. You may obtain a copy of the NPL at + * http://www.mozilla.org/NPL/ + * + * Software distributed under the NPL is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL + * for the specific language governing rights and limitations under the + * NPL. + * + * The Initial Developer of this code under the NPL is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All Rights + * Reserved. + */ +/* line64.c - routines for dealing with the slapd line format */ + +#include +#include +#include +#include +#ifndef macintosh +#include +#endif +#ifdef _WIN32 +#include +#elif !defined( macintosh ) +#include +#endif +#include "ldif.h" +#include +#include "lber.h" +#include +#include "fileurl.h" + +#include "nspr.h" + +#ifndef isascii +#define isascii( c ) (!((c) & ~0177)) +#endif + +#define RIGHT2 0x03 +#define RIGHT4 0x0f +#define CONTINUED_LINE_MARKER '\001' + +#define ISBLANK(c) (c == ' ' || c == '\t' || c == '\n') /* not "\r\v\f" */ + +#define LDIF_OPT_ISSET( value, opt ) (((value) & (opt)) != 0 ) + +static char nib2b64[0x40] = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + +static unsigned char b642nib[0x80] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x3e, 0xff, 0xff, 0xff, 0x3f, + 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, + 0x3c, 0x3d, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, + 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, + 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, + 0x17, 0x18, 0x19, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, + 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, + 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, + 0x31, 0x32, 0x33, 0xff, 0xff, 0xff, 0xff, 0xff +}; + +static int ldif_base64_encode_internal( unsigned char *src, char *dst, int srclen, + int lenused, int wraplen ); + +static int ldif_fromfile( char *path, struct berval *bv ); + +/* + * ldif_parse_line - takes a line of the form "type:[:] value" and splits it + * into components "type" and "value". if a double colon separates type from + * value, then value is encoded in base 64, and parse_line un-decodes it + * (in place) before returning. + * Success return might be 0 (value is returned in place) or 1 (value has + * been malloc'ed) + */ + +int +ldif_parse_line( + char *line, + char **type, + char **value, + int *vlen, + char **errmsg +) +{ + char *p, *s, *d; + int b64; + int url = 0; + int rc = 0; + + *errmsg = NULL; + + /* skip any leading space */ + while ( ISBLANK( *line ) ) { + line++; + } + *type = line; + + for ( s = line; *s && *s != ':'; s++ ) + ; /* NULL */ + if ( *s == '\0' ) { + + /* Comment-out while we address calling libldif from ns-back-ldbm + on NT. 1 of 3 */ +#if defined( _WIN32 ) + /* +#endif + LDAPDebug( LDAP_DEBUG_PARSE, "ldif_parse_line: missing ':' " + "on line \"%s\"\n", line, 0, 0 ); +#if defined( _WIN32 ) + */ +#endif + return( -1 ); + } + + /* trim any space between type and : */ + for ( p = s - 1; p > line && ISBLANK( *p ); p-- ) { + *p = '\0'; + } + *s++ = '\0'; + + /* check for double : - indicates base 64 encoded value */ + if ( *s == ':' ) { + s++; + b64 = 1; + + /* single : - normally encoded value */ + } else { + /* check for ":<" - indicates value is actually an url */ + if (*s == '<') { + s++; + url = 1; + } + b64 = 0; + } + + /* skip space between : and value */ + while ( ISBLANK( *s ) ) { + s++; + } + + /* + * If no value is present, return a zero-length string for + * *value, with *vlen set to zero. + */ + if ( *s == '\0' ) { + *value = s; + *vlen = 0; + return( 0 ); + } + + /* check for continued line markers that should be deleted */ + for ( p = s, d = s; *p; p++ ) { + if ( *p != CONTINUED_LINE_MARKER ) + *d++ = *p; + } + *d = '\0'; + + *value = s; + if ( b64 ) { + if (( *vlen = ldif_base64_decode( s, (unsigned char *)s )) + < 0 ) { + /* Comment-out while we address calling libldif from ns-back-ldbm + on NT. 3 of 3 */ +#if defined( _WIN32 ) + /* +#endif + LDAPDebug( LDAP_DEBUG_ANY, + "ldif_parse_line: invalid base 64 char on line \"%s\"\n", + line, 0, 0 ); +#if defined( _WIN32 ) + */ +#endif + return( -1 ); + } + s[ *vlen ] = '\0'; + + } else if (url) { + + char *path; + struct stat fstats; + struct berval bv; + + bv.bv_val = NULL; + + /* + * We only support file:// URLs for now. + */ + + switch( ldif_fileurl2path( s, &path )) { + case LDIF_FILEURL_NOTAFILEURL: + *errmsg = PR_smprintf( + "ldif_parse_line: unsupported URL \"%s\";" + " use a file:// URL instead.\n", s); + rc = -1; + break; + + case LDIF_FILEURL_MISSINGPATH: + *errmsg = PR_smprintf( + "ldif_parse_line: unable to process URL \"%s\" --" + " missing path..\n", s); + rc = -1; + break; + + case LDIF_FILEURL_NONLOCAL: + *errmsg = PR_smprintf( + "ldif_parse_line: unable to process URL \"%s\" --" + " only local file:// URLs are supported.\n", s); + rc = -1; + break; + + case LDIF_FILEURL_NOMEMORY: + perror( "ldif_fileurl2path" ); + rc = -1; + break; + + case LDIF_FILEURL_SUCCESS: + if ( stat( path, &fstats ) != 0 ) { + perror( path ); + rc = -1; + } else if ( fstats.st_mode & S_IFDIR ) { + *errmsg = PR_smprintf( + "ldif_parse_line: %s is a directory, not a file.\n", path); + rc = -1; + } else if ( ldif_fromfile( path, &bv ) < 0 ) { + *errmsg = PR_smprintf( + "ldif_parse_line: unable to retrieve information" + " from file %s.\n", path); + rc = -1; + } + free( path ); + break; + + default: + *errmsg = PR_smprintf( + "ldif_parse_line: unable to process URL \"%s\" --" + " unknown error.\n", s); + rc = -1; + } + + + if ( rc != 0 ) { + if (bv.bv_val) + free(bv.bv_val); + } else { + *value = bv.bv_val; + *vlen = bv.bv_len; + rc = 1; + } + } else { + *vlen = (int) (d - s); + } + + return( rc ); +} + + +/* + * ldif_base64_decode - take the BASE64-encoded characters in "src" + * (a zero-terminated string) and decode them into the the buffer "dst". + * "src" and "dst" can be the same if in-place decoding is desired. + * "dst" must be large enough to hold the decoded octets. No more than + * 3 * strlen( src ) / 4 bytes will be produced. + * "dst" may contain zero octets anywhere within it, but it is not + * zero-terminated by this function. + * + * The number of bytes copied to "dst" is returned if all goes well. + * -1 is returned if the BASE64 encoding in "src" is invalid. + */ + +int +ldif_base64_decode( char *src, unsigned char *dst ) +{ + char *p, *stop; + unsigned char nib, *byte; + int i, len; + + stop = strchr( src, '\0' ); + byte = dst; + for ( p = src, len = 0; p < stop; p += 4, len += 3 ) { + for ( i = 0; i < 4; i++ ) { + if ( p[i] != '=' && (p[i] & 0x80 || + b642nib[ p[i] & 0x7f ] > 0x3f) ) { + return( -1 ); + } + } + + /* first digit */ + nib = b642nib[ p[0] & 0x7f ]; + byte[0] = nib << 2; + + /* second digit */ + nib = b642nib[ p[1] & 0x7f ]; + byte[0] |= nib >> 4; + + /* third digit */ + if ( p[2] == '=' ) { + len += 1; + break; + } + byte[1] = (nib & RIGHT4) << 4; + nib = b642nib[ p[2] & 0x7f ]; + byte[1] |= nib >> 2; + + /* fourth digit */ + if ( p[3] == '=' ) { + len += 2; + break; + } + byte[2] = (nib & RIGHT2) << 6; + nib = b642nib[ p[3] & 0x7f ]; + byte[2] |= nib; + + byte += 3; + } + + return( len ); +} + +/* + * ldif_getline - return the next "line" (minus newline) of input from a + * string buffer of lines separated by newlines, terminated by \n\n + * or \0. this routine handles continued lines, bundling them into + * a single big line before returning. if a line begins with a white + * space character, it is a continuation of the previous line. the white + * space character (nb: only one char), and preceeding newline are changed + * into CONTINUED_LINE_MARKER chars, to be deleted later by the + * ldif_parse_line() routine above. + * + * it takes a pointer to a pointer to the buffer on the first call, + * which it updates and must be supplied on subsequent calls. + * + * XXX need to update this function to also support as EOL. + * XXX supports as of 07/29/1998 (richm) + */ + +char * +ldif_getline( char **next ) +{ + char *l; + char c; + char *p; + + if ( *next == NULL || **next == '\n' || **next == '\0' ) { + return( NULL ); + } + + while ( **next == '#' ) { /* skip comment lines */ + if (( *next = strchr( *next, '\n' )) == NULL ) { + return( NULL ); + } + (*next)++; + } + + l = *next; + while ( (*next = strchr( *next, '\n' )) != NULL ) { + p = *next - 1; /* pointer to character previous to the newline */ + c = *(*next + 1); /* character after the newline */ + if ( ISBLANK( c ) && c != '\n' ) { + /* DOS EOL is \r\n, so if the character before */ + /* the \n is \r, continue it too */ + if (*p == '\r') + *p = CONTINUED_LINE_MARKER; + **next = CONTINUED_LINE_MARKER; + *(*next+1) = CONTINUED_LINE_MARKER; + } else { + /* DOS EOL is \r\n, so if the character before */ + /* the \n is \r, null it too */ + if (*p == '\r') + *p = '\0'; + *(*next)++ = '\0'; + break; + } + (*next)++; + } + + return( l ); +} + + +#define LDIF_SAFE_CHAR( c ) ( (c) != '\r' && (c) != '\n' ) +#define LDIF_CONSERVATIVE_CHAR( c ) ( LDIF_SAFE_CHAR(c) && isascii((c)) \ + && ( isprint((c)) || (c) == '\t' )) +#define LDIF_SAFE_INITCHAR( c ) ( LDIF_SAFE_CHAR(c) && (c) != ':' \ + && (c) != ' ' && (c) != '<' ) +#define LDIF_CONSERVATIVE_INITCHAR( c ) ( LDIF_SAFE_INITCHAR( c ) && \ + ! ( isascii((c)) && isspace((c)))) +#define LDIF_CONSERVATIVE_FINALCHAR( c ) ( (c) != ' ' ) + + +void +ldif_put_type_and_value_with_options( char **out, char *t, char *val, + int vlen, unsigned long options ) +{ + unsigned char *p, *byte, *stop; + char *save; + int b64, len, savelen, wraplen; + len = 0; + + if ( LDIF_OPT_ISSET( options, LDIF_OPT_NOWRAP )) { + wraplen = -1; + } else { + wraplen = LDIF_MAX_LINE_WIDTH; + } + + /* put the type + ": " */ + for ( p = (unsigned char *) t; *p; p++, len++ ) { + *(*out)++ = *p; + } + *(*out)++ = ':'; + len++; + if ( LDIF_OPT_ISSET( options, LDIF_OPT_VALUE_IS_URL )) { + *(*out)++ = '<'; /* add '<' for URLs */ + len++; + } + save = *out; + savelen = len; + b64 = 0; + + stop = (unsigned char *)val; + if ( val && vlen > 0 ) { + *(*out)++ = ' '; + stop = (unsigned char *) (val + vlen); + if ( LDIF_OPT_ISSET( options, LDIF_OPT_MINIMAL_ENCODING )) { + if ( !LDIF_SAFE_INITCHAR( val[0] )) { + b64 = 1; + } + } else { + if ( !LDIF_CONSERVATIVE_INITCHAR( val[0] ) || + !LDIF_CONSERVATIVE_FINALCHAR( val[vlen-1] )) { + b64 = 1; + } + } + } + + if ( !b64 ) { + for ( byte = (unsigned char *) val; byte < stop; + byte++, len++ ) { + if ( LDIF_OPT_ISSET( options, + LDIF_OPT_MINIMAL_ENCODING )) { + if ( !LDIF_SAFE_CHAR( *byte )) { + b64 = 1; + break; + } + } else if ( !LDIF_CONSERVATIVE_CHAR( *byte )) { + b64 = 1; + break; + } + + if ( wraplen != -1 && len > wraplen ) { + *(*out)++ = '\n'; + *(*out)++ = ' '; + len = 1; + } + *(*out)++ = *byte; + } + } + + if ( b64 ) { + *out = save; + *(*out)++ = ':'; + *(*out)++ = ' '; + len = ldif_base64_encode_internal( (unsigned char *)val, *out, vlen, + savelen + 2, wraplen ); + *out += len; + } + + *(*out)++ = '\n'; +} + +void +ldif_put_type_and_value( char **out, char *t, char *val, int vlen ) +{ + ldif_put_type_and_value_with_options( out, t, val, vlen, 0 ); +} + +void +ldif_put_type_and_value_nowrap( char **out, char *t, char *val, int vlen ) +{ + ldif_put_type_and_value_with_options( out, t, val, vlen, LDIF_OPT_NOWRAP ); +} + +/* + * ldif_base64_encode_internal - encode "srclen" bytes in "src", place BASE64 + * encoded bytes in "dst" and return the length of the BASE64 + * encoded string. "dst" is also zero-terminated by this function. + * + * If "lenused" >= 0, newlines will be included in "dst" and "lenused" if + * appropriate. "lenused" should be a count of characters already used + * on the current line. The LDIF lines we create will contain at most + * "wraplen" characters on each line, unless "wraplen" is -1, in which + * case output line length is unlimited. + * + * If "lenused" < 0, no newlines will be included, and the LDIF_BASE64_LEN() + * macro can be used to determine how many bytes will be placed in "dst." + */ + +static int +ldif_base64_encode_internal( unsigned char *src, char *dst, int srclen, int lenused, int wraplen ) +{ + unsigned char *byte, *stop; + unsigned char buf[3]; + char *out; + unsigned long bits; + int i, pad, len; + + len = 0; + out = dst; + stop = src + srclen; + + /* convert to base 64 (3 bytes => 4 base 64 digits) */ + for ( byte = src; byte < stop - 2; byte += 3 ) { + bits = (byte[0] & 0xff) << 16; + bits |= (byte[1] & 0xff) << 8; + bits |= (byte[2] & 0xff); + + for ( i = 0; i < 4; i++, bits <<= 6 ) { + if ( wraplen != -1 && lenused >= 0 && lenused++ > wraplen ) { + *out++ = '\n'; + *out++ = ' '; + lenused = 2; + } + + /* get b64 digit from high order 6 bits */ + *out++ = nib2b64[ (bits & 0xfc0000L) >> 18 ]; + } + } + + /* add padding if necessary */ + if ( byte < stop ) { + for ( i = 0; byte + i < stop; i++ ) { + buf[i] = byte[i]; + } + for ( pad = 0; i < 3; i++, pad++ ) { + buf[i] = '\0'; + } + byte = buf; + bits = (byte[0] & 0xff) << 16; + bits |= (byte[1] & 0xff) << 8; + bits |= (byte[2] & 0xff); + + for ( i = 0; i < 4; i++, bits <<= 6 ) { + if ( wraplen != -1 && lenused >= 0 && lenused++ > wraplen ) { + *out++ = '\n'; + *out++ = ' '; + lenused = 2; + } + + if (( i == 3 && pad > 0 ) || ( i == 2 && pad == 2 )) { + /* Pad as appropriate */ + *out++ = '='; + } else { + /* get b64 digit from low order 6 bits */ + *out++ = nib2b64[ (bits & 0xfc0000L) >> 18 ]; + } + } + } + + *out = '\0'; + + return( out - dst ); +} + +int +ldif_base64_encode( unsigned char *src, char *dst, int srclen, int lenused ) +{ + return ldif_base64_encode_internal( src, dst, srclen, lenused, LDIF_MAX_LINE_WIDTH ); +} + +int +ldif_base64_encode_nowrap( unsigned char *src, char *dst, int srclen, int lenused ) +{ + return ldif_base64_encode_internal( src, dst, srclen, lenused, -1 ); +} + + +/* + * return malloc'd, zero-terminated LDIF line + */ +char * +ldif_type_and_value_with_options( char *type, char *val, int vlen, + unsigned long options ) +{ + char *buf, *p; + int tlen; + + tlen = strlen( type ); + if (( buf = (char *)malloc( LDIF_SIZE_NEEDED( tlen, vlen ) + 1 )) != + NULL ) { + p = buf; + ldif_put_type_and_value_with_options( &p, type, val, vlen, options ); + *p = '\0'; + } + + return( buf ); +} + +char * +ldif_type_and_value( char *type, char *val, int vlen ) +{ + return ldif_type_and_value_with_options( type, val, vlen, 0 ); +} + +char * +ldif_type_and_value_nowrap( char *type, char *val, int vlen ) +{ + return ldif_type_and_value_with_options( type, val, vlen, LDIF_OPT_NOWRAP ); +} + +/* + * ldif_get_entry - read the next ldif entry from the FILE referenced + * by fp. return a pointer to a malloc'd, null-terminated buffer. also + * returned is the last line number read, in *lineno. + */ +char * +ldif_get_entry( FILE *fp, int *lineno ) +{ + char line[BUFSIZ]; + char *buf; + int max, cur, len, gotsome; + + buf = NULL; + max = cur = gotsome = 0; + while ( fgets( line, sizeof(line), fp ) != NULL ) { + if ( lineno != NULL ) { + (*lineno)++; + } + /* ldif entries are terminated by a \n on a line by itself */ + if ( line[0] == '\0' || line[0] == '\n' +#if !defined( XP_WIN32 ) + || ( line[0] == '\r' && line[1] == '\n' ) /* DOS format */ +#endif + ) { + if ( gotsome ) { + break; + } else { + continue; + } + } else if ( line[0] == '#' ) { + continue; + } + gotsome = 1; + len = strlen( line ); +#if !defined( XP_WIN32 ) + /* DOS format */ + if ( len > 0 && line[len-1] == '\r' ) { + --len; + line[len] = '\0'; + } else if ( len > 1 && line[len-2] == '\r' && line[len-1] == '\n' ) { + --len; + line[len-1] = line[len]; + line[len] = '\0'; + } +#endif + while ( cur + (len + 1) > max ) { + if ( buf == NULL ) { + max += BUFSIZ; + buf = (char *) malloc( max ); + } else { + max *= 2; + buf = (char *) realloc( buf, max ); + } + if ( buf == NULL ) { + return( NULL ); + } + } + + memcpy( buf + cur, line, len + 1 ); + cur += len; + } + + return( buf ); +} + + + +static int +ldif_fromfile( char *path, struct berval *bv ) +{ + FILE *fp; + long rlen; + int eof; +#if defined( XP_WIN32 ) + char mode[20] = "r+b"; +#else + char mode[20] = "r"; +#endif + + if (( fp = fopen( path, mode )) == NULL ) { + perror( path ); + return( -1 ); + } + + if ( fseek( fp, 0L, SEEK_END ) != 0 ) { + perror( path ); + fclose( fp ); + return( -1 ); + } + + bv->bv_len = ftell( fp ); + + if (( bv->bv_val = (char *)malloc( bv->bv_len + 1 )) == NULL ) { + perror( "malloc" ); + fclose( fp ); + return( -1 ); + } + + if ( fseek( fp, 0L, SEEK_SET ) != 0 ) { + perror( path ); + fclose( fp ); + return( -1 ); + } + + rlen = fread( bv->bv_val, 1, bv->bv_len, fp ); + eof = feof( fp ); + fclose( fp ); + + if ( rlen != (long)bv->bv_len ) { + perror( path ); + free( bv->bv_val ); + return( -1 ); + } + + bv->bv_val[ bv->bv_len ] = '\0'; + return( bv->bv_len ); +} + + diff --git a/m4/adminutil.m4 b/m4/adminutil.m4 new file mode 100644 index 0000000..5bdf371 --- /dev/null +++ b/m4/adminutil.m4 @@ -0,0 +1,70 @@ +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2006 Red Hat, Inc. +# All rights reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# END COPYRIGHT BLOCK + +AC_CHECKING(for ADMINUTIL) + +# check for --with-adminutil +AC_MSG_CHECKING(for --with-adminutil) +AC_ARG_WITH(adminutil, [ --with-adminutil=PATH Adminutil directory], +[ + if test -d "$withval"/include -a -d "$withval"/lib + then + AC_MSG_RESULT([using $withval]) + ADMINUTILDIR=$withval + adminutil_lib="-L$ADMINUTILDIR/lib" + # check for version - only needed for older adminutil versions + for file in $ADMINUTILDIR/lib/* ; do + echo $file | grep 'libadminutil[[0-9][0-9]]' && adminutil_ver=`echo $file | sed -e 's/.*libadminutil\([[0-9][0-9]]\).*/\1/'` ; break + done + # use the latest one + adminutil_incdir=`ls -1d $ADMINUTILDIR/include/adminutil-* | sort -n | tail -1` + if ! test -n "$adminutil_incdir" -a -d "$adminutil_incdir" ; then + adminutil_incdir=$ADMINUTILDIR/include + fi + if ! test -e "$adminutil_incdir/libadminutil/admutil.h" ; then + AC_MSG_ERROR([$withval include dir not found]) + fi + adminutil_inc="-I$adminutil_incdir" + else + echo + AC_MSG_ERROR([$withval not found]) + fi +], +AC_MSG_RESULT(no)) + +# if ADMINUTIL is not found yet, try pkg-config + +# last resort +if test -z "$adminutil_inc" -o -z "$adminutil_lib"; then + AC_MSG_CHECKING(for adminutil with pkg-config) + AC_PATH_PROG(PKG_CONFIG, pkg-config) + if test -n "$PKG_CONFIG"; then + if $PKG_CONFIG --exists adminutil; then + adminutil_inc=`$PKG_CONFIG --cflags-only-I adminutil` + adminutil_lib=`$PKG_CONFIG --libs-only-L adminutil` + else + AC_MSG_ERROR([ADMINUTIL not found, specify with --with-adminutil.]) + fi + fi +fi + +if test -z "$adminutil_inc" -o -z "$adminutil_lib"; then + AC_MSG_ERROR([ADMINUTIL not found, specify with --with-adminutil.]) +fi diff --git a/m4/httpd.m4 b/m4/httpd.m4 new file mode 100644 index 0000000..761063a --- /dev/null +++ b/m4/httpd.m4 @@ -0,0 +1,79 @@ +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2006 Red Hat, Inc. +# All rights reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# END COPYRIGHT BLOCK + +AC_ARG_WITH(admserv, [ --with-admserv=PATH Install DSGW with Admin Server - PATH is server root], +[ + if test "$withval" + then + AC_MSG_RESULT([using $withval]) + HAVE_ADMSERV=1 + basedir="$withval/clients/dsgw" + htmldir="$basedir/html" + pbhtmldir="$basedir/pbhtml" + configdir="$basedir/config" + pbconfigdir="$basedir/pbconfig" + contextdir="$basedir/context" + cgibindir="$basedir/bin" + propertydir=$contextdir + securitydir=$contextdir + manualuri="/manual" + cgiuri="/clients/dsgw/bin/" + cookiedir="$basedir/cookies" + else + echo + AC_MSG_ERROR([$withval not found]) + fi +], +AC_MSG_RESULT(no)) + +if test -z "$HAVE_ADMSERV" ; then + AC_PATH_PROG([HTTPD], [httpd], [], + [$PATH:/opt/hpws/apache/bin:/usr/local/apache/sbin:/usr/local/apache2/sbin:/usr/sbin]) + if test -z "$HTTPD" -o ! -x "$HTTPD" ; then + AC_MSG_ERROR([Apache2 httpd server not found]) + fi + + httpd_root=`$HTTPD -V | grep HTTPD_ROOT | cut -f2 -d=` + httpd_root=`eval echo $httpd_root` + httpd_conf_rel=`$HTTPD -V | grep SERVER_CONFIG_FILE | cut -f2 -d=` + httpd_conf_rel=`eval echo $httpd_conf_rel` + + httpd_conf=${httpd_root}/${httpd_conf_rel} + + htmlbasedir=`grep \^DocumentRoot $httpd_conf|awk '{print $2}'` + htmlbasedir=`eval echo $htmlbasedir` + # these directories are html based + htmldir="$htmlbasedir/dsgw/html" + pbhtmldir="$htmlbasedir/dsgw/pbhtml" + configdir="$htmlbasedir/dsgw/config" + pbconfigdir="$htmlbasedir/dsgw/pbconfig" + manualuri="/dirsvr/manual" + + # CGI program directory + cgibindir=`grep '^ScriptAlias.*/cgi-bin/' $httpd_conf|awk '{print $3}'` + cgibindir=`eval echo $cgibindir` + cgiuri=`grep '^ScriptAlias.*/cgi-bin/' $httpd_conf|awk '{print $2}'` + + # configuration files and etc. + contextdir=/etc/dsgw + propertydir=$contextdir + securitydir=$contextdir + cookiedir=/var/run/dsgw/cookies +fi diff --git a/m4/icu.m4 b/m4/icu.m4 new file mode 100644 index 0000000..f639de1 --- /dev/null +++ b/m4/icu.m4 @@ -0,0 +1,98 @@ +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2006 Red Hat, Inc. +# All rights reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# END COPYRIGHT BLOCK + +AC_CHECKING(for LIBICU) + +# check for --with-icu +AC_MSG_CHECKING(for --with-icu) +AC_ARG_WITH(icu, [ --with-icu=PATH ICU directory], +[ + if test -d "$withval"/lib + then + AC_MSG_RESULT([using $withval]) + ICUDIR=$withval + icu_lib="-L$ICUDIR/lib" + else + echo + AC_MSG_ERROR([$withval not found]) + fi + icu_inc=$withval/include + icu_bin=$withval/bin +], +AC_MSG_RESULT(no)) + +# check for --with-icu-inc +AC_MSG_CHECKING(for --with-icu-inc) +AC_ARG_WITH(icu-inc, [ --with-icu-inc=PATH ICU include directory], +[ + if test -d "$withval" + then + AC_MSG_RESULT([using $withval]) + icu_inc="-I$withval" + else + echo + AC_MSG_ERROR([$withval not found]) + fi +], +AC_MSG_RESULT(no)) + +# check for --with-icu-lib +AC_MSG_CHECKING(for --with-icu-lib) +AC_ARG_WITH(icu-lib, [ --with-icu-lib=PATH ICU library directory], +[ + if test -d "$withval" + then + AC_MSG_RESULT([using $withval]) + icu_lib="-L$withval" + else + echo + AC_MSG_ERROR([$withval not found]) + fi +], +AC_MSG_RESULT(no)) + +# check for --with-icu-bin +AC_MSG_CHECKING(for --with-icu-bin) +AC_ARG_WITH(icu-bin, [ --with-icu-bin=PATH ICU binary directory], +[ + if test -d "$withval" + then + AC_MSG_RESULT([using $withval]) + icu_bin="$withval" + else + echo + AC_MSG_ERROR([$withval not found]) + fi +], +AC_MSG_RESULT(no)) +# if not found yet, try pkg-config + +# last resort +if test -z "$icu_lib"; then + AC_MSG_CHECKING(for icu with icu-config) + AC_PATH_PROG(ICU_CONFIG, icu-config) + if test -n "$ICU_CONFIG"; then + icu_lib=`$ICU_CONFIG --ldflags-searchpath` + icu_inc=`$ICU_CONFIG --cppflags-searchpath` + icu_bin=`$ICU_CONFIG --bindir` + else + AC_MSG_ERROR([ICU not found, specify with --with-icu.]) + fi +fi diff --git a/m4/mozldap.m4 b/m4/mozldap.m4 new file mode 100644 index 0000000..22bfb9d --- /dev/null +++ b/m4/mozldap.m4 @@ -0,0 +1,87 @@ +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2006 Red Hat, Inc. +# All rights reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# END COPYRIGHT BLOCK + +AC_CHECKING(for LDAPSDK) + +# check for --with-ldapsdk +AC_MSG_CHECKING(for --with-ldapsdk) +AC_ARG_WITH(ldapsdk, [ --with-ldapsdk=PATH Mozilla LDAP SDK directory], +[ + if test -e "$withval"/include/ldap.h -a -d "$withval"/lib + then + AC_MSG_RESULT([using $withval]) + LDAPSDKDIR=$withval + ldapsdk_inc="-I$LDAPSDKDIR/include" + ldapsdk_lib="-L$LDAPSDKDIR/lib" + else + echo + AC_MSG_ERROR([$withval not found]) + fi +], +AC_MSG_RESULT(no)) + +# check for --with-ldapsdk-inc +AC_MSG_CHECKING(for --with-ldapsdk-inc) +AC_ARG_WITH(ldapsdk-inc, [ --with-ldapsdk-inc=PATH Mozilla LDAP SDK include directory], +[ + if test -e "$withval"/ldap.h + then + AC_MSG_RESULT([using $withval]) + ldapsdk_inc="-I$withval" + else + echo + AC_MSG_ERROR([$withval not found]) + fi +], +AC_MSG_RESULT(no)) + +# check for --with-ldapsdk-lib +AC_MSG_CHECKING(for --with-ldapsdk-lib) +AC_ARG_WITH(ldapsdk-lib, [ --with-ldapsdk-lib=PATH Mozilla LDAP SDK library directory], +[ + if test -d "$withval" + then + AC_MSG_RESULT([using $withval]) + ldapsdk_lib="-L$withval" + else + echo + AC_MSG_ERROR([$withval not found]) + fi +], +AC_MSG_RESULT(no)) + +# if LDAPSDK is not found yet, try pkg-config + +# last resort +if test -z "$ldapsdk_inc" -o -z "$ldapsdk_lib"; then + AC_MSG_CHECKING(for mozldap with pkg-config) + AC_PATH_PROG(PKG_CONFIG, pkg-config) + if test -n "$PKG_CONFIG"; then + if $PKG_CONFIG --exists mozldap; then + nspr_inc=`$PKG_CONFIG --cflags-only-I mozldap` + nspr_lib=`$PKG_CONFIG --libs-only-L mozldap` + else + AC_MSG_ERROR([LDAPSDK not found, specify with --with-ldapsdk[-inc|-lib].]) + fi + fi +fi +if test -z "$ldapsdk_inc" -o -z "$ldapsdk_lib"; then + AC_MSG_ERROR([LDAPSDK not found, specify with --with-ldapsdk[-inc|-lib].]) +fi diff --git a/m4/nspr.m4 b/m4/nspr.m4 new file mode 100644 index 0000000..f33e041 --- /dev/null +++ b/m4/nspr.m4 @@ -0,0 +1,84 @@ +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2006 Red Hat, Inc. +# All rights reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# END COPYRIGHT BLOCK + +AC_CHECKING(for NSPR) + +# check for --with-nspr +AC_MSG_CHECKING(for --with-nspr) +AC_ARG_WITH(nspr, [ --with-nspr=PATH Netscape Portable Runtime (NSPR) directory], +[ + if test -e "$withval"/include/nspr.h -a -d "$withval"/lib + then + AC_MSG_RESULT([using $withval]) + NSPRDIR=$withval + nspr_inc="-I$NSPRDIR/include" + nspr_lib="-L$NSPRDIR/lib" + else + echo + AC_MSG_ERROR([$withval not found]) + fi +], +AC_MSG_RESULT(no)) + +# check for --with-nspr-inc +AC_MSG_CHECKING(for --with-nspr-inc) +AC_ARG_WITH(nspr-inc, [ --with-nspr-inc=PATH Netscape Portable Runtime (NSPR) include file directory], +[ + if test -e "$withval"/nspr.h + then + AC_MSG_RESULT([using $withval]) + nspr_inc="-I$withval" + else + echo + AC_MSG_ERROR([$withval not found]) + fi +], +AC_MSG_RESULT(no)) + +# check for --with-nspr-lib +AC_MSG_CHECKING(for --with-nspr-lib) +AC_ARG_WITH(nspr-lib, [ --with-nspr-lib=PATH Netscape Portable Runtime (NSPR) library directory], +[ + if test -d "$withval" + then + AC_MSG_RESULT([using $withval]) + nspr_lib="-L$withval" + else + echo + AC_MSG_ERROR([$withval not found]) + fi +], +AC_MSG_RESULT(no)) + +# if NSPR is not found yet, try pkg-config + +# last resort +if test -z "$nspr_inc" -o -z "$nspr_lib"; then + AC_MSG_CHECKING(for nspr with pkg-config) + AC_PATH_PROG(PKG_CONFIG, pkg-config) + if test -n "$PKG_CONFIG"; then + if $PKG_CONFIG --exists nspr; then + nspr_inc=`$PKG_CONFIG --cflags-only-I nspr` + nspr_lib=`$PKG_CONFIG --libs-only-L nspr` + else + AC_MSG_ERROR([NSPR not found, specify with --with-nspr.]) + fi + fi +fi diff --git a/m4/nss.m4 b/m4/nss.m4 new file mode 100644 index 0000000..ad4215b --- /dev/null +++ b/m4/nss.m4 @@ -0,0 +1,84 @@ +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2006 Red Hat, Inc. +# All rights reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# END COPYRIGHT BLOCK + +AC_CHECKING(for NSS) + +# check for --with-nss +AC_MSG_CHECKING(for --with-nss) +AC_ARG_WITH(nss, [ --with-nss=PATH Network Security Services (NSS) directory], +[ + if test -e "$withval"/include/nss.h -a -d "$withval"/lib + then + AC_MSG_RESULT([using $withval]) + NSSDIR=$withval + nss_inc="-I$NSSDIR/include" + nss_lib="-L$NSSDIR/lib" + else + echo + AC_MSG_ERROR([$withval not found]) + fi +], +AC_MSG_RESULT(no)) + +# check for --with-nss-inc +AC_MSG_CHECKING(for --with-nss-inc) +AC_ARG_WITH(nss-inc, [ --with-nss-inc=PATH Network Security Services (NSS) include directory], +[ + if test -e "$withval"/nss.h + then + AC_MSG_RESULT([using $withval]) + nss_inc="-I$withval" + else + echo + AC_MSG_ERROR([$withval not found]) + fi +], +AC_MSG_RESULT(no)) + +# check for --with-nss-lib +AC_MSG_CHECKING(for --with-nss-lib) +AC_ARG_WITH(nss-lib, [ --with-nss-lib=PATH Network Security Services (NSS) library directory], +[ + if test -d "$withval" + then + AC_MSG_RESULT([using $withval]) + nss_lib="-L$withval" + else + echo + AC_MSG_ERROR([$withval not found]) + fi +], +AC_MSG_RESULT(no)) + +# if NSS is not found yet, try pkg-config + +# last resort +if test -z "$nss_inc" -o -z "$nss_lib"; then + AC_MSG_CHECKING(for nss with pkg-config) + AC_PATH_PROG(PKG_CONFIG, pkg-config) + if test -n "$PKG_CONFIG"; then + if $PKG_CONFIG --exists nss; then + nss_inc=`$PKG_CONFIG --cflags-only-I nss` + nss_lib=`$PKG_CONFIG --libs-only-L nss` + else + AC_MSG_ERROR([NSS not found, specify with --with-nss.]) + fi + fi +fi diff --git a/missing b/missing new file mode 100755 index 0000000..894e786 --- /dev/null +++ b/missing @@ -0,0 +1,360 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2005-06-08.21 + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# Originally by Fran,cois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +msg="missing on your system" + +case "$1" in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch] + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + +esac + +# Now exit if we have it, but it failed. Also exit now if we +# don't have it and --version was passed (most likely to detect +# the program). +case "$1" in + lex|yacc) + # Not GNU programs, they don't have --version. + ;; + + tar) + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + exit 1 + fi + ;; + + *) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + # Could not run --version or --help. This is probably someone + # running `$TOOL --version' or `$TOOL --help' to check whether + # $TOOL exists and not knowing $TOOL uses missing. + exit 1 + fi + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case "$1" in + aclocal*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case "$f" in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te) + echo 1>&2 "\ +WARNING: \`$1' is needed, but is $msg. + You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` + test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison|yacc) + echo 1>&2 "\ +WARNING: \`$1' $msg. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if [ ! -f y.tab.h ]; then + echo >y.tab.h + fi + if [ ! -f y.tab.c ]; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if [ ! -f lex.yy.c ]; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` + fi + if [ -f "$file" ]; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit 1 + fi + ;; + + makeinfo) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + # The file to touch is that specified with -o ... + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + # ... or it is the one specified with @setfilename ... + infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile` + # ... or it is derived from the source name (dir/f.texi becomes f.info) + test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info + fi + # If the file does not exist, the user really needs makeinfo; + # let's fail without touching anything. + test -f $file || exit 1 + touch $file + ;; + + tar) + shift + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar "$@" && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar "$@" && exit 0 + fi + firstarg="$1" + if shift; then + case "$firstarg" in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + case "$firstarg" in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and is $msg. + You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequisites for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/newentry.c b/newentry.c new file mode 100644 index 0000000..6d89675 --- /dev/null +++ b/newentry.c @@ -0,0 +1,457 @@ +/** --- BEGIN COPYRIGHT BLOCK --- + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + --- END COPYRIGHT BLOCK --- */ +/* + * newentry.c -- CGI program to generate newentry form -- HTTP gateway + */ +#include "dsgw.h" +#include "dbtdsgw.h" + +static void emit_file(char* filename, dsgwnewtype* entType); + +static void +emit_file (char* filename, dsgwnewtype* entType) +{ + auto FILE* html = dsgw_open_html_file( filename, DSGW_ERROPT_EXIT ); + auto char line[ BIG_LINE ]; + auto int argc; + auto char **argv; + char *deleteme = NULL; + + while ( dsgw_next_html_line( html, line )) { + if ( dsgw_parse_line( line, &argc, &argv, 0, dsgw_simple_cond_is_true, NULL )) { + if ( dsgw_directive_is( line, DRCT_HEAD )) { + dsgw_head_begin(); + dsgw_emits ("\n"); + + } else if ( dsgw_directive_is( line, "DS_NEWENTRY_SCRIPT" )) { + dsgw_emits ("\n"); + + } else if ( dsgw_directive_is( line, "DS_NEWENTRY_TYPE_BODY" )) { + dsgw_emitf ("\n", + dsgw_html_body_colors ); + + } else if ( dsgw_directive_is( line, "DS_NEWENTRY_TYPE_FORM" )) { + dsgw_form_begin ("typeForm", NULL); + dsgw_emits ("\n"); + + } else if ( dsgw_directive_is( line, "DS_NEWENTRY_TYPE_SELECT" )) { + auto dsgwnewtype* ntp; + dsgw_emits ("\n" ); + + } else if ( dsgw_directive_is( line, "DS_NEWENTRY_NAME_BODY" )) { + dsgw_emits ("dsnt_loccount) { + dsgw_emits ("parent.locationChange(document.nameForm);"); + } + dsgw_emitf ("document.nameForm.entryname.focus()\" %s>\n", + dsgw_html_body_colors ); + dsgw_emit_alertForm(); + + } else if ( dsgw_directive_is( line, "DS_NEWENTRY_NAME_FORM" )) { + dsgw_form_begin ("nameForm", "action=\"" DSGW_URLPREFIX_CGI_HTTP "newentry\"" + " target=NewEntryWindow" + " onSubmit=\"return parent.submitNameForm(this)\""); + dsgw_emits ("\n"); + + if (entType) { + if (entType->dsnt_rdnattr) { + dsgw_emitf ("\n", + entType->dsnt_rdnattr); + } + if (entType->dsnt_template) { + dsgw_emitf ("\n", + entType->dsnt_template); + } + } + + } else if ( dsgw_directive_is( line, "DS_NEWENTRY_LOCATION_BEGIN" )) { + if ( ! (entType && entType->dsnt_loccount)) { + while ( dsgw_next_html_line( html, line )) { + if ( dsgw_parse_line( line, &argc, &argv, 1, dsgw_simple_cond_is_true, NULL )) { + if ( dsgw_directive_is( line, "DS_NEWENTRY_LOCATION_END" )) { + break; + } + } + } + } + + } else if ( dsgw_directive_is( line, "DS_NEWENTRY_LOCATION_SELECT" )) { + dsgw_emits (" +

+

+ + + +
+ + + diff --git a/pbconfig/authSearch.html b/pbconfig/authSearch.html new file mode 100644 index 0000000..73b17eb --- /dev/null +++ b/pbconfig/authSearch.html @@ -0,0 +1,75 @@ + + + + + + +Authenticate... + + + + + + +The first step in authenticating to the directory is identifying +yourself.
Please type your name: + +

+

+ + + +
+ +

+ + (only available to Directory Administrators) + + + diff --git a/pbconfig/display-orgperson.html b/pbconfig/display-orgperson.html new file mode 100644 index 0000000..578ee81 --- /dev/null +++ b/pbconfig/display-orgperson.html @@ -0,0 +1,419 @@ + + + + + + + + + + +<!-- IF "Adding" --> +New +<!-- ENDIF // Adding --> +Person Entry - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + + + + + + + +
Person Entry
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + New Person - + + + + + + class="linknodec"> +Click to view this person's organization chart. org chart + + Click to view this person's digital business card.  vCard + + +    + +onMouseOver="top.status='Retrieve this person\'s security certificate.'; return true">Click to retrieve this 
+person's security certificate. Get Certificate + +   +
+   + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
+ class="bold" + +> + Work Phone + + +
+ class="bold" + +> + Email Address + + +
+ class="bold" + +> + AIM ID + + + + + +
+ class="bold" + +> + Homepage + + +
 
+ class="bold" + +> + Home Phone + + +
+ class="bold" + +> + Mobile Phone + + +
+ class="bold" + +> + Pager + + +
+ class="bold" + +> + FAX + + +
 
+ class="bold" + +> + Mailing Address + + +
+ class="bold" + +> + Mailstop + + +
+ class="bold" + +> + Location + + +
+ class="bold" + +> + Cube Number + + +
 
+ + +
+ +BORDER=0> +
+ + + + + + + + + + + + + +
+ + + + + + diff --git a/pbconfig/display-orgunit.html b/pbconfig/display-orgunit.html new file mode 100644 index 0000000..50b17e0 --- /dev/null +++ b/pbconfig/display-orgunit.html @@ -0,0 +1,229 @@ + + + + + + + + + + +<!-- IF "Adding" --> +New +<!-- ENDIF // Adding --> +Organizational Unit Entry + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+   + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
+ Business Category + + +
+ Description + + +
+ Contact Phone + + +
+ Fax + + +
 
+ Location + + +
+ Mailing Address + + +
+ Mailstop + + +
+ Postal Code + + +
+ Post Office Box + + +
 
+ See Also + + +
 
+ + + +
+ + +
+ + diff --git a/pbconfig/display-room.html b/pbconfig/display-room.html new file mode 100644 index 0000000..437001c --- /dev/null +++ b/pbconfig/display-room.html @@ -0,0 +1,155 @@ + + + + + + + +<!-- IF "Adding" --> +New +<!-- ENDIF // Adding --> +Room Entry + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + New Room + + + + + +
+   + + + Room + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
+ Phone Number + + +
+ Description + + +
+ See Also + + +
 
+ +
+ + +
+ +
+ + + + + + + diff --git a/pbconfig/dsgwfilter.conf b/pbconfig/dsgwfilter.conf new file mode 100644 index 0000000..d69716b --- /dev/null +++ b/pbconfig/dsgwfilter.conf @@ -0,0 +1,121 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +################################################################################ +# +# $Id: dsgwfilter.conf,v 1.1 2006/06/01 19:43:54 rmeggins Exp $ +# +# AUTHOR: +# +# SYNOPSIS: +# LDAP filter file. +# +# HISTORY: +# 10-Oct-1997 Leif Put Phonebook under CVS control. +# +################################################################################ + + +################################################################################ +# lines like this that start with # or empty lines are ignored +# +# syntax: +# +# +# [] +# [] +# +# [] ... +# +# The "desc" should describe the filter and it should correctly complete +# both of the following phrases: +# +# One match was found for... +# Three matches were found for... +# +# The scope is optional, and should be one of: +# "base" +# "onelevel" +# "subtree" +# if it is included. +# + + +################################################################################ +# People searches. +# +"dsgw-people" + "^[a-zA-Z0-9]+=" " " "(%v))" "LDAP filter is" + + "^[+]*[0-9][ 0-9-]*$" " " "(telephoneNumber=*%v*))" "phone number ends with" + + "@" " " "(mail=%v))" "email address is" + "(mail=%v*))" "email address starts with" + + "^.[. _].*" ". _" "(|(cn=%v1* %v2-)(&(ou=%v1* %v2-)(objectclass=organizationalUnit))))" "first initial + name is" + + ".*[. _].$" ". _" "(|(cn=%v1-*)(&(ou=%v1-*)(objectclass=organizationalUnit))))" "name + last initial is" + + "[. _]" ". _" "(|(sn=%v1-)(cn=%v1-)(&(ou=%v1-)(objectclass=organizationalUnit))))" "name is" + + "^\*$" " " "(|(cn=*)(&(ou=*)(objectclass=organizationalUnit))))" "name or user id is" + + "^.$" ". " "(|(cn=%v)(&(ou=%v)(objectclass=organizationalUnit))))" "full name is" + + "^..$" ". " "(|(|(cn=%v*)(cn=*%v))(&(|(ou=%v*)(ou=*%v))(objectclass=organizationalUnit))))" "full name is" + + ".*" ". " "(|(cn=*%v1*)(uid=%v1)(&(ou=*%v1*)(objectclass=organizationalUnit))))" "name or user id is" + +# Replace the line above with the following line if you are substring +# indexing uid. If not, then only exact matches for uid will be found. +# +# ".*" ". " "(|(cn=*%v1*)(uid=*%v1*)(&(ou=*%v1*)(objectclass=organizationalUnit))))" "name or user id is" + + +################################################################################ +# Authentication searches, prioritize UID first. +# +"dsgw-auth" + ".*" " " "(uid=%v))" "UID is" + "(cn=*%v1*))" "user name is" + +# Replace the line above with the following line if you are substring +# indexing uid. +# +# "(|(cn=*%v1*)(uid=*%v1*)))" "user name is" + diff --git a/pbconfig/dsgwsearchprefs.conf b/pbconfig/dsgwsearchprefs.conf new file mode 100644 index 0000000..1730159 --- /dev/null +++ b/pbconfig/dsgwsearchprefs.conf @@ -0,0 +1,158 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# +################################################################################ +# +# $Id: dsgwsearchprefs.conf,v 1.1 2006/06/01 19:43:54 rmeggins Exp $ +# +# AUTHOR: +# +# SYNOPSIS: +# Search preference configuration file. +# +# HISTORY: +# 10-Oct-1997 Leif Put Phonebook under CVS control. +# +################################################################################ + + +################################################################################ +# dsgwsearchprefs.conf - directory server gateway search object definitions +# the current version of this file format is 1 +# +Version 1 + + +################################################################################ +# +# Name for this search object +People + + +################################################################################ +# options (the only one supported right now is "internal" which means that +# this search object should not be presented directly to the user) +# use "" for none +# +"" + + +################################################################################ +# Label to place before text box user types in +# +"Search For:" + + +################################################################################ +# Filter prefix to append to all searches +# +"(&(|(objectClass=Person)(objectClass=inetOrgPerson)(objectClass=organizationalUnit)(objectClass=Room))" + + +################################################################################ +# Tag to use for "Fewer Choices" searches - from ldapfilter.conf file +# +"dsgw-people" + + +################################################################################ +# If a search results in > 1 match, retrieve this attribute to help +# user disambiguate the entries... +# +not-used-by-dsgw + + +################################################################################ +# ...and label it with this string: +# +not-used-by-dsgw + + +################################################################################ +# Search scope to use when searching +# +subtree + + +################################################################################ +# Follows a list of "More Choices" search options. Format is: +# Label, attribute, select-bitmap, extra attr display name, extra attr ldap name +# If last two are null, "Fewer Choices" name/attributes used +# +"full name" cn 111111 "" "" +"last name" sn 111111 "" "" +"phone number" "telephoneNumber" 111011 "" "" +"e-mail address" "mail" 111111 "" "" +"user id" "uid" 111111 "" "" +"title" title 111111 "" "" +END +# Match types +"is" "(%a=%v))" +"is not" "(!(%a=%v)))" +"sounds like" "(%a~=%v))" +"starts with" "(%a=%v*))" +"ends with" "(%a=*%v))" +"contains" "(%a=*%v*))" +END + + +################################################################################ +# Authentication search configuration, used when editing an entry. +# +Auth +internal +"Authenticate As:" +"(&(objectClass=person)" +"dsgw-auth" +not-used-by-dsgw +not-used-by-dsgw +subtree +"common name" cn 111111 "" "" +"surname" sn 111111 "" "" +"phone number" "telephoneNumber" 111011 "" "" +"e-mail address" "mail" 111111 "" "" +"user id" "uid" 111111 "" "" +"title" title 111111 "" "" +END +"is" "(%a=%v))" +"is not" "(!(%a=%v)))" +"sounds like" "(%a~=%v))" +"starts with" "(%a=%v*))" +"ends with" "(%a=*%v))" +"contains" "(%a=*%v*))" +END diff --git a/pbconfig/edit-passwd.html b/pbconfig/edit-passwd.html new file mode 100644 index 0000000..2ab442f --- /dev/null +++ b/pbconfig/edit-passwd.html @@ -0,0 +1,142 @@ + + + + + + +Change Password - +<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "options=nolink" --> + + + + + + + + + + + +
Person Entry
+ + + + + +
+ + + + + + + + + + +
+ + + Change Password for + +
+ +

+ + + + + + + + + + + + + + + + + + + +
+Enter the old password: + + +
+Enter the old password: + + +
+Enter the new password: + + +
+Enter the new password again to confirm: + + +
+ +

+ + + + + + + +
+ + + + + + + +
+ + + + + + + diff --git a/pbconfig/list-Auth.html b/pbconfig/list-Auth.html new file mode 100644 index 0000000..5a9c570 --- /dev/null +++ b/pbconfig/list-Auth.html @@ -0,0 +1,147 @@ + + + + +Authenticate as... + + + + + + + + + + +
Authenticate as...
+ + + + +
+ +

+ + +> + +
+ + + + + + + + + +
+ +
+

+ +

+ +

+ +Please click on the name of the entry you would like to use for authentication. +

+

+ + + + + + + + + + +
Authenticate AsTitle
+ + + + + + +
+ +Please go back and try again. + +

+ +
+ + + + + + +
+ + +
+ +
+ + diff --git a/pbconfig/list-People.html b/pbconfig/list-People.html new file mode 100644 index 0000000..42cbeed --- /dev/null +++ b/pbconfig/list-People.html @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
  +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Name + + ID + + Phone + + E-mail + + AIM ID + + Group +
+ + + + + + + + + + + + +
+ +
+  
+ Click on an entry's ID to bring up more information about that entry. +
+ + +

+

+ No entries match the requested search term. Please try a different search. +
+

+ + + + diff --git a/pbconfig/pb.tmpl b/pbconfig/pb.tmpl new file mode 100644 index 0000000..8d29ab5 --- /dev/null +++ b/pbconfig/pb.tmpl @@ -0,0 +1,174 @@ +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# In addition, as a special exception, Red Hat, Inc. gives You the additional +# right to link the code of this Program with code not covered under the GNU +# General Public License ("Non-GPL Code") and to distribute linked combinations +# including the two, subject to the limitations in this paragraph. Non-GPL Code +# permitted under this exception must only link to the code of this Program +# through those well defined interfaces identified in the file named EXCEPTION +# found in the source code files (the "Approved Interfaces"). The files of +# Non-GPL Code may instantiate templates or use macros or inline functions from +# the Approved Interfaces without causing the resulting work to be covered by +# the GNU General Public License. Only Red Hat, Inc. may make changes or +# additions to the list of Approved Interfaces. You must obey the GNU General +# Public License in all respects for all of the Program code and other code used +# in conjunction with the Program except the Non-GPL Code covered by this +# exception. If you modify this file, you may extend this exception to your +# version of the file, but you are not obligated to do so. If you do not wish to +# provide this exception without modification, you must delete this exception +# statement from your version and license this file solely under the GPL without +# exception. +# +# +# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK + +baseurl "ldap://@host@:@port@/@suffix@" + +dirmgr "@dirmgr@" + +location-suffix @suffix@ + +securitypath "@contextdir@" + +url-orgchart-base http://@host@:@port@/clients/orgchart/bin/org?context=pb&data= + +# The attribute the orgchart uses to search for entries. +# This value should correspond to the value of attrib-farleft-rdn +# in the orgchart's config.txt configuration file. +orgchart-attrib-farleft-rdn uid + +# Check for Aim presence when the user's entry is displayed +enable-aim-presence true + +# The htmldir directive tells the CGIs where to find the html files +htmldir ../pbhtml + +# The configdir directive tells the CGIs where to find the +# templates/configuration files +configdir ../pbconfig + +# The gwnametrans directive tells the CGIs what url to output +# for http redirection. It should be the same nameTrans set +# in the webserver, if any is being is used. +gwnametrans /clients/dsgw/pbhtml/ + +# The authlifetime directive specifies how long authentication credentials +# are valid (in seconds). +authlifetime 7200 + +# The libNLS data directory. This directory should contain a directory +# named "locales", which contains the configuration files LANG.ctx and +# LANG.txt for each supported language (locale). +NLS ../../../lib/nls + +# The default character set, for communication with HTTP clients. +# A client may override this default, using an HTTP Accept-Charset header. +# Or, this default may be overridden for a specific language, by creating +# a LANG/dsgwcharset.conf file which contains the charset name. +# For compatibility with HTTP clients that can't handle an HTTP response +# with a charset parameter in the content-type, comment out this directive; +# responses will be sent in ISO-8859-1, with no explicit charset parameter. +# RFC 1345 defines the syntax of charset names. There is a registry of +# charsets, at ftp://ftp.isi.edu/in-notes/iana/assignments/character-sets +# charset UTF-8 + +# ignoreAcceptCharsetFrom [ ] +# where each of whose values is the version string (or part of the version +# string) sent by an HTTP client which can't / doesn't want to handle UTF-8. +# Charset from dsgwcharset.conf or charset directive is used (in the order). +# ignoreAcceptCharsetFrom Mozilla/4.01x-NSCP Mozilla/3 + +# Substitute ideographic space for non-breaking space in Asian charsets: +changeHTML "  " " " Shift_JIS Big5 EUC-KR EUC-JP +changeHTML " " " " Shift_JIS Big5 EUC-KR EUC-JP + +# Mapping between config/display-XXX.html templates and LDAP objectClasses. +# This can be generated by using ds/templateindex. The format is: +# +# template TEMPLATENAME OBJECTCLASSES +# +# where "display-TEMPLATENAME.html" is the name of a display template +# that is found in this config directory (e.g., "display-group.html") and +# OBJECTCLASSES is a list of one or more objectClass values. For a given +# template to be used, all the objectClass values listed must be present +# in the directory entry, so the order of these template lines is +# significant (e.g. note that the more specific "orgperson" template is +# listed before the one for an ordinary "person"). +# +template orgunit organizationalUnit +template room room +template orgperson person inetOrgPerson + + +# +# The remainder of this file contains information about the locations and +# types for new entries. +# +# "location" lines define places in the directory where new entries can be added +# The format of each line is: +# location HANDLE FRIENDLYNAME DN +# where HANDLE is a short name which is used in the "newtype" lines (see below) +# and FRIENDLYNAME is a human-readable name for the location +# and DN is the Distinguished Name for this location (if it does not end with +# '#', the location-suffix is appended to to construct a full DN; if it +# does end with `#', it assumed to be a full DN and the `#' is removed). +# +location country "United States" "c=US#" +location org "This Organization" "" +location groups "Groups" "ou=Groups" +location people "People" "ou=People" +location special "Special Users" "ou=Special Users" + +# "newtype" lines define the types of new entries that may be added +# The format of each line is: +# newtype TEMPLATENAME FRIENDLYNAME RDNATTR LOCATIONS... +# where TEMPLATENAME corresponds to an existing display-TEMPLATENAME.html file +# and FRIENDLYNAME is a human-readable name for this type of entry +# and RDNATTR is the attribute that is used to name entries of this type +# and LOCATIONS is a blank-separated list of locations where these types of +# entries can be added (corresponding to a HANDLE on a "location" +# config. file line). +# +newtype orgperson "Person" uid people special +newtype ntperson "NT Person" uid people special +newtype ntgroup "NT Group" cn groups +newtype groupun "Group" cn groups +newtype orgunit "Organizational Unit" ou people org +newtype org "Organization" o country + +# Mappings between VCard properties and LDAP attribute types: +# The format of each line is: +# vcard-property VCARDPROP SYNTAX LDAPATTR [LDAPATTR2] +# where VCARDPROP is the name of a VCard property +# and SYNTAX is "cis" for simple strings and "mls" for multiline strings +# and LDAPATTR is the LDAP attribute that corresponds to VCARDPROP +# and LDAPATTR2 is an optional secondary LDAP attribute which is added to +# the property value by appending a semicolon and then the attr2 value. +vcard-property FN cis cn +vcard-property N cis sn givenName +vcard-property ORG cis o ou +vcard-property ROLE cis businessCategory +vcard-property ADR;WORK mls postalAddress +vcard-property ADR;HOME mls homePostalAddress +vcard-property EMAIL;INTERNET cis mail +vcard-property TITLE cis title +vcard-property TEL;WORK cis telephoneNumber +vcard-property TEL;FAX cis facsimileTelephoneNumber +vcard-property TEL;CELL cis mobile +vcard-property TEL;HOME cis homePhone +vcard-property NOTE cis description + diff --git a/pbhtml/16-conference.gif b/pbhtml/16-conference.gif new file mode 100644 index 0000000..57b9bfd Binary files /dev/null and b/pbhtml/16-conference.gif differ diff --git a/pbhtml/16-person.gif b/pbhtml/16-person.gif new file mode 100644 index 0000000..456e9b2 Binary files /dev/null and b/pbhtml/16-person.gif differ diff --git a/pbhtml/32-alert.gif b/pbhtml/32-alert.gif new file mode 100644 index 0000000..453d1b2 Binary files /dev/null and b/pbhtml/32-alert.gif differ diff --git a/pbhtml/32-conference.gif b/pbhtml/32-conference.gif new file mode 100644 index 0000000..2c0d72e Binary files /dev/null and b/pbhtml/32-conference.gif differ diff --git a/pbhtml/32-message.gif b/pbhtml/32-message.gif new file mode 100644 index 0000000..e46c67a Binary files /dev/null and b/pbhtml/32-message.gif differ diff --git a/pbhtml/32-office.gif b/pbhtml/32-office.gif new file mode 100644 index 0000000..0e3591f Binary files /dev/null and b/pbhtml/32-office.gif differ diff --git a/pbhtml/32-person.gif b/pbhtml/32-person.gif new file mode 100644 index 0000000..93439d0 Binary files /dev/null and b/pbhtml/32-person.gif differ diff --git a/pbhtml/aim-online.gif b/pbhtml/aim-online.gif new file mode 100644 index 0000000..b364017 Binary files /dev/null and b/pbhtml/aim-online.gif differ diff --git a/pbhtml/alert.html b/pbhtml/alert.html new file mode 100644 index 0000000..22821bf --- /dev/null +++ b/pbhtml/alert.html @@ -0,0 +1,55 @@ + + + + +<!-- DS_POSTEDVALUE "NAME=TITLE" --> + + + + + + + +
Alert + +
+
+ +
+ diff --git a/pbhtml/carded.html b/pbhtml/carded.html new file mode 100644 index 0000000..db9ac9c --- /dev/null +++ b/pbhtml/carded.html @@ -0,0 +1,75 @@ + + + + vCard + + + + + + + + + + + diff --git a/pbhtml/clear.gif b/pbhtml/clear.gif new file mode 100644 index 0000000..35d42e8 Binary files /dev/null and b/pbhtml/clear.gif differ diff --git a/pbhtml/conference.gif b/pbhtml/conference.gif new file mode 100644 index 0000000..ce0222d Binary files /dev/null and b/pbhtml/conference.gif differ diff --git a/pbhtml/confirm.html b/pbhtml/confirm.html new file mode 100644 index 0000000..371f582 --- /dev/null +++ b/pbhtml/confirm.html @@ -0,0 +1,61 @@ + + + + +<!-- DS_POSTEDVALUE "NAME=TITLE" --> + + + + + + + +
Confirm + +
+
+ + + +
+ + + +
+ diff --git a/pbhtml/department.gif b/pbhtml/department.gif new file mode 100644 index 0000000..2d0b153 Binary files /dev/null and b/pbhtml/department.gif differ diff --git a/pbhtml/emptyFrame.html b/pbhtml/emptyFrame.html new file mode 100644 index 0000000..ca3671b --- /dev/null +++ b/pbhtml/emptyFrame.html @@ -0,0 +1,38 @@ + + diff --git a/pbhtml/get_cert.gif b/pbhtml/get_cert.gif new file mode 100644 index 0000000..9f08a22 Binary files /dev/null and b/pbhtml/get_cert.gif differ diff --git a/pbhtml/get_cert_sm.gif b/pbhtml/get_cert_sm.gif new file mode 100644 index 0000000..c0c7688 Binary files /dev/null and b/pbhtml/get_cert_sm.gif differ diff --git a/pbhtml/index.html b/pbhtml/index.html new file mode 100644 index 0000000..bdcf196 --- /dev/null +++ b/pbhtml/index.html @@ -0,0 +1,68 @@ + + + + + +Directory Express + + + + + + + + + + + + + diff --git a/pbhtml/intro.html b/pbhtml/intro.html new file mode 100644 index 0000000..2b66574 --- /dev/null +++ b/pbhtml/intro.html @@ -0,0 +1,238 @@ + + + +Directory Express + + + + + + + + + + + + + + + + + + +
+

+  
+ About Directory Express +
  +

+
+ Directory Express displays people, conference rooms, buildings and branch offices. + If multiple entries are found, the results are displayed in a table: +
+   +
+ +
+ + + + + + + + + + + + + + + +
+ Found x entries where the name or user ID matches 'your search'. +
  +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+   + + Name + + ID + + Phone + + E-mail + + Group +
+ + + Jane Castle + + jane + + 4444 + + jane@example.com + + engineering +
+ + + John Castle + + john + + 5555 + + john@example.com + + marketing +
+ + + King's Castle + + King's Castle + + 2121 + +   + +   +
+ + + Quincy Castlegate + + quincy + + 7777 + + quincy@example.com + + product development +
+ +
+  
+ Click on an entry's ID to bring up more information about that entry. +
+ +
+ + + + + + + + + + + +
+   +
+ If a single, unique entry is found, all information pertaining to that entry is + displayed. Users can edit portions of their personal information by displaying + their information as described above, and clicking the "Edit Person" + button at the bottom of the their entry. +
+ + + + + + + diff --git a/pbhtml/modify.html b/pbhtml/modify.html new file mode 100644 index 0000000..94fba69 --- /dev/null +++ b/pbhtml/modify.html @@ -0,0 +1,323 @@ + + + + + + +Directory Express + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+LEGEND + + + +
User-editable Users can edit their own information.
Administrator Email changes to the Directory Express Administrator team.
Help Request Fill out an online Help Request.
Call Helpdesk 555-1111 Please don't call between 10-12, and 2-4 Pacific Time
PeopleSoft Form- Employees Legal Name changes: Use the online Change of Employee Information form. +
+ All others: Download the Employee Change Sheet, print it, fill it out and give it to your divisional HR representative.
Special Email- Vendors, Services, and Other ContractorsThe conditions of your contract determine who gets your Email request.
+

+ + + +

+ +
+ + + +
+Person + +Your Name Here
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Contact Information
Phone: +Administrator +E-Mail Address: +Help Request +
User ID: +Help Request +Mailstop: + +Administrator +
First Name: +Call Helpdesk 555-1111 +Pager: +User-editable +
Last Name: + +Call Helpdesk 555-1111 +Legal Name:Employees: + PeopleSoft +Form
Vendors, Services, and Other Contractors: Special Email + +
Home Phone:
(optional) +
+User-editable +Mobile Phone: +User-editable +
Fax: +User-editable +
+ + + + +

+

+ + + + + + + + + + + + + + + + +
Location Information
Mailing Address:Administrator
Building #:AdministratorBuilding Level:Administrator
Physical Location: Administrator
+ +

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Business Information
Business Category:Employees:PeopleSoft Form
Vendors, Services, and Other Contractors: Special Email
Title:Employees:PeopleSoft Form
Vendors, Services, and Other Contractors: Special Email
Organizational Unit:Employees:PeopleSoft Form
Vendors, Services, and Other Contractors Special Email
Manager:Employees:PeopleSoft Form
Vendors, Services, and Other Contractors: Special Email
Cube #:AdministratorAdmin.:Administrator
Dept#:Employees:PeopleSoft Form
Vendors, Services, and Other Contractors: Special Email
Employee Status:Employees:PeopleSoft Form
Vendors, Services, and Other Contractors: Special Email
Vehicle License#:User-editableCurrent Contact Info.User-editable
+ + +

+

+ + + + + + + + + + + + + + + + + +
Additional Information
Description:User-editable
See Also:User-editable
URL:User-editable
+ +

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
Mail Information
Mail Server: +Help RequestMail Addresses:Help Request
Autoreply mode:User-editable
Autoreply Text:User-editable
Mail Delivery Option: +User-editableForwarding Addresses:User-editable
+ +

+

+ + + + + + + + diff --git a/pbhtml/nonemp.html b/pbhtml/nonemp.html new file mode 100644 index 0000000..2becc02 --- /dev/null +++ b/pbhtml/nonemp.html @@ -0,0 +1,100 @@ + + + + + + + Non-employee Directory Express Changes + + + + +

+

Non-employee Directory Express Changes

+
+ +

Send your change requests to the person that matches your affiliation.

+ + + + + + + + + + + + + + + + + + + + + + + +
+The Amazing Non-employee Request Director + + +
Your Affiliation:Send Requests to:
Independent ContractorChristina Champagne
Interim TemporaryAdministrative Temps. or Contractors contact Lisa Holcomb
+ Technical Temps. or Contractors contact Lisa Livingston +
Vendors & ServicesAndrea Kimerer
+ + + diff --git a/pbhtml/nullStringError.html b/pbhtml/nullStringError.html new file mode 100644 index 0000000..4f6dcac --- /dev/null +++ b/pbhtml/nullStringError.html @@ -0,0 +1,95 @@ + + + +Error! + + + + +

+   +

+ + + + +
+ + + + + +
+
+ + + + + + + + + + + + + + +
+ + +   + + No search term entered. +
+   +
+   + + Directory Express searches against an entry's name, user ID, and phone extension. + Please enter a search term and try again. +
+ +
+
+ +
+ + + diff --git a/pbhtml/office.gif b/pbhtml/office.gif new file mode 100644 index 0000000..558ba18 Binary files /dev/null and b/pbhtml/office.gif differ diff --git a/pbhtml/orgicon.gif b/pbhtml/orgicon.gif new file mode 100644 index 0000000..034f2c2 Binary files /dev/null and b/pbhtml/orgicon.gif differ diff --git a/pbhtml/pbrd.jpg b/pbhtml/pbrd.jpg new file mode 100644 index 0000000..ab92e6e Binary files /dev/null and b/pbhtml/pbrd.jpg differ diff --git a/pbhtml/person.gif b/pbhtml/person.gif new file mode 100644 index 0000000..671869c Binary files /dev/null and b/pbhtml/person.gif differ diff --git a/pbhtml/phone.html b/pbhtml/phone.html new file mode 100644 index 0000000..9a638b7 --- /dev/null +++ b/pbhtml/phone.html @@ -0,0 +1,112 @@ + + + + +Directory Express + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +Directory Express + + + + + +
+ Search for: + + + + + + + +
+
+
+ + diff --git a/pbhtml/phone.js b/pbhtml/phone.js new file mode 100755 index 0000000..e5a687f --- /dev/null +++ b/pbhtml/phone.js @@ -0,0 +1,76 @@ +// +// --- BEGIN COPYRIGHT BLOCK --- +// This Program is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation; version 2 of the License. +// +// This Program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along with +// this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +// Place, Suite 330, Boston, MA 02111-1307 USA. +// +// In addition, as a special exception, Red Hat, Inc. gives You the additional +// right to link the code of this Program with code not covered under the GNU +// General Public License ("Non-GPL Code") and to distribute linked combinations +// including the two, subject to the limitations in this paragraph. Non-GPL Code +// permitted under this exception must only link to the code of this Program +// through those well defined interfaces identified in the file named EXCEPTION +// found in the source code files (the "Approved Interfaces"). The files of +// Non-GPL Code may instantiate templates or use macros or inline functions from +// the Approved Interfaces without causing the resulting work to be covered by +// the GNU General Public License. Only Red Hat, Inc. may make changes or +// additions to the list of Approved Interfaces. You must obey the GNU General +// Public License in all respects for all of the Program code and other code used +// in conjunction with the Program except the Non-GPL Code covered by this +// exception. If you modify this file, you may extend this exception to your +// version of the file, but you are not obligated to do so. If you do not wish to +// provide this exception without modification, you must delete this exception +// statement from your version and license this file solely under the GPL without +// exception. +// +// +// Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +// Copyright (C) 2005 Red Hat, Inc. +// All rights reserved. +// --- END COPYRIGHT BLOCK --- +// +function goToURL(i){ +window.location.href=i; +} + +function easter(){ +if (document.forms[0].searchstring.value=='worker and parasite'){ + window.open ("worker.qt","worker","scrollbars=no,menubar=no,resizable=no,width=300,height=300"); + } +} + +function flipImg(currImg,newImg) { + document.images[currImg].src = newImg; +} + +function phoneTeam (){ + + window.open ("team.html","rah_team","scrollbars=no,menubar=no,resizable=yes,width=500,height=500"); + +} + +function fieldFocus(){ +setTimeout("document.forms[0].searchstring.focus()",400); +} + +function checkForNullString(){ +if (document.forms[0].searchstring.value != "") + { + return true; + } +else + { + parent.resultframe.location="/dsgw/bin/lang?context=pb&file=nullStringError.html"; + return false; + } +} + + diff --git a/pbhtml/pixel.gif b/pbhtml/pixel.gif new file mode 100644 index 0000000..e66849a Binary files /dev/null and b/pbhtml/pixel.gif differ diff --git a/pbhtml/report.html b/pbhtml/report.html new file mode 100644 index 0000000..b3768fb --- /dev/null +++ b/pbhtml/report.html @@ -0,0 +1,186 @@ + + + + + Telephone Book: Reports + + + + +

+ +

+ +

Make a report that looks like this table: +

+ +

+


+ +
+ + + + + + + + + + + + + + + + + +
+

+
+ +

+


+ +
+ + + + + + + + + +
The report has entries where includes
+ +
+ + + + + + + + + + + + + + + +
+

+
and is sorted by and then by and then by . +
+ +
+ + + +
Should the report have multiple smaller tables?  Yes +No
+ +


+
+
+

+ +
+ + + + + +
+ +

+ + + diff --git a/pbhtml/rolodex.gif b/pbhtml/rolodex.gif new file mode 100644 index 0000000..515c0d2 Binary files /dev/null and b/pbhtml/rolodex.gif differ diff --git a/pbhtml/style.css b/pbhtml/style.css new file mode 100644 index 0000000..34df36d --- /dev/null +++ b/pbhtml/style.css @@ -0,0 +1,127 @@ +/* --- BEGIN COPYRIGHT BLOCK + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + * --- END COPYRIGHT BLOCK --- */ + +/* ======================================================= * + * Style sheet for the Directory Express application * + * ======================================================= */ + +/* All Links */ +A:link { font-family: verdana, Arial, Helvetica, sans-serif; font-size: 11px} +A:active { color: #FF0000;} + +.linknodec {text-decoration:none; color:#000000; font-family: verdana, Arial, Helvetica, sans-serif; font-size: 11px} + +/*All Regular Table Data--for the whole application*/ +td { + font-family: verdana, Arial, Helvetica, sans-serif; + font-size: 11px; + color: #000000; + vertical-align : middle; +} + +p { + font-family: verdana, Arial, Helvetica, sans-serif; + font-size: 11px; + color: #000000; +} + + +td.bold { + font-family: verdana, Arial, Helvetica, sans-serif; + font-size: 11px; + vertical-align : middle; + color: #000000; + font-weight: bold; +} + +td.boldbig { + font-family: verdana, Arial, Helvetica, sans-serif; + font-size: 12px; + vertical-align : middle; + color: #000000; + font-weight: bold; +} + +input { + font-family: verdana, Arial, Helvetica, sans-serif; + font-size: 11px; + /*color: #000000;*/ +} + + +A.searchlinknorm:link {color: #CCFFFF} +A.searchlinknorm:visited {color: #CCFFFF} +A.searchlinknorm:active {color: #CCFFFF} + +A.searchlinkspec:link {color: #FF0000} +A.searchlinkspec:visited {color: #FF0000} +A.searchlinkspec:active {color: #CCFFFF} + +/* *********Search frame*************/ + +body.Search { + background-color: #000000; + font-family: Verdana, Arial, Helvetica, san-serif; + color: #ccffff; + font-size: 12px; +} + +td.appName { + font-family: verdana, Arial, Helvetica, sans-serif; + font-size: 16px; + vertical-align : middle; + color: #ffffff; + font-weight: bold; +} + +.apptext { + font-family: verdana, Arial, Helvetica, sans-serif; + font-size: 12px; + vertical-align: middle; + color: #ffffff; + font-weight: bold; +} + +/* Fonts */ +.text15 {color: #ffffff; font-size: 12px; font-family: Verdana, Arial, Helvetica; font-weight: bold;} +.text30 {color: #CCFFFF; font-size: 8px; font-family: Verdana, Arial, Helvetica;} +.text31 {color: #000000; font-size: 14px; font-family: Verdana, Arial, Helvetica; font-weight: bold;} + +.bgColor1 {background-color: #003366;} +.bgColor4 {background-color: #cccccc;} +.bgColor7 {background-color: #66ccff;} diff --git a/pbhtml/tiny_cert.gif b/pbhtml/tiny_cert.gif new file mode 100644 index 0000000..c8cec6e Binary files /dev/null and b/pbhtml/tiny_cert.gif differ diff --git a/pbhtml/tiny_vcard.gif b/pbhtml/tiny_vcard.gif new file mode 100644 index 0000000..a1fcd54 Binary files /dev/null and b/pbhtml/tiny_vcard.gif differ diff --git a/pbhtml/vendor.gif b/pbhtml/vendor.gif new file mode 100644 index 0000000..d2aafd1 Binary files /dev/null and b/pbhtml/vendor.gif differ diff --git a/pbhtml/view_vcard.gif b/pbhtml/view_vcard.gif new file mode 100644 index 0000000..61f3420 Binary files /dev/null and b/pbhtml/view_vcard.gif differ diff --git a/pbhtml/view_vcard_sm.gif b/pbhtml/view_vcard_sm.gif new file mode 100644 index 0000000..98aa322 Binary files /dev/null and b/pbhtml/view_vcard_sm.gif differ diff --git a/propmaker.c b/propmaker.c new file mode 100644 index 0000000..b77092a --- /dev/null +++ b/propmaker.c @@ -0,0 +1,134 @@ +/** BEGIN COPYRIGHT BLOCK + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + * END COPYRIGHT BLOCK **/ + +#include +#include +#include + +#define RESOURCE_STR + +/********************************************/ +/* Begin: Application dependent information */ +/********************************************/ + +#include "dbtdsgw.h" +#define GSXXX_H_INCLUDED + +/********************************************/ +/* End: Application dependent information */ +/********************************************/ + +/*******************************************************************************/ + +/*******************************************************************************/ + +static int +XP_MakeStringProperties(const char *dbfile) +{ + char* LibraryName; + res_RESOURCE_TABLE* table = dsgw; + FILE *hresfile; + char buffer[2000]; + char *src, *dest; + + hresfile = fopen(dbfile, "w"); + + if (hresfile==NULL) { + printf("Error creating properties file %s\n",dbfile); + return 1; + } + + LibraryName = table->str; + printf("Add Library %s\n",LibraryName); + fprintf(hresfile, "//\n"); + fprintf(hresfile, "// #######################################\n"); + fprintf(hresfile, "// ############### %s ###############\n", LibraryName); + fprintf(hresfile, "// ICU resource file\n"); + fprintf(hresfile, "\n"); + fprintf(hresfile, "root {\n"); + fprintf(hresfile, "\n"); + table++; + while (table->str) { + /* + Change special char to \uXXXX + */ + src = table->str; + dest = buffer; + while (*src && (sizeof(buffer) > (dest-buffer))) { + if (*src < 0x20) { + strcpy(dest,"\\u00"); + dest += 4; + sprintf(dest, "%02x", *src); + dest += 1; + } + else if (*src == '"') { /* escape double quotes */ + strcpy(dest, "\\"); + dest++; + *dest = *src; + } + else { + *dest = *src; + } + src ++; + dest ++; + } + *dest = '\0'; + + if (table->id > 0) { + fprintf(hresfile, "%s%d { \"%s\" }\n", LibraryName, table->id, buffer); + } + table++; + } + + fprintf(hresfile, "\n"); + fprintf(hresfile, "}\n"); + fclose(hresfile); + return 0; +} + + + + +/*******************************************************************************/ + +int main(int argc, char *argv[]) +{ + return XP_MakeStringProperties(argv[1]); +} + +/*******************************************************************************/ diff --git a/search.c b/search.c new file mode 100644 index 0000000..386c7ce --- /dev/null +++ b/search.c @@ -0,0 +1,245 @@ +/** --- BEGIN COPYRIGHT BLOCK --- + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + --- END COPYRIGHT BLOCK --- */ +/* + * search.c -- CGI program to generate smart search form -- HTTP gateway + */ + +#include "dsgw.h" +#include "dbtdsgw.h" +static void get_request(char *docname); +static void do_searchtype_popup( struct ldap_searchobj *sop ); + + +int main( argc, argv, env ) + int argc; + char *argv[]; +#ifdef DSGW_DEBUG + char *env[]; +#endif +{ + auto int reqmethod; + char *docname = NULL; + char *qs = NULL; + + /* Parse out the file=blah.html */ + if (( qs = getenv( "QUERY_STRING" )) != NULL && *qs != '\0' ) { + /* parse the query string: */ + auto char *p, *iter = NULL; + qs = dsgw_ch_strdup( qs ); + + for ( p = ldap_utf8strtok_r( qs, "&", &iter ); p != NULL; + p = ldap_utf8strtok_r( NULL, "&", &iter )) { + + /* + * Get the conf file name. It'll be translated + * into /dsgw/context/CONTEXT.conf if + * CONTEXT is all alphanumeric (no slahes, + * or dots). CONTEXT is passed into the cgi. + * if context=CONTEXT is not there, or PATH_INFO + * was used, then use dsgw.conf + */ + if ( !strncasecmp( p, "context=", 8 )) { + context = dsgw_ch_strdup( p + 8 ); + dsgw_form_unescape( context ); + continue; + } + + + /*Get the filename and check it for naughtiness -RJP*/ + if ( !strncasecmp( p, "file=", 5 )) { + docname = dsgw_ch_strdup( p + 5 ); + dsgw_form_unescape( docname ); + + /* + * Make sure the person isn't trying to get + * some file not in the gateway. + */ + if (! dsgw_valid_docname(docname)) { + dsgw_error( DSGW_ERR_BADFILEPATH, docname, + DSGW_ERROPT_EXIT, 0, NULL ); + } + continue; + } + + + } + + free( qs ); qs = NULL; + } + + + reqmethod = dsgw_init( argc, argv, DSGW_METHOD_GET ); + dsgw_send_header(); + +#ifdef DSGW_DEBUG + dsgw_logstringarray( "env", env ); +{ + char buf[ 1024 ]; + getcwd( buf, sizeof(buf)); + dsgw_log( "cwd: \"%s\"\n", buf ); +} +#endif + + if ( reqmethod == DSGW_METHOD_GET ) { + get_request(docname); + } + exit( 0 ); +} + + +static void +get_request(char *docname) +{ + + auto char* filename = NULL; + auto struct ldap_searchobj* sop = NULL; + + if (docname != NULL && *docname == '/') { + docname++; + } + + if ( docname == NULL || *docname == '\0' ) { + filename = "search.html"; + } else if ( !strcmp( docname, "string" )) { + filename = "searchString.html"; + dsgw_init_searchprefs( &sop ); + } + if (filename) { + auto FILE* html = dsgw_open_html_file( filename, DSGW_ERROPT_EXIT ); + auto char line[ BIG_LINE ]; + auto int argc; + auto char **argv; + + while ( dsgw_next_html_line( html, line )) { + if ( dsgw_parse_line( line, &argc, &argv, 0, dsgw_simple_cond_is_true, NULL )) { + if ( dsgw_directive_is( line, "HEAD" )) { + dsgw_head_begin(); + dsgw_emits ("\n"); + } else if ( dsgw_directive_is( line, "DS_SEARCH_SCRIPT" )) { + dsgw_emits ("\n"); + + } else if ( dsgw_directive_is( line, "DS_SEARCH_BODY" )) { + dsgw_emitf ("\n", + dsgw_html_body_colors ); + dsgw_emit_alertForm(); + + } else if ( dsgw_directive_is( line, "DS_SEARCH_FORM" )) { + dsgw_form_begin ("searchForm", "action=\"%s\" %s %s", + dsgw_getvp( DSGW_CGINUM_DOSEARCH ), + "onSubmit=\"return top.validate(this)\"", + argc > 0 ? argv[0] : ""); + dsgw_emitf ("\n" + "\n" + "\n" + "\n" + "\n", + gc->gc_ldapsearchbase, gc->gc_ldapserver, gc->gc_ldapport ); + } else if ( dsgw_directive_is( line, "DS_SEARCH_BASE" )) { +#ifdef NOTFORNOW + /* ldap_dn2ufn currently gobbles up 'dc' so don't use */ + /* it for now */ + auto char* ufn = ldap_dn2ufn( gc->gc_ldapsearchbase ); + dsgw_emits( ufn ); + free( ufn ); +#else + dsgw_emits( gc->gc_ldapsearchbase ); +#endif + } else if ( dsgw_directive_is( line, "DS_SEARCH_TYPE" )) { + do_searchtype_popup( sop ); + } else if ( dsgw_directive_is( line, "DS_HELP_BUTTON" )) { + dsgw_emit_helpbutton (argc > 0 ? argv[0] : ""); + } else { + dsgw_emits (line); + } + dsgw_argv_free( argv ); + } + } + fclose (html); + } +} + + +static void +do_searchtype_popup( +struct ldap_searchobj *sop +) +{ + int first = 1; + struct ldap_searchobj *so; + + dsgw_emits( "\n" ); +} diff --git a/secglue.c b/secglue.c new file mode 100644 index 0000000..576bfec --- /dev/null +++ b/secglue.c @@ -0,0 +1,194 @@ +/** --- BEGIN COPYRIGHT BLOCK --- + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + --- END COPYRIGHT BLOCK --- */ +/* + * secglue.c: Glue routines for the httpd.so shared object. These are + * necessary because on many system no garbage collection is performed for + * shared objects. + * + * Rob McCool + * + * Adapted for DSGW by Mark Smith 18 Aug 1997. + * Copied from revision 1.4.4.6.4.1 of ldapserver/httpd/newadmin/src/secglue.c + */ + +#ifdef __cplusplus +#define FUNC(name) extern "C" { void name (void) {} } +#else +#define FUNC(name) void name (void) {} +#endif + +FUNC(DS_Alloc) +FUNC(DS_Free) +FUNC(DS_Zfree) +FUNC(SEC_CertChainFromCert) +FUNC(SEC_CertTimesValid) +FUNC(SEC_CheckPassword) +FUNC(SEC_CloseKeyDB) +FUNC(SEC_CompareItem) +FUNC(SEC_ConvertToPublicKey) +FUNC(CERT_DestroyCertificate) +FUNC(SECKEY_DestroyPrivateKey) +FUNC(SEC_DestroyPublicKey) +FUNC(SECITEM_DupItem) +FUNC(SEC_ExtractPublicKey) +FUNC(SEC_FindCertByNickname) +FUNC(SEC_FindKeyByName) +FUNC(SECITEM_FreeItem) +FUNC(CERT_GetAVATag) +FUNC(SEC_GetPassword) +FUNC(SEC_GetSSLCACerts) +FUNC(CERT_NameToAscii) +FUNC(SEC_OpenCertDB) +FUNC(CERT_RFC1485_EscapeAndQuote) +FUNC(SEC_ResetRandom) +FUNC(SEC_UTCTimeToAscii) +FUNC(SECKEY_UpdateKeyDBPass1) +FUNC(SECKEY_UpdateKeyDBPass2) +FUNC(SSL_Accept) +FUNC(SSL_AcceptHook) +FUNC(SSL_AuthCertificate) +FUNC(SSL_AuthCertificateHook) +FUNC(SSL_BadCertHook) +FUNC(SSL_Bind) +FUNC(SSL_BindForSockd) +FUNC(SSL_CheckDirectSock) +FUNC(SSL_Close) +FUNC(SSL_ConfigSecureServer) +FUNC(SSL_ConfigServerSessionIDCache) +FUNC(SSL_ConfigSockd) +FUNC(SSL_Connect) +FUNC(SSL_DataPending) +FUNC(SSL_DataPendingHack) +FUNC(SSL_Enable) +FUNC(SSL_EnableCipher) +FUNC(SSL_EnableDefault) +FUNC(SSL_ForceHandshake) +FUNC(SSL_GetClientAuthDataHook) +FUNC(SSL_GetPeerName) +FUNC(SSL_GetSessionID) +FUNC(SSL_GetSockOpt) +FUNC(SSL_HandshakeCallback) +FUNC(SSL_Import) +FUNC(SSL_ImportFd) +FUNC(SSL_InvalidateSession) +FUNC(SSL_Ioctl) +FUNC(SSL_IsDomestic) +FUNC(SSL_Listen) +FUNC(SSL_PeerCertificate) +FUNC(SSL_Read) +FUNC(SSL_Recv) +FUNC(SSL_RedoHandshake) +FUNC(SSL_ResetHandshake) +FUNC(SSL_SecurityCapabilities) +FUNC(SSL_SecurityStatus) +FUNC(SSL_Send) +FUNC(SSL_SetSockOpt) +FUNC(SSL_SetURL) +FUNC(SSL_Shutdown) +FUNC(SSL_Socket) +FUNC(SSL_Write) +/* + * DSGWmcs: added the functions below: + */ +FUNC(SEC_RNGInit) +FUNC(SEC_CheckKeyDBPassword) +FUNC(SEC_ZfreeItem) +FUNC(SEC_DataToAscii) +FUNC(SEC_AsciiToData) +FUNC(ldapssl_init) /* called by something in ns-httpd.so */ +FUNC(SSL_DefaultBadCertHandler) /* called by something in ns-httpd.so */ +/* DSGW kristian added: */ +FUNC(CERT_GetDomainComponentName) +FUNC(CERT_GetCertEmailAddress) +FUNC(CERT_GetCertUid) +FUNC(CERT_GetCommonName) +FUNC(CERT_GetCountryName) +FUNC(CERT_GetLocalityName) +FUNC(CERT_GetOrgName) +FUNC(CERT_GetStateName) +FUNC(CERT_IsExportVersion) +FUNC(CERT_PublicModulusLen) + +/* DSGW pkennedy added, for HCL integration */ +FUNC(BTOA_DataToAscii) +FUNC(ATOB_AsciiToData) +FUNC(SSL_ImportFD) +FUNC(PK11_FindKeyByAnyCert) +FUNC(PK11_GetTokenName) +FUNC(PK11_SetPasswordFunc) +FUNC(PK11_FindCertFromNickname) +FUNC(PK11_ConfigurePKCS11) +FUNC(SSL_SetPolicy) +FUNC(CERT_VerifyCertNow) +FUNC(SSL_RevealURL) +FUNC(CERT_VerifyCertName) +FUNC(PORT_SetError) + +/* DSGW richm added, for nss 2.8.x support */ +FUNC(SSL_OptionSet) +FUNC(NSS_SetDomesticPolicy) + +/* DSGW powers added, for NSS 3.4.x support*/ +FUNC(NSS_NoDB_Init) +FUNC(NSS_Initialize) +FUNC(NSS_Init) +FUNC(PK11_GenerateRandom) +FUNC(PK11_GetInternalKeySlot) +FUNC(PK11_KeyGen) +FUNC(PK11_ImportSymKey) +FUNC(PK11_GenerateNewParam) +FUNC(PK11_CreateContextBySymKey) +FUNC(PK11_CipherOp) +FUNC(PK11_DigestFinal) +FUNC(PK11_Finalize) +FUNC(PK11_DestroyContext) +FUNC(PK11_FreeSlot) +FUNC(PK11_DigestBegin) +FUNC(PK11_FreeSymKey) +FUNC(PK11_DigestOp) +FUNC(PK11_CloneContext) +FUNC(PK11_HashBuf) +FUNC(PK11_CreateDigestContext) +FUNC(SECITEM_ZfreeItem) +FUNC(SSL_CipherPrefSetDefault) +FUNC(SSL_OptionGetDefault) +FUNC(SSL_OptionSetDefault) +FUNC(SSL_CipherPolicySet ) +FUNC(CERT_GetDefaultCertDB) +FUNC(CERT_OpenCertDBFilename) + diff --git a/setup.in b/setup.in new file mode 100644 index 0000000..9a4c3ab --- /dev/null +++ b/setup.in @@ -0,0 +1,259 @@ +#!/bin/sh +# +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# Copyright (C) 2006 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# + +########################### +# +# This shell script provides a way to set up a new installation after +# the binaries have already been extracted. This is typically after +# using native packaging support to install the package e.g. RPM, +# pkgadd, depot, etc. This script will show the license, readme, +# dsktune, then run the usual setup pre and post installers. This +# script should be run from the server root directory since it uses +# pwd to get the server root directory. +# +########################## + +# get command line arguments + +# see if silent mode + +counter=0 +doMktmp() { + tmpfile=`mktemp /tmp/${1}XXXXXX 2> /dev/null` + if ! [ $tmpfile ] ; then + tmpfile=/tmp/$1.$counter.$$ + counter=`expr $counter + 1` + fi + echo $tmpfile +} + +doExit() { + echo "ERROR Exiting . . ." | tee -a $logfile + if [ $tmpinffile ]; then + rm -f $inffile + fi + echo "Log file is $logfile" + exit 1 +} + +askYN() { + prompt="$1" + finished= + while ! [ $finished ]; do + echo "" + echo -n "$prompt (yes/no) " | tee -a $logfile + read ans + echo $ans >> $logfile + case "$ans" in + y*|Y*) finished=1 ;; + n*|N*) exit 1 ;; + *) echo "Please answer yes or no" | tee -a $logfile ;; + esac + done +} + +ask123() { + prompt=$2 + default=$1 + finished= + ans= + while ! [ $finished ]; do + echo -n "" + echo "" + echo -n $prompt "" | tee -a $logfile + read ans + echo $ans >> $logfile + if ! [ $ans ]; then + return $default + fi + case "$ans" in + 1|2|3) finished=1 ;; + *) echo "Please answer 1, 2, or 3" | tee -a $logfile ;; + esac + done + return $ans +} + +getFQDN() { + max=0 + maxhost= + defhost=`hostname` + echo "getFQDN: hostname = $defhost" >> $logfile + hosthost=`host $defhost | grep -v "not found" | awk '{print $1}'` + echo "getFQDN: host $defhost = $hosthost" >> $logfile + for host in $defhost $hosthost `hostname -f` `hostname -a` ; do + len=`echo $host | wc -c` + echo "getFQDN: host $host has length $len" >> $logfile + if [ $len -gt $max ]; then + max=$len + maxhost=$host + echo "getFQDN: new max host $host has length $max" >> $logfile + fi + done + echo $maxhost +} + +getValFromInf() { + cattr=$1 + cfile=$2 + rval=`grep -i ^$cattr $cfile | head -1 | sed -e 's/^.*=[ ]*//'` + echo $rval +} + +host2Suffix() { + echo "dc=$1" | sed -e s/\\./,dc=/g +} + +logfile=`doMktmp log` +myargs= +silent= +inffile= +tmpinffile= +nextisinffile= +keepinffile= +for arg in "$@" ; do + if [ "$arg" = "-s" ]; then + silent=1 + elif [ "$arg" = "-k" ]; then + keepinffile=1 + elif [ "$arg" = "-f" ]; then + nextisinffile=1 + elif [ $nextisinffile ]; then + inffile="$arg" + nextisinffile= + else + myargs="$myargs $arg" + fi +done + +# figure out where we are and make sure we cd to the serverroot dir +setupdir=`dirname $0` +sroot=`dirname $setupdir` +cd $sroot +currentdir=`pwd` + +if [ "$currentdir" != "$sroot" ]; then + # running setup using a relative path + bname=`basename $setupdir` + if [ "$bname" = "." ]; then + setupdir=$currentdir + else + setupdir=`echo $currentdir/$bname` + fi + sroot=`dirname $setupdir` + cd $sroot +fi + +echo "INFO Begin Setup . . ." | tee -a $logfile +# cat LICENSE +if ! [ $silent ]; then + echo "" | tee -a $logfile + echo "" | tee -a $logfile + echo "" | tee -a $logfile + cat LICENSE | tee -a $logfile + askYN "Do you accept the license terms?" +fi + +# cat README +if ! [ $silent ]; then + cat README | tee -a $logfile + askYN "Continue?" +fi + +if [ -f "$inffile" ] ; then + hostname=`getValFromInf FullMachineName $inffile` + port=`getValFromInf ServerPort $inffile` + suffix=`getValFromInf Suffix $inffile` + dirmgr=`getValFromInf RootDN $inffile` +fi + +# if silent mode, do not run the pre-installer programs +# otherwise, create a temp file for their use +if ! [ $silent ]; then + inffile=`doMktmp setup` + tmpinffile=1 + + # put some common answers in the file + if ! [ $hostname ] ; then + hostname=`getFQDN` + if ! [ $hostname ] ; then + hostname=localhost.localdomain + fi + fi + echo "" | tee -a $logfile + echo -n "Fully qualified hostname of LDAP server (default: $hostname) " | tee -a $logfile + read ans + echo $ans >> $logfile + if [ "$ans" ]; then + hostname="$ans" + fi + + if ! [ $port ] ; then + port=389 + fi + echo "" | tee -a $logfile + echo -n "Port number of LDAP server (default: $port) " | tee -a $logfile + read ans + echo $ans >> $logfile + if [ "$ans" ]; then + port="$ans" + fi + + if ! [ $suffix ] ; then + suffix=`host2Suffix $hostname` + fi + echo "" | tee -a $logfile + echo -n "User suffix on LDAP server (default: $suffix) " | tee -a $logfile + read ans + echo $ans >> $logfile + if [ "$ans" ]; then + suffix="$ans" + fi + + if ! [ $dirmgr ] ; then + dirmgr="cn=directory manager" + fi + echo "" | tee -a $logfile + echo -n "Directory Manager DN (default: $dirmgr) " | tee -a $logfile + read ans + echo $ans >> $logfile + if [ "$ans" ]; then + dirmgr="$ans" + fi +fi + +# generate dsgw.conf and pb.conf and default.conf in the @contextdir@ directory +sed -e "s,@host@,$hostname,g" \ + -e "s,@port@,$port,g" \ + -e "s,@suffix@,$suffix,g" \ + -e "s,@dirmgr@,$dirmgr,g" \ + -e "s,\@contextdir\@,@contextdir@,g" \ + @configdir@/dsgw.tmpl > @contextdir@/dsgw.conf + +sed -e "s,@host@,$hostname,g" \ + -e "s,@port@,$port,g" \ + -e "s,@suffix@,$suffix,g" \ + -e "s,@dirmgr@,$dirmgr,g" \ + -e "s,\@contextdir\@,@contextdir@,g" \ + @pbconfigdir@/pb.tmpl > @contextdir@/pb.conf + +cp @contextdir@/dsgw.conf @contextdir@/default.conf + +exit 0 diff --git a/sort.c b/sort.c new file mode 100644 index 0000000..3901e1a --- /dev/null +++ b/sort.c @@ -0,0 +1,168 @@ +/** --- BEGIN COPYRIGHT BLOCK --- + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + --- END COPYRIGHT BLOCK --- */ + +/* DON'T SHIP THIS PROGRAM. It's terribly un-secure, as it + enables an HTTP client to read the contents of any file. +*/ + +/* This is a Gateway CGI program, for testing collation. + It reads the text file named by $PATH_INFO and outputs its lines, sorted, + in a table with the script and collation key computed by dsgw_strkeygen. + The locale is controlled by the Accept-Language header in the HTTP request, + like any Gateway CGI. +*/ + +#include +#include /* fopen, fgets, perror */ +#include /* getenv, qsort */ +#include "dsgw.h" + +static const char* +fgetln(FILE* f, int* error) +{ + auto size_t buflen = 128; + auto char* buf = dsgw_ch_malloc (buflen); + *buf = '\0'; + while (fgets (buf, buflen, f)) { + auto const size_t read = strlen(buf); + if (buf[read-1] == '\n') { + buf[read-1] = '\0'; + return buf; + } + buflen *= 2; + buf = dsgw_ch_realloc (buf, buflen); + } + if (feof(f) && *buf) return buf; + free (buf); + return NULL; +} + +typedef struct keystring { + const char* ks_val; + struct berval* ks_key; +} keystring_t; + +static int +keystring_cmp (const void* Lv, const void* Rv) +{ + auto const keystring_t** L = (const keystring_t**)Lv; + auto const keystring_t** R = (const keystring_t**)Rv; + return dsgw_keycmp (NULL, (*L)->ks_key, (*R)->ks_key); +} + +int +main( int argc, char* argv[] ) +{ + auto int error = 0; + auto const int reqmethod = dsgw_init (argc, argv, DSGW_METHOD_GET); + auto char* fname = getenv ("PATH_INFO"); + + dsgw_send_header(); + dsgw_emits ("\n"); + dsgw_head_begin(); + dsgw_emits ("\n\n\n"); + + if (!fname) { + dsgw_emits ("!PATH_INFO\n"); + error = 1; + } else { + auto FILE* f = fopen (fname, "r"); + if (!f) { + dsgw_emitf ("%s: errno %i\n", fname, errno); + error = 2; + } else { + auto const char* line; + auto keystring_t* v = NULL; + auto size_t vlen = 0; + while (line = fgetln(f, &error)) { + v = (keystring_t*) dsgw_ch_realloc (v, (vlen+1) * sizeof(keystring_t)); + v[vlen].ks_val = line; + v[vlen].ks_key = dsgw_strkeygen (CASE_INSENSITIVE, line); + ++vlen; + } + fclose (f); + if (vlen) { + auto keystring_t** vp; + auto size_t i; + vp = (keystring_t**) dsgw_ch_malloc (vlen * sizeof(keystring_t*)); + for (i = 0; i < vlen; ++i) { + vp[i] = v + i; + } + + qsort (vp, vlen, sizeof(keystring_t*), keystring_cmp); + + dsgw_emits ("\n"); + dsgw_emits (" " + "" + "" + "" + "" + "" + "\n"); + for (i = 0; i < vlen; ++i) { + auto size_t j; + dsgw_emits (" "); + dsgw_emitf ("", 1 + (unsigned long)(vp[i]-v)); + dsgw_emitf ("", vp[i]->ks_val); + dsgw_emits (""); + dsgw_emitf ("", (unsigned long)(vp[i]->ks_key->bv_len) - 2); + dsgw_emits (""); + dsgw_emits ("\n"); + } + dsgw_emits ("
" DSGW_UTF8_NBSP "linescript" DSGW_UTF8_NBSP "Sort Key
%lu:%s"); + if (vp[i]->ks_key->bv_len) { + dsgw_emitf ("%u", 0xFF & (unsigned)(vp[i]->ks_key->bv_val[0])); + } else { + dsgw_emits (DSGW_UTF8_NBSP); + } + dsgw_emits ("%lu:"); + for (j = 1; j < vp[i]->ks_key->bv_len - 1; ++j) { + dsgw_emitf ("%02x", 0xFF & (unsigned)(vp[i]->ks_key->bv_val[j])); + } + dsgw_emits ("
\n"); + free (vp); + for (i = 0; i < vlen; ++i) { + dsgw_keyfree (NULL, v[i].ks_key); + } + free (v); + } + } + } + dsgw_emits ("\n"); + return error; +} diff --git a/tutor.c b/tutor.c new file mode 100644 index 0000000..ea49eff --- /dev/null +++ b/tutor.c @@ -0,0 +1,300 @@ +/** --- BEGIN COPYRIGHT BLOCK --- + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + --- END COPYRIGHT BLOCK --- */ +/* + * tutor.c - Take a qs, and spit out the appropriate tutorial + * + * All blame to Mike McCool + */ + +#include +#include +#include "dsgw.h" + +#define BASE_MAN_DIRECTORY "manual/" +#define BASE_INFO_DIRECTORY "info/" +#define HELP_INDEX_HTML "manual/index.html" +/*#define MANUAL_HPATH "bin/lang?file=" DSGW_MANUALSHORTCUT "/"*/ + +/* Copied from ldapserver/lib/base/util.c */ +static int +my_util_uri_is_evil(char *t) +{ + register int x; + + for(x = 0; t[x]; ++x) { + if(t[x] == '/') { + if(t[x+1] == '/') + return 1; + if(t[x+1] == '.') { + switch(t[x+2]) { + case '.': + if((!t[x+3]) || (t[x+3] == '/')) + return 1; + case '/': + case '\0': + return 1; + } + } + } +#ifdef XP_WIN32 + /* On NT, the directory "abc...." is the same as "abc" + * The only cheap way to catch this globally is to disallow + * names with the trailing "."s. Hopefully this is not over + * restrictive + */ + if ((t[x] == '.') && ( (t[x+1] == '/') || (t[x+1] == '\0') )) { + return 1; + } +#endif + } + return 0; +} + + +FILE * +_open_html_file( char *filename ) +{ + FILE *f; + char *mypath; + char *p; + + p = dsgw_file2path( DSGW_MANROOT, "slapd/gw/" ); + mypath = (char *)dsgw_ch_malloc( strlen( p ) + + strlen( filename ) + 1 ); + sprintf( mypath, "%s%s", p, filename ); + + if (!(f = fopen( mypath, "r" ))) { + dsgw_error( DSGW_ERR_OPENHTMLFILE, filename, DSGW_ERROPT_EXIT, + 0, NULL ); + } + + free( p ); + free( mypath ); + + return f; +} + + + +/* Had to copy and paste so wouldn't set referer. */ +void _my_return_html_file(char *filename, char *base) { + char line[BIG_LINE]; + FILE *html = _open_html_file(filename); + + if(base) { + char *tmp; + char *surl=dsgw_server_url(); + char *sn=dsgw_ch_strdup(getenv("SCRIPT_NAME")); + tmp=strchr(&(sn[1]), '/'); + *tmp='\0'; + dsgw_emitf("\n", surl, sn, base); + } + while( fgets(line, sizeof(line), html)) { + dsgw_emits( line ); + } +} + + +int +main( + int argc, + char *argv[] +#ifdef DSGW_DEBUG + ,char *env[] +#endif +) +{ + char *qs = getenv("QUERY_STRING"); + char *html=NULL; + char *base=NULL; + +#ifdef DSGW_DEBUG + dsgw_logstringarray( "env", env ); +#endif + + if(qs == NULL || *qs == '\0') { + dsgw_send_header(); + _my_return_html_file(BASE_MAN_DIRECTORY HELP_INDEX_HTML, NULL); + exit(0); + } else { + /* parse the query string: */ + auto char *p, *iter = NULL; + + /*get a pointer to the context. It should be the last part of the qs*/ + p = ldap_utf8strtok_r( qs, "&", &iter ); + + /* + * Get the conf file name. It'll be translated + * into /dsgw/context/CONTEXT.conf if + * CONTEXT is all alphanumeric (no slahes, + * or dots). CONTEXT is passed into the cgi. + * if context=CONTEXT is not there, or PATH_INFO + * was used, then use dsgw.conf + */ + if ( iter != NULL && !strncasecmp( iter, "context=", 8 )) { + context = dsgw_ch_strdup( iter + 8 ); + dsgw_form_unescape( context ); + } + + } + + dsgw_init( argc, argv, DSGW_METHOD_GET ); + + html = (char *) dsgw_ch_malloc(strlen(qs)+10+10); + sprintf(html, "%s.html", qs); + if (my_util_uri_is_evil(html)) { + dsgw_send_header(); + dsgw_emits( "

Error

\n" + "

\n" + "URL contains dangerous characters. Cannot display\n" + "help text." ); + exit( 0 ); + } + + if(qs[0]=='!') { + qs++; + if(!strncmp(qs, BASE_INFO_DIRECTORY, strlen(BASE_INFO_DIRECTORY))) { + sprintf(html, "%s.html", qs); + } else if(!strncmp(qs, BASE_MAN_DIRECTORY, strlen(BASE_MAN_DIRECTORY))) { + if(!strstr(qs, ".html")) { + sprintf(html, "%s.htm", qs); + } else { + sprintf(html, "%s", qs); + } + base=qs; + } + else { + char line[BIG_LINE]; + FILE *map=NULL; + char *man_index=NULL; + + man_index = dsgw_file2path ( DSGW_MANROOT, "slapd/gw/manual/index.map" ); + + html[0]='\0'; + + map=fopen(man_index, "r"); + if(!map) + goto ohwell; + while(fgets(line, sizeof(line), map)) { + if(line[0]==';') + continue; + else if(ldap_utf8isspace(line)) + continue; + else { + /* parse out the line */ + register char *head=NULL, *tail=NULL; + int found; + + head=&(line[0]); + tail=head; + found=0; + while(*tail) { + if(ldap_utf8isspace(tail) || *tail=='=') { + *tail='\0'; + found=1; + /* get rid of extra stuff at the end */ + tail++; + while(1) { + if (*tail == 0) { + ++tail; /* This looks wrong. */ + break; + } + LDAP_UTF8INC(tail); + if((!ldap_utf8isspace(tail)) && (*tail!='=')) + break; + } + break; + } + LDAP_UTF8INC(tail); + } + if(!found) continue; + + /* script name is in head */ + if(strncasecmp(head, qs, strlen(qs))) { + continue; + } + /* match found. get the actual file name */ + head=tail; +/* Step on CRs and LFs. */ + while(*tail) { + if((*tail=='\r') || (*tail=='\n') || (*tail==';')) { + *tail='\0'; + break; + } + LDAP_UTF8INC(tail); + } + /* assumedly, head should now have the proper HTML file + * from the manual inside. redirect the client 'cause + * there's no other way to get them to jump to the + * right place. + * Looks like: + * http://host:port/dsgw/bin/lang?context=CONTEXT&file=.MANUAL/FILE.HTM + * Where MANUAL is literal + */ + dsgw_emitf("Location: %s%s/%s\n\n", + gc->gc_urlpfxmain, DSGW_MANUALSHORTCUT, head); + + fclose(map); + exit(0); + } + } + fclose(map); + free( man_index ); + +ohwell: + if(!html[0]) + sprintf(html, "%s%s.html", BASE_MAN_DIRECTORY, qs); + } + dsgw_send_header(); + _my_return_html_file(html, base); + } else { + dsgw_send_header(); + dsgw_emits("Directory Server Gateway Help\n"); + dsgw_emits("\n"); + dsgw_emits("\n" ); + dsgw_emitf("\n", dsgw_getvp(DSGW_CGINUM_TUTOR), context); + dsgw_emitf("\n", dsgw_getvp(DSGW_CGINUM_TUTOR), qs, context); + dsgw_emits("\n"); + } + return 1; +} diff --git a/unauth.c b/unauth.c new file mode 100644 index 0000000..7739995 --- /dev/null +++ b/unauth.c @@ -0,0 +1,193 @@ +/** --- BEGIN COPYRIGHT BLOCK --- + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + --- END COPYRIGHT BLOCK --- */ +/* + * unauth.c -- CGI to discard cookies -- HTTP gateway + */ + +#include "dsgw.h" +#include "dbtdsgw.h" + +char *get_auth_cookie( char *cookie ); +void generate_message( int type ); + +#define CKEXP_SUCCESS 1 +#define CKEXP_FAILURE 2 + +int main( int argc, char **argv ) +{ + int reqmethod; + char *expck; + char *authck; + int rc; + char *qs = NULL; + + /* Parse out the context=blah.html */ + if (( qs = getenv( "QUERY_STRING" )) != NULL && *qs != '\0' ) { + /* parse the query string: */ + auto char *p, *iter = NULL; + qs = dsgw_ch_strdup( qs ); + + for ( p = ldap_utf8strtok_r( qs, "&", &iter ); p != NULL; + p = ldap_utf8strtok_r( NULL, "&", &iter )) { + + /* + * Get the conf file name. It'll be translated + * into /dsgw/context/CONTEXT.conf if + * CONTEXT is all alphanumeric (no slahes, + * or dots). CONTEXT is passed into the cgi. + * if context=CONTEXT is not there, or PATH_INFO + * was used, then use dsgw.conf + */ + if ( !strncasecmp( p, "context=", 8 )) { + context = dsgw_ch_strdup( p + 8 ); + dsgw_form_unescape( context ); + continue; + } + + } + + free( qs ); qs = NULL; + } + + + reqmethod = dsgw_init( argc, argv, DSGW_METHOD_GET ); + + authck = dsgw_get_auth_cookie(); + if ( authck == NULL ) { + /* No cookie. Generate an informational message. */ + generate_message( CKEXP_SUCCESS ); + free( authck ); + exit( 0 ); + } + + /* Remove the cookie from the cookie database */ + rc = dsgw_delcookie( authck ); + + /* Generate a cookie header with the cookie set to [unauthenticated] */ + expck = dsgw_ch_malloc( strlen( DSGW_CKHDR ) + strlen( DSGW_AUTHCKNAME ) + + strlen( DSGW_UNAUTHSTR ) + strlen( "=; path=/" ) + 2 ); + sprintf( expck, "%s%s=%s; path=/", DSGW_CKHDR, DSGW_AUTHCKNAME, DSGW_UNAUTHSTR ); + dsgw_add_header( expck ); + generate_message( CKEXP_SUCCESS ); + free( authck ); + free( expck ); + exit( 0 ); +} + + + +/* + * It's quite likely that there will be more than one cookie in the + * Cookie: header. See if we've got an authentication cookie, and if + * so, parse it out and return a pointer to it. If no auth cookie + * is present, return NULL. + */ +char * +get_auth_cookie( char *cookie ) +{ + char *p, *e; + + if ( cookie == NULL ) { + return NULL; + } + + if (( p = strstr( cookie, DSGW_AUTHCKNAME )) == NULL ) { + return NULL; + } + + if (( e = strchr( p, ';' )) != NULL ) { + *e = '\0'; + } + + return p; +} + + + +void +generate_message( int type ) +{ + dsgw_send_header(); + dsgw_emits( "" ); + dsgw_head_begin(); + dsgw_emits( "\n" ); + if ( type == CKEXP_SUCCESS ) { + dsgw_emits( "Success" ); + } else if ( type == CKEXP_FAILURE ) { + dsgw_emits( "Error" ); + } + dsgw_emits( "\n\n" ); + dsgw_emitf( "\n", dsgw_html_body_colors ); + + dsgw_emitf( "

\n" + "\n" + "%s" + "\n" + "
\n" + "

\n" + "%s", + XP_GetClientStr( DBT_Success_ ), + XP_GetClientStr( DBT_YouAreNoLongerAuthenticated_ )); + + if ( type != CKEXP_SUCCESS ) { + /* + * Something went wrong, so generate some JavaScript to + * discard the cookie. + */ + dsgw_emits( "\n" ); + } + dsgw_form_begin (NULL, NULL); + dsgw_emits( "\n" + "\n" + "\n" + "\n" + "
\n"); + dsgw_emitf( + "\n" ); + dsgw_emit_helpbutton( "UNAUTH" ); + dsgw_emits( "
\n" + "\n" ); +} + diff --git a/utf8compare.c b/utf8compare.c new file mode 100644 index 0000000..f351419 --- /dev/null +++ b/utf8compare.c @@ -0,0 +1,2267 @@ +/** --- BEGIN COPYRIGHT BLOCK --- + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + --- END COPYRIGHT BLOCK --- */ +#include +#include +#include +#include "ldap.h" +#include "dsgw.h" + +typedef struct sUpperLowerTbl { + char *upper, *lower; + int tsz; /* target size */ +} UpperLowerTbl_t; + +/* + * dsgw_has8thBit: check the input string + * return 1 if the string contains 8-bit character + * return 0 otherwise + */ +int +dsgw_has8thBit(unsigned char *s) +{ + unsigned char *p, *tail; + tail = s + strlen((char *)s); + for (p = s; p < tail; p++) { + if (0x80 & *p) { + return 1; + } + } + return 0; +} + +/* + * UpperToLower Tables: sorted by upper characters + */ +UpperLowerTbl_t Upper2LowerTbl20[] = { + /* upper, lower */ + {"\303\200", "\303\240", 2}, + {"\303\201", "\303\241", 2}, + {"\303\202", "\303\242", 2}, + {"\303\203", "\303\243", 2}, + {"\303\204", "\303\244", 2}, + {"\303\205", "\303\245", 2}, + {"\303\206", "\303\246", 2}, + {"\303\207", "\303\247", 2}, + {"\303\210", "\303\250", 2}, + {"\303\211", "\303\251", 2}, + {"\303\212", "\303\252", 2}, + {"\303\213", "\303\253", 2}, + {"\303\214", "\303\254", 2}, + {"\303\215", "\303\255", 2}, + {"\303\216", "\303\256", 2}, + {"\303\217", "\303\257", 2}, + {"\303\220", "\303\260", 2}, + {"\303\221", "\303\261", 2}, + {"\303\222", "\303\262", 2}, + {"\303\223", "\303\263", 2}, + {"\303\224", "\303\264", 2}, + {"\303\225", "\303\265", 2}, + {"\303\226", "\303\266", 2}, + {"\303\230", "\303\270", 2}, + {"\303\231", "\303\271", 2}, + {"\303\232", "\303\272", 2}, + {"\303\233", "\303\273", 2}, + {"\303\234", "\303\274", 2}, + {"\303\235", "\303\275", 2}, + {"\303\236", "\303\276", 2}, + {NULL, NULL, 0} +}; + +UpperLowerTbl_t Upper2LowerTbl21[] = { + {"\304\200", "\304\201", 2}, + {"\304\202", "\304\203", 2}, + {"\304\204", "\304\205", 2}, + {"\304\206", "\304\207", 2}, + {"\304\210", "\304\211", 2}, + {"\304\212", "\304\213", 2}, + {"\304\214", "\304\215", 2}, + {"\304\216", "\304\217", 2}, + {"\304\220", "\304\221", 2}, + {"\304\222", "\304\223", 2}, + {"\304\224", "\304\225", 2}, + {"\304\226", "\304\227", 2}, + {"\304\230", "\304\231", 2}, + {"\304\232", "\304\233", 2}, + {"\304\234", "\304\235", 2}, + {"\304\236", "\304\237", 2}, + {"\304\240", "\304\241", 2}, + {"\304\242", "\304\243", 2}, + {"\304\244", "\304\245", 2}, + {"\304\246", "\304\247", 2}, + {"\304\250", "\304\251", 2}, + {"\304\252", "\304\253", 2}, + {"\304\254", "\304\255", 2}, + {"\304\256", "\304\257", 2}, + {"\304\260", "\151", 1}, + {"\304\262", "\304\263", 2}, + {"\304\264", "\304\265", 2}, + {"\304\266", "\304\267", 2}, + {"\304\271", "\304\272", 2}, + {"\304\273", "\304\274", 2}, + {"\304\275", "\304\276", 2}, + {"\304\277", "\305\200", 2}, + {NULL, NULL, 0} +}; + +UpperLowerTbl_t Upper2LowerTbl22[] = { + {"\305\201", "\305\202", 2}, + {"\305\203", "\305\204", 2}, + {"\305\205", "\305\206", 2}, + {"\305\207", "\305\210", 2}, + {"\305\212", "\305\213", 2}, + {"\305\214", "\305\215", 2}, + {"\305\216", "\305\217", 2}, + {"\305\220", "\305\221", 2}, + {"\305\222", "\305\223", 2}, + {"\305\224", "\305\225", 2}, + {"\305\226", "\305\227", 2}, + {"\305\230", "\305\231", 2}, + {"\305\232", "\305\233", 2}, + {"\305\234", "\305\235", 2}, + {"\305\236", "\305\237", 2}, + {"\305\240", "\305\241", 2}, + {"\305\242", "\305\243", 2}, + {"\305\244", "\305\245", 2}, + {"\305\246", "\305\247", 2}, + {"\305\250", "\305\251", 2}, + {"\305\252", "\305\253", 2}, + {"\305\254", "\305\255", 2}, + {"\305\256", "\305\257", 2}, + {"\305\260", "\305\261", 2}, + {"\305\262", "\305\263", 2}, + {"\305\264", "\305\265", 2}, + {"\305\266", "\305\267", 2}, + {"\305\270", "\303\277", 2}, + {"\305\271", "\305\272", 2}, + {"\305\273", "\305\274", 2}, + {"\305\275", "\305\276", 2}, + {NULL, NULL, 0} +}; + +UpperLowerTbl_t Upper2LowerTbl23[] = { + {"\306\201", "\311\223", 2}, + {"\306\202", "\306\203", 2}, + {"\306\204", "\306\205", 2}, + {"\306\206", "\311\224", 2}, + {"\306\207", "\306\210", 2}, + {"\306\211", "\311\226", 2}, + {"\306\212", "\311\227", 2}, + {"\306\213", "\306\214", 2}, + {"\306\216", "\311\230", 2}, + {"\306\217", "\311\231", 2}, + {"\306\220", "\311\233", 2}, + {"\306\221", "\306\222", 2}, + {"\306\223", "\311\240", 2}, + {"\306\224", "\311\243", 2}, + {"\306\226", "\311\251", 2}, + {"\306\227", "\311\250", 2}, + {"\306\230", "\306\231", 2}, + {"\306\234", "\311\257", 2}, + {"\306\235", "\311\262", 2}, + {"\306\237", "\306\237", 2}, + {"\306\240", "\306\241", 2}, + {"\306\242", "\306\243", 2}, + {"\306\244", "\306\245", 2}, + {"\306\246", "\306\246", 2}, + {"\306\247", "\306\250", 2}, + {"\306\251", "\312\203", 2}, + {"\306\254", "\306\255", 2}, + {"\306\256", "\312\210", 2}, + {"\306\257", "\306\260", 2}, + {"\306\261", "\312\212", 2}, + {"\306\262", "\312\213", 2}, + {"\306\263", "\306\264", 2}, + {"\306\265", "\306\266", 2}, + {"\306\267", "\312\222", 2}, + {"\306\270", "\306\271", 2}, + {"\306\274", "\306\275", 2}, + {NULL, NULL, 0} +}; + +UpperLowerTbl_t Upper2LowerTbl24[] = { + {"\307\204", "\307\205", 2}, + {"\307\205", "\307\204", 2}, + {"\307\207", "\307\210", 2}, + {"\307\210", "\307\207", 2}, + {"\307\212", "\307\213", 2}, + {"\307\213", "\307\212", 2}, + {"\307\215", "\307\216", 2}, + {"\307\217", "\307\220", 2}, + {"\307\221", "\307\222", 2}, + {"\307\223", "\307\224", 2}, + {"\307\225", "\307\226", 2}, + {"\307\227", "\307\230", 2}, + {"\307\231", "\307\232", 2}, + {"\307\233", "\307\234", 2}, + {"\307\236", "\307\237", 2}, + {"\307\240", "\307\241", 2}, + {"\307\242", "\307\243", 2}, + {"\307\244", "\307\245", 2}, + {"\307\246", "\307\247", 2}, + {"\307\250", "\307\251", 2}, + {"\307\252", "\307\253", 2}, + {"\307\254", "\307\255", 2}, + {"\307\256", "\307\257", 2}, + {"\307\261", "\307\262", 2}, + {"\307\262", "\307\261", 2}, + {"\307\264", "\307\265", 2}, + {"\307\272", "\307\273", 2}, + {"\307\274", "\307\275", 2}, + {"\307\276", "\307\277", 2}, + {NULL, NULL, 0} +}; + +UpperLowerTbl_t Upper2LowerTbl25[] = { + {"\310\200", "\310\201", 2}, + {"\310\202", "\310\203", 2}, + {"\310\204", "\310\205", 2}, + {"\310\206", "\310\207", 2}, + {"\310\210", "\310\211", 2}, + {"\310\212", "\310\213", 2}, + {"\310\214", "\310\215", 2}, + {"\310\216", "\310\217", 2}, + {"\310\220", "\310\221", 2}, + {"\310\222", "\310\223", 2}, + {"\310\224", "\310\225", 2}, + {"\310\226", "\310\227", 2}, + {NULL, NULL, 0} +}; + +UpperLowerTbl_t Upper2LowerTbl26[] = { + {"\316\206", "\316\254", 2}, + {"\316\210", "\316\255", 2}, + {"\316\211", "\316\256", 2}, + {"\316\212", "\316\257", 2}, + {"\316\214", "\317\214", 2}, + {"\316\216", "\317\215", 2}, + {"\316\217", "\317\216", 2}, + {"\316\221", "\316\261", 2}, + {"\316\222", "\316\262", 2}, + {"\316\223", "\316\263", 2}, + {"\316\224", "\316\264", 2}, + {"\316\225", "\316\265", 2}, + {"\316\226", "\316\266", 2}, + {"\316\227", "\316\267", 2}, + {"\316\230", "\316\270", 2}, + {"\316\231", "\316\271", 2}, + {"\316\232", "\316\272", 2}, + {"\316\233", "\316\273", 2}, + {"\316\234", "\316\274", 2}, + {"\316\235", "\316\275", 2}, + {"\316\236", "\316\276", 2}, + {"\316\237", "\316\277", 2}, + {"\316\240", "\317\200", 2}, + {"\316\241", "\317\201", 2}, + {"\316\243", "\317\203", 2}, + {"\316\244", "\317\204", 2}, + {"\316\245", "\317\205", 2}, + {"\316\246", "\317\206", 2}, + {"\316\247", "\317\207", 2}, + {"\316\250", "\317\210", 2}, + {"\316\251", "\317\211", 2}, + {"\316\252", "\317\212", 2}, + {"\316\253", "\317\213", 2}, + {NULL, NULL, 0} +}; + +UpperLowerTbl_t Upper2LowerTbl27[] = { + {"\317\222", "\317\222", 2}, + {"\317\223", "\317\223", 2}, + {"\317\224", "\317\224", 2}, + {"\317\232", "\317\232", 2}, + {"\317\234", "\317\234", 2}, + {"\317\236", "\317\236", 2}, + {"\317\240", "\317\240", 2}, + {"\317\242", "\317\243", 2}, + {"\317\244", "\317\245", 2}, + {"\317\246", "\317\247", 2}, + {"\317\250", "\317\251", 2}, + {"\317\252", "\317\253", 2}, + {"\317\254", "\317\255", 2}, + {"\317\256", "\317\257", 2}, + {NULL, NULL, 0} +}; + +UpperLowerTbl_t Upper2LowerTbl28[] = { + {"\320\201", "\321\221", 2}, + {"\320\202", "\321\222", 2}, + {"\320\203", "\321\223", 2}, + {"\320\204", "\321\224", 2}, + {"\320\205", "\321\225", 2}, + {"\320\206", "\321\226", 2}, + {"\320\207", "\321\227", 2}, + {"\320\210", "\321\230", 2}, + {"\320\211", "\321\231", 2}, + {"\320\212", "\321\232", 2}, + {"\320\213", "\321\233", 2}, + {"\320\214", "\321\234", 2}, + {"\320\216", "\321\236", 2}, + {"\320\217", "\321\237", 2}, + {"\320\220", "\320\260", 2}, + {"\320\221", "\320\261", 2}, + {"\320\222", "\320\262", 2}, + {"\320\223", "\320\263", 2}, + {"\320\224", "\320\264", 2}, + {"\320\225", "\320\265", 2}, + {"\320\226", "\320\266", 2}, + {"\320\227", "\320\267", 2}, + {"\320\230", "\320\270", 2}, + {"\320\231", "\320\271", 2}, + {"\320\232", "\320\272", 2}, + {"\320\233", "\320\273", 2}, + {"\320\234", "\320\274", 2}, + {"\320\235", "\320\275", 2}, + {"\320\236", "\320\276", 2}, + {"\320\237", "\320\277", 2}, + {"\320\240", "\321\200", 2}, + {"\320\241", "\321\201", 2}, + {"\320\242", "\321\202", 2}, + {"\320\243", "\321\203", 2}, + {"\320\244", "\321\204", 2}, + {"\320\245", "\321\205", 2}, + {"\320\246", "\321\206", 2}, + {"\320\247", "\321\207", 2}, + {"\320\250", "\321\210", 2}, + {"\320\251", "\321\211", 2}, + {"\320\252", "\321\212", 2}, + {"\320\253", "\321\213", 2}, + {"\320\254", "\321\214", 2}, + {"\320\255", "\321\215", 2}, + {"\320\256", "\321\216", 2}, + {"\320\257", "\321\217", 2}, + {NULL, NULL, 0} +}; + +UpperLowerTbl_t Upper2LowerTbl29[] = { + {"\321\240", "\321\241", 2}, + {"\321\242", "\321\243", 2}, + {"\321\244", "\321\245", 2}, + {"\321\246", "\321\247", 2}, + {"\321\250", "\321\251", 2}, + {"\321\252", "\321\253", 2}, + {"\321\254", "\321\255", 2}, + {"\321\256", "\321\257", 2}, + {"\321\260", "\321\261", 2}, + {"\321\262", "\321\263", 2}, + {"\321\264", "\321\265", 2}, + {"\321\266", "\321\267", 2}, + {"\321\270", "\321\271", 2}, + {"\321\272", "\321\273", 2}, + {"\321\274", "\321\275", 2}, + {"\321\276", "\321\277", 2}, + {NULL, NULL, 0} +}; + +UpperLowerTbl_t Upper2LowerTbl2a[] = { + {"\322\200", "\322\201", 2}, + {"\322\220", "\322\221", 2}, + {"\322\222", "\322\223", 2}, + {"\322\224", "\322\225", 2}, + {"\322\226", "\322\227", 2}, + {"\322\230", "\322\231", 2}, + {"\322\232", "\322\233", 2}, + {"\322\234", "\322\235", 2}, + {"\322\236", "\322\237", 2}, + {"\322\240", "\322\241", 2}, + {"\322\242", "\322\243", 2}, + {"\322\244", "\322\245", 2}, + {"\322\246", "\322\247", 2}, + {"\322\250", "\322\251", 2}, + {"\322\252", "\322\253", 2}, + {"\322\254", "\322\255", 2}, + {"\322\256", "\322\257", 2}, + {"\322\260", "\322\261", 2}, + {"\322\262", "\322\263", 2}, + {"\322\264", "\322\265", 2}, + {"\322\266", "\322\267", 2}, + {"\322\270", "\322\271", 2}, + {"\322\272", "\322\273", 2}, + {"\322\274", "\322\275", 2}, + {"\322\276", "\322\277", 2}, + {NULL, NULL, 0} +}; + +UpperLowerTbl_t Upper2LowerTbl2b[] = { + {"\323\201", "\323\202", 2}, + {"\323\203", "\323\204", 2}, + {"\323\207", "\323\210", 2}, + {"\323\213", "\323\214", 2}, + {"\323\220", "\323\221", 2}, + {"\323\222", "\323\223", 2}, + {"\323\224", "\323\225", 2}, + {"\323\226", "\323\227", 2}, + {"\323\230", "\323\231", 2}, + {"\323\232", "\323\233", 2}, + {"\323\234", "\323\235", 2}, + {"\323\236", "\323\237", 2}, + {"\323\240", "\323\241", 2}, + {"\323\242", "\323\243", 2}, + {"\323\244", "\323\245", 2}, + {"\323\246", "\323\247", 2}, + {"\323\250", "\323\251", 2}, + {"\323\252", "\323\253", 2}, + {"\323\256", "\323\257", 2}, + {"\323\260", "\323\261", 2}, + {"\323\262", "\323\263", 2}, + {"\323\264", "\323\265", 2}, + {"\323\270", "\323\271", 2}, + {NULL, NULL, 0} +}; + +UpperLowerTbl_t Upper2LowerTbl2c[] = { + {"\324\261", "\325\241", 2}, + {"\324\262", "\325\242", 2}, + {"\324\263", "\325\243", 2}, + {"\324\264", "\325\244", 2}, + {"\324\265", "\325\245", 2}, + {"\324\266", "\325\246", 2}, + {"\324\267", "\325\247", 2}, + {"\324\270", "\325\250", 2}, + {"\324\271", "\325\251", 2}, + {"\324\272", "\325\252", 2}, + {"\324\273", "\325\253", 2}, + {"\324\274", "\325\254", 2}, + {"\324\275", "\325\255", 2}, + {"\324\276", "\325\256", 2}, + {"\324\277", "\325\257", 2}, + {NULL, NULL, 0} +}; + +UpperLowerTbl_t Upper2LowerTbl2d[] = { + {"\325\200", "\325\260", 2}, + {"\325\201", "\325\261", 2}, + {"\325\202", "\325\262", 2}, + {"\325\203", "\325\263", 2}, + {"\325\204", "\325\264", 2}, + {"\325\205", "\325\265", 2}, + {"\325\206", "\325\266", 2}, + {"\325\207", "\325\267", 2}, + {"\325\210", "\325\270", 2}, + {"\325\211", "\325\271", 2}, + {"\325\212", "\325\272", 2}, + {"\325\213", "\325\273", 2}, + {"\325\214", "\325\274", 2}, + {"\325\215", "\325\275", 2}, + {"\325\216", "\325\276", 2}, + {"\325\217", "\325\277", 2}, + {"\325\220", "\326\200", 2}, + {"\325\221", "\326\201", 2}, + {"\325\222", "\326\202", 2}, + {"\325\223", "\326\203", 2}, + {"\325\224", "\326\204", 2}, + {"\325\225", "\326\205", 2}, + {"\325\226", "\326\206", 2}, + {NULL, NULL, 0} + /* upper, lower */ +}; + +UpperLowerTbl_t Upper2LowerTbl30[] = { + /* upper, lower */ + {"\341\202\240", "\341\203\220", 3}, + {"\341\202\241", "\341\203\221", 3}, + {"\341\202\242", "\341\203\222", 3}, + {"\341\202\243", "\341\203\223", 3}, + {"\341\202\244", "\341\203\224", 3}, + {"\341\202\245", "\341\203\225", 3}, + {"\341\202\246", "\341\203\226", 3}, + {"\341\202\247", "\341\203\227", 3}, + {"\341\202\250", "\341\203\230", 3}, + {"\341\202\251", "\341\203\231", 3}, + {"\341\202\252", "\341\203\232", 3}, + {"\341\202\253", "\341\203\233", 3}, + {"\341\202\254", "\341\203\234", 3}, + {"\341\202\255", "\341\203\235", 3}, + {"\341\202\256", "\341\203\236", 3}, + {"\341\202\257", "\341\203\237", 3}, + {"\341\202\260", "\341\203\240", 3}, + {"\341\202\261", "\341\203\241", 3}, + {"\341\202\262", "\341\203\242", 3}, + {"\341\202\263", "\341\203\243", 3}, + {"\341\202\264", "\341\203\244", 3}, + {"\341\202\265", "\341\203\245", 3}, + {"\341\202\266", "\341\203\246", 3}, + {"\341\202\267", "\341\203\247", 3}, + {"\341\202\270", "\341\203\250", 3}, + {"\341\202\271", "\341\203\251", 3}, + {"\341\202\272", "\341\203\252", 3}, + {"\341\202\273", "\341\203\253", 3}, + {"\341\202\274", "\341\203\254", 3}, + {"\341\202\275", "\341\203\255", 3}, + {"\341\202\276", "\341\203\256", 3}, + {"\341\202\277", "\341\203\257", 3}, + {"\341\203\200", "\341\203\260", 3}, + {"\341\203\201", "\341\203\261", 3}, + {"\341\203\202", "\341\203\262", 3}, + {"\341\203\203", "\341\203\263", 3}, + {"\341\203\204", "\341\203\264", 3}, + {"\341\203\205", "\341\203\265", 3}, + {"\341\270\200", "\341\270\201", 3}, + {"\341\270\202", "\341\270\203", 3}, + {"\341\270\204", "\341\270\205", 3}, + {"\341\270\206", "\341\270\207", 3}, + {"\341\270\210", "\341\270\211", 3}, + {"\341\270\212", "\341\270\213", 3}, + {"\341\270\214", "\341\270\215", 3}, + {"\341\270\216", "\341\270\217", 3}, + {"\341\270\220", "\341\270\221", 3}, + {"\341\270\222", "\341\270\223", 3}, + {"\341\270\224", "\341\270\225", 3}, + {"\341\270\226", "\341\270\227", 3}, + {"\341\270\230", "\341\270\231", 3}, + {"\341\270\232", "\341\270\233", 3}, + {"\341\270\234", "\341\270\235", 3}, + {"\341\270\236", "\341\270\237", 3}, + {"\341\270\240", "\341\270\241", 3}, + {"\341\270\242", "\341\270\243", 3}, + {"\341\270\244", "\341\270\245", 3}, + {"\341\270\246", "\341\270\247", 3}, + {"\341\270\250", "\341\270\251", 3}, + {"\341\270\252", "\341\270\253", 3}, + {"\341\270\254", "\341\270\255", 3}, + {"\341\270\256", "\341\270\257", 3}, + {"\341\270\260", "\341\270\261", 3}, + {"\341\270\262", "\341\270\263", 3}, + {"\341\270\264", "\341\270\265", 3}, + {"\341\270\266", "\341\270\267", 3}, + {"\341\270\270", "\341\270\271", 3}, + {"\341\270\272", "\341\270\273", 3}, + {"\341\270\274", "\341\270\275", 3}, + {"\341\270\276", "\341\270\277", 3}, + {"\341\271\200", "\341\271\201", 3}, + {"\341\271\202", "\341\271\203", 3}, + {"\341\271\204", "\341\271\205", 3}, + {"\341\271\206", "\341\271\207", 3}, + {"\341\271\210", "\341\271\211", 3}, + {"\341\271\212", "\341\271\213", 3}, + {"\341\271\214", "\341\271\215", 3}, + {"\341\271\216", "\341\271\217", 3}, + {"\341\271\220", "\341\271\221", 3}, + {"\341\271\222", "\341\271\223", 3}, + {"\341\271\224", "\341\271\225", 3}, + {"\341\271\226", "\341\271\227", 3}, + {"\341\271\230", "\341\271\231", 3}, + {"\341\271\232", "\341\271\233", 3}, + {"\341\271\234", "\341\271\235", 3}, + {"\341\271\236", "\341\271\237", 3}, + {"\341\271\240", "\341\271\241", 3}, + {"\341\271\242", "\341\271\243", 3}, + {"\341\271\244", "\341\271\245", 3}, + {"\341\271\246", "\341\271\247", 3}, + {"\341\271\250", "\341\271\251", 3}, + {"\341\271\252", "\341\271\253", 3}, + {"\341\271\254", "\341\271\255", 3}, + {"\341\271\256", "\341\271\257", 3}, + {"\341\271\260", "\341\271\261", 3}, + {"\341\271\262", "\341\271\263", 3}, + {"\341\271\264", "\341\271\265", 3}, + {"\341\271\266", "\341\271\267", 3}, + {"\341\271\270", "\341\271\271", 3}, + {"\341\271\272", "\341\271\273", 3}, + {"\341\271\274", "\341\271\275", 3}, + {"\341\271\276", "\341\271\277", 3}, + {"\341\272\200", "\341\272\201", 3}, + {"\341\272\202", "\341\272\203", 3}, + {"\341\272\204", "\341\272\205", 3}, + {"\341\272\206", "\341\272\207", 3}, + {"\341\272\210", "\341\272\211", 3}, + {"\341\272\212", "\341\272\213", 3}, + {"\341\272\214", "\341\272\215", 3}, + {"\341\272\216", "\341\272\217", 3}, + {"\341\272\220", "\341\272\221", 3}, + {"\341\272\222", "\341\272\223", 3}, + {"\341\272\224", "\341\272\225", 3}, + {"\341\272\240", "\341\272\241", 3}, + {"\341\272\242", "\341\272\243", 3}, + {"\341\272\244", "\341\272\245", 3}, + {"\341\272\246", "\341\272\247", 3}, + {"\341\272\250", "\341\272\251", 3}, + {"\341\272\252", "\341\272\253", 3}, + {"\341\272\254", "\341\272\255", 3}, + {"\341\272\256", "\341\272\257", 3}, + {"\341\272\260", "\341\272\261", 3}, + {"\341\272\262", "\341\272\263", 3}, + {"\341\272\264", "\341\272\265", 3}, + {"\341\272\266", "\341\272\267", 3}, + {"\341\272\270", "\341\272\271", 3}, + {"\341\272\272", "\341\272\273", 3}, + {"\341\272\274", "\341\272\275", 3}, + {"\341\272\276", "\341\272\277", 3}, + {"\341\273\200", "\341\273\201", 3}, + {"\341\273\202", "\341\273\203", 3}, + {"\341\273\204", "\341\273\205", 3}, + {"\341\273\206", "\341\273\207", 3}, + {"\341\273\210", "\341\273\211", 3}, + {"\341\273\212", "\341\273\213", 3}, + {"\341\273\214", "\341\273\215", 3}, + {"\341\273\216", "\341\273\217", 3}, + {"\341\273\220", "\341\273\221", 3}, + {"\341\273\222", "\341\273\223", 3}, + {"\341\273\224", "\341\273\225", 3}, + {"\341\273\226", "\341\273\227", 3}, + {"\341\273\230", "\341\273\231", 3}, + {"\341\273\232", "\341\273\233", 3}, + {"\341\273\234", "\341\273\235", 3}, + {"\341\273\236", "\341\273\237", 3}, + {"\341\273\240", "\341\273\241", 3}, + {"\341\273\242", "\341\273\243", 3}, + {"\341\273\244", "\341\273\245", 3}, + {"\341\273\246", "\341\273\247", 3}, + {"\341\273\250", "\341\273\251", 3}, + {"\341\273\252", "\341\273\253", 3}, + {"\341\273\254", "\341\273\255", 3}, + {"\341\273\256", "\341\273\257", 3}, + {"\341\273\260", "\341\273\261", 3}, + {"\341\273\262", "\341\273\263", 3}, + {"\341\273\264", "\341\273\265", 3}, + {"\341\273\266", "\341\273\267", 3}, + {"\341\273\270", "\341\273\271", 3}, + {"\341\274\210", "\341\274\200", 3}, + {"\341\274\211", "\341\274\201", 3}, + {"\341\274\212", "\341\274\202", 3}, + {"\341\274\213", "\341\274\203", 3}, + {"\341\274\214", "\341\274\204", 3}, + {"\341\274\215", "\341\274\205", 3}, + {"\341\274\216", "\341\274\206", 3}, + {"\341\274\217", "\341\274\207", 3}, + {"\341\274\230", "\341\274\220", 3}, + {"\341\274\231", "\341\274\221", 3}, + {"\341\274\232", "\341\274\222", 3}, + {"\341\274\233", "\341\274\223", 3}, + {"\341\274\234", "\341\274\224", 3}, + {"\341\274\235", "\341\274\225", 3}, + {"\341\274\250", "\341\274\240", 3}, + {"\341\274\251", "\341\274\241", 3}, + {"\341\274\252", "\341\274\242", 3}, + {"\341\274\253", "\341\274\243", 3}, + {"\341\274\254", "\341\274\244", 3}, + {"\341\274\255", "\341\274\245", 3}, + {"\341\274\256", "\341\274\246", 3}, + {"\341\274\257", "\341\274\247", 3}, + {"\341\274\270", "\341\274\260", 3}, + {"\341\274\271", "\341\274\261", 3}, + {"\341\274\272", "\341\274\262", 3}, + {"\341\274\273", "\341\274\263", 3}, + {"\341\274\274", "\341\274\264", 3}, + {"\341\274\275", "\341\274\265", 3}, + {"\341\274\276", "\341\274\266", 3}, + {"\341\274\277", "\341\274\267", 3}, + {"\341\275\210", "\341\275\200", 3}, + {"\341\275\211", "\341\275\201", 3}, + {"\341\275\212", "\341\275\202", 3}, + {"\341\275\213", "\341\275\203", 3}, + {"\341\275\214", "\341\275\204", 3}, + {"\341\275\215", "\341\275\205", 3}, + {"\341\275\231", "\341\275\221", 3}, + {"\341\275\233", "\341\275\223", 3}, + {"\341\275\235", "\341\275\225", 3}, + {"\341\275\237", "\341\275\227", 3}, + {"\341\275\250", "\341\275\240", 3}, + {"\341\275\251", "\341\275\241", 3}, + {"\341\275\252", "\341\275\242", 3}, + {"\341\275\253", "\341\275\243", 3}, + {"\341\275\254", "\341\275\244", 3}, + {"\341\275\255", "\341\275\245", 3}, + {"\341\275\256", "\341\275\246", 3}, + {"\341\275\257", "\341\275\247", 3}, + {"\341\276\210", "\341\276\200", 3}, + {"\341\276\211", "\341\276\201", 3}, + {"\341\276\212", "\341\276\202", 3}, + {"\341\276\213", "\341\276\203", 3}, + {"\341\276\214", "\341\276\204", 3}, + {"\341\276\215", "\341\276\205", 3}, + {"\341\276\216", "\341\276\206", 3}, + {"\341\276\217", "\341\276\207", 3}, + {"\341\276\230", "\341\276\220", 3}, + {"\341\276\231", "\341\276\221", 3}, + {"\341\276\232", "\341\276\222", 3}, + {"\341\276\233", "\341\276\223", 3}, + {"\341\276\234", "\341\276\224", 3}, + {"\341\276\235", "\341\276\225", 3}, + {"\341\276\236", "\341\276\226", 3}, + {"\341\276\237", "\341\276\227", 3}, + {"\341\276\250", "\341\276\240", 3}, + {"\341\276\251", "\341\276\241", 3}, + {"\341\276\252", "\341\276\242", 3}, + {"\341\276\253", "\341\276\243", 3}, + {"\341\276\254", "\341\276\244", 3}, + {"\341\276\255", "\341\276\245", 3}, + {"\341\276\256", "\341\276\246", 3}, + {"\341\276\257", "\341\276\247", 3}, + {"\341\276\270", "\341\276\260", 3}, + {"\341\276\271", "\341\276\261", 3}, + {"\341\276\272", "\341\275\260", 3}, + {"\341\276\273", "\341\275\261", 3}, + {"\341\276\274", "\341\276\263", 3}, + {"\341\276\276", "\341\276\276", 3}, + {"\341\277\210", "\341\275\262", 3}, + {"\341\277\211", "\341\275\263", 3}, + {"\341\277\212", "\341\275\264", 3}, + {"\341\277\213", "\341\275\265", 3}, + {"\341\277\214", "\341\277\203", 3}, + {"\341\277\230", "\341\277\220", 3}, + {"\341\277\231", "\341\277\221", 3}, + {"\341\277\232", "\341\275\266", 3}, + {"\341\277\233", "\341\275\267", 3}, + {"\341\277\250", "\341\277\240", 3}, + {"\341\277\251", "\341\277\241", 3}, + {"\341\277\252", "\341\275\272", 3}, + {"\341\277\253", "\341\275\273", 3}, + {"\341\277\254", "\341\277\245", 3}, + {"\341\277\270", "\341\275\270", 3}, + {"\341\277\271", "\341\275\271", 3}, + {"\341\277\272", "\341\275\274", 3}, + {"\341\277\273", "\341\275\275", 3}, + {"\341\277\274", "\341\277\263", 3}, + {NULL, NULL, 0} +}; + +UpperLowerTbl_t Upper2LowerTbl31[] = { + {"\357\274\241", "\357\275\201", 3}, + {"\357\274\242", "\357\275\202", 3}, + {"\357\274\243", "\357\275\203", 3}, + {"\357\274\244", "\357\275\204", 3}, + {"\357\274\245", "\357\275\205", 3}, + {"\357\274\246", "\357\275\206", 3}, + {"\357\274\247", "\357\275\207", 3}, + {"\357\274\250", "\357\275\210", 3}, + {"\357\274\251", "\357\275\211", 3}, + {"\357\274\252", "\357\275\212", 3}, + {"\357\274\253", "\357\275\213", 3}, + {"\357\274\254", "\357\275\214", 3}, + {"\357\274\255", "\357\275\215", 3}, + {"\357\274\256", "\357\275\216", 3}, + {"\357\274\257", "\357\275\217", 3}, + {"\357\274\260", "\357\275\220", 3}, + {"\357\274\261", "\357\275\221", 3}, + {"\357\274\262", "\357\275\222", 3}, + {"\357\274\263", "\357\275\223", 3}, + {"\357\274\264", "\357\275\224", 3}, + {"\357\274\265", "\357\275\225", 3}, + {"\357\274\266", "\357\275\226", 3}, + {"\357\274\267", "\357\275\227", 3}, + {"\357\274\270", "\357\275\230", 3}, + {"\357\274\271", "\357\275\231", 3}, + {"\357\274\272", "\357\275\232", 3}, + {NULL, NULL, 0} + /* upper, lower */ +}; + +UpperLowerTbl_t *Upper2LowerTbl2[] = { + Upper2LowerTbl20, /* \303 */ + Upper2LowerTbl21, /* \304 */ + Upper2LowerTbl22, /* \305 */ + Upper2LowerTbl23, /* \306 */ + Upper2LowerTbl24, /* \307 */ + Upper2LowerTbl25, /* \310 */ + NULL, /* \311 */ + NULL, /* \312 */ + NULL, /* \313 */ + NULL, /* \314 */ + NULL, /* \315 */ + Upper2LowerTbl26, /* \316 */ + Upper2LowerTbl27, /* \317 */ + Upper2LowerTbl28, /* \320 */ + Upper2LowerTbl29, /* \321 */ + Upper2LowerTbl2a, /* \322 */ + Upper2LowerTbl2b, /* \323 */ + Upper2LowerTbl2c, /* \324 */ + Upper2LowerTbl2d /* \325 */ +}; + +UpperLowerTbl_t *Upper2LowerTbl3[] = { + Upper2LowerTbl30, /* \341 */ + NULL, /* \342 */ + NULL, /* \343 */ + NULL, /* \344 */ + NULL, /* \345 */ + NULL, /* \346 */ + NULL, /* \347 */ + NULL, /* \350 */ + NULL, /* \351 */ + NULL, /* \352 */ + NULL, /* \353 */ + NULL, /* \354 */ + NULL, /* \355 */ + NULL, /* \356 */ + Upper2LowerTbl31 /* \357 */ +}; + +#define UL2S (unsigned char)'\303' +#define UL2E (unsigned char)'\325' +#define UL3S (unsigned char)'\341' +#define UL3E (unsigned char)'\357' + +/* + * dsgw_utf8StrToLower: translate upper-case string to lower-case + * + * input: a null terminated UTF-8 string + * output: a null terminated UTF-8 string which characters are + * converted to lower-case; characters which are not + * upper-case are copied as is. If it's not considered + * a UTF-8 string, NULL is returned. + * + * Notes: This function takes a string (made of multiple UTF-8 characters) + * for the input (not one character as in "tolower"). + * Output string is allocated in this function, which needs to be + * released when it's not needed any more. + */ +unsigned char * +dsgw_utf8StrToLower(unsigned char *s) +{ + UpperLowerTbl_t *ultp; + unsigned char *p, *np, *tail; + unsigned char *lp, *lphead; + int len, sz; + + if (s == NULL || *s == '\0') { + return s; + } + len = strlen((char *)s); + tail = s + len; + lphead = lp = (unsigned char *)dsgw_ch_malloc(len + 1); + p = s; + while ((np = (unsigned char *)ldap_utf8next((char *)p)) <= tail) { + switch(sz = np - p) { + case 1: + sprintf((char *)lp, "%c", tolower(*p)); + break; + case 2: + if (*p < UL2S || *p > UL2E) { /* out of range */ + memcpy(lp, p, sz); + break; + } + for (ultp = Upper2LowerTbl2[*p - UL2S]; + ultp && ultp->upper && memcmp(p, ultp->upper, sz); + ultp++) + ; + if (!ultp) { /* out of range */ + memcpy(lp, p, sz); + } if (ultp->upper) { /* matched */ + memcpy(lp, ultp->lower, ultp->tsz); + sz = ultp->tsz; + } else { + memcpy(lp, p, sz); + } + break; + case 3: + if (*p != UL3S && *p != UL3E) { /* out of range */ + memcpy(lp, p, sz); + break; + } + for (ultp = Upper2LowerTbl3[*p - UL3S]; + ultp && ultp->upper && memcmp(p, ultp->upper, sz); + ultp++) + ; + if (!ultp) { /* out of range */ + memcpy(lp, p, sz); + } if (ultp->upper) { /* matched */ + memcpy(lp, ultp->lower, sz); + } else { + memcpy(lp, p, sz); + } + break; + case 4: + memcpy(lp, p, sz); + break; + default: /* not UTF-8 */ + free(lphead); + return NULL; + } + lp += sz; + p = np; + if (p == tail) { + break; + } + } + *lp = '\0'; + return lphead; +} + +/* + * dsgw_utf8ToLower: translate upper-case character to lower-case + * + * input: a UTF-8 character (s) + * output: a UTF-8 character which is converted to lower-case (d) + * length (in bytes) of input character (ssz) and + * output character (dsz) + * + * Notes: This function takes a UTF-8 character (could be multiple bytes) + * for the input. Memory for the output character is NOT allocated + * in this function, caller should have allocated it (d). + * "memmove" is used since (s) and (d) are overlapped. + */ +void +dsgw_utf8ToLower(unsigned char *s, unsigned char *d, int *ssz, int *dsz) +{ + UpperLowerTbl_t *ultp; + unsigned char *tail; + + if (s == NULL || *s == '\0') { + *ssz = *dsz = 0; + return; + } + if (!(*s & 0x80)) { /* ASCII */ + *dsz = *ssz = 1; + *d = tolower(*s); + return; + } + tail = (unsigned char *)ldap_utf8next((char *)s); + *dsz = *ssz = tail - s; + switch(*ssz) { + case 1: /* ASCII */ + *d = tolower(*s); + break; + case 2: /* 2 bytes */ + if (*s < UL2S || *s > UL2E) { /* out of range */ + memmove(d, s, *ssz); + break; + } + for (ultp = Upper2LowerTbl2[*s - UL2S]; + ultp && ultp->upper && memcmp(s, ultp->upper, *ssz); + ultp++) + ; + if (!ultp) { /* out of range */ + memmove(d, s, *ssz); + } else if (ultp->upper) { /* matched */ + memmove(d, ultp->lower, ultp->tsz); + *dsz = ultp->tsz; + } else { + memmove(d, s, *ssz); + } + break; + case 3: /* 3 bytes */ + if (*s != UL3S && *s != UL3E) { /* out of range */ + memmove(d, s, *ssz); + break; + } + for (ultp = Upper2LowerTbl3[*s - UL3S]; + ultp && ultp->upper && memcmp(s, ultp->upper, *ssz); + ultp++) + ; + if (!ultp) { /* out of range */ + memmove(d, s, *ssz); + } else if (ultp->upper) { /* matched */ + memmove(d, ultp->lower, *ssz); + } else { + memmove(d, s, *ssz); + } + break; + } + return; +} + +/* + * dsgw_utf8isUpper: tests for a character that is a upper-case letter in + * UTF-8 + * + * input: a UTF-8 character (could be multi-byte) + * output: 1 if the character is a upper-case letter + * 0 if the character is not a upper-case letter + */ +int +dsgw_utf8isUpper(unsigned char *s) +{ + UpperLowerTbl_t *ultp; + unsigned char *next; + int sz; + + if (s == NULL || *s == '\0') { + return 0; + } + if (!(*s & 0x80)) { /* ASCII */ + return isupper(*s); + } + next = (unsigned char *)ldap_utf8next((char *)s); + switch(sz = next - s) { + case 1: /* ASCII */ + return isupper(*s); + case 2: + if (*s < UL2S || *s > UL2E) { /* out of range */ + return 0; + } + for (ultp = Upper2LowerTbl2[*s - UL2S]; + ultp && ultp->upper && memcmp(s, ultp->upper, sz); + ultp++) + ; + if (!ultp) { /* out of range */ + return 0; + } if (ultp->upper) { /* matched */ + return 1; + } else { + return 0; + } + case 3: + if (*s < UL3S || *s > UL3E) { /* out of range */ + return 0; + } + for (ultp = Upper2LowerTbl3[*s - UL3S]; + ultp && ultp->upper && memcmp(s, ultp->upper, sz); + ultp++) + ; + if (!ultp) { /* out of range */ + return 0; + } if (ultp->upper) { /* matched */ + return 1; + } else { + return 0; + } + default: + return 0; + } +} + +/* + * Lower2Upper Tables: sorted by lower characters + */ +UpperLowerTbl_t Lower2UpperTbl20[] = { + /* upper, lower */ + {"\303\200", "\303\240", 2}, + {"\303\201", "\303\241", 2}, + {"\303\202", "\303\242", 2}, + {"\303\203", "\303\243", 2}, + {"\303\204", "\303\244", 2}, + {"\303\205", "\303\245", 2}, + {"\303\206", "\303\246", 2}, + {"\303\207", "\303\247", 2}, + {"\303\210", "\303\250", 2}, + {"\303\211", "\303\251", 2}, + {"\303\212", "\303\252", 2}, + {"\303\213", "\303\253", 2}, + {"\303\214", "\303\254", 2}, + {"\303\215", "\303\255", 2}, + {"\303\216", "\303\256", 2}, + {"\303\217", "\303\257", 2}, + {"\303\220", "\303\260", 2}, + {"\303\221", "\303\261", 2}, + {"\303\222", "\303\262", 2}, + {"\303\223", "\303\263", 2}, + {"\303\224", "\303\264", 2}, + {"\303\225", "\303\265", 2}, + {"\303\226", "\303\266", 2}, + {"\303\230", "\303\270", 2}, + {"\303\231", "\303\271", 2}, + {"\303\232", "\303\272", 2}, + {"\303\233", "\303\273", 2}, + {"\303\234", "\303\274", 2}, + {"\303\235", "\303\275", 2}, + {"\303\236", "\303\276", 2}, + {"\305\270", "\303\277", 2}, + {NULL, NULL, 0} +}; + +UpperLowerTbl_t Lower2UpperTbl21[] = { + {"\304\200", "\304\201", 2}, + {"\304\202", "\304\203", 2}, + {"\304\204", "\304\205", 2}, + {"\304\206", "\304\207", 2}, + {"\304\210", "\304\211", 2}, + {"\304\212", "\304\213", 2}, + {"\304\214", "\304\215", 2}, + {"\304\216", "\304\217", 2}, + {"\304\220", "\304\221", 2}, + {"\304\222", "\304\223", 2}, + {"\304\224", "\304\225", 2}, + {"\304\226", "\304\227", 2}, + {"\304\230", "\304\231", 2}, + {"\304\232", "\304\233", 2}, + {"\304\234", "\304\235", 2}, + {"\304\236", "\304\237", 2}, + {"\304\240", "\304\241", 2}, + {"\304\242", "\304\243", 2}, + {"\304\244", "\304\245", 2}, + {"\304\246", "\304\247", 2}, + {"\304\250", "\304\251", 2}, + {"\304\252", "\304\253", 2}, + {"\304\254", "\304\255", 2}, + {"\304\256", "\304\257", 2}, + {"\111", "\304\261", 1}, + {"\304\262", "\304\263", 2}, + {"\304\264", "\304\265", 2}, + {"\304\266", "\304\267", 2}, + {"\304\271", "\304\272", 2}, + {"\304\273", "\304\274", 2}, + {"\304\275", "\304\276", 2}, + {NULL, NULL} +}; + +UpperLowerTbl_t Lower2UpperTbl22[] = { + {"\304\277", "\305\200", 2}, + {"\305\201", "\305\202", 2}, + {"\305\203", "\305\204", 2}, + {"\305\205", "\305\206", 2}, + {"\305\207", "\305\210", 2}, + {"\305\212", "\305\213", 2}, + {"\305\214", "\305\215", 2}, + {"\305\216", "\305\217", 2}, + {"\305\220", "\305\221", 2}, + {"\305\222", "\305\223", 2}, + {"\305\224", "\305\225", 2}, + {"\305\226", "\305\227", 2}, + {"\305\230", "\305\231", 2}, + {"\305\232", "\305\233", 2}, + {"\305\234", "\305\235", 2}, + {"\305\236", "\305\237", 2}, + {"\305\240", "\305\241", 2}, + {"\305\242", "\305\243", 2}, + {"\305\244", "\305\245", 2}, + {"\305\246", "\305\247", 2}, + {"\305\250", "\305\251", 2}, + {"\305\252", "\305\253", 2}, + {"\305\254", "\305\255", 2}, + {"\305\256", "\305\257", 2}, + {"\305\260", "\305\261", 2}, + {"\305\262", "\305\263", 2}, + {"\305\264", "\305\265", 2}, + {"\305\266", "\305\267", 2}, + {"\305\271", "\305\272", 2}, + {"\305\273", "\305\274", 2}, + {"\305\275", "\305\276", 2}, + {"\123", "\305\277", 1}, + {NULL, NULL, 0} +}; + +UpperLowerTbl_t Lower2UpperTbl23[] = { + {"\306\202", "\306\203", 2}, + {"\306\204", "\306\205", 2}, + {"\306\207", "\306\210", 2}, + {"\306\213", "\306\214", 2}, + {"\306\221", "\306\222", 2}, + {"\306\230", "\306\231", 2}, + {"\306\240", "\306\241", 2}, + {"\306\242", "\306\243", 2}, + {"\306\244", "\306\245", 2}, + {"\306\247", "\306\250", 2}, + {"\306\254", "\306\255", 2}, + {"\306\257", "\306\260", 2}, + {"\306\263", "\306\264", 2}, + {"\306\265", "\306\266", 2}, + {"\306\270", "\306\271", 2}, + {"\306\274", "\306\275", 2}, + {NULL, NULL, 0} +}; + +UpperLowerTbl_t Lower2UpperTbl24[] = { + {"\307\204", "\307\206", 2}, + {"\307\207", "\307\211", 2}, + {"\307\212", "\307\214", 2}, + {"\307\215", "\307\216", 2}, + {"\307\217", "\307\220", 2}, + {"\307\221", "\307\222", 2}, + {"\307\223", "\307\224", 2}, + {"\307\225", "\307\226", 2}, + {"\307\227", "\307\230", 2}, + {"\307\231", "\307\232", 2}, + {"\307\233", "\307\234", 2}, + {"\307\236", "\307\237", 2}, + {"\307\240", "\307\241", 2}, + {"\307\242", "\307\243", 2}, + {"\307\244", "\307\245", 2}, + {"\307\246", "\307\247", 2}, + {"\307\250", "\307\251", 2}, + {"\307\252", "\307\253", 2}, + {"\307\254", "\307\255", 2}, + {"\307\256", "\307\257", 2}, + {"\307\261", "\307\263", 2}, + {"\307\264", "\307\265", 2}, + {"\307\272", "\307\273", 2}, + {"\307\274", "\307\275", 2}, + {"\307\276", "\307\277", 2}, + {NULL, NULL, 0} +}; + +UpperLowerTbl_t Lower2UpperTbl25[] = { + {"\310\200", "\310\201", 2}, + {"\310\202", "\310\203", 2}, + {"\310\204", "\310\205", 2}, + {"\310\206", "\310\207", 2}, + {"\310\210", "\310\211", 2}, + {"\310\212", "\310\213", 2}, + {"\310\214", "\310\215", 2}, + {"\310\216", "\310\217", 2}, + {"\310\220", "\310\221", 2}, + {"\310\222", "\310\223", 2}, + {"\310\224", "\310\225", 2}, + {"\310\226", "\310\227", 2}, + {NULL, NULL, 0} +}; + +UpperLowerTbl_t Lower2UpperTbl26[] = { + {"\306\201", "\311\223", 2}, + {"\306\206", "\311\224", 2}, + {"\306\211", "\311\226", 2}, + {"\306\212", "\311\227", 2}, + {"\306\216", "\311\230", 2}, + {"\306\217", "\311\231", 2}, + {"\306\220", "\311\233", 2}, + {"\306\223", "\311\240", 2}, + {"\306\224", "\311\243", 2}, + {"\306\227", "\311\250", 2}, + {"\306\226", "\311\251", 2}, + {"\306\234", "\311\257", 2}, + {"\306\235", "\311\262", 2}, + {NULL, NULL, 0} +}; + +UpperLowerTbl_t Lower2UpperTbl27[] = { + {"\306\251", "\312\203", 2}, + {"\306\256", "\312\210", 2}, + {"\306\261", "\312\212", 2}, + {"\306\262", "\312\213", 2}, + {"\306\267", "\312\222", 2}, + {NULL, NULL, 0} +}; + +UpperLowerTbl_t Lower2UpperTbl28[] = { + {"\316\206", "\316\254", 2}, + {"\316\210", "\316\255", 2}, + {"\316\211", "\316\256", 2}, + {"\316\212", "\316\257", 2}, + {"\316\221", "\316\261", 2}, + {"\316\222", "\316\262", 2}, + {"\316\223", "\316\263", 2}, + {"\316\224", "\316\264", 2}, + {"\316\225", "\316\265", 2}, + {"\316\226", "\316\266", 2}, + {"\316\227", "\316\267", 2}, + {"\316\230", "\316\270", 2}, + {"\316\231", "\316\271", 2}, + {"\316\232", "\316\272", 2}, + {"\316\233", "\316\273", 2}, + {"\316\234", "\316\274", 2}, + {"\316\235", "\316\275", 2}, + {"\316\236", "\316\276", 2}, + {"\316\237", "\316\277", 2}, + {NULL, NULL, 0} +}; + +UpperLowerTbl_t Lower2UpperTbl29[] = { + {"\316\240", "\317\200", 2}, + {"\316\241", "\317\201", 2}, + {"\316\243", "\317\202", 2}, + {"\316\243", "\317\203", 2}, + {"\316\244", "\317\204", 2}, + {"\316\245", "\317\205", 2}, + {"\316\246", "\317\206", 2}, + {"\316\247", "\317\207", 2}, + {"\316\250", "\317\210", 2}, + {"\316\251", "\317\211", 2}, + {"\316\252", "\317\212", 2}, + {"\316\253", "\317\213", 2}, + {"\316\214", "\317\214", 2}, + {"\316\216", "\317\215", 2}, + {"\316\217", "\317\216", 2}, + {"\316\222", "\317\220", 2}, + {"\316\230", "\317\221", 2}, + {"\316\246", "\317\225", 2}, + {"\316\240", "\317\226", 2}, + {"\317\242", "\317\243", 2}, + {"\317\244", "\317\245", 2}, + {"\317\246", "\317\247", 2}, + {"\317\250", "\317\251", 2}, + {"\317\252", "\317\253", 2}, + {"\317\254", "\317\255", 2}, + {"\317\256", "\317\257", 2}, + {"\316\232", "\317\260", 2}, + {"\316\241", "\317\261", 2}, + {NULL, NULL, 0} +}; + +UpperLowerTbl_t Lower2UpperTbl2a[] = { + {"\320\220", "\320\260", 2}, + {"\320\221", "\320\261", 2}, + {"\320\222", "\320\262", 2}, + {"\320\223", "\320\263", 2}, + {"\320\224", "\320\264", 2}, + {"\320\225", "\320\265", 2}, + {"\320\226", "\320\266", 2}, + {"\320\227", "\320\267", 2}, + {"\320\230", "\320\270", 2}, + {"\320\231", "\320\271", 2}, + {"\320\232", "\320\272", 2}, + {"\320\233", "\320\273", 2}, + {"\320\234", "\320\274", 2}, + {"\320\235", "\320\275", 2}, + {"\320\236", "\320\276", 2}, + {"\320\237", "\320\277", 2}, + {NULL, NULL, 0} +}; + +UpperLowerTbl_t Lower2UpperTbl2b[] = { + {"\320\240", "\321\200", 2}, + {"\320\241", "\321\201", 2}, + {"\320\242", "\321\202", 2}, + {"\320\243", "\321\203", 2}, + {"\320\244", "\321\204", 2}, + {"\320\245", "\321\205", 2}, + {"\320\246", "\321\206", 2}, + {"\320\247", "\321\207", 2}, + {"\320\250", "\321\210", 2}, + {"\320\251", "\321\211", 2}, + {"\320\252", "\321\212", 2}, + {"\320\253", "\321\213", 2}, + {"\320\254", "\321\214", 2}, + {"\320\255", "\321\215", 2}, + {"\320\256", "\321\216", 2}, + {"\320\257", "\321\217", 2}, + {"\320\201", "\321\221", 2}, + {"\320\202", "\321\222", 2}, + {"\320\203", "\321\223", 2}, + {"\320\204", "\321\224", 2}, + {"\320\205", "\321\225", 2}, + {"\320\206", "\321\226", 2}, + {"\320\207", "\321\227", 2}, + {"\320\210", "\321\230", 2}, + {"\320\211", "\321\231", 2}, + {"\320\212", "\321\232", 2}, + {"\320\213", "\321\233", 2}, + {"\320\214", "\321\234", 2}, + {"\320\216", "\321\236", 2}, + {"\320\217", "\321\237", 2}, + {"\321\240", "\321\241", 2}, + {"\321\242", "\321\243", 2}, + {"\321\244", "\321\245", 2}, + {"\321\246", "\321\247", 2}, + {"\321\250", "\321\251", 2}, + {"\321\252", "\321\253", 2}, + {"\321\254", "\321\255", 2}, + {"\321\256", "\321\257", 2}, + {"\321\260", "\321\261", 2}, + {"\321\262", "\321\263", 2}, + {"\321\264", "\321\265", 2}, + {"\321\266", "\321\267", 2}, + {"\321\270", "\321\271", 2}, + {"\321\272", "\321\273", 2}, + {"\321\274", "\321\275", 2}, + {"\321\276", "\321\277", 2}, + {NULL, NULL, 0} +}; + +UpperLowerTbl_t Lower2UpperTbl2c[] = { + {"\322\200", "\322\201", 2}, + {"\322\220", "\322\221", 2}, + {"\322\222", "\322\223", 2}, + {"\322\224", "\322\225", 2}, + {"\322\226", "\322\227", 2}, + {"\322\230", "\322\231", 2}, + {"\322\232", "\322\233", 2}, + {"\322\234", "\322\235", 2}, + {"\322\236", "\322\237", 2}, + {"\322\240", "\322\241", 2}, + {"\322\242", "\322\243", 2}, + {"\322\244", "\322\245", 2}, + {"\322\246", "\322\247", 2}, + {"\322\250", "\322\251", 2}, + {"\322\252", "\322\253", 2}, + {"\322\254", "\322\255", 2}, + {"\322\256", "\322\257", 2}, + {"\322\260", "\322\261", 2}, + {"\322\262", "\322\263", 2}, + {"\322\264", "\322\265", 2}, + {"\322\266", "\322\267", 2}, + {"\322\270", "\322\271", 2}, + {"\322\272", "\322\273", 2}, + {"\322\274", "\322\275", 2}, + {"\322\276", "\322\277", 2}, + {NULL, NULL, 0} +}; + +UpperLowerTbl_t Lower2UpperTbl2d[] = { + {"\323\201", "\323\202", 2}, + {"\323\203", "\323\204", 2}, + {"\323\207", "\323\210", 2}, + {"\323\213", "\323\214", 2}, + {"\323\220", "\323\221", 2}, + {"\323\222", "\323\223", 2}, + {"\323\224", "\323\225", 2}, + {"\323\226", "\323\227", 2}, + {"\323\230", "\323\231", 2}, + {"\323\232", "\323\233", 2}, + {"\323\234", "\323\235", 2}, + {"\323\236", "\323\237", 2}, + {"\323\240", "\323\241", 2}, + {"\323\242", "\323\243", 2}, + {"\323\244", "\323\245", 2}, + {"\323\246", "\323\247", 2}, + {"\323\250", "\323\251", 2}, + {"\323\252", "\323\253", 2}, + {"\323\256", "\323\257", 2}, + {"\323\260", "\323\261", 2}, + {"\323\262", "\323\263", 2}, + {"\323\264", "\323\265", 2}, + {"\323\270", "\323\271", 2}, + {NULL, NULL, 0} +}; + +UpperLowerTbl_t Lower2UpperTbl2e[] = { + {"\324\261", "\325\241", 2}, + {"\324\262", "\325\242", 2}, + {"\324\263", "\325\243", 2}, + {"\324\264", "\325\244", 2}, + {"\324\265", "\325\245", 2}, + {"\324\266", "\325\246", 2}, + {"\324\267", "\325\247", 2}, + {"\324\270", "\325\250", 2}, + {"\324\271", "\325\251", 2}, + {"\324\272", "\325\252", 2}, + {"\324\273", "\325\253", 2}, + {"\324\274", "\325\254", 2}, + {"\324\275", "\325\255", 2}, + {"\324\276", "\325\256", 2}, + {"\324\277", "\325\257", 2}, + {"\325\200", "\325\260", 2}, + {"\325\201", "\325\261", 2}, + {"\325\202", "\325\262", 2}, + {"\325\203", "\325\263", 2}, + {"\325\204", "\325\264", 2}, + {"\325\205", "\325\265", 2}, + {"\325\206", "\325\266", 2}, + {"\325\207", "\325\267", 2}, + {"\325\210", "\325\270", 2}, + {"\325\211", "\325\271", 2}, + {"\325\212", "\325\272", 2}, + {"\325\213", "\325\273", 2}, + {"\325\214", "\325\274", 2}, + {"\325\215", "\325\275", 2}, + {"\325\216", "\325\276", 2}, + {"\325\217", "\325\277", 2}, + {NULL, NULL, 0} +}; + +UpperLowerTbl_t Lower2UpperTbl2f[] = { + {"\325\220", "\326\200", 2}, + {"\325\221", "\326\201", 2}, + {"\325\222", "\326\202", 2}, + {"\325\223", "\326\203", 2}, + {"\325\224", "\326\204", 2}, + {"\325\225", "\326\205", 2}, + {"\325\226", "\326\206", 2}, + {NULL, NULL, 0} +}; + +UpperLowerTbl_t Lower2UpperTbl30[] = { + {"\341\202\240", "\341\203\220", 3}, + {"\341\202\241", "\341\203\221", 3}, + {"\341\202\242", "\341\203\222", 3}, + {"\341\202\243", "\341\203\223", 3}, + {"\341\202\244", "\341\203\224", 3}, + {"\341\202\245", "\341\203\225", 3}, + {"\341\202\246", "\341\203\226", 3}, + {"\341\202\247", "\341\203\227", 3}, + {"\341\202\250", "\341\203\230", 3}, + {"\341\202\251", "\341\203\231", 3}, + {"\341\202\252", "\341\203\232", 3}, + {"\341\202\253", "\341\203\233", 3}, + {"\341\202\254", "\341\203\234", 3}, + {"\341\202\255", "\341\203\235", 3}, + {"\341\202\256", "\341\203\236", 3}, + {"\341\202\257", "\341\203\237", 3}, + {"\341\202\260", "\341\203\240", 3}, + {"\341\202\261", "\341\203\241", 3}, + {"\341\202\262", "\341\203\242", 3}, + {"\341\202\263", "\341\203\243", 3}, + {"\341\202\264", "\341\203\244", 3}, + {"\341\202\265", "\341\203\245", 3}, + {"\341\202\266", "\341\203\246", 3}, + {"\341\202\267", "\341\203\247", 3}, + {"\341\202\270", "\341\203\250", 3}, + {"\341\202\271", "\341\203\251", 3}, + {"\341\202\272", "\341\203\252", 3}, + {"\341\202\273", "\341\203\253", 3}, + {"\341\202\274", "\341\203\254", 3}, + {"\341\202\275", "\341\203\255", 3}, + {"\341\202\276", "\341\203\256", 3}, + {"\341\202\277", "\341\203\257", 3}, + {"\341\203\200", "\341\203\260", 3}, + {"\341\203\201", "\341\203\261", 3}, + {"\341\203\202", "\341\203\262", 3}, + {"\341\203\203", "\341\203\263", 3}, + {"\341\203\204", "\341\203\264", 3}, + {"\341\203\205", "\341\203\265", 3}, + {"\341\270\200", "\341\270\201", 3}, + {"\341\270\202", "\341\270\203", 3}, + {"\341\270\204", "\341\270\205", 3}, + {"\341\270\206", "\341\270\207", 3}, + {"\341\270\210", "\341\270\211", 3}, + {"\341\270\212", "\341\270\213", 3}, + {"\341\270\214", "\341\270\215", 3}, + {"\341\270\216", "\341\270\217", 3}, + {"\341\270\220", "\341\270\221", 3}, + {"\341\270\222", "\341\270\223", 3}, + {"\341\270\224", "\341\270\225", 3}, + {"\341\270\226", "\341\270\227", 3}, + {"\341\270\230", "\341\270\231", 3}, + {"\341\270\232", "\341\270\233", 3}, + {"\341\270\234", "\341\270\235", 3}, + {"\341\270\236", "\341\270\237", 3}, + {"\341\270\240", "\341\270\241", 3}, + {"\341\270\242", "\341\270\243", 3}, + {"\341\270\244", "\341\270\245", 3}, + {"\341\270\246", "\341\270\247", 3}, + {"\341\270\250", "\341\270\251", 3}, + {"\341\270\252", "\341\270\253", 3}, + {"\341\270\254", "\341\270\255", 3}, + {"\341\270\256", "\341\270\257", 3}, + {"\341\270\260", "\341\270\261", 3}, + {"\341\270\262", "\341\270\263", 3}, + {"\341\270\264", "\341\270\265", 3}, + {"\341\270\266", "\341\270\267", 3}, + {"\341\270\270", "\341\270\271", 3}, + {"\341\270\272", "\341\270\273", 3}, + {"\341\270\274", "\341\270\275", 3}, + {"\341\270\276", "\341\270\277", 3}, + {"\341\271\200", "\341\271\201", 3}, + {"\341\271\202", "\341\271\203", 3}, + {"\341\271\204", "\341\271\205", 3}, + {"\341\271\206", "\341\271\207", 3}, + {"\341\271\210", "\341\271\211", 3}, + {"\341\271\212", "\341\271\213", 3}, + {"\341\271\214", "\341\271\215", 3}, + {"\341\271\216", "\341\271\217", 3}, + {"\341\271\220", "\341\271\221", 3}, + {"\341\271\222", "\341\271\223", 3}, + {"\341\271\224", "\341\271\225", 3}, + {"\341\271\226", "\341\271\227", 3}, + {"\341\271\230", "\341\271\231", 3}, + {"\341\271\232", "\341\271\233", 3}, + {"\341\271\234", "\341\271\235", 3}, + {"\341\271\236", "\341\271\237", 3}, + {"\341\271\240", "\341\271\241", 3}, + {"\341\271\242", "\341\271\243", 3}, + {"\341\271\244", "\341\271\245", 3}, + {"\341\271\246", "\341\271\247", 3}, + {"\341\271\250", "\341\271\251", 3}, + {"\341\271\252", "\341\271\253", 3}, + {"\341\271\254", "\341\271\255", 3}, + {"\341\271\256", "\341\271\257", 3}, + {"\341\271\260", "\341\271\261", 3}, + {"\341\271\262", "\341\271\263", 3}, + {"\341\271\264", "\341\271\265", 3}, + {"\341\271\266", "\341\271\267", 3}, + {"\341\271\270", "\341\271\271", 3}, + {"\341\271\272", "\341\271\273", 3}, + {"\341\271\274", "\341\271\275", 3}, + {"\341\271\276", "\341\271\277", 3}, + {"\341\272\200", "\341\272\201", 3}, + {"\341\272\202", "\341\272\203", 3}, + {"\341\272\204", "\341\272\205", 3}, + {"\341\272\206", "\341\272\207", 3}, + {"\341\272\210", "\341\272\211", 3}, + {"\341\272\212", "\341\272\213", 3}, + {"\341\272\214", "\341\272\215", 3}, + {"\341\272\216", "\341\272\217", 3}, + {"\341\272\220", "\341\272\221", 3}, + {"\341\272\222", "\341\272\223", 3}, + {"\341\272\224", "\341\272\225", 3}, + {"\341\272\240", "\341\272\241", 3}, + {"\341\272\242", "\341\272\243", 3}, + {"\341\272\244", "\341\272\245", 3}, + {"\341\272\246", "\341\272\247", 3}, + {"\341\272\250", "\341\272\251", 3}, + {"\341\272\252", "\341\272\253", 3}, + {"\341\272\254", "\341\272\255", 3}, + {"\341\272\256", "\341\272\257", 3}, + {"\341\272\260", "\341\272\261", 3}, + {"\341\272\262", "\341\272\263", 3}, + {"\341\272\264", "\341\272\265", 3}, + {"\341\272\266", "\341\272\267", 3}, + {"\341\272\270", "\341\272\271", 3}, + {"\341\272\272", "\341\272\273", 3}, + {"\341\272\274", "\341\272\275", 3}, + {"\341\272\276", "\341\272\277", 3}, + {"\341\273\200", "\341\273\201", 3}, + {"\341\273\202", "\341\273\203", 3}, + {"\341\273\204", "\341\273\205", 3}, + {"\341\273\206", "\341\273\207", 3}, + {"\341\273\210", "\341\273\211", 3}, + {"\341\273\212", "\341\273\213", 3}, + {"\341\273\214", "\341\273\215", 3}, + {"\341\273\216", "\341\273\217", 3}, + {"\341\273\220", "\341\273\221", 3}, + {"\341\273\222", "\341\273\223", 3}, + {"\341\273\224", "\341\273\225", 3}, + {"\341\273\226", "\341\273\227", 3}, + {"\341\273\230", "\341\273\231", 3}, + {"\341\273\232", "\341\273\233", 3}, + {"\341\273\234", "\341\273\235", 3}, + {"\341\273\236", "\341\273\237", 3}, + {"\341\273\240", "\341\273\241", 3}, + {"\341\273\242", "\341\273\243", 3}, + {"\341\273\244", "\341\273\245", 3}, + {"\341\273\246", "\341\273\247", 3}, + {"\341\273\250", "\341\273\251", 3}, + {"\341\273\252", "\341\273\253", 3}, + {"\341\273\254", "\341\273\255", 3}, + {"\341\273\256", "\341\273\257", 3}, + {"\341\273\260", "\341\273\261", 3}, + {"\341\273\262", "\341\273\263", 3}, + {"\341\273\264", "\341\273\265", 3}, + {"\341\273\266", "\341\273\267", 3}, + {"\341\273\270", "\341\273\271", 3}, + {"\341\274\210", "\341\274\200", 3}, + {"\341\274\211", "\341\274\201", 3}, + {"\341\274\212", "\341\274\202", 3}, + {"\341\274\213", "\341\274\203", 3}, + {"\341\274\214", "\341\274\204", 3}, + {"\341\274\215", "\341\274\205", 3}, + {"\341\274\216", "\341\274\206", 3}, + {"\341\274\217", "\341\274\207", 3}, + {"\341\274\230", "\341\274\220", 3}, + {"\341\274\231", "\341\274\221", 3}, + {"\341\274\232", "\341\274\222", 3}, + {"\341\274\233", "\341\274\223", 3}, + {"\341\274\234", "\341\274\224", 3}, + {"\341\274\235", "\341\274\225", 3}, + {"\341\274\250", "\341\274\240", 3}, + {"\341\274\251", "\341\274\241", 3}, + {"\341\274\252", "\341\274\242", 3}, + {"\341\274\253", "\341\274\243", 3}, + {"\341\274\254", "\341\274\244", 3}, + {"\341\274\255", "\341\274\245", 3}, + {"\341\274\256", "\341\274\246", 3}, + {"\341\274\257", "\341\274\247", 3}, + {"\341\274\270", "\341\274\260", 3}, + {"\341\274\271", "\341\274\261", 3}, + {"\341\274\272", "\341\274\262", 3}, + {"\341\274\273", "\341\274\263", 3}, + {"\341\274\274", "\341\274\264", 3}, + {"\341\274\275", "\341\274\265", 3}, + {"\341\274\276", "\341\274\266", 3}, + {"\341\274\277", "\341\274\267", 3}, + {"\341\275\210", "\341\275\200", 3}, + {"\341\275\211", "\341\275\201", 3}, + {"\341\275\212", "\341\275\202", 3}, + {"\341\275\213", "\341\275\203", 3}, + {"\341\275\214", "\341\275\204", 3}, + {"\341\275\215", "\341\275\205", 3}, + {"\341\275\231", "\341\275\221", 3}, + {"\341\275\233", "\341\275\223", 3}, + {"\341\275\235", "\341\275\225", 3}, + {"\341\275\237", "\341\275\227", 3}, + {"\341\275\250", "\341\275\240", 3}, + {"\341\275\251", "\341\275\241", 3}, + {"\341\275\252", "\341\275\242", 3}, + {"\341\275\253", "\341\275\243", 3}, + {"\341\275\254", "\341\275\244", 3}, + {"\341\275\255", "\341\275\245", 3}, + {"\341\275\256", "\341\275\246", 3}, + {"\341\275\257", "\341\275\247", 3}, + {"\341\276\272", "\341\275\260", 3}, + {"\341\276\273", "\341\275\261", 3}, + {"\341\277\210", "\341\275\262", 3}, + {"\341\277\211", "\341\275\263", 3}, + {"\341\277\212", "\341\275\264", 3}, + {"\341\277\213", "\341\275\265", 3}, + {"\341\277\232", "\341\275\266", 3}, + {"\341\277\233", "\341\275\267", 3}, + {"\341\277\270", "\341\275\270", 3}, + {"\341\277\271", "\341\275\271", 3}, + {"\341\277\252", "\341\275\272", 3}, + {"\341\277\253", "\341\275\273", 3}, + {"\341\277\272", "\341\275\274", 3}, + {"\341\277\273", "\341\275\275", 3}, + {"\341\276\210", "\341\276\200", 3}, + {"\341\276\211", "\341\276\201", 3}, + {"\341\276\212", "\341\276\202", 3}, + {"\341\276\213", "\341\276\203", 3}, + {"\341\276\214", "\341\276\204", 3}, + {"\341\276\215", "\341\276\205", 3}, + {"\341\276\216", "\341\276\206", 3}, + {"\341\276\217", "\341\276\207", 3}, + {"\341\276\230", "\341\276\220", 3}, + {"\341\276\231", "\341\276\221", 3}, + {"\341\276\232", "\341\276\222", 3}, + {"\341\276\233", "\341\276\223", 3}, + {"\341\276\234", "\341\276\224", 3}, + {"\341\276\235", "\341\276\225", 3}, + {"\341\276\236", "\341\276\226", 3}, + {"\341\276\237", "\341\276\227", 3}, + {"\341\276\250", "\341\276\240", 3}, + {"\341\276\251", "\341\276\241", 3}, + {"\341\276\252", "\341\276\242", 3}, + {"\341\276\253", "\341\276\243", 3}, + {"\341\276\254", "\341\276\244", 3}, + {"\341\276\255", "\341\276\245", 3}, + {"\341\276\256", "\341\276\246", 3}, + {"\341\276\257", "\341\276\247", 3}, + {"\341\276\270", "\341\276\260", 3}, + {"\341\276\271", "\341\276\261", 3}, + {"\341\276\274", "\341\276\263", 3}, + {"\341\277\214", "\341\277\203", 3}, + {"\341\277\230", "\341\277\220", 3}, + {"\341\277\231", "\341\277\221", 3}, + {"\341\277\250", "\341\277\240", 3}, + {"\341\277\251", "\341\277\241", 3}, + {"\341\277\254", "\341\277\245", 3}, + {"\341\277\274", "\341\277\263", 3}, + {NULL, NULL, 0} +}; + +UpperLowerTbl_t Lower2UpperTbl31[] = { + {"\357\274\241", "\357\275\201", 3}, + {"\357\274\242", "\357\275\202", 3}, + {"\357\274\243", "\357\275\203", 3}, + {"\357\274\244", "\357\275\204", 3}, + {"\357\274\245", "\357\275\205", 3}, + {"\357\274\246", "\357\275\206", 3}, + {"\357\274\247", "\357\275\207", 3}, + {"\357\274\250", "\357\275\210", 3}, + {"\357\274\251", "\357\275\211", 3}, + {"\357\274\252", "\357\275\212", 3}, + {"\357\274\253", "\357\275\213", 3}, + {"\357\274\254", "\357\275\214", 3}, + {"\357\274\255", "\357\275\215", 3}, + {"\357\274\256", "\357\275\216", 3}, + {"\357\274\257", "\357\275\217", 3}, + {"\357\274\260", "\357\275\220", 3}, + {"\357\274\261", "\357\275\221", 3}, + {"\357\274\262", "\357\275\222", 3}, + {"\357\274\263", "\357\275\223", 3}, + {"\357\274\264", "\357\275\224", 3}, + {"\357\274\265", "\357\275\225", 3}, + {"\357\274\266", "\357\275\226", 3}, + {"\357\274\267", "\357\275\227", 3}, + {"\357\274\270", "\357\275\230", 3}, + {"\357\274\271", "\357\275\231", 3}, + {"\357\274\272", "\357\275\232", 3}, + {NULL, NULL, 0} + /* upper, lower */ +}; + +UpperLowerTbl_t *Lower2UpperTbl2[] = { + Lower2UpperTbl20, /* \303 */ + Lower2UpperTbl21, /* \304 */ + Lower2UpperTbl22, /* \305 */ + Lower2UpperTbl23, /* \306 */ + Lower2UpperTbl24, /* \307 */ + Lower2UpperTbl25, /* \310 */ + Lower2UpperTbl26, /* \311 */ + Lower2UpperTbl27, /* \312 */ + NULL, /* \313 */ + NULL, /* \314 */ + NULL, /* \315 */ + Lower2UpperTbl28, /* \316 */ + Lower2UpperTbl29, /* \317 */ + Lower2UpperTbl2a, /* \320 */ + Lower2UpperTbl2b, /* \321 */ + Lower2UpperTbl2c, /* \322 */ + Lower2UpperTbl2d, /* \323 */ + NULL, /* \324 */ + Lower2UpperTbl2e, /* \325 */ + Lower2UpperTbl2f /* \326 */ +}; + +UpperLowerTbl_t *Lower2UpperTbl3[] = { + Lower2UpperTbl30, /* \341 */ + NULL, /* \342 */ + NULL, /* \343 */ + NULL, /* \344 */ + NULL, /* \345 */ + NULL, /* \346 */ + NULL, /* \347 */ + NULL, /* \350 */ + NULL, /* \351 */ + NULL, /* \352 */ + NULL, /* \353 */ + NULL, /* \354 */ + NULL, /* \355 */ + NULL, /* \356 */ + Lower2UpperTbl31 /* \357 */ +}; + +#define LU2S (unsigned char)'\303' +#define LU2E (unsigned char)'\326' +#define LU3S (unsigned char)'\341' +#define LU3E (unsigned char)'\357' + +/* + * dsgw_utf8StrToUpper: translate lower-case string to upper-case + * + * input: a null terminated UTF-8 string + * output: a null terminated UTF-8 string which characters are + * converted to upper-case; characters which are not + * lower-case are copied as is. If it's not considered + * a UTF-8 string, NULL is returned. + * + * Notes: This function takes a string (made of multiple UTF-8 characters) + * for the input (not one character as in "toupper"). + * Output string is allocated in this function, which needs to be + * released when it's not needed any more. + */ +unsigned char * +dsgw_utf8StrToUpper(unsigned char *s) +{ + UpperLowerTbl_t *ultp; + unsigned char *p, *np, *tail; + unsigned char *up, *uphead; + int len, sz; + + if (s == NULL || *s == '\0') { + return s; + } + len = strlen((char *)s); + tail = s + len; + uphead = up = (unsigned char *)dsgw_ch_malloc(len + 1); + p = s; + while ((np = (unsigned char *)ldap_utf8next((char *)p)) <= tail) { + switch(sz = np - p) { + case 1: /* ASCII */ + sprintf((char *)up, "%c", toupper(*p)); + break; + case 2: /* 2 bytes */ + if (*p < LU2S || *p > LU2E) { /* out of range */ + memcpy(up, p, sz); + break; + } + for (ultp = Lower2UpperTbl2[*p - LU2S]; + ultp && ultp->lower && memcmp(p, ultp->lower, sz); + ultp++) + ; + if (!ultp) { /* out of range */ + memcpy(up, p, sz); + } if (ultp->lower) { /* matched */ + memcpy(up, ultp->upper, ultp->tsz); + sz = ultp->tsz; + } else { + memcpy(up, p, sz); + } + break; + case 3: /* 3 bytes */ + if (*p != LU3S && *p != LU3E) { /* out of range */ + memcpy(up, p, sz); + break; + } + for (ultp = Lower2UpperTbl3[*p - LU3S]; + ultp && ultp->lower && memcmp(p, ultp->lower, sz); + ultp++) + ; + if (!ultp) { /* out of range */ + memcpy(up, p, sz); + } if (ultp->lower) { /* matched */ + memcpy(up, ultp->upper, sz); + } else { + memcpy(up, p, sz); + } + break; + case 4: + memcpy(up, p, sz); + break; + default: /* not UTF-8 */ + free(uphead); + return NULL; + } + up += sz; + p = np; + if (p == tail) { + break; + } + } + *up = '\0'; + return uphead; +} + +/* + * dsgw_utf8ToUpper: translate lower-case character to upper-case + * + * input: a UTF-8 character (s) + * output: a UTF-8 character which is converted to upper-case (d) + * length (in bytes) of input character (ssz) and + * output character (dsz) + * + * Notes: This function takes a UTF-8 character (could be multiple bytes) + * for the input. Memory for the output character is NOT allocated + * in this function, caller should have allocated it (d). + * "memmove" is used since (s) and (d) are overlapped. + */ +void +dsgw_utf8ToUpper(unsigned char *s, unsigned char *d, int *ssz, int *dsz) +{ + UpperLowerTbl_t *ultp; + unsigned char *tail; + + if (s == NULL || *s == '\0') { + *ssz = *dsz = 0; + return; + } + if (!(*s & 0x80)) { /* ASCII */ + *dsz = *ssz = 1; + *d = toupper(*s); + return; + } + tail = (unsigned char *)ldap_utf8next((char *)s); + *dsz = *ssz = tail - s; + switch(*ssz) { + case 1: /* ASCII */ + *d = toupper(*s); + break; + case 2: /* 2 bytes */ + if (*s < LU2S || *s > LU2E) { /* out of range */ + memmove(d, s, *ssz); + break; + } + for (ultp = Lower2UpperTbl2[*s - LU2S]; + ultp && ultp->lower && memcmp(s, ultp->lower, *ssz); + ultp++) + ; + if (!ultp) { /* out of range */ + memmove(d, s, *ssz); + } else if (ultp->lower) { /* matched */ + memmove(d, ultp->upper, ultp->tsz); + *dsz = ultp->tsz; + } else { + memmove(d, s, *ssz); + } + break; + case 3: /* 3 bytes */ + if (*s != LU3S && *s != LU3E) { /* out of range */ + memmove(d, s, *ssz); + break; + } + for (ultp = Lower2UpperTbl3[*s - LU3S]; + ultp && ultp->lower && memcmp(s, ultp->lower, *ssz); + ultp++) + ; + if (!ultp) { /* out of range */ + memmove(d, s, *ssz); + } else if (ultp->lower) { /* matched */ + memmove(d, ultp->upper, *ssz); + } else { + memmove(d, s, *ssz); + } + break; + } + return; +} + +/* + * dsgw_utf8isLower: tests for a character that is a lower-case letter in + * UTF-8 + * + * input: a UTF-8 character (could be multi-byte) + * output: 1 if the character is a lower-case letter + * 0 if the character is not a lower-case letter + */ +int +dsgw_utf8isLower(unsigned char *s) +{ + UpperLowerTbl_t *ultp; + unsigned char *next; + int sz; + + if (s == NULL || *s == '\0') { + return 0; + } + if (!(*s & 0x80)) { /* ASCII */ + return islower(*s); + } + next = (unsigned char *)ldap_utf8next((char *)s); + switch(sz = next - s) { + case 1: /* ASCII */ + return islower(*s); + case 2: + if (*s < LU2S || *s > LU2E) { /* out of range */ + return 0; + } + for (ultp = Lower2UpperTbl2[*s - LU2S]; + ultp && ultp->lower && memcmp(s, ultp->lower, sz); + ultp++) + ; + if (!ultp) { /* out of range */ + return 0; + } if (ultp->lower) { /* matched */ + return 1; + } else { + return 0; + } + case 3: + if (*s < LU3S || *s > LU3E) { /* out of range */ + return 0; + } + for (ultp = Lower2UpperTbl3[*s - LU3S]; + ultp && ultp->lower && memcmp(s, ultp->lower, sz); + ultp++) + ; + if (!ultp) { /* out of range */ + return 0; + } if (ultp->lower) { /* matched */ + return 1; + } else { + return 0; + } + default: + return 0; + } +} + +/* + * dsgw_utf8casecmp: case-insensitive string compare for UTF-8 strings + * + * input: two UTF-8 strings (s0, s1) to be compared + * output: positive number, if s0 is after s1 + * 0, if the two strings are identical ignoring the case + * negative number, if s1 is after s0 + * + * Rules: If both UTF-8 strings are NULL or 0-length, 0 is returned. + * If one of the strings is NULL or 0-length, the NULL/0-length + * string is smaller. + * If one or both of the strings are not UTF-8, system provided + * strcasecmp is used. + * If one of the two strings contains no 8-bit characters, + * strcasecmp is used. + * The strings are compared after converted to lower-case UTF-8. + * Each character is compared from the beginning. + * Evaluation goes in this order: + * If the length of one character is shorter then the other, + * the difference of the two lengths is returned. + * If the length of the corresponsing characters is same, + * each byte in the characters is compared. + * If there's a difference between two bytes, + * the diff is returned. + * If one string is shorter then the other, the diff is returned. + * + * Notes: Don't use this function for collation + * 1) there's no notion of locale in this function. + * 2) it's UTF-8 code order, which is different from the locale + * based collation. + */ +int +dsgw_utf8casecmp(unsigned char *s0, unsigned char *s1) +{ + unsigned char *d0, *d1; /* store lower-case strings */ + unsigned char *p0, *p1; /* current UTF-8 char */ + unsigned char *n0, *n1; /* next UTF-8 char */ + unsigned char *t0, *t1; /* tail of the strings */ + unsigned char *x0, *x1; /* current byte in a char */ + int i0, i1; /* length of characters */ + int l0, l1; /* length of leftover */ + int rval; + int has8_s0; + int has8_s1; + + d0 = d1 = NULL; + if (s0 == NULL || *s0 == '\0') { + if (s1 == NULL || *s1 == '\0') { + rval = 0; + } else { + rval = -1; /* regardless s1, s0 < s1 */ + } + goto end; + } else if (s1 == NULL || *s1 == '\0') { + rval = 1; /* regardless s0, s0 > s1 */ + goto end; + } + + has8_s0 = dsgw_has8thBit(s0); + has8_s1 = dsgw_has8thBit(s1); + if (has8_s0 == has8_s1) { /* both has-8th-bit or both do not */ + if (has8_s0 == 0) { /* neither has-8th-bit */ + rval = strcasecmp((char *)s0, (char *)s1); + goto end; + } + } else { /* one has and the other do not */ + rval = strcasecmp((char *)s0, (char *)s1); + goto end; + } + + d0 = dsgw_utf8StrToLower(s0); + d1 = dsgw_utf8StrToLower(s1); + if (d0 == NULL || d1 == NULL || /* either is not a UTF-8 string */ + (d0 && *d0 == '\0') || (d1 && *d1 == '\0')) { + rval = strcasecmp((char *)s0, (char *)s1); + goto end; + } + + p0 = d0; + p1 = d1; + + t0 = d0 + strlen((char *)d0); + t1 = d1 + strlen((char *)d1); + + rval = 0; + while (1) { + n0 = (unsigned char *)ldap_utf8next((char *)p0); + n1 = (unsigned char *)ldap_utf8next((char *)p1); + if (n0 > t0 || n1 > t1) { + break; + } + + i0 = n0 - p0; + i1 = n1 - p1; + rval = i0 - i1; + if (rval) { /* length is different */ + goto end; + } + + /* i0 == i1: same length */ + for (x0 = p0, x1 = p1; x0 < n0; x0++, x1++) { + rval = *x0 - *x1; + if (rval) { + goto end; + } + } + + p0 = n0; p1 = n1; /* goto next */ + } + /* finished scanning the shared part and check the leftover */ + l0 = t0 - n0; + l1 = t1 - n1; + rval = l0 - l1; + +end: + if (d0) + free(d0); + if (d1) + free(d1); + + return rval; +} + +/* + * dsgw_utf8ncasecmp: case-insensitive string compare (n chars) for UTF-8 + * strings + * + * input: two UTF-8 strings (s0, s1) to be compared + * number or characters + * output: positive number, if s0 is after s1 + * 0, if the two strings are identical ignoring the case + * negative number, if s1 is after s0 + * + * Rules: Same as dsgw_utf8casecmp except the n characters limit. + * + * Notes: Don't use this function for collation + * 1) there's no notion of locale in this function. + * 2) it's UTF-8 code order, which is different from the locale + * based collation. + * n characters, NOT n bytes + */ +int +dsgw_utf8ncasecmp(unsigned char *s0, unsigned char *s1, int n) +{ + unsigned char *d0, *d1; /* store lower-case strings */ + unsigned char *p0, *p1; /* current UTF-8 char */ + unsigned char *n0, *n1; /* next UTF-8 char */ + unsigned char *t0, *t1; /* tail of the strings */ + unsigned char *x0, *x1; /* current byte in a char */ + int i0, i1; /* length of characters */ + int l0, l1; /* length of leftover */ + int cnt; + int rval; + int has8_s0; + int has8_s1; + + d0 = d1 = NULL; + if (s0 == NULL || *s0 == '\0') { + if (s1 == NULL || *s1 == '\0') { + rval = 0; + } else { + rval = -1; /* regardless s1, s0 < s1 */ + } + goto end; + } else if (s1 == NULL || *s1 == '\0') { + rval = 1; /* regardless s0, s0 > s1 */ + goto end; + } + + has8_s0 = dsgw_has8thBit(s0); + has8_s1 = dsgw_has8thBit(s1); + if (has8_s0 == has8_s1) { /* both has-8th-bit or both do not */ + if (has8_s0 == 0) { /* neither has-8th-bit */ + rval = strncasecmp((char *)s0, (char *)s1, n); + goto end; + } + } else { /* one has and the other do not */ + rval = strncasecmp((char *)s0, (char *)s1, n); + goto end; + } + + d0 = dsgw_utf8StrToLower(s0); + d1 = dsgw_utf8StrToLower(s1); + if (d0 == NULL || d1 == NULL || /* either is not a UTF-8 string */ + (d0 && *d0 == '\0') || (d1 && *d1 == '\0')) { + rval = strncasecmp((char *)s0, (char *)s1, n); + goto end; + } + + p0 = d0; + p1 = d1; + + t0 = d0 + strlen((char *)d0); + t1 = d1 + strlen((char *)d1); + + rval = 0; + cnt = 0; + while (1) { + n0 = (unsigned char *)ldap_utf8next((char *)p0); + n1 = (unsigned char *)ldap_utf8next((char *)p1); + if (n0 > t0 || n1 > t1 || cnt == n) { + break; + } + + i0 = n0 - p0; + i1 = n1 - p1; + rval = i0 - i1; + if (rval) /* length is different */ + goto end; + + /* i0 == i1: same length */ + for (x0 = p0, x1 = p1; x0 < n0; x0++, x1++) { + rval = *x0 - *x1; + if (rval) + goto end; + } + + p0 = n0; p1 = n1; /* goto next */ + cnt++; + } + if (cnt == n) + rval = 0; + else { + /* finished scanning the shared part and check the leftover */ + l0 = t0 - n0; + l1 = t1 - n1; + rval = l0 - l1; + } + +end: + if (d0) + free(d0); + if (d1) + free(d1); + + return rval; +} + diff --git a/vcard.c b/vcard.c new file mode 100644 index 0000000..a8e4ef8 --- /dev/null +++ b/vcard.c @@ -0,0 +1,286 @@ +/** --- BEGIN COPYRIGHT BLOCK --- + * This Program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; version 2 of the License. + * + * This Program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + * + * In addition, as a special exception, Red Hat, Inc. gives You the additional + * right to link the code of this Program with code not covered under the GNU + * General Public License ("Non-GPL Code") and to distribute linked combinations + * including the two, subject to the limitations in this paragraph. Non-GPL Code + * permitted under this exception must only link to the code of this Program + * through those well defined interfaces identified in the file named EXCEPTION + * found in the source code files (the "Approved Interfaces"). The files of + * Non-GPL Code may instantiate templates or use macros or inline functions from + * the Approved Interfaces without causing the resulting work to be covered by + * the GNU General Public License. Only Red Hat, Inc. may make changes or + * additions to the list of Approved Interfaces. You must obey the GNU General + * Public License in all respects for all of the Program code and other code used + * in conjunction with the Program except the Non-GPL Code covered by this + * exception. If you modify this file, you may extend this exception to your + * version of the file, but you are not obligated to do so. If you do not wish to + * provide this exception without modification, you must delete this exception + * statement from your version and license this file solely under the GPL without + * exception. + * + * + * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. + * Copyright (C) 2005 Red Hat, Inc. + * All rights reserved. + --- END COPYRIGHT BLOCK --- */ +/* + * vcard.c -- vCard utility functions -- HTTP gateway + */ + +#include "dsgw.h" +#include "dbtdsgw.h" +#include "ldif.h" + + +static int entry2vcard( LDAP *ld, char *dn, char *mimetype, + dsgwvcprop *vcprops, char **lderrtxtp ); +static void write_vcard_property( char *prop, char *val, char *val2, + int is_mls ); +static void emit_vcard_headers( char *mimetype ); +static char **vcard_ldapattrs( dsgwvcprop *vcprops ); +static void dsgw_puts( char *s ); + + +#define DSGW_VCARD_MIMEHDR_TEXTDIR "text/directory;profile=vcard" +#define DSGW_VCARD_MIMEHDR_XVCARD "text/x-vcard" +#define DSGW_VCARD_VERSION "2.1" +#define DSGW_VCARD_PROP_VERSION "VERSION" +#define DSGW_VCARD_PROP_BEGIN "BEGIN" +#define DSGW_VCARD_PROP_END "END" +#define DSGW_VCARD_BEGINEND_VALUE "vCard" + + +void +dsgw_vcard_from_entry( LDAP *ld, char *dn, char *mimetype ) +{ + int lderr; + char *lderrtxt; + + if (( lderr = entry2vcard( ld, dn, mimetype, gc->gc_vcardproperties, + &lderrtxt )) != LDAP_SUCCESS ) { + dsgw_error( DSGW_ERR_LDAPGENERAL, NULL, DSGW_ERROPT_EXIT, lderr, + lderrtxt ); + } +} + + +/* + * Retrieve the LDAP entry "dn" and write a vCard representation of it + * to stdout. + */ +static int +entry2vcard( LDAP *ld, char *dn, char *mimetype, dsgwvcprop *vcprops, + char **lderrtxtp ) +{ + int i, rc, is_mls; + char **ldattrs, **vals, **vals2; + dsgwvcprop *vcp; + LDAPMessage *msgp, *entry; + + + ldattrs = vcard_ldapattrs( vcprops ); + + /* Read the entry. */ + if (( rc = ldap_search_s( ld, dn, LDAP_SCOPE_BASE, "objectClass=*", + ldattrs, 0, &msgp )) != LDAP_SUCCESS ) { + (void)ldap_get_lderrno( ld, NULL, lderrtxtp ); + return( rc ); + } + if (( entry = ldap_first_entry( ld, msgp )) == NULL ) { + ldap_msgfree( msgp ); + return( ldap_get_lderrno( ld, NULL, lderrtxtp )); + } + + /* + * Output the vCard headers plus the BEGIN marker and VERSION tag. + * once we do this we are committed to producing a vCard MIME object + * so we must return LDAP_SUCCESS. + */ + emit_vcard_headers( mimetype ); + write_vcard_property( DSGW_VCARD_PROP_BEGIN, DSGW_VCARD_BEGINEND_VALUE, + NULL, 0 ); + write_vcard_property( DSGW_VCARD_PROP_VERSION, DSGW_VCARD_VERSION, + NULL, 0 ); + + /* Output the properties. + * Note that for the secondary LDAP attribute we only use the + * first value returned by the server. I am sure someone won't + * like this but anything else is silly since the main vCard + * property we use a secondary LDAP attribute for is the "N" + * property which looks like "sn;givenName". We really have no way + * of knowing which surname goes with which givenName so it looks + * better not to create lots of "N" properties if there are multiple + * givenNames. + */ + for ( vcp = vcprops; vcp != NULL; vcp = vcp->dsgwvcprop_next ) { + vals = ldap_get_values( ld, entry, vcp->dsgwvcprop_ldaptype ); + if ( vcp->dsgwvcprop_ldaptype2 == NULL ) { + vals2 = NULL; + } else { + vals2 = ldap_get_values( ld, entry, vcp->dsgwvcprop_ldaptype2 ); + } + + if ( vals == NULL && vals2 == NULL ) { + continue; + } + + is_mls = ( strcmp( vcp->dsgwvcprop_syntax, "mls" ) == 0 ); + + if ( vals != NULL ) { + for ( i = 0; vals[ i ] != NULL; ++i ) { + write_vcard_property( vcp->dsgwvcprop_property, + vals[i], vals2 == NULL ? NULL : vals2[0], is_mls ); + } + } else { + for ( i = 0; vals2[ i ] != NULL; ++i ) { + write_vcard_property( vcp->dsgwvcprop_property, + NULL, vals2[i], is_mls ); + } + } + + if ( vals != NULL ) { + ldap_value_free( vals ); + } + if ( vals2 != NULL ) { + ldap_value_free( vals2 ); + } + } + + + /* Output the vCard END marker. */ + write_vcard_property( DSGW_VCARD_PROP_END, DSGW_VCARD_BEGINEND_VALUE, + NULL, 0 ); + + /* Cleanup after ourselves. */ + ldap_msgfree( msgp ); + + return( LDAP_SUCCESS ); +} + + +/* + * output a single vCard text property. + */ +static void +write_vcard_property( char *prop, char *val, char *val2, int is_mls ) +{ + char *s, *p, *tmpv, *mlsv; + + tmpv = mlsv = NULL; + + if ( val == NULL ) { + val = ""; + } + + if ( val2 != NULL ) { + tmpv = (char *)dsgw_ch_malloc( strlen( val ) + strlen( val2 ) + 2 ); + sprintf( tmpv, "%s;%s", val, val2 ); + val = tmpv; + } + + if ( is_mls ) { + val = mlsv = dsgw_mls_convertlines( val, ";", NULL, 0, 0 ); + } + + if (( s = ldif_type_and_value( prop, val, strlen( val ))) != NULL ) { + /* + * vCard base64 rules are different than for LDIF so check and repair + * if necessary. + */ + if (( p = strchr( s, ':' )) != NULL && *(p+1) == ':' ) { + *p++ = '\0'; ++p; + dsgw_emits( s ); + dsgw_emits( ";BASE64:\n " ); + dsgw_emits( p ); + dsgw_emits( "\n" ); + } else { + dsgw_emits( s ); + } + free( s ); + } + + if ( tmpv != NULL ) { + free( tmpv ); + } + if ( mlsv != NULL ) { + free( mlsv ); + } +} + + +/* + * emit vCard Content-Type header, etc. + */ +static void +emit_vcard_headers( char *mimetype ) +{ + if ( mimetype == NULL || *mimetype == '\0' ) { + mimetype = DSGW_VCARD_MIMEHDR_TEXTDIR; /* default */ + } + + dsgw_puts( "Content-Type: " ); + dsgw_puts( mimetype ); + if ( gc->gc_charset != NULL && *gc->gc_charset != '\0' ) { + dsgw_puts( ";charset=" ); + dsgw_puts( gc->gc_charset ); + } + dsgw_puts( "\n\n" ); +} + + +/* + * output a simple string without charset conversion (used for MIME headers) + */ +static void +dsgw_puts( char *s ) +{ + dsgw_fputn( stdout, s, strlen( s )); +} + + +/* + * return list of LDAP attributes we need to fetch + */ +static char ** +vcard_ldapattrs( dsgwvcprop *vcprops ) +{ + dsgwvcprop *vcp; + int count; + static char **attrs = NULL; + + if ( attrs != NULL ) { + return( attrs ); + } + + count = 0; + for ( vcp = vcprops; vcp != NULL; vcp = vcp->dsgwvcprop_next ) { + ++count; + if ( vcp->dsgwvcprop_ldaptype2 != NULL ) { + ++count; + } + } + + attrs = (char **)dsgw_ch_malloc(( count + 1 ) * sizeof( char * )); + count = 0; + for ( vcp = vcprops; vcp != NULL; vcp = vcp->dsgwvcprop_next ) { + attrs[ count++ ] = vcp->dsgwvcprop_ldaptype; + if ( vcp->dsgwvcprop_ldaptype2 != NULL ) { + attrs[ count++ ] = vcp->dsgwvcprop_ldaptype2; + } + } + attrs[ count ] = NULL; + + return( attrs ); +}