From b2093e3016027d6b5cf06b3f91f30769bfc099e2 Mon Sep 17 00:00:00 2001 From: cvsadm Date: Fri, 21 Jan 2005 00:44:34 +0000 Subject: Moving NSCP Directory Server from DirectoryBranch to TRUNK, initial drop. (foxworth) --- Makefile | 268 + bchecker.ini | 3 + buildnum.pl | 49 + component_versions.mk | 198 + components.mk | 978 ++ config/.cvsignore | 5 + config/Linux2.4.mk | 58 + config/Linux2.6.mk | 58 + config/Makefile | 38 + config/SunOS5.8.mk | 14 + config/SunOS5.8_i86pc.mk | 14 + config/SunOS5.9.mk | 14 + config/UNIX.mk | 14 + config/WINNT5.0.mk | 56 + config/common.mn | 120 + config/config.mk | 520 + config/nfspwd.pl | 21 + config/nsinstall.c | 305 + config/pathsub.c | 206 + config/pathsub.h | 46 + config/revdepth-nt.pl | 19 + config/revdepth.pl | 22 + config/rules.mk | 707 + config/webint.mk | 24 + dirver.pl | 125 + httpd/autobuild | 500 + httpd/src/Makefile | 229 + httpd/src/ntnsapi.c | 383 + httpd/src/unixso.exp | 38 + httpd/src/unixso.mk | 246 + include/Makefile | 85 + include/base/Makefile | 40 + include/base/crit.h | 209 + include/base/dbtbase.h | 217 + include/base/ereport.h | 76 + include/base/eventhandler.h | 73 + include/base/eventlog.h | 34 + include/base/file.h | 121 + include/base/fsmutex.h | 94 + include/base/lexer.h | 89 + include/base/nterr.h | 21 + include/base/nterrors.h | 67 + include/base/plist.h | 61 + include/base/pool.h | 103 + include/base/rwlock.h | 54 + include/base/shexp.h | 114 + include/base/systems.h | 565 + include/base/systhr.h | 91 + include/base/util.h | 210 + include/copyrght.h | 6 + include/i18n.h | 245 + include/ldaputil/cert.h | 27 + include/ldaputil/certmap.h | 124 + include/ldaputil/dbconf.h | 91 + include/ldaputil/encode.h | 29 + include/ldaputil/errors.h | 108 + include/ldaputil/extcmap.h | 634 + include/ldaputil/init.h | 23 + include/ldaputil/ldapauth.h | 94 + include/ldaputil/ldapdb.h | 100 + include/ldaputil/ldaputil.h | 132 + include/libaccess/acl.h | 41 + include/libaccess/acladmin.h | 79 + include/libaccess/aclbuild.h | 56 + include/libaccess/aclerror.h | 307 + include/libaccess/acleval.h | 37 + include/libaccess/aclglobal.h | 52 + include/libaccess/aclparse.h | 112 + include/libaccess/aclproto.h | 156 + include/libaccess/aclstruct.h | 264 + include/libaccess/attrec.h | 157 + include/libaccess/authdb.h | 24 + include/libaccess/ava.h | 40 + include/libaccess/avadb.h | 15 + include/libaccess/avapfile.h | 59 + include/libaccess/dbtlibaccess.h | 161 + include/libaccess/dnfstruct.h | 51 + include/libaccess/ipfstruct.h | 81 + include/libaccess/las.h | 184 + include/libaccess/ldapacl.h | 62 + include/libaccess/nsadb.h | 87 + include/libaccess/nsamgmt.h | 122 + include/libaccess/nsauth.h | 288 + include/libaccess/nsautherr.h | 97 + include/libaccess/nscert.h | 102 + include/libaccess/nsdb.h | 182 + include/libaccess/nsdberr.h | 92 + include/libaccess/nsdbmgmt.h | 52 + include/libaccess/nserror.h | 47 + include/libaccess/nsgmgmt.h | 35 + include/libaccess/nsgroup.h | 73 + include/libaccess/nslock.h | 74 + include/libaccess/nsumgmt.h | 36 + include/libaccess/nsuser.h | 70 + include/libaccess/register.h | 215 + include/libaccess/stubs.h | 6 + include/libaccess/symbols.h | 99 + include/libaccess/userauth.h | 13 + include/libaccess/usi.h | 81 + include/libaccess/usrcache.h | 104 + include/libadmin/dbtlibadmin.h | 20 + include/libadmin/libadmin.h | 1403 ++ include/netsite.h | 312 + include/nt/messages.h | 410 + include/nt/nsapi.h | 346 + include/nt/ntos.h | 155 + include/nt/regparms.h | 586 + include/nt/resource.h | 36 + include/public/Makefile | 59 + include/public/base/Makefile | 40 + include/public/base/crit.h | 21 + include/public/base/ereport.h | 21 + include/public/base/file.h | 21 + include/public/base/pool.h | 22 + include/public/base/shexp.h | 22 + include/public/base/systems.h | 242 + include/public/base/systhr.h | 21 + include/public/base/util.h | 21 + include/public/netsite.h | 21 + include/public/nsacl/Makefile | 38 + include/public/nsacl/aclapi.h | 396 + include/public/nsacl/acldef.h | 465 + include/public/nsacl/copyrght.h | 6 + include/public/nsacl/nserrdef.h | 100 + include/public/nsacl/plistdef.h | 62 + include/public/nsapi.h | 3481 ++++ include/version.h | 53 + l10n/dirserv/de/ns-slapd.txt | 899 + l10n/dirserv/de/ns-slapd.txt.iso8859 | 879 + l10n/dirserv/en/ns-slapd.txt | 986 ++ l10n/dirserv/es/ns-slapd.txt | 889 + l10n/dirserv/es/ns-slapd.txt.iso8859 | 874 + l10n/dirserv/fr/ns-slapd.txt | 898 + l10n/dirserv/fr/ns-slapd.txt.iso8859 | 883 + l10n/dirserv/ja/ns-slapd.txt | 1018 ++ l10n/dirserv/ja/ns-slapd.txt.eucjp | 981 ++ ldap/Makefile | 95 + ldap/Makefile.client | 39 + ldap/admin/Makefile | 33 + ldap/admin/include/Makefile | 39 + ldap/admin/include/dsalib.h | 450 + ldap/admin/include/dsalib_pw.h | 17 + ldap/admin/include/dsalib_schema.h | 255 + ldap/admin/include/nterrors.h | 728 + ldap/admin/lib/Makefile | 108 + ldap/admin/lib/dsalib_conf.c | 213 + ldap/admin/lib/dsalib_confs.c | 130 + ldap/admin/lib/dsalib_db.c | 374 + ldap/admin/lib/dsalib_debug.c | 73 + ldap/admin/lib/dsalib_dn.c | 465 + ldap/admin/lib/dsalib_filename.c | 95 + ldap/admin/lib/dsalib_html.c | 201 + ldap/admin/lib/dsalib_ldif.c | 374 + ldap/admin/lib/dsalib_location.c | 142 + ldap/admin/lib/dsalib_pw.c | 29 + ldap/admin/lib/dsalib_tailf.c | 206 + ldap/admin/lib/dsalib_updown.c | 702 + ldap/admin/lib/dsalib_util.c | 1123 ++ ldap/admin/src/AddPerlHeader.pl | 60 + ldap/admin/src/Base.def | 13 + ldap/admin/src/Base.pm | 63 + ldap/admin/src/CGI_ENV | 36 + ldap/admin/src/Cgi.pm | 70 + ldap/admin/src/CreateInstall.pl | 34 + ldap/admin/src/DSAdmin.def | 11 + ldap/admin/src/DSAdmin.mk | 134 + ldap/admin/src/DSAdmin.pm | 225 + ldap/admin/src/DSAdmin.xs | 76 + ldap/admin/src/Inf.pm | 243 + ldap/admin/src/Makefile | 304 + ldap/admin/src/addindex.c | 80 + ldap/admin/src/cfg_sspt.c | 1621 ++ ldap/admin/src/cfg_sspt.h | 110 + ldap/admin/src/configure_instance.cpp | 1969 +++ ldap/admin/src/configure_instance.h | 53 + ldap/admin/src/create_instance.c | 4640 +++++ ldap/admin/src/create_instance.h | 112 + ldap/admin/src/ds_bak2db.c | 71 + ldap/admin/src/ds_db2bak.c | 77 + ldap/admin/src/ds_db2ldif.c | 78 + ldap/admin/src/ds_ldif2db.c | 103 + ldap/admin/src/ds_listdb.c | 37 + ldap/admin/src/ds_remove.c | 234 + ldap/admin/src/ds_remove_uninst.cpp | 317 + ldap/admin/src/ds_remove_uninst.h | 23 + ldap/admin/src/ds_rmdb.c | 73 + ldap/admin/src/ds_snmpctrl.c | 308 + ldap/admin/src/ds_viewlog.pl | 129 + ldap/admin/src/getConfigInfo | 134 + ldap/admin/src/import2info | 58 + ldap/admin/src/init_ds_env.c | 57 + ldap/admin/src/init_ds_env.h | 11 + ldap/admin/src/install_keywords.h | 111 + ldap/admin/src/instindex.cpp | 423 + .../src/java/com/netscape/xmltools/DSML2LDIF.java | 234 + .../src/java/com/netscape/xmltools/DSMLReader.java | 47 + .../java/com/netscape/xmltools/DSMLSAXBuilder.java | 86 + .../java/com/netscape/xmltools/DSMLSAXHandler.java | 299 + .../src/java/com/netscape/xmltools/DSMLWriter.java | 315 + .../src/java/com/netscape/xmltools/GetOpt.java | 222 + .../src/java/com/netscape/xmltools/LDIF2DSML.java | 214 + ldap/admin/src/java/com/netscape/xmltools/Makefile | 67 + ldap/admin/src/java/install | 17 + ldap/admin/src/java/mcc | 38 + ldap/admin/src/java/mcc.bat | 45 + ldap/admin/src/key.rc | 150 + ldap/admin/src/latest_file.c | 95 + ldap/admin/src/makemccvlvindexes | 211 + ldap/admin/src/makevlvindex | 109 + ldap/admin/src/makevlvsearch | 138 + ldap/admin/src/migrateInstance | 549 + ldap/admin/src/migrateLocalDB | 265 + ldap/admin/src/migratePwdFile | 90 + ldap/admin/src/migrateTo4 | 1581 ++ ldap/admin/src/migratedsgw | 445 + ldap/admin/src/namegen.c | 107 + ldap/admin/src/ns-newpwpolicy.pl | 198 + ldap/admin/src/restart.c | 46 + ldap/admin/src/script-gen.c | 107 + ldap/admin/src/scripts/template-bak2db.pl | 89 + ldap/admin/src/scripts/template-cl-dump.pl | 307 + ldap/admin/src/scripts/template-db2bak.pl | 89 + ldap/admin/src/scripts/template-db2index.pl | 195 + ldap/admin/src/scripts/template-db2ldif.pl | 215 + ldap/admin/src/scripts/template-dsml-activate.pl | 198 + ldap/admin/src/scripts/template-ldif2db.pl | 193 + ldap/admin/src/scripts/template-migrate50to51 | 2778 +++ ldap/admin/src/scripts/template-migrate5to6 | 3043 ++++ ldap/admin/src/scripts/template-migrate5to7 | 3043 ++++ ldap/admin/src/scripts/template-migrate6to7 | 3049 ++++ ldap/admin/src/scripts/template-migrateInstance5 | 518 + ldap/admin/src/scripts/template-migrateInstance6 | 550 + ldap/admin/src/scripts/template-migrateInstance7 | 559 + ldap/admin/src/scripts/template-migrateTo5 | 3094 ++++ ldap/admin/src/scripts/template-migrateTo6 | 3268 ++++ ldap/admin/src/scripts/template-migrateTo7 | 3268 ++++ .../admin/src/scripts/template-ns-accountstatus.pl | 813 + ldap/admin/src/scripts/template-ns-activate.pl | 813 + ldap/admin/src/scripts/template-ns-inactivate.pl | 813 + ldap/admin/src/scripts/template-ns-newpwpolicy.pl | 241 + .../admin/src/scripts/template-repl-monitor-cgi.pl | 40 + ldap/admin/src/scripts/template-repl-monitor.pl | 956 + ldap/admin/src/scripts/template-verify-db.pl | 196 + ldap/admin/src/shutdown.c | 39 + ldap/admin/src/start.c | 42 + ldap/admin/src/uname.lib | 169 + ldap/admin/src/updatedsgw | 331 + ldap/admin/src/upgradeServer | 442 + ldap/admin/src/vlvindex.c | 92 + ldap/clients/Makefile | 31 + ldap/clients/dsgw/Makefile | 305 + ldap/clients/dsgw/Versiongw.c | 25 + ldap/clients/dsgw/admhtml/Makefile | 52 + ldap/clients/dsgw/admhtml/display-country.html | 52 + ldap/clients/dsgw/admhtml/display-dnedit.html | 74 + ldap/clients/dsgw/admhtml/display-dnedittop.html | 19 + ldap/clients/dsgw/admhtml/display-group.html | 122 + ldap/clients/dsgw/admhtml/display-groupun.html | 122 + .../dsgw/admhtml/display-licensed-user.html | 71 + ldap/clients/dsgw/admhtml/display-mailgroup.html | 121 + ldap/clients/dsgw/admhtml/display-org.html | 129 + ldap/clients/dsgw/admhtml/display-orgperson.html | 142 + ldap/clients/dsgw/admhtml/display-orgunit.html | 95 + ldap/clients/dsgw/admhtml/display-person.html | 133 + ldap/clients/dsgw/admhtml/display-umperson.html | 177 + ldap/clients/dsgw/admhtml/dsconfig.html | 191 + ldap/clients/dsgw/admhtml/dscrgroup.html | 114 + ldap/clients/dsgw/admhtml/dscrou.html | 103 + ldap/clients/dsgw/admhtml/dscruser.html | 172 + ldap/clients/dsgw/admhtml/dsexpldif.html | 76 + ldap/clients/dsgw/admhtml/dsimpldif.html | 85 + ldap/clients/dsgw/admhtml/dslsgroups.html | 164 + ldap/clients/dsgw/admhtml/dslsous.html | 172 + ldap/clients/dsgw/admhtml/dslsusers.html | 166 + ldap/clients/dsgw/admhtml/edit-passwd.html | 103 + ldap/clients/dsgw/admhtml/index.lst | 87 + ldap/clients/dsgw/admhtml/list-Anything.html | 42 + ldap/clients/dsgw/admhtml/list-Auth.html | 72 + ldap/clients/dsgw/admhtml/list-Groups-report.html | 56 + ldap/clients/dsgw/admhtml/list-Groups-rm.html | 80 + ldap/clients/dsgw/admhtml/list-Groups.html | 62 + ldap/clients/dsgw/admhtml/list-Org-Units.html | 62 + .../clients/dsgw/admhtml/list-OrgUnits-report.html | 56 + ldap/clients/dsgw/admhtml/list-OrgUnits.html | 62 + ldap/clients/dsgw/admhtml/list-Organizations.html | 38 + ldap/clients/dsgw/admhtml/list-Ous-rm.html | 80 + ldap/clients/dsgw/admhtml/list-People-report.html | 60 + ldap/clients/dsgw/admhtml/list-People-rm.html | 81 + ldap/clients/dsgw/admhtml/list-People.html | 61 + ldap/clients/dsgw/admhtml/list-fa-Groups.html | 24 + ldap/clients/dsgw/admhtml/list-fa-People.html | 24 + ldap/clients/dsgw/admhtml/list-fa_people.html | 24 + ldap/clients/dsgw/admhtml/list-urlsearch.html | 39 + ldap/clients/dsgw/auth.c | 120 + ldap/clients/dsgw/cgiutil.c | 512 + ldap/clients/dsgw/ckdel.c | 30 + ldap/clients/dsgw/ckdump.c | 38 + ldap/clients/dsgw/ckget.c | 46 + ldap/clients/dsgw/ckpurge.c | 33 + ldap/clients/dsgw/ckput.c | 63 + ldap/clients/dsgw/collate.c | 400 + ldap/clients/dsgw/config.c | 2080 +++ ldap/clients/dsgw/config/Makefile | 77 + ldap/clients/dsgw/config/authPassword.html | 30 + ldap/clients/dsgw/config/authSearch.html | 35 + ldap/clients/dsgw/config/csearch.html | 28 + ldap/clients/dsgw/config/csearchAttr.html | 23 + ldap/clients/dsgw/config/csearchBase.html | 22 + ldap/clients/dsgw/config/csearchMatch.html | 21 + ldap/clients/dsgw/config/csearchString.html | 26 + ldap/clients/dsgw/config/csearchType.html | 24 + ldap/clients/dsgw/config/de/authPassword.html | 29 + ldap/clients/dsgw/config/de/authSearch.html | 33 + ldap/clients/dsgw/config/de/csearchAttr.html | 17 + ldap/clients/dsgw/config/de/csearchBase.html | 17 + ldap/clients/dsgw/config/de/csearchString.html | 28 + ldap/clients/dsgw/config/de/csearchType.html | 18 + ldap/clients/dsgw/config/de/display-country.html | 54 + ldap/clients/dsgw/config/de/display-dnedit.html | 76 + .../dsgw/config/de/display-dneditpeople.html | 75 + ldap/clients/dsgw/config/de/display-group.html | 150 + ldap/clients/dsgw/config/de/display-groupun.html | 150 + ldap/clients/dsgw/config/de/display-mailgroup.html | 124 + ldap/clients/dsgw/config/de/display-ntgroup.html | 216 + ldap/clients/dsgw/config/de/display-ntperson.html | 505 + ldap/clients/dsgw/config/de/display-org.html | 136 + ldap/clients/dsgw/config/de/display-orgperson.html | 345 + ldap/clients/dsgw/config/de/display-orgunit.html | 136 + ldap/clients/dsgw/config/de/display-person.html | 231 + ldap/clients/dsgw/config/de/display-umperson.html | 200 + ldap/clients/dsgw/config/de/dsgw-l10n.conf | 18 + ldap/clients/dsgw/config/de/dsgw.conf | 133 + ldap/clients/dsgw/config/de/dsgw.tmpl | 116 + ldap/clients/dsgw/config/de/dsgw_adm.conf | 46 + ldap/clients/dsgw/config/de/dsgwfilter.conf | 139 + ldap/clients/dsgw/config/de/dsgwfilter_adm.conf | 73 + ldap/clients/dsgw/config/de/dsgwsearchprefs.conf | 213 + ldap/clients/dsgw/config/de/edit-passwd.html | 78 + ldap/clients/dsgw/config/de/list-Anything.html | 42 + ldap/clients/dsgw/config/de/list-Auth.html | 73 + ldap/clients/dsgw/config/de/list-Groups.html | 38 + ldap/clients/dsgw/config/de/list-NT-Groups.html | 44 + ldap/clients/dsgw/config/de/list-NT-People.html | 48 + ldap/clients/dsgw/config/de/list-Org-Units.html | 38 + .../clients/dsgw/config/de/list-Organizations.html | 38 + ldap/clients/dsgw/config/de/list-People.html | 48 + ldap/clients/dsgw/config/de/list-fa-Groups.html | 22 + ldap/clients/dsgw/config/de/list-fa-People.html | 22 + ldap/clients/dsgw/config/de/list-urlsearch.html | 38 + ldap/clients/dsgw/config/de/newentry.html | 25 + ldap/clients/dsgw/config/de/newentryName.html | 48 + ldap/clients/dsgw/config/de/newentryType.html | 14 + ldap/clients/dsgw/config/de/search.html | 18 + ldap/clients/dsgw/config/de/searchString.html | 30 + ldap/clients/dsgw/config/display-country.html | 61 + ldap/clients/dsgw/config/display-dc.html | 188 + ldap/clients/dsgw/config/display-dnedit.html | 85 + ldap/clients/dsgw/config/display-dneditpeople.html | 83 + ldap/clients/dsgw/config/display-group.html | 186 + ldap/clients/dsgw/config/display-groupun.html | 186 + ldap/clients/dsgw/config/display-ntgroup.html | 277 + ldap/clients/dsgw/config/display-ntperson.html | 670 + ldap/clients/dsgw/config/display-org.html | 189 + ldap/clients/dsgw/config/display-orgperson.html | 501 + ldap/clients/dsgw/config/display-orgunit.html | 191 + ldap/clients/dsgw/config/display-person.html | 366 + ldap/clients/dsgw/config/dsgw-l10n.conf | 18 + ldap/clients/dsgw/config/dsgw.tmpl | 148 + ldap/clients/dsgw/config/dsgw_adm.conf | 46 + ldap/clients/dsgw/config/dsgwfilter.conf | 154 + ldap/clients/dsgw/config/dsgwfilter_adm.conf | 73 + ldap/clients/dsgw/config/dsgwsearchprefs.conf | 234 + ldap/clients/dsgw/config/edit-passwd.html | 78 + ldap/clients/dsgw/config/en-us/dsgw-l10n.conf | 18 + ldap/clients/dsgw/config/en-us/dsgwcollate.conf | 8 + ldap/clients/dsgw/config/en/dsgw-l10n.conf | 18 + ldap/clients/dsgw/config/en/dsgwcollate.conf | 41 + ldap/clients/dsgw/config/es/authPassword.html | 29 + ldap/clients/dsgw/config/es/authSearch.html | 33 + ldap/clients/dsgw/config/es/csearch.html | 23 + ldap/clients/dsgw/config/es/csearchAttr.html | 18 + ldap/clients/dsgw/config/es/csearchBase.html | 17 + ldap/clients/dsgw/config/es/csearchString.html | 28 + ldap/clients/dsgw/config/es/csearchType.html | 19 + ldap/clients/dsgw/config/es/display-country.html | 54 + ldap/clients/dsgw/config/es/display-dnedit.html | 76 + .../dsgw/config/es/display-dneditpeople.html | 75 + ldap/clients/dsgw/config/es/display-group.html | 149 + ldap/clients/dsgw/config/es/display-groupun.html | 149 + ldap/clients/dsgw/config/es/display-ntgroup.html | 215 + ldap/clients/dsgw/config/es/display-ntperson.html | 493 + ldap/clients/dsgw/config/es/display-org.html | 135 + ldap/clients/dsgw/config/es/display-orgperson.html | 342 + ldap/clients/dsgw/config/es/display-orgunit.html | 135 + ldap/clients/dsgw/config/es/display-person.html | 229 + ldap/clients/dsgw/config/es/dsgw-l10n.conf | 18 + ldap/clients/dsgw/config/es/dsgw.tmpl | 116 + ldap/clients/dsgw/config/es/dsgw_adm.conf | 46 + ldap/clients/dsgw/config/es/dsgwfilter.conf | 139 + ldap/clients/dsgw/config/es/dsgwfilter_adm.conf | 73 + ldap/clients/dsgw/config/es/dsgwsearchprefs.conf | 213 + ldap/clients/dsgw/config/es/edit-passwd.html | 78 + ldap/clients/dsgw/config/es/list-Anything.html | 42 + ldap/clients/dsgw/config/es/list-Auth.html | 73 + ldap/clients/dsgw/config/es/list-Groups.html | 38 + ldap/clients/dsgw/config/es/list-NT-Groups.html | 44 + ldap/clients/dsgw/config/es/list-NT-People.html | 48 + ldap/clients/dsgw/config/es/list-Org-Units.html | 38 + .../clients/dsgw/config/es/list-Organizations.html | 38 + ldap/clients/dsgw/config/es/list-People.html | 48 + ldap/clients/dsgw/config/es/list-fa-Groups.html | 22 + ldap/clients/dsgw/config/es/list-fa-People.html | 22 + ldap/clients/dsgw/config/es/list-urlsearch.html | 38 + ldap/clients/dsgw/config/es/newentry.html | 26 + ldap/clients/dsgw/config/es/newentryName.html | 48 + ldap/clients/dsgw/config/es/newentryType.html | 14 + ldap/clients/dsgw/config/es/ns-license-schema.conf | 17 + ldap/clients/dsgw/config/es/search.html | 18 + ldap/clients/dsgw/config/es/searchString.html | 30 + ldap/clients/dsgw/config/fr/authPassword.html | 29 + ldap/clients/dsgw/config/fr/authSearch.html | 34 + ldap/clients/dsgw/config/fr/csearch.html | 23 + ldap/clients/dsgw/config/fr/csearchAttr.html | 17 + ldap/clients/dsgw/config/fr/csearchBase.html | 17 + ldap/clients/dsgw/config/fr/csearchString.html | 28 + ldap/clients/dsgw/config/fr/csearchType.html | 18 + ldap/clients/dsgw/config/fr/display-country.html | 54 + ldap/clients/dsgw/config/fr/display-dnedit.html | 76 + .../dsgw/config/fr/display-dneditpeople.html | 77 + ldap/clients/dsgw/config/fr/display-group.html | 150 + ldap/clients/dsgw/config/fr/display-groupun.html | 150 + ldap/clients/dsgw/config/fr/display-mailgroup.html | 125 + ldap/clients/dsgw/config/fr/display-ntgroup.html | 218 + ldap/clients/dsgw/config/fr/display-ntperson.html | 508 + ldap/clients/dsgw/config/fr/display-org.html | 137 + ldap/clients/dsgw/config/fr/display-orgperson.html | 346 + ldap/clients/dsgw/config/fr/display-orgunit.html | 136 + ldap/clients/dsgw/config/fr/display-person.html | 233 + ldap/clients/dsgw/config/fr/display-umperson.html | 200 + ldap/clients/dsgw/config/fr/dsgw-l10n.conf | 18 + ldap/clients/dsgw/config/fr/dsgw.conf | 133 + ldap/clients/dsgw/config/fr/dsgw.tmpl | 113 + ldap/clients/dsgw/config/fr/dsgw_adm.conf | 48 + ldap/clients/dsgw/config/fr/dsgwfilter.conf | 141 + ldap/clients/dsgw/config/fr/dsgwfilter_adm.conf | 75 + ldap/clients/dsgw/config/fr/dsgwsearchprefs.conf | 214 + ldap/clients/dsgw/config/fr/edit-passwd.html | 78 + ldap/clients/dsgw/config/fr/list-Anything.html | 42 + ldap/clients/dsgw/config/fr/list-Auth.html | 75 + ldap/clients/dsgw/config/fr/list-Groups.html | 38 + ldap/clients/dsgw/config/fr/list-NT-Groups.html | 46 + ldap/clients/dsgw/config/fr/list-NT-People.html | 50 + ldap/clients/dsgw/config/fr/list-Org-Units.html | 38 + .../clients/dsgw/config/fr/list-Organizations.html | 38 + ldap/clients/dsgw/config/fr/list-People.html | 50 + ldap/clients/dsgw/config/fr/list-fa-Groups.html | 22 + ldap/clients/dsgw/config/fr/list-fa-People.html | 22 + ldap/clients/dsgw/config/fr/list-urlsearch.html | 38 + ldap/clients/dsgw/config/fr/newentry.html | 27 + ldap/clients/dsgw/config/fr/newentryName.html | 48 + ldap/clients/dsgw/config/fr/newentryType.html | 14 + ldap/clients/dsgw/config/fr/search.html | 18 + ldap/clients/dsgw/config/fr/searchString.html | 30 + ldap/clients/dsgw/config/ja/authPassword.html | 29 + ldap/clients/dsgw/config/ja/authSearch.html | 33 + ldap/clients/dsgw/config/ja/csearch.html | 23 + ldap/clients/dsgw/config/ja/csearchAttr.html | 17 + ldap/clients/dsgw/config/ja/csearchBase.html | 17 + ldap/clients/dsgw/config/ja/csearchString.html | 28 + ldap/clients/dsgw/config/ja/csearchType.html | 18 + ldap/clients/dsgw/config/ja/display-country.html | 54 + ldap/clients/dsgw/config/ja/display-dnedit.html | 76 + .../dsgw/config/ja/display-dneditpeople.html | 75 + ldap/clients/dsgw/config/ja/display-group.html | 150 + ldap/clients/dsgw/config/ja/display-groupun.html | 150 + ldap/clients/dsgw/config/ja/display-mailgroup.html | 124 + ldap/clients/dsgw/config/ja/display-ntgroup.html | 218 + ldap/clients/dsgw/config/ja/display-ntperson.html | 506 + ldap/clients/dsgw/config/ja/display-org.html | 136 + ldap/clients/dsgw/config/ja/display-orgperson.html | 345 + ldap/clients/dsgw/config/ja/display-orgunit.html | 136 + ldap/clients/dsgw/config/ja/display-person.html | 230 + ldap/clients/dsgw/config/ja/display-umperson.html | 199 + ldap/clients/dsgw/config/ja/dsgw-l10n.conf | 18 + ldap/clients/dsgw/config/ja/dsgw.conf | 133 + ldap/clients/dsgw/config/ja/dsgw.tmpl | 111 + ldap/clients/dsgw/config/ja/dsgw_adm.conf | 46 + ldap/clients/dsgw/config/ja/dsgwcharset.conf | 7 + ldap/clients/dsgw/config/ja/dsgwcollate.conf | 31 + ldap/clients/dsgw/config/ja/dsgwfilter.conf | 139 + ldap/clients/dsgw/config/ja/dsgwfilter_adm.conf | 73 + ldap/clients/dsgw/config/ja/dsgwsearchprefs.conf | 213 + ldap/clients/dsgw/config/ja/edit-passwd.html | 78 + ldap/clients/dsgw/config/ja/list-Anything.html | 42 + ldap/clients/dsgw/config/ja/list-Auth.html | 73 + ldap/clients/dsgw/config/ja/list-Groups.html | 38 + ldap/clients/dsgw/config/ja/list-NT-Groups.html | 44 + ldap/clients/dsgw/config/ja/list-NT-People.html | 48 + ldap/clients/dsgw/config/ja/list-Org-Units.html | 38 + .../clients/dsgw/config/ja/list-Organizations.html | 38 + ldap/clients/dsgw/config/ja/list-People.html | 48 + ldap/clients/dsgw/config/ja/list-fa-Groups.html | 22 + ldap/clients/dsgw/config/ja/list-fa-People.html | 22 + ldap/clients/dsgw/config/ja/list-urlsearch.html | 38 + ldap/clients/dsgw/config/ja/newentry.html | 26 + ldap/clients/dsgw/config/ja/newentryName.html | 48 + ldap/clients/dsgw/config/ja/newentryType.html | 14 + ldap/clients/dsgw/config/ja/search.html | 18 + ldap/clients/dsgw/config/ja/searchString.html | 30 + ldap/clients/dsgw/config/ko/dsgw-l10n.conf | 18 + ldap/clients/dsgw/config/ko/dsgwcharset.conf | 7 + ldap/clients/dsgw/config/list-Anything.html | 120 + ldap/clients/dsgw/config/list-Auth.html | 78 + ldap/clients/dsgw/config/list-Domaincomponent.html | 115 + ldap/clients/dsgw/config/list-Groups.html | 110 + ldap/clients/dsgw/config/list-NT-Groups.html | 119 + ldap/clients/dsgw/config/list-NT-People.html | 152 + ldap/clients/dsgw/config/list-Org-Units.html | 118 + ldap/clients/dsgw/config/list-Organizations.html | 127 + ldap/clients/dsgw/config/list-People.html | 176 + ldap/clients/dsgw/config/list-fa-Groups.html | 26 + ldap/clients/dsgw/config/list-fa-People.html | 26 + ldap/clients/dsgw/config/list-urlsearch.html | 129 + ldap/clients/dsgw/config/newentry.html | 26 + ldap/clients/dsgw/config/newentryName.html | 62 + ldap/clients/dsgw/config/newentryType.html | 25 + ldap/clients/dsgw/config/ns-license-schema.conf | 17 + ldap/clients/dsgw/config/search.html | 18 + ldap/clients/dsgw/config/searchString.html | 41 + ldap/clients/dsgw/config/zh/dsgw-l10n.conf | 18 + ldap/clients/dsgw/config/zh/dsgwcharset.conf | 7 + ldap/clients/dsgw/cookie.c | 990 ++ ldap/clients/dsgw/csearch.c | 336 + ldap/clients/dsgw/dbtdsgw.h | 447 + ldap/clients/dsgw/dnedit.c | 415 + ldap/clients/dsgw/doauth.c | 386 + ldap/clients/dsgw/domodify.c | 1254 ++ ldap/clients/dsgw/dosearch.c | 352 + ldap/clients/dsgw/dsconfig.c | 255 + ldap/clients/dsgw/dsexpldif.c | 133 + ldap/clients/dsgw/dsgw.h | 1053 ++ ldap/clients/dsgw/dsgw_include.mk | 23 + ldap/clients/dsgw/dsgwutil.c | 1318 ++ ldap/clients/dsgw/dsimpldif.c | 150 + ldap/clients/dsgw/edit.c | 256 + ldap/clients/dsgw/emitauth.c | 317 + ldap/clients/dsgw/emitf.c | 860 + ldap/clients/dsgw/entrydisplay.c | 3228 ++++ ldap/clients/dsgw/error.c | 542 + ldap/clients/dsgw/genscreen.c | 117 + ldap/clients/dsgw/getopt.c | 115 + ldap/clients/dsgw/html/Makefile | 81 + ldap/clients/dsgw/html/aim-online.gif | Bin 0 -> 897 bytes ldap/clients/dsgw/html/alert.gif | Bin 0 -> 368 bytes ldap/clients/dsgw/html/alert.html | 24 + ldap/clients/dsgw/html/auth.html | 26 + ldap/clients/dsgw/html/authroot.html | 26 + ldap/clients/dsgw/html/authtitle.html | 156 + ldap/clients/dsgw/html/back1.gif | Bin 0 -> 1068 bytes ldap/clients/dsgw/html/clear.gif | Bin 0 -> 43 bytes ldap/clients/dsgw/html/confirm.gif | Bin 0 -> 372 bytes ldap/clients/dsgw/html/confirm.html | 30 + ldap/clients/dsgw/html/content1.gif | Bin 0 -> 1131 bytes ldap/clients/dsgw/html/country.gif | Bin 0 -> 298 bytes ldap/clients/dsgw/html/csearchtitle.html | 156 + ldap/clients/dsgw/html/dc.gif | Bin 0 -> 268 bytes ldap/clients/dsgw/html/de/adsearch_off.gif | Bin 0 -> 1348 bytes ldap/clients/dsgw/html/de/adsearch_on.gif | Bin 0 -> 1348 bytes ldap/clients/dsgw/html/de/auth.html | 24 + ldap/clients/dsgw/html/de/authen_off.gif | Bin 0 -> 1335 bytes ldap/clients/dsgw/html/de/authen_on.gif | Bin 0 -> 1330 bytes ldap/clients/dsgw/html/de/authroot.html | 22 + ldap/clients/dsgw/html/de/authtitle.html | 37 + ldap/clients/dsgw/html/de/back.gif | Bin 0 -> 384 bytes ldap/clients/dsgw/html/de/back1.gif | Bin 0 -> 276 bytes ldap/clients/dsgw/html/de/content.gif | Bin 0 -> 681 bytes ldap/clients/dsgw/html/de/content1.gif | Bin 0 -> 317 bytes ldap/clients/dsgw/html/de/csearchtitle.html | 37 + ldap/clients/dsgw/html/de/eduser.html | 30 + ldap/clients/dsgw/html/de/exit1.gif | Bin 0 -> 352 bytes ldap/clients/dsgw/html/de/forward1.gif | Bin 0 -> 281 bytes ldap/clients/dsgw/html/de/greeting.html | 64 + ldap/clients/dsgw/html/de/index.html | 21 + ldap/clients/dsgw/html/de/index1.gif | Bin 0 -> 316 bytes ldap/clients/dsgw/html/de/maintitle.html | 37 + ldap/clients/dsgw/html/de/newentry_off.gif | Bin 0 -> 1324 bytes ldap/clients/dsgw/html/de/newentry_on.gif | Bin 0 -> 1325 bytes ldap/clients/dsgw/html/de/newentrytitle.html | 37 + ldap/clients/dsgw/html/de/searchtitle.html | 37 + ldap/clients/dsgw/html/de/stsearch_off.gif | Bin 0 -> 1328 bytes ldap/clients/dsgw/html/de/stsearch_on.gif | Bin 0 -> 1334 bytes ldap/clients/dsgw/html/de/title.gif | Bin 0 -> 4534 bytes ldap/clients/dsgw/html/eduser.html | 31 + ldap/clients/dsgw/html/emptyFrame.html | 7 + ldap/clients/dsgw/html/es/adsearch_off.gif | Bin 0 -> 587 bytes ldap/clients/dsgw/html/es/adsearch_on.gif | Bin 0 -> 630 bytes ldap/clients/dsgw/html/es/auth.html | 23 + ldap/clients/dsgw/html/es/authen_off.gif | Bin 0 -> 544 bytes ldap/clients/dsgw/html/es/authen_on.gif | Bin 0 -> 598 bytes ldap/clients/dsgw/html/es/authroot.html | 22 + ldap/clients/dsgw/html/es/authtitle.html | 37 + ldap/clients/dsgw/html/es/back1.gif | Bin 0 -> 1086 bytes ldap/clients/dsgw/html/es/blank.gif | Bin 0 -> 278 bytes ldap/clients/dsgw/html/es/content1.gif | Bin 0 -> 1146 bytes ldap/clients/dsgw/html/es/country.gif | Bin 0 -> 1044 bytes ldap/clients/dsgw/html/es/csearchtitle.html | 37 + ldap/clients/dsgw/html/es/eduser.html | 30 + ldap/clients/dsgw/html/es/exit1.gif | Bin 0 -> 1144 bytes ldap/clients/dsgw/html/es/forward1.gif | Bin 0 -> 1095 bytes ldap/clients/dsgw/html/es/greeting.html | 64 + ldap/clients/dsgw/html/es/group.gif | Bin 0 -> 1032 bytes ldap/clients/dsgw/html/es/index.html | 20 + ldap/clients/dsgw/html/es/index1.gif | Bin 0 -> 1134 bytes ldap/clients/dsgw/html/es/maintitle.html | 37 + ldap/clients/dsgw/html/es/newentry_off.gif | Bin 0 -> 542 bytes ldap/clients/dsgw/html/es/newentry_on.gif | Bin 0 -> 591 bytes ldap/clients/dsgw/html/es/newentrytitle.html | 37 + ldap/clients/dsgw/html/es/organization.gif | Bin 0 -> 1023 bytes ldap/clients/dsgw/html/es/orgunit.gif | Bin 0 -> 1060 bytes ldap/clients/dsgw/html/es/person.gif | Bin 0 -> 1042 bytes ldap/clients/dsgw/html/es/searchtitle.html | 37 + ldap/clients/dsgw/html/es/stsearch_off.gif | Bin 0 -> 558 bytes ldap/clients/dsgw/html/es/stsearch_on.gif | Bin 0 -> 612 bytes ldap/clients/dsgw/html/es/title.gif | Bin 0 -> 3888 bytes ldap/clients/dsgw/html/exit1.gif | Bin 0 -> 1128 bytes ldap/clients/dsgw/html/forward1.gif | Bin 0 -> 1080 bytes ldap/clients/dsgw/html/fr/adsearch_off.gif | Bin 0 -> 1367 bytes ldap/clients/dsgw/html/fr/adsearch_on.gif | Bin 0 -> 1358 bytes ldap/clients/dsgw/html/fr/auth.html | 24 + ldap/clients/dsgw/html/fr/authen_off.gif | Bin 0 -> 1338 bytes ldap/clients/dsgw/html/fr/authen_on.gif | Bin 0 -> 1339 bytes ldap/clients/dsgw/html/fr/authroot.html | 22 + ldap/clients/dsgw/html/fr/authtitle.html | 37 + ldap/clients/dsgw/html/fr/back.gif | Bin 0 -> 373 bytes ldap/clients/dsgw/html/fr/back1.gif | Bin 0 -> 278 bytes ldap/clients/dsgw/html/fr/content.gif | Bin 0 -> 676 bytes ldap/clients/dsgw/html/fr/content1.gif | Bin 0 -> 319 bytes ldap/clients/dsgw/html/fr/csearchtitle.html | 37 + ldap/clients/dsgw/html/fr/eduser.html | 32 + ldap/clients/dsgw/html/fr/exit1.gif | Bin 0 -> 374 bytes ldap/clients/dsgw/html/fr/forward1.gif | Bin 0 -> 313 bytes ldap/clients/dsgw/html/fr/greeting.html | 65 + ldap/clients/dsgw/html/fr/index.html | 20 + ldap/clients/dsgw/html/fr/index1.gif | Bin 0 -> 316 bytes ldap/clients/dsgw/html/fr/maintitle.html | 38 + ldap/clients/dsgw/html/fr/newentry_off.gif | Bin 0 -> 1330 bytes ldap/clients/dsgw/html/fr/newentry_on.gif | Bin 0 -> 1338 bytes ldap/clients/dsgw/html/fr/newentrytitle.html | 38 + ldap/clients/dsgw/html/fr/searchtitle.html | 38 + ldap/clients/dsgw/html/fr/stsearch_off.gif | Bin 0 -> 1374 bytes ldap/clients/dsgw/html/fr/stsearch_on.gif | Bin 0 -> 1370 bytes ldap/clients/dsgw/html/fr/title.gif | Bin 0 -> 4545 bytes ldap/clients/dsgw/html/greeting.html | 89 + ldap/clients/dsgw/html/group.gif | Bin 0 -> 297 bytes ldap/clients/dsgw/html/index.html | 24 + ldap/clients/dsgw/html/index1.gif | Bin 0 -> 1121 bytes ldap/clients/dsgw/html/info/Makefile | 40 + ldap/clients/dsgw/html/info/infonav.html | 31 + ldap/clients/dsgw/html/ja/adsearch_off.gif | Bin 0 -> 541 bytes ldap/clients/dsgw/html/ja/adsearch_on.gif | Bin 0 -> 600 bytes ldap/clients/dsgw/html/ja/auth.html | 23 + ldap/clients/dsgw/html/ja/authen_off.gif | Bin 0 -> 478 bytes ldap/clients/dsgw/html/ja/authen_on.gif | Bin 0 -> 1267 bytes ldap/clients/dsgw/html/ja/authroot.html | 23 + ldap/clients/dsgw/html/ja/authtitle.html | 37 + ldap/clients/dsgw/html/ja/back.gif | Bin 0 -> 463 bytes ldap/clients/dsgw/html/ja/back1.gif | Bin 0 -> 270 bytes ldap/clients/dsgw/html/ja/content.gif | Bin 0 -> 628 bytes ldap/clients/dsgw/html/ja/content1.gif | Bin 0 -> 325 bytes ldap/clients/dsgw/html/ja/csearchtitle.html | 37 + ldap/clients/dsgw/html/ja/eduser.html | 30 + ldap/clients/dsgw/html/ja/exit1.gif | Bin 0 -> 369 bytes ldap/clients/dsgw/html/ja/forward1.gif | Bin 0 -> 270 bytes ldap/clients/dsgw/html/ja/greeting.html | 65 + ldap/clients/dsgw/html/ja/index.html | 20 + ldap/clients/dsgw/html/ja/index1.gif | Bin 0 -> 324 bytes ldap/clients/dsgw/html/ja/maintitle.html | 37 + ldap/clients/dsgw/html/ja/newentry_off.gif | Bin 0 -> 542 bytes ldap/clients/dsgw/html/ja/newentry_on.gif | Bin 0 -> 1340 bytes ldap/clients/dsgw/html/ja/newentrytitle.html | 37 + ldap/clients/dsgw/html/ja/searchtitle.html | 37 + ldap/clients/dsgw/html/ja/stsearch_off.gif | Bin 0 -> 534 bytes ldap/clients/dsgw/html/ja/stsearch_on.gif | Bin 0 -> 1337 bytes ldap/clients/dsgw/html/ja/title.gif | Bin 0 -> 4976 bytes ldap/clients/dsgw/html/left_bottom.gif | Bin 0 -> 44 bytes ldap/clients/dsgw/html/left_off.gif | Bin 0 -> 73 bytes ldap/clients/dsgw/html/left_on.gif | Bin 0 -> 87 bytes ldap/clients/dsgw/html/maintitle.html | 152 + ldap/clients/dsgw/html/manual/Makefile | 56 + ldap/clients/dsgw/html/manual/a.gif | Bin 0 -> 181 bytes ldap/clients/dsgw/html/manual/add.htm | 681 + ldap/clients/dsgw/html/manual/attribua.gif | 103 + ldap/clients/dsgw/html/manual/attribut.htm | 6712 +++++++ ldap/clients/dsgw/html/manual/auth.htm | 286 + ldap/clients/dsgw/html/manual/contents.html | 185 + ldap/clients/dsgw/html/manual/dn.htm | 262 + ldap/clients/dsgw/html/manual/dna.gif | Bin 0 -> 185 bytes ldap/clients/dsgw/html/manual/filters.htm | 622 + ldap/clients/dsgw/html/manual/index.html | 150 + ldap/clients/dsgw/html/manual/index.map | 49 + ldap/clients/dsgw/html/manual/intro.htm | 70 + ldap/clients/dsgw/html/manual/ja/add.htm | 517 + ldap/clients/dsgw/html/manual/ja/attribut.htm | 7139 ++++++++ ldap/clients/dsgw/html/manual/ja/auth.htm | 151 + ldap/clients/dsgw/html/manual/ja/contents.html | 172 + ldap/clients/dsgw/html/manual/ja/filters.htm | 1062 ++ ldap/clients/dsgw/html/manual/ja/intro.htm | 39 + ldap/clients/dsgw/html/manual/ja/mod.htm | 670 + ldap/clients/dsgw/html/manual/ja/objclass.htm | 7249 ++++++++ ldap/clients/dsgw/html/manual/ja/search.htm | 380 + ldap/clients/dsgw/html/manual/mod.htm | 828 + ldap/clients/dsgw/html/manual/n.gif | Bin 0 -> 181 bytes ldap/clients/dsgw/html/manual/objclass.htm | 7246 ++++++++ ldap/clients/dsgw/html/manual/search.htm | 651 + ldap/clients/dsgw/html/manual/t.gif | Bin 0 -> 147 bytes ldap/clients/dsgw/html/manual/y.gif | Bin 0 -> 176 bytes ldap/clients/dsgw/html/message.gif | Bin 0 -> 693 bytes ldap/clients/dsgw/html/netscape.gif | Bin 0 -> 207 bytes ldap/clients/dsgw/html/newentrytitle.html | 156 + ldap/clients/dsgw/html/organization.gif | Bin 0 -> 268 bytes ldap/clients/dsgw/html/orgicon.gif | Bin 0 -> 884 bytes ldap/clients/dsgw/html/orgunit.gif | Bin 0 -> 296 bytes ldap/clients/dsgw/html/person.gif | Bin 0 -> 287 bytes ldap/clients/dsgw/html/right_bottom.gif | Bin 0 -> 44 bytes ldap/clients/dsgw/html/right_off.gif | Bin 0 -> 80 bytes ldap/clients/dsgw/html/right_on.gif | Bin 0 -> 130 bytes ldap/clients/dsgw/html/searchtitle.html | 157 + ldap/clients/dsgw/html/style.css | 142 + ldap/clients/dsgw/html/transparent.gif | Bin 0 -> 278 bytes ldap/clients/dsgw/htmlout.c | 431 + ldap/clients/dsgw/htmlparse.c | 805 + ldap/clients/dsgw/lang.c | 246 + ldap/clients/dsgw/ldaputil.c | 1564 ++ ldap/clients/dsgw/newentry.c | 447 + ldap/clients/dsgw/pbconfig/Makefile | 50 + ldap/clients/dsgw/pbconfig/authPassword.html | 43 + ldap/clients/dsgw/pbconfig/authSearch.html | 44 + ldap/clients/dsgw/pbconfig/display-orgperson.html | 388 + ldap/clients/dsgw/pbconfig/display-orgunit.html | 198 + ldap/clients/dsgw/pbconfig/display-room.html | 124 + ldap/clients/dsgw/pbconfig/dsgwfilter.conf | 89 + ldap/clients/dsgw/pbconfig/dsgwsearchprefs.conf | 126 + ldap/clients/dsgw/pbconfig/edit-passwd.html | 111 + ldap/clients/dsgw/pbconfig/list-Auth.html | 116 + ldap/clients/dsgw/pbconfig/list-People.html | 125 + ldap/clients/dsgw/pbconfig/pb.tmpl | 126 + ldap/clients/dsgw/pbhtml/16-conference.gif | Bin 0 -> 191 bytes ldap/clients/dsgw/pbhtml/16-person.gif | Bin 0 -> 74 bytes ldap/clients/dsgw/pbhtml/32-alert.gif | Bin 0 -> 372 bytes ldap/clients/dsgw/pbhtml/32-conference.gif | Bin 0 -> 362 bytes ldap/clients/dsgw/pbhtml/32-message.gif | Bin 0 -> 693 bytes ldap/clients/dsgw/pbhtml/32-office.gif | Bin 0 -> 376 bytes ldap/clients/dsgw/pbhtml/32-person.gif | Bin 0 -> 145 bytes ldap/clients/dsgw/pbhtml/Makefile | 53 + ldap/clients/dsgw/pbhtml/aim-online.gif | Bin 0 -> 897 bytes ldap/clients/dsgw/pbhtml/alert.html | 24 + ldap/clients/dsgw/pbhtml/brandblock.gif | Bin 0 -> 1111 bytes ldap/clients/dsgw/pbhtml/carded.html | 44 + ldap/clients/dsgw/pbhtml/clear.gif | Bin 0 -> 43 bytes ldap/clients/dsgw/pbhtml/conference.gif | Bin 0 -> 545 bytes ldap/clients/dsgw/pbhtml/confirm.html | 30 + ldap/clients/dsgw/pbhtml/department.gif | Bin 0 -> 1023 bytes ldap/clients/dsgw/pbhtml/emptyFrame.html | 7 + ldap/clients/dsgw/pbhtml/get_cert.gif | Bin 0 -> 545 bytes ldap/clients/dsgw/pbhtml/get_cert_sm.gif | Bin 0 -> 319 bytes ldap/clients/dsgw/pbhtml/index.html | 41 + ldap/clients/dsgw/pbhtml/intro.html | 207 + ldap/clients/dsgw/pbhtml/modify.html | 292 + ldap/clients/dsgw/pbhtml/nonemp.html | 69 + ldap/clients/dsgw/pbhtml/nullStringError.html | 64 + ldap/clients/dsgw/pbhtml/office.gif | Bin 0 -> 1072 bytes ldap/clients/dsgw/pbhtml/orgicon.gif | Bin 0 -> 884 bytes ldap/clients/dsgw/pbhtml/pbrd.jpg | Bin 0 -> 17206 bytes ldap/clients/dsgw/pbhtml/person.gif | Bin 0 -> 2674 bytes ldap/clients/dsgw/pbhtml/phone.html | 87 + ldap/clients/dsgw/pbhtml/phone.js | 43 + ldap/clients/dsgw/pbhtml/pixel.gif | Bin 0 -> 43 bytes ldap/clients/dsgw/pbhtml/report.html | 155 + ldap/clients/dsgw/pbhtml/style.css | 88 + ldap/clients/dsgw/pbhtml/tiny_cert.gif | Bin 0 -> 164 bytes ldap/clients/dsgw/pbhtml/tiny_vcard.gif | Bin 0 -> 153 bytes ldap/clients/dsgw/pbhtml/vendor.gif | Bin 0 -> 701 bytes ldap/clients/dsgw/pbhtml/view_vcard.gif | Bin 0 -> 454 bytes ldap/clients/dsgw/pbhtml/view_vcard_sm.gif | Bin 0 -> 286 bytes ldap/clients/dsgw/search.c | 217 + ldap/clients/dsgw/secglue.c | 174 + ldap/clients/dsgw/sort.c | 138 + ldap/clients/dsgw/templateindex.c | 184 + ldap/clients/dsgw/tutor.c | 276 + ldap/clients/dsgw/unauth.c | 165 + ldap/clients/dsgw/userhtml/Makefile | 60 + ldap/clients/dsgw/userhtml/edit-userpasswd.html | 85 + ldap/clients/dsgw/userhtml/edit-userpinfo.html | 92 + ldap/clients/dsgw/userhtml/index.html | 29 + ldap/clients/dsgw/userhtml/index.lst | 29 + ldap/clients/dsgw/utf8compare.c | 2236 +++ ldap/clients/dsgw/vcard.c | 258 + ldap/clients/dsmlgw/Makefile | 16 + ldap/clients/dsmlgw/build.xml | 67 + ldap/clients/dsmlgw/misc/dsmlgw.cfg | 13 + ldap/clients/dsmlgw/misc/server-config.wsdd | 79 + ldap/clients/dsmlgw/misc/web-app_2_3.dtd | 1063 ++ .../com/netscape/dsml/gateway/BatchProcessor.java | 229 + .../com/netscape/dsml/gateway/Configuration.java | 97 + .../src/com/netscape/dsml/gateway/Constants.java | 142 + .../netscape/dsml/gateway/GenericOperation.java | 47 + .../dsml/gateway/IConnMgrFactoryFunctor.java | 22 + .../netscape/dsml/gateway/IConnectionManager.java | 30 + .../netscape/dsml/gateway/LDAPAuthenticator.java | 67 + .../com/netscape/dsml/gateway/OperationAdd.java | 96 + .../com/netscape/dsml/gateway/OperationAuth.java | 36 + .../netscape/dsml/gateway/OperationCompare.java | 82 + .../com/netscape/dsml/gateway/OperationDelete.java | 58 + .../netscape/dsml/gateway/OperationExtended.java | 93 + .../com/netscape/dsml/gateway/OperationModify.java | 134 + .../netscape/dsml/gateway/OperationModifyDN.java | 96 + .../com/netscape/dsml/gateway/OperationSearch.java | 322 + .../com/netscape/dsml/gateway/ParseControl.java | 131 + .../src/com/netscape/dsml/gateway/ParseFilter.java | 153 + .../netscape/dsml/gateway/ProxyConnMgrFactory.java | 38 + .../dsml/gateway/ProxyConnectionManager.java | 260 + .../com/netscape/dsml/gateway/gatewayContext.java | 84 + .../netscape/dsml/gateway/gatewayException.java | 36 + .../com/netscape/dsml/gateway/gatewayHandler.java | 208 + .../com/netscape/dsml/gateway/gatewayService.java | 44 + .../src/com/netscape/dsml/test/SOAPClient.java | 74 + .../src/com/netscape/dsml/test/dsmlClient.java | 90 + .../src/com/netscape/dsml/test/dsmlSearch.java | 55 + ldap/clients/orgchart/aim-online.gif | Bin 0 -> 897 bytes ldap/clients/orgchart/arrow.gif | Bin 0 -> 180 bytes ldap/clients/orgchart/botframe.html | 26 + ldap/clients/orgchart/branch-cc1.gif | Bin 0 -> 841 bytes ldap/clients/orgchart/config.tmpl | 185 + ldap/clients/orgchart/index.html | 33 + ldap/clients/orgchart/ldap-person.gif | Bin 0 -> 121 bytes ldap/clients/orgchart/mag.gif | Bin 0 -> 895 bytes ldap/clients/orgchart/mail.gif | Bin 0 -> 884 bytes ldap/clients/orgchart/myorg.bat | 2 + ldap/clients/orgchart/myorg.pl | 632 + ldap/clients/orgchart/new-branch-blank.gif | Bin 0 -> 832 bytes ldap/clients/orgchart/new-branch-first.gif | Bin 0 -> 848 bytes ldap/clients/orgchart/new-branch-straight.gif | Bin 0 -> 852 bytes ldap/clients/orgchart/nslogo.gif | Bin 0 -> 1950 bytes ldap/clients/orgchart/org.bat | 2 + ldap/clients/orgchart/org.pl | 2004 +++ ldap/clients/orgchart/orgicon.gif | Bin 0 -> 884 bytes ldap/clients/orgchart/starthelp.gif | Bin 0 -> 11440 bytes ldap/clients/orgchart/styles.css | 146 + ldap/clients/orgchart/topframe.html | 88 + ldap/clients/orgchart/wrapper.c | 89 + ldap/cm/Makefile | 938 + ldap/cm/filterfiles.sh | 30 + ldap/cm/fixBaseInf.pl | 39 + ldap/cm/fixNSPerlInf.pl | 55 + ldap/cm/fixPerlDAPInf.pl | 33 + ldap/cm/fixSetupInf.pl | 82 + ldap/cm/ldapjava.mpw | 8 + ldap/cm/nbsp2utf8.sh | 15 + ldap/cm/newinst/Makefile | 159 + ldap/cm/newinst/fixINF.pl | 50 + ldap/cm/newinst/ns-keygen | 168 + ldap/cm/newinst/ns-update | 135 + ldap/cm/newinst/replaceToken.pl | 34 + ldap/cm/newinst/setup.pl | 141 + ldap/cm/newinst/setup.sh | 10 + ldap/cm/newinst/slapd.inf | 48 + ldap/cm/newinst/uninstall | 75 + ldap/cm/newinst/ux-config.cc | 1151 ++ ldap/cm/newinst/ux-config.h | 172 + ldap/cm/newinst/ux-dialog.cc | 4332 +++++ ldap/cm/newinst/ux-dialog.h | 69 + ldap/cm/newinst/ux-dsalib_dn.c | 13 + ldap/cm/newinst/ux-guesses.cc | 125 + ldap/cm/newinstnt/Makefile | 91 + ldap/cm/newinstnt/consolinst.c | 320 + ldap/cm/newinstnt/consolinst.h | 39 + ldap/cm/newinstnt/dsinst.aps | Bin 0 -> 121483 bytes ldap/cm/newinstnt/dsinst.c | 8316 +++++++++ ldap/cm/newinstnt/dsinst.h | 248 + ldap/cm/newinstnt/dsinst.rc | 710 + ldap/cm/newinstnt/dsinst_dsalib_dn.c | 7 + ldap/cm/newinstnt/libinst.c | 136 + ldap/cm/newinstnt/libinst.h | 26 + ldap/cm/newinstnt/resource.h | 334 + ldap/cm/newinstnt/setup.bat | 3 + ldap/cm/newinstnt/setup.inf | 42 + ldap/cm/newinstnt/slapd.inf | 62 + ldap/cm/newinstnt/wizard.bmp | Bin 0 -> 31760 bytes ldap/cm/ntpack.sh | 76 + ldap/cm/unixstrip | 31 + ldap/cm/unixstrip.pl | 57 + ldap/cm/v1confs/ns-calendar-globopt.conf | 10 + ldap/cm/v1confs/ns-calendar-schema.conf | 131 + ldap/cm/v1confs/ns-certificate-globopt.conf | 9 + ldap/cm/v1confs/ns-certificate-schema.conf | 12 + ldap/cm/v1confs/ns-compass-globopt.conf | 11 + ldap/cm/v1confs/ns-compass-schema.conf | 169 + ldap/cm/v1confs/ns-directory-globopt.conf | 9 + ldap/cm/v1confs/ns-directory-schema.conf | 12 + ldap/cm/v1confs/ns-mail-globopt.conf | 10 + ldap/cm/v1confs/ns-mail-schema.conf | 93 + ldap/cm/v1confs/ns-media-globopt.conf | 9 + ldap/cm/v1confs/ns-media-schema.conf | 12 + ldap/cm/v1confs/ns-news-globopt.conf | 10 + ldap/cm/v1confs/ns-news-schema.conf | 33 + ldap/cm/v1confs/ns-proxy-globopt.conf | 9 + ldap/cm/v1confs/ns-proxy-schema.conf | 12 + ldap/cm/v1confs/ns-web-globopt.conf | 10 + ldap/cm/v1confs/ns-web-schema.conf | 12 + ldap/cm/v1confs/slapd.at.conf | 276 + ldap/cm/v1confs/slapd.oc.conf | 1077 ++ ldap/cm/v3confs/ns-calendar-globopt.conf | 10 + ldap/cm/v3confs/ns-calendar-schema.conf | 135 + ldap/cm/v3confs/ns-certificate-globopt.conf | 9 + ldap/cm/v3confs/ns-certificate-schema.conf | 13 + ldap/cm/v3confs/ns-compass-globopt.conf | 11 + ldap/cm/v3confs/ns-compass-schema.conf | 173 + ldap/cm/v3confs/ns-directory-globopt.conf | 9 + ldap/cm/v3confs/ns-directory-schema.conf | 13 + ldap/cm/v3confs/ns-mail-globopt.conf | 10 + ldap/cm/v3confs/ns-mail-schema.conf | 97 + ldap/cm/v3confs/ns-media-globopt.conf | 9 + ldap/cm/v3confs/ns-media-schema.conf | 13 + ldap/cm/v3confs/ns-news-globopt.conf | 10 + ldap/cm/v3confs/ns-news-schema.conf | 35 + ldap/cm/v3confs/ns-proxy-globopt.conf | 9 + ldap/cm/v3confs/ns-proxy-schema.conf | 13 + ldap/cm/v3confs/ns-web-globopt.conf | 10 + ldap/cm/v3confs/ns-web-schema.conf | 13 + ldap/cm/v3confs/slapd.at.conf | 319 + ldap/cm/v3confs/slapd.oc.conf | 779 + ldap/cm/v4confs/40/java-object-schema.conf | 58 + ldap/cm/v4confs/40/ns-admin-schema.conf | Bin 0 -> 3032 bytes ldap/cm/v4confs/40/ns-calendar-globopt.conf | 10 + ldap/cm/v4confs/40/ns-calendar-schema.conf | 148 + ldap/cm/v4confs/40/ns-certificate-globopt.conf | 9 + ldap/cm/v4confs/40/ns-certificate-schema.conf | 24 + ldap/cm/v4confs/40/ns-common-schema.conf | 245 + ldap/cm/v4confs/40/ns-compass-globopt.conf | 11 + ldap/cm/v4confs/40/ns-compass-schema.conf | 173 + ldap/cm/v4confs/40/ns-cos-schema.conf | 29 + ldap/cm/v4confs/40/ns-delegated-admin-schema.conf | 62 + ldap/cm/v4confs/40/ns-directory-globopt.conf | 9 + ldap/cm/v4confs/40/ns-directory-schema.conf | 27 + ldap/cm/v4confs/40/ns-legacy-schema.conf | 33 + ldap/cm/v4confs/40/ns-mail-globopt.conf | 12 + ldap/cm/v4confs/40/ns-mail-schema.conf | 132 + ldap/cm/v4confs/40/ns-mcd-browser-schema.conf | 179 + ldap/cm/v4confs/40/ns-mcd-config-schema.conf | 55 + ldap/cm/v4confs/40/ns-mcd-li-globopt.conf | 9 + ldap/cm/v4confs/40/ns-mcd-li-schema.conf | 60 + ldap/cm/v4confs/40/ns-mcd-mail-schema.conf | 219 + ldap/cm/v4confs/40/ns-media-globopt.conf | 9 + ldap/cm/v4confs/40/ns-media-schema.conf | 13 + ldap/cm/v4confs/40/ns-mlm-schema.conf | 95 + ldap/cm/v4confs/40/ns-msg-schema.conf | 690 + ldap/cm/v4confs/40/ns-netshare-schema.conf | 47 + ldap/cm/v4confs/40/ns-news-globopt.conf | 10 + ldap/cm/v4confs/40/ns-news-schema.conf | 35 + ldap/cm/v4confs/40/ns-proxy-globopt.conf | 9 + ldap/cm/v4confs/40/ns-proxy-schema.conf | 13 + ldap/cm/v4confs/40/ns-value-schema.conf | 42 + ldap/cm/v4confs/40/ns-wcal-globopt.conf | 10 + ldap/cm/v4confs/40/ns-wcal-schema.conf | 71 + ldap/cm/v4confs/40/ns-web-globopt.conf | 10 + ldap/cm/v4confs/40/ns-web-schema.conf | 18 + ldap/cm/v4confs/40/slapd.at.conf | 391 + ldap/cm/v4confs/40/slapd.oc.conf | 1068 ++ ldap/cm/v4confs/41/java-object-schema.conf | 53 + ldap/cm/v4confs/41/ns-admin-schema.conf | 155 + ldap/cm/v4confs/41/ns-calendar-globopt.conf | 10 + ldap/cm/v4confs/41/ns-calendar-schema.conf | 148 + ldap/cm/v4confs/41/ns-certificate-globopt.conf | 9 + ldap/cm/v4confs/41/ns-certificate-schema.conf | 24 + ldap/cm/v4confs/41/ns-common-schema.conf | 246 + ldap/cm/v4confs/41/ns-compass-globopt.conf | 11 + ldap/cm/v4confs/41/ns-compass-schema.conf | 173 + ldap/cm/v4confs/41/ns-cos-schema.conf | 29 + ldap/cm/v4confs/41/ns-delegated-admin-schema.conf | 62 + ldap/cm/v4confs/41/ns-directory-globopt.conf | 9 + ldap/cm/v4confs/41/ns-directory-schema.conf | 27 + ldap/cm/v4confs/41/ns-legacy-schema.conf | 33 + ldap/cm/v4confs/41/ns-mail-globopt.conf | 12 + ldap/cm/v4confs/41/ns-mail-schema.conf | 144 + ldap/cm/v4confs/41/ns-mcd-browser-schema.conf | 179 + ldap/cm/v4confs/41/ns-mcd-config-schema.conf | 55 + ldap/cm/v4confs/41/ns-mcd-li-globopt.conf | 9 + ldap/cm/v4confs/41/ns-mcd-li-schema.conf | 60 + ldap/cm/v4confs/41/ns-mcd-mail-schema.conf | 219 + ldap/cm/v4confs/41/ns-media-globopt.conf | 9 + ldap/cm/v4confs/41/ns-media-schema.conf | 13 + ldap/cm/v4confs/41/ns-mlm-schema.conf | 102 + ldap/cm/v4confs/41/ns-msg-schema.conf | 711 + ldap/cm/v4confs/41/ns-netshare-schema.conf | 47 + ldap/cm/v4confs/41/ns-news-globopt.conf | 10 + ldap/cm/v4confs/41/ns-news-schema.conf | 35 + ldap/cm/v4confs/41/ns-proxy-globopt.conf | 9 + ldap/cm/v4confs/41/ns-proxy-schema.conf | 13 + ldap/cm/v4confs/41/ns-value-schema.conf | 42 + ldap/cm/v4confs/41/ns-wcal-globopt.conf | 10 + ldap/cm/v4confs/41/ns-wcal-schema.conf | 71 + ldap/cm/v4confs/41/ns-web-globopt.conf | 10 + ldap/cm/v4confs/41/ns-web-schema.conf | 18 + ldap/cm/v4confs/41/slapd.at.conf | 391 + ldap/cm/v4confs/41/slapd.oc.conf | 1069 ++ ldap/cm/v4confs/411/java-object-schema.conf | 58 + ldap/cm/v4confs/411/ns-admin-schema.conf | 155 + ldap/cm/v4confs/411/ns-calendar-globopt.conf | 10 + ldap/cm/v4confs/411/ns-calendar-schema.conf | 148 + ldap/cm/v4confs/411/ns-certificate-globopt.conf | 9 + ldap/cm/v4confs/411/ns-certificate-schema.conf | 24 + ldap/cm/v4confs/411/ns-common-schema.conf | 246 + ldap/cm/v4confs/411/ns-compass-globopt.conf | 11 + ldap/cm/v4confs/411/ns-compass-schema.conf | 173 + ldap/cm/v4confs/411/ns-cos-schema.conf | 29 + ldap/cm/v4confs/411/ns-delegated-admin-schema.conf | 97 + ldap/cm/v4confs/411/ns-directory-globopt.conf | 9 + ldap/cm/v4confs/411/ns-directory-schema.conf | 27 + ldap/cm/v4confs/411/ns-legacy-schema.conf | 33 + ldap/cm/v4confs/411/ns-mail-globopt.conf | 12 + ldap/cm/v4confs/411/ns-mail-schema.conf | 144 + ldap/cm/v4confs/411/ns-mcd-browser-schema.conf | 179 + ldap/cm/v4confs/411/ns-mcd-config-schema.conf | 55 + ldap/cm/v4confs/411/ns-mcd-li-globopt.conf | 9 + ldap/cm/v4confs/411/ns-mcd-li-schema.conf | 60 + ldap/cm/v4confs/411/ns-mcd-mail-schema.conf | 219 + ldap/cm/v4confs/411/ns-media-globopt.conf | 9 + ldap/cm/v4confs/411/ns-media-schema.conf | 13 + ldap/cm/v4confs/411/ns-mlm-schema.conf | 102 + ldap/cm/v4confs/411/ns-msg-schema.conf | 711 + ldap/cm/v4confs/411/ns-netshare-schema.conf | 47 + ldap/cm/v4confs/411/ns-news-globopt.conf | 10 + ldap/cm/v4confs/411/ns-news-schema.conf | 35 + ldap/cm/v4confs/411/ns-proxy-globopt.conf | 9 + ldap/cm/v4confs/411/ns-proxy-schema.conf | 13 + ldap/cm/v4confs/411/ns-value-schema.conf | 42 + ldap/cm/v4confs/411/ns-wcal-globopt.conf | 10 + ldap/cm/v4confs/411/ns-wcal-schema.conf | 71 + ldap/cm/v4confs/411/ns-web-globopt.conf | 10 + ldap/cm/v4confs/411/ns-web-schema.conf | 18 + ldap/cm/v4confs/411/slapd.at.conf | 391 + ldap/cm/v4confs/411/slapd.oc.conf | 1069 ++ ldap/cm/v4confs/412/java-object-schema.conf | 58 + ldap/cm/v4confs/412/ns-admin-schema.conf | 155 + ldap/cm/v4confs/412/ns-calendar-globopt.conf | 10 + ldap/cm/v4confs/412/ns-calendar-schema.conf | 148 + ldap/cm/v4confs/412/ns-certificate-globopt.conf | 9 + ldap/cm/v4confs/412/ns-certificate-schema.conf | 24 + ldap/cm/v4confs/412/ns-common-schema.conf | 246 + ldap/cm/v4confs/412/ns-compass-globopt.conf | 11 + ldap/cm/v4confs/412/ns-compass-schema.conf | 173 + ldap/cm/v4confs/412/ns-cos-schema.conf | 29 + ldap/cm/v4confs/412/ns-delegated-admin-schema.conf | 114 + ldap/cm/v4confs/412/ns-directory-globopt.conf | 9 + ldap/cm/v4confs/412/ns-directory-schema.conf | 27 + ldap/cm/v4confs/412/ns-legacy-schema.conf | 33 + ldap/cm/v4confs/412/ns-mail-globopt.conf | 12 + ldap/cm/v4confs/412/ns-mail-schema.conf | 144 + ldap/cm/v4confs/412/ns-mcd-browser-schema.conf | 179 + ldap/cm/v4confs/412/ns-mcd-config-schema.conf | 55 + ldap/cm/v4confs/412/ns-mcd-li-globopt.conf | 9 + ldap/cm/v4confs/412/ns-mcd-li-schema.conf | 60 + ldap/cm/v4confs/412/ns-mcd-mail-schema.conf | 219 + ldap/cm/v4confs/412/ns-media-globopt.conf | 9 + ldap/cm/v4confs/412/ns-media-schema.conf | 13 + ldap/cm/v4confs/412/ns-mlm-schema.conf | 102 + ldap/cm/v4confs/412/ns-msg-schema.conf | 711 + ldap/cm/v4confs/412/ns-netshare-schema.conf | 47 + ldap/cm/v4confs/412/ns-news-globopt.conf | 10 + ldap/cm/v4confs/412/ns-news-schema.conf | 35 + ldap/cm/v4confs/412/ns-proxy-globopt.conf | 9 + ldap/cm/v4confs/412/ns-proxy-schema.conf | 13 + ldap/cm/v4confs/412/ns-value-schema.conf | 42 + ldap/cm/v4confs/412/ns-wcal-globopt.conf | 10 + ldap/cm/v4confs/412/ns-wcal-schema.conf | 71 + ldap/cm/v4confs/412/ns-web-globopt.conf | 10 + ldap/cm/v4confs/412/ns-web-schema.conf | 18 + ldap/cm/v4confs/412/slapd.at.conf | 391 + ldap/cm/v4confs/412/slapd.oc.conf | 1069 ++ ldap/docs/LICENSE.txt | 6 + ldap/docs/README.txt | 19 + ldap/docs/dirhlp/Makefile | 196 + ldap/docs/dirhlp/dssynchhelp.z | Bin 0 -> 256000 bytes ldap/docs/dirhlp/help/account_mgmt.htm | 183 + ldap/docs/dirhlp/help/adv_search.htm | 142 + ldap/docs/dirhlp/help/configtab_chaindb.htm | 189 + ldap/docs/dirhlp/help/configtab_chaindb2.htm | 191 + ldap/docs/dirhlp/help/configtab_chaindb3.htm | 325 + ldap/docs/dirhlp/help/configtab_chaindb4.htm | 277 + ldap/docs/dirhlp/help/configtab_chaindb5.htm | 242 + ldap/docs/dirhlp/help/configtab_chaindb6.htm | 249 + ldap/docs/dirhlp/help/configtab_chaindb7.htm | 193 + ldap/docs/dirhlp/help/configtab_db.htm | 207 + ldap/docs/dirhlp/help/configtab_db10.htm | 161 + ldap/docs/dirhlp/help/configtab_db11.htm | 154 + ldap/docs/dirhlp/help/configtab_db12.htm | 170 + ldap/docs/dirhlp/help/configtab_db13.htm | 112 + ldap/docs/dirhlp/help/configtab_db14.htm | 87 + ldap/docs/dirhlp/help/configtab_db15.htm | 94 + ldap/docs/dirhlp/help/configtab_db2.htm | 239 + ldap/docs/dirhlp/help/configtab_db3.htm | 169 + ldap/docs/dirhlp/help/configtab_db4.htm | 142 + ldap/docs/dirhlp/help/configtab_db5.htm | 158 + ldap/docs/dirhlp/help/configtab_db6.htm | 168 + ldap/docs/dirhlp/help/configtab_db7.htm | 165 + ldap/docs/dirhlp/help/configtab_db8.htm | 175 + ldap/docs/dirhlp/help/configtab_db9.htm | 177 + ldap/docs/dirhlp/help/configtab_ldbmdb.htm | 154 + ldap/docs/dirhlp/help/configtab_logs.htm | 217 + ldap/docs/dirhlp/help/configtab_logs2.htm | 221 + ldap/docs/dirhlp/help/configtab_logs3.htm | 217 + ldap/docs/dirhlp/help/configtab_maptree.htm | 177 + ldap/docs/dirhlp/help/configtab_maptree2.htm | 138 + ldap/docs/dirhlp/help/configtab_maptree3.htm | 175 + ldap/docs/dirhlp/help/configtab_maptree4.htm | 161 + ldap/docs/dirhlp/help/configtab_maptree5.htm | 161 + ldap/docs/dirhlp/help/configtab_maptree6.htm | 169 + ldap/docs/dirhlp/help/configtab_maptree7.htm | 157 + ldap/docs/dirhlp/help/configtab_plugins.htm | 174 + ldap/docs/dirhlp/help/configtab_replication.htm | 165 + ldap/docs/dirhlp/help/configtab_replication2.htm | 177 + ldap/docs/dirhlp/help/configtab_replication3.htm | 193 + ldap/docs/dirhlp/help/configtab_replication4.htm | 170 + ldap/docs/dirhlp/help/configtab_replication5.htm | 150 + ldap/docs/dirhlp/help/configtab_replication6.htm | 176 + ldap/docs/dirhlp/help/configtab_replication7.htm | 146 + ldap/docs/dirhlp/help/configtab_replication8.htm | 146 + ldap/docs/dirhlp/help/configtab_rootnode.htm | 162 + ldap/docs/dirhlp/help/configtab_rootnode2.htm | 154 + ldap/docs/dirhlp/help/configtab_rootnode3.htm | 341 + ldap/docs/dirhlp/help/configtab_rootnode4.htm | 153 + ldap/docs/dirhlp/help/configtab_rootnode5.htm | 181 + ldap/docs/dirhlp/help/configtab_rootnode6.htm | 180 + ldap/docs/dirhlp/help/configtab_rootnode7.htm | 118 + ldap/docs/dirhlp/help/configtab_rootnode8.htm | 96 + ldap/docs/dirhlp/help/configtab_rootnode9.htm | 96 + ldap/docs/dirhlp/help/configtab_schema.htm | 181 + ldap/docs/dirhlp/help/configtab_schema2.htm | 177 + ldap/docs/dirhlp/help/configtab_schema3.htm | 195 + ldap/docs/dirhlp/help/configtab_schema4.htm | 173 + ldap/docs/dirhlp/help/configtab_schema5.htm | 211 + ldap/docs/dirhlp/help/dir_browser.htm | 138 + ldap/docs/dirhlp/help/dir_browser2.htm | 239 + ldap/docs/dirhlp/help/dir_browser3.htm | 169 + ldap/docs/dirhlp/help/dir_browser4.htm | 189 + ldap/docs/dirhlp/help/dirtab_cos.htm | 169 + ldap/docs/dirhlp/help/dirtab_cos2.htm | 161 + ldap/docs/dirhlp/help/dirtab_cos3.htm | 181 + ldap/docs/dirhlp/help/dirtab_role.htm | 213 + ldap/docs/dirhlp/help/dirtab_role2.htm | 161 + ldap/docs/dirhlp/help/dirtab_role3.htm | 161 + ldap/docs/dirhlp/help/dirtab_role4.htm | 157 + ldap/docs/dirhlp/help/dirtab_role5.htm | 161 + ldap/docs/dirhlp/help/dirtab_role6.htm | 157 + ldap/docs/dirhlp/help/dirtab_role7.htm | 161 + ldap/docs/dirhlp/help/helpmenu.htm | 204 + ldap/docs/dirhlp/help/ix.htm | 228 + ldap/docs/dirhlp/help/ldapurl.htm | 154 + ldap/docs/dirhlp/help/netscape32.gif | Bin 0 -> 1529 bytes ldap/docs/dirhlp/help/new_instance.htm | 166 + ldap/docs/dirhlp/help/pixel.gif | Bin 0 -> 45 bytes ldap/docs/dirhlp/help/property_editor.htm | 185 + ldap/docs/dirhlp/help/property_editor2.htm | 142 + ldap/docs/dirhlp/help/property_editor3.htm | 188 + ldap/docs/dirhlp/help/property_editor4.htm | 186 + ldap/docs/dirhlp/help/redir_agtoc.htm | 136 + ldap/docs/dirhlp/help/redir_dochome.htm | 113 + ldap/docs/dirhlp/help/replication_wizard.htm | 196 + ldap/docs/dirhlp/help/replication_wizard2.htm | 150 + ldap/docs/dirhlp/help/replication_wizard3.htm | 169 + ldap/docs/dirhlp/help/replication_wizard4.htm | 142 + ldap/docs/dirhlp/help/replication_wizard5.htm | 146 + ldap/docs/dirhlp/help/sniffer.js | 104 + ldap/docs/dirhlp/help/statustab_general.htm | 182 + ldap/docs/dirhlp/help/statustab_logs.htm | 189 + ldap/docs/dirhlp/help/statustab_logs2.htm | 181 + ldap/docs/dirhlp/help/statustab_logs3.htm | 169 + ldap/docs/dirhlp/help/statustab_performance.htm | 363 + ldap/docs/dirhlp/help/statustab_performance2.htm | 237 + ldap/docs/dirhlp/help/statustab_replication.htm | 213 + ldap/docs/dirhlp/help/taskstab_bkup_restore.htm | 165 + ldap/docs/dirhlp/help/taskstab_bkup_restore2.htm | 157 + ldap/docs/dirhlp/help/topics.htm | 531 + ldap/docs/dirhlp/index.htm | 297 + ldap/docs/dirhlp/index.map | 149 + ldap/docs/dirhlp/pixel.gif | Bin 0 -> 45 bytes ldap/docs/dirhlp/tokens.map | 166 + ldap/docs/dirhlp/topicindex.htm | 662 + ldap/dsml/European.dsml | 17598 +++++++++++++++++++ ldap/dsml/Example-roles.dsml | 6514 +++++++ ldap/dsml/Example.dsml | 6501 +++++++ ldap/include/Makefile | 53 + ldap/include/Makefile.client | 54 + ldap/include/avl.h | 67 + ldap/include/dblayer.h | 7 + ldap/include/dirlite_strings.h | 62 + ldap/include/disptmpl.h | 348 + ldap/include/ldaplog.h | 84 + ldap/include/ldaprot.h | 167 + ldap/include/ldbm.h | 380 + ldap/include/ldif.h | 76 + ldap/include/litekey.h | 30 + ldap/include/lthread.h | 423 + ldap/include/ntslapdregparms.h | 41 + ldap/include/ntwatchdog.h | 68 + ldap/include/portable.h | 380 + ldap/include/proto-ntutil.h | 79 + ldap/include/regex.h | 63 + ldap/include/srchpref.h | 123 + ldap/include/sysexits-compat.h | 107 + ldap/javarules.mk | 118 + ldap/ldif/Ace.ldif | 2604 +++ ldap/ldif/European.ldif | 7589 ++++++++ ldap/ldif/Eurosuffix.ldif | 12 + ldap/ldif/Example-roles.ldif | 2995 ++++ ldap/ldif/Example-views.ldif | 3167 ++++ ldap/ldif/Example.ldif | 2981 ++++ ldap/ldif/commonTasks.ldif | 45 + ldap/ldif/roledit.ldif | 50 + ldap/ldif/tasks.ldif | 134 + ldap/ldif/template.ldif | 83 + ldap/libraries/Makefile | 370 + ldap/libraries/Makefile.client | 37 + ldap/libraries/libavl/Makefile | 52 + ldap/libraries/libavl/avl.c | 773 + ldap/libraries/libavl/testavl.c | 125 + ldap/libraries/libldif/Makefile | 52 + ldap/libraries/libldif/fileurl.c | 289 + ldap/libraries/libldif/fileurl.h | 40 + ldap/libraries/libldif/line64.c | 743 + ldap/libraries/liblitekey/Makefile | 50 + ldap/libraries/liblitekey/keycheck.c | 137 + ldap/libraries/libutil/Makefile | 70 + ldap/libraries/libutil/getopt.c | 109 + ldap/libraries/libutil/ntdebug.c | 51 + ldap/libraries/libutil/ntevent.c | 183 + ldap/libraries/libutil/ntreg.c | 105 + ldap/libraries/libutil/ntresource.h | 31 + ldap/libraries/libutil/ntstubs.c | 40 + ldap/nsdeps.mk | 59 + ldap/nsldap.mk | 1752 ++ ldap/schema/00core.ldif | 339 + ldap/schema/05rfc2247.ldif | 19 + ldap/schema/05rfc2927.ldif | 19 + ldap/schema/10presence.ldif | 25 + ldap/schema/10rfc2307.ldif | 54 + ldap/schema/20subscriber.ldif | 32 + ldap/schema/25java-object.ldif | 24 + ldap/schema/28pilot.ldif | 62 + ldap/schema/30ns-common.ldif | 77 + ldap/schema/50ns-admin.ldif | 42 + ldap/schema/50ns-calendar.ldif | 40 + ldap/schema/50ns-certificate.ldif | 14 + ldap/schema/50ns-compass.ldif | 69 + ldap/schema/50ns-delegated-admin.ldif | 37 + ldap/schema/50ns-directory.ldif | 87 + ldap/schema/50ns-legacy.ldif | 16 + ldap/schema/50ns-mail.ldif | 48 + ldap/schema/50ns-mcd-browser.ldif | 86 + ldap/schema/50ns-mcd-config.ldif | 29 + ldap/schema/50ns-mcd-li.ldif | 22 + ldap/schema/50ns-mcd-mail.ldif | 103 + ldap/schema/50ns-media.ldif | 12 + ldap/schema/50ns-mlm.ldif | 43 + ldap/schema/50ns-msg.ldif | 297 + ldap/schema/50ns-netshare.ldif | 23 + ldap/schema/50ns-news.ldif | 19 + ldap/schema/50ns-proxy.ldif | 12 + ldap/schema/50ns-value.ldif | 24 + ldap/schema/50ns-wcal.ldif | 26 + ldap/schema/50ns-web.ldif | 14 + ldap/schema/51ns-calendar.ldif | 69 + ldap/schema/99user.ldif | 11 + ldap/schema/ns-calendar-globopt.conf | 10 + ldap/schema/ns-certificate-globopt.conf | 9 + ldap/schema/ns-compass-globopt.conf | 11 + ldap/schema/ns-directory-globopt.conf | 9 + ldap/schema/ns-mail-globopt.conf | 12 + ldap/schema/ns-mcd-li-globopt.conf | 9 + ldap/schema/ns-media-globopt.conf | 9 + ldap/schema/ns-news-globopt.conf | 10 + ldap/schema/ns-proxy-globopt.conf | 9 + ldap/schema/ns-wcal-globopt.conf | 10 + ldap/schema/ns-web-globopt.conf | 10 + ldap/schema/slapd-collations.conf | 67 + ldap/servers/Makefile | 90 + ldap/servers/plugins/Makefile | 101 + ldap/servers/plugins/acl/ACL-Notes | 215 + ldap/servers/plugins/acl/Makefile | 96 + ldap/servers/plugins/acl/acl.c | 4118 +++++ ldap/servers/plugins/acl/acl.h | 867 + ldap/servers/plugins/acl/acl_ext.c | 968 + ldap/servers/plugins/acl/aclanom.c | 536 + ldap/servers/plugins/acl/acldllmain.c | 128 + ldap/servers/plugins/acl/acleffectiverights.c | 674 + ldap/servers/plugins/acl/aclgroup.c | 442 + ldap/servers/plugins/acl/aclinit.c | 537 + ldap/servers/plugins/acl/acllas.c | 3848 ++++ ldap/servers/plugins/acl/acllist.c | 940 + ldap/servers/plugins/acl/aclparse.c | 1928 ++ ldap/servers/plugins/acl/aclplugin.c | 355 + ldap/servers/plugins/acl/aclproxy.c | 195 + ldap/servers/plugins/acl/aclutil.c | 1475 ++ ldap/servers/plugins/acl/libacl.def | 16 + ldap/servers/plugins/chainingdb/Makefile | 93 + ldap/servers/plugins/chainingdb/cb.h | 461 + ldap/servers/plugins/chainingdb/cb_abandon.c | 50 + ldap/servers/plugins/chainingdb/cb_acl.c | 60 + ldap/servers/plugins/chainingdb/cb_add.c | 227 + ldap/servers/plugins/chainingdb/cb_bind.c | 290 + ldap/servers/plugins/chainingdb/cb_cleanup.c | 22 + ldap/servers/plugins/chainingdb/cb_close.c | 67 + ldap/servers/plugins/chainingdb/cb_compare.c | 217 + ldap/servers/plugins/chainingdb/cb_config.c | 600 + .../servers/plugins/chainingdb/cb_conn_stateless.c | 1132 ++ ldap/servers/plugins/chainingdb/cb_controls.c | 289 + ldap/servers/plugins/chainingdb/cb_debug.c | 23 + ldap/servers/plugins/chainingdb/cb_delete.c | 203 + ldap/servers/plugins/chainingdb/cb_init.c | 120 + ldap/servers/plugins/chainingdb/cb_instance.c | 1871 ++ ldap/servers/plugins/chainingdb/cb_modify.c | 244 + ldap/servers/plugins/chainingdb/cb_modrdn.c | 239 + ldap/servers/plugins/chainingdb/cb_monitor.c | 228 + ldap/servers/plugins/chainingdb/cb_schema.c | 45 + ldap/servers/plugins/chainingdb/cb_search.c | 698 + ldap/servers/plugins/chainingdb/cb_size.c | 22 + ldap/servers/plugins/chainingdb/cb_start.c | 43 + ldap/servers/plugins/chainingdb/cb_temp.c | 15 + ldap/servers/plugins/chainingdb/cb_test.c | 76 + ldap/servers/plugins/chainingdb/cb_unbind.c | 23 + ldap/servers/plugins/chainingdb/cb_utils.c | 375 + ldap/servers/plugins/chainingdb/cbdllmain.c | 128 + ldap/servers/plugins/chainingdb/libcb.def | 15 + ldap/servers/plugins/collation/Makefile | 99 + ldap/servers/plugins/collation/collate.c | 454 + ldap/servers/plugins/collation/collate.h | 36 + ldap/servers/plugins/collation/collation.def | 10 + ldap/servers/plugins/collation/config.c | 178 + ldap/servers/plugins/collation/config.h | 12 + ldap/servers/plugins/collation/debug.c | 14 + ldap/servers/plugins/collation/dllmain.c | 129 + ldap/servers/plugins/collation/orfilter.c | 984 ++ ldap/servers/plugins/collation/orfilter.h | 10 + ldap/servers/plugins/cos/Makefile | 79 + ldap/servers/plugins/cos/cos.c | 266 + ldap/servers/plugins/cos/cos.def | 11 + ldap/servers/plugins/cos/cos_cache.c | 3566 ++++ ldap/servers/plugins/cos/cos_cache.h | 19 + ldap/servers/plugins/cos/dllmain.c | 96 + ldap/servers/plugins/distrib/Makefile | 109 + ldap/servers/plugins/distrib/Makefile.AIX | 44 + ldap/servers/plugins/distrib/Makefile.BSDI | 30 + ldap/servers/plugins/distrib/Makefile.HPUX | 27 + ldap/servers/plugins/distrib/Makefile.HPUX64 | 27 + ldap/servers/plugins/distrib/Makefile.IRIX | 30 + ldap/servers/plugins/distrib/Makefile.Linux | 30 + ldap/servers/plugins/distrib/Makefile.OSF1 | 29 + ldap/servers/plugins/distrib/Makefile.ReliantUNIX | 30 + ldap/servers/plugins/distrib/Makefile.SOLARIS | 30 + ldap/servers/plugins/distrib/Makefile.SOLARIS64 | 30 + ldap/servers/plugins/distrib/Makefile.SOLARISx86 | 30 + ldap/servers/plugins/distrib/Makefile.UnixWare | 30 + ldap/servers/plugins/distrib/Makefile.UnixWareUDK | 30 + ldap/servers/plugins/distrib/Makefile.WINNT | 38 + ldap/servers/plugins/distrib/README | 23 + ldap/servers/plugins/distrib/distrib.c | 222 + ldap/servers/plugins/distrib/distrib.dsp | 116 + ldap/servers/plugins/distrib/dllmain.c | 101 + ldap/servers/plugins/distrib/libdistrib.def | 10 + ldap/servers/plugins/http/Makefile | 80 + ldap/servers/plugins/http/dllmain.c | 98 + ldap/servers/plugins/http/http.def | 13 + ldap/servers/plugins/http/http_client.c | 290 + ldap/servers/plugins/http/http_client.h | 64 + ldap/servers/plugins/http/http_impl.c | 1479 ++ ldap/servers/plugins/http/http_impl.h | 25 + ldap/servers/plugins/passthru/Makefile | 90 + ldap/servers/plugins/passthru/PT-Notes | 30 + ldap/servers/plugins/passthru/libpassthru.def | 14 + ldap/servers/plugins/passthru/passthru.h | 131 + ldap/servers/plugins/passthru/ptbind.c | 144 + ldap/servers/plugins/passthru/ptconfig.c | 301 + ldap/servers/plugins/passthru/ptconn.c | 420 + ldap/servers/plugins/passthru/ptdebug.c | 23 + ldap/servers/plugins/passthru/ptdllmain.c | 131 + ldap/servers/plugins/passthru/ptpreop.c | 252 + ldap/servers/plugins/passthru/ptutil.c | 111 + ldap/servers/plugins/presence/Makefile | 85 + ldap/servers/plugins/presence/dllmain.c | 96 + .../plugins/presence/images/aim-offline.gif | Bin 0 -> 113 bytes .../servers/plugins/presence/images/aim-online.gif | Bin 0 -> 895 bytes .../plugins/presence/images/icq-disabled.gif | Bin 0 -> 138 bytes .../plugins/presence/images/icq-offline.gif | Bin 0 -> 198 bytes .../servers/plugins/presence/images/icq-online.gif | Bin 0 -> 198 bytes .../plugins/presence/images/yahoo-offline.gif | Bin 0 -> 84 bytes .../plugins/presence/images/yahoo-online.gif | Bin 0 -> 140 bytes ldap/servers/plugins/presence/presence.c | 1204 ++ ldap/servers/plugins/presence/presence.def | 11 + ldap/servers/plugins/presence/presence.ldif | 44 + ldap/servers/plugins/pwdstorage/Makefile | 115 + ldap/servers/plugins/pwdstorage/clear_pwd.c | 27 + ldap/servers/plugins/pwdstorage/crypt_pwd.c | 91 + ldap/servers/plugins/pwdstorage/dllmain.c | 91 + ldap/servers/plugins/pwdstorage/libpwdstorage.def | 24 + ldap/servers/plugins/pwdstorage/md5.h | 63 + ldap/servers/plugins/pwdstorage/md5c.c | 337 + ldap/servers/plugins/pwdstorage/ns-mta-md5_pwd.bu | 405 + ldap/servers/plugins/pwdstorage/ns-mta-md5_pwd.c | 81 + ldap/servers/plugins/pwdstorage/pwd_init.c | 146 + ldap/servers/plugins/pwdstorage/pwdstorage.h | 99 + ldap/servers/plugins/pwdstorage/sha_pwd.c | 111 + ldap/servers/plugins/pwdstorage/ssha_pwd.c | 112 + ldap/servers/plugins/referint/Makefile | 72 + ldap/servers/plugins/referint/dllmain.c | 95 + ldap/servers/plugins/referint/referint.c | 808 + ldap/servers/plugins/referint/referint.def | 12 + ldap/servers/plugins/replication/Makefile | 152 + ldap/servers/plugins/replication/cl4.h | 65 + ldap/servers/plugins/replication/cl4_api.c | 797 + ldap/servers/plugins/replication/cl4_api.h | 67 + ldap/servers/plugins/replication/cl4_init.c | 349 + ldap/servers/plugins/replication/cl5.h | 38 + ldap/servers/plugins/replication/cl5_api.c | 6512 +++++++ ldap/servers/plugins/replication/cl5_api.h | 478 + ldap/servers/plugins/replication/cl5_clcache.c | 910 + ldap/servers/plugins/replication/cl5_clcache.h | 22 + ldap/servers/plugins/replication/cl5_config.c | 868 + ldap/servers/plugins/replication/cl5_init.c | 77 + ldap/servers/plugins/replication/cl5_test.c | 830 + ldap/servers/plugins/replication/cl5_test.h | 21 + ldap/servers/plugins/replication/csnpl.c | 328 + ldap/servers/plugins/replication/csnpl.h | 23 + ldap/servers/plugins/replication/dllmain.c | 91 + ldap/servers/plugins/replication/legacy_consumer.c | 707 + ldap/servers/plugins/replication/llist.c | 336 + ldap/servers/plugins/replication/llist.h | 26 + ldap/servers/plugins/replication/profile.c | 42 + ldap/servers/plugins/replication/repl.h | 366 + ldap/servers/plugins/replication/repl5.h | 480 + ldap/servers/plugins/replication/repl5_agmt.c | 1766 ++ ldap/servers/plugins/replication/repl5_agmtlist.c | 618 + ldap/servers/plugins/replication/repl5_backoff.c | 232 + .../servers/plugins/replication/repl5_connection.c | 1493 ++ .../plugins/replication/repl5_inc_protocol.c | 1759 ++ ldap/servers/plugins/replication/repl5_init.c | 572 + .../servers/plugins/replication/repl5_mtnode_ext.c | 194 + ldap/servers/plugins/replication/repl5_plugins.c | 1416 ++ .../plugins/replication/repl5_prot_private.h | 66 + ldap/servers/plugins/replication/repl5_protocol.c | 502 + .../plugins/replication/repl5_protocol_util.c | 468 + ldap/servers/plugins/replication/repl5_replica.c | 3387 ++++ .../plugins/replication/repl5_replica_config.c | 750 + .../plugins/replication/repl5_replica_dnhash.c | 189 + .../plugins/replication/repl5_replica_hash.c | 243 + .../plugins/replication/repl5_replsupplier.c | 166 + ldap/servers/plugins/replication/repl5_ruv.c | 2022 +++ ldap/servers/plugins/replication/repl5_ruv.h | 88 + ldap/servers/plugins/replication/repl5_schedule.c | 742 + .../plugins/replication/repl5_tot_protocol.c | 372 + ldap/servers/plugins/replication/repl5_total.c | 869 + .../plugins/replication/repl5_updatedn_list.c | 243 + ldap/servers/plugins/replication/repl_add.c | 30 + ldap/servers/plugins/replication/repl_bind.c | 48 + ldap/servers/plugins/replication/repl_compare.c | 34 + ldap/servers/plugins/replication/repl_connext.c | 91 + ldap/servers/plugins/replication/repl_controls.c | 337 + ldap/servers/plugins/replication/repl_delete.c | 26 + ldap/servers/plugins/replication/repl_entry.c | 38 + ldap/servers/plugins/replication/repl_ext.c | 113 + ldap/servers/plugins/replication/repl_extop.c | 1134 ++ ldap/servers/plugins/replication/repl_globals.c | 108 + ldap/servers/plugins/replication/repl_helper.c | 85 + ldap/servers/plugins/replication/repl_helper.h | 69 + ldap/servers/plugins/replication/repl_init.c | 312 + ldap/servers/plugins/replication/repl_modify.c | 29 + ldap/servers/plugins/replication/repl_modrdn.c | 28 + ldap/servers/plugins/replication/repl_monitor.c | 58 + ldap/servers/plugins/replication/repl_objset.c | 524 + ldap/servers/plugins/replication/repl_objset.h | 37 + ldap/servers/plugins/replication/repl_opext.c | 97 + ldap/servers/plugins/replication/repl_ops.c | 180 + ldap/servers/plugins/replication/repl_rootdse.c | 79 + ldap/servers/plugins/replication/repl_search.c | 25 + ldap/servers/plugins/replication/repl_shared.h | 132 + ldap/servers/plugins/replication/replication.def | 16 + ldap/servers/plugins/replication/replutil.c | 1073 ++ ldap/servers/plugins/replication/tests/dnp_sim.c | 1033 ++ ldap/servers/plugins/replication/tests/dnp_sim2.c | 972 + ldap/servers/plugins/replication/tests/dnp_sim3.c | 1489 ++ ldap/servers/plugins/replication/tests/makesim | 58 + ldap/servers/plugins/replication/urp.c | 1282 ++ ldap/servers/plugins/replication/urp.h | 45 + ldap/servers/plugins/replication/urp_glue.c | 235 + ldap/servers/plugins/replication/urp_tombstone.c | 210 + ldap/servers/plugins/retrocl/Makefile | 135 + ldap/servers/plugins/retrocl/dllmain.c | 90 + ldap/servers/plugins/retrocl/linktest.c | 16 + ldap/servers/plugins/retrocl/retrocl.c | 341 + ldap/servers/plugins/retrocl/retrocl.def | 15 + ldap/servers/plugins/retrocl/retrocl.h | 123 + ldap/servers/plugins/retrocl/retrocl.txt | 107 + ldap/servers/plugins/retrocl/retrocl_cn.c | 391 + ldap/servers/plugins/retrocl/retrocl_create.c | 317 + ldap/servers/plugins/retrocl/retrocl_po.c | 529 + ldap/servers/plugins/retrocl/retrocl_rootdse.c | 64 + ldap/servers/plugins/retrocl/retrocl_trim.c | 505 + ldap/servers/plugins/rever/Makefile | 111 + ldap/servers/plugins/rever/des.c | 465 + ldap/servers/plugins/rever/dllmain.c | 91 + ldap/servers/plugins/rever/libdes.def | 13 + ldap/servers/plugins/rever/rever.c | 77 + ldap/servers/plugins/rever/rever.h | 34 + ldap/servers/plugins/roles/Makefile | 95 + ldap/servers/plugins/roles/dllmain.c | 96 + ldap/servers/plugins/roles/roles.def | 10 + ldap/servers/plugins/roles/roles_cache.c | 2061 +++ ldap/servers/plugins/roles/roles_cache.h | 52 + ldap/servers/plugins/roles/roles_plugin.c | 254 + ldap/servers/plugins/shared/Makefile | 56 + ldap/servers/plugins/shared/plugin-utils.h | 77 + ldap/servers/plugins/shared/utils.c | 467 + ldap/servers/plugins/statechange/Makefile | 78 + ldap/servers/plugins/statechange/dllmain.c | 96 + ldap/servers/plugins/statechange/statechange.c | 450 + ldap/servers/plugins/statechange/statechange.def | 10 + ldap/servers/plugins/syntaxes/Makefile | 87 + ldap/servers/plugins/syntaxes/bin.c | 201 + ldap/servers/plugins/syntaxes/ces.c | 168 + ldap/servers/plugins/syntaxes/cis.c | 298 + ldap/servers/plugins/syntaxes/debug.c | 20 + ldap/servers/plugins/syntaxes/dllmain.c | 133 + ldap/servers/plugins/syntaxes/dn.c | 98 + ldap/servers/plugins/syntaxes/int.c | 188 + ldap/servers/plugins/syntaxes/libsyntax.def | 24 + ldap/servers/plugins/syntaxes/phonetic.c | 461 + ldap/servers/plugins/syntaxes/sicis.c | 139 + ldap/servers/plugins/syntaxes/string.c | 612 + ldap/servers/plugins/syntaxes/syntax.h | 42 + ldap/servers/plugins/syntaxes/tel.c | 135 + ldap/servers/plugins/syntaxes/value.c | 209 + ldap/servers/plugins/uiduniq/7bit.c | 722 + ldap/servers/plugins/uiduniq/Makefile | 99 + ldap/servers/plugins/uiduniq/UID-Notes | 93 + ldap/servers/plugins/uiduniq/libuiduniq.def | 15 + ldap/servers/plugins/uiduniq/uid.c | 1073 ++ ldap/servers/plugins/vattrsp_template/Makefile | 79 + ldap/servers/plugins/vattrsp_template/dllmain.c | 96 + ldap/servers/plugins/vattrsp_template/vattrsp.c | 397 + ldap/servers/plugins/vattrsp_template/vattrsp.def | 10 + ldap/servers/plugins/views/Makefile | 79 + ldap/servers/plugins/views/dllmain.c | 96 + ldap/servers/plugins/views/views.c | 1779 ++ ldap/servers/plugins/views/views.def | 10 + ldap/servers/slapd/Makefile | 278 + ldap/servers/slapd/abandon.c | 141 + ldap/servers/slapd/add.c | 781 + ldap/servers/slapd/agtmmap.c | 330 + ldap/servers/slapd/agtmmap.h | 191 + ldap/servers/slapd/apibroker.c | 245 + ldap/servers/slapd/attr.c | 849 + ldap/servers/slapd/attrlist.c | 253 + ldap/servers/slapd/attrsyntax.c | 906 + ldap/servers/slapd/auditlog.c | 217 + ldap/servers/slapd/auth.c | 506 + ldap/servers/slapd/auth.h | 15 + ldap/servers/slapd/ava.c | 129 + ldap/servers/slapd/back-ldbm/Makefile | 190 + ldap/servers/slapd/back-ldbm/ancestorid.c | 747 + ldap/servers/slapd/back-ldbm/archive.c | 332 + ldap/servers/slapd/back-ldbm/attrcrypt.h | 33 + ldap/servers/slapd/back-ldbm/back-ldbm.h | 629 + ldap/servers/slapd/back-ldbm/backentry.c | 89 + ldap/servers/slapd/back-ldbm/cache.c | 1195 ++ ldap/servers/slapd/back-ldbm/cleanup.c | 51 + ldap/servers/slapd/back-ldbm/close.c | 52 + ldap/servers/slapd/back-ldbm/dblayer.c | 5395 ++++++ ldap/servers/slapd/back-ldbm/dblayer.h | 140 + ldap/servers/slapd/back-ldbm/dbsize.c | 25 + ldap/servers/slapd/back-ldbm/dbtest.c | 312 + ldap/servers/slapd/back-ldbm/dbversion.c | 181 + ldap/servers/slapd/back-ldbm/dllmain.c | 128 + ldap/servers/slapd/back-ldbm/dn2entry.c | 230 + ldap/servers/slapd/back-ldbm/entrystore.c | 12 + ldap/servers/slapd/back-ldbm/filterindex.c | 830 + ldap/servers/slapd/back-ldbm/findentry.c | 284 + ldap/servers/slapd/back-ldbm/haschildren.c | 8 + ldap/servers/slapd/back-ldbm/id2entry.c | 250 + ldap/servers/slapd/back-ldbm/idl.c | 1599 ++ ldap/servers/slapd/back-ldbm/idl_common.c | 402 + ldap/servers/slapd/back-ldbm/idl_new.c | 671 + ldap/servers/slapd/back-ldbm/idl_shim.c | 124 + ldap/servers/slapd/back-ldbm/idlapi.h | 30 + ldap/servers/slapd/back-ldbm/import-merge.c | 680 + ldap/servers/slapd/back-ldbm/import-threads.c | 1992 +++ ldap/servers/slapd/back-ldbm/import.c | 1465 ++ ldap/servers/slapd/back-ldbm/import.h | 199 + ldap/servers/slapd/back-ldbm/index.c | 1852 ++ ldap/servers/slapd/back-ldbm/init.c | 255 + ldap/servers/slapd/back-ldbm/instance.c | 353 + ldap/servers/slapd/back-ldbm/ldbm_abandon.c | 14 + ldap/servers/slapd/back-ldbm/ldbm_add.c | 880 + ldap/servers/slapd/back-ldbm/ldbm_attr.c | 635 + ldap/servers/slapd/back-ldbm/ldbm_attrcrypt.c | 870 + .../slapd/back-ldbm/ldbm_attrcrypt_config.c | 298 + ldap/servers/slapd/back-ldbm/ldbm_bind.c | 245 + ldap/servers/slapd/back-ldbm/ldbm_compare.c | 77 + ldap/servers/slapd/back-ldbm/ldbm_config.c | 1730 ++ ldap/servers/slapd/back-ldbm/ldbm_config.h | 133 + ldap/servers/slapd/back-ldbm/ldbm_delete.c | 633 + ldap/servers/slapd/back-ldbm/ldbm_index_config.c | 698 + .../servers/slapd/back-ldbm/ldbm_instance_config.c | 997 ++ ldap/servers/slapd/back-ldbm/ldbm_modify.c | 567 + ldap/servers/slapd/back-ldbm/ldbm_modrdn.c | 1403 ++ ldap/servers/slapd/back-ldbm/ldbm_search.c | 1345 ++ ldap/servers/slapd/back-ldbm/ldbm_unbind.c | 14 + ldap/servers/slapd/back-ldbm/ldif2ldbm.c | 2440 +++ ldap/servers/slapd/back-ldbm/libback-ldbm.def | 13 + ldap/servers/slapd/back-ldbm/matchrule.c | 126 + ldap/servers/slapd/back-ldbm/misc.c | 356 + ldap/servers/slapd/back-ldbm/monitor.c | 274 + ldap/servers/slapd/back-ldbm/nextid.c | 204 + ldap/servers/slapd/back-ldbm/parents.c | 105 + ldap/servers/slapd/back-ldbm/perfctrs.c | 444 + ldap/servers/slapd/back-ldbm/perfctrs.h | 51 + ldap/servers/slapd/back-ldbm/proto-back-ldbm.h | 582 + ldap/servers/slapd/back-ldbm/rmdb.c | 54 + ldap/servers/slapd/back-ldbm/seq.c | 262 + ldap/servers/slapd/back-ldbm/sort.c | 1031 ++ ldap/servers/slapd/back-ldbm/start.c | 177 + .../slapd/back-ldbm/tools/index_dump/Makefile | 40 + .../slapd/back-ldbm/tools/index_dump/index_dump.c | 206 + ldap/servers/slapd/back-ldbm/uniqueid2entry.c | 74 + ldap/servers/slapd/back-ldbm/upgrade.c | 352 + ldap/servers/slapd/back-ldbm/vlv.c | 1947 ++ ldap/servers/slapd/back-ldbm/vlv_key.c | 69 + ldap/servers/slapd/back-ldbm/vlv_key.h | 22 + ldap/servers/slapd/back-ldbm/vlv_srch.c | 901 + ldap/servers/slapd/back-ldbm/vlv_srch.h | 134 + ldap/servers/slapd/back-ldif/Makefile | 81 + ldap/servers/slapd/back-ldif/add.c | 189 + ldap/servers/slapd/back-ldif/back-ldif.h | 94 + ldap/servers/slapd/back-ldif/bind.c | 108 + ldap/servers/slapd/back-ldif/close.c | 79 + ldap/servers/slapd/back-ldif/compare.c | 82 + ldap/servers/slapd/back-ldif/config.c | 203 + ldap/servers/slapd/back-ldif/delete.c | 136 + ldap/servers/slapd/back-ldif/dllmain.c | 132 + ldap/servers/slapd/back-ldif/init.c | 114 + ldap/servers/slapd/back-ldif/libback-ldif.def | 12 + ldap/servers/slapd/back-ldif/modify.c | 557 + ldap/servers/slapd/back-ldif/modrdn.c | 282 + ldap/servers/slapd/back-ldif/monitor.c | 124 + ldap/servers/slapd/back-ldif/search.c | 197 + ldap/servers/slapd/back-ldif/start.c | 31 + ldap/servers/slapd/back-ldif/unbind.c | 27 + ldap/servers/slapd/backend.c | 505 + ldap/servers/slapd/backend_manager.c | 770 + ldap/servers/slapd/bind.c | 710 + ldap/servers/slapd/bitset.c | 47 + ldap/servers/slapd/bulk_import.c | 149 + ldap/servers/slapd/ch_malloc.c | 657 + ldap/servers/slapd/charray.c | 354 + ldap/servers/slapd/compare.c | 153 + ldap/servers/slapd/computed.c | 208 + ldap/servers/slapd/config.c | 459 + ldap/servers/slapd/configdse.c | 515 + ldap/servers/slapd/connection.c | 2485 +++ ldap/servers/slapd/conntable.c | 515 + ldap/servers/slapd/control.c | 592 + ldap/servers/slapd/counters.c | 151 + ldap/servers/slapd/csn.c | 383 + ldap/servers/slapd/csngen.c | 762 + ldap/servers/slapd/csngen.h | 27 + ldap/servers/slapd/csnset.c | 360 + ldap/servers/slapd/daemon.c | 2694 +++ ldap/servers/slapd/defbackend.c | 200 + ldap/servers/slapd/delete.c | 324 + ldap/servers/slapd/detach.c | 244 + ldap/servers/slapd/disconnect_error_strings.h | 30 + ldap/servers/slapd/disconnect_errors.h | 32 + ldap/servers/slapd/dl.c | 219 + ldap/servers/slapd/dn.c | 1469 ++ ldap/servers/slapd/dse.c | 2304 +++ ldap/servers/slapd/dynalib.c | 86 + ldap/servers/slapd/entry.c | 3124 ++++ ldap/servers/slapd/entrywsi.c | 1151 ++ ldap/servers/slapd/errormap.c | 186 + ldap/servers/slapd/eventq.c | 482 + ldap/servers/slapd/extendop.c | 297 + ldap/servers/slapd/factory.c | 458 + ldap/servers/slapd/fe.h | 159 + ldap/servers/slapd/fedse.c | 1886 ++ ldap/servers/slapd/fileio.c | 336 + ldap/servers/slapd/filter.c | 1505 ++ ldap/servers/slapd/filter.h | 33 + ldap/servers/slapd/filtercmp.c | 402 + ldap/servers/slapd/filterentry.c | 1000 ++ ldap/servers/slapd/generation.c | 140 + ldap/servers/slapd/getfilelist.c | 233 + ldap/servers/slapd/getopt_ext.c | 236 + ldap/servers/slapd/getopt_ext.h | 111 + ldap/servers/slapd/globals.c | 142 + ldap/servers/slapd/house.c | 91 + ldap/servers/slapd/http.h | 43 + ldap/servers/slapd/index_subsys.h | 47 + ldap/servers/slapd/index_subsystem.c | 1286 ++ ldap/servers/slapd/init.c | 63 + ldap/servers/slapd/intrinsics.h | 112 + ldap/servers/slapd/ldbmlinktest.c | 38 + ldap/servers/slapd/lenstr.c | 80 + ldap/servers/slapd/libglobs.c | 4051 +++++ ldap/servers/slapd/libmakefile | 174 + ldap/servers/slapd/libsh_stub/Makefile | 63 + ldap/servers/slapd/libsh_stub/libsh_stub.c | 7 + ldap/servers/slapd/libslapd.def | 1147 ++ ldap/servers/slapd/listConfigAttrs.pl | 106 + ldap/servers/slapd/lite_entries.c | 106 + ldap/servers/slapd/localhost.c | 228 + ldap/servers/slapd/lock.c | 82 + ldap/servers/slapd/log.c | 3664 ++++ ldap/servers/slapd/log.h | 186 + ldap/servers/slapd/main.c | 2753 +++ ldap/servers/slapd/mapping_tree.c | 3436 ++++ ldap/servers/slapd/match.c | 237 + ldap/servers/slapd/mkDBErrStrs.pl | 83 + ldap/servers/slapd/modify.c | 966 + ldap/servers/slapd/modrdn.c | 501 + ldap/servers/slapd/modutil.c | 774 + ldap/servers/slapd/monitor.c | 176 + ldap/servers/slapd/ntmsgdll/Makefile | 62 + ldap/servers/slapd/ntmsgdll/ntslapdmessages.c | 16 + ldap/servers/slapd/ntmsgdll/ntslapdmessages.mc | 283 + ldap/servers/slapd/ntperfdll/Makefile | 52 + ldap/servers/slapd/ntperfdll/exports.def | 9 + ldap/servers/slapd/ntperfdll/nsldapctr.cpp | 985 ++ ldap/servers/slapd/ntperfdll/nsldapctrdef.h | 33 + ldap/servers/slapd/ntperfdll/nsldapctrmc.h | 122 + ldap/servers/slapd/ntperfdll/nsldapctrmc.mc | 74 + ldap/servers/slapd/ntperfdll/nsldapctrmsg.h | 60 + ldap/servers/slapd/ntperfdll/nsldapctrs.h | 67 + ldap/servers/slapd/ntperfdll/nsldapctrs.ini | 57 + ldap/servers/slapd/ntperfdll/nsldapctrutil.cpp | 364 + ldap/servers/slapd/ntperfdll/nsldapctrutil.h | 120 + ldap/servers/slapd/ntperfdll/nsldapreg.ini | 18 + ldap/servers/slapd/ntuserpin.c | 178 + ldap/servers/slapd/ntwdog/Makefile | 60 + ldap/servers/slapd/ntwdog/cron_conf.c | 654 + ldap/servers/slapd/ntwdog/cron_conf.h | 86 + ldap/servers/slapd/ntwdog/ntcron.c | 156 + ldap/servers/slapd/ntwdog/ntwatchdog.c | 1163 ++ ldap/servers/slapd/object.c | 95 + ldap/servers/slapd/objset.c | 380 + ldap/servers/slapd/operation.c | 410 + ldap/servers/slapd/opshared.c | 1163 ++ ldap/servers/slapd/pblock.c | 2930 +++ ldap/servers/slapd/plugin.c | 2833 +++ ldap/servers/slapd/plugin_acl.c | 192 + ldap/servers/slapd/plugin_internal_op.c | 864 + ldap/servers/slapd/plugin_mr.c | 181 + ldap/servers/slapd/plugin_role.c | 30 + ldap/servers/slapd/plugin_syntax.c | 360 + ldap/servers/slapd/poll_using_select.c | 122 + ldap/servers/slapd/poll_using_select.h | 43 + ldap/servers/slapd/prerrstrs.h | 121 + ldap/servers/slapd/protect_db.c | 758 + ldap/servers/slapd/protect_db.h | 75 + ldap/servers/slapd/proto-slap.h | 1163 ++ ldap/servers/slapd/psearch.c | 723 + ldap/servers/slapd/pw.c | 1540 ++ ldap/servers/slapd/pw.h | 70 + ldap/servers/slapd/pw_mgmt.c | 398 + ldap/servers/slapd/pw_retry.c | 253 + ldap/servers/slapd/rdn.c | 410 + ldap/servers/slapd/referral.c | 1205 ++ ldap/servers/slapd/regex.c | 1045 ++ ldap/servers/slapd/resourcelimit.c | 653 + ldap/servers/slapd/result.c | 1794 ++ ldap/servers/slapd/rootdse.c | 331 + ldap/servers/slapd/rwlock.c | 222 + ldap/servers/slapd/rwlock.h | 28 + ldap/servers/slapd/sasl_io.c | 334 + ldap/servers/slapd/sasl_map.c | 472 + ldap/servers/slapd/saslbind.c | 908 + ldap/servers/slapd/schema.c | 4664 +++++ ldap/servers/slapd/schemaparse.c | 262 + ldap/servers/slapd/search.c | 283 + ldap/servers/slapd/secerrstrs.h | 431 + ldap/servers/slapd/security_wrappers.c | 339 + ldap/servers/slapd/slap.h | 1944 ++ ldap/servers/slapd/slapd.lite.key | 8 + ldap/servers/slapd/slapd.normal.key | 9 + ldap/servers/slapd/slapd_plhash.c | 59 + ldap/servers/slapd/slapi-plugin-compat4.h | 132 + ldap/servers/slapd/slapi-plugin.h | 1652 ++ ldap/servers/slapd/slapi-private.h | 1212 ++ ldap/servers/slapd/slapi2nspr.c | 274 + ldap/servers/slapd/snmp_collator.c | 617 + ldap/servers/slapd/snmp_collator.h | 15 + ldap/servers/slapd/snoop.c | 39 + ldap/servers/slapd/ssl.c | 1499 ++ ldap/servers/slapd/sslerrstrs.h | 355 + ldap/servers/slapd/start_tls_extop.c | 479 + ldap/servers/slapd/statechange.h | 47 + ldap/servers/slapd/str2filter.c | 380 + ldap/servers/slapd/strdup.c | 25 + ldap/servers/slapd/stubrepl.c | 42 + ldap/servers/slapd/stubs.c | 36 + ldap/servers/slapd/subentry.c | 56 + ldap/servers/slapd/task.c | 1703 ++ ldap/servers/slapd/tempnam.c | 44 + ldap/servers/slapd/test-plugins/Makefile | 51 + ldap/servers/slapd/test-plugins/Makefile.AIX | 36 + ldap/servers/slapd/test-plugins/Makefile.BSDI | 31 + ldap/servers/slapd/test-plugins/Makefile.HPUX | 25 + ldap/servers/slapd/test-plugins/Makefile.HPUX64 | 24 + ldap/servers/slapd/test-plugins/Makefile.IRIX | 31 + ldap/servers/slapd/test-plugins/Makefile.Linux | 31 + ldap/servers/slapd/test-plugins/Makefile.OSF1 | 30 + .../slapd/test-plugins/Makefile.ReliantUNIX | 31 + ldap/servers/slapd/test-plugins/Makefile.SOLARIS | 28 + ldap/servers/slapd/test-plugins/Makefile.SOLARIS64 | 28 + .../servers/slapd/test-plugins/Makefile.SOLARISx86 | 31 + ldap/servers/slapd/test-plugins/Makefile.UnixWare | 31 + .../slapd/test-plugins/Makefile.UnixWareUDK | 31 + ldap/servers/slapd/test-plugins/Makefile.WINNT | 45 + ldap/servers/slapd/test-plugins/Makefile.server | 107 + ldap/servers/slapd/test-plugins/README | 149 + ldap/servers/slapd/test-plugins/clients/README | 45 + .../slapd/test-plugins/clients/ReqExtOp.java | 77 + ldap/servers/slapd/test-plugins/clients/reqextop.c | 85 + ldap/servers/slapd/test-plugins/dllmain.c | 109 + ldap/servers/slapd/test-plugins/installDse.pl | 129 + ldap/servers/slapd/test-plugins/nicknames | 10 + ldap/servers/slapd/test-plugins/testbind.c | 252 + ldap/servers/slapd/test-plugins/testdatainterop.c | 312 + ldap/servers/slapd/test-plugins/testdbinterop.c | 102 + ldap/servers/slapd/test-plugins/testdbinterop.h | 22 + ldap/servers/slapd/test-plugins/testentry.c | 133 + ldap/servers/slapd/test-plugins/testextendedop.c | 188 + ldap/servers/slapd/test-plugins/testgetip.c | 141 + ldap/servers/slapd/test-plugins/testplugin.def | 16 + ldap/servers/slapd/test-plugins/testplugin.dsp | 143 + ldap/servers/slapd/test-plugins/testplugin.mak | 431 + ldap/servers/slapd/test-plugins/testpostop.c | 386 + ldap/servers/slapd/test-plugins/testpreop.c | 215 + ldap/servers/slapd/test-plugins/testsaslbind.c | 145 + ldap/servers/slapd/time.c | 367 + ldap/servers/slapd/tools/Makefile | 168 + ldap/servers/slapd/tools/eggencode.c | 57 + ldap/servers/slapd/tools/keyupg.c | 85 + ldap/servers/slapd/tools/ldif.c | 128 + ldap/servers/slapd/tools/migratecred.c | 154 + ldap/servers/slapd/tools/mkdep.c | 335 + ldap/servers/slapd/tools/mmldif.c | 1742 ++ ldap/servers/slapd/tools/pwenc.c | 400 + ldap/servers/slapd/unbind.c | 83 + ldap/servers/slapd/uniqueid.c | 295 + ldap/servers/slapd/uniqueidgen.c | 219 + ldap/servers/slapd/utf8compare.c | 2287 +++ ldap/servers/slapd/util.c | 601 + ldap/servers/slapd/uuid.c | 893 + ldap/servers/slapd/uuid.h | 116 + ldap/servers/slapd/value.c | 460 + ldap/servers/slapd/valueset.c | 1303 ++ ldap/servers/slapd/vattr.c | 2387 +++ ldap/servers/slapd/vattr_spi.h | 54 + ldap/servers/slapd/views.h | 29 + ldap/servers/snmp/Makefile | 91 + ldap/servers/snmp/NETWORK-SERVICES-MIB.txt | 650 + ldap/servers/snmp/RFC-1215.txt | 38 + ldap/servers/snmp/RFC1155-SMI.txt | 119 + ldap/servers/snmp/SNMPv2-CONF.txt | 322 + ldap/servers/snmp/SNMPv2-SMI.txt | 344 + ldap/servers/snmp/SNMPv2-TC.txt | 772 + ldap/servers/snmp/netscape-ldap.mib | 727 + ldap/servers/snmp/ntagt/Makefile | 103 + ldap/servers/snmp/ntagt/msrvdefs.mak | 492 + ldap/servers/snmp/ntagt/nslagtcom_nt.h | 32 + ldap/servers/snmp/ntagt/nsldapagt_nt.c | 1738 ++ ldap/servers/snmp/ntagt/nsldapagt_nt.def | 24 + ldap/servers/snmp/ntagt/nsldapagt_nt.h | 228 + ldap/servers/snmp/ntagt/nsldapmib_nt.c | 1041 ++ ldap/servers/snmp/ntagt/nsldapmib_nt.h | 130 + ldap/systools/Makefile | 96 + ldap/systools/README | 31 + ldap/systools/getHPPatches.pl | 83 + ldap/systools/getSolPatches.pl | 64 + ldap/systools/hp_patches.c | 5 + ldap/systools/idsktune.c | 3279 ++++ ldap/systools/mergeSolPatches.pl | 57 + ldap/systools/pio.c | 94 + ldap/systools/pio.h | 32 + ldap/systools/sol_patches.c | 271 + ldap/systools/viewcore.c | 464 + lib/base/Makefile | 111 + lib/base/crit.cpp | 399 + lib/base/dns.cpp | 176 + lib/base/dnsdmain.cpp | 159 + lib/base/ereport.cpp | 249 + lib/base/eventlog.cpp | 70 + lib/base/file.cpp | 702 + lib/base/fsmutex.cpp | 187 + lib/base/lexer.cpp | 978 ++ lib/base/lexer_pvt.h | 30 + lib/base/net.cpp | 578 + lib/base/nscperror.c | 162 + lib/base/nterrors.cpp | 83 + lib/base/plist.cpp | 1154 ++ lib/base/plist_pvt.h | 122 + lib/base/pool.cpp | 654 + lib/base/rwlock.cpp | 131 + lib/base/shexp.cpp | 290 + lib/base/shmem.cpp | 127 + lib/base/system.cpp | 264 + lib/base/systhr.cpp | 256 + lib/base/util.cpp | 1449 ++ lib/ldaputil/Makefile | 65 + lib/ldaputil/cert.c | 452 + lib/ldaputil/certmap.c | 1950 ++ lib/ldaputil/certmap.conf | 48 + lib/ldaputil/dbconf.c | 704 + lib/ldaputil/encode.c | 142 + lib/ldaputil/errors.c | 202 + lib/ldaputil/examples/Certmap.mak | 254 + lib/ldaputil/examples/Makefile | 91 + lib/ldaputil/examples/README | 97 + lib/ldaputil/examples/init.c | 40 + lib/ldaputil/examples/plugin.c | 239 + lib/ldaputil/examples/plugin.h | 33 + lib/ldaputil/init.c | 185 + lib/ldaputil/ldapauth.c | 1099 ++ lib/ldaputil/ldapdb.c | 583 + lib/ldaputil/ldapu-changes.html | 403 + lib/ldaputil/ldaputili.h | 62 + lib/ldaputil/utest/Makefile | 117 + lib/ldaputil/utest/auth.cpp | 574 + lib/ldaputil/utest/authtest | 106 + lib/ldaputil/utest/certmap.conf | 36 + lib/ldaputil/utest/dblist.conf | 15 + lib/ldaputil/utest/example.c | 116 + lib/ldaputil/utest/plugin.c | 115 + lib/ldaputil/utest/plugin.h | 20 + lib/ldaputil/utest/stubs.c | 107 + lib/ldaputil/utest/stubs.cpp | 102 + lib/ldaputil/utest/test.ref | 448 + lib/ldaputil/vtable.c | 427 + lib/libaccess/Makefile | 176 + lib/libaccess/access_plhash.cpp | 65 + lib/libaccess/access_plhash.h | 17 + lib/libaccess/acl.tab.cpp | 1718 ++ lib/libaccess/acl.tab.h | 44 + lib/libaccess/acl.yy.cpp | 1995 +++ lib/libaccess/aclbuild.cpp | 1360 ++ lib/libaccess/aclcache.cpp | 579 + lib/libaccess/aclcache.h | 27 + lib/libaccess/aclerror.cpp | 246 + lib/libaccess/acleval.cpp | 556 + lib/libaccess/aclflush.cpp | 178 + lib/libaccess/aclparse.cpp | 2241 +++ lib/libaccess/aclpriv.h | 171 + lib/libaccess/aclscan.h | 25 + lib/libaccess/aclscan.l | 379 + lib/libaccess/aclspace.cpp | 37 + lib/libaccess/acltext.y | 957 + lib/libaccess/acltools.cpp | 3457 ++++ lib/libaccess/aclutil.cpp | 223 + lib/libaccess/aclutil.h | 25 + lib/libaccess/attrec.cpp | 309 + lib/libaccess/authdb.cpp | 339 + lib/libaccess/avadb.c | 300 + lib/libaccess/avaparse.y | 140 + lib/libaccess/avapfile.c | 428 + lib/libaccess/avascan.l | 106 + lib/libaccess/las.h | 53 + lib/libaccess/lasdns.cpp | 373 + lib/libaccess/lasdns.h | 10 + lib/libaccess/lasgroup.cpp | 164 + lib/libaccess/lasip.cpp | 487 + lib/libaccess/lasip.h | 13 + lib/libaccess/lastod.cpp | 170 + lib/libaccess/lasuser.cpp | 154 + lib/libaccess/lcache.h | 23 + lib/libaccess/ldapacl.cpp | 822 + lib/libaccess/ldapauth.h | 42 + lib/libaccess/leval.h | 18 + lib/libaccess/lparse.h | 27 + lib/libaccess/method.cpp | 163 + lib/libaccess/nsadb.cpp | 582 + lib/libaccess/nsamgmt.cpp | 1567 ++ lib/libaccess/nsautherr.cpp | 126 + lib/libaccess/nscert.cpp | 963 + lib/libaccess/nsdb.cpp | 836 + lib/libaccess/nsdbmgmt.cpp | 685 + lib/libaccess/nseframe.cpp | 207 + lib/libaccess/nsgmgmt.cpp | 434 + lib/libaccess/nsgroup.cpp | 336 + lib/libaccess/nslock.cpp | 268 + lib/libaccess/nsumgmt.cpp | 456 + lib/libaccess/nsuser.cpp | 309 + lib/libaccess/oneeval.cpp | 1054 ++ lib/libaccess/oneeval.h | 17 + lib/libaccess/parse.h | 21 + lib/libaccess/permhash.h | 79 + lib/libaccess/register.cpp | 821 + lib/libaccess/register.h | 98 + lib/libaccess/symbols.cpp | 350 + lib/libaccess/userauth.cpp | 12 + lib/libaccess/usi.cpp | 371 + lib/libaccess/usrcache.cpp | 657 + lib/libaccess/utest.mk | 61 + lib/libaccess/utest/.purify | 19 + lib/libaccess/utest/Makefile | 119 + lib/libaccess/utest/acl.dat | 12 + lib/libaccess/utest/aclfile0 | 55 + lib/libaccess/utest/aclfile1 | 11 + lib/libaccess/utest/aclfile10 | 13 + lib/libaccess/utest/aclfile11 | 11 + lib/libaccess/utest/aclfile12 | 11 + lib/libaccess/utest/aclfile13 | 11 + lib/libaccess/utest/aclfile14 | 11 + lib/libaccess/utest/aclfile15 | 11 + lib/libaccess/utest/aclfile16 | 11 + lib/libaccess/utest/aclfile17 | 11 + lib/libaccess/utest/aclfile18 | 19 + lib/libaccess/utest/aclfile19 | 14 + lib/libaccess/utest/aclfile2 | 11 + lib/libaccess/utest/aclfile3 | 11 + lib/libaccess/utest/aclfile4 | 11 + lib/libaccess/utest/aclfile5 | 11 + lib/libaccess/utest/aclfile6 | 23 + lib/libaccess/utest/aclfile7 | 11 + lib/libaccess/utest/aclfile8 | 11 + lib/libaccess/utest/aclfile9 | 11 + lib/libaccess/utest/aclgrp0 | 10 + lib/libaccess/utest/aclgrp1 | 10 + lib/libaccess/utest/aclgrp2 | 10 + lib/libaccess/utest/aclgrp3 | 10 + lib/libaccess/utest/aclgrp4 | 10 + lib/libaccess/utest/acltest.cpp | 796 + lib/libaccess/utest/lasemail.cpp | 180 + lib/libaccess/utest/onetest.cpp | 47 + lib/libaccess/utest/shexp.cpp | 294 + lib/libaccess/utest/shexp.h | 131 + lib/libaccess/utest/test.ref | 234 + lib/libaccess/utest/testmain.cpp | 52 + lib/libaccess/utest/twotest.cpp | 57 + lib/libaccess/utest/ustubs.cpp | 283 + lib/libaccess/winnt.l | 762 + lib/libaccess/winnt.v | 156 + lib/libaccess/winnt.y | 793 + lib/libaccess/wintab.h | 26 + lib/libaccess/yy-sed | 21 + lib/libadmin/Makefile | 61 + lib/libadmin/authdb.c | 2467 +++ lib/libadmin/error.c | 109 + lib/libadmin/strlist.c | 46 + lib/libadmin/template.c | 820 + lib/libadmin/util.c | 1340 ++ lib/libnt/Makefile | 27 + lib/libnt/info.c | 81 + lib/libnt/path.c | 266 + lib/libnt/pmddeml.c | 375 + lib/libnt/registry.c | 242 + lib/libnt/service.c | 375 + lib/libnt/tcpip.c | 145 + lib/libsi18n/Makefile | 155 + lib/libsi18n/acclanglist.c | 187 + lib/libsi18n/coreres.c | 113 + lib/libsi18n/coreres.h | 15 + lib/libsi18n/getlang.c | 294 + lib/libsi18n/getstrmem.c | 123 + lib/libsi18n/getstrmem.h | 1156 ++ lib/libsi18n/getstrprop.c | 137 + lib/libsi18n/gsslapd.h | 37 + lib/libsi18n/makstrdb.c | 221 + lib/libsi18n/propset.c | 404 + lib/libsi18n/propset.h | 43 + lib/libsi18n/reshash.c | 264 + lib/libsi18n/reshash.h | 54 + lib/libsi18n/txtfile.c | 130 + lib/libsi18n/txtfile.h | 45 + modules.awk | 451 + modules.sh | 79 + ns_usedb.mk | 153 + ns_usepurify.mk | 20 + ns_usequantify.mk | 18 + ns_usesh.mk | 138 + nsarch | 812 + nsarch.bat | 8 + nsconfig.mk | 1448 ++ nscore.mk | 78 + nsdefs.mk | 245 + nsperl.mk | 88 + ntversion.pl | 34 + pumpkin.pl | 15 + 2095 files changed, 626140 insertions(+) create mode 100644 Makefile create mode 100644 bchecker.ini create mode 100755 buildnum.pl create mode 100644 component_versions.mk create mode 100644 components.mk create mode 100644 config/.cvsignore create mode 100644 config/Linux2.4.mk create mode 100644 config/Linux2.6.mk create mode 100644 config/Makefile create mode 100644 config/SunOS5.8.mk create mode 100644 config/SunOS5.8_i86pc.mk create mode 100644 config/SunOS5.9.mk create mode 100644 config/UNIX.mk create mode 100644 config/WINNT5.0.mk create mode 100644 config/common.mn create mode 100644 config/config.mk create mode 100644 config/nfspwd.pl create mode 100644 config/nsinstall.c create mode 100644 config/pathsub.c create mode 100644 config/pathsub.h create mode 100644 config/revdepth-nt.pl create mode 100644 config/revdepth.pl create mode 100644 config/rules.mk create mode 100644 config/webint.mk create mode 100755 dirver.pl create mode 100755 httpd/autobuild create mode 100644 httpd/src/Makefile create mode 100644 httpd/src/ntnsapi.c create mode 100644 httpd/src/unixso.exp create mode 100644 httpd/src/unixso.mk create mode 100644 include/Makefile create mode 100644 include/base/Makefile create mode 100644 include/base/crit.h create mode 100644 include/base/dbtbase.h create mode 100644 include/base/ereport.h create mode 100644 include/base/eventhandler.h create mode 100644 include/base/eventlog.h create mode 100644 include/base/file.h create mode 100644 include/base/fsmutex.h create mode 100644 include/base/lexer.h create mode 100644 include/base/nterr.h create mode 100644 include/base/nterrors.h create mode 100644 include/base/plist.h create mode 100644 include/base/pool.h create mode 100644 include/base/rwlock.h create mode 100644 include/base/shexp.h create mode 100644 include/base/systems.h create mode 100644 include/base/systhr.h create mode 100644 include/base/util.h create mode 100644 include/copyrght.h create mode 100644 include/i18n.h create mode 100644 include/ldaputil/cert.h create mode 100644 include/ldaputil/certmap.h create mode 100644 include/ldaputil/dbconf.h create mode 100644 include/ldaputil/encode.h create mode 100644 include/ldaputil/errors.h create mode 100644 include/ldaputil/extcmap.h create mode 100644 include/ldaputil/init.h create mode 100644 include/ldaputil/ldapauth.h create mode 100644 include/ldaputil/ldapdb.h create mode 100644 include/ldaputil/ldaputil.h create mode 100644 include/libaccess/acl.h create mode 100644 include/libaccess/acladmin.h create mode 100644 include/libaccess/aclbuild.h create mode 100644 include/libaccess/aclerror.h create mode 100644 include/libaccess/acleval.h create mode 100644 include/libaccess/aclglobal.h create mode 100644 include/libaccess/aclparse.h create mode 100644 include/libaccess/aclproto.h create mode 100644 include/libaccess/aclstruct.h create mode 100644 include/libaccess/attrec.h create mode 100644 include/libaccess/authdb.h create mode 100644 include/libaccess/ava.h create mode 100644 include/libaccess/avadb.h create mode 100644 include/libaccess/avapfile.h create mode 100644 include/libaccess/dbtlibaccess.h create mode 100644 include/libaccess/dnfstruct.h create mode 100644 include/libaccess/ipfstruct.h create mode 100644 include/libaccess/las.h create mode 100644 include/libaccess/ldapacl.h create mode 100644 include/libaccess/nsadb.h create mode 100644 include/libaccess/nsamgmt.h create mode 100644 include/libaccess/nsauth.h create mode 100644 include/libaccess/nsautherr.h create mode 100644 include/libaccess/nscert.h create mode 100644 include/libaccess/nsdb.h create mode 100644 include/libaccess/nsdberr.h create mode 100644 include/libaccess/nsdbmgmt.h create mode 100644 include/libaccess/nserror.h create mode 100644 include/libaccess/nsgmgmt.h create mode 100644 include/libaccess/nsgroup.h create mode 100644 include/libaccess/nslock.h create mode 100644 include/libaccess/nsumgmt.h create mode 100644 include/libaccess/nsuser.h create mode 100644 include/libaccess/register.h create mode 100644 include/libaccess/stubs.h create mode 100644 include/libaccess/symbols.h create mode 100644 include/libaccess/userauth.h create mode 100644 include/libaccess/usi.h create mode 100644 include/libaccess/usrcache.h create mode 100644 include/libadmin/dbtlibadmin.h create mode 100644 include/libadmin/libadmin.h create mode 100644 include/netsite.h create mode 100644 include/nt/messages.h create mode 100644 include/nt/nsapi.h create mode 100644 include/nt/ntos.h create mode 100644 include/nt/regparms.h create mode 100644 include/nt/resource.h create mode 100644 include/public/Makefile create mode 100644 include/public/base/Makefile create mode 100644 include/public/base/crit.h create mode 100644 include/public/base/ereport.h create mode 100644 include/public/base/file.h create mode 100644 include/public/base/pool.h create mode 100644 include/public/base/shexp.h create mode 100644 include/public/base/systems.h create mode 100644 include/public/base/systhr.h create mode 100644 include/public/base/util.h create mode 100644 include/public/netsite.h create mode 100644 include/public/nsacl/Makefile create mode 100644 include/public/nsacl/aclapi.h create mode 100644 include/public/nsacl/acldef.h create mode 100644 include/public/nsacl/copyrght.h create mode 100644 include/public/nsacl/nserrdef.h create mode 100644 include/public/nsacl/plistdef.h create mode 100644 include/public/nsapi.h create mode 100644 include/version.h create mode 100644 l10n/dirserv/de/ns-slapd.txt create mode 100644 l10n/dirserv/de/ns-slapd.txt.iso8859 create mode 100644 l10n/dirserv/en/ns-slapd.txt create mode 100644 l10n/dirserv/es/ns-slapd.txt create mode 100644 l10n/dirserv/es/ns-slapd.txt.iso8859 create mode 100644 l10n/dirserv/fr/ns-slapd.txt create mode 100644 l10n/dirserv/fr/ns-slapd.txt.iso8859 create mode 100644 l10n/dirserv/ja/ns-slapd.txt create mode 100644 l10n/dirserv/ja/ns-slapd.txt.eucjp create mode 100644 ldap/Makefile create mode 100644 ldap/Makefile.client create mode 100644 ldap/admin/Makefile create mode 100644 ldap/admin/include/Makefile create mode 100644 ldap/admin/include/dsalib.h create mode 100644 ldap/admin/include/dsalib_pw.h create mode 100644 ldap/admin/include/dsalib_schema.h create mode 100644 ldap/admin/include/nterrors.h create mode 100644 ldap/admin/lib/Makefile create mode 100644 ldap/admin/lib/dsalib_conf.c create mode 100644 ldap/admin/lib/dsalib_confs.c create mode 100644 ldap/admin/lib/dsalib_db.c create mode 100644 ldap/admin/lib/dsalib_debug.c create mode 100644 ldap/admin/lib/dsalib_dn.c create mode 100644 ldap/admin/lib/dsalib_filename.c create mode 100644 ldap/admin/lib/dsalib_html.c create mode 100644 ldap/admin/lib/dsalib_ldif.c create mode 100644 ldap/admin/lib/dsalib_location.c create mode 100644 ldap/admin/lib/dsalib_pw.c create mode 100644 ldap/admin/lib/dsalib_tailf.c create mode 100644 ldap/admin/lib/dsalib_updown.c create mode 100644 ldap/admin/lib/dsalib_util.c create mode 100644 ldap/admin/src/AddPerlHeader.pl create mode 100644 ldap/admin/src/Base.def create mode 100644 ldap/admin/src/Base.pm create mode 100644 ldap/admin/src/CGI_ENV create mode 100644 ldap/admin/src/Cgi.pm create mode 100644 ldap/admin/src/CreateInstall.pl create mode 100644 ldap/admin/src/DSAdmin.def create mode 100644 ldap/admin/src/DSAdmin.mk create mode 100644 ldap/admin/src/DSAdmin.pm create mode 100644 ldap/admin/src/DSAdmin.xs create mode 100644 ldap/admin/src/Inf.pm create mode 100644 ldap/admin/src/Makefile create mode 100644 ldap/admin/src/addindex.c create mode 100644 ldap/admin/src/cfg_sspt.c create mode 100644 ldap/admin/src/cfg_sspt.h create mode 100644 ldap/admin/src/configure_instance.cpp create mode 100644 ldap/admin/src/configure_instance.h create mode 100644 ldap/admin/src/create_instance.c create mode 100644 ldap/admin/src/create_instance.h create mode 100644 ldap/admin/src/ds_bak2db.c create mode 100644 ldap/admin/src/ds_db2bak.c create mode 100644 ldap/admin/src/ds_db2ldif.c create mode 100644 ldap/admin/src/ds_ldif2db.c create mode 100644 ldap/admin/src/ds_listdb.c create mode 100644 ldap/admin/src/ds_remove.c create mode 100644 ldap/admin/src/ds_remove_uninst.cpp create mode 100644 ldap/admin/src/ds_remove_uninst.h create mode 100644 ldap/admin/src/ds_rmdb.c create mode 100644 ldap/admin/src/ds_snmpctrl.c create mode 100644 ldap/admin/src/ds_viewlog.pl create mode 100644 ldap/admin/src/getConfigInfo create mode 100755 ldap/admin/src/import2info create mode 100644 ldap/admin/src/init_ds_env.c create mode 100644 ldap/admin/src/init_ds_env.h create mode 100644 ldap/admin/src/install_keywords.h create mode 100644 ldap/admin/src/instindex.cpp create mode 100644 ldap/admin/src/java/com/netscape/xmltools/DSML2LDIF.java create mode 100644 ldap/admin/src/java/com/netscape/xmltools/DSMLReader.java create mode 100644 ldap/admin/src/java/com/netscape/xmltools/DSMLSAXBuilder.java create mode 100644 ldap/admin/src/java/com/netscape/xmltools/DSMLSAXHandler.java create mode 100644 ldap/admin/src/java/com/netscape/xmltools/DSMLWriter.java create mode 100644 ldap/admin/src/java/com/netscape/xmltools/GetOpt.java create mode 100644 ldap/admin/src/java/com/netscape/xmltools/LDIF2DSML.java create mode 100644 ldap/admin/src/java/com/netscape/xmltools/Makefile create mode 100755 ldap/admin/src/java/install create mode 100755 ldap/admin/src/java/mcc create mode 100644 ldap/admin/src/java/mcc.bat create mode 100644 ldap/admin/src/key.rc create mode 100644 ldap/admin/src/latest_file.c create mode 100644 ldap/admin/src/makemccvlvindexes create mode 100644 ldap/admin/src/makevlvindex create mode 100644 ldap/admin/src/makevlvsearch create mode 100644 ldap/admin/src/migrateInstance create mode 100644 ldap/admin/src/migrateLocalDB create mode 100644 ldap/admin/src/migratePwdFile create mode 100644 ldap/admin/src/migrateTo4 create mode 100755 ldap/admin/src/migratedsgw create mode 100644 ldap/admin/src/namegen.c create mode 100644 ldap/admin/src/ns-newpwpolicy.pl create mode 100644 ldap/admin/src/restart.c create mode 100644 ldap/admin/src/script-gen.c create mode 100644 ldap/admin/src/scripts/template-bak2db.pl create mode 100755 ldap/admin/src/scripts/template-cl-dump.pl create mode 100644 ldap/admin/src/scripts/template-db2bak.pl create mode 100644 ldap/admin/src/scripts/template-db2index.pl create mode 100644 ldap/admin/src/scripts/template-db2ldif.pl create mode 100644 ldap/admin/src/scripts/template-dsml-activate.pl create mode 100644 ldap/admin/src/scripts/template-ldif2db.pl create mode 100644 ldap/admin/src/scripts/template-migrate50to51 create mode 100644 ldap/admin/src/scripts/template-migrate5to6 create mode 100644 ldap/admin/src/scripts/template-migrate5to7 create mode 100644 ldap/admin/src/scripts/template-migrate6to7 create mode 100644 ldap/admin/src/scripts/template-migrateInstance5 create mode 100644 ldap/admin/src/scripts/template-migrateInstance6 create mode 100644 ldap/admin/src/scripts/template-migrateInstance7 create mode 100755 ldap/admin/src/scripts/template-migrateTo5 create mode 100644 ldap/admin/src/scripts/template-migrateTo6 create mode 100644 ldap/admin/src/scripts/template-migrateTo7 create mode 100644 ldap/admin/src/scripts/template-ns-accountstatus.pl create mode 100644 ldap/admin/src/scripts/template-ns-activate.pl create mode 100644 ldap/admin/src/scripts/template-ns-inactivate.pl create mode 100755 ldap/admin/src/scripts/template-ns-newpwpolicy.pl create mode 100755 ldap/admin/src/scripts/template-repl-monitor-cgi.pl create mode 100755 ldap/admin/src/scripts/template-repl-monitor.pl create mode 100644 ldap/admin/src/scripts/template-verify-db.pl create mode 100644 ldap/admin/src/shutdown.c create mode 100644 ldap/admin/src/start.c create mode 100644 ldap/admin/src/uname.lib create mode 100755 ldap/admin/src/updatedsgw create mode 100755 ldap/admin/src/upgradeServer create mode 100644 ldap/admin/src/vlvindex.c create mode 100644 ldap/clients/Makefile create mode 100644 ldap/clients/dsgw/Makefile create mode 100644 ldap/clients/dsgw/Versiongw.c create mode 100644 ldap/clients/dsgw/admhtml/Makefile create mode 100644 ldap/clients/dsgw/admhtml/display-country.html create mode 100644 ldap/clients/dsgw/admhtml/display-dnedit.html create mode 100644 ldap/clients/dsgw/admhtml/display-dnedittop.html create mode 100644 ldap/clients/dsgw/admhtml/display-group.html create mode 100644 ldap/clients/dsgw/admhtml/display-groupun.html create mode 100644 ldap/clients/dsgw/admhtml/display-licensed-user.html create mode 100644 ldap/clients/dsgw/admhtml/display-mailgroup.html create mode 100644 ldap/clients/dsgw/admhtml/display-org.html create mode 100644 ldap/clients/dsgw/admhtml/display-orgperson.html create mode 100644 ldap/clients/dsgw/admhtml/display-orgunit.html create mode 100644 ldap/clients/dsgw/admhtml/display-person.html create mode 100644 ldap/clients/dsgw/admhtml/display-umperson.html create mode 100644 ldap/clients/dsgw/admhtml/dsconfig.html create mode 100644 ldap/clients/dsgw/admhtml/dscrgroup.html create mode 100644 ldap/clients/dsgw/admhtml/dscrou.html create mode 100644 ldap/clients/dsgw/admhtml/dscruser.html create mode 100644 ldap/clients/dsgw/admhtml/dsexpldif.html create mode 100644 ldap/clients/dsgw/admhtml/dsimpldif.html create mode 100644 ldap/clients/dsgw/admhtml/dslsgroups.html create mode 100644 ldap/clients/dsgw/admhtml/dslsous.html create mode 100644 ldap/clients/dsgw/admhtml/dslsusers.html create mode 100644 ldap/clients/dsgw/admhtml/edit-passwd.html create mode 100644 ldap/clients/dsgw/admhtml/index.lst create mode 100644 ldap/clients/dsgw/admhtml/list-Anything.html create mode 100644 ldap/clients/dsgw/admhtml/list-Auth.html create mode 100644 ldap/clients/dsgw/admhtml/list-Groups-report.html create mode 100644 ldap/clients/dsgw/admhtml/list-Groups-rm.html create mode 100644 ldap/clients/dsgw/admhtml/list-Groups.html create mode 100644 ldap/clients/dsgw/admhtml/list-Org-Units.html create mode 100644 ldap/clients/dsgw/admhtml/list-OrgUnits-report.html create mode 100644 ldap/clients/dsgw/admhtml/list-OrgUnits.html create mode 100644 ldap/clients/dsgw/admhtml/list-Organizations.html create mode 100644 ldap/clients/dsgw/admhtml/list-Ous-rm.html create mode 100644 ldap/clients/dsgw/admhtml/list-People-report.html create mode 100644 ldap/clients/dsgw/admhtml/list-People-rm.html create mode 100644 ldap/clients/dsgw/admhtml/list-People.html create mode 100644 ldap/clients/dsgw/admhtml/list-fa-Groups.html create mode 100644 ldap/clients/dsgw/admhtml/list-fa-People.html create mode 100644 ldap/clients/dsgw/admhtml/list-fa_people.html create mode 100644 ldap/clients/dsgw/admhtml/list-urlsearch.html create mode 100644 ldap/clients/dsgw/auth.c create mode 100644 ldap/clients/dsgw/cgiutil.c create mode 100644 ldap/clients/dsgw/ckdel.c create mode 100644 ldap/clients/dsgw/ckdump.c create mode 100644 ldap/clients/dsgw/ckget.c create mode 100644 ldap/clients/dsgw/ckpurge.c create mode 100644 ldap/clients/dsgw/ckput.c create mode 100644 ldap/clients/dsgw/collate.c create mode 100644 ldap/clients/dsgw/config.c create mode 100644 ldap/clients/dsgw/config/Makefile create mode 100644 ldap/clients/dsgw/config/authPassword.html create mode 100644 ldap/clients/dsgw/config/authSearch.html create mode 100644 ldap/clients/dsgw/config/csearch.html create mode 100644 ldap/clients/dsgw/config/csearchAttr.html create mode 100644 ldap/clients/dsgw/config/csearchBase.html create mode 100644 ldap/clients/dsgw/config/csearchMatch.html create mode 100644 ldap/clients/dsgw/config/csearchString.html create mode 100644 ldap/clients/dsgw/config/csearchType.html create mode 100644 ldap/clients/dsgw/config/de/authPassword.html create mode 100644 ldap/clients/dsgw/config/de/authSearch.html create mode 100644 ldap/clients/dsgw/config/de/csearchAttr.html create mode 100644 ldap/clients/dsgw/config/de/csearchBase.html create mode 100644 ldap/clients/dsgw/config/de/csearchString.html create mode 100644 ldap/clients/dsgw/config/de/csearchType.html create mode 100644 ldap/clients/dsgw/config/de/display-country.html create mode 100644 ldap/clients/dsgw/config/de/display-dnedit.html create mode 100644 ldap/clients/dsgw/config/de/display-dneditpeople.html create mode 100644 ldap/clients/dsgw/config/de/display-group.html create mode 100644 ldap/clients/dsgw/config/de/display-groupun.html create mode 100644 ldap/clients/dsgw/config/de/display-mailgroup.html create mode 100644 ldap/clients/dsgw/config/de/display-ntgroup.html create mode 100644 ldap/clients/dsgw/config/de/display-ntperson.html create mode 100644 ldap/clients/dsgw/config/de/display-org.html create mode 100644 ldap/clients/dsgw/config/de/display-orgperson.html create mode 100644 ldap/clients/dsgw/config/de/display-orgunit.html create mode 100644 ldap/clients/dsgw/config/de/display-person.html create mode 100644 ldap/clients/dsgw/config/de/display-umperson.html create mode 100644 ldap/clients/dsgw/config/de/dsgw-l10n.conf create mode 100644 ldap/clients/dsgw/config/de/dsgw.conf create mode 100644 ldap/clients/dsgw/config/de/dsgw.tmpl create mode 100644 ldap/clients/dsgw/config/de/dsgw_adm.conf create mode 100644 ldap/clients/dsgw/config/de/dsgwfilter.conf create mode 100644 ldap/clients/dsgw/config/de/dsgwfilter_adm.conf create mode 100644 ldap/clients/dsgw/config/de/dsgwsearchprefs.conf create mode 100644 ldap/clients/dsgw/config/de/edit-passwd.html create mode 100644 ldap/clients/dsgw/config/de/list-Anything.html create mode 100644 ldap/clients/dsgw/config/de/list-Auth.html create mode 100644 ldap/clients/dsgw/config/de/list-Groups.html create mode 100644 ldap/clients/dsgw/config/de/list-NT-Groups.html create mode 100644 ldap/clients/dsgw/config/de/list-NT-People.html create mode 100644 ldap/clients/dsgw/config/de/list-Org-Units.html create mode 100644 ldap/clients/dsgw/config/de/list-Organizations.html create mode 100644 ldap/clients/dsgw/config/de/list-People.html create mode 100644 ldap/clients/dsgw/config/de/list-fa-Groups.html create mode 100644 ldap/clients/dsgw/config/de/list-fa-People.html create mode 100644 ldap/clients/dsgw/config/de/list-urlsearch.html create mode 100644 ldap/clients/dsgw/config/de/newentry.html create mode 100644 ldap/clients/dsgw/config/de/newentryName.html create mode 100644 ldap/clients/dsgw/config/de/newentryType.html create mode 100644 ldap/clients/dsgw/config/de/search.html create mode 100644 ldap/clients/dsgw/config/de/searchString.html create mode 100644 ldap/clients/dsgw/config/display-country.html create mode 100644 ldap/clients/dsgw/config/display-dc.html create mode 100644 ldap/clients/dsgw/config/display-dnedit.html create mode 100644 ldap/clients/dsgw/config/display-dneditpeople.html create mode 100644 ldap/clients/dsgw/config/display-group.html create mode 100644 ldap/clients/dsgw/config/display-groupun.html create mode 100644 ldap/clients/dsgw/config/display-ntgroup.html create mode 100644 ldap/clients/dsgw/config/display-ntperson.html create mode 100644 ldap/clients/dsgw/config/display-org.html create mode 100644 ldap/clients/dsgw/config/display-orgperson.html create mode 100644 ldap/clients/dsgw/config/display-orgunit.html create mode 100644 ldap/clients/dsgw/config/display-person.html create mode 100644 ldap/clients/dsgw/config/dsgw-l10n.conf create mode 100644 ldap/clients/dsgw/config/dsgw.tmpl create mode 100644 ldap/clients/dsgw/config/dsgw_adm.conf create mode 100644 ldap/clients/dsgw/config/dsgwfilter.conf create mode 100644 ldap/clients/dsgw/config/dsgwfilter_adm.conf create mode 100644 ldap/clients/dsgw/config/dsgwsearchprefs.conf create mode 100644 ldap/clients/dsgw/config/edit-passwd.html create mode 100644 ldap/clients/dsgw/config/en-us/dsgw-l10n.conf create mode 100644 ldap/clients/dsgw/config/en-us/dsgwcollate.conf create mode 100644 ldap/clients/dsgw/config/en/dsgw-l10n.conf create mode 100644 ldap/clients/dsgw/config/en/dsgwcollate.conf create mode 100644 ldap/clients/dsgw/config/es/authPassword.html create mode 100644 ldap/clients/dsgw/config/es/authSearch.html create mode 100644 ldap/clients/dsgw/config/es/csearch.html create mode 100644 ldap/clients/dsgw/config/es/csearchAttr.html create mode 100644 ldap/clients/dsgw/config/es/csearchBase.html create mode 100644 ldap/clients/dsgw/config/es/csearchString.html create mode 100644 ldap/clients/dsgw/config/es/csearchType.html create mode 100644 ldap/clients/dsgw/config/es/display-country.html create mode 100644 ldap/clients/dsgw/config/es/display-dnedit.html create mode 100644 ldap/clients/dsgw/config/es/display-dneditpeople.html create mode 100644 ldap/clients/dsgw/config/es/display-group.html create mode 100644 ldap/clients/dsgw/config/es/display-groupun.html create mode 100644 ldap/clients/dsgw/config/es/display-ntgroup.html create mode 100644 ldap/clients/dsgw/config/es/display-ntperson.html create mode 100644 ldap/clients/dsgw/config/es/display-org.html create mode 100644 ldap/clients/dsgw/config/es/display-orgperson.html create mode 100644 ldap/clients/dsgw/config/es/display-orgunit.html create mode 100644 ldap/clients/dsgw/config/es/display-person.html create mode 100644 ldap/clients/dsgw/config/es/dsgw-l10n.conf create mode 100644 ldap/clients/dsgw/config/es/dsgw.tmpl create mode 100644 ldap/clients/dsgw/config/es/dsgw_adm.conf create mode 100644 ldap/clients/dsgw/config/es/dsgwfilter.conf create mode 100644 ldap/clients/dsgw/config/es/dsgwfilter_adm.conf create mode 100644 ldap/clients/dsgw/config/es/dsgwsearchprefs.conf create mode 100644 ldap/clients/dsgw/config/es/edit-passwd.html create mode 100644 ldap/clients/dsgw/config/es/list-Anything.html create mode 100644 ldap/clients/dsgw/config/es/list-Auth.html create mode 100644 ldap/clients/dsgw/config/es/list-Groups.html create mode 100644 ldap/clients/dsgw/config/es/list-NT-Groups.html create mode 100644 ldap/clients/dsgw/config/es/list-NT-People.html create mode 100644 ldap/clients/dsgw/config/es/list-Org-Units.html create mode 100644 ldap/clients/dsgw/config/es/list-Organizations.html create mode 100644 ldap/clients/dsgw/config/es/list-People.html create mode 100644 ldap/clients/dsgw/config/es/list-fa-Groups.html create mode 100644 ldap/clients/dsgw/config/es/list-fa-People.html create mode 100644 ldap/clients/dsgw/config/es/list-urlsearch.html create mode 100644 ldap/clients/dsgw/config/es/newentry.html create mode 100644 ldap/clients/dsgw/config/es/newentryName.html create mode 100644 ldap/clients/dsgw/config/es/newentryType.html create mode 100644 ldap/clients/dsgw/config/es/ns-license-schema.conf create mode 100644 ldap/clients/dsgw/config/es/search.html create mode 100644 ldap/clients/dsgw/config/es/searchString.html create mode 100644 ldap/clients/dsgw/config/fr/authPassword.html create mode 100644 ldap/clients/dsgw/config/fr/authSearch.html create mode 100644 ldap/clients/dsgw/config/fr/csearch.html create mode 100644 ldap/clients/dsgw/config/fr/csearchAttr.html create mode 100644 ldap/clients/dsgw/config/fr/csearchBase.html create mode 100644 ldap/clients/dsgw/config/fr/csearchString.html create mode 100644 ldap/clients/dsgw/config/fr/csearchType.html create mode 100644 ldap/clients/dsgw/config/fr/display-country.html create mode 100644 ldap/clients/dsgw/config/fr/display-dnedit.html create mode 100644 ldap/clients/dsgw/config/fr/display-dneditpeople.html create mode 100644 ldap/clients/dsgw/config/fr/display-group.html create mode 100644 ldap/clients/dsgw/config/fr/display-groupun.html create mode 100644 ldap/clients/dsgw/config/fr/display-mailgroup.html create mode 100644 ldap/clients/dsgw/config/fr/display-ntgroup.html create mode 100644 ldap/clients/dsgw/config/fr/display-ntperson.html create mode 100644 ldap/clients/dsgw/config/fr/display-org.html create mode 100644 ldap/clients/dsgw/config/fr/display-orgperson.html create mode 100644 ldap/clients/dsgw/config/fr/display-orgunit.html create mode 100644 ldap/clients/dsgw/config/fr/display-person.html create mode 100644 ldap/clients/dsgw/config/fr/display-umperson.html create mode 100644 ldap/clients/dsgw/config/fr/dsgw-l10n.conf create mode 100644 ldap/clients/dsgw/config/fr/dsgw.conf create mode 100644 ldap/clients/dsgw/config/fr/dsgw.tmpl create mode 100644 ldap/clients/dsgw/config/fr/dsgw_adm.conf create mode 100644 ldap/clients/dsgw/config/fr/dsgwfilter.conf create mode 100644 ldap/clients/dsgw/config/fr/dsgwfilter_adm.conf create mode 100644 ldap/clients/dsgw/config/fr/dsgwsearchprefs.conf create mode 100644 ldap/clients/dsgw/config/fr/edit-passwd.html create mode 100644 ldap/clients/dsgw/config/fr/list-Anything.html create mode 100644 ldap/clients/dsgw/config/fr/list-Auth.html create mode 100644 ldap/clients/dsgw/config/fr/list-Groups.html create mode 100644 ldap/clients/dsgw/config/fr/list-NT-Groups.html create mode 100644 ldap/clients/dsgw/config/fr/list-NT-People.html create mode 100644 ldap/clients/dsgw/config/fr/list-Org-Units.html create mode 100644 ldap/clients/dsgw/config/fr/list-Organizations.html create mode 100644 ldap/clients/dsgw/config/fr/list-People.html create mode 100644 ldap/clients/dsgw/config/fr/list-fa-Groups.html create mode 100644 ldap/clients/dsgw/config/fr/list-fa-People.html create mode 100644 ldap/clients/dsgw/config/fr/list-urlsearch.html create mode 100644 ldap/clients/dsgw/config/fr/newentry.html create mode 100644 ldap/clients/dsgw/config/fr/newentryName.html create mode 100644 ldap/clients/dsgw/config/fr/newentryType.html create mode 100644 ldap/clients/dsgw/config/fr/search.html create mode 100644 ldap/clients/dsgw/config/fr/searchString.html create mode 100644 ldap/clients/dsgw/config/ja/authPassword.html create mode 100644 ldap/clients/dsgw/config/ja/authSearch.html create mode 100644 ldap/clients/dsgw/config/ja/csearch.html create mode 100644 ldap/clients/dsgw/config/ja/csearchAttr.html create mode 100644 ldap/clients/dsgw/config/ja/csearchBase.html create mode 100644 ldap/clients/dsgw/config/ja/csearchString.html create mode 100644 ldap/clients/dsgw/config/ja/csearchType.html create mode 100644 ldap/clients/dsgw/config/ja/display-country.html create mode 100644 ldap/clients/dsgw/config/ja/display-dnedit.html create mode 100644 ldap/clients/dsgw/config/ja/display-dneditpeople.html create mode 100644 ldap/clients/dsgw/config/ja/display-group.html create mode 100644 ldap/clients/dsgw/config/ja/display-groupun.html create mode 100644 ldap/clients/dsgw/config/ja/display-mailgroup.html create mode 100644 ldap/clients/dsgw/config/ja/display-ntgroup.html create mode 100644 ldap/clients/dsgw/config/ja/display-ntperson.html create mode 100644 ldap/clients/dsgw/config/ja/display-org.html create mode 100644 ldap/clients/dsgw/config/ja/display-orgperson.html create mode 100644 ldap/clients/dsgw/config/ja/display-orgunit.html create mode 100644 ldap/clients/dsgw/config/ja/display-person.html create mode 100644 ldap/clients/dsgw/config/ja/display-umperson.html create mode 100644 ldap/clients/dsgw/config/ja/dsgw-l10n.conf create mode 100644 ldap/clients/dsgw/config/ja/dsgw.conf create mode 100644 ldap/clients/dsgw/config/ja/dsgw.tmpl create mode 100644 ldap/clients/dsgw/config/ja/dsgw_adm.conf create mode 100644 ldap/clients/dsgw/config/ja/dsgwcharset.conf create mode 100644 ldap/clients/dsgw/config/ja/dsgwcollate.conf create mode 100644 ldap/clients/dsgw/config/ja/dsgwfilter.conf create mode 100644 ldap/clients/dsgw/config/ja/dsgwfilter_adm.conf create mode 100644 ldap/clients/dsgw/config/ja/dsgwsearchprefs.conf create mode 100644 ldap/clients/dsgw/config/ja/edit-passwd.html create mode 100644 ldap/clients/dsgw/config/ja/list-Anything.html create mode 100644 ldap/clients/dsgw/config/ja/list-Auth.html create mode 100644 ldap/clients/dsgw/config/ja/list-Groups.html create mode 100644 ldap/clients/dsgw/config/ja/list-NT-Groups.html create mode 100644 ldap/clients/dsgw/config/ja/list-NT-People.html create mode 100644 ldap/clients/dsgw/config/ja/list-Org-Units.html create mode 100644 ldap/clients/dsgw/config/ja/list-Organizations.html create mode 100644 ldap/clients/dsgw/config/ja/list-People.html create mode 100644 ldap/clients/dsgw/config/ja/list-fa-Groups.html create mode 100644 ldap/clients/dsgw/config/ja/list-fa-People.html create mode 100644 ldap/clients/dsgw/config/ja/list-urlsearch.html create mode 100644 ldap/clients/dsgw/config/ja/newentry.html create mode 100644 ldap/clients/dsgw/config/ja/newentryName.html create mode 100644 ldap/clients/dsgw/config/ja/newentryType.html create mode 100644 ldap/clients/dsgw/config/ja/search.html create mode 100644 ldap/clients/dsgw/config/ja/searchString.html create mode 100644 ldap/clients/dsgw/config/ko/dsgw-l10n.conf create mode 100644 ldap/clients/dsgw/config/ko/dsgwcharset.conf create mode 100644 ldap/clients/dsgw/config/list-Anything.html create mode 100644 ldap/clients/dsgw/config/list-Auth.html create mode 100644 ldap/clients/dsgw/config/list-Domaincomponent.html create mode 100644 ldap/clients/dsgw/config/list-Groups.html create mode 100644 ldap/clients/dsgw/config/list-NT-Groups.html create mode 100644 ldap/clients/dsgw/config/list-NT-People.html create mode 100644 ldap/clients/dsgw/config/list-Org-Units.html create mode 100644 ldap/clients/dsgw/config/list-Organizations.html create mode 100644 ldap/clients/dsgw/config/list-People.html create mode 100644 ldap/clients/dsgw/config/list-fa-Groups.html create mode 100644 ldap/clients/dsgw/config/list-fa-People.html create mode 100644 ldap/clients/dsgw/config/list-urlsearch.html create mode 100644 ldap/clients/dsgw/config/newentry.html create mode 100644 ldap/clients/dsgw/config/newentryName.html create mode 100644 ldap/clients/dsgw/config/newentryType.html create mode 100644 ldap/clients/dsgw/config/ns-license-schema.conf create mode 100644 ldap/clients/dsgw/config/search.html create mode 100644 ldap/clients/dsgw/config/searchString.html create mode 100644 ldap/clients/dsgw/config/zh/dsgw-l10n.conf create mode 100644 ldap/clients/dsgw/config/zh/dsgwcharset.conf create mode 100644 ldap/clients/dsgw/cookie.c create mode 100644 ldap/clients/dsgw/csearch.c create mode 100644 ldap/clients/dsgw/dbtdsgw.h create mode 100644 ldap/clients/dsgw/dnedit.c create mode 100644 ldap/clients/dsgw/doauth.c create mode 100644 ldap/clients/dsgw/domodify.c create mode 100644 ldap/clients/dsgw/dosearch.c create mode 100644 ldap/clients/dsgw/dsconfig.c create mode 100644 ldap/clients/dsgw/dsexpldif.c create mode 100644 ldap/clients/dsgw/dsgw.h create mode 100644 ldap/clients/dsgw/dsgw_include.mk create mode 100644 ldap/clients/dsgw/dsgwutil.c create mode 100644 ldap/clients/dsgw/dsimpldif.c create mode 100644 ldap/clients/dsgw/edit.c create mode 100644 ldap/clients/dsgw/emitauth.c create mode 100644 ldap/clients/dsgw/emitf.c create mode 100644 ldap/clients/dsgw/entrydisplay.c create mode 100644 ldap/clients/dsgw/error.c create mode 100644 ldap/clients/dsgw/genscreen.c create mode 100644 ldap/clients/dsgw/getopt.c create mode 100644 ldap/clients/dsgw/html/Makefile create mode 100644 ldap/clients/dsgw/html/aim-online.gif create mode 100644 ldap/clients/dsgw/html/alert.gif create mode 100644 ldap/clients/dsgw/html/alert.html create mode 100644 ldap/clients/dsgw/html/auth.html create mode 100644 ldap/clients/dsgw/html/authroot.html create mode 100644 ldap/clients/dsgw/html/authtitle.html create mode 100644 ldap/clients/dsgw/html/back1.gif create mode 100644 ldap/clients/dsgw/html/clear.gif create mode 100644 ldap/clients/dsgw/html/confirm.gif create mode 100644 ldap/clients/dsgw/html/confirm.html create mode 100644 ldap/clients/dsgw/html/content1.gif create mode 100644 ldap/clients/dsgw/html/country.gif create mode 100644 ldap/clients/dsgw/html/csearchtitle.html create mode 100644 ldap/clients/dsgw/html/dc.gif create mode 100644 ldap/clients/dsgw/html/de/adsearch_off.gif create mode 100644 ldap/clients/dsgw/html/de/adsearch_on.gif create mode 100644 ldap/clients/dsgw/html/de/auth.html create mode 100644 ldap/clients/dsgw/html/de/authen_off.gif create mode 100644 ldap/clients/dsgw/html/de/authen_on.gif create mode 100644 ldap/clients/dsgw/html/de/authroot.html create mode 100644 ldap/clients/dsgw/html/de/authtitle.html create mode 100644 ldap/clients/dsgw/html/de/back.gif create mode 100644 ldap/clients/dsgw/html/de/back1.gif create mode 100644 ldap/clients/dsgw/html/de/content.gif create mode 100644 ldap/clients/dsgw/html/de/content1.gif create mode 100644 ldap/clients/dsgw/html/de/csearchtitle.html create mode 100644 ldap/clients/dsgw/html/de/eduser.html create mode 100644 ldap/clients/dsgw/html/de/exit1.gif create mode 100644 ldap/clients/dsgw/html/de/forward1.gif create mode 100644 ldap/clients/dsgw/html/de/greeting.html create mode 100644 ldap/clients/dsgw/html/de/index.html create mode 100644 ldap/clients/dsgw/html/de/index1.gif create mode 100644 ldap/clients/dsgw/html/de/maintitle.html create mode 100644 ldap/clients/dsgw/html/de/newentry_off.gif create mode 100644 ldap/clients/dsgw/html/de/newentry_on.gif create mode 100644 ldap/clients/dsgw/html/de/newentrytitle.html create mode 100644 ldap/clients/dsgw/html/de/searchtitle.html create mode 100644 ldap/clients/dsgw/html/de/stsearch_off.gif create mode 100644 ldap/clients/dsgw/html/de/stsearch_on.gif create mode 100644 ldap/clients/dsgw/html/de/title.gif create mode 100644 ldap/clients/dsgw/html/eduser.html create mode 100644 ldap/clients/dsgw/html/emptyFrame.html create mode 100644 ldap/clients/dsgw/html/es/adsearch_off.gif create mode 100644 ldap/clients/dsgw/html/es/adsearch_on.gif create mode 100644 ldap/clients/dsgw/html/es/auth.html create mode 100644 ldap/clients/dsgw/html/es/authen_off.gif create mode 100644 ldap/clients/dsgw/html/es/authen_on.gif create mode 100644 ldap/clients/dsgw/html/es/authroot.html create mode 100644 ldap/clients/dsgw/html/es/authtitle.html create mode 100644 ldap/clients/dsgw/html/es/back1.gif create mode 100644 ldap/clients/dsgw/html/es/blank.gif create mode 100644 ldap/clients/dsgw/html/es/content1.gif create mode 100644 ldap/clients/dsgw/html/es/country.gif create mode 100644 ldap/clients/dsgw/html/es/csearchtitle.html create mode 100644 ldap/clients/dsgw/html/es/eduser.html create mode 100644 ldap/clients/dsgw/html/es/exit1.gif create mode 100644 ldap/clients/dsgw/html/es/forward1.gif create mode 100644 ldap/clients/dsgw/html/es/greeting.html create mode 100644 ldap/clients/dsgw/html/es/group.gif create mode 100644 ldap/clients/dsgw/html/es/index.html create mode 100644 ldap/clients/dsgw/html/es/index1.gif create mode 100644 ldap/clients/dsgw/html/es/maintitle.html create mode 100644 ldap/clients/dsgw/html/es/newentry_off.gif create mode 100644 ldap/clients/dsgw/html/es/newentry_on.gif create mode 100644 ldap/clients/dsgw/html/es/newentrytitle.html create mode 100644 ldap/clients/dsgw/html/es/organization.gif create mode 100644 ldap/clients/dsgw/html/es/orgunit.gif create mode 100644 ldap/clients/dsgw/html/es/person.gif create mode 100644 ldap/clients/dsgw/html/es/searchtitle.html create mode 100644 ldap/clients/dsgw/html/es/stsearch_off.gif create mode 100644 ldap/clients/dsgw/html/es/stsearch_on.gif create mode 100644 ldap/clients/dsgw/html/es/title.gif create mode 100644 ldap/clients/dsgw/html/exit1.gif create mode 100644 ldap/clients/dsgw/html/forward1.gif create mode 100644 ldap/clients/dsgw/html/fr/adsearch_off.gif create mode 100644 ldap/clients/dsgw/html/fr/adsearch_on.gif create mode 100644 ldap/clients/dsgw/html/fr/auth.html create mode 100644 ldap/clients/dsgw/html/fr/authen_off.gif create mode 100644 ldap/clients/dsgw/html/fr/authen_on.gif create mode 100644 ldap/clients/dsgw/html/fr/authroot.html create mode 100644 ldap/clients/dsgw/html/fr/authtitle.html create mode 100644 ldap/clients/dsgw/html/fr/back.gif create mode 100644 ldap/clients/dsgw/html/fr/back1.gif create mode 100644 ldap/clients/dsgw/html/fr/content.gif create mode 100644 ldap/clients/dsgw/html/fr/content1.gif create mode 100644 ldap/clients/dsgw/html/fr/csearchtitle.html create mode 100644 ldap/clients/dsgw/html/fr/eduser.html create mode 100644 ldap/clients/dsgw/html/fr/exit1.gif create mode 100644 ldap/clients/dsgw/html/fr/forward1.gif create mode 100644 ldap/clients/dsgw/html/fr/greeting.html create mode 100644 ldap/clients/dsgw/html/fr/index.html create mode 100644 ldap/clients/dsgw/html/fr/index1.gif create mode 100644 ldap/clients/dsgw/html/fr/maintitle.html create mode 100644 ldap/clients/dsgw/html/fr/newentry_off.gif create mode 100644 ldap/clients/dsgw/html/fr/newentry_on.gif create mode 100644 ldap/clients/dsgw/html/fr/newentrytitle.html create mode 100644 ldap/clients/dsgw/html/fr/searchtitle.html create mode 100644 ldap/clients/dsgw/html/fr/stsearch_off.gif create mode 100644 ldap/clients/dsgw/html/fr/stsearch_on.gif create mode 100644 ldap/clients/dsgw/html/fr/title.gif create mode 100644 ldap/clients/dsgw/html/greeting.html create mode 100644 ldap/clients/dsgw/html/group.gif create mode 100644 ldap/clients/dsgw/html/index.html create mode 100644 ldap/clients/dsgw/html/index1.gif create mode 100644 ldap/clients/dsgw/html/info/Makefile create mode 100644 ldap/clients/dsgw/html/info/infonav.html create mode 100644 ldap/clients/dsgw/html/ja/adsearch_off.gif create mode 100644 ldap/clients/dsgw/html/ja/adsearch_on.gif create mode 100644 ldap/clients/dsgw/html/ja/auth.html create mode 100644 ldap/clients/dsgw/html/ja/authen_off.gif create mode 100644 ldap/clients/dsgw/html/ja/authen_on.gif create mode 100644 ldap/clients/dsgw/html/ja/authroot.html create mode 100644 ldap/clients/dsgw/html/ja/authtitle.html create mode 100644 ldap/clients/dsgw/html/ja/back.gif create mode 100644 ldap/clients/dsgw/html/ja/back1.gif create mode 100644 ldap/clients/dsgw/html/ja/content.gif create mode 100644 ldap/clients/dsgw/html/ja/content1.gif create mode 100644 ldap/clients/dsgw/html/ja/csearchtitle.html create mode 100644 ldap/clients/dsgw/html/ja/eduser.html create mode 100644 ldap/clients/dsgw/html/ja/exit1.gif create mode 100644 ldap/clients/dsgw/html/ja/forward1.gif create mode 100644 ldap/clients/dsgw/html/ja/greeting.html create mode 100644 ldap/clients/dsgw/html/ja/index.html create mode 100644 ldap/clients/dsgw/html/ja/index1.gif create mode 100644 ldap/clients/dsgw/html/ja/maintitle.html create mode 100644 ldap/clients/dsgw/html/ja/newentry_off.gif create mode 100644 ldap/clients/dsgw/html/ja/newentry_on.gif create mode 100644 ldap/clients/dsgw/html/ja/newentrytitle.html create mode 100644 ldap/clients/dsgw/html/ja/searchtitle.html create mode 100644 ldap/clients/dsgw/html/ja/stsearch_off.gif create mode 100644 ldap/clients/dsgw/html/ja/stsearch_on.gif create mode 100644 ldap/clients/dsgw/html/ja/title.gif create mode 100644 ldap/clients/dsgw/html/left_bottom.gif create mode 100644 ldap/clients/dsgw/html/left_off.gif create mode 100644 ldap/clients/dsgw/html/left_on.gif create mode 100644 ldap/clients/dsgw/html/maintitle.html create mode 100644 ldap/clients/dsgw/html/manual/Makefile create mode 100644 ldap/clients/dsgw/html/manual/a.gif create mode 100644 ldap/clients/dsgw/html/manual/add.htm create mode 100644 ldap/clients/dsgw/html/manual/attribua.gif create mode 100644 ldap/clients/dsgw/html/manual/attribut.htm create mode 100644 ldap/clients/dsgw/html/manual/auth.htm create mode 100644 ldap/clients/dsgw/html/manual/contents.html create mode 100644 ldap/clients/dsgw/html/manual/dn.htm create mode 100644 ldap/clients/dsgw/html/manual/dna.gif create mode 100644 ldap/clients/dsgw/html/manual/filters.htm create mode 100644 ldap/clients/dsgw/html/manual/index.html create mode 100644 ldap/clients/dsgw/html/manual/index.map create mode 100644 ldap/clients/dsgw/html/manual/intro.htm create mode 100644 ldap/clients/dsgw/html/manual/ja/add.htm create mode 100644 ldap/clients/dsgw/html/manual/ja/attribut.htm create mode 100644 ldap/clients/dsgw/html/manual/ja/auth.htm create mode 100644 ldap/clients/dsgw/html/manual/ja/contents.html create mode 100644 ldap/clients/dsgw/html/manual/ja/filters.htm create mode 100644 ldap/clients/dsgw/html/manual/ja/intro.htm create mode 100644 ldap/clients/dsgw/html/manual/ja/mod.htm create mode 100644 ldap/clients/dsgw/html/manual/ja/objclass.htm create mode 100644 ldap/clients/dsgw/html/manual/ja/search.htm create mode 100644 ldap/clients/dsgw/html/manual/mod.htm create mode 100644 ldap/clients/dsgw/html/manual/n.gif create mode 100644 ldap/clients/dsgw/html/manual/objclass.htm create mode 100644 ldap/clients/dsgw/html/manual/search.htm create mode 100644 ldap/clients/dsgw/html/manual/t.gif create mode 100644 ldap/clients/dsgw/html/manual/y.gif create mode 100644 ldap/clients/dsgw/html/message.gif create mode 100644 ldap/clients/dsgw/html/netscape.gif create mode 100644 ldap/clients/dsgw/html/newentrytitle.html create mode 100644 ldap/clients/dsgw/html/organization.gif create mode 100644 ldap/clients/dsgw/html/orgicon.gif create mode 100644 ldap/clients/dsgw/html/orgunit.gif create mode 100644 ldap/clients/dsgw/html/person.gif create mode 100644 ldap/clients/dsgw/html/right_bottom.gif create mode 100644 ldap/clients/dsgw/html/right_off.gif create mode 100644 ldap/clients/dsgw/html/right_on.gif create mode 100644 ldap/clients/dsgw/html/searchtitle.html create mode 100644 ldap/clients/dsgw/html/style.css create mode 100644 ldap/clients/dsgw/html/transparent.gif create mode 100644 ldap/clients/dsgw/htmlout.c create mode 100644 ldap/clients/dsgw/htmlparse.c create mode 100644 ldap/clients/dsgw/lang.c create mode 100644 ldap/clients/dsgw/ldaputil.c create mode 100644 ldap/clients/dsgw/newentry.c create mode 100644 ldap/clients/dsgw/pbconfig/Makefile create mode 100644 ldap/clients/dsgw/pbconfig/authPassword.html create mode 100644 ldap/clients/dsgw/pbconfig/authSearch.html create mode 100644 ldap/clients/dsgw/pbconfig/display-orgperson.html create mode 100644 ldap/clients/dsgw/pbconfig/display-orgunit.html create mode 100644 ldap/clients/dsgw/pbconfig/display-room.html create mode 100644 ldap/clients/dsgw/pbconfig/dsgwfilter.conf create mode 100644 ldap/clients/dsgw/pbconfig/dsgwsearchprefs.conf create mode 100644 ldap/clients/dsgw/pbconfig/edit-passwd.html create mode 100644 ldap/clients/dsgw/pbconfig/list-Auth.html create mode 100644 ldap/clients/dsgw/pbconfig/list-People.html create mode 100644 ldap/clients/dsgw/pbconfig/pb.tmpl create mode 100644 ldap/clients/dsgw/pbhtml/16-conference.gif create mode 100644 ldap/clients/dsgw/pbhtml/16-person.gif create mode 100644 ldap/clients/dsgw/pbhtml/32-alert.gif create mode 100644 ldap/clients/dsgw/pbhtml/32-conference.gif create mode 100644 ldap/clients/dsgw/pbhtml/32-message.gif create mode 100644 ldap/clients/dsgw/pbhtml/32-office.gif create mode 100644 ldap/clients/dsgw/pbhtml/32-person.gif create mode 100644 ldap/clients/dsgw/pbhtml/Makefile create mode 100644 ldap/clients/dsgw/pbhtml/aim-online.gif create mode 100644 ldap/clients/dsgw/pbhtml/alert.html create mode 100644 ldap/clients/dsgw/pbhtml/brandblock.gif create mode 100644 ldap/clients/dsgw/pbhtml/carded.html create mode 100644 ldap/clients/dsgw/pbhtml/clear.gif create mode 100644 ldap/clients/dsgw/pbhtml/conference.gif create mode 100644 ldap/clients/dsgw/pbhtml/confirm.html create mode 100644 ldap/clients/dsgw/pbhtml/department.gif create mode 100644 ldap/clients/dsgw/pbhtml/emptyFrame.html create mode 100644 ldap/clients/dsgw/pbhtml/get_cert.gif create mode 100644 ldap/clients/dsgw/pbhtml/get_cert_sm.gif create mode 100644 ldap/clients/dsgw/pbhtml/index.html create mode 100644 ldap/clients/dsgw/pbhtml/intro.html create mode 100644 ldap/clients/dsgw/pbhtml/modify.html create mode 100644 ldap/clients/dsgw/pbhtml/nonemp.html create mode 100644 ldap/clients/dsgw/pbhtml/nullStringError.html create mode 100644 ldap/clients/dsgw/pbhtml/office.gif create mode 100644 ldap/clients/dsgw/pbhtml/orgicon.gif create mode 100644 ldap/clients/dsgw/pbhtml/pbrd.jpg create mode 100644 ldap/clients/dsgw/pbhtml/person.gif create mode 100644 ldap/clients/dsgw/pbhtml/phone.html create mode 100755 ldap/clients/dsgw/pbhtml/phone.js create mode 100644 ldap/clients/dsgw/pbhtml/pixel.gif create mode 100644 ldap/clients/dsgw/pbhtml/report.html create mode 100644 ldap/clients/dsgw/pbhtml/style.css create mode 100644 ldap/clients/dsgw/pbhtml/tiny_cert.gif create mode 100644 ldap/clients/dsgw/pbhtml/tiny_vcard.gif create mode 100644 ldap/clients/dsgw/pbhtml/vendor.gif create mode 100644 ldap/clients/dsgw/pbhtml/view_vcard.gif create mode 100644 ldap/clients/dsgw/pbhtml/view_vcard_sm.gif create mode 100644 ldap/clients/dsgw/search.c create mode 100644 ldap/clients/dsgw/secglue.c create mode 100644 ldap/clients/dsgw/sort.c create mode 100644 ldap/clients/dsgw/templateindex.c create mode 100644 ldap/clients/dsgw/tutor.c create mode 100644 ldap/clients/dsgw/unauth.c create mode 100644 ldap/clients/dsgw/userhtml/Makefile create mode 100644 ldap/clients/dsgw/userhtml/edit-userpasswd.html create mode 100644 ldap/clients/dsgw/userhtml/edit-userpinfo.html create mode 100644 ldap/clients/dsgw/userhtml/index.html create mode 100644 ldap/clients/dsgw/userhtml/index.lst create mode 100644 ldap/clients/dsgw/utf8compare.c create mode 100644 ldap/clients/dsgw/vcard.c create mode 100644 ldap/clients/dsmlgw/Makefile create mode 100644 ldap/clients/dsmlgw/build.xml create mode 100644 ldap/clients/dsmlgw/misc/dsmlgw.cfg create mode 100644 ldap/clients/dsmlgw/misc/server-config.wsdd create mode 100644 ldap/clients/dsmlgw/misc/web-app_2_3.dtd create mode 100644 ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/BatchProcessor.java create mode 100644 ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/Configuration.java create mode 100644 ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/Constants.java create mode 100644 ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/GenericOperation.java create mode 100644 ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/IConnMgrFactoryFunctor.java create mode 100644 ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/IConnectionManager.java create mode 100644 ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/LDAPAuthenticator.java create mode 100644 ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationAdd.java create mode 100644 ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationAuth.java create mode 100644 ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationCompare.java create mode 100644 ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationDelete.java create mode 100644 ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationExtended.java create mode 100644 ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationModify.java create mode 100644 ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationModifyDN.java create mode 100644 ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationSearch.java create mode 100644 ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ParseControl.java create mode 100644 ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ParseFilter.java create mode 100644 ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ProxyConnMgrFactory.java create mode 100644 ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ProxyConnectionManager.java create mode 100644 ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayContext.java create mode 100644 ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayException.java create mode 100644 ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayHandler.java create mode 100644 ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/gatewayService.java create mode 100644 ldap/clients/dsmlgw/src/com/netscape/dsml/test/SOAPClient.java create mode 100644 ldap/clients/dsmlgw/src/com/netscape/dsml/test/dsmlClient.java create mode 100644 ldap/clients/dsmlgw/src/com/netscape/dsml/test/dsmlSearch.java create mode 100644 ldap/clients/orgchart/aim-online.gif create mode 100644 ldap/clients/orgchart/arrow.gif create mode 100644 ldap/clients/orgchart/botframe.html create mode 100644 ldap/clients/orgchart/branch-cc1.gif create mode 100644 ldap/clients/orgchart/config.tmpl create mode 100644 ldap/clients/orgchart/index.html create mode 100644 ldap/clients/orgchart/ldap-person.gif create mode 100644 ldap/clients/orgchart/mag.gif create mode 100644 ldap/clients/orgchart/mail.gif create mode 100644 ldap/clients/orgchart/myorg.bat create mode 100755 ldap/clients/orgchart/myorg.pl create mode 100644 ldap/clients/orgchart/new-branch-blank.gif create mode 100644 ldap/clients/orgchart/new-branch-first.gif create mode 100644 ldap/clients/orgchart/new-branch-straight.gif create mode 100644 ldap/clients/orgchart/nslogo.gif create mode 100644 ldap/clients/orgchart/org.bat create mode 100755 ldap/clients/orgchart/org.pl create mode 100644 ldap/clients/orgchart/orgicon.gif create mode 100644 ldap/clients/orgchart/starthelp.gif create mode 100644 ldap/clients/orgchart/styles.css create mode 100644 ldap/clients/orgchart/topframe.html create mode 100644 ldap/clients/orgchart/wrapper.c create mode 100644 ldap/cm/Makefile create mode 100644 ldap/cm/filterfiles.sh create mode 100644 ldap/cm/fixBaseInf.pl create mode 100644 ldap/cm/fixNSPerlInf.pl create mode 100644 ldap/cm/fixPerlDAPInf.pl create mode 100644 ldap/cm/fixSetupInf.pl create mode 100644 ldap/cm/ldapjava.mpw create mode 100644 ldap/cm/nbsp2utf8.sh create mode 100644 ldap/cm/newinst/Makefile create mode 100644 ldap/cm/newinst/fixINF.pl create mode 100755 ldap/cm/newinst/ns-keygen create mode 100755 ldap/cm/newinst/ns-update create mode 100644 ldap/cm/newinst/replaceToken.pl create mode 100755 ldap/cm/newinst/setup.pl create mode 100755 ldap/cm/newinst/setup.sh create mode 100644 ldap/cm/newinst/slapd.inf create mode 100755 ldap/cm/newinst/uninstall create mode 100644 ldap/cm/newinst/ux-config.cc create mode 100644 ldap/cm/newinst/ux-config.h create mode 100644 ldap/cm/newinst/ux-dialog.cc create mode 100644 ldap/cm/newinst/ux-dialog.h create mode 100644 ldap/cm/newinst/ux-dsalib_dn.c create mode 100644 ldap/cm/newinst/ux-guesses.cc create mode 100644 ldap/cm/newinstnt/Makefile create mode 100644 ldap/cm/newinstnt/consolinst.c create mode 100644 ldap/cm/newinstnt/consolinst.h create mode 100644 ldap/cm/newinstnt/dsinst.aps create mode 100644 ldap/cm/newinstnt/dsinst.c create mode 100644 ldap/cm/newinstnt/dsinst.h create mode 100644 ldap/cm/newinstnt/dsinst.rc create mode 100644 ldap/cm/newinstnt/dsinst_dsalib_dn.c create mode 100644 ldap/cm/newinstnt/libinst.c create mode 100644 ldap/cm/newinstnt/libinst.h create mode 100644 ldap/cm/newinstnt/resource.h create mode 100644 ldap/cm/newinstnt/setup.bat create mode 100644 ldap/cm/newinstnt/setup.inf create mode 100644 ldap/cm/newinstnt/slapd.inf create mode 100644 ldap/cm/newinstnt/wizard.bmp create mode 100644 ldap/cm/ntpack.sh create mode 100755 ldap/cm/unixstrip create mode 100644 ldap/cm/unixstrip.pl create mode 100644 ldap/cm/v1confs/ns-calendar-globopt.conf create mode 100644 ldap/cm/v1confs/ns-calendar-schema.conf create mode 100644 ldap/cm/v1confs/ns-certificate-globopt.conf create mode 100644 ldap/cm/v1confs/ns-certificate-schema.conf create mode 100644 ldap/cm/v1confs/ns-compass-globopt.conf create mode 100644 ldap/cm/v1confs/ns-compass-schema.conf create mode 100644 ldap/cm/v1confs/ns-directory-globopt.conf create mode 100644 ldap/cm/v1confs/ns-directory-schema.conf create mode 100644 ldap/cm/v1confs/ns-mail-globopt.conf create mode 100644 ldap/cm/v1confs/ns-mail-schema.conf create mode 100644 ldap/cm/v1confs/ns-media-globopt.conf create mode 100644 ldap/cm/v1confs/ns-media-schema.conf create mode 100644 ldap/cm/v1confs/ns-news-globopt.conf create mode 100644 ldap/cm/v1confs/ns-news-schema.conf create mode 100644 ldap/cm/v1confs/ns-proxy-globopt.conf create mode 100644 ldap/cm/v1confs/ns-proxy-schema.conf create mode 100644 ldap/cm/v1confs/ns-web-globopt.conf create mode 100644 ldap/cm/v1confs/ns-web-schema.conf create mode 100644 ldap/cm/v1confs/slapd.at.conf create mode 100644 ldap/cm/v1confs/slapd.oc.conf create mode 100644 ldap/cm/v3confs/ns-calendar-globopt.conf create mode 100644 ldap/cm/v3confs/ns-calendar-schema.conf create mode 100644 ldap/cm/v3confs/ns-certificate-globopt.conf create mode 100644 ldap/cm/v3confs/ns-certificate-schema.conf create mode 100644 ldap/cm/v3confs/ns-compass-globopt.conf create mode 100644 ldap/cm/v3confs/ns-compass-schema.conf create mode 100644 ldap/cm/v3confs/ns-directory-globopt.conf create mode 100644 ldap/cm/v3confs/ns-directory-schema.conf create mode 100644 ldap/cm/v3confs/ns-mail-globopt.conf create mode 100644 ldap/cm/v3confs/ns-mail-schema.conf create mode 100644 ldap/cm/v3confs/ns-media-globopt.conf create mode 100644 ldap/cm/v3confs/ns-media-schema.conf create mode 100644 ldap/cm/v3confs/ns-news-globopt.conf create mode 100644 ldap/cm/v3confs/ns-news-schema.conf create mode 100644 ldap/cm/v3confs/ns-proxy-globopt.conf create mode 100644 ldap/cm/v3confs/ns-proxy-schema.conf create mode 100644 ldap/cm/v3confs/ns-web-globopt.conf create mode 100644 ldap/cm/v3confs/ns-web-schema.conf create mode 100644 ldap/cm/v3confs/slapd.at.conf create mode 100644 ldap/cm/v3confs/slapd.oc.conf create mode 100644 ldap/cm/v4confs/40/java-object-schema.conf create mode 100644 ldap/cm/v4confs/40/ns-admin-schema.conf create mode 100644 ldap/cm/v4confs/40/ns-calendar-globopt.conf create mode 100644 ldap/cm/v4confs/40/ns-calendar-schema.conf create mode 100644 ldap/cm/v4confs/40/ns-certificate-globopt.conf create mode 100644 ldap/cm/v4confs/40/ns-certificate-schema.conf create mode 100644 ldap/cm/v4confs/40/ns-common-schema.conf create mode 100644 ldap/cm/v4confs/40/ns-compass-globopt.conf create mode 100644 ldap/cm/v4confs/40/ns-compass-schema.conf create mode 100644 ldap/cm/v4confs/40/ns-cos-schema.conf create mode 100644 ldap/cm/v4confs/40/ns-delegated-admin-schema.conf create mode 100644 ldap/cm/v4confs/40/ns-directory-globopt.conf create mode 100644 ldap/cm/v4confs/40/ns-directory-schema.conf create mode 100644 ldap/cm/v4confs/40/ns-legacy-schema.conf create mode 100644 ldap/cm/v4confs/40/ns-mail-globopt.conf create mode 100644 ldap/cm/v4confs/40/ns-mail-schema.conf create mode 100644 ldap/cm/v4confs/40/ns-mcd-browser-schema.conf create mode 100644 ldap/cm/v4confs/40/ns-mcd-config-schema.conf create mode 100644 ldap/cm/v4confs/40/ns-mcd-li-globopt.conf create mode 100644 ldap/cm/v4confs/40/ns-mcd-li-schema.conf create mode 100644 ldap/cm/v4confs/40/ns-mcd-mail-schema.conf create mode 100644 ldap/cm/v4confs/40/ns-media-globopt.conf create mode 100644 ldap/cm/v4confs/40/ns-media-schema.conf create mode 100644 ldap/cm/v4confs/40/ns-mlm-schema.conf create mode 100644 ldap/cm/v4confs/40/ns-msg-schema.conf create mode 100644 ldap/cm/v4confs/40/ns-netshare-schema.conf create mode 100644 ldap/cm/v4confs/40/ns-news-globopt.conf create mode 100644 ldap/cm/v4confs/40/ns-news-schema.conf create mode 100644 ldap/cm/v4confs/40/ns-proxy-globopt.conf create mode 100644 ldap/cm/v4confs/40/ns-proxy-schema.conf create mode 100644 ldap/cm/v4confs/40/ns-value-schema.conf create mode 100644 ldap/cm/v4confs/40/ns-wcal-globopt.conf create mode 100644 ldap/cm/v4confs/40/ns-wcal-schema.conf create mode 100644 ldap/cm/v4confs/40/ns-web-globopt.conf create mode 100644 ldap/cm/v4confs/40/ns-web-schema.conf create mode 100644 ldap/cm/v4confs/40/slapd.at.conf create mode 100644 ldap/cm/v4confs/40/slapd.oc.conf create mode 100644 ldap/cm/v4confs/41/java-object-schema.conf create mode 100644 ldap/cm/v4confs/41/ns-admin-schema.conf create mode 100644 ldap/cm/v4confs/41/ns-calendar-globopt.conf create mode 100644 ldap/cm/v4confs/41/ns-calendar-schema.conf create mode 100644 ldap/cm/v4confs/41/ns-certificate-globopt.conf create mode 100644 ldap/cm/v4confs/41/ns-certificate-schema.conf create mode 100644 ldap/cm/v4confs/41/ns-common-schema.conf create mode 100644 ldap/cm/v4confs/41/ns-compass-globopt.conf create mode 100644 ldap/cm/v4confs/41/ns-compass-schema.conf create mode 100644 ldap/cm/v4confs/41/ns-cos-schema.conf create mode 100644 ldap/cm/v4confs/41/ns-delegated-admin-schema.conf create mode 100644 ldap/cm/v4confs/41/ns-directory-globopt.conf create mode 100644 ldap/cm/v4confs/41/ns-directory-schema.conf create mode 100644 ldap/cm/v4confs/41/ns-legacy-schema.conf create mode 100644 ldap/cm/v4confs/41/ns-mail-globopt.conf create mode 100644 ldap/cm/v4confs/41/ns-mail-schema.conf create mode 100644 ldap/cm/v4confs/41/ns-mcd-browser-schema.conf create mode 100644 ldap/cm/v4confs/41/ns-mcd-config-schema.conf create mode 100644 ldap/cm/v4confs/41/ns-mcd-li-globopt.conf create mode 100644 ldap/cm/v4confs/41/ns-mcd-li-schema.conf create mode 100644 ldap/cm/v4confs/41/ns-mcd-mail-schema.conf create mode 100644 ldap/cm/v4confs/41/ns-media-globopt.conf create mode 100644 ldap/cm/v4confs/41/ns-media-schema.conf create mode 100644 ldap/cm/v4confs/41/ns-mlm-schema.conf create mode 100644 ldap/cm/v4confs/41/ns-msg-schema.conf create mode 100644 ldap/cm/v4confs/41/ns-netshare-schema.conf create mode 100644 ldap/cm/v4confs/41/ns-news-globopt.conf create mode 100644 ldap/cm/v4confs/41/ns-news-schema.conf create mode 100644 ldap/cm/v4confs/41/ns-proxy-globopt.conf create mode 100644 ldap/cm/v4confs/41/ns-proxy-schema.conf create mode 100644 ldap/cm/v4confs/41/ns-value-schema.conf create mode 100644 ldap/cm/v4confs/41/ns-wcal-globopt.conf create mode 100644 ldap/cm/v4confs/41/ns-wcal-schema.conf create mode 100644 ldap/cm/v4confs/41/ns-web-globopt.conf create mode 100644 ldap/cm/v4confs/41/ns-web-schema.conf create mode 100644 ldap/cm/v4confs/41/slapd.at.conf create mode 100644 ldap/cm/v4confs/41/slapd.oc.conf create mode 100644 ldap/cm/v4confs/411/java-object-schema.conf create mode 100644 ldap/cm/v4confs/411/ns-admin-schema.conf create mode 100644 ldap/cm/v4confs/411/ns-calendar-globopt.conf create mode 100644 ldap/cm/v4confs/411/ns-calendar-schema.conf create mode 100644 ldap/cm/v4confs/411/ns-certificate-globopt.conf create mode 100644 ldap/cm/v4confs/411/ns-certificate-schema.conf create mode 100644 ldap/cm/v4confs/411/ns-common-schema.conf create mode 100644 ldap/cm/v4confs/411/ns-compass-globopt.conf create mode 100644 ldap/cm/v4confs/411/ns-compass-schema.conf create mode 100644 ldap/cm/v4confs/411/ns-cos-schema.conf create mode 100644 ldap/cm/v4confs/411/ns-delegated-admin-schema.conf create mode 100644 ldap/cm/v4confs/411/ns-directory-globopt.conf create mode 100644 ldap/cm/v4confs/411/ns-directory-schema.conf create mode 100644 ldap/cm/v4confs/411/ns-legacy-schema.conf create mode 100644 ldap/cm/v4confs/411/ns-mail-globopt.conf create mode 100644 ldap/cm/v4confs/411/ns-mail-schema.conf create mode 100644 ldap/cm/v4confs/411/ns-mcd-browser-schema.conf create mode 100644 ldap/cm/v4confs/411/ns-mcd-config-schema.conf create mode 100644 ldap/cm/v4confs/411/ns-mcd-li-globopt.conf create mode 100644 ldap/cm/v4confs/411/ns-mcd-li-schema.conf create mode 100644 ldap/cm/v4confs/411/ns-mcd-mail-schema.conf create mode 100644 ldap/cm/v4confs/411/ns-media-globopt.conf create mode 100644 ldap/cm/v4confs/411/ns-media-schema.conf create mode 100644 ldap/cm/v4confs/411/ns-mlm-schema.conf create mode 100644 ldap/cm/v4confs/411/ns-msg-schema.conf create mode 100644 ldap/cm/v4confs/411/ns-netshare-schema.conf create mode 100644 ldap/cm/v4confs/411/ns-news-globopt.conf create mode 100644 ldap/cm/v4confs/411/ns-news-schema.conf create mode 100644 ldap/cm/v4confs/411/ns-proxy-globopt.conf create mode 100644 ldap/cm/v4confs/411/ns-proxy-schema.conf create mode 100644 ldap/cm/v4confs/411/ns-value-schema.conf create mode 100644 ldap/cm/v4confs/411/ns-wcal-globopt.conf create mode 100644 ldap/cm/v4confs/411/ns-wcal-schema.conf create mode 100644 ldap/cm/v4confs/411/ns-web-globopt.conf create mode 100644 ldap/cm/v4confs/411/ns-web-schema.conf create mode 100644 ldap/cm/v4confs/411/slapd.at.conf create mode 100644 ldap/cm/v4confs/411/slapd.oc.conf create mode 100644 ldap/cm/v4confs/412/java-object-schema.conf create mode 100644 ldap/cm/v4confs/412/ns-admin-schema.conf create mode 100644 ldap/cm/v4confs/412/ns-calendar-globopt.conf create mode 100644 ldap/cm/v4confs/412/ns-calendar-schema.conf create mode 100644 ldap/cm/v4confs/412/ns-certificate-globopt.conf create mode 100644 ldap/cm/v4confs/412/ns-certificate-schema.conf create mode 100644 ldap/cm/v4confs/412/ns-common-schema.conf create mode 100644 ldap/cm/v4confs/412/ns-compass-globopt.conf create mode 100644 ldap/cm/v4confs/412/ns-compass-schema.conf create mode 100644 ldap/cm/v4confs/412/ns-cos-schema.conf create mode 100644 ldap/cm/v4confs/412/ns-delegated-admin-schema.conf create mode 100644 ldap/cm/v4confs/412/ns-directory-globopt.conf create mode 100644 ldap/cm/v4confs/412/ns-directory-schema.conf create mode 100644 ldap/cm/v4confs/412/ns-legacy-schema.conf create mode 100644 ldap/cm/v4confs/412/ns-mail-globopt.conf create mode 100644 ldap/cm/v4confs/412/ns-mail-schema.conf create mode 100644 ldap/cm/v4confs/412/ns-mcd-browser-schema.conf create mode 100644 ldap/cm/v4confs/412/ns-mcd-config-schema.conf create mode 100644 ldap/cm/v4confs/412/ns-mcd-li-globopt.conf create mode 100644 ldap/cm/v4confs/412/ns-mcd-li-schema.conf create mode 100644 ldap/cm/v4confs/412/ns-mcd-mail-schema.conf create mode 100644 ldap/cm/v4confs/412/ns-media-globopt.conf create mode 100644 ldap/cm/v4confs/412/ns-media-schema.conf create mode 100644 ldap/cm/v4confs/412/ns-mlm-schema.conf create mode 100644 ldap/cm/v4confs/412/ns-msg-schema.conf create mode 100644 ldap/cm/v4confs/412/ns-netshare-schema.conf create mode 100644 ldap/cm/v4confs/412/ns-news-globopt.conf create mode 100644 ldap/cm/v4confs/412/ns-news-schema.conf create mode 100644 ldap/cm/v4confs/412/ns-proxy-globopt.conf create mode 100644 ldap/cm/v4confs/412/ns-proxy-schema.conf create mode 100644 ldap/cm/v4confs/412/ns-value-schema.conf create mode 100644 ldap/cm/v4confs/412/ns-wcal-globopt.conf create mode 100644 ldap/cm/v4confs/412/ns-wcal-schema.conf create mode 100644 ldap/cm/v4confs/412/ns-web-globopt.conf create mode 100644 ldap/cm/v4confs/412/ns-web-schema.conf create mode 100644 ldap/cm/v4confs/412/slapd.at.conf create mode 100644 ldap/cm/v4confs/412/slapd.oc.conf create mode 100644 ldap/docs/LICENSE.txt create mode 100644 ldap/docs/README.txt create mode 100644 ldap/docs/dirhlp/Makefile create mode 100644 ldap/docs/dirhlp/dssynchhelp.z create mode 100644 ldap/docs/dirhlp/help/account_mgmt.htm create mode 100644 ldap/docs/dirhlp/help/adv_search.htm create mode 100644 ldap/docs/dirhlp/help/configtab_chaindb.htm create mode 100644 ldap/docs/dirhlp/help/configtab_chaindb2.htm create mode 100644 ldap/docs/dirhlp/help/configtab_chaindb3.htm create mode 100644 ldap/docs/dirhlp/help/configtab_chaindb4.htm create mode 100644 ldap/docs/dirhlp/help/configtab_chaindb5.htm create mode 100644 ldap/docs/dirhlp/help/configtab_chaindb6.htm create mode 100644 ldap/docs/dirhlp/help/configtab_chaindb7.htm create mode 100644 ldap/docs/dirhlp/help/configtab_db.htm create mode 100644 ldap/docs/dirhlp/help/configtab_db10.htm create mode 100644 ldap/docs/dirhlp/help/configtab_db11.htm create mode 100644 ldap/docs/dirhlp/help/configtab_db12.htm create mode 100644 ldap/docs/dirhlp/help/configtab_db13.htm create mode 100644 ldap/docs/dirhlp/help/configtab_db14.htm create mode 100644 ldap/docs/dirhlp/help/configtab_db15.htm create mode 100644 ldap/docs/dirhlp/help/configtab_db2.htm create mode 100644 ldap/docs/dirhlp/help/configtab_db3.htm create mode 100644 ldap/docs/dirhlp/help/configtab_db4.htm create mode 100644 ldap/docs/dirhlp/help/configtab_db5.htm create mode 100644 ldap/docs/dirhlp/help/configtab_db6.htm create mode 100644 ldap/docs/dirhlp/help/configtab_db7.htm create mode 100644 ldap/docs/dirhlp/help/configtab_db8.htm create mode 100644 ldap/docs/dirhlp/help/configtab_db9.htm create mode 100644 ldap/docs/dirhlp/help/configtab_ldbmdb.htm create mode 100644 ldap/docs/dirhlp/help/configtab_logs.htm create mode 100644 ldap/docs/dirhlp/help/configtab_logs2.htm create mode 100644 ldap/docs/dirhlp/help/configtab_logs3.htm create mode 100644 ldap/docs/dirhlp/help/configtab_maptree.htm create mode 100644 ldap/docs/dirhlp/help/configtab_maptree2.htm create mode 100644 ldap/docs/dirhlp/help/configtab_maptree3.htm create mode 100644 ldap/docs/dirhlp/help/configtab_maptree4.htm create mode 100644 ldap/docs/dirhlp/help/configtab_maptree5.htm create mode 100644 ldap/docs/dirhlp/help/configtab_maptree6.htm create mode 100644 ldap/docs/dirhlp/help/configtab_maptree7.htm create mode 100644 ldap/docs/dirhlp/help/configtab_plugins.htm create mode 100644 ldap/docs/dirhlp/help/configtab_replication.htm create mode 100644 ldap/docs/dirhlp/help/configtab_replication2.htm create mode 100644 ldap/docs/dirhlp/help/configtab_replication3.htm create mode 100644 ldap/docs/dirhlp/help/configtab_replication4.htm create mode 100644 ldap/docs/dirhlp/help/configtab_replication5.htm create mode 100644 ldap/docs/dirhlp/help/configtab_replication6.htm create mode 100644 ldap/docs/dirhlp/help/configtab_replication7.htm create mode 100644 ldap/docs/dirhlp/help/configtab_replication8.htm create mode 100644 ldap/docs/dirhlp/help/configtab_rootnode.htm create mode 100644 ldap/docs/dirhlp/help/configtab_rootnode2.htm create mode 100644 ldap/docs/dirhlp/help/configtab_rootnode3.htm create mode 100644 ldap/docs/dirhlp/help/configtab_rootnode4.htm create mode 100644 ldap/docs/dirhlp/help/configtab_rootnode5.htm create mode 100644 ldap/docs/dirhlp/help/configtab_rootnode6.htm create mode 100644 ldap/docs/dirhlp/help/configtab_rootnode7.htm create mode 100644 ldap/docs/dirhlp/help/configtab_rootnode8.htm create mode 100644 ldap/docs/dirhlp/help/configtab_rootnode9.htm create mode 100644 ldap/docs/dirhlp/help/configtab_schema.htm create mode 100644 ldap/docs/dirhlp/help/configtab_schema2.htm create mode 100644 ldap/docs/dirhlp/help/configtab_schema3.htm create mode 100644 ldap/docs/dirhlp/help/configtab_schema4.htm create mode 100644 ldap/docs/dirhlp/help/configtab_schema5.htm create mode 100644 ldap/docs/dirhlp/help/dir_browser.htm create mode 100644 ldap/docs/dirhlp/help/dir_browser2.htm create mode 100644 ldap/docs/dirhlp/help/dir_browser3.htm create mode 100644 ldap/docs/dirhlp/help/dir_browser4.htm create mode 100644 ldap/docs/dirhlp/help/dirtab_cos.htm create mode 100644 ldap/docs/dirhlp/help/dirtab_cos2.htm create mode 100644 ldap/docs/dirhlp/help/dirtab_cos3.htm create mode 100644 ldap/docs/dirhlp/help/dirtab_role.htm create mode 100644 ldap/docs/dirhlp/help/dirtab_role2.htm create mode 100644 ldap/docs/dirhlp/help/dirtab_role3.htm create mode 100644 ldap/docs/dirhlp/help/dirtab_role4.htm create mode 100644 ldap/docs/dirhlp/help/dirtab_role5.htm create mode 100644 ldap/docs/dirhlp/help/dirtab_role6.htm create mode 100644 ldap/docs/dirhlp/help/dirtab_role7.htm create mode 100644 ldap/docs/dirhlp/help/helpmenu.htm create mode 100644 ldap/docs/dirhlp/help/ix.htm create mode 100644 ldap/docs/dirhlp/help/ldapurl.htm create mode 100644 ldap/docs/dirhlp/help/netscape32.gif create mode 100644 ldap/docs/dirhlp/help/new_instance.htm create mode 100644 ldap/docs/dirhlp/help/pixel.gif create mode 100644 ldap/docs/dirhlp/help/property_editor.htm create mode 100644 ldap/docs/dirhlp/help/property_editor2.htm create mode 100644 ldap/docs/dirhlp/help/property_editor3.htm create mode 100644 ldap/docs/dirhlp/help/property_editor4.htm create mode 100644 ldap/docs/dirhlp/help/redir_agtoc.htm create mode 100644 ldap/docs/dirhlp/help/redir_dochome.htm create mode 100644 ldap/docs/dirhlp/help/replication_wizard.htm create mode 100644 ldap/docs/dirhlp/help/replication_wizard2.htm create mode 100644 ldap/docs/dirhlp/help/replication_wizard3.htm create mode 100644 ldap/docs/dirhlp/help/replication_wizard4.htm create mode 100644 ldap/docs/dirhlp/help/replication_wizard5.htm create mode 100755 ldap/docs/dirhlp/help/sniffer.js create mode 100644 ldap/docs/dirhlp/help/statustab_general.htm create mode 100644 ldap/docs/dirhlp/help/statustab_logs.htm create mode 100644 ldap/docs/dirhlp/help/statustab_logs2.htm create mode 100644 ldap/docs/dirhlp/help/statustab_logs3.htm create mode 100644 ldap/docs/dirhlp/help/statustab_performance.htm create mode 100644 ldap/docs/dirhlp/help/statustab_performance2.htm create mode 100644 ldap/docs/dirhlp/help/statustab_replication.htm create mode 100644 ldap/docs/dirhlp/help/taskstab_bkup_restore.htm create mode 100644 ldap/docs/dirhlp/help/taskstab_bkup_restore2.htm create mode 100644 ldap/docs/dirhlp/help/topics.htm create mode 100644 ldap/docs/dirhlp/index.htm create mode 100644 ldap/docs/dirhlp/index.map create mode 100644 ldap/docs/dirhlp/pixel.gif create mode 100644 ldap/docs/dirhlp/tokens.map create mode 100644 ldap/docs/dirhlp/topicindex.htm create mode 100644 ldap/dsml/European.dsml create mode 100644 ldap/dsml/Example-roles.dsml create mode 100644 ldap/dsml/Example.dsml create mode 100644 ldap/include/Makefile create mode 100644 ldap/include/Makefile.client create mode 100644 ldap/include/avl.h create mode 100644 ldap/include/dblayer.h create mode 100644 ldap/include/dirlite_strings.h create mode 100644 ldap/include/disptmpl.h create mode 100644 ldap/include/ldaplog.h create mode 100644 ldap/include/ldaprot.h create mode 100644 ldap/include/ldbm.h create mode 100644 ldap/include/ldif.h create mode 100644 ldap/include/litekey.h create mode 100644 ldap/include/lthread.h create mode 100644 ldap/include/ntslapdregparms.h create mode 100644 ldap/include/ntwatchdog.h create mode 100644 ldap/include/portable.h create mode 100644 ldap/include/proto-ntutil.h create mode 100644 ldap/include/regex.h create mode 100644 ldap/include/srchpref.h create mode 100644 ldap/include/sysexits-compat.h create mode 100644 ldap/javarules.mk create mode 100644 ldap/ldif/Ace.ldif create mode 100644 ldap/ldif/European.ldif create mode 100644 ldap/ldif/Eurosuffix.ldif create mode 100644 ldap/ldif/Example-roles.ldif create mode 100644 ldap/ldif/Example-views.ldif create mode 100644 ldap/ldif/Example.ldif create mode 100644 ldap/ldif/commonTasks.ldif create mode 100644 ldap/ldif/roledit.ldif create mode 100644 ldap/ldif/tasks.ldif create mode 100644 ldap/ldif/template.ldif create mode 100644 ldap/libraries/Makefile create mode 100644 ldap/libraries/Makefile.client create mode 100644 ldap/libraries/libavl/Makefile create mode 100644 ldap/libraries/libavl/avl.c create mode 100644 ldap/libraries/libavl/testavl.c create mode 100644 ldap/libraries/libldif/Makefile create mode 100644 ldap/libraries/libldif/fileurl.c create mode 100644 ldap/libraries/libldif/fileurl.h create mode 100644 ldap/libraries/libldif/line64.c create mode 100644 ldap/libraries/liblitekey/Makefile create mode 100644 ldap/libraries/liblitekey/keycheck.c create mode 100644 ldap/libraries/libutil/Makefile create mode 100644 ldap/libraries/libutil/getopt.c create mode 100644 ldap/libraries/libutil/ntdebug.c create mode 100644 ldap/libraries/libutil/ntevent.c create mode 100644 ldap/libraries/libutil/ntreg.c create mode 100644 ldap/libraries/libutil/ntresource.h create mode 100644 ldap/libraries/libutil/ntstubs.c create mode 100644 ldap/nsdeps.mk create mode 100644 ldap/nsldap.mk create mode 100644 ldap/schema/00core.ldif create mode 100644 ldap/schema/05rfc2247.ldif create mode 100644 ldap/schema/05rfc2927.ldif create mode 100644 ldap/schema/10presence.ldif create mode 100644 ldap/schema/10rfc2307.ldif create mode 100644 ldap/schema/20subscriber.ldif create mode 100644 ldap/schema/25java-object.ldif create mode 100644 ldap/schema/28pilot.ldif create mode 100644 ldap/schema/30ns-common.ldif create mode 100644 ldap/schema/50ns-admin.ldif create mode 100644 ldap/schema/50ns-calendar.ldif create mode 100644 ldap/schema/50ns-certificate.ldif create mode 100644 ldap/schema/50ns-compass.ldif create mode 100644 ldap/schema/50ns-delegated-admin.ldif create mode 100644 ldap/schema/50ns-directory.ldif create mode 100644 ldap/schema/50ns-legacy.ldif create mode 100644 ldap/schema/50ns-mail.ldif create mode 100644 ldap/schema/50ns-mcd-browser.ldif create mode 100644 ldap/schema/50ns-mcd-config.ldif create mode 100644 ldap/schema/50ns-mcd-li.ldif create mode 100644 ldap/schema/50ns-mcd-mail.ldif create mode 100644 ldap/schema/50ns-media.ldif create mode 100644 ldap/schema/50ns-mlm.ldif create mode 100644 ldap/schema/50ns-msg.ldif create mode 100644 ldap/schema/50ns-netshare.ldif create mode 100644 ldap/schema/50ns-news.ldif create mode 100644 ldap/schema/50ns-proxy.ldif create mode 100644 ldap/schema/50ns-value.ldif create mode 100644 ldap/schema/50ns-wcal.ldif create mode 100644 ldap/schema/50ns-web.ldif create mode 100644 ldap/schema/51ns-calendar.ldif create mode 100644 ldap/schema/99user.ldif create mode 100644 ldap/schema/ns-calendar-globopt.conf create mode 100644 ldap/schema/ns-certificate-globopt.conf create mode 100644 ldap/schema/ns-compass-globopt.conf create mode 100644 ldap/schema/ns-directory-globopt.conf create mode 100644 ldap/schema/ns-mail-globopt.conf create mode 100644 ldap/schema/ns-mcd-li-globopt.conf create mode 100644 ldap/schema/ns-media-globopt.conf create mode 100644 ldap/schema/ns-news-globopt.conf create mode 100644 ldap/schema/ns-proxy-globopt.conf create mode 100644 ldap/schema/ns-wcal-globopt.conf create mode 100644 ldap/schema/ns-web-globopt.conf create mode 100644 ldap/schema/slapd-collations.conf create mode 100644 ldap/servers/Makefile create mode 100644 ldap/servers/plugins/Makefile create mode 100644 ldap/servers/plugins/acl/ACL-Notes create mode 100644 ldap/servers/plugins/acl/Makefile create mode 100644 ldap/servers/plugins/acl/acl.c create mode 100644 ldap/servers/plugins/acl/acl.h create mode 100644 ldap/servers/plugins/acl/acl_ext.c create mode 100644 ldap/servers/plugins/acl/aclanom.c create mode 100644 ldap/servers/plugins/acl/acldllmain.c create mode 100644 ldap/servers/plugins/acl/acleffectiverights.c create mode 100644 ldap/servers/plugins/acl/aclgroup.c create mode 100644 ldap/servers/plugins/acl/aclinit.c create mode 100644 ldap/servers/plugins/acl/acllas.c create mode 100644 ldap/servers/plugins/acl/acllist.c create mode 100644 ldap/servers/plugins/acl/aclparse.c create mode 100644 ldap/servers/plugins/acl/aclplugin.c create mode 100644 ldap/servers/plugins/acl/aclproxy.c create mode 100644 ldap/servers/plugins/acl/aclutil.c create mode 100644 ldap/servers/plugins/acl/libacl.def create mode 100644 ldap/servers/plugins/chainingdb/Makefile create mode 100644 ldap/servers/plugins/chainingdb/cb.h create mode 100644 ldap/servers/plugins/chainingdb/cb_abandon.c create mode 100644 ldap/servers/plugins/chainingdb/cb_acl.c create mode 100644 ldap/servers/plugins/chainingdb/cb_add.c create mode 100644 ldap/servers/plugins/chainingdb/cb_bind.c create mode 100644 ldap/servers/plugins/chainingdb/cb_cleanup.c create mode 100644 ldap/servers/plugins/chainingdb/cb_close.c create mode 100644 ldap/servers/plugins/chainingdb/cb_compare.c create mode 100644 ldap/servers/plugins/chainingdb/cb_config.c create mode 100644 ldap/servers/plugins/chainingdb/cb_conn_stateless.c create mode 100644 ldap/servers/plugins/chainingdb/cb_controls.c create mode 100644 ldap/servers/plugins/chainingdb/cb_debug.c create mode 100644 ldap/servers/plugins/chainingdb/cb_delete.c create mode 100644 ldap/servers/plugins/chainingdb/cb_init.c create mode 100644 ldap/servers/plugins/chainingdb/cb_instance.c create mode 100644 ldap/servers/plugins/chainingdb/cb_modify.c create mode 100644 ldap/servers/plugins/chainingdb/cb_modrdn.c create mode 100644 ldap/servers/plugins/chainingdb/cb_monitor.c create mode 100644 ldap/servers/plugins/chainingdb/cb_schema.c create mode 100644 ldap/servers/plugins/chainingdb/cb_search.c create mode 100644 ldap/servers/plugins/chainingdb/cb_size.c create mode 100644 ldap/servers/plugins/chainingdb/cb_start.c create mode 100644 ldap/servers/plugins/chainingdb/cb_temp.c create mode 100644 ldap/servers/plugins/chainingdb/cb_test.c create mode 100644 ldap/servers/plugins/chainingdb/cb_unbind.c create mode 100644 ldap/servers/plugins/chainingdb/cb_utils.c create mode 100644 ldap/servers/plugins/chainingdb/cbdllmain.c create mode 100644 ldap/servers/plugins/chainingdb/libcb.def create mode 100644 ldap/servers/plugins/collation/Makefile create mode 100644 ldap/servers/plugins/collation/collate.c create mode 100644 ldap/servers/plugins/collation/collate.h create mode 100644 ldap/servers/plugins/collation/collation.def create mode 100644 ldap/servers/plugins/collation/config.c create mode 100644 ldap/servers/plugins/collation/config.h create mode 100644 ldap/servers/plugins/collation/debug.c create mode 100644 ldap/servers/plugins/collation/dllmain.c create mode 100644 ldap/servers/plugins/collation/orfilter.c create mode 100644 ldap/servers/plugins/collation/orfilter.h create mode 100644 ldap/servers/plugins/cos/Makefile create mode 100644 ldap/servers/plugins/cos/cos.c create mode 100644 ldap/servers/plugins/cos/cos.def create mode 100644 ldap/servers/plugins/cos/cos_cache.c create mode 100644 ldap/servers/plugins/cos/cos_cache.h create mode 100644 ldap/servers/plugins/cos/dllmain.c create mode 100644 ldap/servers/plugins/distrib/Makefile create mode 100644 ldap/servers/plugins/distrib/Makefile.AIX create mode 100644 ldap/servers/plugins/distrib/Makefile.BSDI create mode 100644 ldap/servers/plugins/distrib/Makefile.HPUX create mode 100644 ldap/servers/plugins/distrib/Makefile.HPUX64 create mode 100644 ldap/servers/plugins/distrib/Makefile.IRIX create mode 100644 ldap/servers/plugins/distrib/Makefile.Linux create mode 100644 ldap/servers/plugins/distrib/Makefile.OSF1 create mode 100644 ldap/servers/plugins/distrib/Makefile.ReliantUNIX create mode 100644 ldap/servers/plugins/distrib/Makefile.SOLARIS create mode 100644 ldap/servers/plugins/distrib/Makefile.SOLARIS64 create mode 100644 ldap/servers/plugins/distrib/Makefile.SOLARISx86 create mode 100644 ldap/servers/plugins/distrib/Makefile.UnixWare create mode 100644 ldap/servers/plugins/distrib/Makefile.UnixWareUDK create mode 100644 ldap/servers/plugins/distrib/Makefile.WINNT create mode 100644 ldap/servers/plugins/distrib/README create mode 100644 ldap/servers/plugins/distrib/distrib.c create mode 100644 ldap/servers/plugins/distrib/distrib.dsp create mode 100644 ldap/servers/plugins/distrib/dllmain.c create mode 100644 ldap/servers/plugins/distrib/libdistrib.def create mode 100644 ldap/servers/plugins/http/Makefile create mode 100644 ldap/servers/plugins/http/dllmain.c create mode 100644 ldap/servers/plugins/http/http.def create mode 100644 ldap/servers/plugins/http/http_client.c create mode 100644 ldap/servers/plugins/http/http_client.h create mode 100644 ldap/servers/plugins/http/http_impl.c create mode 100644 ldap/servers/plugins/http/http_impl.h create mode 100644 ldap/servers/plugins/passthru/Makefile create mode 100644 ldap/servers/plugins/passthru/PT-Notes create mode 100644 ldap/servers/plugins/passthru/libpassthru.def create mode 100644 ldap/servers/plugins/passthru/passthru.h create mode 100644 ldap/servers/plugins/passthru/ptbind.c create mode 100644 ldap/servers/plugins/passthru/ptconfig.c create mode 100644 ldap/servers/plugins/passthru/ptconn.c create mode 100644 ldap/servers/plugins/passthru/ptdebug.c create mode 100644 ldap/servers/plugins/passthru/ptdllmain.c create mode 100644 ldap/servers/plugins/passthru/ptpreop.c create mode 100644 ldap/servers/plugins/passthru/ptutil.c create mode 100644 ldap/servers/plugins/presence/Makefile create mode 100644 ldap/servers/plugins/presence/dllmain.c create mode 100644 ldap/servers/plugins/presence/images/aim-offline.gif create mode 100644 ldap/servers/plugins/presence/images/aim-online.gif create mode 100644 ldap/servers/plugins/presence/images/icq-disabled.gif create mode 100644 ldap/servers/plugins/presence/images/icq-offline.gif create mode 100644 ldap/servers/plugins/presence/images/icq-online.gif create mode 100644 ldap/servers/plugins/presence/images/yahoo-offline.gif create mode 100644 ldap/servers/plugins/presence/images/yahoo-online.gif create mode 100644 ldap/servers/plugins/presence/presence.c create mode 100644 ldap/servers/plugins/presence/presence.def create mode 100644 ldap/servers/plugins/presence/presence.ldif create mode 100644 ldap/servers/plugins/pwdstorage/Makefile create mode 100644 ldap/servers/plugins/pwdstorage/clear_pwd.c create mode 100644 ldap/servers/plugins/pwdstorage/crypt_pwd.c create mode 100644 ldap/servers/plugins/pwdstorage/dllmain.c create mode 100644 ldap/servers/plugins/pwdstorage/libpwdstorage.def create mode 100644 ldap/servers/plugins/pwdstorage/md5.h create mode 100644 ldap/servers/plugins/pwdstorage/md5c.c create mode 100644 ldap/servers/plugins/pwdstorage/ns-mta-md5_pwd.bu create mode 100644 ldap/servers/plugins/pwdstorage/ns-mta-md5_pwd.c create mode 100644 ldap/servers/plugins/pwdstorage/pwd_init.c create mode 100644 ldap/servers/plugins/pwdstorage/pwdstorage.h create mode 100644 ldap/servers/plugins/pwdstorage/sha_pwd.c create mode 100644 ldap/servers/plugins/pwdstorage/ssha_pwd.c create mode 100644 ldap/servers/plugins/referint/Makefile create mode 100644 ldap/servers/plugins/referint/dllmain.c create mode 100644 ldap/servers/plugins/referint/referint.c create mode 100644 ldap/servers/plugins/referint/referint.def create mode 100644 ldap/servers/plugins/replication/Makefile create mode 100644 ldap/servers/plugins/replication/cl4.h create mode 100644 ldap/servers/plugins/replication/cl4_api.c create mode 100644 ldap/servers/plugins/replication/cl4_api.h create mode 100644 ldap/servers/plugins/replication/cl4_init.c create mode 100644 ldap/servers/plugins/replication/cl5.h create mode 100644 ldap/servers/plugins/replication/cl5_api.c create mode 100644 ldap/servers/plugins/replication/cl5_api.h create mode 100644 ldap/servers/plugins/replication/cl5_clcache.c create mode 100644 ldap/servers/plugins/replication/cl5_clcache.h create mode 100644 ldap/servers/plugins/replication/cl5_config.c create mode 100644 ldap/servers/plugins/replication/cl5_init.c create mode 100644 ldap/servers/plugins/replication/cl5_test.c create mode 100644 ldap/servers/plugins/replication/cl5_test.h create mode 100644 ldap/servers/plugins/replication/csnpl.c create mode 100644 ldap/servers/plugins/replication/csnpl.h create mode 100644 ldap/servers/plugins/replication/dllmain.c create mode 100644 ldap/servers/plugins/replication/legacy_consumer.c create mode 100644 ldap/servers/plugins/replication/llist.c create mode 100644 ldap/servers/plugins/replication/llist.h create mode 100644 ldap/servers/plugins/replication/profile.c create mode 100644 ldap/servers/plugins/replication/repl.h create mode 100644 ldap/servers/plugins/replication/repl5.h create mode 100644 ldap/servers/plugins/replication/repl5_agmt.c create mode 100644 ldap/servers/plugins/replication/repl5_agmtlist.c create mode 100644 ldap/servers/plugins/replication/repl5_backoff.c create mode 100644 ldap/servers/plugins/replication/repl5_connection.c create mode 100644 ldap/servers/plugins/replication/repl5_inc_protocol.c create mode 100644 ldap/servers/plugins/replication/repl5_init.c create mode 100644 ldap/servers/plugins/replication/repl5_mtnode_ext.c create mode 100644 ldap/servers/plugins/replication/repl5_plugins.c create mode 100644 ldap/servers/plugins/replication/repl5_prot_private.h create mode 100644 ldap/servers/plugins/replication/repl5_protocol.c create mode 100644 ldap/servers/plugins/replication/repl5_protocol_util.c create mode 100644 ldap/servers/plugins/replication/repl5_replica.c create mode 100644 ldap/servers/plugins/replication/repl5_replica_config.c create mode 100644 ldap/servers/plugins/replication/repl5_replica_dnhash.c create mode 100644 ldap/servers/plugins/replication/repl5_replica_hash.c create mode 100644 ldap/servers/plugins/replication/repl5_replsupplier.c create mode 100644 ldap/servers/plugins/replication/repl5_ruv.c create mode 100644 ldap/servers/plugins/replication/repl5_ruv.h create mode 100644 ldap/servers/plugins/replication/repl5_schedule.c create mode 100644 ldap/servers/plugins/replication/repl5_tot_protocol.c create mode 100644 ldap/servers/plugins/replication/repl5_total.c create mode 100644 ldap/servers/plugins/replication/repl5_updatedn_list.c create mode 100644 ldap/servers/plugins/replication/repl_add.c create mode 100644 ldap/servers/plugins/replication/repl_bind.c create mode 100644 ldap/servers/plugins/replication/repl_compare.c create mode 100644 ldap/servers/plugins/replication/repl_connext.c create mode 100644 ldap/servers/plugins/replication/repl_controls.c create mode 100644 ldap/servers/plugins/replication/repl_delete.c create mode 100644 ldap/servers/plugins/replication/repl_entry.c create mode 100644 ldap/servers/plugins/replication/repl_ext.c create mode 100644 ldap/servers/plugins/replication/repl_extop.c create mode 100644 ldap/servers/plugins/replication/repl_globals.c create mode 100644 ldap/servers/plugins/replication/repl_helper.c create mode 100644 ldap/servers/plugins/replication/repl_helper.h create mode 100644 ldap/servers/plugins/replication/repl_init.c create mode 100644 ldap/servers/plugins/replication/repl_modify.c create mode 100644 ldap/servers/plugins/replication/repl_modrdn.c create mode 100644 ldap/servers/plugins/replication/repl_monitor.c create mode 100644 ldap/servers/plugins/replication/repl_objset.c create mode 100644 ldap/servers/plugins/replication/repl_objset.h create mode 100644 ldap/servers/plugins/replication/repl_opext.c create mode 100644 ldap/servers/plugins/replication/repl_ops.c create mode 100644 ldap/servers/plugins/replication/repl_rootdse.c create mode 100644 ldap/servers/plugins/replication/repl_search.c create mode 100644 ldap/servers/plugins/replication/repl_shared.h create mode 100644 ldap/servers/plugins/replication/replication.def create mode 100644 ldap/servers/plugins/replication/replutil.c create mode 100644 ldap/servers/plugins/replication/tests/dnp_sim.c create mode 100644 ldap/servers/plugins/replication/tests/dnp_sim2.c create mode 100644 ldap/servers/plugins/replication/tests/dnp_sim3.c create mode 100755 ldap/servers/plugins/replication/tests/makesim create mode 100644 ldap/servers/plugins/replication/urp.c create mode 100644 ldap/servers/plugins/replication/urp.h create mode 100644 ldap/servers/plugins/replication/urp_glue.c create mode 100644 ldap/servers/plugins/replication/urp_tombstone.c create mode 100644 ldap/servers/plugins/retrocl/Makefile create mode 100644 ldap/servers/plugins/retrocl/dllmain.c create mode 100644 ldap/servers/plugins/retrocl/linktest.c create mode 100644 ldap/servers/plugins/retrocl/retrocl.c create mode 100644 ldap/servers/plugins/retrocl/retrocl.def create mode 100644 ldap/servers/plugins/retrocl/retrocl.h create mode 100644 ldap/servers/plugins/retrocl/retrocl.txt create mode 100644 ldap/servers/plugins/retrocl/retrocl_cn.c create mode 100644 ldap/servers/plugins/retrocl/retrocl_create.c create mode 100644 ldap/servers/plugins/retrocl/retrocl_po.c create mode 100644 ldap/servers/plugins/retrocl/retrocl_rootdse.c create mode 100644 ldap/servers/plugins/retrocl/retrocl_trim.c create mode 100644 ldap/servers/plugins/rever/Makefile create mode 100644 ldap/servers/plugins/rever/des.c create mode 100644 ldap/servers/plugins/rever/dllmain.c create mode 100644 ldap/servers/plugins/rever/libdes.def create mode 100644 ldap/servers/plugins/rever/rever.c create mode 100644 ldap/servers/plugins/rever/rever.h create mode 100644 ldap/servers/plugins/roles/Makefile create mode 100644 ldap/servers/plugins/roles/dllmain.c create mode 100644 ldap/servers/plugins/roles/roles.def create mode 100644 ldap/servers/plugins/roles/roles_cache.c create mode 100644 ldap/servers/plugins/roles/roles_cache.h create mode 100644 ldap/servers/plugins/roles/roles_plugin.c create mode 100644 ldap/servers/plugins/shared/Makefile create mode 100644 ldap/servers/plugins/shared/plugin-utils.h create mode 100644 ldap/servers/plugins/shared/utils.c create mode 100644 ldap/servers/plugins/statechange/Makefile create mode 100644 ldap/servers/plugins/statechange/dllmain.c create mode 100644 ldap/servers/plugins/statechange/statechange.c create mode 100644 ldap/servers/plugins/statechange/statechange.def create mode 100644 ldap/servers/plugins/syntaxes/Makefile create mode 100644 ldap/servers/plugins/syntaxes/bin.c create mode 100644 ldap/servers/plugins/syntaxes/ces.c create mode 100644 ldap/servers/plugins/syntaxes/cis.c create mode 100644 ldap/servers/plugins/syntaxes/debug.c create mode 100644 ldap/servers/plugins/syntaxes/dllmain.c create mode 100644 ldap/servers/plugins/syntaxes/dn.c create mode 100644 ldap/servers/plugins/syntaxes/int.c create mode 100644 ldap/servers/plugins/syntaxes/libsyntax.def create mode 100644 ldap/servers/plugins/syntaxes/phonetic.c create mode 100644 ldap/servers/plugins/syntaxes/sicis.c create mode 100644 ldap/servers/plugins/syntaxes/string.c create mode 100644 ldap/servers/plugins/syntaxes/syntax.h create mode 100644 ldap/servers/plugins/syntaxes/tel.c create mode 100644 ldap/servers/plugins/syntaxes/value.c create mode 100644 ldap/servers/plugins/uiduniq/7bit.c create mode 100644 ldap/servers/plugins/uiduniq/Makefile create mode 100644 ldap/servers/plugins/uiduniq/UID-Notes create mode 100644 ldap/servers/plugins/uiduniq/libuiduniq.def create mode 100644 ldap/servers/plugins/uiduniq/uid.c create mode 100644 ldap/servers/plugins/vattrsp_template/Makefile create mode 100644 ldap/servers/plugins/vattrsp_template/dllmain.c create mode 100644 ldap/servers/plugins/vattrsp_template/vattrsp.c create mode 100644 ldap/servers/plugins/vattrsp_template/vattrsp.def create mode 100644 ldap/servers/plugins/views/Makefile create mode 100644 ldap/servers/plugins/views/dllmain.c create mode 100644 ldap/servers/plugins/views/views.c create mode 100644 ldap/servers/plugins/views/views.def create mode 100644 ldap/servers/slapd/Makefile create mode 100644 ldap/servers/slapd/abandon.c create mode 100644 ldap/servers/slapd/add.c create mode 100644 ldap/servers/slapd/agtmmap.c create mode 100644 ldap/servers/slapd/agtmmap.h create mode 100644 ldap/servers/slapd/apibroker.c create mode 100644 ldap/servers/slapd/attr.c create mode 100644 ldap/servers/slapd/attrlist.c create mode 100644 ldap/servers/slapd/attrsyntax.c create mode 100644 ldap/servers/slapd/auditlog.c create mode 100644 ldap/servers/slapd/auth.c create mode 100644 ldap/servers/slapd/auth.h create mode 100644 ldap/servers/slapd/ava.c create mode 100644 ldap/servers/slapd/back-ldbm/Makefile create mode 100644 ldap/servers/slapd/back-ldbm/ancestorid.c create mode 100644 ldap/servers/slapd/back-ldbm/archive.c create mode 100644 ldap/servers/slapd/back-ldbm/attrcrypt.h create mode 100644 ldap/servers/slapd/back-ldbm/back-ldbm.h create mode 100644 ldap/servers/slapd/back-ldbm/backentry.c create mode 100644 ldap/servers/slapd/back-ldbm/cache.c create mode 100644 ldap/servers/slapd/back-ldbm/cleanup.c create mode 100644 ldap/servers/slapd/back-ldbm/close.c create mode 100644 ldap/servers/slapd/back-ldbm/dblayer.c create mode 100644 ldap/servers/slapd/back-ldbm/dblayer.h create mode 100644 ldap/servers/slapd/back-ldbm/dbsize.c create mode 100644 ldap/servers/slapd/back-ldbm/dbtest.c create mode 100644 ldap/servers/slapd/back-ldbm/dbversion.c create mode 100644 ldap/servers/slapd/back-ldbm/dllmain.c create mode 100644 ldap/servers/slapd/back-ldbm/dn2entry.c create mode 100644 ldap/servers/slapd/back-ldbm/entrystore.c create mode 100644 ldap/servers/slapd/back-ldbm/filterindex.c create mode 100644 ldap/servers/slapd/back-ldbm/findentry.c create mode 100644 ldap/servers/slapd/back-ldbm/haschildren.c create mode 100644 ldap/servers/slapd/back-ldbm/id2entry.c create mode 100644 ldap/servers/slapd/back-ldbm/idl.c create mode 100644 ldap/servers/slapd/back-ldbm/idl_common.c create mode 100644 ldap/servers/slapd/back-ldbm/idl_new.c create mode 100644 ldap/servers/slapd/back-ldbm/idl_shim.c create mode 100644 ldap/servers/slapd/back-ldbm/idlapi.h create mode 100644 ldap/servers/slapd/back-ldbm/import-merge.c create mode 100644 ldap/servers/slapd/back-ldbm/import-threads.c create mode 100644 ldap/servers/slapd/back-ldbm/import.c create mode 100644 ldap/servers/slapd/back-ldbm/import.h create mode 100644 ldap/servers/slapd/back-ldbm/index.c create mode 100644 ldap/servers/slapd/back-ldbm/init.c create mode 100644 ldap/servers/slapd/back-ldbm/instance.c create mode 100644 ldap/servers/slapd/back-ldbm/ldbm_abandon.c create mode 100644 ldap/servers/slapd/back-ldbm/ldbm_add.c create mode 100644 ldap/servers/slapd/back-ldbm/ldbm_attr.c create mode 100644 ldap/servers/slapd/back-ldbm/ldbm_attrcrypt.c create mode 100644 ldap/servers/slapd/back-ldbm/ldbm_attrcrypt_config.c create mode 100644 ldap/servers/slapd/back-ldbm/ldbm_bind.c create mode 100644 ldap/servers/slapd/back-ldbm/ldbm_compare.c create mode 100644 ldap/servers/slapd/back-ldbm/ldbm_config.c create mode 100644 ldap/servers/slapd/back-ldbm/ldbm_config.h create mode 100644 ldap/servers/slapd/back-ldbm/ldbm_delete.c create mode 100644 ldap/servers/slapd/back-ldbm/ldbm_index_config.c create mode 100644 ldap/servers/slapd/back-ldbm/ldbm_instance_config.c create mode 100644 ldap/servers/slapd/back-ldbm/ldbm_modify.c create mode 100644 ldap/servers/slapd/back-ldbm/ldbm_modrdn.c create mode 100644 ldap/servers/slapd/back-ldbm/ldbm_search.c create mode 100644 ldap/servers/slapd/back-ldbm/ldbm_unbind.c create mode 100644 ldap/servers/slapd/back-ldbm/ldif2ldbm.c create mode 100644 ldap/servers/slapd/back-ldbm/libback-ldbm.def create mode 100644 ldap/servers/slapd/back-ldbm/matchrule.c create mode 100644 ldap/servers/slapd/back-ldbm/misc.c create mode 100644 ldap/servers/slapd/back-ldbm/monitor.c create mode 100644 ldap/servers/slapd/back-ldbm/nextid.c create mode 100644 ldap/servers/slapd/back-ldbm/parents.c create mode 100644 ldap/servers/slapd/back-ldbm/perfctrs.c create mode 100644 ldap/servers/slapd/back-ldbm/perfctrs.h create mode 100644 ldap/servers/slapd/back-ldbm/proto-back-ldbm.h create mode 100644 ldap/servers/slapd/back-ldbm/rmdb.c create mode 100644 ldap/servers/slapd/back-ldbm/seq.c create mode 100644 ldap/servers/slapd/back-ldbm/sort.c create mode 100644 ldap/servers/slapd/back-ldbm/start.c create mode 100644 ldap/servers/slapd/back-ldbm/tools/index_dump/Makefile create mode 100644 ldap/servers/slapd/back-ldbm/tools/index_dump/index_dump.c create mode 100644 ldap/servers/slapd/back-ldbm/uniqueid2entry.c create mode 100644 ldap/servers/slapd/back-ldbm/upgrade.c create mode 100644 ldap/servers/slapd/back-ldbm/vlv.c create mode 100644 ldap/servers/slapd/back-ldbm/vlv_key.c create mode 100644 ldap/servers/slapd/back-ldbm/vlv_key.h create mode 100644 ldap/servers/slapd/back-ldbm/vlv_srch.c create mode 100644 ldap/servers/slapd/back-ldbm/vlv_srch.h create mode 100644 ldap/servers/slapd/back-ldif/Makefile create mode 100644 ldap/servers/slapd/back-ldif/add.c create mode 100644 ldap/servers/slapd/back-ldif/back-ldif.h create mode 100644 ldap/servers/slapd/back-ldif/bind.c create mode 100644 ldap/servers/slapd/back-ldif/close.c create mode 100644 ldap/servers/slapd/back-ldif/compare.c create mode 100644 ldap/servers/slapd/back-ldif/config.c create mode 100644 ldap/servers/slapd/back-ldif/delete.c create mode 100644 ldap/servers/slapd/back-ldif/dllmain.c create mode 100644 ldap/servers/slapd/back-ldif/init.c create mode 100644 ldap/servers/slapd/back-ldif/libback-ldif.def create mode 100644 ldap/servers/slapd/back-ldif/modify.c create mode 100644 ldap/servers/slapd/back-ldif/modrdn.c create mode 100644 ldap/servers/slapd/back-ldif/monitor.c create mode 100644 ldap/servers/slapd/back-ldif/search.c create mode 100644 ldap/servers/slapd/back-ldif/start.c create mode 100644 ldap/servers/slapd/back-ldif/unbind.c create mode 100644 ldap/servers/slapd/backend.c create mode 100644 ldap/servers/slapd/backend_manager.c create mode 100644 ldap/servers/slapd/bind.c create mode 100644 ldap/servers/slapd/bitset.c create mode 100644 ldap/servers/slapd/bulk_import.c create mode 100644 ldap/servers/slapd/ch_malloc.c create mode 100644 ldap/servers/slapd/charray.c create mode 100644 ldap/servers/slapd/compare.c create mode 100644 ldap/servers/slapd/computed.c create mode 100644 ldap/servers/slapd/config.c create mode 100644 ldap/servers/slapd/configdse.c create mode 100644 ldap/servers/slapd/connection.c create mode 100644 ldap/servers/slapd/conntable.c create mode 100644 ldap/servers/slapd/control.c create mode 100644 ldap/servers/slapd/counters.c create mode 100644 ldap/servers/slapd/csn.c create mode 100644 ldap/servers/slapd/csngen.c create mode 100644 ldap/servers/slapd/csngen.h create mode 100644 ldap/servers/slapd/csnset.c create mode 100644 ldap/servers/slapd/daemon.c create mode 100644 ldap/servers/slapd/defbackend.c create mode 100644 ldap/servers/slapd/delete.c create mode 100644 ldap/servers/slapd/detach.c create mode 100644 ldap/servers/slapd/disconnect_error_strings.h create mode 100644 ldap/servers/slapd/disconnect_errors.h create mode 100644 ldap/servers/slapd/dl.c create mode 100644 ldap/servers/slapd/dn.c create mode 100644 ldap/servers/slapd/dse.c create mode 100644 ldap/servers/slapd/dynalib.c create mode 100644 ldap/servers/slapd/entry.c create mode 100644 ldap/servers/slapd/entrywsi.c create mode 100644 ldap/servers/slapd/errormap.c create mode 100644 ldap/servers/slapd/eventq.c create mode 100644 ldap/servers/slapd/extendop.c create mode 100644 ldap/servers/slapd/factory.c create mode 100644 ldap/servers/slapd/fe.h create mode 100644 ldap/servers/slapd/fedse.c create mode 100644 ldap/servers/slapd/fileio.c create mode 100644 ldap/servers/slapd/filter.c create mode 100644 ldap/servers/slapd/filter.h create mode 100644 ldap/servers/slapd/filtercmp.c create mode 100644 ldap/servers/slapd/filterentry.c create mode 100644 ldap/servers/slapd/generation.c create mode 100644 ldap/servers/slapd/getfilelist.c create mode 100644 ldap/servers/slapd/getopt_ext.c create mode 100644 ldap/servers/slapd/getopt_ext.h create mode 100644 ldap/servers/slapd/globals.c create mode 100644 ldap/servers/slapd/house.c create mode 100644 ldap/servers/slapd/http.h create mode 100644 ldap/servers/slapd/index_subsys.h create mode 100644 ldap/servers/slapd/index_subsystem.c create mode 100644 ldap/servers/slapd/init.c create mode 100644 ldap/servers/slapd/intrinsics.h create mode 100644 ldap/servers/slapd/ldbmlinktest.c create mode 100644 ldap/servers/slapd/lenstr.c create mode 100644 ldap/servers/slapd/libglobs.c create mode 100644 ldap/servers/slapd/libmakefile create mode 100644 ldap/servers/slapd/libsh_stub/Makefile create mode 100644 ldap/servers/slapd/libsh_stub/libsh_stub.c create mode 100644 ldap/servers/slapd/libslapd.def create mode 100644 ldap/servers/slapd/listConfigAttrs.pl create mode 100644 ldap/servers/slapd/lite_entries.c create mode 100644 ldap/servers/slapd/localhost.c create mode 100644 ldap/servers/slapd/lock.c create mode 100644 ldap/servers/slapd/log.c create mode 100644 ldap/servers/slapd/log.h create mode 100644 ldap/servers/slapd/main.c create mode 100644 ldap/servers/slapd/mapping_tree.c create mode 100644 ldap/servers/slapd/match.c create mode 100755 ldap/servers/slapd/mkDBErrStrs.pl create mode 100644 ldap/servers/slapd/modify.c create mode 100644 ldap/servers/slapd/modrdn.c create mode 100644 ldap/servers/slapd/modutil.c create mode 100644 ldap/servers/slapd/monitor.c create mode 100644 ldap/servers/slapd/ntmsgdll/Makefile create mode 100644 ldap/servers/slapd/ntmsgdll/ntslapdmessages.c create mode 100644 ldap/servers/slapd/ntmsgdll/ntslapdmessages.mc create mode 100644 ldap/servers/slapd/ntperfdll/Makefile create mode 100644 ldap/servers/slapd/ntperfdll/exports.def create mode 100644 ldap/servers/slapd/ntperfdll/nsldapctr.cpp create mode 100644 ldap/servers/slapd/ntperfdll/nsldapctrdef.h create mode 100644 ldap/servers/slapd/ntperfdll/nsldapctrmc.h create mode 100644 ldap/servers/slapd/ntperfdll/nsldapctrmc.mc create mode 100644 ldap/servers/slapd/ntperfdll/nsldapctrmsg.h create mode 100644 ldap/servers/slapd/ntperfdll/nsldapctrs.h create mode 100644 ldap/servers/slapd/ntperfdll/nsldapctrs.ini create mode 100644 ldap/servers/slapd/ntperfdll/nsldapctrutil.cpp create mode 100644 ldap/servers/slapd/ntperfdll/nsldapctrutil.h create mode 100644 ldap/servers/slapd/ntperfdll/nsldapreg.ini create mode 100644 ldap/servers/slapd/ntuserpin.c create mode 100644 ldap/servers/slapd/ntwdog/Makefile create mode 100644 ldap/servers/slapd/ntwdog/cron_conf.c create mode 100644 ldap/servers/slapd/ntwdog/cron_conf.h create mode 100644 ldap/servers/slapd/ntwdog/ntcron.c create mode 100644 ldap/servers/slapd/ntwdog/ntwatchdog.c create mode 100644 ldap/servers/slapd/object.c create mode 100644 ldap/servers/slapd/objset.c create mode 100644 ldap/servers/slapd/operation.c create mode 100644 ldap/servers/slapd/opshared.c create mode 100644 ldap/servers/slapd/pblock.c create mode 100644 ldap/servers/slapd/plugin.c create mode 100644 ldap/servers/slapd/plugin_acl.c create mode 100644 ldap/servers/slapd/plugin_internal_op.c create mode 100644 ldap/servers/slapd/plugin_mr.c create mode 100644 ldap/servers/slapd/plugin_role.c create mode 100644 ldap/servers/slapd/plugin_syntax.c create mode 100644 ldap/servers/slapd/poll_using_select.c create mode 100644 ldap/servers/slapd/poll_using_select.h create mode 100644 ldap/servers/slapd/prerrstrs.h create mode 100644 ldap/servers/slapd/protect_db.c create mode 100644 ldap/servers/slapd/protect_db.h create mode 100644 ldap/servers/slapd/proto-slap.h create mode 100644 ldap/servers/slapd/psearch.c create mode 100644 ldap/servers/slapd/pw.c create mode 100644 ldap/servers/slapd/pw.h create mode 100644 ldap/servers/slapd/pw_mgmt.c create mode 100644 ldap/servers/slapd/pw_retry.c create mode 100644 ldap/servers/slapd/rdn.c create mode 100644 ldap/servers/slapd/referral.c create mode 100644 ldap/servers/slapd/regex.c create mode 100644 ldap/servers/slapd/resourcelimit.c create mode 100644 ldap/servers/slapd/result.c create mode 100644 ldap/servers/slapd/rootdse.c create mode 100644 ldap/servers/slapd/rwlock.c create mode 100644 ldap/servers/slapd/rwlock.h create mode 100644 ldap/servers/slapd/sasl_io.c create mode 100644 ldap/servers/slapd/sasl_map.c create mode 100644 ldap/servers/slapd/saslbind.c create mode 100644 ldap/servers/slapd/schema.c create mode 100644 ldap/servers/slapd/schemaparse.c create mode 100644 ldap/servers/slapd/search.c create mode 100644 ldap/servers/slapd/secerrstrs.h create mode 100644 ldap/servers/slapd/security_wrappers.c create mode 100644 ldap/servers/slapd/slap.h create mode 100644 ldap/servers/slapd/slapd.lite.key create mode 100644 ldap/servers/slapd/slapd.normal.key create mode 100644 ldap/servers/slapd/slapd_plhash.c create mode 100644 ldap/servers/slapd/slapi-plugin-compat4.h create mode 100644 ldap/servers/slapd/slapi-plugin.h create mode 100644 ldap/servers/slapd/slapi-private.h create mode 100644 ldap/servers/slapd/slapi2nspr.c create mode 100644 ldap/servers/slapd/snmp_collator.c create mode 100644 ldap/servers/slapd/snmp_collator.h create mode 100644 ldap/servers/slapd/snoop.c create mode 100644 ldap/servers/slapd/ssl.c create mode 100644 ldap/servers/slapd/sslerrstrs.h create mode 100644 ldap/servers/slapd/start_tls_extop.c create mode 100644 ldap/servers/slapd/statechange.h create mode 100644 ldap/servers/slapd/str2filter.c create mode 100644 ldap/servers/slapd/strdup.c create mode 100644 ldap/servers/slapd/stubrepl.c create mode 100644 ldap/servers/slapd/stubs.c create mode 100644 ldap/servers/slapd/subentry.c create mode 100644 ldap/servers/slapd/task.c create mode 100644 ldap/servers/slapd/tempnam.c create mode 100644 ldap/servers/slapd/test-plugins/Makefile create mode 100644 ldap/servers/slapd/test-plugins/Makefile.AIX create mode 100644 ldap/servers/slapd/test-plugins/Makefile.BSDI create mode 100644 ldap/servers/slapd/test-plugins/Makefile.HPUX create mode 100644 ldap/servers/slapd/test-plugins/Makefile.HPUX64 create mode 100644 ldap/servers/slapd/test-plugins/Makefile.IRIX create mode 100644 ldap/servers/slapd/test-plugins/Makefile.Linux create mode 100644 ldap/servers/slapd/test-plugins/Makefile.OSF1 create mode 100644 ldap/servers/slapd/test-plugins/Makefile.ReliantUNIX create mode 100644 ldap/servers/slapd/test-plugins/Makefile.SOLARIS create mode 100644 ldap/servers/slapd/test-plugins/Makefile.SOLARIS64 create mode 100644 ldap/servers/slapd/test-plugins/Makefile.SOLARISx86 create mode 100644 ldap/servers/slapd/test-plugins/Makefile.UnixWare create mode 100644 ldap/servers/slapd/test-plugins/Makefile.UnixWareUDK create mode 100644 ldap/servers/slapd/test-plugins/Makefile.WINNT create mode 100644 ldap/servers/slapd/test-plugins/Makefile.server create mode 100644 ldap/servers/slapd/test-plugins/README create mode 100644 ldap/servers/slapd/test-plugins/clients/README create mode 100644 ldap/servers/slapd/test-plugins/clients/ReqExtOp.java create mode 100644 ldap/servers/slapd/test-plugins/clients/reqextop.c create mode 100644 ldap/servers/slapd/test-plugins/dllmain.c create mode 100755 ldap/servers/slapd/test-plugins/installDse.pl create mode 100644 ldap/servers/slapd/test-plugins/nicknames create mode 100644 ldap/servers/slapd/test-plugins/testbind.c create mode 100644 ldap/servers/slapd/test-plugins/testdatainterop.c create mode 100644 ldap/servers/slapd/test-plugins/testdbinterop.c create mode 100644 ldap/servers/slapd/test-plugins/testdbinterop.h create mode 100644 ldap/servers/slapd/test-plugins/testentry.c create mode 100644 ldap/servers/slapd/test-plugins/testextendedop.c create mode 100644 ldap/servers/slapd/test-plugins/testgetip.c create mode 100644 ldap/servers/slapd/test-plugins/testplugin.def create mode 100644 ldap/servers/slapd/test-plugins/testplugin.dsp create mode 100644 ldap/servers/slapd/test-plugins/testplugin.mak create mode 100644 ldap/servers/slapd/test-plugins/testpostop.c create mode 100644 ldap/servers/slapd/test-plugins/testpreop.c create mode 100644 ldap/servers/slapd/test-plugins/testsaslbind.c create mode 100644 ldap/servers/slapd/time.c create mode 100644 ldap/servers/slapd/tools/Makefile create mode 100644 ldap/servers/slapd/tools/eggencode.c create mode 100644 ldap/servers/slapd/tools/keyupg.c create mode 100644 ldap/servers/slapd/tools/ldif.c create mode 100644 ldap/servers/slapd/tools/migratecred.c create mode 100644 ldap/servers/slapd/tools/mkdep.c create mode 100644 ldap/servers/slapd/tools/mmldif.c create mode 100644 ldap/servers/slapd/tools/pwenc.c create mode 100644 ldap/servers/slapd/unbind.c create mode 100644 ldap/servers/slapd/uniqueid.c create mode 100644 ldap/servers/slapd/uniqueidgen.c create mode 100644 ldap/servers/slapd/utf8compare.c create mode 100644 ldap/servers/slapd/util.c create mode 100644 ldap/servers/slapd/uuid.c create mode 100644 ldap/servers/slapd/uuid.h create mode 100644 ldap/servers/slapd/value.c create mode 100644 ldap/servers/slapd/valueset.c create mode 100644 ldap/servers/slapd/vattr.c create mode 100644 ldap/servers/slapd/vattr_spi.h create mode 100644 ldap/servers/slapd/views.h create mode 100644 ldap/servers/snmp/Makefile create mode 100644 ldap/servers/snmp/NETWORK-SERVICES-MIB.txt create mode 100644 ldap/servers/snmp/RFC-1215.txt create mode 100644 ldap/servers/snmp/RFC1155-SMI.txt create mode 100644 ldap/servers/snmp/SNMPv2-CONF.txt create mode 100644 ldap/servers/snmp/SNMPv2-SMI.txt create mode 100644 ldap/servers/snmp/SNMPv2-TC.txt create mode 100644 ldap/servers/snmp/netscape-ldap.mib create mode 100644 ldap/servers/snmp/ntagt/Makefile create mode 100644 ldap/servers/snmp/ntagt/msrvdefs.mak create mode 100644 ldap/servers/snmp/ntagt/nslagtcom_nt.h create mode 100644 ldap/servers/snmp/ntagt/nsldapagt_nt.c create mode 100644 ldap/servers/snmp/ntagt/nsldapagt_nt.def create mode 100644 ldap/servers/snmp/ntagt/nsldapagt_nt.h create mode 100644 ldap/servers/snmp/ntagt/nsldapmib_nt.c create mode 100644 ldap/servers/snmp/ntagt/nsldapmib_nt.h create mode 100644 ldap/systools/Makefile create mode 100644 ldap/systools/README create mode 100755 ldap/systools/getHPPatches.pl create mode 100755 ldap/systools/getSolPatches.pl create mode 100644 ldap/systools/hp_patches.c create mode 100644 ldap/systools/idsktune.c create mode 100755 ldap/systools/mergeSolPatches.pl create mode 100644 ldap/systools/pio.c create mode 100644 ldap/systools/pio.h create mode 100644 ldap/systools/sol_patches.c create mode 100644 ldap/systools/viewcore.c create mode 100644 lib/base/Makefile create mode 100644 lib/base/crit.cpp create mode 100644 lib/base/dns.cpp create mode 100644 lib/base/dnsdmain.cpp create mode 100644 lib/base/ereport.cpp create mode 100644 lib/base/eventlog.cpp create mode 100644 lib/base/file.cpp create mode 100644 lib/base/fsmutex.cpp create mode 100644 lib/base/lexer.cpp create mode 100644 lib/base/lexer_pvt.h create mode 100644 lib/base/net.cpp create mode 100644 lib/base/nscperror.c create mode 100644 lib/base/nterrors.cpp create mode 100644 lib/base/plist.cpp create mode 100644 lib/base/plist_pvt.h create mode 100644 lib/base/pool.cpp create mode 100644 lib/base/rwlock.cpp create mode 100644 lib/base/shexp.cpp create mode 100644 lib/base/shmem.cpp create mode 100644 lib/base/system.cpp create mode 100644 lib/base/systhr.cpp create mode 100644 lib/base/util.cpp create mode 100644 lib/ldaputil/Makefile create mode 100644 lib/ldaputil/cert.c create mode 100644 lib/ldaputil/certmap.c create mode 100644 lib/ldaputil/certmap.conf create mode 100644 lib/ldaputil/dbconf.c create mode 100644 lib/ldaputil/encode.c create mode 100644 lib/ldaputil/errors.c create mode 100644 lib/ldaputil/examples/Certmap.mak create mode 100644 lib/ldaputil/examples/Makefile create mode 100644 lib/ldaputil/examples/README create mode 100644 lib/ldaputil/examples/init.c create mode 100644 lib/ldaputil/examples/plugin.c create mode 100644 lib/ldaputil/examples/plugin.h create mode 100644 lib/ldaputil/init.c create mode 100644 lib/ldaputil/ldapauth.c create mode 100644 lib/ldaputil/ldapdb.c create mode 100644 lib/ldaputil/ldapu-changes.html create mode 100644 lib/ldaputil/ldaputili.h create mode 100644 lib/ldaputil/utest/Makefile create mode 100644 lib/ldaputil/utest/auth.cpp create mode 100755 lib/ldaputil/utest/authtest create mode 100644 lib/ldaputil/utest/certmap.conf create mode 100644 lib/ldaputil/utest/dblist.conf create mode 100644 lib/ldaputil/utest/example.c create mode 100644 lib/ldaputil/utest/plugin.c create mode 100644 lib/ldaputil/utest/plugin.h create mode 100644 lib/ldaputil/utest/stubs.c create mode 100644 lib/ldaputil/utest/stubs.cpp create mode 100644 lib/ldaputil/utest/test.ref create mode 100644 lib/ldaputil/vtable.c create mode 100644 lib/libaccess/Makefile create mode 100644 lib/libaccess/access_plhash.cpp create mode 100644 lib/libaccess/access_plhash.h create mode 100644 lib/libaccess/acl.tab.cpp create mode 100644 lib/libaccess/acl.tab.h create mode 100644 lib/libaccess/acl.yy.cpp create mode 100644 lib/libaccess/aclbuild.cpp create mode 100644 lib/libaccess/aclcache.cpp create mode 100644 lib/libaccess/aclcache.h create mode 100644 lib/libaccess/aclerror.cpp create mode 100644 lib/libaccess/acleval.cpp create mode 100644 lib/libaccess/aclflush.cpp create mode 100644 lib/libaccess/aclparse.cpp create mode 100644 lib/libaccess/aclpriv.h create mode 100644 lib/libaccess/aclscan.h create mode 100644 lib/libaccess/aclscan.l create mode 100644 lib/libaccess/aclspace.cpp create mode 100644 lib/libaccess/acltext.y create mode 100644 lib/libaccess/acltools.cpp create mode 100644 lib/libaccess/aclutil.cpp create mode 100644 lib/libaccess/aclutil.h create mode 100644 lib/libaccess/attrec.cpp create mode 100644 lib/libaccess/authdb.cpp create mode 100644 lib/libaccess/avadb.c create mode 100644 lib/libaccess/avaparse.y create mode 100644 lib/libaccess/avapfile.c create mode 100644 lib/libaccess/avascan.l create mode 100644 lib/libaccess/las.h create mode 100644 lib/libaccess/lasdns.cpp create mode 100644 lib/libaccess/lasdns.h create mode 100644 lib/libaccess/lasgroup.cpp create mode 100644 lib/libaccess/lasip.cpp create mode 100644 lib/libaccess/lasip.h create mode 100644 lib/libaccess/lastod.cpp create mode 100644 lib/libaccess/lasuser.cpp create mode 100644 lib/libaccess/lcache.h create mode 100644 lib/libaccess/ldapacl.cpp create mode 100644 lib/libaccess/ldapauth.h create mode 100644 lib/libaccess/leval.h create mode 100644 lib/libaccess/lparse.h create mode 100644 lib/libaccess/method.cpp create mode 100644 lib/libaccess/nsadb.cpp create mode 100644 lib/libaccess/nsamgmt.cpp create mode 100644 lib/libaccess/nsautherr.cpp create mode 100644 lib/libaccess/nscert.cpp create mode 100644 lib/libaccess/nsdb.cpp create mode 100644 lib/libaccess/nsdbmgmt.cpp create mode 100644 lib/libaccess/nseframe.cpp create mode 100644 lib/libaccess/nsgmgmt.cpp create mode 100644 lib/libaccess/nsgroup.cpp create mode 100644 lib/libaccess/nslock.cpp create mode 100644 lib/libaccess/nsumgmt.cpp create mode 100644 lib/libaccess/nsuser.cpp create mode 100644 lib/libaccess/oneeval.cpp create mode 100644 lib/libaccess/oneeval.h create mode 100644 lib/libaccess/parse.h create mode 100644 lib/libaccess/permhash.h create mode 100644 lib/libaccess/register.cpp create mode 100644 lib/libaccess/register.h create mode 100644 lib/libaccess/symbols.cpp create mode 100644 lib/libaccess/userauth.cpp create mode 100644 lib/libaccess/usi.cpp create mode 100644 lib/libaccess/usrcache.cpp create mode 100644 lib/libaccess/utest.mk create mode 100644 lib/libaccess/utest/.purify create mode 100644 lib/libaccess/utest/Makefile create mode 100644 lib/libaccess/utest/acl.dat create mode 100644 lib/libaccess/utest/aclfile0 create mode 100644 lib/libaccess/utest/aclfile1 create mode 100644 lib/libaccess/utest/aclfile10 create mode 100644 lib/libaccess/utest/aclfile11 create mode 100644 lib/libaccess/utest/aclfile12 create mode 100644 lib/libaccess/utest/aclfile13 create mode 100644 lib/libaccess/utest/aclfile14 create mode 100644 lib/libaccess/utest/aclfile15 create mode 100644 lib/libaccess/utest/aclfile16 create mode 100644 lib/libaccess/utest/aclfile17 create mode 100644 lib/libaccess/utest/aclfile18 create mode 100644 lib/libaccess/utest/aclfile19 create mode 100644 lib/libaccess/utest/aclfile2 create mode 100644 lib/libaccess/utest/aclfile3 create mode 100644 lib/libaccess/utest/aclfile4 create mode 100644 lib/libaccess/utest/aclfile5 create mode 100644 lib/libaccess/utest/aclfile6 create mode 100644 lib/libaccess/utest/aclfile7 create mode 100644 lib/libaccess/utest/aclfile8 create mode 100644 lib/libaccess/utest/aclfile9 create mode 100644 lib/libaccess/utest/aclgrp0 create mode 100644 lib/libaccess/utest/aclgrp1 create mode 100644 lib/libaccess/utest/aclgrp2 create mode 100644 lib/libaccess/utest/aclgrp3 create mode 100644 lib/libaccess/utest/aclgrp4 create mode 100644 lib/libaccess/utest/acltest.cpp create mode 100644 lib/libaccess/utest/lasemail.cpp create mode 100644 lib/libaccess/utest/onetest.cpp create mode 100644 lib/libaccess/utest/shexp.cpp create mode 100644 lib/libaccess/utest/shexp.h create mode 100644 lib/libaccess/utest/test.ref create mode 100644 lib/libaccess/utest/testmain.cpp create mode 100644 lib/libaccess/utest/twotest.cpp create mode 100644 lib/libaccess/utest/ustubs.cpp create mode 100644 lib/libaccess/winnt.l create mode 100644 lib/libaccess/winnt.v create mode 100644 lib/libaccess/winnt.y create mode 100644 lib/libaccess/wintab.h create mode 100644 lib/libaccess/yy-sed create mode 100644 lib/libadmin/Makefile create mode 100644 lib/libadmin/authdb.c create mode 100644 lib/libadmin/error.c create mode 100644 lib/libadmin/strlist.c create mode 100644 lib/libadmin/template.c create mode 100644 lib/libadmin/util.c create mode 100644 lib/libnt/Makefile create mode 100644 lib/libnt/info.c create mode 100644 lib/libnt/path.c create mode 100644 lib/libnt/pmddeml.c create mode 100644 lib/libnt/registry.c create mode 100644 lib/libnt/service.c create mode 100644 lib/libnt/tcpip.c create mode 100644 lib/libsi18n/Makefile create mode 100644 lib/libsi18n/acclanglist.c create mode 100644 lib/libsi18n/coreres.c create mode 100644 lib/libsi18n/coreres.h create mode 100644 lib/libsi18n/getlang.c create mode 100644 lib/libsi18n/getstrmem.c create mode 100644 lib/libsi18n/getstrmem.h create mode 100644 lib/libsi18n/getstrprop.c create mode 100644 lib/libsi18n/gsslapd.h create mode 100644 lib/libsi18n/makstrdb.c create mode 100644 lib/libsi18n/propset.c create mode 100644 lib/libsi18n/propset.h create mode 100644 lib/libsi18n/reshash.c create mode 100644 lib/libsi18n/reshash.h create mode 100644 lib/libsi18n/txtfile.c create mode 100644 lib/libsi18n/txtfile.h create mode 100644 modules.awk create mode 100644 modules.sh create mode 100644 ns_usedb.mk create mode 100644 ns_usepurify.mk create mode 100644 ns_usequantify.mk create mode 100644 ns_usesh.mk create mode 100755 nsarch create mode 100644 nsarch.bat create mode 100644 nsconfig.mk create mode 100644 nscore.mk create mode 100644 nsdefs.mk create mode 100755 nsperl.mk create mode 100644 ntversion.pl create mode 100644 pumpkin.pl diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..1fa353eb --- /dev/null +++ b/Makefile @@ -0,0 +1,268 @@ +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# Top-level gmake Makefile for Directory Server builds. +# +# Execute the command: +# +# gmake help +# +# to see a list of available targets. + +# Relative path to the top of the build tree (i.e., where the DS source tree is checked out) +MCOM_ROOT=.. + +# define COMPONENT_DEPS here so that components are pulled in this makefile +COMPONENT_DEPS := 1 + +include nsdefs.mk +include nsconfig.mk +include ns_usedb.mk + +# first (default) rule: build and create a DS package +all: buildAndPkgDirectory + +help: + @echo + @echo The following are build targets that you can choose from: + @echo + @echo " gmake buildAndPkgDirectory" + @echo " gmake buildDirectory" + @echo " gmake pkgDirectory" + @echo " gmake pkgDirectoryl10n" + @echo " gmake pkgDirectoryPseudoL10n" + +###### Implementation notes: +# +# We use ../../reltools/ftp_puller_new.pl to pull and maintain dependencies +# for the components (binary and header files) we use for the build. The +# dependencies are maintained in the file ../components.OS, where OS is +# the operating system. These files do not exist in CVS; they are created +# as needed. We could probably make the system smarter to know the +# difference between debug/optimized and export/domestic, but for now it +# does not. +# +# The file ./component_versions.mk contains the component version +# information. If you want to change the version of a component used +# to build or package, this is the place to look. +# +# +# The file ./components.mk contains the information about what files and +# directories are used by the component. It also contains the +# information about how to pull the component. Each component defines a +# XXX_DEP macro which is the name of a file to be used for dependency +# checking. +# +# +# By default, NT uses FTP and Unix uses SYMLINK as their pull methods. +# This is controlled by the COMPONENT_PULL_METHOD macro. For example, +# on Unix, you can use +# +# gmake COMPONENT_PULL_METHOD=FTP buildDirectory +# +# To force use of ftp to pull all components. In addition, each component +# can have a XXX_PULL_METHOD macro. If this macro is defined, it overrides +# the default. For example, on Unix, you can use +# +# gmake NSPR_PULL_METHOD=FTP buildDirectory +# +# if you want to get NSPR via ftp and the other components via symlink. +# +# +# By default, the components are only pulled from the top level if you do +# a gmake buildDirectory. There is a macro called COMPONENT_DEPS. If +# this is defined on the command line of the gmake command e.g. +# +# gmake COMPONENT_DEPS=1 ... +# +# this will force component checking and pulling. This will have the +# effect of slowing down the build. +# +###### End of implementation notes. + +components: $(ADMINUTIL_DEP) $(NSPR_DEP) $(ARLIB_DEP) $(DBM_DEP) $(SECURITY_DEP) $(SVRCORE_DEP) \ + $(ICU_DEP) $(SETUPSDK_DEP) $(LDAPSDK_DEP) $(DB_LIB_DEP) $(SASL_DEP) $(PEER_DEP) \ + $(DSRK_DEP) $(AXIS_DEP) $(DSMLJAR_DEP) + -@echo "The components are up to date" + +ifeq ($(BUILD_JAVA_CODE),1) +DS_CONSOLE_COMPONENT_DEP = $(LDAPJDK_DEP) $(SWING_DEP) $(MCC_DEP) +DS_CONSOLE_COMPONENT_DEP += $(JAVASSL_DEP) $(JSS_DEP) $(CRIMSONJAR_DEP) +java_platform_check: + +else + +DS_CONSOLE_COMPONENT_DEP = +java_platform_check: + -@echo "Note: Java code is not built on this platform ($(ARCH))." + -@echo " Use 'gmake BUILD_JAVA_CODE=1 ...' to override." +endif + +consoleComponents: $(DS_CONSOLE_COMPONENT_DEP) + +pumpkin: + @echo NSOS_RELEASE is: $(NSOS_RELEASE) + $(PERL) pumpkin.pl $(PUMPKIN_AGE) pumpkin.dat + +buildnum: + if test ! -d $(BUILD_ARCH); then mkdir $(BUILD_ARCH); fi; + $(PERL) buildnum.pl -p $(BUILD_ARCH) + +nsCommon: + cd config; $(MAKE) export $(NSDEFS) +# XXXsspitzer: for UNIXWARE and UnixWare +ifeq ($(subst nix,NIX,$(subst are,ARE,$(ARCH))), UNIXWARE) + - mkdir built/$(NS_BUILD_FLAVOR)/obj + cd built/$(NS_BUILD_FLAVOR)/obj && ar xv ../../../$(LIBNSPR) uxwrap.o +endif +ifeq ($(ARCH), WINNT) + cd lib/libnt; $(MAKE) $(MFLAGS) export $(NSDEFS) + cd lib/libnt; $(MAKE) $(MFLAGS) libs $(NSDEFS) +endif + +# +# Notice that BUILD_MODULE is not supplied directly on this target. +# It either inherits from the calling target or from the default in +# nsdefs.mk. Therefore if you need to perform 'gmake httpdlib', be sure +# that BUILD_MODULE is set to whatever target release that you need. +# +httpdLib: + @echo + @echo + @echo + @echo ==== Starting Server LIBS for: $(BUILD_MODULE) ========== + @echo + cd lib/base; $(MAKE) $(MFLAGS) + cd lib/ldaputil; $(MAKE) $(MFLAGS) + cd lib/frame; $(MAKE) $(MFLAGS) + cd lib/libaccess; $(MAKE) $(MFLAGS) + cd lib/libadmin; $(MAKE) $(MFLAGS) + cd lib/safs; $(MAKE) $(MFLAGS) + cd lib/libcrypt; $(MAKE) $(MFLAGS) + cd lib/libmsgdisp; $(MAKE) $(MFLAGS) + cd lib/libsi18n; $(MAKE) $(MFLAGS) +ifeq ($(ARCH), WINNT) + cd lib/httpdaemon; $(MAKE) $(MFLAGS) +endif + @echo ==== Finished Server LIBS for: $(BUILD_MODULE) ========== + @echo + +buildAndPkgDirectory: buildDirectory pkgDirectory + +buildDirectory: buildnum pumpkin $(OBJDIR) $(DIRVER_H) $(SDKVER_H) components + @echo + @echo + @echo + @echo ==== Starting Netscape Directory Server ========== + @echo + $(MAKE) $(MFLAGS) nsCommon + cd config; $(MAKE) $(MFLAGS) install $(NSDEFS) + $(MAKE) $(MFLAGS) BUILD_MODULE=DIRECTORY LDAP_NO_LIBLCACHE=1 httpdLib +ifeq ($(ARCH), WINNT) + $(PERL) ntversion.pl $(MCOM_ROOT) $(MAJOR_VERSION) $(MINOR_VERSION) +endif + cd httpd; $(MAKE) $(MFLAGS) LDAP_NO_LIBLCACHE=1 BUILD_MODULE=DIRECTORY httpd-bin + cd ldap; $(MAKE) $(MFLAGS) LDAP_NO_LIBLCACHE=1 BUILD_MODULE=DIRECTORY all + @echo ==== Finished Netscape Directory Server ========== + @echo + @echo ==== Starting Netscape Directory Server Console ========== + @echo + $(MAKE) $(MFLAGS) buildDirectoryConsole + @echo + @echo ==== Finished Netscape Directory Server Console ========== + @echo + @echo ==== Starting Netscape Directory Clients ========== + @echo + $(MAKE) $(MFLAGS) buildDirectoryClients + @echo + @echo ==== Finished Netscape Directory Clients ========== + @echo + +cleanDirectory: + @echo + @echo + @echo ==== Cleaning Netscape Directory Server on $(ARCH) ==== + @echo + rm -rf $(ARCH) + rm -rf built/$(NS_BUILD_FLAVOR) + rm -rf built/release/slapd/$(NS_BUILD_FLAVOR) + rm -rf ../dist/$(NSOBJDIR_NAME) + rm -rf ../dist/full + rm -rf $(CLASS_DEST) # ../dist/classes + @echo + @echo ==== All done === + @echo + +buildDirectoryConsole: consoleComponents java_platform_check +ifeq ($(BUILD_JAVA_CODE),1) + cd ldap/admin/src/java/com/netscape/admin/dirserv; $(MAKE) $(MFLAGS) package + cd ldap/admin/src/java/com/netscape/xmltools; $(MAKE) $(MFLAGS) package +endif + +buildDirectoryClients: $(ANT_DEP) java_platform_check +ifeq ($(BUILD_JAVA_CODE),1) + cd ldap/clients; $(MAKE) $(MFLAGS) +endif + cd ldap/clients/dsgw; $(MAKE) $(MFLAGS) + +$(OBJDIR): + if test ! -d $(OBJDIR); then mkdir $(OBJDIR); fi; + +$(SDKVER_H): + if test ! -d $(DIRVERDIR); then mkdir $(DIRVERDIR); fi; + $(PERL) dirver.pl -v "$(DIRSDK_VERSION)" -o $@ + +$(DIRVER_H): + if test ! -d $(DIRVERDIR); then mkdir $(DIRVERDIR); fi; + $(PERL) dirver.pl -v "$(DIR_VERSION)" -o $@ + +pkgLdapSDK: setupLdapSDK + @echo + @echo =========== Finished - LDAP SDK Package Build ============ + +setupLdapSDK: + @echo =========== Starting - LDAP SDK Package Build ============ + @echo + cd ldap/cm; $(MAKE) $(MAKEFLAGS) releaseLdapSDK + cd ldap/cm; $(MAKE) $(MAKEFLAGS) packageLdapSDK + + +pkgDirectory: setupDirectory + @echo + @echo =========== Finished - Directory Server Package Build ============ + +Acceptance: + cd ldap/cm; $(MAKE) Acceptance $(MFLAGS) + +Longduration: + cd ldap/cm; $(MAKE) Longduration $(MFLAGS) + +setupDirectory: + cd ldap/cm; $(MAKE) $(MFLAGS) releaseDirectory; + cd ldap/cm; $(MAKE) $(MFLAGS) packageDirectory; + +pkgDirectoryJars: + cd ldap/cm; $(MAKE) $(MFLAGS) packageJars + +pkgDirectoryl10n: + @echo =========== Starting - Directory Server International Package Build ============ + cd ldap/cm; $(MAKE) $(MFLAGS) l10nRePackage + @echo =========== Finished - Directory Server International Package Build ============ + +pkgDirectoryPseudoL10n: + @echo =========== Starting - Directory Server L10N Package Build ============ +ifeq ($(BUILD_SECURITY),export) +ifeq ($(BUILD_DEBUG),optimize) + cd i18npkg/apollo; $(MAKE) $(MFLAGS) +else + @echo skipping pkgDirectoryPseudoL10n +endif +else + @echo skipping pkgDirectoryPseudoL10n +endif + @echo =========== Finished - Directory Server L10N Package Build ============ + diff --git a/bchecker.ini b/bchecker.ini new file mode 100644 index 00000000..4ff9a1c6 --- /dev/null +++ b/bchecker.ini @@ -0,0 +1,3 @@ +checking_level full +checking_uninit_compile on +compiler_fault_recovery on diff --git a/buildnum.pl b/buildnum.pl new file mode 100755 index 00000000..6b184f21 --- /dev/null +++ b/buildnum.pl @@ -0,0 +1,49 @@ +#!/usr/bin/perl +#-------------------------------------------- +# buildnum.pl +# +# Generates a dated build number and writes +# out a buildnum.dat file in a user specified +# subdirectory. +# +# Usage: buildnum.pl -p +#-------------------------------------------- + +use Getopt::Std; +use FileHandle; + +autoflush STDERR 1; + +getopts('p:H'); + +if ($opt_H) {exitHelp();} + +# Load arguments +$platdir = $opt_p || exitHelp(); +$buildnum_file = "./$platdir/buildnum.dat"; + +# Get current time +@now = gmtime; + +# Format buildnum as YYYY.DDD.HHMM +$year = $now[5] + 1900; +$doy = $now[7] + 1; +if ($doy < 100) { $doy = 0 . $doy; } +$tod = $now[2] . $now[1]; +$buildnum = "$year.$doy.$tod"; + +# Write buildnum.dat +open(BUILDNUM,">$buildnum_file") || die "Error: Can't create $buildnum_file: $!\n"; +print BUILDNUM "\\\"$buildnum\\\""; +close(BUILDNUM); + +#---------- exitHelp subroutine ---------- +sub exitHelp { + print(STDERR "$0: Generates a dated build number. + + \tUsage: $0 -p + + \t-p Platform subdirectory. + \t-H Print this help message\n"); + exit(0); +} diff --git a/component_versions.mk b/component_versions.mk new file mode 100644 index 00000000..bcdd4a1d --- /dev/null +++ b/component_versions.mk @@ -0,0 +1,198 @@ +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# This file contains the version definitions for all components used in the build. It +# should be COMPLETELY AND TOTALLY SELF CONTAINED e.g. no references to macros defined +# outside of this file. + +# The XXX_DIR OR XXX_VERSDIR or XXX_COMP or XXX_COMP_DIR macros are the name of the +# base directory for the component under the main components directory +# for example, the LDAP SDK component directory is +# $(COMPONENTS_DIR)/$(LDAPCOMP_DIR) == /share/builds/components/ldapsdk31 + +# the XXX_RELDATE or XXX_VERSION macros are the name of the subdirectory under +# the component directory where the specific version can be found. This is +# usually in the form of YYYYMMDD, although NSPR et. al use a different +# naming scheme. +# NSPR +ifndef NSPR_RELDATE + NSPR_RELDATE = DS7.0 +endif + +# SECURITY (NSS) LIBRARY +ifndef SECURITY_RELDATE + SECURITY_RELDATE = DS7.0 +endif + +# LIBDB +DBDEFS:= +ifndef DB_MAJOR_MINOR +DB_MAJOR_MINOR:=db42 +endif +ifndef DB_VERSION + DB_VERSION:=DS7.0 +endif + +# DBM Library +ifndef DBM_RELDATE + DBM_RELDATE = DS7.0 +endif + +# SMARTHEAP +ifndef SH_VERSION + SH_VERSION:=v6.01 +endif + +# LDAP SDK +ifndef LDAP_RELDATE + LDAP_RELDATE = DS7.0 +endif +ifndef LDAPCOMP_DIR + LDAPCOMP_DIR=ldapsdk50 +endif + +# DSRK +ifndef DSRK_RELDATE + DSRK_RELDATE = 20041029 +endif +ifndef DSRKCOMP_DIR + DSRKCOMP_DIR=dsrk70 +endif + +# CRIMSONJAR +ifndef CRIMSONJAR_VERSION + CRIMSONJAR_VERSION = 1.1.3 +endif +ifndef CRIMSONJAR_COMP + CRIMSONJAR_COMP = crimson +endif + +# ANT +ifndef ANT_VERSION + ANT_VERSION = 1.4.1 +endif +ifndef ANT_COMP + ANT_COMP = ant +endif + +# Servlet SDK +ifndef SERVLET_VERSION + SERVLET_VERSION = 2.3 +endif +ifndef SERVLET_COMP + SERVLET_COMP = javax/servlet +endif + +# LDAP JDK +ifndef LDAPJDK_RELDATE + LDAPJDK_RELDATE = v4.17 +endif +ifndef LDAPJDK_COMP + LDAPJDK_COMP = ldapjdk41 +endif + +# admin server + +ifndef ADM_RELDATE + ADM_RELDATE = 20041117 +endif +ifndef ADM_VERSDIR + ADM_VERSDIR = admserv62 +endif + +# peer +ifndef PEER_RELDATE + PEER_RELDATE = DS7.0 +endif + +# setup sdk +ifndef SETUP_SDK_RELDATE + SETUP_SDK_RELDATE = DS7.0 +endif +ifndef SETUPSDK_VERSDIR + SETUPSDK_VERSDIR = v6.2 +endif + +# infozip utilities +ifndef INFOZIP_RELDATE + INFOZIP_RELDATE = CMSTOOLS_7_x +endif + +# server core +ifndef SVRCORE_RELDATE + SVRCORE_RELDATE = DS7.0 +endif + +# admin utility library +ifndef ADMINUTIL_VER + ADMINUTIL_VER=62 +endif +ifndef ADMINUTIL_RELDATE + ADMINUTIL_RELDATE=20041117 +endif + +ifndef ADMINUTIL_VERSDIR + ADMINUTIL_VERSDIR=adminsdk$(ADMINUTIL_VER) +endif + +# MCC (Console JDK) +ifndef MCC_REL + MCC_REL=62 +endif +ifndef MCC_COMP + MCC_COMP = consolesdk$(MCC_REL) +endif +ifndef MCC_RELDATE + MCC_RELDATE=20041117 +endif + +ifndef PERLDAP_VERSION + PERLDAP_VERSION=20041116 +endif + +ifndef JSS_COMP + JSS_COMP=jss +endif + +ifndef JSS_VERSION + JSS_VERSION=DS7.0 +endif + +ifndef JSS_JAR_VERSION + JSS_JAR_VERSION=3 +endif + +ifndef SASL_VERSDIR + SASL_VERSDIR=sasl_1_0 +endif +ifndef SASL_RELDATE + SASL_RELDATE=20041130 +endif + +# jakarta/axis for DSMLGW +ifndef TOMCAT_VERSION + TOMCAT_VERSION=5.0.27 +endif +ifndef AXIS_VERSION + AXIS_VERSION=1_2beta +endif + +# JSP compiler jasper +ifndef JSPC_VERSION + JSPC_VERSION = 4.0.3 +endif +ifndef JSPC_COMP + JSPC_COMP = javax/jasper +endif + +# ICU +ifndef ICU_VERSDIR + ICU_VERSDIR=libicu_2_4 +endif +ifndef ICU_RELDATE + ICU_RELDATE=DS7.0 +endif diff --git a/components.mk b/components.mk new file mode 100644 index 00000000..f661a26f --- /dev/null +++ b/components.mk @@ -0,0 +1,978 @@ +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# this file contains definitions for component macros used during the build +# process. Things like the component location in the build tree, etc. +# this file should be included by nsconfig.mk after it figures out all +# of the OS, architecture, security, and other platform and build related +# macros. This file also contains the instructions for making the component +# up to date e.g. copying the files from their repository to an area where +# the build process has access to it. For some components and OS's, this may +# be as simple as creating a symbolic link to the repository + +# Each component should define a COMPONENT_DEP macro which can be used in +# other makefiles for dependency checking e.g. +# target: $(COMPONENT1_DEP) $(COMPONENT2_DEP) ... +# This macro should evaluate to the name of a single file which must be +# present for the package to be complete e.g. some library or include +# file name +# Each component then should define a target for that dependency which will +# bring the component up to date if that target does not exist e.g. +# $(COMPONENT1_DEP): +# use ftp or symlinks or ??? to get the necessary files to the build +# area + +# Each component should define a COMPONENT_LINK macro which can be used to +# link the component's libraries with the target. For NT, this will typically +# be something like +# /LIBPATH:path_to_library lib1 lib2 lib3 /LIBPATH:more_libs lib4 lib5 ... +# On Unix, this will be something like +# -Lpath_to_library -l1 -l2 -l3 -Lmore_libs -l4 -l5 ... + +# Each component should define a COMPONENT_INCLUDE macro which can be used +# to compile using the component's header files e.g. +# -Ipath_to_include_files -Ipath_to_more_include_files + +# Once this file is working, I will DELETE compvers.sh and ns_ftp.sh +# from the tree, so help me god. + +# this macro contains a list of source files and directories to copy to +# the directory where DLLs/SOs go at runtime; each component will add the files/dirs to +# this macro that it needs to package; not all components will have +# files which need packaging +# if you need some other behavior, see PACKAGE_SRC_DEST below +LIBS_TO_PKG = + +# this macro contains a list of source files and directories to copy to +# the directory where DLLs/SOs go at runtime; each component will add the files/dirs to +# this macro that it needs to package; this is for DLLs/SOs for the shared/bin +# directory where the ldap c sdk command line tools, some security tools, and +# the i18n conversion tools live +LIBS_TO_PKG_SHARED = + +# this macro contains a list of source files and directories to copy to +# the shared tools directory - things like the ldap c sdk command line +# tools, shared security tools, etc. +BINS_TO_PKG_SHARED = + +# this macro contains a list of shared libraries/dlls needed during +# setup to run the setup pre-install program on unix (ns-config) or +# the slapd plugin on NT (DSINST_PreInstall) +PACKAGE_SETUP_LIBS = + +# this macro contains a list of libraries/dlls to copy to the clients +# library directory +LIBS_TO_PKG_CLIENTS = + +# this macro contains a list of source files and directories to copy to +# the release/java directory; usually a list of jar files +PACKAGE_UNDER_JAVA = + +# this macro contains a list of pairs of source and dest files and directories +# the source is where to find the item in the build tree, and the dest is +# the place in the release to put the item, relative to the server root e.g. +# nls locale files are in libnls31/locale, but for packaging they need to +# go into lib/nls, not just lib; the destination should be a directory name; +# separate the src from the dest with a single space +COMMA := , +NULLSTRING := +SPACE := $(NULLSTRING) # the space is between the ) and the # +PACKAGE_SRC_DEST = + +ifeq ($(ARCH), WINNT) +EXE_SUFFIX = .exe +else # unix - windows has no lib name prefix, except for nspr +LIB_PREFIX = lib +endif + +# ADMINUTIL library ####################################### +ADMINUTIL_VERSION=$(ADMINUTIL_RELDATE)$(SEC_SUFFIX) +ADMINUTIL_BASE=$(ADMINUTIL_VERSDIR)/${ADMINUTIL_VERSION} +ADMSDKOBJDIR = $(FULL_RTL_OBJDIR) +ADMINUTIL_IMPORT=$(COMPONENTS_DIR)/${ADMINUTIL_BASE}/$(NSOBJDIR_NAME) +# this is the base directory under which the component's files will be found +# during the build process +ADMINUTIL_BUILD_DIR=$(NSCP_DISTDIR_FULL_RTL)/adminutil +ADMINUTIL_LIBPATH=$(ADMINUTIL_BUILD_DIR)/lib +ADMINUTIL_INCPATH=$(ADMINUTIL_BUILD_DIR)/include + +PACKAGE_SRC_DEST += $(ADMINUTIL_LIBPATH)/property bin/slapd/lib +LIBS_TO_PKG += $(wildcard $(ADMINUTIL_LIBPATH)/*.$(DLL_SUFFIX)) +LIBS_TO_PKG_CLIENTS += $(wildcard $(ADMINUTIL_LIBPATH)/*.$(DLL_SUFFIX)) + +# +# Libadminutil +# +ADMINUTIL_DEP = $(ADMINUTIL_LIBPATH)/libadminutil$(ADMINUTIL_VER).$(LIB_SUFFIX) +ifeq ($(ARCH), WINNT) +ADMINUTIL_LINK = /LIBPATH:$(ADMINUTIL_LIBPATH) libadminutil$(ADMINUTIL_VER).$(LIB_SUFFIX) +ADMINUTIL_S_LINK = /LIBPATH:$(ADMINUTIL_LIBPATH) libadminutil_s$(ADMINUTIL_VER).$(LIB_SUFFIX) +LIBADMINUTILDLL_NAMES = $(ADMINUTIL_LIBPATH)/libadminutil$(ADMINUTIL_VER).$(DLL_SUFFIX) +else +ADMINUTIL_LINK=-L$(ADMINUTIL_LIBPATH) -ladminutil$(ADMINUTIL_VER) +endif +ADMINUTIL_INCLUDE=-I$(ADMINUTIL_INCPATH) \ + -I$(ADMINUTIL_INCPATH)/libadminutil \ + -I$(ADMINUTIL_INCPATH)/libadmsslutil + +ifndef ADMINUTIL_PULL_METHOD +ADMINUTIL_PULL_METHOD = $(COMPONENT_PULL_METHOD) +endif + +$(ADMINUTIL_DEP): ${NSCP_DISTDIR_FULL_RTL} +ifdef COMPONENT_DEPS + $(FTP_PULL) -method $(ADMINUTIL_PULL_METHOD) \ + -objdir $(ADMINUTIL_BUILD_DIR) \ + -componentdir $(ADMINUTIL_IMPORT) \ + -files include,lib +endif + -@if [ ! -f $@ ] ; \ + then echo "Error: could not get component adminutil file $@" ; \ + fi +########################################################### +# Peer + +PEER_BUILD_DIR = $(NSCP_DISTDIR)/peer +ifeq ($(ARCH), WINNT) +# PEER_RELEASE = $(COMPONENTS_DIR)/peer/$(PEER_RELDATE) +# PEER_FILES = include +else +PEER_RELEASE = $(COMPONENTS_DIR)/peer/$(PEER_RELDATE)/$(NSOBJDIR_NAME) +PEER_FILES = obj +PEER_DEP = $(PEER_OBJPATH)/ns-ldapagt +endif +# PEER_MGMTPATH = $(PEER_BUILD_DIR)/dev +# PEER_INCDIR = $(PEER_BUILD_DIR)/include +# PEER_BINPATH = $(PEER_BUILD_DIR)/dev +PEER_OBJPATH = $(PEER_BUILD_DIR)/obj +# PEER_INCLUDE = -I$(PEER_INCDIR) + +ifndef PEER_PULL_METHOD +PEER_PULL_METHOD = $(COMPONENT_PULL_METHOD) +endif + +$(PEER_DEP): $(NSCP_DISTDIR) +ifdef COMPONENT_DEPS + $(FTP_PULL) -method $(PEER_PULL_METHOD) \ + -objdir $(PEER_BUILD_DIR) -componentdir $(PEER_RELEASE) \ + -files $(PEER_FILES) + -@if [ ! -f $@ ] ; \ + then echo "Error: could not get component PEER file $@" ; \ + fi +endif + +########################################################### + +# NSPR20 Library +NSPR_LIBNAMES = plc4 plds4 +ifeq ($(ARCH), SOLARIS) + ifeq ($(NSPR_RELDATE), v4.2.2) +# no need after v4.4.1 +NSPR_LIBNAMES += ultrasparc4 +# just need ultrasparc for now +LIBS_TO_PKG += $(addsuffix .$(DLL_SUFFIX),$(addprefix $(NSPR_LIBPATH)/lib,ultrasparc4)) + endif +endif +NSPR_LIBNAMES += nspr4 +NSPR_BUILD_DIR = $(NSCP_DISTDIR_FULL_RTL)/nspr +NSPR_ABS_BUILD_DIR = $(NSCP_ABS_DISTDIR_FULL_RTL)/nspr +NSPR_LIBPATH = $(NSPR_BUILD_DIR)/lib +NSPR_INCLUDE = -I$(NSPR_BUILD_DIR)/include +NSPR_IMPORT = $(COMPONENTS_DIR)/nspr20/$(NSPR_RELDATE)/$(FULL_RTL_OBJDIR) +NSPR_LIBS_TO_PKG = $(addsuffix .$(DLL_SUFFIX),$(addprefix $(NSPR_LIBPATH)/lib,$(NSPR_LIBNAMES))) + +LIBS_TO_PKG += $(NSPR_LIBS_TO_PKG) +LIBS_TO_PKG_SHARED += $(NSPR_LIBS_TO_PKG) # needed for cmd line tools +PACKAGE_SETUP_LIBS += $(NSPR_LIBS_TO_PKG) +LIBS_TO_PKG_CLIENTS += $(NSPR_LIBS_TO_PKG) # for dsgw + +NSPR_DEP = $(NSPR_LIBPATH)/libnspr4.$(LIB_SUFFIX) +ifeq ($(ARCH), WINNT) + NSPRDLL_NAME = $(addprefix lib, $(NSPR_LIBNAMES)) + NSPROBJNAME = $(addsuffix .lib, $(NSPRDLL_NAME)) + NSPRLINK = /LIBPATH:$(NSPR_LIBPATH) $(NSPROBJNAME) + LIBNSPRDLL_NAMES = $(addsuffix .dll, $(addprefix $(NSPR_LIBPATH)/, \ + $(addprefix lib, $(NSPR_LIBNAMES)))) +else + NSPR_SOLIBS = $(addsuffix .$(DLL_SUFFIX), $(addprefix $(LIB_PREFIX), $(NSPR_LIBNAMES))) + NSPROBJNAME = $(addsuffix .a, $(addprefix $(LIB_PREFIX), $(NSPR_LIBNAMES)) + LIBNSPR = $(addprefix $(NSPR_LIBPATH)/, $(NSPR_SOLIBS)) + NSPRLINK = -L$(NSPR_LIBPATH) $(addprefix -l, $(NSPR_LIBNAMES)) +endif + +ifndef NSPR_PULL_METHOD +NSPR_PULL_METHOD = $(COMPONENT_PULL_METHOD) +endif + +$(NSPR_DEP): $(NSCP_DISTDIR_FULL_RTL) +ifdef COMPONENT_DEPS + $(FTP_PULL) -method $(NSPR_PULL_METHOD) \ + -objdir $(NSPR_BUILD_DIR) -componentdir $(NSPR_IMPORT) \ + -files lib,include +endif + -@if [ ! -f $@ ] ; \ + then echo "Error: could not get component NSPR file $@" ; \ + fi + +### DBM ############################# + +DBM_BUILD_DIR = $(NSCP_DISTDIR_FULL_RTL)/dbm +DBM_LIBPATH = $(DBM_BUILD_DIR)/lib +DBM_INCDIR = $(DBM_BUILD_DIR)/include +DBM_DEP = $(DBM_LIBPATH)/libdbm.$(LIB_SUFFIX) +DBM_IMPORT = $(COMPONENTS_DIR)/dbm/$(DBM_RELDATE)/$(NSOBJDIR_NAME) +DBM_INCLUDE = -I$(DBM_INCDIR) +DBM_LIBNAMES = dbm + +ifeq ($(ARCH), WINNT) + DBMOBJNAME = $(addsuffix .lib, $(DBM_LIBNAMES)) + LIBDBM = $(addprefix $(DBM_LIBPATH)/, $(DBMOBJNAME)) + DBMLINK = /LIBPATH:$(DBM_LIBPATH) $(DBMOBJNAME) + DBM_DEP = $(DBM_LIBPATH)/dbm.$(LIB_SUFFIX) +else + DBM_SOLIBS = $(addsuffix .$(DLL_SUFFIX), $(addprefix $(LIB_PREFIX), $(DBM_LIBNAMES))) + DBMROBJNAME = $(addsuffix .a, $(addprefix $(LIB_PREFIX), $(DBM_LIBNAMES))) + LIBDBM = $(addprefix $(DBM_LIBPATH)/, $(DBMROBJNAME)) + DBMLINK = -L$(DBM_LIBPATH) $(addprefix -l, $(DBM_LIBNAMES)) + DBM_DEP = $(DBM_LIBPATH)/libdbm.$(LIB_SUFFIX) +endif + +ifndef DBM_PULL_METHOD +DBM_PULL_METHOD = $(COMPONENT_PULL_METHOD) +endif + +$(DBM_DEP): $(NSCP_DISTDIR_FULL_RTL) +ifdef COMPONENT_DEPS + $(FTP_PULL) -method $(DBM_PULL_METHOD) \ + -objdir $(DBM_BUILD_DIR) -componentdir $(DBM_IMPORT)/.. \ + -files xpheader.jar -unzip $(DBM_INCDIR) + $(FTP_PULL) -method $(DBM_PULL_METHOD) \ + -objdir $(DBM_BUILD_DIR) -componentdir $(DBM_IMPORT) \ + -files mdbinary.jar -unzip $(DBM_BUILD_DIR) +endif + -@if [ ! -f $@ ] ; \ + then echo "Error: could not get component DBM file $@" ; \ + fi + +### DBM END ############################# + +### SECURITY ############################# +SECURITY_BUILD_DIR = $(NSCP_DISTDIR_FULL_RTL)/nss +SECURITY_LIBPATH = $(SECURITY_BUILD_DIR)/lib +SECURITY_BINPATH = $(SECURITY_BUILD_DIR)/bin +SECURITY_INCDIR = $(SECURITY_BUILD_DIR)/include +SECURITY_INCLUDE = -I$(SECURITY_INCDIR) +# add crlutil and ocspclnt when we support CRL and OCSP cert checking in DS +ifeq ($(SECURITY_RELDATE), NSS_3_7_9_RTM) +SECURITY_BINNAMES = certutil derdump pp pk12util ssltap modutil +else +SECURITY_BINNAMES = certutil derdump pp pk12util ssltap modutil shlibsign +endif +SECURITY_LIBNAMES = ssl3 nss3 softokn3 +SECURITY_IMPORT = $(COMPONENTS_DIR)/nss/$(SECURITY_RELDATE)/$(FULL_RTL_OBJDIR) + +SECURITY_LIBNAMES.pkg = $(SECURITY_LIBNAMES) +SECURITY_LIBNAMES.pkg += smime3 +ifeq ($(ARCH), SOLARIS) +SECURITY_LIBNAMES.pkg += freebl_hybrid_3 freebl_pure32_3 fort swft +endif +ifeq ($(ARCH), HPUX) +SECURITY_LIBNAMES.pkg += freebl_hybrid_3 freebl_pure32_3 fort swft +endif +ifeq ($(ARCH), AIX) +SECURITY_LIBNAMES.pkg += fort swft +endif +ifeq ($(ARCH), OSF1) +SECURITY_LIBNAMES.pkg += fort swft +endif +ifeq ($(ARCH), WINNT) +SECURITY_LIBNAMES.pkg += fort32 swft32 +endif + +SECURITY_TOOLS = $(addsuffix $(EXE_SUFFIX),$(SECURITY_BINNAMES)) +SECURITY_TOOLS_FULLPATH = $(addprefix $(SECURITY_BINPATH)/, $(SECURITY_TOOLS)) + +SECURITY_LIBS_TO_PKG = $(addsuffix .$(DLL_SUFFIX),$(addprefix $(SECURITY_LIBPATH)/$(LIB_PREFIX),$(SECURITY_LIBNAMES.pkg))) +ifneq ($(SECURITY_RELDATE), NSS_3_7_9_RTM) +SECURITY_LIBS_TO_PKG += $(addsuffix .chk,$(addprefix $(SECURITY_LIBPATH)/$(LIB_PREFIX),$(SECURITY_LIBNAMES.pkg))) +endif +LIBS_TO_PKG += $(SECURITY_LIBS_TO_PKG) +LIBS_TO_PKG_SHARED += $(SECURITY_LIBS_TO_PKG) # for cmd line tools +PACKAGE_SETUP_LIBS += $(SECURITY_LIBS_TO_PKG) +LIBS_TO_PKG_CLIENTS += $(SECURITY_LIBS_TO_PKG) # for dsgw + +ifeq ($(ARCH), WINNT) + SECURITYOBJNAME = $(addsuffix .$(LIB_SUFFIX), $(SECURITY_LIBNAMES)) + LIBSECURITY = $(addprefix $(SECURITY_LIBPATH)/, $(SECURITYOBJNAME)) + SECURITYLINK = /LIBPATH:$(SECURITY_LIBPATH) $(SECURITYOBJNAME) + SECURITY_DEP = $(SECURITY_LIBPATH)/ssl3.$(DLL_SUFFIX) +else + SECURITYOBJNAME = $(addsuffix .$(DLL_SUFFIX), $(addprefix $(LIB_PREFIX), $(SECURITY_LIBNAMES))) + LIBSECURITY = $(addprefix $(SECURITY_LIBPATH)/, $(SECURITYOBJNAME)) + SECURITYLINK = -L$(SECURITY_LIBPATH) $(addprefix -l, $(SECURITY_LIBNAMES)) + SECURITY_DEP = $(SECURITY_LIBPATH)/libssl3.$(DLL_SUFFIX) +endif + +# we need to package the root cert file in the alias directory +PACKAGE_SRC_DEST += $(SECURITY_LIBPATH)/$(LIB_PREFIX)nssckbi.$(DLL_SUFFIX) alias + +# need to package the sec tools in shared/bin +BINS_TO_PKG_SHARED += $(SECURITY_TOOLS_FULLPATH) + +#ifeq ($(ARCH), OSF1) +#OSF1SECURITYHACKOBJ = $(OBJDIR)/osf1securityhack.o + +#$(OSF1SECURITYHACKOBJ): $(MCOM_ROOT)/ldapserver/osf1securityhack.c +# $(CC) -c $(CFLAGS) $(MCC_INCLUDE) $< -o $@ + +# SECURITYLINK += $(OSF1SECURITYHACKOBJ) +#endif + +SECURITY_FILES=lib,include,bin/$(subst $(SPACE),$(COMMA)bin/,$(SECURITY_TOOLS)) + +ifndef SECURITY_PULL_METHOD +SECURITY_PULL_METHOD = $(COMPONENT_PULL_METHOD) +endif + +$(SECURITY_DEP): $(NSCP_DISTDIR_FULL_RTL) $(OSF1SECURITYHACKOBJ) +ifdef COMPONENT_DEPS + mkdir -p $(SECURITY_BINPATH) + $(FTP_PULL) -method $(SECURITY_PULL_METHOD) \ + -objdir $(SECURITY_BUILD_DIR) -componentdir $(SECURITY_IMPORT) \ + -files $(SECURITY_FILES) +endif + -@if [ ! -f $@ ] ; \ + then echo "Error: could not get component NSS file $@" ; \ + fi + +### SECURITY END ############################# + +### SVRCORE ############################# +SVRCORE_BUILD_DIR = $(NSCP_DISTDIR)/svrcore +SVRCORE_LIBPATH = $(SVRCORE_BUILD_DIR)/lib +SVRCORE_INCDIR = $(SVRCORE_BUILD_DIR)/include +SVRCORE_INCLUDE = -I$(SVRCORE_INCDIR) +#SVRCORE_LIBNAMES = svrplcy svrcore +SVRCORE_LIBNAMES = svrcore +SVRCORE_IMPORT = $(COMPONENTS_DIR)/svrcore/$(SVRCORE_RELDATE)/$(NSOBJDIR_NAME) + +ifeq ($(ARCH), WINNT) + SVRCOREOBJNAME = $(addsuffix .lib, $(SVRCORE_LIBNAMES)) + LIBSVRCORE = $(addprefix $(SVRCORE_LIBPATH)/, $(SVRCOREOBJNAME)) + SVRCORELINK = /LIBPATH:$(SVRCORE_LIBPATH) $(SVRCOREOBJNAME) + SVRCORE_DEP = $(SVRCORE_LIBPATH)/svrcore.$(LIB_SUFFIX) +else + SVRCOREOBJNAME = $(addsuffix .a, $(addprefix $(LIB_PREFIX), $(SVRCORE_LIBNAMES))) + LIBSVRCORE = $(addprefix $(SVRCORE_LIBPATH)/, $(SVRCOREOBJNAME)) +ifeq ($(ARCH), OSF1) +# the -all flag is used by default. This flag causes _all_ objects in lib.a files to +# be processed and linked. This causes problems with svrcore because there are +# several undefined symbols (notably, the JSS_xxx functions) + SVRCORELINK = -L$(SVRCORE_LIBPATH) -none $(addprefix -l, $(SVRCORE_LIBNAMES)) -all +else + SVRCORELINK = -L$(SVRCORE_LIBPATH) $(addprefix -l, $(SVRCORE_LIBNAMES)) +endif + SVRCORE_DEP = $(SVRCORE_LIBPATH)/libsvrcore.$(LIB_SUFFIX) +endif + +ifndef SVRCORE_PULL_METHOD +SVRCORE_PULL_METHOD = $(COMPONENT_PULL_METHOD) +endif + +$(SVRCORE_DEP): $(NSCP_DISTDIR) +ifdef COMPONENT_DEPS + $(FTP_PULL) -method $(SVRCORE_PULL_METHOD) \ + -objdir $(SVRCORE_BUILD_DIR) -componentdir $(SVRCORE_IMPORT)/.. \ + -files xpheader.jar -unzip $(SVRCORE_INCDIR) + $(FTP_PULL) -method $(SVRCORE_PULL_METHOD) \ + -objdir $(SVRCORE_BUILD_DIR) -componentdir $(SVRCORE_IMPORT) \ + -files mdbinary.jar -unzip $(SVRCORE_BUILD_DIR) +endif + -@if [ ! -f $@ ] ; \ + then echo "Error: could not get component SVRCORE file $@" ; \ + fi + +### SVRCORE END ############################# + +### SETUPSDK ############################# +# this is where the build looks for setupsdk components +SETUP_SDK_BUILD_DIR = $(NSCP_DISTDIR)/setupsdk +SETUPSDK_VERSION = $(SETUP_SDK_RELDATE)$(SEC_SUFFIX) +SETUPSDK_RELEASE = $(COMPONENTS_DIR)/setupsdk/$(SETUPSDK_VERSDIR)/$(SETUPSDK_VERSION)/$(NSOBJDIR_NAME) +SETUPSDK_LIBPATH = $(SETUP_SDK_BUILD_DIR)/lib +SETUPSDK_INCDIR = $(SETUP_SDK_BUILD_DIR)/include +SETUPSDK_BINPATH = $(SETUP_SDK_BUILD_DIR)/bin +SETUPSDK_INCLUDE = -I$(SETUPSDK_INCDIR) + +ifeq ($(ARCH), WINNT) +SETUP_SDK_FILES = setupsdk.tar.gz -unzip $(NSCP_DISTDIR)/setupsdk +SETUPSDK_DEP = $(SETUPSDK_LIBPATH)/nssetup32.$(LIB_SUFFIX) +SETUPSDKLINK = /LIBPATH:$(SETUPSDK_LIBPATH) nssetup32.$(LIB_SUFFIX) +SETUPSDK_S_LINK = /LIBPATH:$(SETUPSDK_LIBPATH) nssetup32_s.$(LIB_SUFFIX) +else +SETUP_SDK_FILES = bin,lib,include +SETUPSDK_DEP = $(SETUPSDK_LIBPATH)/libinstall.$(LIB_SUFFIX) +SETUPSDKLINK = -L$(SETUPSDK_LIBPATH) -linstall +SETUPSDK_S_LINK = $(SETUPSDKLINK) +endif + +ifndef SETUPSDK_PULL_METHOD +SETUPSDK_PULL_METHOD = $(COMPONENT_PULL_METHOD) +endif + +$(SETUPSDK_DEP): $(NSCP_DISTDIR) +ifdef COMPONENT_DEPS + $(FTP_PULL) -method $(SETUPSDK_PULL_METHOD) \ + -objdir $(SETUP_SDK_BUILD_DIR) -componentdir $(SETUPSDK_RELEASE) \ + -files $(SETUP_SDK_FILES) +endif + -@if [ ! -f $@ ] ; \ + then echo "Error: could not get component SETUPSDK file $@" ; \ + fi + +#################################################### +# LDAP SDK +################################################### +ifndef LDAP_VERSION + LDAP_VERSION = $(LDAP_RELDATE)$(SEC_SUFFIX) +endif + +LDAP_ROOT = $(NSCP_DISTDIR_FULL_RTL)/ldapsdk +LDAPSDK_LIBPATH = $(LDAP_ROOT)/lib +LDAPSDK_INCDIR = $(LDAP_ROOT)/include +LDAPSDK_INCLUDE = -I$(LDAPSDK_INCDIR) +ifndef LDAP_SBC +# LDAP_SBC = $(COMPONENTS_DIR_DEV) +LDAP_SBC = $(COMPONENTS_DIR) +endif + +# package the command line programs +LDAPSDK_TOOLS = $(wildcard $(LDAP_ROOT)/tools/*$(EXE_SUFFIX)) +BINS_TO_PKG_SHARED += $(LDAPSDK_TOOLS) +# package the include files - needed for the plugin API +LDAPSDK_INCLUDE_FILES = $(wildcard $(LDAPSDK_INCDIR)/*.h) +PACKAGE_SRC_DEST += $(subst $(SPACE),$(SPACE)plugins/slapd/slapi/include$(SPACE),$(LDAPSDK_INCLUDE_FILES)) +PACKAGE_SRC_DEST += plugins/slapd/slapi/include + +LDAPOBJDIR = $(FULL_RTL_OBJDIR) +ifeq ($(ARCH), WINNT) + ifeq ($(PROCESSOR), ALPHA) + ifeq ($(DEBUG), full) + LDAPOBJDIR = WINNTALPHA3.51_DBG.OBJ + else + LDAPOBJDIR = WINNTALPHA3.51_OPT.OBJ + endif + endif + + LDAP_RELEASE = $(LDAP_SBC)/$(LDAPCOMP_DIR)/$(LDAP_VERSION)/$(LDAPOBJDIR) + LDAP_LIBNAMES = ldapssl32v$(LDAP_SUF) ldap32v$(LDAP_SUF) ldappr32v$(LDAP_SUF) + LDAPDLL_NAME = $(addprefix ns, $(LDAP_LIBNAMES)) + LDAPOBJNAME = $(addsuffix .$(LIB_SUFFIX), $(LDAPDLL_NAME)) + LDAPLINK = /LIBPATH:$(LDAPSDK_LIBPATH) $(LDAPOBJNAME) + LIBLDAPDLL_NAMES = $(addsuffix .dll, $(addprefix $(LDAP_LIBPATH)/, $(LDAPDLL_NAME))) + LDAPSDK_DEP = $(LDAPSDK_LIBPATH)/nsldap32v$(LDAP_SUF).$(DLL_SUFFIX) + LDAPSDK_PULL_LIBS = lib/nsldapssl32v$(LDAP_SUF).$(LIB_SUFFIX),lib/nsldapssl32v$(LDAP_SUF).$(LDAP_DLL_SUFFIX),lib/nsldap32v$(LDAP_SUF).$(LIB_SUFFIX),lib/nsldap32v$(LDAP_SUF).$(LDAP_DLL_SUFFIX),lib/nsldappr32v$(LDAP_SUF).$(LIB_SUFFIX),lib/nsldappr32v$(LDAP_SUF).$(LDAP_DLL_SUFFIX) + + LIBS_TO_PKG += $(addsuffix .$(DLL_SUFFIX),$(addprefix $(LDAPSDK_LIBPATH)/,$(LDAPDLL_NAME))) + PACKAGE_SETUP_LIBS += $(addsuffix .$(DLL_SUFFIX),$(addprefix $(LDAPSDK_LIBPATH)/,$(LDAPDLL_NAME))) + LIBS_TO_PKG_SHARED += $(addsuffix .$(DLL_SUFFIX),$(addprefix $(LDAPSDK_LIBPATH)/,$(LDAPDLL_NAME))) + LIBS_TO_PKG_CLIENTS += $(addsuffix .$(DLL_SUFFIX),$(addprefix $(LDAPSDK_LIBPATH)/,$(LDAPDLL_NAME))) +endif + +# override LDAP version in OS specific section +ifneq ($(ARCH), WINNT) +# LDAP Does not has PTH version, so here is the hack which treat non PTH +# version as PTH version + ifeq ($(USE_PTHREADS), 1) + LDAP_RELEASE = $(LDAP_SBC)/$(LDAPCOMP_DIR)/$(LDAP_VERSION)/$(NSOBJDIR_NAME1) + else + LDAP_RELEASE = $(LDAP_SBC)/$(LDAPCOMP_DIR)/$(LDAP_VERSION)/$(LDAPOBJDIR) + endif + LDAP_SOLIB_NAMES = ssldap$(LDAP_SUF)$(LDAP_DLL_PRESUF) ldap$(LDAP_SUF)$(LDAP_DLL_PRESUF) prldap$(LDAP_SUF)$(LDAP_DLL_PRESUF) + ifndef LDAP_NO_LIBLCACHE + LDAP_SOLIB_NAMES += lcache30$(LDAP_DLL_PRESUF) + endif + LDAP_DOTALIB_NAMES = + LDAP_LIBNAMES = $(LDAP_DOTALIB_NAMES) $(LDAP_SOLIB_NAMES) + LDAP_SOLIBS = $(addsuffix .$(LDAP_DLL_SUFFIX), $(addprefix $(LIB_PREFIX), $(LDAP_SOLIB_NAMES))) + LDAPOBJNAME = $(addsuffix .$(LIB_SUFFIX), $(addprefix $(LIB_PREFIX), $(LDAP_DOTALIB_NAMES))) \ + $(LDAP_SOLIBS) + LDAPSDK_DEP = $(LDAPSDK_LIBPATH)/libldap$(LDAP_SUF).$(DLL_SUFFIX) + LDAPLINK = -L$(LDAPSDK_LIBPATH) $(addprefix -l,$(LDAP_SOLIB_NAMES)) + LDAP_NOSSL_LINK = -L$(LDAPSDK_LIBPATH) -lldap$(LDAP_SUF)$(LDAP_DLL_PRESUF) + LDAPSDK_PULL_LIBS = lib/libssldap$(LDAP_SUF)$(LDAP_DLL_PRESUF).$(LDAP_DLL_SUFFIX),lib/libldap$(LDAP_SUF)$(LDAP_DLL_PRESUF).$(LDAP_DLL_SUFFIX),lib/libprldap$(LDAP_SUF)$(LDAP_DLL_PRESUF).$(LDAP_DLL_SUFFIX) + + LIBS_TO_PKG += $(addprefix $(LDAPSDK_LIBPATH)/,$(LDAP_SOLIBS)) + PACKAGE_SETUP_LIBS += $(addprefix $(LDAPSDK_LIBPATH)/,$(LDAP_SOLIBS)) + LIBS_TO_PKG_SHARED += $(addprefix $(LDAPSDK_LIBPATH)/,$(LDAP_SOLIBS)) + LIBS_TO_PKG_CLIENTS += $(addprefix $(LDAPSDK_LIBPATH)/,$(LDAP_SOLIBS)) +endif + +LDAP_LIBPATH = $(LDAP_ROOT)/lib +LDAP_INCLUDE = $(LDAP_ROOT)/include +LDAP_TOOLDIR = $(LDAP_ROOT)/tools +LIBLDAP = $(addprefix $(LDAP_LIBPATH)/, $(LDAPOBJNAME)) +LDAPSDK_FILES = include,$(LDAPSDK_PULL_LIBS),tools + +ifndef LDAPSDK_PULL_METHOD +LDAPSDK_PULL_METHOD = $(COMPONENT_PULL_METHOD) +endif + +$(LDAPSDK_DEP): $(NSCP_DISTDIR_FULL_RTL) +ifdef COMPONENT_DEPS + mkdir -p $(LDAP_LIBPATH) + $(FTP_PULL) -method $(LDAPSDK_PULL_METHOD) \ + -objdir $(LDAP_ROOT) -componentdir $(LDAP_RELEASE) \ + -files $(LDAPSDK_FILES) +endif + -@if [ ! -f $@ ] ; \ + then echo "Error: could not get component LDAPSDK file $@" ; \ + fi + +#################################################### +# DSRK +#################################################### +ifndef DSRK_VERSION + DSRK_VERSION = $(DSRK_RELDATE)$(SEC_SUFFIX) +endif +ifndef DSRK_SBC +# DSRK_SBC = $(COMPONENTS_DIR_DEV) +DSRK_SBC = $(COMPONENTS_DIR) +endif + +DSRK_RELEASE = $(DSRK_SBC)/dsrk/$(DSRKCOMP_DIR)/$(DSRK_VERSION)/$(NSOBJDIR_NAME) +DSRK_FILES = bin,perl +DSRK_BUILD_DIR = $(NSCP_DISTDIR)/dsrk +DSRK_DEP = $(DSRK_BUILD_DIR)/bin/n$(DSRKCOMP_DIR) + +ifndef DSRK_PULL_METHOD +DSRK_PULL_METHOD = $(COMPONENT_PULL_METHOD) +endif + +$(DSRK_DEP): $(NSCP_DISTDIR_FULL_RTL) +ifdef COMPONENT_DEPS + $(FTP_PULL) -method $(DSRK_PULL_METHOD) \ + -objdir $(DSRK_BUILD_DIR) -componentdir $(DSRK_RELEASE) \ + -files $(DSRK_FILES) +endif + -@if [ ! -d $@ ] ; \ + then echo "Error: could not get component DSRK file $@" ; \ + fi + +# apache-axis java classes ####################################### +AXIS = axis-bin-$(AXIS_VERSION).zip +AXIS_FILES = $(AXIS) +#AXIS_RELEASE = $(COMPONENTS_DIR) +AXIS_RELEASE = $(COMPONENTS_DIR_DEV)/ds/ds70-bozeman +#AXISJAR_DIR = $(AXISJAR_RELEASE)/$(AXISJAR_COMP)/$(AXISJAR_VERSION) +AXIS_DIR = $(AXIS_RELEASE)/axis +AXIS_FILE = $(CLASS_DEST)/$(AXIS) +AXIS_DEP = $(AXIS_FILE) +AXIS_REL_DIR=$(subst -bin,,$(subst .zip,,$(AXIS))) + + +# This is java, so there is only one real platform subdirectory + +#PACKAGE_UNDER_JAVA += $(AXIS_FILE) + +ifndef AXIS_PULL_METHOD +AXIS_PULL_METHOD = $(COMPONENT_PULL_METHOD) +endif + +$(AXIS_DEP): $(CLASS_DEST) +ifdef COMPONENT_DEPS + echo "Inside ftppull" + $(FTP_PULL) -method $(COMPONENT_PULL_METHOD) \ + -objdir $(CLASS_DEST) -componentdir $(AXIS_DIR) \ + -files $(AXIS_FILES) -unzip $(CLASS_DEST) +endif + -@if [ ! -f $@ ] ; \ + then echo "Error: could not get component AXIS files $@" ; \ + fi + +########################################################### + + +# other dsml java classes ####################################### +DSMLJAR = activation.jar,jaxrpc-api.jar,jaxrpc.jar,saaj.jar,xercesImpl.jar,xml-apis.jar +DSMLJAR_FILES = $(DSMLJAR) +DSMLJAR_RELEASE = $(COMPONENTS_DIR_DEV)/ds/ds70-bozeman +#DSMLJARJAR_DIR = $(DSMLJARJAR_RELEASE)/$(DSMLJARJAR_COMP)/$(DSMLJARJAR_VERSION) +DSMLJAR_DIR = $(DSMLJAR_RELEASE)/dsmljars +DSMLJAR_FILE = $(CLASS_DEST) +DSMLJAR_DEP = $(CLASS_DEST)/activation.jar $(CLASS_DEST)/jaxrpc-api.jar $(CLASS_DEST)/jaxrpc.jar $(CLASS_DEST)/saaj.jar $(CLASS_DEST)/xercesImpl.jar $(CLASS_DEST)/xml-apis.jar + +ifndef DSMLJAR_PULL_METHOD +DSMLJAR_PULL_METHOD = $(COMPONENT_PULL_METHOD) +endif + +$(DSMLJAR_DEP): $(CLASS_DEST) +ifdef COMPONENT_DEPS + echo "Inside ftppull" + $(FTP_PULL) -method $(COMPONENT_PULL_METHOD) \ + -objdir $(CLASS_DEST) -componentdir $(DSMLJAR_DIR) \ + -files $(DSMLJAR_FILES) + +endif + -@if [ ! -f $@ ] ; \ + then echo "Error: could not get component DSMLJAR files $@" ; \ + fi + +########################################################### + +# XMLTOOLS java classes ####################################### +CRIMSONJAR = crimson.jar +CRIMSON_LICENSE = LICENSE.crimson +CRIMSONJAR_FILES = $(CRIMSONJAR),$(CRIMSON_LICENSE) +CRIMSONJAR_RELEASE = $(COMPONENTS_DIR) +CRIMSONJAR_DIR = $(CRIMSONJAR_RELEASE)/$(CRIMSONJAR_COMP)/$(CRIMSONJAR_VERSION) +CRIMSONJAR_FILE = $(CLASS_DEST)/$(CRIMSONJAR) +CRIMSONJAR_DEP = $(CRIMSONJAR_FILE) $(CLASS_DEST)/$(CRIMSON_LICENSE) + + +# This is java, so there is only one real platform subdirectory + +PACKAGE_UNDER_JAVA += $(CRIMSONJAR_FILE) + +ifndef CRIMSONJAR_PULL_METHOD +CRIMSONJAR_PULL_METHOD = $(COMPONENT_PULL_METHOD) +endif + +$(CRIMSONJAR_DEP): $(CLASS_DEST) +ifdef COMPONENT_DEPS + echo "Inside ftppull" + $(FTP_PULL) -method $(COMPONENT_PULL_METHOD) \ + -objdir $(CLASS_DEST) -componentdir $(CRIMSONJAR_DIR) \ + -files $(CRIMSONJAR_FILES) +endif + -@if [ ! -f $@ ] ; \ + then echo "Error: could not get component CRIMSONJAR files $@" ; \ + fi + +########################################################### + +# ANT java classes ####################################### +ifeq ($(BUILD_JAVA_CODE),1) +# (we use ant for building some Java code) +ANTJAR = ant.jar +JAXPJAR = jaxp.jar +ANT_FILES = $(ANTJAR) $(JAXPJAR) +ANT_RELEASE = $(COMPONENTS_DIR) +ANT_HOME = $(ANT_RELEASE)/$(ANT_COMP)/$(ANT_VERSION) +ANT_DIR = $(ANT_HOME)/lib +ANT_DEP = $(addprefix $(CLASS_DEST)/, $(ANT_FILES)) +ANT_CP = $(subst $(SPACE),$(PATH_SEP),$(ANT_DEP)) +ANT_PULL = $(subst $(SPACE),$(COMMA),$(ANT_FILES)) + +ifndef ANT_PULL_METHOD +ANT_PULL_METHOD = $(COMPONENT_PULL_METHOD) +endif + +$(ANT_DEP): $(CLASS_DEST) $(CRIMSONJAR_DEP) +ifdef COMPONENT_DEPS + echo "Inside ftppull" + $(FTP_PULL) -method $(COMPONENT_PULL_METHOD) \ + -objdir $(CLASS_DEST) -componentdir $(ANT_DIR) \ + -files $(ANT_PULL) +endif + -@if [ ! -f $@ ] ; \ + then echo "Error: could not get component ant files $@" ; \ + fi +endif +########################################################### + +# Servlet SDK classes ####################################### +SERVLETJAR = servlet.jar +SERVLET_FILES = $(SERVLETJAR) +SERVLET_RELEASE = $(COMPONENTS_DIR) +SERVLET_DIR = $(SERVLET_RELEASE)/$(SERVLET_COMP)/$(SERVLET_VERSION) +SERVLET_DEP = $(addprefix $(CLASS_DEST)/, $(SERVLET_FILES)) +SERVLET_CP = $(subst $(SPACE),$(PATH_SEP),$(SERVLET_DEP)) +SERVLET_PULL = $(subst $(SPACE),$(COMMA),$(SERVLET_FILES)) + +ifndef SERVLET_PULL_METHOD +SERVLET_PULL_METHOD = $(COMPONENT_PULL_METHOD) +endif + +$(SERVLET_DEP): $(CLASS_DEST) +ifdef COMPONENT_DEPS + echo "Inside ftppull" + $(FTP_PULL) -method $(COMPONENT_PULL_METHOD) \ + -objdir $(CLASS_DEST) -componentdir $(SERVLET_DIR) \ + -files $(SERVLET_PULL) +endif + -@if [ ! -f $@ ] ; \ + then echo "Error: could not get component servlet SDK files $@" ; \ + fi + +########################################################### + +# LDAP java classes ####################################### +LDAPJDK = ldapjdk.jar +LDAPJDK_VERSION = $(LDAPJDK_RELDATE) +LDAPJDK_RELEASE = $(COMPONENTS_DIR) +LDAPJDK_DIR = $(LDAPJDK_RELEASE) +LDAPJDK_IMPORT = $(LDAPJDK_RELEASE)/$(LDAPJDK_COMP)/$(LDAPJDK_VERSION)/$(NSOBJDIR_NAME) +# This is java, so there is only one real platform subdirectory +LDAPJARFILE=$(CLASS_DEST)/ldapjdk.jar +LDAPJDK_DEP=$(LDAPJARFILE) + +#PACKAGE_UNDER_JAVA += $(LDAPJARFILE) + +ifndef LDAPJDK_PULL_METHOD +LDAPJDK_PULL_METHOD = $(COMPONENT_PULL_METHOD) +endif + +$(LDAPJDK_DEP): $(CLASS_DEST) +ifdef COMPONENT_DEPS + $(FTP_PULL) -method $(LDAPJDK_PULL_METHOD) \ + -objdir $(CLASS_DEST) -componentdir $(LDAPJDK_IMPORT) \ + -files $(LDAPJDK) +endif + -@if [ ! -f $@ ] ; \ + then echo "Error: could not get component LDAPJDK file $@" ; \ + fi + +########################################################### + +# MCC java classes - the Mission Control Console ######### +MCC_VERSION=$(MCC_RELDATE)$(SEC_SUFFIX) +# +MCCJAR = mcc$(MCC_REL).jar +MCCJAR_EN = mcc$(MCC_REL)_en.jar +NMCLFJAR = nmclf$(MCC_REL).jar +NMCLFJAR_EN = nmclf$(MCC_REL)_en.jar +BASEJAR = base.jar +#MCC_RELEASE=$(COMPONENTS_DIR_DEV) +MCC_RELEASE=$(COMPONENTS_DIR) +MCC_JARDIR = $(MCC_RELEASE)/$(MCC_COMP)/$(MCC_VERSION)/jars +MCCJARFILE=$(CLASS_DEST)/$(MCCJAR) +NMCLFJARFILE=$(CLASS_DEST)/$(NMCLFJAR) +BASEJARFILE=$(CLASS_DEST)/$(BASEJAR) + +MCC_DEP = $(BASEJARFILE) +MCC_FILES=$(MCCJAR),$(MCCJAR_EN),$(NMCLFJAR),$(NMCLFJAR_EN),$(BASEJAR) + +#PACKAGE_UNDER_JAVA += $(addprefix $(CLASS_DEST)/,$(subst $(COMMA),$(SPACE),$(MCC_FILES))) + +ifndef MCC_PULL_METHOD +MCC_PULL_METHOD = $(COMPONENT_PULL_METHOD) +endif + +$(MCC_DEP): $(CLASS_DEST) +ifdef COMPONENT_DEPS + $(FTP_PULL) -method $(MCC_PULL_METHOD) \ + -objdir $(CLASS_DEST) -componentdir $(MCC_JARDIR) \ + -files $(MCC_FILES) +endif + -@if [ ! -f $@ ] ; \ + then echo "Error: could not get component MCC file $@" ; \ + fi + +########################################################### + +########################################################### +### Perldap package ####################################### + +PERLDAP_COMPONENT_DIR = $(COMPONENTS_DIR)/perldap/$(PERLDAP_VERSION)/$(NSOBJDIR_NAME_32) +PERLDAP_ZIP_FILE = perldap14.zip + +########################################################### + +# JSS classes - for the Mission Control Console ###### +JSSJAR = jss$(JSS_JAR_VERSION).jar +JSSJARFILE = $(CLASS_DEST)/$(JSSJAR) +JSS_RELEASE = $(COMPONENTS_DIR)/$(JSS_COMP)/$(JSS_VERSION) +JSS_DEP = $(JSSJARFILE) + +#PACKAGE_UNDER_JAVA += $(JSSJARFILE) + +ifndef JSS_PULL_METHOD +JSS_PULL_METHOD = $(COMPONENT_PULL_METHOD) +endif + +$(JSS_DEP): $(CLASS_DEST) +ifdef COMPONENT_DEPS + $(FTP_PULL) -method $(JSS_PULL_METHOD) \ + -objdir $(CLASS_DEST) -componentdir $(JSS_RELEASE) \ + -files $(JSSJAR) +endif + -@if [ ! -f $@ ] ; \ + then echo "Error: could not get component JSS file $@" ; \ + fi + +########################################################### + +########################################################### +### Admin Server package ################################## + +ADMIN_REL = $(ADM_VERSDIR) +ADMIN_REL_DATE = $(ADM_VERSION) +ADMIN_FILE = admserv.tar.gz +ADMIN_FILE_TAR = admserv.tar +ADMSDKOBJDIR = $(NSCONFIG)$(NSOBJDIR_TAG).OBJ +IMPORTADMINSRV_BASE=$(COMPONENTS_DIR)/$(ADMIN_REL)/$(ADMIN_REL_DATE) +IMPORTADMINSRV = $(IMPORTADMINSRV_BASE)/$(NSOBJDIR_NAME_32) +ADMSERV_DIR=$(ABS_ROOT)/dist/$(NSOBJDIR_NAME)/admserv +ADMSERV_DEP = $(ADMSERV_DIR)/setup$(EXE_SUFFIX) + +ifdef FORTEZZA + ADM_VERSION = $(ADM_RELDATE)F +else + ifeq ($(SECURITY), domestic) + ADM_VERSION = $(ADM_RELDATE)D + else + ifneq ($(ARCH), IRIX) + ADM_VERSION = $(ADM_RELDATE)E + else + ADM_VERSION = $(ADM_RELDATE)D + endif + endif +endif + +ADM_VERSION = $(ADM_RELDATE)$(SEC_SUFFIX) +ADM_RELEASE = $(COMPONENTS_DIR)/$(ADM_VERSDIR)/$(ADM_VERSION)/$(NSOBJDIR_NAME) + +ifndef ADMSERV_PULL_METHOD +ADMSERV_PULL_METHOD = $(COMPONENT_PULL_METHOD) +endif + +ifndef ADMSERV_DEPS +ADMSERV_DEPS = $(COMPONENT_DEPS) +endif +#IMPORTADMINSRV = /share/builds/sbsrel1/admsvr/admsvr62/ships/20030702.2/spd04_Solaris8/SunOS5.8-domestic-optimize-normal +#ADM_RELEASE = /share/builds/sbsrel1/admsvr/admsvr62/ships/20030702.2/spd04_Solaris8/SunOS5.8-domestic-optimize-normal +$(ADMSERV_DEP): $(ABS_ROOT)/dist/$(NSOBJDIR_NAME) +ifdef ADMSERV_DEPS + $(FTP_PULL) -method $(ADMSERV_PULL_METHOD) \ + -objdir $(ADMSERV_DIR) -componentdir $(IMPORTADMINSRV) \ + -files $(ADMIN_FILE) -unzip $(ADMSERV_DIR) +endif + @if [ ! -f $@ ] ; \ + then echo "Error: could not get component ADMINSERV file $@" ; \ + exit 1 ; \ + fi +### Admin Server END ###################################### + + + +### SASL package ########################################## + +SASL_BUILD_DIR = $(NSCP_DISTDIR_FULL_RTL)/sasl +SASL_RELEASE = $(COMPONENTS_DIR)/sasl/$(SASL_VERSDIR)/$(SASL_RELDATE)/$(NSOBJDIR_NAME) +SASL_LIBPATH = $(SASL_BUILD_DIR)/lib +SASL_BINPATH = $(SASL_BUILD_DIR)/bin +SASL_INCLUDE = $(SASL_BUILD_DIR)/include +SASL_DEP = $(SASL_INCLUDE)/sasl.h +ifeq ($(ARCH), WINNT) +SASL_LINK = /LIBPATH:$(SASL_LIBPATH) sasl.lib +else +ifeq ($(ARCH), SOLARIS) +GSSAPI_LIBS=-lgss +endif +#ifeq ($(ARCH), HPUX) +GSSAPI_LIBS=-lgss +#endif +ifeq ($(ARCH), Linux) +GSSAPI_LIBS=-L/usr/kerberos/lib -lgssapi_krb5 +endif +SASL_LINK = -L$(SASL_LIBPATH) -lsasl $(GSSAPI_LIBS) +#SASL_LINK = -L$(SASL_LIBPATH) -lsasl +endif + +ifndef SASL_PULL_METHOD +SASL_PULL_METHOD = $(COMPONENT_PULL_METHOD) +endif + +$(SASL_DEP): $(NSCP_DISTDIR_FULL_RTL) +ifdef COMPONENT_DEPS + $(FTP_PULL) -method $(SASL_PULL_METHOD) \ + -objdir $(SASL_BUILD_DIR) -componentdir $(SASL_RELEASE) \ + -files lib,include +endif + -@if [ ! -f $@ ] ; \ + then echo "Error: could not get component SASL file $@" ; \ + fi + +########################################################### + +### JSP compiler package ################################## + +JSPC_REL = $(JSPC_VERSDIR) +JSPC_REL_DATE = $(JSPC_VERSION) +JSPC_FILES = jasper-compiler.jar jasper-runtime.jar +JSPC_RELEASE = $(COMPONENTS_DIR) +JSPC_DIR = $(JSPC_RELEASE)/$(JSPC_COMP)/$(JSPC_VERSION) +JSPC_DEP = $(addprefix $(CLASS_DEST)/, $(JSPC_FILES)) +JSPC_CP = $(subst $(SPACE),$(PATH_SEP),$(JSPC_DEP)) +JSPC_PULL = $(subst $(SPACE),$(COMMA),$(JSPC_FILES)) + +ifndef JSPC_PULL_METHOD +JSPC_PULL_METHOD = $(COMPONENT_PULL_METHOD) +endif + +$(JSPC_DEP): $(CLASS_DEST) +ifdef COMPONENT_DEPS + echo "Inside ftppull" + $(FTP_PULL) -method $(COMPONENT_PULL_METHOD) \ + -objdir $(CLASS_DEST) -componentdir $(JSPC_DIR) \ + -files $(JSPC_PULL) +endif + -@if [ ! -f $@ ] ; \ + then echo "Error: could not get component jspc files $@" ; \ + fi + +########################################################### + +### ICU package ########################################## + +ICU_LIB_VERSION = 24 +ICU_BUILD_DIR = $(NSCP_DISTDIR_FULL_RTL)/libicu +ICU_RELEASE = $(COMPONENTS_DIR)/libicu/$(ICU_VERSDIR)/$(ICU_RELDATE)/$(NSOBJDIR_NAME) +ICU_LIBPATH = $(ICU_BUILD_DIR)/lib +ICU_BINPATH = $(ICU_BUILD_DIR)/bin +ICU_INCPATH = $(ICU_BUILD_DIR)/include +ICU_DEP = $(ICU_INCPATH)/unicode/unicode.h +ICU_INCLUDE = -I$(ICU_INCPATH) +ifeq ($(ARCH), WINNT) +ifeq ($(BUILD_DEBUG), optimize) +ICU_LIB_SUF= +else +ICU_LIB_SUF=d +endif +ICU_LIBNAMES = icuin$(ICU_LIB_SUF) icuuc$(ICU_LIB_SUF) icudata +ICU_DLLNAMES = icuin$(ICU_LIB_VERSION)$(ICU_LIB_SUF) icuuc$(ICU_LIB_VERSION)$(ICU_LIB_SUF) icudt$(ICU_LIB_VERSION)l +ICULINK = /LIBPATH:$(ICU_LIBPATH) $(addsuffix .$(LIB_SUFFIX),$(ICU_LIBNAMES)) +LIBS_TO_PKG += $(addsuffix .$(DLL_SUFFIX),$(addprefix $(ICU_BINPATH)/,$(ICU_DLLNAMES))) +LIBS_TO_PKG_SHARED += $(addsuffix .$(DLL_SUFFIX),$(addprefix $(ICU_BINPATH)/,$(ICU_DLLNAMES))) +LIBS_TO_PKG_CLIENTS += $(addsuffix .$(DLL_SUFFIX),$(addprefix $(ICU_BINPATH)/,$(ICU_DLLNAMES))) +else +ICU_LIBNAMES = icui18n icuuc icudata +ICULINK = -L$(ICU_LIBPATH) $(addprefix -l, $(ICU_LIBNAMES)) +LIBS_TO_PKG += $(addsuffix .$(ICU_LIB_VERSION),$(addsuffix .$(DLL_SUFFIX),$(addprefix $(ICU_LIBPATH)/,$(addprefix lib,$(ICU_LIBNAMES))))) +LIBS_TO_PKG_SHARED += $(addsuffix .$(ICU_LIB_VERSION),$(addsuffix .$(DLL_SUFFIX),$(addprefix $(ICU_LIBPATH)/,$(addprefix lib,$(ICU_LIBNAMES))))) +LIBS_TO_PKG_CLIENTS += $(addsuffix .$(ICU_LIB_VERSION),$(addsuffix .$(DLL_SUFFIX),$(addprefix $(ICU_LIBPATH)/,$(addprefix lib,$(ICU_LIBNAMES))))) +#LIBS_TO_PKG = $(addsuffix $(addprefix lib,$(ICU_LIBNAMES)) +endif + +BINS_TO_PKG_SHARED += $(ICU_BINPATH)/uconv$(EXE_SUFFIX) + +ifndef ICU_PULL_METHOD +ICU_PULL_METHOD = $(COMPONENT_PULL_METHOD) +endif + +$(ICU_DEP): $(NSCP_DISTDIR_FULL_RTL) +ifdef COMPONENT_DEPS + $(FTP_PULL) -method $(ICU_PULL_METHOD) \ + -objdir $(ICU_BUILD_DIR) -componentdir $(ICU_RELEASE) \ + -files lib,include,bin +endif + -@if [ ! -f $@ ] ; \ + then echo "Error: could not get component ICU file $@" ; \ + fi + +########################################################### diff --git a/config/.cvsignore b/config/.cvsignore new file mode 100644 index 00000000..9a1527d0 --- /dev/null +++ b/config/.cvsignore @@ -0,0 +1,5 @@ +nfspwd +nsinstall +revdepth +myconfig.mk +myrules.mk diff --git a/config/Linux2.4.mk b/config/Linux2.4.mk new file mode 100644 index 00000000..fc0447b8 --- /dev/null +++ b/config/Linux2.4.mk @@ -0,0 +1,58 @@ +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# +# Config stuff for Linux2.4 +# + +#include $(NSPRDEPTH)/config/UNIX.mk + +CC = gcc +CCC = g++ + +CPU_ARCH = x86 +GFX_ARCH = x + +RANLIB = ranlib + +ifdef SERVER_BUILD +# see sun-java/config/config.mk +STATIC_JAVA = yes +endif + +NEED_XMOS = 1 + +# fixme OS_CFLAGS = -m486 -ansi -Wall -pipe -MDupdate $(DEPENDENCIES) +OS_CFLAGS = -m486 -ansi -Wall -pipe + +OS_CFLAGS += -DLINUX -DLINUX2_4 -D_POSIX_SOURCE -D_BSD_SOURCE -DHAVE_STRERROR -D_REENTRANT +OS_LIBS = -L /lib -lc -ldl -lpthread + +ARCH = linux + +EN_LOCALE = C +DE_LOCALE = de_DE.ISO8859-1 +FR_LOCALE = fr_FR.ISO8859-1 +JP_LOCALE = ja +SJIS_LOCALE = ja_JP.SJIS +KR_LOCALE = ko_KR.EUC +CN_LOCALE = zh +TW_LOCALE = zh +I2_LOCALE = i2 + +BUILD_UNIX_PLUGINS = 1 + +ifeq ($(OS_RELEASE),2.4) +OS_REL_CFLAGS += -DLINUX2_4 +MKSHLIB = $(LD) -shared +endif + +XINC = /usr/X11R6/include +INCLUDES += -I$(XINC) + +BSDECHO = echo + diff --git a/config/Linux2.6.mk b/config/Linux2.6.mk new file mode 100644 index 00000000..fc0447b8 --- /dev/null +++ b/config/Linux2.6.mk @@ -0,0 +1,58 @@ +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# +# Config stuff for Linux2.4 +# + +#include $(NSPRDEPTH)/config/UNIX.mk + +CC = gcc +CCC = g++ + +CPU_ARCH = x86 +GFX_ARCH = x + +RANLIB = ranlib + +ifdef SERVER_BUILD +# see sun-java/config/config.mk +STATIC_JAVA = yes +endif + +NEED_XMOS = 1 + +# fixme OS_CFLAGS = -m486 -ansi -Wall -pipe -MDupdate $(DEPENDENCIES) +OS_CFLAGS = -m486 -ansi -Wall -pipe + +OS_CFLAGS += -DLINUX -DLINUX2_4 -D_POSIX_SOURCE -D_BSD_SOURCE -DHAVE_STRERROR -D_REENTRANT +OS_LIBS = -L /lib -lc -ldl -lpthread + +ARCH = linux + +EN_LOCALE = C +DE_LOCALE = de_DE.ISO8859-1 +FR_LOCALE = fr_FR.ISO8859-1 +JP_LOCALE = ja +SJIS_LOCALE = ja_JP.SJIS +KR_LOCALE = ko_KR.EUC +CN_LOCALE = zh +TW_LOCALE = zh +I2_LOCALE = i2 + +BUILD_UNIX_PLUGINS = 1 + +ifeq ($(OS_RELEASE),2.4) +OS_REL_CFLAGS += -DLINUX2_4 +MKSHLIB = $(LD) -shared +endif + +XINC = /usr/X11R6/include +INCLUDES += -I$(XINC) + +BSDECHO = echo + diff --git a/config/Makefile b/config/Makefile new file mode 100644 index 00000000..a3326e44 --- /dev/null +++ b/config/Makefile @@ -0,0 +1,38 @@ +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +#! gmake + +DEPTH = .. + +HSRCS = pathsub.h +CSRCS = nsinstall.c pathsub.c + +PLSRCS = nfspwd.pl revdepth.pl + +ifneq ($(subst /,_,$(shell uname -s)),WINNT) +PROGRAM = nsinstall +OBJS = $(CSRCS:.c=.o) +endif + +TARGETS = $(PROGRAM) $(PLSRCS:.pl=) + +# IMPORTANT: Disable NSBUILDROOT for this directory only, otherwise we have +# a recursive rule for finding nsinstall and the perl scripts +ifdef NSBUILDROOT +override NSBUILDROOT := +endif + +include $(DEPTH)/config/rules.mk + +# Redefine MAKE_OBJDIR for just this directory +define MAKE_OBJDIR +if test ! -d $(@D); then rm -rf $(@D); mkdir $(@D); fi +endef + +export:: $(TARGETS) +install:: $(TARGETS) diff --git a/config/SunOS5.8.mk b/config/SunOS5.8.mk new file mode 100644 index 00000000..5019c182 --- /dev/null +++ b/config/SunOS5.8.mk @@ -0,0 +1,14 @@ +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# +# Config stuff for SunOS5.8 +# + +SOL_CFLAGS = -D_SVID_GETTOD -DSOLARIS_55_OR_GREATER + +include $(DEPTH)/config/SunOS5.mk diff --git a/config/SunOS5.8_i86pc.mk b/config/SunOS5.8_i86pc.mk new file mode 100644 index 00000000..5019c182 --- /dev/null +++ b/config/SunOS5.8_i86pc.mk @@ -0,0 +1,14 @@ +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# +# Config stuff for SunOS5.8 +# + +SOL_CFLAGS = -D_SVID_GETTOD -DSOLARIS_55_OR_GREATER + +include $(DEPTH)/config/SunOS5.mk diff --git a/config/SunOS5.9.mk b/config/SunOS5.9.mk new file mode 100644 index 00000000..bff14749 --- /dev/null +++ b/config/SunOS5.9.mk @@ -0,0 +1,14 @@ +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# +# Config stuff for SunOS5.9 +# + +SOL_CFLAGS = -D_SVID_GETTOD -DSOLARIS_55_OR_GREATER + +include $(DEPTH)/config/SunOS5.mk diff --git a/config/UNIX.mk b/config/UNIX.mk new file mode 100644 index 00000000..35d0c36e --- /dev/null +++ b/config/UNIX.mk @@ -0,0 +1,14 @@ +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# A small start on what nspr20/config did +XP_DEFINE = -DXP_UNIX +LIB_SUFFIX = a +# +DLL_SUFFIX = so +AR = ar cr $@ + diff --git a/config/WINNT5.0.mk b/config/WINNT5.0.mk new file mode 100644 index 00000000..41c2cac6 --- /dev/null +++ b/config/WINNT5.0.mk @@ -0,0 +1,56 @@ +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# +# Config stuff for WINNT 5.0 +# + +CC=cl +CCC=cl +LINK = link +RANLIB = echo +BSDECHO = echo + +OTHER_DIRT = +GARBAGE = vc20.pdb + +ifdef DEBUG_RUNTIME +RTLIBFLAGS:=-MDd +else +RTLIBFLAGS:=-MD +endif + +PROCESSOR := $(shell uname -p) +USE_KERNEL_THREADS=1 +_PR_USECPU=1 +ifeq ($(PROCESSOR), I386) +CPU_ARCH = x386 +OS_CFLAGS = $(OPTIMIZER) -GT $(RTLIBFLAGS) -W3 -nologo -D_X86_ -Dx386 -D_WINDOWS -DWIN32 -DHW_THREADS +else +ifeq ($(PROCESSOR), MIPS) +CPU_ARCH = MIPS +#OS_CFLAGS = $(OPTIMIZER) $(RTLIBFLAGS) -W3 -nologo -D_MIPS_ -D_WINDOWS -DWIN32 -DHW_THREADS +OS_CFLAGS = $(OPTIMIZER) $(RTLIBFLAGS) -W3 -nologo -D_WINDOWS -DWIN32 -DHW_THREADS +else +ifeq ($(PROCESSOR), ALPHA) +CPU_ARCH = ALPHA +OS_CFLAGS = $(OPTIMIZER) $(RTLIBFLAGS) -W3 -nologo -D_ALPHA_=1 -D_WINDOWS -DWIN32 -DHW_THREADS +else +CPU_ARCH = processor_is_undefined +endif +endif +endif + +ifeq ($(SERVER_BUILD), 1) +OS_CFLAGS += -DSERVER_BUILD +endif + +OS_DLLFLAGS = -nologo -DLL -SUBSYSTEM:WINDOWS -MAP -PDB:NONE +OS_LFLAGS = -nologo -PDB:NONE -INCREMENT:NO -SUBSYSTEM:console +OS_LIBS = kernel32.lib user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib + +OS_DEFS= SERVER_BUILD=$(SERVER_BUILD) NSPR_VERSION=$(VERSION) NS_PRODUCT=$(NS_PRODUCT) diff --git a/config/common.mn b/config/common.mn new file mode 100644 index 00000000..daae3872 --- /dev/null +++ b/config/common.mn @@ -0,0 +1,120 @@ +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +###################################################################### +### Comon Manifest File +### Cross-platform defines used on all platforms (in theory) +###################################################################### + +# The VERSION_NUMBER is suffixed onto the end of the DLLs we ship. +# Since the longest of these is 5 characters without the suffix, +# be sure to not set VERSION_NUMBER to anything longer than 3 +# characters for Win16's sake. +# +# Also... If you change this value, there are several other places +# you'll need to change (because they're not reached by this +# variable): +# sun-java/nsjava/nsjava32.def +# sun-java/nsjava/nsjava16.def +# sun-java/classsrc/sun/audio/AudioDevice.java +# sun-java/classsrc/sun/awt/windows/WToolkit.java + +VERSION_NUMBER = 40 + +ZIP_NAME = java_$(VERSION_NUMBER) +JAR_NAME = java_$(VERSION_NUMBER).jar + +###################################################################### +### Cross-Platform Java Stuff +###################################################################### +## java interpreter + +# get class files from the directory they are compiled to +JAVA_CLASSPATH = $(JAVA_DESTPATH) + +JAVA_FLAGS = -classpath $(JAVA_CLASSPATH) -ms8m +JAVA = $(JAVA_PROG) $(JAVA_FLAGS) + +JAVA_DEFINES = \ + -DZIP_NAME=\"$(ZIP_NAME)\" \ + -DJAR_NAME=\"$(JAR_NAME)\" \ + -DJRTDLL=\"$(JRTDLL)\" \ + -DMMDLL=\"$(MMDLL)\" \ + -DAWTDLL=\"$(AWTDLL)\" \ + -DJITDLL=\"$(JITDLL)\" + +###################################################################### +## javac + +# to run the compiler in the interpreter +JAVAC_PROG = -ms8m -classpath $(JAVAC_ZIP) sun.tools.javac.Main +JAVAC = $(JAVA_PROG) $(JAVAC_PROG) $(JAVAC_FLAGS) + +# std set of options passed to the compiler +JAVAC_FLAGS = -classpath $(JAVAC_CLASSPATH) $(JAVA_OPTIMIZER) -d $(JAVA_DESTPATH) + +## +## The canonical Java classpath is: +## JAVA_DESTPATH, JAVA_SOURCEPATH, JAVA_LIBS +## +## appropriately delimited, in that order +## +JAVAC_CLASSPATH = $(JAVA_DESTPATH)$(PATH_SEPARATOR)$(JAVA_SOURCEPATH) + +###################################################################### +## javadoc + +# Rules to build java .html files from java source files + +JAVADOC_PROG = $(JAVA) sun.tools.javadoc.Main +JAVADOC_FLAGS = -classpath $(JAVAC_CLASSPATH) +JAVADOC = $(JAVADOC_PROG) $(JAVADOC_FLAGS) + +###################################################################### +## javah + +JAVAH_FLAGS = -classpath $(JAVA_CLASSPATH) +JAVAH = $(JAVAH_PROG) $(JAVAH_FLAGS) + +###################################################################### +## jmc + +JMCSRCDIR = $(XPDIST)/_jmc +JMC_PROG = $(JAVA) netscape.tools.jmc.Main +JMC_CLASSPATH = $(JMCSRCDIR)$(PATH_SEPARATOR)$(JAVAC_CLASSPATH) +JMC_FLAGS = -classpath $(JMC_CLASSPATH) -verbose +JMC = $(JMC_PROG) $(JMC_FLAGS) + +###################################################################### +## zip + +ZIP = $(ZIP_PROG) $(ZIP_FLAGS) + +###################################################################### +## idl2java + +ORBTOOLS = $(DEPTH)/modules/iiop/tools/orbtools.zip +ORB_CLASSPATH = $(ORBTOOLS)$(PATH_SEPARATOR)$(JAVA_CLASSPATH) + +IDL2JAVA_PROG = $(JAVA_PROG) +IDL2JAVA_FLAGS = -classpath $(ORB_CLASSPATH) pomoco.tools.idl2java +IDL2JAVA = $(IDL2JAVA_PROG) $(IDL2JAVA_FLAGS) + +###################################################################### +## lex and yacc + +JAVALEX_PROG = $(JAVA_PROG) -classpath $(ORB_CLASSPATH) sbktech.tools.jax.driver +JAVALEX_FLAGS = +JAVALEX = $(JAVALEX_PROG) $(JAVALEX_FLAGS) + +JAVACUP_PROG = $(JAVA_PROG) -classpath $(ORB_CLASSPATH) java_cup.Main +JAVACUP_FLAGS = +JAVACUP = $(JAVACUP_PROG) $(JAVACUP_FLAGS) + +###################################################################### + + diff --git a/config/config.mk b/config/config.mk new file mode 100644 index 00000000..b962fae0 --- /dev/null +++ b/config/config.mk @@ -0,0 +1,520 @@ +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +#! gmake + +include $(DEPTH)/config/common.mn + +# +# Important internal static macros +# +OS_ARCH := $(subst /,_,$(shell uname -s)) +OS_TEST := $(shell uname -m) + +# Force the IRIX64 machines to use IRIX. +ifeq ($(OS_ARCH),IRIX64) +OS_ARCH := IRIX +endif + +# Attempt to differentiate between SunOS 5.4 and x86 5.4 +ifeq ($(OS_TEST),i86pc) +OS_RELEASE := $(shell uname -r)_$(OS_TEST) +else +OS_RELEASE := $(shell uname -r) +endif + +ifeq ($(OS_ARCH),AIX) +OS_RELEASE := $(shell uname -v).$(shell uname -r) +endif + +# SINIX changes name to ReliantUNIX with 5.43 +ifeq ($(OS_ARCH),ReliantUNIX-N) +OS_ARCH := ReliantUNIX +OS_RELEASE := 5.4 +endif +ifeq ($(OS_ARCH),SINIX-N) +OS_ARCH := ReliantUNIX +OS_RELEASE := 5.4 +endif + +# SVR5 (UnixWare[7]) +ifeq ($(OS_ARCH),UnixWare) +# For now get the OS release for backward compatibility (UnixWare5) +OS_RELEASE := $(shell uname -r) +endif + +# Catch NCR butchering of SVR4 +ifeq ($(OS_ARCH),UNIX_SV) +ifneq ($(findstring NCR, $(shell grep NCR /etc/bcheckrc | head -1 )),) +OS_ARCH := NCR +OS_RELEASE := $(shell uname -v) +else # !NCR +# Make UnixWare something human readable +OS_ARCH := UNIXWARE +# Check for UW2 using UDK, which looks like a Gemini (UnixWare[3,5,7]) build +OS_RELEASE := $(shell $(DEPTH)/netsite/nsarch -f | sed 's/UnixWare //') +ifeq ($(OS_RELEASE),5) +OS_ARCH := UnixWare +else # OS_RELEASE = 5 +# Get the OS release number, not 4.2 +OS_RELEASE := $(shell uname -v) +ifeq ($(OS_RELEASE),2.1.2) +OS_RELEASE := 2.1 +endif # OS_RELEASE = 2.1.2 +endif # OS_RELEASE = 5 +endif # !NCR +endif # UNIX_SV + + +ifeq ($(OS_ARCH),Linux) +# +# Handle FreeBSD 2.2-STABLE and Linux 2.0.30-osfmach3 and 2.2.14-5.0smp +# +ifeq (,$(filter-out Linux FreeBSD,$(NSOS_ARCH))) + OS_RELEASE := $(shell echo $(OS_RELEASE) | sed 's/-.*//') +endif +OS_RELEASE := $(basename $(OS_RELEASE)) + ifeq (86,$(findstring 86,$(OS_TEST))) + CPU_TAG = _x86 + else + CPU_TAG = _$(OS_TEST) + endif + ifeq ($(USE_LIBC),1) + LIBC_TAG = _libc + else + LIBC_TAG = _glibc + endif +# always use pthreads + USE_PTHREADS = 1 + ifeq ($(USE_PTHREADS),1) + IMPL_STRATEGY = _PTH + endif + ifeq ($(USE_EGCS),1) + COMPILER_TAG = _egcs + endif +endif + +# Clean up SCO +ifeq ($(OS_ARCH),SCO_SV) +OS_ARCH := SCOOS +ifeq (5.0,$(findstring 5.0,$(shell ls /var/opt/K/SCO/Unix))) +OS_RELEASE := 5.0 +else +OS_RELEASE := UNKNOWN +endif +endif + +# Furnish the extra libraries for using ld on OSF1 +ifeq ($(OS_ARCH),OSF1) +LDEXTRA := -lcxx -lexc -lc +# +# Distinguish between OSF1 V4.0B and V4.0D +# +ifeq ($(OS_RELEASE),V4.0) + OS_VERSION := $(shell uname -v) + ifeq ($(OS_VERSION),564) + OS_RELEASE := V4.0B + endif + ifeq ($(OS_VERSION),878) + OS_RELEASE := V4.0D + endif +endif +else +LDEXTRA := +endif + +# Relative pathname from top-of-tree to current source directory +ifneq ($(OS_ARCH),WINNT) +REVDEPTH := $(DEPTH)/config/revdepth +SRCDIR := $(shell perl $(REVDEPTH).pl $(DEPTH)) +endif + +# define an include-at-most-once flag +NS_CONFIG_MK = 1 + +# +# Default command macros; can be overridden in .mk. +# +AS = $(CC) +ASFLAGS = $(CFLAGS) +CCF = $(CC) $(CFLAGS) +PURIFY = purify $(PURIFYOPTIONS) +LINK_EXE = $(LINK) $(OS_LFLAGS) $(LFLAGS) +LINK_DLL = $(LINK) $(OS_DLLFLAGS) $(DLLFLAGS) +NFSPWD = $(DEPTH)/config/nfspwd + +ifeq ($(OS_ARCH),WINNT) +RC = rc.exe +XP_DEFINE = -DXP_PC +LIB_SUFFIX = lib +DLL_SUFFIX = dll +AR = lib -NOLOGO -OUT:"$@" +DLLFLAGS = $(XLFLAGS) -OUT:"$@" +LFLAGS = $(OBJS) $(DEPLIBS) $(EXTRA_LIBS) -OUT:"$@" +NSINSTALL = nsinstall +INSTALL = $(NSINSTALL) +else +include $(DEPTH)/config/UNIX.mk +endif + +ifdef BUILD_OPT +ifeq ($(OS_ARCH),WINNT) +OPTIMIZER = -O2 +XCFLAGS = $(LCFLAGS) +XLFLAGS = $(LLFLAGS) +else +OPTIMIZER = -O +JAVA_OPTIMIZER = -O +DEFINES = -UDEBUG -DNDEBUG -DTRIMMED +endif +OBJDIR_TAG = _OPT +else +ifeq ($(OS_ARCH),WINNT) +OPTIMIZER = -Od -Z7 +LDFLAGS = -DEBUG + +XCFLAGS = $(LCFLAGS) +XLFLAGS = -DEBUG $(LLFLAGS) +XBCFLAGS = -FR$* +JAVA_OPTIMIZER = -Od -Z7 +else +ifeq ($(ARCH), ReliantUNIX) +OPTIMIZER = -gdwarf +JAVA_OPTIMIZER = -gdwarf +else +OPTIMIZER = -g +JAVA_OPTIMIZER = -g +endif +ifeq ($(OS_ARCH),OSF1) +DEFINES = -DDEBUG_$(shell whoami) -DTRACING +else +DEFINES = -DDEBUG -UNDEBUG -DDEBUG_$(shell whoami) -DTRACING +endif +endif +OBJDIR_TAG = _DBG +endif + +LIBNT = $(DIST)/lib/libnt.$(LIB_SUFFIX) +LIBAWT = $(DIST)/lib/libawt.$(LIB_SUFFIX) +LIBMMEDIA = $(DIST)/lib/libmmedia.$(LIB_SUFFIX) +LIBNSPR = $(DIST)/lib/libnspr.$(LIB_SUFFIX) +PURELIBNSPR = $(DIST)/lib/libpurenspr.$(LIB_SUFFIX) + +ifeq ($(OS_ARCH),WINNT) +LIBNSJAVA = $(DIST)/lib/jrt3221.$(LIB_SUFFIX) +else +LIBNSJAVA = $(DIST)/lib/nsjava32.$(LIB_SUFFIX) +endif + + +# XXX For now, we're including $(DEPTH)/include directly instead of +# getting this stuff from dist. This stuff is old and will eventually +# be put in the library directories where it belongs so that it can +# get exported to dist properly. +INCLUDES = $(LOCAL_PREINCLUDES) -I$(DEPTH)/include $(LOCAL_INCLUDES) + +CFLAGS = $(XP_DEFINE) $(OPTIMIZER) $(OS_CFLAGS) $(DEFINES) $(INCLUDES) $(XCFLAGS) +# For purify +NOMD_CFLAGS = $(XP_DEFINE) $(OPTIMIZER) $(NOMD_OS_CFLAGS) $(DEFINES) $(INCLUDES) $(XCFLAGS) + +# +# To build on SunOS5.8 when some SunOS5.8 components or config +# files are missing, just pretend you're on SunOS5.6 by setting +# NSOS_RELEASE_OVERRIDE=5.6 +# +ifdef NSOS_RELEASE_OVERRIDE +OS_RELEASE := $(NSOS_RELEASE_OVERRIDE) +endif + +include $(DEPTH)/config/$(OS_ARCH)$(OS_RELEASE).mk + +OS_CONFIG := $(OS_ARCH)$(OS_RELEASE) + +include $(DEPTH)/config/$(OS_CONFIG).mk + +# now take care of default GCC (rus@5/5/97) + +ifdef NS_USE_GCC +# if gcc-settings are redefined already - don't touch it +# +ifeq (,$(findstring gcc, $(CC))) +CC = gcc +CCC = g++ +CXX = g++ +# always use -fpic - some makefiles are still broken and don't distinguish +# situation when they build shared and static libraries +CFLAGS += -fpic -Wall -DNS_USE_GCC $(GCC_FLAGS_EXTRA) +OS_LIBS += -L/usr/local/lib -lstdc++ -lg++ -lgcc +endif +endif +### + +# Name of the binary code directories +ifeq ($(OS_ARCH),WINNT) +ifneq ($(PROCESSOR_ARCHITECTURE),x86) +OBJDIR_NAME = $(OS_CONFIG)$(PROCESSOR_ARCHITECTURE)$(OBJDIR_TAG).OBJ +else +OBJDIR_NAME = $(OS_CONFIG)$(OBJDIR_TAG).OBJ +endif +else # WINNT +ifeq ($(OS_ARCH),Linux) +OBJDIR_NAME = $(OS_CONFIG)$(CPU_TAG)$(COMPILER_TAG)$(LIBC_TAG)$(IMPL_STRATEGY)$(OBJDIR_TAG).OBJ +else +ifeq ($(OS_ARCH), IRIX) + ifeq ($(USE_PTHREADS), 1) + ifeq ($(USE_N32), 1) + OBJDIR_NAME = $(OS_CONFIG)_n32_PTH$(OBJDIR_TAG).OBJ + else + OBJDIR_NAME = $(OS_CONFIG)_PTH$(OBJDIR_TAG).OBJ + endif + else + OBJDIR_NAME = $(OS_CONFIG)$(OBJDIR_TAG).OBJ + endif +else + OBJDIR_NAME = $(OS_CONFIG)$(OBJDIR_TAG).OBJ +endif # IRIX +endif # Linux +endif # WINNT + +# Figure out where the binary code lives. It either lives in the src +# tree (NSBUILDROOT is undefined) or somewhere else. +ifdef NSBUILDROOT +BUILD = $(NSBUILDROOT)/$(OBJDIR_NAME)/build +OBJDIR = $(BUILD)/$(SRCDIR) +XPDIST = $(NSBUILDROOT) +DIST = $(NSBUILDROOT)/$(OBJDIR_NAME)/dist +else +BUILD = $(OBJDIR_NAME) +OBJDIR = $(OBJDIR_NAME) +XPDIST = $(DEPTH)/dist +DIST = $(DEPTH)/dist/$(OBJDIR_NAME) +endif + +# all public include files go in subdirectories of PUBLIC: +PUBLIC = $(XPDIST)/public + +VPATH = $(OBJDIR) +DEPENDENCIES = $(OBJDIR)/.md + +# Personal makefile customizations go in these optional make include files. +MY_CONFIG = $(DEPTH)/config/myconfig.mk +MY_RULES = $(DEPTH)/config/myrules.mk + +-include $(MY_CONFIG) + +###################################################################### + +# Specify that we are building a client. +# This will instruct the cross platform libraries to +# include all the client specific cruft. +ifndef SERVER_BUILD +ifndef LIVEWIRE +DEFINES += -DMOZILLA_CLIENT -DNETSCAPE +endif +else +DEFINES += -DSERVER_BUILD +endif +DEFINES += -DNETSCAPE + +# Now test variables that might have been set or overridden by $(MY_CONFIG). + +# if ((BUILD_EDITOR || BUILD_EDT) && !NO_EDITOR) -> -DEDITOR is defined +ifndef NO_EDITOR +ifdef BUILD_EDITOR +OBJDIR_TAG := $(OBJDIR_TAG)_EDT +DEFINES += -DEDITOR -DGOLD +# This is the product classification not the feature classification. +# It effects things like where are the release notes, etc.. +BUILD_GOLD = yea +else +# We ought to get rid of this now that BUILD_EDITOR has replaced it. +ifdef BUILD_EDT +OBJDIR_TAG := $(OBJDIR_TAG)_EDT +DEFINES += -DEDITOR -DGOLD +BUILD_EDITOR = yea +endif +endif +endif + +# Build layers by default +ifndef NO_LAYERS +DEFINES += -DLAYERS +endif + +# if (BUILD_EDITOR_UI && !NO_EDITOR_UI) -> -DEDITOR_UI is defined +ifdef BUILD_EDITOR_UI +ifndef NO_EDITOR_UI +DEFINES += -DEDITOR_UI +endif +endif + +ifdef BUILD_DEBUG_GC +DEFINES += -DDEBUG_GC +endif + +ifdef BUILD_UNIX_PLUGINS +# UNIX_EMBED Should not be needed. For now these two defines go +# together until I talk with jg. --dp +DEFINES += -DUNIX_EMBED -DX_PLUGINS +endif + +ifndef NO_UNIX_LDAP +DEFINES += -DUNIX_LDAP +endif + +# +# Platform dependent switching off of NSPR, JAVA and MOCHA +# +ifndef NO_NSPR +DEFINES += -DNSPR -DNSPR20 +endif + +ifndef NO_JAVA +DEFINES += -DJAVA +endif + +ifeq ($(LW_JAVA), 1) +DEFINES += -DJAVA +endif + +ifndef NO_MOCHA +DEFINES += -DMOCHA +endif + +ifdef FORTEZZA +DEFINES += -DFORTEZZA +endif + +###################################################################### + +GARBAGE = $(DEPENDENCIES) core + +ifneq ($(OS_ARCH),WINNT) +NSINSTALL = $(DEPTH)/config/$(OBJDIR_NAME)/nsinstall + +ifeq ($(NSDISTMODE),copy) +# copy files, but preserve source mtime +INSTALL = $(NSINSTALL) -t +else +ifeq ($(NSDISTMODE),absolute_symlink) +# install using absolute symbolic links +INSTALL = $(NSINSTALL) -L `$(NFSPWD)` +else +# install using relative symbolic links +INSTALL = $(NSINSTALL) -R +endif +endif +endif + +ifndef PLATFORM_HOSTS +PLATFORM_HOSTS = \ + atm \ + bsdi \ + diva \ + gunwale \ + openwound \ + server2 \ + server3 \ + server9 \ + zot \ + $(NULL) +endif + +###################################################################### + +# always copy files for the sdk +SDKINSTALL = $(NSINSTALL) -t + +ifndef SDK +SDK = $(DEPTH)/dist/sdk +endif + +###################################################################### +### Java Stuff +###################################################################### +## java interpreter + +JAVA_PROG = java # from the ether + +# Let user over-ride CLASSPATH from environment +#ifdef xCLASSPATH # bad idea +#JAVA_CLASSPATH = $(CLASSPATH) +#else +# keep sun-java/classsrc until bootstrapped +#JAVA_CLASSPATH = $(XPDIST)/classes:$(DEPTH)/sun-java/classsrc +#endif + +#JAVA_FLAGS = -classpath $(JAVA_CLASSPATH) -ms8m +#JAVA = $(JAVA_PROG) $(JAVA_FLAGS) + +###################################################################### +## java compiler +# XXX - ram included from common.mn +#JAVAC_PROG = javac # from the ether +#JAVAC_CLASSPATH = $(JAVA_CLASSPATH):/usr/local/netscape/java/lib/javac.zip +#JAVAC_FLAGS = -classpath $(JAVAC_CLASSPATH) $(JAVA_OPTIMIZER) +#JAVAC = $(JAVAC_PROG) $(JAVAC_FLAGS) + +PATH_SEPARATOR = : +JAVAC_ZIP = /usr/local/netscape/java/lib/javac.zip + +# +# The canonical classpath for building java libraries +# includes these two entries first, then any additional zips +# or directories +# +# see "JAVAC_CLASSPATH" in common.mn +# + +# where the bytecode will go +JAVA_DESTPATH = $(XPDIST)/classes +# where the sources for the module you are compiling are +# default is sun-java/classsrc, override for other modules +JAVA_SOURCEPATH = $(DEPTH)/sun-java/classsrc + +###################################################################### +## javadoc + +# Rules to build java .html files from java source files + +JAVADOC_PROG = $(JAVA) sun.tools.javadoc.Main +JAVADOC_FLAGS = -classpath $(JAVAC_CLASSPATH) +JAVADOC = $(JAVADOC_PROG) $(JAVADOC_FLAGS) + +###################################################################### +## javah + +ifndef JAVAH_IN_JAVA +JAVAH_PROG = $(DIST)/bin/javah +else +JAVAH_PROG = $(JAVA) netscape.tools.jric.Main +endif +JAVAH_FLAGS = -classpath $(JAVA_CLASSPATH) +JAVAH = $(JAVAH_PROG) $(JAVAH_FLAGS) + +###################################################################### +## jmc + +JMCSRCDIR = $(XPDIST)/_jmc +JMC_PROG = $(JAVA) netscape.tools.jmc.Main +JMC_CLASSPATH = $(JMCSRCDIR):$(JAVAC_CLASSPATH) +JMC_FLAGS = -classpath $(JMC_CLASSPATH) -verbose +JMC = $(JMC_PROG) $(JMC_FLAGS) + +###################################################################### +## zip + +ZIP_PROG = zip +ZIP_FLAGS = -0rq +ZIP = $(ZIP_PROG) $(ZIP_FLAGS) + +###################################################################### +JRTDLL = libjrt.$(DLL_SUFFIX) +MMDLL = libmm32$(VERSION_NUMBER).$(DLL_SUFFIX) +AWTDLL = libawt.$(DLL_SUFFIX) +JITDLL = libjit + diff --git a/config/nfspwd.pl b/config/nfspwd.pl new file mode 100644 index 00000000..a4d1645d --- /dev/null +++ b/config/nfspwd.pl @@ -0,0 +1,21 @@ +#! /usr/local/bin/perl +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# + +require "fastcwd.pl"; + +$_ = &fastcwd; +if (m@^/[uh]/@o || s@^/tmp_mnt/@/@o) { + print("$_\n"); +} elsif ((($user, $rest) = m@^/usr/people/(\w+)/(.*)@o) + && readlink("/u/$user") eq "/usr/people/$user") { + print("/u/$user/$rest\n"); +} else { + chop($host = `hostname`); + print("/h/$host$_\n"); +} diff --git a/config/nsinstall.c b/config/nsinstall.c new file mode 100644 index 00000000..0d8a537a --- /dev/null +++ b/config/nsinstall.c @@ -0,0 +1,305 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/* +** Netscape portable install command. +** +** Brendan Eich, 7/20/95 +*/ +#include /* OSF/1 requires this before grp.h, so put it first */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "pathsub.h" + +#define HAVE_LCHOWN + +#if defined(AIXV3) || defined(BSDI) || defined(HPUX) || defined(LINUX) || defined(SUNOS4) || defined(SCO) || defined(SNI) +#undef HAVE_LCHOWN +#endif + +#ifdef LINUX +# include +#endif + +#if defined(SCO) || defined(UNIXWARE) || defined(SNI) || defined (NCR) || defined(UnixWare) +#if !defined(S_ISLNK) && defined(S_IFLNK) +#define S_ISLNK(a) (((a) & S_IFMT) == S_IFLNK) +#endif +#endif + +static void +usage(void) +{ + fprintf(stderr, + "usage: %s [-C cwd] [-L linkprefix] [-m mode] [-o owner] [-g group]\n" + " %*s [-DdltR] file [file ...] directory\n", + program, strlen(program), ""); + exit(2); +} + +static int +mkdirs(char *path, mode_t mode) +{ + char *cp; + struct stat sb; + + while (*path == '/' && path[1] == '/') + path++; + while ((cp = strrchr(path, '/')) && cp[1] == '\0') + *cp = '\0'; + if (cp && cp != path) { + *cp = '\0'; + if ((lstat(path, &sb) < 0 || !S_ISDIR(sb.st_mode)) && + mkdirs(path, mode) < 0) { + return -1; + } + *cp = '/'; + } + return mkdir(path, mode); +} + +static uid_t +touid(char *owner) +{ + struct passwd *pw; + uid_t uid; + char *cp; + + pw = getpwnam(owner); + if (pw) + return pw->pw_uid; + uid = strtol(owner, &cp, 0); + if (uid == 0 && cp == owner) + fail("cannot find uid for %s", owner); + return uid; +} + +static gid_t +togid(char *group) +{ + struct group *gr; + gid_t gid; + char *cp; + + gr = getgrnam(group); + if (gr) + return gr->gr_gid; + gid = strtol(group, &cp, 0); + if (gid == 0 && cp == group) + fail("cannot find gid for %s", group); + return gid; +} + +int +main(int argc, char **argv) +{ + int onlydir, dodir, dolink, dorelsymlink, dotimes; + mode_t mode; + char *linkprefix, *owner, *group; + int opt, len, lplen, tdlen, bnlen, exists, fromfd, tofd, cc, wc; + char *cp, *cwd, *todir, *toname, *name, *base, *linkname; + uid_t uid; + gid_t gid; + char *bp, buf[BUFSIZ]; + struct stat sb, tosb; + struct utimbuf utb; + + program = argv[0]; + cwd = 0; + onlydir = dodir = dolink = dorelsymlink = dotimes = 0; + mode = 0755; + linkprefix = owner = group = 0; + + while ((opt = getopt(argc, argv, "C:DdlL:Rm:o:g:t")) != EOF) { + switch (opt) { + case 'C': + cwd = optarg; + break; + case 'D': + onlydir = 1; + break; + case 'd': + dodir = 1; + break; + case 'l': + dolink = 1; + break; + case 'L': + linkprefix = optarg; + lplen = strlen(linkprefix); + dolink = 1; + break; + case 'R': + dolink = dorelsymlink = 1; + break; + case 'm': + mode = strtoul(optarg, &cp, 8); + if (mode == 0 && cp == optarg) + usage(); + break; + case 'o': + owner = optarg; + break; + case 'g': + group = optarg; + break; + case 't': + dotimes = 1; + break; + default: + usage(); + } + } + + argc -= optind; + argv += optind; + if (argc < 2 - onlydir) + usage(); + + todir = argv[argc-1]; + if ((stat(todir, &sb) < 0 || !S_ISDIR(sb.st_mode)) && + mkdirs(todir, 0777) < 0) { + fail("cannot make directory %s", todir); + } + if (onlydir) + return 0; + + if (!cwd) + cwd = getcwd(0, PATH_MAX); + xchdir(todir); + todir = getcwd(0, PATH_MAX); + tdlen = strlen(todir); + xchdir(cwd); + tdlen = strlen(todir); + + uid = owner ? touid(owner) : -1; + gid = group ? togid(group) : -1; + + while (--argc > 0) { + name = *argv++; + len = strlen(name); + base = xbasename(name); + bnlen = strlen(base); + toname = xmalloc(tdlen + 1 + bnlen + 1); + sprintf(toname, "%s/%s", todir, base); + exists = (lstat(toname, &tosb) == 0); + + if (dodir) { + /* -d means create a directory, always */ + if (exists && !S_ISDIR(tosb.st_mode)) { + (void) unlink(toname); + exists = 0; + } + if (!exists && mkdir(toname, mode) < 0) + fail("cannot make directory %s", toname); + if ((owner || group) && chown(toname, uid, gid) < 0) + fail("cannot change owner of %s", toname); + } else if (dolink) { + if (*name == '/') { + /* source is absolute pathname, link to it directly */ + linkname = 0; + } else { + if (linkprefix) { + /* -L implies -l and prefixes names with a $cwd arg. */ + len += lplen + 1; + linkname = xmalloc(len + 1); + sprintf(linkname, "%s/%s", linkprefix, name); + } else if (dorelsymlink) { + /* Symlink the relative path from todir to source name. */ + linkname = xmalloc(PATH_MAX); + + if (*todir == '/') { + /* todir is absolute: skip over common prefix. */ + lplen = relatepaths(todir, cwd, linkname); + strcpy(linkname + lplen, name); + } else { + /* todir is named by a relative path: reverse it. */ + reversepath(todir, name, len, linkname); + xchdir(cwd); + } + + len = strlen(linkname); + } + name = linkname; + } + + /* Check for a pre-existing symlink with identical content. */ + if (exists && + (!S_ISLNK(tosb.st_mode) || + readlink(toname, buf, sizeof buf) != len || + strncmp(buf, name, len) != 0)) { + (void) (S_ISDIR(tosb.st_mode) ? rmdir : unlink)(toname); + exists = 0; + } + if (!exists && symlink(name, toname) < 0) + fail("cannot make symbolic link %s", toname); +#ifdef HAVE_LCHOWN + if ((owner || group) && lchown(toname, uid, gid) < 0) + fail("cannot change owner of %s", toname); +#endif + + if (linkname) { + free(linkname); + linkname = 0; + } + } else { + /* Copy from name to toname, which might be the same file. */ + fromfd = open(name, O_RDONLY); + if (fromfd < 0 || fstat(fromfd, &sb) < 0) + fail("cannot access %s", name); + if (exists && (!S_ISREG(tosb.st_mode) || access(toname, W_OK) < 0)) + (void) (S_ISDIR(tosb.st_mode) ? rmdir : unlink)(toname); + tofd = open(toname, O_CREAT | O_WRONLY, 0666); + if (tofd < 0) + fail("cannot create %s", toname); + + bp = buf; + while ((cc = read(fromfd, bp, sizeof buf)) > 0) { + while ((wc = write(tofd, bp, cc)) > 0) { + if ((cc -= wc) == 0) + break; + bp += wc; + } + if (wc < 0) + fail("cannot write to %s", toname); + } + if (cc < 0) + fail("cannot read from %s", name); + + if (ftruncate(tofd, sb.st_size) < 0) + fail("cannot truncate %s", toname); + if (dotimes) { + utb.actime = sb.st_atime; + utb.modtime = sb.st_mtime; + if (utime(toname, &utb) < 0) + fail("cannot set times of %s", toname); + } + if (fchmod(tofd, mode) < 0) + fail("cannot change mode of %s", toname); + if ((owner || group) && fchown(tofd, uid, gid) < 0) + fail("cannot change owner of %s", toname); + + /* Must check for delayed (NFS) write errors on close. */ + if (close(tofd) < 0) + fail("cannot write to %s", toname); + close(fromfd); + } + + free(toname); + } + + free(cwd); + free(todir); + return 0; +} diff --git a/config/pathsub.c b/config/pathsub.c new file mode 100644 index 00000000..6e5cfd20 --- /dev/null +++ b/config/pathsub.c @@ -0,0 +1,206 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/* +** Pathname subroutines. +** +** Brendan Eich, 8/29/95 +*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "pathsub.h" +#ifdef USE_REENTRANT_LIBC +#include +#endif /* USE_REENTRANT_LIBC */ + +char *program; + +void +fail(char *format, ...) +{ + int error; + va_list ap; + +#ifdef USE_REENTRANT_LIBC + R_STRERROR_INIT_R(); +#endif + + error = errno; + fprintf(stderr, "%s: ", program); + va_start(ap, format); + vfprintf(stderr, format, ap); + va_end(ap); + if (error) + +#ifdef USE_REENTRANT_LIBC + R_STRERROR_R(errno); + fprintf(stderr, ": %s", r_strerror_r); +#else + fprintf(stderr, ": %s", strerror(errno)); +#endif + + putc('\n', stderr); + exit(1); +} + +char * +getcomponent(char *path, char *name) +{ + if (*path == '\0') + return 0; + if (*path == '/') { + *name++ = '/'; + } else { + do { + *name++ = *path++; + } while (*path != '/' && *path != '\0'); + } + *name = '\0'; + while (*path == '/') + path++; + return path; +} + +#ifdef UNIXWARE +/* Sigh. The static buffer in Unixware's readdir is too small. */ +struct dirent * readdir(DIR *d) +{ + static struct dirent *buf = NULL; +#define MAX_PATH_LEN 1024 + + + if(buf == NULL) + buf = (struct dirent *) malloc(sizeof(struct dirent) + MAX_PATH_LEN) +; + return(readdir_r(d, buf)); +} +#endif + +char * +ino2name(ino_t ino, char *dir) +{ + DIR *dp; + struct dirent *ep; + char *name; + + dp = opendir(".."); + if (!dp) + fail("cannot read parent directory"); + for (;;) { + if (!(ep = readdir(dp))) + fail("cannot find current directory"); + if (ep->d_ino == ino) + break; + } + name = xstrdup(ep->d_name); + closedir(dp); + return name; +} + +void * +xmalloc(size_t size) +{ + void *p = malloc(size); + if (!p) + fail("cannot allocate %u bytes", size); + return p; +} + +char * +xstrdup(char *s) +{ + return strcpy(xmalloc(strlen(s) + 1), s); +} + +char * +xbasename(char *path) +{ + char *cp; + + while ((cp = strrchr(path, '/')) && cp[1] == '\0') + *cp = '\0'; + if (!cp) return path; + return cp + 1; +} + +void +xchdir(char *dir) +{ + if (chdir(dir) < 0) + fail("cannot change directory to %s", dir); +} + +int +relatepaths(char *from, char *to, char *outpath) +{ + char *cp, *cp2; + int len; + char buf[NAME_MAX]; + + assert(*from == '/' && *to == '/'); + for (cp = to, cp2 = from; *cp == *cp2; cp++, cp2++) + if (*cp == '\0') + break; + while (cp[-1] != '/') + cp--, cp2--; + if (cp - 1 == to) { + /* closest common ancestor is /, so use full pathname */ + len = strlen(strcpy(outpath, to)); + if (outpath[len] != '/') { + outpath[len++] = '/'; + outpath[len] = '\0'; + } + } else { + len = 0; + while ((cp2 = getcomponent(cp2, buf)) != 0) { + strcpy(outpath + len, "../"); + len += 3; + } + while ((cp = getcomponent(cp, buf)) != 0) { + sprintf(outpath + len, "%s/", buf); + len += strlen(outpath + len); + } + } + return len; +} + +void +reversepath(char *inpath, char *name, int len, char *outpath) +{ + char *cp, *cp2; + char buf[NAME_MAX]; + struct stat sb; + + cp = strcpy(outpath + PATH_MAX - (len + 1), name); + cp2 = inpath; + while ((cp2 = getcomponent(cp2, buf)) != 0) { + if (strcmp(buf, ".") == 0) + continue; + if (strcmp(buf, "..") == 0) { + if (stat(".", &sb) < 0) + fail("cannot stat current directory"); + name = ino2name(sb.st_ino, ".."); + len = strlen(name); + cp -= len + 1; + strcpy(cp, name); + cp[len] = '/'; + free(name); + xchdir(".."); + } else { + cp -= 3; + strncpy(cp, "../", 3); + xchdir(buf); + } + } + strcpy(outpath, cp); +} diff --git a/config/pathsub.h b/config/pathsub.h new file mode 100644 index 00000000..2e7a0554 --- /dev/null +++ b/config/pathsub.h @@ -0,0 +1,46 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef pathsub_h___ +#define pathsub_h___ +/* +** Pathname subroutines. +** +** Brendan Eich, 8/29/95 +*/ +#include +#include + +#if SUNOS4 +#include "../nspr/include/sunos4.h" +#endif + +#ifndef PATH_MAX +#define PATH_MAX 1024 +#endif + +/* + * Just prevent stupidity + */ +#undef NAME_MAX +#define NAME_MAX 256 + +extern char *program; + +extern void fail(char *format, ...); +extern char *getcomponent(char *path, char *name); +extern char *ino2name(ino_t ino, char *dir); +extern void *xmalloc(size_t size); +extern char *xstrdup(char *s); +extern char *xbasename(char *path); +extern void xchdir(char *dir); + +/* Relate absolute pathnames from and to returning the result in outpath. */ +extern int relatepaths(char *from, char *to, char *outpath); + +/* XXX changes current working directory -- caveat emptor */ +extern void reversepath(char *inpath, char *name, int len, char *outpath); + +#endif /* pathsub_h___ */ diff --git a/config/revdepth-nt.pl b/config/revdepth-nt.pl new file mode 100644 index 00000000..8b8a85f5 --- /dev/null +++ b/config/revdepth-nt.pl @@ -0,0 +1,19 @@ +#! /usr/local/bin/perl +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# + +require "/ns/config/fastcwd.pl"; + +$cur = &fastcwd; +chdir($ARGV[0]); +$newcur = &fastcwd; +$newcurlen = length($newcur); + +# Skip common separating / unless $newcur is "/" +$cur = substr($cur, $newcurlen + ($newcurlen > 1)); +print $cur; diff --git a/config/revdepth.pl b/config/revdepth.pl new file mode 100644 index 00000000..b38f6f3d --- /dev/null +++ b/config/revdepth.pl @@ -0,0 +1,22 @@ +#! /usr/local/bin/perl +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# + +unshift(@INC, '/usr/lib/perl'); +unshift(@INC, '/usr/local/lib/perl'); + +require "fastcwd.pl"; + +$cur = &fastcwd; +chdir($ARGV[0]); +$newcur = &fastcwd; +$newcurlen = length($newcur); + +# Skip common separating / unless $newcur is "/" +$cur = substr($cur, $newcurlen + ($newcurlen > 1)); +print $cur; diff --git a/config/rules.mk b/config/rules.mk new file mode 100644 index 00000000..c65f49f2 --- /dev/null +++ b/config/rules.mk @@ -0,0 +1,707 @@ +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +################################################################################ +# Wow this is complicated! The story is that we now have a 4 pass build process: +# +# Pass 1. export - Create generated headers and stubs. Publish public headers to +# dist//include. +# +# Pass 2. libs - Create libraries. Publish libraries to dist//lib. +# +# Pass 3. all - Create programs. +# +# Pass 4. install - Publish programs to dist//bin. +# +# Parameters to this makefile (set these before including): +# +# a) +# TARGETS -- the target to create +# (defaults to $LIBRARY $PROGRAM) +# b) +# DIRS -- subdirectories for make to recurse on +# (the 'all' rule builds $TARGETS $DIRS) +# c) +# CSRCS, CPPSRCS -- .c and .cpp files to compile +# (used to define $OBJS) +# d) +# PROGRAM -- the target program name to create from $OBJS +# ($OBJDIR automatically prepended to it) +# e) +# LIBRARY -- the target library name to create from $OBJS +# ($OBJDIR automatically prepended to it) +# f) +# JSRCS -- java source files to compile into class files +# (if you don't specify this it will default to *.java) +# PACKAGE -- the package to put the .class files into +# (e.g. netscape/applet) +# JMC_EXPORT -- java files to be exported for use by JMC_GEN +# (this is a list of Class names) +# g) +# JRI_GEN -- files to run through javah to generate headers and stubs +# (output goes into the _jri sub-dir) +# h) +# JMC_GEN -- files to run through jmc to generate headers and stubs +# (output goes into the _jmc sub-dir) +# +################################################################################ + +# +# Common rules used by lots of makefiles... +# +ifndef NS_CONFIG_MK +include $(DEPTH)/config/config.mk +endif + +ifdef PROGRAM +PROGRAM := $(addprefix $(OBJDIR)/, $(PROGRAM)) +endif + +ifndef LIBRARY +ifdef LIBRARY_NAME +LIBRARY := lib$(LIBRARY_NAME).$(LIB_SUFFIX) +endif +endif + +ifdef LIBRARY +LIBRARY := $(addprefix $(OBJDIR)/, $(LIBRARY)) +ifdef MKSHLIB +SHARED_LIBRARY := $(LIBRARY:.$(LIB_SUFFIX)=$(DLL_PRESUF).$(DLL_SUFFIX)) +endif +endif + +ifndef TARGETS +TARGETS = $(LIBRARY) $(SHARED_LIBRARY) $(PROGRAM) +endif + +ifndef OBJS +OBJS = $(JRI_STUB_CFILES) $(addsuffix .o, $(JMC_GEN)) $(CSRCS:.c=.o) $(CPPSRCS:.cpp=.o) $(ASFILES:.s=.o) +endif + +ifdef OBJS +OBJS := $(addprefix $(OBJDIR)/, $(OBJS)) +endif + +ifdef REQUIRES +MODULE_PREINCLUDES = $(addprefix -I$(XPDIST)/public/, $(REQUIRES)) +endif + +ifeq ($(OS_ARCH),WINNT) +ifdef DLL +DLL := $(addprefix $(OBJDIR)/, $(DLL)) +LIB := $(addprefix $(OBJDIR)/, $(LIB)) +endif +endif +define MAKE_OBJDIR +if test ! -d $(@D); then rm -rf $(@D); $(NSINSTALL) -D $(@D); fi +endef + +ALL_TRASH = $(TARGETS) $(OBJS) $(OBJDIR) LOGS TAGS $(GARBAGE) \ + $(NOSUCHFILE) $(JDK_HEADER_CFILES) $(JDK_STUB_CFILES) \ + $(JRI_HEADER_CFILES) $(JRI_STUB_CFILES) $(JMC_STUBS) \ + $(JMC_HEADERS) $(JMC_EXPORT_FILES) so_locations \ + _gen _jmc _jri _stubs \ + $(wildcard $(JAVA_DESTPATH)/$(PACKAGE)/*.class) + +ifdef JDIRS +ALL_TRASH += $(addprefix $(JAVA_DESTPATH)/,$(JDIRS)) +endif + +ifdef NSBUILDROOT +JDK_GEN_DIR = $(XPDIST)/_gen +JMC_GEN_DIR = $(XPDIST)/_jmc +JRI_GEN_DIR = $(XPDIST)/_jri +JDK_STUB_DIR = $(XPDIST)/_stubs +else +JDK_GEN_DIR = _gen +JMC_GEN_DIR = _jmc +JRI_GEN_DIR = _jri +JDK_STUB_DIR = _stubs +endif + +# +# If this is an "official" build, try to build everything. +# I.e., don't exit on errors. +# +ifdef BUILD_OFFICIAL +EXIT_ON_ERROR = +e +CLICK_STOPWATCH = date +else +EXIT_ON_ERROR = -e +CLICK_STOPWATCH = true +endif + + +################################################################################ + +ifdef ALL_PLATFORMS +all_platforms:: $(NFSPWD) + @d=`$(NFSPWD)`; \ + if test ! -d LOGS; then rm -rf LOGS; mkdir LOGS; fi; \ + for h in $(PLATFORM_HOSTS); do \ + echo "On $$h: $(MAKE) $(ALL_PLATFORMS) >& LOGS/$$h.log"; \ + rsh $$h -n "(chdir $$d; \ + $(MAKE) $(ALL_PLATFORMS) >& LOGS/$$h.log; \ + echo DONE) &" 2>&1 > LOGS/$$h.pid & \ + sleep 1; \ + done + +$(NFSPWD): + cd $(@D); $(MAKE) $(@F) +endif + +ifdef REQUIRES +ifndef NO_NSPR +INCLUDES += -I$(XPDIST)/$(OBJDIR)/include/nspr20/pr $(addprefix -I$(XPDIST)/public/, $(REQUIRES)) +else +INCLUDES += $(addprefix -I$(XPDIST)/public/, $(REQUIRES)) +endif +endif + +all:: $(TARGETS) + +$(LOOP_OVER_DIRS) + +libs:: $(LIBRARY) $(SHARED_LIBRARY) + +$(PROGRAM): $(OBJS) + @$(MAKE_OBJDIR) +ifeq ($(OS_ARCH),WINNT) + $(CC) $(OBJS) -Fe$@ -link $(LDFLAGS) $(OS_LIBS) $(EXTRA_LIBS) +else + $(CC) -o $@ $(CFLAGS) $(OBJS) $(LDFLAGS) +endif + +$(LIBRARY): $(OBJS) + @$(MAKE_OBJDIR) + rm -f $@ + $(AR) $(OBJS) + $(RANLIB) $@ + +$(SHARED_LIBRARY): $(OBJS) + @$(MAKE_OBJDIR) + rm -f $@ + $(MKSHLIB) -o $@ $(OBJS) $(EXTRA_SHLIBS) + chmod +x $@ + +ifeq ($(OS_ARCH),WINNT) +$(DLL): $(OBJS) $(EXTRA_LIBS) + @$(MAKE_OBJDIR) + rm -f $@ + $(LINK_DLL) $(OBJS) $(OS_LIBS) $(EXTRA_LIBS) +endif + +.SUFFIXES: .i .pl .class .java .html + +.PRECIOUS: .java + +$(OBJDIR)/%: %.c + @$(MAKE_OBJDIR) +ifeq ($(OS_ARCH),WINNT) + $(CC) -Fo$@ -c $(CFLAGS) $*.c +else + $(CC) -o $@ $(CFLAGS) $*.c $(LDFLAGS) +endif + +$(OBJDIR)/%.o: %.c + @$(MAKE_OBJDIR) +ifeq ($(OS_ARCH),WINNT) + $(CC) -Fo$@ -c $(CFLAGS) $*.c +else + $(CC) -o $@ -c $(CFLAGS) $*.c +endif + +$(OBJDIR)/%.o: %.s + @$(MAKE_OBJDIR) + $(AS) -o $@ $(ASFLAGS) -c $*.s + +$(OBJDIR)/%.o: %.S + @$(MAKE_OBJDIR) + $(AS) -o $@ $(ASFLAGS) -c $*.S + +$(OBJDIR)/%: %.cpp + @$(MAKE_OBJDIR) + $(CCC) -o $@ $(CFLAGS) $*.c $(LDFLAGS) + +# +# Please keep the next two rules in sync. +# +$(OBJDIR)/%.o: %.cc + @$(MAKE_OBJDIR) + $(CCC) -o $@ -c $(CFLAGS) $*.cc + +$(OBJDIR)/%.o: %.cpp + @$(MAKE_OBJDIR) +ifdef STRICT_CPLUSPLUS_SUFFIX + echo "#line 1 \"$*.cpp\"" | cat - $*.cpp > $(OBJDIR)/t_$*.cc + $(CCC) -o $@ -c $(CFLAGS) $(OBJDIR)/t_$*.cc + rm -f $(OBJDIR)/t_$*.cc +else +ifeq ($(OS_ARCH),WINNT) + $(CCC) -Fo$@ -c $(CFLAGS) $*.cpp +else + $(CCC) -o $@ -c $(CFLAGS) $*.cpp +endif +endif #STRICT_CPLUSPLUS_SUFFIX + +%.i: %.cpp + $(CCC) -C -E $(CFLAGS) $< > $*.i + +%.i: %.c + $(CC) -C -E $(CFLAGS) $< > $*.i + +%: %.pl + rm -f $@; cp $*.pl $@; chmod +x $@ + +%: %.sh + rm -f $@; cp $*.sh $@; chmod +x $@ + +# +# If this is an "official" build, try to build everything. +# I.e., don't exit on errors. +# +ifdef BUILD_OFFICIAL +EXIT_ON_ERROR = +e +else +EXIT_ON_ERROR = -e +endif + +ifdef DIRS +ifneq ($(OS_ARCH),WINNT) +override MAKEFLAGS := +endif +LOOP_OVER_DIRS = \ + @for d in $(DIRS); do \ + if test -d $$d; then \ + set $(EXIT_ON_ERROR); \ + echo "cd $$d; $(MAKE) $(MAKEFLAGS) $@"; \ + cd $$d; $(MAKE) $(MAKEFLAGS) $@; cd ..; \ + set +e; \ + else \ + echo "Skipping non-directory $$d..."; \ + fi; \ + $(CLICK_STOPWATCH); \ +done + +$(DIRS):: + @if test -d $@; then \ + set $(EXIT_ON_ERROR); \ + echo "cd $@; $(MAKE) $(MAKEFLAGS)"; \ + cd $@; $(MAKE) $(MAKEFLAGS); \ + set +e; \ + else \ + echo "Skipping non-directory $@..."; \ + fi \ + $(CLICK_STOPWATCH); +endif # DIRS + +clean:: + rm -f $(OBJS) $(NOSUCHFILE) + +$(LOOP_OVER_DIRS) + +clobber:: + rm -f $(OBJS) $(TARGETS) $(GARBAGE) $(NOSUCHFILE) + +$(LOOP_OVER_DIRS) + +realclean clobber_all:: + rm -rf LOGS TAGS $(wildcard *.OBJ) $(OBJS) $(TARGETS) $(GARBAGE) $(NOSUCHFILE) + +$(LOOP_OVER_DIRS) + +alltags: + rm -f TAGS + find . -name dist -prune -o \( -name '*.[hc]' -o -name '*.cp' -o -name '*.cpp' \) -print | xargs etags -a + +export:: + +$(LOOP_OVER_DIRS) + +libs:: + +$(LOOP_OVER_DIRS) + +install:: + +$(LOOP_OVER_DIRS) + +mac:: + +$(LOOP_OVER_DIRS) + +################################################################################ +### Bunch of things that extend the 'export' rule (in order): +################################################################################ +### JSRCS -- for compiling java files + +ifndef PACKAGE +PACKAGE = . +endif +$(JAVA_DESTPATH) $(JAVA_DESTPATH)/$(PACKAGE) $(JMCSRCDIR):: + @if test ! -d $@; then \ + echo Creating $@; \ + rm -rf $@; \ + $(NSINSTALL) -D $@; \ + fi + +ifneq ($(JSRCS),) +export:: $(JAVA_DESTPATH) $(JAVA_DESTPATH)/$(PACKAGE) + @list=`perl $(DEPTH)/config/outofdate.pl $(PERLARG) \ + -d $(JAVA_DESTPATH)/$(PACKAGE) $(JSRCS)`; \ + if test "$$list"x != "x"; then \ + echo $(JAVAC) $$list; \ + $(JAVAC) $$list; \ + fi + +all:: export + +clobber:: + rm -f $(XPDIST)/classes/$(PACKAGE)/*.class + +endif + +################################################################################ +## JDIRS -- like JSRCS, except you can give a list of directories and it will +## compile all the out-of-date java files recursively below those directories. + +ifdef JDIRS + +export:: $(JAVA_DESTPATH) $(JAVA_DESTPATH)/$(PACKAGE) + @for d in $(JDIRS); do \ + if test -d $$d; then \ + set $(EXIT_ON_ERROR); \ + files=`echo $$d/*.java`; \ + list=`perl $(DEPTH)/config/outofdate.pl $(PERLARG) \ + -d $(JAVA_DESTPATH)/$(PACKAGE) $$files`; \ + if test "$${list}x" != "x"; then \ + echo Building all java files in $$d; \ + echo $(JAVAC) $$list; \ + $(JAVAC) $$list; \ + fi; \ + set +e; \ + else \ + echo "Skipping non-directory $$d..."; \ + fi; \ + $(CLICK_STOPWATCH); \ + done + +all:: export + +clobber:: + @for d in $(JDIRS); do \ + echo rm -rf $(XPDIST)/classes/$$d; \ + rm -rf $(XPDIST)/classes/$$d; \ + done + +endif + +################################################################################ +### JDK_GEN -- for generating "old style" native methods + +# Generate JDK Headers and Stubs into the '_gen' and '_stubs' directory + +ifneq ($(JDK_GEN),) + +ifdef NSBUILDROOT +JDK_GEN_DIR = $(XPDIST)/_gen +JDK_STUB_DIR = $(XPDIST)/_stubs +else +JDK_GEN_DIR = _gen +JDK_STUB_DIR = _stubs +endif + +INCLUDES += -I$(JDK_GEN_DIR) + +JDK_PACKAGE_CLASSES = $(JDK_GEN) +JDK_PATH_CLASSES = $(subst .,/,$(JDK_PACKAGE_CLASSES)) +JDK_PATH_CLASSES = $(subst .,/,$(JDK_PACKAGE_CLASSES)) +JDK_HEADER_CLASSFILES = $(patsubst %,$(JAVA_DESTPATH)/%.class,$(JDK_PATH_CLASSES)) +JDK_STUB_CLASSFILES = $(patsubst %,$(JAVA_DESTPATH)/%.class,$(JDK_PATH_CLASSES)) +JDK_HEADER_CFILES = $(patsubst %,$(JDK_GEN_DIR)/%.h,$(JDK_GEN)) +JDK_STUB_CFILES = $(patsubst %,$(JDK_STUB_DIR)/%.c,$(JDK_GEN)) + +$(JDK_HEADER_CFILES): $(JDK_HEADER_CLASSFILES) +$(JDK_STUB_CFILES): $(JDK_STUB_CLASSFILES) + +export:: + @echo Generating/Updating JDK headers + $(JAVAH) -d $(JDK_GEN_DIR) $(JDK_PACKAGE_CLASSES) + @echo Generating/Updating JDK stubs + $(JAVAH) -stubs -d $(JDK_STUB_DIR) $(JDK_PACKAGE_CLASSES) + +mac:: + @echo Generating/Updating JDK headers for the Mac + $(JAVAH) -mac -d $(DEPTH)/lib/mac/Java/_gen $(JDK_PACKAGE_CLASSES) + @echo Generating/Updating JDK stubs for the Mac + $(JAVAH) -mac -stubs -d $(DEPTH)/lib/mac/Java/_stubs $(JDK_PACKAGE_CLASSES) + +# Don't delete them if the don't compile (makes it hard to debug): +.PRECIOUS: $(JDK_HEADERS) $(JDK_STUBS) + +clobber:: + rm -rf $(JDK_HEADER_CFILES) $(JDK_STUB_CFILES) + +endif + +################################################################################ +### JRI_GEN -- for generating JRI native methods + +# Generate JRI Headers and Stubs into the 'jri' directory + +ifneq ($(JRI_GEN),) + +ifdef NSBUILDROOT +JRI_GEN_DIR = $(XPDIST)/_jri +else +JRI_GEN_DIR = _jri +endif + +INCLUDES += -I$(JRI_GEN_DIR) + +JRI_PACKAGE_CLASSES = $(JRI_GEN) +JRI_PATH_CLASSES = $(subst .,/,$(JRI_PACKAGE_CLASSES)) + +## dependency fu +JRI_HEADER_CLASSFILES = $(patsubst %,$(XPDIST)/classes/%.class,$(JRI_PATH_CLASSES)) +JRI_HEADER_CFILES = $(patsubst %,$(JRI_GEN_DIR)/%.h,$(JRI_GEN)) +$(JRI_HEADER_CFILES): $(JRI_HEADER_CLASSFILES) + +## dependency fu +JRI_STUB_CLASSFILES = $(patsubst %,$(XPDIST)/classes/%.class,$(JRI_PATH_CLASSES)) +JRI_STUB_CFILES = $(patsubst %,$(JRI_GEN_DIR)/%.c,$(JRI_GEN)) +$(JRI_STUB_CFILES): $(JRI_STUB_CLASSFILES) + +export:: + @echo Generating/Updating JRI headers + $(JAVAH) -jri -d $(JRI_GEN_DIR) $(JRI_PACKAGE_CLASSES) + @echo Generating/Updating JRI stubs + $(JAVAH) -jri -stubs -d $(JRI_GEN_DIR) $(JRI_PACKAGE_CLASSES) + @if test ! -d $(DEPTH)/lib/mac/Java/; then \ + echo "!!! You need to have a ns/lib/mac/Java directory checked out."; \ + echo "!!! This allows us to automatically update generated files for the mac."; \ + echo "!!! If you see any modified files there, please check them in."; \ + fi + @echo Generating/Updating JRI headers for the Mac + $(JAVAH) -jri -mac -d $(DEPTH)/lib/mac/Java/_jri $(JRI_PACKAGE_CLASSES) + @echo Generating/Updating JRI stubs for the Mac + $(JAVAH) -jri -mac -stubs -d $(DEPTH)/lib/mac/Java/_jri $(JRI_PACKAGE_CLASSES) + +# Don't delete them if the don't compile (makes it hard to debug): +.PRECIOUS: $(JRI_HEADERS) $(JRI_STUBS) + +clobber:: + rm -rf $(JRI_HEADER_CFILES) $(JRI_STUB_CFILES) + +endif + +################################################################################ +## JMC_EXPORT -- for declaring which java classes are to be exported for jmc + +ifneq ($(JMC_EXPORT),) + +JMC_EXPORT_PATHS = $(subst .,/,$(JMC_EXPORT)) +JMC_EXPORT_FILES = $(patsubst %,$(XPDIST)/classes/$(PACKAGE)/%.class,$(JMC_EXPORT_PATHS)) + +# We're doing NSINSTALL -t here (copy mode) because calling INSTALL will pick up +# your NSDISTMODE and make links relative to the current directory. This is a +# problem because the source isn't in the current directory: + +export:: $(JMC_EXPORT_FILES) $(JMCSRCDIR) + $(NSINSTALL) -t -m 444 $(JMC_EXPORT_FILES) $(JMCSRCDIR) + +clobber:: + rm -rf $(JMC_EXPORT_FILES) + +endif + + +################################################################################ +## EXPORTS +# +# Copy each element of EXPORTS to $(XPDIST)/public/$(MODULE)/ +# + +ifneq ($(EXPORTS),) + +$(XPDIST)/public/$(MODULE):: + @if test ! -d $@; then \ + echo Creating $@; \ + rm -rf $@; \ + mkdir -p $@; \ + fi + +export:: $(EXPORTS) $(XPDIST)/public/$(MODULE) + $(NSINSTALL) -t -m 444 $(EXPORTS) $(XPDIST)/public/$(MODULE) + +endif + +################################################################################ +## JMC_GEN -- for generating java modules + +# Provide default export & install rules when using JMC_GEN +ifneq ($(JMC_GEN),) + +ifdef NSBUILDROOT +JMC_GEN_DIR = $(XPDIST)/_jmc +else +JMC_GEN_DIR = _jmc +endif + +INCLUDES += -I$(JMC_GEN_DIR) + +JMC_HEADERS = $(patsubst %,$(JMC_GEN_DIR)/%.h,$(JMC_GEN)) +JMC_STUBS = $(patsubst %,$(JMC_GEN_DIR)/%.c,$(JMC_GEN)) +JMC_OBJS = $(patsubst %,$(OBJDIR)/%.o,$(JMC_GEN)) + +$(JMC_GEN_DIR)/M%.h: $(JMCSRCDIR)/%.class + $(JMC) -d $(JMC_GEN_DIR) -interface $(JMC_GEN_FLAGS) $(?F:.class=) + +$(JMC_GEN_DIR)/M%.c: $(JMCSRCDIR)/%.class + $(JMC) -d $(JMC_GEN_DIR) -module $(JMC_GEN_FLAGS) $(?F:.class=) + +$(OBJDIR)/M%.o: $(JMC_GEN_DIR)/M%.h $(JMC_GEN_DIR)/M%.c + @$(MAKE_OBJDIR) + $(CC) -o $@ -c $(CFLAGS) $(JMC_GEN_DIR)/M$*.c + +export:: $(JMC_HEADERS) $(JMC_STUBS) + +# Don't delete them if the don't compile (makes it hard to debug): +.PRECIOUS: $(JMC_HEADERS) $(JMC_STUBS) + +clobber:: + rm -rf $(JMC_HEADERS) $(JMC_STUBS) + +endif + +################################################################################ +## LIBRARY -- default rules for for building libraries + +ifdef LIBRARY +libs:: $(LIBRARY) + $(INSTALL) -m 444 $(LIBRARY) $(DIST)/lib + +install:: $(LIBRARY) + $(INSTALL) -m 444 $(LIBRARY) $(DIST)/lib +endif + +ifdef SHARED_LIBRARY +libs:: $(SHARED_LIBRARY) + $(INSTALL) -m 555 $(SHARED_LIBRARY) $(DIST)/bin + +install:: $(SHARED_LIBRARY) + $(INSTALL) -m 555 $(SHARED_LIBRARY) $(DIST)/bin +endif + +################################################################################ +## PROGRAM -- this is now needed because final programs are distributed +## through dist and link with dynamic libraries + +ifdef PROGRAM +libs:: $(PROGRAM) + $(INSTALL) -m 444 $(PROGRAM) $(DIST)/bin + +install:: $(PROGRAM) + $(INSTALL) -m 444 $(PROGRAM) $(DIST)/bin +endif + +################################################################################ + +-include $(DEPENDENCIES) + +ifneq ($(OS_ARCH),WINNT) +# Can't use sed because of its 4000-char line length limit, so resort to perl +.DEFAULT: + @perl -e ' \ + open(MD, "< $(DEPENDENCIES)"); \ + while () { \ + if (m@ \.*/*$< @) { \ + $$found = 1; \ + last; \ + } \ + } \ + if ($$found) { \ + print "Removing stale dependency $< from $(DEPENDENCIES)\n"; \ + seek(MD, 0, 0); \ + $$tmpname = "$(OBJDIR)/fix.md" . $$$$; \ + open(TMD, "> " . $$tmpname); \ + while () { \ + s@ \.*/*$< @ @; \ + if (!print TMD "$$_") { \ + unlink(($$tmpname)); \ + exit(1); \ + } \ + } \ + close(TMD); \ + if (!rename($$tmpname, "$(DEPENDENCIES)")) { \ + unlink(($$tmpname)); \ + } \ + } elsif ("$<" ne "$(DEPENDENCIES)") { \ + print "$(MAKE): *** No rule to make target $<. Stop.\n"; \ + exit(1); \ + }' +endif + +############################################################################# +# X dependency system +############################################################################# + +ifneq ($(OS_ARCH),WINNT) + +$(MKDEPENDENCIES):: + @$(MAKE_OBJDIR) + touch $(MKDEPENDENCIES) + $(MKDEPEND) -p$(OBJDIR_NAME)/ -o'.o' -f$(MKDEPENDENCIES) $(INCLUDES) $(CSRCS) $(CPPSRCS) + +$(MKDEPEND):: + cd $(MKDEPEND_DIR); $(MAKE) + +ifdef OBJS +depend:: $(MKDEPEND) $(MKDEPENDENCIES) +else +depend:: +endif + +$(LOOP_OVER_DIRS) + +dependclean:: + rm -f $(MKDEPENDENCIES) + +$(LOOP_OVER_DIRS) + +#-include $(OBJDIR)/depend.mk + +endif + +############################################################################# + +-include $(MY_RULES) + +$(MY_CONFIG): +$(MY_RULES): + +# Generate Emacs tags in a file named TAGS if ETAGS was set in $(MY_CONFIG) +# or in $(MY_RULES) +ifdef ETAGS +ifneq ($(CSRCS)$(HEADERS),) +all:: TAGS +TAGS:: $(CSRCS) $(HEADERS) + $(ETAGS) $(CSRCS) $(HEADERS) +endif +endif + +################################################################################ +# Special gmake rules. +################################################################################ + +# +# Re-define the list of default suffixes, so gmake won't have to churn through +# hundreds of built-in suffix rules for stuff we don't need. +# +.SUFFIXES: +.SUFFIXES: .out .a .ln .o .c .cc .C .cpp .y .l .s .S .h .sh .i .pl .class .java .html + +# +# Don't delete these files if we get killed. +# +.PRECIOUS: .java $(JDK_HEADERS) $(JDK_STUBS) $(JRI_HEADERS) $(JRI_STUBS) $(JMC_HEADERS) $(JMC_STUBS) + +# +# Fake targets. Always run these rules, even if a file/directory with that +# name already exists. +# +.PHONY: all all_platforms alltags boot clean clobber clobber_all export install libs realclean $(OBJDIR) $(DIRS) diff --git a/config/webint.mk b/config/webint.mk new file mode 100644 index 00000000..5269b321 --- /dev/null +++ b/config/webint.mk @@ -0,0 +1,24 @@ +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +ifdef WEBSERVER_LANGS +LANG_LOOP= \ + @for d in $(WEBSERVER_LANGS); do \ + if test ! -d $$d; then \ + echo Directory $$d does not exist. Creating...; \ + mkdir -p $$d; \ + fi; \ + echo cd $$d; \ + cd $$d; \ + echo $(MAKE) -f ../Makefile $(MAKEFLAGS) INT_SUBDIR=1; \ + $(MAKE) -f ../Makefile $(MAKEFLAGS) INT_SUBDIR=1; \ + cd ..; \ + done +else +LANG_LOOP= @echo "No foreign languages in this build" +endif + diff --git a/dirver.pl b/dirver.pl new file mode 100755 index 00000000..f360c18a --- /dev/null +++ b/dirver.pl @@ -0,0 +1,125 @@ +#!/usr/bin/perl +#----------------------------------------------------------------- +# dirver.pl: Generates ascii format #define for FILEVERSION +# resource identifier used by Windows executable binaries. +# +# Usage: dirver.pl -v [-d mm/dd/yy] [-o outfile] +# Example: dirver.pl -v 6.5.2 -d 1/19/2005 -o fileversion.h +# +# -v Version number. +# -d Date. (optional) +# -o Output header file. (optional) +# -H Print this help message +#----------------------------------------------------------------- + +use Getopt::Std; +use FileHandle; + +autoflush STDERR 1; + +getopts('v:d:o:H'); + +if ($opt_H) {exitHelp();} + +# Load arguments +$version = $opt_v || exitHelp(); +$date = $opt_d; +$outfile = $opt_o; + +# Separate version into components +my @verComponents = split(/\./, $version); + +# Set version components to 0 if not defined +if ($verComponents[1] == undef) { $verComponents[1] = "0"; } +if ($verComponents[2] == undef) { $verComponents[2] = "0"; } + +# Calculate build version and build date +my $buildVersion = calcVersion(@verComponents); +my $buildDate = calcBuildDate($date); + +# Write #defines out to stdout or a file is requested +if ($outfile) { + open(OUTFILE,">$outfile") || die "Error: Can't create $outfile: $!"; + $outhdl = OUTFILE; +} else { + $outhdl = STDOUT; +} + +print $outhdl "#define VI_PRODUCTVERSION $verComponents[0].$verComponents[1]\n"; +print $outhdl "#define PRODUCTTEXT \"$version\"\n"; +print $outhdl "#define VI_FILEVERSION $buildVersion, 0, 0, $buildDate\n"; +print $outhdl "#define VI_FileVersion \"$version Build $buildDate\\0\"\n"; + +# Close file if not using STDOUT +if ($outfile) { + close(OUTFILE); +} + +#---------- calcVersion subroutine ---------- +sub calcVersion { + my @ver = shift; + my $nVersion = 0; + + $nVersion = $ver[0]; + $nVersion <<= 5; + $nVersion += $ver[1]; + $nVersion <<= 7; + $nVersion += $ver[2]; + $nVersion &= 0xFFFF; + + return $nVersion; +} + +#---------- calcBuildDate subroutine ---------- +sub calcBuildDate { + my $date = shift; + my @dateComponents = (); + my $month, $date, $year; + my $buildDate = ""; + + # Use date if passed in, otherwise use system date + if ($date) { + # Separate date into month, day, and year + @dateComponents = split(/\//, $date); + + # Use struct tm range for month + $dateComponents[0]--; + + # Handle 2 digit years like (20)00 + if ($dateComponents[2] < 70) { + $dateComponents[2] += 20; + } + + $month = $dateComponents[0]; + $day = $dateComponents[1]; + $year = $dateComponents[2]; + } else { + $month = (localtime)[4]; + $day = (localtime)[3]; + $year = (localtime)[5] - 80; + } + + $buildDate = $year; + $buildDate <<= 4; + $buildDate += $month; + $buildDate <<= 5; + $buildDate += $day; + $buildDate &= 0xFFFF; + + return $buildDate; +} + +#---------- exitHelp subroutine ---------- +sub exitHelp { + print(STDERR "$0: Generates ascii format #define for FILEVERSION + \tresource identifier used by Windows executable binaries. + + \tUsage: $0 -v [-d mm/dd/yy] [-o outfile] + \tExample: $0 -v 6.5.2 -d 1/19/2005 -o fileversion.h + + \t-v Version number. + \t-d Date. \(optional\) + \t-o Output header file. \(optional\) + \t-H Print this help message\n"); + exit(0); +} diff --git a/httpd/autobuild b/httpd/autobuild new file mode 100755 index 00000000..a8b4a2fa --- /dev/null +++ b/httpd/autobuild @@ -0,0 +1,500 @@ +#!/bin/sh +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# + +UNAME=`../nsarch` +NSUNAME=`uname -s | sed -e 's%/%_%g'``uname -r` +DATE="`date +%d-%h`" + +# OS tweaks + +if [ "$UNAME" = "SUNOS4" ]; then + PATH=/usr/local/sun4/bin:/usr/bin/X11:$PATH; export PATH + GTAR=/share/builds/f/gtar/bin/sunos-gtar + HTTPDLIB=ns-httpd.so + +elif [ "$UNAME" = "SOLARIS" ]; then + PATH=/usr/ccs/bin:/usr/openwin/bin:$PATH; export PATH + OPENWINHOME=/usr/openwin; export OPENWINHOME + GTAR=/share/builds/f/gtar/bin/solaris-gtar + HTTPDLIB=ns-httpd.so + +elif [ "$UNAME" = "SOLARISx86" ]; then + PATH=/usr/ccs/bin:/usr/openwin/bin:$PATH; export PATH + OPENWINHOME=/usr/openwin; export OPENWINHOME + HTTPDLIB=ns-httpd.so + +elif [ "$UNAME" = "HPUX" ]; then + PATH=/usr/local/hpux/bin:/usr/bin/X11:$PATH; export PATH + GTAR=/share/builds/f/gtar/bin/hpux-gtar + HTTPDLIB=libnshttpd.sl + +elif [ "$UNAME" = "BSDI" ]; then + PATH=/usr/local/bin:/usr/X11/bin:$PATH; export PATH + GTAR=/share/builds/f/gtar/bin/bsdi-gtar + +elif [ "$UNAME" = "OSF1" ]; then +# NOJAVA=true + PATH=/usr/local/dec/bin:/usr/bin/X11:$PATH; export PATH + GTAR=/share/builds/f/gtar/bin/osf1-gtar + HTTPDLIB=ns-httpd.so + +elif [ "$UNAME" = "AIX" ]; then + PATH=/usr/local/aix32/bin:/usr/bin/X11:$PATH; export PATH + GTAR=/share/builds/f/gtar/bin/aix-gtar + HTTPDLIB=ns-httpd.a + +elif [ "$UNAME" = "IRIX" ]; then + GTAR=/share/builds/f/gtar/bin/irix-gtar + HTTPDLIB=ns-httpd.so + +elif [ "$UNAME" = "SONY" ]; then + PATH=/usr/bin/X11:$PATH; export PATH + HTTPDLIB=ns-httpd.so + +elif [ "$UNAME" = "NECSVR4" ]; then + PATH=/u/malmer/nec/usr/local/bin:/usr/bin/X11:$PATH; export PATH + HTTPDLIB=ns-httpd.so + +elif [ "$UNAME" = "ReliantUNIX" ]; then + PATH=/usr/local/bin:$PATH; export PATH + GTAR=tar + HTTPDLIB=ns-httpd.so + +elif [ "$UNAME" = "SCO" ]; then + PATH=/usr/local/bin:/usr/bin/X11:$PATH; export PATH + GTAR=/usr/local/bin/gtar + HTTPDLIB=ns-httpd.so + +elif [ "$UNAME" = "UNIXWARE" ]; then + PATH=/usr/local/bin:/usr/bin/X11:$PATH; export PATH + GTAR=/usr/local/bin/gtar + HTTPDLIB=ns-httpd.so + +fi + +set -- `getopt p: $*` || { + echo "### `basename $0`: ERROR: unknown option" 1>&2 + exit 1 +} + +BuildInPhases=0 + +while [ "$1" != "--" ] ; do + case "$1" in + -p) BuildInPhases=1; shift; Phase=$1 + ;; + esac + shift +done +shift + + +buildit() { + +# Initialize some variables + +ADMINDIR=../built/$UNAME-$SECTYPE-admserv +if [ "$PRODUCT" = "personal" ]; then + BINDIR=httpd + TARNAME=nshttpd.tar +elif [ "$PRODUCT" = "catalog" ]; then + BINDIR=catalog + TARNAME=ns-catalog.tar +elif [ "$PRODUCT" = "rds" ]; then + BINDIR=rds + TARNAME=ns-rds.tar +elif [ "$PRODUCT" = "cms" ]; then + BINDIR=https + TARNAME=ns-cms.tar +else + BINDIR=https + TARNAME=nshttps.tar +fi +SOURCEDIR=../built/$UNAME-$SECTYPE-$BINDIR +TARGETDIR=$TYPE/$UNAME-$SECTYPE-$BINDIR +TARGETUNTAR=$TYPE/$UNAME-$SECTYPE-$BINDIR/untarred + +TARGETHTBIN=$TYPE/$UNAME-$SECTYPE-$BINDIR/untarred/bin/$BINDIR +mkdir -p $TARGETUNTAR 2> /dev/null + +if [ $BuildInPhases = 1 ] +then + if [ "$Phase" = "server" ] + then + buildserver + elif [ "$Phase" = "admin" ] + then + buildadmin + elif [ "$Phase" = "batman" ] + then + buildbatman + elif [ "$Phase" = "tar" ] + then + (cd $TARGETUNTAR; tar cvf ../$TARNAME *) + else + echo "`basename $0`: ERROR: unknown build phase" + exit 1 + fi +else + buildserver + buildadmin + buildbatman + (cd $TARGETUNTAR; tar cvf ../$TARNAME *) +fi +} + +buildserver() { + +(cd ..; ./config $BOMB $PRODUCT $SECCONFIG $OPTIMIZE) +gmake + +if [ $? -ne 0 ]; then + exit 2 +fi + +(cd ../mc-icons; gmake) +if [ $? -ne 0 ]; then + exit 2 +fi + +(cd ../include; gmake) +if [ $? -ne 0 ]; then + exit 2 +fi + +(cd nsapi; gmake) +if [ $? -ne 0 ]; then + exit 2 +fi + +(cd extras; gmake) +if [ $? -ne 0 ]; then + exit 2 +fi + +if [ "$NOJAVA" != "true" ]; then + (cd ../lib/sjava; gmake) + if [ $? -ne 0 ]; then + exit 2 + fi +fi + +# generate DBMs in admin/bin directory +(cd $SOURCEDIR/admin/bin; ./mkdbm) + +# Each product has different manuals +if [ "$BINDIR" = "catalog" -o "$BINDIR" = "rds" ]; then + # Batman + ADMINMANUALS="html/manual/ag html/manual/design html/manual/beta2" +else + # Enterprise and FastTrack + ADMINMANUALS="html/manual/ag html/manual/pg html/manual/javascript" +fi +for i in icons html html/info html/manual $ADMINMANUALS bin; do + mkdir -p $TARGETUNTAR/bin/$BINDIR/admin/$i + cp $SOURCEDIR/admin/$i/* $TARGETHTBIN/admin/$i +done + +/bin/rm -f $TARGETHTBIN/admin/bin/*.o +$STRIP $TARGETHTBIN/admin/bin/* + +for i in misc icons html bin; do + mkdir -p $TARGETHTBIN/install/$i + cp $SOURCEDIR/install/$i/* $TARGETHTBIN/install/$i +done +$STRIP $TARGETHTBIN/install/bin/* +mv $TARGETHTBIN/install/bin/ns-setup $TARGETDIR +mv $TARGETHTBIN/install/bin/ns-config $TARGETHTBIN/ns-config + + +mkdir -p $TARGETUNTAR/ns-icons +cp $SOURCEDIR/mc-icons/* $TARGETUNTAR/ns-icons + +if [ -d $SOURCEDIR/nsapi -a "$UNAME" != "BSDI" ]; then + mkdir -p $TARGETUNTAR/nsapi + cp -r $SOURCEDIR/nsapi/* $TARGETUNTAR/nsapi +fi + +mkdir -p $TARGETUNTAR/extras +cp -r $SOURCEDIR/extras/* $TARGETUNTAR/extras +$STRIP $TARGETUNTAR/extras/*/* + +cp $SOURCEDIR/ns-httpd $TARGETHTBIN/ns-httpd +if [ "$HTTPDLIB" != "" ]; then + cp $SOURCEDIR/$HTTPDLIB $TARGETHTBIN/$HTTPDLIB +fi +$STRIP $TARGETHTBIN/ns-httpd +if [ "$UNAME" != "IRIX" -a "$UNAME" != "SUNOS4" ]; then + $STRIP $TARGETHTBIN/$HTTPDLIB +fi + +if [ "$UNAME" = "AIX" ]; then + cp /usr/lib/libsvld.a $TARGETHTBIN/libsvld.a +fi + + +cp README $TARGETDIR +cp newinst/misc/license.txt $TARGETDIR + +mkdir -p $TARGETUNTAR/userdb +mkdir -p $TARGETUNTAR/httpacl +mkdir -p $TARGETUNTAR/authdb +mkdir -p $TARGETUNTAR/authdb/default + +if [ "$PRODUCT" = "enterprise" ]; then +mkdir -p $TARGETUNTAR/plugins/search/admin +mkdir -p $TARGETUNTAR/plugins/search/tmp +chmod a+w $TARGETUNTAR/plugins/search/tmp +mkdir -p $TARGETUNTAR/plugins/search/collections +chmod a+w $TARGETUNTAR/plugins/search/collections +cp -r plugins/search $TARGETUNTAR/plugins +(cd $TARGETUNTAR/plugins/search; rm -r `find . -name CVS -print`) +cp $SOURCEDIR/lib/vsearch $TARGETUNTAR/plugins/search/vsearch +cp $SOURCEDIR/admin/bin/ia* $TARGETUNTAR/plugins/search/vsearch +$STRIP $TARGETUNTAR/plugins/search/vsearch/ia* +cp ../lib/libsearch/searching/query.err $TARGETUNTAR/plugins/search/vsearch +mkdir -p $TARGETUNTAR/plugins/search/ui/icons +mkdir -p $TARGETUNTAR/plugins/search/ui/usa +cp ../lib/libsearch/searching/ui/icons/* $TARGETUNTAR/plugins/search/ui/icons +cp ../lib/libsearch/searching/ui/usa/* $TARGETUNTAR/plugins/search/ui/usa + +mkdir -p $TARGETUNTAR/plugins/snmp +mkdir -p $TARGETUNTAR/plugins/snmp/magt +mkdir -p $TARGETUNTAR/plugins/snmp/sagt +if [ -d $SOURCEDIR/plugin/snmp -a -f $SOURCEDIR/plugin/snmp/httpagt ]; then + cp $SOURCEDIR/plugin/snmp/httpagt $TARGETUNTAR/plugins/snmp/httpagt +fi +cp plugins/snmp/netscape.pub $TARGETUNTAR/plugins/snmp/netscape.mib + +mkdir -p $TARGETUNTAR/plugins/mks/bin + cp $SOURCEDIR/plugins/mks/bin/*.so $TARGETUNTAR/plugins/mks/bin + +if [ "$UNAME" = "SUNOS4" ]; then + cp ../../../peer/sunos/magt/* $TARGETUNTAR/plugins/snmp/magt + cp ../../../peer/sunos/sagt/* $TARGETUNTAR/plugins/snmp/sagt +elif [ "$UNAME" = "SOLARIS" ]; then + cp ../../../peer/solaris/magt/* $TARGETUNTAR/plugins/snmp/magt + cp ../../../peer/solaris/sagt/* $TARGETUNTAR/plugins/snmp/sagt +elif [ "$UNAME" = "HPUX" ]; then + cp ../../../peer/hp/magt/* $TARGETUNTAR/plugins/snmp/magt + cp ../../../peer/hp/sagt/* $TARGETUNTAR/plugins/snmp/sagt +elif [ "$UNAME" = "OSF1" ]; then + cp ../../../peer/osf/magt/* $TARGETUNTAR/plugins/snmp/magt + cp ../../../peer/osf/sagt/* $TARGETUNTAR/plugins/snmp/sagt +elif [ "$UNAME" = "AIX" ]; then + cp ../../../peer/aix/magt/* $TARGETUNTAR/plugins/snmp/magt + cp ../../../peer/aix/sagt/* $TARGETUNTAR/plugins/snmp/sgat +elif [ "$UNAME" = "IRIX" ]; then + cp ../../../peer/irix/magt/* $TARGETUNTAR/plugins/snmp/magt + cp ../../../peer/irix/sagt/* $TARGETUNTAR/plugins/snmp/sagt +fi +fi # PRODUCT = enterprise + + +if [ "$NOJAVA" != "true" ]; then + mkdir -p $TARGETUNTAR/plugins/java/bin + cp $SOURCEDIR/lib/libsjava.so $TARGETUNTAR/plugins/java/bin + + mkdir -p $TARGETUNTAR/plugins/java/classes + cp ../../sun-java/classsrc/serv2_0.zip $TARGETUNTAR/plugins/java/classes + + cp plugins/java/javac $TARGETUNTAR/plugins/java + cp plugins/java/README $TARGETUNTAR/plugins/java + + mkdir -p $TARGETUNTAR/plugins/java/applets + cp plugins/java/applets/* $TARGETUNTAR/plugins/java/applets + +# mkdir -p $TARGETUNTAR/plugins/java/local-classes +# cp plugins/java/local-classes/* $TARGETUNTAR/plugins/java/local-classes + +# XXXrobm these docs assume that we have Sun's HTML and images +# mkdir -p $TARGETUNTAR/plugins/java/docs/images +# cp plugins/java/docs/*.html $TARGETUNTAR/plugins/java/docs +# cp ../../sun-java/javadoc/*.gif $TARGETUNTAR/plugins/java/docs/images +fi + +mkdir $TARGETUNTAR/install +cp ./newinst/src/upgrade $TARGETUNTAR/install +cp ./newinst/src/ObjConf.pm $TARGETUNTAR/install +cp ./newinst/src/Magnus.pm $TARGETUNTAR/install +cp ./newinst/src/start $TARGETUNTAR/install +cp ./newinst/src/stop $TARGETUNTAR/install +cp ./newinst/src/restart $TARGETUNTAR/install +cp ./newinst/src/rotate $TARGETUNTAR/install +cp ./newinst/perl5/$UNAME-perl5/perl $TARGETUNTAR/install +cp ./newinst/perl5/artistic $TARGETUNTAR/install +if [ "$UNAME" = "IRIX" ] || [ "$UNAME" = "SOLARIS" ] || [ "$UNAME" = "OSF1" ] ; then + cp ./newinst/src/kernelThreads.pl $TARGETUNTAR/install/threads.pl +fi +cp $SOURCEDIR/extras/database/mkuser $TARGETUNTAR/install +cp $SOURCEDIR/extras/database/ndbmdump $TARGETUNTAR/install +cp $SOURCEDIR/extras/database/rcert11 $TARGETUNTAR/install +cp $SOURCEDIR/extras/database/rkey11 $TARGETUNTAR/install +$STRIP $TARGETUNTAR/install/* + +if [ "$DO_LIVEWIRE" = "yes" ]; then + if [ "$UNAME" = "IRIX" ] ; then + PLATSFX=sgi + elif [ "$UNAME" = "SOLARIS" ] ; then + PLATSFX=sol + elif [ "$UNAME" = "HPUX" ] ; then + PLATSFX=hpx + fi + LIVEWIRETAR=livewire_$PLATSFX.tar + if [ -d $TARGETUNTAR/LiveWire ]; then + rm -rf $TARGETUNTAR/LiveWire + fi + mkdir $TARGETUNTAR/LiveWire + cp ./newinst/src/$LIVEWIRETAR.gz $TARGETUNTAR/LiveWire + gunzip $TARGETUNTAR/LiveWire/$LIVEWIRETAR + (cd $TARGETUNTAR/LiveWire; tar xf livewire*.tar) + cp $TARGETUNTAR/LiveWire/server/* $TARGETUNTAR/bin/$BINDIR + cp $TARGETUNTAR/LiveWire/bin/* $TARGETUNTAR/bin/$BINDIR + rm -rf $TARGETUNTAR/LiveWire/server $TARGETUNTAR/LiveWire/bin + rm $TARGETUNTAR/LiveWire/livewire*.tar +fi + + +(cd $TARGETUNTAR; find . -name \*.o -print | xargs rm -f) + +} + +buildadmin() { + +# BONEHEAD +(cd ..; ./config $BOMB admin $SECCONFIG $OPTIMIZE) +(cd ../admserv; gmake) +if [ $? -ne 0 ]; then + exit 2 +fi + +mkdir -p $TARGETUNTAR/admserv +cp $ADMINDIR/ns-admin $TARGETUNTAR/admserv +$STRIP $TARGETUNTAR/admserv/ns-admin + +for i in icons html html/info bin cfgstuff; do + mkdir -p $TARGETUNTAR/bin/admserv/$i + cp $ADMINDIR/cgi/$i/* $TARGETUNTAR/bin/admserv/$i +done +$STRIP $TARGETUNTAR/bin/admserv/bin/* + +} + +buildbatman() { + +# For AutoCatalog from Batman -Darren +if [ "$DO_AUTOCATALOG" = "yes" ]; then + # We need to re-run config to get our own library versions, etc. + (cd ..; ./config $BOMB batman $SECCONFIG $OPTIMIZE) + + # This ugly hack is needed because nspr.a must be rebuilt on + # SOLARIS for batman. There are symbols required by the gcc + # generated code that SparcWorks doesn't provide - nothing links. + + if [ "$UNAME" = "SOLARIS" ]; then + NSPRDIR=../../nspr/src/${NSUNAME}_${NSTAG}.OBJ + mv $NSPRDIR/nspr.a $NSPRDIR/GCCnspr.a + if [ -f $NSPRDIR/SPARCWKnspr.a ] ; then + mv $NSPRDIR/SPARCWKnspr.a $NSPRDIR/nspr.a + else + rm -f $NSPRDIR/*.o + fi + fi + (NS_USE_NATIVE=1; export NS_USE_NATIVE; cd ../batman; gmake MINIRDS_INSTALLDIR="../../httpd/$TARGETUNTAR/plugins" NSAPIDIR="$TARGETUNTAR/nsapi" minirds) + if [ $? -ne 0 ]; then + exit 2 + fi + $STRIP $TARGETUNTAR/plugins/autocatalog/bin/* + $STRIP $TARGETUNTAR/plugins/autocatalog/* + if [ "$UNAME" = "SOLARIS" ] ; then + mv $NSPRDIR/nspr.a $NSPRDIR/SPARCWKnspr.a + mv $NSPRDIR/GCCnspr.a $NSPRDIR/nspr.a + fi +fi + +} + +if [ "`echo $* | grep final`" != "" ]; then + TYPE=final + BOMB=nobomb + +elif [ "`echo $* | grep beta`" != "" ]; then + TYPE=beta + BOMB=bomb + +else + echo "You must choose to build either a beta or final version." + exit 2 +fi + + +if [ "$NOJAVA" = "" -a "`echo $* | grep java`" != "" ]; then + NOJAVA=false +else + NOJAVA=true +fi + +if [ "$DO_AUTOCATALOG" = "" -a "`echo $* | grep autocatalog`" != "" ]; then + DO_AUTOCATALOG=yes +else + DO_AUTOCATALOG=no +fi +# need to export DO_AUTOCATALOG so that it's passed down through all gmakes +export DO_AUTOCATALOG + +if [ "$DO_LIVEWIRE" = "" ]; then + if [ "`echo $* | grep livewire`" != "" ]; then + DO_LIVEWIRE=yes + else + DO_LIVEWIRE=no + fi +fi +export DO_LIVEWIRE + +OPTIMIZE=optimize +NSTAG=OPT +STRIP=strip +if [ "`echo $* | grep debug`" != "" ]; then + OPTIMIZE=debug + NSTAG=DBG + STRIP=echo +fi + +NSDISTDIR=../../dist/${NSUNAME}_${NSTAG}.OBJ + +if [ "`echo $* | grep personal`" != "" ]; then + PRODUCT=personal +elif [ "`echo $* | grep ns_catalog`" != "" ]; then + PRODUCT=catalog +elif [ "`echo $* | grep ns_rds`" != "" ]; then + PRODUCT=rds +elif [ "`echo $* | grep cms`" != "" ]; then + PRODUCT=cms +else + PRODUCT=enterprise +fi + + +if [ "`echo $* | grep unsecure`" != "" -o "`echo $* | grep all`" != "" ]; then + SECTYPE=none + SECCONFIG=unsecure + buildit +fi + +if [ "`echo $* | grep export`" != "" -o "`echo $* | grep all`" != "" ]; then + SECTYPE=export + SECCONFIG=export + buildit +fi + +if [ "`echo $* | grep domestic`" != "" -o "`echo $* | grep all`" != "" ]; then + SECTYPE=domestic + SECCONFIG=domestic + buildit +fi diff --git a/httpd/src/Makefile b/httpd/src/Makefile new file mode 100644 index 00000000..26ac574c --- /dev/null +++ b/httpd/src/Makefile @@ -0,0 +1,229 @@ +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# Makefile.cpp for the Netsite Commerce and Communications servers. + +MCOM_ROOT = ../../.. + +MODULE=httpdBinary + +ifneq ($(ARCH), WINNT) +OLD_MCOM_ROOT := $(MCOM_ROOT) +MCOM_ROOT := $(shell cd $(OLD_MCOM_ROOT); pwd) +BUILDSO=mocha admin +endif + +HTTPD_DIR=$(OBJDIR) +OBJDEST=$(HTTPD_DIR)/obj + +include ../../nsconfig.mk + +MCC_INCLUDE += $(ADMINUTIL_INCLUDE) + +ifeq ($(ARCH), WINNT) +BINS=$(HTTPD_DIR)/httpd.exe +DLLS=$(HTTPD_DIR)/$(HTTPDLL_NAME).dll +HTTPD_LIB=$(HTTPD_DIR)/$(HTTPDLL_NAME).lib +NSAPI20=$(HTTPD_DIR)/ns-httpd20.dll +LOCAL_LINK_EXE = link -OUT:"$@" /STACK:0x20000,0x2000 /MAP $(ARCH_LINK_DEBUG) $(LCFLAGS) /NOLOGO /PDB:NONE /INCREMENTAL:NO \ + /SUBSYSTEM:windows $(EXTRA_LIBS) +EXTRA_LIBS+=$(NSPRLINK) + +ifeq ($(BSCINFO), yes) +BSCS=$(HTTPD_DIR)/httpd.bsc +endif + +else +BINS=$(HTTPD_DIR)/ns-httpd +endif + +ifeq ($(ARCH), SCO) +EXTRA_OPTS := -Wl,-Bexport +endif + +ifeq ($(ARCH), UNIXWARE) +EXTRA_OPTS := -W l,-Bexport +endif + +ifeq ($(ARCH), NCR) +EXTRA_OPTS := -Wl,-Bexport +endif + +ifeq ($(ARCH), SUNOS4) +EXTRA_LIBS=-nostdlib /usr/lib/libc.a +endif + +ifeq ($(ARCH), AIX) +EXTRA_OPTS = -blibpath:../../bin/https:$(DEF_LIBPATH) +endif + +ifeq ($(ARCH), SOLARIS) +EXTRA_LIBS=$(GCCLIBS) +endif + +ifeq ($(ARCH), WINNT) +OS_TARGETS= admin libhttpdaemon $(DLLS) +endif + +all: $(OBJDEST) $(OS_TARGETS) $(BINS) $(BSCS) + +include unixso.mk + +ifeq ($(ARCH), HPUX) +comma:=, +#EXTRA_LIBS +=/opt/CC/lib/cxxshl.o +EXTRA_LIBS += $(NSCP_DISTDIR)/lib/libprstrms.$(LIB_SUFFIX) +EXTRA_LIBS := $(subst -E,-E$(comma)+s,$(EXTRA_LIBS)) +EXTRA_OPTS := -Wl,+s,-E +#The extra library below is required to debug shared libraries. +ifeq ($(BUILD_DEBUG), full) +EXTRA_LIBS += /opt/langtools/lib/end.o +endif +# THIS IS A TEMPORARY SOLUTION TO THE HPUX COMPILER LIMITATION. WE +# NEED TO INCLUDE ALL OF THE eh/LIBC object files into our main executable +# to avoid having undefined symbols with plugins. +LIBCARCHIVE = /opt/CC/lib/eh/libC.a +endif + +$(OBJDEST): + mkdir -p $(OBJDEST) + +HTTPD_LIBS=$(FRAME) $(HTTPDAEMON) + +ifeq ($(ARCH), WINNT) +ifeq ($(NO_MOCHA), 1) +MOCHA = +MCC_SERVER += -DNO_MOCHA +else +MOCHA=$(NSCP_DISTDIR)/lib/mocha.lib +endif +OSOBJS = ntmagnus.o ntnsapi.o +HTTPD_LIBS += $(SAFS) $(LIBCRYPT) +FVERSION_FLAGS+=-s$(BUILD_SECURITY) +else +OSOBJS = main.o +endif + +ifneq ($(ARCH), WINNT) +OBJS=$(addprefix $(OBJDEST)/, $(OSOBJS) index.o shtml.o upload.o \ + cookie.o nsconfig.o) +else +EXEOBJS=$(addprefix $(OBJDEST)/, password.res ntmain.o) +OBJS=$(addprefix $(OBJDEST)/, $(OSOBJS) index.o shtml.o upload.o \ + cookie.o nsconfig.o) +endif + +MODULE_CFLAGS= + +# Unixware linker braindamage. The libnspr.so won't override select +# at link time +ifeq ($(ARCH), UNIXWARE) +OBJS+=$(HTTPD_DIR)/obj/uxwrap.o +endif + +ifeq ($(ARCH), NCR) +#OBJS+=$(HTTPD_DIR)/httpd-lib/nspr20/uxwrap.o +endif + +ifdef PRODUCT_IS_DIRECTORY_SERVER +# Primitive NT link process for nshttpd.dll requires httpdaemon + ifeq ($(ARCH), WINNT) + DAEMONLIB=$(OBJDIR)/lib/libhttpdaemon + else + DAEMONLIB= + endif +else + DAEMONLIB=$(OBJDIR)/lib/libhttpdaemon +endif + +ifeq ($(ARCH), WINNT) +# Don't define DEPLIBS for NT because standard macros like LINK_EXE +# and LINK_DLL automatically pick up DEPLIBS which we don't always wan't. +# $(LIBDIRMON) (temporily removed) +DEPLIBS = $(addsuffix .$(LIB_SUFFIX), $(addprefix $(OBJDIR)/lib/lib, $(LIBADMIN) $(LIBLDAPU) $(LIBACCESS) $(HTTPD_LIBS))) \ + $(addsuffix .$(LIB_SUFFIX), $(OBJDIR)/lib/libmsgdisp) +DEPLIBS += $(LIBSECURITY) \ + $(LIBNSPR) \ + $(LIBLDAP) \ + $(LIBDBM) \ + $(ADMINUTIL_DEP) + +DEPLINK = /LIBPATH:$(OBJDIR)/lib $(addsuffix .$(LIB_SUFFIX), $(addprefix lib, $(LIBADMIN) $(LIBLDAPU) $(LIBACCESS) $(HTTPD_LIBS))) \ + libmsgdisp.$(LIB_SUFFIX) $(ADMINUTIL_LINK) $(LDAPLINK) $(SECURITYLINK) \ + $(NSPRLINK) $(DBMLINK) +else +# unixso.mk may define DEPLIBS +ifndef DEPLIBS +DEPLIBS = $(addsuffix .$(LIB_SUFFIX), \ + $(addprefix $(OBJDIR)/lib/lib,$(HTTPD_LIBS)) \ + $(DAEMONLIB) \ + $(OBJDIR)/lib/libaccess \ + $(OBJDIR)/lib/libbase \ + $(OBJDIR)/lib/libsi18n \ + $(OBJDIR)/lib/libmsgdisp) \ + $(LIBSSLIO) +DEPLIBS += $(SECURITY_DEP) \ + $(NSPR_DEP) \ + $(ADMINUTIL_DEP) + +DEPLINK = $(addsuffix .$(LIB_SUFFIX), \ + $(addprefix $(OBJDIR)/lib/lib,$(HTTPD_LIBS)) \ + $(DAEMONLIB) \ + $(OBJDIR)/lib/libaccess \ + $(OBJDIR)/lib/libbase \ + $(OBJDIR)/lib/libsi18n \ + $(OBJDIR)/lib/libmsgdisp) \ + $(SECURITYLINK) \ + $(NSPRLINK) \ + $(LIBSSLIO) \ + $(ADMINUTILLINK) +endif + +endif + +ifndef PRODUCT_IS_DIRECTORY_SERVER +ifeq ($(ARCH), AIX) +ifdef OLD_AIX_LINKING +# why is this redefined here? +CCC = svxlC_r +endif +endif +endif +ifneq ($(ARCH), WINNT) +$(BINS): $(DEPLIBS) $(OBJS) +ifndef PRODUCT_IS_DIRECTORY_SERVER + echo "why are we doing this for directory server?" + cd $(HTTPD_DIR); $(PURIFY) $(CCC) -o ns-httpd $(OBJS) \ + $(EXTRA_OPTS) $(DEPLINK) $(EXTRA_LIBS) +endif # Netscape Directory Server +else # WINNT + +$(MOCHA): + cd $(MCOM_ROOT)/mocha; $(MAKE) export $(NSDEFS) + +$(DLLS): $(OBJS) $(DEPLIBS) $(OBJDEST)/ns-httpd.res + -@echo EXTRA_LIBS = $(EXTRA_LIBS) + $(PURIFY) $(LINK_DLL) $(DEPLINK) $(OBJDEST)/ns-httpd.res $(OBJS) $(EXTRA_LIBS) + cp $(HTTPD_LIB) $(NSCP_DISTDIR)/lib + echo $(DLLS) finished + +$(BINS): $(OBJS) $(EXEOBJS) $(HTTPD_LIB) + rm -f $@ + $(PURIFY) $(LOCAL_LINK_EXE) $(EXEOBJS) $(HTTPD_LIB) + echo $(BINS) finished + +$(NSAPI20): $(HTTPD_LIB) $(OBJDIR)/lib/frame/nsapi20.o + $(PURIFY) $(LINK_DLL) $(LIBNSPR) $(HTTPD_LIB) $(OBJDIR)/lib/frame/nsapi20.o $(EXTRA_LIBS) + +ifeq ($(BSCINFO), yes) +$(BSCS): $(OBJS) + $(BSCMAKE) $(OBJDEST)/*.sbr +endif +endif + + +include $(INCLUDE_DEPENDS) diff --git a/httpd/src/ntnsapi.c b/httpd/src/ntnsapi.c new file mode 100644 index 00000000..33fa7955 --- /dev/null +++ b/httpd/src/ntnsapi.c @@ -0,0 +1,383 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/* + * Aruna Victor + * NT NSAPI works differently from UNIX. The DLL doesn't know the addresses + * of the functions in the server process and needs to be told them. + */ + +#include +extern int upload_file(pblock *pb, Session *sn, Request *rq); + +#ifdef BUILD_DLL + +#include +#include +#include +#include +#include +#if 0 +#ifndef NO_MOCHA +#include +#include +#include +#endif /* NO_MOCHA */ +#endif +#include + +extern char *system_winerr(void); +extern char *system_winsockerr(void); + +VOID NsapiDummy() +{ + int i = 0; + SafTable = (SafFunction **)MALLOC(400 * sizeof(VOID*)); + + /* Force references to libadmin */ + + /* Functions from libadmin:keyconf.c */ + SafTable[i++] = (SafFunction *)get_alias_dir; + /* Functions from libadmin:objconf.c */ + SafTable[i++] = (SafFunction *)get_mag_init; + /* Functions from libadmin:form_post.c */ + SafTable[i++] = (SafFunction *)post_begin; + /* Functions from libadmin:form_get.c */ + SafTable[i++] = (SafFunction *)open_html_file; + /* Functions from libadmin:userdb.c */ +#if 0 + SafTable[i++] = (SafFunction *)detect_db_type; +#endif + /* Functions from libadmin:authdb.c */ + SafTable[i++] = (SafFunction *)list_auth_dbs; + /* Functions from libadmin:error.c */ + SafTable[i++] = (SafFunction *)report_error; + /* Functions from libadmin:template.c */ + SafTable[i++] = (SafFunction *)directive_is; + /* Functions from libaccess:pcontrol.c */ + SafTable[i++] = (SafFunction *)restart_http; + /* Functions from libadmin:admserv.c */ + SafTable[i++] = (SafFunction *)read_server_lst; + /* Functions from libadmin:multconf.c */ + SafTable[i++] = (SafFunction *)make_conflist; + /* Functions from libadmin:password */ + SafTable[i++] = (SafFunction *)pw_enc; + /* Functions from libadmin:cron_conf.c */ +#if 0 + SafTable[i++] = (SafFunction *)cron_conf_create_obj; +#endif + /* Functions from libadmin:dstats.c */ + SafTable[i++] = (SafFunction *)dstats_open; + /* Functions from libadmin:distadm.c */ + SafTable[i++] = (SafFunction *)ADM_InitializePermissions; + +#ifndef NO_MOCHA + /* Force references to mocha */ + /* Functions from mocha:mo_atom.c */ + SafTable[i++] = (SafFunction *)mocha_Atomize; + /* Functions from mocha:mo_fun.c */ + /* SafTable[i++] = (SafFunction *)mocha_NewFunctionObject; */ + /* Functions from mocha:mo_scope.c */ + SafTable[i++] = (SafFunction *)mocha_DefineSymbol; + /* Functions from mocha:mochaapi.c */ + SafTable[i++] = (SafFunction *)MOCHA_CanConvertDatum; +#endif /* NO_MOCHA */ + + /* Force references to base */ + SafTable[i++] = (SafFunction *)fsmutex_init; + + /* Force references to libmsgdisp */ + SafTable[i++] = (SafFunction *)NSORB_Init; + SafTable[i++] = (SafFunction *)ConsumerCreatePush; + SafTable[i++] = (SafFunction *)CMNewBTree; + SafTable[i++] = (SafFunction *)NSObjArrayNew; +} +#endif /* BUILD_DLL */ + +VOID InitializeSafFunctions() +{ + + SafTable = (SafFunction **)MALLOC(400 * sizeof(VOID *)); + +/* Functions from buffer.c */ + + SafTable[FILEBUF_OPEN] = (SafFunction *)filebuf_open; + SafTable[NETBUF_OPEN] = (SafFunction *)netbuf_open; + SafTable[FILEBUF_OPEN_NOSTAT] = (SafFunction *)filebuf_open_nostat; + SafTable[PIPEBUF_OPEN] = (SafFunction *)pipebuf_open; + SafTable[PIPEBUF_CLOSE] = (SafFunction *)pipebuf_close; + SafTable[FILEBUF_OPEN_NOSTAT] = (SafFunction *)filebuf_open_nostat; + SafTable[NETBUF_NEXT] = (SafFunction *)netbuf_next; + SafTable[PIPEBUF_NEXT] = (SafFunction *)pipebuf_next; + SafTable[FILEBUF_CLOSE] = (SafFunction *)filebuf_close; + SafTable[NETBUF_CLOSE] = (SafFunction *)netbuf_close; + SafTable[FILEBUF_GRAB] = (SafFunction *)filebuf_grab; + SafTable[NETBUF_GRAB] = (SafFunction *)netbuf_grab; + SafTable[PIPEBUF_GRAB] = (SafFunction *)pipebuf_grab; + SafTable[NETBUF_BUF2SD] = (SafFunction *)netbuf_buf2sd; + SafTable[FILEBUF_BUF2SD] = (SafFunction *)filebuf_buf2sd; + SafTable[PIPEBUF_BUF2SD] = (SafFunction *)pipebuf_buf2sd; + SafTable[PIPEBUF_NETBUF2SD] = (SafFunction *)pipebuf_netbuf2sd; + +/* Functions from daemon.h */ + SafTable[NTDAEMON_RUN] = (SafFunction *)daemon_run; + SafTable[CHILD_STATUS] = (SafFunction *)child_status; + +/* Functions from file.h */ + SafTable[SYSTEM_STAT] = (SafFunction *)system_stat; + SafTable[SYSTEM_FOPENRO] = (SafFunction *)system_fopenRO; + SafTable[SYSTEM_FOPENWA] = (SafFunction *)system_fopenWA; + SafTable[SYSTEM_FOPENRW] = (SafFunction *)system_fopenRW; + SafTable[SYSTEM_NOCOREDUMPS] = (SafFunction *)system_nocoredumps; + SafTable[SYSTEM_FWRITE] = (SafFunction *)system_fwrite; + SafTable[SYSTEM_FWRITE_ATOMIC] = (SafFunction *)system_fwrite_atomic; + SafTable[SYSTEM_WINERR] = (SafFunction *)system_winerr; + SafTable[SYSTEM_WINSOCKERR] = (SafFunction *)system_winsockerr; + + SafTable[FILE_NOTFOUND] = (SafFunction *)file_notfound; + /* Removed from main code- 9-2-96 + * + SafTable[SYSTEM_INITLOCK] = (SafFunction *)system_initlock;*/ + SafTable[FILE_UNIX2LOCAL] = (SafFunction *)file_unix2local; + SafTable[DIR_OPEN] = (SafFunction *)dir_open; + SafTable[DIR_READ] = (SafFunction *)dir_read; + SafTable[DIR_CLOSE] = (SafFunction *)dir_close; + +/* Functions from cinfo.h */ + SafTable[CINFO_INIT] = (SafFunction *)cinfo_init; + SafTable[CINFO_TERMINATE] = (SafFunction *)cinfo_terminate; + SafTable[CINFO_MERGE] = (SafFunction *)cinfo_merge; + SafTable[CINFO_FIND] = (SafFunction *)cinfo_find; + SafTable[CINFO_LOOKUP] = (SafFunction *)cinfo_lookup; + SafTable[CINFO_DUMP_DATABASE] = (SafFunction *)cinfo_dump_database; + +/* Functions from ereport.h */ + SafTable[EREPORT] = (SafFunction *)ereport ; + SafTable[EREPORT_INIT] = (SafFunction *)ereport_init; + SafTable[EREPORT_TERMINATE] = (SafFunction *)ereport_terminate; + SafTable[EREPORT_GETFD] = (SafFunction *)ereport_getfd; + +#ifdef NET_SSL +/* Functions from minissl.h */ + SafTable[SSL_CLOSE] = (SafFunction *)PR_Close; + SafTable[SSL_SOCKET] = (SafFunction *)PR_NewTCPSocket; + SafTable[SSL_GET_SOCKOPT] = (SafFunction *)PR_GetSocketOption; + SafTable[SSL_SET_SOCKOPT] = (SafFunction *)PR_SetSocketOption; + SafTable[SSL_BIND] = (SafFunction *)PR_Bind; + SafTable[SSL_LISTEN] = (SafFunction *)PR_Listen; + SafTable[SSL_ACCEPT] = (SafFunction *)PR_Accept; + SafTable[SSL_READ] = (SafFunction *)PR_Read; + SafTable[SSL_WRITE] = (SafFunction *)PR_Write; + SafTable[SSL_GETPEERNAME] = (SafFunction *)PR_GetPeerName; +#endif /* NET_SSL */ + + +/* Functions from net.h */ + + SafTable[NET_BIND] = (SafFunction *)net_bind; + SafTable[NET_READ] = (SafFunction *)net_read; + SafTable[NET_WRITE] = (SafFunction *)net_write; + /* SafTable[NET_FIND_FQDN] = (SafFunction *)net_find_fqdn; */ + SafTable[NET_IP2HOST] = (SafFunction *)net_ip2host; + +/* Functions from pblock.h */ + SafTable[PARAM_CREATE] = (SafFunction *)param_create; + SafTable[PARAM_FREE] = (SafFunction *)param_free; + SafTable[PBLOCK_CREATE] = (SafFunction *)pblock_create; + SafTable[PBLOCK_FREE] = (SafFunction *)pblock_free; + SafTable[PBLOCK_FINDVAL] = (SafFunction *)pblock_findval; + SafTable[PBLOCK_NVINSERT] = (SafFunction *)pblock_nvinsert; + SafTable[PBLOCK_NNINSERT] = (SafFunction *)pblock_nninsert; + SafTable[PBLOCK_PINSERT] = (SafFunction *)pblock_pinsert; + SafTable[PBLOCK_STR2PBLOCK] = (SafFunction *)pblock_str2pblock; + SafTable[PBLOCK_PBLOCK2STR] = (SafFunction *)pblock_pblock2str; + SafTable[PBLOCK_COPY] = (SafFunction *)pblock_copy; + SafTable[PBLOCK_PB2ENV] = (SafFunction *)pblock_pb2env; + SafTable[PBLOCK_FR] = (SafFunction *)pblock_fr; + +/* Functions from sem.h */ + SafTable[SEM_INIT] = (SafFunction *)sem_init; + SafTable[SEM_TERMINATE] = (SafFunction *)sem_terminate; + SafTable[SEM_GRAB] = (SafFunction *)sem_grab; + SafTable[SEM_TGRAB] = (SafFunction *)sem_grab; + SafTable[SEM_RELEASE] = (SafFunction *)sem_release; + +/* Functions from session.h */ + SafTable[SESSION_CREATE] = (SafFunction *)session_create; + SafTable[SESSION_FREE] = (SafFunction *)session_free; + SafTable[SESSION_DNS_LOOKUP] = (SafFunction *)session_dns_lookup; + +/* Functions from shexp.h */ + SafTable[SHEXP_VALID] = (SafFunction *)shexp_valid; + SafTable[SHEXP_MATCH] = (SafFunction *)shexp_match; + SafTable[SHEXP_CMP] = (SafFunction *)shexp_cmp; + SafTable[SHEXP_CASECMP] = (SafFunction *)shexp_casecmp; + +/* Functions from systhr.h */ + SafTable[SYSTHREAD_START] = (SafFunction *)systhread_start; + SafTable[SYSTHREAD_ATTACH] = (SafFunction *)systhread_attach; + SafTable[SYSTHREAD_TERMINATE] = (SafFunction *)systhread_terminate; + SafTable[SYSTHREAD_SLEEP] = (SafFunction *)systhread_sleep; + SafTable[SYSTHREAD_INIT] = (SafFunction *)systhread_init; + SafTable[SYSTHREAD_NEWKEY] = (SafFunction *)systhread_newkey; + SafTable[SYSTHREAD_GETDATA] = (SafFunction *)systhread_getdata; + SafTable[SYSTHREAD_SETDATA] = (SafFunction *)systhread_setdata; + +/* Functions from shmem.h */ + SafTable[SHMEM_ALLOC] = (SafFunction *)shmem_alloc; + SafTable[SHMEM_FREE] = (SafFunction *)shmem_free; + +/* Functions from systems.h */ + SafTable[UTIL_STRCASECMP] = (SafFunction *)util_strcasecmp; + SafTable[UTIL_STRNCASECMP] = (SafFunction *)util_strncasecmp; + +/* Functions from util.h */ + SafTable[UTIL_GETLINE] = (SafFunction *)util_getline; + SafTable[UTIL_ENV_CREATE] = (SafFunction *)util_env_create; + SafTable[UTIL_ENV_STR] = (SafFunction *)util_env_str; +#if 0 + /* Removed from ntcgi.c --- obsolete; MB 1-26-96 */ + SafTable[NTUTIL_ENV_STR] = (SafFunction *)ntutil_env_str; +#endif + SafTable[UTIL_ENV_REPLACE] = (SafFunction *)util_env_replace; + SafTable[UTIL_ENV_FREE] = (SafFunction *)util_env_free; + SafTable[UTIL_ENV_FIND] = (SafFunction *)util_env_find; + SafTable[UTIL_HOSTNAME] = (SafFunction *)util_hostname; + SafTable[UTIL_CHDIR2PATH] = (SafFunction *)util_chdir2path; + SafTable[UTIL_IS_MOZILLA] = (SafFunction *)util_is_mozilla; + SafTable[UTIL_IS_URL] = (SafFunction *)util_is_url; + SafTable[UTIL_LATER_THAN] = (SafFunction *)util_later_than; + SafTable[UTIL_URI_IS_EVIL] = (SafFunction *)util_uri_is_evil; + SafTable[UTIL_URI_PARSE] = (SafFunction *)util_uri_parse; + SafTable[UTIL_URI_UNESCAPE] = (SafFunction *)util_uri_unescape; + SafTable[UTIL_URI_ESCAPE] = (SafFunction *)util_uri_escape; + SafTable[UTIL_URL_ESCAPE] = (SafFunction *)util_url_escape; + SafTable[UTIL_SH_ESCAPE] = (SafFunction *)util_sh_escape; + SafTable[UTIL_ITOA] = (SafFunction *)util_itoa; + SafTable[UTIL_VSPRINTF] = (SafFunction *)util_vsprintf; + SafTable[UTIL_SPRINTF] = (SafFunction *)util_sprintf; + SafTable[UTIL_VSNPRINTF] = (SafFunction *)util_vsnprintf; + SafTable[UTIL_SNPRINTF] = (SafFunction *)util_snprintf; + +// SafTable[INITIALIZE_ADMIN_LOGGING] = (SafFunction *)InitializeAdminLogging; +// SafTable[INITIALIZE_HTTPD_LOGGING] = (SafFunction *)InitializeHttpdLogging; +// SafTable[TERMINATE_ADMIN_LOGGING] = (SafFunction *)TerminateAdminLogging; +// SafTable[TERMINATE_HTTPD_LOGGING] = (SafFunction *)TerminateHttpdLogging; + + SafTable[LOG_ERROR_EVENT] = (SafFunction *)LogErrorEvent; + +/* Functions from conf.h */ + SafTable[CONF_INIT] = (SafFunction *)conf_init; + SafTable[CONF_TERMINATE] = (SafFunction *)conf_terminate; + SafTable[CONF_GETGLOBALS] = (SafFunction *)conf_getglobals; + SafTable[CONF_VARS2DAEMON] = (SafFunction *)conf_vars2daemon; + + SafTable[FUNC_INIT] = (SafFunction *)func_init; + SafTable[FUNC_FIND] = (SafFunction *)func_find; + SafTable[FUNC_EXEC] = (SafFunction *)func_exec; + SafTable[FUNC_INSERT] = (SafFunction *)func_insert; + SafTable[HTTP_SCAN_HEADERS] = (SafFunction *)http_scan_headers; + SafTable[HTTP_START_RESPONSE] = (SafFunction *)http_start_response; + SafTable[HTTP_HDRS2_ENV] = (SafFunction *)http_hdrs2env; + SafTable[HTTP_STATUS] = (SafFunction *)http_status; + SafTable[HTTP_SET_FINFO] = (SafFunction *)http_set_finfo; + SafTable[HTTP_DUMP822] = (SafFunction *)http_dump822; + SafTable[HTTP_FINISH_REQUEST] = (SafFunction *)http_finish_request; + SafTable[HTTP_HANDLE_SESSION] = (SafFunction *)http_handle_session; + SafTable[HTTP_URI2URL] = (SafFunction *)http_uri2url; + +/* Functions from log.h */ + SafTable[LOG_ERROR] = (SafFunction *)log_error; + SafTable[DIRECTIVE_NAME2NUM] = (SafFunction *)directive_name2num; + SafTable[DIRECTIVE_NUM2NAME] = (SafFunction *)directive_num2name; + SafTable[OBJECT_CREATE] = (SafFunction *)object_create; + SafTable[OBJECT_FREE] = (SafFunction *)object_free; + SafTable[OBJECT_ADD_DIRECTIVE] = (SafFunction *)object_add_directive; + SafTable[OBJECT_EXECUTE] = (SafFunction *)object_execute; + SafTable[OBJSET_SCAN_BUFFER] = (SafFunction *)objset_scan_buffer; + SafTable[OBJSET_FREE] = (SafFunction *)objset_free; + SafTable[OBJSET_FREE_SETONLY] = (SafFunction *)objset_free_setonly; + SafTable[OBJSET_NEW_OBJECT] = (SafFunction *)objset_new_object; + SafTable[OBJSET_ADD_OBJECT] = (SafFunction *)objset_add_object; + SafTable[OBJSET_FINDBYNAME] = (SafFunction *)objset_findbyname; + SafTable[OBJSET_FINDBYPPATH] = (SafFunction *)objset_findbyppath; + + SafTable[REQUEST_CREATE] = (SafFunction *)request_create; + SafTable[REQUEST_FREE] = (SafFunction *)request_free; + SafTable[REQUEST_RESTART_INTERNAL] = (SafFunction *)request_restart_internal; + SafTable[REQUEST_TRANSLATE_URI] = (SafFunction *)request_translate_uri; + SafTable[REQUEST_HEADER] = (SafFunction *)request_header; + SafTable[REQUEST_STAT_PATH] = (SafFunction *)request_stat_path; + + /* temporarily remove definitions till they are added into the header file. */ + SafTable[REQUEST_HANDLE_PROCESSED] = (SafFunction *)request_handle_processed; + + SafTable[MAGNUS_ATRESTART] = (SafFunction *)magnus_atrestart; + + SafTable[SYSTEM_FOPENWT] = (SafFunction *)system_fopenWT; + SafTable[SYSTEM_MALLOC] = (SafFunction *)system_malloc; + SafTable[SYSTEM_FREE] = (SafFunction *)system_free; + SafTable[SYSTEM_REALLOC] = (SafFunction *)system_realloc; + SafTable[SYSTEM_STRDUP] = (SafFunction *)system_strdup; + + SafTable[UPLOAD_FILE] = (SafFunction *)upload_file; + + SafTable[CRIT_INIT] = (SafFunction *)crit_init; + SafTable[CRIT_ENTER] = (SafFunction *)crit_enter; + SafTable[CRIT_EXIT] = (SafFunction *)crit_exit; + SafTable[CRIT_TERMINATE] = (SafFunction *)crit_terminate; + SafTable[SYSTHREAD_CURRENT] = (SafFunction *)systhread_current; + + SafTable[NET_ACCEPT] = (SafFunction *)net_accept; + SafTable[NET_CLOSE] = (SafFunction *)net_close; + SafTable[NET_CONNECT] = (SafFunction *)net_connect; + SafTable[NET_IOCTL] = (SafFunction *)net_ioctl; + SafTable[NET_LISTEN] = (SafFunction *)net_listen; + SafTable[NET_SETSOCKOPT] = (SafFunction *)net_setsockopt; + SafTable[NET_SOCKET] = (SafFunction *)net_socket; + + + /* msgdisp functions */ + SafTable[NSORB_INIT] = (SafFunction *)NSORB_Init; + SafTable[NSORB_INST_ID] = (SafFunction *)NSORB_InstanceID; + SafTable[NSORB_GET_INST] = (SafFunction *)NSORB_GetInstance; + SafTable[NSORB_REG_INT] = (SafFunction *)NSORB_RegisterInterface; + SafTable[NSORB_FIND_OBJ] = (SafFunction *)NSORB_FindObject; + SafTable[NSORB_GET_INTERFACE] = (SafFunction *)NSORB_GetInterface; + + SafTable[ARR_NEW] = (SafFunction *)NSObjArrayNew; + SafTable[ARR_FREE] = (SafFunction *)NSObjArrayFree; + SafTable[ARR_GET_OBJ] = (SafFunction *)NSObjArrayGetObj; + SafTable[ARR_GET_LAST_OBJ] = (SafFunction *)NSObjArrayGetLastObj; + SafTable[ARR_NEW_OBJ] = (SafFunction *)NSObjArrayNewObj; + SafTable[ARR_GET_NUM_OBJ] = (SafFunction *)NSObjArrayGetNumObj; + SafTable[ARR_RESET] = (SafFunction *)NSObjArrayReset; + SafTable[ARR_REMOVEOBJ] = (SafFunction *)NSObjArrayRemoveObj; + SafTable[ARR_GET_OBJ_NUM] = (SafFunction *)NSObjArrayGetObjNum; + + SafTable[CM_BT_NEW] = (SafFunction *)CMNewBTree; + SafTable[CM_BT_ADD_NODE] = (SafFunction *)CMBTreeAddNode; + SafTable[CM_BT_FIND_NODE] = (SafFunction *)CMBTreeFindNode; + SafTable[CM_BT_DEL_NODE] = (SafFunction *)CMBTreeDeleteNode; + SafTable[CM_BT_DESTROY] = (SafFunction *)CMBTreeDestroy; + SafTable[CM_BT_GET_NUM] = (SafFunction *)CMBTreeGetNumNode; + SafTable[CM_BT_TRAVEL] = (SafFunction *)CMBTreeInorderTravel; + + SafTable[CM_STR_NEW] = (SafFunction *)NewCMStrObj; + SafTable[CM_STR_ADD] = (SafFunction *)CMStrObjAdd; + SafTable[CM_STR_REL] = (SafFunction *)CMStrObjRelease; + SafTable[CM_STR_FREE] = (SafFunction *)CMStrObjFree; + SafTable[CM_STR_GET] = (SafFunction *)CMStrObjGetString; + SafTable[CM_STR_SIZE] = (SafFunction *)CMStrObjGetSize; + SafTable[CM_COPY_STR] = (SafFunction *)CMCopyString; + SafTable[CM_MAKE_UID] = (SafFunction *)MakeUID; + + SafTable[MS_NEW] = (SafFunction *)ConsumerNewPush; + SafTable[MS_CREATE] = (SafFunction *)ConsumerCreatePush; + + + +} + diff --git a/httpd/src/unixso.exp b/httpd/src/unixso.exp new file mode 100644 index 00000000..55aae332 --- /dev/null +++ b/httpd/src/unixso.exp @@ -0,0 +1,38 @@ +acl_write_rights +acl_read_rights +SEC_ERROR_INVALID_AVA +SEC_ERROR_INPUT_LEN +SEC_ERROR_BAD_KEY +SEC_ERROR_EXPIRED_CERTIFICATE +SSL_ERROR_BAD_CERT_DOMAIN +SEC_ERROR_UNTRUSTED_CERT +SEC_ERROR_UNKNOWN_ISSUER +SEC_ERROR_BAD_SIGNATURE +SEC_ERROR_IO +SEC_ERROR_INVALID_TIME +XP_ERRNO_EWOULDBLOCK +XP_ERRNO_EAGAIN +pr_fdTable +XP_ERRNO_EIO +XP_ERRNO_EISCONN +XP_ERRNO_EINVAL +XP_ERRNO_EBADF +XP_ERRNO_ECONNREFUSED +SSL_ERROR_US_ONLY_SERVER +SSL_ERROR_EXPORT_ONLY_SERVER +SSL_ERROR_BAD_CERTIFICATE +SSL_ERROR_UNSUPPORTED_CERTIFICATE_TYPE +SSL_ERROR_NO_CERTIFICATE +SSL_ERROR_UNSUPPORTED_VERSION +SSL_ERROR_NO_CYPHER_OVERLAP +SSL_ERROR_BAD_SERVER +SSL_ERROR_BAD_CLIENT +SEC_ERROR_OUTPUT_LEN +SEC_ERROR_INVALID_ARGS +SEC_ERROR_BAD_DATA +SEC_ERROR_NO_MEMORY +SEC_ERROR_BAD_DATABASE +SEC_ERROR_BAD_DER +SEC_ERROR_INVALID_ALGORITHM +SEC_ERROR_LIBRARY_FAILURE +SEC_ERROR_BAD_PASSWORD diff --git a/httpd/src/unixso.mk b/httpd/src/unixso.mk new file mode 100644 index 00000000..e60e0226 --- /dev/null +++ b/httpd/src/unixso.mk @@ -0,0 +1,246 @@ +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +LIBSECDIR=$(MCOM_ROOT)/lib/libsec/$(NSOBJDIR_NAME) + +ifneq ($(ARCH), WINNT) + +SRCDIR=$(MCOM_ROOT)/ldapserver/httpd/src + +AR = ar + +ifeq ($(ARCH), OSF1) +DLL_LDFLAGS += -soname $(SONAME) +EXTRA_LIBS += -Wl,-rpath,.:../../lib:../../bin/https:../../plugins/java/bin:../../wai/lib +ADM_EXTRA = -lcxx -lpthread -lmach -lexc -lc +AR = rm -f ________64ELEL_ ; ar +endif + +ifeq ($(ARCH), IRIX) +DLL_LDFLAGS += -soname $(SONAME) +ifeq ($(USE_N32), 1) + DLL_LDFLAGS += -n32 -mips3 +endif +EXTRA_LIBS += -rpath .:../../lib:../../bin/https:../../plugins/java/bin:../wai/lib +# IRIX likes it twice! +SOLINK2=$(SOLINK) +endif + +ifeq ($(ARCH), SOLARIS) +DLL_LDFLAGS += -h $(SONAME) +EXTRA_LIBS += -R .:../../lib:../../bin/https:../../plugins/java/bin:../wai/lib +ADM_EXTRA = $(GCCLIB) +endif + +ifdef USE_LD_RUN_PATH +EXTRA_LIBS += -L. +export LD_RUN_PATH=./.:../../lib:../../bin/https:../../plugins/java/bin:../wai/lib +endif + +ifeq ($(ARCH), SONY) +DLL_LDFLAGS += -soname $(SONAME) +EXTRA_LIBS += -rpath . +endif + +ifeq ($(ARCH), NEC) +DLL_LDFLAGS += -h $(SONAME) +endif + +ifeq ($(ARCH), HPUX) +DLL_LDFLAGS += -L. +SOLINK=-L. -l$(HTTPDSO_NAME)$(DLL_PRESUF) +EXTRA_LIBS += -Wl,+b.:../../lib:../../bin/https:../../plugins/java/bin:../wai/lib +# The line below is required for LiveWire DB2 to work. +EXTRA_LIBS += -Wl,-uallow_unaligned_data_access -lhppa +LD=$(CCC) +# Well HPUX's not happy about including libnspr.sl(-lnspr) into our executable, +# it's that ___ +eh again. +NSPRLINK=$(NOTHING) +#LDAPLINK=-L. $(addsuffix .a, $(addprefix lib, $(LDAP_DOTALIB_NAMES))) \ +# $(addprefix -l, $(LDAP_SOLIB_NAMES)) +endif + +ifeq ($(ARCH), AIX) +MKSHLIB_FLAGS += -berok -brtl +SOLINK=-L. -L../../lib -lns-dshttpd$(DLL_PRESUF) +LIBSECDIR=$(MCOM_ROOT)/lib/libsec/$(NSOBJDIR_NAME) +#LDAPLINK=-L. $(addsuffix .a, $(addprefix lib, $(LDAP_DOTALIB_NAMES))) \ +# $(addprefix -l, $(LDAP_SOLIB_NAMES)) +#NSPRLINK = -L. -lnspr$(DLL_PRESUF) +#NSPRLINK = -L. -ldsnspr$(DLL_PRESUF) +ADM_EXTRA := -L. -L../../lib $(LDAPLINK) $(NSPRLINK) $(EXTRA_LIBS) +#ADM_EXTRA := -L. -L../../lib $(LDAPLINK) $(NSPRLINK) $(EXTRA_LIBS) -L$(LIBSECDIR) -lsec-$(WHICHA) +ifdef FORTEZZA +ADM_EXTRA += $(NSCP_DISTDIR)/lib/libci.$(LIB_SUFFIX) +endif +DEF_LIBPATH := .:../../lib:$(DEF_LIBPATH) +endif + +ifeq ($(ARCH), SUNOS4) +EXTRA_LIBS += -L. +ADM_EXTRA = $(EXTRA_LIBS) +endif + +ifeq ($(ARCH), UnixWare) +DLL_LDFLAGS += -h $(SONAME) +NSPRLINK = -L. -ldsnspr$(DLL_PRESUF) +endif + +EXTRA_LIBS += $(MATHLIB) + +ifndef SONAME +SONAME=$(HTTPDSO_NAME)$(DLL_PRESUF).$(DLL_SUFFIX) +endif + +ifndef SOLINK +SOLINK=./$(HTTPDSO_NAME)$(DLL_PRESUF).$(DLL_SUFFIX) +endif + +#ifndef LDAPLINK +#LDAPLINK=$(LDAPOBJNAME) +#endif + +ifndef NSPRLINK +NSPRLINK=libnspr$(DLL_PRESUF).$(DLL_SUFFIX) +endif + +# Temporary directory for the libraries and their object files +$(OBJDIR)/httpd-lib: +ifeq ($(ARCH), HPUX) + mkdir -p $(OBJDIR)/httpd-lib/nspr20 +endif + mkdir -p $(OBJDIR)/httpd-lib/sslio + mkdir -p $(OBJDIR)/httpd-lib/arlib + mkdir -p $(OBJDIR)/httpd-lib/mocha + mkdir -p $(OBJDIR)/httpd-lib/libsec + mkdir -p $(OBJDIR)/httpd-lib/libdbm + mkdir -p $(OBJDIR)/httpd-lib/xp + +# Define a LIBSEC which doesn't include libdbm and xp. +LIBSECNAME=$(MCOM_LIBDIR)/libsec/$(NSOBJDIR_NAME)/libsec-$(WHICHA).$(LIB_SUFFIX) +ifndef LIBSECOBJS +LIBSEC1=$(LIBSECNAME) +else +LIBSEC1=$(LIBSECOBJS) +endif + +ifdef PRODUCT_IS_DIRECTORY_SERVER + DAEMONLIB= +else + DAEMONLIB=$(OBJDIR)/lib/libhttpdaemon.a +endif + +DEPLIBS = ${DAEMONLIB} $(OBJDIR)/lib/libsi18n.a $(ADMLIB) $(LDAPSDK_DEP) + +ifdef FORTEZZA +LIBSEC1 += $(NSCP_DISTDIR)/lib/libci.$(LIB_SUFFIX) +endif + +DEPLINK = ${DAEMONLIB} $(OBJDIR)/lib/libsi18n.a +ifneq ($(BUILD_MODULE), HTTP_PERSONAL) +DEPLINK += $(OBJDIR)/lib/libmsgdisp.a +endif +DEPLINK += $(SOLINK) $(LDAPLINK) $(NSPRLINK) $(SOLINK2) + +# Relative to the directory that contains the .so +BUILTDIR = . + +ifndef NO_VERITY + +ifeq ($(DO_SEARCH), yes) +ifdef VERITY_TASKSTUB +TASKSTUB = ./taskstub.o +else +TASKSTUB = +endif + +ifndef VERITY_SOLINK +VERITY_SOLINK=$(TASKSTUB) -L. $(addprefix -l, $(VERITY_LIBNAMES)) +endif + +VERITYDEP=$(addprefix $(OBJDIR)/, $(VERITYOBJNAMES) $(TASKSTUB)) + +$(VERITYDEP) : $(LIBVERITY) + cp $(LIBVERITY) $(VERITY_TASKSTUB) $(OBJDIR) + +DEPLINK += $(VERITY_SOLINK) +DEPLIBS += $(VERITYDEP) +endif + +endif + +SERVLIBS = $(addprefix $(OBJDIR)/lib/, libadmin.a libframe.a libaccess.a \ + libldapu.a libbase.a libsi18n.a) +SERVLIB_DIRS = $(addprefix $(OBJDIR)/lib/, libadmin frame libaccess base \ + ldaputil libmsgdisp libsi18n) +SERVLIB_OBJS = $(subst $(OBJDIR)/,$(BUILTDIR)/, \ + $(filter-out $(OBJDIR)/lib/libadmin/nsnews.o, \ + $(wildcard $(addsuffix /*.o, $(SERVLIB_DIRS))))) + +MOCHA=$(NSCP_DISTDIR)/lib/mocha.a + +# Removed for ns-security integration +#NSLIBS = $(SECLIB) $(LIBSSLIO) + +ADMLIB_LIBS = $(SERVLIBS) $(NSLIBS) + +mocha: + cd $(MCOM_ROOT)/mocha; $(MAKE) export $(NSDEFS) + + +admobjs: +ifeq ($(ARCH), HPUX) + cd $(OBJDIR)/httpd-lib/nspr20; $(AR) x $(LIBNSPR) +endif + cd $(OBJDIR)/httpd-lib/sslio; $(AR) x $(LIBSSLIO) +ifndef NSPR20 + cd $(OBJDIR)/httpd-lib/mocha; $(AR) x $(MOCHA) +endif + cd $(OBJDIR)/httpd-lib/libdbm; $(AR) x $(LIBDBM) + cd $(OBJDIR)/httpd-lib/xp; $(AR) x $(LIBXP) + cd $(OBJDIR)/httpd-lib/libdbm; $(AR) x $(LIBDBM) + cd $(OBJDIR)/httpd-lib/xp; $(AR) x $(LIBXP) + rm -f $(addprefix $(OBJDIR)/httpd-lib/xp/, xp_time.o xplocale.o \ + xp_cntxt.o) + +#$(LDAPOBJNAME): ldapobjs + +#ldapobjs: +# (cd $(OBJDIR); rm -f $(LDAPOBJNAME)) +# cp $(LIBLDAP) $(OBJDIR) + +# Removed for ns-security integration. +#OBJRULES += ldapobjs + +# Removed the httpd-lib from link for ns-security integration. +#ADMOBJS=$(SERVLIB_OBJS) $(BUILTDIR)/httpd-lib/*/*.o +#OBJRULES += admobjs +ADMLIB=$(OBJDIR)/$(SONAME) + +$(ADMLIB): $(ADMLIB_LIBS) +ifeq ($(ARCH), IRIX) + ifeq ($(USE_N32), 1) # no -objectlist any more + cd $(OBJDIR) ; \ + $(LINK_DLL) \ + $(SERVLIB_OBJS) $(ADM_EXTRA) + else + echo "$(SERVLIB_OBJS)" > /tmp/objectlist + tr ' ' '\012' < /tmp/objectlist > /tmp/objectlist.NEW + mv /tmp/objectlist.NEW /tmp/objectlist + cd $(OBJDIR) ; \ + $(LINK_DLL) \ + -objectlist /tmp/objectlist $(ADM_EXTRA) + rm /tmp/objectlist + endif +else + cd $(OBJDIR) ; \ + $(LINK_DLL) \ + $(SERVLIB_OBJS) $(ADM_EXTRA) +endif + + +endif diff --git a/include/Makefile b/include/Makefile new file mode 100644 index 00000000..40e9f063 --- /dev/null +++ b/include/Makefile @@ -0,0 +1,85 @@ +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# Makefile for netsite.h + +MCOM_ROOT = ../.. +MODULE=netsiteInclude + +include ../nsdefs.mk + +HDRDEST=$(OBJDIR)/include + +NSPRDEST=$(HDRDEST) +NSPRHDRS= \ + prio.h \ + prlong.h \ + prtypes.h \ + prtime.h \ + prthread.h \ + prinrval.h \ + md/prcpucfg.h \ + obsolete/protypes.h + +NSPRBINS=$(addprefix $(NSPRDEST)/, $(NSPRHDRS)) + +PREFIX=copyrght.h + + +NOSTDSTRIP=true +NOSTDDEPEND=true + +HDRS=netsite.h version.h + +BINS=$(addprefix $(HDRDEST)/,$(HDRS)) + +all: stuff nspr + +strip: +depend: + +include ../nsconfig.mk + +ifeq ($(NSAPI_CAPABLE), true) + +stuff: $(HDRDEST) $(BINS) sub-hdrs + +$(HDRDEST): + mkdir -p $(HDRDEST) + +ifeq ($(PRODUCT), "Netscape Proxy Server") +sub-hdrs: + cd base; gmake + cd frame; gmake + cd libproxy; gmake +else +sub-hdrs: + cd base; gmake + cd frame; gmake +endif + +$(HDRDEST)/%.h: %.h + cat $(PREFIX) $< > $(HDRDEST)/$*.h + +else +stuff: + +endif + +$(NSPRDEST): + mkdir -p $(NSPRDEST) + +$(NSPRDEST)/md: $(NSPRDEST) + mkdir -p $(NSPRDEST)/md + +$(NSPRDEST)/obsolete: $(NSPRDEST) + mkdir -p $(NSPRDEST)/obsolete + +$(NSPRDEST)/%.h: + cp $(NSCP_DISTDIR)/include/nspr20/pr/$*.h $(NSPRDEST)/$*.h + +nspr: $(NSPRDEST)/md $(NSPRDEST)/obsolete $(NSPRBINS) diff --git a/include/base/Makefile b/include/base/Makefile new file mode 100644 index 00000000..9f2f6a35 --- /dev/null +++ b/include/base/Makefile @@ -0,0 +1,40 @@ +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# Makefile for netsite.h + +MCOM_ROOT = ../../.. +MODULE=netsiteIncludeBase + +include ../../nsdefs.mk + +HDRDEST=$(OBJDIR)/include/base + +PREFIX=../copyrght.h + + +NOSTDSTRIP=true +NOSTDDEPEND=true + +#HDRS=$(wildcard *.h) +HDRS=daemon.h cinfo.h crit.h ereport.h buffer.h net.h pblock.h sem.h session.h shexp.h shmem.h systhr.h util.h file.h pool.h regexp.h systems.h + + +BINS=$(addprefix $(HDRDEST)/,$(HDRS)) + +all: $(HDRDEST) $(BINS) + +$(HDRDEST): + mkdir -p $(HDRDEST) + +strip: +depend: + +include ../../nsconfig.mk + +$(HDRDEST)/%.h: %.h + cat $(PREFIX) $< > $(HDRDEST)/$*.h diff --git a/include/base/crit.h b/include/base/crit.h new file mode 100644 index 00000000..1ff7e957 --- /dev/null +++ b/include/base/crit.h @@ -0,0 +1,209 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef BASE_CRIT_H +#define BASE_CRIT_H + +#ifndef NOINTNSAPI +#define INTNSAPI +#endif /* !NOINTNSAPI */ + +/* + * crit.h: Critical section abstraction. Used in threaded servers to protect + * areas where two threads can interfere with each other. + * + * Condvars are condition variables that are used for thread-thread + * synchronization. + * + * Rob McCool + */ + +#ifndef NETSITE_H +#include "netsite.h" +#endif /* !NETSITE_H */ + +/* Define C interface */ +#ifndef PUBLIC_BASE_CRIT_H +#include "public/base/crit.h" +#endif /* !PUBLIC_BASE_CRIT_H */ + +/* Define C++ interface */ +#ifdef __cplusplus + +#ifndef BASE_NSASSERT_H +#include "nsassert.h" +#endif /* !BASE_NSASSERT_H */ + +#ifndef prmon_h___ +#include "prmon.h" +#endif /* !prmon_h___ */ + +class NSAPI_PUBLIC CriticalSection +{ +public: + CriticalSection(); + ~CriticalSection(); + void Acquire(){PR_EnterMonitor(_crtsec);} + void Release(){PR_ExitMonitor(_crtsec);} + +private: + PRMonitor *_crtsec; +}; + +inline CriticalSection::CriticalSection():_crtsec(0) +{ + _crtsec = PR_NewMonitor(); + NS_ASSERT(_crtsec); +} + +inline CriticalSection::~CriticalSection() +{ + if (_crtsec) + PR_DestroyMonitor(_crtsec); +} + +class SafeLock { + public: + SafeLock (CriticalSection&); // acquire lock + ~SafeLock (); // release lock + private: + CriticalSection& lock; +}; + +inline SafeLock::SafeLock (CriticalSection& _lock) : lock(_lock) +{ + lock.Acquire(); +} + +inline SafeLock::~SafeLock () +{ + lock.Release(); +} +#endif /* __cplusplus */ + +/* --- Begin function prototypes --- */ + +#ifdef INTNSAPI + +NSPR_BEGIN_EXTERN_C + +/* ASSERT function only */ +NSAPI_PUBLIC int crit_owner_is_me(CRITICAL id); + +/* + * INTcrit_init creates and returns a new critical section variable. At the + * time of creation no one has entered it. + */ +NSAPI_PUBLIC CRITICAL INTcrit_init(void); + +/* + * INTcrit_enter enters a critical section. If someone is already in the + * section, the calling thread is blocked until that thread exits. + */ +NSAPI_PUBLIC void INTcrit_enter(CRITICAL id); + + +/* + * INTcrit_exit exits a critical section. If another thread is blocked waiting + * to enter, it will be unblocked and given ownership of the section. + */ +NSAPI_PUBLIC void INTcrit_exit(CRITICAL id); + + +/* + * INTcrit_terminate removes a previously allocated critical section variable. + */ +NSAPI_PUBLIC void INTcrit_terminate(CRITICAL id); + + +/* + * INTcondvar_init initializes and returns a new condition variable. You + * must provide a critical section to be associated with this condition + * variable. + */ +NSAPI_PUBLIC CONDVAR INTcondvar_init(CRITICAL id); + + +/* + * INTcondvar_wait blocks on the given condition variable. The calling thread + * will be blocked until another thread calls INTcondvar_notify on this variable. + * The caller must have entered the critical section associated with this + * condition variable prior to waiting for it. + */ +NSAPI_PUBLIC void INTcondvar_wait(CONDVAR cv); +NSAPI_PUBLIC void condvar_timed_wait(CONDVAR _cv, long secs); + + +/* + * INTcondvar_notify awakens any threads blocked on the given condition + * variable. The caller must have entered the critical section associated + * with this variable first. + */ +NSAPI_PUBLIC void INTcondvar_notify(CONDVAR cv); + +/* + * INTcondvar_notifyAll awakens all threads blocked on the given condition + * variable. The caller must have entered the critical section associated + * with this variable first. + */ +NSAPI_PUBLIC void INTcondvar_notifyAll(CONDVAR cv); + +/* + * INTcondvar_terminate frees the given previously allocated condition variable + */ +NSAPI_PUBLIC void INTcondvar_terminate(CONDVAR cv); + + +/* + * Create a counting semaphore. + * Return non-zero on success, 0 on failure. + */ +NSAPI_PUBLIC COUNTING_SEMAPHORE INTcs_init(int initial_count); + +/* + * Destroy a counting semaphore + */ +NSAPI_PUBLIC void INTcs_terminate(COUNTING_SEMAPHORE csp); + +/* + * Wait to "enter" the semaphore. + * Return 0 on success, -1 on failure. + */ +NSAPI_PUBLIC int INTcs_wait(COUNTING_SEMAPHORE csp); + +/* + * Enter the semaphore if the count is > 0. Otherwise return -1. + * + */ +NSAPI_PUBLIC int INTcs_trywait(COUNTING_SEMAPHORE csp); + +/* + * Release the semaphore- allowing a thread to enter. + * Return 0 on success, -1 on failure. + */ +NSAPI_PUBLIC int INTcs_release(COUNTING_SEMAPHORE csp); + +NSPR_END_EXTERN_C + +/* --- End function prototypes --- */ + +#define crit_init INTcrit_init +#define crit_enter INTcrit_enter +#define crit_exit INTcrit_exit +#define crit_terminate INTcrit_terminate +#define condvar_init INTcondvar_init +#define condvar_wait INTcondvar_wait +#define condvar_notify INTcondvar_notify +#define condvar_notifyAll INTcondvar_notifyAll +#define condvar_terminate INTcondvar_terminate +#define cs_init INTcs_init +#define cs_terminate INTcs_terminate +#define cs_wait INTcs_wait +#define cs_trywait INTcs_trywait +#define cs_release INTcs_release + +#endif /* INTNSAPI */ + +#endif /* !BASE_CRIT_H */ diff --git a/include/base/dbtbase.h b/include/base/dbtbase.h new file mode 100644 index 00000000..5f30d374 --- /dev/null +++ b/include/base/dbtbase.h @@ -0,0 +1,217 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ + +#define LIBRARY_NAME "base" + +static char dbtbaseid[] = "$DBT: base referenced v1 $"; + +#include "i18n.h" + +BEGIN_STR(base) + ResDef( DBT_LibraryID_, -1, dbtbaseid )/* extracted from dbtbase.h*/ + ResDef( DBT_insufficientMemoryToCreateHashTa_, 1, "insufficient memory to create hash table" )/*extracted from cache.cpp*/ + ResDef( DBT_insufficientMemoryToCreateHashTa_1, 2, "insufficient memory to create hash table" )/*extracted from cache.cpp*/ + ResDef( DBT_cacheDestroyCacheTablesAppearCor_, 3, "cache_destroy: cache tables appear corrupt." )/*extracted from cache.cpp*/ + ResDef( DBT_unableToAllocateHashEntry_, 4, "unable to allocate hash entry" )/*extracted from cache.cpp*/ + ResDef( DBT_cacheInsertUnableToCreateCacheEn_, 5, "cache_insert: unable to create cache entry" )/*extracted from cache.cpp*/ + ResDef( DBT_http10200OkNcontentTypeTextHtmlN_, 6, "HTTP/1.0 200 OK\nContent-type: text/html\n\n" )/*extracted from cache.cpp*/ + ResDef( DBT_H2NetscapeCacheStatusReportH2N_, 7, "

Netscape cache status report

\n" )/*extracted from cache.cpp*/ + ResDef( DBT_noCachesOnSystemP_, 8, "No caches on system

" )/*extracted from cache.cpp*/ + ResDef( DBT_H2SCacheH2N_, 9, "

%s cache

\n" )/*extracted from cache.cpp*/ + ResDef( DBT_cacheHitRatioDDFPNPN_, 10, "Cache hit ratio: %d/%d (%f)

\n

\n" )/*extracted from cache.cpp*/ + ResDef( DBT_cacheSizeDDPNPN_, 11, "Cache size: %d/%d

\n

\n" )/*extracted from cache.cpp*/ + ResDef( DBT_hashTableSizeDPNPN_, 12, "Hash table size: %d

\n

\n" )/*extracted from cache.cpp*/ + ResDef( DBT_mruDPNlruDPN_, 13, "mru : %d

\nlru : %d

\n" )/*extracted from cache.cpp*/ + ResDef( DBT_UlTableBorder4ThBucketThThAddres_, 14, "
    \n" )/*extracted from cache.cpp*/ + ResDef( DBT_munmapFailedS_, 15, "munmap failed (%s)" )/*extracted from buffer.cpp*/ + ResDef( DBT_munmapFailedS_1, 16, "munmap failed (%s)" )/*extracted from buffer.cpp*/ + ResDef( DBT_closeFailedS_, 17, "close failed (%s)" )/*extracted from buffer.cpp*/ + ResDef( DBT_daemonUnableToForkNewProcessSN_, 18, "daemon: unable to fork new process (%s)\n" )/*extracted from daemon.cpp*/ + ResDef( DBT_daemonSetsidFailedSN_, 19, "daemon: setsid failed (%s)\n" )/*extracted from daemon.cpp*/ + ResDef( DBT_daemonCanTLogPidToSSN_, 20, "daemon: can't log pid to %s (%s)\n" )/*extracted from daemon.cpp*/ + ResDef( DBT_warningCouldNotSetGroupIdToDSN_, 21, "warning: could not set group id to %d (%s)\n" )/*extracted from daemon.cpp*/ + ResDef( DBT_warningCouldNotSetUserIdToDSN_, 22, "warning: could not set user id to %d (%s)\n" )/*extracted from daemon.cpp*/ + ResDef( DBT_warningDaemonIsRunningAsSuperUse_, 23, "warning: daemon is running as super-user\n" )/*extracted from daemon.cpp*/ + ResDef( DBT_couldNotDetermineCurrentUserName_, 24, "could not determine current user name\n" )/*extracted from daemon.cpp*/ + ResDef( DBT_errorChrootToSFailedSN_, 25, "error: chroot to %s failed (%s)\n" )/*extracted from daemon.cpp*/ + ResDef( DBT_AddressS_, 27, ", address %s" )/*extracted from daemon.cpp*/ + ResDef( DBT_warningStatisticsDisabledSN_, 28, "warning: statistics disabled (%s)\n" )/*extracted from daemon.cpp*/ + ResDef( DBT_securityHandshakeTimedOutForPidD_, 29, "security handshake timed out for pid %d" )/*extracted from daemon.cpp*/ + ResDef( DBT_warningStatisticsDisabledSN_1, 30, "warning: statistics disabled (%s)\n" )/*extracted from daemon.cpp*/ + ResDef( DBT_secureHandshakeFailedCodeDN_, 31, "secure handshake failed (code %d)\n" )/*extracted from daemon.cpp*/ + ResDef( DBT_acceptFailedS_, 32, "accept failed (%s)" )/*extracted from daemon.cpp*/ + ResDef( DBT_warningStatisticsDisabledSN_2, 33, "warning: statistics disabled (%s)\n" )/*extracted from daemon.cpp*/ + ResDef( DBT_selectThreadMiss_, 34, "select thread miss" )/*extracted from daemon.cpp*/ + ResDef( DBT_keepaliveWorkerAwokenWithNoWorkT_, 35, "keepalive worker awoken with no work to do" )/*extracted from daemon.cpp*/ + ResDef( DBT_couldNotCreateNewThreadDS_, 36, "could not create new thread: %d (%s)" )/*extracted from daemon.cpp*/ + ResDef( DBT_waitForSemaSucceededButNothingTo_, 37, "wait for sema succeeded, but nothing to dequeue" )/*extracted from daemon.cpp*/ + ResDef( DBT_queueSemaCreationFailure_, 38, "queue-sema creation failure" )/*extracted from daemon.cpp*/ + ResDef( DBT_errorGettingProcessorInfoForProc_, 39, "error getting processor info for processor %d" )/*extracted from daemon.cpp*/ + ResDef( DBT_errorBindingToProcessorD_, 40, "Error binding to processor %d" )/*extracted from daemon.cpp*/ + ResDef( DBT_boundProcessDToProcessorD_, 41, "bound process %d to processor %d" )/*extracted from daemon.cpp*/ + ResDef( DBT_netscapeServerIsNotExplicitlyBin_, 42, "Netscape server is not explicitly binding to any processors." )/*extracted from daemon.cpp*/ + ResDef( DBT_cacheMonitorExited_, 43, "cache monitor exited" )/*extracted from daemon.cpp*/ + ResDef( DBT_cacheBatchUpdateDaemonExited_, 44, "cache batch update daemon exited" )/*extracted from daemon.cpp*/ + ResDef( DBT_usingSingleThreadedAccepts_, 45, "Using single threaded accepts." )/*extracted from daemon.cpp*/ + ResDef( DBT_usingMultiThreadedAccepts_, 46, "Using multi threaded accepts." )/*extracted from daemon.cpp*/ + ResDef( DBT_usingPartialSingleThreadedAccept_, 47, "Using partial single threaded accepts." )/*extracted from daemon.cpp*/ + ResDef( DBT_thisMachineHasDProcessors_, 48, "This machine has %d processors." )/*extracted from daemon.cpp*/ + ResDef( DBT_errorCallingThrSeconcurrencyDS_, 49, "Error calling thr_seconcurrency(%d)- (%s)" )/*extracted from daemon.cpp*/ + ResDef( DBT_setConncurrencyToD_, 50, "Set conncurrency to %d." )/*extracted from daemon.cpp*/ + ResDef( DBT_warningNetscapeExecutableAndLibr_, 51, "WARNING! netscape executable and library have different versions.\n" )/*extracted from daemon.cpp*/ + ResDef( DBT_seminitFailedSN_, 54, "seminit failed (%s)\n" )/*extracted from daemon.cpp*/ + ResDef( DBT_thisBetaSoftwareHasExpiredN_, 55, "This beta software has expired.\n" )/*extracted from daemon.cpp*/ + ResDef( DBT_cacheMonitorRespawned_, 56, "Cache monitor respawned" )/*extracted from daemon.cpp*/ + ResDef( DBT_cacheBatchUpdateDaemonRespawned_, 57, "Cache batch update daemon respawned" )/*extracted from daemon.cpp*/ + ResDef( DBT_canTFindEmptyStatisticsSlot_, 58, "can't find empty statistics slot" )/*extracted from daemon.cpp*/ + ResDef( DBT_canTForkNewProcessS_, 59, "can't fork new process (%s)" )/*extracted from daemon.cpp*/ + ResDef( DBT_assertFailedSN_, 60, "assert failed! %s\n" )/*extracted from multiplex.c*/ + ResDef( DBT_mrTableInit_, 61, "mr_table_init()" )/*extracted from multiplex.c*/ + ResDef( DBT_mallocFailed_, 62, "malloc failed" )/*extracted from multiplex.c*/ + ResDef( DBT_mallocFailed_1, 63, "malloc failed!" )/*extracted from multiplex.c*/ + ResDef( DBT_mrAddIoDTypeDFileD_, 64, "mr_add_io(%d, type %d, file %d)" )/*extracted from multiplex.c*/ + ResDef( DBT_mrAddIoStage1_, 65, "mr_add_io - stage 1" )/*extracted from multiplex.c*/ + ResDef( DBT_mrAddIoStage2_, 66, "mr_add_io - stage 2" )/*extracted from multiplex.c*/ + ResDef( DBT_mrAddIoFoundInvalidIoTypeD_, 67, "mr_add_io found invalid IO type %d" )/*extracted from multiplex.c*/ + ResDef( DBT_mrAddIoAddingTimeout_, 68, "mr_add_io - adding timeout" )/*extracted from multiplex.c*/ + ResDef( DBT_outOfMemoryN_, 69, "Out of memory!\n" )/*extracted from multiplex.c*/ + ResDef( DBT_doneWithMrAddIo_, 70, "done with mr_add_io" )/*extracted from multiplex.c*/ + ResDef( DBT_mrDelIoDTypeDFileD_, 71, "mr_del_io(%d, type %d, file %d)" )/*extracted from multiplex.c*/ + ResDef( DBT_mrDelIoFoundInvalidIoTypeD_, 72, "mr_del_io found invalid IO type %d" )/*extracted from multiplex.c*/ + ResDef( DBT_mrLookupIoD_, 73, "mr_lookup_io(%d)" )/*extracted from multiplex.c*/ + ResDef( DBT_mrAsyncIoDDBytesFileD_, 74, "mr_async_io(%d, %d bytes, file %d)" )/*extracted from multiplex.c*/ + ResDef( DBT_mallocFailureAddingAsyncIo_, 75, "malloc failure adding async IO" )/*extracted from multiplex.c*/ + ResDef( DBT_errorAddingAsyncIo_, 76, "Error adding async io!" )/*extracted from multiplex.c*/ + ResDef( DBT_cannotSeekForRead_, 77, "Cannot seek for read!" )/*extracted from multiplex.c*/ + ResDef( DBT_readFailureDS_, 78, "read failure! (%d, %s)" )/*extracted from multiplex.c*/ + ResDef( DBT_doReadReadDBytesForFileD_, 79, "do_read read %d bytes for file %d" )/*extracted from multiplex.c*/ + ResDef( DBT_cannotSeekForWrite_, 80, "Cannot seek for write!" )/*extracted from multiplex.c*/ + ResDef( DBT_writevFailureDS_, 81, "writev failure! (%d, %s)" )/*extracted from multiplex.c*/ + ResDef( DBT_writeFailureDS_, 82, "write failure! (%d, %s)" )/*extracted from multiplex.c*/ + ResDef( DBT_doWriteWroteDBytesForFileD_, 83, "do_write wrote %d bytes for file %d" )/*extracted from multiplex.c*/ + ResDef( DBT_doTimeoutMrpD_, 84, "do_timeout(mrp %d)" )/*extracted from multiplex.c*/ + ResDef( DBT_doTimeoutFoundIoTimerDTimeD_, 85, "do_timeout: found IO (timer=%d, time=%d)" )/*extracted from multiplex.c*/ + ResDef( DBT_errorDeletingIo_, 86, "error deleting io" )/*extracted from multiplex.c*/ + ResDef( DBT_timeoutCallbackFailureForDN_, 87, "timeout callback failure for %d\n" )/*extracted from multiplex.c*/ + ResDef( DBT_mrGetEventDOutstandingIoD_, 88, "mr_get_event(%d) - outstanding io %d" )/*extracted from multiplex.c*/ + ResDef( DBT_mrGetEventWaitingForReadsOnFd_, 89, "mr_get_event: Waiting for reads on FD:" )/*extracted from multiplex.c*/ + ResDef( DBT_mrGetEventWaitingForWritesOnFd_, 90, "mr_get_event: Waiting for writes on FD:" )/*extracted from multiplex.c*/ + ResDef( DBT_TD_, 91, "\t%d" )/*extracted from multiplex.c*/ + ResDef( DBT_TD_1, 92, "\t%d" )/*extracted from multiplex.c*/ + ResDef( DBT_mrGetEventSetNoTimeout_, 93, "mr_get_event set no timeout" )/*extracted from multiplex.c*/ + ResDef( DBT_mrGetEventSetTimeoutToDDSec_, 94, "mr_get_event set timeout to: %d.%d sec" )/*extracted from multiplex.c*/ + ResDef( DBT_errorInSelectDS_, 95, "error in select (%d, %s)" )/*extracted from multiplex.c*/ + ResDef( DBT_mrGetEventSelectFoundD_, 96, "mr_get_event() - select found %d" )/*extracted from multiplex.c*/ + ResDef( DBT_errorLookingUpIoFdD_, 97, "error looking up IO fd %d" )/*extracted from multiplex.c*/ + ResDef( DBT_readFailedForFdD_, 98, "read failed for fd %d" )/*extracted from multiplex.c*/ + ResDef( DBT_errorDeletingIo_1, 99, "error deleting io" )/*extracted from multiplex.c*/ + ResDef( DBT_callbackFailureForDN_, 100, "callback failure for %d\n" )/*extracted from multiplex.c*/ + ResDef( DBT_errorLookingUpIoFdD_1, 101, "error looking up IO fd %d" )/*extracted from multiplex.c*/ + ResDef( DBT_writingHeaderLenDWritelenDTotalD_, 102, "writing: header len %d, writelen %d, total %d" )/*extracted from multiplex.c*/ + ResDef( DBT_writeFailedForFdD_, 103, "write failed for fd %d" )/*extracted from multiplex.c*/ + ResDef( DBT_errorDeletingIo_2, 104, "error deleting io" )/*extracted from multiplex.c*/ + ResDef( DBT_callbackFailureForDN_1, 105, "callback failure for %d\n" )/*extracted from multiplex.c*/ + ResDef( DBT_errorCreatingDnsCache_, 106, "Error creating dns cache" )/*extracted from dns_cache.cpp*/ + ResDef( DBT_dnsCacheInitHashSize0UsingD_, 107, "dns_cache_init: hash_size <= 0, using %d" )/*extracted from dns_cache.cpp*/ + ResDef( DBT_dnsCacheInitCacheSizeDUsingD_, 108, "dns_cache_init: cache-size <= %d, using %d" )/*extracted from dns_cache.cpp*/ + ResDef( DBT_dnsCacheInitCacheSizeIsDIsTooLar_, 109, "dns_cache_init: cache-size is %d is too large, using %d." )/*extracted from dns_cache.cpp*/ + ResDef( DBT_dnsCacheInitExpireTime0UsingD_, 110, "dns_cache_init: expire_time <= 0, using %d" )/*extracted from dns_cache.cpp*/ + ResDef( DBT_dnsCacheInitExpireIsDIsTooLargeU_, 111, "dns_cache_init: expire is %d is too large, using %d seconds." )/*extracted from dns_cache.cpp*/ + ResDef( DBT_errorCreatingDnsCache_1, 112, "Error creating dns cache" )/*extracted from dns_cache.cpp*/ + ResDef( DBT_dnsCacheInsertErrorAllocatingEnt_, 113, "dns-cache-insert: Error allocating entry" )/*extracted from dns_cache.cpp*/ + ResDef( DBT_dnsCacheInsertMallocFailure_, 114, "dns-cache-insert: malloc failure" )/*extracted from dns_cache.cpp*/ + ResDef( DBT_successfulServerStartup_, 115, "successful server startup" )/*extracted from ereport.cpp*/ + ResDef( DBT_SBS_, 116, "%s B%s" )/*extracted from ereport.cpp*/ + ResDef( DBT_netscapeExecutableAndSharedLibra_, 117, "Netscape executable and shared library have different versions" )/*extracted from ereport.cpp*/ + ResDef( DBT_executableVersionIsS_, 118, " executable version is %s" )/*extracted from ereport.cpp*/ + ResDef( DBT_sharedLibraryVersionIsS_, 119, " shared library version is %s" )/*extracted from ereport.cpp*/ + ResDef( DBT_errorReportingShuttingDown_, 120, "error reporting shutting down" )/*extracted from ereport.cpp*/ + ResDef( DBT_warning_, 121, "warning" )/*extracted from ereport.cpp*/ + ResDef( DBT_config_, 122, "config" )/*extracted from ereport.cpp*/ + ResDef( DBT_security_, 123, "security" )/*extracted from ereport.cpp*/ + ResDef( DBT_failure_, 124, "failure" )/*extracted from ereport.cpp*/ + ResDef( DBT_catastrophe_, 125, "catastrophe" )/*extracted from ereport.cpp*/ + ResDef( DBT_info_, 126, "info" )/*extracted from ereport.cpp*/ + ResDef( DBT_verbose_, 127, "verbose" )/*extracted from ereport.cpp*/ + ResDef( DBT_eventHandlerFailedToWaitOnEvents_, 128, "event_handler:Failed to wait on events %s" )/*extracted from eventhandler.cpp*/ + ResDef( DBT_couldNotWaitOnResumeEventEventS_, 129, "could not wait on resume event event (%s)" )/*extracted from eventhandler.cpp*/ + ResDef( DBT_dlopenOfSFailedS_, 130, "dlopen of %s failed (%s)" )/*extracted from LibMgr.cpp*/ + ResDef( DBT_dlopenOfSFailedS_1, 131, "dlopen of %s failed (%s)" )/*extracted from LibMgr.cpp*/ + ResDef( DBT_theServerIsTerminatingDueToAnErr_, 132, "The server is terminating due to an error. Check the event viewer for the error message. SERVER EXITING!" )/*extracted from ntdaemon.cpp*/ + ResDef( DBT_terminatingTheServerS_, 133, "Terminating the server %s" )/*extracted from ntdaemon.cpp*/ + ResDef( DBT_killServerCannotOpenServerEventS_, 134, "kill_server:cannot open server event %s" )/*extracted from ntdaemon.cpp*/ + ResDef( DBT_killServerCannotSetServerEventS_, 135, "kill_server:cannot set server event %s" )/*extracted from ntdaemon.cpp*/ + ResDef( DBT_errorCouldNotGetSocketSN_, 136, "error: could not get socket (%s)\n" )/*extracted from ntdaemon.cpp*/ + ResDef( DBT_errorCouldNotSetSocketOptionSN_, 137, "error: could not set socket option (%s)\n" )/*extracted from ntdaemon.cpp*/ + ResDef( DBT_terminatingServiceErrorCouldNotB_, 138, "Terminating Service:error: could not bind to address %s port %d (%s)\n" )/*extracted from ntdaemon.cpp*/ + ResDef( DBT_terminatingServiceErrorCouldNotB_1, 139, "Terminating Service:error: could not bind to port %d (%s)\n" )/*extracted from ntdaemon.cpp*/ + ResDef( DBT_sethandlenoninheritableCouldNotD_, 140, "SetHandleNonInheritable: could not duplicate socket (%s)" )/*extracted from ntdaemon.cpp*/ + ResDef( DBT_sethandlenoninheritableClosingTh_, 141, "SetHandleNonInheritable: closing the original socket failed (%s)" )/*extracted from ntdaemon.cpp*/ + ResDef( DBT_couldNotSethandleinformationS_, 142, "Could not SetHandleInformation (%s)" )/*extracted from ntdaemon.cpp*/ + ResDef( DBT_terminatingServiceFailureCouldNo_, 143, "Terminating Service:Failure: Could not open statistics file (%s)\n" )/*extracted from ntdaemon.cpp*/ + ResDef( DBT_couldNotSetThreadLocalStorageVal_, 144, "Could not set Thread Local Storage Value for thread at slot %d" )/*extracted from ntdaemon.cpp*/ + ResDef( DBT_secureHandshakeFailedCodeDN_1, 145, "secure handshake failed (code %d)\n" )/*extracted from ntdaemon.cpp*/ + ResDef( DBT_acceptFailedDS_, 146, "accept failed %d (%s)" )/*extracted from ntdaemon.cpp*/ + ResDef( DBT_failedToPulseEventDS_, 147, "Failed to pulse Event %d %s" )/*extracted from ntdaemon.cpp*/ + ResDef( DBT_failedToSendMobgrowthEventToPare_, 148, "Failed to send MobGrowth Event to parent %s" )/*extracted from ntdaemon.cpp*/ + ResDef( DBT_pulsingMobrespawnEventD_, 149, "Pulsing MobRespawn Event %d" )/*extracted from ntdaemon.cpp*/ + ResDef( DBT_respawnThreadPoolToDD_, 150, "respawn thread pool to %d (%d)" )/*extracted from ntdaemon.cpp*/ + ResDef( DBT_couldNotOpenEventToSignalRotateA_, 151, "Could not open event to signal rotate application. Could not create the MoveLog event:%s" )/*extracted from ntdaemon.cpp*/ + ResDef( DBT_failedToSendMovelogEventToRotate_, 152, "Failed to send MoveLog Event to rotate app %s" )/*extracted from ntdaemon.cpp*/ + ResDef( DBT_growingThreadPoolFromDToD_, 153, "growing thread pool from %d to %d" )/*extracted from ntdaemon.cpp*/ + ResDef( DBT_couldNotOpenTheServicecontrolman_, 154, "Could not open the ServiceControlManager, Error %d" )/*extracted from ntdaemon.cpp*/ + ResDef( DBT_startnetsiteserviceCouldNotOpenT_, 155, "StartNetsiteService:Could not open the service %s: Error %d" )/*extracted from ntdaemon.cpp*/ + ResDef( DBT_startnetsiteserviceCouldNotStart_, 156, "StartNetsiteService:Could not start the service %s" )/*extracted from ntdaemon.cpp*/ + ResDef( DBT_serviceStartupCouldNotAllocateSe_, 157, "Service Startup: Could not allocate security descriptor" )/*extracted from ntdaemon.cpp*/ + ResDef( DBT_serviceStartupCouldNotInitSecuri_, 158, "Service Startup: Could not init security descriptor" )/*extracted from ntdaemon.cpp*/ + ResDef( DBT_serviceStartupCouldNotSetTheSecu_, 159, "Service Startup: Could not set the security Dacl" )/*extracted from ntdaemon.cpp*/ + ResDef( DBT_terminatingServiceWinsockInitFai_, 160, "Terminating Service:WinSock init failed: %s" )/*extracted from ntdaemon.cpp*/ + ResDef( DBT_httpdServerStartupFailedS_, 161, "Httpd Server Startup failed: %s" )/*extracted from ntdaemon.cpp*/ + ResDef( DBT_canTFindEmptyStatisticsSlot_1, 162, "can't find empty statistics slot" )/*extracted from ntdaemon.cpp*/ + ResDef( DBT_ntDaemonCouldNotCreateNewThreadD_, 163, "NT daemon: could not create new thread %d" )/*extracted from ntdaemon.cpp*/ + ResDef( DBT_serviceStartupFailureTerminating_, 164, "Service Startup Failure. Terminating Service:Could not create event %d:%s" )/*extracted from ntdaemon.cpp*/ + ResDef( DBT_serviceStartupErrorCouldNotCreat_, 165, "Service Startup Error. Could not create the MoveLog event:%s" )/*extracted from ntdaemon.cpp*/ + ResDef( DBT_failedToWaitOnEventObjectsS_, 166, "Failed to wait on Event objects %s" )/*extracted from ntdaemon.cpp*/ + ResDef( DBT_failedToWaitOnEventObjectsS_1, 167, "Failed to wait on Event objects %s" )/*extracted from ntdaemon.cpp*/ + ResDef( DBT_pipebufBuf2sdPipebufGrabIoErrorD_, 168, "pipebuf_buf2sd: pipebuf_grab IO_ERROR %d" )/*extracted from ntpipe.cpp*/ + ResDef( DBT_poolInitMemoryPoolsDisabled_, 169, "pool-init: memory pools disabled" )/*extracted from pool.cpp*/ + ResDef( DBT_poolInitFreeSize0UsingD_, 170, "pool-init: free_size <= 0, using %d" )/*extracted from pool.cpp*/ + ResDef( DBT_poolCreateBlockOutOfMemory_, 171, "pool-create-block: out of memory" )/*extracted from pool.cpp*/ + ResDef( DBT_poolCreateOutOfMemory_, 172, "pool-create: out of memory" )/*extracted from pool.cpp*/ + ResDef( DBT_poolCreateOutOfMemory_1, 173, "pool-create: out of memory" )/*extracted from pool.cpp*/ + ResDef( DBT_poolMallocOutOfMemory_, 174, "pool-malloc: out of memory" )/*extracted from pool.cpp*/ + ResDef( DBT_freeUsedWherePermFreeShouldHaveB_, 175, "FREE() used where PERM_FREE() should have been used- problem corrected and supressing further warnings." )/*extracted from pool.cpp*/ + ResDef( DBT_regexErrorSRegexS_, 176, "regex error: %s (regex: '%s')" )/*extracted from regexp.cpp*/ + ResDef( DBT_canTCreateIpcPipeS_, 177, "can't create IPC pipe (%s)" )/*extracted from thrconn.cpp*/ + ResDef( DBT_writeToWakeupPipeFailedS_, 178, "write to wakeup pipe failed (%s)" )/*extracted from thrconn.cpp*/ + ResDef( DBT_flushingDConnectionsCurrentDTotD_, 179, "flushing %d connections; current %d; tot %d" )/*extracted from thrconn.cpp*/ + ResDef( DBT_acceptFailedS_1, 180, "accept failed (%s)" )/*extracted from thrconn.cpp*/ + ResDef( DBT_errorCreatingTimeCache_, 181, "Error creating time cache" )/*extracted from time_cache.cpp*/ + ResDef( DBT_timeCacheCacheDisabled_, 182, "time-cache: cache disabled" )/*extracted from time_cache.cpp*/ + ResDef( DBT_timeCacheInitHashSizeDUsingDefau_, 183, "time_cache_init: hash_size < %d, using default, %d" )/*extracted from time_cache.cpp*/ + ResDef( DBT_timeCacheInitHashSizeDUsingDefau_1, 184, "time_cache_init: hash_size > %d, using default, %d" )/*extracted from time_cache.cpp*/ + ResDef( DBT_timeCacheInitCacheSizeDUsingDefa_, 185, "time_cache_init: cache_size < %d, using default, %d" )/*extracted from time_cache.cpp*/ + ResDef( DBT_timeCacheInitCacheSizeDUsingDefa_1, 186, "time_cache_init: cache_size > %d, using default, %d" )/*extracted from time_cache.cpp*/ + ResDef( DBT_errorAllocatingMemoryForTimeCach_, 187, "Error allocating memory for time_cache" )/*extracted from time_cache.cpp*/ + ResDef( DBT_errorAllocatingMemoryForTimeCach_1, 188, "Error allocating memory for time_cache entry" )/*extracted from time_cache.cpp*/ + ResDef( DBT_errorAllocatingMemoryForTimeCach_2, 189, "Error allocating memory for time_cache entry" )/*extracted from time_cache.cpp*/ + ResDef( DBT_errorInsertingNewTimeCacheEntry_, 190, "Error inserting new time_cache entry" )/*extracted from time_cache.cpp*/ + ResDef( DBT_errorAllocatingMemoryForTimeCach_3, 191, "Error allocating memory for time_cache" )/*extracted from time_cache.cpp*/ + ResDef( DBT_csTerminateFailureS_, 192, "cs-terminate failure (%s)" )/*extracted from crit.cpp*/ + ResDef( DBT_csInitFailureS_, 193, "cs-init failure (%s)" )/*extracted from crit.cpp*/ + ResDef( DBT_csWaitFailureS_, 194, "cs-wait failure (%s)" )/*extracted from crit.cpp*/ + ResDef( DBT_csPostFailureS_, 195, "cs-post failure (%s)" )/*extracted from crit.cpp*/ + ResDef( DBT_unableToCreateNonblockingSocketS_, 196, "Unable to create nonblocking socket (%s)" )/*extracted from net.cpp*/ + ResDef( DBT_errorCouldNotSetKeepaliveSN_, 197, "error: could not set keepalive (%s)\n" )/*extracted from net.cpp*/ + ResDef( DBT_errorCouldNotSetRecvTimeoutSN_, 198, "error: could not set recv timeout (%s)\n" )/*extracted from net.cpp*/ + ResDef( DBT_errorCouldNotSetSendTimeoutSN_, 199, "error: could not set send timeout (%s)\n" )/*extracted from net.cpp*/ + ResDef( DBT_unableToCreateNonblockingSocketS_1, 200, "Unable to create nonblocking socket (%s)" )/*extracted from net.cpp*/ + ResDef( DBT_semGrabFailedS_, 201, "sem_grab failed (%s)" )/*extracted from net.cpp*/ + ResDef( DBT_semReleaseFailedS_, 202, "sem_release failed (%s)" )/*extracted from net.cpp*/ + ResDef( DBT_semReleaseFailedS_1, 203, "sem_release failed (%s)" )/*extracted from net.cpp*/ + ResDef( DBT_couldNotRemoveTemporaryDirectory_, 204, "Could not remove temporary directory %s, Error %d" )/*extracted from util.cpp*/ + ResDef( DBT_couldNotRemoveTemporaryDirectory_1, 205, "Could not remove temporary directory %s, Error %d" )/*extracted from util.cpp*/ +END_STR(base) diff --git a/include/base/ereport.h b/include/base/ereport.h new file mode 100644 index 00000000..0c74e957 --- /dev/null +++ b/include/base/ereport.h @@ -0,0 +1,76 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef BASE_EREPORT_H +#define BASE_EREPORT_H + +#ifndef NOINTNSAPI +#define INTNSAPI +#endif /* !NOINTNSAPI */ + +/* + * ereport.h: Records transactions, reports errors to administrators, etc. + * + * Rob McCool + */ + +#ifndef BASE_SESSION_H +#include "session.h" +#endif /* !BASE_SESSION_H */ + +#ifndef PUBLIC_BASE_EREPORT_H +#include "public/base/ereport.h" +#endif /* !PUBLIC_BASE_EREPORT_H */ + +/* --- Begin function prototypes --- */ + +#ifdef INTNSAPI + +NSPR_BEGIN_EXTERN_C + +/* + * INTereport logs an error of the given degree and formats the arguments with + * the printf() style fmt. Returns whether the log was successful. Records + * the current date. + */ + +NSAPI_PUBLIC int INTereport(int degree, char *fmt, ...); +NSAPI_PUBLIC int INTereport_v(int degree, char *fmt, va_list args); + +/* + * INTereport_init initializes the error logging subsystem and opens the static + * file descriptors. It returns NULL upon success and an error string upon + * error. If a userpw is given, the logs will be chowned to that user. + * + * email is the address of a person to mail upon catastrophic error. It + * can be NULL if no e-mail is desired. INTereport_init will not duplicate + * its own copy of this string; you must make sure it stays around and free + * it when you shut down the server. + */ + +NSAPI_PUBLIC +char *INTereport_init(char *err_fn, char *email, PASSWD pwuser, char *version); + +/* + * log_terminate closes the error and common log file descriptors. + */ +NSAPI_PUBLIC void INTereport_terminate(void); + +/* For restarts */ +NSAPI_PUBLIC SYS_FILE INTereport_getfd(void); + +NSPR_END_EXTERN_C + +/* --- End function prototypes --- */ + +#define ereport INTereport +#define ereport_v INTereport_v +#define ereport_init INTereport_init +#define ereport_terminate INTereport_terminate +#define ereport_getfd INTereport_getfd + +#endif /* INTNSAPI */ + +#endif /* !BASE_EREPORT_H */ diff --git a/include/base/eventhandler.h b/include/base/eventhandler.h new file mode 100644 index 00000000..a68a231e --- /dev/null +++ b/include/base/eventhandler.h @@ -0,0 +1,73 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/* + * eventhandler.h: Handle registration of event handlers + * + * This is a facility in the NT server to provide a way to register event + * handling functions. Often there is a need to send a control signal of some + * kind to the server. This could be a signal for the server to rotate its + * logs, or a signal to collect and return statistical information of some kind + * such as perfmon stats. + * + * This file specifies the structures and functions necessary to set up this + * kind of asynchronous special event handling. + * + * Aruna Victor 2/21/96 + */ + +#ifndef EVENTHANDLER_H +#define EVENTHANDLER_H + +#include "netsite.h" + +/* ------------------------------ Structures ------------------------------ */ + +/* EVENT_HANDLER specifies + 1. The name of the event. This is the event that the event handler will + create and wait on for a signal. + 2. The name of the function should be called to handle the event. + 3. The argument that should be passed to this function. + 4. The next EVENT_HANDLER on the list this structure is on. */ + +typedef struct event_handler { + int event_number; + char *event_name; + void (*_event_handler)(void *); + void *argument; + struct event_handler *next; +} EVENT_HANDLER; + +/* ------------------------------ Prototypes ------------------------------ */ + +NSPR_BEGIN_EXTERN_C + +char *initialize_event_handler(char *serverid); + +char *terminate_event_handler(); + +char *add_handler(char *event, void (*fn)(void *), void *arg); + +char *delete_handler(char *event); + +char *add_rotation_handler(char *event, void (*fn)(void *), void *arg); + +NSPR_END_EXTERN_C + +#endif /* !EVENTHANDLER */ + + + + + + + + + + + + + + diff --git a/include/base/eventlog.h b/include/base/eventlog.h new file mode 100644 index 00000000..a8dd6d27 --- /dev/null +++ b/include/base/eventlog.h @@ -0,0 +1,34 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +// EVENTLOG.H +// +// This file contains the defines that make NT an installable service. +// +// 1/12/95 aruna +// + +// Functions in eventlog.c + +#ifndef _EVENTLOG_H_ +#define _EVENTLOG_H_ + +#include "netsite.h" + + +#if defined(XP_WIN32) + +NSPR_BEGIN_EXTERN_C + +NSAPI_PUBLIC HANDLE InitializeLogging(char *szEventLogName); +NSAPI_PUBLIC BOOL TerminateLogging(HANDLE hEventSource); +NSAPI_PUBLIC BOOL LogErrorEvent(HANDLE hEventSource, WORD fwEventType, WORD fwCategory, DWORD IDEvent, LPTSTR chMsg, LPTSTR lpszMsg); + +NSPR_END_EXTERN_C + +#endif /* XP_WIN32 */ + + +#endif diff --git a/include/base/file.h b/include/base/file.h new file mode 100644 index 00000000..6447bb83 --- /dev/null +++ b/include/base/file.h @@ -0,0 +1,121 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef BASE_FILE_H +#define BASE_FILE_H + +#ifndef NOINTNSAPI +#define INTNSAPI +#endif /* !NOINTNSAPI */ + +/* GLOBAL FUNCTIONS: + * DESCRIPTION: + * system-specific functions for reading/writing files + */ + +#ifndef NETSITE_H +#include "../netsite.h" +#endif /* !NETSITE_H */ + +#ifndef PUBLIC_BASE_FILE_H +#include "public/base/file.h" +#endif /* !PUBLIC_BASE_FILE_H */ + +/* --- Begin function prototypes --- */ + +#ifdef INTNSAPI + +NSPR_BEGIN_EXTERN_C + +void INTsystem_errmsg_init(void); + +NSAPI_PUBLIC SYS_FILE INTsystem_fopenRO(char *path); +NSAPI_PUBLIC SYS_FILE INTsystem_fopenWA(char *path); +NSAPI_PUBLIC SYS_FILE INTsystem_fopenRW(char *path); +NSAPI_PUBLIC SYS_FILE INTsystem_fopenWT(char *path); +NSAPI_PUBLIC int INTsystem_fread(SYS_FILE fd, char *buf, int sz); +NSAPI_PUBLIC int INTsystem_fwrite(SYS_FILE fd,char *buf,int sz); +NSAPI_PUBLIC int INTsystem_fwrite_atomic(SYS_FILE fd, char *buf, int sz); +NSAPI_PUBLIC int INTsystem_lseek(SYS_FILE fd, int off, int wh); +NSAPI_PUBLIC int INTsystem_fclose(SYS_FILE fd); +NSAPI_PUBLIC int INTsystem_stat(char *name, struct stat *finfo); +NSAPI_PUBLIC int INTsystem_rename(char *oldpath, char *newpath); +NSAPI_PUBLIC int INTsystem_unlink(char *path); +NSAPI_PUBLIC int INTsystem_tlock(SYS_FILE fd); +NSAPI_PUBLIC int INTsystem_flock(SYS_FILE fd); +NSAPI_PUBLIC int INTsystem_ulock(SYS_FILE fd); + +#ifdef XP_WIN32 +NSAPI_PUBLIC SYS_DIR INTdir_open(char *path); +NSAPI_PUBLIC SYS_DIRENT *INTdir_read(SYS_DIR ds); +NSAPI_PUBLIC void INTdir_close(SYS_DIR ds); +#endif /* XP_WIN32 */ + +NSAPI_PUBLIC int INTdir_create_all(char *dir); + +/* --- OBSOLETE ---------------------------------------------------------- + * The following macros/functions are obsolete and are only maintained for + * compatibility. Do not use them. 11-19-96 + * ----------------------------------------------------------------------- + */ + +#ifdef XP_WIN32 +NSAPI_PUBLIC char *INTsystem_winsockerr(void); +NSAPI_PUBLIC char *INTsystem_winerr(void); +NSAPI_PUBLIC int INTsystem_pread(SYS_FILE fd, char *buf, int sz); +NSAPI_PUBLIC int INTsystem_pwrite(SYS_FILE fd, char *buf, int sz); +NSAPI_PUBLIC void INTfile_unix2local(char *path, char *p2); +#endif /* XP_WIN32 */ + +NSAPI_PUBLIC int INTsystem_nocoredumps(void); +NSAPI_PUBLIC int INTfile_setinherit(SYS_FILE fd, int value); +NSAPI_PUBLIC int INTfile_notfound(void); +NSAPI_PUBLIC char *INTsystem_errmsg(void); +NSAPI_PUBLIC int INTsystem_errmsg_fn(char **buff, size_t maxlen); + +NSPR_END_EXTERN_C + +#define system_errmsg_init INTsystem_errmsg_init +#define system_fopenRO INTsystem_fopenRO +#define system_fopenWA INTsystem_fopenWA +#define system_fopenRW INTsystem_fopenRW +#define system_fopenWT INTsystem_fopenWT +#define system_fread INTsystem_fread +#define system_fwrite INTsystem_fwrite +#define system_fwrite_atomic INTsystem_fwrite_atomic +#define system_lseek INTsystem_lseek +#define system_fclose INTsystem_fclose +#define system_stat INTsystem_stat +#define system_rename INTsystem_rename +#define system_unlink INTsystem_unlink +#define system_tlock INTsystem_tlock +#define system_flock INTsystem_flock +#define system_ulock INTsystem_ulock +#ifdef XP_WIN32 +#define dir_open INTdir_open +#define dir_read INTdir_read +#define dir_close INTdir_close +#endif /* XP_WIN32 */ +#define dir_create_all INTdir_create_all + +/* Obsolete */ +#ifdef XP_WIN32 +#define system_winsockerr INTsystem_winsockerr +#define system_winerr INTsystem_winerr +#define system_pread INTsystem_pread +#define system_pwrite INTsystem_pwrite +#define file_unix2local INTfile_unix2local +#endif /* XP_WIN32 */ + +#define system_nocoredumps INTsystem_nocoredumps +#define file_setinherit INTfile_setinherit +#define file_notfound INTfile_notfound +#define rtfile_notfound INTfile_notfound +#define system_errmsg INTsystem_errmsg +#define system_errmsg_fn INTsystem_errmsg_fn + +#endif /* INTNSAPI */ + +#endif /* BASE_FILE_H */ diff --git a/include/base/fsmutex.h b/include/base/fsmutex.h new file mode 100644 index 00000000..486f0f4c --- /dev/null +++ b/include/base/fsmutex.h @@ -0,0 +1,94 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/* + * fsmutex: Mutexes that are filesystem-based so they're available from more + * than one process and address space + * + * Rob McCool + */ + + +#ifndef FSMUTEX_H +#define FSMUTEX_H + +#include "netsite.h" + +typedef void * FSMUTEX; + + +/* ------------------------------ Prototypes ------------------------------ */ + +NSPR_BEGIN_EXTERN_C + +/* + Flags to fsmutex_init. + + FSMUTEX_VISIBLE makes a filesystem mutex which can be opened by other + programs or processes. + + FSMUTEX_NEEDCRIT specifies that the fsmutex_lock and fsmutex_unlock + functions should also use a critical section to ensure that more than + one thread does not acquire the mutex at a time. If this flag is not + specified, it is up to the caller to ensure that only thread within a + process tries to acquire the lock at any given time. + */ +#define FSMUTEX_VISIBLE 0x01 +#define FSMUTEX_NEEDCRIT 0x02 + + +/* + fsmutex_init creates a new filesystem-based mutex. The resulting mutex + is part of the filesystem. The name and number parameters are used to + create a name for the mutex. If the FSMUTEX_VISIBLE flag is specified, + the mutex will be left in the filesystem for other programs and processes + to access. If a mutex with the given name/number combination already + exists, the calling process is allowed access to it. If the mutex does + not already exist, the mutex is created. + + Returns NULL on failure, a void pointer to a fsmutex structure otherwise. + This fsmutex structure is local to the current process. + */ +NSAPI_PUBLIC FSMUTEX fsmutex_init(char *name, int number, int flags); + +/* + Sets the ownership of the underlying filesystem object to the given + uid and gid. Only effective if the server is running as root. + */ +#ifdef XP_UNIX +#include +#ifdef __sony +#include +#endif +NSAPI_PUBLIC void fsmutex_setowner(FSMUTEX fsm, uid_t uid, gid_t gid); +#endif + + + +/* + fsmutex_terminate deletes a filesystem-based mutex. A mutex will only + be deleted when every process which has an open pointer to the mutex + calls this function. + */ +NSAPI_PUBLIC void fsmutex_terminate(FSMUTEX id); + +/* + fsmutex_lock attempts to acquire the given filesystem-based mutex. If + another process is holding the mutex, or if the FSMUTEX_NEEDCRIT flag + was passed to fsmutex_init and another thread in the current process is + holding the mutex, then the calling thread will block until the mutex + is available. + */ +NSAPI_PUBLIC void fsmutex_lock(FSMUTEX id); + +/* + fsmutex_unlock releases a filesystem-based mutex previously acquired + by fsmutex_lock. + */ +NSAPI_PUBLIC void fsmutex_unlock(FSMUTEX id); + +NSPR_END_EXTERN_C + +#endif diff --git a/include/base/lexer.h b/include/base/lexer.h new file mode 100644 index 00000000..129aa449 --- /dev/null +++ b/include/base/lexer.h @@ -0,0 +1,89 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef __lexer_h +#define __lexer_h + +#ifndef _POOL_H_ +#include "base/pool.h" +#endif /* _POOL_H_ */ + +/* Define error codes */ +#define LEXERR_MALLOC -1 /* insufficient dynamic memory */ + + +typedef struct LEXStream_s LEXStream_t; +typedef int (*LEXStreamGet_t)(LEXStream_t *); +struct LEXStream_s { + LEXStream_t * lst_next; /* link for "include" parent stream */ + void * lst_strmid; /* client stream identifier */ + LEXStreamGet_t lst_get; /* pointer to stream "get" function */ + char * lst_buf; /* stream buffer pointer */ + char * lst_cp; /* current position in buffer */ + int lst_len; /* remaining bytes in buffer */ + int lst_buflen; /* buffer length */ + int lst_flags; /* bit flags */ +#define LST_FREEBUF 0x1 /* free lst_buf in stream destroy */ +}; +NSPR_BEGIN_EXTERN_C + +/* Functions in lexer.c */ +NSAPI_PUBLIC +int lex_class_check(void * chtab, char code, unsigned long cbits); + +NSAPI_PUBLIC +int lex_class_create(int classc, char * classv[], void **pchtab); + +NSAPI_PUBLIC void lex_class_destroy(void * chtab); + +NSAPI_PUBLIC +LEXStream_t * lex_stream_create(LEXStreamGet_t strmget, void * strmid, + char * buf, int buflen); + +NSAPI_PUBLIC void lex_stream_destroy(LEXStream_t * lst); + +NSAPI_PUBLIC int +lex_token_new(pool_handle_t * pool, int initlen, int growlen, void **token); + +NSAPI_PUBLIC int lex_token_start(void * token); + +NSAPI_PUBLIC +char * lex_token_info(void * token, int * tdatalen, int * tbufflen); + +NSAPI_PUBLIC char * lex_token(void * token); + +NSAPI_PUBLIC void lex_token_destroy(void * token); + +NSAPI_PUBLIC +char * lex_token_get(void * token, int * tdatalen, int * tbufflen); + +NSAPI_PUBLIC char * lex_token_take(void * token); + +NSAPI_PUBLIC +int lex_token_append(void * token, int nbytes, char * src); + +NSAPI_PUBLIC +int lex_next_char(LEXStream_t * lst, void * chtab, unsigned long cbits); + +NSAPI_PUBLIC +int lex_scan_over(LEXStream_t * lst, void * chtab, unsigned long cbits, + void * token); + +NSAPI_PUBLIC +int lex_scan_string(LEXStream_t * lst, void * token, int flags); + +NSAPI_PUBLIC +int lex_scan_to(LEXStream_t * lst, void * chtab, unsigned long cbits, + void * token); + +NSAPI_PUBLIC +int lex_skip_over(LEXStream_t * lst, void * chtab, unsigned long cbits); + +NSAPI_PUBLIC +int lex_skip_to(LEXStream_t * lst, void * chtab, unsigned long cbits); + +NSPR_END_EXTERN_C + +#endif /* __lexer_h */ diff --git a/include/base/nterr.h b/include/base/nterr.h new file mode 100644 index 00000000..55d1be22 --- /dev/null +++ b/include/base/nterr.h @@ -0,0 +1,21 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/* + * Added function prototypes for nterror stuff. + * + * Robin Maxwell + */ + +#ifndef _NTERR_H +#define _NTERR_H +NSPR_BEGIN_EXTERN_C + +char * FindError(int error); +NSAPI_PUBLIC void HashNtErrors(); + +NSPR_END_EXTERN_C + +#endif /* _NTERR_H */ diff --git a/include/base/nterrors.h b/include/base/nterrors.h new file mode 100644 index 00000000..f9e4aa1f --- /dev/null +++ b/include/base/nterrors.h @@ -0,0 +1,67 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/* DO NOT EDIT THIS FILE - it is automatically generated */ + +typedef struct _NtError { + int ErrorNumber; + char *ErrorString; + struct _NtError *next; +} NtError; + +NtError NtErrorStrings[] = { +{ 10004 , "WSAEINTR" }, +{ 10009 , "WSAEBADF" }, +{ 10013 , "WSAEACCES" }, +{ 10014 , "WSAEFAULT" }, +{ 10022 , "WSAEINVAL" }, +{ 10024 , "WSAEMFILE" }, +{ 10035 , "WSAEWOULDBLOCK" }, +{ 10036 , "WSAEINPROGRESS" }, +{ 10037 , "WSAEALREADY" }, +{ 10038 , "WSAENOTSOCK" }, +{ 10039 , "WSAEDESTADDRREQ" }, +{ 10040 , "WSAEMSGSIZE" }, +{ 10041 , "WSAEPROTOTYPE" }, +{ 10042 , "WSAENOPROTOOPT" }, +{ 10043 , "WSAEPROTONOSUPPORT" }, +{ 10044 , "WSAESOCKTNOSUPPORT" }, +{ 10045 , "WSAEOPNOTSUPP" }, +{ 10046 , "WSAEPFNOSUPPORT" }, +{ 10047 , "WSAEAFNOSUPPORT" }, +{ 10048 , "WSAEADDRINUSE" }, +{ 10049 , "WSAEADDRNOTAVAIL" }, +{ 10050 , "WSAENETDOWN" }, +{ 10051 , "WSAENETUNREACH" }, +{ 10052 , "WSAENETRESET" }, +{ 10053 , "WSAECONNABORTED" }, +{ 10054 , "WSAECONNRESET" }, +{ 10055 , "WSAENOBUFS" }, +{ 10056 , "WSAEISCONN" }, +{ 10057 , "WSAENOTCONN" }, +{ 10058 , "WSAESHUTDOWN" }, +{ 10059 , "WSAETOOMANYREFS" }, +{ 10060 , "WSAETIMEDOUT" }, +{ 10061 , "WSAECONNREFUSED" }, +{ 10062 , "WSAELOOP" }, +{ 10063 , "WSAENAMETOOLONG" }, +{ 10064 , "WSAEHOSTDOWN" }, +{ 10065 , "WSAEHOSTUNREACH" }, +{ 10066 , "WSAENOTEMPTY" }, +{ 10067 , "WSAEPROCLIM" }, +{ 10068 , "WSAEUSERS" }, +{ 10069 , "WSAEDQUOT" }, +{ 10070 , "WSAESTALE" }, +{ 10071 , "WSAEREMOTE" }, +{ 10101 , "WSAEDISCON" }, +{ 10091 , "WSASYSNOTREADY" }, +{ 10092 , "WSAVERNOTSUPPORTED" }, +{ 10093 , "WSANOTINITIALISED" }, +{ 11001 , "WSAHOST_NOT_FOUND" }, +{ 11002 , "WSATRY_AGAIN" }, +{ 11003 , "WSANO_RECOVERY" }, +{ 11004 , "WSANO_DATA" }, +{ 0, NULL } +}; diff --git a/include/base/plist.h b/include/base/plist.h new file mode 100644 index 00000000..d9ab744f --- /dev/null +++ b/include/base/plist.h @@ -0,0 +1,61 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef _PLIST_H +#define _PLIST_H + +#ifndef NOINTNSACL +#define INTNSACL +#endif /* !NOINTNSACL */ + +/* + * TYPE: PList_t + * + * DESCRIPTION: + * + * This type defines a handle for a property list. + */ + +#include "base/pool.h" + +#ifndef PUBLIC_NSACL_PLISTDEF_H +#include "../public/nsacl/plistdef.h" +#endif /* !PUBLIC_NSACL_PLISTDEF_H */ + +#ifdef INTNSACL + +/* Functions in plist.c */ +NSPR_BEGIN_EXTERN_C + +NSAPI_PUBLIC extern int PListAssignValue(PList_t plist, const char *pname, + const void *pvalue, PList_t ptype); +NSAPI_PUBLIC extern PList_t PListCreate(pool_handle_t *mempool, + int resvprop, int maxprop, int flags); +NSAPI_PUBLIC extern int PListDefProp(PList_t plist, int pindex, + const char *pname, const int flags); +NSAPI_PUBLIC extern const void * PListDeleteProp(PList_t plist, int pindex, const char *pname); +NSAPI_PUBLIC extern int PListFindValue(PList_t plist, + const char *pname, void **pvalue, PList_t *type); +NSAPI_PUBLIC extern int PListInitProp(PList_t plist, int pindex, const char *pname, + const void *pvalue, PList_t ptype); +NSAPI_PUBLIC extern PList_t PListNew(pool_handle_t *mempool); +NSAPI_PUBLIC extern void PListDestroy(PList_t plist); +NSAPI_PUBLIC extern int PListGetValue(PList_t plist, + int pindex, void **pvalue, PList_t *type); +NSAPI_PUBLIC extern int PListNameProp(PList_t plist, int pindex, const char *pname); +NSAPI_PUBLIC extern int PListSetType(PList_t plist, int pindex, PList_t type); +NSAPI_PUBLIC extern int PListSetValue(PList_t plist, + int pindex, const void *pvalue, PList_t type); +NSAPI_PUBLIC extern void PListEnumerate(PList_t plist, PListFunc_t *user_func, + void *user_data); +NSAPI_PUBLIC extern PList_t +PListDuplicate(PList_t plist, pool_handle_t *new_mempool, int flags); +NSAPI_PUBLIC extern pool_handle_t *PListGetPool(PList_t plist); + +NSPR_END_EXTERN_C + +#endif /* INTNSACL */ + +#endif /* _PLIST_H */ diff --git a/include/base/pool.h b/include/base/pool.h new file mode 100644 index 00000000..bca055c7 --- /dev/null +++ b/include/base/pool.h @@ -0,0 +1,103 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef BASE_POOL_H +#define BASE_POOL_H + +#ifndef NOINTNSAPI +#define INTNSAPI +#endif /* !NOINTNSAPI */ + +/* + * pool.h + * + * Module for handling memory allocations. + * + * Notes: + * This module is used instead of the NSPR prarena module because the prarenas + * did not fit as cleanly into the existing server. + * + * Mike Belshe + * 10-02-95 + * + */ + +#ifdef MALLOC_POOLS + +#ifndef NETSITE_H +#include "netsite.h" +#endif /* !NETSITE_H */ + +#ifndef BASE_PBLOCK_H +#include "pblock.h" +#endif /* !BASE_PBLOCK_H */ + +#ifndef BASE_SESSION_H +#include "session.h" +#endif /* !BASE_SESSION_H */ + +#ifndef FRAME_REQ_H +#include "frame/req.h" +#endif /* !FRAME_REQ_H */ + +#ifndef PUBLIC_BASE_POOL_H +#include "public/base/pool.h" +#endif /* !PUBLIC_BASE_POOL_H */ + +/* --- Begin function prototypes --- */ + +#ifdef INTNSAPI + +NSPR_BEGIN_EXTERN_C + +int pool_internal_init(void); + +NSAPI_PUBLIC int INTpool_init(pblock *pb, Session *sn, Request *rq); + +#ifdef DEBUG_CACHES +NSAPI_PUBLIC int INTpool_service_debug(pblock *pb, Session *sn, Request *rq); +#endif + +NSAPI_PUBLIC pool_handle_t *INTpool_create(void); + +NSAPI_PUBLIC void INTpool_destroy(pool_handle_t *pool_handle); + +NSAPI_PUBLIC int INTpool_enabled(void); + +NSAPI_PUBLIC void *INTpool_malloc(pool_handle_t *pool_handle, size_t size ); + +NSAPI_PUBLIC void INTpool_free(pool_handle_t *pool_handle, void *ptr ); + +NSAPI_PUBLIC +void *INTpool_calloc(pool_handle_t *pool_handle, size_t nelem, size_t elsize); + +NSAPI_PUBLIC +void *INTpool_realloc(pool_handle_t *pool_handle, void *ptr, size_t size ); + +NSAPI_PUBLIC +char *INTpool_strdup(pool_handle_t *pool_handle, const char *orig_str ); + +NSPR_END_EXTERN_C + +#define pool_init INTpool_init + +#ifdef DEBUG_CACHES +#define pool_service_debug INTpool_service_debug +#endif /* DEBUG_CACHES */ + +#define pool_create INTpool_create +#define pool_destroy INTpool_destroy +#define pool_enabled INTpool_enabled +#define pool_malloc INTpool_malloc +#define pool_free INTpool_free +#define pool_calloc INTpool_calloc +#define pool_realloc INTpool_realloc +#define pool_strdup INTpool_strdup + +#endif /* INTNSAPI */ + +#endif /* MALLOC_POOLS */ + +#endif /* !BASE_POOL_H_ */ diff --git a/include/base/rwlock.h b/include/base/rwlock.h new file mode 100644 index 00000000..2111e97b --- /dev/null +++ b/include/base/rwlock.h @@ -0,0 +1,54 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/* + * rwlock.h: Shared/Exclusive lock abstraction. + * + * Sanjay Krishnamurthi + */ +#ifndef _BASE_RWLOCK_H_ +#define _BASE_RWLOCK_H_ + +#include "netsite.h" +#include "crit.h" + +NSPR_BEGIN_EXTERN_C + +typedef void* RWLOCK; + +/* + * rwlock_Init() + * creates and returns a new readwrite lock variable. + */ +NSAPI_PUBLIC RWLOCK rwlock_Init(void); + +/* + * rwlock_ReadLock() + */ +NSAPI_PUBLIC void rwlock_ReadLock(RWLOCK lock); + +/* + * rwlock_WriteLock() + */ +NSAPI_PUBLIC void rwlock_WriteLock(RWLOCK lock); + +/* + * rwlock_Unlock() + */ +NSAPI_PUBLIC void rwlock_Unlock(RWLOCK lock); + +/* + * rwlock_DemoteLock() + */ +NSAPI_PUBLIC void rwlock_DemoteLock(RWLOCK lock); + +/* + * rwlock_terminate removes a previously allocated RWLOCK variable. + */ +NSAPI_PUBLIC void rwlock_Terminate(RWLOCK lock); + +NSPR_END_EXTERN_C + +#endif /* _BASE_RWLOCK_H_ */ diff --git a/include/base/shexp.h b/include/base/shexp.h new file mode 100644 index 00000000..f1a5aab6 --- /dev/null +++ b/include/base/shexp.h @@ -0,0 +1,114 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef BASE_SHEXP_H +#define BASE_SHEXP_H + +#ifndef NOINTNSAPI +#define INTNSAPI +#endif /* !NOINTNSAPI */ + +/* + * shexp.h: Defines and prototypes for shell exp. match routines + * + * + * This routine will match a string with a shell expression. The expressions + * accepted are based loosely on the expressions accepted by zsh. + * + * o * matches anything + * o ? matches one character + * o \ will escape a special character + * o $ matches the end of the string + * o [abc] matches one occurence of a, b, or c. The only character that needs + * to be escaped in this is ], all others are not special. + * o [a-z] matches any character between a and z + * o [^az] matches any character except a or z + * o ~ followed by another shell expression will remove any pattern + * matching the shell expression from the match list + * o (foo|bar) will match either the substring foo, or the substring bar. + * These can be shell expressions as well. + * + * The public interface to these routines is documented in + * public/base/shexp.h. + * + * Rob McCool + * + */ + +/* + * Requires that the macro MALLOC be set to a "safe" malloc that will + * exit if no memory is available. If not under MCC httpd, define MALLOC + * to be the real malloc and play with fire, or make your own function. + */ + +#ifndef NETSITE_H +#include "../netsite.h" +#endif /* !NETSITE_H */ + +#ifndef OS_CTYPE_H +#include /* isalnum */ +#define OS_CTYPE_H +#endif /* !OS_CTYPE_H */ + +#ifndef OS_STRING_H +#include /* strlen */ +#define OS_STRING_H +#endif /* !OS_STRING_H */ + +/* See public/base/shexp.h or public/base/regexp.h concerning USE_REGEX */ + +/* + * This little bit of nonsense is because USE_REGEX is currently + * supposed to be recognized only by the proxy. If that's the + * case, only the proxy should define USE_REGEX, but I'm playing + * it safe. XXXHEP 12/96 + */ +#ifndef MCC_PROXY +#ifdef USE_REGEX +#define SAVED_USE_REGEX USE_REGEX +#undef USE_REGEX +#endif /* USE_REGEX */ +#endif /* !MCC_PROXY */ + +#ifndef PUBLIC_BASE_SHEXP_H +#include "public/base/shexp.h" +#endif /* !PUBLIC_BASE_SHEXP_H */ + +/* --- Begin function prototypes --- */ + +#ifdef INTNSAPI + +NSPR_BEGIN_EXTERN_C + +NSAPI_PUBLIC int INTshexp_valid(char *exp); + +NSAPI_PUBLIC int INTshexp_match(char *str, char *exp); + +NSAPI_PUBLIC int INTshexp_cmp(char *str, char *exp); + +NSAPI_PUBLIC int INTshexp_casecmp(char *str, char *exp); + +NSPR_END_EXTERN_C + +/* --- End function prototypes --- */ + +#define shexp_valid INTshexp_valid +#define shexp_match INTshexp_match +#define shexp_cmp INTshexp_cmp +#define shexp_casecmp INTshexp_casecmp + +#endif /* INTNSAPI */ + +/* Restore USE_REGEX definition for non-proxy. See above. */ +#ifdef SAVED_USE_REGEX +#define USE_REGEX SAVED_USE_REGEX +#undef SAVED_USE_REGEX +#endif /* SAVED_USE_REGEX */ + +#ifdef USE_REGEX +#include "base/regexp.h" +#endif /* USE_REGEX */ + +#endif /* !BASE_SHEXP_H */ diff --git a/include/base/systems.h b/include/base/systems.h new file mode 100644 index 00000000..ca28c453 --- /dev/null +++ b/include/base/systems.h @@ -0,0 +1,565 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef BASE_SYSTEMS_H +#define BASE_SYSTEMS_H + +#ifndef NOINTNSAPI +#define INTNSAPI +#endif /* !NOINTNSAPI */ + +/* + * systems.h: Lists of defines for systems + * + * This sets what general flavor the system is (UNIX, etc.), + * and defines what extra functions your particular system needs. + */ + + +/* --- Begin common definitions for all supported platforms --- */ + +#define DAEMON_ANY +#define DAEMON_STATS + +/* --- End common definitions for all supported platforms --- */ + +/* --- Begin platform-specific definitions --- */ + +#if defined(AIX) + +#define ACCELERATOR_CACHE +#define AUTH_DBM +#define BSD_RLIMIT +#undef BSD_SIGNALS +/* AIX can handle really big shoes */ +#define DAEMON_LISTEN_SIZE 4096 +#define DAEMON_NEEDS_SEMAPHORE +#define DAEMON_UNIX_MOBRULE +#define DLL_CAPABLE +#define DLL_DLOPEN +#define DLL_DLOPEN_FLAGS RTLD_NOW|RTLD_GLOBAL +#define DNS_CACHE +#define FILE_INHERIT_FCNTL +#define FILE_MMAP_FLAGS MAP_SHARED +#define HAS_STATFS +#define HAVE_ATEXIT +#define HAVE_PW_R /* reent passwd routines */ +#define HAVE_STRERROR_R +#define HAVE_STRTOK_R +#define HAVE_TIME_R 2 /* arg count */ +#define HAVE_STRFTIME /* no cftime */ +#define JAVA_STATIC_LINK +#undef NEED_CRYPT_H +#define NEED_SETEID_PROTO /* setegid, seteuid */ +#define NEED_STRINGS_H /* for strcasecmp */ +#define NET_SOCKETS +#define SA_HANDLER_T(x) (void (*)(int))x +#if OSVERSION < 4210 +#define SA_NOCLDWAIT 0 /* AIX < 4.2 don't got this */ +#endif /* OSVERSION < 4210 */ +#define SHMEM_MMAP_FLAGS MAP_SHARED +#ifdef HW_THREADS +#define THREAD_ANY +#endif + +#elif defined(BSDI) + +#define ACCELERATOR_CACHE +#define AUTH_DBM +#define BSD_MAIL +#define BSD_RLIMIT +#define BSD_SIGNALS +#define BSD_TIME +#define DAEMON_UNIX_MOBRULE +#define DNS_CACHE +#define FILE_INHERIT_FCNTL +#define FILE_MMAP_FLAGS (MAP_FILE | MAP_SHARED) +#define HAS_STATFS +#define HAVE_ATEXIT +#undef NEED_CRYPT_PROTO +#define NET_SOCKETS +#ifndef NO_DOMAINNAME +#define NO_DOMAINNAME +#endif +#define SHMEM_MMAP_FLAGS MAP_SHARED +#define JAVA_STATIC_LINK + +#elif defined(HPUX) + +#define ACCELERATOR_CACHE +#define AUTH_DBM +#undef BSD_RLIMIT +#undef BSD_SIGNALS +#ifdef MCC_PROXY +#define DAEMON_NEEDS_SEMAPHORE +#else +#undef DAEMON_NEEDS_SEMAPHORE +#endif +#define DAEMON_UNIX_MOBRULE +#define DLL_CAPABLE +#define DLL_HPSHL +#define DNS_CACHE +#define FILE_INHERIT_FCNTL +#define FILE_MMAP_FLAGS MAP_PRIVATE +#define HAS_STATFS +#define HAVE_ATEXIT +#define HAVE_STRFTIME +#define JAVA_STATIC_LINK +#undef NEED_CRYPT_H +#define NET_SOCKETS +#define SA_HANDLER_T(x) (void (*)(int))x +/* warning: mmap doesn't work under 9.04 */ +#define SHMEM_MMAP_FLAGS MAP_FILE | MAP_VARIABLE | MAP_SHARED + +#elif defined (IRIX) + +#define ACCELERATOR_CACHE +#define AUTH_DBM +#define BSD_RLIMIT +#undef BSD_SIGNALS +#define DAEMON_UNIX_MOBRULE +#define DLL_CAPABLE +#define DLL_DLOPEN +#define DLL_DLOPEN_FLAGS RTLD_NOW +#define DNS_CACHE +#define FILE_INHERIT_FCNTL +#define FILE_MMAP_FLAGS MAP_SHARED +#define HAS_STATVFS +#define HAVE_ATEXIT +#define HAVE_STRTOK_R +#ifdef IRIX +#define HAVE_TIME_R 2 /* arg count */ +#else +#define HAVE_TIME_R 3 /* arg count */ +#define NEED_SETEID_PROTO /* setegid, seteuid */ +#endif +#define JAVA_STATIC_LINK +#define NEED_CRYPT_H +#define NET_SOCKETS +#define SA_HANDLER_T(x) (void (*)(int))x +#define SHMEM_MMAP_FLAGS MAP_SHARED +#define THROW_HACK throw() + +#elif defined(NCR) + +#define ACCELERATOR_CACHE +#define AUTH_DBM +#undef BSD_RLIMIT +/* #define DAEMON_NEEDS_SEMAPHORE */ +#define DAEMON_UNIX_MOBRULE +#define DLL_CAPABLE +#define DLL_DLOPEN +#define DLL_DLOPEN_FLAGS RTLD_NOW +#define DNS_CACHE +#define FILE_INHERIT_FCNTL +#define FILE_MMAP_FLAGS MAP_SHARED +#define HAS_STATVFS +#define HAVE_ATEXIT +#define HAVE_STRTOK_R +#define JAVA_STATIC_LINK +#define NEED_CRYPT_H +#define NEED_FILIO +#define NEED_GHN_PROTO +#define NET_SOCKETS +#define SHMEM_MMAP_FLAGS MAP_SHARED + +#elif defined(NEC) + +#define ACCELERATOR_CACHE +#define DNS_CACHE +#define AUTH_DBM +#undef BSD_RLIMIT +#define DAEMON_NEEDS_SEMAPHORE +#define DAEMON_UNIX_MOBRULE +#define DLL_DLOPEN +#define DLL_DLOPEN_FLAGS RTLD_NOW +#define DLL_CAPABLE +#define FILE_INHERIT_FCNTL +#define FILE_MMAP_FLAGS MAP_SHARED +#define HAS_STATVFS +#define HAVE_ATEXIT +#define HAVE_STRTOK_R +#define HAVE_TIME_R 2 /* arg count */ +#define JAVA_STATIC_LINK +#define NEED_CRYPT_H +#define NEED_FILIO +#define NET_SOCKETS +#define SHMEM_MMAP_FLAGS MAP_SHARED + +#elif defined(OSF1) + +#define ACCELERATOR_CACHE +#define AUTH_DBM +#define BSD_RLIMIT +#undef BSD_SIGNALS +#define BSD_TIME +#define DAEMON_NEEDS_SEMAPHORE +#define DAEMON_UNIX_MOBRULE +#define DLL_CAPABLE +#define DLL_DLOPEN +#define DLL_DLOPEN_FLAGS RTLD_NOW +#define DNS_CACHE +#define FILE_INHERIT_FCNTL +#define FILE_MMAP_FLAGS MAP_SHARED +#define HAVE_ATEXIT +#define HAVE_STRFTIME /* no cftime */ +#define HAVE_TIME_R 2 /* ctime_r arg count */ +#define NET_SOCKETS +#define SA_HANDLER_T(x) (void (*)(int))x +#define SHMEM_MMAP_FLAGS MAP_SHARED + +#elif defined(SCO) + +#define ACCELERATOR_CACHE +#define AUTH_DBM +#undef BSD_RLIMIT +#undef BSD_SIGNALS +#define DAEMON_NEEDS_SEMAPHORE +#define DAEMON_UNIX_MOBRULE +#define DLL_CAPABLE +#define DLL_DLOPEN +#define DLL_DLOPEN_FLAGS RTLD_NOW +#define DNS_CACHE +#define FILE_INHERIT_FCNTL +#define FILE_MMAP_FLAGS MAP_SHARED +#define HAS_STATVFS +#define HAVE_ATEXIT +#undef NEED_CRYPT_H +#undef NEED_FILIO +#undef NEED_GHN_PROTO +#undef NEED_SETEID_PROTO /* setegid, seteuid */ +#define NET_SOCKETS +#define SHMEM_MMAP_FLAGS MAP_SHARED +#define SA_HANDLER_T(x) (void (*)(int))x + + +#elif defined(SNI) + +#define ACCELERATOR_CACHE +#define AUTH_DBM +#undef BSD_RLIMIT +#define DAEMON_NEEDS_SEMAPHORE +#define DAEMON_UNIX_MOBRULE +#define DLL_CAPABLE +#define DLL_DLOPEN +#define DLL_DLOPEN_FLAGS RTLD_NOW +#define DNS_CACHE +#define FILE_INHERIT_FCNTL +#define FILE_MMAP_FLAGS MAP_SHARED +#define HAS_STATVFS +#define HAVE_ATEXIT +#define JAVA_STATIC_LINK +#define NEED_CRYPT_H +#define NEED_FILIO +#define NEED_SETEID_PROTO /* setegid, seteuid */ +#define NET_SOCKETS +#define SHMEM_MMAP_FLAGS MAP_SHARED +#define TCPLEN_T size_t +#define USE_PIPE +/* + * define this if your C++ platform has separate inline functions for + * e.g. const char *strchr(const char *, char) + * and + * char *strchr(char *, char) + * and your compiler complains about this: + * func(const char *bla) + * { + * char *fasel = strchr(bla, '.'); + * .... + * because it says that you cannot initialize a char * with a const char * + */ +#define HAS_CONSTVALUED_STRFUNCS + +/* hack for C++ platforms where bool is a keyword */ +#ifndef boolean +#define boolean boolean +#endif + +#elif defined(Linux) + +#define ACCELERATOR_CACHE +#define DNS_CACHE +#define FILE_INHERIT_FCNTL +#define DAEMON_UNIX_MOBRULE +#define BSD_RLIMIT +#undef BSD_SIGNALS +#define FILE_UNIX_MMAP +#define FILE_MMAP_FLAGS (MAP_FILE | MAP_SHARED) +#define SHMEM_UNIX_MMAP +#define SHMEM_MMAP_FLAGS MAP_SHARED +#define AUTH_DBM +#define SEM_FLOCK +#define DLL_CAPABLE +#define DLL_DLOPEN +#define DLL_DLOPEN_FLAGS RTLD_NOW +#define HAVE_ATEXIT +#define HAS_STATFS +#define JAVA_STATIC_LINK +#define SA_HANDLER_T(x) (void (*)(int))(x) +#define SA_NOCLDWAIT 0 /* Linux doesn't have this */ +#define TCPLEN_T size_t + +#undef NEED_CRYPT_PROTO +#define NET_SOCKETS +#ifndef NO_DOMAINNAME +#define NO_DOMAINNAME +#endif +#elif defined(SOLARIS) || defined(SOLARISx86) + +#define ACCELERATOR_CACHE +#define AUTH_DBM +#define BSD_RLIMIT +#undef BSD_SIGNALS +#define DAEMON_NEEDS_SEMAPHORE +#define DAEMON_UNIX_MOBRULE +#define DLL_CAPABLE +#define DLL_DLOPEN +#define DLL_DLOPEN_FLAGS RTLD_NOW +#define DNS_CACHE +#define FILE_INHERIT_FCNTL +#define FILE_MMAP_FLAGS MAP_SHARED +#define HAS_STATVFS +#define HAVE_ATEXIT +#define HAVE_PW_R +#define HAVE_STRTOK_R +#define HAVE_TIME_R 3 /* arg count */ +#define NEED_CRYPT_H +#define NEED_FILIO +#if OSVERSION < 506 || OSVERSION == 50501 +#define NEED_GHN_PROTO +#endif +#define NET_SOCKETS +#if OSVERSION > 504 +#define SA_HANDLER_T(x) x +#endif +#define SHMEM_MMAP_FLAGS MAP_SHARED + +#elif defined (SONY) + +#define AUTH_DBM +#undef BSD_RLIMIT +#define DAEMON_NEEDS_SEMAPHORE +#define DAEMON_UNIX_MOBRULE +#define DLL_CAPABLE +#define FILE_INHERIT_FCNTL +#define FILE_MMAP_FLAGS MAP_SHARED +#define HAVE_ATEXIT +#define NEED_CRYPT_H +#define NEED_FILIO +#define NET_SOCKETS +#define SHMEM_MMAP_FLAGS MAP_SHARED + +#elif defined(SUNOS4) + +#define ACCELERATOR_CACHE +#define AUTH_DBM +#define BSD_MAIL +#define BSD_RLIMIT +#define BSD_SIGNALS +#define BSD_TIME +#define DAEMON_UNIX_MOBRULE +#define DLL_CAPABLE +#define DLL_DLOPEN +#define DLL_DLOPEN_FLAGS 1 +#define DNS_CACHE +#define FILE_INHERIT_FCNTL +#define FILE_MMAP_FLAGS MAP_SHARED +#define HAS_STATFS +#undef HAVE_ATEXIT +#undef NEED_CRYPT_H +#define NEED_CRYPT_PROTO +#define NEED_FILIO +#define NET_SOCKETS +#define SHMEM_MMAP_FLAGS MAP_SHARED + +#elif defined(UNIXWARE) || defined(UnixWare) + +#define ACCELERATOR_CACHE +#define AUTH_DBM +#undef BSD_RLIMIT +#define DAEMON_UNIX_MOBRULE +#define DLL_CAPABLE +#define DLL_DLOPEN +#define DLL_DLOPEN_FLAGS RTLD_NOW +#define DNS_CACHE +#define FILE_INHERIT_FCNTL +#define FILE_MMAP_FLAGS MAP_SHARED +#define HAS_STATVFS +#define HAVE_ATEXIT +#define NEED_CRYPT_H +#define NEED_FILIO +#define NEED_GHN_PROTO +#define NEED_SETEID_PROTO /* setegid, seteuid */ +#define NET_SOCKETS +#define SHMEM_MMAP_FLAGS MAP_SHARED + +#ifndef boolean +#define boolean boolean +#endif + +#if defined (UnixWare) +/* UnixWare but not UNIXWARE... */ +#define NEED_STRINGS_H /* for strcasecmp */ +#define SA_HANDLER_T(x) (void (*)(int))x +#endif + +#elif defined (XP_WIN32) /* Windows NT */ + +#include +#include + +typedef void* PASSWD; + +#define ACCELERATOR_CACHE +#define AUTH_DBM +/* size has been raised to 200 with NT 4.0 server; NT 4.0 workstation is still + * limited + */ +#define DAEMON_LISTEN_SIZE 200 +#define DAEMON_WIN32 +#define DLL_CAPABLE +#define DLL_WIN32 +#define DNS_CACHE +#define LOG_BUFFERING +#define HAVE_STRFTIME /* no cftime */ +#define NEED_CRYPT_PROTO +#define NEEDS_WRITEV +#define NET_SOCKETS +#ifndef NO_DOMAINNAME +#define NO_DOMAINNAME +#endif +#ifdef BUILD_DLL +#define NSAPI_PUBLIC __declspec(dllexport) +#else +#define NSAPI_PUBLIC +#endif /* BUILD_DLL */ +#define THREAD_ANY +#define THREAD_NSPR_KERNEL +#define USE_NSPR +#define USE_STRFTIME /* no cftime */ + +#else + +#error "Missing defines in ns/netsite/include/base/systems.h" + +#endif /* Windows NT */ + +/* Pick up the configuration symbols in the public interface */ +#ifndef PUBLIC_BASE_SYSTEMS_H +#include "public/base/systems.h" +#endif /* PUBLIC_BASE_SYSTEMS_H */ + +/* --- Begin defaults for values not defined above --- */ + +#ifndef DAEMON_LISTEN_SIZE +#define DAEMON_LISTEN_SIZE 128 +#endif /* !DAEMON_LISTEN_SIZE */ + +#ifndef SA_HANDLER_T +#define SA_HANDLER_T(x) (void (*)())x +#endif + +#ifdef HAS_CONSTVALUED_STRFUNCS +#define CONSTVALSTRCAST (char *) +#else +#define CONSTVALSTRCAST +#endif + +#ifndef TCPLEN_T +#define TCPLEN_T int +#endif + +#ifndef THROW_HACK +#define THROW_HACK /* as nothing */ +#endif + + +/* --- End defaults for values not defined above --- */ + +/* --- Begin the great debate --- */ + +/* NS_MAIL builds sec-key.c which calls systhread_init, which requires */ +/* that USE_NSPR is defined when systhr.c is compiled. --lachman */ +/* MCC_PROXY does the same thing now --nbreslow -- LIKE HELL --ari */ +#if (defined(MCC_HTTPD) || defined(MCC_ADMSERV) || defined(MCC_PROXY) || defined(NS_MAIL)) && defined(XP_UNIX) +#define USE_NSPR +/* XXXrobm This is UNIX-only for the moment */ +#define LOG_BUFFERING +#ifdef SW_THREADS +#define THREAD_NSPR_USER +#else +#define THREAD_NSPR_KERNEL +#ifdef IRIX +#undef SEM_FLOCK +#define SEM_IRIX +#endif +#endif +#define THREAD_ANY +#endif + +/* --- End the great debate --- */ + +#ifndef APSTUDIO_READONLY_SYMBOLS + +#ifndef NSPR_PRIO_H +#include +#define NSPR_PRIO_H +#endif /* !NSPR_PRIO_H */ + +/* + * These types have to be defined early, because they are defined + * as (void *) in the public API. + */ + +#ifndef SYS_FILE_T +typedef PRFileDesc *SYS_FILE; +#define SYS_FILE_T PRFileDesc * +#endif /* !SYS_FILE_T */ + +#ifndef SYS_NETFD_T +typedef PRFileDesc *SYS_NETFD; +#define SYS_NETFD_T PRFileDesc * +#endif /* !SYS_NETFD_T */ + +#ifdef SEM_WIN32 + +typedef HANDLE SEMAPHORE; +#define SEMAPHORE_T HANDLE +#define SEM_ERROR NULL +/* That oughta hold them (I hope) */ +#define SEM_MAXVALUE 32767 + +#elif defined(SEM_IRIX) + +#ifndef OS_ULOCKS_H +#include +#define OS_ULOCKS_H +#endif /* !OS_ULOCKS_H */ + +typedef struct { + usptr_t *arena; + usema_t *sem; +} semirix_s; +typedef semirix_s* SEMAPHORE; +#define SEMAPHORE_T semirix_s * +#define SEM_ERROR NULL + +#elif defined(SEM_FLOCK) + +#define SEMAPHORE_T SYS_FILE +typedef SYS_FILE SEMAPHORE; +#define SEM_ERROR NULL + +#else /* ! SEM_WIN32, !SEM_IRIX */ + +typedef int SEMAPHORE; +#define SEMAPHORE_T int +#define SEM_ERROR -1 + +#endif /* SEM_WIN32 */ + +#endif /* !APSTUDIO_READONLY_SYMBOLS */ + +#endif /* BASE_SYSTEMS_H */ diff --git a/include/base/systhr.h b/include/base/systhr.h new file mode 100644 index 00000000..714246df --- /dev/null +++ b/include/base/systhr.h @@ -0,0 +1,91 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef BASE_SYSTHR_H +#define BASE_SYSTHR_H + +#ifndef NOINTNSAPI +#define INTNSAPI +#endif /* !NOINTNSAPI */ + +/* + * systhr.h: Abstracted threading mechanisms + * + * Rob McCool + */ + +#ifndef NETSITE_H +#include "netsite.h" +#endif /* !NETSITE_H */ + +#ifdef THREAD_ANY + +#ifndef PUBLIC_BASE_SYSTHR_H +#include "public/base/systhr.h" +#endif /* !PUBLIC_BASE_SYSTHR_H */ + +/* --- Begin function prototypes --- */ + +#ifdef INTNSAPI + +NSPR_BEGIN_EXTERN_C + +#ifdef UnixWare +typedef void(*ArgFn_systhread_start)(void *); +NSAPI_PUBLIC +SYS_THREAD INTsysthread_start( int prio, int stksz, \ + ArgFn_systhread_start, void *arg); +#else +NSAPI_PUBLIC +SYS_THREAD INTsysthread_start(int prio, int stksz, void (*fn)(void *), void *arg); +#endif + +NSAPI_PUBLIC SYS_THREAD INTsysthread_current(void); + +NSAPI_PUBLIC void INTsysthread_yield(void); + +NSAPI_PUBLIC SYS_THREAD INTsysthread_attach(void); + +NSAPI_PUBLIC void INTsysthread_detach(SYS_THREAD thr); + +NSAPI_PUBLIC void INTsysthread_terminate(SYS_THREAD thr); + +NSAPI_PUBLIC void INTsysthread_sleep(int milliseconds); + +NSAPI_PUBLIC void INTsysthread_init(char *name); + +NSAPI_PUBLIC void INTsysthread_timerset(int usec); + +NSAPI_PUBLIC int INTsysthread_newkey(void); + +NSAPI_PUBLIC void *INTsysthread_getdata(int key); + +NSAPI_PUBLIC void INTsysthread_setdata(int key, void *data); + +NSAPI_PUBLIC +void INTsysthread_set_default_stacksize(unsigned long size); + +NSPR_END_EXTERN_C + +/* --- End function prototypes --- */ +#define systhread_start INTsysthread_start +#define systhread_current INTsysthread_current +#define systhread_yield INTsysthread_yield +#define systhread_attach INTsysthread_attach +#define systhread_detach INTsysthread_detach +#define systhread_terminate INTsysthread_terminate +#define systhread_sleep INTsysthread_sleep +#define systhread_init INTsysthread_init +#define systhread_timerset INTsysthread_timerset +#define systhread_newkey INTsysthread_newkey +#define systhread_getdata INTsysthread_getdata +#define systhread_setdata INTsysthread_setdata +#define systhread_set_default_stacksize INTsysthread_set_default_stacksize + +#endif /* INTNSAPI */ + +#endif /* THREAD_ANY */ + +#endif /* !BASE_SYSTHR_H */ diff --git a/include/base/util.h b/include/base/util.h new file mode 100644 index 00000000..7778b924 --- /dev/null +++ b/include/base/util.h @@ -0,0 +1,210 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef BASE_UTIL_H +#define BASE_UTIL_H + +#ifndef NOINTNSAPI +#define INTNSAPI +#endif /* !NOINTNSAPI */ + +/* + * util.h: A hodge podge of utility functions and standard functions which + * are unavailable on certain systems + * + * Rob McCool + */ + +/* Needed for various reentrant functions */ +#define DEF_CTIMEBUF 26 +#define DEF_ERRBUF 256 +#define DEF_PWBUF 256 + +#ifndef BASE_BUFFER_H +#include "buffer.h" /* filebuf for getline */ +#endif /* !BASE_BUFFER_H */ + +#ifndef PUBLIC_BASE_UTIL_H +#include "public/base/util.h" +#endif /* !PUBLIC_BASE_UTIL_H */ + +/* --- Begin common function prototypes --- */ + +#ifdef INTNSAPI + +NSPR_BEGIN_EXTERN_C + +NSAPI_PUBLIC +int INTutil_getline(filebuffer *buf, int lineno, int maxlen, char *l); + +NSAPI_PUBLIC char **INTutil_env_create(char **env, int n, int *pos); + +NSAPI_PUBLIC char *INTutil_env_str(char *name, char *value); + +NSAPI_PUBLIC void INTutil_env_replace(char **env, char *name, char *value); + +NSAPI_PUBLIC void INTutil_env_free(char **env); + +NSAPI_PUBLIC char **INTutil_env_copy(char **src, char **dst); + +NSAPI_PUBLIC char *INTutil_env_find(char **env, char *name); + +NSAPI_PUBLIC char *INTutil_hostname(void); + +NSAPI_PUBLIC int INTutil_chdir2path(char *path); + +NSAPI_PUBLIC int INTutil_is_mozilla(char *ua, char *major, char *minor); + +NSAPI_PUBLIC int INTutil_is_url(char *url); + +NSAPI_PUBLIC int INTutil_later_than(struct tm *lms, char *ims); + +NSAPI_PUBLIC int INTutil_time_equal(struct tm *lms, char *ims); + +NSAPI_PUBLIC int INTutil_str_time_equal(char *t1, char *t2); + +NSAPI_PUBLIC int INTutil_uri_is_evil(char *t); + +NSAPI_PUBLIC void INTutil_uri_parse(char *uri); + +NSAPI_PUBLIC void INTutil_uri_unescape(char *s); + +NSAPI_PUBLIC char *INTutil_uri_escape(char *d, char *s); + +NSAPI_PUBLIC char *INTutil_url_escape(char *d, char *s); + +NSAPI_PUBLIC char *INTutil_sh_escape(char *s); + +NSAPI_PUBLIC int INTutil_mime_separator(char *sep); + +NSAPI_PUBLIC int INTutil_itoa(int i, char *a); + +NSAPI_PUBLIC +int INTutil_vsprintf(char *s, register const char *fmt, va_list args); + +NSAPI_PUBLIC int INTutil_sprintf(char *s, const char *fmt, ...); + +NSAPI_PUBLIC int INTutil_vsnprintf(char *s, int n, register const char *fmt, + va_list args); + +NSAPI_PUBLIC int INTutil_snprintf(char *s, int n, const char *fmt, ...); + +NSAPI_PUBLIC int INTutil_strftime(char *s, const char *format, const struct tm *t); + +NSAPI_PUBLIC char *INTutil_strtok(char *s1, const char *s2, char **lasts); + +NSAPI_PUBLIC struct tm *INTutil_localtime(const time_t *clock, struct tm *res); + +NSAPI_PUBLIC char *INTutil_ctime(const time_t *clock, char *buf, int buflen); + +NSAPI_PUBLIC char *INTutil_strerror(int errnum, char *msg, int buflen); + +NSAPI_PUBLIC struct tm *INTutil_gmtime(const time_t *clock, struct tm *res); + +NSAPI_PUBLIC char *INTutil_asctime(const struct tm *tm,char *buf, int buflen); + +#ifdef NEED_STRCASECMP +NSAPI_PUBLIC int INTutil_strcasecmp(CASECMPARG_T char *one, CASECMPARG_T char *two); +#endif /* NEED_STRCASECMP */ + +#ifdef NEED_STRNCASECMP +NSAPI_PUBLIC int INTutil_strncasecmp(CASECMPARG_T char *one, CASECMPARG_T char *two, int n); +#endif /* NEED_STRNCASECMP */ + +/* --- End common function prototypes --- */ + +/* --- Begin Unix-only function prototypes --- */ + +#ifdef XP_UNIX + +NSAPI_PUBLIC int INTutil_can_exec(struct stat *finfo, uid_t uid, gid_t gid); + +NSAPI_PUBLIC +struct passwd *INTutil_getpwnam(const char *name, struct passwd *result, + char *buffer, int buflen); + +NSAPI_PUBLIC pid_t INTutil_waitpid(pid_t pid, int *statptr, int options); + +#endif /* XP_UNIX */ + +/* --- End Unix-only function prototypes --- */ + +/* --- Begin Windows-only function prototypes --- */ + +#ifdef XP_WIN32 + +NSAPI_PUBLIC +VOID INTutil_delete_directory(char *FileName, BOOL delete_directory); + +#endif /* XP_WIN32 */ + +/* --- End Windows-only function prototypes --- */ + +NSPR_END_EXTERN_C + +#define util_getline INTutil_getline +#define util_env_create INTutil_env_create +#define util_env_str INTutil_env_str +#define util_env_replace INTutil_env_replace +#define util_env_free INTutil_env_free +#define util_env_copy INTutil_env_copy +#define util_env_find INTutil_env_find +#define util_hostname INTutil_hostname +#define util_chdir2path INTutil_chdir2path +#define util_is_mozilla INTutil_is_mozilla +#define util_is_url INTutil_is_url +#define util_later_than INTutil_later_than +#define util_time_equal INTutil_time_equal +#define util_str_time_equal INTutil_str_time_equal +#define util_uri_is_evil INTutil_uri_is_evil +#define util_uri_parse INTutil_uri_parse +#define util_uri_unescape INTutil_uri_unescape +#define util_uri_escape INTutil_uri_escape +#define util_url_escape INTutil_url_escape +#define util_sh_escape INTutil_sh_escape +#define util_mime_separator INTutil_mime_separator +#define util_itoa INTutil_itoa +#define util_vsprintf INTutil_vsprintf +#define util_sprintf INTutil_sprintf +#define util_vsnprintf INTutil_vsnprintf +#define util_snprintf INTutil_snprintf +#define util_strftime INTutil_strftime +#define util_strcasecmp INTutil_strcasecmp +#define util_strncasecmp INTutil_strncasecmp +#define util_strtok INTutil_strtok +#define util_localtime INTutil_localtime +#define util_ctime INTutil_ctime +#define util_strerror INTutil_strerror +#define util_gmtime INTutil_gmtime +#define util_asctime INTutil_asctime + +#ifdef XP_UNIX +#define util_can_exec INTutil_can_exec +#define util_getpwnam INTutil_getpwnam +#define util_waitpid INTutil_waitpid +#endif /* XP_UNIX */ + +#ifdef XP_WIN32 +#define util_delete_directory INTutil_delete_directory +#endif /* XP_WIN32 */ + +#ifdef NEED_STRCASECMP +#define util_strcasecmp INTutil_strcasecmp +#define strcasecmp INTutil_strcasecmp +#endif /* NEED_STRCASECMP */ + +#ifdef NEED_STRINGS_H /* usually for strcasecmp */ +#include +#endif + +#ifdef NEED_STRNCASECMP +#define util_strncasecmp INTutil_strncasecmp +#define strncasecmp INTutil_strncasecmp +#endif /* NEED_STRNCASECMP */ + +#endif /* INTNSAPI */ + +#endif /* !BASE_UTIL_H */ + diff --git a/include/copyrght.h b/include/copyrght.h new file mode 100644 index 00000000..4f8ec167 --- /dev/null +++ b/include/copyrght.h @@ -0,0 +1,6 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ + diff --git a/include/i18n.h b/include/i18n.h new file mode 100644 index 00000000..1a6e67c4 --- /dev/null +++ b/include/i18n.h @@ -0,0 +1,245 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ + +#ifndef I18N_H +#define I18N_H + +/* Make NSAPI_PUBLIC available */ +#include "base/systems.h" +#include "libadminutil/resource.h" + +typedef res_RESOURCE_TABLE RESOURCE_TABLE; +typedef res_RESOURCE_GLOBAL RESOURCE_GLOBAL; + +/*******************************************************************************/ + +/* + * In accordance with the recommendations in the + * "Netscape Coding Standard for Server Internationalization", + * the following aliases are defined for fprintf, et al., and + * these aliases should be used to clearly indicate the intended + * destination for output. + */ + +#define AdminFprintf fprintf +#define DebugFprintf fprintf + +#define ClientSprintf sprintf +#define AdminSprintf sprintf +#define DebugSprintf sprintf + +#define ClientFputs fputs +#define AdminFputs fputs +#define DebugFputs fputs + +/* more #define, as needed */ + +/*******************************************************************************/ + +/* + * Function prototypes for application and libraries + */ + + +#ifdef __cplusplus +extern "C" +{ +#endif + +/***************************/ +/* XP_InitStringDatabase() */ +/***************************/ + +NSAPI_PUBLIC +void +XP_InitStringDatabase(char* pathCWD, char* databaseName); + +/* Initialize the resource string database */ + +/******************************/ +/* XP_GetStringFromDatabase() */ +/******************************/ + +NSAPI_PUBLIC +extern char* +XP_GetStringFromDatabase(char* strLibraryName, + char* strLanguage, + int iToken); + +/* 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 +}; + +NSAPI_PUBLIC +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() */ +/***********************/ + +NSAPI_PUBLIC +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() */ +/**********************/ + +NSAPI_PUBLIC +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() */ +/************************/ + +NSAPI_PUBLIC +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() */ +/************************/ + +NSAPI_PUBLIC +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) */ + +/********************/ +/* XP_AccLangList() */ +/********************/ + +#define MAX_ACCEPT_LANGUAGE 16 +#define MAX_ACCEPT_LENGTH 18 + +typedef char ACCEPT_LANGUAGE_LIST[MAX_ACCEPT_LANGUAGE][MAX_ACCEPT_LENGTH]; + +NSAPI_PUBLIC +int +XP_AccLangList(char* AcceptLanguage, + ACCEPT_LANGUAGE_LIST AcceptLanguageList); + +#ifdef __cplusplus +} +#endif + + +/*******************************************************************************/ + +/* + * Function prototypes for building string database + */ + +extern int XP_MakeStringDatabase(void); + +/* Used to create the string database at build time; not used by the application + itself. Returns 0 is successful. */ + +extern void XP_PrintStringDatabase(void); + +/* DEBUG: Prints out entire string database to standard output. */ + +/*******************************************************************************/ + +/* + * Macros to simplify calls to XP_GetStringFromDatabase + * (need one argument instead of three) + */ + +#define XP_GetClientStr(DBTTokenName) \ + XP_GetStringFromDatabase(LIBRARY_NAME, \ + GetClientLanguage(), \ + DBTTokenName) + +#define XP_GetAdminStr(DBTTokenName) \ + XP_GetStringFromDatabase(LIBRARY_NAME, \ + "en", \ + DBTTokenName) + +/*******************************************************************************/ + + +/*******************************************************************************/ + +/* + * Define the ResDef macro to simplify the maintenance of strings which are to + * be added to the library or application header file (dbtxxx.h). This enables + * source code to refer to the strings by theit TokenNames, and allows the + * strings to be stored in the database. + * + * Usage: ResDef(TokenName,TokenValue,String) + * + * Example: ResDef(DBT_HelloWorld_, \ + * 1,"Hello, World!") + * ResDef(DBT_TheCowJumpedOverTheMoon_, \ + * 2,"The cow jumped over the moon.") + * ResDef(DBT_TheValueOfPiIsAbout31415926536_, \ + * 3,"The value of PI is about 3.1415926536." + * + * RESOURCE_STR is used by makstrdb.c only. It is not used by getstrdb.c or + * in library or application source code. + */ + +#if 0 +#define BEGIN_STR(argLibraryName) \ + enum { +#define ResDef(argToken,argID,argString) \ + argToken = argID, +#define END_STR(argLibraryName) \ + argLibraryName ## top }; + +#endif +/*******************************************************************************/ + +#endif diff --git a/include/ldaputil/cert.h b/include/ldaputil/cert.h new file mode 100644 index 00000000..4dac8f05 --- /dev/null +++ b/include/ldaputil/cert.h @@ -0,0 +1,27 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef _LDAPU_CERT_H +#define _LDAPU_CERT_H + +#ifndef NSAPI_PUBLIC +#ifdef XP_WIN32 +#define NSAPI_PUBLIC __declspec(dllexport) +#else +#define NSAPI_PUBLIC +#endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +NSAPI_PUBLIC int ldapu_get_cert (void *SSLendpoint, void **cert); + +#ifdef __cplusplus +} +#endif + +#endif /* _LDAPU_CERT_H */ diff --git a/include/ldaputil/certmap.h b/include/ldaputil/certmap.h new file mode 100644 index 00000000..921cbd06 --- /dev/null +++ b/include/ldaputil/certmap.h @@ -0,0 +1,124 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef _LDAPU_CERTMAP_H +#define _LDAPU_CERTMAP_H + +#ifndef INTLDAPU +#define INTLDAPU +#endif /* INTLDAPU */ + +#include "extcmap.h" + +enum { + LDAPU_STR_FILTER_DEFAULT, + LDAPU_STR_FILTER_USER, + LDAPU_STR_FILTER_GROUP, + LDAPU_STR_FILTER_MEMBER, + LDAPU_STR_FILTER_MEMBER_RECURSE, + LDAPU_STR_ATTR_USER, + LDAPU_STR_ATTR_CERT, + LDAPU_STR_ATTR_CERT_NOSUBTYPE, + LDAPU_STR_MAX_INDEX +}; + +static char *ldapu_strings[] = { + "objectclass=*", /* LDAPU_STR_DEFAULT */ + "uid=%s", /* LDAPU_STR_FILTER_USER */ + "(& (cn=%s) (| (objectclass=groupofuniquenames) (objectclass=groupofnames)))", /* LDAPU_STR_FILTER_GROUP */ + "(| (uniquemember=%s) (member=%s))", /* LDAPU_STR_FILTER_MEMBER */ + "(& %s (| (objectclass=groupofuniquenames) (objectclass=groupofnames))", /* LDAPU_STR_FILTER_MEMBER_RECURSE */ + "uid", /* LDAPU_STR_ATTR_USER */ + "userCertificate;binary", /* LDAPU_STR_ATTR_CERT */ + "userCertificate" /* LDAPU_STR_ATTR_CERT_NOSUBTYPE */ +}; + +typedef struct { + char *str; + int size; + int len; +} LDAPUStr_t; + +#ifdef __cplusplus +extern "C" { +#endif + +NSAPI_PUBLIC int ldapu_cert_to_ldap_entry (void *cert, LDAP *ld, + const char *basedn, + LDAPMessage **res); + +NSAPI_PUBLIC int ldapu_set_cert_mapfn (const char *issuerDN, + CertMapFn_t mapfn); + + +NSAPI_PUBLIC CertMapFn_t ldapu_get_cert_mapfn (const char *issuerDN); + +NSAPI_PUBLIC int ldapu_set_cert_searchfn (const char *issuerDN, + CertSearchFn_t searchfn); + + +NSAPI_PUBLIC CertSearchFn_t ldapu_get_cert_searchfn (const char *issuerDN); + +NSAPI_PUBLIC int ldapu_set_cert_verifyfn (const char *issuerDN, + CertVerifyFn_t verifyFn); + +NSAPI_PUBLIC CertVerifyFn_t ldapu_get_cert_verifyfn (const char *issuerDN); + + +NSAPI_PUBLIC int ldapu_get_cert_subject_dn (void *cert, char **subjectDN); + + +NSAPI_PUBLIC int ldapu_get_cert_issuer_dn (void *cert, char **issuerDN); + + +NSAPI_PUBLIC int ldapu_get_cert_ava_val (void *cert, int which_dn, + const char *attr, char ***val); + + +NSAPI_PUBLIC int ldapu_free_cert_ava_val (char **val); + + +NSAPI_PUBLIC int ldapu_get_cert_der (void *cert, unsigned char **derCert, + unsigned int *len); + + +NSAPI_PUBLIC int ldapu_issuer_certinfo (const char *issuerDN, + void **certmap_info); + + +NSAPI_PUBLIC int ldapu_certmap_info_attrval (void *certmap_info, + const char *attr, char **val); + + +NSAPI_PUBLIC char *ldapu_err2string (int err); + +/* Keep the old fn for backward compatibility */ +NSAPI_PUBLIC void ldapu_free_old (char *ptr); + + +NSAPI_PUBLIC void *ldapu_malloc (int size); + + +NSAPI_PUBLIC char *ldapu_strdup (const char *ptr); + + +NSAPI_PUBLIC void *ldapu_realloc (void *ptr, int size); + + +NSAPI_PUBLIC void ldapu_free (void *ptr); + + +NSAPI_PUBLIC int ldapu_string_set (const int type, const char *filter); + + +NSAPI_PUBLIC const char *ldapu_string_get (const int type); + +NSAPI_PUBLIC int ldaputil_exit (); + +#ifdef __cplusplus +} +#endif + +#endif /* _LDAPU_CERTMAP_H */ diff --git a/include/ldaputil/dbconf.h b/include/ldaputil/dbconf.h new file mode 100644 index 00000000..3556c36e --- /dev/null +++ b/include/ldaputil/dbconf.h @@ -0,0 +1,91 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef _LDAPU_DBCONF_H +#define _LDAPU_DBCONF_H + +#include + +#ifndef NSAPI_PUBLIC +#ifdef XP_WIN32 +#define NSAPI_PUBLIC __declspec(dllexport) +#else +#define NSAPI_PUBLIC +#endif +#endif + +typedef struct dbconf_propval { + char *prop; /* Property name */ + char *val; /* Property value */ + struct dbconf_propval *next; /* Pointer to the next prop-val pair */ +} DBPropVal_t; + +typedef struct dbconf_dbinfo { + char *dbname; /* Database name */ + char *url; /* Database URL */ + DBPropVal_t *firstprop; /* pointer to first property-value pair */ + DBPropVal_t *lastprop; /* pointer to last property-value pair */ + struct dbconf_dbinfo *next; /* pointer to next db info */ +} DBConfDBInfo_t; + +typedef struct { + DBConfDBInfo_t *firstdb; /* pointer to first db info */ + DBConfDBInfo_t *lastdb; /* pointer to last db info */ +} DBConfInfo_t; + +#define DBCONF_DEFAULT_DBNAME "default" + +#ifdef __cplusplus +extern "C" { +#endif + +NSAPI_PUBLIC extern int dbconf_read_default_dbinfo (const char *file, + DBConfDBInfo_t **db_info); +NSAPI_PUBLIC extern int dbconf_read_config_file (const char *file, + DBConfInfo_t **conf_info); + +NSAPI_PUBLIC extern int ldapu_dbinfo_attrval (DBConfDBInfo_t *db_info, + const char *attr, char **val); + +NSAPI_PUBLIC extern void dbconf_free_confinfo (DBConfInfo_t *conf_info); +NSAPI_PUBLIC extern void dbconf_free_dbinfo (DBConfDBInfo_t *db_info); + +extern void dbconf_free_propval (DBPropVal_t *propval); + +extern void dbconf_print_confinfo (DBConfInfo_t *conf_info); +extern void dbconf_print_dbinfo (DBConfDBInfo_t *db_info); +extern void dbconf_print_propval (DBPropVal_t *propval); + + +NSAPI_PUBLIC int dbconf_output_db_directive (FILE *fp, const char *dbname, + const char *url); + +NSAPI_PUBLIC int dbconf_output_propval (FILE *fp, const char *dbname, + const char *prop, const char *val, + const int encoded); + +/* Following functions are required by certmap.c file */ +extern int dbconf_read_config_file_sub (const char *file, + const char *directive, + const int directive_len, + DBConfInfo_t **conf_info_out); + +extern int dbconf_read_default_dbinfo_sub (const char *file, + const char *directive, + const int directive_len, + DBConfDBInfo_t **db_info_out); + +NSAPI_PUBLIC int dbconf_get_dbnames (const char *dbmap, char ***dbnames, int *cnt); + +NSAPI_PUBLIC int dbconf_free_dbnames (char **dbnames); + + +extern int ldapu_strcasecmp (const char *s1, const char *s2); + +#ifdef __cplusplus +} +#endif + +#endif /* _LDAPU_DBCONF_H */ diff --git a/include/ldaputil/encode.h b/include/ldaputil/encode.h new file mode 100644 index 00000000..6cc7729e --- /dev/null +++ b/include/ldaputil/encode.h @@ -0,0 +1,29 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef _LDAPU_ENCODE_H +#define _LDAPU_ENCODE_H + +#ifndef NSAPI_PUBLIC +#ifdef XP_WIN32 +#define NSAPI_PUBLIC __declspec(dllexport) +#else +#define NSAPI_PUBLIC +#endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +NSAPI_PUBLIC extern char *dbconf_encodeval(const char *val); + +NSAPI_PUBLIC extern char *dbconf_decodeval (const char *val); + +#ifdef __cplusplus +} +#endif + +#endif /* _LDAPU_ENCODE_H */ diff --git a/include/ldaputil/errors.h b/include/ldaputil/errors.h new file mode 100644 index 00000000..de6f893d --- /dev/null +++ b/include/ldaputil/errors.h @@ -0,0 +1,108 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef _LDAPU_ERRORS_H +#define _LDAPU_ERRORS_H + +#ifndef NSAPI_PUBLIC +#ifdef XP_WIN32 +#define NSAPI_PUBLIC __declspec(dllexport) +#else +#define NSAPI_PUBLIC +#endif +#endif + +#ifdef DBG_PRINT +#include +#define DBG_PRINT1(x) fprintf(stderr, x) +#define DBG_PRINT2(x,y) fprintf(stderr, x, y) +#define DBG_PRINT3(x,y,z) fprintf(stderr, x, y, z) +#define DBG_PRINT4(x,y,z,a) fprintf(stderr, x, y, z, a) +#else +#define DBG_PRINT1(x) +#define DBG_PRINT2(x,y) +#define DBG_PRINT3(x,y,z) +#define DBG_PRINT4(x,y,z,a) +#endif + +/* Common error codes */ +#define LDAPU_ERR_NOT_IMPLEMENTED -1000 +#define LDAPU_ERR_INTERNAL -1001 +/* #define LDAPU_SUCCESS 0 */ /* defined in extcmap.h */ +/* #define LDAPU_FAILED -1 */ /* defined in extcmap.h */ +/* #define LDAPU_CERT_MAP_FUNCTION_FAILED -2 *//* defined in extcmap.h */ +/* #define LDAPU_CERT_VERIFY_FUNCTION_FAILED -3 *//* defined in extcmap.h */ +/* #define LDAPU_CERT_VERIFY_FUNCTION_FAILED -4 *//* defined in extcmap.h */ +/* #define LDAPU_CERT_MAP_INITFN_FAILED -5 *//* defined in extcmap.h */ + +/* Error codes returned by ldapdb.c */ +#define LDAPU_ERR_OUT_OF_MEMORY -110 +#define LDAPU_ERR_URL_INVALID_PREFIX -112 +#define LDAPU_ERR_URL_NO_BASEDN -113 +#define LDAPU_ERR_URL_PARSE_FAILED -114 + +#define LDAPU_ERR_LDAP_INIT_FAILED -120 +#define LDAPU_ERR_LCACHE_INIT_FAILED -121 +#define LDAPU_ERR_LDAP_SET_OPTION_FAILED -122 +#define LDAPU_ERR_NO_DEFAULT_CERTDB -123 + +/* Errors returned by dbconf.c */ +#define LDAPU_ERR_CANNOT_OPEN_FILE -141 +#define LDAPU_ERR_DBNAME_IS_MISSING -142 +#define LDAPU_ERR_PROP_IS_MISSING -143 +#define LDAPU_ERR_DIRECTIVE_IS_MISSING -145 +#define LDAPU_ERR_NOT_PROPVAL -146 +#define LDAPU_ATTR_NOT_FOUND -147 + +/* Error codes returned by certmap.c */ +#define LDAPU_ERR_NO_ISSUERDN_IN_CERT -181 +#define LDAPU_ERR_NO_ISSUERDN_IN_CONFIG_FILE -182 +#define LDAPU_ERR_CERTMAP_INFO_MISSING -183 +#define LDAPU_ERR_MALFORMED_SUBJECT_DN -184 +#define LDAPU_ERR_MAPPED_ENTRY_NOT_FOUND -185 +#define LDAPU_ERR_UNABLE_TO_LOAD_PLUGIN -186 +#define LDAPU_ERR_MISSING_INIT_FN_IN_LIB -187 +#define LDAPU_ERR_MISSING_INIT_FN_IN_CONFIG -188 +#define LDAPU_ERR_CERT_VERIFY_FAILED -189 +#define LDAPU_ERR_CERT_VERIFY_NO_CERTS -190 +#define LDAPU_ERR_MISSING_LIBNAME -191 +#define LDAPU_ERR_MISSING_INIT_FN_NAME -192 + +#define LDAPU_ERR_EMPTY_LDAP_RESULT -193 +#define LDAPU_ERR_MULTIPLE_MATCHES -194 +#define LDAPU_ERR_MISSING_RES_ENTRY -195 +#define LDAPU_ERR_MISSING_UID_ATTR -196 +#define LDAPU_ERR_WRONG_ARGS -197 +#define LDAPU_ERR_RENAME_FILE_FAILED -198 + +#define LDAPU_ERR_MISSING_VERIFYCERT_VAL -199 +#define LDAPU_ERR_CANAME_IS_MISSING -200 +#define LDAPU_ERR_CAPROP_IS_MISSING -201 +#define LDAPU_ERR_UNKNOWN_CERT_ATTR -202 +#define LDAPU_ERR_INVALID_ARGUMENT -203 +#define LDAPU_ERR_INVALID_SUFFIX -204 + +/* Error codes returned by cert.c */ +#define LDAPU_ERR_EXTRACT_SUBJECTDN_FAILED -300 +#define LDAPU_ERR_EXTRACT_ISSUERDN_FAILED -301 +#define LDAPU_ERR_EXTRACT_DERCERT_FAILED -302 + +/* Error codes returned by ldapauth.c */ +#define LDAPU_ERR_CIRCULAR_GROUPS -400 +#define LDAPU_ERR_INVALID_STRING -401 +#define LDAPU_ERR_INVALID_STRING_INDEX -402 +#define LDAPU_ERR_MISSING_ATTR_VAL -403 + +#ifdef __cplusplus +extern "C" { +#endif + + /* NSAPI_PUBLIC extern char *ldapu_err2string(int err); */ + +#ifdef __cplusplus +} +#endif + +#endif /* LDAPUTIL_LDAPU_H */ diff --git a/include/ldaputil/extcmap.h b/include/ldaputil/extcmap.h new file mode 100644 index 00000000..fde6a4b3 --- /dev/null +++ b/include/ldaputil/extcmap.h @@ -0,0 +1,634 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef _PUBLIC_CERTMAP_H +#define _PUBLIC_CERTMAP_H + +#include + +#ifndef NSAPI_PUBLIC +#if defined( _WINDOWS ) || defined( _WIN32 ) || defined( XP_WIN32 ) +#define NSAPI_PUBLIC __declspec(dllexport) +#else +#define NSAPI_PUBLIC +#endif +#endif + + +#define LDAPU_ATTR_INITFN "InitFn" +#define LDAPU_ATTR_LIBRARY "library" +#define LDAPU_ATTR_DNCOMPS "DNComps" +#define LDAPU_ATTR_FILTERCOMPS "FilterComps" +#define LDAPU_ATTR_VERIFYCERT "VerifyCert" +#define LDAPU_ATTR_CERTMAP_LDAP_ATTR "CmapLdapAttr" + +/* Error/Success codes */ +#define LDAPU_SUCCESS 0 +#define LDAPU_FAILED -1 +#define LDAPU_CERT_MAP_FUNCTION_FAILED -2 +#define LDAPU_CERT_SEARCH_FUNCTION_FAILED -3 +#define LDAPU_CERT_VERIFY_FUNCTION_FAILED -4 +#define LDAPU_CERT_MAP_INITFN_FAILED -5 + + +/* + * CertMapFn_t - + * This is a typedef for cert mapping function. The mapping function is + * called by the function ldapu_cert_to_ldap_entry. + * Parameters: + * cert - cert to be mapped. You can pass this to + * functions ldapu_get_cert_XYZ. + * ld - Handle to the connection to the directory server. + * certmap_info - This structure contains information about the + * configuration parameters for the cert's issuer (CA). + * This structure can be passed to the function + * ldapu_certmap_info_attrval to get value for a particular + * configuration attribute (or a property). + * ldapdn - The mapping function should allocate memory for ldapdn + * using malloc and set this variable using the 'cert' and + * 'certmap_info'. This DN will be used for ldap lookup. + * filter - The mapping function should allocate memory for filter + * using malloc and set this variable using the 'cert' and + * 'certmap_info'. This will be used as ldap filter for ldap + * lookup of the ldapdn. + * + * Return Value: + * return LDAPU_SUCCESS upon successful completion (cert is mapped) + * return LDAPU_FAILED there is no unexpected error but cert could not + * mapped (probably because ldap entry doesn't exist). + * otherwise return LDAPU_CERT_MAP_FUNCTION_FAILED. + */ +typedef int (*CertMapFn_t)(void *cert, LDAP *ld, void *certmap_info, + char **ldapdn, char **filter); + + +/* + * CertSearchFn_t - + * This is a typedef for cert search function. The search function is + * called by the function ldapu_cert_to_ldap_entry after calling the mapping + * function. The candidate 'dn' and 'filter' returned by the mapping + * function is passed to this function. + * The default search function works as follows: + * 1. If the 'filter' is NULL, default it to 'objectclass=*'. + * 2. If the 'dn' is non-NULL, do a base level search with the 'dn' and + * 'filter'. If it succeeds, we are done. If there is no serious + * error (LDAP_NO_SUCH_OBJECT is not serious error yet), continue. + * 3. If the 'dn' is NULL, default it to 'basedn'. + * 4. Perform a 'subtree' search in LDAP for the 'dn' and the 'filter'. + * 5. Return the results of the last search. + * Parameters: + * cert - cert to be mapped. You can pass this to + * functions ldapu_get_cert_XYZ. + * ld - Handle to the connection to the directory server. + * certmap_info - This structure contains information about the + * configuration parameters for the cert's issuer (CA). + * This structure can be passed to the function + * ldapu_certmap_info_attrval to get value for a particular + * configuration attribute (or a property). + * suffix - If the ldapdn is empty then use this DN to begin the + * search. This is the DN of the root object in LDAP + * Directory. + * ldapdn - candidate 'dn' returned by the mapping function. + * filter - returned by the mapping function. + * attrs - list of attributes to return from the search. If this is + * NULL, all attributes are returned. + * res - result of the search which is passed to the verify + * function. + * + * Return Value: + * return LDAPU_SUCCESS upon successful completion + * return LDAPU_FAILED there is no unexpected error but entries matching the + * 'dn' and 'filter' doesn't exist. + * otherwise return LDAPU_CERT_SEARCH_FUNCTION_FAILED. + */ +typedef int (*CertSearchFn_t)(void *cert, LDAP *ld, void *certmap_info, + const char *suffix, const char *ldapdn, + const char *filter, const char **attrs, + LDAPMessage ***res); + + +/* + * CertVerifyFn_t - + * This is a typedef for cert verify function. The verify function is + * called by the function ldapu_cert_to_ldap_entry after the cert is + * successfully mapped to ldapdn and filter, and an entry matching that + * exists in the directory server. The verify fn may get called for + * multiple matched entries. This function must go through all the entries + * and check which one is appropriate. The pointer to that entry must be + * passed back in the 'LDAPMessage **entry' parameter. + * Parameters: + * cert - Original cert to be mapped. You can pass this to + * functions ldapu_get_cert_XYZ. + * ld - Handle to the connection to the directory server. + * certmap_info - This structure contains information about the + * configuration parameters for the cert's issuer (CA). + * This structure can be passed to the function + * ldapu_certmap_info_attrval to get value for a particular + * configuration attribute (or a property). + * res - cert is first mapped to ldapdn and filter. 'res' is the + * result of ldap search using the ldapdn and filter. + * 'ld' and 'res' can be used in the calls to ldapsdk API. + * entry - pointer to the entry from 'res' which is the correct match + * according to the verify function. + * + * Return Values: + * return LDAPU_SUCCESS upon successful completion (cert is verified) + * return LDAPU_FAILED there is no unexpected error but cert could not + * verified (probably because it was revoked). + * otherwise return LDAPU_CERT_VERIFY_FUNCTION_FAILED. + */ +typedef int (*CertVerifyFn_t)(void *cert, LDAP *ld, void *certmap_info, + LDAPMessage *res, LDAPMessage **entry); + + + +/* + * CertmapInitFn_t - + * This is a typedef for user defined init function. An init function can be + * specified in the config file (/userdb/certmap.conf) per issuer + * of a certificate. This init function must from the user's library, also + * loaded from the config file using the 'library' property. The init + * function is specified in the config file using the 'InitFn' property. + * When the config file is loaded, any user defined init functions will be + * called with the certmap_info pertaining to the issuer (CA). + * Parameters: + * certmap_info - This structure contains information about the + * configuration parameters for the cert's issuer (CA). + * This structure can be passed to the function + * ldapu_certmap_info_attrval to get value for a particular + * configuration attribute (or a property). + * + * Return Value: + * return LDAPU_SUCCESS upon successful completion + * otherwise return LDAPU_CERT_MAP_INITFN_FAILED. The server startup will be + * aborted if the return value is not LDAPU_SUCCESS. + */ +typedef int (*CertMapInitFn_t)(void *certmap_info, const char *issuerName, + const char *issuerDN, const char *libname); + +/* + * Refer to the description of the function ldapu_get_cert_ava_val + */ +enum { + LDAPU_SUBJECT_DN, + LDAPU_ISSUER_DN +}; + +/* ldapu_cert_to_ldap_entry */ +typedef int (*t_ldapu_cert_to_ldap_entry)(void *cert, LDAP *ld, + const char *suffix, + LDAPMessage **res); + +/* ldapu_set_cert_mapfn */ +typedef int (*t_ldapu_set_cert_mapfn)(const char *issuerDN, + CertMapFn_t mapfn); + +/* ldapu_get_cert_mapfn */ +typedef CertMapFn_t (*t_ldapu_get_cert_mapfn) (const char *issuerDN); + +/* ldapu_set_cert_searchfn */ +typedef int (*t_ldapu_set_cert_searchfn) (const char *issuerDN, + CertSearchFn_t searchfn); + +/* ldapu_get_cert_searchfn */ +typedef CertSearchFn_t (*t_ldapu_get_cert_searchfn) (const char *issuerDN); + +/* ldapu_set_cert_verifyfn */ +typedef int (*t_ldapu_set_cert_verifyfn) (const char *issuerDN, + CertVerifyFn_t verifyFn); + +/* ldapu_get_cert_verifyfn */ +typedef CertVerifyFn_t (*t_ldapu_get_cert_verifyfn) (const char *issuerDN); + +/* ldapu_get_cert_subject_dn */ +typedef int (*t_ldapu_get_cert_subject_dn) (void *cert, char **subjectDN); + +/* ldapu_get_cert_issuer_dn */ +typedef int (*t_ldapu_get_cert_issuer_dn) (void *cert, char **issuerDN); + +/* ldapu_get_cert_ava_val */ +typedef int (*t_ldapu_get_cert_ava_val) (void *cert, int which_dn, + const char *attr, char ***val); + +/* ldapu_free_cert_ava_val */ +typedef int (*t_ldapu_free_cert_ava_val) (char **val); + +/* ldapu_get_cert_der */ +typedef int (*t_ldapu_get_cert_der) (void *cert, unsigned char **derCert, + unsigned int *len); + +/* ldapu_issuer_certinfo */ +typedef int (*t_ldapu_issuer_certinfo) (const char *issuerDN, + void **certmap_info); + +/* ldapu_certmap_info_attrval */ +typedef int (*t_ldapu_certmap_info_attrval) (void *certmap_info, + const char *attr, char **val); + +/* ldapu_err2string */ +typedef char * (*t_ldapu_err2string) (int err); + +/* ldapu_free */ +typedef void (*t_ldapu_free_old) (char *ptr); +typedef void (*t_ldapu_free) (void *ptr); + +/* ldapu_malloc */ +typedef void *(*t_ldapu_malloc) (int size); + +/* ldapu_strdup */ +typedef char *(*t_ldapu_strdup) (const char *ptr); + + +typedef struct LDAPUDispatchVector LDAPUDispatchVector_t; +struct LDAPUDispatchVector { + t_ldapu_cert_to_ldap_entry f_ldapu_cert_to_ldap_entry; + t_ldapu_set_cert_mapfn f_ldapu_set_cert_mapfn; + t_ldapu_get_cert_mapfn f_ldapu_get_cert_mapfn; + t_ldapu_set_cert_searchfn f_ldapu_set_cert_searchfn; + t_ldapu_get_cert_searchfn f_ldapu_get_cert_searchfn; + t_ldapu_set_cert_verifyfn f_ldapu_set_cert_verifyfn; + t_ldapu_get_cert_verifyfn f_ldapu_get_cert_verifyfn; + t_ldapu_get_cert_subject_dn f_ldapu_get_cert_subject_dn; + t_ldapu_get_cert_issuer_dn f_ldapu_get_cert_issuer_dn; + t_ldapu_get_cert_ava_val f_ldapu_get_cert_ava_val; + t_ldapu_free_cert_ava_val f_ldapu_free_cert_ava_val; + t_ldapu_get_cert_der f_ldapu_get_cert_der; + t_ldapu_issuer_certinfo f_ldapu_issuer_certinfo; + t_ldapu_certmap_info_attrval f_ldapu_certmap_info_attrval; + t_ldapu_err2string f_ldapu_err2string; + t_ldapu_free_old f_ldapu_free_old; + t_ldapu_malloc f_ldapu_malloc; + t_ldapu_strdup f_ldapu_strdup; + t_ldapu_free f_ldapu_free; +}; + + +#ifdef INTLDAPU +NSAPI_PUBLIC extern LDAPUDispatchVector_t *__ldapu_table; +#else +typedef int (*CertMapDLLInitFn_t)(LDAPUDispatchVector_t **table); + +NSAPI_PUBLIC extern int CertMapDLLInitFn(LDAPUDispatchVector_t **table); + +extern LDAPUDispatchVector_t *__ldapu_table; + +#if defined( _WINDOWS ) || defined( _WIN32 ) || defined( XP_WIN32 ) +#define CertmapDLLInitFnTbl LDAPUDispatchVector_t *__ldapu_table; +#define CertmapDLLInit(rv, libname) \ +{\ + HANDLE h = LoadLibrary((libname)); \ + CertMapDLLInitFn_t init_fn; \ + if (!h) return LDAPU_CERT_MAP_INITFN_FAILED; \ + init_fn = (CertMapDLLInitFn_t)GetProcAddress(h, "CertMapDLLInitFn"); \ + rv = init_fn(&__ldapu_table); \ +} +#else +#define CertmapDLLInit(rv, libname) +#define CertmapDLLInitFnTbl +#endif + +#endif /* INTLDAPU */ + +#ifndef INTLDAPU + +/* + * ldapu_cert_to_ldap_entry - + * This function is called to map a cert to an ldap entry. It extracts the + * cert issuer information from the given cert. The mapping function set for + * the issuer (if any) or the default mapping function is called to map the + * subject DN from the cert to a candidate ldap DN and filter for ldap + * search. If the mapped ldap DN is NULL, the 'basedn' passed into this + * function is used as a starting place for the search. If the mapped filter + * is NULL, "objectclass=*" is used as a filter. A base level search is + * performed to see if the candidate DN exists in the LDAP database matching + * the filter. If there is no match, a scoped search (sub-tree search) is + * performed. If at least one entry matched the mapped DN and filter, the + * result is passed to the appropriate verify function. The verify function + * is called only if 'VerifyCert' parameter has been set for the cert issuer + * in the certmap.conf file. + * If the verify function succeeds, it must return the pointer to the matched + * 'entry'. If at the end, there is only one matching entry, the mapping is + * successful. + * Parameters: + * cert - cert to be mapped. You can pass this to + * functions ldapu_get_cert_XYZ. + * ld - Handle to the connection to the directory server. + * suffix - If the subject dn is mapped to empty LDAP DN then use this + * DN to begin the search. This is the DN of the root object + * in LDAP Directory. + * res - cert is first mapped to ldapdn and filter. 'res' is the + * result of ldap search using the ldapdn and filter. + * 'ld' and 'res' can be used in the calls to ldapsdk API. + * When done with 'res', free it using ldap_msgfree(res) + * + * Return Value: + * return LDAPU_SUCCESS upon successful completion + * otherwise returns an error code that can be passed to ldapu_err2string. + */ +#define ldapu_cert_to_ldap_entry (*__ldapu_table->f_ldapu_cert_to_ldap_entry) + +/* + * ldapu_set_cert_mapfn - + * This function can be used to set the cert mapping function for the given + * issuer (CA). If the mapping information doesn't exist for the given + * issuer then a new one will be created and the mapping function will be + * set. When creating the new mapping information, the default mapping + * information is copied. + * Parameters: + * issuerDN - DN of the cert issuer. This mapping function will be used + * for all certs issued by this issuer. If the issuerDN is + * NULL, the given 'mapfn' becomes the default mapping + * function (which is used when no mapping function has been + * set for the cert's issuer). + * mapfn - the mapping function. Look at the desciption of + * CertMapFn_t to find out more about the mapping functions. + * + * Return Value: + * return LDAPU_SUCCESS upon successful completion + * otherwise returns an error code that can be passed to ldapu_err2string. + */ +#define ldapu_set_cert_mapfn (*__ldapu_table->f_ldapu_set_cert_mapfn) + + +/* + * ldapu_get_cert_mapfn - + * This function can be used to get the cert mapping function for the given + * issuer (CA). This will always return a non-NULL function. + * Parameters: + * issuerDN - DN of the cert issuer for which the mapping function is to + * be retrieved. If this is NULL, default mapping function + * is returned. + * + * Return Value: + * The mapping function set for the issuer is returned. If the issuerDN is + * NULL or if no specific mapping function has been set for the issuer, the + * default mapping function is returned. + */ +#define ldapu_get_cert_mapfn (*__ldapu_table->f_ldapu_get_cert_mapfn) + +/* + * ldapu_set_cert_searchfn - + * This function can be used to set the cert search function for the given + * issuer (CA). + * Parameters: + * issuerDN - DN of the cert issuer. This search function will be used + * for all certs issued by this issuer. If the issuerDN is + * NULL, the given 'searchfn' becomes the default search + * function (which is used when no search function has been + * set for the cert's issuer). + * searchfn - the search function. Look at the desciption of + * CertSearchFn_t to find out more about the search functions. + * + * Return Value: + * return LDAPU_SUCCESS upon successful completion + * otherwise returns an error code that can be passed to ldapu_err2string. + */ +#define ldapu_set_cert_searchfn (*__ldapu_table->f_ldapu_set_cert_searchfn) + + +/* + * ldapu_get_cert_searchfn - + * This function can be used to get the cert search function for the given + * issuer (CA). This will always return a non-NULL function. + * Parameters: + * issuerDN - DN of the cert issuer for which the search function is to + * be retrieved. If this is NULL, the default search + * function is returned. + * + * Return Value: + * The search function set for the issuer is returned. If the issuerDN is + * NULL or if no specific search function has been set for the issuer, the + * default search function is returned. + */ +#define ldapu_get_cert_searchfn (*__ldapu_table->f_ldapu_get_cert_searchfn) + +/* + * ldapu_set_cert_verifyfn - + * This function can be used to set the cert verify function for the given + * issuer (CA). If the mapping information doesn't exist for the given + * issuer then a new one will be created and the verify function will be + * set. When creating the new mapping information, the default mapping + * information is copied. + * Parameters: + * issuerDN - DN of the cert issuer. This verify function will be used + * for all certs issued by this issuer. If the issuerDN is + * NULL, the given 'verifyFn' becomes the default verify + * function (which is used when no verify function has been + * set for the cert's issuer). + * verifyFn - the verify function. Look at the desciption of + * CertMapFn_t to find out more about the verify functions. + * + * Return Value: + * return LDAPU_SUCCESS upon successful completion + * otherwise returns an error code that can be passed to ldapu_err2string. + */ +#define ldapu_set_cert_verifyfn (*__ldapu_table->f_ldapu_set_cert_verifyfn) + +/* + * ldapu_get_cert_verifyfn - + * This function can be used to get the cert verify function for the given + * issuer (CA). This function can return NULL when there is no applicable + * verify function. + * Parameters: + * issuerDN - DN of the cert issuer for which the verify function is to + * be retrieved. If this is NULL, default verify function + * is returned. + * + * Return Value: + * The verify function set for the issuer is returned. If the issuerDN is + * NULL or if no specific verify function has been set for the issuer, the + * default verify function is returned. This function can return NULL when + * there is no applicable verify function. + */ +#define ldapu_get_cert_verifyfn (*__ldapu_table->f_ldapu_get_cert_verifyfn) + + +/* + * ldapu_get_cert_subject_dn - + * This function can be used to get the subject DN from the cert. Free the + * subjectDN using 'free' after you are done using it. + * Parameters: + * cert - cert from which the DN is to be extracted. + * subjectDN - subjectDN extracted from the cert. Free it using 'free' + * after it is no longer required. + * + * Return Value: + * return LDAPU_SUCCESS upon successful completion + * otherwise returns an error code that can be passed to ldapu_err2string. + */ +#define ldapu_get_cert_subject_dn (*__ldapu_table->f_ldapu_get_cert_subject_dn) + + +/* + * ldapu_get_cert_issuer_dn - + * This function can be used to get the issuer DN from the cert. Free the + * issuerDN using 'free' after you are done using it. + * Parameters: + * cert - cert from which the DN is to be extracted. + * issuerDN - issuerDN extracted from the cert. Free it using 'free' + * after it is no longer required. + * + * Return Value: + * return LDAPU_SUCCESS upon successful completion + * otherwise returns an error code that can be passed to ldapu_err2string. + */ +#define ldapu_get_cert_issuer_dn (*__ldapu_table->f_ldapu_get_cert_issuer_dn) + + +/* + * ldapu_get_cert_ava_val - + * This function can be used to get value of the given attribute from either + * the subject DN or the issuer DN from the cert. + * Parameters: + * cert - cert from which the values are to be extracted. + * which_dn - Should be either LDAPU_ISSUER_DN or LDAPU_SUBJECT_DN. + * attr - Should be one of "CN", "OU", "O", "C", "UID", "MAIL", + * "E", "L", and "ST". + * val - An array of attribute values extracted from the cert. + * There could be multiple values. The last entry in the + * array is NULL. You must free this array of strings after + * you are done with it (using the function + * ldapu_free_cert_ava_val). 'val' is initialized to NULL if + * there is an error. + * + * Return Value: + * return LDAPU_SUCCESS upon successful completion + * otherwise returns an error code that can be passed to ldapu_err2string. + */ +#define ldapu_get_cert_ava_val (*__ldapu_table->f_ldapu_get_cert_ava_val) + + +/* + * ldapu_free_cert_ava_val - + * This function can be used to free the array returned by the + * ldapu_get_cert_ava_val function. + * Parameters: + * val - An array of attribute values returned by + * ldapu_get_cert_ava_val. + * + * Return Value: + * return LDAPU_SUCCESS upon successful completion + * otherwise returns an error code that can be passed to ldapu_err2string. + */ +#define ldapu_free_cert_ava_val (*__ldapu_table->f_ldapu_free_cert_ava_val) + + +/* + * ldapu_get_cert_der - + * This function can be used to get the original DER encoded cert for the + * given cert. + * Parameters: + * cert - cert from which the original DER is to be extracted. + * derCert - the original DER encoded cert + * len - length of derCert + * + * Return Value: + * return LDAPU_SUCCESS upon successful completion + * otherwise returns an error code that can be passed to ldapu_err2string. + */ +#define ldapu_get_cert_der (*__ldapu_table->f_ldapu_get_cert_der) + + +/* + * ldapu_issuer_certinfo - + * This function can be used to get the handle on the internal structure for + * the given issuer. This handle can be passed to ldapu_certmap_info_attrval + * to get configuration attribute values for the issuer. + * Parameters: + * issuerDN - DN of the issuer for whom the handle on internal structure + * is requested. If issuerDN is NULL, the handle to the + * default configuration information is returned. + * certmap_info - This structure contains information about the + * configuration parameters for the cert's issuer (CA). + * This structure can be passed to the function + * ldapu_certmap_info_attrval to get value for a particular + * configuration attribute (or a property). + * + * Return Value: + * return LDAPU_SUCCESS upon successful completion + * otherwise returns an error code that can be passed to ldapu_err2string. + * CAUTION: DON'T FREE THE 'certmap_info' STRUCTURE. + */ +#define ldapu_issuer_certinfo (*__ldapu_table->f_ldapu_issuer_certinfo) + + +/* + * ldapu_certmap_info_attrval - + * This function can be used to get values for the given attribute/property + * from the given certmap_info. You can get handle on the certmap_info by + * calling the ldapu_issuer_certinfo function. Free the 'val' using 'free' + * after it is no longer required. + * Parameters: + * certmap_info - This structure contains information about the + * configuration parameters for the cert's issuer (CA). + * attr - name of the attribute/property for which the value is to + * be returned. The attribute can be one of the attributes + * listed above (LDAPU_ATTR_XYZ). User defined attributes + * can also be used. + * val - Value of the 'attr' from the 'certmap_info'. + * + * Return Value: + * return LDAPU_SUCCESS upon successful completion + * otherwise returns an error code that can be passed to ldapu_err2string. + */ +#define ldapu_certmap_info_attrval (*__ldapu_table->f_ldapu_certmap_info_attrval) + + +/* + * ldapu_err2string - + * This function can be used to print any of the ldaputil or LDAP error + * code. + * Parameters: + * err - error code to be converted to printable string. + * + * Return Value: + * Printable representation of the given error code. + */ +#define ldapu_err2string (*__ldapu_table->f_ldapu_err2string) + +/* + * ldapu_free - + * This function should be used to free the memory allocated by + * ldapu_* functions if the ldapu_* function doesn't have a corresponding + * 'free' function. Use this function for free'ing the memory allocated by + * the following functions: + * ldapu_get_cert_subject_dn + * ldapu_get_cert_issuer_dn + * ldapu_get_cert_der + * ldapu_certmap_info_attrval + * To free memory allocated by ldapu_get_cert_ava_val, use + * ldapu_free_cert_ava_val. Do not free the certmap_info pointer returned by + * ldapu_issuer_certinfo. + * Parameters: + * ptr - pointer returned by ldapu_get_cert_* functions. + */ +#define ldapu_free (*__ldapu_table->f_ldapu_free) + +/* + * ldapu_malloc - + * This function is a cover function for the 'malloc' system call. On NT, it + * is best to alloc & free the memory in the same DLL. + * Parameters: + * size - size of the memory to be allocated + * Return Value: + * same as 'malloc' -- pointer to the allocated memory or NULL on failure. + */ +#define ldapu_malloc (*__ldapu_table->f_ldapu_malloc) + +/* + * ldapu_strdup - + * This function is a cover function for the 'strdup' system call. On NT, it + * is best to alloc & free the memory in the same DLL. + * Parameters: + * ptr - Pointer to the string to be copied + * Return Value: + * same as 'strdup' -- pointer to the copied string or NULL on failure. + */ +#define ldapu_strdup (*__ldapu_table->f_ldapu_strdup) + + +#endif /* !INTLDAPU */ + +#endif /* _PUBLIC_CERTMAP_H */ diff --git a/include/ldaputil/init.h b/include/ldaputil/init.h new file mode 100644 index 00000000..e983787b --- /dev/null +++ b/include/ldaputil/init.h @@ -0,0 +1,23 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef _LDAPU_INIT_H +#define _LDAPU_INIT_H + +#ifdef __cplusplus +extern "C" { +#endif + +NSAPI_PUBLIC extern int ldaputil_init (const char *config_file, + const char *dllname, + const char *serv_root, + const char *serv_type, + const char *serv_id); + +#ifdef __cplusplus +} +#endif + +#endif /* _LDAPU_INIT_H */ diff --git a/include/ldaputil/ldapauth.h b/include/ldaputil/ldapauth.h new file mode 100644 index 00000000..d4d96bfc --- /dev/null +++ b/include/ldaputil/ldapauth.h @@ -0,0 +1,94 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ + +#ifndef LDAPU_AUTH_H +#define LDAPU_AUTH_H + +#include + +#ifndef NSAPI_PUBLIC +#ifdef XP_WIN32 +#define NSAPI_PUBLIC __declspec(dllexport) +#else +#define NSAPI_PUBLIC +#endif +#endif + +typedef int (*LDAPU_GroupCmpFn_t)(const void *groupids, const char *group, + const int len); + +#ifdef __cplusplus +extern "C" { +#endif + +extern int ldapu_find (LDAP *ld, const char *base, int scope, + const char *filter, const char **attrs, + int attrsonly, LDAPMessage **res); + +int ldapu_find_entire_tree (LDAP *ld, int scope, + const char *filter, const char **attrs, + int attrsonly, LDAPMessage ***res); + +extern int ldapu_auth_userdn_groupdn (LDAP *ld, const char *userdn, + const char *groupdn, + const char *base); + +extern int ldapu_auth_uid_groupdn (LDAP *ld, const char *uid, + const char *groupdn, const char *base); + +extern int ldapu_auth_uid_groupid (LDAP *ld, const char *uid, + const char *groupid, const char *base); + +extern int ldapu_auth_userdn_groupid (LDAP *ld, + const char *userdn, const char *groupid, + const char *base); + +extern int ldapu_auth_userdn_groupids (LDAP *ld, const char *userdn, + void *groupids, + LDAPU_GroupCmpFn_t grpcmpfn, + const char *base, + char **group_out); + +extern int ldapu_auth_userdn_attrfilter (LDAP *ld, + const char *userdn, + const char *attrfilter); + +extern int ldapu_auth_uid_attrfilter (LDAP *ld, const char *uid, + const char *attrfilter, + const char *base); + +extern int ldapu_auth_userdn_password (LDAP *ld, + const char *userdn, + const char *password); + +extern int ldapu_find_uid_attrs (LDAP *ld, const char *uid, + const char *base, const char **attrs, + int attrsonly, LDAPMessage **res); + +extern int ldapu_find_uid (LDAP *ld, const char *uid, + const char *base, LDAPMessage **res); + +NSAPI_PUBLIC extern int ldapu_find_userdn (LDAP *ld, const char *uid, + const char *base, char **dn); + +extern int ldapu_find_group_attrs (LDAP *ld, const char *groupid, + const char *base, const char **attrs, + int attrsonly, LDAPMessage **res); + +extern int ldapu_find_group (LDAP *ld, const char *groupid, + const char *base, LDAPMessage **res); + +extern int ldapu_find_groupdn (LDAP *ld, const char *groupid, + const char *base, char **dn); + +extern int ldapu_auth_uid_password (LDAP *ld, const char *uid, + const char *password, const char *base); + +#ifdef __cplusplus +} +#endif + +#endif /* LDAPU_AUTH_H */ diff --git a/include/ldaputil/ldapdb.h b/include/ldaputil/ldapdb.h new file mode 100644 index 00000000..13254a93 --- /dev/null +++ b/include/ldaputil/ldapdb.h @@ -0,0 +1,100 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef _LDAPU_LDAPDB_H +#define _LDAPU_LDAPDB_H + +#include +/* removed for LDAPSDK31 integration +#include +*/ +#ifdef LDAPDB_THREAD_SAFE +/* In the past, we used CRITICAL objects from lib/base/crit.cpp. + * Now we use PRMonitor to avoid ldapu to depend on lib/base. + */ +#include +#else +#define PRMonitor void +#endif /* LDAPDB_THREAD_SAFE */ + +#ifndef NSAPI_PUBLIC +#ifdef XP_WIN32 +#define NSAPI_PUBLIC __declspec(dllexport) +#else +#define NSAPI_PUBLIC +#endif +#endif + +#define LDAPDB_URL_PREFIX "ldapdb:" +#define LDAPDB_URL_PREFIX_LEN 7 + +typedef struct { + int use_ssl; /* Set to 0 in case of local LDAP cache */ + char *host; /* Set to 0 in case of local LDAP cache */ + int port; /* Set to 0 in case of local LDAP cache */ + char *basedn; + char *scope; + char *filter; + LDAP *ld; + char *binddn; /* Set to 0 in case of local LDAP cache */ + char *bindpw; /* Set to 0 in case of local LDAP cache */ + int bound; /* If 0 then not bound with binddn & bindpw */ + PRMonitor* crit;/* to control critical sections */ +} LDAPDatabase_t; + +#define LDAPU_ATTR_BINDDN "binddn" +#define LDAPU_ATTR_BINDPW "bindpw" + + +#ifdef __cplusplus +extern "C" { +#endif + +NSAPI_PUBLIC extern int ldapu_url_parse (const char *url, const char *binddn, + const char *bindpw, + LDAPDatabase_t **ldb); + +NSAPI_PUBLIC extern int ldapu_ldapdb_url_parse (const char *url, + LDAPDatabase_t **ldb); + +NSAPI_PUBLIC extern int ldapu_is_local_db (const LDAPDatabase_t *ldb); + +NSAPI_PUBLIC extern void ldapu_free_LDAPDatabase_t (LDAPDatabase_t *ldb); + +NSAPI_PUBLIC extern LDAPDatabase_t *ldapu_copy_LDAPDatabase_t (const LDAPDatabase_t *ldb); + +NSAPI_PUBLIC extern int ldapu_ldap_init (LDAPDatabase_t *ldb); + +NSAPI_PUBLIC extern int ldapu_ldap_init_and_bind (LDAPDatabase_t *ldb); + +NSAPI_PUBLIC extern int ldapu_ldap_rebind (LDAPDatabase_t *ldb); + +NSAPI_PUBLIC extern int ldapu_ldap_reinit_and_rebind (LDAPDatabase_t *ldb); + +#ifdef __cplusplus +} +#endif + +/* + * LDAPU_REQ -- + * 'ld' is cached in the 'ldb' structure. If the LDAP server goes down since + * it was cached, the ldap lookup commands fail with LDAP_SERVER_DOWN. This + * macro can be used to rebind to the server and retry the command once if + * this happens. + */ +#define LDAPU_REQ(rv, ldb, cmd) \ +{ \ + int numtry = 0; \ + while(1) { \ + rv = cmd; \ + if (rv != LDAP_SERVER_DOWN || numtry++ != 0) break; \ + /* Server went down since our last ldap lookup ... reconnect */ \ + rv = ldapu_ldap_reinit_and_rebind(ldb); \ + if (rv != LDAPU_SUCCESS) break; \ + } \ +} + + +#endif /* LDAPUTIL_LDAPDB_H */ diff --git a/include/ldaputil/ldaputil.h b/include/ldaputil/ldaputil.h new file mode 100644 index 00000000..f0d87c22 --- /dev/null +++ b/include/ldaputil/ldaputil.h @@ -0,0 +1,132 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef _LDAPU_LDAPUTIL_H +#define _LDAPU_LDAPUTIL_H + +#include +#include + +typedef struct ldapu_list_node { + void *info; /* pointer to the corresponding info */ + struct ldapu_list_node *next; /* pointer to the next node */ + struct ldapu_list_node *prev; /* pointer to the prev node */ +} LDAPUListNode_t; + +typedef struct ldapu_list { + LDAPUListNode_t *head; + LDAPUListNode_t *tail; +} LDAPUList_t; + +typedef struct { + char *prop; /* property name */ + char *val; /* value -- only char* supported for now */ +} LDAPUPropVal_t; + +typedef LDAPUList_t LDAPUPropValList_t; + +enum { + COMPS_COMMENTED_OUT, + COMPS_EMPTY, + COMPS_HAS_ATTRS +}; + +typedef struct { + char *issuerName; /* issuer (symbolic/short) name */ + char *issuerDN; /* cert issuer's DN */ + LDAPUPropValList_t *propval; /* pointer to the prop-val pairs list */ + CertMapFn_t mapfn; /* cert to ldapdn & filter mapping func */ + CertVerifyFn_t verifyfn; /* verify cert function */ + CertSearchFn_t searchfn; /* search ldap entry function */ + long dncomps; /* bitmask: components to form ldap dn */ + long filtercomps; /* components used to form ldap filter */ + int verifyCert; /* Verify the cert? */ + char *searchAttr; /* LDAP attr used by the search fn */ + int dncompsState; /* Empty, commented out, or attr names */ + int filtercompsState; /* Empty, commented out, or attr names */ +} LDAPUCertMapInfo_t; + +typedef LDAPUList_t LDAPUCertMapListInfo_t; + +typedef void * (*LDAPUListNodeFn_t)(void *info, void *arg); + +#ifdef __cplusplus +extern "C" { +#endif + +extern int certmap_read_default_certinfo (const char *file); + +extern int certmap_read_certconfig_file (const char *file); + +extern void ldapu_certinfo_free (void *certmap_info); + +extern void ldapu_certmap_listinfo_free (void *certmap_listinfo); + +extern void ldapu_propval_list_free (void *propval_list); + +NSAPI_PUBLIC extern int ldaputil_exit (); + +NSAPI_PUBLIC extern int ldapu_cert_to_user (void *cert, LDAP *ld, + const char *basedn, + LDAPMessage **res, + char **user); + +NSAPI_PUBLIC extern int ldapu_certmap_init (const char *config_file, + const char *libname, + LDAPUCertMapListInfo_t **certmap_list, + LDAPUCertMapInfo_t + **certmap_default); + +NSAPI_PUBLIC extern int ldapu_certinfo_modify (const char *issuerName, + const char *issuerDN, + const LDAPUPropValList_t *propval); + +NSAPI_PUBLIC extern int ldapu_certinfo_delete (const char *issuerDN); + +NSAPI_PUBLIC extern int ldapu_certinfo_save (const char *fname, + const char *old_fname, + const char *tmp_fname); + +NSAPI_PUBLIC extern int ldapu_list_alloc (LDAPUList_t **list); +NSAPI_PUBLIC extern int ldapu_propval_alloc (const char *prop, const char *val, + LDAPUPropVal_t **propval); +NSAPI_PUBLIC extern int ldapu_list_add_info (LDAPUList_t *list, void *info); + +#ifndef DONT_USE_LDAP_SSL +#define USE_LDAP_SSL +#endif + +typedef struct { +#ifdef USE_LDAP_SSL + LDAP* (LDAP_CALL LDAP_CALLBACK *ldapuV_ssl_init) ( const char*, int, int ); +#else + LDAP* (LDAP_CALL LDAP_CALLBACK *ldapuV_init) ( const char*, int ); +#endif + int (LDAP_CALL LDAP_CALLBACK *ldapuV_set_option) ( LDAP*, int, void* ); + int (LDAP_CALL LDAP_CALLBACK *ldapuV_simple_bind_s) ( LDAP*, const char*, const char* ); + int (LDAP_CALL LDAP_CALLBACK *ldapuV_unbind) ( LDAP* ); + int (LDAP_CALL LDAP_CALLBACK *ldapuV_search_s) ( LDAP*, const char*, int, const char*, char**, int, LDAPMessage** ); + int (LDAP_CALL LDAP_CALLBACK *ldapuV_count_entries) ( LDAP*, LDAPMessage* ); + LDAPMessage*(LDAP_CALL LDAP_CALLBACK *ldapuV_first_entry) ( LDAP*, LDAPMessage* ); + LDAPMessage*(LDAP_CALL LDAP_CALLBACK *ldapuV_next_entry) ( LDAP*, LDAPMessage* ); + int (LDAP_CALL LDAP_CALLBACK *ldapuV_msgfree) ( LDAP*, LDAPMessage* ); + char* (LDAP_CALL LDAP_CALLBACK *ldapuV_get_dn) ( LDAP*, LDAPMessage* ); + void (LDAP_CALL LDAP_CALLBACK *ldapuV_memfree) ( LDAP*, void* ); + char* (LDAP_CALL LDAP_CALLBACK *ldapuV_first_attribute) ( LDAP*, LDAPMessage*, BerElement** ); + char* (LDAP_CALL LDAP_CALLBACK *ldapuV_next_attribute) ( LDAP*, LDAPMessage*, BerElement* ); + void (LDAP_CALL LDAP_CALLBACK *ldapuV_ber_free) ( LDAP*, BerElement*, int ); + char** (LDAP_CALL LDAP_CALLBACK *ldapuV_get_values) ( LDAP*, LDAPMessage*, const char* ); + void (LDAP_CALL LDAP_CALLBACK *ldapuV_value_free) ( LDAP*, char** ); + struct berval**(LDAP_CALL LDAP_CALLBACK *ldapuV_get_values_len)( LDAP*, LDAPMessage*, const char* ); + void (LDAP_CALL LDAP_CALLBACK *ldapuV_value_free_len)( LDAP*, struct berval** ); +} LDAPUVTable_t; + +NSAPI_PUBLIC extern void ldapu_VTable_set (LDAPUVTable_t*); + +#ifdef __cplusplus +} +#endif + +#endif /* _LDAPU_LDAPUTIL_H */ diff --git a/include/libaccess/acl.h b/include/libaccess/acl.h new file mode 100644 index 00000000..88ac07f4 --- /dev/null +++ b/include/libaccess/acl.h @@ -0,0 +1,41 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef ACL_HEADER +#define ACL_HEADER + +#ifndef NOINTNSACL +#define INTNSACL +#endif /* NOINTNSACL */ + +#include +#include +#include +#include +#include + +#ifndef FALSE +#define FALSE 0 +#endif +#ifndef TRUE +#define TRUE 1 +#endif + +#ifndef PUBLIC_NSACL_ACLAPI_H +#include "public/nsacl/aclapi.h" +#endif /* !PUBLIC_NSACL_ACLAPI_H */ + +#ifdef INTNSACL + +NSPR_BEGIN_EXTERN_C + +extern char *generic_rights[]; +extern char *http_generic[]; + +NSPR_END_EXTERN_C + +#endif /* INTNSACL */ + +#endif diff --git a/include/libaccess/acladmin.h b/include/libaccess/acladmin.h new file mode 100644 index 00000000..9bd75623 --- /dev/null +++ b/include/libaccess/acladmin.h @@ -0,0 +1,79 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef __acladmin_h +#define __acladmin_h + + +/* + * Description (acladmin.h) + * + * This file describes the interface to access control list (ACL) + * administration functions. This interface provides mechanisms + * for inspecting, modifying, and writing out in text form ACL + * structures. + */ + +#include "aclstruct.h" + +NSPR_BEGIN_EXTERN_C + +/* Flags used for various functions */ +#define ACLF_NPREFIX 0x1 /* ACL name string is a name prefix */ +#define ACLF_REXACT 0x2 /* rights must match exactly */ +#define ACLF_RALL 0x4 /* must have all specified rights */ + +/* Functions in acladmin.c */ +extern NSAPI_PUBLIC int aclDNSAddHost(char * newhost, + char ***alist, int * asize); +extern NSAPI_PUBLIC int aclDNSAddAliases(char * host, + char ***alist, int * asize); +extern NSAPI_PUBLIC int aclDNSPutHost(char * hname, int fqdn, int aliases, + char ***alist, int * asize); +extern NSAPI_PUBLIC int aclFindByName(ACContext_t * acc, char * aclname, + char **rights, int flags, ACL_t **pacl); +extern NSAPI_PUBLIC char * aclGetAuthMethod(ACL_t * acl, int dirno); +extern NSAPI_PUBLIC char * aclGetDatabase(ACL_t * acl, int dirno); +extern NSAPI_PUBLIC char **aclGetHosts(ACL_t * acl, int dirno, int clsno); +extern NSAPI_PUBLIC char * aclGetPrompt(ACL_t * acl, int dirno); +extern NSAPI_PUBLIC char **aclGetRights(ACL_t * acl); +extern NSAPI_PUBLIC unsigned long aclGetRightsMask(ACContext_t * acc, char **rlist); +extern NSAPI_PUBLIC char * aclGetSignature(ACL_t * acl); +extern NSAPI_PUBLIC char **aclGetUsers(ACL_t * acl, int dirno, int clsno); +extern NSAPI_PUBLIC int aclDNSFilterStrings(char **list, DNSFilter_t * dnf); +extern NSAPI_PUBLIC int aclIPFilterStrings(char **list, IPFilter_t * ipf); +extern NSAPI_PUBLIC int aclIdsToNames(char **list, + USIList_t * uilptr, int uflag, Realm_t * rlm); +extern NSAPI_PUBLIC int aclMakeNew(ACContext_t * acc, char * aclsig, char * aclname, + char **rights, int flags, ACL_t **pacl); +extern NSAPI_PUBLIC int aclPutAllowDeny(NSErr_t * errp, ACL_t * acl, + int always, int allow, char **users, char **hosts); +extern NSAPI_PUBLIC int aclPutAuth(NSErr_t * errp, ACL_t * acl, + int always, int amethod, char * dbname, char * prompt); +extern NSAPI_PUBLIC char * aclSafeIdent(char * str); +extern NSAPI_PUBLIC int aclSetRights(ACL_t * acl, char **rights, int replace); +extern NSAPI_PUBLIC int accWriteFile(ACContext_t * acc, char * filename, int flags); +extern NSAPI_PUBLIC int aclStringGet(LEXStream_t * lst); +extern NSAPI_PUBLIC int aclStringOpen(NSErr_t * errp, + int slen, char * sptr, int flags, ACLFile_t **pacf); +extern NSAPI_PUBLIC int aclCheckUsers(NSErr_t * errp, char * dbpath, char * usernames, + char * groupnames, char ***uglist, char ***badulist, + char ***badglist); +extern NSAPI_PUBLIC int aclCheckHosts(NSErr_t * errp, + int hexpand, char * dnsspecs, char * ipspecs, + char ***hlist, char ***baddns, char ***badip); + +#ifdef NOTDEF +extern int aclSetAuthMethod(ACL_t * acl, int dirno, char * amethod); +extern int aclSetDatabase(ACL_t * acl, int dirno, char * dbname); +extern int aclSetExecOptions(ACL_t * acl, char **options); +extern int aclSetHosts(ACL_t * acl, int dirno, char **hostlist); +extern int aclSetPrompt(ACL_t * acl, int dirno, char * prompt); +extern int aclSetUsers(ACL_t * acl, int dirno, char **userlist); +#endif /* NOTDEF */ + +NSPR_END_EXTERN_C + +#endif /* __acladmin_h */ diff --git a/include/libaccess/aclbuild.h b/include/libaccess/aclbuild.h new file mode 100644 index 00000000..319f5342 --- /dev/null +++ b/include/libaccess/aclbuild.h @@ -0,0 +1,56 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef __aclbuild_h +#define __aclbuild_h + +/* + * Description (aclbuild.h) + * + * This file describes the interface to a module which provides + * functions for building Access Control List (ACL) structures + * in memory. + */ + +#include "usi.h" +#include "nserror.h" +#include "aclstruct.h" + +/* Define flags for aclAuthNameAdd() return value */ +#define ANA_GROUP 0x1 /* name matches group name */ +#define ANA_USER 0x2 /* name matches user name */ +#define ANA_DUP 0x4 /* name already in AuthNode_t */ + +NSPR_BEGIN_EXTERN_C + +/* Functions in aclbuild.c */ +extern int accCreate(NSErr_t * errp, void * stp, ACContext_t **pacc); +extern void accDestroy(ACContext_t * acc, int flags); +extern int accDestroySym(Symbol_t * sym, void * argp); +extern int accReadFile(NSErr_t * errp, char * aclfile, ACContext_t **pacc); +extern int aclAuthDNSAdd(HostSpec_t **hspp, char * dnsspec, int fqdn); +extern int aclAuthIPAdd(HostSpec_t **hspp, IPAddr_t ipaddr, IPAddr_t netmask); +extern int aclAuthNameAdd(NSErr_t * errp, UserSpec_t * usp, + Realm_t * rlm, char * name); +extern ACClients_t * aclClientsDirCreate(); +extern int aclCreate(NSErr_t * errp, + ACContext_t * acc, char * aclname, ACL_t **pacl); +extern void aclDestroy(ACL_t * acl); +extern void aclDelete(ACL_t * acl); +extern int aclDirectiveAdd(ACL_t * acl, ACDirective_t * acd); +extern ACDirective_t * aclDirectiveCreate(); +extern void aclDirectiveDestroy(ACDirective_t * acd); +extern int aclDNSSpecDestroy(Symbol_t * sym, void * parg); +extern void aclHostSpecDestroy(HostSpec_t * hsp); +extern void aclRealmSpecDestroy(RealmSpec_t * rsp); +extern int aclRightDef(NSErr_t * errp, + ACContext_t * acc, char * rname, RightDef_t **prd); +extern void aclRightSpecDestroy(RightSpec_t * rsp); +extern UserSpec_t * aclUserSpecCreate(); +extern void aclUserSpecDestroy(UserSpec_t * usp); + +NSPR_END_EXTERN_C + +#endif /* __aclbuild_h */ diff --git a/include/libaccess/aclerror.h b/include/libaccess/aclerror.h new file mode 100644 index 00000000..ffd5510b --- /dev/null +++ b/include/libaccess/aclerror.h @@ -0,0 +1,307 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef __aclerror_h +#define __aclerror_h + +/* ACL facility name string (in aclbuild.c) */ +NSPR_BEGIN_EXTERN_C +extern char * ACL_Program; +NSPR_END_EXTERN_C + +/* Define error identifiers */ + +/* Errors generated in aclparse.c */ + +/* aclAuthListParse() */ +#define ACLERR1000 1000 /* dynamic memory shortage */ + +/* aclAuthHostsParse() */ +#define ACLERR1100 1100 /* unsupported list of host lists */ +#define ACLERR1120 1120 /* host list name not found where expected */ +#define ACLERR1140 1140 /* undefined host list name */ +#define ACLERR1160 1160 /* *unused* */ +#define ACLERR1180 1180 /* error adding IP filter entry */ +#define ACLERR1200 1200 /* error adding DNS filter entry */ +#define ACLERR1220 1220 /* ")" missing */ + +/* aclAuthUsersParse() */ +#define ACLERR1300 1300 /* *unused* */ +#define ACLERR1320 1320 /* *unused* */ +#define ACLERR1340 1340 /* *unused* */ +#define ACLERR1360 1360 /* undefined user or group name */ +#define ACLERR1380 1380 /* duplicate user or group name */ +#define ACLERR1400 1400 /* ")" missing */ +#define ACLERR1420 1420 /* empty auth-user-elem */ +#define ACLERR1440 1440 /* duplicate or conflicting use of "all" */ +#define ACLERR1460 1460 /* duplicate or conflicting use of "any" */ +#define ACLERR1480 1480 /* conflicting use of "all" or "any" */ +#define ACLERR1500 1500 /* insufficient dynamic memory */ +#define ACLERR1520 1520 /* insufficient dynamic memory */ + +/* aclDirectivesParse() */ +#define ACLERR1600 1600 /* dir-access missing */ +#define ACLERR1620 1620 /* invalid dir-access specification */ +#define ACLERR1640 1640 /* error adding ACD_AUTH directive to ACL */ +#define ACLERR1650 1650 /* error adding directive to ACL */ +#define ACLERR1660 1660 /* insufficient dynamic memory */ +#define ACLERR1680 1680 /* insufficient dynamic memory */ +#define ACLERR1685 1685 /* insufficient dynamic memory */ +#define ACLERR1690 1690 /* error adding directive to ACL */ +#define ACLERR1695 1695 /* error in "execute" directive */ + +/* aclACLParse() */ +#define ACLERR1700 1700 /* ACL statement missing */ +#define ACLERR1720 1720 /* ACL name missing */ +#define ACLERR1740 1740 /* opening "{" missing */ +#define ACLERR1760 1760 /* closing "}" missing */ +#define ACLERR1780 1780 /* unrecognized ACL statement */ + +/* aclFileOpen() */ +#define ACLERR1900 1900 /* file open error */ +#define ACLERR1920 1920 /* memory shortage for ACLFile_t */ +#define ACLERR1940 1940 /* memory shortage for token */ +#define ACLERR1960 1960 /* memory shortage for LEX stream */ + +/* aclGetDNSString() */ +#define ACLERR2100 2100 /* */ +#define ACLERR2120 2120 /* */ +#define ACLERR2140 2140 /* */ + +/* aclGetIPAddr() */ +#define ACLERR2200 2200 /* */ +#define ACLERR2220 2220 /* */ +#define ACLERR2240 2240 /* */ +#define ACLERR2260 2260 /* */ +#define ACLERR2280 2280 /* */ +#define ACLERR2300 2300 /* */ +#define ACLERR2320 2320 /* */ + +/* aclGetToken() */ +#define ACLERR2400 2400 /* aclGetToken() parse error */ + +/* aclParseInit() */ + +/* aclRealmSpecParse() */ +#define ACLERR2500 2500 /* missing realm name */ +#define ACLERR2520 2520 /* undefined realm name */ +#define ACLERR2540 2540 /* insufficient dynamic memory */ +#define ACLERR2560 2560 /* missing realm directive */ +#define ACLERR2570 2570 /* missing database filespec */ +#define ACLERR2580 2580 /* missing authentication method name */ +#define ACLERR2600 2600 /* unknown authentication method name */ +#define ACLERR2605 2605 /* realm prompt string missing */ +#define ACLERR2610 2610 /* unknown realm directive */ +#define ACLERR2620 2620 /* missing "}" */ + +/* aclRightsParse() */ +#define ACLERR2700 2700 /* missing rights list element */ +#define ACLERR2720 2720 /* missing rights list name */ +#define ACLERR2740 2740 /* undefined rights list name */ +#define ACLERR2760 2760 /* insufficient dynamic memory */ +#define ACLERR2780 2780 /* insufficient dynamic memory */ +#define ACLERR2800 2800 /* error creating access right definition */ +#define ACLERR2820 2820 /* insufficient dynamic memory */ +#define ACLERR2840 2840 /* missing ")" */ + +/* aclGetFileSpec() */ +#define ACLERR2900 2900 /* skip over whitespace failed */ +#define ACLERR2920 2920 /* scan over filename failed */ +#define ACLERR2940 2940 /* missing filename */ + +/* aclStringOpen() */ +#define ACLERR5000 5000 /* memory shortage for ACLFile_t */ +#define ACLERR5020 5020 /* memory shortage for token */ +#define ACLERR5040 5040 /* memory shortage for LEX stream */ + +/* Errors generated in aclbuild.c */ + +/* accCreate() */ +#define ACLERR3000 3000 /* insufficient dynamic memory */ +#define ACLERR3020 3020 /* insufficient dynamic memory */ + +/* accFileRead() */ +#define ACLERR3100 3100 /* error initializing ACL parser */ +#define ACLERR3120 3120 /* error creating ACL symbol table */ + +/* aclCreate() */ +#define ACLERR3200 3200 /* insufficient dynamic memory */ +#define ACLERR3220 3220 /* duplicate ACL name */ + +/* aclAuthNameAdd() */ +#define ACLERR3400 3400 /* realm missing for user/group name */ +#define ACLERR3420 3420 /* error opening authentication DB */ +#define ACLERR3440 3440 /* error finding name in DB */ +#define ACLERR3460 3460 /* insufficient dynamic memory */ + +/* aclRightDef() */ +#define ACLERR3600 3600 /* insufficient dynamic memory */ +#define ACLERR3620 3620 /* add right to symbol table failed */ + +/* ACL_ListPostParseForAuth() */ +#define ACLERR3800 3800 /* Undefined method/database */ +#define ACLERR3810 3810 /* insufficient dynamic memory */ + +/* Register.cpp */ +#define ACLERR3900 3900 /* Duplicate LAS registered */ + +/* ACL_EvalBuildContext */ +#define ACLERR4000 4000 /* Unable to create context hash */ +#define ACLERR4010 4010 /* Unable to alloc cache structure */ +#define ACLERR4020 4020 /* Unable to alloc ACE entry */ +#define ACLERR4030 4030 /* Unable to alloc ACE entry */ +#define ACLERR4040 4040 /* Unable to alloc Auth Ptr Array */ +#define ACLERR4050 4050 /* Unable to alloc Auth Ptr Array */ + +/* ACL_EvalTestRights */ +#define ACLERR4100 4100 /* Interim absolute, non-allow value */ +#define ACLERR4110 4110 /* BuildContext call failed */ + +/* ACL_ModuleRegister */ +#define ACLERR4200 4200 /* module name missing */ +#define ACLERR4210 4210 /* module registration call failed */ + +/* ACL_GetAttribute */ +#define ACLERR4300 4300 /* Couldn't determine method */ +#define ACLERR4310 4310 /* Couldn't locate Getter */ +#define ACLERR4320 4320 /* Couldn't Set Attr */ +#define ACLERR4330 4330 /* Couldn't Get Attr */ +#define ACLERR4340 4340 /* All getters declined */ +#define ACLERR4350 4350 /* All getters declined */ +#define ACLERR4360 4360 /* All getters declined */ +#define ACLERR4370 4370 /* All getters declined */ +#define ACLERR4380 4380 /* Couldn't determine dbtype */ + +/* reg_dbname_internal */ +#define ACLERR4400 4400 /* dbtype not defined yet */ +#define ACLERR4410 4410 /* dbtype not defined yet */ +#define ACLERR4420 4420 /* out of memory */ + +/* ACL_DatabaseRegister */ +#define ACLERR4500 4500 /* database name is missing */ + +/* ACL_ReadDbMapFile */ +#define ACLERR4600 4600 /* Error reading the Map file */ +#define ACLERR4610 4610 /* Couldn't determine dbtype */ +#define ACLERR4620 4620 /* Missing URL for database */ +#define ACLERR4630 4630 /* Invalid proprty pair */ +#define ACLERR4640 4640 /* Register database failed */ +#define ACLERR4650 4650 /* Default database not LDAP */ +#define ACLERR4660 4660 /* Multiple default databases */ +#define ACLERR4670 4670 /* No default database */ + +/* LASDnsBuild */ +#define ACLERR4700 4700 /* Cannot allocatae hash */ +#define ACLERR4710 4710 /* Cannot add token to hash */ +#define ACLERR4720 4720 /* Cannot add token to hash */ +#define ACLERR4730 4730 /* Cannot add token to hash */ +#define ACLERR4740 4740 /* Cannot add token to hash */ +#define ACLERR4750 4750 /* Cannot add token to hash */ +#define ACLERR4760 4760 /* Cannot add token to hash */ + +/* LASDnsEval */ +#define ACLERR4800 4800 /* Wrong attribute name */ +#define ACLERR4810 4810 /* Illegal comparator */ +#define ACLERR4820 4820 /* Cannot allocate context struct */ +#define ACLERR4830 4830 /* Cannot get DNS attribute */ + +/* LASGroupEval */ +#define ACLERR4900 4900 /* wrong attribute */ +#define ACLERR4910 4910 /* bad comparator */ +#define ACLERR4920 4920 /* unable to get database name */ + +/* LASIpTreeAllocNode */ +#define ACLERR5000 5000 /* Cannot allocate IP tree */ + +/* LASIpAddPattern */ +#define ACLERR5100 5100 /* Cannot allocate IP tree node */ +#define ACLERR5110 5110 /* Cannot allocate IP tree node */ + +/* LASIpEval */ +#define ACLERR5200 5200 /* Wrong attribute */ +#define ACLERR5210 5210 /* Bad comparator */ +#define ACLERR5220 5220 /* Cannot get session pointer */ +#define ACLERR5230 5230 /* Cannot allocate context */ +#define ACLERR5240 5240 /* Tested 32 bits without conclusion */ + +/* LASProgramEval */ +#define ACLERR5300 5300 /* Wrong attribute */ +#define ACLERR5310 5310 /* Bad comparator */ +#define ACLERR5320 5320 /* Can't get request pointer */ +#define ACLERR5330 5330 /* Invalid program expression */ +#define ACLERR5340 5340 /* Rejecting Request */ + +/* LASDayOfWeekEval */ +#define ACLERR5400 5400 /* wrong attribute */ +#define ACLERR5410 5410 /* bad comparator */ + +/* LASTimeOfDayEval */ +#define ACLERR5600 5600 /* wrong attribute */ +#define ACLERR5610 5610 /* bad comparator */ + +/* LASUserEval */ +#define ACLERR5700 5700 /* wrong attribute */ +#define ACLERR5710 5710 /* bad comparator */ +#define ACLERR5720 5720 /* Out of memory */ + +/* ldapacl.cpp */ +#define ACLERR5800 5800 /* missing the database url */ +#define ACLERR5810 5810 /* missing the database name */ +#define ACLERR5820 5820 /* error parsing the db url */ +#define ACLERR5830 5830 /* unable to get db name */ +#define ACLERR5840 5840 /* can't get parsed db name */ +#define ACLERR5850 5850 /* can't init ldap connection */ +#define ACLERR5860 5860 /* passwd check ldap error */ +#define ACLERR5870 5870 /* Out of memory */ +#define ACLERR5880 5880 /* User doesn't exist anymore */ +#define ACLERR5890 5890 /* PList error */ + +/* get_user_ismember_ldap */ +#define ACLERR5900 5900 /* Can't get db name */ +#define ACLERR5910 5910 /* Can't get parsed db name */ +#define ACLERR5920 5920 /* Out of memory */ +#define ACLERR5930 5930 /* Can't init ldap connection */ +#define ACLERR5940 5940 /* Group doesn't exist */ +#define ACLERR5950 5950 /* LDAP error */ + +/* ACL_LDAPDatabaseHandle */ +#define ACLERR6000 6000 /* Not a registered db */ +#define ACLERR6010 6010 /* Not an LDAP db */ +#define ACLERR6020 6020 /* Out of memory */ +#define ACLERR6030 6030 /* Can't init ldap connection */ +#define ACLERR6040 6040 /* Can't bind to ldap server */ + + + +/* Define error return codes */ +#define ACLERRNOMEM -1 /* insufficient dynamic memory */ +#define ACLERROPEN -2 /* file open error */ +#define ACLERRDUPSYM -3 /* duplicate symbol */ +#define ACLERRSYNTAX -4 /* syntax error */ +#define ACLERRUNDEF -5 /* undefined symbol */ +#define ACLERRADB -6 /* authentication DB access error */ +#define ACLERRPARSE -7 /* ACL parsing error */ +#define ACLERRNORLM -8 /* missing authentication realm */ +#define ACLERRIO -9 /* IO error */ +#define ACLERRINTERNAL -10 /* internal processing error */ +/* #define ACLERRFAIL -11 */ /* defined in include/public/nsacl/acldef.h */ +#define ACLERRINVAL -12 /* invalid argument */ +#define ACLERRCONFIG -13 /* auth realms don't math acl */ + +#include "nserror.h" + +#ifndef PUBLIC_NSACL_ACLDEF_H +#include "public/nsacl/acldef.h" +#endif /* !PUBLIC_NSACL_ACLDEF_H */ + +NSPR_BEGIN_EXTERN_C + +/* Functions in aclerror.c */ +extern void aclErrorFmt(NSErr_t * errp, + char * msgbuf, int maxlen, int maxdepth); + +NSPR_END_EXTERN_C + +#endif /* __aclerror_h */ diff --git a/include/libaccess/acleval.h b/include/libaccess/acleval.h new file mode 100644 index 00000000..7fbd077a --- /dev/null +++ b/include/libaccess/acleval.h @@ -0,0 +1,37 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef __acleval_h +#define __acleval_h + +/* + * Description (acleval.h) + * + * This file defines the interface to the ACL evaluation module. + */ + +#include "nserror.h" +#include "nsauth.h" +#include "aclstruct.h" + +/* Define values returned by lookup routines */ +#define ACL_NOMATCH 0 /* no match */ +#define ACL_IPMATCH 0x1 /* IP address match */ +#define ACL_DNMATCH 0x2 /* DNS name match */ +#define ACL_USMATCH 0x4 /* user name match */ +#define ACL_GRMATCH 0x8 /* user is member of group */ + +NSPR_BEGIN_EXTERN_C + +/* Functions in acleval.c */ +extern int aclDNSLookup(DNSFilter_t * dnf, + char * dnsspec, int fqdn, char **match); +extern int aclIPLookup(IPFilter_t * ipf, IPAddr_t ipaddr, void **match); +extern int aclUserLookup(UidUser_t * uup, UserObj_t * uoptr); +extern int aclEvaluate(ACL_t * acl, USI_t arid, ClAuth_t * clauth, int * padn); + +NSPR_END_EXTERN_C + +#endif /* __acleval_h */ diff --git a/include/libaccess/aclglobal.h b/include/libaccess/aclglobal.h new file mode 100644 index 00000000..165a69ef --- /dev/null +++ b/include/libaccess/aclglobal.h @@ -0,0 +1,52 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/* +** Header file containing global data elements. These are duplicated +** when a cache flush is done. +*/ + +#include + +struct ACLGlobal_s { + ACLListHandle_t *masterlist; + pool_handle_t *pool; /* Deallocate at the start of cache flush */ + pool_handle_t *databasepool; + pool_handle_t *methodpool; + PRHashTable *urihash; + PRHashTable *urigethash; + PRHashTable *listhash; + PRHashTable *evalhash; + PRHashTable *flushhash; + PRHashTable *methodhash; + PRHashTable *dbtypehash; + PRHashTable *dbnamehash; + PRHashTable *attrgetterhash; + PRHashTable *userLdbHash; /* user's LDAP handle hash */ +}; + +typedef struct ACLGlobal_s ACLGlobal_t; +typedef struct ACLGlobal_s *ACLGlobal_p; + +#define acl_uri_hash_pool ACLGlobal->pool +#define acl_uri_hash ACLGlobal->urihash +#define acl_uri_get_hash ACLGlobal->urigethash +#define ACLListHash ACLGlobal->listhash +#define ACLLasEvalHash ACLGlobal->evalhash +#define ACLLasFlushHash ACLGlobal->flushhash +#define ACLMethodHash ACLGlobal->methodhash +#define ACLDbTypeHash ACLGlobal->dbtypehash +#define ACLDbNameHash ACLGlobal->dbnamehash +#define ACLAttrGetterHash ACLGlobal->attrgetterhash +#define ACLUserLdbHash ACLGlobal->userLdbHash +#define ACL_DATABASE_POOL ACLGlobal->databasepool +#define ACL_METHOD_POOL ACLGlobal->methodpool + +NSPR_BEGIN_EXTERN_C + +extern ACLGlobal_p ACLGlobal; +extern ACLGlobal_p oldACLGlobal; + +NSPR_END_EXTERN_C diff --git a/include/libaccess/aclparse.h b/include/libaccess/aclparse.h new file mode 100644 index 00000000..503657e1 --- /dev/null +++ b/include/libaccess/aclparse.h @@ -0,0 +1,112 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef __aclparse_h +#define __aclparse_h + +/* + * Description (aclparse.h) + * + * This file describes the interface to a parser for files + * containing Access Control List (ACL) definitions. The parser + * uses the services of the aclbuild module to construct an + * in-memory representation of the ACLs it parses. + */ + +#include "nserror.h" +#include "aclbuild.h" + +/* Define keywords */ +#define KEYWORD_ACL "acl" +#define KEYWORD_ALL "all" +#define KEYWORD_ALLOW "allow" +#define KEYWORD_ANY "anyone" +#define KEYWORD_AT "at" +#define KEYWORD_AUTH "authenticate" +#define KEYWORD_BASIC "basic" +#define KEYWORD_DATABASE "database" +#define KEYWORD_DEFAULT "default" +#define KEYWORD_DENY "deny" +#define KEYWORD_EXECUTE "execute" +#define KEYWORD_HOSTS "hosts" +#define KEYWORD_IF "if" +#define KEYWORD_IN "in" +#define KEYWORD_INCLUDE "include" +#define KEYWORD_METHOD "method" +#define KEYWORD_PROMPT "prompt" +#define KEYWORD_REALM "realm" +#define KEYWORD_RIGHTS "rights" +#define KEYWORD_SSL "ssl" + +/* Define character classes */ +#define CCM_WS 0x1 /* whitespace */ +#define CCM_NL 0x2 /* newline */ +#define CCM_SPECIAL 0x4 /* special characters */ +#define CCM_DIGIT 0x8 /* digits */ +#define CCM_LETTER 0x10 /* letters */ +#define CCM_HYPHEN 0x20 /* hyphen */ +#define CCM_USCORE 0x40 /* underscore */ +#define CCM_FILESPEC 0x80 /* filename special characters */ + +#define CCM_HYPUND (CCM_HYPHEN|CCM_USCORE) +#define CCM_IDENT (CCM_LETTER|CCM_DIGIT|CCM_HYPUND) +#define CCM_FILENAME (CCM_LETTER|CCM_DIGIT|CCM_FILESPEC) + +/* Define token numbers */ +#define TOKEN_ERROR -1 /* error in reading data stream */ +#define TOKEN_EOF 0 /* end-of-file */ +#define TOKEN_EOS 1 /* end-of-statement */ +#define TOKEN_IDENT 2 /* identifier */ +#define TOKEN_NUMBER 3 /* number */ +#define TOKEN_COMMA 4 /* comma */ +#define TOKEN_SEMI 5 /* semicolon */ +#define TOKEN_PERIOD 6 /* period */ +#define TOKEN_LPAREN 7 /* left parenthesis */ +#define TOKEN_RPAREN 8 /* right parenthesis */ +#define TOKEN_LBRACE 9 /* left brace */ +#define TOKEN_RBRACE 10 /* right brace */ +#define TOKEN_AT 11 /* at sign */ +#define TOKEN_PLUS 12 /* plus sign */ +#define TOKEN_STAR 13 /* asterisk */ +#define TOKEN_STRING 14 /* quoted string */ +#define TOKEN_HUH 15 /* unrecognized input */ + +/* Define flags bits for aclGetToken() */ +#define AGT_NOSKIP 0x1 /* don't skip leading whitespace */ +#define AGT_APPEND 0x2 /* append next to token buffer */ + +NSPR_BEGIN_EXTERN_C + +extern void * aclChTab; /* character table for ACL parsing */ + +/* Functions in aclparse.c */ +extern int aclAuthListParse(NSErr_t * errp, ACLFile_t * acf, + ACContext_t * acc, Realm_t * rlm, + ACClients_t **clsp); +extern int aclAuthHostsParse(NSErr_t * errp, ACLFile_t * acf, + ACContext_t * acc, HostSpec_t **hspp); +extern int aclAuthUsersParse(NSErr_t * errp, ACLFile_t * acf, + Realm_t * rlm, UserSpec_t **uspp, char ***elist); +extern int aclDirectivesParse(NSErr_t * errp, ACLFile_t * acf, ACL_t * acl); +extern int aclACLParse(NSErr_t * errp, + ACLFile_t * acf, ACContext_t * acc, int flags); +extern void aclFileClose(ACLFile_t * acf, int flags); +extern int aclFileOpen(NSErr_t * errp, + char * filename, int flags, ACLFile_t **pacf); +extern int aclGetDNSString(NSErr_t * errp, ACLFile_t * acf); +extern int aclGetFileSpec(NSErr_t * errp, ACLFile_t * acf, int flags); +extern int aclGetIPAddr(NSErr_t * errp, + ACLFile_t * acf, IPAddr_t * pip, IPAddr_t * pmask); +extern int aclGetToken(NSErr_t * errp, ACLFile_t * acf, int flags); +extern int aclParseInit(); +extern int aclRealmSpecParse(NSErr_t * errp, ACLFile_t * acf, + ACContext_t * acc, RealmSpec_t **rspp); +extern int aclRightsParse(NSErr_t * errp, ACLFile_t * acf, ACContext_t * acc, + RightSpec_t **rights); +extern int aclStreamGet(LEXStream_t * lst); + +NSPR_END_EXTERN_C + +#endif /* __aclparse_h */ diff --git a/include/libaccess/aclproto.h b/include/libaccess/aclproto.h new file mode 100644 index 00000000..6dbc07d5 --- /dev/null +++ b/include/libaccess/aclproto.h @@ -0,0 +1,156 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef ACL_PROTO_HEADER +#define ACL_PROTO_HEADER + +#ifndef NOINTNSACL +#define INTNSACL +#endif /* !NOINTNSACL */ + +#ifndef PUBLIC_NSACL_ACLDEF_H +#include "public/nsacl/acldef.h" +#endif /* !PUBLIC_NSACL_ACLDEF_H */ + +#ifdef INTNSACL + +NSPR_BEGIN_EXTERN_C + +/********************************************************************* + * ACL language and file interfaces + *********************************************************************/ + +NSAPI_PUBLIC ACLListHandle_t * ACL_ParseFile(NSErr_t *errp, char *filename); +NSAPI_PUBLIC ACLListHandle_t * ACL_ParseString(NSErr_t *errp, char *buffer); +NSAPI_PUBLIC int ACL_Decompose(NSErr_t *errp, char **acl, ACLListHandle_t *acl_list); +NSAPI_PUBLIC int ACL_WriteString(NSErr_t *errp, char **acl, ACLListHandle_t *acllist); +NSAPI_PUBLIC int ACL_WriteFile(NSErr_t *errp, char *filename, ACLListHandle_t *acllist); +NSAPI_PUBLIC int ACL_FileRenameAcl(NSErr_t *errp, char *filename, char *acl_name, char *new_acl_name, int flags); +NSAPI_PUBLIC int ACL_FileDeleteAcl(NSErr_t *errp, char *filename, char *acl_name, int flags); +NSAPI_PUBLIC int ACL_FileGetAcl(NSErr_t *errp, char *filename, char *acl_name, char **acl_text, int flags); +NSAPI_PUBLIC int ACL_FileSetAcl(NSErr_t *errp, char *filename, char *acl_text, int flags); +NSAPI_PUBLIC int ACL_FileMergeAcl(NSErr_t *errp, char *filename, char **acl_name_list, char *new_acl_name, int flags); +NSAPI_PUBLIC int ACL_FileMergeFile(NSErr_t *errp, char *filename, char **file_list, int flags); + + +/********************************************************************* + * ACL Expression construction interfaces + *********************************************************************/ +NSAPI_PUBLIC ACLExprHandle_t *ACL_ExprNew(const ACLExprType_t expr_type); +NSAPI_PUBLIC void ACL_ExprDestroy(ACLExprHandle_t *expr); +NSAPI_PUBLIC int ACL_ExprSetPFlags(NSErr_t *errp, ACLExprHandle_t *expr, PFlags_t flags); +NSAPI_PUBLIC int ACL_ExprClearPFlags(NSErr_t *errp, ACLExprHandle_t *expr); +NSAPI_PUBLIC int ACL_ExprTerm(NSErr_t *errp, ACLExprHandle_t *acl_expr, char *attr_name, CmpOp_t cmp, char *attr_pattern); +NSAPI_PUBLIC int ACL_ExprNot(NSErr_t *errp, ACLExprHandle_t *acl_expr); +NSAPI_PUBLIC int ACL_ExprAnd(NSErr_t *errp, ACLExprHandle_t *acl_expr); +NSAPI_PUBLIC int ACL_ExprOr(NSErr_t *errp, ACLExprHandle_t *acl_expr); +NSAPI_PUBLIC int ACL_ExprAddAuthInfo(ACLExprHandle_t *expr, PList_t auth_info); +NSAPI_PUBLIC int ACL_ExprAddArg(NSErr_t *errp, ACLExprHandle_t *expr, char *arg); +NSAPI_PUBLIC int ACL_ExprSetDenyWith(NSErr_t *errp, ACLExprHandle_t *expr, char *deny_type, char *deny_response); +NSAPI_PUBLIC int ACL_ExprGetDenyWith(NSErr_t *errp, ACLExprHandle_t *expr, char **deny_type, char **deny_response); + +/********************************************************************* + * ACL manipulation + *********************************************************************/ + +NSAPI_PUBLIC ACLHandle_t * ACL_AclNew(NSErr_t *errp, char *tag); +NSAPI_PUBLIC void ACL_AclDestroy(NSErr_t *errp, ACLHandle_t *acl); +NSAPI_PUBLIC int ACL_ExprAppend(NSErr_t *errp, ACLHandle_t *acl, ACLExprHandle_t *expr); +NSAPI_PUBLIC const char *ACL_AclGetTag(ACLHandle_t *acl); + +/********************************************************************* + * ACL list manipulation + *********************************************************************/ + +NSAPI_PUBLIC ACLListHandle_t * ACL_ListNew(NSErr_t *errp); +NSAPI_PUBLIC int ACL_ListConcat(NSErr_t *errp, ACLListHandle_t *acl_list1, ACLListHandle_t *acl_list2, int flags); +NSAPI_PUBLIC int ACL_ListAppend(NSErr_t *errp, ACLListHandle_t *acllist, ACLHandle_t *acl, int flags); +NSAPI_PUBLIC void ACL_ListDestroy(NSErr_t *errp, ACLListHandle_t *acllist); +NSAPI_PUBLIC ACLHandle_t * ACL_ListFind(NSErr_t *errp, ACLListHandle_t *acllist, char *aclname, int flags); +NSAPI_PUBLIC int ACL_ListAclDelete(NSErr_t *errp, ACLListHandle_t *acl_list, char *acl_name, int flags); +NSAPI_PUBLIC int ACL_ListGetNameList(NSErr_t *errp, ACLListHandle_t *acl_list, char ***name_list); +NSAPI_PUBLIC int ACL_FileGetNameList(NSErr_t *errp, char * filename, char ***name_list); +NSAPI_PUBLIC int ACL_NameListDestroy(NSErr_t *errp, char **name_list); +NSAPI_PUBLIC ACLHandle_t *ACL_ListGetFirst(ACLListHandle_t *acl_list, + ACLListEnum_t *acl_enum); +NSAPI_PUBLIC ACLHandle_t *ACL_ListGetNext(ACLListHandle_t *acl_list, + ACLListEnum_t *acl_enum); + +/* Only used for asserts. Probably shouldn't be publicly advertized */ +extern int ACL_AssertAcllist( ACLListHandle_t *acllist ); + +/* Need to be ACL_LIB_INTERNAL */ +NSAPI_PUBLIC int ACL_ListPostParseForAuth(NSErr_t *errp, ACLListHandle_t *acl_list); + +/********************************************************************* + * ACL evaluation + *********************************************************************/ + +NSAPI_PUBLIC int ACL_EvalTestRights(NSErr_t *errp, ACLEvalHandle_t *acleval, char **rights, char **map_generic, char **deny_type, char **deny_response, char **acl_tag, int *expr_num); +NSAPI_PUBLIC int ACL_CachableAclList(ACLListHandle_t *acllist); +NSAPI_PUBLIC ACLEvalHandle_t * ACL_EvalNew(NSErr_t *errp, pool_handle_t *pool); +NSAPI_PUBLIC void ACL_EvalDestroy(NSErr_t *errp, pool_handle_t *pool, ACLEvalHandle_t *acleval); +NSAPI_PUBLIC void ACL_EvalDestroyNoDecrement(NSErr_t *errp, pool_handle_t *pool, ACLEvalHandle_t *acleval); +NSAPI_PUBLIC int ACL_ListDecrement(NSErr_t *errp, ACLListHandle_t *acllist); +NSAPI_PUBLIC int ACL_EvalSetACL(NSErr_t *errp, ACLEvalHandle_t *acleval, ACLListHandle_t *acllist); +NSAPI_PUBLIC PList_t ACL_EvalGetSubject(NSErr_t *errp, ACLEvalHandle_t *acleval); +NSAPI_PUBLIC int ACL_EvalSetSubject(NSErr_t *errp, ACLEvalHandle_t *acleval, PList_t subject); +NSAPI_PUBLIC PList_t ACL_EvalGetResource(NSErr_t *errp, ACLEvalHandle_t *acleval); +NSAPI_PUBLIC int ACL_EvalSetResource(NSErr_t *errp, ACLEvalHandle_t *acleval, PList_t resource); + +/* + * The following entities are only meant to be called by whole server + * products that include libaccess. E.g. the HTTP server, the Directory + * server etc. They should not be called by ACL callers, LASs etc. + */ + +/********************************************************************* + * ACL misc routines + *********************************************************************/ + +NSAPI_PUBLIC int ACL_Init(void); +NSAPI_PUBLIC int ACL_InitPostMagnus(void); +NSAPI_PUBLIC int ACL_LateInitPostMagnus(void); +NSAPI_PUBLIC void ACL_ListHashUpdate(ACLListHandle_t **acllistp); +NSAPI_PUBLIC void ACL_GetPathAcls(char *path, ACLListHandle_t **acllist_p, char *prefix, ACLListHandle_t *masterlist); +NSAPI_PUBLIC int ACL_ReadDbMapFile(NSErr_t *errp, const char *map_file, int default_only); + +NSAPI_PUBLIC int ACL_MethodNamesGet(NSErr_t *errp, char ***names, int *count); +NSAPI_PUBLIC int ACL_MethodNamesFree(NSErr_t *errp, char **names, int count); + +NSAPI_PUBLIC int ACL_DatabaseNamesGet(NSErr_t *errp, char ***names, int *count); +NSAPI_PUBLIC int ACL_DatabaseNamesFree(NSErr_t *errp, char **names, int count); + +NSAPI_PUBLIC int ACL_InitAttr2Index(void); +NSAPI_PUBLIC int ACL_Attr2Index(const char *attrname); + +/********************************************************************* + * ACL cache and flush utility + *********************************************************************/ + +NSAPI_PUBLIC int ACL_CacheCheck(char *uri, ACLListHandle_t **acllist_p); +NSAPI_PUBLIC int ACL_CacheCheckGet(char *uri, ACLListHandle_t **acllist_p); +NSAPI_PUBLIC void ACL_CacheEnter(char *uri, ACLListHandle_t **acllist_p); +NSAPI_PUBLIC void ACL_CacheEnterGet(char *uri, ACLListHandle_t **acllist_p); +NSAPI_PUBLIC int ACL_ListHashCheck(ACLListHandle_t **acllist_p); +NSAPI_PUBLIC void ACL_ListHashEnter(ACLListHandle_t **acllist_p); +NSAPI_PUBLIC int ACL_CacheFlush(void); +NSAPI_PUBLIC void ACL_Restart(void *clntData); +NSAPI_PUBLIC void ACL_CritEnter(void); +NSAPI_PUBLIC void ACL_CritExit(void); + +/********************************************************************* + * ACL CGI routines + *********************************************************************/ + +NSAPI_PUBLIC void ACL_OutputSelector(char *name, char **item); + + +NSPR_END_EXTERN_C + +#endif /* INTNSACL */ + +#endif + diff --git a/include/libaccess/aclstruct.h b/include/libaccess/aclstruct.h new file mode 100644 index 00000000..71320b0f --- /dev/null +++ b/include/libaccess/aclstruct.h @@ -0,0 +1,264 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef __aclstruct_h +#define __aclstruct_h + +/* + * Description (aclstruct.h) + * + * This file defines types and data structures used to construct + * representations of Access Control Lists (ACLs) in memory. + */ + +#include "base/systems.h" +#include "base/file.h" +#include "base/lexer.h" +#include "nsauth.h" /* authentication types */ +#include "symbols.h" /* typed symbol support */ +#include "ipfstruct.h" /* IP address filter structures */ +#include "dnfstruct.h" /* DNS name filter structures */ + + +NSPR_BEGIN_EXTERN_C + +/* Forward type definitions */ +typedef struct ACL_s ACL_t; + +/* + * Description (InetHost_t) + * + * This type defines a structure which represents a list of Internet + * hosts by IP address and netmask, or by fully or partially + * qualified DNS name. + */ + +typedef struct InetHost_s InetHost_t; +struct InetHost_s { + IPFilter_t inh_ipf; /* reference to IP filter */ + DNSFilter_t inh_dnf; /* reference to DNS filter */ +}; + +/* + * Description (HostSpec_t) + * + * This type describes a named list of hosts. + */ + +typedef struct HostSpec_s HostSpec_t; +struct HostSpec_s { + Symbol_t hs_sym; /* symbol name, type ACLSYMHOST */ + InetHost_t hs_host; /* host information */ +}; + +/* + * Description (UidUser_t) + * + * This type represents a list of users and groups using unique + * integer identifiers. + */ + +typedef struct UidUser_s UidUser_t; +struct UidUser_s { + USIList_t uu_user; /* list of user ids */ + USIList_t uu_group; /* list of group ids */ +}; + +/* + * Description (UserSpec_t) + * + * This type describes a named list of users and groups. + */ + +typedef struct UserSpec_s UserSpec_t; +struct UserSpec_s { + Symbol_t us_sym; /* list name, type ACLSYMUSER */ + int us_flags; /* bit flags */ +#define ACL_USALL 0x1 /* any authenticated user */ + + UidUser_t us_user; /* user list structure */ +}; + +/* + * Description (ACClients_t) + * + * This type defines the structure of action-specific information + * for access control directives with action codes ACD_ALLOW and + * ACD_DENY. These directives specify access control constraints + * on users/groups and hosts. + */ + +typedef struct ACClients_s ACClients_t; +struct ACClients_s { + ACClients_t * cl_next; /* list link */ + HostSpec_t * cl_host; /* host specification pointer */ + UserSpec_t * cl_user; /* user list pointer */ +}; + +/* + * Description (RealmSpec_t) + * + * This type describes a named realm. + */ + +typedef struct RealmSpec_s RealmSpec_t; +struct RealmSpec_s { + Symbol_t rs_sym; /* realm name, type ACLSYMREALM */ + Realm_t rs_realm; /* realm information */ +}; + +/* + * Description (ACAuth_t) + * + * This type defines the structure of action-specific information + * for an access control directive with action code ACD_AUTH, + * which specifies information about authentication requirements. + */ + +typedef struct ACAuth_s ACAuth_t; +struct ACAuth_s { + RealmSpec_t * au_realm; /* pointer to realm information */ +}; + +/* + * Description (ACDirective_t) + * + * This type defines a structure which represents an access control + * directive. Each directive specifies an access control action + * to be taken during ACL evaluation. The ACDirective_t structure + * begins an action-specific structure which contains the + * parameters for an action. + */ + +typedef struct ACDirective_s ACDirective_t; +struct ACDirective_s { + ACDirective_t * acd_next; /* next directive in ACL */ + short acd_action; /* directive action code */ + short acd_flags; /* action modifier flags */ + + /* Begin action-specific information */ + union { + ACClients_t * acu_cl; /* ACD_ALLOW, ACD_DENY */ + ACAuth_t acu_auth; /* ACD_AUTH */ + } acd_u; +}; + +#define acd_cl acd_u.acu_cl +#define acd_auth acd_u.acu_auth + +/* Define acd_action codes */ +#define ACD_ALLOW 1 /* allow access */ +#define ACD_DENY 2 /* deny access */ +#define ACD_AUTH 3 /* specify authentication realm */ +#define ACD_EXEC 4 /* execute (conditionally) */ + +/* Define acd_flags values */ +#define ACD_ACTION 0xf /* bits reserved for acd_action */ +#define ACD_FORCE 0x10 /* force of action */ +#define ACD_DEFAULT 0 /* default action */ +#define ACD_ALWAYS ACD_FORCE /* immediate action */ +#define ACD_EXALLOW 0x20 /* execute if allow */ +#define ACD_EXDENY 0x40 /* execute if deny */ +#define ACD_EXAUTH 0x80 /* execute if authenticate */ + +/* + * Description (RightDef_t) + * + * This type describes a named access right. Each access right has + * an associated unique integer id. A list of all access rights + * known in an ACL context is maintained, with its head in the + * ACContext_t structure. + */ + +typedef struct RightDef_s RightDef_t; +struct RightDef_s { + Symbol_t rd_sym; /* right name, type ACLSYMRIGHT */ + RightDef_t * rd_next; /* next on ACContext_t list */ + USI_t rd_id; /* unique id */ +}; + +/* + * Description (RightSpec_t) + * + * This type describes a named list of access rights. + */ + +typedef struct RightSpec_s RightSpec_t; +struct RightSpec_s { + Symbol_t rs_sym; /* list name, type ACLSYMRDEF */ + USIList_t rs_list; /* list of right ids */ +}; + +/* + * Description (ACContext_t) + * + * This type defines a structure that defines a context for a set + * of Access Control Lists. This includes references to an + * authentication database, if any, and a symbol table containing + * access right definitions. It also serves as a list head for the + * ACLs which are defined in the specified context. + */ + +typedef struct ACContext_s ACContext_t; +struct ACContext_s { + void * acc_stp; /* symbol table handle */ + ACL_t * acc_acls; /* list of ACLs */ + RightDef_t * acc_rights; /* list of access right definitions */ + int acc_refcnt; /* reference count */ +}; + +/* + * Description (ACL_t) + * + * This type defines the structure that represents an Access Control + * List (ACL). An ACL has a user-assigned name and an internally + * assigned identifier (which is an index in an object directory). + * It references a list of access rights which are to be allowed or + * denied, according to the ACL specifications. It references an + * ordered list of ACL directives, which specify who has and who does + * not have the associated access rights. + */ + +struct ACL_s { + Symbol_t acl_sym; /* ACL name, type ACLSYMACL */ + ACL_t * acl_next; /* next ACL on a list */ + ACContext_t * acl_acc; /* context for this ACL */ + USI_t acl_id; /* id of this ACL */ + int acl_refcnt; /* reference count */ + RightSpec_t * acl_rights; /* access rights list */ + ACDirective_t * acl_dirf; /* first directive pointer */ + ACDirective_t * acl_dirl; /* last directive pointer */ +}; + +/* Define symbol type codes */ +#define ACLSYMACL 0 /* ACL */ +#define ACLSYMRIGHT 1 /* access right */ +#define ACLSYMRDEF 2 /* access rights list */ +#define ACLSYMREALM 3 /* realm name */ +#define ACLSYMHOST 4 /* host specifications */ +#define ACLSYMUSER 5 /* user/group list */ + +/* + * Description (ACLFile_t) + * + * This type describes a structure containing information about + * an open ACL description file. + */ + +typedef struct ACLFile_s ACLFile_t; +struct ACLFile_s { + ACLFile_t * acf_next; /* list link */ + char * acf_filename; /* pointer to filename string */ + LEXStream_t * acf_lst; /* LEX stream handle */ + SYS_FILE acf_fd; /* file descriptor */ + int acf_flags; /* bit flags (unused) */ + int acf_lineno; /* current line number */ + void * acf_token; /* LEX token handle */ + int acf_ttype; /* current token type */ +}; + +NSPR_END_EXTERN_C + +#endif /* __aclstruct_h */ diff --git a/include/libaccess/attrec.h b/include/libaccess/attrec.h new file mode 100644 index 00000000..267c32ff --- /dev/null +++ b/include/libaccess/attrec.h @@ -0,0 +1,157 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef __attrec_h +#define __attrec_h + +/* + * Description (attrec.h) + * + * This file describes the encoding and decoding of attribute + * records. Attribute records consist of a sequence of items + * of the form: + * + * + * + * The is an integer code which identifies a particular + * attribute. The is the integer length in bytes of + * the . The encoding of the contents is determined + * by the , and is application-specific. + * + * Primitive data types currently supported are unsigned + * integers (USI) and null-terminated strings (NTS). The + * encoding of USI values less than 128 is simply an octet + * containing the value. For values 128 or greater, the first + * octet is 0x80 plus the length of the value, in octets. + * This octet is followed by the indicated number of octets, + * containing the USI value, with the most significant bits in + * the first octet, and the least significant bits in the last + * octet. + * + * Examples of USI encoding: + * + * Value Encoding (each value is an octet) + * 4 0x04 + * 127 0x7f + * -1 (this is not a USI) + * 128 0x81 0x80 + * 1023 0x82 0x03 0xff + * + * The encoding of a null-terminated string (NTS) is simply the + * sequence of octets which comprise the string, including the + * terminating null (0x00) octet. The terminating null octet is + * the only null value in the string. The character set used to + * encode the other string octets is ASCII. + */ + +#include "usi.h" + +NSPR_BEGIN_EXTERN_C + +/* Define a type to reference an attribute record */ +typedef unsigned char * ATR_t; + +/* + * Description (USILENGTH) + * + * This macro returns the length of the USI encoding for a specified + * unsigned integer value. The length is the number of octets + * required. It will be greater than zero, and less than or equal + * to USIALLOC(). This is a partial inline optimization of + * USI_Length(). + */ + +#define USILENGTH(val) (((USI_t)(val) <= 0x7f) ? 1 : USI_Length((USI_t)(val))) + +/* + * Description (USIALLOC) + * + * This macro returns the maximum length of an unsigned integer + * encoding. + */ + +#define USIALLOC() (5) + +/* + * Description (USIENCODE) + * + * This macro encodes a USI value into a specified buffer. It + * returns a pointer to the first octet after the encoding. + * This is a partial inline optimization for USI_Encode(). + */ + +#define USIENCODE(cp, val) (((USI_t)(val) <= 0x7f) ? (*(cp) = (val), (cp)+1) \ + : USI_Encode((cp), (val))) + +/* + * Description (USIINSERT) + * + * This macro performs a variation of USIENCODE which always + * generates the maximum-sized USI encoding, i.e. the number of + * octets indicated by USIALLOC(). + */ + +#define USIINSERT(cp, val) USI_Insert((ATR_t)(cp), (USI_t)(val)) + +/* + * Description (USIDECODE) + * + * This macro decodes a USI value from a specified buffer. It + * returns a pointer to the first octet after the encoding. + * This is a partial inline optimization for USI_Decode(). + */ + +#define USIDECODE(cp, pval) \ + ((*(cp) & 0x80) ? USI_Decode((cp), (pval)) \ + : (((pval) ? (*(pval) = *(cp)) : 0), (cp)+1)) + +/* Define a type to reference a null-terminated string */ +typedef unsigned char * NTS_t; + +/* + * Decription (NTSLENGTH) + * + * Return the length, in octets, of a null-terminated string. + * It includes the terminating null octet. + */ + +#define NTSLENGTH(nts) ((nts) ? strlen((char *)(nts)) + 1 : 1) + +/* + * Description (NTSENCODE) + * + * This macro copies a null-terminated string to a specified + * attribute record buffer. It returns a pointer to the octet + * following the NTS in the buffer. + */ + +#define NTSENCODE(cp, nts) \ + ((ATR_t)memccpy((void *)(cp), \ + (void *)((nts) ? (NTS_t)(nts) : (NTS_t)""), \ + 0, NTSLENGTH(nts))) + +/* + * Description (NTSDECODE) + * + * This macro decodes a null-terminated string in a specified + * attribute record buffer into a dynamically allocated buffer. + * It returns a pointer to the first octet after the NTS in the + * attribute record buffer. + */ + +#define NTSDECODE(cp, pnts) NTS_Decode((cp), (pnts)) + +/* Functions in attrec.c */ +extern int NTS_Length(NTS_t ntsp); +extern ATR_t NTS_Decode(ATR_t cp, NTS_t * pnts); +extern ATR_t NTS_Encode(ATR_t cp, NTS_t nts); +extern ATR_t USI_Decode(ATR_t cp, USI_t * pval); +extern ATR_t USI_Encode(ATR_t cp, USI_t val); +extern ATR_t USI_Insert(ATR_t cp, USI_t val); +extern int USI_Length(USI_t val); + +NSPR_END_EXTERN_C + +#endif /* __attrec_h */ diff --git a/include/libaccess/authdb.h b/include/libaccess/authdb.h new file mode 100644 index 00000000..952f0d07 --- /dev/null +++ b/include/libaccess/authdb.h @@ -0,0 +1,24 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef AUTHDB_H +#define AUTHDB_H + +#include +#include +#include + +#define URL_PREFIX_LDAP "ldap" +#define URL_PREFIX_LDAP_LEN 4 + +typedef struct { + char *dbname; + ACLDbType_t dbtype; + void *dbinfo; +} AuthdbInfo_t; + +extern int acl_num_databases(); + +#endif /* AUTHDB_H */ diff --git a/include/libaccess/ava.h b/include/libaccess/ava.h new file mode 100644 index 00000000..c8570b90 --- /dev/null +++ b/include/libaccess/ava.h @@ -0,0 +1,40 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef _ava_h +#define _ava_h + +#define ENTRIES_ALLOCSIZE 100 +#define ORGS_ALLOCSIZE 15 + + +#ifdef XP_WIN32 +#define NSAPI_PUBLIC __declspec(dllexport) +#else /* !XP_WIN32 */ +#define NSAPI_PUBLIC +#endif + + +typedef struct { + char *email; + char *locality; + char *userid; + char *state; + char *country; + char *company; + int numOrgs; + char **organizations; + char *CNEntry; +} AVAEntry; + +typedef struct { + char *userdb; + int numEntries; + AVAEntry **enteredTable; +} AVATable; + + +#endif + diff --git a/include/libaccess/avadb.h b/include/libaccess/avadb.h new file mode 100644 index 00000000..bbb6c904 --- /dev/null +++ b/include/libaccess/avadb.h @@ -0,0 +1,15 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef _avadb_h_ +#define _avadb_h_ + +#define USE_NSAPI + +USE_NSAPI int AddEntry (char *key, char *value); +USE_NSAPI int DeleteEntry (char *key); +USE_NSAPI char *GetValue (char *key); + +#endif /*_avadb_h_*/ diff --git a/include/libaccess/avapfile.h b/include/libaccess/avapfile.h new file mode 100644 index 00000000..4b60117c --- /dev/null +++ b/include/libaccess/avapfile.h @@ -0,0 +1,59 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef _avaparsedfiles_h_ +#define _avaparsedfiles_h_ + +#include "libaccess/ava.h" +#include "frame/req.h" +#include "base/session.h" + +#define AUTH_DB_FILE "AvaCertmap" +#define AVADB_TAG "avadb" +#define AVA_DB_SEL "ava_db_sel" /*Variable name used in + *outputAVAdbs + */ + + +extern void outputAVAdbs (char *chosen); /*Outputs the selector of auth databases + *and makes it so that the form submits + *when onChange event occurs. + */ + + +/*For the following 3 functions, enter the full path of + *ava database file includint tag and filename + */ +/*Before calling _getTable, initializa yy_sn and yy_rq. Set to NULL if no + *Session* or Request* variables exist and an error will be reported with + *function report_error(libamin.h). Otherwise error will be logged into + *the server's error log + */ +extern AVATable *_getTable (char *avadbfile); +extern AVATable *_wasParsed (char *avadbfile);/*Assumes a call to yyparse was just + *completed + */ +extern int _hasBeenParsed (char *avadbfile);/*Check if _getTable returns NULL or not*/ + +extern AVAEntry* _getAVAEntry (char *groupid, AVATable *table); +extern AVAEntry* _deleteAVAEntry (char *groupid, AVATable *table); +extern void _addAVAtoTable (AVAEntry *entry, AVATable *table); +extern void AVAEntry_Free (AVAEntry *entry); + +/*Functions for writing out files*/ +extern void PrintHeader (FILE *outfile); +extern void writeOutFile (char *avadbfilename, AVATable *table); + + +extern int yyparse(); +extern FILE *yyin; + +extern char *currFile; + +extern Session *yy_sn; +extern Request *yy_rq; + + +#endif /*_avaparsedfiles_h_*/ diff --git a/include/libaccess/dbtlibaccess.h b/include/libaccess/dbtlibaccess.h new file mode 100644 index 00000000..f1eb420f --- /dev/null +++ b/include/libaccess/dbtlibaccess.h @@ -0,0 +1,161 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ + +#define LIBRARY_NAME "libaccess" + +static char dbtlibaccessid[] = "$DBT: libaccess referenced v1 $"; + +#include "i18n.h" + +BEGIN_STR(libaccess) + ResDef( DBT_LibraryID_, -1, dbtlibaccessid )/* extracted from dbtlibaccess.h*/ + ResDef( DBT_basicNcsa_, 1, "basic-ncsa" )/*extracted from userauth.cpp*/ + ResDef( DBT_cannotOpenDatabaseS_, 2, "cannot open database %s" )/*extracted from userauth.cpp*/ + ResDef( DBT_basicNcsa_1, 3, "basic-ncsa" )/*extracted from userauth.cpp*/ + ResDef( DBT_userSPasswordDidNotMatchDatabase_, 4, "user %s password did not match database %s" )/*extracted from userauth.cpp*/ + ResDef( DBT_basicNcsa_2, 5, "basic-ncsa" )/*extracted from userauth.cpp*/ + ResDef( DBT_cannotOpenConnectionToLdapServer_, 6, "cannot open connection to LDAP server on %s:%d" )/*NOT USED - extracted from userauth.cpp*/ + ResDef( DBT_basicNcsa_3, 7, "basic-ncsa" )/*extracted from userauth.cpp*/ + ResDef( DBT_userSPasswordDidNotMatchLdapOnSD_, 8, "user %s password did not match LDAP on %s:%d" )/*NOT USED - extracted from userauth.cpp*/ + ResDef( DBT_aclState_, 9, "acl-state" )/*extracted from userauth.cpp*/ + ResDef( DBT_missingRealm_, 10, "missing realm" )/*extracted from userauth.cpp*/ + ResDef( DBT_unableToAllocateAclListHashN_, 11, "Unable to allocate ACL List Hash\n" )/*extracted from cache.cpp*/ + ResDef( DBT_aclevalbuildcontextUnableToPermM_, 12, "ACLEvalBuildContext unable to PERM_MALLOC cache structure\n" )/*extracted from eval.cpp*/ + ResDef( DBT_aclevalbuildcontextUnableToCreat_, 13, "ACLEvalBuildContext unable to create hash table\n" )/*extracted from eval.cpp*/ + ResDef( DBT_aclevalbuildcontextUnableToAlloc_, 14, "ACLEvalBuildContext unable to allocate ACE Entry\n" )/*extracted from eval.cpp*/ + ResDef( DBT_aclevalbuildcontextUnableToAlloc_1, 15, "ACLEvalBuildContext unable to allocate ACE entry\n" )/*extracted from eval.cpp*/ + ResDef( DBT_aclevalbuildcontextUnableToAlloc_2, 16, "ACLEvalBuildContext unable to allocate Boundary Entry\n" )/*extracted from eval.cpp*/ + ResDef( DBT_aclevalbuildcontextFailedN_, 17, "ACLEvalBuildContext failed.\n" )/*extracted from eval.cpp*/ + ResDef( DBT_aclEvaltestrightsAnInterimAbsolu_, 18, "ACL_EvalTestRights: an interim, absolute non-allow value was encountered. right=%s, value=%d\n" )/*NOT USED - extracted from eval.cpp*/ + ResDef( DBT_lasdnsbuildUnableToAllocateHashT_, 19, "LASDnsBuild unable to allocate hash table header\n" )/*extracted from lasdns.cpp*/ + ResDef( DBT_lasdnsbuildUnableToAddKeySN_, 20, "LASDnsBuild unable to add key %s\n" )/*extracted from lasdns.cpp*/ + ResDef( DBT_lasdnsbuildUnableToAddKeySN_1, 21, "LASDnsBuild unable to add key %s\n" )/*extracted from lasdns.cpp*/ + ResDef( DBT_lasdnsbuildUnableToAddKeySN_2, 22, "LASDnsBuild unable to add key %s\n" )/*extracted from lasdns.cpp*/ + ResDef( DBT_lasdnsbuildUnableToAddKeySN_3, 23, "LASDnsBuild unable to add key %s\n" )/*extracted from lasdns.cpp*/ + ResDef( DBT_lasdnsbuildUnableToAddKeySN_4, 24, "LASDnsBuild unable to add key %s\n" )/*extracted from lasdns.cpp*/ + ResDef( DBT_lasDnsBuildReceivedRequestForAtt_, 25, "LAS DNS build received request for attribute %s\n" )/*extracted from lasdns.cpp*/ + ResDef( DBT_lasdnsevalIllegalComparatorDN_, 26, "LASDnsEval - illegal comparator %s\n" )/*extracted from lasdns.cpp*/ + ResDef( DBT_lasdnsevalUnableToAllocateContex_, 27, "LASDnsEval unable to allocate Context struct\n\n" )/*extracted from lasdns.cpp*/ + ResDef( DBT_lasdnsevalUnableToGetSessionAddr_, 28, "LASDnsEval unable to get session address %d\n" )/*NOT USED - extracted from lasdns.cpp*/ + ResDef( DBT_lasdnsevalUnableToGetDnsErrorDN_, 29, "LASDnsEval unable to get DNS - error=%s\n" )/*extracted from lasdns.cpp*/ + ResDef( DBT_lasGroupEvalReceivedRequestForAt_, 30, "LAS Group Eval received request for attribute %s\n" )/*extracted from lasgroup.cpp*/ + ResDef( DBT_lasgroupevalIllegalComparatorDN_, 31, "LASGroupEval - illegal comparator %s\n" )/*extracted from lasgroup.cpp*/ + ResDef( DBT_lasgroupevalRanOutOfMemoryN_, 32, "LASGroupEval - ran out of memory\n" )/*extracted from lasgroup.cpp*/ + ResDef( DBT_lasgroupevalUnableToGetSessionAd_, 33, "LASGroupEval unable to get session address %d\n" )/*NOT USED - extracted from lasgroup.cpp*/ + ResDef( DBT_lasgroupevalUnableToGetSessionAd_1, 34, "LASGroupEval unable to get session address %d\n" )/*NOT USED - extracted from lasgroup.cpp*/ + ResDef( DBT_lasgroupevalCouldnTLocateGetterF_, 35, "LASGroupEval - couldn't locate getter for auth-user\n" )/*extracted from lasgroup.cpp*/ + ResDef( DBT_lasgroupevalAttributeGetterForAu_, 36, "LASGroupEval - Attribute getter for auth-user failed\n" )/*extracted from lasgroup.cpp*/ + ResDef( DBT_lasgroupevalAttributeGetterDidnT_, 37, "LASGroupEval - Attribute getter didn't set auth-user\n" )/*extracted from lasgroup.cpp*/ + ResDef( DBT_checkGroupMembershipOfUserSForGr_, 38, "Check group membership of user \"%s\" for group \"%s\"\n" )/*extracted from lasgroup.cpp*/ + ResDef( DBT_ldapuSuccessForGroupSN_, 39, "LDAPU_SUCCESS for group \"%s\"\n" )/*extracted from lasgroup.cpp*/ + ResDef( DBT_ldapuFailedForGroupSN_, 40, "LDAPU_FAILED for group \"%s\"\n" )/*extracted from lasgroup.cpp*/ + ResDef( DBT_lasEvalFalseN_, 41, "LAS_EVAL_FALSE\n" )/*extracted from lasgroup.cpp*/ + ResDef( DBT_lasEvalTrueN_, 42, "LAS_EVAL_TRUE\n" )/*extracted from lasgroup.cpp*/ + ResDef( DBT_lasiptreeallocNoMemoryN_, 43, "LASIpTreeAlloc - no memory\n" )/*extracted from lasip.cpp*/ + ResDef( DBT_ipLasUnableToAllocateTreeNodeN_, 44, "IP LAS unable to allocate tree node\n" )/*extracted from lasip.cpp*/ + ResDef( DBT_ipLasUnableToAllocateTreeNodeN_1, 45, "IP LAS unable to allocate tree node\n" )/*extracted from lasip.cpp*/ + ResDef( DBT_lasIpBuildReceivedRequestForAttr_, 46, "LAS IP build received request for attribute %s\n" )/*extracted from lasip.cpp*/ + ResDef( DBT_lasipevalIllegalComparatorDN_, 47, "LASIpEval - illegal comparator %s\n" )/*extracted from lasip.cpp*/ + ResDef( DBT_lasipevalUnableToGetSessionAddre_, 48, "LASIpEval unable to get session address - error=%s\n" )/*extracted from lasip.cpp*/ + ResDef( DBT_lasipevalUnableToAllocateContext_, 49, "LASIpEval unable to allocate Context struct\n\n" )/*extracted from lasip.cpp*/ + ResDef( DBT_lasipevalReach32BitsWithoutConcl_, 50, "LASIpEval - reach 32 bits without conclusion value=%s" )/*extracted from lasip.cpp*/ + ResDef( DBT_lasProgramEvalReceivedRequestFor_, 51, "LAS Program Eval received request for attribute %s\n" )/*extracted from lasprogram.cpp*/ + ResDef( DBT_lasprogramevalIllegalComparatorD_, 52, "LASProgramEval - illegal comparator %s\n" )/*extracted from lasprogram.cpp*/ + ResDef( DBT_lasprogramUnableToGetSessionAddr_, 53, "LASProgram unable to get session address %d\n" )/*NOT USED - extracted from lasprogram.cpp*/ + ResDef( DBT_bin_, 54, "bin" )/*extracted from lasprogram.cpp*/ + ResDef( DBT_lasprogramevalRequestNotOfTypeAd_, 55, "LASProgramEval: request not of type admin or bin, passing.\n" )/*extracted from lasprogram.cpp*/ + ResDef( DBT_lasprogramevalCheckIfProgramSMat_, 56, "LASProgramEval: check if program %s matches pattern %s.\n" )/*extracted from lasprogram.cpp*/ + ResDef( DBT_lasprogramevalInvalidWildcardExp_, 57, "LASProgramEval: Invalid wildcard expression %s.\n" )/*extracted from lasprogram.cpp*/ + ResDef( DBT_lasEvalFalseN_1, 58, "LAS_EVAL_FALSE\n" )/*extracted from lasprogram.cpp*/ + ResDef( DBT_lasEvalTrueN_1, 59, "LAS_EVAL_TRUE\n" )/*extracted from lasprogram.cpp*/ + ResDef( DBT_unexpectedAttributeInDayofweekSN_, 60, "Unexpected attribute in dayOfWeek - %s\n" )/*extracted from lastod.cpp*/ + ResDef( DBT_illegalComparatorForDayofweekDN_, 61, "Illegal comparator for dayOfWeek - %s\n" )/*extracted from lastod.cpp*/ + ResDef( DBT_unexpectedAttributeInTimeofdaySN_, 62, "Unexpected attribute in timeOfDay - %s\n" )/*extracted from lastod.cpp*/ + ResDef( DBT_lasUserEvalReceivedRequestForAtt_, 63, "LAS User Eval received request for attribute %s\n" )/*extracted from lasuser.cpp*/ + ResDef( DBT_lasuserevalIllegalComparatorDN_, 64, "LASUserEval - illegal comparator %s\n" )/*extracted from lasuser.cpp*/ + ResDef( DBT_lasuserevalRanOutOfMemoryN_, 65, "LASUserEval - ran out of memory\n" )/*extracted from lasuser.cpp*/ + ResDef( DBT_lasuserevalUnableToGetSessionAdd_, 66, "LASUserEval unable to get session address %d\n" )/*NOT USED - extracted from lasuser.cpp*/ + ResDef( DBT_lasuserevalUnableToGetSessionAdd_1, 67, "LASUserEval unable to get session address %d\n" )/*NOT USED - extracted from lasuser.cpp*/ + ResDef( DBT_lasgroupevalCouldnTLocateGetterF_1, 68, "LASGroupEval - couldn't locate getter for auth-user\n" )/*extracted from lasuser.cpp*/ + ResDef( DBT_lasgroupevalAttributeGetterForAu_1, 69, "LASGroupEval - Attribute getter for auth-user failed\n" )/*extracted from lasuser.cpp*/ + ResDef( DBT_lasgroupevalAttributeGetterDidnT_1, 70, "LASGroupEval - Attribute getter didn't set auth-user\n" )/*extracted from lasuser.cpp*/ + ResDef( DBT_checkIfUidUserIECheckSSN_, 71, "Check if uid == user (i.e. check \"%s\" == \"%s)\"\n" )/*extracted from lasuser.cpp*/ + ResDef( DBT_successForUserSN_, 72, "SUCCESS for user \"%s\"\n" )/*extracted from lasuser.cpp*/ + ResDef( DBT_failedForUserSN_, 73, "FAILED for user \"%s\"\n" )/*extracted from lasuser.cpp*/ + ResDef( DBT_lasEvalFalseN_2, 74, "LAS_EVAL_FALSE\n" )/*extracted from lasuser.cpp*/ + ResDef( DBT_lasEvalTrueN_2, 75, "LAS_EVAL_TRUE\n" )/*extracted from lasuser.cpp*/ + ResDef( DBT_Unused76, 76, "") + ResDef( DBT_lasProgramUnableToGetRequest_, 77, "LASProgram unable to get request address - error=%s" ) /*extracted from lasprogram.cpp*/ + ResDef( DBT_lasProgramRejectingRequestForProgram_, 78, "LASProgram rejecting request for program %s from pattern %s" ) /*extracted from lasprogram.cpp*/ + ResDef( DBT_aclcacheflushCannotParseFile, 79, "ACL_CacheFlush: unable to parse file \"%s\"\n" ) + ResDef( DBT_aclcacheflushCannotConcatList, 80, "ACL_CacheFlush: unable to concatenate ACL list \"%s\"\n" ) + ResDef( DBT_aclcacheflushCannotOpenMagnus, 81, "ACL_CacheFlush: unable to open and process the magnus file \"%s\"\n" ) + ResDef( DBT_illegalComparatorForTimeOfDayDN_, 82, "Illegal comparator for timeOfDay - %s\n" )/*extracted from lastod.cpp*/ + ResDef( DBT_EvalBuildContextUnableToCreateHash, 83, "ACL_EvalBuildContext unable to create hash table\n") + ResDef( DBT_EvalBuildContextUnableToAllocCache, 84, "ACL_EvalBuildContext unable to PERM_CALLOC cache structure\n") + ResDef( DBT_EvalBuildContextUnableToAllocAceEntry, 85, "ACL_EvalBuildContext unable to allocate ACE entry\n") + ResDef( DBT_EvalBuildContextUnableToAllocAuthPointerArray, 86, "ACL_EvalBuildContext unable to allocate auth pointer array\n") + ResDef( DBT_EvalBuildContextUnableToAllocAuthPlist, 87, "ACL_EvalBuildContext unable to allocate auth plist\n") + ResDef( DBT_EvalTestRightsInterimAbsoluteNonAllowValue, 88, "ACL_EvalTestRights: an interim, absolute non-allow value was encountered. right=%s, value=%s\n") + ResDef( DBT_EvalTestRightsEvalBuildContextFailed, 89, "ACL_INTEvalTestRights: call to ACL_EvalBuildContext returned failure status\n") + ResDef( DBT_ModuleRegisterModuleNameMissing, 90, "ACL_ModuleRegister: module name is missing\n") + ResDef( DBT_ModuleRegisterFailed, 91, "ACL_ModuleRegister: call to module init function returned a failed status\n") + ResDef( DBT_GetAttributeCouldntDetermineMethod, 92, "ACL_GetAttribute: couldn't determine method for %s\n") + ResDef( DBT_GetAttributeCouldntLocateGetter, 93, "ACL_GetAttribute: couldn't locate getter for %s") + ResDef( DBT_GetAttributeDidntGetAttr, 94, "ACL_GetAttribute: attr getter failed to get %s") + ResDef( DBT_GetAttributeDidntSetAttr, 95, "ACL_GetAttribute: attr getter failed to get %s") + ResDef( DBT_GetAttributeAllGettersDeclined, 96, "ACL_GetAttribute: All attribute getters declined for attr %s") + ResDef( DBT_DbtypeNoteDefinedYet, 97, "ACL_DatabaseRegister: dbtype for database \"%s\" is not defined yet!") + ResDef( DBT_DatabaseRegisterDatabaseNameMissing, 98, "ACL_DatabaseRegister: database name is missing") + ResDef( DBT_ReadDbMapFileErrorReadingFile, 99, "Error reading the DB Map File: %s. Reason: %s") + ResDef( DBT_ReadDbMapFileMissingUrl, 100, "URL is missing for database %s") + ResDef( DBT_ReadDbMapFileInvalidPropertyPair, 101, "Invalid property value pair for database %s") + ResDef( DBT_ReadDbMapFileDefaultDatabaseNotLdap, 102, "\"default\" database must be an LDAP database") + ResDef( DBT_ReadDbMapFileMultipleDefaultDatabases, 103, "Multiple \"default\" databases are being registered") + ResDef( DBT_ReadDbMapFileMissingDefaultDatabase, 104, "\"default\" LDAP database must be registered") + ResDef( DBT_lasGroupEvalUnableToGetDatabaseName, 105, "LASGroupEval unable to get database name - error= %s") + ResDef( DBT_lasProgramReceivedInvalidProgramExpression, 106, "received invalid program expression %s") + ResDef( DBT_ldapaclDatabaseUrlIsMissing, 107, "parse_ldap_url: database url is missing") + ResDef( DBT_ldapaclDatabaseNameIsMissing, 108, "parse_ldap_url: database name is missing") + ResDef( DBT_ldapaclErrorParsingLdapUrl, 109, "parse_ldap_url: error in parsing ldap url. Reason: %s") + ResDef( DBT_ldapaclUnableToGetDatabaseName, 110, "ldap password check: unable to get database name - error=%s") + ResDef( DBT_ldapaclUnableToGetParsedDatabaseName, 111, "ldap password check: unable to get parsed database %s") + ResDef( DBT_ldapaclCoudlntInitializeConnectionToLdap, 112, "ldap password check: couldn't initialize connection to LDAP. Reason: %s") + ResDef( DBT_ldapaclPassworkCheckLdapError, 113, "ldap password check: LDAP error: \"%s\"") + ResDef( DBT_GetUserIsMemberLdapUnabelToGetDatabaseName, 114, "get_user_ismember_ldap unable to get database name - error=%s") + ResDef( DBT_GetUserIsMemberLdapUnableToGetParsedDatabaseName, 115, "get_user_ismember_ldap unable to get parsed database %s") + ResDef( DBT_GetUserIsMemberLdapCouldntInitializeConnectionToLdap, 116, "ldap password check: couldn't initialize connection to LDAP. Reason: %s") + ResDef( DBT_GetUserIsMemberLdapGroupDoesntExist, 117, "get_user_ismember_ldap: group %s does not exist") + ResDef( DBT_GetUserIsMemberLdapError, 118, "get_user_ismember_ldap: LDAP error: \"%s\"") + ResDef( DBT_LdapDatabaseHandleNotARegisteredDatabase, 119, "ACL_LDAPDatabaseHandle: %s is not a registered database") + ResDef( DBT_LdapDatabaseHandleNotAnLdapDatabase, 120, "ACL_LDAPDatabaseHandle: %s is not an LDAP database") + ResDef( DBT_LdapDatabaseHandleOutOfMemory, 121, "ACL_LDAPDatabaseHandle: out of memory") + ResDef( DBT_LdapDatabaseHandleCouldntInitializeConnectionToLdap, 122, "ACL_LDAPDatabaseHandle: couldn't initialize connection to LDAP. Reason: %s") + ResDef( DBT_LdapDatabaseHandleCouldntBindToLdapServer, 123, "ACL_LDAPDatabaseHandle: couldn't bind to LDAP server. Reason: %s") + ResDef( DBT_AclerrfmtAclerrnomem, 124, "insufficient dynamic memory") + ResDef( DBT_AclerrfmtAclerropen, 125, "error opening file, %s: %s") + ResDef( DBT_AclerrfmtAclerrdupsym1, 126, "duplicate definition of %s") + ResDef( DBT_AclerrfmtAclerrdupsym3, 127, "file %s, line %s: duplicate definition of %s") + ResDef( DBT_AclerrfmtAclerrsyntax, 128, "file %s, line %s: syntax error") + ResDef( DBT_AclerrfmtAclerrundef, 129, "file %s, line %s: %s is undefined") + ResDef( DBT_AclerrfmtAclaclundef, 130, "in acl %s, %s %s is undefined") + ResDef( DBT_AclerrfmtAclerradb, 131, "database %s: error accessing %s") + ResDef( DBT_AclerrfmtAclerrparse1, 132, "%s") + ResDef( DBT_AclerrfmtAclerrparse2, 133, "file %s, line %s: invalid syntax") + ResDef( DBT_AclerrfmtAclerrparse3, 134, "file %s, line %s: syntax error at \"%s\"") + ResDef( DBT_AclerrfmtAclerrnorlm, 135, "realm %s is not defined") + ResDef( DBT_AclerrfmtUnknownerr, 136, "error code = %d") + ResDef( DBT_AclerrfmtAclerrinternal, 137, "internal ACL error") + ResDef( DBT_AclerrfmtAclerrinval, 138, "invalid argument") + ResDef( DBT_DbtypeNotDefinedYet, 139, "ACL_DatabaseRegister: dbtype for database \"%s\" is not defined yet!") + ResDef( DBT_ReadDbMapFileCouldntDetermineDbtype, 140, "couldn't determine dbtype from: %s") + ResDef( DBT_ReadDbMapFileRegisterDatabaseFailed, 141, "Failed to register database %s") + ResDef( DBT_AclerrfmtAclerrfail, 142, "ACL call returned failed status") + ResDef( DBT_AclerrfmtAclerrio, 143, "file %s: ACL IO error - %s") + ResDef( DBT_AclUserExistsOutOfMemory, 144, "acl_user_exists: out of memory") + ResDef( DBT_AclUserExistsNot, 145, "acl_user_exists: user doesn't exist anymore") + ResDef( DBT_AclUserPlistError, 146, "acl_user_exists: plist error") +END_STR(libaccess) diff --git a/include/libaccess/dnfstruct.h b/include/libaccess/dnfstruct.h new file mode 100644 index 00000000..d1ab28a3 --- /dev/null +++ b/include/libaccess/dnfstruct.h @@ -0,0 +1,51 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef __dnfstruct_h +#define __dnfstruct_h + +/* + * Description (dnfstruct_h) + * + * This file defines types and structures used to represent a DNS + * name filter in memory. A DNS name filter contains specifications + * of fully or partially qualified DNS names. Each of these + * specifications can be associated with whatever information is + * appropriate for a particular use of a DNS name filter. + */ + +#include "nspr.h" +#include "plhash.h" + +NSPR_BEGIN_EXTERN_C + +/* + * Description (DNSLeaf_t) + * + * This type describes the structure of information associated with + * an entry in a DNS filter. The filter itself is implemented as a + * hash table, keyed by the DNS name specification string. The + * value associated with a key is a pointer to a DNSLeaf_t structure. + */ + +typedef struct DNSLeaf_s DNSLeaf_t; +struct DNSLeaf_s { + PLHashEntry dnl_he; /* NSPR hash table entry */ +}; + +#define dnl_next dnl_he.next /* hash table collision link */ +#define dnl_keyhash dnl_he.keyHash /* symbol hash value */ +#define dnl_key dnl_he.key /* pointer to Symbol_t structure */ +#define dnl_ref dnl_he.value /* pointer to named structure */ + +typedef struct DNSFilter_s DNSFilter_t; +struct DNSFilter_s { + DNSFilter_t * dnf_next; /* link to next filter */ + void * dnf_hash; /* pointer to constructed hash table */ +}; + +NSPR_END_EXTERN_C + +#endif /* __dnfstruct_h */ diff --git a/include/libaccess/ipfstruct.h b/include/libaccess/ipfstruct.h new file mode 100644 index 00000000..acb0349e --- /dev/null +++ b/include/libaccess/ipfstruct.h @@ -0,0 +1,81 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef __ipfstruct_h +#define __ipfstruct_h + +/* + * Description (ipfstruct.h) + * + * This file defines types and structures used to represent an + * IP address filter in memory. An IP address filter contains + * specifications of IP host and network addresses. Each of + * these specifications can be associated with whatever information + * is appropriate for a particular use of an IP address filter. + */ + +/* Define a scalar IP address value */ +#ifndef __IPADDR_T_ +#define __IPADDR_T_ +typedef unsigned long IPAddr_t; +#endif /* __IPADDR_T_ */ + +/* + * Description (IPNode_t) + * + * This type describes an internal node in the radix tree. An internal + * node has a link up the tree to its parent, and up to three links + * down the tree to its descendants. Each internal node is used to + * test a particular bit in a given IP address, and traverse down the + * tree in a direction which depends on whether the bit is set, clear, + * or masked out. The descendants of an internal node may be internal + * nodes or leaf nodes (IPLeaf_t). + */ + +/* Define indices of links in an IPNode_t */ +#define IPN_CLEAR 0 /* link to node with ipn_bit clear */ +#define IPN_SET 1 /* link to node with ipn_bit set */ +#define IPN_MASKED 2 /* link to node with ipn_bit masked out */ +#define IPN_NLINKS 3 /* number of links */ + +typedef struct IPNode_s IPNode_t; +struct IPNode_s { + char ipn_type; /* node type */ +#define IPN_LEAF 0 /* leaf node */ +#define IPN_NODE 1 /* internal node */ + + char ipn_bit; /* bit number (31-0) to test */ + IPNode_t * ipn_parent; /* link to parent node */ + IPNode_t * ipn_links[IPN_NLINKS]; +}; + +/* Helper definitions */ +#define ipn_clear ipn_links[IPN_CLEAR] +#define ipn_set ipn_links[IPN_SET] +#define ipn_masked ipn_links[IPN_MASKED] + +/* + * Description (IPLeaf_t) + * + * This type describes a leaf node in the radix tree. A leaf node + * contains an IP host or network address, and a network mask. A + * given IP address matches a leaf node if the IP address, when masked + * by ipl_netmask, equals ipl_ipaddr. + */ + +typedef struct IPLeaf_s IPLeaf_t; +struct IPLeaf_s { + char ipl_type; /* see ipn_type in IPNode_t */ + IPAddr_t ipl_netmask; /* IP network mask */ + IPAddr_t ipl_ipaddr; /* IP address of host or network */ +}; + +typedef struct IPFilter_s IPFilter_t; +struct IPFilter_s { + IPFilter_t * ipf_next; /* link to next filter */ + IPNode_t * ipf_tree; /* pointer to radix tree structure */ +}; + +#endif /* __ipfstruct_h */ diff --git a/include/libaccess/las.h b/include/libaccess/las.h new file mode 100644 index 00000000..252e3619 --- /dev/null +++ b/include/libaccess/las.h @@ -0,0 +1,184 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ + +#ifndef ACL_LAS_HEADER +#define ACL_LAS_HEADER + +#ifndef NOINTNSACL +#define INTNSACL +#endif /* !NOINTNSACL */ + +/* #include */ +#include +#include + +#include +#include +#include +#include + +#ifndef PUBLIC_NSACL_ACLDEF_H +#include "public/nsacl/acldef.h" +#endif /* !PUBLIC_NSACL_ACLDEF_H */ + +#define ACL_MAX_METHOD 32 +#define ACL_MAX_DBTYPE 32 + +struct ACLAttrGetter { + PRCList list; /* must be first */ + ACLMethod_t method; + ACLDbType_t dbtype; + ACLAttrGetterFn_t fn; + void *arg; +}; + +NSPR_BEGIN_EXTERN_C + +NSAPI_PUBLIC extern int + ACL_LasRegister(NSErr_t *errp, char *attr_name, LASEvalFunc_t + eval_func, LASFlushFunc_t flush_func); +NSAPI_PUBLIC extern int + ACL_LasFindEval(NSErr_t *errp, char *attr_name, LASEvalFunc_t + *eval_funcp); +NSAPI_PUBLIC extern int + ACL_LasFindFlush(NSErr_t *errp, char *attr_name, LASFlushFunc_t + *flush_funcp); +extern void + ACL_LasHashInit(void); +extern void + ACL_LasHashDestroy(void); + +/* + * Revised, normalized method/dbtype registration routines + */ +NSAPI_PUBLIC extern int + ACL_MethodRegister(NSErr_t *errp, const char *name, ACLMethod_t *t); +NSAPI_PUBLIC extern int + ACL_MethodIsEqual(NSErr_t *errp, const ACLMethod_t t1, const ACLMethod_t t2); +NSAPI_PUBLIC extern int + ACL_MethodNameIsEqual(NSErr_t *errp, const ACLMethod_t t, const char *name); +NSAPI_PUBLIC extern int + ACL_MethodFind(NSErr_t *errp, const char *name, ACLMethod_t *t); +NSAPI_PUBLIC extern ACLMethod_t + ACL_MethodGetDefault(NSErr_t *errp); +NSAPI_PUBLIC extern int + ACL_MethodSetDefault(NSErr_t *errp, const ACLMethod_t t); +NSAPI_PUBLIC extern int + ACL_AuthInfoGetMethod(NSErr_t *errp, PList_t auth_info, ACLMethod_t *t); +NSAPI_PUBLIC extern int + ACL_AuthInfoSetMethod(NSErr_t *errp, PList_t auth_info, ACLMethod_t t); +NSAPI_PUBLIC extern int + ACL_DbTypeRegister(NSErr_t *errp, const char *name, DbParseFn_t func, ACLDbType_t *t); +NSAPI_PUBLIC extern int + ACL_DbTypeIsEqual(NSErr_t *errp, const ACLDbType_t t1, const ACLDbType_t t2); +NSAPI_PUBLIC extern int + ACL_DbTypeNameIsEqual(NSErr_t *errp, const ACLDbType_t t, const char *name); +NSAPI_PUBLIC extern int + ACL_DbTypeFind(NSErr_t *errp, const char *name, ACLDbType_t *t); +NSAPI_PUBLIC extern ACLDbType_t + ACL_DbTypeGetDefault(NSErr_t *errp); +NSAPI_PUBLIC extern const char * + ACL_DatabaseGetDefault(NSErr_t *errp); +NSAPI_PUBLIC extern int + ACL_DatabaseSetDefault(NSErr_t *errp, const char *dbname); +NSAPI_PUBLIC extern int + ACL_AuthInfoGetDbType(NSErr_t *errp, PList_t auth_info, ACLDbType_t *t); +NSAPI_PUBLIC extern int + ACL_DbTypeIsRegistered(NSErr_t *errp, const ACLDbType_t dbtype); +NSAPI_PUBLIC extern int + ACL_AttrGetterRegister(NSErr_t *errp, const char *attr, + ACLAttrGetterFn_t fn, ACLMethod_t m, + ACLDbType_t d, int position, void *arg); + +extern ACLDbType_t ACL_DbTypeLdap; + +NSAPI_PUBLIC extern int + ACL_DbTypeSetDefault(NSErr_t *errp, ACLDbType_t t); +NSAPI_PUBLIC extern DbParseFn_t + ACL_DbTypeParseFn(NSErr_t *errp, const ACLDbType_t dbtype); +NSAPI_PUBLIC extern int + ACL_AttrGetterFind(NSErr_t *errp, const char *attr, + ACLAttrGetterList_t *getters); +NSAPI_PUBLIC extern ACLAttrGetter_t * + ACL_AttrGetterFirst(ACLAttrGetterList_t *getters); +NSAPI_PUBLIC extern ACLAttrGetter_t * + ACL_AttrGetterNext(ACLAttrGetterList_t *getters, + ACLAttrGetter_t *last); + +/* typedef PRHashTable AttrGetterTable_t; */ +typedef PLHashTable AttrGetterTable_t; + +typedef struct { + char *method; + char *authtype; + char *dbtype; + AttrGetterTable_t *attrGetters; +} MethodInfo_t; + +NSAPI_PUBLIC int ACL_ModuleRegister (NSErr_t *errp, const char *moduleName, AclModuleInitFunc func); + +NSAPI_PUBLIC int ACL_GetAttribute(NSErr_t *errp, const char *attr, void **val, PList_t subject, PList_t resource, PList_t auth_info, PList_t global_auth); + +NSAPI_PUBLIC int ACL_DatabaseRegister(NSErr_t *errp, ACLDbType_t dbtype, const char *dbname, const char *url, PList_t plist); + +NSAPI_PUBLIC int ACL_RegisterDbFromACL(NSErr_t *errp, const char *url, ACLDbType_t *dbtype); +NSAPI_PUBLIC int ACL_DatabaseFind(NSErr_t *errp, const char *dbname, + ACLDbType_t *dbtype, void **db); +NSAPI_PUBLIC int ACL_LDAPDatabaseHandle (NSErr_t *errp, + const char *dbname, LDAP **ld, + char **basedn); +NSAPI_PUBLIC int ACL_AuthInfoGetDbname (PList_t auth_info, char **dbname); +NSAPI_PUBLIC int ACL_AuthInfoSetDbname (NSErr_t *errp, PList_t auth_info, + const char *dbname); +NSAPI_PUBLIC int ACL_CacheFlushRegister(AclCacheFlushFunc_t func); +NSAPI_PUBLIC int ACL_SetDefaultResult (NSErr_t *errp, + ACLEvalHandle_t *acleval, + int result); +NSAPI_PUBLIC int ACL_GetDefaultResult (ACLEvalHandle_t *acleval); + +struct program_groups { + char *type; + char **groups; + char **programs; +}; + +extern int LASTimeOfDayEval(NSErr_t *errp, char *attribute, CmpOp_t comparator, + char *pattern, ACLCachable_t *cachable, void **las_cookie, + PList_t subject, PList_t resource, PList_t auth_info, + PList_t global_auth); +extern int LASDayOfWeekEval(NSErr_t *errp, char *attribute, CmpOp_t comparator, + char *pattern, ACLCachable_t *cachable, void **las_cookie, + PList_t subject, PList_t resource, PList_t auth_info, + PList_t global_auth); +extern int LASIpEval(NSErr_t *errp, char *attribute, CmpOp_t comparator, + char *pattern, ACLCachable_t *cachable, void **las_cookie, + PList_t subject, PList_t resource, PList_t auth_info, + PList_t global_auth); +extern int LASDnsEval(NSErr_t *errp, char *attribute, CmpOp_t comparator, + char *pattern, ACLCachable_t *cachable, void **las_cookie, + PList_t subject, PList_t resource, PList_t auth_info, + PList_t global_auth); +extern int LASGroupEval(NSErr_t *errp, char *attribute, CmpOp_t comparator, + char *pattern, ACLCachable_t *cachable, void **las_cookie, + PList_t subject, PList_t resource, PList_t auth_info, + PList_t global_auth); +extern int LASUserEval(NSErr_t *errp, char *attribute, CmpOp_t comparator, + char *pattern, ACLCachable_t *cachable, void **las_cookie, + PList_t subject, PList_t resource, PList_t auth_info, + PList_t global_auth); +extern int LASProgramEval(NSErr_t *errp, char *attribute, CmpOp_t comparator, + char *pattern, ACLCachable_t *cachable, void **las_cookie, + PList_t subject, PList_t resource, PList_t auth_info, + PList_t global_auth); + +extern void LASTimeOfDayFlush(void **cookie); +extern void LASDayOfWeekFlush(void **cookie); +extern void LASIpFlush(void **cookie); +extern void LASDnsFlush(void **cookie); + +NSPR_END_EXTERN_C + +#endif /* ACL_LAS_HEADER */ diff --git a/include/libaccess/ldapacl.h b/include/libaccess/ldapacl.h new file mode 100644 index 00000000..94a00333 --- /dev/null +++ b/include/libaccess/ldapacl.h @@ -0,0 +1,62 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ + +#ifndef ACL_AUTH_H +#define ACL_AUTH_H + +#include +#include +#include +#include + +NSPR_BEGIN_EXTERN_C + +extern void init_ldb_rwlock (); + +NSAPI_PUBLIC extern int parse_ldap_url (NSErr_t *errp, ACLDbType_t dbtype, + const char *name, const char *url, + PList_t plist, void **db); + +extern int get_is_valid_password_basic_ldap (NSErr_t *errp, + PList_t subject, + PList_t resource, + PList_t auth_info, + PList_t global_auth, + void *arg); + +extern int get_user_ismember_ldap (NSErr_t *errp, + PList_t subject, + PList_t resource, + PList_t auth_info, + PList_t global_auth, + void *arg); + +extern int get_userdn_ldap (NSErr_t *errp, + PList_t subject, + PList_t resource, + PList_t auth_info, + PList_t global_auth, + void *arg); + +extern int ACL_NeedLDAPOverSSL(); + +extern int acl_map_cert_to_user (NSErr_t *errp, const char *dbname, + LDAPDatabase_t *ldb, void *cert, + PList_t resource, pool_handle_t *pool, + char **user, char **userdn); + +extern int get_user_exists_ldap (NSErr_t *errp, PList_t subject, + PList_t resource, PList_t auth_info, + PList_t global_auth, void *unused); + +NSAPI_PUBLIC extern int acl_user_exists (const char *user, + const char *userdn, + const char *dbname, + const int logerr); + +NSPR_END_EXTERN_C + +#endif /* ACL_AUTH_H */ diff --git a/include/libaccess/nsadb.h b/include/libaccess/nsadb.h new file mode 100644 index 00000000..07fb2ca2 --- /dev/null +++ b/include/libaccess/nsadb.h @@ -0,0 +1,87 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef __nsadb_h +#define __nsadb_h + +/* + * Description (nsadb.h) + * + * This file describes the interface for retrieving information + * from a Netscape authentication database. This facility is + * built on top of the Netscape (server) database interface as + * defined in nsdb.h. It represents a subclass of a more general + * authentication database interface defined in nsauth.h. + */ + +#include "nserror.h" /* error frame list support */ +#include "nsautherr.h" /* authentication error codes */ +#include "nsauth.h" + +/* Begin private definitions */ +#ifdef __PRIVATE_NSADB + +#include "nsdb.h" + +#if defined(CLIENT_AUTH) +#define ADBDBNAMES 3 /* number of named files */ +#else +#define ADBDBNAMES 2 /* number of named files */ +#endif +#define ADBUSERDBNAME "Users" /* name of user database */ +#define ADBGROUPDBNAME "Groups" /* name of group database */ +#if defined(CLIENT_AUTH) +#define ADBCERTDBNAME "Certs" /* name of certificate mapping DB */ +#define ADBUMAPDBNAME "Certs.nm" /* name of mapped user names DB */ +#endif + +typedef struct AuthDB_s AuthDB_t; +struct AuthDB_s { + char * adb_dbname; /* database name */ + void * adb_userdb; /* handle for user database */ + void * adb_groupdb; /* handle for group database */ +#if defined(CLIENT_AUTH) + void * adb_certdb; /* handle for cert mapping database */ + void * adb_certlock; /* lock for cert mapping database */ + void * adb_certnm; /* handle for username-to-certid DB */ +#endif + int adb_flags; /* flags */ +}; + +/* Definitions for adb_flags (also used on nsadbOpenXxxx() calls) */ +#define ADBF_NEW 0x1 /* newly created database */ +#define ADBF_UREAD 0x10 /* user database open for read */ +#define ADBF_UWRITE 0x20 /* user database open for write */ +#define ADBF_GREAD 0x100 /* group database open for read */ +#define ADBF_GWRITE 0x200 /* group database open for write */ +#define ADBF_CREAD 0x1000 /* cert database open for read */ +#define ADBF_CWRITE 0x2000 /* cert database open for write */ +#endif /* __PRIVATE_NSADB */ + +NSPR_BEGIN_EXTERN_C + +/* Functions in nsadb.c */ +extern NSAPI_PUBLIC int nsadbOpen(NSErr_t * errp, + char * adbname, int flags, void **rptr); +extern NSAPI_PUBLIC void nsadbClose(void * authdb, int flags); +extern NSAPI_PUBLIC int nsadbOpenUsers(NSErr_t * errp, + void * authdb, int flags); +extern NSAPI_PUBLIC int nsadbOpenGroups(NSErr_t * errp, + void * authdb, int flags); +extern NSAPI_PUBLIC int nsadbIdToName(NSErr_t * errp, void * authdb, + USI_t id, int flags, char **rptr); +extern NSAPI_PUBLIC int nsadbFindByName(NSErr_t * errp, void * authdb, + char * name, int flags, void **rptr); + +#if defined(CLIENT_AUTH) +#include "nscert.h" +#endif + +/* Authentication database interface structure in nsadb.c */ +extern AuthIF_t NSADB_AuthIF; + +NSPR_END_EXTERN_C + +#endif /* __nsadb_h */ diff --git a/include/libaccess/nsamgmt.h b/include/libaccess/nsamgmt.h new file mode 100644 index 00000000..c6b82ca4 --- /dev/null +++ b/include/libaccess/nsamgmt.h @@ -0,0 +1,122 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef __nsamgmt_h +#define __nsamgmt_h + +/* + * Description (nsamgmt.h) + * + * This file defines the interface for managing information in a + * Netscape authentication database. An authentication database + * consists of a user database and a group database. This + * implementation of an authentication database based on Netscape + * user and group databases defined in nsuser.h and nsgroup.h, + * which in turn are based on the Netscape (server) database + * implementation defined in nsdb.h. The interface for retrieving + * information from an authentication database is described + * separately in nsadb.h. + */ + +#include "nsadb.h" + +/* Flags used in enumeration call-back function return value */ +#define ADBF_KEEPOBJ 0x1 /* do not free user or group object */ +#define ADBF_STOPENUM 0x2 /* stop the enumeration */ + +NSPR_BEGIN_EXTERN_C + +/* Functions in nsamgmt.c */ +NSAPI_PUBLIC extern int nsadbAddGroupToGroup(NSErr_t * errp, void * authdb, + GroupObj_t * pgoptr, + GroupObj_t * cgoptr); + +NSAPI_PUBLIC extern int nsadbAddUserToGroup(NSErr_t * errp, void * authdb, + GroupObj_t * goptr, + UserObj_t * uoptr); + +NSAPI_PUBLIC extern int nsadbCreateGroup(NSErr_t * errp, + void * authdb, GroupObj_t * goptr); + +NSAPI_PUBLIC extern int nsadbCreateUser(NSErr_t * errp, + void * authdb, UserObj_t * uoptr); + +/* +for ANSI C++ standard on SCO UDK must typedef fn in arg list, otherwise fn +name is managled +*/ + +#ifdef UnixWare +typedef int(*ArgFn_EnumUsers)(NSErr_t * ferrp, void * authdb, void * parg, + UserObj_t * uoptr); + +NSAPI_PUBLIC extern int nsadbEnumerateUsers(NSErr_t * errp, void * authdb, + void * argp, ArgFn_EnumUsers); +#else /* UnixWare */ +NSAPI_PUBLIC extern int nsadbEnumerateUsers(NSErr_t * errp, void * authdb, + void * argp, + int (*func)(NSErr_t * ferrp, + void * authdb, + void * parg, + UserObj_t * uoptr)); +#endif /* UnixWare */ + +#ifdef UnixWare +typedef int(*ArgFn_EnumGroups)(NSErr_t * ferrp, void * authdb, void * parg, + GroupObj_t * goptr); +NSAPI_PUBLIC extern int nsadbEnumerateGroups(NSErr_t * errp, + void * authdb, void * argp, + ArgFn_EnumGroups); +#else /* UnixWare */ +NSAPI_PUBLIC extern int nsadbEnumerateGroups(NSErr_t * errp, + void * authdb, void * argp, + int (*func)(NSErr_t * ferrp, + void * authdb, + void * parg, + GroupObj_t * goptr)); +#endif /* UnixWare */ + +NSAPI_PUBLIC extern int nsadbIsUserInGroup(NSErr_t * errp, void * authdb, + USI_t uid, USI_t gid, + int ngroups, USI_t * grplist); + +NSAPI_PUBLIC extern int nsadbModifyGroup(NSErr_t * errp, + void * authdb, GroupObj_t * goptr); + +NSAPI_PUBLIC extern int nsadbModifyUser(NSErr_t * errp, + void * authdb, UserObj_t * uoptr); + +NSAPI_PUBLIC extern int nsadbRemoveGroup(NSErr_t * errp, + void * authdb, char * name); + +NSAPI_PUBLIC extern int nsadbRemoveUser(NSErr_t * errp, + void * authdb, char * name); + +NSAPI_PUBLIC extern int nsadbRemGroupFromGroup(NSErr_t * errp, void * authdb, + GroupObj_t * pgoptr, + GroupObj_t * cgoptr); + +NSAPI_PUBLIC extern int nsadbRemUserFromGroup(NSErr_t * errp, void * authdb, + GroupObj_t * goptr, + UserObj_t * uoptr); + +NSAPI_PUBLIC extern int nsadbSuperGroups(NSErr_t * errp, void * authdb, + GroupObj_t * goptr, + USIList_t * gsuper); + + +NSPR_END_EXTERN_C + +#if defined(CLIENT_AUTH) + +/* Removed for new ns security integration +#include +*/ +#include +#include + +#endif /* defined(CLIENT_AUTH) */ + +#endif /* __nsamgmt_h */ diff --git a/include/libaccess/nsauth.h b/include/libaccess/nsauth.h new file mode 100644 index 00000000..8f5ce877 --- /dev/null +++ b/include/libaccess/nsauth.h @@ -0,0 +1,288 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef __nsauth_h +#define __nsauth_h + +/* + * Description (nsauth.h) + * + * This file defines types and interfaces which pertain to client + * authentication. The key types are Realm_t, which describes a + * context for authentication, and ClAuth_t, which is used to + * pass authentication information about a particular client + * into and out of authentication interface functions. + */ + +#ifdef CLIENT_AUTH + +#include "ssl.h" + +#if 0 +/* Removed for new ns security */ +#include "sec.h" /* SECCertificate */ +#endif +#include "cert.h" /* CERTCertificate for new ns security bin */ +#endif /* CLIENT_AUTH */ + +#include "usi.h" /* identifier list support */ +#include "attrec.h" /* attribute record types */ +#include "nserror.h" /* error frame list support */ +#include "nsautherr.h" /* authentication error codes */ + +/* Define a scalar IP address value */ +#ifndef __IPADDR_T_ +#define __IPADDR_T_ +typedef unsigned long IPAddr_t; +#endif /* __IPADDR_T_ */ + +/* + * Description (UserObj_t) + * + * This type defines the structure of a user object. A user object + * contains information about a user which might be contained in + * an authentication database, including user name, password, user id, + * and group membership. + */ + +typedef struct UserObj_s UserObj_t; +struct UserObj_s { + NTS_t uo_name; /* user account name */ + NTS_t uo_pwd; /* encrypted password */ + USI_t uo_uid; /* user id */ + USI_t uo_flags; /* bit flags */ +#define UOF_DBFLAGS 0x1f /* mask for flags stored in DB file */ +#define UOF_ERROR 0x20 /* error on last operation */ +#define UOF_NEW 0x40 /* new user object */ +#define UOF_MODIFIED 0x80 /* internal object modified */ +#define UOF_DELPEND 0x100 /* delete pending */ + + NTS_t uo_rname; /* real user name (gecos string) */ + USIList_t uo_groups; /* list of group ids containing user */ +}; + +/* + * Description (GroupObj_t) + * + * This type defines the structure of a group object. A group object + * contains information about a group which might be contained in + * an authentication database, including group name, group id, and + * relationships to other groups. + */ + +typedef struct GroupObj_s GroupObj_t; +struct GroupObj_s { + NTS_t go_name; /* group name */ + USI_t go_gid; /* group id */ + USI_t go_flags; /* bit flags */ +#define GOF_DBFLAGS 0x3f /* mask for flags stored in DB file */ +#define GOF_NEW 0x40 /* new group object */ +#define GOF_MODIFIED 0x80 /* internal object modified */ +#define GOF_DELPEND 0x100 /* delete pending */ + + NTS_t go_desc; /* group description */ + USIList_t go_users; /* list of user members (uids) */ + USIList_t go_groups; /* list of group members (gids) */ + USIList_t go_pgroups; /* list of parent groups (gids) */ +}; + +/* + * Description (AuthIF_t) + * + * This type describes a structure containing pointers to functions + * which provide a standard interface to an authentication database. + * The functions are described below. + * + * Description (aif_close) + * + * The referenced function closes an authentication database which + * was previously opened via the aif_open function. + * + * Arguments: + * + * authdb - handle for database returned by aif_open + * flags - close flags (unused - must be zero) + * + * + * Description (aif_findid) + * + * The referenced function looks up a specified user or group id + * in a given authentication database. Flags can be specified to + * search for only matching user ids, only matching group ids, + * or both. The result value for a successful search indicates + * whether a matching user or group id was found, and a pointer to + * a user or group object is returned accordingly. + * + * Arguments: + * + * authdb - handle for database returned by aif_open + * id - user/group id value + * flags - bit flags to control search + * rptr - pointer to returned user or group object + * pointer (may be null) + * + * Returns: + * + * If successful, the result value is greater than zero, and contains + * a subset of the search flags, indicating what was found, and a user + * or group object pointer is returned through 'rptr' if it is non-null. + * An unsuccessful search is indicated by a return value of zero. An + * error is indicated by a negative return value (defined in + * nsautherr.h). + * + * + * Description (aif_findname) + * + * The referenced function looks up a specified user or group name + * in a given authentication database. Flags can be specified to + * search for only matching user names, only matching group names, + * or both. The result value for a successful search indicates + * whether a matching user or group was found, and a pointer to a + * user or group object is returned accordingly. + * + * Arguments: + * + * authdb - handle for database returned by aif_open + * name - user/group name string pointer + * flags - bit flags to control search + * rptr - pointer to returned user or group object + * pointer (may be null) + * + * Returns: + * + * If successful, the result value is greater than zero, and contains + * a subset of the search flags, indicating what was found, and a user + * or group object pointer is returned through 'rptr' if it is non-null. + * An unsuccessful search is indicated by a return value of zero. An + * error is indicated by a negative return value (defined in + * nsautherr.h). + * + * + * Description (aif_idtoname) + * + * The referenced function looks up a specified user or group id + * in a given authentication database, and returns the associated + * user or group name. Flags can be specified to search for only + * matching user ids, only matching group ids, or both. The result + * value for a successful search indicates whether a matching user + * or group id was found, and a pointer to the user or group name + * is returned accordingly. + * + * Arguments: + * + * authdb - handle for database returned by aif_open + * id - user/group id value + * flags - bit flags to control search + * rptr - pointer to returned user or group name + * pointer (may be null) + * + * Returns: + * + * If successful, the result value is greater than zero, and contains + * a subset of the search flags, indicating what was found, and a user + * or group name pointer is returned through 'rptr' if it is non-null. + * An unsuccessful search is indicated by a return value of zero. An + * error is indicated by a negative return value (defined in + * nsautherr.h). + * + * + * Description (aif_open) + * + * The referenced function opens a named authentication database of + * the type supported by this interface. The actual effect of the + * open function depends on the particular type of database, but a + * call to the aif_open function should generally be followed by a + * call to the aif_close function at some point. + * + * Arguments: + * + * adbname - authentication database name string pointer + * flags - open flags (definitions below) + * rptr - pointer to returned handle for the database + * + * Returns: + * + * The return value is zero if the operation is successful, and a + * handle for the authentication database is returned through 'rptr'. + * An error is indicated by a negative return value (defined in + * nsautherr.h). + */ + +typedef struct AuthIF_s AuthIF_t; +struct AuthIF_s { + int (*aif_findid)(NSErr_t * errp, + void * authdb, USI_t id, int flags, void **rptr); + int (*aif_findname)(NSErr_t * errp, + void * authdb, char * name, int flags, void **rptr); + int (*aif_idtoname)(NSErr_t * errp, + void * authdb, USI_t id, int flags, char **rptr); + int (*aif_open)(NSErr_t * errp, char * adbname, int flags, void **rptr); + void (*aif_close)(void * authdb, int flags); + int (*aif_addmember)(void **pmlist, char * name, int flags); + int (*aif_ismember)(void * mlist, char * name, int flags); +}; + +/* Define flags for the aif_open function */ +#define AIF_CREATE 0x1 /* new database (create it) */ + +/* + * Define bits for flags and return value of aif_findid, aif_findid, + * and aif_idtoname functions. + */ +#define AIF_NONE 0 /* no matching group or user name */ +#define AIF_GROUP 0x1 /* matching group name/id found */ +#define AIF_USER 0x2 /* matching user name/id found */ + +/* + * Description (Realm_t) + * + * This type defines a structure which represents an authentication + * realm. Each realm has a unique name, which is accessed through + * a Symbol_t structure, which in turn references a Realm_t as the + * symbol value. This structure specifies an authentication + * method and an authentication database. + */ + +typedef struct Realm_s Realm_t; +struct Realm_s { + int rlm_ameth; /* authentication method type */ + char * rlm_dbname; /* authentication database name */ + AuthIF_t * rlm_aif; /* authentication interface pointer */ + void * rlm_authdb; /* authentication database handle */ + char * rlm_prompt; /* realm prompt string */ +}; + +/* Define supported authentication method codes for rlm_ameth */ +#define AUTH_METHOD_BASIC 1 /* basic authentication */ +#define AUTH_METHOD_SSL 2 /* SSL client authentication */ + +/* + * Description (ClAuth_t) + * + * This type describes a structure containing information about a + * particular client. It is used to pass information into and out + * of authentication support functions, as well as to other functions + * needing access to client authentication information. + * FUTURE: + * - add client certificate pointer + */ + +typedef struct ClAuth_s ClAuth_t; +struct ClAuth_s { + Realm_t * cla_realm; /* authentication realm pointer */ + IPAddr_t cla_ipaddr; /* IP address */ + char * cla_dns; /* DNS name string pointer */ + UserObj_t * cla_uoptr; /* authenticated user object pointer */ + GroupObj_t * cla_goptr; /* pointer to list of group objects */ +#ifdef CLIENT_AUTH +#if 0 + /* Removed for new ns security */ + SECCertificate * cla_cert; /* certificate from SSL client auth */ +#endif + CERTCertificate * cla_cert; /* certificate from SSL client auth */ +#endif /* CLIENT_AUTH */ +}; + +#endif /* __nsauth_h */ diff --git a/include/libaccess/nsautherr.h b/include/libaccess/nsautherr.h new file mode 100644 index 00000000..02951b9f --- /dev/null +++ b/include/libaccess/nsautherr.h @@ -0,0 +1,97 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef __nsautherr_h +#define __nsautherr_h + +/* Define error id codes */ + +/* Define error ids generated by nsumgmt.c */ + +/* userRename() */ +#define NSAUERR1000 1000 /* insufficient dynamic memory */ + +/* userStore() */ +#define NSAUERR1100 1100 /* insufficient dynamic memory */ + +/* Define error ids generated by nsgmgmt.c */ + +/* groupStore() */ +#define NSAUERR2000 2000 /* insufficient dynamic memory */ + +/* Define error ids generated by nsadb.c */ + +/* nsadbOpen() */ +#define NSAUERR3000 3000 /* invalid function argument */ +#define NSAUERR3020 3020 /* insufficient dynamic memory */ +#define NSAUERR3040 3040 /* create directory operation failed */ +#define NSAUERR3060 3060 /* open directory operation failed */ + +/* nsadbOpenUsers() */ +#define NSAUERR3200 3200 /* invalid function argument */ +#define NSAUERR3220 3220 /* insufficient dynamic memory */ +#define NSAUERR3240 3240 /* error opening user database */ + +/* nsadbOpenGroups() */ +#define NSAUERR3300 3300 /* invalid function argument */ +#define NSAUERR3320 3320 /* insufficient dynamic memory */ +#define NSAUERR3340 3340 /* error opening group database */ + +#if defined(CLIENT_AUTH) +/* nsadbOpenClients() */ +#define NSAUERR3400 3400 /* invalid function argument */ +#define NSAUERR3420 3420 /* insufficient dynamic memory */ +#define NSAUERR3430 3430 /* error initializing DB lock */ +#define NSAUERR3440 3440 /* error opening group database */ + +/* nsadbPutUserByCert() */ +#define NSAUERR3500 3500 /* invalid username length */ +#define NSAUERR3520 3520 /* user-to-cert map already exists */ + +/* nsadbOpenCertUsers() */ +#define NSAUERR3600 3600 /* error opening user-to-cert id DB */ + +/* nsadbFindCertUser() */ +#define NSAUERR3700 3700 /* specified user name not found */ + +/* nsadbAddCertUser() */ +#define NSAUERR3800 3800 /* error adding entry to database */ + +/* nsadbRemoveCertUser() */ +#define NSAUERR3900 3900 /* error deleting entry in database */ + +#endif /* defined(CLIENT_AUTH) */ + +/* Define error ids generated by nsamgmt.c */ + +/* nsadbRemoveUser() */ +#define NSAUERR4000 4000 /* user name not found */ + +/* nsadbRemoveGroup() */ +#define NSAUERR4100 4100 /* group name not found */ + +/* Define error codes */ +#define NSAERRNOMEM -1 /* insufficient dynamic memory */ +#define NSAERRINVAL -2 /* invalid function argument */ +#define NSAERROPEN -3 /* error opening database */ +#define NSAERRMKDIR -4 /* error creating database directory */ +#define NSAERRNAME -5 /* user or group name not found */ +#define NSAERRPUT -6 /* error writing record to database */ +#define NSAERRCMAP -7 /* certificate map already exists */ +#define NSAERRDEL -8 /* error deleting database entry */ +#define NSAERRLOCK -9 /* error initializing DB lock */ + +NSPR_BEGIN_EXTERN_C + +/* Authentication facility name in nsuser.c */ +extern char * NSAuth_Program; + + /* Functions in nsautherr.c */ +extern NSAPI_PUBLIC void nsadbErrorFmt(NSErr_t * errp, + char * msgbuf, int maxlen, int maxdepth); + +NSPR_END_EXTERN_C + +#endif /* __nsautherr_h */ diff --git a/include/libaccess/nscert.h b/include/libaccess/nscert.h new file mode 100644 index 00000000..b704bbdf --- /dev/null +++ b/include/libaccess/nscert.h @@ -0,0 +1,102 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef __nscert_h +#define __nscert_h + +/* + * Description (nscert.h) + * + * This file describes the interface for accessing and storing + * information in a Netscape client certificate to username + * database. This facility is built on top of the Netscape + * (server) database interface as defined in nsdb.h. + */ + +#include /* error frame list support */ +#include /* authentication error codes */ +#include + +#include +/* Removed for new ns security integration +#include +*/ +#include + +#if defined(CLIENT_AUTH) + +/* Certificate to user record attribute tags */ +#define CAT_USERNAME 0x61 /* username associated with cert */ +#define CAT_CERTID 0x62 /* id assigned to cert */ + +/* Attribute tags used in certificate key encoding */ +#define KAT_ISSUER 0x01 /* issuer DER */ +#define KAT_SUBJECT 0x02 /* subject DER */ + +typedef struct CertObj_s CertObj_t; +struct CertObj_s { + SECItem co_issuer; /* issuing authority */ + SECItem co_subject; /* certicate's subject */ + char * co_username; /* the local name it mapps to */ + USI_t co_certid; /* internal id for this client certificate */ +}; + +typedef int (*CertEnumCallback)(NSErr_t * ferrp, void * authdb, + void * argp, CertObj_t * coptr); + +NSPR_BEGIN_EXTERN_C + +extern NSAPI_PUBLIC int nsadbCertInitialize(void); + +extern NSAPI_PUBLIC int nsadbDecodeCertKey(int keylen, char * keyptr, + SECItem * issuer, + SECItem * subject); + +extern NSAPI_PUBLIC int nsadbDecodeCertRec(int reclen, char * recptr, + CertObj_t * coptr); + +extern NSAPI_PUBLIC int nsadbEncodeCertKey(SECItem * issuer, SECItem * subject, + int * keylen, char **keyptr); + +extern NSAPI_PUBLIC int nsadbEnumerateCerts(NSErr_t * errp, void * authdb, + void * argp, + CertEnumCallback func); + +extern NSAPI_PUBLIC void nsadbFreeCertObj(CertObj_t * coptr); + +extern NSAPI_PUBLIC int nsadbGetCertById(NSErr_t * errp, void * authdb, + USI_t certid, CertObj_t **coptr); + +extern NSAPI_PUBLIC int nsadbGetUserByCert(NSErr_t * errp, void * authdb, + CERTCertificate * cert, + char **username); + +extern NSAPI_PUBLIC int nsadbOpenCerts(NSErr_t * errp, + void * authdb, int flags); + +extern NSAPI_PUBLIC int nsadbPutUserByCert(NSErr_t * errp, void * authdb, + CERTCertificate * cert, + const char * username); + +extern NSAPI_PUBLIC int nsadbRemoveCert(NSErr_t * errp, void * authdb, + void * username, CertObj_t * coptr); + +extern NSAPI_PUBLIC int nsadbRemoveUserCert(NSErr_t * errp, void * authdb, + char * username); + +extern NSAPI_PUBLIC void nsadbCloseCerts(void * authdb, int flags); + +extern NSAPI_PUBLIC void nsadbCloseCertUsers(void * authdb, int flags); + +extern NSAPI_PUBLIC int nsadbFindCertUser(NSErr_t * errp, void * authdb, + const char * username, USI_t * id); + + +NSPR_END_EXTERN_C + +#endif /* CLIENT_AUTH */ + + +#endif /* __nscert_h */ diff --git a/include/libaccess/nsdb.h b/include/libaccess/nsdb.h new file mode 100644 index 00000000..c5b39e1c --- /dev/null +++ b/include/libaccess/nsdb.h @@ -0,0 +1,182 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef __nsdb_h +#define __nsdb_h + +/* + * Description (nsdb.h) + * + * This file describes the interface for retrieving information + * from a Netscape (server) database. A database is composed of + * two (libdbm) DB files. One of these (.db) contains + * records indexed by a string key. These records contain the + * primary information in the database. A second DB file + * (.id) is used to map an integer id value to a string + * key, which can then be used to locate a record in the first file. + * The interface for managing information in a database is described + * in nsdbmgmt.h. + */ + +/* Begin private definitions */ +#ifdef __PRIVATE_NSDB + +#include "mcom_db.h" + +/* + * Description (NSDB_t) + * + * This type describes the structure that used to represent a + * Netscape server database. It includes fields to reference + * both the primary and id-to-name DB files, and information + * about the current state of the database. + */ + +typedef struct NSDB_s NSDB_t; +struct NSDB_s { + char * ndb_pname; /* primary DB file name pointer */ + DB * ndb_pdb; /* primary DB file handle */ + char * ndb_iname; /* id-to-name DB file name pointer */ + DB * ndb_idb; /* id-to-name DB file handle */ + int ndb_flags; /* bit flags */ +#define NDBF_RDNAME 0x1 /* primary DB open for read */ +#define NDBF_WRNAME 0x2 /* primary DB open for write */ +#define NDBF_NONAME 0x4 /* primary DB does not exist */ +#define NDBF_RDID 0x10 /* id-to-name DB open for read */ +#define NDBF_WRID 0x20 /* id-to-name DB open for write */ +#define NDBF_NOID 0x40 /* id-to-name DB does not exist */ + + int ndb_dbtype; /* database type */ + int ndb_version; /* type-specific version number */ +}; + +/* Define metadata record keys (must start with NDB_MDPREFIX) */ +#define NDB_DBTYPE "?dbtype" /* database type and version info */ +#define NDB_IDMAP "?idmap" /* id allocation bitmap */ + +#endif /* __PRIVATE_NSDB */ + +/* Begin public definitions */ + +#include "nserror.h" /* error frame list support */ +#include "nsdberr.h" /* error codes for NSDB facility */ + +/* Define the NSDB version number */ +#define NDB_VERSION 0x10 /* NSDB version 1.0 */ + +/* Define reserved database type codes for ndb_dbtype */ +#define NDB_TYPE_USERDB 1 /* user database */ +#define NDB_TYPE_GROUPDB 2 /* group database */ +#define NDB_TYPE_CLIENTDB 3 /* client database */ +#define NDB_TYPE_ACLDB 4 /* access control list database */ + +/* + * Define the metadata record key prefix character. Normal data record + * keys (names) cannot begin with this character. + */ +#define NDB_MDPREFIX '?' + +/* Define flags for ndbEnumerate() */ +#define NDBF_ENUMNORM 0x1 /* enumerate normal data records */ +#define NDBF_ENUMMETA 0x2 /* enumerate metadata records */ + +/* Define return values for a user function called by ndbEnumerate */ +#define NDB_ENUMSTOP -1 /* terminate enumeration */ +#define NDB_ENUMCONT 0 /* continue enumeration */ +#define NDB_ENUMRESET 1 /* restart enumeration at beginning */ + +NSPR_BEGIN_EXTERN_C + +/* Functions for database information retrieval in nsdb.c */ +extern void ndbClose(void * ndb, int flags); + +/* for ANSI C++ standard on SCO UDK, otherwise fn name is mangled */ +#ifdef UnixWare +typedef int (*ArgFn_ndbEnum)(NSErr_t * ferrp, void * parg, int namelen, + char * name, int reclen, char * recptr); +extern int ndbEnumerate(NSErr_t * errp, void * ndb, int flags, void * argp, + ArgFn_ndbEnum); +#else /* UnixWare */ +extern int ndbEnumerate(NSErr_t * errp, void * ndb, int flags, void * argp, + int (*func)(NSErr_t * ferrp, void * parg, + int namelen, char * name, + int reclen, char * recptr)); +#endif /* UnixWare */ +extern int ndbFindName(NSErr_t * errp, void * ndb, int namelen, char * name, + int * reclen, char **recptr); +extern int ndbIdToName(NSErr_t * errp, + void * ndb, unsigned int id, int * plen, char **pname); +extern int ndbInitPrimary(NSErr_t * errp, void * ndb); +extern void * ndbOpen(NSErr_t * errp, + char * dbname, int flags, int dbtype, int * version); +extern int ndbReOpen(NSErr_t * errp, void * ndb, int flags); + +NSPR_END_EXTERN_C + +/* richm - 20020218 - these macros were added as part of the port to DBM 1.6 + * apparently, these were exported for outside use from mcom_db.h in + * DBM 1.5x and earlier, but were made private in 1.6 - so I copied them + * here + */ +/* + * Little endian <==> big endian 32-bit swap macros. + * M_32_SWAP swap a memory location + * P_32_SWAP swap a referenced memory location + * P_32_COPY swap from one location to another + */ +#ifndef M_32_SWAP +#define M_32_SWAP(a) { \ + uint32 _tmp = a; \ + ((char *)&a)[0] = ((char *)&_tmp)[3]; \ + ((char *)&a)[1] = ((char *)&_tmp)[2]; \ + ((char *)&a)[2] = ((char *)&_tmp)[1]; \ + ((char *)&a)[3] = ((char *)&_tmp)[0]; \ +} +#endif +#ifndef P_32_SWAP +#define P_32_SWAP(a) { \ + uint32 _tmp = *(uint32 *)a; \ + ((char *)a)[0] = ((char *)&_tmp)[3]; \ + ((char *)a)[1] = ((char *)&_tmp)[2]; \ + ((char *)a)[2] = ((char *)&_tmp)[1]; \ + ((char *)a)[3] = ((char *)&_tmp)[0]; \ +} +#endif +#ifndef P_32_COPY +#define P_32_COPY(a, b) { \ + ((char *)&(b))[0] = ((char *)&(a))[3]; \ + ((char *)&(b))[1] = ((char *)&(a))[2]; \ + ((char *)&(b))[2] = ((char *)&(a))[1]; \ + ((char *)&(b))[3] = ((char *)&(a))[0]; \ +} +#endif +/* + * Little endian <==> big endian 16-bit swap macros. + * M_16_SWAP swap a memory location + * P_16_SWAP swap a referenced memory location + * P_16_COPY swap from one location to another + */ +#ifndef M_16_SWAP +#define M_16_SWAP(a) { \ + uint16 _tmp = a; \ + ((char *)&a)[0] = ((char *)&_tmp)[1]; \ + ((char *)&a)[1] = ((char *)&_tmp)[0]; \ +} +#endif +#ifndef P_16_SWAP +#define P_16_SWAP(a) { \ + uint16 _tmp = *(uint16 *)a; \ + ((char *)a)[0] = ((char *)&_tmp)[1]; \ + ((char *)a)[1] = ((char *)&_tmp)[0]; \ +} +#endif +#ifndef P_16_COPY +#define P_16_COPY(a, b) { \ + ((char *)&(b))[0] = ((char *)&(a))[1]; \ + ((char *)&(b))[1] = ((char *)&(a))[0]; \ +} +#endif + +#endif /* __nsdb_h */ diff --git a/include/libaccess/nsdberr.h b/include/libaccess/nsdberr.h new file mode 100644 index 00000000..224bd483 --- /dev/null +++ b/include/libaccess/nsdberr.h @@ -0,0 +1,92 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef __nsdberr_h +#define __nsdberr_h + +/* NSDB facility name (defined in nsdb,c) */ +extern char * NSDB_Program; + +/* Define error identifiers for NSDB facility */ + +/* Errors generated in nsdb.c */ + +/* ndbFindName() */ +#define NSDBERR1000 1000 /* primary DB get operation failed */ + +/* ndbIdToName() */ +#define NSDBERR1100 1100 /* id-to-name DB get operation failed */ + +/* ndbInitPrimary() */ +#define NSDBERR1200 1200 /* primary database already exists */ +#define NSDBERR1220 1220 /* primary database open failed */ +#define NSDBERR1240 1240 /* primary DB put operation failed */ +#define NSDBERR1260 1260 /* primary DB put operation failed */ + +/* ndbOpen() */ +#define NSDBERR1400 1400 /* insufficient dynamic memory */ +#define NSDBERR1420 1420 /* insufficient dynamic memory */ +#define NSDBERR1440 1440 /* insufficient dynamic memory */ +#define NSDBERR1460 1460 /* primary DB get metadata operation failed */ +#define NSDBERR1480 1480 /* metadata format error */ +#define NSDBERR1500 1500 /* unsupported database version number */ +#define NSDBERR1520 1520 /* wrong database type */ + +/* ndbReOpen() */ +#define NSDBERR1600 1600 /* create primary DB failed */ +#define NSDBERR1620 1620 /* open primary/write failed */ +#define NSDBERR1640 1640 /* open primary/read failed */ +#define NSDBERR1660 1660 /* create id-to-name DB failed */ +#define NSDBERR1680 1680 /* open id-to-name DB for write failed */ +#define NSDBERR1700 1700 /* open id-to-name DB for read failed */ + +/* Define error ids generated in nsdbmgmt.c */ + +/* ndbAllocId() */ +#define NSDBERR2000 2000 /* bad DB name key */ +#define NSDBERR2020 2020 /* metadata get operation failed */ +#define NSDBERR2040 2040 /* no space to grow DB id bitmap */ +#define NSDBERR2060 2060 /* no space to copy DB id bitmap */ +#define NSDBERR2080 2080 /* put bitmap to DB operation failed */ +#define NSDBERR2100 2100 /* put id-to-name operation failed */ + +/* ndbDeleteName() */ +#define NSDBERR2200 2200 /* error deleting record */ + +/* ndbFreeId() */ +#define NSDBERR2300 2300 /* invalid id value */ +#define NSDBERR2320 2320 /* error deleting id-to-name record */ +#define NSDBERR2340 2340 /* error reading id bitmap from primary DB */ +#define NSDBERR2360 2360 /* invalid id value */ +#define NSDBERR2380 2380 /* insufficient dynamic memory */ +#define NSDBERR2400 2400 /* error writing id bitmap back to DB */ + +/* ndbRenameId() */ +#define NSDBERR2500 2500 /* invalid new key name string */ +#define NSDBERR2520 2520 /* get id record operation failed */ +#define NSDBERR2540 2540 /* put id record operation failed */ + +/* ndbStoreName() */ +#define NSDBERR2700 2700 /* database put operation failed */ + +/* Define error return codes */ +#define NDBERRNOMEM -1 /* insufficient dynamic memory */ +#define NDBERRNAME -2 /* invalid key name string */ +#define NDBERROPEN -3 /* database open error */ +#define NDBERRMDGET -4 /* database metadata get failed */ +#define NDBERRMDPUT -5 /* database metadata put failed */ +#define NDBERRIDPUT -6 /* id-to-name record put failed */ +#define NDBERRNMDEL -7 /* delete named record failed */ +#define NDBERRPINIT -8 /* error creating primary DB file */ +#define NDBERRGET -9 /* database get failed */ +#define NDBERREXIST -10 /* DB already exists */ +#define NDBERRMDFMT -11 /* invalid metadata format */ +#define NDBERRDBTYPE -12 /* wrong DB type */ +#define NDBERRBADID -13 /* invalid id value for name */ +#define NDBERRPUT -14 /* database put operation failed */ +#define NDBERRVERS -15 /* unsupported database version */ +#define NDBERRIDDEL -16 /* delete id-to-name record failed */ + +#endif /* __nsdberr_h */ diff --git a/include/libaccess/nsdbmgmt.h b/include/libaccess/nsdbmgmt.h new file mode 100644 index 00000000..2977e6a2 --- /dev/null +++ b/include/libaccess/nsdbmgmt.h @@ -0,0 +1,52 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef __nsdbmgmt_h +#define __nsdbmgmt_h + +/* + * Description (nsdbmgmt.h) + * + * The file describes the interface for managing information in + * a Netscape (server) database. A database is composed of + * two (libdbm) DB files. One of these (.db) contains + * records indexed by a string key. These records contain the + * primary information in the database. A second DB file + * (.id) is used to map an integer id value to a string + * key, which can then be used to locate a record in the first file. + * The interface for retrieving information from a database is + * described in nsdb.h. + * + * FUTURE: + * Normally the records in the primary DB file will contain the + * id values which are used to key the id-to-name DB. When this + * is the case, it is possible to construct the id-to-name DB from + * the primary DB file, and an interface is provided to facilitate + * this. + */ + +#include "nsdb.h" /* database access */ + +/* Define flags for ndbStoreName() */ +#define NDBF_NEWNAME 0x1 /* this is (should be) a new name */ + +NSPR_BEGIN_EXTERN_C + +/* Functions for database management in nsdbmgmt.c */ +extern int ndbAllocId(NSErr_t * errp, void * ndb, + int namelen, char * name, unsigned int * id); +extern int ndbDeleteName(NSErr_t * errp, + void * ndb, int flags, int namelen, char * name); +extern int ndbFreeId(NSErr_t * errp, + void * ndb, int namelen, char * name, unsigned int id); +extern int ndbRenameId(NSErr_t * errp, void * ndb, + int namelen, char * newname, unsigned int id); +extern int ndbStoreName(NSErr_t * errp, void * ndb, int flags, + int namelen, char * name, int reclen, char * recptr); +extern int ndbSync(NSErr_t * errp, void * ndb, int flags); + +NSPR_END_EXTERN_C + +#endif /* __nsdbmgmt_h */ diff --git a/include/libaccess/nserror.h b/include/libaccess/nserror.h new file mode 100644 index 00000000..2a28c4f9 --- /dev/null +++ b/include/libaccess/nserror.h @@ -0,0 +1,47 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef __nserror_h +#define __nserror_h + +#ifndef NOINTNSACL +#define INTNSACL +#endif /* !NOINTNSACL */ + +/* + * Description (nserror.h) + * + * This file describes the interface to an error handling mechanism + * that is intended for general use. This mechanism uses a data + * structure known as an "error frame" to capture information about + * an error. Multiple error frames are used in nested function calls + * to capture the interpretation of an error at the different levels + * of a nested call. + */ + +#include +#include +#include "public/nsacl/nserrdef.h" + +#ifdef INTNSACL + +NSPR_BEGIN_EXTERN_C + +/* Functions in nseframe.c */ +extern void nserrDispose(NSErr_t * errp); +extern NSEFrame_t * nserrFAlloc(NSErr_t * errp); +extern void nserrFFree(NSErr_t * errp, NSEFrame_t * efp); +extern NSEFrame_t * nserrGenerate(NSErr_t * errp, long retcode, long errorid, + char * program, int errc, ...); + +/* Functions in nserrmsg.c */ +extern char * nserrMessage(NSEFrame_t * efp, int flags); +extern char * nserrRetrieve(NSEFrame_t * efp, int flags); + +NSPR_END_EXTERN_C + +#endif /* INTNSACL */ + +#endif /* __nserror_h */ diff --git a/include/libaccess/nsgmgmt.h b/include/libaccess/nsgmgmt.h new file mode 100644 index 00000000..8fc59e12 --- /dev/null +++ b/include/libaccess/nsgmgmt.h @@ -0,0 +1,35 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef __nsgmgmt_h +#define __nsgmgmt_h + +/* + * Description (nsgmgmt.h) + * + * This file defines the interface to group management facilities + * implemented using a Netscape group database. This interface + * provides functions for adding, modifying, and removing group + * entries in the database, using the group object (GroupObj_t) + * structure to convey information across the interface. + */ + +#define __PRIVATE_NSGROUP +#include "nsgroup.h" /* group object access */ + +NSPR_BEGIN_EXTERN_C + +/* Group information management operations in nsgmgmt.c */ +extern NSAPI_PUBLIC int groupAddMember(GroupObj_t * goptr, int isgid, USI_t id); +extern NSAPI_PUBLIC GroupObj_t * groupCreate(NTS_t name, NTS_t desc); +extern NSAPI_PUBLIC int groupDeleteMember(GroupObj_t * goptr, int isgid, USI_t id); +extern NSAPI_PUBLIC int groupEncode(GroupObj_t * goptr, int * ureclen, ATR_t * urecptr); +extern NSAPI_PUBLIC int groupRemove(NSErr_t * errp, void * groupdb, int flags, NTS_t name); +extern NSAPI_PUBLIC int groupStore(NSErr_t * errp, + void * groupdb, int flags, GroupObj_t * goptr); + +NSPR_END_EXTERN_C + +#endif /* __nsgmgmt_h */ diff --git a/include/libaccess/nsgroup.h b/include/libaccess/nsgroup.h new file mode 100644 index 00000000..8f4bf56a --- /dev/null +++ b/include/libaccess/nsgroup.h @@ -0,0 +1,73 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef __nsgroup_h +#define __nsgroup_h + +/* + * Description (nsgroup.h) + * + * This file describes the interface to group information stored in + * a Netscape group database. Information about a group is provided + * to the caller in the form of a group object (GroupObj_t), defined + * in nsauth.h. This interface provides only read access to group + * information. The interface for managing the group database is + * described in nsgmgmt.h. + */ + +#include "nserror.h" /* error frame list support */ +#include "nsautherr.h" /* authentication error codes */ +#include "nsauth.h" /* authentication types */ + +/* Begin private definitions */ +#ifdef __PRIVATE_NSGROUP + +#include "nsdb.h" + +/* + * Define structure used to communicate between groupEnumerate() and + * groupEnumHelp(). + */ + +typedef struct GroupEnumArgs_s GroupEnumArgs_t; +struct GroupEnumArgs_s { + void * groupdb; /* group database handle */ + int flags; /* groupEnumerate() flags */ + int (*func)(NSErr_t * ferrp, void * parg, + GroupObj_t * goptr); /* user function pointer */ + void * user; /* user's argp pointer */ +}; + +/* Define attribute tags for group DB records */ +#define GAT_GID 0x50 /* group id (USI) */ +#define GAT_FLAGS 0x51 /* flags (USI) */ +#define GAT_DESCRIPT 0x52 /* group description (NTS) */ +#define GAT_USERS 0x53 /* list of users (USI...) */ +#define GAT_GROUPS 0x54 /* list of groups (USI...) */ +#define GAT_PGROUPS 0x55 /* list of paret groups (USI...) */ + +#endif /* __PRIVATE_NSGROUP */ + +/* Begin public definitions */ + +/* Define flags for groupEnumerate() */ +#define GOF_ENUMKEEP 0x1 /* don't free group objects */ + +NSPR_BEGIN_EXTERN_C + + /* Operations on a group object (see nsgroup.c) */ +extern NSAPI_PUBLIC GroupObj_t * groupDecode(NTS_t name, int ureclen, ATR_t urecptr); +extern NSAPI_PUBLIC int groupEnumerate(NSErr_t * errp, + void * groupdb, int flags, void * argp, + int (*func)(NSErr_t * ferrp, + void * parg, GroupObj_t * goptr)); +extern NSAPI_PUBLIC GroupObj_t * groupFindByName(NSErr_t * errp, + void * groupdb, NTS_t name); +extern NSAPI_PUBLIC GroupObj_t * groupFindByGid(NSErr_t * errp, void * groupdb, USI_t gid); +extern NSAPI_PUBLIC void groupFree(GroupObj_t * goptr); + +NSPR_END_EXTERN_C + +#endif /* __nsgroup_h */ diff --git a/include/libaccess/nslock.h b/include/libaccess/nslock.h new file mode 100644 index 00000000..af205863 --- /dev/null +++ b/include/libaccess/nslock.h @@ -0,0 +1,74 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef __nslock_h +#define __nslock_h + +/* + * Description (nslock.h) + * + * This file defines to interface for a locking facility that + * provides exclusive access to a resource across multiple + * server processes. + */ + +#include "nserror.h" +#include "base/crit.h" + +#ifdef __PRIVATE_NSLOCK + +/* + * Description (NSLock_t) + * + * This type represents a lock. It includes a name which + * uniquely identifies the lock, and a handle for referencing + * the lock once it has been initialized. + */ + +typedef struct NSLock_s NSLock_t; +struct NSLock_s { + NSLock_t * nl_next; /* next lock on NSLock_List */ + char * nl_name; /* name associate with lock */ +#if defined(FILE_UNIX) + CRITICAL nl_crit; /* critical section for threads */ + SYS_FILE nl_fd; /* file descriptor */ + int nl_cnt; /* nsLockAcquire() count */ +#elif defined(XP_WIN32) +#else +#error "nslock.h needs work for this platform" +#endif +}; + +#endif /* __PRIVATE_NSLOCK */ + +/* Define error identifiers */ + +/* nsLockOpen() */ +#define NSLERR1000 1000 /* insufficient dynamic memory */ +#define NSLERR1020 1020 /* error creating lock */ +#define NSLERR1040 1040 /* error accessing lock */ + +/* nsLockAcquire() */ +#define NSLERR1100 1100 /* error acquiring lock */ + +/* Define error return codes */ + +#define NSLERRNOMEM -1 /* insufficient dynamic memory */ +#define NSLERRCREATE -2 /* error creating lock */ +#define NSLERROPEN -3 /* error accessing lock */ +#define NSLERRLOCK -4 /* error acquiring lock */ + +NSPR_BEGIN_EXTERN_C + +/* Functions in nslock.c */ +extern NSAPI_PUBLIC int nsLockOpen(NSErr_t * errp, + char * lockname, void **plock); +extern NSAPI_PUBLIC int nsLockAcquire(NSErr_t * errp, void * lock); +extern NSAPI_PUBLIC void nsLockRelease(void * lock); +extern NSAPI_PUBLIC void nsLockClose(void * lock); + +NSPR_END_EXTERN_C + +#endif __nslock_h diff --git a/include/libaccess/nsumgmt.h b/include/libaccess/nsumgmt.h new file mode 100644 index 00000000..6d295a85 --- /dev/null +++ b/include/libaccess/nsumgmt.h @@ -0,0 +1,36 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef __nsumgmt_h +#define __nsumgmt_h + +/* + * Description (nsumgmt.h) + * + * This file defines the interface to user management facilities + * implemented using a Netscape user database. This interface + * provides functions for adding, modifying, and removing user + * entries in the database, using the user object (UserObj_t) + * structure to convey information across the interface. + */ + +#include "nsuser.h" /* user object access */ + +NSPR_BEGIN_EXTERN_C + +/* User information management operations in nsumgmt.c */ +extern int userAddGroup(UserObj_t * uoptr, USI_t gid); +extern NSAPI_PUBLIC UserObj_t * userCreate(NTS_t name, NTS_t pwd, NTS_t rname); +extern int userDeleteGroup(UserObj_t * uoptr, USI_t gid); +extern int userEncode(UserObj_t * uoptr, int * ureclen, ATR_t * urecptr); +extern NSAPI_PUBLIC int userRemove(NSErr_t * errp, void * userdb, int flags, NTS_t name); +extern NSAPI_PUBLIC int userRename(NSErr_t * errp, + void * userdb, UserObj_t * uoptr, NTS_t newname); +extern NSAPI_PUBLIC int userStore(NSErr_t * errp, + void * userdb, int flags, UserObj_t * uoptr); + +NSPR_END_EXTERN_C + +#endif /* __nsumgmt_h */ diff --git a/include/libaccess/nsuser.h b/include/libaccess/nsuser.h new file mode 100644 index 00000000..fbc51ba3 --- /dev/null +++ b/include/libaccess/nsuser.h @@ -0,0 +1,70 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef __nsuser_h +#define __nsuser_h + +/* + * Description (nsuser.h) + * + * This file describes the interface to user information stored in + * a Netscape user database. Information about a user is provided + * to the caller in the form of a user object (UserObj_t), defined + * in nsauth.h. This interface provides only read access to user + * information. The interface for managing the user database is + * described in nsumgmt.h. + */ + +#include "nserror.h" /* error frame list support */ +#include "nsautherr.h" /* authentication error codes */ +#include "nsauth.h" /* authentication types */ + +/* Begin private definitions */ +#ifdef __PRIVATE_NSUSER + +#include "nsdb.h" + +/* + * Define structure used to communicate between userEnumerate() and + * userEnumHelp(). + */ + +typedef struct UserEnumArgs_s UserEnumArgs_t; +struct UserEnumArgs_s { + void * userdb; /* user database handle */ + int flags; /* userEnumerate() flags */ + int (*func)(NSErr_t * ferrp, void * parg, + UserObj_t * uoptr); /* user function pointer */ + void * user; /* user's argp pointer */ +}; + +/* Define attribute tags for user DB records */ +#define UAT_PASSWORD 0x40 /* password (NTS) */ +#define UAT_UID 0x41 /* user id (USI) */ +#define UAT_ACCFLAGS 0x42 /* account flags (USI) */ +#define UAT_REALNAME 0x43 /* real name (NTS) */ +#define UAT_GROUPS 0x44 /* list of groups (USI...) */ + +#endif /* __PRIVATE_NSUSER */ + +/* Begin public definitions */ + +/* Define flags for userEnumerate() */ +#define UOF_ENUMKEEP 0x1 /* don't free user objects */ + +NSPR_BEGIN_EXTERN_C + +/* User information retrieval operations in nsuser.c */ +extern UserObj_t * userDecode(NTS_t name, int ureclen, ATR_t urecptr); +extern int userEnumerate(NSErr_t * errp, void * userdb, int flags, void * argp, + int (*func)(NSErr_t * ferrp, + void * parg, UserObj_t * uoptr)); +extern UserObj_t * userFindByName(NSErr_t * errp, void * userdb, NTS_t name); +extern UserObj_t * userFindByUid(NSErr_t * errp, void * userdb, USI_t uid); +NSAPI_PUBLIC extern void userFree(UserObj_t * uoptr); + +NSPR_END_EXTERN_C + +#endif /* __nsuser_h */ diff --git a/include/libaccess/register.h b/include/libaccess/register.h new file mode 100644 index 00000000..9b5837e4 --- /dev/null +++ b/include/libaccess/register.h @@ -0,0 +1,215 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ + +#ifndef ACL_REGISTER_HEADER +#define ACL_REGISTER_HEADER + +#include + +#include +#include +#include +#include +#include + +typedef void * ACLMethod_t; +#define ACL_METHOD_ANY (ACLMethod_t)-1 +#define ACL_METHOD_INVALID (ACLMethod_t)-2 +extern ACLMethod_t ACL_METHOD_BASIC; + +typedef void * ACLDbType_t; +#define ACL_DBTYPE_ANY (ACLDbType_t)-1 +#define ACL_DBTYPE_INVALID (ACLDbType_t)-2 +extern ACLDbType_t ACL_ACL_DBTYPE_LDAP; + +typedef int (*AttrGetterFn)(NSErr_t *errp, PList_t subject, PList_t resource, PList_t auth_info, PList_t global_auth, void *arg); +typedef int (*AclModuleInitFunc)(pblock *pb, Session *sn, Request *rq); +typedef int (*DbParseFn_t)(NSErr_t *errp, ACLDbType_t dbtype, + const char *name, const char *url, + PList_t plist, void **db); +typedef int (*AclCacheFlushFunc_t)(void); + +#ifdef __cplusplus +typedef int (*LASEvalFunc_t)(NSErr_t*, char*, CmpOp_t, char*, int*, void**, PList_t, PList_t, PList_t, PList_t); +typedef void (*LASFlushFunc_t)(void **); +#else +typedef int (*LASEvalFunc_t)(); +typedef void (*LASFlushFunc_t)(); +#endif + +/* We need to hide ACLGetter_t */ +typedef struct ACLGetter_s { + ACLMethod_t method; + ACLDbType_t db; + AttrGetterFn fn; + void *arg; +} ACLGetter_t; +typedef ACLGetter_t *ACLGetter_p; + +/* + * Command values for the "position" argument to ACL_RegisterGetter + * Any positive >0 value is the specific position in the list to insert + * the new function. + */ +#define ACL_AT_FRONT 0 +#define ACL_AT_END -1 +#define ACL_REPLACE_ALL -2 +#define ACL_REPLACE_MATCHING -3 + +#ifdef ACL_LIB_INTERNAL +#define ACL_MAX_METHOD 32 +#define ACL_MAX_DBTYPE 32 +#endif + +NSPR_BEGIN_EXTERN_C + +NSAPI_PUBLIC extern int + ACL_LasRegister( NSErr_t *errp, char *attr_name, LASEvalFunc_t + eval_func, LASFlushFunc_t flush_func ); +NSAPI_PUBLIC extern int + ACL_LasFindEval( NSErr_t *errp, char *attr_name, LASEvalFunc_t + *eval_funcp ); +NSAPI_PUBLIC extern int + ACL_LasFindFlush( NSErr_t *errp, char *attr_name, LASFlushFunc_t + *flush_funcp ); +extern void + ACL_LasHashInit( void ); +extern void + ACL_LasHashDestroy( void ); + +/* + * Revised, normalized method/dbtype registration routines + */ +NSAPI_PUBLIC extern int + ACL_MethodRegister(const char *name, ACLMethod_t *t); +NSAPI_PUBLIC extern int + ACL_MethodIsEqual(const ACLMethod_t t1, const ACLMethod_t t2); +NSAPI_PUBLIC extern int + ACL_MethodNameIsEqual(const ACLMethod_t t, const char *name); +NSAPI_PUBLIC extern int + ACL_MethodFind(const char *name, ACLMethod_t *t); +NSAPI_PUBLIC extern ACLMethod_t + ACL_MethodGetDefault(); +NSAPI_PUBLIC extern void + ACL_MethodSetDefault(const ACLMethod_t t); +NSAPI_PUBLIC extern int + ACL_AuthInfoGetMethod(PList_t auth_info, ACLMethod_t *t); + +NSAPI_PUBLIC extern int + ACL_DbTypeRegister(const char *name, DbParseFn_t func, ACLDbType_t *t); +NSAPI_PUBLIC extern int + ACL_DbTypeIsEqual(const ACLDbType_t t1, const ACLDbType_t t2); +NSAPI_PUBLIC extern int + ACL_DbTypeNameIsEqual(const ACLDbType_t t, const char *name); +NSAPI_PUBLIC extern int + ACL_DbTypeFind(const char *name, ACLDbType_t *t); +NSAPI_PUBLIC extern const ACLDbType_t + ACL_DbTypeGetDefault(); +NSAPI_PUBLIC extern void + ACL_DbTypeSetDefault(ACLDbType_t t); +NSAPI_PUBLIC extern int + ACL_AuthInfoGetDbType(PList_t auth_info, ACLDbType_t *t); +NSAPI_PUBLIC extern int + ACL_DbTypeIsRegistered(const ACLDbType_t dbtype); +NSAPI_PUBLIC extern DbParseFn_t + ACL_DbTypeParseFn(const ACLDbType_t dbtype); + +NSAPI_PUBLIC extern int + ACL_AttrGetterRegister(const char *attr, AttrGetterFn fn, ACLMethod_t m, + ACLDbType_t d, int position, void *arg); +typedef ACLGetter_t *AttrGetterList; /* TEMPORARY */ +NSAPI_PUBLIC extern int + ACL_AttrGetterFind(PList_t auth_info, const char *attr, + AttrGetterList *getters); + +NSPR_END_EXTERN_C + + +/* LAS return codes - Must all be negative numbers */ +#define LAS_EVAL_TRUE -1 +#define LAS_EVAL_FALSE -2 +#define LAS_EVAL_DECLINE -3 +#define LAS_EVAL_FAIL -4 +#define LAS_EVAL_INVALID -5 +#define LAS_EVAL_NEED_MORE_INFO -6 + +#define ACL_ATTR_GROUP "group" +#define ACL_ATTR_RAW_USER_LOGIN "user-login" +#define ACL_ATTR_AUTH_USER "auth-user" +#define ACL_ATTR_AUTH_TYPE "auth-type" +#define ACL_ATTR_AUTH_DB "auth-db" +#define ACL_ATTR_AUTH_PASSWORD "auth-password" +#define ACL_ATTR_USER "user" +#define ACL_ATTR_PASSWORD "pw" +#define ACL_ATTR_USERDN "userdn" +#define ACL_ATTR_RAW_USER "raw-user" +#define ACL_ATTR_RAW_PASSWORD "raw-pw" +#define ACL_ATTR_USER_ISMEMBER "user-ismember" +#define ACL_ATTR_DATABASE "database" +#define ACL_ATTR_DBTYPE "dbtype" +#define ACL_ATTR_DBNAME "dbname" +#define ACL_ATTR_DATABASE_URL "url" +#define ACL_ATTR_METHOD "method" +#define ACL_ATTR_AUTHTYPE "authtype" +#define ACL_ATTR_AUTHORIZATION "authorization" +#define ACL_ATTR_PARSEFN "parsefn" +#define ACL_ATTR_ATTRIBUTE "attr" +#define ACL_ATTR_GETTERFN "getterfunc" +#define ACL_ATTR_IP "ip" +#define ACL_ATTR_DNS "dns" +#define ACL_ATTR_MODULE "module" +#define ACL_ATTR_MODULEFUNC "func" +#define ACL_ATTR_GROUPS "groups" +#define ACL_ATTR_IS_VALID_PASSWORD "isvalid-password" +#define ACL_ATTR_CERT2USER "cert2user" +#define ACL_ATTR_USER_CERT "cert" +#define ACL_ATTR_PROMPT "prompt" +#define ACL_ATTR_TIME "time" +#define ACL_ATTR_USERS_GROUP "users-group" + +#define ACL_DBTYPE_LDAP "ldap" + +#define METHOD_DEFAULT "default" + +typedef PRHashTable AttrGetterTable_t; + +typedef struct { + char *method; + char *authtype; + char *dbtype; + AttrGetterTable_t *attrGetters; +} MethodInfo_t; + +NSPR_BEGIN_EXTERN_C + +NSAPI_PUBLIC int ACL_FindMethod (NSErr_t *errp, const char *method, MethodInfo_t **method_info_handle); +NSAPI_PUBLIC int ACL_RegisterModule (NSErr_t *errp, const char *moduleName, AclModuleInitFunc func); +NSAPI_PUBLIC int ACL_RegisterMethod (NSErr_t *errp, const char *method, const char *authtype, const char *dbtype, MethodInfo_t **method_info_handle); +NSAPI_PUBLIC int ACL_RegisterAttrGetter (NSErr_t *errp, MethodInfo_t *method_info_handle, const char *attr, AttrGetterFn func); +NSAPI_PUBLIC int ACL_UseAttrGettersFromMethod (NSErr_t *errp, const char *method, const char *usefrom); +NSAPI_PUBLIC int ACL_GetAttribute(NSErr_t *errp, const char *attr, void **val, PList_t subject, PList_t resource, PList_t auth_info, PList_t global_auth); +NSAPI_PUBLIC int ACL_FindAttrGetter (NSErr_t *errp, const char *method, const char *attr, AttrGetterFn *func); +NSAPI_PUBLIC int ACL_CallAttrGetter (NSErr_t *errp, const char *method, const char *attr, PList_t subject, PList_t resource, PList_t auth_info, PList_t global_auth); +NSAPI_PUBLIC int ACL_RegisterDbType(NSErr_t *errp, const char *dbtype, DbParseFn_t func); +NSAPI_PUBLIC int ACL_RegisterDbName(NSErr_t *errp, ACLDbType_t dbtype, const char *dbname, const char *url, PList_t plist); +NSAPI_PUBLIC int ACL_RegisterDbFromACL(NSErr_t *errp, const char *url, ACLDbType_t *dbtype); +NSAPI_PUBLIC int ACL_DatabaseFind(NSErr_t *errp, const char *dbname, + ACLDbType_t *dbtype, void **db); +NSAPI_PUBLIC int ACL_SetDefaultDatabase (NSErr_t *errp, const char *dbname); +NSAPI_PUBLIC int ACL_SetDefaultMethod (NSErr_t *errp, const char *method); +NSAPI_PUBLIC const char *ACL_DbnameGetDefault (NSErr_t *errp); +NSAPI_PUBLIC int ACL_LDAPDatabaseHandle (NSErr_t *errp, const char *dbname, LDAP **ld); +NSAPI_PUBLIC int ACL_AuthInfoGetDbname (NSErr_t *errp, PList_t auth_info, char **dbname); +NSAPI_PUBLIC int ACL_CacheFlushRegister(AclCacheFlushFunc_t func); + +NSPR_END_EXTERN_C + +struct program_groups { + char **groups; + char **programs; +}; + +#endif diff --git a/include/libaccess/stubs.h b/include/libaccess/stubs.h new file mode 100644 index 00000000..8efa0923 --- /dev/null +++ b/include/libaccess/stubs.h @@ -0,0 +1,6 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +typedef void PropList_t; diff --git a/include/libaccess/symbols.h b/include/libaccess/symbols.h new file mode 100644 index 00000000..c711f351 --- /dev/null +++ b/include/libaccess/symbols.h @@ -0,0 +1,99 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef __symbols_h +#define __symbols_h + +/* + * Description (symbols.h) + * + * This file describes the interface to an ACL symbol table + * implementation. The symbol table provides for storing symbols + * keyed by name and type, creating a separate name space for + * each symbol type. + */ + +#ifdef __PRIVATE_SYMBOLS + +#include "plhash.h" +#include "base/crit.h" + +/* + * Description (SymTable_t) + * + * This type describes a symbols table. It contains a pointer to + * an NSPR hash table and a pointer to a monitor. The monitor is + * needed even for read access to the symbol table because NSPR + * modifies the list for a hash bucket when a name is looked up. + */ + +typedef struct SymTable_s SymTable_t; +struct SymTable_s { + CRITICAL stb_crit; /* monitor pointer */ + PLHashTable * stb_ht; /* hash table pointer */ +}; + + +/* Private functions defined in symbols.c */ +/* +static PLHashEntry * symAllocEntry(void * pool, const void *unused); +static void * symAllocTable(void * pool, PRSize size); +static int symCmpName(const void * name1, const void * name2); +static int symCmpValue(const void * value1, const void * value2); +static PLHashNumber symHash(const void * symkey); +static void symFreeEntry(void * pool, PLHashEntry * he, PRUintn flag); +static void symFreeTable(void * pool, void * item); +*/ +#endif /* __PRIVATE_SYMBOLS */ + +/* + * Description (Symbol_t) + * + * This type describes a symbol table entry. A symbol is + * identified by the combination of its name and type. This + * structure is normally embedded in a structure for a particular + * symbol type, which will contain the symbol "value" information + * as well. + */ + +typedef struct Symbol_s Symbol_t; +struct Symbol_s { + char * sym_name; /* pointer to symbol name string */ + int sym_type; /* symbol type */ + void *sym_data; /* symbol data storage */ +}; + +/* Define error return codes */ +#define SYMERRNOMEM -1 /* insufficient dynamic memory */ +#define SYMERRDUPSYM -2 /* duplicate symbol name and type */ +#define SYMERRNOSYM -3 /* symbol name and type not found */ + +/* Define return flags for symTableEnumerate() func() */ +#define SYMENUMSTOP 0x1 /* terminate enumeration */ +#define SYMENUMREMOVE 0x2 /* remove entry from symbol table */ + +NSPR_BEGIN_EXTERN_C + +/* Public functions defined in symbols.c */ +extern int symTableAddSym(void * table, Symbol_t * newsym, void * symref); +extern void symTableRemoveSym(void * table, Symbol_t * sym); +extern void symTableDestroy(void * table, int flags); + +/* for ANSI C++ on SCO UDK, otherwise fn name is managled */ +#ifdef UnixWare +typedef int (*ArgFn_symTableEnum)(Symbol_t * sym, void * parg); +extern void symTableEnumerate(void * table, void * argp, ArgFn_symTableEnum); +#else /* UnixWare */ +extern void symTableEnumerate(void * table, void * argp, + int (*func)(Symbol_t * sym, void * parg)); +#endif /* UnixWare */ + +extern int symTableFindSym(void * table, char * symname, + int symtype, void **psymref); +extern int symTableNew(void **ptable); + +NSPR_END_EXTERN_C + +#endif /* __symbols_h */ diff --git a/include/libaccess/userauth.h b/include/libaccess/userauth.h new file mode 100644 index 00000000..84bf4d8a --- /dev/null +++ b/include/libaccess/userauth.h @@ -0,0 +1,13 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef USERAUTH_H +#define USERAUTH_H + +NSPR_BEGIN_EXTERN_C + + +NSPR_END_EXTERN_C +#endif diff --git a/include/libaccess/usi.h b/include/libaccess/usi.h new file mode 100644 index 00000000..7cbe7371 --- /dev/null +++ b/include/libaccess/usi.h @@ -0,0 +1,81 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef __usi_h +#define __usi_h + +/* + * Description (usi.h) + * + * This file defines the interface to an unsigned integer datatype. + * Unsigned integers are used to represent object identifiers of + * various sorts, including user ids and group ids. Functions + * for manipulating lists of USIs are also provided in this + * interface. + */ + +/* Define a type to contain an unsigned integer value */ +typedef unsigned int USI_t; + +/* Define a type to describe a list of USI_t values */ +typedef struct USIList_s USIList_t; +struct USIList_s { + int uil_count; /* number of active values in list */ + int uil_size; /* current size of list area in USI_t */ + USI_t * uil_list; /* pointer to array of values */ +}; + +/* Define macro to initialize a USIList_t structure */ +#define UILINIT(uilptr) \ + { \ + (uilptr)->uil_count = 0; \ + (uilptr)->uil_size = 0; \ + (uilptr)->uil_list = 0; \ + } + +/* Define a macro to replace the contents of one USIList_t with another's */ +#define UILREPLACE(dst, src) \ + { \ + if ((dst)->uil_size > 0) { \ + FREE((dst)->uil_list); \ + } \ + (dst)->uil_count = (src)->uil_count; \ + (dst)->uil_size = (src)->uil_size; \ + (dst)->uil_list = (src)->uil_list; \ + (src)->uil_count = 0; \ + (src)->uil_size = 0; \ + (src)->uil_list = 0; \ + } + +/* Define a variation of UILINIT() that frees any allocated space */ +#define UILFREE(uilptr) \ + { \ + if ((uilptr)->uil_size > 0) { \ + FREE((uilptr)->uil_list); \ + } \ + (uilptr)->uil_count = 0; \ + (uilptr)->uil_size = 0; \ + (uilptr)->uil_list = 0; \ + } + +/* Define a macro to extract the current number of items in a USIList_t */ +#define UILCOUNT(uilptr) ((uilptr)->uil_count) + +/* Define a macro to return a pointer to the array of values */ +#define UILLIST(uilptr) ((uilptr)->uil_list) + +NSPR_BEGIN_EXTERN_C + +/* Define functions in usi.c */ +extern USI_t * usiAlloc(USIList_t * uilptr, int count); +extern int usiInsert(USIList_t * uilptr, USI_t usi); +extern int usiPresent(USIList_t * uilptr, USI_t usi); +extern int usiRemove(USIList_t * uilptr, USI_t usi); +extern int uilDuplicate(USIList_t * dstptr, USIList_t * srcptr); +extern int uilMerge(USIList_t * dstptr, USIList_t * srcptr); + +NSPR_END_EXTERN_C + +#endif /* __usi_h */ diff --git a/include/libaccess/usrcache.h b/include/libaccess/usrcache.h new file mode 100644 index 00000000..646d1fd9 --- /dev/null +++ b/include/libaccess/usrcache.h @@ -0,0 +1,104 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ + +#ifndef ACL_USER_CACHE_H +#define ACL_USER_CACHE_H + +#ifdef NSPR20 +#include +#else +#include +#endif + +#include +#include +/* Removed for new ns security integration +#include +*/ +#include +#include +#include + +typedef struct { + PRCList list; /* pointer to next & prev obj */ + char *uid; /* unique within a database */ + char *userdn; /* LDAP DN if using LDAP db */ + char *passwd; /* password */ + SECItem *derCert; /* raw certificate data */ + char *group; /* group recently checked for membership */ + time_t time; /* last time when the cache was validated */ + PRHashTable *hashtable; /* hash table where this obj is being used */ +} UserCacheObj; + +NSPR_BEGIN_EXTERN_C + +/* Set the number of seconds the cache is valid */ +extern int acl_usr_cache_set_timeout (const int nsec); + +/* Is the cache enabled? */ +extern int acl_usr_cache_enabled(); + +/* initialize user cache */ +extern int acl_usr_cache_init (); + +/* Creates a new user obj entry */ +extern int acl_usr_cache_insert (const char *uid, const char *dbname, + const char *dn, const char *passwd, + const char *group, const SECItem *derCert, + const time_t time); + +/* Add group to the user's cache obj. */ +extern int acl_usr_cache_set_group (const char *uid, const char *dbname, + const char *group, const time_t time); + +/* Add userdn to the user's cache obj. */ +extern int acl_usr_cache_set_userdn (const char *uid, const char *dbname, + const char *userdn, const time_t time); + +/* Returns LAS_EVAL_TRUE if the user's password matches -- also returns the dn */ +extern int acl_usr_cache_passwd_check (const char *uid, const char *dbname, + const char *passwd, + const time_t time, char **dn, + pool_handle_t *pool); + +/* Returns LAS_EVAL_TRUE if the user is a member of the group */ +extern int acl_usr_cache_group_check (const char *uid, const char *dbname, + const char *group, const time_t time); + +/* Returns LAS_EVAL_TRUE if the user is a member of the group */ +extern int acl_usr_cache_group_len_check (const char *uid, const char *dbname, + const char *group, + const int len, + const time_t time); + +/* Returns LAS_EVAL_TRUE if the user's cache is valid and has a group */ +extern int acl_usr_cache_get_group (const char *uid, const char *dbname, + const time_t time, char **group, + pool_handle_t *pool); + +/* Returns LAS_EVAL_TRUE if the user is a member of the group */ +extern int acl_usr_cache_userdn_check (const char *uid, const char *dbname, + const char *userdn, const time_t time); + +/* Returns LAS_EVAL_TRUE if the user's cache is valid and has userdn */ +extern int acl_usr_cache_get_userdn (const char *uid, const char *dbname, + const time_t time, char **userdn, + pool_handle_t *pool); + +/* Creates a new user obj entry for cert to user mapping */ +extern int acl_cert_cache_insert (void *cert, const char *dbname, + const char *uid, const char *dn, + const time_t time); + +/* Returns LAS_EVAL_TRUE if the user's cache is valid and returns uid */ +extern int acl_cert_cache_get_uid (void *cert, const char *dbname, + const time_t time, char **uid, + char **dn, pool_handle_t *pool); + +NSPR_END_EXTERN_C + + +#endif /* ACL_USER_CACHE_H */ diff --git a/include/libadmin/dbtlibadmin.h b/include/libadmin/dbtlibadmin.h new file mode 100644 index 00000000..aa828d71 --- /dev/null +++ b/include/libadmin/dbtlibadmin.h @@ -0,0 +1,20 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ + +#define LIBRARY_NAME "libadmin" + +static char dbtlibadminid[] = "$DBT: libadmin referenced v1 $"; + +#include "i18n.h" + +BEGIN_STR(libadmin) + ResDef( DBT_LibraryID_, -1, dbtlibadminid )/* extracted from dbtlibadmin.h*/ + ResDef( DBT_help_, 1, " Help " )/*extracted from template.c*/ + ResDef( DBT_ok_, 2, " OK " )/*extracted from template.c*/ + ResDef( DBT_reset_, 3, " Reset " )/*extracted from template.c*/ + ResDef( DBT_done_, 4, " Done " )/*extracted from template.c*/ + ResDef( DBT_cancel_, 5, " Cancel " )/*extracted from template.c*/ +END_STR(libadmin) diff --git a/include/libadmin/libadmin.h b/include/libadmin/libadmin.h new file mode 100644 index 00000000..8fdd4fa2 --- /dev/null +++ b/include/libadmin/libadmin.h @@ -0,0 +1,1403 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/* + * libadmin.h - All functions contained in libadmin.a + * + * All blame goes to Mike McCool + */ + +#ifndef libadmin_h +#define libadmin_h + +#include +#include + +#include "base/systems.h" +#include "base/systhr.h" +#include "base/util.h" + +#include "frame/objset.h" +#include "frame/req.h" + +#ifdef XP_UNIX +#include +#else /* XP_WIN32 */ +#include +#endif /* XP_WIN32 */ + +#include "prinit.h" +#include "prthread.h" +#include "prlong.h" + +#define NSPR_INIT(Program) (PR_Init(PR_USER_THREAD, PR_PRIORITY_NORMAL, 8)) + +#undef howmany + +#define ADM_CONF "admin.conf" +#define MAGNUS_CONF "magnus.conf" +#define OBJ_DATABASE "obj.conf" +#define MIME_TYPES "mime.types" +#define NSADMIN_CONF "ns-admin.conf" +#define CERT_LOG "cert.log" + +#define SERVER_KEY_NAME "Server-Key" +#define SERVER_CERT_NAME "Server-Cert" + +#define DBPW_USER "admin" +#define DB_BAD_INPUT_CHARS "<>\"" +#define AUTHDB_ACL_FAIL -1 +#define AUTHDB_ACL_ODD_ACL -2 +#define AUTHDB_ACL_NOT_FOUND -3 + +#define ACLNAME_READ_COOKIE "formgen-READ-ACL" +#define ACLNAME_WRITE_COOKIE "formgen-WRITE-ACL" + +#define USERNAME_KEYWORD "USERNAME" + +typedef struct authInfo_s authInfo_t; +struct authInfo_s { + char *type; + char *db_path; + char *prompt; +}; + +/* Not defined in any nspr header file, why? */ +PRNetAddr *PR_CreateNetAddr(int PR_IpAddrNull, PRUint16 port); + +NSPR_BEGIN_EXTERN_C + +NSAPI_PUBLIC char *get_ip_and_mask(char *candidate); +NSAPI_PUBLIC int groupOrUser(char *dbname, char *name, + int *is_user, int *is_group); +NSAPI_PUBLIC int is_readacl(char *name); +NSAPI_PUBLIC int is_writeacl(char *name); +NSAPI_PUBLIC char *get_acl_file(void); /* Full path to file used by server. */ +NSAPI_PUBLIC char *get_workacl_file(void); /* Full path to file updated by ACL forms. */ +NSAPI_PUBLIC int get_acl_names(char **readaclname, + char **writeaclname, char *dir); +NSAPI_PUBLIC int get_acl_info(char *acl_file, char *acl_name, + void **acl_context, char ***hosts, + authInfo_t **authinfo, + char ***users, char ***userhosts, + int *fdefaultallow); +NSAPI_PUBLIC int set_acl_info(char *acl_file, char *acl_name, int prefix, + void **pacl, char **rights, + char **hosts, authInfo_t *authinfo, + char **users, char **userhosts, + int fdefaultallow); +NSAPI_PUBLIC int delete_acl_by_name(char *acl_file, char *acl_name); + +NSAPI_PUBLIC int str_flag_to_int(char *str_flag); +NSAPI_PUBLIC int admin_is_ipaddr(char *p); +NSAPI_PUBLIC void get_hostnames_and_ipaddrs(char **hosts, + char **hostnames, char **ipaddrs); +NSAPI_PUBLIC void load_host_array(char ***hosts, + char *hostnames, char *ipaddrs); +NSAPI_PUBLIC void load_users_array(char ***users, + char *usernames, char *groups); +NSAPI_PUBLIC void get_users_and_groups(char **users, char **usernames, + char **groups, char *dbname); +NSAPI_PUBLIC char * str_unquote(char * str); + +extern NSAPI_PUBLIC char *acl_read_rights[]; +extern NSAPI_PUBLIC char *acl_write_rights[]; + +#ifdef USE_ADMSERV +#define CONFDIR(x) get_conf_dir(x) +#define ACLDIR(x) get_acl_dir(x) +#define COMMDEST(x) get_commit_dest(x) +#define SERVER_NAMES getenv("SERVER_NAMES") +#define ADMCONFDIR getenv("ADMSERV_ROOT") +#else +#define ACLDIR(x) "../../httpacl/" +#define CONFDIR(x) "../config/" +#define ADMCONFDIR "../config/" +#endif + +#ifdef XP_UNIX +#define FILE_PATHSEP '/' +#define OPEN_MODE "r" +#define QUOTE "" +#define CONVERT_TO_NATIVE_FS(Filename) +#define CONVERT_TO_HTTP_FORMAT(Filename) +#define WSACleanup() + +#undef GET_QUERY_STRING +#define GET_QUERY_STRING() (getenv("QUERY_STRING")) +#define NOT_ABSOLUTE_PATH(str) (str[0] != '/') +#define CREATE_DIRECTORY(Directory) +#define FILE_LOCK_PATH (get_flock_path()) + +#else /* XP_WIN32 */ +#define verify_adm_dbm +#define add_user_dbm +#define find_user_dbm +#define list_users_dbm +#define modify_user_dbm +#define remove_user_dbm +#define dbm_open +#define dbm_close +#define dbm_store +#define lstat stat +#define popen _popen +#define pclose _pclose + +#define CONVERT_TO_NATIVE_FS(Filename) \ +{ \ + register char *s; \ + if (Filename) \ + for (s = Filename; *s; s++) \ + if ( *s == '/') \ + *s = '\\'; \ +} +#define CONVERT_TO_HTTP_FORMAT(Filename) \ +{ \ + register char *s; \ + if (Filename) \ + for (s = Filename; *s; s++) \ + if ( *s == '\\') \ + *s = '/'; \ +} +#define FILE_PATHSEP '/' +#define OPEN_MODE "r+b" +#define QUOTE "\"" + + +#undef GET_QUERY_STRING +#define GET_QUERY_STRING() (GetQueryNT()) +/* Defined in util.c */ +NSAPI_PUBLIC char *GetQueryNT(void); +#define NOT_ABSOLUTE_PATH(str) \ + ((str[0] != '/') && (str[0] != '\\') && (str[2] != '/') && (str[2] != '\\')) + +#define CREATE_DIRECTORY(Directory) CreateDirectory(Directory, NULL) +#define FILE_LOCK_PATH (get_flock_path()) + +#endif /* XP_WIN32 */ + + +/* error types */ +#define FILE_ERROR 0 +#define MEMORY_ERROR 1 +#define SYSTEM_ERROR 2 +#define INCORRECT_USAGE 3 +#define ELEM_MISSING 4 +#define REGISTRY_DATABASE_ERROR 5 +#define NETWORK_ERROR 6 +#define GENERAL_FAILURE 7 +#define WARNING 8 + +/* The upper bound on error types */ +#define MAX_ERROR 9 + +/* The default error type (in case something goes wrong */ +#define DEFAULT_ERROR 3 + +/* The change types for admin logging */ +#define TO_MAGNUS "magnus.conf" +#define TO_OBJCONF "obj.conf" +#define TO_ACLFILE "generated.acl" +#define TO_STATUS "status" +#define TO_ADMIN "admserv" +#define TO_USERDB "userdb" +#define TO_SEC "security" +#define TO_BACKUP "backup" +#define TO_CACHE "cache" +#define TO_BUCONF "bu.conf" +#define TO_LDAP "ldap" + +/* The indexes for conf file backup purposes */ +#define BK_MAGNUS 0 +#define BK_OBJ 1 +#define BK_MIMETYPES 2 +#define BK_BU 3 +#define BK_ACLFILE 4 + +/* The extension for backup files to use. Emacs weenies like "%s.~%d~" */ +/* But real vi men like this one */ +#define BACKUP_EXT "%s.v%d" +/* Need also a way to identify the backup files when we're doing an ls */ +#define BACKUP_SHORT ".v" + +/* User database defines */ +#define IS_A_DBM 1 +#define IS_A_NCSA 2 + +#define REMOVE_FROM_DB "-REMOVE_THIS_USER" +#define DB_INC "inc" +#define NCSA_EXT "pwf" + +/* We now use the client DB libs, so they're all '.db' with no second file. */ +#define DBM_EXT_1 "db" +#define DBM_EXT_2 NULL + +/* Define the functions in a central place so that obj.conf viewer can get + * to them */ +#ifdef MCC_PROXY +#define BASIC_NCSA_FN "proxy-auth" +#define REQUIRE_AUTH_FN "require-proxy-auth" +#define CHECK_ACL_FN "check-acl" +#else +#define BASIC_NCSA_FN "basic-ncsa" +#define REQUIRE_AUTH_FN "require-auth" +#define CHECK_ACL_FN "check-acl" +#endif + + +/* Frame window names. */ +#define INDEX_NAME "index" +#define MESSAGE_NAME "msgs" +#define TOP_NAME "tabs" +#define BOTTOM_NAME "category" +#define OPTIONS_NAME "options" +#define CONTENT_NAME "content" +#define COPY_NAME "copy" + +#define INFO_IDX_NAME "infowin" +#define INFO_TOPIC_NAME "infotopic" +#define HELP_WIN_OPTIONS "'resizable=1,width=500,height=500'" + + +/* pblock types, either it's a ppath, or it's a name. */ +#define PB_NAME 1 +#define PB_PATH 2 + +/* Resource types */ +#define NAME "name" +#define FILE_OR_DIR "path" +#define TEMPLATE "tmpl" +#define WILDCARD "wild" + +/* A really big form line */ +#define BIG_LINE 1024 + +/* Max size for a pathname */ +#ifndef PATH_MAX +#define PATH_MAX 256 +#endif + + +/* Boundary string for uploading / downloading config files. */ +#define CF_BOUNDARY "--Config_File_Boundary--" +#define CF_NEWCONFIG "--NewConfigFile:" +#define CF_MTIME "--LastMod:" +#define CF_ERRSTR "--Error: " +#define CFTRANS_BIN "bin/cftrans" +#define CF_REMOTE_URL "#RemoteUrl " + +#define HTML_ERRCOLOR "#AA0000" + +#define MOCHA_NAME "JavaScript" + +/* Internationalization stuffs. If we define MSG_RETURN, then create a + * function which will return a string of the given identifier. If we + * define MSG_DBM, it creates a function you can call to create the DBM + * properly. Finally, if nothing else, it will create a mapping from + * the string's name to its proper ID number. */ +/* store_msg is in mkdbm.c, in the admin stuff */ +/* get_msg.c */ +NSAPI_PUBLIC char *get_msg(int msgid); +NSAPI_PUBLIC void store_msg(int msgid, char *msg); + +#if defined(MSG_RETURN) +#define BGN_MSG(arg) static char *(arg)(int i) { switch(i) { +#define STR(name, id, msg) case (id): return(msg); +#define END_MSG(arg) } return 0; } + +#elif defined(MSG_DBM) +#define BGN_MSG(arg) void (arg)() { +#define STR(name, id, msg) store_msg(id, msg); +#define END_MSG(arg) } + +#else +#define BGN_MSG(arg) enum { +#define STR(name, id, msg) name=id, +#define END_MSG(arg) arg=0 }; +#endif + +/* The files where the messages are kept. */ +#define LA_BASE 1000 +#define LA_BASE_END 1999 +#define LA_DBM_LOC "./la_msgs" + +#define HADM_BASE 2000 +#define HADM_BASE_END 5999 +#define HADM_DBM_LOC "./hadm_msgs" + +#include "la_msgs.i" +#include "hadm_msgs.i" + +/* Initialize libadmin. Should be called by EVERY CGI. */ +/* util.c */ +NSAPI_PUBLIC int ADM_Init(void); + +/* Open a .html file to parse it. Returns a file ptr (simple fn, really) */ +/* error one doesn't call report_error so we lose the infinite loop prob */ +/* form_get.c */ +NSAPI_PUBLIC FILE *open_html_file(char *filename); +NSAPI_PUBLIC FILE *open_error_file(char *filename); + +/* Same as open_html_file, but opens the html file from the specified */ +/* language subdirectory, if available, else from the default language */ +/* subdirectory. */ +/* form_get.c */ +NSAPI_PUBLIC FILE* open_html_file_lang(char* filename,char* language); + +/* Parse an HTML file and return it to the client. */ +/* form_get.c */ +NSAPI_PUBLIC void return_html_file(char *filename); + +/* Parse an HTML file, return it to the client, but don't set the referer */ +/* form_get.c */ +NSAPI_PUBLIC void return_html_noref(char *filename); + +/* Output an input of an arbitrary type. Not really that flexible. */ +/* form_get.c */ +NSAPI_PUBLIC void output_input(char *type, char *name, char *value, char *other); + +/* Get the next line from the file. Returns 0 when EOF is encountered. */ +/* form_get.c */ +NSAPI_PUBLIC int next_html_line(FILE *f, char *line); + + + +/* Get the referer from the config file */ +/* referer.c */ +NSAPI_PUBLIC char *get_referer(char **config); + +/* Set the referer and write out the config file */ +/* referer.c */ +NSAPI_PUBLIC void set_referer(char **config); + +/* Sets the referer to a script that's not you. If new_ref is an absolute ref, + * it will cat that with SERVER_URL; if it's not, it will replace the + * current script name with new_ref. */ +/* referer.c */ +NSAPI_PUBLIC void set_fake_referer(char *new_ref); + +/* Redirect the person to the Referer, or give a short error message */ +/* referer.c */ +NSAPI_PUBLIC void redirect_to_referer(char *addition); + +/* Opens the referer in the content window using JavaScript */ +/* referer.c */ +NSAPI_PUBLIC void js_open_referer(void); + +/* Redirect to the given script. Assumes that SCRIPT_NAME is set to a script */ +/* referer.c */ +NSAPI_PUBLIC void redirect_to_script(char *script); + + +/* Filter a line using templates, and spit the results to stdout */ +/* template.c */ +NSAPI_PUBLIC int parse_line(char *line, char **input); + +/* Since everyone seems to be doing this independently, at least centralize + the code. Useful for onClicks and automatic help */ +NSAPI_PUBLIC char *helpJavaScript(); +NSAPI_PUBLIC char *helpJavaScriptForTopic( char *topic ); + +/* Check to see if a directive the parser didn't know about is a given + * directive */ +/* template.c */ +NSAPI_PUBLIC int directive_is(char *target, char *directive); + +/* Export the pageheader because sec-icrt uses it --MLM */ +/* template.c */ +NSAPI_PUBLIC void pageheader(char **vars, char **config); + + +/* Report an error. Takes 3 args: 1. Category of error + * 2. Some more specific category info (opt) + * 3. A short explanation of the error. + * + * report_warning: same thing except doesn't exit when done whining + */ +/* error.c */ +NSAPI_PUBLIC void output_alert(int type, char *info, char *details, int wait); +NSAPI_PUBLIC void report_error(int type, char *info, char *details); +NSAPI_PUBLIC void report_warning(int type, char *info, char *details); + +/* Read the administrative config from the server admin root */ +/* Mult adm gets a particular adm config (for multiple server config) */ +/* admconf.c */ +NSAPI_PUBLIC char **get_adm_config(void); +NSAPI_PUBLIC char **get_mult_adm_config(int whichone); + +/* Write the administrative config back to the file */ +/* Mult adm saves a particular adm config (for multiple server config) */ +/* admconf.c */ +NSAPI_PUBLIC int write_adm_config(char **config); +NSAPI_PUBLIC int write_mult_adm_config(int whichone, char **config); + +/* An additional level of abstraction for resource grabbing. Gets the current + * resource from the config set. */ +/* admconf.c */ +NSAPI_PUBLIC char *get_current_resource(char **config); + +/* Gets the string of the current resource type */ +/* admconf.c */ +NSAPI_PUBLIC char *get_current_typestr(char **config); + +/* Gets the pblock type of the current resource from the config set. */ +/* admconf.c */ +NSAPI_PUBLIC int get_current_restype(char **config); + +/* Sets the current resource given its type and its data. */ +/* admconf.c */ +NSAPI_PUBLIC void set_current_resource(char **config, char *nrestype, char *nres); + + +/* Get the value of a particular variable in magnus.conf */ +/* get_num_mag_var: get only a particular server's value for it */ +/* magconf.c */ +NSAPI_PUBLIC char *get_mag_var(char *var); +NSAPI_PUBLIC char *get_num_mag_var(int whichsrv, char *var); + +/* Set the value of a particular variable in magnus.conf */ +/* magconf.c */ +NSAPI_PUBLIC void set_mag_var(char *name, char *value); + +/* Get the value of a particular variable in cert.log */ +NSAPI_PUBLIC char *get_cert_var(char *var); +NSAPI_PUBLIC char *get_num_cert_var(int whichsrv, char *var); + +/* Set the value of a particular variable in cert.log */ +NSAPI_PUBLIC void set_cert_var(char *name, char *value); + +/* Get the value of a particular variable in ns-admin.conf */ +/* admserv.c */ +NSAPI_PUBLIC char *get_nsadm_var(char *var); +NSAPI_PUBLIC char **scan_server_instance(char *, char **); + + +/* Set the value of a particular variable in ns-admin.conf */ +/* admserv.c */ +NSAPI_PUBLIC void set_nsadm_var(char *name, char *value); + +/* List all of the installed servers on the admin server. */ +/* Takes 1 arg (string list of identifiers for servers, such as */ +/* httpd, https, proxy, news) */ +/* admserv.c */ +NSAPI_PUBLIC char **list_installed_servers(char **namelist); + +/* Reads in the list of servers installed on this machine. Fills in + * two string lists (one of names, one of descriptions.) *servlist and + * *desclist will be allocated for you. */ +NSAPI_PUBLIC void read_server_lst(char ***namelist, char ***desclist); +NSAPI_PUBLIC void read_keyalias_lst(char ***namelist); +NSAPI_PUBLIC void read_certalias_lst(char ***namelist); +NSAPI_PUBLIC void get_key_cert_files(char *alias, char **keyfile, char **certfile); +NSAPI_PUBLIC void display_aliases(char *keyfile, char **aliaslist); + +/* Create a new object (i.e. empty "" in the + * config files. */ +/* objconf.c */ +NSAPI_PUBLIC void add_object(int objtype, char *id); + +/* Destroy a given object and all its contents. */ +/* objconf.c */ +NSAPI_PUBLIC void delete_object(int objtype, char *id); + +/* Grab a given object */ +/* objconf.c */ +NSAPI_PUBLIC httpd_object *grab_object(int objtype, char *id); + +/* List all objects of the given type. */ +/* objconf.c */ +NSAPI_PUBLIC char **list_objects(int objtype); + +/* Count how many objects there are of the given type. */ +/* objconf.c */ +NSAPI_PUBLIC int count_objects(int objtype); + +/* Return the total number of objects in the configuration. */ +/* objconf.c */ +NSAPI_PUBLIC int total_object_count(void); + +/* Find a particular instance of a parameter in a particular object and a + * particular directive. id_type and id_value are optional parameter + * specifiers if you want not just the first instance of a function. + */ +/* objconf.c */ +NSAPI_PUBLIC pblock *grab_pblock(int objtype, char *object, char *directive, + char *function, char *id_type, char *id_value); + +/* Grab a pblock, but don't use the "fn" parameter. Instead of "fn", + * use the string "fname" to identify the block. */ +/* objconf.c */ +NSAPI_PUBLIC pblock *grab_pblock_byid(int objtype, char *object, char *directive, + char *fname, char *function, char *id_type, + char *id_value); + +/* Add a new parameter block into the given object, of the given directive + * type, using the given function, and with the list of parameters given + * (should be called like this:) + * + * add_pblock(PB_NAME, "default", "NameTrans", "pfx2dir", + * 4, "from", "/foo", "dir", "/bar"); + * Returns the new pblock for posterity + */ +/* objconf.c */ +NSAPI_PUBLIC pblock *add_pblock(int objtype, char *object, char *directive, char *function, + int nargs, ...); + +/* Create a new pblock, but don't save it or anything. */ +/* objconf.c */ +NSAPI_PUBLIC pblock *new_pblock(char *function, int nargs, ...); + +/* Destroy a paramter block. Same call patterns as grab_pblock. */ +/* objconf.c */ +NSAPI_PUBLIC void delete_pblock(int objtype, char *object, char *directive, char *function, + char *id_type, char *id_value); + +/* Set the values of a given pblock to these new values. Arg passing is same + * as for add_pblock() + */ +/* objconf.c */ +NSAPI_PUBLIC void set_pblock_vals(pblock *pb, int nargs, ...); + +/* List all the pblocks you can find with the given object, directive, and + * function. Returns a pointer to a list of pblock *'s just like a strlist. + */ +/* objconf.c */ +NSAPI_PUBLIC pblock **list_pblocks(int objtype, char *object, char *direct, char *function); + +/* Get the client pblock from a given directive, specified as above in + * grab_pblock. + */ +/* objconf.c */ +NSAPI_PUBLIC pblock *grab_client(int objtype, char *object, char *directive, + char *function, char *id_type, char *id_value); + +/* Add a client pblock to a given object. If you have a pblock, send it + * in oldpb, if not, send NULL and it will create one with a + * "PathCheck fn=deny-existence" directive for you. + * + * Send the nargs just like above; assumedly there's only two: client and ip. + */ +/* objconf.c */ +NSAPI_PUBLIC void add_client(int objtype, char *object, char *direct, + pblock *oldpb, int nargs, ...); + +/* List all the clients you can find with the given object, directive, and + * function. Returns a pointer to a list of directive *'s (struct with + * two pblock ptrs: param and client) + */ +/* objconf.c */ +NSAPI_PUBLIC directive **list_clients(int objtype, char *object, char *direct, + char *function); + +/* Delete a client, as identified by directive, path=blah in param part, + * dns=blah in client part, and ip=blah in client part. */ +/* objconf.c */ +NSAPI_PUBLIC void delete_client(int objtype, char *object, char *direct, char *path, + char *dns, char *ip); + +/* Gets the directive associated with a given pblock. */ +/* objconf.c */ +NSAPI_PUBLIC directive *get_pb_directive(int objtype, char *object, + char *directive, pblock *pb); +NSAPI_PUBLIC directive *get_cl_directive(int objtype, char *object, + char *directive, pblock *cl); + +/* Delete a pblock by its pointer. (Note: I should have done this function + * long ago. Grr. */ +/* objconf.c */ +NSAPI_PUBLIC void delete_pblock_byptr(int objtype, char *object, + char *directive, pblock *pb); + +/* Init directives are now in obj.conf, deal with them there. */ +/* ---------------------------------------------------------- */ + +/* Get the value of an init variable in pblock form. */ +/* objconf.c */ +NSAPI_PUBLIC pblock *get_mag_init(char *fn); + +/* Get only a particular mag init */ +/* objconf.c */ +NSAPI_PUBLIC pblock *get_specific_mag_init(char *fn, char *name, char *value); + +/* Get all instances of the same Init function as an array of pblock ptrs */ +/* objconf.c */ +NSAPI_PUBLIC pblock **get_all_mag_inits(char *fn); + +/* Set the value of an init variable. If it exists, modify existing, if not, + * create it. + * If the key_nam and key_val are set, also the parameter named key_val + * will be used when matching against the specific directive. This will + * allow multiple calls to the same Init function, with a specific parameter + * value together with the function name uniquely identifying the specific + * Init function call. + */ +/* objconf.c */ +NSAPI_PUBLIC void set_mag_init(char *fn, char *key_nam, char *key_val, int nargs, ...); + +/* Delete an instance of an Init variable. */ +/* objconf.c */ +NSAPI_PUBLIC void delete_mag_init(char *fn); +NSAPI_PUBLIC void delete_specific_mag_init(char *fn, char *key_nam, char *key_val); + + +/* Commit all outstanding config stuff from admin directory to the actual + * server. Does not restart the server. */ +/* Argument authlist is a string list of authorization strings + * (username:password) to send to remote servers (or NULL if it is a + * local machine.) */ +/* commit.c */ +NSAPI_PUBLIC int do_commit(char **authlist); + +/* Back out from outstanding changes. Authlist same as above. */ +/* commit.c */ +NSAPI_PUBLIC int do_undo(char **authlist); + +/* Prints outstanding changes to server to stdout. */ +/* commit.c */ +NSAPI_PUBLIC void output_uncommitted(void); + +/* Returns a flag saying whether there are outstanding changes that need to + * be committed. If you've already read in admin.conf, send a pointer to + * it here. Or else send NULL, and it'll read it in. */ +/* commit.c */ +NSAPI_PUBLIC int needs_commit(char **config); + +/* Sets the flag to say whether we need to commit or not. 1 means "yes, + * we need to commit." 0 means "No, I just committed the changes." + * whichsrv is which server to set the bit in (if you're configuring + * multiple servers.) */ +/* commit.c */ +NSAPI_PUBLIC void set_commit(int whichsrv, int needscommit); + +/* Returns an int for which backup number to use. 0=magnus, 1=obj*/ +/* index is which server among the list you want to use (mult config) */ +/* commit.c */ +NSAPI_PUBLIC int get_bknum(int which, int index); + +/* Sets the current backup number. */ +/* index is which server among the list you want to use. */ +/* commit.c */ +NSAPI_PUBLIC void set_bknum(int num, int which, int index); + +/* Backs up given file, using number in admconf. */ +/* commit.c */ +NSAPI_PUBLIC void conf_backup(char *whichfile, int index, int whichsrv); + +/* Gets the last known modification time for a config file. + * When you do a commit, this is set to the mod time after you do + * the commit. Later, when you want to see if the file you're about + * to upload has changed, you check this value. */ +/* commit.c */ +NSAPI_PUBLIC time_t get_org_mtime(int whichsrv, int whichfile); + +/* Gets and sets the three modification times as they were stored in + * admin.conf. */ +/* Useful in remote transactions. */ +/* commit.c */ +NSAPI_PUBLIC char *get_mtime_str(int whichsrv); +NSAPI_PUBLIC void set_mtime_str(int whichsrv, char *str); + +/* Sets that same value (see above) */ +/* commit.c */ +NSAPI_PUBLIC void set_org_mtime(int whichsrv, int whichfile, time_t mtime); + +/* Set the modification times for *all* of the files needing this check, + * assuming admin.conf got lost or hasn't been created yet. */ +/* When it doubt, set to zero. */ +NSAPI_PUBLIC void set_all_org_mtimes(void); + + +/* Create an internal list of the servers which are being changed. */ +/* Returns the total number of servers in the list. */ +/* multconf.c */ +NSAPI_PUBLIC int make_conflist(void); + +/* Don't use this function. It's a grotesque hack. It's used by the admin + * page to fake the on/off buttons for the servers. */ +/* multconf.c */ +NSAPI_PUBLIC int fake_conflist(char *fakename); + +/* Get the current admin config directory. Takes an int to say which one + * (of the list of servers to configure) you're interested in, so you can + * for loop through them. Always use 0 if you want the first one. */ +/* multconf.c */ +NSAPI_PUBLIC char *get_conf_dir(int whichone); +NSAPI_PUBLIC char *get_alias_dir(void); +NSAPI_PUBLIC void read_alias_files(char ***aliasfiles); +NSAPI_PUBLIC void read_aliases(char ***aliaslist); + +/* Return 1 if this server number whichone is a not on the local machine. */ +/* multconf.c */ +NSAPI_PUBLIC int is_remote_server(int whichone); + +/* Return 1 if we are configuring the admin server. */ +/* multconf.c */ +NSAPI_PUBLIC int is_admserv(void); + +/* Return 1 if there is a remote server in the list of servers to config. */ +/* Return 0 if not. */ +/* multconf.c */ +NSAPI_PUBLIC int remote_server_inlist(void); + +/* Get the ultimate destination for a particular config file set. Same + * arg as above function. */ +/* multconf.c */ +NSAPI_PUBLIC char *get_commit_dest(int whichone); + +/* Get the name of the indicated server (for logging purposes etc.) */ +/* Send -1 for a string with all of them. */ +/* multconf.c */ +NSAPI_PUBLIC char *get_srvname(int whichsrv); + + +/* Some simple buffering tools */ +/* Keeps a buffer for network info, and a buffer for returning lines */ +/* httpcon.c */ +typedef struct bufstruct { + char *buf; + int bufsize; + int curpos; + int inbuf; + char *hbuf; + int hbufsize; + int hbufpos; +} bufstruct; + +/* Make a new buffer. Flush the rest of a buffer (leaving the contents + * unread. Delete a buffer structure. */ +/* httpcon.c */ +NSAPI_PUBLIC bufstruct *new_buffer(int bufsize); +NSAPI_PUBLIC void flush_buffer(bufstruct *buf); +NSAPI_PUBLIC void delete_buffer(bufstruct *buf); + +/* stdio replacement for a network connection (so shoot me) */ +/* httpcon.c */ +NSAPI_PUBLIC char *get_line_from_fd(PRFileDesc *fd, bufstruct *buf); + +/* send a line to a remote server (equivalent to write()) */ +/* httpcon.c */ +NSAPI_PUBLIC int send_line_to_fd(PRFileDesc *fd, char *line, int linesize); + +/* Decompose a URL into protocol, server, port, and URI. You needn't allocate + * the strings you're passing, will be done for you. */ +/* httpcon.c */ +NSAPI_PUBLIC int decompose_url(char *url, char **protocol, char **server, unsigned int *port, char **uri); + +/* Take a status line "HTTP/1.0 200 OK" or some such and produce a protocol + * status number. */ +/* httpcon.c */ +NSAPI_PUBLIC int parse_status_line(char *statusline); + +/* Returns whether the headers have now ended (with the line you give it) */ +/* httpcon.c */ +NSAPI_PUBLIC int is_end_of_headers(char *hline); + +/* Make an HTTP request to a given server, running on a given port, + * with the given initial request. Returns a FD that can be used + * to read / write to the connection. */ +/* Note: Reports status to stdout in HTML form. Bad? Perhaps... */ +/* httpcon.c */ +NSAPI_PUBLIC PRFileDesc *make_http_request(char *protocol, char *server, unsigned int port, char *request, int *errcode); + +/* Terminate an HTTP request session (see above) */ +/* httpcon.c */ +NSAPI_PUBLIC void end_http_request(PRFileDesc *req_socket); + +/* Verify that given server is an admin server. */ +NSAPI_PUBLIC int verify_is_admin(char *protocol, char *server, int port); + + +/* Log a change in the verbose admin log. kind is a string representing + * what kind of change it was (see #defines at top of file, such as MAGNUS_LOG) + * Change is the text of the change, in printf format (so you can give args). */ +/* admlog.c */ +NSAPI_PUBLIC void log_change(char *kind, char *change, ...); + +/* Get a pretty string for the current resource for logging. */ +/* admlog.c */ +NSAPI_PUBLIC char *log_curres(char **config); + + +/* List all the user databases (actually, all files) in a given path into a + * strlist. */ +/* userdb.c */ +NSAPI_PUBLIC char **list_user_dbs(char *fullpath); + +NSAPI_PUBLIC char **list_auth_dbs(char *fullpath); + +/* Output the 1.x database selector. Path is the path to the DB's, element is + * the desired SELECT name, current is the one that should currently be + * selected. */ +/* userdb.c */ +NSAPI_PUBLIC void output_db_selector(char *path, char *element, char *current); + +/* Output the 2.x database selector. Path is the path to the DB's, element is + * the desired SELECT name, current is the one that should currently be + * selected. */ +NSAPI_PUBLIC void output_authdb_selector(char *path, char *element, char *current); + +/* Sets which DB is considered current. */ +/* userdb.c */ +NSAPI_PUBLIC void set_current_db(char *current); /* obsolete 1.x */ + +/* Sets which DB is considered current (2.x version). */ +NSAPI_PUBLIC void set_current_authdb(char *current); +NSAPI_PUBLIC char *get_current_authdb(void); + +/* Detect the type of the given database. */ +/* WARNING: REMOVES THE EXTENSION!!! */ +/* userdb.c */ +NSAPI_PUBLIC int detect_db_type(char *db_name); + +/* Find a user within an NCSA database, and return */ +/* userdb.c */ +NSAPI_PUBLIC char *find_user_ncsa(char *db, char *user); + +/* Add a user to an NCSA style database */ +/* userdb.c */ +NSAPI_PUBLIC void add_user_ncsa(char *db, char *user, char *password, int enc); + +/* List all the users in an NCSA style database */ +/* userdb.c */ +NSAPI_PUBLIC char **list_users_ncsa(char *db); + +/* Modify a user in an NCSA style database */ +/* userdb.c */ +NSAPI_PUBLIC int modify_user_ncsa(char *db, char *user, char *pw); + +/* Verify the admin password, or die. Returns 1 if there is one, 0 if not */ +/* userdb.c */ +NSAPI_PUBLIC int verify_adm_ncsa(char *db, char *pw); + +/* Remove a user from an NCSA style database */ +/* userdb.c */ +NSAPI_PUBLIC int remove_user_ncsa(char *db, char *user); + +#ifdef XP_UNIX /* WIN32 has no DBM */ +/* Find a user within a DBM database, and return */ +/* userdb.c */ +char *find_user_dbm(char *db, char *user); + +/* Add a user to a DBM database */ +/* userdb.c */ +void add_user_dbm(char *db, char *user, char *password, int enc); + +/* List all the users in a DBM */ +/* userdb.c */ +char **list_users_dbm(char *db); + +/* Modify a user in a DBM database */ +/* userdb.c */ +int modify_user_dbm(char *db, char *user, char *pw); + +/* Verify the admin password, or die. Returns 1 if there is one, 0 if not */ +/* userdb.c */ +int verify_adm_dbm(char *db, char *pw); + +/* Remove a user from a DBM */ +/* userdb.c */ +int remove_user_dbm(char *db, char *user); + +#endif /* WIN32 */ + + +/* Checks to see if server is running. Doesn't work over network. Returns 0 + * if it's down, 1 if it's up, -1 if an error occurred. */ +/* pcontrol.c */ +NSAPI_PUBLIC int is_server_running(int whichsrv); + +/* Starts up the HTTP server. Puts the errors into /tmp/startup.[pid] */ +/* Returns 0 on success, 1 on failure */ +/* Restart restarts it, shutdown shuts it down */ +/* pcontrol.c */ +NSAPI_PUBLIC int startup_http(int, char*, char *); +NSAPI_PUBLIC int restart_http(int, char*, char *); +NSAPI_PUBLIC int shutdown_http(int, char*); + +/* As above, but for SNMP HTTP subagent */ +/* pcontrol.c */ +NSAPI_PUBLIC int startup_snmp(); +NSAPI_PUBLIC int restart_snmp(); +NSAPI_PUBLIC int shutdown_snmp(); + +/* Performs the request rq, for server (in list) whichsrv, using auth as + * auth info. + * + * successmsg is the prefix on lines that are returned from the remote + * server that indicate success. */ +/* pcontrol.c */ +NSAPI_PUBLIC int perform_request(char *req, int whichsrv, char *auth, char *successmsg); + +/* Escapes a shell command for system() calls. NOTE: This string should + * be large enough to handle expansion!!!! */ +/* util.c */ +NSAPI_PUBLIC void escape_for_shell(char *cmd); + +/* Lists all files in a directory. If dashA list .files except . and .. */ +/* util.c */ +NSAPI_PUBLIC char **list_directory(char *path, int dashA); + +/* Does a given file exist? */ +/* util.c */ +NSAPI_PUBLIC int file_exists(char *filename); + +/* What's the size of a given file? */ +/* util.c */ +NSAPI_PUBLIC int get_file_size(char *path); + +/* Create a directory path if it does not exist (mkdir -p) */ +/* util.c */ +NSAPI_PUBLIC int ADM_mkdir_p(char *dir, int mode); + +/* Copy a directory recursively. */ +/* util.c */ +NSAPI_PUBLIC int ADM_copy_directory(char *src_dir, char *dest_dir); + +/* Remove a directory recursively. Same as remove_directory except that + filenames arent printed on stdout */ +/* util.c */ +NSAPI_PUBLIC void ADM_remove_directory(char *path); + +#ifdef XP_UNIX +/* Obtain Unix SuiteSpot user/group information */ +/* util.c */ +NSAPI_PUBLIC int ADM_GetUXSSid(char *, char **, char **); +#endif + +/* Return: LastModificationTime(f1) < LastModificationTime(f2) ? */ +/* util.c */ +NSAPI_PUBLIC int mtime_is_earlier(char *file1, char *file2); + +/* Return: the last mod time of fn */ +/* util.c */ +NSAPI_PUBLIC time_t get_mtime(char *fn); + +/* Does this string have all numbers? */ +/* util.c */ +NSAPI_PUBLIC int all_numbers(char *target); +/* Valid floating point number? */ +NSAPI_PUBLIC int all_numbers_float(char *target); + +/* Get the [ServerRoot]/config directory. */ +/* whichone is which server you're interested in. */ +/* 0 if you want the first one.*/ +/* util.c */ +NSAPI_PUBLIC char *get_admcf_dir(int whichone); + +/* Get the admin server's [ServerRoot]/config directory */ +NSAPI_PUBLIC char *get_admservcf_dir(void); + +/* Get the admin/userdb directory. */ +/* util.c */ +NSAPI_PUBLIC char *get_userdb_dir(void); +/* Get the V2.x admin/userdb directory. */ +/* util.c */ +NSAPI_PUBLIC char *get_authdb_dir(void); +NSAPI_PUBLIC char *get_httpacl_dir(void); + + +/* V2.x User admin functions. They take a full path of + the directory where the databases live, and perform + various operations on the databases. They open and + close the DBM, so they can not be called when the + database is already open. The output_xxx ones spit + out various HTMLized admin data. +*/ +NSAPI_PUBLIC int getfullname(char *dbname, char *user, char **fullname); +NSAPI_PUBLIC int setfullname(char *dbname, char *user, char *fullname); +NSAPI_PUBLIC int setpw(char *dbname, char *user, char *pwd); +NSAPI_PUBLIC int setdbpw(char *dbname, char *pwd); +NSAPI_PUBLIC int checkdbpw(char *dbname, char *pwd); +NSAPI_PUBLIC int addusertogroup(char *dbname, char *user, char *group); +NSAPI_PUBLIC int remuserfromgroup(char *dbname, char *user, char *group); +NSAPI_PUBLIC int addgrouptogroup(char *dbname, char *memgroup, char *group); +NSAPI_PUBLIC int remgroupfromgroup(char *dbname, char *memgroup, char *group); +NSAPI_PUBLIC int output_users_list(char *line, char *userfilter); +NSAPI_PUBLIC int output_groups_list(char *dbname, char *groupfilter); +NSAPI_PUBLIC void output_group_membership(char *dbname, char *user); +NSAPI_PUBLIC void output_nonmembership(char *dbname, char *user); +NSAPI_PUBLIC void output_grpgroup_membership(char *dbname, char *group, char *filter); +NSAPI_PUBLIC void output_user_membership(char *dbname, char *group, char *filter); +NSAPI_PUBLIC void output_nongrpgroup_membership(char *dbname, char *group, char *filter); +NSAPI_PUBLIC void output_nonuser_membership(char *dbname, char *group, char *filter); + +/* Set a user's login name */ +NSAPI_PUBLIC int setusername(char *db_path, char *user, char *newname); + +/* Output a selector box with name "name", an option "NONE" if none=1, + * and make it a multiple selector box if multiple=1. If multiple != 1, + * then make it a pulldown list if the number of groups is less than + * SELECT_OVERFLOW. */ +/* If highlight is non-null, specifically highlight that entry. */ +/* If user is non-null, and it's a multiple box, correctly set the group + * membership in the multiple list (Groups they're in are on, groups they're + * not in are off. */ +/* If group_user is one, then the variable "user" refers to *group* members, + * not *user* members. */ +/* If except is non-null, output all entries except the "except" item. */ +/* (note: this methodology is known as the "Garbage pail method", just + * keep adding parameters till it does everything you want) MLM */ +#define SELECT_OVERFLOW 25 +NSAPI_PUBLIC void output_group_selector(char *db_path, + int group_user, char *user, + char *highlight, char *except, + char *name, int none, int multiple); + +/* Same as above, except output a list of users, highlighting those in a + * particular group. MLM */ +NSAPI_PUBLIC void output_user_selector(char *db_path, char *group, + char *highlight, char *except, + char *name, int none, int multiple); + +/* Take a char ** null terminated list of group names, and change a user's + * memberships so those are the only groups he's in. MLM */ +NSAPI_PUBLIC void change_user_membership(char *db_path, char *user, + char **new_groups); + +/* Take a char ** null terminated list of group names, and change a user's + * memberships so those are the only groups he's in. MLM */ +/* If group_users is 1, then new_users are assumed to be groups. */ +NSAPI_PUBLIC void change_group_membership(char *db_path, char *group, + int group_users, char **new_users); + + +/* Get the server's URL. */ +/* util.c */ +NSAPI_PUBLIC char *get_serv_url(void); + +/* Run a command and check the output */ +struct runcmd_s { + char *title; + char *msg; + char *arg; + int sysmsg; +}; +/* util.c */ +NSAPI_PUBLIC int run_cmd(char *cmd, FILE *closeme, struct runcmd_s *rm); + +/* This is basically copy_file from the install section, with the error + * reporting changed to match the admin stuff. Since some stuff depends + * on copy_file being the install version, I'll cheat and call this one + * cp_file. */ +/* util.c */ +NSAPI_PUBLIC void cp_file(char *sfile, char *dfile, int mode); + +/* Delete the file with the given path. Returns positive value on failure.*/ +/* util.c */ +NSAPI_PUBLIC int delete_file(char *path); + +/* Delete the directory with the given path. Returns positive value on failure.*/ +/* BEWARE! Be sure to verify you're not deleting things you */ +/* shouldn't. Testing the directory with "util_uri_is_evil" */ +/* is often a good idea. */ +/* util.c */ +NSAPI_PUBLIC void remove_directory(char *path); + +/* Simply creates a directory that you give it. Checks for errors and + * all that. (Not to be confused with create_subdirs in install, since + * it relies on some installation stuff.) */ +/* util.c */ +NSAPI_PUBLIC void create_dir(char *dir, int mode); + +/* Open a file, with file locking. Close a file, releasing the lock. */ +/* util.c */ +NSAPI_PUBLIC FILE *fopen_l(char *pathname, char *mode); +NSAPI_PUBLIC void fclose_l(FILE *f); + +/* helper function to figure out where to put the lock */ +/* util.c */ +NSAPI_PUBLIC char *get_flock_path(void); + +/* uuencode a given buffer. both src and dst need to be allocated. dst + * should be 1 1/4 as big as src (i saved some math and just made it twice + * as big when I called it) */ +/* util.c */ +NSAPI_PUBLIC int do_uuencode(unsigned char *src, unsigned char *dst, int srclen); + +/* Word wrap a string to fit into a JavaScript alert box. */ +/* str is the string, width is the width to wrap to, linefeed is the string + * to use as a linefeed. */ +/* util.c */ +#define WORD_WRAP_WIDTH 80 +NSAPI_PUBLIC char *alert_word_wrap(char *str, int width, char *linefeed); + + +/* Writes the given object set as the current database */ +/* Takes an argument for which server in the list to dump to */ +/* ns-util.c */ +NSAPI_PUBLIC void dump_database(int whichsrv, httpd_objset *os); +NSAPI_PUBLIC void dump_database_tofile(int whichsrv, char *fn, httpd_objset *os); + +/* Scans the given database and returns its object set. */ +/* ns-util.c */ +NSAPI_PUBLIC httpd_objset *read_config_from_file(char *objconf); + +/* Scans the current database and returns its object set. */ +/* Takes a number for which server in multiple list to read */ +/* ns-util.c */ +NSAPI_PUBLIC httpd_objset *read_config(int x); + +/* Inserts a new pfx2dir name translation into the object, making sure there + * are no name conflicts. Name conflict resolution is simple: Keep the longest + * from fields first in the file. */ +/* ns-util.c */ +NSAPI_PUBLIC void insert_ntrans(pblock *p, pblock *c, httpd_object *obj); + +/* Inserts a new assign-name and mkssi-version into the object, making sure + * that they come first and are sorted. */ +NSAPI_PUBLIC void insert_ntrans_an(pblock *p, pblock *c, httpd_object *obj); + +/* Inserts a new mkssi-pcheck into the object, making sure that they come + * first and are sorted. */ +NSAPI_PUBLIC void insert_pcheck_mp(pblock *p, pblock *c, httpd_object *obj); + +/* Inserts a new alias in the database (before all other entries) */ +/* ns-util.c */ +NSAPI_PUBLIC void insert_alias(pblock *p, pblock *c, httpd_object *obj); + +/* Scans a file and puts all of its lines into a char * array. Strips + * trailing whitespace */ +/* ns-util.c */ +NSAPI_PUBLIC char **scan_tech(char *fn); + +/* Writes the lines to the given file */ +/* ns-util.c */ +NSAPI_PUBLIC int write_tech(char *fn, char **lines); + +/* Finds an object by its ppath */ +/* ns-util.c */ +NSAPI_PUBLIC httpd_object *findliteralppath(char *qs, httpd_objset *os); + + +/* Compares two passwords, one plaintext and one encrypted. Returns strcmp() + * like integer (0 good, anything else bad) */ +/* password.c */ +NSAPI_PUBLIC int pw_cmp(char *pw, char *enc); + +/* Encrypts a plaintext password. */ +/* password.c */ +NSAPI_PUBLIC char *pw_enc(char *pw); + + +/* Maintain what amounts to a handle to a list of strings */ +/* strlist.c */ +/* Moved to libadminutil, use libadminutil/admutil.h instead +NSAPI_PUBLIC char **new_strlist(int size); +NSAPI_PUBLIC char **grow_strlist(char **strlist, int newsize); +NSAPI_PUBLIC void free_strlist(char **strlist); +*/ + +/* Handle INN config.data which are now called nsnews.conf files */ +/* nsnews.c */ +char *find_nsnews_var(char *var, char **lines); +void set_nsnews_var(char *name, char *val, char **lines); +int find_nsnews_line(char *var, char **lines); +void remove_nsnews_var(char *name, char **lines); +void replace_nsnews_prefix(char *opfx, char *npfx, char **lines); + +char **scan_nsnews_admin(char *filename); +char **scan_nsnews_install(char *filename); +void nsnews_file2path_admin(char *filename, char *path); +void nsnews_file2path_install(char *filename, char *path); +void write_nsnews_admin(char *filename, char **lines); +void write_nsnews_install(char *filename, char **lines); + +void run_ctlinnd(char *cmd); +char **nsnews_status(void); +void set_moderator(char *group, char *email); +char *find_moderator(char *group, char **lines); +char **scan_active(char **nscnf); +int find_active_group(char *grp, char **active); +char *active_flags(char *line); +int active_groupmatch(char *grppat, char *line); +char **scan_expirectl(char *fn); +void write_expirectl(char *fn, char **lines); +void set_expire_remember(char *days, char **lines); +void set_expire_default(char *def, char *keep, char *purge, char **lines); + +#define EXPREM_STRING "/remember/:" +#define EXPREM_LEN 11 +#define EXPDEF_STRING "*:A:" +#define EXPDEF_LEN 4 + +#define find_expire_remember(lines) (find_expire_string(EXPREM_STRING, lines)) +#define find_expire_default(lines) (find_expire_string(EXPDEF_STRING, lines)) +char *find_expire_string(char *find, char **lines); + +typedef struct { + char *patterns; + char flag; + char *keep; + char *def; + char *purge; +} expire_s; +int expire_entry(char *line, expire_s *ret); +expire_s *expire_entry_default(char **lines); +expire_s *find_expire_entry(char *find, char **lines); +void new_expire_entry(expire_s *ex, char **lines); +void change_expire_entry(char *find, expire_s *ex, char **lines); +void remove_expire_entry(char *find, char **lines); + +typedef struct { + char *grp; + char *hostpats; + char *flags; + char *userpat; +} permission_s; +char **scan_nsaccess(char *fn); +void write_nsaccess(char *fn, char **lines); +permission_s *find_nsaccess_default(char **lines); +permission_s *find_nsaccess_entry(char *find, char **lines); +void new_nsaccess_entry(permission_s *ps, char **lines); +void change_nsaccess_entry(char *find, permission_s *ps, char **lines); +void remove_nsaccess_entry(char *find, char **lines); + +/* Handle newsfeeds files */ +void feed_read_file(); +void feed_write_file(); +char *feed_get_ind_var(int *x); +char *feed_get_host_var(char *host); +char *feed_get_newsgroups(char *feedline); +char *feed_get_param(char *feedline); +void feed_split_newsgroups(char *ngroups, char **allow, char **deny); +char *add_bangs(char *string); +void compress_whitespace(char *source); +char *feed_merge_newsgroups(char *allow_in, char *deny_in); +void feed_set_groups(char *host, char *groups); +void feed_set_entry(char *id, char *ngroups, char *feedtype, char *params); +void feed_delete_host(char *host); +void feed_dump_vars(char *feedtype, char *dest); + +void nnhost_add(char *hostname); +void nnhost_delete(char *hostname); + +void nnctl_add(char *hostname); +void nnctl_delete(char *hostname); + +int nsnews_running(char **nscnf); + + +#ifdef MCC_PROXY + +extern long inst_cache_size_tbl[]; +extern long inst_cache_capacity_tbl[]; +extern long cache_size_tbl[]; +extern long cache_capacity_tbl[]; +extern float lm_factor_tbl[]; +extern long time_interval_tbl[]; +extern long timeout_tbl[]; +extern int percent_tbl[]; + +char *mb_str(long mb); +char *lm_str(float f); + +void output_interval_select(char *name, char *other, long selected, long *tbl); +void output_mb_select(char *name, char *other, long selected, long *tbl); +void output_lm_select(char *name, char *other, float selected, float *tbl); +void output_percentage_select(char *name, char *other, int selected, int *tbl); + +#endif /* MCC_PROXY */ + +#ifdef MCC_NEWS + +char * get_active_news_authdb(char **nscnf); +void set_active_news_authdb(char *name, char **nscnf); +void output_active_news_authdb(char **nscnf); + +#endif /* MCC_NEWS */ + +#if 0 /* move cron_conf to libadminutil */ + +/* read and write to cron.conf, cron_conf.c */ +/* Alex Feygin, 3/22/96 */ +typedef struct cron_conf_obj +{ + char *name; + char *command; + char *dir; + char *user; + char *start_time; + char *days; +} +cron_conf_obj; + +typedef struct cron_conf_list +{ + char *name; + cron_conf_obj *obj; + struct cron_conf_list *next; +} +cron_conf_list; + +/* Reads cron.conf to a null terminated list of cron_conf_objects; returns + 0 if unable to do a read; 1 otherwise */ +NSAPI_PUBLIC int cron_conf_read(); + +/* gets a cron object, NULL if it doesnt exist */ +NSAPI_PUBLIC cron_conf_obj *cron_conf_get(char *name); + +/* returns a NULL-terminated cron_conf_list of all the cron conf objects */ +NSAPI_PUBLIC cron_conf_list *cron_conf_get_list(); + +/* Creates a cron conf object; all these args get STRDUP'd in the function + so make sure to free up the space later if need be */ +NSAPI_PUBLIC cron_conf_obj *cron_conf_create_obj(char *name, char *command, + char *dir, char *user, + char *start_time, char *days); + +/* Puts a cron conf object into list or updates it if it already in there. + Returns either the object passed or the object in there already; + cco may be FREE'd during this operation so if you need the object + back, call it like so: + + cco = cron_conf_set(cco->name, cco); + + calling cron_conf_set with a NULL cco will cause the 'name' object + to be deleted. +*/ +NSAPI_PUBLIC cron_conf_obj *cron_conf_set(char *name, cron_conf_obj *cco); + +/* write out current list of cron_conf_objects to cron.conf file */ +NSAPI_PUBLIC void cron_conf_write(); + +/* free all cron conf data structures */ +NSAPI_PUBLIC void cron_conf_free(); + + +#endif /* move cron_conf to libadminutil */ + + +/************************************************************************** + * This is should really be in base/file.h, but we don't want to tread on + * toes. + * Implement fgets without the error complaints the util_getline has. The + * calling function is smart enough to deal with partial lines. + * Also include a sleep that has the same functionality as Unix for NT. + *************************************************************************/ + +NSAPI_PUBLIC char *system_gets( char *, int, filebuffer * ); + +#ifdef XP_UNIX +NSAPI_PUBLIC int system_zero( SYS_FILE ); +#else /* XP_WIN32 */ +#define system_zero( f ) \ + SetFilePointer( PR_FileDesc2NativeHandle( f ), 0, NULL, FILE_BEGIN );\ + SetEndOfFile( PR_FileDesc2NativeHandle( f ) ) +#define sleep( t ) Sleep( (t) * 1000 ) +#endif /* XP_WIN32 */ + +NSAPI_PUBLIC char *cookieValue( char *, char * ); + +NSAPI_PUBLIC void jsPWDialogSrc( int inScript, char *otherJS ); + +NSAPI_PUBLIC int IsCurrentTemplateNSPlugin(char* templateName); + +/************************** Miscellaneous *************************/ +NSAPI_PUBLIC char * jsEscape(char *src); +NSAPI_PUBLIC int read_AbbrDescType_file(char *path, char ***namelist, char ***desclist); + +NSPR_END_EXTERN_C + +#endif /* libadmin_h */ diff --git a/include/netsite.h b/include/netsite.h new file mode 100644 index 00000000..278b1d14 --- /dev/null +++ b/include/netsite.h @@ -0,0 +1,312 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef NETSITE_H +#define NETSITE_H + +#ifndef NOINTNSAPI +#define INTNSAPI +#endif /* !NOINTNSAPI */ + +/* + * Standard defs for NetSite servers. + */ + +/* +** Macro shorthands for conditional C++ extern block delimiters. +** Don't redefine for compatability with NSPR. +*/ +#ifndef NSPR_BEGIN_EXTERN_C +#ifdef __cplusplus +#define NSPR_BEGIN_EXTERN_C extern "C" { +#define NSPR_END_EXTERN_C } +#else +#define NSPR_BEGIN_EXTERN_C +#define NSPR_END_EXTERN_C +#endif +#endif /* NSPR_BEGIN_EXTERN_C */ +#ifdef __cplusplus +#define EXTERNC extern "C" +#else +#define EXTERNC +#endif + +#ifndef VERSION_H +#include "version.h" +#endif /* !VERSION_H */ + +#ifndef BASE_SYSTEMS_H +#include "base/systems.h" +#endif /* !BASE_SYSTEMS_H */ + +#undef MAGNUS_VERSION_STRING + +#ifdef MCC_PROXY +#define MAGNUS_VERSION PROXY_VERSION_DEF +#define MAGNUS_VERSION_STRING PROXY_VERSION_STRING + +#elif defined(NS_CMS) +#define MAGNUS_VERSION CMS_VERSION_DEF +#define MAGNUS_VERSION_STRING CMS_VERSION_STRING + +#elif defined(NS_DS) +#define MAGNUS_VERSION DS_VERSION_DEF +#define MAGNUS_VERSION_STRING DS_VERSION_STRING + +#elif defined(MCC_ADMSERV) +#define MAGNUS_VERSION ADMSERV_VERSION_DEF +#define MAGNUS_VERSION_STRING ADMSERV_VERSION_STRING + +#elif defined(NS_CATALOG) +#define MAGNUS_VERSION CATALOG_VERSION_DEF +#define MAGNUS_VERSION_STRING CATALOG_VERSION_STRING + +#elif defined(NS_RDS) +#define MAGNUS_VERSION RDS_VERSION_DEF +#define MAGNUS_VERSION_STRING RDS_VERSION_STRING + +#elif defined(MCC_HTTPD) + +#ifdef NS_PERSONAL +#define MAGNUS_VERSION PERSONAL_VERSION_DEF +#else +#define MAGNUS_VERSION ENTERPRISE_VERSION_DEF +#endif + +#if defined(XP_UNIX) || defined(USE_ADMSERV) +#if defined(NS_DS) +#define MAGNUS_VERSION_STRING DS_VERSION_STRING +#elif defined(NS_PERSONAL) +#define MAGNUS_VERSION_STRING PERSONAL_VERSION_STRING +#elif defined(NS_CATALOG) +#define MAGNUS_VERSION_STRING CATALOG_VERSION_STRING +#elif defined(NS_RDS) +#define MAGNUS_VERSION_STRING RDS_VERSION_STRING +#elif defined(NS_CMS) +#define MAGNUS_VERSION_STRING CMS_VERSION_STRING +#else +#define MAGNUS_VERSION_STRING ENTERPRISE_VERSION_STRING +#endif +#endif /* XP_UNIX */ + +#elif defined(MCC_NEWS) +#define MAGNUS_VERSION_STRING NEWS_VERSION_STRING + +#elif defined(NS_MAIL) +#define MAGNUS_VERSION MAIL_VERSION_DEF +#define MAGNUS_VERSION_STRING MAIL_VERSION_STRING + +#elif defined(MCC_BATMAN) +#define MAGNUS_VERSION BATMAN_VERSION_DEF +#define MAGNUS_VERSION_STRING BATMAN_VERSION_STRING + +#endif + +#ifndef VOID +#define VOID void +#endif + +#ifdef XP_UNIX +/* + * Provide some typedefs that are commonly used on windows + * + * DO NOT USE THESE! They will be deleted later! + * + */ +#define CONST const +typedef unsigned long DWORD; +typedef int BOOL; +typedef unsigned char BYTE; +typedef unsigned short WORD; +typedef float FLOAT; +typedef FLOAT *PFLOAT; +typedef BOOL *PBOOL; +typedef BOOL *LPBOOL; +typedef BYTE *PBYTE; +typedef BYTE *LPBYTE; +typedef int *PINT; +typedef int *LPINT; +typedef WORD *PWORD; +typedef WORD *LPWORD; +typedef long *LPLONG; +typedef DWORD *PDWORD; +typedef DWORD *LPDWORD; +typedef void *LPVOID; + +#ifndef SNI +#if !defined (boolean) && !defined (__GNUC__) +typedef int boolean; +#endif +#endif + +#endif +#define NS_TRUE 1 +#define NS_FALSE 0 + +NSPR_BEGIN_EXTERN_C + +/* -------------------------- System version on NT------------------------- */ + +/* Encode the server version as a number to be able to provide inexpensive + * dynamic checks on server version - this isn't added in yet. */ + +#define ENTERPRISE_VERSION 1 +#define PERSONAL_VERSION 2 +#define CATALOG_VERSION 3 +#define RDS_VERSION 4 +#define CMS_VERSION 5 +#undef DS_VERSION +#define DS_VERSION 6 + +#define server_fasttrack (!strcmp(MAGNUS_VERSION_STRING, PERSONAL_VERSION_STRING)) +#define server_enterprise (!strcmp(MAGNUS_VERSION_STRING, ENTERPRISE_VERSION_STRING)) + +/* This definition of MAGNUS_VERSION_STRING on NT should be used + * only when building the ns-http DLL */ + +#if defined(MCC_HTTPD) && defined(XP_WIN32) && !defined(USE_ADMSERV) && !defined(MCC_ADMSERV) +#undef MAGNUS_VERSION_STRING +#define MAGNUS_VERSION_STRING INTsystem_version() +#endif /* XP_WIN32 */ + +/* Set server's version dynamically */ +NSAPI_PUBLIC void INTsystem_version_set(char *ptr); + +#ifndef APSTUDIO_READONLY_SYMBOLS + +/* Include the public netsite.h definitions */ +#ifndef PUBLIC_NETSITE_H +#ifdef MALLOC_DEBUG +#define NS_MALLOC_DEBUG +#endif /* MALLOC_DEBUG */ +#include "public/netsite.h" +#endif /* PUBLIC_NETSITE_H */ + +#endif /* !APSTUDIO_READONLY_SYMBOLS */ + +/* + * If NS_MALLOC_DEBUG is defined, declare the debug version of the memory + * allocation API. + */ +#ifdef NS_MALLOC_DEBUG +#define PERM_MALLOC(size) INTsystem_malloc_perm(size, __LINE__, __FILE__) +NSAPI_PUBLIC void *INTsystem_malloc_perm(int size, int line, char *file); + +#define PERM_CALLOC(size) INTsystem_calloc_perm(size, __LINE__, __FILE__) +NSAPI_PUBLIC void *INTsystem_calloc_perm(int size, int line, char *file); + +#define PERM_REALLOC(ptr, size) INTsystem_realloc_perm(ptr, size, __LINE__, __FILE__) +NSAPI_PUBLIC void *INTsystem_realloc_perm(void *ptr, int size, int line, char *file); + +#define PERM_FREE(ptr) INTsystem_free_perm((void *) ptr, __LINE__, __FILE__) +NSAPI_PUBLIC void INTsystem_free_perm(void *ptr, int line, char *file); + +#define PERM_STRDUP(ptr) INTsystem_strdup_perm(ptr, __LINE__, __FILE__) +NSAPI_PUBLIC char *INTsystem_strdup_perm(const char *ptr, int line, char *file); +#endif /* NS_MALLOC_DEBUG */ + +/* + * Only the mainline needs to set the malloc key. + */ + +void setThreadMallocKey(int key); + +/* This probably belongs somewhere else, perhaps with a different name */ +NSAPI_PUBLIC char *INTdns_guess_domain(char * hname); + +/* --- Begin public functions --- */ + +#ifdef INTNSAPI + +NSAPI_PUBLIC char *INTsystem_version(); + +/* + Depending on the system, memory allocated via these macros may come from + an arena. If these functions are called from within an Init function, they + will be allocated from permanent storage. Otherwise, they will be freed + when the current request is finished. + */ + +#define MALLOC(size) INTsystem_malloc(size) +NSAPI_PUBLIC void *INTsystem_malloc(int size); + +#define CALLOC(size) INTsystem_calloc(size) +NSAPI_PUBLIC void *INTsystem_calloc(int size); + +#define REALLOC(ptr, size) INTsystem_realloc(ptr, size) +NSAPI_PUBLIC void *INTsystem_realloc(void *ptr, int size); + +#define FREE(ptr) INTsystem_free((void *) ptr) +NSAPI_PUBLIC void INTsystem_free(void *ptr); + +#define STRDUP(ptr) INTsystem_strdup(ptr) +NSAPI_PUBLIC char *INTsystem_strdup(const char *ptr); + +/* + These macros always provide permanent storage, for use in global variables + and such. They are checked at runtime to prevent them from returning NULL. + */ + +#ifndef NS_MALLOC_DEBUG + +#define PERM_MALLOC(size) INTsystem_malloc_perm(size) +NSAPI_PUBLIC void *INTsystem_malloc_perm(int size); + +#define PERM_CALLOC(size) INTsystem_calloc_perm(size) +NSAPI_PUBLIC void *INTsystem_calloc_perm(int size); + +#define PERM_REALLOC(ptr, size) INTsystem_realloc_perm(ptr, size) +NSAPI_PUBLIC void *INTsystem_realloc_perm(void *ptr, int size); + +#define PERM_FREE(ptr) INTsystem_free_perm((void *) ptr) +NSAPI_PUBLIC void INTsystem_free_perm(void *ptr); + +#define PERM_STRDUP(ptr) INTsystem_strdup_perm(ptr) +NSAPI_PUBLIC char *INTsystem_strdup_perm(const char *ptr); + +#endif /* !NS_MALLOC_DEBUG */ + +/* Thread-Private data key index for accessing the thread-private memory pool. + * Each thread creates its own pool for allocating data. The MALLOC/FREE/etc + * macros have been defined to check the thread private data area with the + * thread_malloc_key index to find the address for the pool currently in use. + * + * If a thread wants to use a different pool, it must change the thread-local- + * storage[thread_malloc_key]. + */ + +NSAPI_PUBLIC int INTgetThreadMallocKey(void); + +/* Not sure where to put this. */ +NSAPI_PUBLIC void INTmagnus_atrestart(void (*fn)(void *), void *data); + +#endif /* INTNSAPI */ + +/* --- End public functions --- */ + +NSPR_END_EXTERN_C + +#define system_version_set INTsystem_version_set +#define dns_guess_domain INTdns_guess_domain + +#ifdef INTNSAPI + +#define system_version INTsystem_version +#define system_malloc INTsystem_malloc +#define system_calloc INTsystem_calloc +#define system_realloc INTsystem_realloc +#define system_free INTsystem_free +#define system_strdup INTsystem_strdup +#define system_malloc_perm INTsystem_malloc_perm +#define system_calloc_perm INTsystem_calloc_perm +#define system_realloc_perm INTsystem_realloc_perm +#define system_free_perm INTsystem_free_perm +#define system_strdup_perm INTsystem_strdup_perm +#define getThreadMallocKey INTgetThreadMallocKey +#define magnus_atrestart INTmagnus_atrestart + +#endif /* INTNSAPI */ + +#endif /* NETSITE_H */ diff --git a/include/nt/messages.h b/include/nt/messages.h new file mode 100644 index 00000000..d47a9fa5 --- /dev/null +++ b/include/nt/messages.h @@ -0,0 +1,410 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ + /* + Microsoft Developer Support + Copyright (c) 1992 Microsoft Corporation + + This file contains the message definitions for the Win32 + messages.exe sample program. +------------------------------------------------------------------------- + HEADER SECTION + + The header section defines names and language identifiers for use + by the message definitions later in this file. The MessageIdTypedef, + SeverityNames, FacilityNames, and LanguageNames keywords are + optional and not required. + + + + The MessageIdTypedef keyword gives a typedef name that is used in a + type cast for each message code in the generated include file. Each + message code appears in the include file with the format: #define + name ((type) 0xnnnnnnnn) The default value for type is empty, and no + type cast is generated. It is the programmer's responsibility to + specify a typedef statement in the application source code to define + the type. The type used in the typedef must be large enough to + accomodate the entire 32-bit message code. + + + + The SeverityNames keyword defines the set of names that are allowed + as the value of the Severity keyword in the message definition. The + set is delimited by left and right parentheses. Associated with each + severity name is a number that, when shifted left by 30, gives the + bit pattern to logical-OR with the Facility value and MessageId + value to form the full 32-bit message code. The default value of + this keyword is: + + SeverityNames=( + Success=0x0 + Informational=0x1 + Warning=0x2 + Error=0x3 + ) + + Severity values occupy the high two bits of a 32-bit message code. + Any severity value that does not fit in two bits is an error. The + severity codes can be given symbolic names by following each value + with :name + + + + The FacilityNames keyword defines the set of names that are allowed + as the value of the Facility keyword in the message definition. The + set is delimited by left and right parentheses. Associated with each + facility name is a number that, when shift it left by 16 bits, gives + the bit pattern to logical-OR with the Severity value and MessageId + value to form the full 32-bit message code. The default value of + this keyword is: + + FacilityNames=( + System=0x0FF + Application=0xFFF + ) + + Facility codes occupy the low order 12 bits of the high order + 16-bits of a 32-bit message code. Any facility code that does not + fit in 12 bits is an error. This allows for 4,096 facility codes. + The first 256 codes are reserved for use by the system software. The + facility codes can be given symbolic names by following each value + with :name + + + The LanguageNames keyword defines the set of names that are allowed + as the value of the Language keyword in the message definition. The + set is delimited by left and right parentheses. Associated with each + language name is a number and a file name that are used to name the + generated resource file that contains the messages for that + language. The number corresponds to the language identifier to use + in the resource table. The number is separated from the file name + with a colon. The initial value of LanguageNames is: + + LanguageNames=(English=1:MSG00001) + + Any new names in the source file which don't override the built-in + names are added to the list of valid languages. This allows an + application to support private languages with descriptive names. + + +------------------------------------------------------------------------- + MESSAGE DEFINITION SECTION + + Following the header section is the body of the Message Compiler + source file. The body consists of zero or more message definitions. + Each message definition begins with one or more of the following + statements: + + MessageId = [number|+number] + Severity = severity_name + Facility = facility_name + SymbolicName = name + + The MessageId statement marks the beginning of the message + definition. A MessageID statement is required for each message, + although the value is optional. If no value is specified, the value + used is the previous value for the facility plus one. If the value + is specified as +number then the value used is the previous value + for the facility, plus the number after the plus sign. Otherwise, if + a numeric value is given, that value is used. Any MessageId value + that does not fit in 16 bits is an error. + + The Severity and Facility statements are optional. These statements + specify additional bits to OR into the final 32-bit message code. If + not specified they default to the value last specified for a message + definition. The initial values prior to processing the first message + definition are: + + Severity=Success + Facility=Application + + The value associated with Severity and Facility must match one of + the names given in the FacilityNames and SeverityNames statements in + the header section. The SymbolicName statement allows you to + associate a C/C++ symbolic constant with the final 32-bit message + code. + */ +// +// Values are 32 bit values layed out as follows: +// +// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 +// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 +// +---+-+-+-----------------------+-------------------------------+ +// |Sev|C|R| Facility | Code | +// +---+-+-+-----------------------+-------------------------------+ +// +// where +// +// Sev - is the severity code +// +// 00 - Success +// 01 - Informational +// 10 - Warning +// 11 - Error +// +// C - is the Customer code flag +// +// R - is a reserved bit +// +// Facility - is the facility code +// +// Code - is the facility's status code +// +// +// Define the facility codes +// +#define FACILITY_SYSTEM 0x0 +#define FACILITY_STARTUP 0x5 +#define FACILITY_RUNTIME 0x1 +#define FACILITY_REGISTRY 0x7 +#define FACILITY_NETWORK 0x4 +#define FACILITY_SERVICE 0x3 +#define FACILITY_FILESYSTEM 0x6 +#define FACILITY_CGI 0x2 + + +// +// Define the severity codes +// +#define STATUS_SEVERITY_WARNING 0x2 +#define STATUS_SEVERITY_SUCCESS 0x0 +#define STATUS_SEVERITY_INFORMATIONAL 0x1 +#define STATUS_SEVERITY_ERROR 0x3 + + +// +// MessageId: MSG_BAD_CONF_INIT +// +// MessageText: +// +// Netsite:%1 %2 +// +#define MSG_BAD_CONF_INIT ((DWORD)0xC0050001L) + +// +// MessageId: MSG_BAD_EREPORT_INIT +// +// MessageText: +// +// Netsite:%1 %2 +// +#define MSG_BAD_EREPORT_INIT ((DWORD)0xC0050002L) + +// +// MessageId: MSG_BAD_STARTUP +// +// MessageText: +// +// Netsite:%1 %2 +// +#define MSG_BAD_STARTUP ((DWORD)0xC0050003L) + +// +// MessageId: MSG_BAD_WINSOCK_INIT +// +// MessageText: +// +// Netsite Initialization:%1 %2 +// +#define MSG_BAD_WINSOCK_INIT ((DWORD)0xC0050004L) + +// +// MessageId: MSG_BAD_CGISEM_CREATE +// +// MessageText: +// +// Netsite Initialization:%1 %2 +// +#define MSG_BAD_CGISEM_CREATE ((DWORD)0xC0050005L) + +// +// MessageId: MSG_BAD_PROCESSSEM_CREATE +// +// MessageText: +// +// Netsite:Initialization:%1 %2 +// +#define MSG_BAD_PROCESSSEM_CREATE ((DWORD)0xC0050006L) + +// +// MessageId: MSG_STARTUP_SUCCESSFUL +// +// MessageText: +// +// Netsite:%1 %2 +// +#define MSG_STARTUP_SUCCESSFUL ((DWORD)0x00050007L) + +// +// MessageId: MSG_BAD_REGISTRY_PARAMETER +// +// MessageText: +// +// Netsite:%1 %2 +// +#define MSG_BAD_REGISTRY_PARAMETER ((DWORD)0x80050008L) + +// +// MessageId: MSG_BAD_GENERAL_FUNCTION +// +// MessageText: +// +// Netsite:Execution of Initialization Function failed %1 %2 +// +#define MSG_BAD_GENERAL_FUNCTION ((DWORD)0xC0050009L) + +// +// MessageId: MSG_BAD_SETCIPHERS +// +// MessageText: +// +// Netsite: %1 %2 +// +#define MSG_BAD_SETCIPHERS ((DWORD)0xC0050010L) + +// +// MessageId: MSG_BAD_REGISTRY_KEY_OPEN +// +// MessageText: +// +// Netsite Initialization:Open of %1 %2 +// +#define MSG_BAD_REGISTRY_KEY_OPEN ((DWORD)0xC0050011L) + +// +// MessageId: MSG_BAD_REGISTRY_KEY_ENUM +// +// MessageText: +// +// Netsite Initialization:Enumeration of %1 %2 +// +#define MSG_BAD_REGISTRY_KEY_ENUM ((DWORD)0xC0050012L) + +// +// MessageId: MSG_BAD_REGISTRY_VALUE_ENUM +// +// MessageText: +// +// Netsite Initialization:Enumeration of Values of %1 %2 +// +#define MSG_BAD_REGISTRY_VALUE_ENUM ((DWORD)0xC0050013L) + +// +// MessageId: MSG_BAD_OBJECT_VALUE +// +// MessageText: +// +// Netsite startup:Use Values "name" or "ppath" for object key.Incorrect Parameter %1 %2 +// +#define MSG_BAD_OBJECT_VALUE ((DWORD)0xC0050014L) + +// +// MessageId: MSG_BAD_PBLOCK +// +// MessageText: +// +// Netsite startup:Could not enter Parameter %1 %2 +// +#define MSG_BAD_PBLOCK ((DWORD)0xC0050015L) + +// +// MessageId: MSG_BAD_CLIENT_VALUE +// +// MessageText: +// +// Netsite startup:Use Values "dns" or "ip" for client key.Incorrect Parameter %1 %2 +// +#define MSG_BAD_CLIENT_VALUE ((DWORD)0xC0050016L) + +// +// MessageId: MSG_BAD_DIRECTIVE +// +// MessageText: +// +// Netsite startup:Incorrect Directive Value %1 %2 +// +#define MSG_BAD_DIRECTIVE ((DWORD)0xC0050017L) + +// +// MessageId: MSG_BAD_PARAMETER +// +// MessageText: +// +// Netsite startup:Incorrect Parameter %1 %2 +// +#define MSG_BAD_PARAMETER ((DWORD)0xC0050018L) + +// +// MessageId: MSG_WD_RESTART +// +// MessageText: +// +// Web Server: %1 +// The server terminated abnormally with error code %2. +// An attempt will be made to restart it. +// +#define MSG_WD_RESTART ((DWORD)0xC0050019L) + +// +// MessageId: MSG_WD_STARTFAILED +// +// MessageText: +// +// Web Server: %1 +// The server could not be started. +// Command line used: %2 +// +#define MSG_WD_STARTFAILED ((DWORD)0xC005001AL) + +// +// MessageId: MSG_WD_BADPASSWORD +// +// MessageText: +// +// Web Server: %1 +// Incorrect SSL password entered. +// +#define MSG_WD_BADPASSWORD ((DWORD)0xC005001BL) + +// +// MessageId: MSG_WD_BADCMDLINE +// +// MessageText: +// +// Web Server: %1 +// Invalid command line specified: %2 +// +#define MSG_WD_BADCMDLINE ((DWORD)0xC005001CL) + +// +// MessageId: MSG_WD_STRING +// +// MessageText: +// +// Web Server: %1 +// %2 +// +#define MSG_WD_STRING ((DWORD)0xC005001DL) + +// +// MessageId: MSG_WD_REGISTRY +// +// MessageText: +// +// Web Server: %1 +// Could not open registry key: %2 +// +#define MSG_WD_REGISTRY ((DWORD)0xC005001EL) + +// +// MessageId: MSG_CRON_STARTFAILED +// +// MessageText: +// +// Web Server: %1 +// The scheduled job (%2) could not be started. +// +#define MSG_CRON_STARTFAILED ((DWORD)0xC005001FL) + diff --git a/include/nt/nsapi.h b/include/nt/nsapi.h new file mode 100644 index 00000000..f286dc1f --- /dev/null +++ b/include/nt/nsapi.h @@ -0,0 +1,346 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/* + * Aruna Victor + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +typedef void * (SafFunction)(); +SafFunction **SafTable; +__declspec(dllexport) int InitSafTable(SafFunction *Table); + +/* Functions from ntbuffer.c */ + +#define FILEBUF_OPEN 1 +#define NETBUF_OPEN 2 +#define FILEBUF_OPEN_NOSTAT 3 + +#define PIPEBUF_OPEN 4 +#define PIPEBUF_CLOSE 5 +#define FILEBUF_NEXT 6 +#define NETBUF_NEXT 7 + +#define PIPEBUF_NEXT 8 +#define FILEBUF_CLOSE 9 +#define NETBUF_CLOSE 10 +#define FILEBUF_GRAB 11 +#define NETBUF_GRAB 12 +#define PIPEBUF_GRAB 13 +#define NETBUF_BUF2SD 14 +#define FILEBUF_BUF2SD 15 + +#define PIPEBUF_BUF2SD 16 +#define PIPEBUF_NETBUF2SD 17 + +/* Functions from daemon.h */ + +#define NTDAEMON_RUN 18 +#define CHILD_STATUS 19 + +/* Functions from file.h */ +#define SYSTEM_FREAD 20 +#define SYSTEM_PREAD 21 +#define SYSTEM_FOPENRO 22 +#define SYSTEM_FOPENWA 23 +#define SYSTEM_FOPENRW 24 +#define SYSTEM_FCLOSE 25 +#define SYSTEM_NOCOREDUMPS 26 +#define SYSTEM_FWRITE 27 +#define SYSTEM_FWRITE_ATOMIC 28 +#define SYSTEM_WINERR 29 +#define SYSTEM_WINSOCKERR 30 +#define FILE_NOTFOUND 31 +#define SYSTEM_STAT 32 +#define SYSTEM_INITLOCK 33 + +#define FILE_UNIX2LOCAL 34 +#define DIR_OPEN 35 +#define DIR_READ 36 +#define DIR_CLOSE 37 + +/* Functions from sem.h */ +#define SEM_INIT 40 +#define SEM_TERMINATE 41 +#define SEM_GRAB 42 +#define SEM_TGRAB 43 +#define SEM_RELEASE 44 + +/* Functions from session.h */ +#define SESSION_CREATE 45 +#define SESSION_FREE 46 +#define SESSION_DNS_LOOKUP 47 + +/* Functions from cinfo.h */ +#define CINFO_INIT 70 +#define CINFO_TERMINATE 71 +#define CINFO_MERGE 72 +#define CINFO_FIND 73 +#define CINFO_LOOKUP 74 +#define CINFO_DUMP_DATABASE 75 + +/* Functions from ereport.h */ +#define EREPORT 80 +#define EREPORT_INIT 81 +#define EREPORT_TERMINATE 82 +#define EREPORT_GETFD 83 + +/* Functions from minissl.h */ +#define SSL_CLOSE 90 +#define SSL_SOCKET 91 +#define SSL_GET_SOCKOPT 92 +#define SSL_SET_SOCKOPT 93 +#define SSL_BIND 94 +#define SSL_LISTEN 95 +#define SSL_ACCEPT 96 +#define SSL_READ 97 +#define SSL_WRITE 98 +#define SSL_GETPEERNAME 99 + +/* Functions from net.h */ +#define NET_BIND 110 +#define NET_READ 111 +#define NET_WRITE 112 + +#define NET_FIND_FQDN 113 +#define NET_IP2HOST 114 +#define NET_SENDMAIL 115 + +/* Functions from pblock.h */ +#define PARAM_CREATE 120 +#define PARAM_FREE 121 +#define PBLOCK_CREATE 122 +#define PBLOCK_FREE 123 +#define PBLOCK_FINDVAL 124 +#define PBLOCK_NVINSERT 125 +#define PBLOCK_NNINSERT 126 +#define PBLOCK_PINSERT 127 +#define PBLOCK_STR2PBLOCK 128 +#define PBLOCK_PBLOCK2STR 129 +#define PBLOCK_COPY 130 +#define PBLOCK_PB2ENV 131 +#define PBLOCK_FR 132 + +/* Functions from systhr.h */ +#define SYSTHREAD_START 133 +#define SYSTHREAD_ATTACH 134 +#define SYSTHREAD_TERMINATE 135 +#define SYSTHREAD_SLEEP 136 +#define SYSTHREAD_INIT 137 +#define SYSTHREAD_NEWKEY 138 +#define SYSTHREAD_GETDATA 139 +#define SYSTHREAD_SETDATA 140 + +/* Functions from shmem.h */ +#define SHMEM_ALLOC 141 +#define SHMEM_FREE 142 + +/* Functions from eventlog.h */ +#define INITIALIZE_ADMIN_LOGGING 143 +#define INITIALIZE_HTTPD_LOGGING 144 +#define INITIALIZE_HTTPS_LOGGING 145 + +#define TERMINATE_ADMIN_LOGGING 146 +#define TERMINATE_HTTPD_LOGGING 147 +#define TERMINATE_HTTPS_LOGGING 148 + +#define LOG_ERROR_EVENT 149 + +/* Functions from shexp.h */ +#define SHEXP_VALID 160 +#define SHEXP_MATCH 161 +#define SHEXP_CMP 162 +#define SHEXP_CASECMP 163 + +/* Functions from systems.h */ +#define UTIL_STRCASECMP 170 +#define UTIL_STRNCASECMP 171 + +/* Functions from util.h */ +#define UTIL_GETLINE 180 +#define UTIL_ENV_CREATE 181 +#define UTIL_ENV_STR 182 +#define NTUTIL_ENV_STR 183 +#define UTIL_ENV_REPLACE 184 +#define UTIL_ENV_FREE 185 +#define UTIL_ENV_FIND 186 +#define UTIL_HOSTNAME 187 +#define UTIL_CHDIR2PATH 188 +#define UTIL_IS_MOZILLA 189 +#define UTIL_IS_URL 190 +#define UTIL_LATER_THAN 191 +#define UTIL_URI_IS_EVIL 192 +#define UTIL_URI_PARSE 193 +#define UTIL_URI_UNESCAPE 194 +#define UTIL_URI_ESCAPE 195 +#define UTIL_URL_ESCAPE 196 +#define UTIL_SH_ESCAPE 197 +#define UTIL_ITOA 198 +#define UTIL_VSPRINTF 199 +#define UTIL_SPRINTF 200 +#define UTIL_VSNPRINTF 201 +#define UTIL_SNPRINTF 202 + +/* Functions from magnus.h */ +#define MAGNUS_ATRESTART 203 + +/* Functions from conf.h */ +#define CONF_INIT 207 +#define CONF_TERMINATE 208 +#define CONF_GETGLOBALS 209 +#define CONF_VARS2DAEMON 210 + +/* Functions from req.h */ +#define REQUEST_CREATE 211 +#define REQUEST_FREE 212 +#define REQUEST_RESTART_INTERNAL 213 +#define REQUEST_TRANSLATE_URI 214 +#define REQUEST_HEADER 215 +#define REQUEST_STAT_PATH 216 +#define REQUEST_URI2PATH 217 +#define REQUEST_PATHCHECKS 218 +#define REQUEST_FILEINFO 219 +#define REQUEST_HANDLE_PROCESSED 220 +#define REQUEST_SERVICE 221 +#define REQUEST_HANDLE 222 + +/* Functions from object.h */ +#define DIRECTIVE_NAME2NUM 223 +#define DIRECTIVE_NUM2NAME 224 +#define OBJECT_CREATE 225 +#define OBJECT_FREE 226 +#define OBJECT_ADD_DIRECTIVE 227 +#define OBJECT_EXECUTE 228 + +/* Functions from objset.h */ +#define OBJSET_SCAN_BUFFER 230 +#define OBJSET_CREATE 231 +#define OBJSET_FREE 232 +#define OBJSET_FREE_SETONLY 233 +#define OBJSET_NEW_OBJECT 234 +#define OBJSET_ADD_OBJECT 235 +#define OBJSET_FINDBYNAME 236 +#define OBJSET_FINDBYPPATH 237 + +/* Functions from http.h */ +#define HTTP_PARSE_REQUEST 240 +#define HTTP_SCAN_HEADERS 241 +#define HTTP_START_RESPONSE 242 +#define HTTP_HDRS2_ENV 243 +#define HTTP_STATUS 244 +#define HTTP_SET_FINFO 245 +#define HTTP_DUMP822 246 +#define HTTP_FINISH_REQUEST 247 +#define HTTP_HANDLE_SESSION 248 +#define HTTP_URI2URL 249 + +/* Functions from func.h */ +#define FUNC_INIT 251 +#define FUNC_FIND 252 +#define FUNC_EXEC 253 +#define FUNC_INSERT 254 + +/* Functions from log.h */ +#define LOG_ERROR 260 + +/* robm Functions added in 2.0 */ +#define SYSTEM_FOPENWT 261 +#define SYSTEM_MALLOC 262 +#define SYSTEM_FREE 263 +#define SYSTEM_REALLOC 264 +#define SYSTEM_STRDUP 265 + +#define UPLOAD_FILE 266 + +#define CRIT_INIT 267 +#define CRIT_ENTER 268 +#define CRIT_EXIT 269 +#define CRIT_TERMINATE 270 +#define SYSTHREAD_CURRENT 271 + +#define NET_ACCEPT 272 +#define NET_CLOSE 273 +#define NET_CONNECT 274 +#define NET_IOCTL 275 +#define NET_LISTEN 276 +#define NET_SETSOCKOPT 277 +#define NET_SOCKET 278 + +/* Daryoush Functions added in 3.0 */ +#define NSORB_INIT 279 +#define NSORB_INST_ID 280 +#define NSORB_GET_INST 281 +#define NSORB_REG_INT 282 +#define NSORB_FIND_OBJ 283 +#define NSORB_GET_INTERFACE 284 + +#define ARR_NEW 285 +#define ARR_FREE 286 +#define ARR_GET_OBJ 288 +#define ARR_GET_LAST_OBJ 289 +#define ARR_NEW_OBJ 290 +#define ARR_GET_NUM_OBJ 291 +#define ARR_RESET 292 +#define ARR_REMOVEOBJ 293 +#define ARR_GET_OBJ_NUM 294 + +#define CM_BT_NEW 295 +#define CM_BT_ADD_NODE 296 +#define CM_BT_FIND_NODE 297 +#define CM_BT_DEL_NODE 298 +#define CM_BT_DESTROY 299 +#define CM_BT_GET_NUM 300 +#define CM_BT_TRAVEL 301 + +#define CM_STR_NEW 302 +#define CM_STR_ADD 303 +#define CM_STR_REL 304 +#define CM_STR_FREE 305 +#define CM_STR_GET 306 +#define CM_STR_SIZE 307 +#define CM_COPY_STR 308 +#define CM_MAKE_UID 309 + +#define MS_NEW 310 +#define MS_CREATE 311 diff --git a/include/nt/ntos.h b/include/nt/ntos.h new file mode 100644 index 00000000..dce0efa0 --- /dev/null +++ b/include/nt/ntos.h @@ -0,0 +1,155 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/********************************************************************** + * ntOS.h - functionality used bt NT Operating System + * + **********************************************************************/ + +#ifndef _ntos_h +#define _ntos_h + + +#ifdef __cplusplus +extern "C" { /* Assume C declarations for C++ */ +#endif /* __cplusplus */ + +#ifdef ISHIELD_DLL +#define NS_WINAPI WINAPI +#else +#define NS_WINAPI +#endif + +/* prototypes for info.c */ +typedef enum { + OS_WIN95, + OS_WINNT, + OS_WIN32S, + OS_UNKNOWN +} OS_TYPE; + +typedef enum { + PROCESSOR_I386, + PROCESSOR_ALPHA, + PROCESSOR_MIPS, + PROCESSOR_PPC, + PROCESSOR_UNKNOWN +} PROCESSOR_TYPE; + +OS_TYPE NS_WINAPI INFO_GetOperatingSystem (); +DWORD NS_WINAPI INFO_GetOSMajorVersion (); +DWORD NS_WINAPI INFO_GetOSMinorVersion (); +void NS_WINAPI OS_GetComputerName (LPTSTR computerName, int nComputerNameLength ); +PROCESSOR_TYPE NS_WINAPI OS_GetProcessor (); +DWORD NS_WINAPI INFO_GetOSServicePack (); + + +/* prototypes for path.c */ +DWORD NS_WINAPI PATH_RemoveRelative ( char * path ); +DWORD NS_WINAPI PATH_ConvertNtSlashesToUnix( LPCTSTR lpszNtPath, LPSTR lpszUnixPath ); +DWORD NS_WINAPI PATH_GetNextFileInDirectory ( long hFile, char * path, char * lpFileName ); +DWORD NS_WINAPI PATH_GetNextSubDirectory( long hFile, char * path, char * lpSubDirectoryName, char * lpSubDirectoryPrefix ); +DWORD NS_WINAPI PATH_DeleteRecursively ( char * path ); + + +/* prototypes for registry.c */ +BOOL NS_WINAPI REG_CheckIfKeyExists( HKEY hKey, LPCTSTR registryKey ); +BOOL NS_WINAPI REG_CreateKey( HKEY hKey, LPCTSTR registryKey ); +BOOL NS_WINAPI REG_DeleteKey( HKEY hKey, LPCTSTR registryKey ); +BOOL NS_WINAPI REG_DeleteValue( HKEY hKey, LPCTSTR registryKey, LPCSTR valueName ); + +BOOL NS_WINAPI +REG_GetRegistryParameter( + HKEY hKey, + LPCTSTR registryKey, + LPTSTR QueryValueName, + LPDWORD ValueType, + LPBYTE ValueBuffer, + LPDWORD ValueBufferSize + ); + +BOOL NS_WINAPI +REG_SetRegistryParameter( + HKEY hKey, + LPCTSTR registryKey, + LPTSTR valueName, + DWORD valueType, + LPCTSTR ValueString, + DWORD valueStringLength + ); + +BOOL NS_WINAPI +REG_GetSubKeysInfo( + HKEY hKey, + LPCTSTR registryKey, + LPDWORD lpdwNumberOfSubKeys, + LPDWORD lpdwMaxSubKeyLength + ); + +BOOL NS_WINAPI +REG_GetSubKey( HKEY hKey, + LPCTSTR registryKey, + DWORD nSubKeyIndex, + LPTSTR registrySubKeyBuffer, + DWORD subKeyBufferSize + ); + +/* prototypes for service.c */ +#define SERVRET_ERROR 0 +#define SERVRET_INSTALLED 1 +#define SERVRET_STARTING 2 +#define SERVRET_STARTED 3 +#define SERVRET_STOPPING 4 +#define SERVRET_REMOVED 5 + +DWORD NS_WINAPI SERVICE_GetNTServiceStatus(LPCTSTR szServiceName, LPDWORD lpLastError ); +DWORD NS_WINAPI SERVICE_InstallNTService(LPCTSTR szServiceName, LPCTSTR szServiceDisplayName, LPCTSTR szServiceExe ); +DWORD NS_WINAPI SERVICE_ReinstallNTService(LPCTSTR szServiceName, LPCTSTR szServiceDisplayName, LPCTSTR szServiceExe ); +DWORD NS_WINAPI SERVICE_RemoveNTService(LPCTSTR szServiceName); +DWORD NS_WINAPI SERVICE_StartNTService(LPCTSTR szServiceName); +DWORD NS_WINAPI SERVICE_StartNTServiceAndWait(LPCTSTR szServiceName, LPDWORD lpdwLastError); +DWORD NS_WINAPI SERVICE_StopNTService(LPCTSTR szServiceName); +DWORD NS_WINAPI SERVICE_StopNTServiceAndWait(LPCTSTR szServiceName, LPDWORD lpdwLastError); + + +/* prototypes for pmddeml.c */ +DWORD PMDDEML_Open ( void ); +BOOL PMDDEML_Close ( DWORD idInst ); +BOOL PMDDEML_CreateProgramManagerGroup ( DWORD idInst, LPCTSTR lpszGroupName ); +BOOL PMDDEML_DeleteProgramManagerGroup ( DWORD idInst, LPCTSTR lpszGroupName ); +BOOL PMDDEML_ShowProgramManagerGroup ( DWORD idInst, LPCTSTR lpszGroupName ); +BOOL PMDDEML_AddIconToProgramManagerGroup ( DWORD idInst, LPCTSTR lpszCmdLine, + LPCTSTR lpszTitle, LPCTSTR lpszIconPath, LPCTSTR lpszWorkingDir, + BOOL bReplace ); +BOOL PMDDEML_CreateProgramManagerCommonGroup ( DWORD idInst, + LPCTSTR lpszGroupName ); +BOOL PMDDEML_DeleteProgramManagerCommonGroup ( DWORD idInst, + LPCTSTR lpszGroupName ); +BOOL PMDDEML_ShowProgramManagerCommonGroup ( DWORD idInst, + LPCTSTR lpszGroupName ); +BOOL PMDDEML_DeleteIconInProgramManagerGroup ( DWORD idInst, LPCTSTR lpszTitle ); +BOOL PMDDEML_GetProgramGroupInfo(DWORD idInst, LPSTR lpProgramGroup, char *szBuffer, DWORD cbBuffer); + +/* prototypes for tcpip.c */ +#define TCPIP_NO_ERROR 0 +#define TCPIP_UNSUPPORTED_OS 1 +#define TCPIP_NO_WINSOCK_DLL 2 +#define TCPIP_NO_TCPIP 3 +#define TCPIP_NETWORK_DOWN 4 /* The Windows Sockets implementation has detected that the network subsystem has failed. */ +#define TCPIP_NETWORK_ERROR 5 +#define TCPIP_HOST_NOT_FOUND 6 /* Authoritative Answer Host not found. */ +#define TCPIP_HOST_SERVER_DOWN 7 /* Non-Authoritative Host not found, or SERVERFAIL */ +#define TCPIP_HOST_VALID_NAME 8 /* Valid name, no data record of requested type. */ + +DWORD NS_WINAPI +TCPIP_GetDefaultHostName( LPTSTR lpszFullHostName, LPTSTR lpszHostName, LPTSTR lpszDomainName ); +DWORD NS_WINAPI TCPIP_VerifyHostName( LPCTSTR lpszHostName ); + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif diff --git a/include/nt/regparms.h b/include/nt/regparms.h new file mode 100644 index 00000000..418e60b0 --- /dev/null +++ b/include/nt/regparms.h @@ -0,0 +1,586 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +// // +// Name: regparms.h // +// Platforms: WIN32 // +// ...................................................................... // +// This module contains registry key definations used throughout the // +// server. // +// ...................................................................... // +// Revision History: // +// 01-12-95 Initial Version, Aruna Victor (aruna@netscape.com) // +// 12-19-96 3.0 registry changes, Andy Hakim (ahakim@netscape.com) // +// 07-24-97 3.5 registry changes, Ted Byrd (tbyrd@netscape.com) // +// 09-28-97 4.0 registry changes, Glen Beasley (gbeasley@netscape.com) // +//--------------------------------------------------------------------------// +#define KEY_COMPANY "Netscape" +#define KEY_APP_PATH "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths" +#define KEY_RUN_ONCE "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnce" +#define KEY_SERVICES "SYSTEM\\CurrentControlSet\\Services" +#define KEY_SNMP_SERVICE "SNMP\\Parameters\\ExtensionAgents" +#define KEY_SNMP_CURRENTVERSION "SNMP\\CurrentVersion" +#define KEY_EVENTLOG_MESSAGES "EventLogMessages" +#define KEY_EVENTLOG_APP "EventLog\\Application" +#define KEY_SOFTWARE_NETSCAPE "SOFTWARE\\Netscape" +#define VALUE_IMAGE_PATH "ImagePath" +#define VALUE_CONFIG_PATH "ConfigurationPath" +#define VALUE_ROOT_PATH "RootPath" +#define VALUE_APP_PATH "Pathname" +#define PROGRAM_GROUP_NAME "Netscape SuiteSpot" +#define STR_PRODUCT_TYPE "Server" +#define STR_EXE ".exe" +#define STR_COMPANY_PREFIX "ns-" + +/* SuiteSpot IDs */ +#define NSS_NAME_SHORT "SuiteSpot" +#define NSS_VERSION "6.0" +#define NSS_NAME_VERSION "SuiteSpot 6.0" +#define NSS_NAME_FULL "Netscape SuiteSpot" +#define NSS_NAME_FULL_VERSION "Netscape SuiteSpot 6.0" +#define NSS_NAME_UNINSTALL "Uninstall SuiteSpot 6.0" + +/* Admin IDs */ +#define ADM_ID_PRODUCT "admin" +#define ADM_NAME_SHORT "Administration" +#define ADM_VERSION "6.0" +#define ADM_NAME_VERSION "Administration 6.0" +#define ADM_NAME_SERVER "Administration Server" +#define ADM_NAME_FULL "Netscape Administration Server" +#define ADM_NAME_FULL_VERSION "Netscape Administration Server 6.0" +#define ADM_NAME_SERVICE "Netscape Administration 6.0" +#define ADM_EXE "ns-admin.exe" +#define ADM_EXE_START "admin.exe" +#define ADM_ID_SERVICE "admin60" +#define ADM_KEY_ROOT "Administration\\6.0" +#define ADM_SERVER_LST_NAME "adm:Netscape Enterprise Server" +#define ADM_DIR_ROOT "admin" +#define ADM_NAME_UNINSTALL "Uninstall Administration Server 6.0" + +#if defined( NS_DS ) +#define ADMIN_SERVICE_NAME "Admin Server" +#define ADMIN_ICON_NAME "Administer Netscape Servers" +#endif + +/* Enterprise IDs */ +#define ENT_ID_PRODUCT "https" +#define ENT_NAME_SHORT "Enterprise" +#define ENT_VERSION "3.01" +#define ENT_NAME_VERSION "Enterprise 3.01" +#define ENT_NAME_SERVER "Enterprise Server" +#define ENT_NAME_FULL "Netscape Enterprise Server" +#define ENT_NAME_FULL_VERSION "Netscape Enterprise Server 3.01" +#define ENT_NAME_SERVICE "Netscape Enterprise 3.01" +#define ENT_EXE "ns-httpd.exe" +#define ENT_EXE_START "httpd.exe" +#define ENT_ID_SERVICE "https" +#define ENT_KEY_ROOT "Enterprise\\3.01" +#define ENT_SERVER_LST_NAME "https:Netscape Enterprise Server" +#define ENT_DIR_ROOT "https" +#define ENT_NAME_UNINSTALL "Uninstall Enterprise Server 3.01" + +/* Personal IDs */ +#define PERSONAL_APP_PATH_KEY "ns-httpd.exe" +#define PERSONAL_README_ICON_NAME "FastTrack README" +#define PERSONAL_REGISTRY_ROOT_KEY "Httpd Server" +#define PERSONAL_SERVER_LST_NAME "httpd:Netscape FastTrack Server" +#define PERSONAL_UNINSTALL_ICON_NAME "Uninstall FastTrack" +#define PERSONAL_UNINSTALL_KEY "FastTrackV2.0" +#define PERSONAL_SERVER_NAME "Netscape FastTrack Server" + + + + +#define PER_ID_PRODUCT "httpd" +#define PER_NAME_SHORT "FastTrack" +#define PER_VERSION "3.01" +#define PER_NAME_VERSION "FastTrack 3.01" +#define PER_NAME_SERVER "FastTrack Server" +#define PER_NAME_FULL "Netscape FastTrack Server" +#define PER_NAME_FULL_VERSION "Netscape FastTrack Server 3.01" +#define PER_NAME_SERVICE "Netscape FastTrack 3.01" +#define PER_EXE "ns-httpd.exe" +#define PER_EXE_START "httpd.exe" +#define PER_ID_SERVICE "httpd" +#define PER_KEY_ROOT "FastTrack\\3.01" +#define PER_SERVER_LST_NAME "httpd:Netscape FastTrack Server" +#define PER_DIR_ROOT "httpd" +#define PER_NAME_UNINSTALL "Uninstall FastTrack Server 3.01" + +/* Proxy IDs */ +#define PRX_ID_PRODUCT "proxy" +#define PRX_NAME_SHORT "Proxy" +#define PRX_VERSION "3.0" +#define PRX_NAME_VERSION "Proxy 3.0" +#define PRX_NAME_SERVER "Proxy Server" +#define PRX_NAME_FULL "Netscape Proxy Server" +#define PRX_NAME_FULL_VERSION "Netscape Proxy Server 3.0" +#define PRX_NAME_SERVICE "Netscape Proxy 3.0" +#define PRX_EXE "ns-proxy.exe" +#define PRX_EXE_START "proxy.exe" +#define PRX_ID_SERVICE "proxy30" +#define PRX_KEY_ROOT "Proxy\\3.0" +#define PRX_SERVER_LST_NAME "proxy:Netscape Proxy Server" +#define PRX_DIR_ROOT "proxy" +#define PRX_NAME_UNINSTALL "Uninstall Proxy Server 3.0" + +/* Catalog IDs */ +#define CATALOG_SHORT_NAME "Catalog" +#define CATALOG_SERVER_NAME "Netscape Catalog Server" +#define CATALOG_SERVER_VERSION "1.0" +#define CATALOG_SETUP_SHORT_NAME "Catalog Server" +#define CATALOG_SETUP_NAME "Netscape Catalog Server 1.0" +#define CATALOG_REGISTRY_ROOT_KEY "Catalog Server" +#define CATALOG_EXE "ns-httpd.exe" +#define CATALOG_DIR_ROOT "catalog" +#define CATALOG_APP_PATH_KEY "ns-catalog" +#define CATALOG_UNINSTALL_KEY "CatalogV1.0" +#define CATALOG_SERVER_LST_NAME "catalog:Netscape Catalog Server" +#define CATALOG_SERVICE_PREFIX "Netscape Catalog Server " +#define CATALOG_README_ICON_NAME "Catalog README" +#define CATALOG_UNINSTALL_ICON_NAME "Uninstall Catalog" +#define CATALOG_PRODUCT_NAME "catalog" + +/* RDS IDs */ +#define RDS_SHORT_NAME "RDS" +#define RDS_SERVER_NAME "Netscape RDS Server" +#define RDS_SERVER_VERSION "1.0" +#define RDS_SETUP_SHORT_NAME "RDS Server" +#define RDS_SETUP_NAME "Netscape RDS Server 1.0" +#define RDS_REGISTRY_ROOT_KEY "RDS Server" +#define RDS_EXE "ns-httpd.exe" +#define RDS_DIR_ROOT "rds" +#define RDS_APP_PATH_KEY "ns-rds" +#define RDS_UNINSTALL_KEY "RdsV1.0" +#define RDS_SERVER_LST_NAME "rds:Netscape RDS Server" +#define RDS_SERVICE_PREFIX "Netscape RDS Server " +#define RDS_README_ICON_NAME "Rds README" +#define RDS_UNINSTALL_ICON_NAME "Uninstall RDS" +#define RDS_PRODUCT_NAME "rds" + +/* News IDs */ +#define NEWS_SHORT_NAME "News" +/* Alpha #define NEWS_SERVER_NAME "Netscape News Server (tm) " */ +/* Alpha #define NEWS_SETUP_NAME "Netscape News Server (tm) " */ +/* Alpha #define NEWS_UNINSTALL_KEY "NewsV1.2" */ +#define NEWS_SERVER_NAME "Netscape News Server" +#define NEWS_SERVER_VERSION "2.0" +#define NEWS_UNINSTALL_KEY "NetscapeNewsV2.0" +#define NEWS_SETUP_SHORT_NAME "News Server" +#define NEWS_SETUP_NAME "Netscape News Server" +#define NEWS_REGISTRY_ROOT_KEY "News Server" // key under SW/Netscape +#define NEWS_EXE "nnrpd.exe" // value for +#define NEWS_DIR_ROOT "news" // mess.dll in Reg, and in .lst +#define NEWS_APP_PATH_KEY "innd.exe" // key under app paths +#define NEWS_SERVER_LST_NAME "news:Netscape News Server" +#define NEWS_SERVICE_PREFIX "Netscape News Server " +#define NEWS_README_ICON_NAME "News Readme" +#define NEWS_UNINSTALL_ICON_NAME "Uninstall News" + +/* Mail IDs */ +/* When we integrate the core & admin servers installation processes */ +/* we will use the code below instead of the section following it. */ + +/* +#define MAIL_SHORT_NAME "Mail" +#define MAIL_SERVER_NAME "Netscape Mail Server (tm)" +#define MAIL_SERVER_VERSION "2.0" +#define MAIL_SETUP_SHORT_NAME "Mail Server" +#define MAIL_SETUP_NAME "Netscape Mail Server (tm)" +#define MAIL_REGISTRY_ROOT_KEY "Mail Server" // key under SW/Netscape +#define MAIL_EXE "NetscapeMTA.exe" // value for +#define MAIL_DIR_ROOT "mail" // mess.dll in Reg, and in .lst +#define MAIL_APP_PATH_KEY "NetscapeMTA.exe" // key under app paths +#define MAIL_UNINSTALL_KEY "MailV2.0" +#define MAIL_SERVER_LST_NAME "mail:Netscape Mail Server" +#define MAIL_SERVICE_PREFIX "Netscape Mail Server " +#define MAIL_README_ICON_NAME "Mail Readme" +#define MAIL_UNINSTALL_ICON_NAME "Uninstall Mail" +*/ + +#define MAIL_SHORT_NAME "Admin" +#define MAIL_SERVER_NAME "Netscape Administration Server (tm)" +#define MAIL_SERVER_VERSION "2.0" +#define MAIL_SETUP_SHORT_NAME "Admin Server" +#define MAIL_SETUP_NAME "Netscape Administration Server (tm)" +#define MAIL_REGISTRY_ROOT_KEY "Mail Server" // key under SW/Netscape +#define MAIL_EXE "NetscapeMTA.exe" // value for +#define MAIL_DIR_ROOT "mail" // mess.dll in Reg, and in .lst +#define MAIL_APP_PATH_KEY "NetscapeMTA.exe" // key under app paths +#define MAIL_UNINSTALL_KEY "MailV2.0" +#define MAIL_SERVER_LST_NAME "mail:Netscape Mail Server" +#define MAIL_SERVICE_PREFIX "Netscape Admin Server " +#define MAIL_README_ICON_NAME "Mail Readme" +#define MAIL_UNINSTALL_ICON_NAME "Uninstall Mail" + +/* Synchronization Service IDs */ +#define DSS_SHORT_NAME "Directory Synchronization Service" +#define DSS_SERVER_NAME "Netscape Directory Synchronization Service" +#define DSS_SERVER_VERSION "7" +#define DSS_SETUP_SHORT_NAME "Netscape Synchronization Service" +#define DSS_SETUP_NAME "Netscape Directory Synchronization Service 7" +#define DSS_REGISTRY_ROOT_KEY "Directory Synchronization Service" +#define DSS_EXE "dssynch.exe" +#define DSS_DIR_ROOT "dssynch" +#define DSS_APP_PATH_KEY "dssynch.exe" +#define DSS_CONFIG_TOOL "synchcfg.exe" +#define DSS_UNINSTALL_KEY "SynchronizationV7" +#define DSS_SERVER_LST_NAME "dssynch:Netscape Directory Synchronization Service" +#define DSS_SERVICE_PREFIX "Netscape Directory Synchronization Service " +#define DSS_README_ICON_NAME "Directory Synchronization Service README" +#define DSS_CONFIG_ICON_NAME "Directory Synchronization Service Config" +#define DSS_UNINSTALL_ICON_NAME "Uninstall Directory Synch Service" +#define DSS_PRODUCT_NAME "dssynch" +#define DSS_ID_PRODUCT DSS_PRODUCT_NAME +#define DS_COMPONENT 1 + +/* IDs needed for Directory 102/30 synchservice */ +#define ADMIN_APP_PATH_KEY "ns-admin.exe" +#define ADMIN_EXE "ns-admin.exe" +#define ADMIN_REGISTRY_ROOT_KEY "admin.exe" +#define ADMSERV_COMPRESSED_FILE "admserv.z" +#define APPBASE_DIR95 "Program Files" +#define APPBASE_PATH "Netscape" +#define APP_PATH_KEY "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths" +#define BASE_REGISTRY95 "Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\" +#define BASE_REGISTRYNT "Software\\Microsoft\\Windows NT\\CurrentVersion\\App Paths\\" +#define CMS_COMPRESSED_FILE "certsvr.z" +#define CMS_DIR_ROOT "cms" +#define CMS_SHORT_NAME "Certificate Server" +#define CMS_APP_PATH_KEY "libcms.dll" +#define CMS_UNINSTALL_KEY "CertificateV1.0" +#define CMS_UNINSTALL_ICON_NAME "Uninstall CertServer" +#define UPGRADE_VER_1_ICON_NAME "Upgrade 1.1x Servers" +#define CMS_README_ICON_NAME "CertServer README" +#define CMS_REGISTRY_ROOT_KEY "Certificate Server" +#define CMS_SERVER_NAME "Netscape Certificate Server" +#define CMS_SERVER_LST_NAME "cms:Netscape Certificate Server" +#define COMPANY_NAME "Netscape" +#define DIR_HTTPD_SERVER DSS_DIR_ROOT +#define DSS_COMPRESSED_FILE "dssynch.z" +#define DSS_COMPRESSED_HELP_FILE "hdssynch.z" +#define DS_COMPRESSED_FILE "slapd.z" +#define ENTERPRISE_APP_PATH_KEY "ns-https.exe" +#define ENTERPRISE_README_ICON_NAME "Enterprise README" +#define ENTERPRISE_REGISTRY_ROOT_KEY "Https Server" +#define ENTERPRISE_SERVER_LST_NAME "https:Netscape Enterprise Server" +#define ENTERPRISE_SERVER_NAME "Netscape Enterprise Server" +#define ENTERPRISE_UNINSTALL_KEY "EnterpriseV2.0" +#define ENTERPRISE_UNINSTALL_ICON_NAME "Uninstall Enterprise" +#define ENTERPRISE_DIR_ROOT "https" +#define ENTERPRISE_SHORT_NAME "Enterprise" +#define EXTRAS_COMPRESSED_FILE "extras.z" +#define HTTP_SERVER_NAME DSS_DIR_ROOT +#define INSTALL_COMPRESSED_FILE "install.z" +#define LIVEWIRE_COMPRESSED_FILE "wire.z" +#define NSAPI_COMPRESSED_FILE "nsapi.z" +#define PERSONAL_DIR_ROOT "httpd" +#define PERSONAL_SHORT_NAME "FastTrack" +#define PLUGINS_COMPRESSED_FILE "plugins.z" +#define REGISTRY_ROOT_PATH_KEY "Path" +#define SERVDLLS_COMPRESSED_FILE "servdlls.z" +#define SERVER_APP_PATH_KEY DSS_APP_PATH_KEY +#define SERVER_COMPRESSED_FILE "server.z" +#define SERVER_EXE DSS_EXE +#define SERVER_LIST_NAME DSS_SERVER_LST_NAME +#define SERVER_PRODUCT_NAME DSS_REGISTRY_ROOT_KEY +#define SERVER_PRODUCT_VERSION DSS_VERSION_DEF +#define SERVER_README_ICON_NAME DSS_README_ICON_NAME +#define SERVER_UNINSTALL_ICON_NAME DSS_UNINSTALL_ICON_NAME +#define SETUP_NAME DSS_SETUP_NAME +#define SETUP_SHORT_NAME DSS_SHORT_NAME +#define SETUP_TITLE_WIN95_BMP "titleNTb.bmp" +#define SETUP_TITLE_WINNT_BMP "titledss.bmp" +#define SOFTWARE_NETSCAPE_KEY "SOFTWARE\\Netscape" +#define NETSCAPE_WEB_KEY "Netscape Web Servers" +#define NETSCAPE_SERVICE_KEY "SYSTEM\\CurrentControlSet\\Services" + +#define SYSDLLS_COMPRESSED_FILE "ssdlls.z" +#define UNINSTALL_KEY DSS_UNINSTALL_KEY +#define UNINSTALL_REGISTRY95 "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\" +// NT SNMP Extension Agent registry entries +#define SNMP_SERVICE_KEY "SYSTEM\\CurrentControlSet\\Services\\SNMP\\Parameters\\ExtensionAgents\\" +#define SNMP_AGENT_KEY "HTTP SNMP Agent" +#define SNMP_CURRENT_VERSION "CurrentVersion" +#define SNMP_PATHNAME "Pathname" +#define SNMP_DLL_PATH "bin\\https\\httpsnmp.dll" +#define SNMP_SERVICE_NAME "SNMP" +// end synch service + +#define LICENSE_TXT "license.txt" + +#define UNINST_EXE "unslapd.exe" +#define DSS_UNINST_EXE "unsynch.exe" + +#define DIR_ADMSERV_SERVER "admserv" + +#define COPY_READMEFILES "Copying readme files..." +#define COPY_SYSDLLFILES "Copying Shared System files..." +#define COPY_SERVDLLFILES "Copying Shared Server files..." +#define COPY_SERVERFILES "Copying web server files..." +#define COPY_ADMINFILES "Copying administration server files..." +#define COPY_EXTRASFILES "Copying CGI Example and Log Analyzer Files..." +#define COPY_INSTALLFILES "Copying Version 1.1x upgrade files..." +#define COPY_NSAPIFILES "Copying NSAPI Library and Examples Files..." +#define COPY_PLUGINSFILES "Copying Plug-in Files..." +#define COPY_LIVEWIREFILES "Copying LiveWire Files..." +#define INSTALL_LIVEWIREFILES "Installing LiveWire Server Extension files..." +#define INSTALL_CMSFILES "Installing Certificate Server files..." +#define INSTALL_DSFILES "Installing Directory Server files..." +#define INSTALL_DSSFILES "Installing Directory Synchronization Service files..." +#define INSTALL_DSSHELPFILES "Installing Directory Synchronization Service Help files..." + +#define STR_DEFTAB " " +/* end temp ds102 IDs */ + + +/* Directory IDs */ +/* NOTES: + dboreham: I have no idea what is going on below: + we seem to be using two completely different sets of defines. + This needs sorted out + ryamaura: The first group is there only to ensure that + nothing breaks. The second group conforms to the rest of + the SuiteSpot servers and should be the final form. +*/ +#define DS_SHORT_NAME "Directory Server" +#define DS_SERVER_NAME "Netscape Directory Server" +#define DS_SERVER_VERSION "7" +#define DS_SETUP_SHORT_NAME "Directory Server" +#define DS_SETUP_NAME "Netscape Directory Server 7" +#define DS_REGISTRY_ROOT_KEY "Directory Server" +#define DS_APP_PATH_KEY "ns-slapd.exe" +#define DS_UNINSTALL_KEY "DirectoryV7" +#define DS_SERVICE_PREFIX "Netscape Directory Server " +#define DS_README_ICON_NAME "Directory Server 7 README" +#define DS_UNINSTALL_ICON_NAME "Uninstall Directory Server 7" +#define DS_PRODUCT_NAME "slapd" + +#define DS_ID_PRODUCT "slapd" +#define DS_NAME_SHORT "Directory" +#define DS_VERSION_OLD "3.0" +#undef DS_VERSION +#define DS_VERSION "7" +#define DS_NAME_VERSION "Directory 7" +#define DS_NAME_SERVER "Directory Server" +#define DS_NAME_FULL "Netscape Directory Server" +#define DS_NAME_FULL_VERSION "Netscape Directory Server 7" +#define DS_NAME_SERVICE "Netscape Directory 7" +#define DS_EXE "ns-slapd.exe" +#define DS_EXE_START "slapd.exe" +#define DS_ID_SERVICE "slapd" +#define DS_KEY_ROOT "Directory\\7" +#define DS_KEY_ROOT_OLD "Directory\\3.0" +#define DS_SERVER_LST_NAME "slapd:Netscape Directory Server" +#define DS_DIR_ROOT "slapd" +#define DS_NAME_UNINSTALL "Uninstall Directory Server 7" +#define DS_SNMP_PATH "bin\\slapd\\server\\ns-ldapagt.dll" +#define DS_OPTIONS "Select the installation option from below" +#define DS_OPTIONS_TITLE "Directory Server Installions Options" +#define DS_GENERAL_OPTIONS DS_NAME_SERVER + + +#ifndef DS_COMPONENT +#define DS_COMPONENT 1 +#endif + +/* original definitions */ +// Upper-level registry parameters +/* Note: the followin MCC_ are not defined when this file is included + for the NT setup.rul file. Beware of using the following definitions in NT + - nirmal +*/ +#if defined(MCC_ADMSERV) + +#define SERVICE_NAME ADM_ID_SERVICE +#define EVENTLOG_APPNAME ADM_NAME_VERSION +#define SERVICE_EXE ADM_EXE +#define SERVICE_PREFIX ADM_NAME_VERSION +#define SVR_ID_PRODUCT ADM_ID_PRODUCT +#define SVR_NAME_SHORT ADM_NAME_SHORT +#define SVR_VERSION ADM_VERSION +#define SVR_NAME_VERSION ADM_NAME_VERSION +#define SVR_NAME_SERVER ADM_NAME_SERVER +#define SVR_NAME_FULL ADM_NAME_FULL +#define SVR_NAME_FULL_VERSION ADM_NAME_FULL_VERSION +#define SVR_NAME_SERVICE ADM_NAME_SERVICE +#define SVR_EXE ADM_EXE +#define SVR_EXE_START ADM_EXE_START +#define SVR_ID_SERVICE ADM_ID_SERVICE +#define SVR_KEY_ROOT ADM_KEY_ROOT +#define SVR_SERVER_LST_NAME ADM_SERVER_LST_NAME +#define SVR_DIR_ROOT ADM_DIR_ROOT +#define SVR_NAME_UNINSTALL ADM_NAME_UNINSTALL + +#elif defined(NS_ENTERPRISE) + +#define PRODUCT_KEY ENT_KEY_ROOT +#define PRODUCT_NAME ENT_ID_PRODUCT +#define EVENTLOG_APPNAME ENT_NAME_VERSION +#define SERVICE_PREFIX ENT_NAME_VERSION +#define SVR_ID_PRODUCT ENT_ID_PRODUCT +#define SVR_NAME_SHORT ENT_NAME_SHORT +#define SVR_VERSION ENT_VERSION +#define SVR_NAME_VERSION ENT_NAME_VERSION +#define SVR_NAME_SERVER ENT_NAME_SERVER +#define SVR_NAME_FULL ENT_NAME_FULL +#define SVR_NAME_FULL_VERSION ENT_NAME_FULL_VERSION +#define SVR_NAME_SERVICE ENT_NAME_SERVICE +#define SVR_EXE ENT_EXE +#define SVR_EXE_START ENT_EXE_START +#define SVR_ID_SERVICE ENT_ID_SERVICE +#define SVR_KEY_ROOT ENT_KEY_ROOT +#define SVR_SERVER_LST_NAME ENT_SERVER_LST_NAME +#define SVR_DIR_ROOT ENT_DIR_ROOT +#define SVR_NAME_UNINSTALL ENT_NAME_UNINSTALL + +#elif defined(NS_PROXY) + +#define PRODUCT_KEY PRX_KEY_ROOT +#define PRODUCT_NAME PRX_ID_PRODUCT +#define EVENTLOG_APPNAME PRX_NAME_VERSION +#define SERVICE_PREFIX PRX_NAME_VERSION +#define SVR_ID_PRODUCT PRX_ID_PRODUCT +#define SVR_NAME_SHORT PRX_NAME_SHORT +#define SVR_VERSION PRX_VERSION +#define SVR_NAME_VERSION PRX_NAME_VERSION +#define SVR_NAME_SERVER PRX_NAME_SERVER +#define SVR_NAME_FULL PRX_NAME_FULL +#define SVR_NAME_FULL_VERSION PRX_NAME_FULL_VERSION +#define SVR_NAME_SERVICE PRX_NAME_SERVICE +#define SVR_EXE PRX_EXE +#define SVR_EXE_START PRX_EXE_START +#define SVR_ID_SERVICE PRX_ID_SERVICE +#define SVR_KEY_ROOT PRX_KEY_ROOT +#define SVR_SERVER_LST_NAME PRX_SERVER_LST_NAME +#define SVR_DIR_ROOT PRX_DIR_ROOT +#define SVR_NAME_UNINSTALL PRX_NAME_UNINSTALL + +#elif defined(NS_CATALOG) + +#define PRODUCT_KEY CATALOG_REGISTRY_ROOT_KEY // CKA (should use key above) +#define PRODUCT_NAME "catalog" +#define EVENTLOG_APPNAME "NetscapeCatalog" +#define SERVICE_PREFIX CATALOG_SERVICE_PREFIX + +#elif defined(NS_RDS) + +#define PRODUCT_KEY RDS_REGISTRY_ROOT_KEY // CKA (should use key above) +#define PRODUCT_NAME "rds" +#define EVENTLOG_APPNAME "NetscapeRds" +#define SERVICE_PREFIX RDS_SERVICE_PREFIX + +#elif defined(NS_PERSONAL) + +#define PRODUCT_KEY PER_KEY_ROOT +#define PRODUCT_NAME PER_ID_PRODUCT +#define EVENTLOG_APPNAME PER_NAME_VERSION +#define SERVICE_PREFIX PER_NAME_VERSION +#define SVR_ID_PRODUCT PER_ID_PRODUCT +#define SVR_NAME_SHORT PER_NAME_SHORT +#define SVR_VERSION PER_VERSION +#define SVR_NAME_VERSION PER_NAME_VERSION +#define SVR_NAME_SERVER PER_NAME_SERVER +#define SVR_NAME_FULL PER_NAME_FULL +#define SVR_NAME_FULL_VERSION PER_NAME_FULL_VERSION +#define SVR_NAME_SERVICE PER_NAME_SERVICE +#define SVR_EXE PER_EXE +#define SVR_EXE_START PER_EXE_START +#define SVR_ID_SERVICE PER_ID_SERVICE +#define SVR_KEY_ROOT PER_KEY_ROOT +#define SVR_SERVER_LST_NAME PER_SERVER_LST_NAME +#define SVR_DIR_ROOT PER_DIR_ROOT +#define SVR_NAME_UNINSTALL PER_NAME_UNINSTALL + +#elif defined(NS_DSS) + +#define PRODUCT_KEY DSS_REGISTRY_ROOT_KEY // CKA (should use key above) +#define PRODUCT_NAME "dssynch" +#define EVENTLOG_APPNAME "NetscapeDirSynchService" +#define SERVICE_PREFIX DSS_SERVICE_PREFIX + +#elif defined(NS_DS) + +#define PRODUCT_BIN "ns-slapd" +#define SLAPD_EXE "slapd.exe" +#define SERVICE_EXE SLAPD_EXE +#define SLAPD_CONF "slapd.conf" +#define SLAPD_DONGLE_FILE "password.dng" +#define DONGLE_FILE_NAME SLAPD_DONGLE_FILE + +#define PRODUCT_KEY DS_REGISTRY_ROOT_KEY +#define PRODUCT_NAME DS_ID_PRODUCT +#define EVENTLOG_APPNAME DS_NAME_VERSION +#define SERVICE_PREFIX DS_NAME_VERSION +#define SVR_ID_PRODUCT DS_ID_PRODUCT +#define SVR_NAME_SHORT DS_NAME_SHORT +#define SVR_VERSION DS_VERSION +#define SVR_VERSION_OLD DS_VERSION_OLD +#define SVR_NAME_VERSION DS_NAME_VERSION +#define SVR_NAME_SERVER DS_NAME_SERVER +#define SVR_NAME_FULL DS_NAME_FULL +#define SVR_NAME_FULL_VERSION DS_NAME_FULL_VERSION +#define SVR_NAME_SERVICE DS_NAME_SERVICE +#define SVR_EXE DS_EXE +#define SVR_EXE_START DS_EXE_START +#define SVR_ID_SERVICE DS_ID_SERVICE +#define SVR_KEY_ROOT DS_KEY_ROOT +#define SVR_SERVER_LST_NAME DS_SERVER_LST_NAME +#define SVR_DIR_ROOT DS_DIR_ROOT +#define SVR_NAME_UNINSTALL DS_NAME_UNINSTALL +#define SNMP_PATH DS_SNMP_PATH + +#elif defined(NS_SETUP) +#else + +#error SERVER TYPE NOT DEFINED + +#endif /* MCC_ADMSERV */ + +// Do not move this section. This has to come immediately after the +// ifdef section above - Nirmal +// +#if defined(MCC_NEWS) // Nirmal : added for news 2/21/95. +#define PRODUCT_BIN "innd" // Redefine the generic ns-httpd.exe +#define PRODUCT_KEY NEWS_REGISTRY_ROOT_KEY // CKA (should use key above) +#define PRODUCT_NAME "news" +#define EVENTLOG_APPNAME "NetscapeNews" +#define SERVICE_PREFIX NEWS_SERVICE_PREFIX + +#endif + + +#define VERSION_KEY "CurrentVersion" + +// Configuration Parameters + +#define SOFTWARE_KEY "Software" + +// NT Perfmon DLL entries +#define KEY_PERFORMANCE "Performance" +#define PERF_MICROSOFT_KEY "SOFTWARE\\Microsoft\\Windows NT\\Perflib\\009" +#define PERF_COUNTER_KEY "Counter" +#define PERF_HELP_KEY "Help" +#define PERF_OPEN_FUNCTION "OpenNSPerformanceData" +#define PERF_COLLECT_FUNCTION "CollectNSPerformanceData" +#define PERF_CLOSE_FUNCTION "CloseNSPerformanceData" +#define PERF_CTR_INI "nsctrs.ini" + +// this section used to be in confhttp.h. TODO: convert to SVR_ format -ahakim +#if defined(NS_CATALOG) +#define SERVER_REGISTRY_ROOT_KEY CATALOG_REGISTRY_ROOT_KEY +#define SERVER_APP_PATH_KEY CATALOG_APP_PATH_KEY +#define SERVER_DIR_ROOT CATALOG_DIR_ROOT +#define SERVER_SETUP_NAME CATALOG_SETUP_NAME +#define SERVER_SHORT_NAME CATALOG_SHORT_NAME + +#elif defined(NS_RDS) +#define SERVER_REGISTRY_ROOT_KEY RDS_REGISTRY_ROOT_KEY +#define SERVER_APP_PATH_KEY RDS_APP_PATH_KEY +#define SERVER_DIR_ROOT RDS_DIR_ROOT +#define SERVER_SETUP_NAME RDS_SETUP_NAME +#define SERVER_SHORT_NAME RDS_SHORT_NAME + +#endif diff --git a/include/nt/resource.h b/include/nt/resource.h new file mode 100644 index 00000000..905cbeb6 --- /dev/null +++ b/include/nt/resource.h @@ -0,0 +1,36 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by netsite.rc +// +#define IDB_BITMAP1 101 +#define DLG_STARTUP_ERROR 101 +#define IDI_NETSITE 102 +#define IDI_ICON1 104 +#define DLG_GETPASSWORD 106 +#define IDI_ICON2 107 +#define IDD_PASSWORD 108 +#define IDI_KEY 109 +#define IDD_PIN 110 +#define IDEDIT 1000 +#define IDC_ERRORLOG 1001 +#define ID_EXIT 1001 +#define IDC_ERRORMSG 1002 +#define IDC_STARTUP_ERROR 1003 +#define IDC_STATIC -1 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 110 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1002 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif + diff --git a/include/public/Makefile b/include/public/Makefile new file mode 100644 index 00000000..9d291cae --- /dev/null +++ b/include/public/Makefile @@ -0,0 +1,59 @@ +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# Makefile for netsite.h + +MCOM_ROOT = ../../.. +MODULE=netsiteInclude + +include ../../nsdefs.mk + +HDRDEST=$(OBJDIR)/include + +PREFIX=../copyrght.h + + +NOSTDSTRIP=true +NOSTDDEPEND=true + +HDRS=netsite.h nsapi.h + +BINS=$(addprefix $(HDRDEST)/,$(HDRS)) + +all: stuff + +strip: +depend: + +include ../../nsconfig.mk + +ifeq ($(NSAPI_CAPABLE), true) + +stuff: $(HDRDEST) $(BINS) sub-hdrs + +$(HDRDEST): + mkdir -p $(HDRDEST) + +ifeq ($(PRODUCT), "Netscape Proxy Server") +sub-hdrs: + cd base; $(MAKE) $(MAKEFLAGS) + cd frame; $(MAKE) $(MAKEFLAGS) + cd libproxy; $(MAKE) $(MAKEFLAGS) +else +sub-hdrs: + cd base; $(MAKE) $(MAKEFLAGS) + cd frame; $(MAKE) $(MAKEFLAGS) + cd nsacl; $(MAKE) $(MAKEFLAGS) +endif + +$(HDRDEST)/%.h: %.h + cat $(PREFIX) $< > $(HDRDEST)/$*.h + +else +stuff: + +endif diff --git a/include/public/base/Makefile b/include/public/base/Makefile new file mode 100644 index 00000000..15fa95e3 --- /dev/null +++ b/include/public/base/Makefile @@ -0,0 +1,40 @@ +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# Makefile for netsite.h + +MCOM_ROOT = ../../../.. +MODULE=netsiteIncludeBase + +include ../../../nsdefs.mk + +HDRDEST=$(OBJDIR)/include/base + +PREFIX=../../copyrght.h + + +NOSTDSTRIP=true +NOSTDDEPEND=true + +#HDRS=$(wildcard *.h) +HDRS=daemon.h cinfo.h crit.h ereport.h buffer.h net.h pblock.h sem.h session.h shexp.h shmem.h systhr.h util.h file.h pool.h regexp.h systems.h + + +BINS=$(addprefix $(HDRDEST)/,$(HDRS)) + +all: $(HDRDEST) $(BINS) + +$(HDRDEST): + mkdir -p $(HDRDEST) + +strip: +depend: + +include ../../../nsconfig.mk + +$(HDRDEST)/%.h: %.h + cat $(PREFIX) $< > $(HDRDEST)/$*.h diff --git a/include/public/base/crit.h b/include/public/base/crit.h new file mode 100644 index 00000000..bca8c839 --- /dev/null +++ b/include/public/base/crit.h @@ -0,0 +1,21 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef PUBLIC_BASE_CRIT_H +#define PUBLIC_BASE_CRIT_H + +/* + * File: crit.h + * + * Description: + * + * Deprecated include file. + */ + +#ifndef PUBLIC_NSAPI_H +#include "../nsapi.h" +#endif /* !PUBLIC_NSAPI_H */ + +#endif /* !PUBLIC_BASE_CRIT_H */ diff --git a/include/public/base/ereport.h b/include/public/base/ereport.h new file mode 100644 index 00000000..742d77ea --- /dev/null +++ b/include/public/base/ereport.h @@ -0,0 +1,21 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef PUBLIC_BASE_EREPORT_H +#define PUBLIC_BASE_EREPORT_H + +/* + * File: ereport.h + * + * Description: + * + * Deprecated include file. + */ + +#ifndef PUBLIC_NSAPI_H +#include "../nsapi.h" +#endif /* !PUBLIC_NSAPI_H */ + +#endif /* !PUBLIC_BASE_EREPORT_H */ diff --git a/include/public/base/file.h b/include/public/base/file.h new file mode 100644 index 00000000..73312bd2 --- /dev/null +++ b/include/public/base/file.h @@ -0,0 +1,21 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef PUBLIC_BASE_FILE_H +#define PUBLIC_BASE_FILE_H + +/* + * File: file.h + * + * Description: + * + * Deprecated include file. + */ + +#ifndef PUBLIC_NSAPI_H +#include "../nsapi.h" +#endif /* !PUBLIC_NSAPI_H */ + +#endif /* !PUBLIC_BASE_FILE_H */ diff --git a/include/public/base/pool.h b/include/public/base/pool.h new file mode 100644 index 00000000..9480d7c6 --- /dev/null +++ b/include/public/base/pool.h @@ -0,0 +1,22 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef PUBLIC_BASE_POOL_H +#define PUBLIC_BASE_POOL_H + +/* + * File: pool.h + * + * Description: + * + * Deprecated include file. + */ + +#ifndef PUBLIC_NSAPI_H +#include "../nsapi.h" +#endif /* !PUBLIC_NSAPI_H */ + +#endif /* !PUBLIC_BASE_POOL_H */ + diff --git a/include/public/base/shexp.h b/include/public/base/shexp.h new file mode 100644 index 00000000..dd7acf9b --- /dev/null +++ b/include/public/base/shexp.h @@ -0,0 +1,22 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef PUBLIC_BASE_SHEXP_H +#define PUBLIC_BASE_SHEXP_H + +/* + * File: shexp.h + * + * Description: + * + * Deprecated include file. + */ + +#ifndef PUBLIC_NSAPI_H +#include "../nsapi.h" +#endif /* !PUBLIC_NSAPI_H */ + +#endif /* !PUBLIC_BASE_SHEXP_H */ + diff --git a/include/public/base/systems.h b/include/public/base/systems.h new file mode 100644 index 00000000..51be7bcd --- /dev/null +++ b/include/public/base/systems.h @@ -0,0 +1,242 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef PUBLIC_BASE_SYSTEMS_H +#define PUBLIC_BASE_SYSTEMS_H + +/* + * File: systems.h + * + * Description: + * + * This file defines various platform-dependent symbols, which are + * used to configure platform-dependent aspects of the API. + */ + +/* --- Begin native platform configuration definitions --- */ + +#if defined(AIX) + +#define FILE_UNIX +#define FILE_UNIX_MMAP +#define MALLOC_POOLS +#define SEM_FLOCK +#define SHMEM_UNIX_MMAP +#define ZERO(ptr,len) memset(ptr,0,len) +#define NEED_STRCASECMP +#define NEED_STRNCASECMP +#if OSVERSION > 4200 +#define TCPLEN_T size_t +#endif /* OSVERSION > 4200 */ + +#elif defined(BSDI) + +#define BSD_FLOCK +#define FILE_UNIX +#define FILE_UNIX_MMAP +#define MALLOC_POOLS +#define SEM_FLOCK +#define SHMEM_UNIX_MMAP +#define ZERO(ptr,len) memset(ptr,0,len) + +#elif defined(HPUX) + +#define FILE_UNIX +#define FILE_UNIX_MMAP +#define MALLOC_POOLS +#define SEM_FLOCK +/* warning: mmap doesn't work under 9.04 */ +#define SHMEM_UNIX_MMAP +#define ZERO(ptr,len) memset(ptr,0,len) + +#elif defined (IRIX) + +#define FILE_UNIX +#define FILE_UNIX_MMAP +#define MALLOC_POOLS +#define SEM_FLOCK +#define SHMEM_UNIX_MMAP +#define ZERO(ptr,len) memset(ptr,0,len) + +#elif defined(NCR) + +#define CASECMPARG_T unsigned +#define FILE_UNIX +#define FILE_UNIX_MMAP +#define MALLOC_POOLS +#define NEED_STRCASECMP +#define NEED_STRNCASECMP +#ifndef S_ISLNK +#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) +#endif +#define SEM_FLOCK +#define SHMEM_UNIX_MMAP +#define ZERO(ptr,len) memset(ptr,0,len) + +#elif defined(NEC) + +#define FILE_UNIX +#define FILE_UNIX_MMAP +#define MALLOC_POOLS +#define NEED_STRCASECMP +#define NEED_STRNCASECMP +#ifndef S_ISLNK +#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) +#endif +#define SEM_FLOCK +#define SHMEM_UNIX_MMAP +#define ZERO(ptr,len) memset(ptr,0,len) + +#elif defined(OSF1) + +#undef BSD_FLOCK +#define FILE_UNIX +#define FILE_UNIX_MMAP +#define MALLOC_POOLS +#define SEM_FLOCK +#define SHMEM_UNIX_MMAP +#define ZERO(ptr,len) memset(ptr,0,len) + +#elif defined(SCO) + +#define FILE_UNIX +#define FILE_UNIX_MMAP +#define MALLOC_POOLS +#define SEM_FLOCK +#define SHMEM_UNIX_MMAP +#define ZERO(ptr,len) memset(ptr,0,len) + +#elif defined(SNI) + +#define CASECMPARG_T const +#define FILE_UNIX +#define FILE_UNIX_MMAP +#define MALLOC_POOLS +#define NEED_STRCASECMP +#define NEED_STRNCASECMP +#define SEM_FLOCK +#define SHMEM_UNIX_MMAP +#if 0 +#define socketpair(a,b,c,d) pipe(d) +#endif +#define ZERO(ptr,len) memset(ptr,0,len) + +#elif defined(SOLARIS) || defined (SOLARISx86) + +#undef FILE_UNIX /* avoid redefinition message */ +#define FILE_UNIX +#define FILE_UNIX_MMAP +#define MALLOC_POOLS +/* The Solaris routines return ENOSPC when too many semaphores are SEM_UNDO. */ +#define SEM_FLOCK +#define SHMEM_UNIX_MMAP +#define ZERO(ptr,len) memset(ptr,0,len) + +#elif defined (SONY) + +#define FILE_UNIX +#define FILE_UNIX_MMAP +#define NEED_STRCASECMP +#define NEED_STRNCASECMP +#define SEM_FLOCK +#define SHMEM_UNIX_MMAP +#define ZERO(ptr,len) memset(ptr,0,len) + +#elif defined(SUNOS4) + +#define BSD_FLOCK +#define FILE_UNIX +#define FILE_UNIX_MMAP +#define MALLOC_POOLS +#define SEM_FLOCK +#define SHMEM_UNIX_MMAP +#define ZERO(ptr,len) memset(ptr,0,len) + +#elif defined(UNIXWARE) || defined(UnixWare) + +#define CASECMPARG_T const +#define FILE_UNIX +#define FILE_UNIX_MMAP +#define MALLOC_POOLS +#define NEED_STRCASECMP +#define NEED_STRNCASECMP +#ifndef S_ISLNK +#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) +#endif +#define SEM_FLOCK +#define SHMEM_UNIX_MMAP +#define ZERO(ptr,len) memset(ptr,0,len) +#define TCPLEN_T size_t + +#elif defined(Linux) + +#define FILE_UNIX +#define FILE_UNIX_MMAP +#define MALLOC_POOLS +#define SEM_FLOCK +#define SHMEM_UNIX_MMAP +#define ZERO(ptr,len) memset(ptr,0,len) + +#elif defined (XP_WIN32) /* Windows NT */ + +#include +#include + +typedef void* PASSWD; + +#define caddr_t PCHAR +#define CASECMPARG_T const +#define FILE_WIN32 +#define FILE_WIN32_MMAP +#define MALLOC_POOLS +#define NEED_STRCASECMP +#define NEED_STRNCASECMP +#define NET_WINSOCK +#define NSAPI_PUBLIC __declspec(dllexport) +/* The stat call under NT doesn't define these macros */ +#ifndef S_ISDIR +#define S_ISDIR(mode) ((mode&S_IFMT) == S_IFDIR) +#endif +#ifndef S_ISREG +#define S_ISREG(mode) ((mode&S_IFMT) == S_IFREG) +#endif +#ifndef S_ISLNK +#define S_ISLNK(x) (0) +#endif +#define SEM_WIN32 +#define SHMEM_WIN32_MMAP +#define ZERO(ptr, len) ZeroMemory(ptr, len) + +#else + +#error "Missing defines in ns/netsite/include/public/base/systems.h" + +#endif /* Windows NT */ + +#ifndef NSPR_BEGIN_EXTERN_C +#ifdef __cplusplus +#define NSPR_BEGIN_EXTERN_C extern "C" { +#define NSPR_END_EXTERN_C } +#else +#define NSPR_BEGIN_EXTERN_C +#define NSPR_END_EXTERN_C +#endif /* __cplusplus */ +#endif /* !NSPR_BEGIN_EXTERN_C */ + +#ifndef TCPLEN_T +#define TCPLEN_T int +#endif + +#ifndef NSAPI_PUBLIC +#define NSAPI_PUBLIC +#endif /* !NSAPI_PUBLIC */ + +#if defined(NEED_STRCASECMP) || defined(NEED_STRNCASECMP) +#ifndef CASECMPARG_T +#define CASECMPARG_T const +#endif /* !CASECMPARG_T */ +#endif /* NEED_STRCASECMP || NEED_STRNCASECMP */ + +#endif /* PUBLIC_BASE_SYSTEMS_H */ diff --git a/include/public/base/systhr.h b/include/public/base/systhr.h new file mode 100644 index 00000000..d312c3b2 --- /dev/null +++ b/include/public/base/systhr.h @@ -0,0 +1,21 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef PUBLIC_BASE_SYSTHR_H +#define PUBLIC_BASE_SYSTHR_H + +/* + * File: systhr.h + * + * Description: + * + * Deprecated include file. + */ + +#ifndef PUBLIC_NSAPI_H +#include "../nsapi.h" +#endif /* !PUBLIC_NSAPI_H */ + +#endif /* !PUBLIC_BASE_SYSTHR_H */ diff --git a/include/public/base/util.h b/include/public/base/util.h new file mode 100644 index 00000000..88897e5d --- /dev/null +++ b/include/public/base/util.h @@ -0,0 +1,21 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef PUBLIC_BASE_UTIL_H +#define PUBLIC_BASE_UTIL_H + +/* + * File: util.h + * + * Description: + * + * Deprecated include file. + */ + +#ifndef PUBLIC_NSAPI_H +#include "../nsapi.h" +#endif /* !PUBLIC_NSAPI_H */ + +#endif /* PUBLIC_BASE_UTIL_H */ diff --git a/include/public/netsite.h b/include/public/netsite.h new file mode 100644 index 00000000..4f745cc7 --- /dev/null +++ b/include/public/netsite.h @@ -0,0 +1,21 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef PUBLIC_NETSITE_H +#define PUBLIC_NETSITE_H + +/* + * File: netsite.h + * + * Description: + * + * Deprecated include file. + */ + +#ifndef PUBLIC_NSAPI_H +#include "nsapi.h" +#endif /* !PUBLIC_NSAPI_H */ + +#endif /* !PUBLIC_NETSITE_H */ diff --git a/include/public/nsacl/Makefile b/include/public/nsacl/Makefile new file mode 100644 index 00000000..e55a0d9d --- /dev/null +++ b/include/public/nsacl/Makefile @@ -0,0 +1,38 @@ +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# Makefile for include/public/nsacl public header files + +MCOM_ROOT = ../../../.. +MODULE=netsiteIncludeNsacl + +include ../../../nsdefs.mk + +HDRDEST=$(OBJDIR)/include/nsacl + +PREFIX=copyrght.h + + +NOSTDSTRIP=true +NOSTDDEPEND=true + +HDRS=$(wildcard *.h) + +BINS=$(addprefix $(HDRDEST)/,$(HDRS)) + +all: $(HDRDEST) $(BINS) + +$(HDRDEST): + mkdir -p $(HDRDEST) + +strip: +depend: + +include ../../../nsconfig.mk + +$(HDRDEST)/%.h: %.h + cat $(PREFIX) $< > $(HDRDEST)/$*.h diff --git a/include/public/nsacl/aclapi.h b/include/public/nsacl/aclapi.h new file mode 100644 index 00000000..09068f8a --- /dev/null +++ b/include/public/nsacl/aclapi.h @@ -0,0 +1,396 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef PUBLIC_NSACL_ACLAPI_H +#define PUBLIC_NSACL_ACLAPI_H + +/* + * File: aclapi.h + * + * Description: + * + * This file defines the functions available in the ACL API. + */ + +#ifndef PUBLIC_NSACL_NSERRDEF_H +#include "nserrdef.h" +#endif /* !PUBLIC_NSACL_NSERRDEF_H */ + +#ifndef PUBLIC_BASE_POOL_H +#include "../base/pool.h" +#endif /* !PUBLIC_BASE_POOL_H */ + +#ifndef PUBLIC_NSACL_PLISTDEF_H +#include "plistdef.h" +#endif /* !PUBLIC_NSACL_PLISTDEF_H */ + +#ifndef PUBLIC_NSACL_ACLDEF_H +#include "acldef.h" +#endif /* !PUBLIC_NSACL_ACLDEF_H */ + +NSPR_BEGIN_EXTERN_C + +typedef struct ACLDispatchVector ACLDispatchVector_t; +struct ACLDispatchVector { + + /* Error frame stack support */ + + void (*f_nserrDispose)(NSErr_t * errp); + NSEFrame_t *(*f_nserrFAlloc)(NSErr_t * errp); + void (*f_nserrFFree)(NSErr_t * errp, NSEFrame_t * efp); + NSEFrame_t *(*f_nserrGenerate)(NSErr_t * errp, long retcode, + long errorid, char * program, + int errc, ...); + + /* Property list support + * The Property List facility makes extensive use of pointers to + * opaque structures. As such, PLists cannot be marshalled. WAI-style + * ACL APIs in future releases will therefore not be using PLists. + * However the C API documented here may continue to be supported + * in future releases. + */ + + int (*f_PListAssignValue)(PList_t plist, const char *pname, + const void *pvalue, PList_t ptype); + PList_t (*f_PListCreate)(pool_handle_t *mempool, + int resvprop, int maxprop, int flags); + int (*f_PListDefProp)(PList_t plist, int pindex, + const char *pname, const int flags); + const void * (*f_PListDeleteProp)(PList_t plist, int pindex, + const char *pname); + int (*f_PListFindValue)(PList_t plist, + const char *pname, void **pvalue, PList_t *type); + int (*f_PListInitProp)(PList_t plist, int pindex, const char *pname, + const void *pvalue, PList_t ptype); + PList_t (*f_PListNew)(pool_handle_t *mempool); + void (*f_PListDestroy)(PList_t plist); + int (*f_PListGetValue)(PList_t plist, + int pindex, void **pvalue, PList_t *type); + int (*f_PListNameProp)(PList_t plist, int pindex, const char *pname); + int (*f_PListSetType)(PList_t plist, int pindex, PList_t type); + int (*f_PListSetValue)(PList_t plist, + int pindex, const void *pvalue, PList_t type); + void (*f_PListEnumerate)(PList_t plist, PListFunc_t *user_func, + void *user_data); + PList_t (*f_PListDuplicate)(PList_t plist, + pool_handle_t *new_mempool, int flags); + pool_handle_t *(*f_PListGetPool)(PList_t plist); + + /* ACL attribute handling */ + + int (*f_ACL_LasRegister)(NSErr_t *errp, char *attr_name, + LASEvalFunc_t eval_func, + LASFlushFunc_t flush_func); + + /* method/dbtype registration routines */ + + int (*f_ACL_MethodRegister)(NSErr_t *errp, const char *name, + ACLMethod_t *t); + int (*f_ACL_MethodIsEqual)(NSErr_t *errp, + const ACLMethod_t t1, const ACLMethod_t t2); + int (*f_ACL_MethodNameIsEqual)(NSErr_t *errp, + const ACLMethod_t t, const char *name); + int (*f_ACL_MethodFind)(NSErr_t *errp, const char *name, ACLMethod_t *t); + ACLMethod_t (*f_ACL_MethodGetDefault)(NSErr_t *errp); + int (*f_ACL_MethodSetDefault)(NSErr_t *errp, const ACLMethod_t t); + int (*f_ACL_AuthInfoGetMethod)(NSErr_t *errp, + PList_t auth_info, ACLMethod_t *t); + + int (*f_ACL_DbTypeRegister)(NSErr_t *errp, const char *name, + DbParseFn_t func, ACLDbType_t *t); + int (*f_ACL_DbTypeIsEqual)(NSErr_t *errp, + const ACLDbType_t t1, const ACLDbType_t t2); + int (*f_ACL_DbTypeNameIsEqual)(NSErr_t * errp, + const ACLDbType_t t, const char *name); + int (*f_ACL_DbTypeFind)(NSErr_t *errp, const char *name, ACLDbType_t *t); + ACLDbType_t (*f_ACL_DbTypeGetDefault)(NSErr_t *errp); + int (*f_ACL_AuthInfoGetDbType)(NSErr_t *errp, + PList_t auth_info, ACLDbType_t *t); + int (*f_ACL_DbTypeIsRegistered)(NSErr_t *errp, const ACLDbType_t dbtype); + DbParseFn_t (*f_ACL_DbTypeParseFn)(NSErr_t *errp, + const ACLDbType_t dbtype); + + int (*f_ACL_AttrGetterRegister)(NSErr_t *errp, + const char *attr, ACLAttrGetterFn_t fn, + ACLMethod_t m, ACLDbType_t d, + int position, void *arg); + + int (*f_ACL_ModuleRegister)(NSErr_t *errp, const char *moduleName, + AclModuleInitFunc func); + int (*f_ACL_GetAttribute)(NSErr_t *errp, const char *attr, void **val, + PList_t subject, PList_t resource, + PList_t auth_info, PList_t global_auth); + int (*f_ACL_DatabaseRegister)(NSErr_t *errp, ACLDbType_t dbtype, + const char *dbname, const char *url, + PList_t plist); + int (*f_ACL_DatabaseFind)(NSErr_t *errp, const char *dbname, + ACLDbType_t *dbtype, void **db); + int (*f_ACL_DatabaseSetDefault)(NSErr_t *errp, const char *dbname); + int (*f_ACL_LDAPDatabaseHandle )(NSErr_t *errp, const char *dbname, + LDAP **ld, char **basedn); + int (*f_ACL_AuthInfoGetDbname)(PList_t auth_info, char **dbname); + int (*f_ACL_CacheFlushRegister)(AclCacheFlushFunc_t func); + int (*f_ACL_CacheFlush)(void); + + /* ACL language and file interfaces */ + + ACLListHandle_t * (*f_ACL_ParseFile)(NSErr_t *errp, char *filename); + ACLListHandle_t * (*f_ACL_ParseString)(NSErr_t *errp, char *buffer); + int (*f_ACL_WriteString)(NSErr_t *errp, char **acl, + ACLListHandle_t *acllist); + int (*f_ACL_WriteFile)(NSErr_t *errp, char *filename, + ACLListHandle_t *acllist); + int (*f_ACL_FileRenameAcl)(NSErr_t *errp, char *filename, + char *acl_name, char *new_acl_name, int flags); + int (*f_ACL_FileDeleteAcl)(NSErr_t *errp, char *filename, + char *acl_name, int flags); + int (*f_ACL_FileGetAcl)(NSErr_t *errp, char *filename, + char *acl_name, char **acl_text, int flags); + int (*f_ACL_FileSetAcl)(NSErr_t *errp, char *filename, + char *acl_text, int flags); + + /* ACL Expression construction interfaces + * These are low-level interfaces that may be useful to those who are not + * using the ONE ACL syntax, but want to use the ONE ACL evaluation + * routines. By their low-level nature, future support of these APIs + * cannot be guaranteed. Use ACL_ParseFile and ACL_ParseString wherever + * possible. + */ + + ACLExprHandle_t *(*f_ACL_ExprNew)(const ACLExprType_t expr_type); + void (*f_ACL_ExprDestroy)(ACLExprHandle_t *expr); + int (*f_ACL_ExprSetPFlags)(NSErr_t *errp, + ACLExprHandle_t *expr, PFlags_t flags); + int (*f_ACL_ExprClearPFlags)(NSErr_t *errp, ACLExprHandle_t *expr); + int (*f_ACL_ExprTerm)(NSErr_t *errp, ACLExprHandle_t *acl_expr, + char *attr_name, CmpOp_t cmp, char *attr_pattern); + int (*f_ACL_ExprNot)(NSErr_t *errp, ACLExprHandle_t *acl_expr); + int (*f_ACL_ExprAnd)(NSErr_t *errp, ACLExprHandle_t *acl_expr); + int (*f_ACL_ExprOr)(NSErr_t *errp, ACLExprHandle_t *acl_expr); + int (*f_ACL_ExprAddAuthInfo)(ACLExprHandle_t *expr, PList_t auth_info); + int (*f_ACL_ExprAddArg)(NSErr_t *errp, ACLExprHandle_t *expr, char *arg); + int (*f_ACL_ExprSetDenyWith)(NSErr_t *errp, ACLExprHandle_t *expr, + char *deny_type, char *deny_response); + int (*f_ACL_ExprGetDenyWith)(NSErr_t *errp, ACLExprHandle_t *expr, + char **deny_type, char **deny_response); + int (*f_ACL_ExprAppend)(NSErr_t *errp, + ACLHandle_t *acl, ACLExprHandle_t *expr); + + /* ACL manipulation */ + + ACLHandle_t * (*f_ACL_AclNew)(NSErr_t *errp, char *tag); + void (*f_ACL_AclDestroy)(NSErr_t *errp, ACLHandle_t *acl); + + /* ACL list manipulation */ + + ACLListHandle_t * (*f_ACL_ListNew)(NSErr_t *errp); + int (*f_ACL_ListConcat)(NSErr_t *errp, ACLListHandle_t *acl_list1, + ACLListHandle_t *acl_list2, int flags); + int (*f_ACL_ListAppend)(NSErr_t *errp, ACLListHandle_t *acllist, + ACLHandle_t *acl, int flags); + void (*f_ACL_ListDestroy)(NSErr_t *errp, ACLListHandle_t *acllist); + ACLHandle_t * (*f_ACL_ListFind)(NSErr_t *errp, ACLListHandle_t *acllist, + char *aclname, int flags); + int (*f_ACL_ListAclDelete)(NSErr_t *errp, ACLListHandle_t *acl_list, + char *acl_name, int flags); + int (*f_ACL_ListGetNameList)(NSErr_t *errp, ACLListHandle_t *acl_list, + char ***name_list); + int (*f_ACL_NameListDestroy)(NSErr_t *errp, char **name_list); + + /* ACL evaluation */ + + int (*f_ACL_EvalTestRights)(NSErr_t *errp, ACLEvalHandle_t *acleval, + char **rights, char **map_generic, + char **deny_type, char **deny_response, + char **acl_tag, int *expr_num); + ACLEvalHandle_t * (*f_ACL_EvalNew)(NSErr_t *errp, pool_handle_t *pool); + void (*f_ACL_EvalDestroy)(NSErr_t *errp, + pool_handle_t *pool, ACLEvalHandle_t *acleval); + int (*f_ACL_EvalSetACL)(NSErr_t *errp, ACLEvalHandle_t *acleval, + ACLListHandle_t *acllist); + PList_t (*f_ACL_EvalGetSubject)(NSErr_t *errp, ACLEvalHandle_t *acleval); + int (*f_ACL_EvalSetSubject)(NSErr_t *errp, + ACLEvalHandle_t *acleval, PList_t subject); + PList_t (*f_ACL_EvalGetResource)(NSErr_t *errp, ACLEvalHandle_t *acleval); + int (*f_ACL_EvalSetResource)(NSErr_t *errp, + ACLEvalHandle_t *acleval, PList_t resource); + + /* Access to critical section for ACL cache */ + + void (*f_ACL_CritEnter)(void); + void (*f_ACL_CritExit)(void); + + /* Miscellaneous functions */ + const char * (*f_ACL_AclGetTag)(ACLHandle_t *acl); + ACLHandle_t * (*f_ACL_ListGetFirst)(ACLListHandle_t *acl_list, + ACLListEnum_t *acl_enum); + ACLHandle_t * (*f_ACL_ListGetNext)(ACLListHandle_t *acl_list, + ACLListEnum_t *acl_enum); + + /* Functions added after ES 3.0 release */ + const char * (*f_ACL_DatabaseGetDefault)(NSErr_t *errp); + int (*f_ACL_SetDefaultResult)(NSErr_t *errp, ACLEvalHandle_t *acleval, + int result); + int (*f_ACL_GetDefaultResult)(ACLEvalHandle_t *acleval); +}; + +#ifdef XP_WIN32 + +#ifdef INTNSACL +NSAPI_PUBLIC extern ACLDispatchVector_t *__nsacl_table; +#else +__declspec(dllimport) ACLDispatchVector_t *__nsacl_table; +#endif /* INTNSACL */ + +#else /* !XP_WIN32 */ + +NSAPI_PUBLIC extern ACLDispatchVector_t *__nsacl_table; + +#endif /* XP_WIN32 */ + +#ifndef INTNSACL + +#define nserrDispose (*__nsacl_table->f_nserrDispose) +#define nserrFAlloc (*__nsacl_table->f_nserrFAlloc) +#define nserrFFree (*__nsacl_table->f_nserrFFree) +#define nserrGenerate (*__nsacl_table->f_nserrGenerate) + + /* Property list support + * The Property List facility makes extensive use of pointers to + * opaque structures. As such, PLists cannot be marshalled. WAI-style + * ACL APIs in future releases will therefore not be using PLists. + * However the C API documented here may continue to be supported + * in future releases. + */ + +#define PListAssignValue (*__nsacl_table->f_PListAssignValue) +#define PListCreate (*__nsacl_table->f_PListCreate) +#define PListDefProp (*__nsacl_table->f_PListDefProp) +#define PListDeleteProp (*__nsacl_table->f_PListDeleteProp) +#define PListFindValue (*__nsacl_table->f_PListFindValue) +#define PListInitProp (*__nsacl_table->f_PListInitProp) +#define PListNew (*__nsacl_table->f_PListNew) +#define PListDestroy (*__nsacl_table->f_PListDestroy) +#define PListGetValue (*__nsacl_table->f_PListGetValue) +#define PListNameProp (*__nsacl_table->f_PListNameProp) +#define PListSetType (*__nsacl_table->f_PListSetType) +#define PListSetValue (*__nsacl_table->f_PListSetValue) +#define PListEnumerate (*__nsacl_table->f_PListEnumerate) +#define PListDuplicate (*__nsacl_table->f_PListDuplicate) +#define PListGetPool (*__nsacl_table->f_PListGetPool) + + /* ACL attribute handling */ + +#define ACL_LasRegister (*__nsacl_table->f_ACL_LasRegister) + + /* method/dbtype registration routines */ + +#define ACL_MethodRegister (*__nsacl_table->f_ACL_MethodRegister) +#define ACL_MethodIsEqual (*__nsacl_table->f_ACL_MethodIsEqual) +#define ACL_MethodNameIsEqual (*__nsacl_table->f_ACL_MethodNameIsEqual) +#define ACL_MethodFind (*__nsacl_table->f_ACL_MethodFind) +#define ACL_MethodGetDefault (*__nsacl_table->f_ACL_MethodGetDefault) +#define ACL_MethodSetDefault (*__nsacl_table->f_ACL_MethodSetDefault) +#define ACL_AuthInfoGetMethod (*__nsacl_table->f_ACL_AuthInfoGetMethod) +#define ACL_DbTypeRegister (*__nsacl_table->f_ACL_DbTypeRegister) +#define ACL_DbTypeIsEqual (*__nsacl_table->f_ACL_DbTypeIsEqual) +#define ACL_DbTypeNameIsEqual (*__nsacl_table->f_ACL_DbTypeNameIsEqual) +#define ACL_DbTypeFind (*__nsacl_table->f_ACL_DbTypeFind) +#define ACL_DbTypeGetDefault (*__nsacl_table->f_ACL_DbTypeGetDefault) +#define ACL_AuthInfoGetDbType (*__nsacl_table->f_ACL_AuthInfoGetDbType) +#define ACL_DbTypeIsRegistered (*__nsacl_table->f_ACL_DbTypeIsRegistered) +#define ACL_DbTypeParseFn (*__nsacl_table->f_ACL_DbTypeParseFn) +#define ACL_AttrGetterRegister (*__nsacl_table->f_ACL_AttrGetterRegister) +#define ACL_ModuleRegister (*__nsacl_table->f_ACL_ModuleRegister) +#define ACL_GetAttribute (*__nsacl_table->f_ACL_GetAttribute) +#define ACL_DatabaseRegister (*__nsacl_table->f_ACL_DatabaseRegister) +#define ACL_DatabaseFind (*__nsacl_table->f_ACL_DatabaseFind) +#define ACL_DatabaseSetDefault (*__nsacl_table->f_ACL_DatabaseSetDefault) +#define ACL_LDAPDatabaseHandle (*__nsacl_table->f_ACL_LDAPDatabaseHandle) +#define ACL_AuthInfoGetDbname (*__nsacl_table->f_ACL_AuthInfoGetDbname) +#define ACL_CacheFlushRegister (*__nsacl_table->f_ACL_CacheFlushRegister) +#define ACL_CacheFlush (*__nsacl_table->f_ACL_CacheFlush) + + /* ACL language and file interfaces */ + +#define ACL_ParseFile (*__nsacl_table->f_ACL_ParseFile) +#define ACL_ParseString (*__nsacl_table->f_ACL_ParseString) +#define ACL_WriteString (*__nsacl_table->f_ACL_WriteString) +#define ACL_WriteFile (*__nsacl_table->f_ACL_WriteFile) +#define ACL_FileRenameAcl (*__nsacl_table->f_ACL_FileRenameAcl) +#define ACL_FileDeleteAcl (*__nsacl_table->f_ACL_FileDeleteAcl) +#define ACL_FileGetAcl (*__nsacl_table->f_ACL_FileGetAcl) +#define ACL_FileSetAcl (*__nsacl_table->f_ACL_FileSetAcl) + + /* ACL Expression construction interfaces + * These are low-level interfaces that may be useful to those who are not + * using the ONE ACL syntax, but want to use the ONE ACL evaluation + * routines. By their low-level nature, future support of these APIs + * cannot be guaranteed. Use ACL_ParseFile and ACL_ParseString wherever + * possible. + */ + +#define ACL_ExprNew (*__nsacl_table->f_ACL_ExprNew) +#define ACL_ExprDestroy (*__nsacl_table->f_ACL_ExprDestroy) +#define ACL_ExprSetPFlags (*__nsacl_table->f_ACL_ExprSetPFlags) +#define ACL_ExprClearPFlags (*__nsacl_table->f_ACL_ExprClearPFlags) +#define ACL_ExprTerm (*__nsacl_table->f_ACL_ExprTerm) +#define ACL_ExprNot (*__nsacl_table->f_ACL_ExprNot) +#define ACL_ExprAnd (*__nsacl_table->f_ACL_ExprAnd) +#define ACL_ExprOr (*__nsacl_table->f_ACL_ExprOr) +#define ACL_ExprAddAuthInfo (*__nsacl_table->f_ACL_ExprAddAuthInfo) +#define ACL_ExprAddArg (*__nsacl_table->f_ACL_ExprAddArg) +#define ACL_ExprSetDenyWith (*__nsacl_table->f_ACL_ExprSetDenyWith) +#define ACL_ExprGetDenyWith (*__nsacl_table->f_ACL_ExprGetDenyWith) +#define ACL_ExprAppend (*__nsacl_table->f_ACL_ExprAppend) + + /* ACL manipulation */ + +#define ACL_AclNew (*__nsacl_table->f_ACL_AclNew) +#define ACL_AclDestroy (*__nsacl_table->f_ACL_AclDestroy) + + /* ACL list manipulation */ + +#define ACL_ListNew (*__nsacl_table->f_ACL_ListNew) +#define ACL_ListConcat (*__nsacl_table->f_ACL_ListConcat) +#define ACL_ListAppend (*__nsacl_table->f_ACL_ListAppend) +#define ACL_ListDestroy (*__nsacl_table->f_ACL_ListDestroy) +#define ACL_ListFind (*__nsacl_table->f_ACL_ListFind) +#define ACL_ListAclDelete (*__nsacl_table->f_ACL_ListAclDelete) +#define ACL_ListGetNameList (*__nsacl_table->f_ACL_ListGetNameList) +#define ACL_NameListDestroy (*__nsacl_table->f_ACL_NameListDestroy) + + /* ACL evaluation */ + +#define ACL_EvalTestRights (*__nsacl_table->f_ACL_EvalTestRights) +#define ACL_EvalNew (*__nsacl_table->f_ACL_EvalNew) +#define ACL_EvalDestroy (*__nsacl_table->f_ACL_EvalDestroy) +#define ACL_EvalSetACL (*__nsacl_table->f_ACL_EvalSetACL) +#define ACL_EvalGetSubject (*__nsacl_table->f_ACL_EvalGetSubject) +#define ACL_EvalSetSubject (*__nsacl_table->f_ACL_EvalSetSubject) +#define ACL_EvalGetResource (*__nsacl_table->f_ACL_EvalGetResource) +#define ACL_EvalSetResource (*__nsacl_table->f_ACL_EvalSetResource) + + /* Access to critical section for ACL cache */ + +#define ACL_CritEnter (*__nsacl_table->f_ACL_CritEnter) +#define ACL_CritExit (*__nsacl_table->f_ACL_CritExit) + + /* Miscellaneous functions */ + +#define ACL_AclGetTag (*__nsacl_table->f_ACL_AclGetTag) +#define ACL_ListGetFirst (*__nsacl_table->f_ACL_ListGetFirst) +#define ACL_ListGetNext (*__nsacl_table->f_ACL_ListGetNext) + + /* Functions added after ES 3.0 release */ +#define ACL_DatabaseGetDefault (*__nsacl_table->f_ACL_DatabaseGetDefault) +#define ACL_SetDefaultResult (*__nsacl_table->f_ACL_SetDefaultResult) +#define ACL_GetDefaultResult (*__nsacl_table->f_ACL_GetDefaultResult) + +#endif /* !INTNSACL */ + +NSPR_END_EXTERN_C + +#endif /* !PUBLIC_NSACL_ACLAPI_H */ diff --git a/include/public/nsacl/acldef.h b/include/public/nsacl/acldef.h new file mode 100644 index 00000000..c5eb1d09 --- /dev/null +++ b/include/public/nsacl/acldef.h @@ -0,0 +1,465 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef PUBLIC_NSACL_ACLDEF_H +#define PUBLIC_NSACL_ACLDEF_H + +/* + * File: acldef.h + * + * Description: + * + * This file contains constant and type definitions for the ACL API. + */ + +#ifndef PUBLIC_NSACL_NSERRDEF_H +#include "nserrdef.h" +#endif /* !PUBLIC_NSACL_NSERRDEF_H */ + +#ifndef PUBLIC_NSACL_PLISTDEF_H +#include "plistdef.h" +#endif /* !PUBLIC_NSACL_PLISTDEF_H */ + +NSPR_BEGIN_EXTERN_C + +/* + * Type: ACLCachable_t + * + * Description: + * + * This type is used to specify whether and how long something + * may be safely cached. A value of zero (ACL_NOT_CACHABLE) + * indicates that the item is not cachable. Any other value is + * a time, in seconds since 00:00:00 UTC, January 1, 1970, after + * which the cached information should be discarded. + */ + +typedef unsigned long ACLCachable_t; + +#define ACL_NOT_CACHABLE 0 +#define ACL_INDEF_CACHABLE ((unsigned long)(-1)) + +/* + * Type: ACLListHandle_t + * + * Description: + * + * This type represents a list of ACLs in their in-memory form. + */ + +typedef struct ACLListHandle ACLListHandle_t; + +/* The object has been checked for ACLs and has none attached */ +#define ACL_LIST_NO_ACLS ((ACLListHandle_t *)-1) + +/* + * Type: ACLHandle_t + * + * Description: + * + * This type represents the in-memory form of an ACL. + */ + +typedef struct ACLHandle ACLHandle_t; + +/* + * Type: ACLListEnum_t + * + * Description: + * + * This type contains the state of an ACL list enumeration. + */ + +typedef void *ACLListEnum_t; + +/* + * Type: ACLExprHandle_t + * + * Description: + * + * This type represents a single ACL entry, e.g. allow, deny, etc. + */ + +typedef struct ACLExprHandle ACLExprHandle_t; + +/* + * Type: ACLEvalHandle_t + * + * Description: + * + * This type represents an ACL evaluation context, which includes + * an ACL list and property lists for the subject and resource. + */ + +typedef struct ACLEvalHandle ACLEvalHandle_t; + +/* + * Type: PFlags_t + * + * Description: + * + * This type represents a set of processing flags for an ACL entry. + */ +typedef int PFlags_t; + +#define ACL_PFLAG_ABSOLUTE 0x1 +#define ACL_PFLAG_TERMINAL 0x2 +#define ACL_PFLAG_CONTENT 0x4 + +#define IS_ABSOLUTE(x) ((x) & ACL_PFLAG_ABSOLUTE) +#define IS_STATIC(x) ((x) & ACL_PFLAG_STATIC) +#define IS_CONTENT(x) ((x) & ACL_PFLAG_CONTENT) + +/* + * Type: CmpOp_t + * + * Description: + * + * This type represents a comparison operator in an ACL attribute + * expression. + */ +typedef enum { + CMP_OP_EQ, + CMP_OP_NE, + CMP_OP_GT, + CMP_OP_LT, + CMP_OP_GE, + CMP_OP_LE + } CmpOp_t; + +/* + * Type: ACLExprType_t + * + * Description: + * + * This type represents the type of an ACL entry. + */ +typedef enum { + ACL_EXPR_TYPE_ALLOW, + ACL_EXPR_TYPE_DENY, + ACL_EXPR_TYPE_AUTH, + ACL_EXPR_TYPE_RESPONSE + } ACLExprType_t; + +/* + * Type: ACLEvalRes_t + * + * Description: + * + * This type represents the result of ACL evaluation. + */ +typedef enum { + ACL_RES_ALLOW, + ACL_RES_DENY, + ACL_RES_FAIL, + ACL_RES_INVALID, + ACL_RES_NONE + } ACLEvalRes_t; + +/* + * Type: ACLMethod_t + * + * Description: + * + * This type represents a reference to an authentication method. + */ +typedef void * ACLMethod_t; + +#define ACL_METHOD_ANY ((ACLMethod_t)-1) +#define ACL_METHOD_INVALID ((ACLMethod_t)-2) + +/* + * Type: ACLDbType_t + * + * Description: + * + * This type represents a reference to a type of authentication + * database. + */ +typedef void * ACLDbType_t; + +#define ACL_DBTYPE_ANY ((ACLDbType_t)-1) +#define ACL_DBTYPE_INVALID ((ACLDbType_t)-2) + +/* + * Type: ACLAttrGetterFn_t + * + * Description: + * + * This type describes a kind of callback function that obtains + * a value for an ACL attribute and enters the attribute and value + * into the subject property list. + */ +typedef int (*ACLAttrGetterFn_t)(NSErr_t *errp, PList_t subject, + PList_t resource, PList_t auth_info, + PList_t global_auth, void *arg); + +typedef struct ACLAttrGetter ACLAttrGetter_t; +typedef void *ACLAttrGetterList_t; + +/* + * Type: AclModuleInitFunc + * + * Description: + * + * This type describes a kind of callback function that is + * specified to ACL_ModuleRegister() and called from there. + * The function should return 0 on success and non-zero on + * failure. + */ +typedef int (*AclModuleInitFunc)(NSErr_t *errp); + +/* + * Type: DbParseFn_t + * + * Description: + * + * This type describes a kind of callback function that parses + * a reference to an authentication database of a particular + * database type. It is called when ACL_DatabaseRegister() is + * called for a database which is that database type. + * The function should return 0 on success and non-zero on + * failure. + */ +typedef int (*DbParseFn_t)(NSErr_t *errp, ACLDbType_t dbtype, + const char *name, const char *url, + PList_t plist, void **db); + +/* + * Type: AclCacheFlushFunc_t + * + * Description: + * + * This type describes a kind of callback function that is called + * when ACL_CacheFlush() is called. + */ +typedef int (*AclCacheFlushFunc_t)(void); + +/* + * Type: LASEvalFunc_t + * + * Description: + * + * This type describes a kind of callback function that is called + * to evaluate an attribute value expression in an ACL statement. + */ +typedef int (*LASEvalFunc_t)(NSErr_t *errp, char *attr_name, + CmpOp_t comparator, char *attr_pattern, + ACLCachable_t *cachable, void **cookie, + PList_t subject, PList_t resource, + PList_t auth_info, PList_t global_auth); + +/* + * Type: LASFlushFunc_t + * + * Description: + * + * This type describes a kind of callback function that is called + * when a previously cached LAS cookie is being flushed from + * the ACL cache. + */ +typedef void (*LASFlushFunc_t)(void **cookie); + +/* + * Type: LDAP + * + * Description: + * + * This is an opaque type that represents an open LDAP connection. + * It is used mostly via the LDAP SDK API. + * Include the file before including this file if you wish to + * use the function ACL_LDAPDatabaseHandle. + */ +#ifndef _LDAP_H +typedef struct ldap LDAP; +#endif /* _LDAP_H */ + + +/* Flags to ACL_ListFind */ +#define ACL_CASE_INSENSITIVE 0x1 +#define ACL_CASE_SENSITIVE 0x2 + +#define ACL_MAX_TEST_RIGHTS 32 +#define ACL_MAX_GENERIC 32 + +/* + * ACLERRFAIL -- Use this as an 'retcode' argument to nserrGenerate. + */ +#define ACLERRFAIL -11 + + +/* + * Command values for the "position" argument to ACL_RegisterGetter + * Any positive >0 value is the specific position in the list to insert + * the new function. + */ +#define ACL_AT_FRONT 0 +#define ACL_AT_END -1 +#define ACL_REPLACE_ALL -2 +#define ACL_REPLACE_MATCHING -3 + +#define ACL_ATTR_GROUP "group" +#define ACL_ATTR_GROUP_INDEX 1 +#define ACL_ATTR_RAW_USER_LOGIN "user-login" +#define ACL_ATTR_RAW_USER_LOGIN_INDEX 2 +#define ACL_ATTR_AUTH_USER "auth-user" +#define ACL_ATTR_AUTH_USER_INDEX 3 +#define ACL_ATTR_AUTH_TYPE "auth-type" +#define ACL_ATTR_AUTH_TYPE_INDEX 4 +#define ACL_ATTR_AUTH_DB "auth-db" +#define ACL_ATTR_AUTH_DB_INDEX 5 +#define ACL_ATTR_AUTH_PASSWORD "auth-password" +#define ACL_ATTR_AUTH_PASSWORD_INDEX 6 +#define ACL_ATTR_USER "user" +#define ACL_ATTR_USER_INDEX 7 +#define ACL_ATTR_PASSWORD "pw" +#define ACL_ATTR_PASSWORD_INDEX 8 +#define ACL_ATTR_USERDN "userdn" +#define ACL_ATTR_USERDN_INDEX 9 +#define ACL_ATTR_RAW_USER "raw-user" +#define ACL_ATTR_RAW_USER_INDEX 10 +#define ACL_ATTR_RAW_PASSWORD "raw-pw" +#define ACL_ATTR_RAW_PASSWORD_INDEX 11 +#define ACL_ATTR_USER_ISMEMBER "user-ismember" +#define ACL_ATTR_USER_ISMEMBER_INDEX 12 +#define ACL_ATTR_DATABASE "database" +#define ACL_ATTR_DATABASE_INDEX 13 +#define ACL_ATTR_DBTYPE "dbtype" +#define ACL_ATTR_DBTYPE_INDEX 14 +#define ACL_ATTR_DBNAME "dbname" +#define ACL_ATTR_DBNAME_INDEX 15 +#define ACL_ATTR_DATABASE_URL "url" +#define ACL_ATTR_DATABASE_URL_INDEX 16 +#define ACL_ATTR_METHOD "method" +#define ACL_ATTR_METHOD_INDEX 17 +#define ACL_ATTR_AUTHTYPE "authtype" +#define ACL_ATTR_AUTHTYPE_INDEX 18 +#define ACL_ATTR_AUTHORIZATION "authorization" +#define ACL_ATTR_AUTHORIZATION_INDEX 19 +#define ACL_ATTR_PARSEFN "parsefn" +#define ACL_ATTR_PARSEFN_INDEX 20 +#define ACL_ATTR_ATTRIBUTE "attr" +#define ACL_ATTR_ATTRIBUTE_INDEX 21 +#define ACL_ATTR_GETTERFN "getterfunc" +#define ACL_ATTR_GETTERFN_INDEX 22 +#define ACL_ATTR_IP "ip" +#define ACL_ATTR_IP_INDEX 23 +#define ACL_ATTR_DNS "dns" +#define ACL_ATTR_DNS_INDEX 24 +#define ACL_ATTR_MODULE "module" +#define ACL_ATTR_MODULE_INDEX 25 +#define ACL_ATTR_MODULEFUNC "func" +#define ACL_ATTR_MODULEFUNC_INDEX 26 +#define ACL_ATTR_GROUPS "groups" +#define ACL_ATTR_GROUPS_INDEX 27 +#define ACL_ATTR_IS_VALID_PASSWORD "isvalid-password" +#define ACL_ATTR_IS_VALID_PASSWORD_INDEX 28 +#define ACL_ATTR_CERT2USER "cert2user" +#define ACL_ATTR_CERT2USER_INDEX 29 +#define ACL_ATTR_USER_CERT "cert" +#define ACL_ATTR_USER_CERT_INDEX 30 +#define ACL_ATTR_PROMPT "prompt" +#define ACL_ATTR_PROMPT_INDEX 31 +#define ACL_ATTR_TIME "time" +#define ACL_ATTR_TIME_INDEX 32 +#define ACL_ATTR_USERS_GROUP "users-group" +#define ACL_ATTR_USERS_GROUP_INDEX 33 +#define ACL_ATTR_SESSION "session" /* subject property */ +#define ACL_ATTR_SESSION_INDEX 34 +#define ACL_ATTR_REQUEST "request" /* resource property */ +#define ACL_ATTR_REQUEST_INDEX 35 +#define ACL_ATTR_ERROR "error" +#define ACL_ATTR_ERROR_INDEX 36 +#define ACL_ATTR_PROGRAMS "programs" /* resource property */ +#define ACL_ATTR_PROGRAMS_INDEX 37 +#define ACL_ATTR_ACCEL_AUTH "accel-authorization" +#define ACL_ATTR_ACCEL_AUTH_INDEX 38 +#define ACL_ATTR_WWW_AUTH_PROMPT "www-auth-prompt" +#define ACL_ATTR_WWW_AUTH_PROMPT_INDEX 39 +#define ACL_ATTR_OWNER "owner" +#define ACL_ATTR_OWNER_INDEX 40 +#define ACL_ATTR_IS_OWNER "is-owner" +#define ACL_ATTR_IS_OWNER_INDEX 41 +#define ACL_ATTR_CACHED_USER "cached-user" +#define ACL_ATTR_CACHED_USER_INDEX 42 +#define ACL_ATTR_USER_EXISTS "user-exists" +#define ACL_ATTR_USER_EXISTS_INDEX 43 + +/* Must be 1 larger than the highest index used */ +#define ACL_ATTR_INDEX_MAX 44 + +#ifdef ALLOCATE_ATTR_TABLE +/* Must be in the same order as the index numbers */ +char *ACLAttrTable[] = { + NULL, /* 0 */ +/* Don't have one numbered 0 */ + ACL_ATTR_GROUP, /* 1 */ + ACL_ATTR_RAW_USER_LOGIN, /* 2 */ + ACL_ATTR_AUTH_USER, /* 3 */ + ACL_ATTR_AUTH_TYPE, /* 4 */ + ACL_ATTR_AUTH_DB, /* 5 */ + ACL_ATTR_AUTH_PASSWORD, /* 6 */ + ACL_ATTR_USER, /* 7 */ + ACL_ATTR_PASSWORD, /* 8 */ + ACL_ATTR_USERDN, /* 9 */ + ACL_ATTR_RAW_USER, /* 10 */ + ACL_ATTR_RAW_PASSWORD, /* 11 */ + ACL_ATTR_USER_ISMEMBER, /* 12 */ + ACL_ATTR_DATABASE, /* 13 */ + ACL_ATTR_DBTYPE, /* 14 */ + ACL_ATTR_DBNAME, /* 15 */ + ACL_ATTR_DATABASE_URL, /* 16 */ + ACL_ATTR_METHOD, /* 17 */ + ACL_ATTR_AUTHTYPE, /* 18 */ + ACL_ATTR_AUTHORIZATION, /* 19 */ + ACL_ATTR_PARSEFN, /* 20 */ + ACL_ATTR_ATTRIBUTE, /* 21 */ + ACL_ATTR_GETTERFN, /* 22 */ + ACL_ATTR_IP, /* 23 */ + ACL_ATTR_DNS, /* 24 */ + ACL_ATTR_MODULE, /* 25 */ + ACL_ATTR_MODULEFUNC, /* 26 */ + ACL_ATTR_GROUPS, /* 27 */ + ACL_ATTR_IS_VALID_PASSWORD, /* 28 */ + ACL_ATTR_CERT2USER, /* 29 */ + ACL_ATTR_USER_CERT, /* 30 */ + ACL_ATTR_PROMPT, /* 31 */ + ACL_ATTR_TIME, /* 32 */ + ACL_ATTR_USERS_GROUP, /* 33 */ + ACL_ATTR_SESSION, /* 34 */ + ACL_ATTR_REQUEST, /* 35 */ + ACL_ATTR_ERROR, /* 36 */ + ACL_ATTR_PROGRAMS, /* 37 */ + ACL_ATTR_ACCEL_AUTH, /* 38 */ + ACL_ATTR_WWW_AUTH_PROMPT, /* 39 */ + ACL_ATTR_OWNER, /* 40 */ + ACL_ATTR_IS_OWNER, /* 41 */ + ACL_ATTR_CACHED_USER, /* 42 */ + ACL_ATTR_USER_EXISTS /* 43 */ +}; +#endif + + +#define ACL_DBTYPE_LDAP "ldap" + +#define METHOD_DEFAULT "default" + +/* Errors must be < 0 */ +#define ACL_RES_ERROR -1 + +/* LAS return codes - Must all be negative numbers */ +#define LAS_EVAL_TRUE -1 +#define LAS_EVAL_FALSE -2 +#define LAS_EVAL_DECLINE -3 +#define LAS_EVAL_FAIL -4 +#define LAS_EVAL_INVALID -5 +#define LAS_EVAL_NEED_MORE_INFO -6 + +/* Max pathlength. Intended to match REQ_MAX_LEN */ +#define ACL_PATH_MAX 4096 + +NSPR_END_EXTERN_C + +#endif /* !PUBLIC_NSACL_ACLDEF_H */ diff --git a/include/public/nsacl/copyrght.h b/include/public/nsacl/copyrght.h new file mode 100644 index 00000000..4f8ec167 --- /dev/null +++ b/include/public/nsacl/copyrght.h @@ -0,0 +1,6 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ + diff --git a/include/public/nsacl/nserrdef.h b/include/public/nsacl/nserrdef.h new file mode 100644 index 00000000..81748227 --- /dev/null +++ b/include/public/nsacl/nserrdef.h @@ -0,0 +1,100 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef PUBLIC_NSACL_NSERRDEF_H +#define PUBLIC_NSACL_NSERRDEF_H + +/* + * Type: NSEFrame_t + * + * Description: + * + * This type describes the structure of an error frame. An error + * frame contains the following items: + * + * ef_retcode - This is a copy of the traditional error code, + * as might be returned as a function value to + * indicate an error. The purpose of the error + * code is to provide the caller of a function + * with sufficient information to determine how + * to process the error. That is, it does not + * need to identify a specific error, but only + * has to distinguish between classes of errors + * as needed by the caller to respond differently. + * Usually this should be a small number of values. + * + * ef_errorid - This is an integer identifier which uniquely + * identifies errors in a module or library. + * That is, there should be only one place in + * the source code of the module or library which + * generates a particular error id. The error id + * is used to select an error message in an error + * message file. + * + * ef_program - This is a pointer to a string which identifies + * the module or library context of ef_errorid. + * The string is used to construct the name of + * the message file in which an error message for + * ef_errorid can be found. + * + * ef_errc - This is the number of values stored in ef_errc[] + * for the current error id. + * + * ef_errv - This is an array of strings which are relevant + * to a particular error id. These strings can + * be included in an error message retrieved from + * a message file. The strings in a message file + * can contain "%s" sprintf() format codes. The + * ef_errv[] strings are passed to sprintf() along + * with the error message string. + */ + +#define NSERRMAXARG 8 /* size of ef_errv[] */ + +typedef struct NSEFrame_s NSEFrame_t; +struct NSEFrame_s { + NSEFrame_t * ef_next; /* next error frame on NSErr_t list */ + long ef_retcode; /* error return code */ + long ef_errorid; /* error unique identifier */ + char * ef_program; /* context for ef_errorid */ + int ef_errc; /* number of strings in ef_errv[] */ + char * ef_errv[NSERRMAXARG];/* arguments for formatting error message */ +}; + +/* + * Description (NSErr_t) + * + * This type describes the structure of a header for a list of + * error frames. The header contains a pointer to the first + * and last error frames on the list. The first error frame + * is normally the one most recently generated, which usually + * represents the highest-level interpretation available for an + * error that is propogating upward in a call chain. These + * structures are generally allocated as automatic or static + * variables. + */ + +typedef struct NSErr_s NSErr_t; +struct NSErr_s { + NSEFrame_t * err_first; /* first error frame */ + NSEFrame_t * err_last; /* last error frame */ + NSEFrame_t *(*err_falloc)(NSErr_t * errp); /* error frame allocator */ + void (*err_ffree)(NSErr_t * errp, + NSEFrame_t * efp); /* error frame deallocator */ +}; + +/* Define an initializer for an NSErr_t */ +#define NSERRINIT { 0, 0, 0, 0 } + +#ifndef INTNSACL + +#define nserrDispose (*__nsacl_table->f_nserrDispose) +#define nserrFAlloc (*__nsacl_table->f_nserrFAlloc) +#define nserrFFree (*__nsacl_table->f_nserrFFree) +#define nserrGenerate (*__nsacl_table->f_nserrGenerate) + +#endif /* !INTNSACL */ + +#endif /* !PUBLIC_NSACL_NSERRDEF_H */ diff --git a/include/public/nsacl/plistdef.h b/include/public/nsacl/plistdef.h new file mode 100644 index 00000000..f3e804ee --- /dev/null +++ b/include/public/nsacl/plistdef.h @@ -0,0 +1,62 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef PUBLIC_NSACL_PLISTDEF_H +#define PUBLIC_NSACL_PLISTDEF_H + +/* + * File: plistdef.h + * + * Description: + * + * This file defines the interface to property lists. Property + * lists are a generalization of parameter blocks (pblocks). + */ + +#ifndef PUBLIC_BASE_POOL_H +#include "../base/pool.h" +#endif /* !PUBLIC_BASE_POOL_H */ + +typedef struct PListStruct_s *PList_t; + +/* Define error codes returned from property list routines */ + +#define ERRPLINVPI -1 /* invalid property index */ +#define ERRPLEXIST -2 /* property already exists */ +#define ERRPLFULL -3 /* property list is full */ +#define ERRPLNOMEM -4 /* insufficient dynamic memory */ +#define ERRPLUNDEF -5 /* undefined property name */ + +#define PLFLG_OLD_MPOOL 0 /* use the plist memory pool */ +#define PLFLG_NEW_MPOOL 1 /* use the input memory pool */ +#define PLFLG_IGN_RES 2 /* ignore the reserved properties */ +#define PLFLG_USE_RES 3 /* use the reserved properties */ + +#ifdef __cplusplus +typedef void (PListFunc_t)(char*, const void*, void*); +#else +typedef void (PListFunc_t)(); +#endif + +#ifndef INTNSACL +#define PListAssignValue (*__nsacl_table->f_PListAssignValue) +#define PListCreate (*__nsacl_table->f_PListCreate) +#define PListDefProp (*__nsacl_table->f_PListDefProp) +#define PListDeleteProp (*__nsacl_table->f_PListDeleteProp) +#define PListFindValue (*__nsacl_table->f_PListFindValue) +#define PListInitProp (*__nsacl_table->f_PListInitProp) +#define PListNew (*__nsacl_table->f_PListNew) +#define PListDestroy (*__nsacl_table->f_PListDestroy) +#define PListGetValue (*__nsacl_table->f_PListGetValue) +#define PListNameProp (*__nsacl_table->f_PListNameProp) +#define PListSetType (*__nsacl_table->f_PListSetType) +#define PListSetValue (*__nsacl_table->f_PListSetValue) +#define PListEnumerate (*__nsacl_table->f_PListEnumerate) +#define PListDuplicate (*__nsacl_table->f_PListDuplicate) +#define PListGetPool (*__nsacl_table->f_PListGetPool) + +#endif /* !INTNSACL */ + +#endif /* !PUBLIC_NSACL_PLISTDEF_H */ diff --git a/include/public/nsapi.h b/include/public/nsapi.h new file mode 100644 index 00000000..3544fd20 --- /dev/null +++ b/include/public/nsapi.h @@ -0,0 +1,3481 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef PUBLIC_NSAPI_H +#define PUBLIC_NSAPI_H + +/* + * File: nsapi.h + * + * Description: + * + * This file defines an interface for extending the server with + * in-process plug-ins. + */ + +#include "base/systems.h" + +#if defined(FILE_UNIX_MMAP) || defined(FILE_WIN32_MMAP) +#define FILE_MMAP +#endif + +/* --- Begin miscellaneous definitions --- */ + +/* Used in some places as a length limit on error messages */ +#define MAGNUS_ERROR_LEN 1024 + +/* Carriage return and line feed */ +#define CR 13 +#define LF 10 +#ifdef XP_WIN32 +#define ENDLINE "\r\n" +#else +#define ENDLINE "\n" +#endif + +/* mime.types file identification line */ +#define NCC_MT_MAGIC "#--Netscape Communications Corporation MIME Information" +#define NCC_MT_MAGIC_LEN 55 + +/* Deprecated */ +#define MCC_MT_MAGIC "#--Mosaic Communications Corporation MIME Information" +#define MCC_MT_MAGIC_LEN 53 + +/* The character which separates extensions with cinfo_find */ +#define CINFO_SEPARATOR '.' + +/* The maximum length of a line in a mime.types file */ +#define CINFO_MAX_LEN 1024 + +/* + * The maximum length of an error message. NOT RUN-TIME CHECKED + */ + +#define MAX_ERROR_LEN 1024 + +/* A warning is a minor mishap, such as a 404 being issued. */ +#define LOG_WARN 0 + +/* + * A misconfig is when there is a syntax error or permission violation in + * a config. file. + */ +#define LOG_MISCONFIG 1 + +/* + * Security warnings are issued when authentication fails, or a host is + * given a 403 return code. + */ +#define LOG_SECURITY 2 + +/* + * A failure is when a request could not be fulfilled due to an internal + * problem, such as a CGI script exiting prematurely, or a filesystem + * permissions problem. + */ +#define LOG_FAILURE 3 + +/* + * A catastrophe is a fatal server error such as running out of + * memory or processes, or a system call failing, or even a server crash. + * The server child cannot recover from a catastrophe. + */ +#define LOG_CATASTROPHE 4 + +/* + * Informational message, of no concern. + */ +#define LOG_INFORM 5 + +/* + * Internal log messages to be logged. Internal use only. + * Enable with "LogVerbose on" in magnus.conf + */ +#define LOG_VERBOSE 6 + +/* + * The time format to use in the error log + */ + +#define ERR_TIMEFMT "[%d/%b/%Y:%H:%M:%S]" + + +/* The fd you will get if you are reporting errors to SYSLOG */ + +#define ERRORS_TO_SYSLOG -1 + +/* Return codes from file I/O routines */ +#define IO_OKAY 1 +#define IO_ERROR -1 +#define IO_EOF 0 +#define NETBUF_EOF -1 +#define NETBUF_ERROR -2 + +/* The disk page size on this machine. */ +#define FILE_BUFFERSIZE 4096 + +#ifdef XP_UNIX + +#define FILE_PATHSEP '/' +#define FILE_PARENT "../" + +#elif defined(XP_WIN32) + +#define FILE_PATHSEP '/' +#define FILE_PARENT "..\\" + +#endif /* XP_WIN32 */ + +#define NET_INFINITE_TIMEOUT 0 +#define NET_ZERO_TIMEOUT -1 + + +/* + * The following macros allow code to be written to use either the + * shell expression API defined here, or the regular expression + * pattern matching API defined in regexp.h. Regular expressions + * have a more complicated syntax, but also are more powerful. + * Define the symbol, USE_REGEX to use regular expressions. You + * can include either or both of shexp.h and regexp.h, regardless + * of whether USE_REGEX is defined or not, and the WILDPAT macros + * will be defined appropriately. + */ + +#ifdef USE_REGEX + +#define WILDPAT_VALID(exp) regexp_valid(exp) +#define WILDPAT_MATCH(str, exp) regexp_match(str, exp) +#define WILDPAT_CMP(str, exp) regexp_cmp(str, exp) +#define WILDPAT_CASECMP(str, exp) regexp_casecmp(str, exp) +#define WILDPAT_USES_REGEXP 1 + +/* Define return codes from WILDPAT_VALID */ +#define NON_WILDPAT -1 /* exp is ordinary string */ +#define INVALID_WILDPAT -2 /* exp is an invalid pattern */ +#define VALID_WILDPAT 1 /* exp is a valid pattern */ + +#else + +/* WILDPAT uses shell expressions */ +#define WILDPAT_VALID(exp) shexp_valid(exp) +#define WILDPAT_MATCH(str, exp) shexp_match(str, exp) +#define WILDPAT_CMP(str, exp) shexp_cmp(str, exp) +#define WILDPAT_CASECMP(str, exp) shexp_casecmp(str, exp) +#define WILDPAT_USES_SHEXP 1 + +/* Define return codes from WILDPAT_VALID */ +#define NON_WILDPAT -1 /* exp is ordinary string */ +#define INVALID_WILDPAT -2 /* exp is an invalid pattern */ +#define VALID_WILDPAT 1 /* exp is a valid pattern */ + +#endif /* USE_REGEX */ + +/* Define return codes from regexp_valid and shexp_valid */ +#define NON_SXP NON_WILDPAT /* exp is an ordinary string */ +#define INVALID_SXP INVALID_WILDPAT /* exp is an invalid shell exp */ +#define VALID_SXP VALID_WILDPAT /* exp is a valid shell exp */ + +#ifdef USE_REGEX +/* and regexp versions */ +#define NON_REGEXP NON_SXP +#define INVALID_REGEXP INVALID_SXP +#define VALID_REGEXP VALID_SXP +#endif + +#define SYSTHREAD_DEFAULT_PRIORITY 16 + +/* The longest line in the configuration file */ +#define CONF_MAXLEN 16384 + +#define HTTP_DATE_LEN 128 +#ifdef XP_UNIX +#define HTTP_DATE_FMT "%A, %d-%b-%y %T GMT" +#else /* XP_WIN32 */ +#define HTTP_DATE_FMT "%A, %d-%b-%y %H:%M:%S GMT" +#endif /* XP_WIN32 */ + +/* HTTP status codes */ +#define PROTOCOL_CONTINUE 100 /* HTTP/1.1 */ +#define PROTOCOL_SWITCHING 101 /* HTTP/1.1 */ +#define PROTOCOL_OK 200 +#define PROTOCOL_CREATED 201 +#define PROTOCOL_NO_RESPONSE 204 +#define PROTOCOL_PARTIAL_CONTENT 206 +#define PROTOCOL_REDIRECT 302 +#define PROTOCOL_NOT_MODIFIED 304 +#define PROTOCOL_BAD_REQUEST 400 +#define PROTOCOL_UNAUTHORIZED 401 +#define PROTOCOL_FORBIDDEN 403 +#define PROTOCOL_NOT_FOUND 404 +#define PROTOCOL_METHOD_NOT_ALLOWED 405 /*HTTP/1.1 */ +#define PROTOCOL_PROXY_UNAUTHORIZED 407 +#define PROTOCOL_CONFLICT 409 /* HTTP/1.1 */ +#define PROTOCOL_LENGTH_REQUIRED 411 /*HTTP/1.1 */ +#define PROTOCOL_PRECONDITION_FAIL 412 /*HTTP/1.1 */ +#define PROTOCOL_ENTITY_TOO_LARGE 413 /*HTTP/1.1 */ +#define PROTOCOL_URI_TOO_LARGE 414 /*HTTP/1.1 */ +#define PROTOCOL_SERVER_ERROR 500 +#define PROTOCOL_NOT_IMPLEMENTED 501 +#define PROTOCOL_VERSION_NOT_SUPPORTED 505 /*HTTP/1.1 */ + +#define CURRENT_PROTOCOL_VERSION 101 + +/* Definitions for HTTP over SSL */ +#define HTTPS_PORT 443 +#define HTTPS_URL "https" + +/* Definitions for HTTP over TCP */ +#define HTTP_PORT 80 +#define HTTP_URL "http" + + +#define REQ_MAX_LINE 4096 + +/* + * The REQ_ return codes. These codes are used to determine what the server + * should do after a particular module completes its task. + * + * Func type functions return these as do many internal functions. + */ + +/* The function performed its task, proceed with the request */ +#define REQ_PROCEED 0 +/* The entire request should be aborted: An error occurred */ +#define REQ_ABORTED -1 +/* The function performed no task, but proceed anyway. */ +#define REQ_NOACTION -2 +/* Tear down the session and exit */ +#define REQ_EXIT -3 +/* Restart the entire request-response process */ +#define REQ_RESTART -4 + +/* --- End miscellaneous definitions --- */ + +/* --- Begin native platform includes --- */ + +#if defined(FILE_UNIX) || defined(FILE_UNIX_MMAP) +#include /* caddr_t */ +#include +#include +#include +#endif + +#ifdef FILE_WIN32 +#include +#endif /* FILE_WIN32 */ + +#ifdef NET_WINSOCK +#include +struct iovec { + char *iov_base; + unsigned iov_len; +}; +#else +#if !defined(SUNOS4) && !defined(HPUX) && !defined(LINUX) +#include +#endif +#include /* struct timeval */ +#include +#include /* sockaddr and in_addr */ +#include +#endif /* NET_WINSOCK */ + +#include + +#include /* isspace */ +#include +#include +#include +#include +#include +#include + +#ifdef XP_UNIX +#include +#include /* struct passwd */ +#endif /* XP_UNIX */ +#include "libadminutil/psetc.h" + +/* --- End native platform includes --- */ + +/* --- Begin type definitions --- */ + +#ifndef SYS_FILE_T +typedef void *SYS_FILE; +#define SYS_FILE_T void * +#endif /* !SYS_FILE_T */ + +#define SYS_ERROR_FD ((SYS_FILE)-1) + +#ifndef SYS_NETFD_T +typedef void *SYS_NETFD; +#define SYS_NETFD_T void * +#endif /* !SYS_NETFD_T */ + +/* Error value for a SYS_NETFD */ +#ifndef SYS_NET_ERRORFD +#define SYS_NET_ERRORFD ((SYS_NETFD)-1) +#endif /* !SYS_NET_ERRORFD */ + +/* + * Type: filebuffer, filebuf_t + * + * Description: + * + * This structure is used to represent a buffered file. On some + * systems the file may be memory-mapped. A filebuffer is created + * by filebuf_open(), and destroyed by filebuf_close(). + * + * Notes: + * + * Direct access to the members of this structure, not using + * macros defined here, is discouraged. + * + * The filebuf alias that used to be defined for this type was + * found to conflict with a C++ class of the same name, so it + * has been renamed to filebuf_t. + * + * The inbuf field used to be (char *), but is now (unsigned char *) + * to simplify handling of 8-bit data. The value returned by the + * filebuf_getc() macro is the (unsigned char) casted to (int), or + * an error code. Unfortunately, IO_EOF cannot be distinguished + * from a zero byte, but a new function, filebuf_iseof(), is + * provided that will indicate definitively whether EOF has been + * reached. + */ + +#ifdef FILE_MMAP + +/* Version of filebuffer when memory-mapped files are supported */ +typedef struct { + SYS_FILE fd; +#ifdef FILE_UNIX_MMAP + caddr_t fp; +#else /* FILE_WIN32_MMAP */ + HANDLE fdmap; + char *fp; +#endif /* FILE_UNIX_MMAP */ + int len; + + unsigned char *inbuf; /* for buffer_grab */ + int cursize; + + int pos; + char *errmsg; +} filebuffer; + +/* Return next character or IO_EOF */ +#define filebuf_getc(b) ((b)->pos == (b)->len ? IO_EOF : (int)((unsigned char *)(b)->fp)[(b)->pos++]) + +#define filebuf_iseof(b) ((b)->pos == (b)->len) + +#else + +/* Version of filebuffer with no memory-mapped file support */ +typedef struct { + SYS_FILE fd; + + int pos, cursize, maxsize; + unsigned char *inbuf; + char *errmsg; +} filebuffer; + +/* Return next character, IO_EOF, or IO_ERROR */ +#define filebuf_getc(b) \ + ((b)->pos != (b)->cursize ? (int)((b)->inbuf[(b)->pos++]) : filebuf_next(b,1)) + +#endif /* FILE_MMAP */ + +/* C++ streamio defines a filebuf class. */ +typedef filebuffer filebuf_t; + +#ifdef XP_WIN32 +/* Use a filebuffer to read data from a pipe */ +#define pipebuf_getc(b) \ + ((b)->pos != (b)->cursize ? (int)((b)->inbuf[(b)->pos++]) : pipebuf_next(b,1)) +#endif /* XP_WIN32 */ + +/* + * Type: netbuf + * + * Description: + * + * This structure is used to represent a buffered network socket. + * It is created by netbuf_open(), and destroyed by netbuf_close(). + * + * Notes: + * + * Direct access to the members of this structure, not using + * macros defined here, is discouraged. + * + * The inbuf field used to be (unsigned char *), but is now + * simply (char *). The value returned by the netbuf_getc() + * macro is (int). + */ + +typedef struct { + SYS_NETFD sd; + + int pos, cursize, maxsize, rdtimeout; +#ifdef XP_WIN32 + CHAR address[64]; +#endif /* XP_WIN32 */ + unsigned char *inbuf; + char *errmsg; +#ifndef XP_WIN32 + char address[64]; +#endif /* !XP_WIN32 */ +} netbuf; + +/* + * netbuf_getc gets a character from the given network buffer and returns + * it. (as an integer). + * + * It will return (int) IO_ERROR for an error and (int) IO_EOF for + * an error condition or EOF respectively. + */ + +#define netbuf_getc(b) \ + ((b)->pos != (b)->cursize ? (int)((b)->inbuf[(b)->pos++]) : netbuf_next(b,1)) + +/* + * buffer_error returns the last error that occurred with buffer. Don't use + * this unless you know an error occurred. Independent of network/file type. + */ + +#define buffer_error(b) ((b)->errmsg) + +/* + * Type: cinfo + * + * Description: + * + * This is a structure that captures the information in the name/value + * pairs on one line of a mime.types file. A cinfo structure is + * stored in the memory-resident database, indexed by each of the + * file extensions specified in the "exts" name/value pair. It + * defines various attributes of resources with names containing + * the specified file extensions. + * + * Notes: + * + * Pointers to cinfo structures returned by this API may or may not + * need to freed by the caller. See the individual function + * descriptions. + * + * The strings referenced by the fields of cinfo structures returned + * by this API should be considered read-only, and do not need to be + * freed by the caller, even when the cinfo structure does. + */ + +typedef struct { + char *type; + char *encoding; + char *language; +} cinfo; + + +typedef void* CONDVAR; +typedef void *COUNTING_SEMAPHORE; +typedef void* CRITICAL; + +#ifdef XP_UNIX +typedef struct passwd *PASSWD; +typedef DIR* SYS_DIR; +typedef struct dirent SYS_DIRENT; +#endif /* XP_UNIX */ + +#ifdef XP_WIN32 + +typedef struct { + char *d_name; +} dirent_s; + +typedef struct { + HANDLE dp; + WIN32_FIND_DATA fdata; + dirent_s de; +} dir_s; + +typedef dir_s* SYS_DIR; +typedef dirent_s SYS_DIRENT; + +#endif /* XP_WIN32 */ + +typedef struct { + char *name,*value; +} pb_param; + +struct pb_entry { + pb_param *param; + struct pb_entry *next; +}; + +typedef struct { + int hsize; + struct pb_entry **ht; +} pblock; + +#ifndef POOL_HANDLE_T +#define POOL_HANDLE_T +typedef void *pool_handle_t; +#endif + +#ifndef SEMAPHORE_T +typedef void *SEMAPHORE; +#define SEMAPHORE_T void * +#endif /* !SEMAPHORE_T */ + +#define SESSION_HASHSIZE 5 + +typedef struct PListStruct_s PListStruct_s; +typedef struct ACLListHandle ACLListHandle; + +typedef struct Session { + /* Client-specific information */ + pblock *client; + + SYS_NETFD csd; + netbuf *inbuf; + int csd_open; + + struct in_addr iaddr; + +#ifdef MCC_PROXY + int req_cnt; +#endif + +#ifdef MALLOC_POOLS + pool_handle_t *pool; +#endif /* MALLOC_POOLS */ + + void *clauth; /* ACL client authentication information */ + struct Session *next; + int fill; + struct sockaddr_in local_addr; /* local addr for this session*/ + + PListStruct_s *subject; +} Session; + +#if defined (SHMEM_UNIX_MMAP) || defined (SHMEM_WIN32_MMAP) +typedef struct { + void *data; /* the data */ +#ifdef SHMEM_WIN32_MMAP + HANDLE fdmap; +#endif /* SHMEM_WIN32_MMAP */ + int size; /* the maximum length of the data */ + + char *name; /* internal use: filename to unlink if exposed */ + SYS_FILE fd; /* internal use: file descriptor for region */ +} shmem_s; +#endif /* SHMEM_UNIX_MMAP || SHMEM_WIN32_MMAP */ + + +/* Define a handle for a thread */ +typedef void* SYS_THREAD; + +/* Define an error value for the thread handle */ +#define SYS_THREAD_ERROR NULL + +/* + * Hierarchy of httpd_object + * + * An object contains dtables. + * + * Each dtable is a table of directives that were entered of a certain type. + * There is one dtable for each unique type of directive. + * + * Each dtable contains an array of directives, each of which is equivalent + * to one directive that occurred in a config. file. + * + * It is up to the caller to determine how many dtables will be allocated + * and to keep track of which of their directive types maps to which dtable + * number. + */ + + +/* + * directive is a structure containing the protection and parameters to an + * instance of a directive within an httpd_object. + * + * param is the parameters, client is the protection. + */ + +typedef struct { + pblock *param; + pblock *client; +} directive; + +/* + * dtable is a structure for creating tables of directives + */ + +typedef struct { + int ni; + directive *inst; +} dtable; + +/* + * The httpd_object structure. + * + * The name pblock array contains the names for this object, such as its + * virtual location, its physical location, or its identifier. + * + * tmpl contains any templates allocated to this object. + */ + +typedef struct { + pblock *name; + + int nd; + dtable *dt; +} httpd_object; + +/* + * httpd_objset is a container for a bunch of objects. obj is a + * NULL-terminated array of objects. pos points to the entry after the last + * one in the array. You should not mess with pos, but can read it to find + * the last entry. + * + * The initfns array is a NULL-terminated array of the Init functions + * associated with this object set. If there are no Init functions associated + * with this object set, initfns can be NULL. Each pblock specifies the + * parameters which are passed to the function when it's executed. + */ + +typedef struct { + int pos; + httpd_object **obj; + + pblock **initfns; +} httpd_objset; + + +typedef struct { + + /* What port we listen to */ + int Vport; +#define server_portnum conf_getglobals()->Vport + + /* What address to bind to */ + char *Vaddr; + + /* User to run as */ +#define user_pw conf_getglobals()->Vuserpw + struct passwd *Vuserpw; + + /* Directory to chroot to */ + char *Vchr; + + /* Where to log our pid to */ + char *Vpidfn; + +#define pool_max conf_getglobals()->Vpool_max + int Vpool_max; /* OBSOLETE */ +#define pool_min conf_getglobals()->Vpool_min + int Vpool_min; /* OBSOLETE */ +#define pool_life conf_getglobals()->Vpool_life + int Vpool_life; /* OBSOLETE */ + + /* For multiprocess UNIX servers, the maximum threads per process */ +#define pool_maxthreads conf_getglobals()->Vpool_maxthreads + int Vpool_maxthreads; + +#define pool_minthreads conf_getglobals()->Vpool_minthreads + int Vpool_minthreads; /* OBSOLETE */ + + char *Vsecure_keyfn; + char *Vsecure_certfn; + +#define security_active conf_getglobals()->Vsecurity_active + int Vsecurity_active; +#define ssl3_active conf_getglobals()->Vssl3_active + int Vssl3_active; +#define ssl2_active conf_getglobals()->Vssl2_active + int Vssl2_active; + int Vsecure_auth; +#define security_session_timeout conf_getglobals()->Vsecurity_session_timeout + int Vsecurity_session_timeout; +#define ssl3_session_timeout conf_getglobals()->Vssl3_session_timeout + long Vssl3_session_timeout; + + /* The server's hostname as should be reported in self-ref URLs */ +#define server_hostname conf_getglobals()->Vserver_hostname + char *Vserver_hostname; + + /* The main object from which all are derived */ +#define root_object conf_getglobals()->Vroot_object + char *Vroot_object; + + /* The object set the administrator has asked us to load */ +#define std_os conf_getglobals()->Vstd_os + httpd_objset *Vstd_os; + + /* The root of ACL data structures */ + void *Vacl_root; +#define acl_root conf_getglobals()->Vacl_root + + /* The main error log, where all errors are logged */ +#define master_error_log conf_getglobals()->Vmaster_error_log + char *Vmaster_error_log; + + /* The server root ( in which the server sits while executing ) */ +#define server_root conf_getglobals()->Vserver_root + char *Vserver_root; + + /* This server's id */ +#define server_id conf_getglobals()->Vserver_id + char *Vserver_id; + + int single_accept; /* daemon mode Internal use only */ + int num_keep_alives; /* number of KA threads Internal use only */ + int log_verbose; /* Flag to log LOG_VERBOSE messages */ + int mmap_flags; /* mmap flags for file cache mmaping - internal use only */ + int mmap_prots; /* mmap prots for file cache mmaping - internal use only */ + int unused1; + int unused2; + + /* Begin Enterprise 3.0 fields */ + int accept_language; /* turn accept-language on/off */ + + char *mtahost; /* Hostname of the Mail Transport Agent : + * typically "localhost" for the Unix boxes, + * or the hostname of a POP server otherwise. + * Needed by the Agents subsystem. + */ + char *nntphost; /* NNTP server -> for Agents */ + + /* The root of ACL data structures */ + void *Vacl_root_30; +#define acl_root_30 conf_getglobals()->Vacl_root_30 + + /* This is for the agent subsystem */ + /* The name of tha configuration parameter is: "AgentsFilePath" */ + char* agentFilePath; /* path to agent.conf */ +#define AgentFilePath (conf_getglobals()->agentFilePath) + + /* Default allowed methods - */ + int Allowed; +#define AllowedMethods (conf_getglobals()->Allowed) + + pblock *genericGlobals; /* See conf_api.h for details on accessing + * these + */ + + /*Agents ACL file */ + char* agentsACLFile; + int wait_for_cgi; + int cgiwatch_timeout; + +#ifdef FORTEZZA + uint32 fortezza_card_mask; + char *fortezza_personality; + char *krlname; +#endif +} conf_global_vars_s; + +typedef struct { + /* Server working variables */ + pblock *vars; + + /* The method, URI, and protocol revision of this request */ + pblock *reqpb; + /* Protocol specific headers */ + int loadhdrs; + pblock *headers; + + /* Server's response headers */ + int senthdrs; + pblock *srvhdrs; + + /* The object set constructed to fulfill this request */ + httpd_objset *os; + /* Array of objects that were created from .nsconfig files */ + httpd_objset *tmpos; + + /* The stat last returned by request_stat_path */ + char *statpath; + char *staterr; + struct stat *finfo; + + /* access control state */ + int aclstate; /* ACL decision state */ + int acldirno; /* deciding ACL directive number */ + char * aclname; /* name of deciding ACL */ + pblock * aclpb; /* parameter block for ACL PathCheck */ + /* 3.0 ACL list pointer */ + ACLListHandle *acllist; + +#ifdef MCC_PROXY + struct hostent *hp; /* proxy NSAPI: DNS resolution result */ + char * host; /* proxy NSAPI: host to resolve/connect to */ + int port; /* proxy NSAPI: port to connect to */ + + void * socks_rq; /* SOCKS request data */ +#endif + + int request_is_cacheable; /* default TRUE */ + int directive_is_cacheable; /* default FALSE */ + + char *cached_headers; + int cached_headers_len; /* length of the valid headers */ + char *unused; + + /* HTTP/1.1 features */ + time_t req_start; /* Time request arrived - used for determining weak or*/ + /* strong cache validation */ +#define REQ_TIME(x) (x)->req_start + short protv_num; /* Protocol Version number */ + short method_num; /* Method number */ + struct rq_attr { +#ifdef AIX + unsigned abs_uri:1; /* 1=Absolute URI was used */ + unsigned chunked:1; /* chunked transfer-coding */ + unsigned keep_alive:1; /* connection keek-alive */ + unsigned pipelined:1; /* request packet is pipelined */ + unsigned reserved:28; /* If you add a bit flag, make */ + /* sure to subtract one from this */ +#else + unsigned long abs_uri:1; /* 1=Absolute URI was used */ + unsigned long chunked:1; /* chunked transfer-coding */ + unsigned long keep_alive:1; /* connection keek-alive */ + unsigned pipelined:1; /* request packet is pipelined */ + unsigned long reserved:28; /* If you add a bit flag, make */ + /* sure to subtract one from this */ +#endif + }rq_attr; + char * hostname; /* Not NULL if abs_uri */ + int allowed; /* Allowed METHODs for this server */ + int byterange; /* number of byte ranges */ + short status_num; /* Status code */ + + int staterrno; /* used for rqstat */ +} Request; + +/* Request attribute macros */ +#define ABS_URI(x) (x)->rq_attr.abs_uri +#define CHUNKED(x) (x)->rq_attr.chunked +#define KEEP_ALIVE(x) (x)->rq_attr.keep_alive +#define PIPELINED(x) (x)->rq_attr.pipelined + +/* Define METHODS for HTTP/1.1 */ +#define METHOD_HEAD 0 +#define METHOD_GET 1 +#define METHOD_PUT 2 +#define METHOD_POST 3 +#define METHOD_DELETE 4 +#define METHOD_TRACE 5 +#define METHOD_OPTIONS 6 +/* The following methods are Netscape method extensions */ +#define METHOD_MOVE 7 +#define METHOD_INDEX 8 +#define METHOD_MKDIR 9 +#define METHOD_RMDIR 10 +#define METHOD_COPY 11 +#define METHOD_MAX 12 /* Number of methods available on this server */ + +#define ISMGET(r) ((r)->method_num == METHOD_GET) +#define ISMHEAD(r) ((r)->method_num == METHOD_HEAD) +#define ISMPUT(r) ((r)->method_num == METHOD_PUT) +#define ISMPOST(r) ((r)->method_num == METHOD_POST) +#define ISMDELETE(r) ((r)->method_num == METHOD_DELETE) +#define ISMMOVE(r) ((r)->method_num == METHOD_MOVE) +#define ISMINDEX(r) ((r)->method_num == METHOD_INDEX) +#define ISMMKDIR(r) ((r)->method_num == METHOD_MKDIR) +#define ISMRMDIR(r) ((r)->method_num == METHOD_RMDIR) +#define ISMCOPY(r) ((r)->method_num == METHOD_COPY) +#define ISMTRACE(r) ((r)->method_num == METHOD_TRACE) +#define ISMOPTIONS(r) ((r)->method_num == METHOD_OPTIONS) + +/* + * FuncPtr is a pointer to our kind of functions + */ + +#ifdef XP_UNIX +typedef int Func(pblock *, Session *, Request *); +#else /* XP_WIN32 */ +typedef int _cdecl Func(pblock *, Session *, Request *); +#endif /* XP_WIN32 */ + +typedef Func *FuncPtr; + +/* + * FuncStruct is a structure used in the static declaration of the + * functions. This static declaration is parsed into a hash table at + * startup. You should initialize the next entry to NULL. + */ + +struct FuncStruct { + char *name; + FuncPtr func; + struct FuncStruct *next; + int flags; +}; + +/* --- End type definitions --- */ + +/* --- Begin dispatch vector table definition --- */ + +typedef struct nsapi_dispatch_s nsapi_dispatch_t; +struct nsapi_dispatch_s { + char *(*f_system_version)(); + void *(*f_system_malloc)(int size); + void *(*f_system_calloc)(int size); + void *(*f_system_realloc)(void *ptr, int size); + void (*f_system_free)(void *ptr); + char *(*f_system_strdup)(const char *ptr); + void *(*f_system_malloc_perm)(int size); + void *(*f_system_calloc_perm)(int size); + void *(*f_system_realloc_perm)(void *ptr, int size); + void (*f_system_free_perm)(void *ptr); + char *(*f_system_strdup_perm)(const char *ptr); + int (*f_getThreadMallocKey)(void); + void (*f_magnus_atrestart)(void (*fn)(void *), void *data); + filebuf_t *(*f_filebuf_open)(SYS_FILE fd, int sz); + netbuf *(*f_netbuf_open)(SYS_NETFD sd, int sz); + filebuf_t *(*f_filebuf_create)(SYS_FILE fd, caddr_t mmap_ptr, + int mmap_len, int bufsz); + void (*f_filebuf_close_buffer)(filebuf_t *buf, int clean_mmap); +#ifdef FILE_MMAP + filebuf_t *(*f_filebuf_open_nostat)(SYS_FILE fd, int sz, + struct stat *finfo); +#else + void *(*f_filebuf_open_nostat)(void); +#endif +#ifdef XP_WIN32 + filebuf_t *(*f_pipebuf_open)(SYS_FILE fd, int sz, struct stat *finfo); +#else + void *(*f_pipebuf_open)(void); +#endif /* XP_WIN32 */ +#ifndef FILE_MMAP + int (*f_filebuf_next)(filebuf_t *buf, int advance); +#else + int (*f_filebuf_next)(void); +#endif /* !FILE_MMAP */ + int (*f_netbuf_next)(netbuf *buf, int advance); +#ifdef XP_WIN32 + int (*f_pipebuf_next)(filebuf_t *buf, int advance); +#else + int (*f_pipebuf_next)(void); +#endif /* XP_WIN32 */ + void (*f_filebuf_close)(filebuf_t *buf); + void (*f_netbuf_close)(netbuf *buf); +#ifdef XP_WIN32 + void (*f_pipebuf_close)(filebuf_t *buf); +#else + void (*f_pipebuf_close)(void); +#endif /* XP_WIN32 */ + int (*f_filebuf_grab)(filebuf_t *buf, int sz); + int (*f_netbuf_grab)(netbuf *buf, int sz); +#ifdef XP_WIN32 + int (*f_pipebuf_grab)(filebuf_t *buf, int sz); +#else + int (*f_pipebuf_grab)(void); +#endif /* XP_WIN32 */ + int (*f_netbuf_buf2sd)(netbuf *buf, SYS_NETFD sd, int len); + int (*f_filebuf_buf2sd)(filebuf_t *buf, SYS_NETFD sd); +#ifdef XP_WIN32 + int (*f_pipebuf_buf2sd)(filebuf_t *buf, SYS_NETFD sd, int len); + int (*f_pipebuf_netbuf2sd)(netbuf *buf, SYS_FILE sd, int len); + int (*f_pipebuf_netbuf2pipe)(netbuf *buf, SYS_NETFD sd, int len); +#else + int (*f_pipebuf_buf2sd)(void); + int (*f_pipebuf_netbuf2sd)(void); + int (*f_pipebuf_netbuf2pipe)(void); +#endif /* XP_WIN32 */ + void (*f_cinfo_init)(void); + void (*f_cinfo_terminate)(void); + char *(*f_cinfo_merge)(char *fn); + cinfo *(*f_cinfo_find)(char *uri); + cinfo *(*f_cinfo_lookup)(char *type); + void (*f_cinfo_dump_database)(FILE *dump); + CRITICAL (*f_crit_init)(void); + void (*f_crit_enter)(CRITICAL id); + void (*f_crit_exit)(CRITICAL id); + void (*f_crit_terminate)(CRITICAL id); + CONDVAR (*f_condvar_init)(CRITICAL id); + void (*f_condvar_wait)(CONDVAR cv); + void (*f_condvar_notify)(CONDVAR cv); + void (*f_condvar_notifyAll)(CONDVAR cv); + void (*f_condvar_terminate)(CONDVAR cv); + COUNTING_SEMAPHORE (*f_cs_init)(int initial_count); + void (*f_cs_terminate)(COUNTING_SEMAPHORE csp); + int (*f_cs_wait)(COUNTING_SEMAPHORE csp); + int (*f_cs_trywait)(COUNTING_SEMAPHORE csp); + int (*f_cs_release)(COUNTING_SEMAPHORE csp); + void (*f_daemon_atrestart)(void (*fn)(void *), void *data); +#ifdef FORTEZZA + /* THIS IS BOGUS... WHO Decided to export servssl_init!!! It should not + * be a public function. + */ + void (*f_servssl_init)(void); +#else + void (*f_servssl_init)(PsetHndl pset, PRFileDesc *fd, char *admRoot); +#endif + int (*f_ereport)(int degree, char *fmt, ...); + int (*f_ereport_v)(int degree, char *fmt, va_list args); + char *(*f_ereport_init)(char *err_fn, char *email, + PASSWD pwuser, char *version); + void (*f_ereport_terminate)(void); + SYS_FILE (*f_ereport_getfd)(void); + SYS_FILE (*f_system_fopenRO)(char *path); + SYS_FILE (*f_system_fopenWA)(char *path); + SYS_FILE (*f_system_fopenRW)(char *path); + SYS_FILE (*f_system_fopenWT)(char *path); + int (*f_system_fread)(SYS_FILE fd, char *buf, int sz); + int (*f_system_fwrite)(SYS_FILE fd,char *buf,int sz); + int (*f_system_fwrite_atomic)(SYS_FILE fd, char *buf, int sz); + int (*f_system_lseek)(SYS_FILE fd, int off, int wh); + int (*f_system_fclose)(SYS_FILE fd); + int (*f_system_stat)(char *name, struct stat *finfo); + int (*f_system_rename)(char *oldpath, char *newpath); + int (*f_system_unlink)(char *path); + int (*f_system_tlock)(SYS_FILE fd); + int (*f_system_flock)(SYS_FILE fd); + int (*f_system_ulock)(SYS_FILE fd); +#ifdef XP_WIN32 + SYS_DIR (*f_dir_open)(char *path); + SYS_DIRENT *(*f_dir_read)(SYS_DIR ds); + void (*f_dir_close)(SYS_DIR ds); +#else + void *(*f_dir_open)(void); + void *(*f_dir_read)(void); + void (*f_dir_close)(void); +#endif /* XP_WIN32 */ + int (*f_dir_create_all)(char *dir); +#ifdef XP_WIN32 + char *(*f_system_winsockerr)(void); + char *(*f_system_winerr)(void); + int (*f_system_pread)(SYS_FILE fd, char *buf, int sz); + int (*f_system_pwrite)(SYS_FILE fd, char *buf, int sz); + void (*f_file_unix2local)(char *path, char *p2); +#else + void *(*f_system_winsockerr)(void); + void *(*f_system_winerr)(void); + int (*f_system_pread)(void); + int (*f_system_pwrite)(void); + void (*f_file_unix2local)(void); +#endif /* XP_WIN32 */ + int (*f_system_nocoredumps)(void); + int (*f_file_setinherit)(SYS_FILE fd, int value); + int (*f_file_notfound)(void); + char *(*f_system_errmsg)(void); + int (*f_system_errmsg_fn)(char **buff, size_t maxlen); + SYS_NETFD (*f_net_socket)(int domain, int type, int protocol); + int (*f_net_listen)(SYS_NETFD s, int backlog); + SYS_NETFD (*f_net_create_listener)(char *ipaddr, int port); + int (*f_net_connect)(SYS_NETFD s, const void *sockaddr, int namelen); + int (*f_net_getpeername)(SYS_NETFD s, struct sockaddr *name, int *namelen); + int (*f_net_close)(SYS_NETFD s); + int (*f_net_bind)(SYS_NETFD s, const struct sockaddr *name, int namelen); + SYS_NETFD (*f_net_accept)(SYS_NETFD s, struct sockaddr *addr, int *addrlen); + int (*f_net_read)(SYS_NETFD sd, char *buf, int sz, int timeout); + int (*f_net_write)(SYS_NETFD sd, char *buf, int sz); + int (*f_net_writev)(SYS_NETFD sd, struct iovec *iov, int iovlen); + int (*f_net_isalive)(SYS_NETFD sd); + char *(*f_net_ip2host)(char *ip, int verify); + int (*f_net_getsockopt)(SYS_NETFD s, int level, int optname, + void *optval, int *optlen); + int (*f_net_setsockopt)(SYS_NETFD s, int level, int optname, + const void *optval, int optlen); + int (*f_net_select)(int nfds, fd_set *r, fd_set *w, fd_set *e, + struct timeval *timeout); + int (*f_net_ioctl)(SYS_NETFD s, int tag, void *result); + pb_param *(*f_param_create)(char *name, char *value); + int (*f_param_free)(pb_param *pp); + pblock *(*f_pblock_create)(int n); + void (*f_pblock_free)(pblock *pb); + char *(*f_pblock_findval)(const char *name, pblock *pb); + pb_param *(*f_pblock_nvinsert)(const char *name, const char *value, pblock *pb); + pb_param *(*f_pblock_nninsert)(const char *name, int value, pblock *pb); + void (*f_pblock_pinsert)(pb_param *pp, pblock *pb); + int (*f_pblock_str2pblock)(const char *str, pblock *pb); + char *(*f_pblock_pblock2str)(pblock *pb, char *str); + void (*f_pblock_copy)(pblock *src, pblock *dst); + pblock *(*f_pblock_dup)(pblock *src); + char **(*f_pblock_pb2env)(pblock *pb, char **env); + pb_param *(*f_pblock_fr)(const char *name, pblock *pb, int remove); + char * (*f_pblock_replace)(const char *name,char * new_value,pblock *pb); + pool_handle_t *(*f_pool_create)(void); + void (*f_pool_destroy)(pool_handle_t *pool_handle); + int (*f_pool_enabled)(void); + void *(*f_pool_malloc)(pool_handle_t *pool_handle, size_t size ); + void (*f_pool_free)(pool_handle_t *pool_handle, void *ptr ); + void *(*f_pool_calloc)(pool_handle_t *pool_handle, size_t nelem, size_t elsize); + void *(*f_pool_realloc)(pool_handle_t *pool_handle, void *ptr, size_t size ); + char *(*f_pool_strdup)(pool_handle_t *pool_handle, const char *orig_str ); +#if defined(MCC_PROXY) && defined(USE_REGEX) + int (*f_regexp_valid)(char *exp); + int (*f_regexp_match)(char *str, char *exp); + int (*f_regexp_cmp)(char *str, char *exp); + int (*f_regexp_casecmp)(char *str, char *exp); +#else + int (*f_regexp_valid)(void); + int (*f_regexp_match)(void); + int (*f_regexp_cmp)(void); + int (*f_regexp_casecmp)(void); +#endif + SEMAPHORE (*f_sem_init)(char *name, int number); + void (*f_sem_terminate)(SEMAPHORE id); + int (*f_sem_grab)(SEMAPHORE id); + int (*f_sem_tgrab)(SEMAPHORE id); + int (*f_sem_release)(SEMAPHORE id); + Session *(*f_session_alloc)(SYS_NETFD csd, struct sockaddr_in *sac); /* internal */ + Session *(*f_session_fill)(Session *sn); /* internal */ + Session *(*f_session_create)(SYS_NETFD csd, struct sockaddr_in *sac); + void (*f_session_free)(Session *sn); + char *(*f_session_dns_lookup)(Session *sn, int verify); + int (*f_shexp_valid)(char *exp); + int (*f_shexp_match)(char *str, char *exp); + int (*f_shexp_cmp)(char *str, char *exp); + int (*f_shexp_casecmp)(char *str, char *exp); +#if defined (SHMEM_UNIX_MMAP) || defined (SHMEM_WIN32_MMAP) + shmem_s *(*f_shmem_alloc)(char *name, int size, int expose); + void (*f_shmem_free)(shmem_s *region); +#else + void *(*f_shmem_alloc)(void); + void (*f_shmem_free)(void); +#endif /* SHMEM_UNIX_MMAP || SHMEM_WIN32_MMAP */ + SYS_THREAD (*f_systhread_start)(int prio, int stksz, void (*fn)(void *), void *arg); + SYS_THREAD (*f_systhread_current)(void); + void (*f_systhread_yield)(void); + SYS_THREAD (*f_systhread_attach)(void); + void (*f_systhread_detach)(SYS_THREAD thr); + void (*f_systhread_terminate)(SYS_THREAD thr); + void (*f_systhread_sleep)(int milliseconds); + void (*f_systhread_init)(char *name); + void (*f_systhread_timerset)(int usec); + int (*f_systhread_newkey)(void); + void *(*f_systhread_getdata)(int key); + void (*f_systhread_setdata)(int key, void *data); + void (*f_systhread_set_default_stacksize)(unsigned long size); + int (*f_util_getline)(filebuffer *buf, int lineno, int maxlen, char *l); + char **(*f_util_env_create)(char **env, int n, int *pos); + char *(*f_util_env_str)(char *name, char *value); + void (*f_util_env_replace)(char **env, char *name, char *value); + void (*f_util_env_free)(char **env); + char **(*f_util_env_copy)(char **src, char **dst); + char *(*f_util_env_find)(char **env, char *name); + char *(*f_util_hostname)(void); + int (*f_util_chdir2path)(char *path); + int (*f_util_is_mozilla)(char *ua, char *major, char *minor); + int (*f_util_is_url)(char *url); + int (*f_util_later_than)(struct tm *lms, char *ims); + int (*f_util_time_equal)(struct tm *lms, char *ims); + int (*f_util_str_time_equal)(char *t1, char *t2); + int (*f_util_uri_is_evil)(char *t); + void (*f_util_uri_parse)(char *uri); + void (*f_util_uri_unescape)(char *s); + char *(*f_util_uri_escape)(char *d, char *s); + char *(*f_util_url_escape)(char *d, char *s); + char *(*f_util_sh_escape)(char *s); + int (*f_util_mime_separator)(char *sep); + int (*f_util_itoa)(int i, char *a); + int (*f_util_vsprintf)(char *s, register const char *fmt, va_list args); + int (*f_util_sprintf)(char *s, const char *fmt, ...); + int (*f_util_vsnprintf)(char *s, int n, register const char *fmt, + va_list args); + int (*f_util_snprintf)(char *s, int n, const char *fmt, ...); + int (*f_util_strftime)(char *s, const char *format, const struct tm *t); + char *(*f_util_strtok)(char *s1, const char *s2, char **lasts); + struct tm *(*f_util_localtime)(const time_t *clock, struct tm *res); + char *(*f_util_ctime)(const time_t *clock, char *buf, int buflen); + char *(*f_util_strerror)(int errnum, char *msg, int buflen); + struct tm *(*f_util_gmtime)(const time_t *clock, struct tm *res); + char *(*f_util_asctime)(const struct tm *tm,char *buf, int buflen); +#ifdef NEED_STRCASECMP + int (*f_util_strcasecmp)(CASECMPARG_T char *one, CASECMPARG_T char *two); +#else + int (*f_util_strcasecmp)(void); +#endif /* NEED_STRCASECMP */ +#ifdef NEED_STRNCASECMP + int (*f_util_strncasecmp)(CASECMPARG_T char *one, CASECMPARG_T char *two, int n); +#else + int (*f_util_strncasecmp)(void); +#endif /* NEED_STRNCASECMP */ +#ifdef XP_UNIX + int (*f_util_can_exec)(struct stat *finfo, uid_t uid, gid_t gid); + struct passwd *(*f_util_getpwnam)(const char *name, struct passwd + *result, char *buffer, int buflen); + pid_t (*f_util_waitpid)(pid_t pid, int *statptr, int options); +#else + int (*f_util_can_exec)(void); + void *(*f_util_getpwnam)(void); + int (*f_util_waitpid)(void); +#endif /* XP_UNIX */ +#ifdef XP_WIN32 + VOID (*f_util_delete_directory)(char *FileName, BOOL delete_directory); +#else + void (*f_util_delete_directory)(void); +#endif /* XP_WIN32 */ + char *(*f_conf_init)(char *cfn); + char *(*f_conf_run_init_functions)(void); + void (*f_conf_terminate)(void); + conf_global_vars_s *(*f_conf_getglobals)(void); + void (*f_func_init)(struct FuncStruct *func_standard); + FuncPtr (*f_func_find)(char *name); + int (*f_func_exec)(pblock *pb, Session *sn, Request *rq); + struct FuncStruct *(*f_func_insert)(char *name, FuncPtr fn); + int (*f_object_execute)(directive *inst, Session *sn, void *rq); + Request *(*f_http_find_request)(netbuf *buf, Session *sn, int *reply); + int (*f_http_parse_request)(char *t, Request *rq, Session *sn); + int (*f_http_scan_headers)(Session *sn, netbuf *buf, char *t, + pblock *headers); + int (*f_http_start_response)(Session *sn, Request *rq); + char **(*f_http_hdrs2env)(pblock *pb); + void (*f_http_status)(Session *sn, Request *rq, int n, char *r); + int (*f_http_set_finfo)(Session *sn, Request *rq, struct stat *finfo); + char *(*f_http_dump822)(pblock *pb, char *t, int *pos, int tsz); + void (*f_http_finish_request)(Session *sn, Request *rq); + void (*f_http_handle_session)(Session *sn); + char *(*f_http_uri2url)(const char *prefix, const char *suffix); + char *(*f_http_uri2url_dynamic)(const char *prefix, const char *suffix, + Session *sn, Request *rq); + void (*f_http_set_keepalive_timeout)(int secs); + int (*f_log_error_v)(int degree, char *func, Session *sn, Request *rq, + char *fmt, va_list args); + int (*f_log_error)(int degree, char *func, Session *sn, Request *rq, + char *fmt, ...); + int (*f_log_ereport_v)(int degree, char *fmt, va_list args); + int (*f_log_ereport)(int degree, char *fmt, ...); + httpd_object *(*f_object_create)(int nd, pblock *name); + void (*f_object_free)(httpd_object *obj); + void (*f_object_add_directive)(int dc, pblock *p, pblock *c, + httpd_object *obj); + httpd_objset *(*f_objset_scan_buffer)(filebuffer *buf, char *errstr, + httpd_objset *os); + httpd_objset *(*f_objset_create)(void); + void (*f_objset_free)(httpd_objset *os); + void (*f_objset_free_setonly)(httpd_objset *os); + httpd_object *(*f_objset_new_object)(pblock *name, httpd_objset *os); + void (*f_objset_add_object)(httpd_object *obj, httpd_objset *os); + void (*f_objset_add_init)(pblock *initfn, httpd_objset *os); + httpd_object *(*f_objset_findbyname)(char *name, httpd_objset *ign, + httpd_objset *os); + httpd_object *(*f_objset_findbyppath)(char *ppath, httpd_objset *ign, + httpd_objset *os); + Request *(*f_request_create)(void); + void (*f_request_free)(Request *req); + Request *(*f_request_restart_internal)(char *uri, Request *rq); + int (*f_request_header)(char *name, char **value, Session *sn, + Request *rq); + struct stat *(*f_request_stat_path)(char *path, Request *rq); + char *(*f_conf_getServerString)(void); + FuncPtr (*f_func_replace)(char *funcname, FuncPtr fn); + int (*f_net_socketpair)(SYS_NETFD *pair); +#ifdef XP_UNIX + SYS_NETFD (*f_net_dup2)(SYS_NETFD prfd, int osfd); + int (*f_net_is_STDOUT)(SYS_NETFD prfd); + int (*f_net_is_STDIN)(SYS_NETFD prfd); +#else + void *(*f_net_dup2)(void); + int (*f_net_is_STDOUT)(void); + int (*f_net_is_STDIN)(void); +#endif /* XP_UNIX */ + int (*f_func_set_native_thread_flag)(char *name, int flags); + void *(*f_random_create)(void); + void (*f_random_update)(void *rctx, unsigned char *inbuf, int length); + void (*f_random_generate)(void *rctx, unsigned char *outbuf, int length); + void (*f_random_destroy)(void *rctx); + void *(*f_md5hash_create)(void); + void *(*f_md5hash_copy)(void *hctx); + void (*f_md5hash_begin)(void *hctx); + void (*f_md5hash_update)(void *hctx, unsigned char *inbuf, int length); + void (*f_md5hash_end)(void *hctx, unsigned char *outbuf); + void (*f_md5hash_destroy)(void *hctx); + void (*f_md5hash_data)(unsigned char *outbuf, unsigned char *src, int length); + int (*f_ACL_SetupEval)(struct ACLListHandle *acllist, Session *sn, Request *rq, char **rights, char **map_generic, const char *user); + int (*f_netbuf_getbytes)(netbuf *buf, char *buffer, int size); + char *(*f_servact_translate_uri)(char *uri, Session *sn); + +}; + +/* --- End dispatch vector table definition --- */ + +/* --- Begin API macro definitions --- */ + +#ifndef INTNSAPI + +#define system_version (*__nsapi30_table->f_system_version) + +/* + Depending on the system, memory allocated via these macros may come from + an arena. If these functions are called from within an Init function, they + will be allocated from permanent storage. Otherwise, they will be freed + when the current request is finished. + */ + +#define MALLOC (*__nsapi30_table->f_system_malloc) +#define system_malloc (*__nsapi30_table->f_system_malloc) + +#define CALLOC (*__nsapi30_table->f_system_calloc) +#define system_calloc (*__nsapi30_table->f_system_calloc) + +#define REALLOC (*__nsapi30_table->f_system_realloc) +#define system_realloc (*__nsapi30_table->f_system_realloc) + +#define FREE (*__nsapi30_table->f_system_free) +#define system_free (*__nsapi30_table->f_system_free) + +#define STRDUP (*__nsapi30_table->f_system_strdup) +#define system_strdup (*__nsapi30_table->f_system_strdup) + +#ifndef NS_MALLOC_DEBUG + +/* + These macros always provide permanent storage, for use in global variables + and such. They are checked at runtime to prevent them from returning NULL. + */ + +#define PERM_MALLOC (*__nsapi30_table->f_system_malloc_perm) +#define system_malloc_perm (*__nsapi30_table->f_system_malloc_perm) + +#define PERM_CALLOC (*__nsapi30_table->f_system_calloc_perm) +#define system_calloc_perm (*__nsapi30_table->f_system_calloc_perm) + +#define PERM_REALLOC (*__nsapi30_table->f_system_realloc_perm) +#define system_realloc_perm (*__nsapi30_table->f_system_realloc_perm) + +#define PERM_FREE (*__nsapi30_table->f_system_free_perm) +#define system_free_perm (*__nsapi30_table->f_system_free_perm) + +#define PERM_STRDUP (*__nsapi30_table->f_system_strdup_perm) +#define system_strdup_perm (*__nsapi30_table->f_system_strdup_perm) + +#endif /* !NS_MALLOC_DEBUG */ + +/* Thread-Private data key index for accessing the thread-private memory pool. + * Each thread creates its own pool for allocating data. The MALLOC/FREE/etc + * macros have been defined to check the thread private data area with the + * thread_malloc_key index to find the address for the pool currently in use. + * + * If a thread wants to use a different pool, it must change the thread-local- + * storage[thread_malloc_key]. + */ + +#define getThreadMallocKey (*__nsapi30_table->f_getThreadMallocKey) + +#define magnus_atrestart (*__nsapi30_table->f_magnus_atrestart) + +/* + * buffer_open opens a new buffer reading the specified file, with an I/O + * buffer of size sz, and returns a new buffer structure which will hold + * the data. + * + * If FILE_UNIX_MMAP is defined, this may return NULL. If it does, check + * system_errmsg to get a message about the error. + */ + +#define filebuf_open (*__nsapi30_table->f_filebuf_open) +#define netbuf_open (*__nsapi30_table->f_netbuf_open) + +/* + * filebuf_open_nostat is a convenience function for mmap() buffer opens, + * if you happen to have the stat structure already. + */ + +#ifdef FILE_MMAP +#define filebuf_open_nostat (*__nsapi30_table->f_filebuf_open_nostat) +#endif /* FILE_MMAP */ + +/* + * filebuf_create is a convenience function if the file is already open + * or mmap'd. It creates a new filebuf for use with the mmap'd file. + * If mmap_ptr is NULL, or MMAP is not supported on this system, it + * creates a buffer with buffer size bufsz. + */ + +#define filebuf_create (*__nsapi30_table->f_filebuf_create) + +/* + * filebuf_close_buffer is provided to cleanup a filebuf without closing + * the underlying file. If clean_mmap is 1, and the file is memory mapped, + * the file will be unmapped. If clean_mmap is 0, the file will not + * be unmapped. + */ +#define filebuf_close_buffer (*__nsapi30_table->f_filebuf_close_buffer) + +#ifdef FILE_MMAP +#define filebuf_open_nostat (*__nsapi30_table->f_filebuf_open_nostat) +#endif + +#ifdef XP_WIN32 +#define pipebuf_open (*__nsapi30_table->f_pipebuf_open) +#endif /* XP_WIN32 */ + +/* + * buffer_next loads size more bytes into the given buffer and returns the + * first one, or BUFFER_EOF on EOF and BUFFER_ERROR on error. + */ + +#ifndef FILE_MMAP +#define filebuf_next (*__nsapi30_table->f_filebuf_next) +#endif /* !FILE_MMAP */ +#define netbuf_next (*__nsapi30_table->f_netbuf_next) +#ifdef XP_WIN32 +#define pipebuf_next (*__nsapi30_table->f_pipebuf_next) +#endif /* XP_WIN32 */ + +/* + * buffer_close deallocates a buffer and closes its associated files + * (does not close a network socket). + */ + +#define filebuf_close (*__nsapi30_table->f_filebuf_close) +#define netbuf_close (*__nsapi30_table->f_netbuf_close) +#ifdef XP_WIN32 +#define pipebuf_close (*__nsapi30_table->f_pipebuf_close) +#endif /* XP_WIN32 */ + +/* + * buffer_grab will set the buffer's inbuf array to an array of sz bytes + * from the buffer's associated object. It returns the number of bytes + * actually read (between 1 and sz). It returns IO_EOF upon EOF or IO_ERROR + * upon error. The cursize entry of the structure will reflect the size + * of the iobuf array. + * + * The buffer will take care of allocation and deallocation of this array. + */ + +#define filebuf_grab (*__nsapi30_table->f_filebuf_grab) +#define netbuf_grab (*__nsapi30_table->f_netbuf_grab) +#ifdef XP_WIN32 +#define pipebuf_grab (*__nsapi30_table->f_pipebuf_grab) +#endif /* XP_WIN32 */ + +/* + * netbuf_getbytes will read bytes from the netbuf into the user + * supplied buffer. Up to size bytes will be read. + * If the call is successful, the number of bytes read is returned. + * NETBUF_EOF is returned when no more data will arrive on the socket, + * and NETBUF_ERROR is returned in the event of an error. + * + */ +#define netbuf_getbytes (*__nsapi30_table->f_netbuf_getbytes) + + +/* + * netbuf_buf2sd will send n bytes from the (probably previously read) + * buffer and send them to sd. If sd is -1, they are discarded. If n is + * -1, it will continue until EOF is recieved. Returns IO_ERROR on error + * and the number of bytes sent any other time. + */ + +#define netbuf_buf2sd (*__nsapi30_table->f_netbuf_buf2sd) + +/* + * filebuf_buf2sd assumes that nothing has been read from the filebuf, + * and just sends the file out to the given socket. Returns IO_ERROR on error + * and the number of bytes sent otherwise. + * + * Does not currently support you having read from the buffer previously. This + * can be changed transparently. + */ + +#define filebuf_buf2sd (*__nsapi30_table->f_filebuf_buf2sd) + +#ifdef XP_WIN32 + +/* + * NT pipe version of filebuf_buf2sd. + */ +#define pipebuf_buf2sd (*__nsapi30_table->f_pipebuf_buf2sd) + +/* + * NT pipe version of netbuf_buf2sd. + */ + +#define pipebuf_netbuf2sd (*__nsapi30_table->f_pipebuf_netbuf2sd) +#define pipebuf_netbuf2pipe (*__nsapi30_table->f_pipebuf_netbuf2pipe) +#endif /* XP_WIN32 */ + +/* + * Notes: + * + * Format of a mime.types file + * + * A mime.types file passed to cinfo_merge() should begin with + * a line containing NCC_MT_MAGIC as defined below (MCC_MT_MAGIC + * is also still supported). Lines containing only whitespace + * and lines beginning with "#" are ignored. Other lines contain + * one or more name/value pairs, separated by whitespace. The + * format of each of these is NAME=VALUE, where NAME is one of: + * + * type - VALUE is a mime type, e.g. text/html + * exts - VALUE is a list of file extensions, e.g. htm,html + * enc - VALUE specifies a content encoding, e.g. x-gzip + * lang - VALUE specifies a content language, e.g. en-US + * (see RFC1766) + * + * The VALUE may be enclosed in quotes (" "), and should be if it + * contains whitespace. + * + * Each line in the file that contains at least one name/value + * pair causes a cinfo structure to be created, containing the + * specified information. These structures are kept in memory + * and can be queried using cinfo_find(). + * + * Related information + * + * See the NSAPI "load-types" function. + */ + +/* + * Function: cinfo_init + * + * Description: + * + * This function initializes the memory resident content information + * database to be empty. + * + * Notes: + * + * This function is called by the NSAPI "load-types" function, + * which also sets up a call to cinfo_terminate() on server restart. + * If "load-types" is used, it should be unnecessary to call this + * function. + */ + +#define cinfo_init (*__nsapi30_table->f_cinfo_init) + +/* + * Function: cinfo_terminate + * + * Description: + * + * This function frees all dynamic memory associated with the + * memory resident content information database, and leaves the + * database empty. cinfo_init() should be called before using + * the database again. + */ + +#define cinfo_terminate (*__nsapi30_table->f_cinfo_terminate) + +/* + * Function: cinfo_merge + * + * Description: + * + * This function reads a mime.types formatted file of the specified + * name. Content information in the file is merged into the + * memory resident content information database. + * + * Arguments: + * + * fn - name of mime.types formatted file + * + * Returns: + * + * If successful, NULL is returned. If an error occurs, the return + * value is a pointer to a descriptive error string, which should + * be freed by the caller (using FREE()). Information processed + * prior to the error will still be added to the database. + */ + +#define cinfo_merge (*__nsapi30_table->f_cinfo_merge) + + +/* + * Function: cinfo_find + * + * Description: + * + * This function is used to retrieve content information based on + * a file extension contained in the argument string, which might + * be either a URI or a file name. It ignores any text up to and + * including the last FILE_PATHSEP character in the argument + * string. It looks for one or more file extensions in the + * remaining string, each one starting with a CINFO_SEPARATOR + * character. Each file extension is looked up in the database + * and any information found there is used to build a composite + * cinfo structure, containing information derived from each of + * the file extensions. If more than one file extensions present + * have a particular piece of information associated with them + * in the database (e.g. type or language), the value returned in + * the composite cinfo structure is taken from the data for the + * last file extension to provide that attribute. + * + * Arguments: + * + * uri - pointer to the argument string + * + * Returns: + * + * If successful, a pointer to the composite cinfo structure is + * returned. The fields of this structure reference values of + * those fields in one or more cinfo structures in the database, + * so these values should be copied if they are going to be + * modified. The cinfo structure itself should be freed by the + * caller using FREE(). If an error occurs, a null pointer is + * returned. If no information is found for any of the extensions, + * a null pointer is returned, although this is not necessarily + * an error. + * + * Notes: + * + * The matching of extensions in the argument string to extensions + * in the database is case-insensitive. + * + * The argument string is modified during parsing, but only + * temporarily. It should be intact on return. + */ + +#define cinfo_find (*__nsapi30_table->f_cinfo_find) + +/* + * Function: cinfo_lookup + * + * Description: + * + * This function returns a pointer to the last cinfo structure + * added to the database for a specified mime type. Unlike + * cinfo_find(), the returned pointer references a cinfo structure + * that is part of the database, and corresponds to a single line + * in a mime.types file. This structure should be considered + * read-only, and should not be freed by the caller. + * + * Arguments: + * + * type - a pointer to a mime type string + * + * Returns: + * + * If the specified type is found, a pointer to the cinfo structure + * returned. Otherwise a null pointer is returned. + * + * Notes: + * + * The search for the type is case-insensitive. + */ + +#define cinfo_lookup (*__nsapi30_table->f_cinfo_lookup) + +/* + * Function: cinfo_dump_database + * + * Description: + * + * This function outputs, to a specified file, formatted text + * describing the contents of the content information database. + * This is intended for debugging purposes. It is not in mime.types + * format. + * + * Arguments: + * + * dump - handle for already open output file + */ + +#define cinfo_dump_database (*__nsapi30_table->f_cinfo_dump_database) + +/* + * Critical section abstraction. Used in threaded servers to protect + * areas where two threads can interfere with each other. + * + * Condvars are condition variables that are used for thread-thread + * synchronization. + */ + +/* + * crit_init creates and returns a new critical section variable. At the + * time of creation no one has entered it. + */ +#define crit_init (*__nsapi30_table->f_crit_init) + +/* + * crit_enter enters a critical section. If someone is already in the + * section, the calling thread is blocked until that thread exits. + */ +#define crit_enter (*__nsapi30_table->f_crit_enter) + +/* + * crit_exit exits a critical section. If another thread is blocked waiting + * to enter, it will be unblocked and given ownership of the section. + */ +#define crit_exit (*__nsapi30_table->f_crit_exit) + +/* + * crit_terminate removes a previously allocated critical section variable. + */ +#define crit_terminate (*__nsapi30_table->f_crit_terminate) + +/* + * condvar_init initializes and returns a new condition variable. You + * must provide a critical section to be associated with this condition + * variable. + */ +#define condvar_init (*__nsapi30_table->f_condvar_init) + +/* + * condvar_wait blocks on the given condition variable. The calling thread + * will be blocked until another thread calls condvar_notify on this variable. + * The caller must have entered the critical section associated with this + * condition variable prior to waiting for it. + */ +#define condvar_wait (*__nsapi30_table->f_condvar_wait) + +/* + * condvar_notify awakens any threads blocked on the given condition + * variable. The caller must have entered the critical section associated + * with this variable first. + */ +#define condvar_notify (*__nsapi30_table->f_condvar_notify) + +/* + * condvar_notify awakens all threads blocked on the given condition + * variable. The caller must have entered the critical section associated + * with this variable first. + */ +#define condvar_notifyAll (*__nsapi30_table->f_condvar_notifyAll) + +/* + * condvar_terminate frees the given previously allocated condition variable + */ +#define condvar_terminate (*__nsapi30_table->f_condvar_terminate) + +/* + * Create a counting semaphore. + * Return non-zero on success, 0 on failure. + */ +#define cs_init (*__nsapi30_table->f_cs_init) + +/* + * Destroy a counting semaphore + */ +#define cs_terminate (*__nsapi30_table->f_cs_terminate) + +/* + * Wait to "enter" the semaphore. + * Return 0 on success, -1 on failure. + */ +#define cs_wait (*__nsapi30_table->f_cs_wait) + +/* + * Enter the semaphore if the count is > 0. Otherwise return -1. + * + */ +#define cs_trywait (*__nsapi30_table->f_cs_trywait) + +/* + * Release the semaphore- allowing a thread to enter. + * Return 0 on success, -1 on failure. + */ +#define cs_release (*__nsapi30_table->f_cs_release) + +/* + * daemon_atrestart registers a function to be called fn, with the given + * void pointer as an argument, when the server is restarted. + */ +#define daemon_atrestart (*__nsapi30_table->f_daemon_atrestart) + +#define servssl_init (*__nsapi30_table->f_servssl_init) + +/* + * ereport logs an error of the given degree and formats the arguments with + * the printf() style fmt. Returns whether the log was successful. Records + * the current date. + */ + +#define ereport (*__nsapi30_table->f_ereport) +#define ereport_v (*__nsapi30_table->f_ereport_v) + +/* + * ereport_init initializes the error logging subsystem and opens the static + * file descriptors. It returns NULL upon success and an error string upon + * error. If a userpw is given, the logs will be chowned to that user. + * + * email is the address of a person to mail upon catastrophic error. It + * can be NULL if no e-mail is desired. ereport_init will not duplicate + * its own copy of this string; you must make sure it stays around and free + * it when you shut down the server. + */ + +#define ereport_init (*__nsapi30_table->f_ereport_init) + +/* + * log_terminate closes the error and common log file descriptors. + */ +#define ereport_terminate (*__nsapi30_table->f_ereport_terminate) + +/* For restarts */ +#define ereport_getfd (*__nsapi30_table->f_ereport_getfd) + +/* FUNCTION: system_fopenXX + * DESCRIPTION: + * system_fopenRO - Open a disk file for read-only access. + * system_fopenWA - Open a disk file for write and append access. + * system_fopenRW - Open a disk file for read-write access. + * system_fopenWT - Open a disk file for write and truncate access. + * INPUTS: + * path- the name of the file + * OUTPUTS: + * none + * RETURNS: + * SYS_ERRORFD on failure + * A opaque file handle on success + * RESTRICTIONS: + * The return from this function should not be interpreted as a native + * file handle. It may only be used in other calls to system_xxx(). + * + * Note for unix programmers: Although this routine is called + * "system_fopen" do not consider it to be equivalent to the unix + * "fopen" call, which opens a buffered-IO file. + */ +#define system_fopenRO (*__nsapi30_table->f_system_fopenRO) +#define system_fopenWA (*__nsapi30_table->f_system_fopenWA) +#define system_fopenRW (*__nsapi30_table->f_system_fopenRW) +#define system_fopenWT (*__nsapi30_table->f_system_fopenWT) + +/* FUNCTION: system_fread + * DESCRIPTION: + * Read from a file + * INPUTS: + * fd- an open file handle to read from + * buf- a buffer to receive data + * sz- the number of bytes to read from the file + * OUTPUTS: + * none + * RETURNS: + * less-than-zero on failure + * 0 for end-of-file + * positive for number of bytes read + * RESTRICTIONS: + */ +#define system_fread (*__nsapi30_table->f_system_fread) + +/* FUNCTION: system_write + * DESCRIPTION: + * Writes sz bytes from buf to file fd. + * INPUTS: + * fd- the file to write to + * buf- the buffer containing data to be written + * sz- the size of data to write. + * OUTPUTS: + * none + * RETURNS: + * IO_OKAY on success + * IO_ERROR on failure + * RESTRICTIONS: + * There is no way to determine if bytes were written when this call fails. + * For more specific information, use PR_WRITE(). + */ +#define system_fwrite (*__nsapi30_table->f_system_fwrite) + +/* FUNCTION: system_fwrite_atomic + * DESCRIPTION: + * system_fwrite_atomic locks the given fd before writing to it. This + * avoids interference between simultaneous writes. + * INPUTS: + * fd- the file to write to + * buf- the buffer containing data to be written + * sz- the size of data to write. + * OUTPUTS: + * none + * RETURNS: + * IO_OKAY on success + * IO_ERROR on failure + * RESTRICTIONS: + */ +#define system_fwrite_atomic (*__nsapi30_table->f_system_fwrite_atomic) + +/* FUNCTION: system_lseek + * DESCRIPTION: + * Seek to a position in a file + * INPUTS: + * fd- an open file handle + * off + * wh + * OUTPUTS: + * RETURNS: + * RESTRICTIONS: + */ +#define system_lseek (*__nsapi30_table->f_system_lseek) + +/* FUNCTION: system_fclose + * DESCRIPTION: + * Close a file. + * INPUTS: + * fd- an open file handle from a previous system_fopenXX call. + * OUTPUTS: + * none + * RETURNS: + * IO_OKAY on success + * IO_ERROR on failure + * RESTRICTIONS: + */ +#define system_fclose (*__nsapi30_table->f_system_fclose) + +/* FUNCTION: system_stat + * DESCRIPTION: + * Get information about a file on disk + * INPUTS: + * name- the name of the file to be queried + * OUTPUTS: + * finfo- a buffer to receive the file information. + * RETURN: + * less-than-zero on failure. + * 0 on success. + * RESTRICTIONS: + * Within the stat structure, this routine is only guaranteed to return + * st_mode, st_size, st_ctime, and st_mtime. Other stat fields are + * undefined. + */ +#define system_stat (*__nsapi30_table->f_system_stat) + +/* --- File manipulation --------------------------------------------- */ + +/* FUNCTION: system_rename + * DESCRIPTION: + * Rename a file on disk. + * INPUTS: + * oldpath- old file name + * newpath- new file name + * OUTPUTS: + * none + * RETURNS: + * less-than-zero on failure + * 0 on success + * RESTRICTIONS: + * Not guaranteed to work portably on files which are in use. + */ +#define system_rename (*__nsapi30_table->f_system_rename) + +/* FUNCTION: system_unlink + * DESCRIPTION: + * Remove a file from disk. + * INPUTS: + * path- the file to delete + * OUTPUTS: + * none + * RETURNS: + * less-than-zero on failure + * 0 on success + * RESTRICTIONS: + * Not guaranteed to work portably on files which are in use. + */ +#define system_unlink (*__nsapi30_table->f_system_unlink) + +/* --- File locking -------------------------------------------------- */ + +#define system_initlock(fd) (0) + +/* FUNCTION: system_tlock + * DESCRIPTION: + * Test for a file lock and grab it if it is available + * INPUTS: + * fd- the file to lock + * OUTPUTS: + * none + * RETURNS: + * 0 - if we now hold the lock + * less-than-zero if the lock is held by someone else + * RESTRICTIONS: + * 1. file locking is process based. Two threads in the same process + * requesting exclusive access will both be allowed to access the file + * at the same time. + */ +#define system_tlock (*__nsapi30_table->f_system_tlock) + +/* FUNCTION: system_flock + * DESCRIPTION: + * Wait for exclusive access to a file + * INPUTS: + * fd- the file to lock + * OUTPUTS: + * none + * RETURNS: + * 0 - if we now hold the lock + * less-than-zero if an error occurred + * RESTRICTIONS: + * 1. file locking is process based. Two threads in the same process + * requesting exclusive access will both be allowed to access the file + * at the same time. + */ +#define system_flock (*__nsapi30_table->f_system_flock) + +/* FUNCTION: system_ulock + * DESCRIPTION: + * Release exclusive access to a file + * INPUTS: + * fd- the file to lock + * OUTPUTS: + * none + * RETURNS: + * 0 - if we released the lock + * less-than-zero if an error occurred + * RESTRICTIONS: + * 1. file locking is process based. Two threads in the same process + * requesting exclusive access will both be allowed to access the file + * at the same time. + */ +#define system_ulock (*__nsapi30_table->f_system_ulock) + +/* --- Directory manipulation routines ---------------------------------- */ + +#ifdef XP_WIN32 +#define dir_open (*__nsapi30_table->f_dir_open) +#define dir_read (*__nsapi30_table->f_dir_read) +#define dir_close (*__nsapi30_table->f_dir_close) +#endif /* XP_WIN32 */ + +/* + * create a directory and any of its parents + */ +#define dir_create_all (*__nsapi30_table->f_dir_create_all) + +#ifdef XP_WIN32 +#define system_winsockerr (*__nsapi30_table->f_system_winsockerr) +#define system_winerr (*__nsapi30_table->f_system_winerr) +#define system_pread (*__nsapi30_table->f_system_pread) +#define system_pwrite (*__nsapi30_table->f_system_pwrite) +#define file_unix2local (*__nsapi30_table->f_file_unix2local) +#endif /* XP_WIN32 */ + +#define system_nocoredumps (*__nsapi30_table->f_system_nocoredumps) +#define file_setinherit (*__nsapi30_table->f_file_setinherit) +#define file_notfound (*__nsapi30_table->f_file_notfound) +#define system_errmsg (*__nsapi30_table->f_system_errmsg) +#define system_errmsg_fn (*__nsapi30_table->f_system_errmsg_fn) + +/* FUNCTION: net_socket + * DESCRIPTION: + * Create a new socket. + * INPUTS: + * domain- only supported type is AF_INET + * type- only supported type is SOCK_STREAM + * protocol- only supported value is 0 + * OUTPUTS: + * none + * RETURNS: + * SYS_NET_ERRORFD on errro + * a valid SYS_NETFD on success + * RESTRICTIONS: + */ +#define net_socket (*__nsapi30_table->f_net_socket) + +/* FUNCTION: net_listen + * DESCRIPTION: + * Set listen backlog for a socket. + * INPUTS: + * s- the socket + * backlog- value of backlog to set + * OUTPUTS: + * RETURNS: + * 0 on success + * less-than-zero on failure + * RESTRICTIONS: + * Some systems do not return errors even when the requested backlog + * cannot be set (it is too high). Consult your system manual for + * details on the maximum value of the backlog. + */ +#define net_listen (*__nsapi30_table->f_net_listen) + +/* FUNCTION: net_create_listener + * DESCRIPTION: + * Creates a socket for accepting new connection. + * INPUTS: + * OUTPUTS: + * RETURNS: + * SYS_NET_ERRORFD on error. + * RESTRICTIONS: + * This is a convenience routine which creates a socket, binds to + * an IP address and port, and sets the listen backlog to + * net_listenqsize. + */ +#define net_create_listener (*__nsapi30_table->f_net_create_listener) + +/* FUNCTION: net_connect + * DESCRIPTION: + * Connect a socket to a remote listener + * INPUTS: + * OUTPUTS: + * RETURNS: + * 0 on success + * less-than-zero on error + * RESTRICTIONS: + */ +#define net_connect (*__nsapi30_table->f_net_connect) + +/* FUNCTION: net_getpeername + * DESCRIPTION: + * Get the socket address (IP address/port) of the remote host. + * INPUTS: + * s- the socket + * name - the socket address of the remote + * OUTPUTS: + * RETURNS: + * RESTRICTIONS: + */ +#define net_getpeername (*__nsapi30_table->f_net_getpeername) + +/* FUNCTION: net_close + * DESCRIPTION: + * Close an open socket + * INPUTS: + * s- the socket to close + * OUTPUTS: + * none + * RETURNS: + * 0 on success + * less-than-zero on failure + * RESTRICTIONS: + */ +#define net_close (*__nsapi30_table->f_net_close) + +/* FUNCTION: net_bind + * DESCRIPTION: + * Bind to a socket address + * INPUTS: + * s- + * name- + * namelen- + * OUTPUTS: + * RETURNS: + * RESTRICTIONS: + */ +#define net_bind (*__nsapi30_table->f_net_bind) + +/* FUNCTION: net_accept + * DESCRIPTION: + * Accept a connection on a listener socket. + * INPUTS: + * s + * addr + * OUTPUTS: + * addrlen + * RETURNS: + * RESTRICTIONS: + */ +#define net_accept (*__nsapi30_table->f_net_accept) + +/* FUNCTION: net_read + * DESCRIPTION: + * sd + * buf + * sz + * timeout + * INPUTS: + * OUTPUTS: + * RETURNS: + * IO_ERROR on error + * 0 if the remote closes the socket + * positive representing the number of bytes successfully read + * RESTRICTIONS: + * timeout must be NET_ZERO_TIMEOUT, NET_INFINITE_TIMEOUT, or a positive + * value in seconds + */ +#define net_read (*__nsapi30_table->f_net_read) + +/* FUNCTION: net_write + * DESCRIPTION: + * Write data to a socket. + * INPUTS: + * sd + * buf + * sz + * OUTPUTS: + * RETURNS: + * RESTRICTIONS: + * net_write() is unbuffered. Specifying many calls to net_write() for + * small amounts of data is inefficient. + */ +#define net_write (*__nsapi30_table->f_net_write) + +/* FUNCTION: net_writev + * DESCRIPTION: + * Write vectored data to the socket. + * INPUTS: + * OUTPUTS: + * RETURNS: + * RESTRICTIONS: + * net_writev() is unbuffered. Specifying many calls to net_writev() for + * small amounts of data is inefficient. + */ +#define net_writev (*__nsapi30_table->f_net_writev) + +/* FUNCTION: net_isalive + * DESCRIPTION: + * Checks to see if the given socket is still connected to a remote + * host. The remote host does not see any side effects from this call. + * INPUTS: + * sd - the socket + * OUTPUTS: + * none + * RETURNS: + * 0 if the socket is no longer connected + * 1 if the socket is still connected. + * RESTRICTIONS: + */ +#define net_isalive (*__nsapi30_table->f_net_isalive) + +/* FUNCTION: net_ip2host + * DESCRIPTION: + * Transforms the given textual IP number into a fully qualified domain + * name (FQDN). This is similar to calling gethostbyaddr(). + * INPUTS: + * verify- If 1, specifies that the function should verify the hostname + * returned from the lookup. This is similar to calling + * gethostbyname() on the result of the call to gethostbyaddr(). + * OUTPUTS: + * RETURNS: + * The fully qualified domain name, or whatever it can find. + * If it cannot resolve the name at all, returns NULL. + * RESTRICTIONS: + * This function is governed by the use of the Server DNS cache. If caching + * is enabled it can take as long as 20 minutes before this function + * does the lookup again. + */ +#define net_ip2host (*__nsapi30_table->f_net_ip2host) + + +/* --- OBSOLETE ---------------------------------------------------------- + * The following macros/functions are obsolete and are only maintained for + * compatibility. Do not use them. + * ----------------------------------------------------------------------- + */ + +/* FUNCTION: net_getsockopt + * DESCRIPTION: + * Get socket options + * INPUTS: + * OUTPUTS: + * RETURNS: + * RESTRICTIONS: + * Because this function is not portable (not all systems support the + * same options), it should be used with caution. + */ +#define net_getsockopt (*__nsapi30_table->f_net_getsockopt) + +/* FUNCTION: net_setsockopt + * DESCRIPTION: + * Set socket options + * INPUTS: + * OUTPUTS: + * RETURNS: + * RESTRICTIONS: + * Because this function is not portable (not all systems support the + * same options), it should be used with caution. + */ +#define net_setsockopt (*__nsapi30_table->f_net_setsockopt) + +/* FUNCTION: net_select + * DESCRIPTION: + * Wait for IO on a set of sockets. + * INPUTS: + * OUTPUTS: + * RETURNS: + * -1 on error + * 0 on timeout + * positive value representing the number of IOs ready + * RESTRICTIONS: + * Because this function is not portable (not all systems support the + * same options), it should be used with caution. + */ +#define net_select (*__nsapi30_table->f_net_select) + +/* FUNCTION: net_ioctl + * DESCRIPTION: + * Set socket options. + * INPUTS: + * OUTPUTS: + * RETURNS: + * RESTRICTIONS: + * Because this function is not portable (not all systems support the + * same options), it should be used with caution. + */ +#define net_ioctl (*__nsapi30_table->f_net_ioctl) + +/* FUNCTION: net_socketpair + * DESCRIPTION: + * Creates a TCP socketpair. + * INPUTS: + * OUTPUTS: + * RETURNS: + * 0 on success + * -1 on failure + * RESTRICTIONS: + * Because this function is not portable (not all systems support the + * same options), it should be used with caution. + */ +#define net_socketpair (*__nsapi30_table->f_net_socketpair) + +#ifdef XP_UNIX +/* FUNCTION: net_dup2 + * DESCRIPTION: + * Duplicates a socket to a specific file descriptor + * INPUTS: + * OUTPUTS: + * RETURNS: + * RESTRICTIONS: + * Because this function is not portable (not all systems support the + * same options), it should be used with caution. + */ +#define net_dup2 (*__nsapi30_table->f_net_dup2) + +/* FUNCTION: net_is_STDOUT + * DESCRIPTION: + * Checks if the underlying OS file descriptor for the given + * SYS_NETFD is the STDOUT filedescriptor + * INPUTS: + * OUTPUTS: + * RETURNS: + * 1 if it is STDOUT (1) + * 0 otherwise + * RESTRICTIONS: + * Because this function is not portable (not all systems support the + * same options), it should be used with caution. + */ +#define net_is_STDOUT (*__nsapi30_table->f_net_is_STDOUT) + +/* FUNCTION: net_is_STDIN + * DESCRIPTION: + * Checks if the underlying OS file descriptor for the given + * SYS_NETFD is the STDIN filedescriptor + * INPUTS: + * OUTPUTS: + * RETURNS: + * 1 if it is STDIN (0) + * 0 otherwise + * RESTRICTIONS: + * Because this function is not portable (not all systems support the + * same options), it should be used with caution. + */ +#define net_is_STDIN (*__nsapi30_table->f_net_is_STDIN) +#endif /* XP_UNIX */ + +/* + * A parameter block is a set of name=value pairs which are generally used + * as parameters, but can be anything. They are kept in a hash table for + * reasonable speed, but if you are doing any intensive modification or + * access of them you should probably make a local copy of each parameter + * while working. + * + * When creating a pblock, you specify the hash table size for that pblock. + * You should set this size larger if you know that many items will be in + * that pblock, and smaller if only a few will be used or if speed is not + * a concern. + */ + +/* + * param_create creates a parameter with the given name and value. If name + * and value are non-NULL, they are copied and placed into the new pb_param + * struct. + */ + +#define param_create (*__nsapi30_table->f_param_create) + +/* + * param_free frees a given parameter if it's non-NULL, and returns 1 if + * p was non-NULL, and 0 if p was NULL. + * + * Useful for error checking pblock_remove. + */ + +#define param_free (*__nsapi30_table->f_param_free) + +/* + * pblock_create creates a new pblock with hash table size n. + * + * It returns the newly allocated pblock. + */ + +#define pblock_create (*__nsapi30_table->f_pblock_create) + +/* + * pblock_free frees the given pblock and any entries inside it. + * + * If you want to save anything in a pblock, remove its entities with + * pblock_remove first and save the pointers you get. + */ + +#define pblock_free (*__nsapi30_table->f_pblock_free) + +/* + * pblock_findval finds the entry with the given name in pblock pb, and + * returns its value, otherwise returns NULL. + */ + +#define pblock_findval (*__nsapi30_table->f_pblock_findval) + +/* + * pblock_nvinsert creates a new parameter with the given name and value + * and inserts it into pblock pb. The name and value in the parameter are + * also newly allocated. Returns the pb_param it allocated (in case you + * need it). + * + * pblock_nninsert inserts a numerical value. + */ + +#define pblock_nvinsert (*__nsapi30_table->f_pblock_nvinsert) +#define pblock_nninsert (*__nsapi30_table->f_pblock_nninsert) + +/* + * pblock_pinsert inserts a pb_param into a pblock. + */ + +#define pblock_pinsert (*__nsapi30_table->f_pblock_pinsert) + +/* + * pblock_str2pblock scans the given string str for parameter pairs + * name=value, or name="value". Any \ must be followed by a literal + * character. If a string value is found, with no unescaped = signs, it + * will be added with the name 1, 2, 3, etc. depending on whether it was + * first, second, third, etc. in the stream (zero doesn't count). + * + * Returns the number of parameters added to the table, or -1 upon error. + */ + +#define pblock_str2pblock (*__nsapi30_table->f_pblock_str2pblock) + +/* + * pblock_pblock2str places all of the parameters in the given pblock + * into the given string (NULL if it needs creation). It will re-allocate + * more space for the string. Each parameter is separated by a space and of + * the form name="value" + */ + +#define pblock_pblock2str (*__nsapi30_table->f_pblock_pblock2str) + +/* + * pblock_copy copies the entries in the given source pblock to the + * destination one. The entries are newly allocated so that the original + * pblock may be freed or the new one changed without affecting the other. + */ + +#define pblock_copy (*__nsapi30_table->f_pblock_copy) + +/* + * pblock_dup creates a new pblock and copies the given source pblock + * into it. The entries are newly allocated so that the original pblock + * may be freed or the new one changed without affecting the other. + */ + +#define pblock_dup (*__nsapi30_table->f_pblock_dup) + +/* + * pblock_pb2env copies the given pblock into the given environment, with + * one new env entry for each name/value pair in the pblock. + */ + +#define pblock_pb2env (*__nsapi30_table->f_pblock_pb2env) + +/* --------------------------- Internal things ---------------------------- */ +#define pblock_fr (*__nsapi30_table->f_pblock_fr) +#define pblock_replace (*__nsapi30_table->f_pblock_replace) + +/* pool_create() + * Function to create a new pool. + * Returns non-NULL on success, NULL on failure. + */ +#define pool_create (*__nsapi30_table->f_pool_create) + +/* pool_destroy() + * Frees all memory associated with a pool and destroys the pool. + */ +#define pool_destroy (*__nsapi30_table->f_pool_destroy) + +/* pool_enabled() + * Check if the pools are enabled and a pool is currently set + * for this thread. Return 1 if enabled, 0 if not enabled. + */ +#define pool_enabled (*__nsapi30_table->f_pool_enabled) + +#define pool_malloc (*__nsapi30_table->f_pool_malloc) +#define pool_free (*__nsapi30_table->f_pool_free) +#define pool_calloc (*__nsapi30_table->f_pool_calloc) +#define pool_realloc (*__nsapi30_table->f_pool_realloc) +#define pool_strdup (*__nsapi30_table->f_pool_strdup) + +/* + * regexp_valid takes a regular expression exp as input. It returns: + * + * NON_REGEXP if exp is a standard string + * (above not used -- always returns VALID_REGEXP!!) + * INVALID_REGEXP if exp is a regular expression, but invalid + * VALID_REGEXP if exp is a valid regular expression + */ + +#define regexp_valid (*__nsapi30_table->f_regexp_valid) + +/* + * regexp_match + * + * Takes a prevalidated shell expression exp, and a string str. + * + * Returns 0 on match and 1 on non-match. + */ + +#define regexp_match (*__nsapi30_table->f_regexp_match) + +/* + * regexp_cmp + * + * Same as above, but validates the exp first. 0 on match, 1 on non-match, + * -1 on invalid exp. regexp_casecmp does the same thing but is case + * insensitive. + */ + +#define regexp_cmp (*__nsapi30_table->f_regexp_cmp) +#define regexp_casecmp (*__nsapi30_table->f_regexp_casecmp) + +/* + * sem_init creates a semaphore using the given name and unique + * identification number. filename should be a file accessible to the + * process. Returns SEM_ERROR on error. + */ + +#define sem_init (*__nsapi30_table->f_sem_init) + +/* + * sem_terminate de-allocates the given semaphore. + */ + +#define sem_terminate (*__nsapi30_table->f_sem_terminate) + +/* + * sem_grab attempts to gain exclusive access to the given semaphore. If + * it can't get it, the caller will block. Returns -1 on error. + */ + +#define sem_grab (*__nsapi30_table->f_sem_grab) +#define sem_tgrab (*__nsapi30_table->f_sem_tgrab) + +/* + * sem_release releases this process's exclusive control over the given + * semaphore. Returns -1 on error. + */ + +#define sem_release (*__nsapi30_table->f_sem_release) + +/* + * session_create creates a new request structure for the client with the + * given socket descriptor and sockaddr. + */ + +#define session_alloc (*__nsapi30_table->f_session_alloc) +#define session_fill (*__nsapi30_table->f_session_fill) +#define session_create (*__nsapi30_table->f_session_create) + +/* + * session_free frees the given session + */ + +#define session_free (*__nsapi30_table->f_session_free) + +#define session_dns_lookup (*__nsapi30_table->f_session_dns_lookup) + +/* + * This describes the API for matching a string with a "shell expression". + * The expressions accepted are based loosely on the expressions accepted + * by zsh. A shell expression is a string pattern made up of ordinary + * characters and any of the types of pattern sequences listed below. + * + * Pattern Matches + * * zero or more characters + * ? exactly one character + * $ matches the end of string + * [abc] matches one instance of any of the characters + * enclosed in [] + * [a-z] matches one instance of any character in the + * specified range of characters + * [^abc] matches one instance of any character not + * in the enclosed set + * + * Backslash (\) is used to quote a character that would otherwise be + * considered part of a pattern sequence, e.g. "2\*2=4". + * + * The following composite shell expression structures are also + * recognized: + * + * shexp1~shexp2 matches any string that matches shexp1, + * unless the string also matches shexp2 + * + * Example: "*~*.netscape.com" matches any string that does + * not end with ".netscape.com" + * + * (shexp1|...|shexpN) matches any string that matches any one of + * the ()-enclosed, |-separated shell + * expressions. + */ + +/* Determine whether exp is a valid shell expression */ +#define shexp_valid (*__nsapi30_table->f_shexp_valid) + +/* + * shexp_match + * + * Takes a prevalidated shell expression exp, and a string str. + * + * Returns 0 on match and 1 on non-match. + */ + +#define shexp_match (*__nsapi30_table->f_shexp_match) + + +/* + * shexp_cmp + * + * Same as above, but validates the exp first. 0 on match, 1 on non-match, + * -1 on invalid exp. shexp_casecmp does the same thing but is case + * insensitive. + */ + +#define shexp_cmp (*__nsapi30_table->f_shexp_cmp) +#define shexp_casecmp (*__nsapi30_table->f_shexp_casecmp) + +/* + * Regular expression API - Analogous to shell expression API + */ + +#define regexp_valid (*__nsapi30_table->f_regexp_valid) +#define regexp_match (*__nsapi30_table->f_regexp_match) +#define regexp_cmp (*__nsapi30_table->f_regexp_cmp) +#define regexp_casecmp (*__nsapi30_table->f_regexp_casecmp) + + +#if defined (SHMEM_UNIX_MMAP) || defined (SHMEM_WIN32_MMAP) + +/* + * shmem_alloc allocates a region of shared memory of the given size, using + * the given name to avoid conflicts between multiple regions within the + * program. The region will not be automatically grown if its boundaries + * are over-run, use shmem_realloc for that. + * + * If expose is non-zero and the underlying system supports it, the + * file used to create the shared region will be visible to other processes + * running on the system. + * + * name should be unique to the program which calls this routine, otherwise + * conflicts will arise. + * + * Returns a new shared memory region, with the data element being a + * pointer to the shared memory. This function must be called before any + * daemon workers are spawned, in order for the handle to the shared region + * to be inherited by the children. + * + * Because of the requirement that the region must be inherited by the + * children, the region cannot be re-allocated with a larger size when + * necessary. + */ +#define shmem_alloc (*__nsapi30_table->f_shmem_alloc) + +/* + * shmem_free de-allocates the specified region of shared memory. + */ +#define shmem_free (*__nsapi30_table->f_shmem_free) + +#endif /* SHMEM_UNIX_MMAP || SHMEM_WIN32_MMAP */ + +/* + * systhread_start creates a thread with the given priority, will allocate + * a stack of stksz bytes, and calls fn with arg as its argument. stksz + * of zero will allocate a default stack size. + * + * Returns a new SYS_THREAD pointer on success, SYS_THREAD_ERROR on failure. + * XXX Priorities are system dependent + */ + +#define systhread_start (*__nsapi30_table->f_systhread_start) + +/* + * systhread_current returns a handle for the current thread. + */ + +#define systhread_current (*__nsapi30_table->f_systhread_current) + +/* + * systhread_yield yields the processor to another thread + */ + +#define systhread_yield (*__nsapi30_table->f_systhread_yield) + +/* + * systhread_attach makes an existing thread an NSPR thread. + */ +#define systhread_attach (*__nsapi30_table->f_systhread_attach) + +/* + * Detaches a thread that was attached. + */ + +#define systhread_detach (*__nsapi30_table->f_systhread_detach) + +/* + * systhread_terminate terminates the thread that is passed in. + */ +#define systhread_terminate (*__nsapi30_table->f_systhread_terminate) + +/* + * systhread_sleep puts the calling thread to sleep for the given number + * of milliseconds. + */ +#define systhread_sleep (*__nsapi30_table->f_systhread_sleep) + +/* + * systhread_init initializes the threading system. name is a name for the + * program for debugging. + */ + +#define systhread_init (*__nsapi30_table->f_systhread_init) + +/* + * systhread_timerset starts or re-sets the interrupt timer for a thread + * system. This should be considered a suggestion as most systems don't allow + * the timer interval to be changed. + */ + +#define systhread_timerset (*__nsapi30_table->f_systhread_timerset) + +/* + * newkey allocates a new integer id for thread-private data. Use this + * key to identify a variable which you want to appear differently + * between threads, and then use setdata to associate a value with this + * key for each thread. + */ +#define systhread_newkey (*__nsapi30_table->f_systhread_newkey) + +/* + * Get data that has been previously associated with key in this thread. + * Returns NULL if setkey has not been called with this key by this + * thread previously, or the data that was previously used with setkey + * by this thread with this key. + */ +#define systhread_getdata (*__nsapi30_table->f_systhread_getdata) + +/* + * Associate data with the given key number in this thread. + */ +#define systhread_setdata (*__nsapi30_table->f_systhread_setdata) + +/* + * Set the default stack size for threads created via systhr_start + */ +#define systhread_set_default_stacksize (*__nsapi30_table->f_systhread_set_default_stacksize) + +/* + * A hodge podge of utility functions and standard functions which + * are unavailable on certain systems + */ + +/* + * getline scans in buf until it finds a LF or CRLF, storing the string in + * l. It will terminate the string and return: + * + * 0 when done, with the scanned line (minus CR or LF) in l + * 1 upon EOF, with the scanned line (minus CR or LF) in l + * -1 on error with the error description in l (uses lineno for information) + */ + +#define util_getline (*__nsapi30_table->f_util_getline) + +/* + * env_create creates a new environment with the given env, with n new + * entries, and places the current position that you should add your + * entries with at pos. + * + * If env is NULL, it will allocate a new one. If not, it will reallocate + * that one. + */ + +#define util_env_create (*__nsapi30_table->f_util_env_create) + +/* + * util_env_str allocates a string from the given name and value and + * returns it. It does not check for things like = signs in name. + */ + +#define util_env_str (*__nsapi30_table->f_util_env_str) + +/* + * env_replace replaces the occurrence of the given variable with the + * value you give. + */ + +#define util_env_replace (*__nsapi30_table->f_util_env_replace) + +/* + * util_env_free frees an environment. + */ + +#define util_env_free (*__nsapi30_table->f_util_env_free) + +/* + * util_env_copy copies an env + */ +#define util_env_copy (*__nsapi30_table->f_util_env_copy) + +/* + * util_env_find looks through env for the named string. Returns the + * corresponding value if the named string is found, or NULL if not. + */ +#define util_env_find (*__nsapi30_table->f_util_env_find) + +/* + * hostname gets the local hostname. Returns NULL if it can't find a FQDN. + * You are free to realloc or free this string. + */ + +#define util_hostname (*__nsapi30_table->f_util_hostname) + +/* + * chdir2path changes the current directory to the one that the file + * path is in. path should point to a file. Caveat: path must be a writable + * string. It won't get modified permanently. + */ + +#define util_chdir2path (*__nsapi30_table->f_util_chdir2path) + +/* + * is_mozilla checks if the given user-agent is mozilla, of at least + * the given major and minor revisions. These are strings to avoid + * ambiguities like 1.56 > 1.5 + */ + +#define util_is_mozilla (*__nsapi30_table->f_util_is_mozilla) + +/* + * is_url will return 1 if the given string seems to be a URL, or will + * return 0 otherwise. + * + * Because of stupid news URLs, this will return 1 if the string has + * all alphabetic characters up to the first colon and will not check for + * the double slash. + */ + +#define util_is_url (*__nsapi30_table->f_util_is_url) + +/* + * util_later_than checks the date in the string ims, and if that date is + * later than or equal to the one in the tm struct lms, then it returns 1. + * + * util_time_equal is above, but checks for exact equality. + * + * Handles RFC 822, 850, and ctime formats. + */ + +#define util_later_than (*__nsapi30_table->f_util_later_than) +#define util_time_equal (*__nsapi30_table->f_util_time_equal) + +/* + * util_str_time_equal checks the character-string dates are equal. + * Supports rfc1123 and rfc850 formats. t1 must be rfc1123 + * Returns 0 if equal, -1 otherwise + */ +#define util_str_time_equal (*__nsapi30_table->f_util_str_time_equal) + +/* + * util_uri_is_evil returns 1 if a URL has ../ or // in it. + */ +#define util_uri_is_evil (*__nsapi30_table->f_util_uri_is_evil) + +/* + * util_uri_parse gets rid of /../, /./, and //. + * + * Assumes that either the string starts with a /, or the string will + * not .. right off of its beginning. As such, ../foo.gif will + * not be changed, although /../foo.gif will become /foo.gif. + */ + +#define util_uri_parse (*__nsapi30_table->f_util_uri_parse) + +/* + * util_uri_unescape unescapes the given URI in place (% conversions only). + */ + +#define util_uri_unescape (*__nsapi30_table->f_util_uri_unescape) + +/* + * util_uri_escape escapes any nasty chars in s and copies the string into d. + * If d is NULL, it will allocate and return a properly sized string. + * Warning: does not check bounds on a given d. + * + * util_url_escape does the same thing but does it for a url, i.e. ?:+ is + * not escaped. + */ + +#define util_uri_escape (*__nsapi30_table->f_util_uri_escape) +#define util_url_escape (*__nsapi30_table->f_util_url_escape) + +/* + * util_sh_escape places a \ in front of any shell-special characters. + * Returns a newly-allocated copy of the string. + */ + +#define util_sh_escape (*__nsapi30_table->f_util_sh_escape) + +/* + * util_mime_separator generates a new MIME separator into the given buffer. + * The buffer should be more than 4 + 3*10 + 1 bytes long. A CRLF is prepended + * to the beginning of the string, along with two dashes. The string is null + * terminated, with no CRLF. The intent is that you create your content-type + * header by accessing &sep[4], and afterwards print sep followed by CRLF + * for message boundaries. + * + * Returns the length of the string. + */ +#define util_mime_separator (*__nsapi30_table->f_util_mime_separator) + +/* + * util_itoa converts the given integer to a string into a. + */ + +#define util_itoa (*__nsapi30_table->f_util_itoa) + +/* + * util_vsprintf and util_sprintf are simplified clones of the System V + * vsprintf and sprintf routines. + * + * Returns the number of characters printed. Only handles %d and %s, + * does not handle any width or precision. + */ + +#define util_vsprintf (*__nsapi30_table->f_util_vsprintf) +#define util_sprintf (*__nsapi30_table->f_util_sprintf) + +/* These routines perform bounds checks. */ +#define util_vsnprintf (*__nsapi30_table->f_util_vsnprintf) +#define util_snprintf (*__nsapi30_table->f_util_snprintf) + +/* util_strftime() + * Thread safe version of strftime. + * No bounds checking is done s. t must be a valid tm structure. + */ +#define util_strftime (*__nsapi30_table->f_util_strftime) + +/* Various thread safe routines. */ + +#define util_strtok (*__nsapi30_table->f_util_strtok) +#define util_localtime (*__nsapi30_table->f_util_localtime) +#define util_ctime (*__nsapi30_table->f_util_ctime) +#define util_strerror (*__nsapi30_table->f_util_strerror) +#define util_gmtime (*__nsapi30_table->f_util_gmtime) +#define util_asctime (*__nsapi30_table->f_util_asctime) + +#ifdef NEED_STRCASECMP +#define util_strcasecmp (*__nsapi30_table->f_util_strcasecmp) +#define strcasecmp(s1, s2) util_strcasecmp(s1, s2) +#endif /* NEED_STRCASECMP */ + +#ifdef NEED_STRNCASECMP +#define util_strncasecmp (*__nsapi30_table->f_util_strncasecmp) +#define strncasecmp(s1, s2, n) util_strncasecmp(s1, s2, n) +#endif /* NEED_STRNCASECMP */ + +#ifdef XP_UNIX + +/* + * can_exec returns 1 if you can execute the file described by finfo, and + * 0 if you can't. + */ + +#define util_can_exec (*__nsapi30_table->f_util_can_exec) + +/* + * Thread safe getpwnam + */ +#define util_getpwnam (*__nsapi30_table->f_util_getpwnam) + +#define util_waitpid (*__nsapi30_table->f_util_waitpid) + +#endif /* XP_UNIX */ + +#ifdef XP_WIN32 + +/* util_delete_directory() + * This routine deletes all the files in a directory. If delete_directory is + * TRUE it will also delete the directory itself. + */ +#define util_delete_directory (*__nsapi30_table->f_util_delete_directory) + +#endif /* XP_WIN32 */ + +/* + * conf_init reads the given configuration file and sets any non-default + * parameters to their given setting. + */ +#define conf_init (*__nsapi30_table->f_conf_init) +#define conf_run_init_functions (*__nsapi30_table->f_conf_run_init_functions) + +/* + * conf_terminate frees any data the conf routines may be holding. + */ +#define conf_terminate (*__nsapi30_table->f_conf_terminate) + +/* + * conf_getServerString returns the Server ID string + */ +#define conf_getServerString (*__nsapi30_table->f_conf_getServerString) + +/* + * Get a structure with the global variables for this server. + */ +#define conf_getglobals (*__nsapi30_table->f_conf_getglobals) + +/* + * func_init reads the static FuncStruct arrays and creates the global + * function table from them. + * + * func_init will only read from the static arrays defined in func.c. + */ +#define func_init (*__nsapi30_table->f_func_init) + +/* + * func_find returns a pointer to the function named name, or NULL if none + * exists. + */ +#define func_find (*__nsapi30_table->f_func_find) + +/* DO NOT USE this function. + */ +#define func_set_native_thread_flag (*__nsapi30_table->f_func_set_native_thread_flag) + +/* + * func_exec will try to execute the function whose name is the "fn" entry + * in the given pblock. If name is not found, it will log a misconfig of + * missing fn parameter. If it can't find it, it will log that. In these + * cases it will return REQ_ABORTED. Otherwise, it will return what the + * function being executed returns. + */ +#define func_exec (*__nsapi30_table->f_func_exec) + +/* + * func_replace will replace a function in the server's function table with + * another. Returns the FuncPtr to the old function if it replaces the + * function, otherwise it returns 0. + */ +#define func_replace (*__nsapi30_table->f_func_replace) + +/* + * func_insert dynamically inserts a named function into the server's + * table of functions. Returns the FuncStruct it keeps in internal + * databases, because on server restart you are responsible for freeing + * (or not) its contents. + */ +#define func_insert (*__nsapi30_table->f_func_insert) +#define object_execute (*__nsapi30_table->f_object_execute) + +/* + * gets the first line of an HTTP request + */ +#define http_find_request (*__nsapi30_table->f_http_find_request) + +/* + * parses the first line of an HTTP request + */ +#define http_parse_request (*__nsapi30_table->f_http_parse_request) + +/* + * Scans HTTP headers from the given netbuf, and places them in headers. + * If netbuf is NULL, the session's inbuf is used. + * + * Folded lines are joined and the linefeed removed (but not the whitespace). + * If there are any repeat headers they are joined and the two field bodies + * separated by a comma and space. + * + * t should be a string of length REQ_MAX_LINE. This is a convenience to + * req.c so that we don't use too much runtime stack. + * + * Session is an optional parameter. Use NULL if you wish. It's used for + * error logs. + */ +#define http_scan_headers (*__nsapi30_table->f_http_scan_headers) + +/* + * Starts the HTTP response. If HTTP/0.9, does nothing. If 1.0, sends header. + * If this returns REQ_NOACTION, the method was head and no body should be + * sent. Otherwise, it will return REQ_PROCEED. + */ +#define http_start_response (*__nsapi30_table->f_http_start_response) + +/* + * http_hdrs2env takes the entries from the given pblock and converts them + * to an environment. + * + * Each name entry will be made uppercase, prefixed with HTTP_ and any + * occurrence of - will be converted to _. + */ +#define http_hdrs2env (*__nsapi30_table->f_http_hdrs2env) + +/* + * http_status sets status to the code n, with reason string r. If r is + * NULL, the server will attempt to find one for the given status code. + * If it finds none, it will give "Because I felt like it." + */ +#define http_status (*__nsapi30_table->f_http_status) + +/* + * http_set_finfo sets content-length and last-modified + */ + +#define http_set_finfo (*__nsapi30_table->f_http_set_finfo) + +/* + * Takes the given pblock and prints headers into the given buffer at + * position pos. Returns the buffer, reallocated if needed. Modifies pos. + */ +#define http_dump822 (*__nsapi30_table->f_http_dump822) + +/* + * Finishes a request. For HTTP, this just closes the socket. + */ +#define http_finish_request (*__nsapi30_table->f_http_finish_request) + +/* + * http_handle_session processes each request generated by Session + */ +#define http_handle_session (*__nsapi30_table->f_http_handle_session) + +/* + * http_uri2url takes the give URI prefix and URI suffix and creates a + * newly-allocated full URL from them of the form + * http://(server):(port)(prefix)(suffix) + * + * If you want either prefix or suffix to be skipped, use "" instead of NULL. + * + * Normally, the server hostname is taken from the ServerName parameter in + * magnus.conf. The newer function http_uri2url_dynamic should be used when + * a Session and Request structure are available, to ensure that the browser + * gets redirected to the exact host they were originally referencing. + */ + +#define http_uri2url (*__nsapi30_table->f_http_uri2url) +#define http_uri2url_dynamic (*__nsapi30_table->f_http_uri2url_dynamic) + +/* + * http_set_keepalive_timeout sets the number of seconds to wait for a new + * request to come from a persistent connection. Returns nothing. Intended + * to be called at server startup only. + * + * Specifying a timeout of zero will disable persistent connections and allow + * browsers to request only one file per connection. + */ +#define http_set_keepalive_timeout (*__nsapi30_table->f_http_set_keepalive_timeout) + +/* + * log_error logs an error of the given degree from the function func + * and formats the arguments with the printf() style fmt. Returns whether the + * log was successful. Records the current date. + * + * sn and rq are optional parameters. If given, information about the client + * will be reported. + */ +#define log_error_v (*__nsapi30_table->f_log_error_v) +#define log_error (*__nsapi30_table->f_log_error) + +/* + * Internal use only + */ +#define log_ereport_v (*__nsapi30_table->f_log_ereport_v) +#define log_ereport (*__nsapi30_table->f_log_ereport) + +/* + * object_create will create a new object and return a pointer to it. + * It will allocate space for nd directive types and set name accordingly. + */ +#define object_create (*__nsapi30_table->f_object_create) + +/* + * object_free will free an object and any data associated with it. + */ +#define object_free (*__nsapi30_table->f_object_free) + +/* + * object_add_directive will add a new directive to the dtable for + * the directive class at position dc. + */ +#define object_add_directive (*__nsapi30_table->f_object_add_directive) + +/* + * Executes the directive specified by inst within the context of the + * given session and request structures. Returns what the executed function + * returned (one of the REQ_* codes defined in req.h). + * + * This prototype uses void * for Request * in order to avoid including + * all of req.h. + * + */ + +/* + * objset_scan_buffer will scan through buffer, looking for object + * configuration information, and adding them to the object set os if it + * finds any. If os is NULL it will allocate a new object set. + * + * If any error occurs (syntax error, premature EOF) this function will + * free os, print an error message into errstr, and return NULL. + * This is because a config. file error is viewed as a catastrophic error + * from which httpd should not try to recover. If httpd were to continue + * after an error, it would not behave as the admin. expected and he/she + * may not notice until it's too late. + * + * Upon EOF the file will not be closed. + */ +#define objset_scan_buffer (*__nsapi30_table->f_objset_scan_buffer) + +/* + * objset_create creates a new object set and returns a pointer to it. + */ +#define objset_create (*__nsapi30_table->f_objset_create) + +/* + * objset_free will free an object set, any associated objects, and any + * associated Init functions. + */ +#define objset_free (*__nsapi30_table->f_objset_free) + +/* + * objset_free_setonly frees only the object set, and not the associated + * objects or init functions. + */ +#define objset_free_setonly (*__nsapi30_table->f_objset_free_setonly) + +/* + * objset_new_object will add a new object to objset with the specified + * name. It returns a pointer to the new object (which may be anywhere in + * the objset). + */ +#define objset_new_object (*__nsapi30_table->f_objset_new_object) + +/* + * objset_add_object will add the existing object to os. + */ +#define objset_add_object (*__nsapi30_table->f_objset_add_object) + +/* + * objset_add_init will add the initialization function specified by + * initfn to the given object set. Modifies os->initfns. + */ +#define objset_add_init (*__nsapi30_table->f_objset_add_init) + +/* + * objset_findbyname will find the object in objset having the given name, + * and return the object if found, and NULL otherwise. + * ign is a set of objects to ignore. + */ +#define objset_findbyname (*__nsapi30_table->f_objset_findbyname) + +/* + * objset_findbyppath will find the object in objset having the given + * partial path entry. Returns object if found, NULL otherwise. + * ign is a set of objects to ignore. + */ +#define objset_findbyppath (*__nsapi30_table->f_objset_findbyppath) + +/* + * request_create creates a new request structure. + */ +#define request_create (*__nsapi30_table->f_request_create) + +/* + * request_free destroys a request structure. + */ +#define request_free (*__nsapi30_table->f_request_free) + +/* + * Restarts a request for a given URI internally. If rq is non-NULL, the + * function will keep the old request's headers and protocol, but with a new + * URI and method of GET. If the previous method was HEAD, this is preserved. + * Any other method becomes GET. You may assume that if you give it a request + * structure that it will use the same structure. + * + * Once you have this new Request, you must then do what you want with + * it (e.g. send the object back, perform uri2path translation, etc.) + */ +#define request_restart_internal (*__nsapi30_table->f_request_restart_internal) + +/* + * request_header finds the named header depending on the requesting + * protocol. If possible, it will not load headers until the first is + * requested. You have to watch out because this can return REQ_ABORTED. + */ +#define request_header (*__nsapi30_table->f_request_header) + +/* + * request_loadheaders just makes sure the headers have been loaded. + */ +#define request_loadheaders (*__nsapi30_table->f_request_loadheaders) + +/* + * request_stat_path tries to stat path. If path is NULL, it will look in + * the vars pblock for "path". If the stat is successful, it returns the stat + * structure. If not, returns NULL and leaves a message in rq->staterr. If a + * previous call to this function was successful, and path is the same, the + * function will simply return the previously found value. + * + * User functions should not free this structure. + */ + +#define request_stat_path (*__nsapi30_table->f_request_stat_path) + +/* + * Random number generation + * + * random_create - create a new random number context + * random_update - update a context with random data + * random_generate - generate random bytes + * random_destroy - destroy a random number context + */ + +#define random_create (*__nsapi30_table->f_random_create) +#define random_update (*__nsapi30_table->f_random_update) +#define random_generate (*__nsapi30_table->f_random_generate) +#define random_destroy (*__nsapi30_table->f_random_destroy) + +/* + * MD5 hash routines + * + * md5hash_create - create an MD5 hash context + * md5hash_copy - make a copy of an MD5 hash context + * md5hash_begin - initialize an MD5 hash context + * md5hash_update - update MD5 hash with more input data + * md5hash_end - finalize MD5 hash and get result + * md5hash_destroy - destroy an MD5 hash context + * md5hash_data - compute MD5 hash of data in one step + */ + +#define md5hash_create (*__nsapi30_table->f_md5hash_create) +#define md5hash_copy (*__nsapi30_table->f_md5hash_copy) +#define md5hash_begin (*__nsapi30_table->f_md5hash_begin) +#define md5hash_update (*__nsapi30_table->f_md5hash_update) +#define md5hash_end (*__nsapi30_table->f_md5hash_end) +#define md5hash_destroy (*__nsapi30_table->f_md5hash_destroy) +#define md5hash_data (*__nsapi30_table->f_md5hash_data) + +/* + * ACL_SetupEval - + * Setup environment and call ACL_EvalTestRights. + */ +#define ACL_SetupEval (*__nsapi30_table->f_ACL_SetupEval) + +/* + * servact_translate_uri + * Returns the translated path (filename) for the given uri, NULL otherwise. + * If authentication is required for the given uri, nothing is returned even + * if the current user has authenticated to that area. + */ +#define servact_translate_uri (*__nsapi30_table->f_servact_translate_uri) + +#endif /* !INTNSAPI */ + +#ifndef FILE_MMAP +#define filebuf_open_nostat(fd,sz,finfo) filebuf_open(fd,sz) +#endif + +#ifdef XP_UNIX +#define dir_open opendir +#define dir_read readdir +#define dir_close closedir +#define dir_create(path) mkdir(path, 0755) +#define dir_remove rmdir +#define system_chdir chdir +#define file_unix2local(path,p2) strcpy(p2,path) +#endif /* XP_UNIX */ + +#ifdef XP_WIN32 +#define dir_create _mkdir +#define dir_remove _rmdir +#define system_chdir SetCurrentDirectory +#endif /* XP_WIN32 */ + +/* + * Thread-safe variants of localtime and gmtime + */ +#define system_localtime(curtime, ret) util_localtime(curtime, ret) +#define system_gmtime(curtime, ret) util_gmtime(curtime, ret) + +/* + * pblock_find finds the entry with the given name in pblock pb. + * + * If it is successful, it returns the param block. If not, it returns NULL. + */ + +#define pblock_find(name, pb) (pblock_fr(name,pb,0)) + +/* + * pblock_remove behaves exactly like pblock_find, but removes the given + * entry from pb. + */ + +#define pblock_remove(name, pb) (pblock_fr(name,pb,1)) + +/* + * session_dns returns the DNS hostname of the client of this session, + * and inserts it into the client pblock. Returns NULL if unavailable. + */ + +#define session_dns(sn) session_dns_lookup(sn, 0) + +/* + * session_maxdns looks up a hostname from an IP address, and then verifies + * that the host is really who they claim to be. + */ + +#define session_maxdns(sn) session_dns_lookup(sn, 1) + +#define protocol_find_request http_find_request +#define protocol_parse_request http_parse_request +#define protocol_scan_headers http_scan_headers +#define protocol_start_response http_start_response +#define protocol_status http_status +#define protocol_set_finfo http_set_finfo +#define protocol_finish_request http_finish_request +#define protocol_handle_session http_handle_session +#define protocol_uri2url http_uri2url +#define protocol_uri2url_dynamic http_uri2url_dynamic +#define protocol_set_keepalive_timeout http_set_keepalive_timeout + +/* XXXrobm temporary compatibility */ +#define request_uri2path servact_uri2path +#define request_pathchecks servact_pathchecks +#define request_fileinfo servact_fileinfo +#define request_service servact_service + +#define request_handle_processed servact_handle_processed +#define request_translate_uri servact_translate_uri +#define request_finderror servact_finderror + +/* --- OBSOLETE ---------------------------------------------------------- + * The following macros/functions are obsolete and are only maintained for + * compatibility. Do not use them. 11-19-96 + * ----------------------------------------------------------------------- + */ + +#define SYS_STDERR STDERR_FILENO + +#ifdef XP_WIN32 + +typedef HANDLE pid_t; + +#define ERROR_PIPE \ + (ERROR_BROKEN_PIPE | ERROR_BAD_PIPE |\ + ERROR_PIPE_BUSY | ERROR_PIPE_LISTENING | ERROR_PIPE_NOT_CONNECTED) +#define CONVERT_TO_PRINTABLE_FORMAT(Filename) \ +{ \ + register char *s; \ + if (Filename) \ + for (s = Filename; *s; s++) \ + if ( *s == '\\') \ + *s = '/'; \ +} +#define CONVERT_TO_NATIVE_FS(Filename) \ +{ \ + register char *s; \ + if (Filename) \ + for (s = Filename; *s; s++) \ + if ( *s == '/') \ + *s = '\\'; \ +} + +#ifdef INTNSAPI +NSAPI_PUBLIC extern nsapi_dispatch_t *__nsapi30_table; +#else +__declspec(dllimport) nsapi_dispatch_t *__nsapi30_table; +#endif /* INTNSAPI */ + +#else /* !XP_WIN32 */ + +NSAPI_PUBLIC extern nsapi_dispatch_t *__nsapi30_table; + +#endif /* XP_WIN32 */ + +#endif /* !PUBLIC_NSAPI_H */ diff --git a/include/version.h b/include/version.h new file mode 100644 index 00000000..a1116466 --- /dev/null +++ b/include/version.h @@ -0,0 +1,53 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/* + This file is included from both C source and the NT installation compiler. + Because of that, no ifdefs are allowed, and strings must be simple strings + (not concatenated). + + Because macros called PERSONAL_VERSION and ENTERPRISE_VERSION already + exist, the PRODUCT_VERSION define has _DEF appended. + */ + +#define DIRECTORY_VERSION_DEF "7.0" +#define DIRECTORY_COMPATIBLE "3.0" +#define DIRECTORY_VERSION_STRING "Netscape-DirServer/7.0" + +#define DS_VERSION_DEF DIRECTORY_VERSION_DEF +#define DS_VERSION_STRING DIRECTORY_VERSION_STRING + +#define DSS_VERSION_DEF DIRECTORY_VERSION_DEF +#define DSS_VERSION_STRING "Netscape-DirSynchService/7.0" + +#define PROXY_VERSION_DEF "2.0" +#define PROXY_VERSION_STRING "Netscape-Proxy/2.0" + +#define ADMSERV_VERSION_DEF "4.0b1" +#define ADMSERV_VERSION_STRING "Netscape-Administrator/4.0b1" +/* supposedly the trunk is currently the home of 3.x development */ + +#define PERSONAL_VERSION_DEF "3.01b1" +#define PERSONAL_VERSION_STRING "Netscape-FastTrack/3.01b1" + +#define CATALOG_VERSION_DEF "1.0b2" +#define CATALOG_VERSION_STRING "Netscape-Catalog/1.0b2" + +#define RDS_VERSION_DEF "1.0b2" +#define RDS_VERSION_STRING "Netscape-RDS/1.0b2" + +#define ENTERPRISE_VERSION_DEF "3.01" +#define ENTERPRISE_VERSION_STRING "Netscape-Enterprise/3.01" + +#define MAIL_VERSION_DEF "3.0a0" +#define MAIL_VERSION_STRING "Netscape-Mail/3.0a0" + +#define NEWS_VERSION_STRING "Netscape 1.1" + +#define BATMAN_VERSION_DEF "1.0a1" +#define BATMAN_VERSION_STRING "Batman/1.0a1" + +#define VI_COMPANYNAME "Netscape Communications Corporation\0" +#define VI_COPYRIGHT "Copyright 2001 Sun Microsystems, Inc. Portions copyright 1999, 2001-2003 Netscape Communications Corporation. All rights reserved.\0" diff --git a/l10n/dirserv/de/ns-slapd.txt b/l10n/dirserv/de/ns-slapd.txt new file mode 100644 index 00000000..7e183ed7 --- /dev/null +++ b/l10n/dirserv/de/ns-slapd.txt @@ -0,0 +1,899 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ + +/* This text file was generated by program dblink */ + +$Revision: 1.1 $ +$Log: ns-slapd.txt,v $ +Revision 1.1 2005/01/21 00:40:48 cvsadm +Initial revision + +Revision 1.2.10.6 2003/09/22 19:36:39 ulfw +Update copyright years from 2001 to 2001-2003 + +Revision 1.2.10.5 2001/11/03 01:05:12 richm +XXX use new copyright XXX + +Revision 1.2.10.4 2001/10/06 20:00:37 richm +ns/netsite/l10n/dirserv/de/ns-slapd.txt +1.2.10.3 +20010918 + +Remove copyright caracter from copyright + + +==================================================== + +Revision 1.2.10.3 2001/09/18 11:48:15 rmarco +Remove copyright caracter from copyright + +Revision 1.2.10.2 2001/02/13 09:59:50 rmarco +Copyrights + +Revision 1.2.10.1 1998/10/10 02:13:58 ggood +Copy from Directory40RtmBranchpoint to DirectoryBranch + +Revision 1.2.2.3.6.1 1998/04/04 23:16:45 mcs +merge changes made on directory31_rtm_branch into server4_directory_branch + +Revision 1.2.2.3.2.1 1998/02/24 05:51:51 noriko +Synched with server3_i18npkg_branch + +Revision 1.1.2.6 1997/12/31 00:28:38 werudge +UTF8 Encoded from de/ns-slapd.txt.iso8859 : 1.1.2.6 +Based on en/ns-slapd.txt : 1.1.2.3 + +Revision 1.1.2.6 1997/12/31 00:23:36 werudge +Remove \n from dsgw,198 to fix JavaScript problem + +Revision 1.1.2.5 1997/12/19 02:03:43 werudge +Based on en/ns-slapd.txt : 1.1.2.3 +daily 971113.1 SOLARIS-export-optimize-normal-slapd +$EndLog$ + +$StartStringData$ + +de,base,-1,[$DBT: base in DB file v1 $] +de,base,1,[nicht genügend Arbeitsspeicher zum Erstellen der Hash-Tabelle] +de,base,2,[nicht genügend Arbeitsspeicher zum Erstellen der Hash-Tabelle] +de,base,3,[cache_destroy: Cache-Tabellen scheinen beschädigt zu sein.] +de,base,4,[Hash-Eintrag kann nicht zugewiesen werden] +de,base,5,[cache_insert: Cache-Eintrag kann nicht erstellt werden] +de,base,6,[HTTP/1.0 200 OK\nContent-type: text/html\n\n] +de,base,7,[

    Netscape-Cache Statusbericht

    \n(

    Netscape cache status report

    )\n] +de,base,8,[Keine Caches im System (No caches on system)

    ] +de,base,9,[

    %s Cache (cache)

    \n] +de,base,10,[Cacheverbindungsverhältnis (Cache hit ratio): %d/%d (%f)

    \n

    \n] +de,base,11,[Cachegröße (Cache size): %d/%d

    \n

    \n] +de,base,12,[Hash-Tabellengröße (Hash table size): %d

    \n

    \n] +de,base,13,[mru : %d

    \nlru : %d

    \n] +de,base,14,[
      Bucket Address Key Access Count Delete Next LRU MRU Data
      \n] +de,base,15,[munmap failed (%s)] +de,base,16,[munmap failed (%s)] +de,base,17,[close failed (%s)] +de,base,18,[daemon: unable to fork new process (%s)\n] +de,base,19,[daemon: setsid failed (%s)\n] +de,base,20,[daemon: can't log pid to %s (%s)\n] +de,base,21,[warning: could not set group id to %d (%s)\n] +de,base,22,[warning: could not set user id to %d (%s)\n] +de,base,23,[warning: daemon is running as super-user\n] +de,base,24,[could not determine current user name\n] +de,base,25,[error: chroot to %s failed (%s)\n] +de,base,27,[, address %s] +de,base,28,[warning: statistics disabled (%s)\n] +de,base,29,[security handshake timed out for pid %d] +de,base,30,[warning: statistics disabled (%s)\n] +de,base,31,[secure handshake failed (code %d)\n] +de,base,32,[accept failed (%s)] +de,base,33,[warning: statistics disabled (%s)\n] +de,base,34,[select thread miss] +de,base,35,[keepalive worker awoken with no work to do] +de,base,36,[could not create new thread: %d (%s)] +de,base,37,[wait for sema succeeded, but nothing to dequeue] +de,base,38,[queue-sema creation failure] +de,base,39,[error getting processor info for processor %d] +de,base,40,[Error binding to processor %d] +de,base,41,[bound process %d to processor %d] +de,base,42,[Netscape server is not explicitly binding to any processors.] +de,base,43,[cache monitor exited] +de,base,44,[cache batch update daemon exited] +de,base,45,[Using single threaded accepts.] +de,base,46,[Using multi threaded accepts.] +de,base,47,[Using partial single threaded accepts.] +de,base,48,[This machine has %d processors.] +de,base,49,[Error calling thr_seconcurrency(%d)- (%s)] +de,base,50,[Set conncurrency to %d.] +de,base,51,[WARNING! netscape executable and library have different versions.\n] +de,base,54,[seminit failed (%s)\n] +de,base,55,[This beta software has expired.\n] +de,base,56,[Cache monitor respawned] +de,base,57,[Cache batch update daemon respawned] +de,base,58,[can't find empty statistics slot] +de,base,59,[can't fork new process (%s)] +de,base,60,[assert failed! %s\n] +de,base,61,[mr_table_init()] +de,base,62,[malloc failed] +de,base,63,[malloc failed!] +de,base,64,[mr_add_io(%d, type %d, file %d)] +de,base,65,[mr_add_io - stage 1] +de,base,66,[mr_add_io - stage 2] +de,base,67,[mr_add_io found invalid IO type %d] +de,base,68,[mr_add_io - adding timeout] +de,base,69,[Out of memory!\n] +de,base,70,[done with mr_add_io] +de,base,71,[mr_del_io(%d, type %d, file %d)] +de,base,72,[mr_del_io found invalid IO type %d] +de,base,73,[mr_lookup_io(%d)] +de,base,74,[mr_async_io(%d, %d bytes, file %d)] +de,base,75,[malloc failure adding async IO] +de,base,76,[Error adding async io!] +de,base,77,[Cannot seek for read!] +de,base,78,[read failure! (%d, %s)] +de,base,79,[do_read read %d bytes for file %d] +de,base,80,[Cannot seek for write!] +de,base,81,[writev failure! (%d, %s)] +de,base,82,[write failure! (%d, %s)] +de,base,83,[do_write wrote %d bytes for file %d] +de,base,84,[do_timeout(mrp %d)] +de,base,85,[do_timeout: found IO (timer=%d, time=%d)] +de,base,86,[error deleting io] +de,base,87,[timeout callback failure for %d\n] +de,base,88,[mr_get_event(%d) - outstanding io %d] +de,base,89,[mr_get_event: Waiting for reads on FD:] +de,base,90,[mr_get_event: Waiting for writes on FD:] +de,base,91,[ %d] +de,base,92,[ %d] +de,base,93,[mr_get_event set no timeout] +de,base,94,[mr_get_event set timeout to: %d.%d sec] +de,base,95,[error in select (%d, %s)] +de,base,96,[mr_get_event() - select found %d] +de,base,97,[error looking up IO fd %d] +de,base,98,[read failed for fd %d] +de,base,99,[error deleting io] +de,base,100,[callback failure for %d\n] +de,base,101,[error looking up IO fd %d] +de,base,102,[writing: header len %d, writelen %d, total %d] +de,base,103,[write failed for fd %d] +de,base,104,[error deleting io] +de,base,105,[callback failure for %d\n] +de,base,106,[Error creating dns cache] +de,base,107,[dns_cache_init: hash_size <= 0, using %d] +de,base,108,[dns_cache_init: cache-size <= %d, using %d] +de,base,109,[dns_cache_init: cache-size is %d is too large, using %d.] +de,base,110,[dns_cache_init: expire_time <= 0, using %d] +de,base,111,[dns_cache_init: expire is %d is too large, using %d seconds.] +de,base,112,[Error creating dns cache] +de,base,113,[dns-cache-insert: Error allocating entry] +de,base,114,[dns-cache-insert: malloc failure] +de,base,115,[successful server startup] +de,base,116,[%s B%s] +de,base,117,[Netscape executable and shared library have different versions] +de,base,118,[ executable version is %s] +de,base,119,[ shared library version is %s] +de,base,120,[error reporting shutting down] +de,base,121,[warning] +de,base,122,[config] +de,base,123,[security] +de,base,124,[failure] +de,base,125,[catastrophe] +de,base,126,[info] +de,base,127,[verbose] +de,base,128,[event_handler:Failed to wait on events %s] +de,base,129,[could not wait on resume event event (%s)] +de,base,130,[dlopen of %s failed (%s)] +de,base,131,[dlopen of %s failed (%s)] +de,base,132,[The server is terminating due to an error. Check the event viewer for the error message. SERVER EXITING!] +de,base,133,[Terminating the server %s] +de,base,134,[kill_server:cannot open server event %s] +de,base,135,[kill_server:cannot set server event %s] +de,base,136,[error: could not get socket (%s)\n] +de,base,137,[error: could not set socket option (%s)\n] +de,base,138,[Terminating Service:error: could not bind to address %s port %d (%s)\n] +de,base,139,[Terminating Service:error: could not bind to port %d (%s)\n] +de,base,140,[SetHandleNonInheritable: could not duplicate socket (%s)] +de,base,141,[SetHandleNonInheritable: closing the original socket failed (%s)] +de,base,142,[Could not SetHandleInformation (%s)] +de,base,143,[Terminating Service:Failure: Could not open statistics file (%s)\n] +de,base,144,[Could not set Thread Local Storage Value for thread at slot %d] +de,base,145,[secure handshake failed (code %d)\n] +de,base,146,[accept failed %d (%s)] +de,base,147,[Failed to pulse Event %d %s] +de,base,148,[Failed to send MobGrowth Event to parent %s] +de,base,149,[Pulsing MobRespawn Event %d] +de,base,150,[respawn thread pool to %d (%d)] +de,base,151,[Could not open event to signal rotate application. Could not create the MoveLog event:%s] +de,base,152,[Failed to send MoveLog Event to rotate app %s] +de,base,153,[growing thread pool from %d to %d] +de,base,154,[Could not open the ServiceControlManager, Error %d] +de,base,155,[StartNetsiteService:Could not open the service %s: Error %d] +de,base,156,[StartNetsiteService:Could not start the service %s] +de,base,157,[Service Startup: Could not allocate security descriptor] +de,base,158,[Service Startup: Could not init security descriptor] +de,base,159,[Service Startup: Could not set the security Dacl] +de,base,160,[Terminating Service:WinSock init failed: %s] +de,base,161,[Httpd Server Startup failed: %s] +de,base,162,[can't find empty statistics slot] +de,base,163,[NT daemon: could not create new thread %d] +de,base,164,[Service Startup Failure. Terminating Service:Could not create event %d:%s] +de,base,165,[Service Startup Error. Could not create the MoveLog event:%s] +de,base,166,[Failed to wait on Event objects %s] +de,base,167,[Failed to wait on Event objects %s] +de,base,168,[pipebuf_buf2sd: pipebuf_grab IO_ERROR %d] +de,base,169,[pool-init: memory pools disabled] +de,base,170,[pool-init: free_size <= 0, using %d] +de,base,171,[pool-create-block: out of memory] +de,base,172,[pool-create: out of memory] +de,base,173,[pool-create: out of memory] +de,base,174,[pool-malloc: out of memory] +de,base,175,[FREE() used where PERM_FREE() should have been used- problem corrected and supressing further warnings.] +de,base,176,[regex error: %s (regex: '%s')] +de,base,177,[can't create IPC pipe (%s)] +de,base,178,[write to wakeup pipe failed (%s)] +de,base,179,[flushing %d connections; current %d; tot %d] +de,base,180,[accept failed (%s)] +de,base,181,[Error creating time cache] +de,base,182,[time-cache: cache disabled] +de,base,183,[time_cache_init: hash_size < %d, using default, %d] +de,base,184,[time_cache_init: hash_size > %d, using default, %d] +de,base,185,[time_cache_init: cache_size < %d, using default, %d] +de,base,186,[time_cache_init: cache_size > %d, using default, %d] +de,base,187,[Error allocating memory for time_cache] +de,base,188,[Error allocating memory for time_cache entry] +de,base,189,[Error allocating memory for time_cache entry] +de,base,190,[Error inserting new time_cache entry] +de,base,191,[Error allocating memory for time_cache] +de,base,192,[cs-terminate failure (%s)] +de,base,193,[cs-init failure (%s)] +de,base,194,[cs-wait failure (%s)] +de,base,195,[cs-post failure (%s)] +de,base,196,[Unable to create nonblocking socket (%s)] +de,base,197,[error: could not set keepalive (%s)\n] +de,base,198,[error: could not set recv timeout (%s)\n] +de,base,199,[error: could not set send timeout (%s)\n] +de,base,200,[Unable to create nonblocking socket (%s)] +de,base,201,[sem_grab failed (%s)] +de,base,202,[sem_release failed (%s)] +de,base,203,[sem_release failed (%s)] +de,base,204,[Could not remove temporary directory %s, Error %d] +de,base,205,[Could not remove temporary directory %s, Error %d] +de,dsgw,-1,[$DBT: dsgw in DB file v1 $] +de,dsgw,1,[Unbekannte HTTP-Anforderungsmethode (Unknown HTTP request method)] +de,dsgw,2,[Ungültige oder unvollständige HTML-Formulardaten (Invalid or incomplete HTML form data)] +de,dsgw,3,[Nicht genügend Speicherplatz (Out of memory)] +de,dsgw,4,[Erforderliche Anfrage-/Formulareingabe fehlt (Required query/form input is missing)] +de,dsgw,5,[Ungültiges Zeichen im Dateipfad (Illegal character in file path)] +de,dsgw,6,[Falsche oder fehlende Konfigurationsdatei (Bad or missing configuration file)] +de,dsgw,7,[LDAP kann nicht initialisiert werden (Unable to initialize LDAP)] +de,dsgw,8,[Fehler beim Aufrufen des LDAP-Server (An error occurred while contacting the LDAP server)] +de,dsgw,9,[Unbekannter Suchobjekttyp (Unknown search object type)] +de,dsgw,10,[Unbekanntes Attributetikett (Unknown attribute label)] +de,dsgw,11,[Unbekannte Match-Aufforderung (Unknown match prompt)] +de,dsgw,12,[Keine Suchfilter für Objekttyp (No search filters for object type)] +de,dsgw,13,[HTML-Vorlagedatei kann nicht gefunden werden (Unable to open HTML template file)] +de,dsgw,14,[Unbekannter Suchmodus - benutzen Sie "smart", "complex", "pattern" oder "auth" (Unknown search mode - use "smart", "complex", "pattern", or "auth")] +de,dsgw,15,[Unverwechselbarer Name fehlt in der URL (Distinguished Name missing in URL)] +de,dsgw,16,[Unbekannter Bereich in der URL (sollte "base", "sub" oder "one" sein) (Unknown scope in URL (should be base, sub, or one))] +de,dsgw,17,[Unbekannte URL oder unbekannter Fehler (Unrecognized URL or unknown error)] +de,dsgw,18,[Ungültiges URL-Format (Bad URL format)] +de,dsgw,19,[Interner Fehler (Internal error)] +de,dsgw,20,[Vorlageindexdatei kann nicht geschrieben werden (Unable to write template index file)] +de,dsgw,21,[Vorlageindexdatei kann nicht geöffnet werden (Unable to open template index file)] +de,dsgw,22,[Verzeichnis kann nicht gelesen werden (Unable to read directory)] +de,dsgw,23,[Fehler bei der Initialisierung von LDAP SSL (Sicherheitspfad überprüfen) (LDAP SSL initialization failed (check the security path)] +de,dsgw,24,[Damit die Benutzer- und Gruppenformulare mit dem Verwalter-Server via SSL ausgeführt werden können, müssen Sie oder der Systemverwalter über das Formular Server-Eigenschaften|Verschlüsselung EIN/AUS SSL für diesen Verwaltungsserver aktivieren aktivieren.\n(For the Users and Groups forms to work over SSL, you or your server administrator needs to activate SSL for this Administration Server. The Encryption|On/Off page can be used to do so.)] +de,dsgw,25,[Beglaubigungsberechtigung wurde nicht in der Beglaubigungsdatenbank gefunden (Authentication credentials not found in authentication database)] +de,dsgw,26,[Fehler beim Abrufen der Daten von der Beglaubigungsdatenbank (Error retrieving data from the authentication database)] +de,dsgw,27,[Ihre Beglaubigungsberechtigung ist abgelaufen (Your authentication credentials have expired)] +de,dsgw,28,[Zufalls-Zeichenfolge kann nicht erstellt werden\n(Unable to create a random string)] +de,dsgw,29,[Beim Abrufen des Berechtigungsnachweises wurde kein unverwechselbarer Name angegeben (No distinguished name was provided when retrieving credentials)] +de,dsgw,30,[Beglaubigungsdatenbank kann nicht geöffnet werden (Cannot open authentication database)] +de,dsgw,31,[Daten konnten nicht an die Beglaubigungsdatenbank angehängt werden (Could not append data to the authentication database)] +de,dsgw,32,[Es wurde kein Verzeichnisverwalter definiert (No Directory Manager is defined)] +de,dsgw,33,[Es wurde keine Suchzeichenfolge angegeben. Bitte noch einmal versuchen (No search string was provided. Please try again)] +de,dsgw,34,[Zu viele Argumente auf einer Zeile in der Konfigurationsdatei (Too many arguments on one line in the config. file)] +de,dsgw,35,[Windows Sockets konnte nicht initialisiert werden (Failed to initialize Windows Sockets)] +de,dsgw,36,[Beglaubigungsberechtigung konnte nicht vom Verwaltungs-Server abgerufen werden (Authentication credentials could not be obtained from the Administration Server)] +de,dsgw,37,[Unverwechselbarer Name fehlt in der ldapdb:// URL (Distinguished Name missing in ldapdb:// URL)] +de,dsgw,38,[Unbekannte URL oder unbekannter Fehler (Unrecognized URL or unknown error)] +de,dsgw,39,[Ungültiges URL-Format (Bad URL format)] +de,dsgw,40,[Fehler beim Initialisieren der lokalen LDAP-Datenbank\n(An error occurred while initializing the local LDAP database)] +de,dsgw,41,[Unbekannter Verzeichnis-Servicetyp - benutzen Sie "local" oder "remote" (Unknown directory service type - use "local" or "remote")] +de,dsgw,42,[Fehler beim Lesen der db-Konfigurationdatei (An error occurred while reading the db configuration file)] +de,dsgw,43,[NSHOME/userdb-Pfad war NULL (NSHOME/userdb path was NULL)] +de,dsgw,44,[Die Servicekonfiguration des Verzeichnisses konnte nicht aktualisiert werden. (The directory service configuration could not be updated.)] +de,dsgw,45,[Der Eintrag konnte nicht im Verzeichnis gelesen werden. (The entry could not be read from the directory.)] +de,dsgw,46,[Die LDAP-Databank konnte nicht gelöscht werden. (The LDAP database could not be erased.)] +de,dsgw,47,[Sie dürfen keine Einträge außer Ihren eigenen ändern. (You may not change entries besides your own.)] +de,dsgw,48,[Problem] +de,dsgw,49,[Beglaubigungsproblem (Authentication Problem)] +de,dsgw,50,[.\n

      Sie müssen neu beglaubigen, ehe Sie fortfahren. (You must re-authenticate before continuing.)\n] +de,dsgw,51,[.\n

      Sie müssen neu beglaubigen, ehe Sie fortfahren. (You must re-authenticate before continuing.)\n] +de,dsgw,52,[unbekannter Fehler (unknown error)] +de,dsgw,53,[Der Vorgang war erfolgreich. (The operation was successful.)] +de,dsgw,54,[Im Server ist ein interner Fehler aufgetreten. Das deutet gewöhnlich auf einen ernsthaften Fehler im Server hin und sollte Ihrem Serververwalter mitgeteilt werden. (An internal error occurred in the server. This usually indicates a serious malfunction in the server and should be brought to the attention of your server administrator.)] +de,dsgw,55,[Der Server konnte die durch das Gateway an ihn gesandte Anforderung nicht verstehen. (The server could not understand the request which was sent to it by the gateway.)] +de,dsgw,56,[Das Zeitlimit wurde bei der Ausführung Ihrer Anforderung überschritten. Die Suche nach Einträgen erzielt bessere Ergebnisse, wenn Sie Ihre Suche präziser definieren. (A time limit was exceeded in responding to your request. If you are searching for entries, you may achieve better results if you are more specific in your search.)] +de,dsgw,57,[Das Größenlimit wurde bei der Ausführung Ihrer Anforderung überschritten. Ihre Suche nach Einträgen erzielt bessere Ergebnisse, wenn Sie Ihre Suche präziser definieren, da zu viele Einträge zu Ihren Suchkriterien paßten. (A size limit was exceeded in responding to your request. If you are searching for entries, you may achieve better results if you are more specific in your search, because too many entries matched your search criteria.)] +de,dsgw,58,[Das Gateway versuchte, mit einer Methode auf dem Server\nzu beglaubigen, die der Server nicht versteht.\n(The gateway attempted to authenticate to the server using\na method the server doesn't understand.)] +de,dsgw,59,[Das Gateway versuchte mit einer Beglaubigungsmethode auf dem Server zu beglaubigen, die der Server nicht unterstützt. (The gateway attempted to authenticate to the server using an authentication method which the server does not support. )] +de,dsgw,60,[Ihre Anforderung konnte nicht ausgeführt werden, weil der aufgerufene Server wahrscheinlich nicht die von Ihnen gewünschten Daten enthält. Möglicherweise wurde die Anforderung auf einen anderen Server umgeleitet und wieder zurückgesandt, konnte jedoch nicht zurückverfolgt werden. Sollten Sie versucht haben, Änderungen im Verzeichnis vorzunehmen, dann ist der Server mit der Stammkopie möglicherweise nicht verfügbar. (Your request could not be fulfilled, probably because the server that was contacted does not contain the data you are looking for. It is possible that a referral to another server was returned but could not be followed. If you were trying to make changes to the directory, it may be that the server that holds the master copy of the data is not available.)] +de,dsgw,61,[Ihre Anforderung hat ein Verwalterlimit auf dem Server überschritten. (Your request exceeded an administrative limit in the server.)] +de,dsgw,62,[Eine vom Gateway angeforderte kritische Erweiterung ist auf diesem Server nicht verfügbar. (A critical extension that the gateway requested is not available in this server.)] +de,dsgw,63,[Der Server konnte die Anforderung nicht ausführen, da sie\nsich auf ein Attribut bezieht, das nicht im\nEintrag existiert.\n(The server was unable to process the request, because the\nrequest referred to an attribute which does not exist in the\nentry.)] +de,dsgw,64,[Der Server konnte Ihre Anforderung nicht ausführen, da\nsie gegen eine Beschränkung verstößt.\n(The server was unable to fulfill your request, because the\nrequest violates a constraint.)] +de,dsgw,65,[Der Server konnte dem Eintrag keinen Wert hinzufügen, da dieser Wert bereits im Eintrag enthalten ist. (The server could not add a value to the entry, because that value is already contained in the entry.)] +de,dsgw,66,[Der Server konnte diesen Eintrag nicht finden. Wird ein neuer\nWert hinzugefügt, vergewissern Sie sich, daß das übergeordnete Verzeichnis,\nfür den Eintrag, den Sie hinzufügen möchten, existiert. Erscheint diese\nFehlermeldung bei einem Suchvorgang, bedeutet das,\ndaß der von Ihnen gesuchte Eintrag nicht existiert. Wenn Sie versucht\nhaben, als Verzeichnisverwalter zu beglaubigen und diese Fehlermeldung erscheint,\ndann überprüfen Sie die Gateway-Konfigurationsdatei.\n(The server could not locate the entry. If adding a new entry,\nbe sure that the parent of the entry you are trying to add exists.\nIf you received this error while searching, it indicates that the\nentry which was being searched for does not exist.\nIf you were attempting to authenticate as the directory manager and\nreceived this error, check the gateway configuration file.)] +de,dsgw,67,[Ein unverwechselbarer Name hatte nicht das richtige Format. (A distinguished name was not in the proper format. )] +de,dsgw,68,[Dem Eintrag, den Sie beglaubigen wollten, fehlt entweder der Kennwortsatz oder andere erforderliche Beglaubigungsberechtigungen. Mit dieser Eingabe können Sie erst beglaubigen, wenn der Verzeichnisverwalter die passenden Attribute hinzugefügt hat. (The entry you attempted to authenticate as does not have a password set, or is missing other required authentication credentials. You cannot authenticate as that entry until the appropriate attributes have been added by the directory manager.)] +de,dsgw,69,[Das eingegebene Kennwort (oder andere Beglaubigungsberechtigungen)\nist falsch.\n(The password (or other authentication credentials) you supplied\nis incorrect.)] +de,dsgw,70,[Sie sind nicht ausreichend berechtigt, um den Vorgang auszuführen. (You do not have sufficient privileges to perform the operation. )] +de,dsgw,71,[Der Server ist belegt und kann Ihre Anforderung nicht ausführen. Versuchen Sie es in ein paar Miuten noch einmal. (The server is too busy to service your request. Try again in a few minutes.)] +de,dsgw,72,[Der LDAP-Server konnte nicht aufgerufen werden. (The LDAP server could not be contacted.)] +de,dsgw,73,[Der Server lehnt die Ausführung Ihrer Anforderung ab. Das bedeutet gewöhnlich, daß die Ausführung Ihrer Anforderung den Server zu sehr belastet. Es könnte möglicherweise auch bedeuten, daß der Server nicht konfiguriert ist, Ihre Anforderung auszuführen. Versuchen Sie, bei der Suche den Suchbereich einzuschränken. (The server was unwilling to process your request. Usually, this indicates that serving your request would put a heavy load on the server. It may also indicate that the server is not configured to process your request. If searching, you may wish to limit the scope of your search.)] +de,dsgw,74,[Der Verzeichnis-Server konnte Ihrer Anforderung nicht nachkommen, da sie gegen die Schemabedingungen verstößt. Das bedeutet gewöhnlich, daß Sie keinen Wert für ein erforderliches Feld eingegeben haben. Es könnte auch bedeuten, daß das Schema im Verzeichnis-Server aktualisiert werden muß. (The directory server could not honor your request because it violates the schema requirements. Typically, this means that you have not provided a value for a required field. It could also mean that the schema in the directory server needs to be updated.)] +de,dsgw,75,[Der Verzeichnis-Server läßt nicht zu, daß Sie einen Eintrag, der untergeordnet ist, löschen oder umbenennen. Um das zu tun, müssen Sie erst alle untergeordneten Einträge löschen. (The directory server will not allow you to delete or rename an entry if that entry has children. If you wish to do this, you must first delete all the child entries.)] +de,dsgw,76,[Der Server konnte weder einen neuen Eintrag hinzufügen noch einen bestehenden umbenennen, da ein Eintrag unter diesem Namen bereits existiert. (The server was unable to add a new entry, or rename an existing entry, because an entry by that name already exists.)] +de,dsgw,77,[Ihre Anforderung würde mehrere Verzeichnis-Server betreffen. (Your request would affect several directory servers.)] +de,dsgw,78,[Der Verzeichnis-Server konnte nicht aufgerufen werden. Wenden\nSie sich an den Serververwalter.\n(The directory server could not be contacted. Contact your\n server administrator for assistance.)] +de,dsgw,79,[Fehler beim Senden der Daten zum Server. (An error occured while sending data to the server.)] +de,dsgw,80,[Fehler beim Lesen der Daten vom Server. (An error occured while reading data from the server.)] +de,dsgw,81,[Der Server hat nicht auf Ihre Anforderung reagiert. Die Anforderung wurde unterbrochen. (The server did not respond to the request. The request timed out.)] +de,dsgw,82,[Der Server unterstützt nicht die vom Gateway benutzte Beglaubigungsmethode. (The server does not support the authentication method used by the gateway.)] +de,dsgw,83,[Der vom Gateway erstellte Suchfilter war falsch. (The search filter constructed by the gateway was in error.)] +de,dsgw,84,[Der Vorgang wurde auf Ihren Wunsch abgebrochen. (The operation was cancelled at your request.)] +de,dsgw,85,[Interner Fehler in der Bibliothek - ein Parameter war falsch. (An internal error occurred in the library - a parameter was incorrect.)] +de,dsgw,86,[Verbindung zum Verzeichnis-Server konnte nicht hergestellt werden. Wenden\nSie sich an Ihren Server-Verwalter.\n(A connection to the directory server could not be opened. Contact your\nserver administrator for assistance.)] +de,dsgw,87,[Unbekannter Fehler aufgetreten. (An unknown error was encountered.)] +de,dsgw,88,[Eintrag existiert bereits (Entry Already Exists)] +de,dsgw,89,[Dieser Namenseintrag (An entry named )] +de,dsgw,90,[onMouseOver="window.status='Klicken Sie hier, um den Eintrag einzusehen'; return true"\n(onMouseOver="window.status='Click here to view this entry'; return true")] +de,dsgw,91,[ existiert bereits (already exists).

      Bitte anderen Namen und/oder Adresse wählen.\n(Please choose another name and/or location.\n

      )\n] +de,dsgw,92,[Übergeordneter Eintrag existiert nicht\n(Parent entry does not exist)] +de,dsgw,93,[Sie können einen Eintrag unter diesem Namen:\n(You cannot add an entry by the name:)

      %s,

      nicht hinzufügen,\nda der übergeordnete Eintrags nicht existiert.\n(because the parent of that entry does not exist.)

      \nEhe Sie diesen Eintrag hinzufügen, müssen Sie zunächst den dazugehörige\n(Before you can add this entry, you must first add)\n] +de,dsgw,94,[übergeordneten Eintrag hinzufügen. (its parent.)\n] +de,dsgw,95,[ein Eintrag unter diesem Namen (an entry named):

      %s.\n] +de,dsgw,96,[Warnung: Keine Beglaubigung (wird fortgesetzt)...\n(Warning: no authentication (continuing)...)\n] +de,dsgw,97,[%s Verzeichniseintrag (Directory Entry)] +de,dsgw,98,[

      Eingabe-DN (Entry DN): %s

      \n] +de,dsgw,99,[Änderungen zu %s wurden gespeichert.] +de,dsgw,100,[%s has been added.] +de,dsgw,101,[%s has been deleted.] +de,dsgw,102,[Renamed %s to %s.] +de,dsgw,103,[

      Hinweis: Da Sie den Eintrag, unter dem Sie beglaubigt\nsind, %s haben, mußte Ihre Beglaubigungsberechtigung\ngelöscht werden. Sie müssen neu beglaubig werden, um\nweitere Änderungen vornehmen zu können.\n(Note: because of your action on the entry you were \nauthenticated as, it was necessary to discard your \nauthentication credentials. You will need to authenticate \nagain to make additional changes.)\n] +de,dsgw,104,[gelöscht (deleted)] +de,dsgw,105,[umbenannt (renamed)] +de,dsgw,106,[Kennwort umbenannt für (changed the password of)] +de,dsgw,107,[Attribut (Attribute) %s wurde geändert (was changed)
      \n] +de,dsgw,108,[ NICHT (NOT) ASCII (%ld Bytes)\n] +de,dsgw,109,[Es wurden keine Werte eingegeben. Bitte erneut versuchen.\n(No values were entered. Please try again.)\n] +de,dsgw,110,[Es wurden keine Änderungen vorgenommen.\n] +de,dsgw,111,[

      %s wird an Verzeichnis-Server gesendet...\n] +de,dsgw,112,[Information] +de,dsgw,113,[Änderungen (changes)] +de,dsgw,114,[

      Eintrag erfolgreich hinzugefügt.\n(Successfully added entry.)\n] +de,dsgw,115,[

      Eintrag erfolgreich bearbeitet. Änderungen wurden gespeichert.\n(Successfully edited entry. Your changes have been saved.)\n] +de,dsgw,116,[

      Eintrag erfolgreich gelöscht.\n(Successfully deleted entry.)\n] +de,dsgw,117,[

      Der neue Eintrag heißt (The new name for the entry is): %s\n

      \n] +de,dsgw,118,[

      Eintrag erfolgreich umbenannt.\n(Successfully renamed entry.)\n] +de,dsgw,119,[Sie müssen das alte Kennwort angeben.] +de,dsgw,120,[Sie müssen ein neues Kennwort angeben. Bitte erneut versuchen] +de,dsgw,121,[Neues und bestätigendes Kennwort stimmen nicht überein. Bitte erneut versuchen] +de,dsgw,122,[
      %s %s ist bereits in Benutzung. Bitte ein anderes wählen.\n(The item shown is already in use. Please choose a different one.)
      \n] +de,dsgw,123,[fehlendes Formulardatenelement (missing form data element) "%.100s"] +de,dsgw,124,[Konfigurationsinformation wird initialisiert\n(Initializing config info)] +de,dsgw,125,[Datei kann nicht geöffnet werden.\n(Cannot open file.)] +de,dsgw,126,[ Konfigurationsdate der Datenbanki ist verstümmelt.\n(Malformed dbconf file.)] +de,dsgw,127,[Eigenschaftsname in der Konfigurationsdatei der Datenbank fehlt.\n(Missing property name in dbconf file.)] +de,dsgw,128,[Nicht genügend Arbeitspeicher. (Out of memory.)] +de,dsgw,129,[Betriebsanweisung in der Konfigurationsdatei der Datenbank fehlt.\n(Missing directive in dbconf file.)] +de,dsgw,130,[Konfigurationsdatei "%s" kann nicht geöffnet werden\n(Cannot open config file with name shown)\n] +de,dsgw,131,[Argument für die Betriebsanweisung "authlifetime" fehlt\n(Missing argument for "authlifetime" directive)\n] +de,dsgw,132,[Argument für Betriebsanweisung "dirmgr" fehlt\n(Missing argument for "dirmgr" directive)\n] +de,dsgw,133,[Argument für Betriebsanweisung "baseurl" fehlt\n(Missing argument for "baseurl" directive)\n] +de,dsgw,134,[Falsche URL für Betriebsanweisung "baseurl" angegeben - Basis-DN fehlt\n(Bad URL provided for "baseurl" directive - the base DN is missing)\n] +de,dsgw,135,[Betriebsanweisung "baseurl" wird analysiert\n(parsing baseurl directive)] +de,dsgw,136,[Falsche URL für Betriebsanweisung "baseurl" angegeben - keine "ldap://" URL\n(Bad URL provided for "baseurl" directive - not an "ldap://" URL)\n] +de,dsgw,137,["ldaps://" URLs werden noch nicht unterstützt\n("ldaps://" URLs are not yet supported)\n] +de,dsgw,138,[Argumente für Betriebsanweisung "template" fehlen\n(Missing arguments for "template" directive)\n] +de,dsgw,139,[Argument für Betriebsanweisung "sslrequired" fehlt\n(Missing argument for "sslrequired" directive)\n] +de,dsgw,140,[Unbekanntes Argument für Betriebsanweisung "sslrequired" (muß "never", "whenauthenticated"oder "always" sein)\n(Unknown argument to "sslrequired" directive (should be "never", "whenauthenticated", "always"))\n] +de,dsgw,141,[Argument für Betriebsanweisung "securitypath" fehlt\n(Missing argument for "securitypath" directive)\n] +de,dsgw,142,[Argument für Betriebsanweisung "location-suffix" fehlt\n(Missing argument for "location-suffix" directive)\n] +de,dsgw,143,[Die Betriebsanweisung "location" erfordert drei Argumente\n(Three arguments are required for the "location" directive)\n] +de,dsgw,144,[Die Betriebsanweisung "newtype" erfordert mindestens zwei Argumente\n(At least two arguments are required for the "newtype" directive)\n] +de,dsgw,145,[Unbekannte Adresse in der Betriebsanweisung "newtype"\n(Unknown location in "newtype" directive)\n] +de,dsgw,146,[Die Betriebsanweisung "tmplset" erfordert drei oder vier Argumente\n(Three or four arguments are required for the "tmplset" directive)\n] +de,dsgw,147,[Die Betriebsanweisung "attrvset" erfordert vier Argumente\n(Four arguments are required for the "attrvset" directive)\n] +de,dsgw,148,[Argument für Betriebsanweisung "charset" fehlt\n(Missing argument for "charset" directive)\n] +de,dsgw,149,[Argument für Betriebsanweisung "ClientLanguage" fehlt\n(Missing argument for "ClientLanguage" directive)\n] +de,dsgw,150,[Argument für Betriebsanweisung "AdminLanguage" fehlt\n(Missing argument for "AdminLanguage" directive)\n] +de,dsgw,151,[Argument für Betriebsanweisung "DefaultLanguage" fehlt\n(Missing argument for "DefaultLanguage" directive)\n] +de,dsgw,152,[Dateiname für Betriebsanweisung "include" fehlt\n(Missing filename for "include" directive)\n] +de,dsgw,153,[Unbekannte Betriebsanweisung in der Konfigurationsdatei\n(Unknown directive in config file)\n] +de,dsgw,154,[<= erase_db konnte lcache.conf-Datei "%s" nicht öffnen\n(<= erase_db could not open lcache.conf file with name shown)\n] +de,dsgw,155,[\n

      Die Datenbank wurde gelöscht. Neue Datenbank wird erstellt...\n(The database has been deleted. Creating new database...)\n\n ] +de,dsgw,156,[\n

      Die Datenbank konnte nicht gelöscht werden\n(The database could not be deleted)\n\n ] +de,dsgw,157,[<= app_suffix konnte ldif-Datei "%s" nicht öffnen\n(<= app_suffix could not open ldif file with name shown)\n] +de,dsgw,158,[<= app_suffix konnte tmp-Datei "%s" nicht öffnen\n(<= app_suffix could not open tmp file with name shown)\n] +de,dsgw,159,[%s konnte nicht in %s umbenannt werden\n(Unable to rename with names as shown)] +de,dsgw,160,[Leerzeiger wurde von dbconf_read_default_dbinfo() zurückgegeben.\n(null pointer returned by dbconf_read_default_dbinfo().)] +de,dsgw,161,[Falsche "ldapdb"-URL - Basis-DN fehlt\n(Bad "ldapdb" URL - the base DN is missing)\n] +de,dsgw,162,[Falsche "ldapdb"-URL (Bad "ldapdb" URL)\n] +de,dsgw,163,[Falsche URL für Betriebsanweisung "baseurl" angegeben - Basis-DN fehlt \n(Bad URL provided for "baseurl" directive - the base DN is missing)\n] +de,dsgw,164,[Betriebsanweisung "baseurl" wird analysiert\n(parsing baseurl directive)] +de,dsgw,165,[Falsche URL für Betriebsanweisung "baseurl" angegeben - keine "ldap:// bzw. ldapdb://" URL\n(Bad URL provided for "baseurl" directive - not an "ldap:// or ldapdb://" URL)\n] +de,dsgw,166,["ldaps://" URLs werden noch nicht unterstützt\n("ldaps://" URLs are not yet supported)\n] +de,dsgw,167,[Kein Wert für binddn angegeben\n(No value given for binddn)] +de,dsgw,168,[Kein Wert für bindpw angegeben\n(No value given for bindpw)] +de,dsgw,169,[In der dbswitch.conf-Datei ist kein Standard-Verzeichnisservice angegeben\n(There is no default directory service defined in the dbswitch.conf file)] +de,dsgw,170,[Konfigurationsdatei "%s" kann nicht zum Schreiben geöffnet werden\n(Cannot open config file with name shown for writing)\n] +de,dsgw,171,[Kann %s nicht in %s umbenennen\n(Unable to rename with names as shown)] +de,dsgw,172,[Konfigurationsdatei (config file) %s: ] +de,dsgw,173,[Konfigurationsdatei (config file) %s: Zeile (line) %d: ] +de,dsgw,174,[Max. (max) %d] +de,dsgw,175,[ OK ] +de,dsgw,176,[Fenster schließen (Close Window)] +de,dsgw,177,[Zurück] +de,dsgw,178,[{crypt}GESPERRT (LOCKED) [%s GMT]] +de,dsgw,179,[Zurück zum Hauptbildschirm (Return to Main)] +de,dsgw,181,[ Help ] +de,dsgw,182,[Hilfe (Help)] +de,dsgw,184,[Hilfe ist noch nicht verfügbar.\n(Help is not yet available.)] +de,dsgw,186,[Fenster schließen (Close Window)] +de,dsgw,187,[Fenster schließen (Close Window)] +de,dsgw,188,[?template fehlt (missing ?template)] +de,dsgw,189,[Beglaubigen...(Authenticate...)] +de,dsgw,190,[Beglaubigungsberechtigung löschen (abmelden)?\n(Discard authentication credentials (log out)?)] +de,dsgw,191,[Geben Sie eine Suchenzeichenfolge an\n(Please type a search string)] +de,dsgw,192,[Um Ihren Zugriff zu dem Verzeichnis zu beglaubigen, müssen Sie sich zunächst zu\nerkennen geben.
      Geben Sie Ihren Namen ein:\n(The first step in authenticating to the directory is identifying\nyourself.
      Please type your name:)] +de,dsgw,193,[Weiter (Continue)] +de,dsgw,194,[Weiter (Continue)] +de,dsgw,195,[Abbrechen (Cancel)] +de,dsgw,196,[Als Verzeichnisverwalter beglaubigen">  (nur für Verzeichnis-Administratoren verfügbar)\n(Authenticate as directory manager">  (only available to Directory Administrators))\n] +de,dsgw,197,[Beglaubigen...(Authenticate...)] +de,dsgw,198,[Beglaubigungsberechtigung löschen? (Discard authentication credentials?)] +de,dsgw,200,[Weiter (Continue)] +de,dsgw,201,[Weiter (Continue)] +de,dsgw,202,[Abbrechen (Cancel)] +de,dsgw,203,[Zugriff zu dem Verzeichnis beglaubigen (anmelden)\n(Authenticate (log in) to the directory)] +de,dsgw,204,[Ihr Zugriff zu dem Verzeichnis wird gleich beglaubigt werden unter \n(You are about to authenticate to the directory as) %s. Geben Sie zum Vervollständigen des Beglaubigungsvorgangs Ihr Kennwort ein. (To complete the authentication process, type your password.\n] +de,dsgw,206,[Ehe Sie Einträge bearbeiten bzw. hinzufügen können, muß\nIhr Zugriff zu dem Verzeichnis beglaubigt (angemeldet) sein\n. Folgen Sie den Anweisungen für den Beglaubigungsprozeß\nauf diesem Fenster.\n(Before you can edit or add entries, you must authenticate\n(log in) to the directory. This window will guide\nyou through the steps of the authentication\nprocess.)\n] +de,dsgw,207,[Ihr Zugriff zu dem Verzeichnis kann von diesem Bildschirm aus\nbeglaubigt bzw. angemeldet werden.\nSie müssen beglaubigt sein, ehe Sie Verzeichniseinträge\nändern können. Wenn Sie einen Eintrag, ohne beglaubigt zu sein, ändern möchten, dann werden Sie aufgefordert, sich anzumelden.\n(From this screen you may authenticate, or log in, \nto the directory. You will need to authenticate\nbefore you can modify directory entries. If you\nattempt to modify an entry without authenticating,\nyou will be asked to log in.)\n] +de,dsgw,208,[Beglaubigungsstatus(Authentication Status)] +de,dsgw,209,[
      \nIhr Zugriff zu dem Verzeichnis ist derzeitig beglaubigt unter \n(\nYou are currently authenticated to the directory as )] +de,dsgw,210,[.\nWenn Sie Ihre Beglaubigungsberechtigung löschen und sich vom Verzeichnis abmelden möchten, klicken Sie unten auf die Schaltfläche.\n(.\nIf you wish to discard your authentication credentials and log out of the directory, click on the button below.)] +de,dsgw,211,[Beglaubigungsberechtigung löschen (abmelden)\n(Discard Authentication Credentials (log out))] +de,dsgw,212,[Ihre Beglaubigungsberechtigung für \n(Your authentication credentials for )] +de,dsgw,213,[ist abgelaufen (have expired).\n


      )\n] +de,dsgw,214,[Ihr Zugriff zu dem Verzeichnis ist derzeitig nicht beglaubigt.\n(Currently, you are not authenticated to the directory.
      )\n] +de,dsgw,215,["%s=" fehlt (missing)] +de,dsgw,216,["%s=%s" unbekannt (unknown)] +de,dsgw,217,[unbekannte Option (unknown option) %s ] +de,dsgw,218,[unbekannte Syntax=%s (syntax shown unknown)\n] +de,dsgw,219,[** HTML-Typ "%s" nicht unterstützt **
      \n(** HTML type shown is not supported **
      )\n] +de,dsgw,224,[Bearbeiten (Edit)] +de,dsgw,225,[Save Changes] +de,dsgw,226,[modify] +de,dsgw,227,[add] +de,dsgw,228,[Löschen (Delete)] +de,dsgw,229,[Diesen Eintrag löschen? (Delete this entry?)] +de,dsgw,230,[Umbenennen (Rename)] +de,dsgw,231,[Neuen Namen für diesen Eintrag eingeben:\n(Enter a new name for this entry:)] +de,dsgw,232,[Bearbeiten unter (Edit As)] +de,dsgw,233,[%s= fehlt (missing)] +de,dsgw,234,[Fenster schließen (Close Window)] +de,dsgw,235,[Bearbeiten... (Edit...)] +de,dsgw,236,["%s=" fehlt (missing)\n] +de,dsgw,237,[Unbekannter Satz "%s" (set shown is unknown)\n] +de,dsgw,238,[unbekannte Syntax "%s" (unknown syntax "%s")\n] +de,dsgw,239,[Neu beglaubigen (Re-Authenticate)] +de,dsgw,240,[Fenster schließen (Close Window)] +de,dsgw,241,[Möchten Sie wirklich (Do you really want to )] +de,dsgw,242,[?] +de,dsgw,243,[ OK ] +de,dsgw,244,[ OK ] +de,dsgw,245,[Zurücksetzen (Reset)] +de,dsgw,246,[Beendet (Done)] +de,dsgw,247,[Abbrechen (Cancel)] +de,dsgw,248,[anderes IF gefunden (geschachtelte IFs sind nicht unterstützt)\n(found another IF (nested IFs are not supported))] +de,dsgw,249,[ELSE wurde gefunden, aber kein IF\n(found ELSE but didn't see an IF)] +de,dsgw,250,[ELSE nach ELSE gefunden (ENDIF erwartet)\n(found ELSE after ELSE (expecting ENDIF))] +de,dsgw,251,[ELSE wurde gefunden, aber kein IF\n(found ELIF but didn't see an IF)] +de,dsgw,252,[ELIF nach ELSE gefunden (ENDIF erwartet)\n(found ELIF after ELSE (expecting ENDIF))] +de,dsgw,253,[ELDIF wurde gefunden, aber kein IF\n(found ENDIF but didn't see an IF)] +de,dsgw,254,[
      Vorlagefehler (template error): %s
      \n] +de,dsgw,255,[ldap_init/lcache_init aufgerufen, ehe Konfigurationsdatei gelesen wurde\n(ldap_init/lcache_init attempted before config file read)] +de,dsgw,256,[führt nicht unter dem Verwaltungs-Server aus\n(not running under the administration server)] +de,dsgw,257,[Konnte Genehmigungen nicht initialisieren\n(Could not initialize permissions)] +de,dsgw,258,[Konnte Benutzername nicht auf einem DN abbilden (Fehler vom Verwaltungs-Server)\n(Could not map username to a DN (error from admin server))] +de,dsgw,259,[Konnte aktuellen Benutzernamen nicht aufrufen\n(Could not get current username)] +de,dsgw,260,[Konnte aktuelles Benutzerkennwort nicht abrufen\n(Could not get current user password)] +de,dsgw,261,[Fehler (Error): %s] +de,dsgw,262,[Hinweis: Für diese Art von Eintrag gibt es keine Anzeigevorlage; die Eintragsart \nwird unten\nim Standarmodus angezeigt.\n(Note: there is no display template for this type of entry available, so it is\ndisplayed below using a default method.)] +de,dsgw,263,[Ungültige Benutzer-ID bzw. NULL LDAP-Erkennung\n(Invalid user id or NULL LDAP handle)] +de,dsgw,264,[keine Übereinstimmung mit Benutzer-ID\n(no match for user id)] +de,dsgw,265,[mehr als eine Übereinstimmung mit Benutzer-ID\n(more than one match for user id)] +de,dsgw,266,[the entire directory] +de,dsgw,267,[Die Betriebsanweisung "includeset" erfordert zwei Argumente\n(Two arguments are required for the "includeset" directive)\n] +de,dsgw,268,[Der angeforderte Attributwert wurde im Eintrag nicht gefunden (The attribute value requested was not found in the entry)] +de,dsgw,269,[Argument fehlt in der "NLS"-Betriebsanweisung\n] +de,dsgw,270,[Es muß ein NT-Benutzername angegeben werden] +de,dsgw,271,[Die Kombination aus NT-Benutzernamen und NT-Domäne ist in diesem Verzeichnis nicht eindeutig\n] +de,dsgw,272,[Es muß sowohl ein NT-Benutzername als auch eine NT-Domäne angegeben werden\n] +de,dsgw,273,[Der NT-Benutzername darf nicht länger sein als 20 Zeichen.] +de,dsgw,274,[Namen für den neuen Eintrag angeben.] +de,dsgw,275,[Standort für den neuen Eintrag auswählen.] +de,dsgw,276,[Neuer Eintrag] +de,dsgw,277,[Für diese Funktion muß ein Verzeichnisverwalter in der Datei "dsgw.conf" definiert sein] +de,dsgw,278,[Die Betriebsanweisung "vcard-property" erfordert drei oder vier Argumente.\n] +de,dsgw,279,[DieVCard-Eigenschaft kann nur entweder "cis" oder "mls" lauten.\n] +de,dsgw,280,[Kein Eintrag gefunden.\n%2$s] +de,dsgw,281,[Kein Eintrag gefunden, in dem %2$s '%4$s' %3$s.\n] +de,dsgw,282,[Kein Eintrag gefunden.\n%2$s] +de,dsgw,283,[Kein Eintrag gefunden, in dem %2$s '%4$s' %3$s.\n] +de,dsgw,284,[1 Eintrag gefunden.\n%2$s] +de,dsgw,285,[1 Eintrag gefunden, in dem %2$s '%4$s' %3$s.\n] +de,dsgw,286,[1 Eintrag gefunden.\n%2$s] +de,dsgw,287,[1 Eintrag gefunden, in dem %2$s '%4$s' %3$s.\n] +de,dsgw,288,[%1$li Einträge gefunden.\n%2$s] +de,dsgw,289,[%1$li Einträge gefunden, in denen %2$s '%4$s' %3$s.\n] +de,dsgw,290,[%1$li Einträge gefunden.\n%2$s] +de,dsgw,291,[%1$li Einträge gefunden, in denen %2$s '%4$s' %3$s.\n] +de,dsgw,292,[der LDAP-Filter ist] +de,dsgw,293,[Der Server konnte den Eintrag, den Sie bei der Beglaubigung verwendet haben, nicht finden. Möglicherweise wurde der Eintrag umbenannt oder gelöscht. Bitte wiederholen Sie die Beglaubigung.] +de,dsgw,294,[Die neue Kennwortsyntax ist ungültig.\n] +de,dsgw,295,[Das neue Kennwort ist in der Kennwortchronik enthalten.\n] +de,dsgw,296,[Sie haben den Grenzwert für die Wiederholung des Kennworts überschritten. Bitte wenden Sie sich an den Systemverwalter.\n] +de,dsgw,297,[Sie haben den Grenzwert für die Wiederholung des Kennworts überschritten. Versuchen Sie es später erneut.\n] +de,dsgw,298,[Das Kennwort ist abgelaufen. Wenden Sie sich an den Systemverwalter, um das Kennwort zurückzusetzen.\n] +de,frame,-1,[$DBT: frame in DB file v1 $] +de,frame,1,[Nicht gefunden (Not Found)

      Nicht gefunden (Not Found)

      Das angeforderte Objekt existiert nicht auf diesem Server. Die von Ihnen verfolgte Verknüpfung ist entweder veraltet, ungenau oder der Server darf sie Ihnen nicht anbieten.\n(The requested object does not exist on this server. The link you followed is either outdated, inaccurate, or the server has been instructed not to let you have it.)] +de,frame,2,[Informieren Sie bitte den Standortverwalter über die , Bezugsseite .\n(Please inform the site administrator of the referring page.)] +de,frame,3,[Ihr Browser sandte eine Anforderung, die dieser Proxy-Server nicht verstehen kann.\n(Your browser sent a request that this proxy could not understand.)] +de,frame,4,[Ordnungsgemäße Genehmigung ist für den Administrator dieses Proxy-Servers erforderlich.\nEntweder führt Ihr Browser keine Genehmigung aus oder Ihre Genehmigung ist falsch.\n(Proper authorization is required for the administration of this proxy.\nEither your browser does not perform authorization, or your authorization\nhas failed.)] +de,frame,5,[Beglaubigung des Benutzernamens ist erforderlich, um diesen Proxy-Server zu benutzen.\n Entweder führt Ihr Browser keine Proxy-Genehmigung aus oder Ihre Genehmigung ist falsch.\n(Username authentication is required for using this proxy.\nEither your browser does not perform proxy authorization, or your\nauthorization has failed.)] +de,frame,6,[Die Zugriffssteuerungskonfiguration des Proxy-Servers verweigert\nZugriff auf das durch diesen Proxy-Server angeforderte Objekt.\n(The proxy's access control configuration denies access to\nthe requested object through this proxy.)] +de,frame,7,[Im Proxy-Server ist ein interner Fehler aufgetreten, so daß Ihre\nAnforderung nicht ausgeführt werden kann. Wahrscheinlich ist die Konfiguration falsch.\nBitten Sie den Administrator, nach entsprechenden Hinweisen im Fehlerprotokoll des Proxy-Servers zu suchen.\n(The proxy has encountered an internal error which prevents it from\nfulfilling your request. The most likely cause is a misconfiguration.\nPlease ask the administrator to look for messages in the proxy's error log.)] +de,frame,8,[Dieser Proxy-Server setzt nicht die angeforderte Methode ein.\n(This proxy server does not implement the requested method.)] +de,frame,9,[Ein Fehler ist auf dem Proxy-Server aufgetreten.\n(An error has occurred on the proxy server.)] +de,frame,10,[Dieser Server konnte die gesendete Anfrage Ihres Browsers nicht verstehen.\n(Your browser sent a query this server could not understand.)] +de,frame,11,[Ordnungsgemäße Genehmigung ist für diesen Bereich erforderlich. Entweder führt Ihr Browser keine Genehmigung aus oder Ihre Genehmigung ist falsch.\n(Proper authorization is required for this area. Either your browser does not perform authorization, or your authorization has failed.)] +de,frame,12,[Ihr Client darf das angeforderte Objekt nicht abrufen.\n(Your client is not allowed to access the requested object.)] +de,frame,13,[In diesem Server ist ein interner Fehler aufgetreten, so daß Ihre Anforderung nicht ausgeführt werden kann. Wahrscheinlich ist die Konfiguration falsch. Bitten Sie den Administrator, nach entsprechenden Hinweisen im Fehlerprotokoll des Proxy-Servers zu suchen.\n(This server has encountered an internal error which prevents it from fulfilling your request. The most likely cause is a misconfiguration. Please ask the administrator to look for messages in the server's error log.)] +de,frame,14,[Dieser Server setzt nicht die angeforderte Methode ein.\n(This server does not implement the requested method.)] +de,frame,15,[Ein Fehler ist aufgetreten.\n(An error has occurred.)] +de,frame,16,[Dieser Server konnte die gesendete Meldung Ihres Browsers nicht verstehen.\n(Your browser sent a message this server could not understand.)] +de,frame,17,[%s

      %s

      \nDieses Dokument wurde an einen neuen Standort verschoben. Aktualisieren Sie bitte Ihre Dokumente und Hotlisten entsprechend.(This document has moved to a new location. Please update your documents and hotlists accordingly.)\n] +de,frame,18,[%s\n

      %s

      \n%s\n] +de,frame,19,[process-uri-objects] +de,frame,20,[cannot find template %s] +de,frame,21,[process-uri-objects] +de,frame,22,[no partial path after object processing] +de,frame,23,[find-service] +de,frame,24,[invalid shexp %s] +de,frame,25,[find-service] +de,frame,26,[invalid shexp %s] +de,frame,27,[handle-processed] +de,frame,28,[no way to service request for %s] +de,frame,29,[finish-socks-request] +de,frame,30,[close failed (%s), csd=%d] +de,frame,31,[This beta software has expired.\n] +de,frame,32,[mr_accept(%d)] +de,frame,33,[Error issuing read on accept socket] +de,frame,34,[acb_accept_connection(%d)] +de,frame,35,[Error getting accept socket (%d)] +de,frame,36,[Error in accept! (%d, %s)] +de,frame,37,[Error creating new accept request] +de,frame,38,[accepted connection: %d (NSPR %d)] +de,frame,39,[Error creating new session structure] +de,frame,40,[accel_read_request()] +de,frame,41,[Error allocating request read buffer] +de,frame,42,[Error issuing async read request] +de,frame,43,[acb_read_request(%d, bytes %d)] +de,frame,44,[acb_read_req(1 session = %d)] +de,frame,45,[Error reading request (%d, %s)] +de,frame,46,[Client aborted connection] +de,frame,47,[Error reading request] +de,frame,48,[Error creating new request] +de,frame,49,[error occurred, closing %d, io was for %d] +de,frame,50,[accel_async_scan_headers()] +de,frame,51,[out of memory: accel_async_scan_headers] +de,frame,52,[out of memory: accel_async_scan_headers] +de,frame,53,[Error during async read (%d, %s)] +de,frame,54,[scan-headers reports: line too long] +de,frame,55,[scan-headers reports: too many headers] +de,frame,56,[Error reading headers] +de,frame,57,[scan-headers reports: header missing terminator (an empty line)] +de,frame,58,[scan-headers reports: header was empty] +de,frame,59,[Name ohne Wert: Zeile "%s" erhalten\n(name without value: got line as shown)] +de,frame,60,[accel_send_plain_file()] +de,frame,61,[accel_send_plain_file() - found request %d] +de,frame,62,[Parse headers lost the URI!] +de,frame,63,[accel_send_plain_file() - found uri %s] +de,frame,64,[accel_send_plain_file() - found in cache?] +de,frame,65,[malloc died!] +de,frame,66,[Error writing back file\n] +de,frame,67,[acb_send_plain_file(%d)] +de,frame,68,[Error writing in acb_send_plain_file (%d, %s)] +de,frame,69,[acb_close_connection(%d)] +de,frame,70,[Errored IO in acb_close_connection (%d, %s)] +de,frame,71,[Unable to close socket %d] +de,frame,72,[accel-cache-insert: Error allocating entry] +de,frame,73,[cache-init: server cache disabled] +de,frame,74,[accel_file_cache: Error initializing file cache] +de,frame,75,[accel_file_cache: Error creating cache] +de,frame,76,[accel_file_cache_init: CacheHashSize < %d, using %d] +de,frame,77,[accel_file_cache_init: CacheHashSize > %d, using %d] +de,frame,78,[accel_file_cache_init: MaxNumberOfCachedFiles < %d, using %d] +de,frame,79,[accel_file_cache_init: MaxNumberOfCachedFiles > %d, using %d] +de,frame,80,[accel_file_cache_init: MaxNumberOfOpenCachedFiles < %d, using %d] +de,frame,81,[accel_file_cache_init: MaxNumberOfOpenCachedFiles > %d, using %d] +de,frame,82,[accel_file_cache: Error initializing file cache] +de,frame,83,[file-cache: enabled = %s ] +de,frame,84,[on] +de,frame,85,[off] +de,frame,86,[file-cache: MaxNumberOfCachedFiles %d (0x%x)] +de,frame,87,[file-cache: CacheHashSize %d (0x%x)] +de,frame,88,[file-cache: MaxNumberOfOpenCachedFiles %d (0x%x)] +de,frame,89,[accel-cache-insert: Error allocating entry] +de,frame,90,[file-cache-cleanup: munmap failed (%s)] +de,frame,91,[file-cache-cleanup: found mmapped file \non system without mmap] +de,frame,92,[file_cache_init: MaxTotalCachedFileSize < %d, using %d] +de,frame,93,[file_cache_init: MaxTotalCachedFileSize > %d, using %d] +de,frame,94,[file cache using mmap flags 0x%x] +de,frame,95,[file cache using mmap prots 0x%x] +de,frame,96,[file-cache-init: could not create lock] +de,frame,97,[file-cache: unable to create temporary directory %s.\n] +de,frame,98,[file-cache: unable to create temporary directory %s.\n] +de,frame,99,[file-cache: GetTempPath() Cannot find temp directory to store file!] +de,frame,100,[file-cache-init: set max cached file size to %d] +de,frame,101,[file-cache-init: could not create lock] +de,frame,102,[file_cache_destroy()] +de,frame,103,[file-cache: Unable to get temp file name. Error %s] +de,frame,104,[file-cache: Unable to get temp file name. Error %s] +de,frame,105,[file-cache-insert: Error allocating entry] +de,frame,106,[file-cache-create: Error opening file %s (%s)] +de,frame,107,[file-cache-create: Error stat()ing file %s (%s)] +de,frame,108,[file-cache-create: Error mmap()ing file %s (%s)] +de,frame,109,[file-cache-create: malloc failure] +de,frame,110,[file-cache-create: error case failed to munmap(%d, %d) (%s)] +de,frame,111,[file-cache-valid: cannot stat %s] +de,frame,112,[dir change: invalidating %s (%d)] +de,frame,113,[file-cache: asynchronous file change notification failed.] +de,frame,114,[dir change: offset %d, action %d, len %d, name %s] +de,frame,115,[unable to check async file status] +de,frame,116,[ReadDirectoryChangesW failure- unable to continue watching %s. Error is %s] +de,frame,117,[file-cache-add-watch failure- unable to open directory %s. Error %s] +de,frame,118,[ReadDirectoryChangesW failure- unable to start watching %s. Error %s] +de,frame,119,[func_exec] +de,frame,120,[no handler function given for directive] +de,frame,121,[func_exec] +de,frame,122,[cannot find function named %s] +de,frame,123,[handle-request] +de,frame,124,[method without URI] +de,frame,125,[http-parse-request] +de,frame,126,[while scanning HTTP headers, %s] +de,frame,127,[handle-request] +de,frame,128,[read from %s failed, error is %s] +de,frame,129,[handle-request] +de,frame,130,[request too long] +de,frame,131,[start-http-response] +de,frame,132,[write failed (%s)] +de,frame,133,[start-http-response] +de,frame,134,[write failed (%s)] +de,frame,135,[http-status] +de,frame,136,[%d is not a valid HTTP status code] +de,frame,137,[finish-request] +de,frame,138,[close failed (%s)] +de,frame,139,[Unable to close socket for writing] +de,frame,140,[os has %d objects] +de,frame,141,[obj %d has no hash table at %d] +de,frame,142,[obj %d has no param] +de,frame,143,[obj %d name %s value %s] +de,frame,144,[.....directives %d.......] +de,frame,145,[.....directive %d] +de,frame,146,[.......instance %d] +de,frame,147,[...........param name %s value %s] +de,frame,148,[ClearConfigurationParameters:RegCreateKey %s] +de,frame,149,[ClearConfigurationParameters:RegEnumKey %s failed] +de,frame,150,[obj.conf line %d: error in filter file "%s" at line %d: %s] +de,frame,151,[obj.conf line %d: error in filter file "%s" at line %d: %s] +de,frame,152,[Unable to allocate Subject property list.\n] +de,frame,153,[Unable to set session ptr in Subject property list - error=%d\n] +de,frame,154,[Unable to set request ptr in Subject property list - error=%d\n] +de,frame,155,[file-cache-valid: cannot stat %s] +de,frame,156,[file-cache-create: Error stat()ing file %s (%s)] +de,httpdaemon,-1,[$DBT: httpdaemon in DB file v1 $] +de,httpdaemon,1,[Error in ConvertThreadToFiber] +de,httpdaemon,2,[Error in ConvertThreadToFiber] +de,httpdaemon,3,[Error in md_start_system] +de,httpdaemon,4,[Error in CreateFiber - idlefiber] +de,httpdaemon,5,[Error in GetQueuedCompletionStatus] +de,httpdaemon,6,[Error creating completion port] +de,httpdaemon,7,[Could not SetHandleNonInheritable (%s)] +de,httpdaemon,8,[Error accept/read new conn] +de,httpdaemon,9,[Error in Respond()] +de,httpdaemon,10,[Error in RespondCompleted()] +de,httpdaemon,11,[daemon: unable to fork new process (%s)\n] +de,httpdaemon,12,[daemon: setsid failed (%s)\n] +de,httpdaemon,13,[daemon: can't log pid to %s (%s)\n] +de,httpdaemon,14,[warning: could not set group id to %d (%s)\n] +de,httpdaemon,15,[warning: could not set user id to %d (%s)\n] +de,httpdaemon,16,[warning: daemon is running as super-user\n] +de,httpdaemon,17,[could not determine current user name\n] +de,httpdaemon,18,[error: chroot to %s failed (%s)\n] +de,httpdaemon,19,[WARNING! netscape executable and library have different versions.\n] +de,httpdaemon,20,[startup: listening to %s://%s, port %d as %s\n] +de,httpdaemon,21,[startup: listening to %s://%s, port %d as %s\n] +de,httpdaemon,22,[seminit failed (%s)\n] +de,httpdaemon,23,[Using single threaded accepts.] +de,httpdaemon,24,[Using multi threaded accepts.] +de,httpdaemon,25,[Using partial single threaded accepts.] +de,httpdaemon,26,[This machine has %d processors.] +de,httpdaemon,27,[Error calling thr_seconcurrency(%d)- (%s)] +de,httpdaemon,28,[Set conncurrency to %d.] +de,httpdaemon,29,[can't fork new process (%s)] +de,httpdaemon,30,[This beta software has expired.\n] +de,httpdaemon,31,[can't create IPC pipe (%s)] +de,httpdaemon,32,[write to wakeup pipe failed (%s)] +de,httpdaemon,33,[select thread miss] +de,httpdaemon,34,[startup failure: could not bind to port %d (%s)\n] +de,httpdaemon,35,[startup failure: could not bind to port %d, IP address %s (%s)\n] +de,libaccess,-1,[$DBT: libaccess in DB file v1 $] +de,libaccess,1,[basic-ncsa] +de,libaccess,2,[cannot open database %s] +de,libaccess,3,[basic-ncsa] +de,libaccess,4,[user %s password did not match database %s] +de,libaccess,5,[basic-ncsa] +de,libaccess,6,[cannot open connection to LDAP server on %s:%d] +de,libaccess,7,[basic-ncsa] +de,libaccess,8,[user %s password did not match LDAP on %s:%d] +de,libaccess,9,[acl-state] +de,libaccess,10,[missing realm] +de,libaccess,11,[Unable to allocate ACL List Hash\n] +de,libaccess,12,[ACLEvalBuildContext unable to PERM_MALLOC cache structure\n] +de,libaccess,13,[ACLEvalBuildContext unable to create hash table\n] +de,libaccess,14,[ACLEvalBuildContext unable to allocate ACE Entry\n] +de,libaccess,15,[ACLEvalBuildContext unable to allocate ACE entry\n] +de,libaccess,16,[ACLEvalBuildContext unable to allocate Boundary Entry\n] +de,libaccess,17,[ACLEvalBuildContext failed.\n] +de,libaccess,18,[ACL_EvalTestRights: an interim, absolute non-allow value was encountered. right=%s, value=%d\n] +de,libaccess,19,[LASDnsBuild unable to allocate hash table header\n] +de,libaccess,20,[LASDnsBuild unable to add key %s\n] +de,libaccess,21,[LASDnsBuild unable to add key %s\n] +de,libaccess,22,[LASDnsBuild unable to add key %s\n] +de,libaccess,23,[LASDnsBuild unable to add key %s\n] +de,libaccess,24,[LASDnsBuild unable to add key %s\n] +de,libaccess,25,[LAS DNS build received request for attribute %s\n] +de,libaccess,26,[LASDnsEval - illegal comparator %s\n] +de,libaccess,27,[LASDnsEval unable to allocate Context struct\n\n] +de,libaccess,28,[LASDnsEval unable to get session address %d\n] +de,libaccess,29,[LASDnsEval unable to get DNS - error=%s\n] +de,libaccess,30,[LAS Group Eval received request for attribute %s\n] +de,libaccess,31,[LASGroupEval - illegal comparator %s\n] +de,libaccess,32,[LASGroupEval - ran out of memory\n] +de,libaccess,33,[LASGroupEval unable to get session address %d\n] +de,libaccess,34,[LASGroupEval unable to get session address %d\n] +de,libaccess,35,[LASGroupEval - couldn't locate getter for auth-user\n] +de,libaccess,36,[LASGroupEval - Attribute getter for auth-user failed\n] +de,libaccess,37,[LASGroupEval - Attribute getter didn't set auth-user\n] +de,libaccess,38,[Check group membership of user "%s" for group "%s"\n] +de,libaccess,39,[LDAPU_SUCCESS for group "%s"\n] +de,libaccess,40,[LDAPU_FAILED for group "%s"\n] +de,libaccess,41,[LAS_EVAL_FALSE\n] +de,libaccess,42,[LAS_EVAL_TRUE\n] +de,libaccess,43,[LASIpTreeAlloc - no memory\n] +de,libaccess,44,[IP LAS unable to allocate tree node\n] +de,libaccess,45,[IP LAS unable to allocate tree node\n] +de,libaccess,46,[LAS IP build received request for attribute %s\n] +de,libaccess,47,[LASIpEval - illegal comparator %s\n] +de,libaccess,48,[LASIpEval unable to get session address - error=%s\n] +de,libaccess,49,[LASIpEval unable to allocate Context struct\n\n] +de,libaccess,50,[LASIpEval - reach 32 bits without conclusion value=%s] +de,libaccess,51,[LAS Program Eval received request for attribute %s\n] +de,libaccess,52,[LASProgramEval - illegal comparator %s\n] +de,libaccess,53,[LASProgram unable to get session address %d\n] +de,libaccess,54,[bin] +de,libaccess,55,[LASProgramEval: request not of type admin or bin, passing.\n] +de,libaccess,56,[LASProgramEval: check if program %s matches pattern %s.\n] +de,libaccess,57,[LASProgramEval: Invalid wildcard expression %s.\n] +de,libaccess,58,[LAS_EVAL_FALSE\n] +de,libaccess,59,[LAS_EVAL_TRUE\n] +de,libaccess,60,[Unexpected attribute in dayOfWeek - %s\n] +de,libaccess,61,[Illegal comparator for dayOfWeek - %s\n] +de,libaccess,62,[Unexpected attribute in timeOfDay - %s\n] +de,libaccess,63,[LAS User Eval received request for attribute %s\n] +de,libaccess,64,[LASUserEval - illegal comparator %s\n] +de,libaccess,65,[LASUserEval - ran out of memory\n] +de,libaccess,66,[LASUserEval unable to get session address %d\n] +de,libaccess,67,[LASUserEval unable to get session address %d\n] +de,libaccess,68,[LASGroupEval - couldn't locate getter for auth-user\n] +de,libaccess,69,[LASGroupEval - Attribute getter for auth-user failed\n] +de,libaccess,70,[LASGroupEval - Attribute getter didn't set auth-user\n] +de,libaccess,71,[Check if uid == user (i.e. check "%s" == "%s)"\n] +de,libaccess,72,[SUCCESS for user "%s"\n] +de,libaccess,73,[FAILED for user "%s"\n] +de,libaccess,74,[LAS_EVAL_FALSE\n] +de,libaccess,75,[LAS_EVAL_TRUE\n] +de,libaccess,76,[] +de,libaccess,77,[LASProgram unable to get request address - error=%s] +de,libaccess,78,[LASProgram rejecting request for program %s from pattern %s] +de,libaccess,79,[ACL_CacheFlush: unable to parse file "%s"\n] +de,libaccess,80,[ACL_CacheFlush: unable to concatenate ACL list "%s"\n] +de,libaccess,81,[ACL_CacheFlush: unable to open and process the magnus file "%s"\n] +de,libaccess,82,[Illegal comparator for timeOfDay - %s\n] +de,libaccess,83,[ACL_EvalBuildContext unable to create hash table\n] +de,libaccess,84,[ACL_EvalBuildContext unable to PERM_CALLOC cache structure\n] +de,libaccess,85,[ACL_EvalBuildContext unable to allocate ACE entry\n] +de,libaccess,86,[ACL_EvalBuildContext unable to allocate auth pointer array\n] +de,libaccess,87,[ACL_EvalBuildContext unable to allocate auth plist\n] +de,libaccess,88,[ACL_EvalTestRights: an interim, absolute non-allow value was encountered. right=%s, value=%s\n] +de,libaccess,89,[ACL_INTEvalTestRights: call to ACL_EvalBuildContext returned failure status\n] +de,libaccess,90,[ACL_ModuleRegister: module name is missing\n] +de,libaccess,91,[ACL_ModuleRegister: call to module init function returned a failed status\n] +de,libaccess,92,[ACL_GetAttribute: couldn't determine method for %s\n] +de,libaccess,93,[ACL_GetAttribute: couldn't locate getter for %s] +de,libaccess,94,[ACL_GetAttribute: attr getter failed to get %s] +de,libaccess,95,[ACL_GetAttribute: attr getter failed to get %s] +de,libaccess,96,[ACL_GetAttribute: All attribute getters declined for attr %s] +de,libaccess,97,[ACL_DatabaseRegister: dbtype for database "%s" is not defined yet!] +de,libaccess,98,[ACL_DatabaseRegister: database name is missing] +de,libaccess,99,[Error reading the DB Map File: %s. Reason: %s] +de,libaccess,100,[URL is missing for database %s] +de,libaccess,101,[Invalid property value pair for database %s] +de,libaccess,102,["default" database must be an LDAP database] +de,libaccess,103,[Multiple "default" databases are being registered] +de,libaccess,104,["default" LDAP database must be registered] +de,libaccess,105,[LASGroupEval unable to get database name - error= %s] +de,libaccess,106,[received invalid program expression %s] +de,libaccess,107,[parse_ldap_url: database url is missing] +de,libaccess,108,[parse_ldap_url: database name is missing] +de,libaccess,109,[parse_ldap_url: error in parsing ldap url. Reason: %s] +de,libaccess,110,[ldap password check: unable to get database name - error=%s] +de,libaccess,111,[ldap password check: unable to get parsed database %s] +de,libaccess,112,[ldap password check: couldn't initialize connection to LDAP. Reason: %s] +de,libaccess,113,[ldap password check: LDAP error: "%s"] +de,libaccess,114,[get_user_ismember_ldap unable to get database name - error=%s] +de,libaccess,115,[get_user_ismember_ldap unable to get parsed database %s] +de,libaccess,116,[ldap password check: couldn't initialize connection to LDAP. Reason: %s] +de,libaccess,117,[get_user_ismember_ldap: group %s does not exist] +de,libaccess,118,[get_user_ismember_ldap: LDAP error: "%s"] +de,libaccess,119,[ACL_LDAPDatabaseHandle: %s is not a registered database] +de,libaccess,120,[ACL_LDAPDatabaseHandle: %s is not an LDAP database] +de,libaccess,121,[ACL_LDAPDatabaseHandle: out of memory] +de,libaccess,122,[ACL_LDAPDatabaseHandle: couldn't initialize connection to LDAP. Reason: %s] +de,libaccess,123,[ACL_LDAPDatabaseHandle: couldn't bind to LDAP server. Reason: %s] +de,libaccess,124,[insufficient dynamic memory] +de,libaccess,125,[error opening file, %s: %s] +de,libaccess,126,[duplicate definition of %s] +de,libaccess,127,[file %s, line %s: duplicate definition of %s] +de,libaccess,128,[file %s, line %s: syntax error] +de,libaccess,129,[file %s, line %s: %s is undefined] +de,libaccess,130,[in acl %s, %s %s is undefined] +de,libaccess,131,[database %s: error accessing %s] +de,libaccess,132,[%s] +de,libaccess,133,[file %s, line %s: invalid syntax] +de,libaccess,134,[file %s, line %s: syntax error at "%s"] +de,libaccess,135,[realm %s is not defined] +de,libaccess,136,[error code = %d] +de,libaccess,137,[internal ACL error] +de,libaccess,138,[invalid argument] +de,libaccess,139,[ACL_DatabaseRegister: dbtype for database "%s" is not defined yet!] +de,libaccess,140,[couldn't determine dbtype from: %s] +de,libaccess,141,[Failed to register database %s] +de,libaccess,142,[ACL call returned failed status] +de,libaccess,143,[file %s: ACL IO error - %s] +de,libaccess,144,[acl_user_exists: Nicht genug Speicher] +de,libaccess,145,[acl_user_exists: Benutzer existiert nicht mehr] +de,libaccess,146,[acl_user_exists: plist-Fehler] +de,libadmin,-1,[$DBT: libadmin in DB file v1 $] +de,libadmin,1,[ Help ] +de,libadmin,2,[ OK ] +de,libadmin,3,[ Reset ] +de,libadmin,4,[ Done ] +de,libadmin,5,[ Cancel ] +de,libir,-1,[$DBT: libadmin in DB file v1 $] +de,libir,1,[An I/O error occurred before all form data could be read.] diff --git a/l10n/dirserv/de/ns-slapd.txt.iso8859 b/l10n/dirserv/de/ns-slapd.txt.iso8859 new file mode 100644 index 00000000..a61ef25f --- /dev/null +++ b/l10n/dirserv/de/ns-slapd.txt.iso8859 @@ -0,0 +1,879 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ + +/* This text file was generated by program dblink */ + +$Revision: 1.1 $ +$Log: ns-slapd.txt.iso8859,v $ +Revision 1.1 2005/01/21 00:40:48 cvsadm +Initial revision + +Revision 1.3.2.3 2003/09/22 19:36:40 ulfw +Update copyright years from 2001 to 2001-2003 + +Revision 1.3.2.2 2001/11/03 01:05:35 richm +XXX use new copyright XXX + +Revision 1.3.2.1 1998/10/10 02:13:59 ggood +Copy from Directory40RtmBranchpoint to DirectoryBranch + +Revision 1.1.2.4.2.2.6.1 1998/04/04 23:16:47 mcs +merge changes made on directory31_rtm_branch into server4_directory_branch + +Revision 1.1.2.4.2.2.2.1 1998/02/24 05:51:52 noriko +Synched with server3_i18npkg_branch + +Revision 1.1.2.6 1997/12/31 00:23:36 werudge +Remove \n from dsgw,198 to fix JavaScript problem + +Revision 1.1.2.5 1997/12/19 02:03:43 werudge +Based on en/ns-slapd.txt : 1.1.2.3 +daily 971113.1 SOLARIS-export-optimize-normal-slapd +$EndLog$ + +$StartStringData$ + +de,base,-1,[$DBT: base in DB file v1 $] +de,base,1,[nicht genügend Arbeitsspeicher zum Erstellen der Hash-Tabelle] +de,base,2,[nicht genügend Arbeitsspeicher zum Erstellen der Hash-Tabelle] +de,base,3,[cache_destroy: Cache-Tabellen scheinen beschädigt zu sein.] +de,base,4,[Hash-Eintrag kann nicht zugewiesen werden] +de,base,5,[cache_insert: Cache-Eintrag kann nicht erstellt werden] +de,base,6,[HTTP/1.0 200 OK\nContent-type: text/html\n\n] +de,base,7,[

      Netscape-Cache Statusbericht

      \n(

      Netscape cache status report

      )\n] +de,base,8,[Keine Caches im System (No caches on system)

      ] +de,base,9,[

      %s Cache (cache)

      \n] +de,base,10,[Cacheverbindungsverhältnis (Cache hit ratio): %d/%d (%f)

      \n

      \n] +de,base,11,[Cachegröße (Cache size): %d/%d

      \n

      \n] +de,base,12,[Hash-Tabellengröße (Hash table size): %d

      \n

      \n] +de,base,13,[mru : %d

      \nlru : %d

      \n] +de,base,14,[
        Originalspeicherbereich (Bucket) Adresse (Address) Schlüssel (Key) Zugriffsanzahl (Access Count) Löschen (Delete) Nächste (Next) LRU MRU Daten (Data)
        \n] +de,base,15,[munmap failed (%s)] +de,base,16,[munmap failed (%s)] +de,base,17,[close failed (%s)] +de,base,18,[daemon: unable to fork new process (%s)\n] +de,base,19,[daemon: setsid failed (%s)\n] +de,base,20,[daemon: can't log pid to %s (%s)\n] +de,base,21,[warning: could not set group id to %d (%s)\n] +de,base,22,[warning: could not set user id to %d (%s)\n] +de,base,23,[warning: daemon is running as super-user\n] +de,base,24,[could not determine current user name\n] +de,base,25,[error: chroot to %s failed (%s)\n] +de,base,27,[, address %s] +de,base,28,[warning: statistics disabled (%s)\n] +de,base,29,[security handshake timed out for pid %d] +de,base,30,[warning: statistics disabled (%s)\n] +de,base,31,[secure handshake failed (code %d)\n] +de,base,32,[accept failed (%s)] +de,base,33,[warning: statistics disabled (%s)\n] +de,base,34,[select thread miss] +de,base,35,[keepalive worker awoken with no work to do] +de,base,36,[could not create new thread: %d (%s)] +de,base,37,[wait for sema succeeded, but nothing to dequeue] +de,base,38,[queue-sema creation failure] +de,base,39,[error getting processor info for processor %d] +de,base,40,[Error binding to processor %d] +de,base,41,[bound process %d to processor %d] +de,base,42,[Netscape server is not explicitly binding to any processors.] +de,base,43,[cache monitor exited] +de,base,44,[cache batch update daemon exited] +de,base,45,[Using single threaded accepts.] +de,base,46,[Using multi threaded accepts.] +de,base,47,[Using partial single threaded accepts.] +de,base,48,[This machine has %d processors.] +de,base,49,[Error calling thr_seconcurrency(%d)- (%s)] +de,base,50,[Set conncurrency to %d.] +de,base,51,[WARNING! netscape executable and library have different versions.\n] +de,base,54,[seminit failed (%s)\n] +de,base,55,[This beta software has expired.\n] +de,base,56,[Cache monitor respawned] +de,base,57,[Cache batch update daemon respawned] +de,base,58,[can't find empty statistics slot] +de,base,59,[can't fork new process (%s)] +de,base,60,[assert failed! %s\n] +de,base,61,[mr_table_init()] +de,base,62,[malloc failed] +de,base,63,[malloc failed!] +de,base,64,[mr_add_io(%d, type %d, file %d)] +de,base,65,[mr_add_io - stage 1] +de,base,66,[mr_add_io - stage 2] +de,base,67,[mr_add_io found invalid IO type %d] +de,base,68,[mr_add_io - adding timeout] +de,base,69,[Out of memory!\n] +de,base,70,[done with mr_add_io] +de,base,71,[mr_del_io(%d, type %d, file %d)] +de,base,72,[mr_del_io found invalid IO type %d] +de,base,73,[mr_lookup_io(%d)] +de,base,74,[mr_async_io(%d, %d bytes, file %d)] +de,base,75,[malloc failure adding async IO] +de,base,76,[Error adding async io!] +de,base,77,[Cannot seek for read!] +de,base,78,[read failure! (%d, %s)] +de,base,79,[do_read read %d bytes for file %d] +de,base,80,[Cannot seek for write!] +de,base,81,[writev failure! (%d, %s)] +de,base,82,[write failure! (%d, %s)] +de,base,83,[do_write wrote %d bytes for file %d] +de,base,84,[do_timeout(mrp %d)] +de,base,85,[do_timeout: found IO (timer=%d, time=%d)] +de,base,86,[error deleting io] +de,base,87,[timeout callback failure for %d\n] +de,base,88,[mr_get_event(%d) - outstanding io %d] +de,base,89,[mr_get_event: Waiting for reads on FD:] +de,base,90,[mr_get_event: Waiting for writes on FD:] +de,base,91,[ %d] +de,base,92,[ %d] +de,base,93,[mr_get_event set no timeout] +de,base,94,[mr_get_event set timeout to: %d.%d sec] +de,base,95,[error in select (%d, %s)] +de,base,96,[mr_get_event() - select found %d] +de,base,97,[error looking up IO fd %d] +de,base,98,[read failed for fd %d] +de,base,99,[error deleting io] +de,base,100,[callback failure for %d\n] +de,base,101,[error looking up IO fd %d] +de,base,102,[writing: header len %d, writelen %d, total %d] +de,base,103,[write failed for fd %d] +de,base,104,[error deleting io] +de,base,105,[callback failure for %d\n] +de,base,106,[Error creating dns cache] +de,base,107,[dns_cache_init: hash_size <= 0, using %d] +de,base,108,[dns_cache_init: cache-size <= %d, using %d] +de,base,109,[dns_cache_init: cache-size is %d is too large, using %d.] +de,base,110,[dns_cache_init: expire_time <= 0, using %d] +de,base,111,[dns_cache_init: expire is %d is too large, using %d seconds.] +de,base,112,[Error creating dns cache] +de,base,113,[dns-cache-insert: Error allocating entry] +de,base,114,[dns-cache-insert: malloc failure] +de,base,115,[successful server startup] +de,base,116,[%s B%s] +de,base,117,[Netscape executable and shared library have different versions] +de,base,118,[ executable version is %s] +de,base,119,[ shared library version is %s] +de,base,120,[error reporting shutting down] +de,base,121,[warning] +de,base,122,[config] +de,base,123,[security] +de,base,124,[failure] +de,base,125,[catastrophe] +de,base,126,[info] +de,base,127,[verbose] +de,base,128,[event_handler:Failed to wait on events %s] +de,base,129,[could not wait on resume event event (%s)] +de,base,130,[dlopen of %s failed (%s)] +de,base,131,[dlopen of %s failed (%s)] +de,base,132,[The server is terminating due to an error. Check the event viewer for the error message. SERVER EXITING!] +de,base,133,[Terminating the server %s] +de,base,134,[kill_server:cannot open server event %s] +de,base,135,[kill_server:cannot set server event %s] +de,base,136,[error: could not get socket (%s)\n] +de,base,137,[error: could not set socket option (%s)\n] +de,base,138,[Terminating Service:error: could not bind to address %s port %d (%s)\n] +de,base,139,[Terminating Service:error: could not bind to port %d (%s)\n] +de,base,140,[SetHandleNonInheritable: could not duplicate socket (%s)] +de,base,141,[SetHandleNonInheritable: closing the original socket failed (%s)] +de,base,142,[Could not SetHandleInformation (%s)] +de,base,143,[Terminating Service:Failure: Could not open statistics file (%s)\n] +de,base,144,[Could not set Thread Local Storage Value for thread at slot %d] +de,base,145,[secure handshake failed (code %d)\n] +de,base,146,[accept failed %d (%s)] +de,base,147,[Failed to pulse Event %d %s] +de,base,148,[Failed to send MobGrowth Event to parent %s] +de,base,149,[Pulsing MobRespawn Event %d] +de,base,150,[respawn thread pool to %d (%d)] +de,base,151,[Could not open event to signal rotate application. Could not create the MoveLog event:%s] +de,base,152,[Failed to send MoveLog Event to rotate app %s] +de,base,153,[growing thread pool from %d to %d] +de,base,154,[Could not open the ServiceControlManager, Error %d] +de,base,155,[StartNetsiteService:Could not open the service %s: Error %d] +de,base,156,[StartNetsiteService:Could not start the service %s] +de,base,157,[Service Startup: Could not allocate security descriptor] +de,base,158,[Service Startup: Could not init security descriptor] +de,base,159,[Service Startup: Could not set the security Dacl] +de,base,160,[Terminating Service:WinSock init failed: %s] +de,base,161,[Httpd Server Startup failed: %s] +de,base,162,[can't find empty statistics slot] +de,base,163,[NT daemon: could not create new thread %d] +de,base,164,[Service Startup Failure. Terminating Service:Could not create event %d:%s] +de,base,165,[Service Startup Error. Could not create the MoveLog event:%s] +de,base,166,[Failed to wait on Event objects %s] +de,base,167,[Failed to wait on Event objects %s] +de,base,168,[pipebuf_buf2sd: pipebuf_grab IO_ERROR %d] +de,base,169,[pool-init: memory pools disabled] +de,base,170,[pool-init: free_size <= 0, using %d] +de,base,171,[pool-create-block: out of memory] +de,base,172,[pool-create: out of memory] +de,base,173,[pool-create: out of memory] +de,base,174,[pool-malloc: out of memory] +de,base,175,[FREE() used where PERM_FREE() should have been used- problem corrected and supressing further warnings.] +de,base,176,[regex error: %s (regex: '%s')] +de,base,177,[can't create IPC pipe (%s)] +de,base,178,[write to wakeup pipe failed (%s)] +de,base,179,[flushing %d connections; current %d; tot %d] +de,base,180,[accept failed (%s)] +de,base,181,[Error creating time cache] +de,base,182,[time-cache: cache disabled] +de,base,183,[time_cache_init: hash_size < %d, using default, %d] +de,base,184,[time_cache_init: hash_size > %d, using default, %d] +de,base,185,[time_cache_init: cache_size < %d, using default, %d] +de,base,186,[time_cache_init: cache_size > %d, using default, %d] +de,base,187,[Error allocating memory for time_cache] +de,base,188,[Error allocating memory for time_cache entry] +de,base,189,[Error allocating memory for time_cache entry] +de,base,190,[Error inserting new time_cache entry] +de,base,191,[Error allocating memory for time_cache] +de,base,192,[cs-terminate failure (%s)] +de,base,193,[cs-init failure (%s)] +de,base,194,[cs-wait failure (%s)] +de,base,195,[cs-post failure (%s)] +de,base,196,[Unable to create nonblocking socket (%s)] +de,base,197,[error: could not set keepalive (%s)\n] +de,base,198,[error: could not set recv timeout (%s)\n] +de,base,199,[error: could not set send timeout (%s)\n] +de,base,200,[Unable to create nonblocking socket (%s)] +de,base,201,[sem_grab failed (%s)] +de,base,202,[sem_release failed (%s)] +de,base,203,[sem_release failed (%s)] +de,base,204,[Could not remove temporary directory %s, Error %d] +de,base,205,[Could not remove temporary directory %s, Error %d] +de,dsgw,-1,[$DBT: dsgw in DB file v1 $] +de,dsgw,1,[Unbekannte HTTP-Anforderungsmethode (Unknown HTTP request method)] +de,dsgw,2,[Ungültige oder unvollständige HTML-Formulardaten (Invalid or incomplete HTML form data)] +de,dsgw,3,[Nicht genügend Speicherplatz (Out of memory)] +de,dsgw,4,[Erforderliche Anfrage-/Formulareingabe fehlt (Required query/form input is missing)] +de,dsgw,5,[Ungültiges Zeichen im Dateipfad (Illegal character in file path)] +de,dsgw,6,[Falsche oder fehlende Konfigurationsdatei (Bad or missing configuration file)] +de,dsgw,7,[LDAP kann nicht initialisiert werden (Unable to initialize LDAP)] +de,dsgw,8,[Fehler beim Aufrufen des LDAP-Server (An error occurred while contacting the LDAP server)] +de,dsgw,9,[Unbekannter Suchobjekttyp (Unknown search object type)] +de,dsgw,10,[Unbekanntes Attributetikett (Unknown attribute label)] +de,dsgw,11,[Unbekannte Match-Aufforderung (Unknown match prompt)] +de,dsgw,12,[Keine Suchfilter für Objekttyp (No search filters for object type)] +de,dsgw,13,[HTML-Vorlagedatei kann nicht gefunden werden (Unable to open HTML template file)] +de,dsgw,14,[Unbekannter Suchmodus - benutzen Sie "smart", "complex", "pattern" oder "auth" (Unknown search mode - use "smart", "complex", "pattern", or "auth")] +de,dsgw,15,[Unverwechselbarer Name fehlt in der URL (Distinguished Name missing in URL)] +de,dsgw,16,[Unbekannter Bereich in der URL (sollte "base", "sub" oder "one" sein) (Unknown scope in URL (should be base, sub, or one))] +de,dsgw,17,[Unbekannte URL oder unbekannter Fehler (Unrecognized URL or unknown error)] +de,dsgw,18,[Ungültiges URL-Format (Bad URL format)] +de,dsgw,19,[Interner Fehler (Internal error)] +de,dsgw,20,[Vorlageindexdatei kann nicht geschrieben werden (Unable to write template index file)] +de,dsgw,21,[Vorlageindexdatei kann nicht geöffnet werden (Unable to open template index file)] +de,dsgw,22,[Verzeichnis kann nicht gelesen werden (Unable to read directory)] +de,dsgw,23,[Fehler bei der Initialisierung von LDAP SSL (Sicherheitspfad überprüfen) (LDAP SSL initialization failed (check the security path)] +de,dsgw,24,[Damit die Benutzer- und Gruppenformulare mit dem Verwalter-Server via SSL ausgeführt werden können, müssen Sie oder der Systemverwalter über das Formular Server-Eigenschaften|Verschlüsselung EIN/AUS SSL für diesen Verwaltungsserver aktivieren aktivieren.\n(For the Users and Groups forms to work over SSL, you or your server administrator needs to activate SSL for this Administration Server. The Encryption|On/Off page can be used to do so.)] +de,dsgw,25,[Beglaubigungsberechtigung wurde nicht in der Beglaubigungsdatenbank gefunden (Authentication credentials not found in authentication database)] +de,dsgw,26,[Fehler beim Abrufen der Daten von der Beglaubigungsdatenbank (Error retrieving data from the authentication database)] +de,dsgw,27,[Ihre Beglaubigungsberechtigung ist abgelaufen (Your authentication credentials have expired)] +de,dsgw,28,[Zufalls-Zeichenfolge kann nicht erstellt werden\n(Unable to create a random string)] +de,dsgw,29,[Beim Abrufen des Berechtigungsnachweises wurde kein unverwechselbarer Name angegeben (No distinguished name was provided when retrieving credentials)] +de,dsgw,30,[Beglaubigungsdatenbank kann nicht geöffnet werden (Cannot open authentication database)] +de,dsgw,31,[Daten konnten nicht an die Beglaubigungsdatenbank angehängt werden (Could not append data to the authentication database)] +de,dsgw,32,[Es wurde kein Verzeichnisverwalter definiert (No Directory Manager is defined)] +de,dsgw,33,[Es wurde keine Suchzeichenfolge angegeben. Bitte noch einmal versuchen (No search string was provided. Please try again)] +de,dsgw,34,[Zu viele Argumente auf einer Zeile in der Konfigurationsdatei (Too many arguments on one line in the config. file)] +de,dsgw,35,[Windows Sockets konnte nicht initialisiert werden (Failed to initialize Windows Sockets)] +de,dsgw,36,[Beglaubigungsberechtigung konnte nicht vom Verwaltungs-Server abgerufen werden (Authentication credentials could not be obtained from the Administration Server)] +de,dsgw,37,[Unverwechselbarer Name fehlt in der ldapdb:// URL (Distinguished Name missing in ldapdb:// URL)] +de,dsgw,38,[Unbekannte URL oder unbekannter Fehler (Unrecognized URL or unknown error)] +de,dsgw,39,[Ungültiges URL-Format (Bad URL format)] +de,dsgw,40,[Fehler beim Initialisieren der lokalen LDAP-Datenbank\n(An error occurred while initializing the local LDAP database)] +de,dsgw,41,[Unbekannter Verzeichnis-Servicetyp - benutzen Sie "local" oder "remote" (Unknown directory service type - use "local" or "remote")] +de,dsgw,42,[Fehler beim Lesen der db-Konfigurationdatei (An error occurred while reading the db configuration file)] +de,dsgw,43,[NSHOME/userdb-Pfad war NULL (NSHOME/userdb path was NULL)] +de,dsgw,44,[Die Servicekonfiguration des Verzeichnisses konnte nicht aktualisiert werden. (The directory service configuration could not be updated.)] +de,dsgw,45,[Der Eintrag konnte nicht im Verzeichnis gelesen werden. (The entry could not be read from the directory.)] +de,dsgw,46,[Die LDAP-Databank konnte nicht gelöscht werden. (The LDAP database could not be erased.)] +de,dsgw,47,[Sie dürfen keine Einträge außer Ihren eigenen ändern. (You may not change entries besides your own.)] +de,dsgw,48,[Problem] +de,dsgw,49,[Beglaubigungsproblem (Authentication Problem)] +de,dsgw,50,[.\n

        Sie müssen neu beglaubigen, ehe Sie fortfahren. (You must re-authenticate before continuing.)\n] +de,dsgw,51,[.\n

        Sie müssen neu beglaubigen, ehe Sie fortfahren. (You must re-authenticate before continuing.)\n] +de,dsgw,52,[unbekannter Fehler (unknown error)] +de,dsgw,53,[Der Vorgang war erfolgreich. (The operation was successful.)] +de,dsgw,54,[Im Server ist ein interner Fehler aufgetreten. Das deutet gewöhnlich auf einen ernsthaften Fehler im Server hin und sollte Ihrem Serververwalter mitgeteilt werden. (An internal error occurred in the server. This usually indicates a serious malfunction in the server and should be brought to the attention of your server administrator.)] +de,dsgw,55,[Der Server konnte die durch das Gateway an ihn gesandte Anforderung nicht verstehen. (The server could not understand the request which was sent to it by the gateway.)] +de,dsgw,56,[Das Zeitlimit wurde bei der Ausführung Ihrer Anforderung überschritten. Die Suche nach Einträgen erzielt bessere Ergebnisse, wenn Sie Ihre Suche präziser definieren. (A time limit was exceeded in responding to your request. If you are searching for entries, you may achieve better results if you are more specific in your search.)] +de,dsgw,57,[Das Größenlimit wurde bei der Ausführung Ihrer Anforderung überschritten. Ihre Suche nach Einträgen erzielt bessere Ergebnisse, wenn Sie Ihre Suche präziser definieren, da zu viele Einträge zu Ihren Suchkriterien paßten. (A size limit was exceeded in responding to your request. If you are searching for entries, you may achieve better results if you are more specific in your search, because too many entries matched your search criteria.)] +de,dsgw,58,[Das Gateway versuchte, mit einer Methode auf dem Server\nzu beglaubigen, die der Server nicht versteht.\n(The gateway attempted to authenticate to the server using\na method the server doesn't understand.)] +de,dsgw,59,[Das Gateway versuchte mit einer Beglaubigungsmethode auf dem Server zu beglaubigen, die der Server nicht unterstützt. (The gateway attempted to authenticate to the server using an authentication method which the server does not support. )] +de,dsgw,60,[Ihre Anforderung konnte nicht ausgeführt werden, weil der aufgerufene Server wahrscheinlich nicht die von Ihnen gewünschten Daten enthält. Möglicherweise wurde die Anforderung auf einen anderen Server umgeleitet und wieder zurückgesandt, konnte jedoch nicht zurückverfolgt werden. Sollten Sie versucht haben, Änderungen im Verzeichnis vorzunehmen, dann ist der Server mit der Stammkopie möglicherweise nicht verfügbar. (Your request could not be fulfilled, probably because the server that was contacted does not contain the data you are looking for. It is possible that a referral to another server was returned but could not be followed. If you were trying to make changes to the directory, it may be that the server that holds the master copy of the data is not available.)] +de,dsgw,61,[Ihre Anforderung hat ein Verwalterlimit auf dem Server überschritten. (Your request exceeded an administrative limit in the server.)] +de,dsgw,62,[Eine vom Gateway angeforderte kritische Erweiterung ist auf diesem Server nicht verfügbar. (A critical extension that the gateway requested is not available in this server.)] +de,dsgw,63,[Der Server konnte die Anforderung nicht ausführen, da sie\nsich auf ein Attribut bezieht, das nicht im\nEintrag existiert.\n(The server was unable to process the request, because the\nrequest referred to an attribute which does not exist in the\nentry.)] +de,dsgw,64,[Der Server konnte Ihre Anforderung nicht ausführen, da\nsie gegen eine Beschränkung verstößt.\n(The server was unable to fulfill your request, because the\nrequest violates a constraint.)] +de,dsgw,65,[Der Server konnte dem Eintrag keinen Wert hinzufügen, da dieser Wert bereits im Eintrag enthalten ist. (The server could not add a value to the entry, because that value is already contained in the entry.)] +de,dsgw,66,[Der Server konnte diesen Eintrag nicht finden. Wird ein neuer\nWert hinzugefügt, vergewissern Sie sich, daß das übergeordnete Verzeichnis,\nfür den Eintrag, den Sie hinzufügen möchten, existiert. Erscheint diese\nFehlermeldung bei einem Suchvorgang, bedeutet das,\ndaß der von Ihnen gesuchte Eintrag nicht existiert. Wenn Sie versucht\nhaben, als Verzeichnisverwalter zu beglaubigen und diese Fehlermeldung erscheint,\ndann überprüfen Sie die Gateway-Konfigurationsdatei.\n(The server could not locate the entry. If adding a new entry,\nbe sure that the parent of the entry you are trying to add exists.\nIf you received this error while searching, it indicates that the\nentry which was being searched for does not exist.\nIf you were attempting to authenticate as the directory manager and\nreceived this error, check the gateway configuration file.)] +de,dsgw,67,[Ein unverwechselbarer Name hatte nicht das richtige Format. (A distinguished name was not in the proper format. )] +de,dsgw,68,[Dem Eintrag, den Sie beglaubigen wollten, fehlt entweder der Kennwortsatz oder andere erforderliche Beglaubigungsberechtigungen. Mit dieser Eingabe können Sie erst beglaubigen, wenn der Verzeichnisverwalter die passenden Attribute hinzugefügt hat. (The entry you attempted to authenticate as does not have a password set, or is missing other required authentication credentials. You cannot authenticate as that entry until the appropriate attributes have been added by the directory manager.)] +de,dsgw,69,[Das eingegebene Kennwort (oder andere Beglaubigungsberechtigungen)\nist falsch.\n(The password (or other authentication credentials) you supplied\nis incorrect.)] +de,dsgw,70,[Sie sind nicht ausreichend berechtigt, um den Vorgang auszuführen. (You do not have sufficient privileges to perform the operation. )] +de,dsgw,71,[Der Server ist belegt und kann Ihre Anforderung nicht ausführen. Versuchen Sie es in ein paar Miuten noch einmal. (The server is too busy to service your request. Try again in a few minutes.)] +de,dsgw,72,[Der LDAP-Server konnte nicht aufgerufen werden. (The LDAP server could not be contacted.)] +de,dsgw,73,[Der Server lehnt die Ausführung Ihrer Anforderung ab. Das bedeutet gewöhnlich, daß die Ausführung Ihrer Anforderung den Server zu sehr belastet. Es könnte möglicherweise auch bedeuten, daß der Server nicht konfiguriert ist, Ihre Anforderung auszuführen. Versuchen Sie, bei der Suche den Suchbereich einzuschränken. (The server was unwilling to process your request. Usually, this indicates that serving your request would put a heavy load on the server. It may also indicate that the server is not configured to process your request. If searching, you may wish to limit the scope of your search.)] +de,dsgw,74,[Der Verzeichnis-Server konnte Ihrer Anforderung nicht nachkommen, da sie gegen die Schemabedingungen verstößt. Das bedeutet gewöhnlich, daß Sie keinen Wert für ein erforderliches Feld eingegeben haben. Es könnte auch bedeuten, daß das Schema im Verzeichnis-Server aktualisiert werden muß. (The directory server could not honor your request because it violates the schema requirements. Typically, this means that you have not provided a value for a required field. It could also mean that the schema in the directory server needs to be updated.)] +de,dsgw,75,[Der Verzeichnis-Server läßt nicht zu, daß Sie einen Eintrag, der untergeordnet ist, löschen oder umbenennen. Um das zu tun, müssen Sie erst alle untergeordneten Einträge löschen. (The directory server will not allow you to delete or rename an entry if that entry has children. If you wish to do this, you must first delete all the child entries.)] +de,dsgw,76,[Der Server konnte weder einen neuen Eintrag hinzufügen noch einen bestehenden umbenennen, da ein Eintrag unter diesem Namen bereits existiert. (The server was unable to add a new entry, or rename an existing entry, because an entry by that name already exists.)] +de,dsgw,77,[Ihre Anforderung würde mehrere Verzeichnis-Server betreffen. (Your request would affect several directory servers.)] +de,dsgw,78,[Der Verzeichnis-Server konnte nicht aufgerufen werden. Wenden\nSie sich an den Serververwalter.\n(The directory server could not be contacted. Contact your\n server administrator for assistance.)] +de,dsgw,79,[Fehler beim Senden der Daten zum Server. (An error occured while sending data to the server.)] +de,dsgw,80,[Fehler beim Lesen der Daten vom Server. (An error occured while reading data from the server.)] +de,dsgw,81,[Der Server hat nicht auf Ihre Anforderung reagiert. Die Anforderung wurde unterbrochen. (The server did not respond to the request. The request timed out.)] +de,dsgw,82,[Der Server unterstützt nicht die vom Gateway benutzte Beglaubigungsmethode. (The server does not support the authentication method used by the gateway.)] +de,dsgw,83,[Der vom Gateway erstellte Suchfilter war falsch. (The search filter constructed by the gateway was in error.)] +de,dsgw,84,[Der Vorgang wurde auf Ihren Wunsch abgebrochen. (The operation was cancelled at your request.)] +de,dsgw,85,[Interner Fehler in der Bibliothek - ein Parameter war falsch. (An internal error occurred in the library - a parameter was incorrect.)] +de,dsgw,86,[Verbindung zum Verzeichnis-Server konnte nicht hergestellt werden. Wenden\nSie sich an Ihren Server-Verwalter.\n(A connection to the directory server could not be opened. Contact your\nserver administrator for assistance.)] +de,dsgw,87,[Unbekannter Fehler aufgetreten. (An unknown error was encountered.)] +de,dsgw,88,[Eintrag existiert bereits (Entry Already Exists)] +de,dsgw,89,[Dieser Namenseintrag (An entry named )] +de,dsgw,90,[onMouseOver="window.status='Klicken Sie hier, um den Eintrag einzusehen'; return true"\n(onMouseOver="window.status='Click here to view this entry'; return true")] +de,dsgw,91,[ existiert bereits (already exists).

        Bitte anderen Namen und/oder Adresse wählen.\n(Please choose another name and/or location.\n

        )\n] +de,dsgw,92,[Übergeordneter Eintrag existiert nicht\n(Parent entry does not exist)] +de,dsgw,93,[Sie können einen Eintrag unter diesem Namen:\n(You cannot add an entry by the name:)

        %s,

        nicht hinzufügen,\nda der übergeordnete Eintrags nicht existiert.\n(because the parent of that entry does not exist.)

        \nEhe Sie diesen Eintrag hinzufügen, müssen Sie zunächst den dazugehörige\n(Before you can add this entry, you must first add)\n] +de,dsgw,94,[übergeordneten Eintrag hinzufügen. (its parent.)\n] +de,dsgw,95,[ein Eintrag unter diesem Namen (an entry named):

        %s.\n] +de,dsgw,96,[Warnung: Keine Beglaubigung (wird fortgesetzt)...\n(Warning: no authentication (continuing)...)\n] +de,dsgw,97,[%s Verzeichniseintrag (Directory Entry)] +de,dsgw,98,[

        Eingabe-DN (Entry DN): %s

        \n] +de,dsgw,99,[Änderungen zu %s wurden gespeichert.] +de,dsgw,100,[%s has been added.] +de,dsgw,101,[%s has been deleted.] +de,dsgw,102,[Renamed %s to %s.] +de,dsgw,103,[

        Hinweis: Da Sie den Eintrag, unter dem Sie beglaubigt\nsind, %s haben, mußte Ihre Beglaubigungsberechtigung\ngelöscht werden. Sie müssen neu beglaubig werden, um\nweitere Änderungen vornehmen zu können.\n(Note: because of your action on the entry you were \nauthenticated as, it was necessary to discard your \nauthentication credentials. You will need to authenticate \nagain to make additional changes.)\n] +de,dsgw,104,[gelöscht (deleted)] +de,dsgw,105,[umbenannt (renamed)] +de,dsgw,106,[Kennwort umbenannt für (changed the password of)] +de,dsgw,107,[Attribut (Attribute) %s wurde geändert (was changed)
        \n] +de,dsgw,108,[ NICHT (NOT) ASCII (%ld Bytes)\n] +de,dsgw,109,[Es wurden keine Werte eingegeben. Bitte erneut versuchen.\n(No values were entered. Please try again.)\n] +de,dsgw,110,[Es wurden keine Änderungen vorgenommen.\n] +de,dsgw,111,[

        %s wird an Verzeichnis-Server gesendet...\n] +de,dsgw,112,[Information] +de,dsgw,113,[Änderungen (changes)] +de,dsgw,114,[

        Eintrag erfolgreich hinzugefügt.\n(Successfully added entry.)\n] +de,dsgw,115,[

        Eintrag erfolgreich bearbeitet. Änderungen wurden gespeichert.\n(Successfully edited entry. Your changes have been saved.)\n] +de,dsgw,116,[

        Eintrag erfolgreich gelöscht.\n(Successfully deleted entry.)\n] +de,dsgw,117,[

        Der neue Eintrag heißt (The new name for the entry is): %s\n

        \n] +de,dsgw,118,[

        Eintrag erfolgreich umbenannt.\n(Successfully renamed entry.)\n] +de,dsgw,119,[Sie müssen das alte Kennwort angeben.] +de,dsgw,120,[Sie müssen ein neues Kennwort angeben. Bitte erneut versuchen] +de,dsgw,121,[Neues und bestätigendes Kennwort stimmen nicht überein. Bitte erneut versuchen] +de,dsgw,122,[
        %s %s ist bereits in Benutzung. Bitte ein anderes wählen.\n(The item shown is already in use. Please choose a different one.)
        \n] +de,dsgw,123,[fehlendes Formulardatenelement (missing form data element) "%.100s"] +de,dsgw,124,[Konfigurationsinformation wird initialisiert\n(Initializing config info)] +de,dsgw,125,[Datei kann nicht geöffnet werden.\n(Cannot open file.)] +de,dsgw,126,[ Konfigurationsdate der Datenbanki ist verstümmelt.\n(Malformed dbconf file.)] +de,dsgw,127,[Eigenschaftsname in der Konfigurationsdatei der Datenbank fehlt.\n(Missing property name in dbconf file.)] +de,dsgw,128,[Nicht genügend Arbeitspeicher. (Out of memory.)] +de,dsgw,129,[Betriebsanweisung in der Konfigurationsdatei der Datenbank fehlt.\n(Missing directive in dbconf file.)] +de,dsgw,130,[Konfigurationsdatei "%s" kann nicht geöffnet werden\n(Cannot open config file with name shown)\n] +de,dsgw,131,[Argument für die Betriebsanweisung "authlifetime" fehlt\n(Missing argument for "authlifetime" directive)\n] +de,dsgw,132,[Argument für Betriebsanweisung "dirmgr" fehlt\n(Missing argument for "dirmgr" directive)\n] +de,dsgw,133,[Argument für Betriebsanweisung "baseurl" fehlt\n(Missing argument for "baseurl" directive)\n] +de,dsgw,134,[Falsche URL für Betriebsanweisung "baseurl" angegeben - Basis-DN fehlt\n(Bad URL provided for "baseurl" directive - the base DN is missing)\n] +de,dsgw,135,[Betriebsanweisung "baseurl" wird analysiert\n(parsing baseurl directive)] +de,dsgw,136,[Falsche URL für Betriebsanweisung "baseurl" angegeben - keine "ldap://" URL\n(Bad URL provided for "baseurl" directive - not an "ldap://" URL)\n] +de,dsgw,137,["ldaps://" URLs werden noch nicht unterstützt\n("ldaps://" URLs are not yet supported)\n] +de,dsgw,138,[Argumente für Betriebsanweisung "template" fehlen\n(Missing arguments for "template" directive)\n] +de,dsgw,139,[Argument für Betriebsanweisung "sslrequired" fehlt\n(Missing argument for "sslrequired" directive)\n] +de,dsgw,140,[Unbekanntes Argument für Betriebsanweisung "sslrequired" (muß "never", "whenauthenticated"oder "always" sein)\n(Unknown argument to "sslrequired" directive (should be "never", "whenauthenticated", "always"))\n] +de,dsgw,141,[Argument für Betriebsanweisung "securitypath" fehlt\n(Missing argument for "securitypath" directive)\n] +de,dsgw,142,[Argument für Betriebsanweisung "location-suffix" fehlt\n(Missing argument for "location-suffix" directive)\n] +de,dsgw,143,[Die Betriebsanweisung "location" erfordert drei Argumente\n(Three arguments are required for the "location" directive)\n] +de,dsgw,144,[Die Betriebsanweisung "newtype" erfordert mindestens zwei Argumente\n(At least two arguments are required for the "newtype" directive)\n] +de,dsgw,145,[Unbekannte Adresse in der Betriebsanweisung "newtype"\n(Unknown location in "newtype" directive)\n] +de,dsgw,146,[Die Betriebsanweisung "tmplset" erfordert drei oder vier Argumente\n(Three or four arguments are required for the "tmplset" directive)\n] +de,dsgw,147,[Die Betriebsanweisung "attrvset" erfordert vier Argumente\n(Four arguments are required for the "attrvset" directive)\n] +de,dsgw,148,[Argument für Betriebsanweisung "charset" fehlt\n(Missing argument for "charset" directive)\n] +de,dsgw,149,[Argument für Betriebsanweisung "ClientLanguage" fehlt\n(Missing argument for "ClientLanguage" directive)\n] +de,dsgw,150,[Argument für Betriebsanweisung "AdminLanguage" fehlt\n(Missing argument for "AdminLanguage" directive)\n] +de,dsgw,151,[Argument für Betriebsanweisung "DefaultLanguage" fehlt\n(Missing argument for "DefaultLanguage" directive)\n] +de,dsgw,152,[Dateiname für Betriebsanweisung "include" fehlt\n(Missing filename for "include" directive)\n] +de,dsgw,153,[Unbekannte Betriebsanweisung in der Konfigurationsdatei\n(Unknown directive in config file)\n] +de,dsgw,154,[<= erase_db konnte lcache.conf-Datei "%s" nicht öffnen\n(<= erase_db could not open lcache.conf file with name shown)\n] +de,dsgw,155,[\n

        Die Datenbank wurde gelöscht. Neue Datenbank wird erstellt...\n(The database has been deleted. Creating new database...)\n\n ] +de,dsgw,156,[\n

        Die Datenbank konnte nicht gelöscht werden\n(The database could not be deleted)\n\n ] +de,dsgw,157,[<= app_suffix konnte ldif-Datei "%s" nicht öffnen\n(<= app_suffix could not open ldif file with name shown)\n] +de,dsgw,158,[<= app_suffix konnte tmp-Datei "%s" nicht öffnen\n(<= app_suffix could not open tmp file with name shown)\n] +de,dsgw,159,[%s konnte nicht in %s umbenannt werden\n(Unable to rename with names as shown)] +de,dsgw,160,[Leerzeiger wurde von dbconf_read_default_dbinfo() zurückgegeben.\n(null pointer returned by dbconf_read_default_dbinfo().)] +de,dsgw,161,[Falsche "ldapdb"-URL - Basis-DN fehlt\n(Bad "ldapdb" URL - the base DN is missing)\n] +de,dsgw,162,[Falsche "ldapdb"-URL (Bad "ldapdb" URL)\n] +de,dsgw,163,[Falsche URL für Betriebsanweisung "baseurl" angegeben - Basis-DN fehlt \n(Bad URL provided for "baseurl" directive - the base DN is missing)\n] +de,dsgw,164,[Betriebsanweisung "baseurl" wird analysiert\n(parsing baseurl directive)] +de,dsgw,165,[Falsche URL für Betriebsanweisung "baseurl" angegeben - keine "ldap:// bzw. ldapdb://" URL\n(Bad URL provided for "baseurl" directive - not an "ldap:// or ldapdb://" URL)\n] +de,dsgw,166,["ldaps://" URLs werden noch nicht unterstützt\n("ldaps://" URLs are not yet supported)\n] +de,dsgw,167,[Kein Wert für binddn angegeben\n(No value given for binddn)] +de,dsgw,168,[Kein Wert für bindpw angegeben\n(No value given for bindpw)] +de,dsgw,169,[In der dbswitch.conf-Datei ist kein Standard-Verzeichnisservice angegeben\n(There is no default directory service defined in the dbswitch.conf file)] +de,dsgw,170,[Konfigurationsdatei "%s" kann nicht zum Schreiben geöffnet werden\n(Cannot open config file with name shown for writing)\n] +de,dsgw,171,[Kann %s nicht in %s umbenennen\n(Unable to rename with names as shown)] +de,dsgw,172,[Konfigurationsdatei (config file) %s: ] +de,dsgw,173,[Konfigurationsdatei (config file) %s: Zeile (line) %d: ] +de,dsgw,174,[Max. (max) %d] +de,dsgw,175,[ OK ] +de,dsgw,176,[Fenster schließen (Close Window)] +de,dsgw,177,[Zurück] +de,dsgw,178,[{crypt}GESPERRT (LOCKED) [%s GMT]] +de,dsgw,179,[Zurück zum Hauptbildschirm (Return to Main)] +de,dsgw,181,[ Help ] +de,dsgw,182,[Hilfe (Help)] +de,dsgw,184,[Hilfe ist noch nicht verfügbar.\n(Help is not yet available.)] +de,dsgw,186,[Fenster schließen (Close Window)] +de,dsgw,187,[Fenster schließen (Close Window)] +de,dsgw,188,[?template fehlt (missing ?template)] +de,dsgw,189,[Beglaubigen...(Authenticate...)] +de,dsgw,190,[Beglaubigungsberechtigung löschen (abmelden)?\n(Discard authentication credentials (log out)?)] +de,dsgw,191,[Geben Sie eine Suchenzeichenfolge an\n(Please type a search string)] +de,dsgw,192,[Um Ihren Zugriff zu dem Verzeichnis zu beglaubigen, müssen Sie sich zunächst zu\nerkennen geben.
        Geben Sie Ihren Namen ein:\n(The first step in authenticating to the directory is identifying\nyourself.
        Please type your name:)] +de,dsgw,193,[Weiter (Continue)] +de,dsgw,194,[Weiter (Continue)] +de,dsgw,195,[Abbrechen (Cancel)] +de,dsgw,196,[Als Verzeichnisverwalter beglaubigen">  (nur für Verzeichnis-Administratoren verfügbar)\n(Authenticate as directory manager">  (only available to Directory Administrators))\n] +de,dsgw,197,[Beglaubigen...(Authenticate...)] +de,dsgw,198,[Beglaubigungsberechtigung löschen? (Discard authentication credentials?)] +de,dsgw,200,[Weiter (Continue)] +de,dsgw,201,[Weiter (Continue)] +de,dsgw,202,[Abbrechen (Cancel)] +de,dsgw,203,[Zugriff zu dem Verzeichnis beglaubigen (anmelden)\n(Authenticate (log in) to the directory)] +de,dsgw,204,[Ihr Zugriff zu dem Verzeichnis wird gleich beglaubigt werden unter \n(You are about to authenticate to the directory as) %s. Geben Sie zum Vervollständigen des Beglaubigungsvorgangs Ihr Kennwort ein. (To complete the authentication process, type your password.\n] +de,dsgw,206,[Ehe Sie Einträge bearbeiten bzw. hinzufügen können, muß\nIhr Zugriff zu dem Verzeichnis beglaubigt (angemeldet) sein\n. Folgen Sie den Anweisungen für den Beglaubigungsprozeß\nauf diesem Fenster.\n(Before you can edit or add entries, you must authenticate\n(log in) to the directory. This window will guide\nyou through the steps of the authentication\nprocess.)\n] +de,dsgw,207,[Ihr Zugriff zu dem Verzeichnis kann von diesem Bildschirm aus\nbeglaubigt bzw. angemeldet werden.\nSie müssen beglaubigt sein, ehe Sie Verzeichniseinträge\nändern können. Wenn Sie einen Eintrag, ohne beglaubigt zu sein, ändern möchten, dann werden Sie aufgefordert, sich anzumelden.\n(From this screen you may authenticate, or log in, \nto the directory. You will need to authenticate\nbefore you can modify directory entries. If you\nattempt to modify an entry without authenticating,\nyou will be asked to log in.)\n] +de,dsgw,208,[Beglaubigungsstatus(Authentication Status)] +de,dsgw,209,[\nIhr Zugriff zu dem Verzeichnis ist derzeitig beglaubigt unter \n(\nYou are currently authenticated to the directory as )] +de,dsgw,210,[.\nWenn Sie Ihre Beglaubigungsberechtigung löschen und sich vom Verzeichnis abmelden möchten, klicken Sie unten auf die Schaltfläche.\n(.\nIf you wish to discard your authentication credentials and log out of the directory, click on the button below.)] +de,dsgw,211,[Beglaubigungsberechtigung löschen (abmelden)\n(Discard Authentication Credentials (log out))] +de,dsgw,212,[Ihre Beglaubigungsberechtigung für \n(Your authentication credentials for )] +de,dsgw,213,[ist abgelaufen (have expired).\n


        )\n] +de,dsgw,214,[Ihr Zugriff zu dem Verzeichnis ist derzeitig nicht beglaubigt.\n(Currently, you are not authenticated to the directory.
        )\n] +de,dsgw,215,["%s=" fehlt (missing)] +de,dsgw,216,["%s=%s" unbekannt (unknown)] +de,dsgw,217,[unbekannte Option (unknown option) %s ] +de,dsgw,218,[unbekannte Syntax=%s (syntax shown unknown)\n] +de,dsgw,219,[** HTML-Typ "%s" nicht unterstützt **
        \n(** HTML type shown is not supported **
        )\n] +de,dsgw,224,[Bearbeiten (Edit)] +de,dsgw,225,[Save Changes] +de,dsgw,226,[modify] +de,dsgw,227,[add] +de,dsgw,228,[Löschen (Delete)] +de,dsgw,229,[Diesen Eintrag löschen? (Delete this entry?)] +de,dsgw,230,[Umbenennen (Rename)] +de,dsgw,231,[Neuen Namen für diesen Eintrag eingeben:\n(Enter a new name for this entry:)] +de,dsgw,232,[Bearbeiten unter (Edit As)] +de,dsgw,233,[%s= fehlt (missing)] +de,dsgw,234,[Fenster schließen (Close Window)] +de,dsgw,235,[Bearbeiten... (Edit...)] +de,dsgw,236,["%s=" fehlt (missing)\n] +de,dsgw,237,[Unbekannter Satz "%s" (set shown is unknown)\n] +de,dsgw,238,[unbekannte Syntax "%s" (unknown syntax "%s")\n] +de,dsgw,239,[Neu beglaubigen (Re-Authenticate)] +de,dsgw,240,[Fenster schließen (Close Window)] +de,dsgw,241,[Möchten Sie wirklich (Do you really want to )] +de,dsgw,242,[?] +de,dsgw,243,[ OK ] +de,dsgw,244,[ OK ] +de,dsgw,245,[Zurücksetzen (Reset)] +de,dsgw,246,[Beendet (Done)] +de,dsgw,247,[Abbrechen (Cancel)] +de,dsgw,248,[anderes IF gefunden (geschachtelte IFs sind nicht unterstützt)\n(found another IF (nested IFs are not supported))] +de,dsgw,249,[ELSE wurde gefunden, aber kein IF\n(found ELSE but didn't see an IF)] +de,dsgw,250,[ELSE nach ELSE gefunden (ENDIF erwartet)\n(found ELSE after ELSE (expecting ENDIF))] +de,dsgw,251,[ELSE wurde gefunden, aber kein IF\n(found ELIF but didn't see an IF)] +de,dsgw,252,[ELIF nach ELSE gefunden (ENDIF erwartet)\n(found ELIF after ELSE (expecting ENDIF))] +de,dsgw,253,[ELDIF wurde gefunden, aber kein IF\n(found ENDIF but didn't see an IF)] +de,dsgw,254,[
        Vorlagefehler (template error): %s
        \n] +de,dsgw,255,[ldap_init/lcache_init aufgerufen, ehe Konfigurationsdatei gelesen wurde\n(ldap_init/lcache_init attempted before config file read)] +de,dsgw,256,[führt nicht unter dem Verwaltungs-Server aus\n(not running under the administration server)] +de,dsgw,257,[Konnte Genehmigungen nicht initialisieren\n(Could not initialize permissions)] +de,dsgw,258,[Konnte Benutzername nicht auf einem DN abbilden (Fehler vom Verwaltungs-Server)\n(Could not map username to a DN (error from admin server))] +de,dsgw,259,[Konnte aktuellen Benutzernamen nicht aufrufen\n(Could not get current username)] +de,dsgw,260,[Konnte aktuelles Benutzerkennwort nicht abrufen\n(Could not get current user password)] +de,dsgw,261,[Fehler (Error): %s] +de,dsgw,262,[Hinweis: Für diese Art von Eintrag gibt es keine Anzeigevorlage; die Eintragsart \nwird unten\nim Standarmodus angezeigt.\n(Note: there is no display template for this type of entry available, so it is\ndisplayed below using a default method.)] +de,dsgw,263,[Ungültige Benutzer-ID bzw. NULL LDAP-Erkennung\n(Invalid user id or NULL LDAP handle)] +de,dsgw,264,[keine Übereinstimmung mit Benutzer-ID\n(no match for user id)] +de,dsgw,265,[mehr als eine Übereinstimmung mit Benutzer-ID\n(more than one match for user id)] +de,dsgw,266,[the entire directory] +de,dsgw,267,[Die Betriebsanweisung "includeset" erfordert zwei Argumente\n(Two arguments are required for the "includeset" directive)\n] +de,dsgw,268,[Der angeforderte Attributwert wurde im Eintrag nicht gefunden (The attribute value requested was not found in the entry)] +de,dsgw,269,[Argument fehlt in der "NLS"-Betriebsanweisung\n] +de,dsgw,270,[Es muß ein NT-Benutzername angegeben werden] +de,dsgw,271,[Die Kombination aus NT-Benutzernamen und NT-Domäne ist in diesem Verzeichnis nicht eindeutig\n] +de,dsgw,272,[Es muß sowohl ein NT-Benutzername als auch eine NT-Domäne angegeben werden\n] +de,dsgw,273,[Der NT-Benutzername darf nicht länger sein als 20 Zeichen.] +de,dsgw,274,[Namen für den neuen Eintrag angeben.] +de,dsgw,275,[Standort für den neuen Eintrag auswählen.] +de,dsgw,276,[Neuer Eintrag] +de,dsgw,277,[Für diese Funktion muß ein Verzeichnisverwalter in der Datei "dsgw.conf" definiert sein] +de,dsgw,278,[Die Betriebsanweisung "vcard-property" erfordert drei oder vier Argumente.\n] +de,dsgw,279,[DieVCard-Eigenschaft kann nur entweder "cis" oder "mls" lauten.\n] +de,dsgw,280,[Kein Eintrag gefunden.\n%2$s] +de,dsgw,281,[Kein Eintrag gefunden, in dem %2$s '%4$s' %3$s.\n] +de,dsgw,282,[Kein Eintrag gefunden.\n%2$s] +de,dsgw,283,[Kein Eintrag gefunden, in dem %2$s '%4$s' %3$s.\n] +de,dsgw,284,[1 Eintrag gefunden.\n%2$s] +de,dsgw,285,[1 Eintrag gefunden, in dem %2$s '%4$s' %3$s.\n] +de,dsgw,286,[1 Eintrag gefunden.\n%2$s] +de,dsgw,287,[1 Eintrag gefunden, in dem %2$s '%4$s' %3$s.\n] +de,dsgw,288,[%1$li Einträge gefunden.\n%2$s] +de,dsgw,289,[%1$li Einträge gefunden, in denen %2$s '%4$s' %3$s.\n] +de,dsgw,290,[%1$li Einträge gefunden.\n%2$s] +de,dsgw,291,[%1$li Einträge gefunden, in denen %2$s '%4$s' %3$s.\n] +de,dsgw,292,[der LDAP-Filter ist] +de,dsgw,293,[Der Server konnte den Eintrag, den Sie bei der Beglaubigung verwendet haben, nicht finden. Möglicherweise wurde der Eintrag umbenannt oder gelöscht. Bitte wiederholen Sie die Beglaubigung.] +de,dsgw,294,[Die neue Kennwortsyntax ist ungültig.\n] +de,dsgw,295,[Das neue Kennwort ist in der Kennwortchronik enthalten.\n] +de,dsgw,296,[Sie haben den Grenzwert für die Wiederholung des Kennworts überschritten. Bitte wenden Sie sich an den Systemverwalter.\n] +de,dsgw,297,[Sie haben den Grenzwert für die Wiederholung des Kennworts überschritten. Versuchen Sie es später erneut.\n] +de,dsgw,298,[Das Kennwort ist abgelaufen. Wenden Sie sich an den Systemverwalter, um das Kennwort zurückzusetzen.\n] +de,frame,-1,[$DBT: frame in DB file v1 $] +de,frame,1,[Nicht gefunden (Not Found)

        Nicht gefunden (Not Found)

        Das angeforderte Objekt existiert nicht auf diesem Server. Die von Ihnen verfolgte Verknüpfung ist entweder veraltet, ungenau oder der Server darf sie Ihnen nicht anbieten.\n(The requested object does not exist on this server. The link you followed is either outdated, inaccurate, or the server has been instructed not to let you have it.)] +de,frame,2,[Informieren Sie bitte den Standortverwalter über die , Bezugsseite .\n(Please inform the site administrator of the referring page.)] +de,frame,3,[Ihr Browser sandte eine Anforderung, die dieser Proxy-Server nicht verstehen kann.\n(Your browser sent a request that this proxy could not understand.)] +de,frame,4,[Ordnungsgemäße Genehmigung ist für den Administrator dieses Proxy-Servers erforderlich.\nEntweder führt Ihr Browser keine Genehmigung aus oder Ihre Genehmigung ist falsch.\n(Proper authorization is required for the administration of this proxy.\nEither your browser does not perform authorization, or your authorization\nhas failed.)] +de,frame,5,[Beglaubigung des Benutzernamens ist erforderlich, um diesen Proxy-Server zu benutzen.\n Entweder führt Ihr Browser keine Proxy-Genehmigung aus oder Ihre Genehmigung ist falsch.\n(Username authentication is required for using this proxy.\nEither your browser does not perform proxy authorization, or your\nauthorization has failed.)] +de,frame,6,[Die Zugriffssteuerungskonfiguration des Proxy-Servers verweigert\nZugriff auf das durch diesen Proxy-Server angeforderte Objekt.\n(The proxy's access control configuration denies access to\nthe requested object through this proxy.)] +de,frame,7,[Im Proxy-Server ist ein interner Fehler aufgetreten, so daß Ihre\nAnforderung nicht ausgeführt werden kann. Wahrscheinlich ist die Konfiguration falsch.\nBitten Sie den Administrator, nach entsprechenden Hinweisen im Fehlerprotokoll des Proxy-Servers zu suchen.\n(The proxy has encountered an internal error which prevents it from\nfulfilling your request. The most likely cause is a misconfiguration.\nPlease ask the administrator to look for messages in the proxy's error log.)] +de,frame,8,[Dieser Proxy-Server setzt nicht die angeforderte Methode ein.\n(This proxy server does not implement the requested method.)] +de,frame,9,[Ein Fehler ist auf dem Proxy-Server aufgetreten.\n(An error has occurred on the proxy server.)] +de,frame,10,[Dieser Server konnte die gesendete Anfrage Ihres Browsers nicht verstehen.\n(Your browser sent a query this server could not understand.)] +de,frame,11,[Ordnungsgemäße Genehmigung ist für diesen Bereich erforderlich. Entweder führt Ihr Browser keine Genehmigung aus oder Ihre Genehmigung ist falsch.\n(Proper authorization is required for this area. Either your browser does not perform authorization, or your authorization has failed.)] +de,frame,12,[Ihr Client darf das angeforderte Objekt nicht abrufen.\n(Your client is not allowed to access the requested object.)] +de,frame,13,[In diesem Server ist ein interner Fehler aufgetreten, so daß Ihre Anforderung nicht ausgeführt werden kann. Wahrscheinlich ist die Konfiguration falsch. Bitten Sie den Administrator, nach entsprechenden Hinweisen im Fehlerprotokoll des Proxy-Servers zu suchen.\n(This server has encountered an internal error which prevents it from fulfilling your request. The most likely cause is a misconfiguration. Please ask the administrator to look for messages in the server's error log.)] +de,frame,14,[Dieser Server setzt nicht die angeforderte Methode ein.\n(This server does not implement the requested method.)] +de,frame,15,[Ein Fehler ist aufgetreten.\n(An error has occurred.)] +de,frame,16,[Dieser Server konnte die gesendete Meldung Ihres Browsers nicht verstehen.\n(Your browser sent a message this server could not understand.)] +de,frame,17,[%s

        %s

        \nDieses Dokument wurde an einen neuen Standort verschoben. Aktualisieren Sie bitte Ihre Dokumente und Hotlisten entsprechend.(This document has moved to a new location. Please update your documents and hotlists accordingly.)\n] +de,frame,18,[%s\n

        %s

        \n%s\n] +de,frame,19,[process-uri-objects] +de,frame,20,[cannot find template %s] +de,frame,21,[process-uri-objects] +de,frame,22,[no partial path after object processing] +de,frame,23,[find-service] +de,frame,24,[invalid shexp %s] +de,frame,25,[find-service] +de,frame,26,[invalid shexp %s] +de,frame,27,[handle-processed] +de,frame,28,[no way to service request for %s] +de,frame,29,[finish-socks-request] +de,frame,30,[close failed (%s), csd=%d] +de,frame,31,[This beta software has expired.\n] +de,frame,32,[mr_accept(%d)] +de,frame,33,[Error issuing read on accept socket] +de,frame,34,[acb_accept_connection(%d)] +de,frame,35,[Error getting accept socket (%d)] +de,frame,36,[Error in accept! (%d, %s)] +de,frame,37,[Error creating new accept request] +de,frame,38,[accepted connection: %d (NSPR %d)] +de,frame,39,[Error creating new session structure] +de,frame,40,[accel_read_request()] +de,frame,41,[Error allocating request read buffer] +de,frame,42,[Error issuing async read request] +de,frame,43,[acb_read_request(%d, bytes %d)] +de,frame,44,[acb_read_req(1 session = %d)] +de,frame,45,[Error reading request (%d, %s)] +de,frame,46,[Client aborted connection] +de,frame,47,[Error reading request] +de,frame,48,[Error creating new request] +de,frame,49,[error occurred, closing %d, io was for %d] +de,frame,50,[accel_async_scan_headers()] +de,frame,51,[out of memory: accel_async_scan_headers] +de,frame,52,[out of memory: accel_async_scan_headers] +de,frame,53,[Error during async read (%d, %s)] +de,frame,54,[scan-headers reports: line too long] +de,frame,55,[scan-headers reports: too many headers] +de,frame,56,[Error reading headers] +de,frame,57,[scan-headers reports: header missing terminator (an empty line)] +de,frame,58,[scan-headers reports: header was empty] +de,frame,59,[Name ohne Wert: Zeile "%s" erhalten\n(name without value: got line as shown)] +de,frame,60,[accel_send_plain_file()] +de,frame,61,[accel_send_plain_file() - found request %d] +de,frame,62,[Parse headers lost the URI!] +de,frame,63,[accel_send_plain_file() - found uri %s] +de,frame,64,[accel_send_plain_file() - found in cache?] +de,frame,65,[malloc died!] +de,frame,66,[Error writing back file\n] +de,frame,67,[acb_send_plain_file(%d)] +de,frame,68,[Error writing in acb_send_plain_file (%d, %s)] +de,frame,69,[acb_close_connection(%d)] +de,frame,70,[Errored IO in acb_close_connection (%d, %s)] +de,frame,71,[Unable to close socket %d] +de,frame,72,[accel-cache-insert: Error allocating entry] +de,frame,73,[cache-init: server cache disabled] +de,frame,74,[accel_file_cache: Error initializing file cache] +de,frame,75,[accel_file_cache: Error creating cache] +de,frame,76,[accel_file_cache_init: CacheHashSize < %d, using %d] +de,frame,77,[accel_file_cache_init: CacheHashSize > %d, using %d] +de,frame,78,[accel_file_cache_init: MaxNumberOfCachedFiles < %d, using %d] +de,frame,79,[accel_file_cache_init: MaxNumberOfCachedFiles > %d, using %d] +de,frame,80,[accel_file_cache_init: MaxNumberOfOpenCachedFiles < %d, using %d] +de,frame,81,[accel_file_cache_init: MaxNumberOfOpenCachedFiles > %d, using %d] +de,frame,82,[accel_file_cache: Error initializing file cache] +de,frame,83,[file-cache: enabled = %s ] +de,frame,84,[on] +de,frame,85,[off] +de,frame,86,[file-cache: MaxNumberOfCachedFiles %d (0x%x)] +de,frame,87,[file-cache: CacheHashSize %d (0x%x)] +de,frame,88,[file-cache: MaxNumberOfOpenCachedFiles %d (0x%x)] +de,frame,89,[accel-cache-insert: Error allocating entry] +de,frame,90,[file-cache-cleanup: munmap failed (%s)] +de,frame,91,[file-cache-cleanup: found mmapped file \non system without mmap] +de,frame,92,[file_cache_init: MaxTotalCachedFileSize < %d, using %d] +de,frame,93,[file_cache_init: MaxTotalCachedFileSize > %d, using %d] +de,frame,94,[file cache using mmap flags 0x%x] +de,frame,95,[file cache using mmap prots 0x%x] +de,frame,96,[file-cache-init: could not create lock] +de,frame,97,[file-cache: unable to create temporary directory %s.\n] +de,frame,98,[file-cache: unable to create temporary directory %s.\n] +de,frame,99,[file-cache: GetTempPath() Cannot find temp directory to store file!] +de,frame,100,[file-cache-init: set max cached file size to %d] +de,frame,101,[file-cache-init: could not create lock] +de,frame,102,[file_cache_destroy()] +de,frame,103,[file-cache: Unable to get temp file name. Error %s] +de,frame,104,[file-cache: Unable to get temp file name. Error %s] +de,frame,105,[file-cache-insert: Error allocating entry] +de,frame,106,[file-cache-create: Error opening file %s (%s)] +de,frame,107,[file-cache-create: Error stat()ing file %s (%s)] +de,frame,108,[file-cache-create: Error mmap()ing file %s (%s)] +de,frame,109,[file-cache-create: malloc failure] +de,frame,110,[file-cache-create: error case failed to munmap(%d, %d) (%s)] +de,frame,111,[file-cache-valid: cannot stat %s] +de,frame,112,[dir change: invalidating %s (%d)] +de,frame,113,[file-cache: asynchronous file change notification failed.] +de,frame,114,[dir change: offset %d, action %d, len %d, name %s] +de,frame,115,[unable to check async file status] +de,frame,116,[ReadDirectoryChangesW failure- unable to continue watching %s. Error is %s] +de,frame,117,[file-cache-add-watch failure- unable to open directory %s. Error %s] +de,frame,118,[ReadDirectoryChangesW failure- unable to start watching %s. Error %s] +de,frame,119,[func_exec] +de,frame,120,[no handler function given for directive] +de,frame,121,[func_exec] +de,frame,122,[cannot find function named %s] +de,frame,123,[handle-request] +de,frame,124,[method without URI] +de,frame,125,[http-parse-request] +de,frame,126,[while scanning HTTP headers, %s] +de,frame,127,[handle-request] +de,frame,128,[read from %s failed, error is %s] +de,frame,129,[handle-request] +de,frame,130,[request too long] +de,frame,131,[start-http-response] +de,frame,132,[write failed (%s)] +de,frame,133,[start-http-response] +de,frame,134,[write failed (%s)] +de,frame,135,[http-status] +de,frame,136,[%d is not a valid HTTP status code] +de,frame,137,[finish-request] +de,frame,138,[close failed (%s)] +de,frame,139,[Unable to close socket for writing] +de,frame,140,[os has %d objects] +de,frame,141,[obj %d has no hash table at %d] +de,frame,142,[obj %d has no param] +de,frame,143,[obj %d name %s value %s] +de,frame,144,[.....directives %d.......] +de,frame,145,[.....directive %d] +de,frame,146,[.......instance %d] +de,frame,147,[...........param name %s value %s] +de,frame,148,[ClearConfigurationParameters:RegCreateKey %s] +de,frame,149,[ClearConfigurationParameters:RegEnumKey %s failed] +de,frame,150,[obj.conf line %d: error in filter file "%s" at line %d: %s] +de,frame,151,[obj.conf line %d: error in filter file "%s" at line %d: %s] +de,frame,152,[Unable to allocate Subject property list.\n] +de,frame,153,[Unable to set session ptr in Subject property list - error=%d\n] +de,frame,154,[Unable to set request ptr in Subject property list - error=%d\n] +de,frame,155,[file-cache-valid: cannot stat %s] +de,frame,156,[file-cache-create: Error stat()ing file %s (%s)] +de,httpdaemon,-1,[$DBT: httpdaemon in DB file v1 $] +de,httpdaemon,1,[Error in ConvertThreadToFiber] +de,httpdaemon,2,[Error in ConvertThreadToFiber] +de,httpdaemon,3,[Error in md_start_system] +de,httpdaemon,4,[Error in CreateFiber - idlefiber] +de,httpdaemon,5,[Error in GetQueuedCompletionStatus] +de,httpdaemon,6,[Error creating completion port] +de,httpdaemon,7,[Could not SetHandleNonInheritable (%s)] +de,httpdaemon,8,[Error accept/read new conn] +de,httpdaemon,9,[Error in Respond()] +de,httpdaemon,10,[Error in RespondCompleted()] +de,httpdaemon,11,[daemon: unable to fork new process (%s)\n] +de,httpdaemon,12,[daemon: setsid failed (%s)\n] +de,httpdaemon,13,[daemon: can't log pid to %s (%s)\n] +de,httpdaemon,14,[warning: could not set group id to %d (%s)\n] +de,httpdaemon,15,[warning: could not set user id to %d (%s)\n] +de,httpdaemon,16,[warning: daemon is running as super-user\n] +de,httpdaemon,17,[could not determine current user name\n] +de,httpdaemon,18,[error: chroot to %s failed (%s)\n] +de,httpdaemon,19,[WARNING! netscape executable and library have different versions.\n] +de,httpdaemon,20,[startup: listening to %s://%s, port %d as %s\n] +de,httpdaemon,21,[startup: listening to %s://%s, port %d as %s\n] +de,httpdaemon,22,[seminit failed (%s)\n] +de,httpdaemon,23,[Using single threaded accepts.] +de,httpdaemon,24,[Using multi threaded accepts.] +de,httpdaemon,25,[Using partial single threaded accepts.] +de,httpdaemon,26,[This machine has %d processors.] +de,httpdaemon,27,[Error calling thr_seconcurrency(%d)- (%s)] +de,httpdaemon,28,[Set conncurrency to %d.] +de,httpdaemon,29,[can't fork new process (%s)] +de,httpdaemon,30,[This beta software has expired.\n] +de,httpdaemon,31,[can't create IPC pipe (%s)] +de,httpdaemon,32,[write to wakeup pipe failed (%s)] +de,httpdaemon,33,[select thread miss] +de,httpdaemon,34,[startup failure: could not bind to port %d (%s)\n] +de,httpdaemon,35,[startup failure: could not bind to port %d, IP address %s (%s)\n] +de,libaccess,-1,[$DBT: libaccess in DB file v1 $] +de,libaccess,1,[basic-ncsa] +de,libaccess,2,[cannot open database %s] +de,libaccess,3,[basic-ncsa] +de,libaccess,4,[user %s password did not match database %s] +de,libaccess,5,[basic-ncsa] +de,libaccess,6,[cannot open connection to LDAP server on %s:%d] +de,libaccess,7,[basic-ncsa] +de,libaccess,8,[user %s password did not match LDAP on %s:%d] +de,libaccess,9,[acl-state] +de,libaccess,10,[missing realm] +de,libaccess,11,[Unable to allocate ACL List Hash\n] +de,libaccess,12,[ACLEvalBuildContext unable to PERM_MALLOC cache structure\n] +de,libaccess,13,[ACLEvalBuildContext unable to create hash table\n] +de,libaccess,14,[ACLEvalBuildContext unable to allocate ACE Entry\n] +de,libaccess,15,[ACLEvalBuildContext unable to allocate ACE entry\n] +de,libaccess,16,[ACLEvalBuildContext unable to allocate Boundary Entry\n] +de,libaccess,17,[ACLEvalBuildContext failed.\n] +de,libaccess,18,[ACL_EvalTestRights: an interim, absolute non-allow value was encountered. right=%s, value=%d\n] +de,libaccess,19,[LASDnsBuild unable to allocate hash table header\n] +de,libaccess,20,[LASDnsBuild unable to add key %s\n] +de,libaccess,21,[LASDnsBuild unable to add key %s\n] +de,libaccess,22,[LASDnsBuild unable to add key %s\n] +de,libaccess,23,[LASDnsBuild unable to add key %s\n] +de,libaccess,24,[LASDnsBuild unable to add key %s\n] +de,libaccess,25,[LAS DNS build received request for attribute %s\n] +de,libaccess,26,[LASDnsEval - illegal comparator %s\n] +de,libaccess,27,[LASDnsEval unable to allocate Context struct\n\n] +de,libaccess,28,[LASDnsEval unable to get session address %d\n] +de,libaccess,29,[LASDnsEval unable to get DNS - error=%s\n] +de,libaccess,30,[LAS Group Eval received request for attribute %s\n] +de,libaccess,31,[LASGroupEval - illegal comparator %s\n] +de,libaccess,32,[LASGroupEval - ran out of memory\n] +de,libaccess,33,[LASGroupEval unable to get session address %d\n] +de,libaccess,34,[LASGroupEval unable to get session address %d\n] +de,libaccess,35,[LASGroupEval - couldn't locate getter for auth-user\n] +de,libaccess,36,[LASGroupEval - Attribute getter for auth-user failed\n] +de,libaccess,37,[LASGroupEval - Attribute getter didn't set auth-user\n] +de,libaccess,38,[Check group membership of user "%s" for group "%s"\n] +de,libaccess,39,[LDAPU_SUCCESS for group "%s"\n] +de,libaccess,40,[LDAPU_FAILED for group "%s"\n] +de,libaccess,41,[LAS_EVAL_FALSE\n] +de,libaccess,42,[LAS_EVAL_TRUE\n] +de,libaccess,43,[LASIpTreeAlloc - no memory\n] +de,libaccess,44,[IP LAS unable to allocate tree node\n] +de,libaccess,45,[IP LAS unable to allocate tree node\n] +de,libaccess,46,[LAS IP build received request for attribute %s\n] +de,libaccess,47,[LASIpEval - illegal comparator %s\n] +de,libaccess,48,[LASIpEval unable to get session address - error=%s\n] +de,libaccess,49,[LASIpEval unable to allocate Context struct\n\n] +de,libaccess,50,[LASIpEval - reach 32 bits without conclusion value=%s] +de,libaccess,51,[LAS Program Eval received request for attribute %s\n] +de,libaccess,52,[LASProgramEval - illegal comparator %s\n] +de,libaccess,53,[LASProgram unable to get session address %d\n] +de,libaccess,54,[bin] +de,libaccess,55,[LASProgramEval: request not of type admin or bin, passing.\n] +de,libaccess,56,[LASProgramEval: check if program %s matches pattern %s.\n] +de,libaccess,57,[LASProgramEval: Invalid wildcard expression %s.\n] +de,libaccess,58,[LAS_EVAL_FALSE\n] +de,libaccess,59,[LAS_EVAL_TRUE\n] +de,libaccess,60,[Unexpected attribute in dayOfWeek - %s\n] +de,libaccess,61,[Illegal comparator for dayOfWeek - %s\n] +de,libaccess,62,[Unexpected attribute in timeOfDay - %s\n] +de,libaccess,63,[LAS User Eval received request for attribute %s\n] +de,libaccess,64,[LASUserEval - illegal comparator %s\n] +de,libaccess,65,[LASUserEval - ran out of memory\n] +de,libaccess,66,[LASUserEval unable to get session address %d\n] +de,libaccess,67,[LASUserEval unable to get session address %d\n] +de,libaccess,68,[LASGroupEval - couldn't locate getter for auth-user\n] +de,libaccess,69,[LASGroupEval - Attribute getter for auth-user failed\n] +de,libaccess,70,[LASGroupEval - Attribute getter didn't set auth-user\n] +de,libaccess,71,[Check if uid == user (i.e. check "%s" == "%s)"\n] +de,libaccess,72,[SUCCESS for user "%s"\n] +de,libaccess,73,[FAILED for user "%s"\n] +de,libaccess,74,[LAS_EVAL_FALSE\n] +de,libaccess,75,[LAS_EVAL_TRUE\n] +de,libaccess,76,[] +de,libaccess,77,[LASProgram unable to get request address - error=%s] +de,libaccess,78,[LASProgram rejecting request for program %s from pattern %s] +de,libaccess,79,[ACL_CacheFlush: unable to parse file "%s"\n] +de,libaccess,80,[ACL_CacheFlush: unable to concatenate ACL list "%s"\n] +de,libaccess,81,[ACL_CacheFlush: unable to open and process the magnus file "%s"\n] +de,libaccess,82,[Illegal comparator for timeOfDay - %s\n] +de,libaccess,83,[ACL_EvalBuildContext unable to create hash table\n] +de,libaccess,84,[ACL_EvalBuildContext unable to PERM_CALLOC cache structure\n] +de,libaccess,85,[ACL_EvalBuildContext unable to allocate ACE entry\n] +de,libaccess,86,[ACL_EvalBuildContext unable to allocate auth pointer array\n] +de,libaccess,87,[ACL_EvalBuildContext unable to allocate auth plist\n] +de,libaccess,88,[ACL_EvalTestRights: an interim, absolute non-allow value was encountered. right=%s, value=%s\n] +de,libaccess,89,[ACL_INTEvalTestRights: call to ACL_EvalBuildContext returned failure status\n] +de,libaccess,90,[ACL_ModuleRegister: module name is missing\n] +de,libaccess,91,[ACL_ModuleRegister: call to module init function returned a failed status\n] +de,libaccess,92,[ACL_GetAttribute: couldn't determine method for %s\n] +de,libaccess,93,[ACL_GetAttribute: couldn't locate getter for %s] +de,libaccess,94,[ACL_GetAttribute: attr getter failed to get %s] +de,libaccess,95,[ACL_GetAttribute: attr getter failed to get %s] +de,libaccess,96,[ACL_GetAttribute: All attribute getters declined for attr %s] +de,libaccess,97,[ACL_DatabaseRegister: dbtype for database "%s" is not defined yet!] +de,libaccess,98,[ACL_DatabaseRegister: database name is missing] +de,libaccess,99,[Error reading the DB Map File: %s. Reason: %s] +de,libaccess,100,[URL is missing for database %s] +de,libaccess,101,[Invalid property value pair for database %s] +de,libaccess,102,["default" database must be an LDAP database] +de,libaccess,103,[Multiple "default" databases are being registered] +de,libaccess,104,["default" LDAP database must be registered] +de,libaccess,105,[LASGroupEval unable to get database name - error= %s] +de,libaccess,106,[received invalid program expression %s] +de,libaccess,107,[parse_ldap_url: database url is missing] +de,libaccess,108,[parse_ldap_url: database name is missing] +de,libaccess,109,[parse_ldap_url: error in parsing ldap url. Reason: %s] +de,libaccess,110,[ldap password check: unable to get database name - error=%s] +de,libaccess,111,[ldap password check: unable to get parsed database %s] +de,libaccess,112,[ldap password check: couldn't initialize connection to LDAP. Reason: %s] +de,libaccess,113,[ldap password check: LDAP error: "%s"] +de,libaccess,114,[get_user_ismember_ldap unable to get database name - error=%s] +de,libaccess,115,[get_user_ismember_ldap unable to get parsed database %s] +de,libaccess,116,[ldap password check: couldn't initialize connection to LDAP. Reason: %s] +de,libaccess,117,[get_user_ismember_ldap: group %s does not exist] +de,libaccess,118,[get_user_ismember_ldap: LDAP error: "%s"] +de,libaccess,119,[ACL_LDAPDatabaseHandle: %s is not a registered database] +de,libaccess,120,[ACL_LDAPDatabaseHandle: %s is not an LDAP database] +de,libaccess,121,[ACL_LDAPDatabaseHandle: out of memory] +de,libaccess,122,[ACL_LDAPDatabaseHandle: couldn't initialize connection to LDAP. Reason: %s] +de,libaccess,123,[ACL_LDAPDatabaseHandle: couldn't bind to LDAP server. Reason: %s] +de,libaccess,124,[insufficient dynamic memory] +de,libaccess,125,[error opening file, %s: %s] +de,libaccess,126,[duplicate definition of %s] +de,libaccess,127,[file %s, line %s: duplicate definition of %s] +de,libaccess,128,[file %s, line %s: syntax error] +de,libaccess,129,[file %s, line %s: %s is undefined] +de,libaccess,130,[in acl %s, %s %s is undefined] +de,libaccess,131,[database %s: error accessing %s] +de,libaccess,132,[%s] +de,libaccess,133,[file %s, line %s: invalid syntax] +de,libaccess,134,[file %s, line %s: syntax error at "%s"] +de,libaccess,135,[realm %s is not defined] +de,libaccess,136,[error code = %d] +de,libaccess,137,[internal ACL error] +de,libaccess,138,[invalid argument] +de,libaccess,139,[ACL_DatabaseRegister: dbtype for database "%s" is not defined yet!] +de,libaccess,140,[couldn't determine dbtype from: %s] +de,libaccess,141,[Failed to register database %s] +de,libaccess,142,[ACL call returned failed status] +de,libaccess,143,[file %s: ACL IO error - %s] +de,libaccess,144,[acl_user_exists: Nicht genug Speicher] +de,libaccess,145,[acl_user_exists: Benutzer existiert nicht mehr] +de,libaccess,146,[acl_user_exists: plist-Fehler] +de,libadmin,-1,[$DBT: libadmin in DB file v1 $] +de,libadmin,1,[ Help ] +de,libadmin,2,[ OK ] +de,libadmin,3,[ Reset ] +de,libadmin,4,[ Done ] +de,libadmin,5,[ Cancel ] +de,libir,-1,[$DBT: libadmin in DB file v1 $] +de,libir,1,[An I/O error occurred before all form data could be read.] diff --git a/l10n/dirserv/en/ns-slapd.txt b/l10n/dirserv/en/ns-slapd.txt new file mode 100644 index 00000000..b1f8348f --- /dev/null +++ b/l10n/dirserv/en/ns-slapd.txt @@ -0,0 +1,986 @@ +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +/**************************************************************************/ +/* The copyright notice(s) in this Source Code does not indicate actual */ +/* or intended publication of this Source Code. */ +/**************************************************************************/ + +/* This text file was generated by program dblink */ + +$Revision: 1.1 $ +$Log: ns-slapd.txt,v $ +Revision 1.1 2005/01/21 00:40:48 cvsadm +Initial revision + +Revision 1.1.2.3.10.1.8.4 2003/09/22 19:36:41 ulfw +Update copyright years from 2001 to 2001-2003 + +Revision 1.1.2.3.10.1.8.3 2001/11/03 01:05:57 richm +XXX use new copyright XXX + +Revision 1.1.2.3.10.1.8.2 2001/09/20 16:39:13 richm +removed 8 bit copyright character + +Revision 1.1.2.3.10.1.8.2 2001/09/18 11:48:15 rmarco +Remove copyright caracter from copyright + +Revision 1.1.2.3.10.1.8.1 2001/02/13 09:59:52 rmarco +Copyrights + +Revision 1.1.2.3.10.1 1998/04/04 23:16:50 mcs +merge changes made on directory31_rtm_branch into server4_directory_branch + +Revision 1.1.2.3.6.1 1998/02/24 05:51:54 noriko +Synched with server3_i18npkg_branch + +Revision 1.1.2.5 1998/02/12 01:15:09 scronin +still the same i18n changes + +$EndLog$ + +$StartStringData$ + +en,base,-1,[$DBT: base in DB file v1 $] +en,base,1,[insufficient memory to create hash table] +en,base,2,[insufficient memory to create hash table] +en,base,3,[cache_destroy: cache tables appear corrupt.] +en,base,4,[unable to allocate hash entry] +en,base,5,[cache_insert: unable to create cache entry] +en,base,6,[HTTP/1.0 200 OK\nContent-type: text/html\n\n] +en,base,7,[

        Netscape cache status report

        \n] +en,base,8,[No caches on system

        ] +en,base,9,[

        %s cache

        \n] +en,base,10,[Cache hit ratio: %d/%d (%f)

        \n

        \n] +en,base,11,[Cache size: %d/%d

        \n

        \n] +en,base,12,[Hash table size: %d

        \n

        \n] +en,base,13,[mru : %d

        \nlru : %d

        \n] +en,base,14,[
          Originalspeicherbereich (Bucket) Adresse (Address) Schlüssel (Key) Zugriffsanzahl (Access Count) Löschen (Delete) Nächste (Next) LRU MRU Daten (Data)
          \n] +en,base,15,[munmap failed (%s)] +en,base,16,[munmap failed (%s)] +en,base,17,[close failed (%s)] +en,base,18,[daemon: unable to fork new process (%s)\n] +en,base,19,[daemon: setsid failed (%s)\n] +en,base,20,[daemon: can't log pid to %s (%s)\n] +en,base,21,[warning: could not set group id to %d (%s)\n] +en,base,22,[warning: could not set user id to %d (%s)\n] +en,base,23,[warning: daemon is running as super-user\n] +en,base,24,[could not determine current user name\n] +en,base,25,[error: chroot to %s failed (%s)\n] +en,base,27,[, address %s] +en,base,28,[warning: statistics disabled (%s)\n] +en,base,29,[security handshake timed out for pid %d] +en,base,30,[warning: statistics disabled (%s)\n] +en,base,31,[secure handshake failed (code %d)\n] +en,base,32,[accept failed (%s)] +en,base,33,[warning: statistics disabled (%s)\n] +en,base,34,[select thread miss] +en,base,35,[keepalive worker awoken with no work to do] +en,base,36,[could not create new thread: %d (%s)] +en,base,37,[wait for sema succeeded, but nothing to dequeue] +en,base,38,[queue-sema creation failure] +en,base,39,[error getting processor info for processor %d] +en,base,40,[Error binding to processor %d] +en,base,41,[bound process %d to processor %d] +en,base,42,[Netscape server is not explicitly binding to any processors.] +en,base,43,[cache monitor exited] +en,base,44,[cache batch update daemon exited] +en,base,45,[Using single threaded accepts.] +en,base,46,[Using multi threaded accepts.] +en,base,47,[Using partial single threaded accepts.] +en,base,48,[This machine has %d processors.] +en,base,49,[Error calling thr_seconcurrency(%d)- (%s)] +en,base,50,[Set conncurrency to %d.] +en,base,51,[WARNING! netscape executable and library have different versions.\n] +en,base,54,[seminit failed (%s)\n] +en,base,55,[This beta software has expired.\n] +en,base,56,[Cache monitor respawned] +en,base,57,[Cache batch update daemon respawned] +en,base,58,[can't find empty statistics slot] +en,base,59,[can't fork new process (%s)] +en,base,60,[assert failed! %s\n] +en,base,61,[mr_table_init()] +en,base,62,[malloc failed] +en,base,63,[malloc failed!] +en,base,64,[mr_add_io(%d, type %d, file %d)] +en,base,65,[mr_add_io - stage 1] +en,base,66,[mr_add_io - stage 2] +en,base,67,[mr_add_io found invalid IO type %d] +en,base,68,[mr_add_io - adding timeout] +en,base,69,[Out of memory!\n] +en,base,70,[done with mr_add_io] +en,base,71,[mr_del_io(%d, type %d, file %d)] +en,base,72,[mr_del_io found invalid IO type %d] +en,base,73,[mr_lookup_io(%d)] +en,base,74,[mr_async_io(%d, %d bytes, file %d)] +en,base,75,[malloc failure adding async IO] +en,base,76,[Error adding async io!] +en,base,77,[Cannot seek for read!] +en,base,78,[read failure! (%d, %s)] +en,base,79,[do_read read %d bytes for file %d] +en,base,80,[Cannot seek for write!] +en,base,81,[writev failure! (%d, %s)] +en,base,82,[write failure! (%d, %s)] +en,base,83,[do_write wrote %d bytes for file %d] +en,base,84,[do_timeout(mrp %d)] +en,base,85,[do_timeout: found IO (timer=%d, time=%d)] +en,base,86,[error deleting io] +en,base,87,[timeout callback failure for %d\n] +en,base,88,[mr_get_event(%d) - outstanding io %d] +en,base,89,[mr_get_event: Waiting for reads on FD:] +en,base,90,[mr_get_event: Waiting for writes on FD:] +en,base,91,[ %d] +en,base,92,[ %d] +en,base,93,[mr_get_event set no timeout] +en,base,94,[mr_get_event set timeout to: %d.%d sec] +en,base,95,[error in select (%d, %s)] +en,base,96,[mr_get_event() - select found %d] +en,base,97,[error looking up IO fd %d] +en,base,98,[read failed for fd %d] +en,base,99,[error deleting io] +en,base,100,[callback failure for %d\n] +en,base,101,[error looking up IO fd %d] +en,base,102,[writing: header len %d, writelen %d, total %d] +en,base,103,[write failed for fd %d] +en,base,104,[error deleting io] +en,base,105,[callback failure for %d\n] +en,base,106,[Error creating dns cache] +en,base,107,[dns_cache_init: hash_size <= 0, using %d] +en,base,108,[dns_cache_init: cache-size <= %d, using %d] +en,base,109,[dns_cache_init: cache-size is %d is too large, using %d.] +en,base,110,[dns_cache_init: expire_time <= 0, using %d] +en,base,111,[dns_cache_init: expire is %d is too large, using %d seconds.] +en,base,112,[Error creating dns cache] +en,base,113,[dns-cache-insert: Error allocating entry] +en,base,114,[dns-cache-insert: malloc failure] +en,base,115,[successful server startup] +en,base,116,[%s B%s] +en,base,117,[Netscape executable and shared library have different versions] +en,base,118,[ executable version is %s] +en,base,119,[ shared library version is %s] +en,base,120,[error reporting shutting down] +en,base,121,[warning] +en,base,122,[config] +en,base,123,[security] +en,base,124,[failure] +en,base,125,[catastrophe] +en,base,126,[info] +en,base,127,[verbose] +en,base,128,[event_handler:Failed to wait on events %s] +en,base,129,[could not wait on resume event event (%s)] +en,base,130,[dlopen of %s failed (%s)] +en,base,131,[dlopen of %s failed (%s)] +en,base,132,[The server is terminating due to an error. Check the event viewer for the error message. SERVER EXITING!] +en,base,133,[Terminating the server %s] +en,base,134,[kill_server:cannot open server event %s] +en,base,135,[kill_server:cannot set server event %s] +en,base,136,[error: could not get socket (%s)\n] +en,base,137,[error: could not set socket option (%s)\n] +en,base,138,[Terminating Service:error: could not bind to address %s port %d (%s)\n] +en,base,139,[Terminating Service:error: could not bind to port %d (%s)\n] +en,base,140,[SetHandleNonInheritable: could not duplicate socket (%s)] +en,base,141,[SetHandleNonInheritable: closing the original socket failed (%s)] +en,base,142,[Could not SetHandleInformation (%s)] +en,base,143,[Terminating Service:Failure: Could not open statistics file (%s)\n] +en,base,144,[Could not set Thread Local Storage Value for thread at slot %d] +en,base,145,[secure handshake failed (code %d)\n] +en,base,146,[accept failed %d (%s)] +en,base,147,[Failed to pulse Event %d %s] +en,base,148,[Failed to send MobGrowth Event to parent %s] +en,base,149,[Pulsing MobRespawn Event %d] +en,base,150,[respawn thread pool to %d (%d)] +en,base,151,[Could not open event to signal rotate application. Could not create the MoveLog event:%s] +en,base,152,[Failed to send MoveLog Event to rotate app %s] +en,base,153,[growing thread pool from %d to %d] +en,base,154,[Could not open the ServiceControlManager, Error %d] +en,base,155,[StartNetsiteService:Could not open the service %s: Error %d] +en,base,156,[StartNetsiteService:Could not start the service %s] +en,base,157,[Service Startup: Could not allocate security descriptor] +en,base,158,[Service Startup: Could not init security descriptor] +en,base,159,[Service Startup: Could not set the security Dacl] +en,base,160,[Terminating Service:WinSock init failed: %s] +en,base,161,[Httpd Server Startup failed: %s] +en,base,162,[can't find empty statistics slot] +en,base,163,[NT daemon: could not create new thread %d] +en,base,164,[Service Startup Failure. Terminating Service:Could not create event %d:%s] +en,base,165,[Service Startup Error. Could not create the MoveLog event:%s] +en,base,166,[Failed to wait on Event objects %s] +en,base,167,[Failed to wait on Event objects %s] +en,base,168,[pipebuf_buf2sd: pipebuf_grab IO_ERROR %d] +en,base,169,[pool-init: memory pools disabled] +en,base,170,[pool-init: free_size <= 0, using %d] +en,base,171,[pool-create-block: out of memory] +en,base,172,[pool-create: out of memory] +en,base,173,[pool-create: out of memory] +en,base,174,[pool-malloc: out of memory] +en,base,175,[FREE() used where PERM_FREE() should have been used- problem corrected and supressing further warnings.] +en,base,176,[regex error: %s (regex: '%s')] +en,base,177,[can't create IPC pipe (%s)] +en,base,178,[write to wakeup pipe failed (%s)] +en,base,179,[flushing %d connections; current %d; tot %d] +en,base,180,[accept failed (%s)] +en,base,181,[Error creating time cache] +en,base,182,[time-cache: cache disabled] +en,base,183,[time_cache_init: hash_size < %d, using default, %d] +en,base,184,[time_cache_init: hash_size > %d, using default, %d] +en,base,185,[time_cache_init: cache_size < %d, using default, %d] +en,base,186,[time_cache_init: cache_size > %d, using default, %d] +en,base,187,[Error allocating memory for time_cache] +en,base,188,[Error allocating memory for time_cache entry] +en,base,189,[Error allocating memory for time_cache entry] +en,base,190,[Error inserting new time_cache entry] +en,base,191,[Error allocating memory for time_cache] +en,base,192,[cs-terminate failure (%s)] +en,base,193,[cs-init failure (%s)] +en,base,194,[cs-wait failure (%s)] +en,base,195,[cs-post failure (%s)] +en,base,196,[Unable to create nonblocking socket (%s)] +en,base,197,[error: could not set keepalive (%s)\n] +en,base,198,[error: could not set recv timeout (%s)\n] +en,base,199,[error: could not set send timeout (%s)\n] +en,base,200,[Unable to create nonblocking socket (%s)] +en,base,201,[sem_grab failed (%s)] +en,base,202,[sem_release failed (%s)] +en,base,203,[sem_release failed (%s)] +en,base,204,[Could not remove temporary directory %s, Error %d] +en,base,205,[Could not remove temporary directory %s, Error %d] +en,dsgw,-1,[$DBT: dsgw in DB file v1 $] +en,dsgw,1,[Unknown HTTP request method] +en,dsgw,2,[Invalid or incomplete HTML form data] +en,dsgw,3,[Out of memory] +en,dsgw,4,[Required query/form input is missing] +en,dsgw,5,[Illegal character in file path] +en,dsgw,6,[Bad or missing configuration file] +en,dsgw,7,[Unable to initialize LDAP] +en,dsgw,8,[An error occurred while contacting the LDAP server] +en,dsgw,9,[Unknown search object type] +en,dsgw,10,[Unknown attribute label] +en,dsgw,11,[Unknown match prompt] +en,dsgw,12,[No search filters for object type] +en,dsgw,13,[Unable to open HTML template file] +en,dsgw,14,[Unknown search mode - use "smart", "complex", "pattern", or "auth"] +en,dsgw,15,[Distinguished Name missing in URL] +en,dsgw,16,[Unknown scope in URL (should be base, sub, or one)] +en,dsgw,17,[Unrecognized URL or unknown error] +en,dsgw,18,[Bad URL format] +en,dsgw,19,[Internal error] +en,dsgw,20,[Unable to write template index file] +en,dsgw,21,[Unable to open template index file] +en,dsgw,22,[Unable to read directory] +en,dsgw,23,[LDAP SSL initialization failed (check the security path)] +en,dsgw,24,[For the Users and Groups forms to work over SSL, you or your server administrator needs to activate SSL for this Administration Server. The Encryption|On/Off page can be used to do so ] +en,dsgw,25,[Authentication credentials not found in authentication database] +en,dsgw,26,[Error retrieving data from the authentication database] +en,dsgw,27,[Your authentication credentials have expired] +en,dsgw,28,[Unable to create a random string] +en,dsgw,29,[No distinguished name was provided when retrieving credentials] +en,dsgw,30,[Cannot open authentication database] +en,dsgw,31,[Could not append data to the authentication database] +en,dsgw,32,[No Directory Manager is defined] +en,dsgw,33,[No search string was provided. Please try again] +en,dsgw,34,[Too many arguments on one line in the config. file] +en,dsgw,35,[Failed to initialize Windows Sockets] +en,dsgw,36,[Authentication credentials could not be obtained from the Administration Server] +en,dsgw,37,[Distinguished Name missing in ldapdb:// URL] +en,dsgw,38,[Unrecognized URL or unknown error] +en,dsgw,39,[Bad URL format] +en,dsgw,40,[An error occurred while initializing the local ldap database] +en,dsgw,41,[Unknown directory service type - use "local" or "remote"] +en,dsgw,42,[An error occurred while reading the db configuration file] +en,dsgw,43,[NSHOME/userdb path was NULL] +en,dsgw,44,[The directory service configuration could not be updated.] +en,dsgw,45,[The entry could not be read from the directory.] +en,dsgw,46,[The LDAP database could not be erased.] +en,dsgw,47,[You may not change entries besides your own.] +en,dsgw,48,[Problem] +en,dsgw,49,[Authentication Problem] +en,dsgw,50,[.\n

          You must re-authenticate before continuing.\n] +en,dsgw,51,[.\n

          You must re-authenticate before continuing.\n] +en,dsgw,52,[unknown error] +en,dsgw,53,[The operation was successful.] +en,dsgw,54,[An internal error occurred in the server. This usually\nindicates a serious malfunction in the server and should be\nbrought to the attention of your server administrator.] +en,dsgw,55,[The server could not understand the request which was sent to\nit by the gateway.] +en,dsgw,56,[A time limit was exceeded in responding to your request. If\nyou are searching for entries, you may achieve better results\nif you are more specific in your search.] +en,dsgw,57,[A size limit was exceeded in responding to your request. If\nyou are searching for entries, you may achieve better results\nif you are more specific in your search, because too many entries\nmatched your search criteria.] +en,dsgw,58,[The gateway attempted to authenticate to the server using\na method the server doesn't understand.] +en,dsgw,59,[The gateway attempted to authenticate to the server using an\nauthentication method which the server does not support. ] +en,dsgw,60,[Your request could not be fulfilled, probably because the server\nthat was contacted does not contain the data you are looking\nfor. It is possible that a referral to another server was\nreturned but could not be followed. If you were trying to make\nchanges to the directory, it may be that the server that holds\nthe master copy of the data is not available.] +en,dsgw,61,[Your request exceeded an administrative limit in the server.] +en,dsgw,62,[A critical extension that the gateway requested is not available in this server.] +en,dsgw,63,[The server was unable to process the request, becase the\nrequest referred to an attribute which does not exist in the\nentry.] +en,dsgw,64,[The server was unable to fulfill your request, because the\nrequest violates a constraint.] +en,dsgw,65,[The server could not add a value to the entry, because that\nvalue is already contained in the entry.] +en,dsgw,66,[The server could not locate the entry. If adding a new entry,\nbe sure that the parent of the entry you are trying to add exists.\nIf you received this error while searching, it indicates that the\nentry which was being searched for does not exist.\nIf you were attempting to authenticate as the directory manager and\nreceived this error, check the gateway configuration file.] +en,dsgw,67,[A distinguished name was not in the proper format. ] +en,dsgw,68,[The entry you attempted to authenticate as does not have a\npassword set, or is missing other required authentication\ncredentials. You cannot authenticate as that entry until the\nappropriate attributes have been added by the directory manager. ] +en,dsgw,69,[The password (or other authentication credentials) you supplied\nis incorrect.] +en,dsgw,70,[You do not have sufficient privileges to perform the operation. ] +en,dsgw,71,[The server is too busy to service your request. Try again\nin a few minutes.] +en,dsgw,72,[The LDAP server could not be contacted.] +en,dsgw,73,[The server was unwilliing to process your request. Usually,\nthis indicates that serving your request would put a heavy load\non the server. It may also indicate that the server is not\nconfigured to process your request. If searching, you may wish\nto limit the scope of your search.] +en,dsgw,74,[The directory server could not honor your request because it\nviolates the schema requirements. Typically, this means that you\nhave not provided a value for a required field. It could also mean\nthat the schema in the directory server needs to be updated.] +en,dsgw,75,[The directory server will not allow you to delete or rename\nan entry if that entry has children. If you wish to do this, you\nmust first delete all the child entries.] +en,dsgw,76,[The server was unable to add a new entry, or rename an existing\nentry, because an entry by that name already exists.] +en,dsgw,77,[Your request would affect several directory servers.] +en,dsgw,78,[The directory server could not be contacted. Contact your\nserver administrator for assistance.] +en,dsgw,79,[An error occured while sending data to the server.] +en,dsgw,80,[An error occured while reading data from the server.] +en,dsgw,81,[The server did not respond to the request. \nThe request timed out.] +en,dsgw,82,[The server does not support the authentication method used\nby the gateway.] +en,dsgw,83,[The search filter constructed by the gateway was in error.] +en,dsgw,84,[The operation was cancelled at your request.] +en,dsgw,85,[An internal error occurred in the library - a parameter was\nincorrect.] +en,dsgw,86,[A connection to the server could not be opened. Contact your\nserver administrator for assistance.] +en,dsgw,87,[An unknown error was encountered.] +en,dsgw,88,[Entry Already Exists] +en,dsgw,89,[An entry named ] +en,dsgw,90,[onMouseOver="window.status='Click here to view this entry'; return true"] +en,dsgw,91,[ already exists.

          Please choose another name and/or location.\n

          \n] +en,dsgw,92,[Parent entry does not exist] +en,dsgw,93,[You cannot add an entry by the name:

          %s,

          \nbecause the parent of that entry does not exist.

          \nBefore you can add this entry, you must first add\n] +en,dsgw,94,[its parent.\n] +en,dsgw,95,[an entry named:

          %s.\n] +en,dsgw,96,[Warning: no authentication (continuing)...\n] +en,dsgw,97,[%s Directory Entry] +en,dsgw,98,[

          Entry DN: %s

          \n] +en,dsgw,99,[Changes to %s have been saved.] +en,dsgw,100,[%s has been added.] +en,dsgw,101,[%s has been deleted.] +en,dsgw,102,[Renamed %s to %s.] +en,dsgw,103,[

          Note: because you %s the entry you were \nauthenticated as, it was necessary to discard your \nauthentication credentials. You will need to authenticate \nagain to make additional changes.\n] +en,dsgw,104,[deleted] +en,dsgw,105,[renamed] +en,dsgw,106,[changed the password of] +en,dsgw,107,[Attribute %s was changed
          \n] +en,dsgw,108,[ NOT ASCII (%ld bytes)\n] +en,dsgw,109,[No values were entered. Please try again.\n] +en,dsgw,110,[No changes were made.\n] +en,dsgw,111,[

          Sending %s to the directory server...\n] +en,dsgw,112,[information] +en,dsgw,113,[changes] +en,dsgw,114,[

          Successfully added entry.\n] +en,dsgw,115,[

          Successfully edited entry. Your changes have been saved.\n] +en,dsgw,116,[

          Successfully deleted entry.\n] +en,dsgw,117,[

          The new name for the entry is: %s\n

          \n] +en,dsgw,118,[

          Successfully renamed entry.\n] +en,dsgw,119,[You must provide the old password.] +en,dsgw,120,[You must provide a new password. Please try again] +en,dsgw,121,[The new and confirming passwords do not match. Please try again] +en,dsgw,122,[
          The %s %s is already in use. Please choose a different one.
          \n] +en,dsgw,123,[missing form data element "%.100s"] +en,dsgw,124,[Initializing config info] +en,dsgw,125,[Cannot open file.] +en,dsgw,126,[Malformed dbconf file.] +en,dsgw,127,[Missing property name in dbconf file.] +en,dsgw,128,[Out of memory.] +en,dsgw,129,[Missing directive in dbconf file.] +en,dsgw,130,[Cannot open config file "%s"\n] +en,dsgw,131,[Missing argument for "authlifetime" directive\n] +en,dsgw,132,[Missing argument for "dirmgr" directive\n] +en,dsgw,133,[Missing argument for "baseurl" directive\n] +en,dsgw,134,[Bad URL provided for "baseurl" directive - the base DN is missing\n] +en,dsgw,135,[parsing baseurl directive] +en,dsgw,136,[Bad URL provided for "baseurl" directive - not an "ldap://" URL\n] +en,dsgw,137,["ldaps://" URLs are not yet supported\n] +en,dsgw,138,[Missing arguments for "template" directive\n] +en,dsgw,139,[Missing argument for "sslrequired" directive\n] +en,dsgw,140,[Unknown argument to "sslrequired" directive (should be "never", "whenauthenticated", "always")\n] +en,dsgw,141,[Missing argument for "securitypath" directive\n] +en,dsgw,142,[Missing argument for "location-suffix" directive\n] +en,dsgw,143,[Three arguments are required for the "location" directive\n] +en,dsgw,144,[At least two arguments are required for the "newtype" directive\n] +en,dsgw,145,[Unknown location in "newtype" directive\n] +en,dsgw,146,[Three or four arguments are required for the "tmplset" directive\n] +en,dsgw,147,[Four arguments are required for the "attrvset" directive\n] +en,dsgw,148,[Missing argument for "charset" directive\n] +en,dsgw,149,[Missing argument for "ClientLanguage" directive\n] +en,dsgw,150,[Missing argument for "AdminLanguage" directive\n] +en,dsgw,151,[Missing argument for "DefaultLanguage" directive\n] +en,dsgw,152,[Missing filename for "include" directive\n] +en,dsgw,153,[Unknown directive in config file\n] +en,dsgw,154,[<= erase_db could not open lcache.conf file "%s"\n] +en,dsgw,155,[\n

          The database has been deleted. Creating new database... \n\n ] +en,dsgw,156,[\n

          The database could not be deleted \n\n ] +en,dsgw,157,[<= app_suffix could not open ldif file "%s"\n] +en,dsgw,158,[<= app_suffix could not open tmp file "%s"\n] +en,dsgw,159,[Unable to rename %s to %s] +en,dsgw,160,[null pointer returned by dbconf_read_default_dbinfo().] +en,dsgw,161,[Bad "ldapdb" URL - the base DN is missing\n] +en,dsgw,162,[Bad "ldapdb" URL\n] +en,dsgw,163,[Bad URL provided for "baseurl" directive - the base DN is missing\n] +en,dsgw,164,[parsing baseurl directive] +en,dsgw,165,[Bad URL provided for "baseurl" directive - not an "ldap:// or ldapdb://" URL\n] +en,dsgw,166,["ldaps://" URLs are not yet supported\n] +en,dsgw,167,[No value given for binddn] +en,dsgw,168,[No value given for bindpw] +en,dsgw,169,[There is no default directory service defined in the dbswitch.conf file] +en,dsgw,170,[Cannot open config file "%s" for writing\n] +en,dsgw,171,[Unable to rename %s to %s] +en,dsgw,172,[config file %s: ] +en,dsgw,173,[config file %s: line %d: ] +en,dsgw,174,[max %d] +en,dsgw,175,[ OK ] +en,dsgw,176,[Close Window] +en,dsgw,177,[Go Back] +en,dsgw,178,[{crypt}LOCKED [%s GMT]] +en,dsgw,179,[Return to Main] +en,dsgw,181,[ Help ] +en,dsgw,182,[Help] +en,dsgw,184,[Help is not yet available.] +en,dsgw,186,[Close Window] +en,dsgw,187,[Close Window] +en,dsgw,188,[The URL did not include a template name (immediately following the '?').] +en,dsgw,189,[Authenticate...] +en,dsgw,190,[Discard authentication credentials (log out)?] +en,dsgw,191,[Please type a search string] +en,dsgw,192,[The first step in authenticating to the directory is identifying\nyourself.
          Please type your name:] +en,dsgw,193,[Continue] +en,dsgw,194,[Continue] +en,dsgw,195,[Cancel] +en,dsgw,196,[Authenticate as directory manager">  (only available to Directory Administrators)\n] +en,dsgw,197,[Authenticate...] +en,dsgw,198,[Discard authentication credentials?] +en,dsgw,200,[Continue] +en,dsgw,201,[Continue] +en,dsgw,202,[Cancel] +en,dsgw,203,[Authenticate (log in) to the directory] +en,dsgw,204,[You are about to authenticate to the directory as %s. To complete the authentication process, type your password.\n] +en,dsgw,206,[Before you can edit or add entries, you must authenticate\n(log in) to the directory. This window will guide\nyou through the steps of the authentication\nprocess.\n] +en,dsgw,207,[From this screen you may authenticate, or log in, \nto the directory. You will need to authenticate\nbefore you can modify directory entries. If you\nattempt to modify an entry without authenticating,\nyou will be asked to log in.\n] +en,dsgw,208,[Authentication Status] +en,dsgw,209,[\nYou are currently authenticated to the directory as ] +en,dsgw,210,[.\nIf you wish to discard your authentication credentials and log out of the directory, click on the button below.] +en,dsgw,211,[Discard Authentication Credentials (log out)] +en,dsgw,212,[Your authentication credentials for ] +en,dsgw,213,[have expired.\n


          \n] +en,dsgw,214,[Currently, you are not authenticated to the directory.
          \n] +en,dsgw,215,[missing "%s="] +en,dsgw,216,[unknown "%s=%s"] +en,dsgw,217,[unknown option %s] +en,dsgw,218,[unknown syntax=%s\n] +en,dsgw,219,[** HTML type "%s" not supported **
          \n] +en,dsgw,224,[Edit] +en,dsgw,225,[Save Changes] +en,dsgw,226,[modify] +en,dsgw,227,[add] +en,dsgw,228,[Delete] +en,dsgw,229,[Delete this entry?] +en,dsgw,230,[Rename] +en,dsgw,231,[Enter a new name for this entry:] +en,dsgw,232,[Edit As] +en,dsgw,233,[missing %s=] +en,dsgw,234,[Close Window] +en,dsgw,235,[Edit...] +en,dsgw,236,[missing "%s="\n] +en,dsgw,237,[unknown set "%s"\n] +en,dsgw,238,[unknown syntax "%s"\n] +en,dsgw,239,[Re-Authenticate] +en,dsgw,240,[Close Window] +en,dsgw,241,[Do you really want to %s?] +en,dsgw,242,[width=400,height=130,resizable] +en,dsgw,243,[ OK ] +en,dsgw,244,[ OK ] +en,dsgw,245,[ Reset ] +en,dsgw,246,[ Done ] +en,dsgw,247,[ Cancel ] +en,dsgw,248,[found another IF (nested IFs are not supported)] +en,dsgw,249,[found ELSE but didn't see an IF] +en,dsgw,250,[found ELSE after ELSE (expecting ENDIF)] +en,dsgw,251,[found ELIF but didn't see an IF] +en,dsgw,252,[found ELIF after ELSE (expecting ENDIF)] +en,dsgw,253,[found ENDIF but didn't see an IF] +en,dsgw,254,[
          template error: %s
          \n] +en,dsgw,255,[ldap_init/lcache_init attempted before config file read] +en,dsgw,256,[not running under the administration server] +en,dsgw,257,[Could not initialize permissions] +en,dsgw,258,[Could not map username to a DN (error from admin server)] +en,dsgw,259,[Could not get current username] +en,dsgw,260,[Could not get current user password] +en,dsgw,261,[Error: %s (%i)] +en,dsgw,262,[Note: there is no display template for this type of entry available, so it is\ndisplayed below using a default method.] +en,dsgw,263,[Invalid user id or NULL LDAP handle] +en,dsgw,264,[no match for user id] +en,dsgw,265,[more than one match for user id] +en,dsgw,266,[the entire directory] +en,dsgw,267,[Two arguments are required for the "includeset" directive\n] +en,dsgw,268,[The attribute value requested was not found in the entry] +en,dsgw,269,[Missing argument for "NLS" directive\n] +en,dsgw,270,[A value must be specified for NT User Id\n] +en,dsgw,271,[The combination of NT User Id, NT Domain Id is not unique in the directory\n] +en,dsgw,272,[Values must be specified for both NT User Id and NT Domain Id\n] +en,dsgw,273,[The NT User Id value must not exceed 20 characters in length.\n] +en,dsgw,274,[Please provide a name for the new entry.] +en,dsgw,275,[Please select a location for the new entry.] +en,dsgw,276,[New Entry] +en,dsgw,277,[In order to use this feature, there must be a dirmgr defined in dsgw.conf] +en,dsgw,278,[Three or four arguments are required for the "vcard-property" directive\n] +en,dsgw,279,[VCard property syntax must be "cis" or "mls"\n] +en,dsgw,280,[Found no entries.\n%2$s] +en,dsgw,281,[Found no entries where the %2$s %3$s '%4$s'.\n] +en,dsgw,282,[Searched and found no entries.\n%2$s] +en,dsgw,283,[Searched and found no entries where the %2$s %3$s %4$s'.\n] +en,dsgw,284,[Found 1 entry.\n%2$s] +en,dsgw,285,[Found 1 entry where the %2$s %3$s '%4$s'.\n] +en,dsgw,286,[Searched and found 1 entry.\n%2$s] +en,dsgw,287,[Searched and found 1 entry where the %2$s %3$s '%4$s'.\n] +en,dsgw,288,[Found %1$li entries.\n%2$s] +en,dsgw,289,[Found %1$li entries where the %2$s %3$s '%4$s'.\n] +en,dsgw,290,[Searched and found %1$li entries.\n%2$s] +en,dsgw,291,[Searched and found %1$li entries where the %2$s %3$s '%4$s'.\n] +en,dsgw,292,[the LDAP filter is] +en,dsgw,293,[The server could not locate the entry you used when you authenticated. It is possible that someone renamed the entry or that is was deleted. Please try to authenticate again.] +en,dsgw,294,[The new password syntax is invalid.\n] +en,dsgw,295,[The new password occurs in the password history.\n] +en,dsgw,296,[You've exceeded the password retry limit. Please contact your System Administrator.\n] +en,dsgw,297,[You've exceeded the password retry limit. Please try again later.\n] +en,dsgw,298,[The password has expired. Contact your System Administrator to reset the password.\n] +en,dsgw,299,[Editing] +en,dsgw,300,[Adding] +en,dsgw,301,[Deleting] +en,dsgw,302,[Renaming] +en,dsgw,303,[There are no names in the list.] +en,dsgw,304,[There is 1 name in the list.] +en,dsgw,305,[There are %s names in the list.] +en,dsgw,306,[Remove\\nfrom\\nlist? Name] +en,dsgw,307,[Discard Changes?] +en,dsgw,308,[width=300,height=130,resizable] +en,dsgw,309,[Continue without saving changes?
          Unsaved changes will be lost.] +en,dsgw,310,[width=400,height=150,resizable] +en,dsgw,311,[Alert] +en,dsgw,312,[Confirm] +en,dsgw,313,[Authentication Failed\n] +en,dsgw,314,[Authentication Successful] +en,dsgw,315,[You are now authenticated to the directory as %s.] +en,dsgw,316,[Your authentication credentials will expire in %d minutes.\n] +en,dsgw,317,[After your credentials expire, you will need to \nre-authenticate to the directory.\n] +en,dsgw,318,[

          The password for this entry will expire %s.\n] +en,dsgw,319,[Authentication failed because] +en,dsgw,320,[Authentication failed because the entry you attempted to authenticate as does\nnot exist in the directory.\nYou may only authenticate as an existing directory\nentry.\n] +en,dsgw,321,[Authentication failed because the entry you attempted to authenticate as does\nnot have a password. Before you can authenticate\nas this entry, a password must be set by a\ndirectory administrator\n] +en,dsgw,322,[Authentication failed because the password you supplied is incorrect. Please\nclick the Retry button and try again. If you have\nforgotten the password for this entry, a directory\nadministrator must reset the password for you.\n] +en,dsgw,323,[Authentication failed because of an unexpected error: %s\n] +en,dsgw,324,[Retry] +en,dsgw,325,[To continue, select a task from the list above.\n] +en,dsgw,326,[Edit Password] +en,dsgw,327,[

          Password Expired for %s

          \n] +en,dsgw,328,[Your Directory Server password has expired.] +en,dsgw,329,[ You must change your password immediately.\n] +en,dsgw,330,[you did not provide a password. Whenever you authenticate, you must provide a password so that the server can verify your identity.] +en,dsgw,331,[the server was unable to generate authentication credentials. The authentication database could not be opened.] +en,dsgw,332,[the server was unable to generate authentication credentials. Data could not be appended to the authentication database.] +en,dsgw,333,[Continue] +en,dsgw,334,[Close Window] +en,dsgw,335,[Success] +en,dsgw,336,[Your authentication credentials have been destroyed. You are no longer authenticated to the \ndirectory.\n] +en,dsgw,337,[Go Back] +en,dsgw,338,[Success] +en,dsgw,339,[Operations error] +en,dsgw,340,[Protocol error] +en,dsgw,341,[Warning: a time limit was exceeded. Not all matching entries are shown.] +en,dsgw,342,[Warning: a size limit was exceeded. Not all matching entries are shown.] +en,dsgw,343,[Compare false] +en,dsgw,344,[Compare true] +en,dsgw,345,[Strong authentication not supported] +en,dsgw,346,[Strong authentication required] +en,dsgw,347,[Warning: some directory servers could not be contacted. Not all matching entries are shown.] +en,dsgw,348,[Referral received] +en,dsgw,349,[Administrative limit exceeded] +en,dsgw,350,[Unavailable critical extension] +en,dsgw,351,[Confidentiality required] +en,dsgw,352,[SASL bind in progress] +en,dsgw,353,[No such attribute] +en,dsgw,354,[Undefined attribute type] +en,dsgw,355,[Inappropriate matching] +en,dsgw,356,[Constraint violation] +en,dsgw,357,[Type or value exists] +en,dsgw,358,[Invalid syntax] +en,dsgw,359,[No such object] +en,dsgw,360,[Alias problem] +en,dsgw,361,[Invalid DN syntax] +en,dsgw,362,[Object is a leaf] +en,dsgw,363,[Alias dereferencing problem] +en,dsgw,364,[Inappropriate authentication] +en,dsgw,365,[Invalid credentials] +en,dsgw,366,[Insufficient access] +en,dsgw,367,[DSA is busy] +en,dsgw,368,[DSA is unavailable] +en,dsgw,369,[DSA is unwilling to perform] +en,dsgw,370,[Loop detected] +en,dsgw,371,[Naming violation] +en,dsgw,372,[Object class violation] +en,dsgw,373,[Operation not allowed on nonleaf] +en,dsgw,374,[Operation not allowed on RDN] +en,dsgw,375,[Already exists] +en,dsgw,376,[Cannot modify object class] +en,dsgw,377,[Results too large] +en,dsgw,378,[Affects multiple servers] +en,dsgw,379,[Unknown error] +en,dsgw,380,[Can't contact LDAP server] +en,dsgw,381,[Local error] +en,dsgw,382,[Encoding error] +en,dsgw,383,[Decoding error] +en,dsgw,384,[Timed out] +en,dsgw,385,[Unknown authentication method] +en,dsgw,386,[Bad search filter] +en,dsgw,387,[User cancelled operation] +en,dsgw,388,[Bad parameter to an ldap routine] +en,dsgw,389,[Out of memory] +en,dsgw,390,[Can't connect to the LDAP server] +en,dsgw,391,[Not supported by this version of the LDAP protocol] +en,dsgw,392,[Requested LDAP control not found] +en,dsgw,393,[No results returned] +en,dsgw,394,[More results to return] +en,dsgw,395,[Client detected loop] +en,dsgw,396,[Referral hop limit exceeded] +en,frame,-1,[$DBT: frame in DB file v1 $] +en,frame,1,[Not Found

          Not Found

          The requested object does not exist on this server. The link you followed is either outdated, inaccurate, or the server has been instructed not to let you have it. ] +en,frame,2,[Please inform the site administrator of the referring page.] +en,frame,3,[Your browser sent a request that this proxy could not understand.] +en,frame,4,[Proper authorization is required for the administration of this proxy.\nEither your browser does not perform authorization, or your authorization\nhas failed.] +en,frame,5,[Username authentication is required for using this proxy.\nEither your browser does not perform proxy authorization, or your\nauthorization has failed.] +en,frame,6,[The proxy's access control configuration denies access to\nthe requested object through this proxy.] +en,frame,7,[The proxy has encountered an internal error which prevents it from\nfulfilling your request. The most likely cause is a misconfiguration.\nPlease ask the administrator to look for messages in the proxy's error log.] +en,frame,8,[This proxy server does not implement the requested method.] +en,frame,9,[An error has occurred on the proxy server.] +en,frame,10,[Your browser sent a query this server could not understand.] +en,frame,11,[Proper authorization is required for this area. Either your browser does not perform authorization, or your authorization has failed.] +en,frame,12,[Your client is not allowed to access the requested object.] +en,frame,13,[This server has encountered an internal error which prevents it from fulfilling your request. The most likely cause is a misconfiguration. Please ask the administrator to look for messages in the server's error log.] +en,frame,14,[This server does not implement the requested method.] +en,frame,15,[An error has occurred.] +en,frame,16,[Your browser sent a message this server could not understand.] +en,frame,17,[%s

          %s

          \nThis document has moved to a new location. Please update your documents and hotlists accordingly.] +en,frame,18,[%s\n

          %s

          \n%s\n] +en,frame,19,[process-uri-objects] +en,frame,20,[cannot find template %s] +en,frame,21,[process-uri-objects] +en,frame,22,[no partial path after object processing] +en,frame,23,[find-service] +en,frame,24,[invalid shexp %s] +en,frame,25,[find-service] +en,frame,26,[invalid shexp %s] +en,frame,27,[handle-processed] +en,frame,28,[no way to service request for %s] +en,frame,29,[finish-socks-request] +en,frame,30,[close failed (%s), csd=%d] +en,frame,31,[This beta software has expired.\n] +en,frame,32,[mr_accept(%d)] +en,frame,33,[Error issuing read on accept socket] +en,frame,34,[acb_accept_connection(%d)] +en,frame,35,[Error getting accept socket (%d)] +en,frame,36,[Error in accept! (%d, %s)] +en,frame,37,[Error creating new accept request] +en,frame,38,[accepted connection: %d (NSPR %d)] +en,frame,39,[Error creating new session structure] +en,frame,40,[accel_read_request()] +en,frame,41,[Error allocating request read buffer] +en,frame,42,[Error issuing async read request] +en,frame,43,[acb_read_request(%d, bytes %d)] +en,frame,44,[acb_read_req(1 session = %d)] +en,frame,45,[Error reading request (%d, %s)] +en,frame,46,[Client aborted connection] +en,frame,47,[Error reading request] +en,frame,48,[Error creating new request] +en,frame,49,[error occurred, closing %d, io was for %d] +en,frame,50,[accel_async_scan_headers()] +en,frame,51,[out of memory: accel_async_scan_headers] +en,frame,52,[out of memory: accel_async_scan_headers] +en,frame,53,[Error during async read (%d, %s)] +en,frame,54,[scan-headers reports: line too long] +en,frame,55,[scan-headers reports: too many headers] +en,frame,56,[Error reading headers] +en,frame,57,[scan-headers reports: header missing terminator (an empty line)] +en,frame,58,[scan-headers reports: header was empty] +en,frame,59,[name without value: got line "%s"] +en,frame,60,[accel_send_plain_file()] +en,frame,61,[accel_send_plain_file() - found request %d] +en,frame,62,[Parse headers lost the URI!] +en,frame,63,[accel_send_plain_file() - found uri %s] +en,frame,64,[accel_send_plain_file() - found in cache?] +en,frame,65,[malloc died!] +en,frame,66,[Error writing back file\n] +en,frame,67,[acb_send_plain_file(%d)] +en,frame,68,[Error writing in acb_send_plain_file (%d, %s)] +en,frame,69,[acb_close_connection(%d)] +en,frame,70,[Errored IO in acb_close_connection (%d, %s)] +en,frame,71,[Unable to close socket %d] +en,frame,72,[accel-cache-insert: Error allocating entry] +en,frame,73,[cache-init: server cache disabled] +en,frame,74,[accel_file_cache: Error initializing file cache] +en,frame,75,[accel_file_cache: Error creating cache] +en,frame,76,[accel_file_cache_init: CacheHashSize < %d, using %d] +en,frame,77,[accel_file_cache_init: CacheHashSize > %d, using %d] +en,frame,78,[accel_file_cache_init: MaxNumberOfCachedFiles < %d, using %d] +en,frame,79,[accel_file_cache_init: MaxNumberOfCachedFiles > %d, using %d] +en,frame,80,[accel_file_cache_init: MaxNumberOfOpenCachedFiles < %d, using %d] +en,frame,81,[accel_file_cache_init: MaxNumberOfOpenCachedFiles > %d, using %d] +en,frame,82,[accel_file_cache: Error initializing file cache] +en,frame,83,[file-cache: enabled = %s ] +en,frame,84,[on] +en,frame,85,[off] +en,frame,86,[file-cache: MaxNumberOfCachedFiles %d (0x%x)] +en,frame,87,[file-cache: CacheHashSize %d (0x%x)] +en,frame,88,[file-cache: MaxNumberOfOpenCachedFiles %d (0x%x)] +en,frame,89,[accel-cache-insert: Error allocating entry] +en,frame,90,[file-cache-cleanup: munmap failed (%s)] +en,frame,91,[file-cache-cleanup: found mmapped file \non system without mmap] +en,frame,92,[file_cache_init: MaxTotalCachedFileSize < %d, using %d] +en,frame,93,[file_cache_init: MaxTotalCachedFileSize > %d, using %d] +en,frame,94,[file cache using mmap flags 0x%x] +en,frame,95,[file cache using mmap prots 0x%x] +en,frame,96,[file-cache-init: could not create lock] +en,frame,97,[file-cache: unable to create temporary directory %s.\n] +en,frame,98,[file-cache: unable to create temporary directory %s.\n] +en,frame,99,[file-cache: GetTempPath() Cannot find temp directory to store file!] +en,frame,100,[file-cache-init: set max cached file size to %d] +en,frame,101,[file-cache-init: could not create lock] +en,frame,102,[file_cache_destroy()] +en,frame,103,[file-cache: Unable to get temp file name. Error %s] +en,frame,104,[file-cache: Unable to get temp file name. Error %s] +en,frame,105,[file-cache-insert: Error allocating entry] +en,frame,106,[file-cache-create: Error opening file %s (%s)] +en,frame,107,[file-cache-create: Error stat()ing file %s (%s)] +en,frame,108,[file-cache-create: Error mmap()ing file %s (%s)] +en,frame,109,[file-cache-create: malloc failure] +en,frame,110,[file-cache-create: error case failed to munmap(%d, %d) (%s)] +en,frame,111,[file-cache-valid: cannot stat %s] +en,frame,112,[dir change: invalidating %s (%d)] +en,frame,113,[file-cache: asynchronous file change notification failed.] +en,frame,114,[dir change: offset %d, action %d, len %d, name %s] +en,frame,115,[unable to check async file status] +en,frame,116,[ReadDirectoryChangesW failure- unable to continue watching %s. Error is %s] +en,frame,117,[file-cache-add-watch failure- unable to open directory %s. Error %s] +en,frame,118,[ReadDirectoryChangesW failure- unable to start watching %s. Error %s] +en,frame,119,[func_exec] +en,frame,120,[no handler function given for directive] +en,frame,121,[func_exec] +en,frame,122,[cannot find function named %s] +en,frame,123,[handle-request] +en,frame,124,[method without URI] +en,frame,125,[http-parse-request] +en,frame,126,[while scanning HTTP headers, %s] +en,frame,127,[handle-request] +en,frame,128,[read from %s failed, error is %s] +en,frame,129,[handle-request] +en,frame,130,[request too long] +en,frame,131,[start-http-response] +en,frame,132,[write failed (%s)] +en,frame,133,[start-http-response] +en,frame,134,[write failed (%s)] +en,frame,135,[http-status] +en,frame,136,[%d is not a valid HTTP status code] +en,frame,137,[finish-request] +en,frame,138,[close failed (%s)] +en,frame,139,[Unable to close socket for writing] +en,frame,140,[os has %d objects] +en,frame,141,[obj %d has no hash table at %d] +en,frame,142,[obj %d has no param] +en,frame,143,[obj %d name %s value %s] +en,frame,144,[.....directives %d.......] +en,frame,145,[.....directive %d] +en,frame,146,[.......instance %d] +en,frame,147,[...........param name %s value %s] +en,frame,148,[ClearConfigurationParameters:RegCreateKey %s] +en,frame,149,[ClearConfigurationParameters:RegEnumKey %s failed] +en,frame,150,[obj.conf line %d: error in filter file "%s" at line %d: %s] +en,frame,151,[obj.conf line %d: error in filter file "%s" at line %d: %s] +en,frame,152,[Unable to allocate Subject property list.\n] +en,frame,153,[Unable to set session ptr in Subject property list - error=%d\n] +en,frame,154,[Unable to set request ptr in Subject property list - error=%d\n] +en,frame,155,[file-cache-valid: cannot stat %s] +en,frame,156,[file-cache-create: Error stat()ing file %s (%s)] +en,httpdaemon,-1,[$DBT: httpdaemon in DB file v1 $] +en,httpdaemon,1,[Error in ConvertThreadToFiber] +en,httpdaemon,2,[Error in ConvertThreadToFiber] +en,httpdaemon,3,[Error in md_start_system] +en,httpdaemon,4,[Error in CreateFiber - idlefiber] +en,httpdaemon,5,[Error in GetQueuedCompletionStatus] +en,httpdaemon,6,[Error creating completion port] +en,httpdaemon,7,[Could not SetHandleNonInheritable (%s)] +en,httpdaemon,8,[Error accept/read new conn] +en,httpdaemon,9,[Error in Respond()] +en,httpdaemon,10,[Error in RespondCompleted()] +en,httpdaemon,11,[daemon: unable to fork new process (%s)\n] +en,httpdaemon,12,[daemon: setsid failed (%s)\n] +en,httpdaemon,13,[daemon: can't log pid to %s (%s)\n] +en,httpdaemon,14,[warning: could not set group id to %d (%s)\n] +en,httpdaemon,15,[warning: could not set user id to %d (%s)\n] +en,httpdaemon,16,[warning: daemon is running as super-user\n] +en,httpdaemon,17,[could not determine current user name\n] +en,httpdaemon,18,[error: chroot to %s failed (%s)\n] +en,httpdaemon,19,[WARNING! netscape executable and library have different versions.\n] +en,httpdaemon,20,[startup: listening to %s://%s, port %d as %s\n] +en,httpdaemon,21,[startup: listening to %s://%s, port %d as %s\n] +en,httpdaemon,22,[seminit failed (%s)\n] +en,httpdaemon,23,[Using single threaded accepts.] +en,httpdaemon,24,[Using multi threaded accepts.] +en,httpdaemon,25,[Using partial single threaded accepts.] +en,httpdaemon,26,[This machine has %d processors.] +en,httpdaemon,27,[Error calling thr_seconcurrency(%d)- (%s)] +en,httpdaemon,28,[Set conncurrency to %d.] +en,httpdaemon,29,[can't fork new process (%s)] +en,httpdaemon,30,[This beta software has expired.\n] +en,httpdaemon,31,[can't create IPC pipe (%s)] +en,httpdaemon,32,[write to wakeup pipe failed (%s)] +en,httpdaemon,33,[select thread miss] +en,httpdaemon,34,[startup failure: could not bind to port %d (%s)\n] +en,httpdaemon,35,[startup failure: could not bind to port %d, IP address %s (%s)\n] +en,libaccess,-1,[$DBT: libaccess in DB file v1 $] +en,libaccess,1,[basic-ncsa] +en,libaccess,2,[cannot open database %s] +en,libaccess,3,[basic-ncsa] +en,libaccess,4,[user %s password did not match database %s] +en,libaccess,5,[basic-ncsa] +en,libaccess,6,[cannot open connection to LDAP server on %s:%d] +en,libaccess,7,[basic-ncsa] +en,libaccess,8,[user %s password did not match LDAP on %s:%d] +en,libaccess,9,[acl-state] +en,libaccess,10,[missing realm] +en,libaccess,11,[Unable to allocate ACL List Hash\n] +en,libaccess,12,[ACLEvalBuildContext unable to PERM_MALLOC cache structure\n] +en,libaccess,13,[ACLEvalBuildContext unable to create hash table\n] +en,libaccess,14,[ACLEvalBuildContext unable to allocate ACE Entry\n] +en,libaccess,15,[ACLEvalBuildContext unable to allocate ACE entry\n] +en,libaccess,16,[ACLEvalBuildContext unable to allocate Boundary Entry\n] +en,libaccess,17,[ACLEvalBuildContext failed.\n] +en,libaccess,18,[ACL_EvalTestRights: an interim, absolute non-allow value was encountered. right=%s, value=%d\n] +en,libaccess,19,[LASDnsBuild unable to allocate hash table header\n] +en,libaccess,20,[LASDnsBuild unable to add key %s\n] +en,libaccess,21,[LASDnsBuild unable to add key %s\n] +en,libaccess,22,[LASDnsBuild unable to add key %s\n] +en,libaccess,23,[LASDnsBuild unable to add key %s\n] +en,libaccess,24,[LASDnsBuild unable to add key %s\n] +en,libaccess,25,[LAS DNS build received request for attribute %s\n] +en,libaccess,26,[LASDnsEval - illegal comparator %s\n] +en,libaccess,27,[LASDnsEval unable to allocate Context struct\n\n] +en,libaccess,28,[LASDnsEval unable to get session address %d\n] +en,libaccess,29,[LASDnsEval unable to get DNS - error=%s\n] +en,libaccess,30,[LAS Group Eval received request for attribute %s\n] +en,libaccess,31,[LASGroupEval - illegal comparator %s\n] +en,libaccess,32,[LASGroupEval - ran out of memory\n] +en,libaccess,33,[LASGroupEval unable to get session address %d\n] +en,libaccess,34,[LASGroupEval unable to get session address %d\n] +en,libaccess,35,[LASGroupEval - couldn't locate getter for auth-user\n] +en,libaccess,36,[LASGroupEval - Attribute getter for auth-user failed\n] +en,libaccess,37,[LASGroupEval - Attribute getter didn't set auth-user\n] +en,libaccess,38,[Check group membership of user "%s" for group "%s"\n] +en,libaccess,39,[LDAPU_SUCCESS for group "%s"\n] +en,libaccess,40,[LDAPU_FAILED for group "%s"\n] +en,libaccess,41,[LAS_EVAL_FALSE\n] +en,libaccess,42,[LAS_EVAL_TRUE\n] +en,libaccess,43,[LASIpTreeAlloc - no memory\n] +en,libaccess,44,[IP LAS unable to allocate tree node\n] +en,libaccess,45,[IP LAS unable to allocate tree node\n] +en,libaccess,46,[LAS IP build received request for attribute %s\n] +en,libaccess,47,[LASIpEval - illegal comparator %s\n] +en,libaccess,48,[LASIpEval unable to get session address - error=%s\n] +en,libaccess,49,[LASIpEval unable to allocate Context struct\n\n] +en,libaccess,50,[LASIpEval - reach 32 bits without conclusion value=%s] +en,libaccess,51,[LAS Program Eval received request for attribute %s\n] +en,libaccess,52,[LASProgramEval - illegal comparator %s\n] +en,libaccess,53,[LASProgram unable to get session address %d\n] +en,libaccess,54,[bin] +en,libaccess,55,[LASProgramEval: request not of type admin or bin, passing.\n] +en,libaccess,56,[LASProgramEval: check if program %s matches pattern %s.\n] +en,libaccess,57,[LASProgramEval: Invalid wildcard expression %s.\n] +en,libaccess,58,[LAS_EVAL_FALSE\n] +en,libaccess,59,[LAS_EVAL_TRUE\n] +en,libaccess,60,[Unexpected attribute in dayOfWeek - %s\n] +en,libaccess,61,[Illegal comparator for dayOfWeek - %s\n] +en,libaccess,62,[Unexpected attribute in timeOfDay - %s\n] +en,libaccess,63,[LAS User Eval received request for attribute %s\n] +en,libaccess,64,[LASUserEval - illegal comparator %s\n] +en,libaccess,65,[LASUserEval - ran out of memory\n] +en,libaccess,66,[LASUserEval unable to get session address %d\n] +en,libaccess,67,[LASUserEval unable to get session address %d\n] +en,libaccess,68,[LASGroupEval - couldn't locate getter for auth-user\n] +en,libaccess,69,[LASGroupEval - Attribute getter for auth-user failed\n] +en,libaccess,70,[LASGroupEval - Attribute getter didn't set auth-user\n] +en,libaccess,71,[Check if uid == user (i.e. check "%s" == "%s)"\n] +en,libaccess,72,[SUCCESS for user "%s"\n] +en,libaccess,73,[FAILED for user "%s"\n] +en,libaccess,74,[LAS_EVAL_FALSE\n] +en,libaccess,75,[LAS_EVAL_TRUE\n] +en,libaccess,76,[] +en,libaccess,77,[LASProgram unable to get request address - error=%s] +en,libaccess,78,[LASProgram rejecting request for program %s from pattern %s] +en,libaccess,79,[ACL_CacheFlush: unable to parse file "%s"\n] +en,libaccess,80,[ACL_CacheFlush: unable to concatenate ACL list "%s"\n] +en,libaccess,81,[ACL_CacheFlush: unable to open and process the magnus file "%s"\n] +en,libaccess,82,[Illegal comparator for timeOfDay - %s\n] +en,libaccess,83,[ACL_EvalBuildContext unable to create hash table\n] +en,libaccess,84,[ACL_EvalBuildContext unable to PERM_CALLOC cache structure\n] +en,libaccess,85,[ACL_EvalBuildContext unable to allocate ACE entry\n] +en,libaccess,86,[ACL_EvalBuildContext unable to allocate auth pointer array\n] +en,libaccess,87,[ACL_EvalBuildContext unable to allocate auth plist\n] +en,libaccess,88,[ACL_EvalTestRights: an interim, absolute non-allow value was encountered. right=%s, value=%s\n] +en,libaccess,89,[ACL_INTEvalTestRights: call to ACL_EvalBuildContext returned failure status\n] +en,libaccess,90,[ACL_ModuleRegister: module name is missing\n] +en,libaccess,91,[ACL_ModuleRegister: call to module init function returned a failed status\n] +en,libaccess,92,[ACL_GetAttribute: couldn't determine method for %s\n] +en,libaccess,93,[ACL_GetAttribute: couldn't locate getter for %s] +en,libaccess,94,[ACL_GetAttribute: attr getter failed to get %s] +en,libaccess,95,[ACL_GetAttribute: attr getter failed to get %s] +en,libaccess,96,[ACL_GetAttribute: All attribute getters declined for attr %s] +en,libaccess,97,[ACL_DatabaseRegister: dbtype for database "%s" is not defined yet!] +en,libaccess,98,[ACL_DatabaseRegister: database name is missing] +en,libaccess,99,[Error reading the DB Map File: %s. Reason: %s] +en,libaccess,100,[URL is missing for database %s] +en,libaccess,101,[Invalid property value pair for database %s] +en,libaccess,102,["default" database must be an LDAP database] +en,libaccess,103,[Multiple "default" databases are being registered] +en,libaccess,104,["default" LDAP database must be registered] +en,libaccess,105,[LASGroupEval unable to get database name - error= %s] +en,libaccess,106,[received invalid program expression %s] +en,libaccess,107,[parse_ldap_url: database url is missing] +en,libaccess,108,[parse_ldap_url: database name is missing] +en,libaccess,109,[parse_ldap_url: error in parsing ldap url. Reason: %s] +en,libaccess,110,[ldap password check: unable to get database name - error=%s] +en,libaccess,111,[ldap password check: unable to get parsed database %s] +en,libaccess,112,[ldap password check: couldn't initialize connection to LDAP. Reason: %s] +en,libaccess,113,[ldap password check: LDAP error: "%s"] +en,libaccess,114,[get_user_ismember_ldap unable to get database name - error=%s] +en,libaccess,115,[get_user_ismember_ldap unable to get parsed database %s] +en,libaccess,116,[ldap password check: couldn't initialize connection to LDAP. Reason: %s] +en,libaccess,117,[get_user_ismember_ldap: group %s does not exist] +en,libaccess,118,[get_user_ismember_ldap: LDAP error: "%s"] +en,libaccess,119,[ACL_LDAPDatabaseHandle: %s is not a registered database] +en,libaccess,120,[ACL_LDAPDatabaseHandle: %s is not an LDAP database] +en,libaccess,121,[ACL_LDAPDatabaseHandle: out of memory] +en,libaccess,122,[ACL_LDAPDatabaseHandle: couldn't initialize connection to LDAP. Reason: %s] +en,libaccess,123,[ACL_LDAPDatabaseHandle: couldn't bind to LDAP server. Reason: %s] +en,libaccess,124,[insufficient dynamic memory] +en,libaccess,125,[error opening file, %s: %s] +en,libaccess,126,[duplicate definition of %s] +en,libaccess,127,[file %s, line %s: duplicate definition of %s] +en,libaccess,128,[file %s, line %s: syntax error] +en,libaccess,129,[file %s, line %s: %s is undefined] +en,libaccess,130,[in acl %s, %s %s is undefined] +en,libaccess,131,[database %s: error accessing %s] +en,libaccess,132,[%s] +en,libaccess,133,[file %s, line %s: invalid syntax] +en,libaccess,134,[file %s, line %s: syntax error at "%s"] +en,libaccess,135,[realm %s is not defined] +en,libaccess,136,[error code = %d] +en,libaccess,137,[internal ACL error] +en,libaccess,138,[invalid argument] +en,libaccess,139,[ACL_DatabaseRegister: dbtype for database "%s" is not defined yet!] +en,libaccess,140,[couldn't determine dbtype from: %s] +en,libaccess,141,[Failed to register database %s] +en,libaccess,142,[ACL call returned failed status] +en,libaccess,143,[file %s: ACL IO error - %s] +en,libaccess,144,[acl_user_exists: out of memory] +en,libaccess,145,[acl_user_exists: user doesn't exist anymore] +en,libaccess,146,[acl_user_exists: plist error] +en,libadmin,-1,[$DBT: libadmin in DB file v1 $] +en,libadmin,1,[ Help ] +en,libadmin,2,[ OK ] +en,libadmin,3,[ Reset ] +en,libadmin,4,[ Done ] +en,libadmin,5,[ Cancel ] +en,libir,-1,[$DBT: libadmin in DB file v1 $] +en,libir,1,[An I/O error occurred before all form data could be read.] diff --git a/l10n/dirserv/es/ns-slapd.txt b/l10n/dirserv/es/ns-slapd.txt new file mode 100644 index 00000000..c7b2bb87 --- /dev/null +++ b/l10n/dirserv/es/ns-slapd.txt @@ -0,0 +1,889 @@ +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +/**************************************************************************/ +/* The copyright notice(s) in this Source Code does not indicate actual */ +/* or intended publication of this Source Code. */ +/**************************************************************************/ + +/* This text file was generated by program dblink */ + +$Revision: 1.1 $ +$Log: ns-slapd.txt,v $ +Revision 1.1 2005/01/21 00:40:48 cvsadm +Initial revision + +Revision 1.2.4.5 2003/09/22 19:36:41 ulfw +Update copyright years from 2001 to 2001-2003 + +Revision 1.2.4.4 2001/11/03 01:06:19 richm +XXX use new copyright XXX + +Revision 1.2.4.3 2001/09/20 16:39:14 richm +removed 8 bit copyright character + +Revision 1.2.4.3 2001/09/18 11:48:16 rmarco +Remove copyright caracter from copyright + +Revision 1.2.4.2 2001/02/13 09:59:53 rmarco +Copyrights + +Revision 1.2.4.1 1998/10/10 02:14:04 ggood +Copy from Directory40RtmBranchpoint to DirectoryBranch + +Revision 1.1.2.1 1997/12/24 01:18:23 werudge +UTF8 Encoded from es/ns-slapd.txt.iso8859 : 1.1.2.1 +Based on en/ns-slapd.txt : 1.1.2.3 + +Revision 1.1.2.1 1997/12/24 01:14:39 werudge +Based on en/ns-slapd.txt : 1.1.2.3 +daily 971113.1 SOLARIS-export-optimize-normal-slapd +$EndLog$ + +$StartStringData$ + +es,base,-1,[$DBT: base in DB file v1 $] +es,base,1,[no hay memoria suficiente para crear la tabla de totales de control] +es,base,2,[no hay memoria suficiente para crear la tabla de totales de control] +es,base,3,[cache_destroy: las tablas caché parecen dañadas.] +es,base,4,[no ha sido posible asignar la entrada de total de control] +es,base,5,[cache_insert: no ha sido posible crear la entrada caché] +es,base,6,[HTTP/1.0 200 OK\nContent-type: text/html\n\n] +es,base,7,[

          Informe de estado de caché de Netscape

          \n] +es,base,8,[El sistema no tiene cachés

          ] +es,base,9,[

          Caché %s

          \n] +es,base,10,[Índice de aciertos de caché: %d/%d (%f)

          \n

          \n] +es,base,11,[Tamaño de caché: %d/%d

          \n

          \n] +es,base,12,[Tamaño de la tabla de totales de control: %d

          \n

          \n] +es,base,13,[mru : %d

          \nlru : %d

          \n] +es,base,14,[
            Bucket Address Key Access Count Delete Next LRU MRU Data
            \n] +es,base,15,[munmap failed (%s)] +es,base,16,[munmap failed (%s)] +es,base,17,[close failed (%s)] +es,base,18,[daemon: unable to fork new process (%s)\n] +es,base,19,[daemon: setsid failed (%s)\n] +es,base,20,[daemon: can't log pid to %s (%s)\n] +es,base,21,[warning: could not set group id to %d (%s)\n] +es,base,22,[warning: could not set user id to %d (%s)\n] +es,base,23,[warning: daemon is running as super-user\n] +es,base,24,[could not determine current user name\n] +es,base,25,[error: chroot to %s failed (%s)\n] +es,base,27,[, address %s] +es,base,28,[warning: statistics disabled (%s)\n] +es,base,29,[security handshake timed out for pid %d] +es,base,30,[warning: statistics disabled (%s)\n] +es,base,31,[secure handshake failed (code %d)\n] +es,base,32,[accept failed (%s)] +es,base,33,[warning: statistics disabled (%s)\n] +es,base,34,[select thread miss] +es,base,35,[keepalive worker awoken with no work to do] +es,base,36,[could not create new thread: %d (%s)] +es,base,37,[wait for sema succeeded, but nothing to dequeue] +es,base,38,[queue-sema creation failure] +es,base,39,[error getting processor info for processor %d] +es,base,40,[Error binding to processor %d] +es,base,41,[bound process %d to processor %d] +es,base,42,[Netscape server is not explicitly binding to any processors.] +es,base,43,[cache monitor exited] +es,base,44,[cache batch update daemon exited] +es,base,45,[Using single threaded accepts.] +es,base,46,[Using multi threaded accepts.] +es,base,47,[Using partial single threaded accepts.] +es,base,48,[This machine has %d processors.] +es,base,49,[Error calling thr_seconcurrency(%d)- (%s)] +es,base,50,[Set conncurrency to %d.] +es,base,51,[WARNING! netscape executable and library have different versions.\n] +es,base,54,[seminit failed (%s)\n] +es,base,55,[This beta software has expired.\n] +es,base,56,[Cache monitor respawned] +es,base,57,[Cache batch update daemon respawned] +es,base,58,[can't find empty statistics slot] +es,base,59,[can't fork new process (%s)] +es,base,60,[assert failed! %s\n] +es,base,61,[mr_table_init()] +es,base,62,[malloc failed] +es,base,63,[malloc failed!] +es,base,64,[mr_add_io(%d, type %d, file %d)] +es,base,65,[mr_add_io - stage 1] +es,base,66,[mr_add_io - stage 2] +es,base,67,[mr_add_io found invalid IO type %d] +es,base,68,[mr_add_io - adding timeout] +es,base,69,[Out of memory!\n] +es,base,70,[done with mr_add_io] +es,base,71,[mr_del_io(%d, type %d, file %d)] +es,base,72,[mr_del_io found invalid IO type %d] +es,base,73,[mr_lookup_io(%d)] +es,base,74,[mr_async_io(%d, %d bytes, file %d)] +es,base,75,[malloc failure adding async IO] +es,base,76,[Error adding async io!] +es,base,77,[Cannot seek for read!] +es,base,78,[read failure! (%d, %s)] +es,base,79,[do_read read %d bytes for file %d] +es,base,80,[Cannot seek for write!] +es,base,81,[writev failure! (%d, %s)] +es,base,82,[write failure! (%d, %s)] +es,base,83,[do_write wrote %d bytes for file %d] +es,base,84,[do_timeout(mrp %d)] +es,base,85,[do_timeout: found IO (timer=%d, time=%d)] +es,base,86,[error deleting io] +es,base,87,[timeout callback failure for %d\n] +es,base,88,[mr_get_event(%d) - outstanding io %d] +es,base,89,[mr_get_event: Waiting for reads on FD:] +es,base,90,[mr_get_event: Waiting for writes on FD:] +es,base,91,[ %d] +es,base,92,[ %d] +es,base,93,[mr_get_event set no timeout] +es,base,94,[mr_get_event set timeout to: %d.%d sec] +es,base,95,[error in select (%d, %s)] +es,base,96,[mr_get_event() - select found %d] +es,base,97,[error looking up IO fd %d] +es,base,98,[read failed for fd %d] +es,base,99,[error deleting io] +es,base,100,[callback failure for %d\n] +es,base,101,[error looking up IO fd %d] +es,base,102,[writing: header len %d, writelen %d, total %d] +es,base,103,[write failed for fd %d] +es,base,104,[error deleting io] +es,base,105,[callback failure for %d\n] +es,base,106,[Error creating dns cache] +es,base,107,[dns_cache_init: hash_size <= 0, using %d] +es,base,108,[dns_cache_init: cache-size <= %d, using %d] +es,base,109,[dns_cache_init: cache-size is %d is too large, using %d.] +es,base,110,[dns_cache_init: expire_time <= 0, using %d] +es,base,111,[dns_cache_init: expire is %d is too large, using %d seconds.] +es,base,112,[Error creating dns cache] +es,base,113,[dns-cache-insert: Error allocating entry] +es,base,114,[dns-cache-insert: malloc failure] +es,base,115,[successful server startup] +es,base,116,[%s B%s] +es,base,117,[Netscape executable and shared library have different versions] +es,base,118,[ executable version is %s] +es,base,119,[ shared library version is %s] +es,base,120,[error reporting shutting down] +es,base,121,[warning] +es,base,122,[config] +es,base,123,[security] +es,base,124,[failure] +es,base,125,[catastrophe] +es,base,126,[info] +es,base,127,[verbose] +es,base,128,[event_handler:Failed to wait on events %s] +es,base,129,[could not wait on resume event event (%s)] +es,base,130,[dlopen of %s failed (%s)] +es,base,131,[dlopen of %s failed (%s)] +es,base,132,[The server is terminating due to an error. Check the event viewer for the error message. SERVER EXITING!] +es,base,133,[Terminating the server %s] +es,base,134,[kill_server:cannot open server event %s] +es,base,135,[kill_server:cannot set server event %s] +es,base,136,[error: could not get socket (%s)\n] +es,base,137,[error: could not set socket option (%s)\n] +es,base,138,[Terminating Service:error: could not bind to address %s port %d (%s)\n] +es,base,139,[Terminating Service:error: could not bind to port %d (%s)\n] +es,base,140,[SetHandleNonInheritable: could not duplicate socket (%s)] +es,base,141,[SetHandleNonInheritable: closing the original socket failed (%s)] +es,base,142,[Could not SetHandleInformation (%s)] +es,base,143,[Terminating Service:Failure: Could not open statistics file (%s)\n] +es,base,144,[Could not set Thread Local Storage Value for thread at slot %d] +es,base,145,[secure handshake failed (code %d)\n] +es,base,146,[accept failed %d (%s)] +es,base,147,[Failed to pulse Event %d %s] +es,base,148,[Failed to send MobGrowth Event to parent %s] +es,base,149,[Pulsing MobRespawn Event %d] +es,base,150,[respawn thread pool to %d (%d)] +es,base,151,[Could not open event to signal rotate application. Could not create the MoveLog event:%s] +es,base,152,[Failed to send MoveLog Event to rotate app %s] +es,base,153,[growing thread pool from %d to %d] +es,base,154,[Could not open the ServiceControlManager, Error %d] +es,base,155,[StartNetsiteService:Could not open the service %s: Error %d] +es,base,156,[StartNetsiteService:Could not start the service %s] +es,base,157,[Service Startup: Could not allocate security descriptor] +es,base,158,[Service Startup: Could not init security descriptor] +es,base,159,[Service Startup: Could not set the security Dacl] +es,base,160,[Terminating Service:WinSock init failed: %s] +es,base,161,[Httpd Server Startup failed: %s] +es,base,162,[can't find empty statistics slot] +es,base,163,[NT daemon: could not create new thread %d] +es,base,164,[Service Startup Failure. Terminating Service:Could not create event %d:%s] +es,base,165,[Service Startup Error. Could not create the MoveLog event:%s] +es,base,166,[Failed to wait on Event objects %s] +es,base,167,[Failed to wait on Event objects %s] +es,base,168,[pipebuf_buf2sd: pipebuf_grab IO_ERROR %d] +es,base,169,[pool-init: memory pools disabled] +es,base,170,[pool-init: free_size <= 0, using %d] +es,base,171,[pool-create-block: out of memory] +es,base,172,[pool-create: out of memory] +es,base,173,[pool-create: out of memory] +es,base,174,[pool-malloc: out of memory] +es,base,175,[FREE() used where PERM_FREE() should have been used- problem corrected and supressing further warnings.] +es,base,176,[regex error: %s (regex: '%s')] +es,base,177,[can't create IPC pipe (%s)] +es,base,178,[write to wakeup pipe failed (%s)] +es,base,179,[flushing %d connections; current %d; tot %d] +es,base,180,[accept failed (%s)] +es,base,181,[Error creating time cache] +es,base,182,[time-cache: cache disabled] +es,base,183,[time_cache_init: hash_size < %d, using default, %d] +es,base,184,[time_cache_init: hash_size > %d, using default, %d] +es,base,185,[time_cache_init: cache_size < %d, using default, %d] +es,base,186,[time_cache_init: cache_size > %d, using default, %d] +es,base,187,[Error allocating memory for time_cache] +es,base,188,[Error allocating memory for time_cache entry] +es,base,189,[Error allocating memory for time_cache entry] +es,base,190,[Error inserting new time_cache entry] +es,base,191,[Error allocating memory for time_cache] +es,base,192,[cs-terminate failure (%s)] +es,base,193,[cs-init failure (%s)] +es,base,194,[cs-wait failure (%s)] +es,base,195,[cs-post failure (%s)] +es,base,196,[Unable to create nonblocking socket (%s)] +es,base,197,[error: could not set keepalive (%s)\n] +es,base,198,[error: could not set recv timeout (%s)\n] +es,base,199,[error: could not set send timeout (%s)\n] +es,base,200,[Unable to create nonblocking socket (%s)] +es,base,201,[sem_grab failed (%s)] +es,base,202,[sem_release failed (%s)] +es,base,203,[sem_release failed (%s)] +es,base,204,[Could not remove temporary directory %s, Error %d] +es,base,205,[Could not remove temporary directory %s, Error %d] +es,dsgw,-1,[$DBT: dsgw in DB file v1 $] +es,dsgw,1,[Se desconoce el método de solicitud HTTP] +es,dsgw,2,[Los datos del formulario HTML no son válidos o son incompletos] +es,dsgw,3,[Memoria agotada] +es,dsgw,4,[Falta una entrada necesaria de solicitud/formulario] +es,dsgw,5,[La vía de acceso contiene caracteres no válidos] +es,dsgw,6,[Falta el archivo de configuración o está dañado] +es,dsgw,7,[Imposible inicializar el protocolo LDAP] +es,dsgw,8,[Se ha producido un error al establecer contacto con el servidor LDAP] +es,dsgw,9,[Se desconoce el tipo de objeto de búsqueda] +es,dsgw,10,[Se desconoce la etiqueta de atributo] +es,dsgw,11,[Se desconoce el indicador de correspondencia] +es,dsgw,12,[El tipo de objeto no tiene filtros de búsqueda] +es,dsgw,13,[Imposible abrir el archivo de la plantilla HTML] +es,dsgw,14,[Se desconoce el modo de búsqueda: utilice "smart", "complex", "pattern" o "auth"] +es,dsgw,15,[Falta un nombre distinguido en el URL] +es,dsgw,16,[Se desconoce un ámbito del URL (debe ser base, sub o one)] +es,dsgw,17,[No se reconoce el URL o hay un error desconocido] +es,dsgw,18,[El formato del URL no es correcto] +es,dsgw,19,[Error interno] +es,dsgw,20,[Imposible escribir en el archivo de índices de la plantilla] +es,dsgw,21,[Imposible abrir el archivo de índice de plantillas] +es,dsgw,22,[Imposible leer el directorio] +es,dsgw,23,[Ha fallado la inicialización SSL LDAP (compruebe la vía de acceso de seguridad)] +es,dsgw,24,[Para que los formularios Usuarios y Grupos funcionen mediante SSL, usted o el administrador del servidor tiene que activar SSL en este Administration Server. Para ello, puede utilizar la página Cifrado|activado/desactivado] +es,dsgw,25,[No se han encontrado las credenciales de autentificación en la base de datos de autentificación] +es,dsgw,26,[Error al recuperar datos de la base de datos de autentificación] +es,dsgw,27,[Sus credenciales de autentificación han caducado] +es,dsgw,28,[Imposible crear una cadena aleatoria] +es,dsgw,29,[No se ha especificado un nombre distinguido al recuperar credenciales] +es,dsgw,30,[No se puede abrir la base de datos de autentificación] +es,dsgw,31,[No ha sido posible añadir los datos a la base de datos de autentificación] +es,dsgw,32,[No se ha definido un Gestor de directorios] +es,dsgw,33,[No se ha especificado una cadena de búsqueda. Vuelva a intentarlo] +es,dsgw,34,[Una de las líneas del archivo config. contiene demasiados argumentos] +es,dsgw,35,[No ha sido posible inicializar Windows Sockets] +es,dsgw,36,[No se han recibido las credenciales de autentificación del Administration Server] +es,dsgw,37,[Falta un nombre distinguido en el URL ldapdb://] +es,dsgw,38,[No se reconoce el URL o hay un error desconocido] +es,dsgw,39,[El formato del URL no es correcto] +es,dsgw,40,[Se ha producido un error al inicializar la base de datos ldap local] +es,dsgw,41,[Se desconoce el tipo de servicio de directorios: utilice "local" o "remote"] +es,dsgw,42,[Se ha producido un error al leer el archivo de configuración de base de datos] +es,dsgw,43,[La vía de acceso a NSHOME/userdb tenía el valor NULL] +es,dsgw,44,[No ha sido posible actualizar la configuración del servicio de directorios.] +es,dsgw,45,[No ha sido posible leer la entrada desde el directorio.] +es,dsgw,46,[No ha sido posible borrar la base de datos LDAP.] +es,dsgw,47,[No está autorizado a cambiar otras entradas que no sean las suyas propias.] +es,dsgw,48,[Problema] +es,dsgw,49,[Problema de autentificación] +es,dsgw,50,[.\n

            Debe repetir la autentificación para poder continuar.\n] +es,dsgw,51,[.\n

            Debe repetir la autentificación para poder continuar.\n] +es,dsgw,52,[error desconocido] +es,dsgw,53,[La operación se ha realizado con éxito.] +es,dsgw,54,[Se ha producido un error interno en el servidor. Por lo general,\nesto indica un fallo grave del servidor.\nComuníqueselo al administrador del servidor.] +es,dsgw,55,[El servidor no ha entendido la solicitud que le ha llegado desde\nla pasarela.] +es,dsgw,56,[Se ha sobrepasado el límite de tiempo para responder a su solicitud.\nSi lo que busca son entradas, es posible que obtenga mejores\nresultados si realiza una búsqueda más específica.] +es,dsgw,57,[Se ha sobrepasado el límite de tamaño para responder a su solicitud.\nSi lo que busca son entradas, es posible que obtenga mejores\nresultados si realiza una búsqueda más específica, ya que existen\ndemasiadas entradas que cumplen los criterios de búsqueda.] +es,dsgw,58,[La pasarela ha intentado autentificarse en el servidor\nmediante un método que el servidor no entiende.] +es,dsgw,59,[La pasarela ha intentado autentificarse ante el servidor mediante un\nmétodo de autentificación incompatible con el servidor. ] +es,dsgw,60,[No ha sido posible atender su solicitud, probablemente porque\nel servidor con el que se ha establecido contacto no contiene los datos que\nusted busca. Es posible que se haya recibido\nuna referencia a otro servidor\nal que no es posible acceder. Si tenía la intención\n de realizar cambios en el directorio, puede que no esté disponible el servidor\nque contiene la copia maestra de los datos.] +es,dsgw,61,[Su solicitud ha sobrepasado un límite administrativo en el servidor.] +es,dsgw,62,[La pasarela ha solicitado una extensión crítica que no está disponible en el servidor.] +es,dsgw,63,[El servidor no ha podido procesar la solicitud debido a que\nésta contiene una referencia a un atributo que no\nexiste en la entrada.] +es,dsgw,64,[El servidor no ha podido atender la solicitud debido a que\nésta no cumple con una restricción de la base de datos.] +es,dsgw,65,[El servidor no ha podido añadir un valor a la entrada debido a que\ndicho valor ya está incluido en la entrada.] +es,dsgw,66,[El servidor no ha encontrado la entrada. Si desea añadir\nuna entrada, compruebe que exista su entrada primaria. Si este error\nse ha producido durante una búsqueda, indica que no existe\nla entrada que se está buscando.\nSi ha intentado autentificarse como gestor de directorios y se ha producido\neste error, compruebe el archivo de configuración de la pasarela.] +es,dsgw,67,[Un nombre distinguido no tenía el formato correcto. ] +es,dsgw,68,[Ha intentado autentificarse mediante una entrada que no tiene un\nconjunto de contraseñas o que carece de otras credenciales\nnecesarias para la autentificación. No podrá utilizar esa entrada para la autentificación\nhasta que el gestor de directorios haya añadido\nlos atributos correspondientes.] +es,dsgw,69,[La contraseña u otras credenciales de autentificación especificadas\nno son correctas.] +es,dsgw,70,[No dispone de suficientes derechos de acceso para realizar la operación. ] +es,dsgw,71,[El servidor está demasiado ocupado para atender su\nsolicitud. Vuelva a intentarlo dentro de unos minutos.] +es,dsgw,72,[No ha sido posible establecer contacto con el servidor LDAP.] +es,dsgw,73,[El servidor se ha negado a procesar su solicitud,\nprobablemente porque se saturaría durante la operación. También puede indicar que el servidor no está\nconfigurado para procesar su solicitud. Si está realizando una búsqueda,\nquizás convenga limitar el ámbito de la misma.] +es,dsgw,74,[El servidor de directorios no ha podido atender su solicitud porque\nno cumple con los requisitos del esquema. Normalmente, esto suele indicar\nque no se ha especificado el valor de un campo necesario, aunque también\npodría indicar que es necesario actualizar el esquema del servidor de directorios.] +es,dsgw,75,[El servidor de directorios no permite eliminar una entrada\nni cambiarle el nombre si tiene entradas secundarias. Si desea realizar esta operación,\ndeberá eliminar en primer lugar todas las entradas secundarias.] +es,dsgw,76,[El servidor no ha podido añadir una entrada nueva o cambiar el nombre de\nuna entrada ya existente porque ese nombre ya se utiliza.] +es,dsgw,77,[Su solicitud afectaría a varios servidores de directorios.] +es,dsgw,78,[No ha sido posible establecer contacto con el servidor de directorios.\nConsulte con el administrador del servidor.] +es,dsgw,79,[Se ha producido un error al enviar datos al servidor.] +es,dsgw,80,[Se ha producido un error al leer datos desde el servidor.] +es,dsgw,81,[El servidor no ha respondido a la solicitud.\nHa vencido el tiempo de espera de la solicitud.] +es,dsgw,82,[El servidor no admite el método de autentificación que\nutiliza la pasarela.] +es,dsgw,83,[El filtro de búsqueda que ha formado la pasarela tiene un error.] +es,dsgw,84,[La operación se ha cancelado a solicitud del usuario.] +es,dsgw,85,[Se ha producido un error interno en la biblioteca: un parámetro\nera incorrecto.] +es,dsgw,86,[No ha sido posible abrir una conexión con el servidor.\nConsulte con el administrador del servidor.] +es,dsgw,87,[Se ha producido un error desconocido.] +es,dsgw,88,[La entrada ya existe] +es,dsgw,89,[Ya existe una entrada con el nombre ] +es,dsgw,90,[onMouseOver="window.status='Haga clic aquí para ver esta entrada'; return true"] +es,dsgw,91,[ .

            Elija otro nombre u otra ubicación.\n

            \n] +es,dsgw,92,[No existe la entrada primaria] +es,dsgw,93,[No puede añadir una entrada mediante este nombre:

            %s,

            \nya que no existe su entrada primaria.

            \nPara poder añadir esta entrada, deberá añadir en primer lugar\n] +es,dsgw,94,[su entrada primaria.\n] +es,dsgw,95,[una entrada con este nombre:

            %s.\n] +es,dsgw,96,[Advertencia: sin autentificar (continuación)...\n] +es,dsgw,97,[%s la entrada de directorio] +es,dsgw,98,[

            DN de la entrada: %s

            \n] +es,dsgw,99,[Han quedado guardados los cambios realizados en %s] +es,dsgw,100,[%s has been added.] +es,dsgw,101,[%s has been deleted.] +es,dsgw,102,[Renamed %s to %s.] +es,dsgw,103,[

            Nota: debido a que ha %s la entrada que utilizó como\nautentificación, ha sido necesario descartar sus credenciales de \nautentificación. Si desea realizar más cambios,\ndeberá volver a autentificarse.\n] +es,dsgw,104,[eliminado] +es,dsgw,105,[cambiado el nombre de] +es,dsgw,106,[cambiado la contraseña de] +es,dsgw,107,[Se ha cambiado el atributo %s
            \n] +es,dsgw,108,[ NO ASCII (%ld bytes)\n] +es,dsgw,109,[No se han introducido valores. Vuelva a intentarlo.\n] +es,dsgw,110,[No se han realizado cambios.\n] +es,dsgw,111,[

            Enviando %s al servidor de directorios...\n] +es,dsgw,112,[información] +es,dsgw,113,[cambios] +es,dsgw,114,[

            Se ha añadido la entrada sin problemas.\n] +es,dsgw,115,[

            Se ha modificado la entrada sin problemas. Los cambios han quedado guardados.\n] +es,dsgw,116,[

            Se ha eliminado la entrada sin problemas.\n] +es,dsgw,117,[

            El nombre nuevo de la entrada es: %s\n

            \n] +es,dsgw,118,[

            Se ha cambiado el nombre de la entrada sin problemas.\n] +es,dsgw,119,[Es necesario especificar la contraseña antigua.] +es,dsgw,120,[Es necesario especificar una contraseña nueva. Vuelva a intentarlo] +es,dsgw,121,[La contraseña de confirmación no coincide con la contraseña nueva. Vuelva a intentarlo] +es,dsgw,122,[
            El %s %s ya está en uso. Elija otro.
            \n] +es,dsgw,123,[falta el elemento "%.100s" de los datos del formulario] +es,dsgw,124,[Inicializando la información de configuración] +es,dsgw,125,[Imposible abrir el archivo.] +es,dsgw,126,[Archivo dbconf mal construido.] +es,dsgw,127,[Falta un nombre de propiedad en el archivo dbconf.] +es,dsgw,128,[Memoria agotada.] +es,dsgw,129,[Falta una directiva en el archivo dbconf.] +es,dsgw,130,[Imposible abrir el archivo de configuración "%s"\n] +es,dsgw,131,[Falta un argumento en la directiva "authlifetime"\n] +es,dsgw,132,[Falta un argumento en la directiva "dirmgr"\n] +es,dsgw,133,[Falta un argumento en la directiva "baseurl"\n] +es,dsgw,134,[Se ha especificado un URL erróneo para la directiva "baseurl": falta el DN de base\n] +es,dsgw,135,[analizando la directiva baseurl] +es,dsgw,136,[Se ha especificado un URL erróneo para la directiva "baseurl": no es un URL "ldap://"\n] +es,dsgw,137,[Todavía no son compatibles las direcciones URL "ldap://"\n] +es,dsgw,138,[Faltan argumentos en la directiva "template"\n] +es,dsgw,139,[Faltan un argumento en la directiva "sslrequired"\n] +es,dsgw,140,[Se desconoce un argumento de la directiva "sslrequired" (debería ser "never", "whenauthenticated", "always")\n] +es,dsgw,141,[Falta un argumento en la directiva "securitypath"\n] +es,dsgw,142,[Falta un argumento en la directiva "location-suffix"\n] +es,dsgw,143,[La directiva "location" necesita tres argumentos\n] +es,dsgw,144,[La directiva "newtype" necesita dos argumentos como mínimo\n] +es,dsgw,145,[Se desconoce una ubicación en la directiva "newtype"\n] +es,dsgw,146,[La directiva "tmplset" necesita tres o cuatro argumentos\n] +es,dsgw,147,[La directiva "attrvset" necesita cuatro argumentos\n] +es,dsgw,148,[Falta un argumento en la directiva "charset"\n] +es,dsgw,149,[Falta un argumento en la directiva "ClientLanguage"\n] +es,dsgw,150,[Falta un argumento en la directiva "AdminLanguage"\n] +es,dsgw,151,[Falta un argumento en la directiva "DefaultLanguage"\n] +es,dsgw,152,[Falta un nombre de archivo en la directiva "include"\n] +es,dsgw,153,[Se desconoce una directiva del archivo config\n] +es,dsgw,154,[<= erase_db no ha podido abrir el archivo lcache.conf "%s"\n] +es,dsgw,155,[\n

            Se ha eliminado la base de datos. Creando una base de datos nueva... \n\n ] +es,dsgw,156,[\n

            No ha sido posible eliminar la base de datos \n\n ] +es,dsgw,157,[<= app_suffix no ha podido abrir el archivo ldif "%s"\n] +es,dsgw,158,[<= app_suffix no ha podido abrir el archivo temporal "%s"\n] +es,dsgw,159,[Imposible cambiar el nombre de %s a %s] +es,dsgw,160,[dbconf_read_default_dbinfo() ha devuelto un puntero NULL.] +es,dsgw,161,[El URL "ldapdb" es erróneo: falta el DN de base\n] +es,dsgw,162,[El URL "ldapdb" es erróneo\n] +es,dsgw,163,[Se ha especificado un URL erróneo en la directiva "baseurl": falta el DN de base\n] +es,dsgw,164,[analizando la directiva baseurl] +es,dsgw,165,[Se ha especificado un URL erróneo en la directiva "baseurl": no es un URL "ldap:// o ldapdb://"\n] +es,dsgw,166,[Todavía no son compatibles las direcciones URL "ldap://"\n] +es,dsgw,167,[No se ha dado ningún valor para binddn] +es,dsgw,168,[No se ha dado ningún valor para bindpw] +es,dsgw,169,[No se ha definido un servicio predeterminado de directorios en el archivo dbswitch.conf] +es,dsgw,170,[Imposible abrir el archivo de configuración "%s" para escribir en él] +es,dsgw,171,[Imposible cambiar el nombre de %s a %s] +es,dsgw,172,[archivo de configuración %s: ] +es,dsgw,173,[archivo de configuración %s: línea %d: ] +es,dsgw,174,[máx %d] +es,dsgw,175,[ OK ] +es,dsgw,176,[Cerrar la ventana] +es,dsgw,177,[Retroceder] +es,dsgw,178,[{crypt}BLOQUEADO [%s GMT]] +es,dsgw,179,[Volver a la pantalla principal] +es,dsgw,181,[ Help ] +es,dsgw,182,[Ayuda] +es,dsgw,184,[Todavía no hay ayuda disponible.] +es,dsgw,186,[Cerrar la ventana] +es,dsgw,187,[Cerrar la ventana] +es,dsgw,188,[El URL no incluía un nombre de plantilla justo después de "?"] +es,dsgw,189,[Autentificar...] +es,dsgw,190,[¿Desea descartar las credenciales de autentificación (finalizar la sesión?] +es,dsgw,191,[Escriba una cadena de búsqueda] +es,dsgw,192,[Como primer paso para autentificarse ante el directorio,\n identifíquese.
            Introduzca su nombre:] +es,dsgw,193,[Continuar] +es,dsgw,194,[Continuar] +es,dsgw,195,[Cancelar] +es,dsgw,196,[Autentificarse como gestor de directorios"> Â (solamente para los administradores de directorios)\n] +es,dsgw,197,[Autentificar...] +es,dsgw,198,[¿Desea descartar las credenciales de autentificación?] +es,dsgw,200,[Continuar] +es,dsgw,201,[Continuar] +es,dsgw,202,[Cancelar] +es,dsgw,203,[Autentifíquese (inicie la sesión) en el directorio] +es,dsgw,204,[Está a punto de autentificarse en el directorio como %s. Para concluir el proceso de autentificación, escriba su contraseña.\n] +es,dsgw,206,[Para poder modificar o añadir entradas, es necesario autentificarse\n(iniciar sesión) en el directorio. Esta ventana le servirá de\nguía para realizar el proceso\nde autentificación.\n] +es,dsgw,207,[Desde esta pantalla, es posible autentificarse (iniciar sesión)\nen el directorio. Para poder modificar entradas del directorio, es necesario\realizar la autentificación en primer lugar.\nSi intenta modificar una entrada si haberse autentificado,\nel sistema le pedirá que inicie sesión.\n] +es,dsgw,208,[Estado de la autentificación] +es,dsgw,209,[\nActualmente, se encuentra autentificado en el directorio como ] +es,dsgw,210,[.\nSi desea descartar las credenciales de autentificación y finalizar la sesión en el directorio, haga clic en el botón que aparece a continuación.] +es,dsgw,211,[Descartar credenciales de autentificación (finalizar sesión)] +es,dsgw,212,[Sus credenciales de autentificación en ] +es,dsgw,213,[han caducado.\n


            \n] +es,dsgw,214,[Actualmente, no se encuentra autentificado en el directorio.
            \n] +es,dsgw,215,[falta "%s=" ] +es,dsgw,216,[se desconoce "%s=%s"] +es,dsgw,217,[se desconoce la opción %s] +es,dsgw,218,[se desconoce la sintaxis=%s\n] +es,dsgw,219,[** El tipo de HTML "%s" no es compatible **
            \n] +es,dsgw,224,[Modificar] +es,dsgw,225,[Save Changes] +es,dsgw,226,[modify] +es,dsgw,227,[add] +es,dsgw,228,[Eliminar] +es,dsgw,229,[¿Desea eliminar esta entrada?] +es,dsgw,230,[Cambiar el nombre] +es,dsgw,231,[Escriba un nombre nuevo para esta entrada:] +es,dsgw,232,[Modificar como] +es,dsgw,233,[falta %s=] +es,dsgw,234,[Cerrar la ventana] +es,dsgw,235,[Modificar...] +es,dsgw,236,[falta"%s="\n] +es,dsgw,237,[se desconoce el conjunto "%s"\n] +es,dsgw,238,[se desconoce la sintaxis "%s"\n] +es,dsgw,239,[Repetir la autentificación] +es,dsgw,240,[Cerrar la ventana] +es,dsgw,241,[Confirme que desea ] +es,dsgw,242,[?] +es,dsgw,243,[ Aceptar ] +es,dsgw,244,[ Aceptar ] +es,dsgw,245,[ Restablecer ] +es,dsgw,246,[ Terminado ] +es,dsgw,247,[ Cancelar ] +es,dsgw,248,[se ha encontrado otra sentencia IF (no se admiten las sentencias IF anidadas)] +es,dsgw,249,[se ha encontrado una sentencia ELSE, pero no aparece la IF] +es,dsgw,250,[se ha encontrado una sentencia ELSE después de ELSE (se esperaba encontrar ENDIF)] +es,dsgw,251,[se ha encontrado una sentencia ELIF, pero no aparece la IF] +es,dsgw,252,[se ha encontrado una sentencia ELIF después de ELSE (se esperaba encontrar ENDIF)] +es,dsgw,253,[se ha encontrado una sentencia ENDIF, pero no aparece la IF] +es,dsgw,254,[
            error de plantilla: %s
            \n] +es,dsgw,255,[se ha intentado el proceso ldap_init/lcache_init antes de leer el archivo de configuración] +es,dsgw,256,[no se ejecuta bajo el Administration Server] +es,dsgw,257,[No se han podido inicializar los permisos] +es,dsgw,258,[No ha sido posible asignar el nombre de usuario a un DN (el Administration Server ha comunicado un error)] +es,dsgw,259,[No se ha recibido el nombre de usuario actual] +es,dsgw,260,[No se ha recibido la contraseña del usuario actual] +es,dsgw,261,[Error: %s] +es,dsgw,262,[Nota: no se encuentra disponible ninguna plantilla de presentación para este tipo de\nentrada; la entrada se muestra a continuación con un método predeterminado.] +es,dsgw,263,[La identifación de usuario no es válida o el identifador LDAP tiene el valor NULL] +es,dsgw,264,[no coincide ninguna identificación de usuario] +es,dsgw,265,[coinciden varias identificaciones de usuario] +es,dsgw,266,[the entire directory] +es,dsgw,267,[La directiva "includeset" necesita dos argumentos\n] +es,dsgw,268,[No se ha encontrado en esta entrada el valor de atributo solicitado] +es,dsgw,269,[Falta un argumento en la directiva "NLS"\n] +es,dsgw,270,[Es necesario especificar un valor de identificación de usuario NT\n ] +es,dsgw,271,[La combinación de identificaciones de usuario NT y dominio NT ya se utiliza en el directorio\n] +es,dsgw,272,[Es necesario especificar valores de identificación de usuario NT y de dominio NT\n] +es,dsgw,273,[La identifiación de usuario NT no puede contener más de 20 caracteres.\n] +es,dsgw,274,[Especifique el nombre de la entrada nueva.] +es,dsgw,275,[Seleccione la ubicación de la entrada nueva.] +es,dsgw,276,[Entrada nueva] +es,dsgw,277,[Para poder utilizar esta función, el archivo dsgw.conf debe contener una definición de dirmgr] +es,dsgw,278,[La directiva "vcard-property" necesita tres o cuatro argumentos\n] +es,dsgw,279,[La sintaxis de la propiedad VCard debe ser "cis" o "mls"\n] +es,dsgw,280,[No se han encontrado entradas.\n%2$s] +es,dsgw,281,[No se han encontrado entradas en las que %2$s %3$s '%4$s'.\n] +es,dsgw,282,[Se ha realizado la búsqueda, pero no se ha encontrado ninguna entrada.\n%2$s] +es,dsgw,283,[Se ha realizado la búsqueda, pero no se ha encontrado ninguna entrada en la que %2$s %3$s %4$s'.\n] +es,dsgw,284,[Se ha encontrado 1 entrada.\n%2$s] +es,dsgw,285,[Se ha encontrado 1 entrada en la que %2$s %3$s '%4$s'.\n] +es,dsgw,286,[Se ha realizado la búsqueda y se ha encontrado 1 entrada.\n%2$s] +es,dsgw,287,[Se ha realizado la búsqueda y se ha encontrado 1 entrada en la que %2$s %3$s '%4$s'.\n] +es,dsgw,288,[Se han encontrado %1$li entradas.\n%2$s] +es,dsgw,289,[Se han encontrado %1$li entradas en las que %2$s %3$s '%4$s'.\n] +es,dsgw,290,[Se ha realizado la búsqueda y se han encontrado %1$li entradas.\n%2$s] +es,dsgw,291,[Se ha realizado la búsqueda y se han encontrado %1$li entradas en las que %2$s %3$s '%4$s'.\n] +es,dsgw,292,[el filtro LDAP es] +es,dsgw,293,[El servidor no ha encontrado la entrada que usted ha utilizado el autentificarse. Es posible que se haya eliminado la entrada o que alguien le haya cambiado el nombre. Intente volver a realizar la autentificación.] +es,dsgw,294,[La sintaxis de la contraseña nueva no es válida.\n] +es,dsgw,295,[La contraseña nueva ya existe en el historial de contraseñas.\n] +es,dsgw,296,[Ha sobrepasado el límite de reintentos de contraseña. Consulte con el administrador del sistema.\n] +es,dsgw,297,[Ha sobrepasado el límite de reintentos de contraseña. Vuelva a intentarlo más adelante.\n] +es,dsgw,298,[La contraseña ha caducado. Consulte con el administrador del sistema para restablecer la contraseña.\n] +es,frame,-1,[$DBT: frame in DB file v1 $] +es,frame,1,[No se ha encontrado

            No se ha encontrado

            El objeto solicitado no existe en este servidor. El vínculo que ha seguido no está actualizado o no es exacto, o bien el servidor ha recibido instrucciones para no permitirle el acceso.] +es,frame,2,[Informe al administrador de la oficina acerca de la página que contiene la referencia.] +es,frame,3,[El navegador ha enviado una solicitud que este servidor proxy no ha entendido.] +es,frame,4,[Es necesario disponer de la autorización adecuada para la administración de\neste servidor proxy. El navegador no puede conceder la autorización,\no la autorización no se ha podido realizar.] +es,frame,5,[Es necesaria la autentificación de nombre de usuario para utilizar\neste servidor proxy. El navegador no puede conceder la autorización,\no la autorización no se ha podido realizar.] +es,frame,6,[La configuración de control de acceso al servidor proxy deniega\nel acceso al objeto solicitado mediante este servidor proxy.] +es,frame,7,[El servidor proxy ha encontrado un error interno que le impide\natender su solicitud. Lo más probable es que se deba a una configuración\nerrónea. Solicite al administrador que examine el registro de errores del servidor proxy.] +es,frame,8,[Este servidor proxy no utiliza el método solicitado.] +es,frame,9,[Se ha producido un error en el servidor proxy.] +es,frame,10,[El navegador ha enviado una consulta que este servidor no ha entendido.] +es,frame,11,[Es necesario disponer de la autorización adecuada para acceder a esta zona. El navegador no puede conceder la autorización o la autorización no se ha podido realizar] +es,frame,12,[Su cliente no está autorizado a acceder al objeto que ha solicitado.] +es,frame,13,[El servidor ha encontrado un error interno que le impide atender su solicitud. Lo más probable es que se deba a una configuración errónea. Solicite al administrador que examine el registro de errores del servidor.] +es,frame,14,[Este servidor no utiliza el método solicitado.] +es,frame,15,[Se ha producido un error.] +es,frame,16,[El navegador ha enviado un mensaje que este servidor no ha entendido.] +es,frame,17,[%s

            %s

            \nEste documento ha sido trasladado a otra ubicación. Actualice los documentos y listas de acceso con los nuevos datos.] +es,frame,18,[%s\n

            %s

            \n%s\n] +es,frame,19,[process-uri-objects] +es,frame,20,[cannot find template %s] +es,frame,21,[process-uri-objects] +es,frame,22,[no partial path after object processing] +es,frame,23,[find-service] +es,frame,24,[invalid shexp %s] +es,frame,25,[find-service] +es,frame,26,[invalid shexp %s] +es,frame,27,[handle-processed] +es,frame,28,[no way to service request for %s] +es,frame,29,[finish-socks-request] +es,frame,30,[close failed (%s), csd=%d] +es,frame,31,[This beta software has expired.\n] +es,frame,32,[mr_accept(%d)] +es,frame,33,[Error issuing read on accept socket] +es,frame,34,[acb_accept_connection(%d)] +es,frame,35,[Error getting accept socket (%d)] +es,frame,36,[Error in accept! (%d, %s)] +es,frame,37,[Error creating new accept request] +es,frame,38,[accepted connection: %d (NSPR %d)] +es,frame,39,[Error creating new session structure] +es,frame,40,[accel_read_request()] +es,frame,41,[Error allocating request read buffer] +es,frame,42,[Error issuing async read request] +es,frame,43,[acb_read_request(%d, bytes %d)] +es,frame,44,[acb_read_req(1 session = %d)] +es,frame,45,[Error reading request (%d, %s)] +es,frame,46,[Client aborted connection] +es,frame,47,[Error reading request] +es,frame,48,[Error creating new request] +es,frame,49,[error occurred, closing %d, io was for %d] +es,frame,50,[accel_async_scan_headers()] +es,frame,51,[out of memory: accel_async_scan_headers] +es,frame,52,[out of memory: accel_async_scan_headers] +es,frame,53,[Error during async read (%d, %s)] +es,frame,54,[scan-headers reports: line too long] +es,frame,55,[scan-headers reports: too many headers] +es,frame,56,[Error reading headers] +es,frame,57,[scan-headers reports: header missing terminator (an empty line)] +es,frame,58,[scan-headers reports: header was empty] +es,frame,59,[nombre sin valor: se ha recibido la línea "%s"] +es,frame,60,[accel_send_plain_file()] +es,frame,61,[accel_send_plain_file() - found request %d] +es,frame,62,[Parse headers lost the URI!] +es,frame,63,[accel_send_plain_file() - found uri %s] +es,frame,64,[accel_send_plain_file() - found in cache?] +es,frame,65,[malloc died!] +es,frame,66,[Error writing back file\n] +es,frame,67,[acb_send_plain_file(%d)] +es,frame,68,[Error writing in acb_send_plain_file (%d, %s)] +es,frame,69,[acb_close_connection(%d)] +es,frame,70,[Errored IO in acb_close_connection (%d, %s)] +es,frame,71,[Unable to close socket %d] +es,frame,72,[accel-cache-insert: Error allocating entry] +es,frame,73,[cache-init: server cache disabled] +es,frame,74,[accel_file_cache: Error initializing file cache] +es,frame,75,[accel_file_cache: Error creating cache] +es,frame,76,[accel_file_cache_init: CacheHashSize < %d, using %d] +es,frame,77,[accel_file_cache_init: CacheHashSize > %d, using %d] +es,frame,78,[accel_file_cache_init: MaxNumberOfCachedFiles < %d, using %d] +es,frame,79,[accel_file_cache_init: MaxNumberOfCachedFiles > %d, using %d] +es,frame,80,[accel_file_cache_init: MaxNumberOfOpenCachedFiles < %d, using %d] +es,frame,81,[accel_file_cache_init: MaxNumberOfOpenCachedFiles > %d, using %d] +es,frame,82,[accel_file_cache: Error initializing file cache] +es,frame,83,[file-cache: enabled = %s ] +es,frame,84,[on] +es,frame,85,[off] +es,frame,86,[file-cache: MaxNumberOfCachedFiles %d (0x%x)] +es,frame,87,[file-cache: CacheHashSize %d (0x%x)] +es,frame,88,[file-cache: MaxNumberOfOpenCachedFiles %d (0x%x)] +es,frame,89,[accel-cache-insert: Error allocating entry] +es,frame,90,[file-cache-cleanup: munmap failed (%s)] +es,frame,91,[file-cache-cleanup: found mmapped file \non system without mmap] +es,frame,92,[file_cache_init: MaxTotalCachedFileSize < %d, using %d] +es,frame,93,[file_cache_init: MaxTotalCachedFileSize > %d, using %d] +es,frame,94,[file cache using mmap flags 0x%x] +es,frame,95,[file cache using mmap prots 0x%x] +es,frame,96,[file-cache-init: could not create lock] +es,frame,97,[file-cache: unable to create temporary directory %s.\n] +es,frame,98,[file-cache: unable to create temporary directory %s.\n] +es,frame,99,[file-cache: GetTempPath() Cannot find temp directory to store file!] +es,frame,100,[file-cache-init: set max cached file size to %d] +es,frame,101,[file-cache-init: could not create lock] +es,frame,102,[file_cache_destroy()] +es,frame,103,[file-cache: Unable to get temp file name. Error %s] +es,frame,104,[file-cache: Unable to get temp file name. Error %s] +es,frame,105,[file-cache-insert: Error allocating entry] +es,frame,106,[file-cache-create: Error opening file %s (%s)] +es,frame,107,[file-cache-create: Error stat()ing file %s (%s)] +es,frame,108,[file-cache-create: Error mmap()ing file %s (%s)] +es,frame,109,[file-cache-create: malloc failure] +es,frame,110,[file-cache-create: error case failed to munmap(%d, %d) (%s)] +es,frame,111,[file-cache-valid: cannot stat %s] +es,frame,112,[dir change: invalidating %s (%d)] +es,frame,113,[file-cache: asynchronous file change notification failed.] +es,frame,114,[dir change: offset %d, action %d, len %d, name %s] +es,frame,115,[unable to check async file status] +es,frame,116,[ReadDirectoryChangesW failure- unable to continue watching %s. Error is %s] +es,frame,117,[file-cache-add-watch failure- unable to open directory %s. Error %s] +es,frame,118,[ReadDirectoryChangesW failure- unable to start watching %s. Error %s] +es,frame,119,[func_exec] +es,frame,120,[no handler function given for directive] +es,frame,121,[func_exec] +es,frame,122,[cannot find function named %s] +es,frame,123,[handle-request] +es,frame,124,[method without URI] +es,frame,125,[http-parse-request] +es,frame,126,[while scanning HTTP headers, %s] +es,frame,127,[handle-request] +es,frame,128,[read from %s failed, error is %s] +es,frame,129,[handle-request] +es,frame,130,[request too long] +es,frame,131,[start-http-response] +es,frame,132,[write failed (%s)] +es,frame,133,[start-http-response] +es,frame,134,[write failed (%s)] +es,frame,135,[http-status] +es,frame,136,[%d is not a valid HTTP status code] +es,frame,137,[finish-request] +es,frame,138,[close failed (%s)] +es,frame,139,[Unable to close socket for writing] +es,frame,140,[os has %d objects] +es,frame,141,[obj %d has no hash table at %d] +es,frame,142,[obj %d has no param] +es,frame,143,[obj %d name %s value %s] +es,frame,144,[.....directives %d.......] +es,frame,145,[.....directive %d] +es,frame,146,[.......instance %d] +es,frame,147,[...........param name %s value %s] +es,frame,148,[ClearConfigurationParameters:RegCreateKey %s] +es,frame,149,[ClearConfigurationParameters:RegEnumKey %s failed] +es,frame,150,[obj.conf line %d: error in filter file "%s" at line %d: %s] +es,frame,151,[obj.conf line %d: error in filter file "%s" at line %d: %s] +es,frame,152,[Unable to allocate Subject property list.\n] +es,frame,153,[Unable to set session ptr in Subject property list - error=%d\n] +es,frame,154,[Unable to set request ptr in Subject property list - error=%d\n] +es,frame,155,[file-cache-valid: cannot stat %s] +es,frame,156,[file-cache-create: Error stat()ing file %s (%s)] +es,httpdaemon,-1,[$DBT: httpdaemon in DB file v1 $] +es,httpdaemon,1,[Error in ConvertThreadToFiber] +es,httpdaemon,2,[Error in ConvertThreadToFiber] +es,httpdaemon,3,[Error in md_start_system] +es,httpdaemon,4,[Error in CreateFiber - idlefiber] +es,httpdaemon,5,[Error in GetQueuedCompletionStatus] +es,httpdaemon,6,[Error creating completion port] +es,httpdaemon,7,[Could not SetHandleNonInheritable (%s)] +es,httpdaemon,8,[Error accept/read new conn] +es,httpdaemon,9,[Error in Respond()] +es,httpdaemon,10,[Error in RespondCompleted()] +es,httpdaemon,11,[daemon: unable to fork new process (%s)\n] +es,httpdaemon,12,[daemon: setsid failed (%s)\n] +es,httpdaemon,13,[daemon: can't log pid to %s (%s)\n] +es,httpdaemon,14,[warning: could not set group id to %d (%s)\n] +es,httpdaemon,15,[warning: could not set user id to %d (%s)\n] +es,httpdaemon,16,[warning: daemon is running as super-user\n] +es,httpdaemon,17,[could not determine current user name\n] +es,httpdaemon,18,[error: chroot to %s failed (%s)\n] +es,httpdaemon,19,[WARNING! netscape executable and library have different versions.\n] +es,httpdaemon,20,[startup: listening to %s://%s, port %d as %s\n] +es,httpdaemon,21,[startup: listening to %s://%s, port %d as %s\n] +es,httpdaemon,22,[seminit failed (%s)\n] +es,httpdaemon,23,[Using single threaded accepts.] +es,httpdaemon,24,[Using multi threaded accepts.] +es,httpdaemon,25,[Using partial single threaded accepts.] +es,httpdaemon,26,[This machine has %d processors.] +es,httpdaemon,27,[Error calling thr_seconcurrency(%d)- (%s)] +es,httpdaemon,28,[Set conncurrency to %d.] +es,httpdaemon,29,[can't fork new process (%s)] +es,httpdaemon,30,[This beta software has expired.\n] +es,httpdaemon,31,[can't create IPC pipe (%s)] +es,httpdaemon,32,[write to wakeup pipe failed (%s)] +es,httpdaemon,33,[select thread miss] +es,httpdaemon,34,[startup failure: could not bind to port %d (%s)\n] +es,httpdaemon,35,[startup failure: could not bind to port %d, IP address %s (%s)\n] +es,libaccess,-1,[$DBT: libaccess in DB file v1 $] +es,libaccess,1,[basic-ncsa] +es,libaccess,2,[cannot open database %s] +es,libaccess,3,[basic-ncsa] +es,libaccess,4,[user %s password did not match database %s] +es,libaccess,5,[basic-ncsa] +es,libaccess,6,[cannot open connection to LDAP server on %s:%d] +es,libaccess,7,[basic-ncsa] +es,libaccess,8,[user %s password did not match LDAP on %s:%d] +es,libaccess,9,[acl-state] +es,libaccess,10,[missing realm] +es,libaccess,11,[Unable to allocate ACL List Hash\n] +es,libaccess,12,[ACLEvalBuildContext unable to PERM_MALLOC cache structure\n] +es,libaccess,13,[ACLEvalBuildContext unable to create hash table\n] +es,libaccess,14,[ACLEvalBuildContext unable to allocate ACE Entry\n] +es,libaccess,15,[ACLEvalBuildContext unable to allocate ACE entry\n] +es,libaccess,16,[ACLEvalBuildContext unable to allocate Boundary Entry\n] +es,libaccess,17,[ACLEvalBuildContext failed.\n] +es,libaccess,18,[ACL_EvalTestRights: an interim, absolute non-allow value was encountered. right=%s, value=%d\n] +es,libaccess,19,[LASDnsBuild unable to allocate hash table header\n] +es,libaccess,20,[LASDnsBuild unable to add key %s\n] +es,libaccess,21,[LASDnsBuild unable to add key %s\n] +es,libaccess,22,[LASDnsBuild unable to add key %s\n] +es,libaccess,23,[LASDnsBuild unable to add key %s\n] +es,libaccess,24,[LASDnsBuild unable to add key %s\n] +es,libaccess,25,[LAS DNS build received request for attribute %s\n] +es,libaccess,26,[LASDnsEval - illegal comparator %s\n] +es,libaccess,27,[LASDnsEval unable to allocate Context struct\n\n] +es,libaccess,28,[LASDnsEval unable to get session address %d\n] +es,libaccess,29,[LASDnsEval unable to get DNS - error=%s\n] +es,libaccess,30,[LAS Group Eval received request for attribute %s\n] +es,libaccess,31,[LASGroupEval - illegal comparator %s\n] +es,libaccess,32,[LASGroupEval - ran out of memory\n] +es,libaccess,33,[LASGroupEval unable to get session address %d\n] +es,libaccess,34,[LASGroupEval unable to get session address %d\n] +es,libaccess,35,[LASGroupEval - couldn't locate getter for auth-user\n] +es,libaccess,36,[LASGroupEval - Attribute getter for auth-user failed\n] +es,libaccess,37,[LASGroupEval - Attribute getter didn't set auth-user\n] +es,libaccess,38,[Check group membership of user "%s" for group "%s"\n] +es,libaccess,39,[LDAPU_SUCCESS for group "%s"\n] +es,libaccess,40,[LDAPU_FAILED for group "%s"\n] +es,libaccess,41,[LAS_EVAL_FALSE\n] +es,libaccess,42,[LAS_EVAL_TRUE\n] +es,libaccess,43,[LASIpTreeAlloc - no memory\n] +es,libaccess,44,[IP LAS unable to allocate tree node\n] +es,libaccess,45,[IP LAS unable to allocate tree node\n] +es,libaccess,46,[LAS IP build received request for attribute %s\n] +es,libaccess,47,[LASIpEval - illegal comparator %s\n] +es,libaccess,48,[LASIpEval unable to get session address - error=%s\n] +es,libaccess,49,[LASIpEval unable to allocate Context struct\n\n] +es,libaccess,50,[LASIpEval - reach 32 bits without conclusion value=%s] +es,libaccess,51,[LAS Program Eval received request for attribute %s\n] +es,libaccess,52,[LASProgramEval - illegal comparator %s\n] +es,libaccess,53,[LASProgram unable to get session address %d\n] +es,libaccess,54,[bin] +es,libaccess,55,[LASProgramEval: request not of type admin or bin, passing.\n] +es,libaccess,56,[LASProgramEval: check if program %s matches pattern %s.\n] +es,libaccess,57,[LASProgramEval: Invalid wildcard expression %s.\n] +es,libaccess,58,[LAS_EVAL_FALSE\n] +es,libaccess,59,[LAS_EVAL_TRUE\n] +es,libaccess,60,[Unexpected attribute in dayOfWeek - %s\n] +es,libaccess,61,[Illegal comparator for dayOfWeek - %s\n] +es,libaccess,62,[Unexpected attribute in timeOfDay - %s\n] +es,libaccess,63,[LAS User Eval received request for attribute %s\n] +es,libaccess,64,[LASUserEval - illegal comparator %s\n] +es,libaccess,65,[LASUserEval - ran out of memory\n] +es,libaccess,66,[LASUserEval unable to get session address %d\n] +es,libaccess,67,[LASUserEval unable to get session address %d\n] +es,libaccess,68,[LASGroupEval - couldn't locate getter for auth-user\n] +es,libaccess,69,[LASGroupEval - Attribute getter for auth-user failed\n] +es,libaccess,70,[LASGroupEval - Attribute getter didn't set auth-user\n] +es,libaccess,71,[Check if uid == user (i.e. check "%s" == "%s)"\n] +es,libaccess,72,[SUCCESS for user "%s"\n] +es,libaccess,73,[FAILED for user "%s"\n] +es,libaccess,74,[LAS_EVAL_FALSE\n] +es,libaccess,75,[LAS_EVAL_TRUE\n] +es,libaccess,76,[] +es,libaccess,77,[LASProgram unable to get request address - error=%s] +es,libaccess,78,[LASProgram rejecting request for program %s from pattern %s] +es,libaccess,79,[ACL_CacheFlush: unable to parse file "%s"\n] +es,libaccess,80,[ACL_CacheFlush: unable to concatenate ACL list "%s"\n] +es,libaccess,81,[ACL_CacheFlush: unable to open and process the magnus file "%s"\n] +es,libaccess,82,[Illegal comparator for timeOfDay - %s\n] +es,libaccess,83,[ACL_EvalBuildContext unable to create hash table\n] +es,libaccess,84,[ACL_EvalBuildContext unable to PERM_CALLOC cache structure\n] +es,libaccess,85,[ACL_EvalBuildContext unable to allocate ACE entry\n] +es,libaccess,86,[ACL_EvalBuildContext unable to allocate auth pointer array\n] +es,libaccess,87,[ACL_EvalBuildContext unable to allocate auth plist\n] +es,libaccess,88,[ACL_EvalTestRights: an interim, absolute non-allow value was encountered. right=%s, value=%s\n] +es,libaccess,89,[ACL_INTEvalTestRights: call to ACL_EvalBuildContext returned failure status\n] +es,libaccess,90,[ACL_ModuleRegister: module name is missing\n] +es,libaccess,91,[ACL_ModuleRegister: call to module init function returned a failed status\n] +es,libaccess,92,[ACL_GetAttribute: couldn't determine method for %s\n] +es,libaccess,93,[ACL_GetAttribute: couldn't locate getter for %s] +es,libaccess,94,[ACL_GetAttribute: attr getter failed to get %s] +es,libaccess,95,[ACL_GetAttribute: attr getter failed to get %s] +es,libaccess,96,[ACL_GetAttribute: All attribute getters declined for attr %s] +es,libaccess,97,[ACL_DatabaseRegister: dbtype for database "%s" is not defined yet!] +es,libaccess,98,[ACL_DatabaseRegister: database name is missing] +es,libaccess,99,[Error reading the DB Map File: %s. Reason: %s] +es,libaccess,100,[URL is missing for database %s] +es,libaccess,101,[Invalid property value pair for database %s] +es,libaccess,102,["default" database must be an LDAP database] +es,libaccess,103,[Multiple "default" databases are being registered] +es,libaccess,104,["default" LDAP database must be registered] +es,libaccess,105,[LASGroupEval unable to get database name - error= %s] +es,libaccess,106,[received invalid program expression %s] +es,libaccess,107,[parse_ldap_url: database url is missing] +es,libaccess,108,[parse_ldap_url: database name is missing] +es,libaccess,109,[parse_ldap_url: error in parsing ldap url. Reason: %s] +es,libaccess,110,[ldap password check: unable to get database name - error=%s] +es,libaccess,111,[ldap password check: unable to get parsed database %s] +es,libaccess,112,[ldap password check: couldn't initialize connection to LDAP. Reason: %s] +es,libaccess,113,[ldap password check: LDAP error: "%s"] +es,libaccess,114,[get_user_ismember_ldap unable to get database name - error=%s] +es,libaccess,115,[get_user_ismember_ldap unable to get parsed database %s] +es,libaccess,116,[ldap password check: couldn't initialize connection to LDAP. Reason: %s] +es,libaccess,117,[get_user_ismember_ldap: group %s does not exist] +es,libaccess,118,[get_user_ismember_ldap: LDAP error: "%s"] +es,libaccess,119,[ACL_LDAPDatabaseHandle: %s is not a registered database] +es,libaccess,120,[ACL_LDAPDatabaseHandle: %s is not an LDAP database] +es,libaccess,121,[ACL_LDAPDatabaseHandle: out of memory] +es,libaccess,122,[ACL_LDAPDatabaseHandle: couldn't initialize connection to LDAP. Reason: %s] +es,libaccess,123,[ACL_LDAPDatabaseHandle: couldn't bind to LDAP server. Reason: %s] +es,libaccess,124,[insufficient dynamic memory] +es,libaccess,125,[error opening file, %s: %s] +es,libaccess,126,[duplicate definition of %s] +es,libaccess,127,[file %s, line %s: duplicate definition of %s] +es,libaccess,128,[file %s, line %s: syntax error] +es,libaccess,129,[file %s, line %s: %s is undefined] +es,libaccess,130,[in acl %s, %s %s is undefined] +es,libaccess,131,[database %s: error accessing %s] +es,libaccess,132,[%s] +es,libaccess,133,[file %s, line %s: invalid syntax] +es,libaccess,134,[file %s, line %s: syntax error at "%s"] +es,libaccess,135,[realm %s is not defined] +es,libaccess,136,[error code = %d] +es,libaccess,137,[internal ACL error] +es,libaccess,138,[invalid argument] +es,libaccess,139,[ACL_DatabaseRegister: dbtype for database "%s" is not defined yet!] +es,libaccess,140,[couldn't determine dbtype from: %s] +es,libaccess,141,[Failed to register database %s] +es,libaccess,142,[ACL call returned failed status] +es,libaccess,143,[file %s: ACL IO error - %s] +es,libaccess,144,[acl_user_exists: memoria agotada] +es,libaccess,145,[acl_user_exists: ya no existe el usuario] +es,libaccess,146,[acl_user_exists: error de plist] +es,libadmin,-1,[$DBT: libadmin in DB file v1 $] +es,libadmin,1,[ Help ] +es,libadmin,2,[ OK ] +es,libadmin,3,[ Reset ] +es,libadmin,4,[ Done ] +es,libadmin,5,[ Cancel ] +es,libir,-1,[$DBT: libadmin in DB file v1 $] +es,libir,1,[An I/O error occurred before all form data could be read.] diff --git a/l10n/dirserv/es/ns-slapd.txt.iso8859 b/l10n/dirserv/es/ns-slapd.txt.iso8859 new file mode 100644 index 00000000..3298ce5a --- /dev/null +++ b/l10n/dirserv/es/ns-slapd.txt.iso8859 @@ -0,0 +1,874 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/**************************************************************************/ +/* The copyright notice(s) in this Source Code does not indicate actual */ +/* or intended publication of this Source Code. */ +/**************************************************************************/ + +/* This text file was generated by program dblink */ + +$Revision: 1.1 $ +$Log: ns-slapd.txt.iso8859,v $ +Revision 1.1 2005/01/21 00:40:48 cvsadm +Initial revision + +Revision 1.1.8.3 2003/09/22 19:36:42 ulfw +Update copyright years from 2001 to 2001-2003 + +Revision 1.1.8.2 2001/11/03 01:06:41 richm +XXX use new copyright XXX + +Revision 1.1.8.1 1998/10/10 02:14:04 ggood +Copy from Directory40RtmBranchpoint to DirectoryBranch + +Revision 1.1.2.1 1997/12/24 01:14:39 werudge +Based on en/ns-slapd.txt : 1.1.2.3 +daily 971113.1 SOLARIS-export-optimize-normal-slapd +$EndLog$ + +$StartStringData$ + +es,base,-1,[$DBT: base in DB file v1 $] +es,base,1,[no hay memoria suficiente para crear la tabla de totales de control] +es,base,2,[no hay memoria suficiente para crear la tabla de totales de control] +es,base,3,[cache_destroy: las tablas caché parecen dañadas.] +es,base,4,[no ha sido posible asignar la entrada de total de control] +es,base,5,[cache_insert: no ha sido posible crear la entrada caché] +es,base,6,[HTTP/1.0 200 OK\nContent-type: text/html\n\n] +es,base,7,[

            Informe de estado de caché de Netscape

            \n] +es,base,8,[El sistema no tiene cachés

            ] +es,base,9,[

            Caché %s

            \n] +es,base,10,[Índice de aciertos de caché: %d/%d (%f)

            \n

            \n] +es,base,11,[Tamaño de caché: %d/%d

            \n

            \n] +es,base,12,[Tamaño de la tabla de totales de control: %d

            \n

            \n] +es,base,13,[mru : %d

            \nlru : %d

            \n] +es,base,14,[
              Sector de almacenamiento Dirección Clave Recuento de accesos Eliminar Siguiente LRU MRU Datos
              \n] +es,base,15,[munmap failed (%s)] +es,base,16,[munmap failed (%s)] +es,base,17,[close failed (%s)] +es,base,18,[daemon: unable to fork new process (%s)\n] +es,base,19,[daemon: setsid failed (%s)\n] +es,base,20,[daemon: can't log pid to %s (%s)\n] +es,base,21,[warning: could not set group id to %d (%s)\n] +es,base,22,[warning: could not set user id to %d (%s)\n] +es,base,23,[warning: daemon is running as super-user\n] +es,base,24,[could not determine current user name\n] +es,base,25,[error: chroot to %s failed (%s)\n] +es,base,27,[, address %s] +es,base,28,[warning: statistics disabled (%s)\n] +es,base,29,[security handshake timed out for pid %d] +es,base,30,[warning: statistics disabled (%s)\n] +es,base,31,[secure handshake failed (code %d)\n] +es,base,32,[accept failed (%s)] +es,base,33,[warning: statistics disabled (%s)\n] +es,base,34,[select thread miss] +es,base,35,[keepalive worker awoken with no work to do] +es,base,36,[could not create new thread: %d (%s)] +es,base,37,[wait for sema succeeded, but nothing to dequeue] +es,base,38,[queue-sema creation failure] +es,base,39,[error getting processor info for processor %d] +es,base,40,[Error binding to processor %d] +es,base,41,[bound process %d to processor %d] +es,base,42,[Netscape server is not explicitly binding to any processors.] +es,base,43,[cache monitor exited] +es,base,44,[cache batch update daemon exited] +es,base,45,[Using single threaded accepts.] +es,base,46,[Using multi threaded accepts.] +es,base,47,[Using partial single threaded accepts.] +es,base,48,[This machine has %d processors.] +es,base,49,[Error calling thr_seconcurrency(%d)- (%s)] +es,base,50,[Set conncurrency to %d.] +es,base,51,[WARNING! netscape executable and library have different versions.\n] +es,base,54,[seminit failed (%s)\n] +es,base,55,[This beta software has expired.\n] +es,base,56,[Cache monitor respawned] +es,base,57,[Cache batch update daemon respawned] +es,base,58,[can't find empty statistics slot] +es,base,59,[can't fork new process (%s)] +es,base,60,[assert failed! %s\n] +es,base,61,[mr_table_init()] +es,base,62,[malloc failed] +es,base,63,[malloc failed!] +es,base,64,[mr_add_io(%d, type %d, file %d)] +es,base,65,[mr_add_io - stage 1] +es,base,66,[mr_add_io - stage 2] +es,base,67,[mr_add_io found invalid IO type %d] +es,base,68,[mr_add_io - adding timeout] +es,base,69,[Out of memory!\n] +es,base,70,[done with mr_add_io] +es,base,71,[mr_del_io(%d, type %d, file %d)] +es,base,72,[mr_del_io found invalid IO type %d] +es,base,73,[mr_lookup_io(%d)] +es,base,74,[mr_async_io(%d, %d bytes, file %d)] +es,base,75,[malloc failure adding async IO] +es,base,76,[Error adding async io!] +es,base,77,[Cannot seek for read!] +es,base,78,[read failure! (%d, %s)] +es,base,79,[do_read read %d bytes for file %d] +es,base,80,[Cannot seek for write!] +es,base,81,[writev failure! (%d, %s)] +es,base,82,[write failure! (%d, %s)] +es,base,83,[do_write wrote %d bytes for file %d] +es,base,84,[do_timeout(mrp %d)] +es,base,85,[do_timeout: found IO (timer=%d, time=%d)] +es,base,86,[error deleting io] +es,base,87,[timeout callback failure for %d\n] +es,base,88,[mr_get_event(%d) - outstanding io %d] +es,base,89,[mr_get_event: Waiting for reads on FD:] +es,base,90,[mr_get_event: Waiting for writes on FD:] +es,base,91,[ %d] +es,base,92,[ %d] +es,base,93,[mr_get_event set no timeout] +es,base,94,[mr_get_event set timeout to: %d.%d sec] +es,base,95,[error in select (%d, %s)] +es,base,96,[mr_get_event() - select found %d] +es,base,97,[error looking up IO fd %d] +es,base,98,[read failed for fd %d] +es,base,99,[error deleting io] +es,base,100,[callback failure for %d\n] +es,base,101,[error looking up IO fd %d] +es,base,102,[writing: header len %d, writelen %d, total %d] +es,base,103,[write failed for fd %d] +es,base,104,[error deleting io] +es,base,105,[callback failure for %d\n] +es,base,106,[Error creating dns cache] +es,base,107,[dns_cache_init: hash_size <= 0, using %d] +es,base,108,[dns_cache_init: cache-size <= %d, using %d] +es,base,109,[dns_cache_init: cache-size is %d is too large, using %d.] +es,base,110,[dns_cache_init: expire_time <= 0, using %d] +es,base,111,[dns_cache_init: expire is %d is too large, using %d seconds.] +es,base,112,[Error creating dns cache] +es,base,113,[dns-cache-insert: Error allocating entry] +es,base,114,[dns-cache-insert: malloc failure] +es,base,115,[successful server startup] +es,base,116,[%s B%s] +es,base,117,[Netscape executable and shared library have different versions] +es,base,118,[ executable version is %s] +es,base,119,[ shared library version is %s] +es,base,120,[error reporting shutting down] +es,base,121,[warning] +es,base,122,[config] +es,base,123,[security] +es,base,124,[failure] +es,base,125,[catastrophe] +es,base,126,[info] +es,base,127,[verbose] +es,base,128,[event_handler:Failed to wait on events %s] +es,base,129,[could not wait on resume event event (%s)] +es,base,130,[dlopen of %s failed (%s)] +es,base,131,[dlopen of %s failed (%s)] +es,base,132,[The server is terminating due to an error. Check the event viewer for the error message. SERVER EXITING!] +es,base,133,[Terminating the server %s] +es,base,134,[kill_server:cannot open server event %s] +es,base,135,[kill_server:cannot set server event %s] +es,base,136,[error: could not get socket (%s)\n] +es,base,137,[error: could not set socket option (%s)\n] +es,base,138,[Terminating Service:error: could not bind to address %s port %d (%s)\n] +es,base,139,[Terminating Service:error: could not bind to port %d (%s)\n] +es,base,140,[SetHandleNonInheritable: could not duplicate socket (%s)] +es,base,141,[SetHandleNonInheritable: closing the original socket failed (%s)] +es,base,142,[Could not SetHandleInformation (%s)] +es,base,143,[Terminating Service:Failure: Could not open statistics file (%s)\n] +es,base,144,[Could not set Thread Local Storage Value for thread at slot %d] +es,base,145,[secure handshake failed (code %d)\n] +es,base,146,[accept failed %d (%s)] +es,base,147,[Failed to pulse Event %d %s] +es,base,148,[Failed to send MobGrowth Event to parent %s] +es,base,149,[Pulsing MobRespawn Event %d] +es,base,150,[respawn thread pool to %d (%d)] +es,base,151,[Could not open event to signal rotate application. Could not create the MoveLog event:%s] +es,base,152,[Failed to send MoveLog Event to rotate app %s] +es,base,153,[growing thread pool from %d to %d] +es,base,154,[Could not open the ServiceControlManager, Error %d] +es,base,155,[StartNetsiteService:Could not open the service %s: Error %d] +es,base,156,[StartNetsiteService:Could not start the service %s] +es,base,157,[Service Startup: Could not allocate security descriptor] +es,base,158,[Service Startup: Could not init security descriptor] +es,base,159,[Service Startup: Could not set the security Dacl] +es,base,160,[Terminating Service:WinSock init failed: %s] +es,base,161,[Httpd Server Startup failed: %s] +es,base,162,[can't find empty statistics slot] +es,base,163,[NT daemon: could not create new thread %d] +es,base,164,[Service Startup Failure. Terminating Service:Could not create event %d:%s] +es,base,165,[Service Startup Error. Could not create the MoveLog event:%s] +es,base,166,[Failed to wait on Event objects %s] +es,base,167,[Failed to wait on Event objects %s] +es,base,168,[pipebuf_buf2sd: pipebuf_grab IO_ERROR %d] +es,base,169,[pool-init: memory pools disabled] +es,base,170,[pool-init: free_size <= 0, using %d] +es,base,171,[pool-create-block: out of memory] +es,base,172,[pool-create: out of memory] +es,base,173,[pool-create: out of memory] +es,base,174,[pool-malloc: out of memory] +es,base,175,[FREE() used where PERM_FREE() should have been used- problem corrected and supressing further warnings.] +es,base,176,[regex error: %s (regex: '%s')] +es,base,177,[can't create IPC pipe (%s)] +es,base,178,[write to wakeup pipe failed (%s)] +es,base,179,[flushing %d connections; current %d; tot %d] +es,base,180,[accept failed (%s)] +es,base,181,[Error creating time cache] +es,base,182,[time-cache: cache disabled] +es,base,183,[time_cache_init: hash_size < %d, using default, %d] +es,base,184,[time_cache_init: hash_size > %d, using default, %d] +es,base,185,[time_cache_init: cache_size < %d, using default, %d] +es,base,186,[time_cache_init: cache_size > %d, using default, %d] +es,base,187,[Error allocating memory for time_cache] +es,base,188,[Error allocating memory for time_cache entry] +es,base,189,[Error allocating memory for time_cache entry] +es,base,190,[Error inserting new time_cache entry] +es,base,191,[Error allocating memory for time_cache] +es,base,192,[cs-terminate failure (%s)] +es,base,193,[cs-init failure (%s)] +es,base,194,[cs-wait failure (%s)] +es,base,195,[cs-post failure (%s)] +es,base,196,[Unable to create nonblocking socket (%s)] +es,base,197,[error: could not set keepalive (%s)\n] +es,base,198,[error: could not set recv timeout (%s)\n] +es,base,199,[error: could not set send timeout (%s)\n] +es,base,200,[Unable to create nonblocking socket (%s)] +es,base,201,[sem_grab failed (%s)] +es,base,202,[sem_release failed (%s)] +es,base,203,[sem_release failed (%s)] +es,base,204,[Could not remove temporary directory %s, Error %d] +es,base,205,[Could not remove temporary directory %s, Error %d] +es,dsgw,-1,[$DBT: dsgw in DB file v1 $] +es,dsgw,1,[Se desconoce el método de solicitud HTTP] +es,dsgw,2,[Los datos del formulario HTML no son válidos o son incompletos] +es,dsgw,3,[Memoria agotada] +es,dsgw,4,[Falta una entrada necesaria de solicitud/formulario] +es,dsgw,5,[La vía de acceso contiene caracteres no válidos] +es,dsgw,6,[Falta el archivo de configuración o está dañado] +es,dsgw,7,[Imposible inicializar el protocolo LDAP] +es,dsgw,8,[Se ha producido un error al establecer contacto con el servidor LDAP] +es,dsgw,9,[Se desconoce el tipo de objeto de búsqueda] +es,dsgw,10,[Se desconoce la etiqueta de atributo] +es,dsgw,11,[Se desconoce el indicador de correspondencia] +es,dsgw,12,[El tipo de objeto no tiene filtros de búsqueda] +es,dsgw,13,[Imposible abrir el archivo de la plantilla HTML] +es,dsgw,14,[Se desconoce el modo de búsqueda: utilice "smart", "complex", "pattern" o "auth"] +es,dsgw,15,[Falta un nombre distinguido en el URL] +es,dsgw,16,[Se desconoce un ámbito del URL (debe ser base, sub o one)] +es,dsgw,17,[No se reconoce el URL o hay un error desconocido] +es,dsgw,18,[El formato del URL no es correcto] +es,dsgw,19,[Error interno] +es,dsgw,20,[Imposible escribir en el archivo de índices de la plantilla] +es,dsgw,21,[Imposible abrir el archivo de índice de plantillas] +es,dsgw,22,[Imposible leer el directorio] +es,dsgw,23,[Ha fallado la inicialización SSL LDAP (compruebe la vía de acceso de seguridad)] +es,dsgw,24,[Para que los formularios Usuarios y Grupos funcionen mediante SSL, usted o el administrador del servidor tiene que activar SSL en este Administration Server. Para ello, puede utilizar la página Cifrado|activado/desactivado] +es,dsgw,25,[No se han encontrado las credenciales de autentificación en la base de datos de autentificación] +es,dsgw,26,[Error al recuperar datos de la base de datos de autentificación] +es,dsgw,27,[Sus credenciales de autentificación han caducado] +es,dsgw,28,[Imposible crear una cadena aleatoria] +es,dsgw,29,[No se ha especificado un nombre distinguido al recuperar credenciales] +es,dsgw,30,[No se puede abrir la base de datos de autentificación] +es,dsgw,31,[No ha sido posible añadir los datos a la base de datos de autentificación] +es,dsgw,32,[No se ha definido un Gestor de directorios] +es,dsgw,33,[No se ha especificado una cadena de búsqueda. Vuelva a intentarlo] +es,dsgw,34,[Una de las líneas del archivo config. contiene demasiados argumentos] +es,dsgw,35,[No ha sido posible inicializar Windows Sockets] +es,dsgw,36,[No se han recibido las credenciales de autentificación del Administration Server] +es,dsgw,37,[Falta un nombre distinguido en el URL ldapdb://] +es,dsgw,38,[No se reconoce el URL o hay un error desconocido] +es,dsgw,39,[El formato del URL no es correcto] +es,dsgw,40,[Se ha producido un error al inicializar la base de datos ldap local] +es,dsgw,41,[Se desconoce el tipo de servicio de directorios: utilice "local" o "remote"] +es,dsgw,42,[Se ha producido un error al leer el archivo de configuración de base de datos] +es,dsgw,43,[La vía de acceso a NSHOME/userdb tenía el valor NULL] +es,dsgw,44,[No ha sido posible actualizar la configuración del servicio de directorios.] +es,dsgw,45,[No ha sido posible leer la entrada desde el directorio.] +es,dsgw,46,[No ha sido posible borrar la base de datos LDAP.] +es,dsgw,47,[No está autorizado a cambiar otras entradas que no sean las suyas propias.] +es,dsgw,48,[Problema] +es,dsgw,49,[Problema de autentificación] +es,dsgw,50,[.\n

              Debe repetir la autentificación para poder continuar.\n] +es,dsgw,51,[.\n

              Debe repetir la autentificación para poder continuar.\n] +es,dsgw,52,[error desconocido] +es,dsgw,53,[La operación se ha realizado con éxito.] +es,dsgw,54,[Se ha producido un error interno en el servidor. Por lo general,\nesto indica un fallo grave del servidor.\nComuníqueselo al administrador del servidor.] +es,dsgw,55,[El servidor no ha entendido la solicitud que le ha llegado desde\nla pasarela.] +es,dsgw,56,[Se ha sobrepasado el límite de tiempo para responder a su solicitud.\nSi lo que busca son entradas, es posible que obtenga mejores\nresultados si realiza una búsqueda más específica.] +es,dsgw,57,[Se ha sobrepasado el límite de tamaño para responder a su solicitud.\nSi lo que busca son entradas, es posible que obtenga mejores\nresultados si realiza una búsqueda más específica, ya que existen\ndemasiadas entradas que cumplen los criterios de búsqueda.] +es,dsgw,58,[La pasarela ha intentado autentificarse en el servidor\nmediante un método que el servidor no entiende.] +es,dsgw,59,[La pasarela ha intentado autentificarse ante el servidor mediante un\nmétodo de autentificación incompatible con el servidor. ] +es,dsgw,60,[No ha sido posible atender su solicitud, probablemente porque\nel servidor con el que se ha establecido contacto no contiene los datos que\nusted busca. Es posible que se haya recibido\nuna referencia a otro servidor\nal que no es posible acceder. Si tenía la intención\n de realizar cambios en el directorio, puede que no esté disponible el servidor\nque contiene la copia maestra de los datos.] +es,dsgw,61,[Su solicitud ha sobrepasado un límite administrativo en el servidor.] +es,dsgw,62,[La pasarela ha solicitado una extensión crítica que no está disponible en el servidor.] +es,dsgw,63,[El servidor no ha podido procesar la solicitud debido a que\nésta contiene una referencia a un atributo que no\nexiste en la entrada.] +es,dsgw,64,[El servidor no ha podido atender la solicitud debido a que\nésta no cumple con una restricción de la base de datos.] +es,dsgw,65,[El servidor no ha podido añadir un valor a la entrada debido a que\ndicho valor ya está incluido en la entrada.] +es,dsgw,66,[El servidor no ha encontrado la entrada. Si desea añadir\nuna entrada, compruebe que exista su entrada primaria. Si este error\nse ha producido durante una búsqueda, indica que no existe\nla entrada que se está buscando.\nSi ha intentado autentificarse como gestor de directorios y se ha producido\neste error, compruebe el archivo de configuración de la pasarela.] +es,dsgw,67,[Un nombre distinguido no tenía el formato correcto. ] +es,dsgw,68,[Ha intentado autentificarse mediante una entrada que no tiene un\nconjunto de contraseñas o que carece de otras credenciales\nnecesarias para la autentificación. No podrá utilizar esa entrada para la autentificación\nhasta que el gestor de directorios haya añadido\nlos atributos correspondientes.] +es,dsgw,69,[La contraseña u otras credenciales de autentificación especificadas\nno son correctas.] +es,dsgw,70,[No dispone de suficientes derechos de acceso para realizar la operación. ] +es,dsgw,71,[El servidor está demasiado ocupado para atender su\nsolicitud. Vuelva a intentarlo dentro de unos minutos.] +es,dsgw,72,[No ha sido posible establecer contacto con el servidor LDAP.] +es,dsgw,73,[El servidor se ha negado a procesar su solicitud,\nprobablemente porque se saturaría durante la operación. También puede indicar que el servidor no está\nconfigurado para procesar su solicitud. Si está realizando una búsqueda,\nquizás convenga limitar el ámbito de la misma.] +es,dsgw,74,[El servidor de directorios no ha podido atender su solicitud porque\nno cumple con los requisitos del esquema. Normalmente, esto suele indicar\nque no se ha especificado el valor de un campo necesario, aunque también\npodría indicar que es necesario actualizar el esquema del servidor de directorios.] +es,dsgw,75,[El servidor de directorios no permite eliminar una entrada\nni cambiarle el nombre si tiene entradas secundarias. Si desea realizar esta operación,\ndeberá eliminar en primer lugar todas las entradas secundarias.] +es,dsgw,76,[El servidor no ha podido añadir una entrada nueva o cambiar el nombre de\nuna entrada ya existente porque ese nombre ya se utiliza.] +es,dsgw,77,[Su solicitud afectaría a varios servidores de directorios.] +es,dsgw,78,[No ha sido posible establecer contacto con el servidor de directorios.\nConsulte con el administrador del servidor.] +es,dsgw,79,[Se ha producido un error al enviar datos al servidor.] +es,dsgw,80,[Se ha producido un error al leer datos desde el servidor.] +es,dsgw,81,[El servidor no ha respondido a la solicitud.\nHa vencido el tiempo de espera de la solicitud.] +es,dsgw,82,[El servidor no admite el método de autentificación que\nutiliza la pasarela.] +es,dsgw,83,[El filtro de búsqueda que ha formado la pasarela tiene un error.] +es,dsgw,84,[La operación se ha cancelado a solicitud del usuario.] +es,dsgw,85,[Se ha producido un error interno en la biblioteca: un parámetro\nera incorrecto.] +es,dsgw,86,[No ha sido posible abrir una conexión con el servidor.\nConsulte con el administrador del servidor.] +es,dsgw,87,[Se ha producido un error desconocido.] +es,dsgw,88,[La entrada ya existe] +es,dsgw,89,[Ya existe una entrada con el nombre ] +es,dsgw,90,[onMouseOver="window.status='Haga clic aquí para ver esta entrada'; return true"] +es,dsgw,91,[ .

              Elija otro nombre u otra ubicación.\n

              \n] +es,dsgw,92,[No existe la entrada primaria] +es,dsgw,93,[No puede añadir una entrada mediante este nombre:

              %s,

              \nya que no existe su entrada primaria.

              \nPara poder añadir esta entrada, deberá añadir en primer lugar\n] +es,dsgw,94,[su entrada primaria.\n] +es,dsgw,95,[una entrada con este nombre:

              %s.\n] +es,dsgw,96,[Advertencia: sin autentificar (continuación)...\n] +es,dsgw,97,[%s la entrada de directorio] +es,dsgw,98,[

              DN de la entrada: %s

              \n] +es,dsgw,99,[Han quedado guardados los cambios realizados en %s] +es,dsgw,100,[%s has been added.] +es,dsgw,101,[%s has been deleted.] +es,dsgw,102,[Renamed %s to %s.] +es,dsgw,103,[

              Nota: debido a que ha %s la entrada que utilizó como\nautentificación, ha sido necesario descartar sus credenciales de \nautentificación. Si desea realizar más cambios,\ndeberá volver a autentificarse.\n] +es,dsgw,104,[eliminado] +es,dsgw,105,[cambiado el nombre de] +es,dsgw,106,[cambiado la contraseña de] +es,dsgw,107,[Se ha cambiado el atributo %s
              \n] +es,dsgw,108,[ NO ASCII (%ld bytes)\n] +es,dsgw,109,[No se han introducido valores. Vuelva a intentarlo.\n] +es,dsgw,110,[No se han realizado cambios.\n] +es,dsgw,111,[

              Enviando %s al servidor de directorios...\n] +es,dsgw,112,[información] +es,dsgw,113,[cambios] +es,dsgw,114,[

              Se ha añadido la entrada sin problemas.\n] +es,dsgw,115,[

              Se ha modificado la entrada sin problemas. Los cambios han quedado guardados.\n] +es,dsgw,116,[

              Se ha eliminado la entrada sin problemas.\n] +es,dsgw,117,[

              El nombre nuevo de la entrada es: %s\n

              \n] +es,dsgw,118,[

              Se ha cambiado el nombre de la entrada sin problemas.\n] +es,dsgw,119,[Es necesario especificar la contraseña antigua.] +es,dsgw,120,[Es necesario especificar una contraseña nueva. Vuelva a intentarlo] +es,dsgw,121,[La contraseña de confirmación no coincide con la contraseña nueva. Vuelva a intentarlo] +es,dsgw,122,[
              El %s %s ya está en uso. Elija otro.
              \n] +es,dsgw,123,[falta el elemento "%.100s" de los datos del formulario] +es,dsgw,124,[Inicializando la información de configuración] +es,dsgw,125,[Imposible abrir el archivo.] +es,dsgw,126,[Archivo dbconf mal construido.] +es,dsgw,127,[Falta un nombre de propiedad en el archivo dbconf.] +es,dsgw,128,[Memoria agotada.] +es,dsgw,129,[Falta una directiva en el archivo dbconf.] +es,dsgw,130,[Imposible abrir el archivo de configuración "%s"\n] +es,dsgw,131,[Falta un argumento en la directiva "authlifetime"\n] +es,dsgw,132,[Falta un argumento en la directiva "dirmgr"\n] +es,dsgw,133,[Falta un argumento en la directiva "baseurl"\n] +es,dsgw,134,[Se ha especificado un URL erróneo para la directiva "baseurl": falta el DN de base\n] +es,dsgw,135,[analizando la directiva baseurl] +es,dsgw,136,[Se ha especificado un URL erróneo para la directiva "baseurl": no es un URL "ldap://"\n] +es,dsgw,137,[Todavía no son compatibles las direcciones URL "ldap://"\n] +es,dsgw,138,[Faltan argumentos en la directiva "template"\n] +es,dsgw,139,[Faltan un argumento en la directiva "sslrequired"\n] +es,dsgw,140,[Se desconoce un argumento de la directiva "sslrequired" (debería ser "never", "whenauthenticated", "always")\n] +es,dsgw,141,[Falta un argumento en la directiva "securitypath"\n] +es,dsgw,142,[Falta un argumento en la directiva "location-suffix"\n] +es,dsgw,143,[La directiva "location" necesita tres argumentos\n] +es,dsgw,144,[La directiva "newtype" necesita dos argumentos como mínimo\n] +es,dsgw,145,[Se desconoce una ubicación en la directiva "newtype"\n] +es,dsgw,146,[La directiva "tmplset" necesita tres o cuatro argumentos\n] +es,dsgw,147,[La directiva "attrvset" necesita cuatro argumentos\n] +es,dsgw,148,[Falta un argumento en la directiva "charset"\n] +es,dsgw,149,[Falta un argumento en la directiva "ClientLanguage"\n] +es,dsgw,150,[Falta un argumento en la directiva "AdminLanguage"\n] +es,dsgw,151,[Falta un argumento en la directiva "DefaultLanguage"\n] +es,dsgw,152,[Falta un nombre de archivo en la directiva "include"\n] +es,dsgw,153,[Se desconoce una directiva del archivo config\n] +es,dsgw,154,[<= erase_db no ha podido abrir el archivo lcache.conf "%s"\n] +es,dsgw,155,[\n

              Se ha eliminado la base de datos. Creando una base de datos nueva... \n\n ] +es,dsgw,156,[\n

              No ha sido posible eliminar la base de datos \n\n ] +es,dsgw,157,[<= app_suffix no ha podido abrir el archivo ldif "%s"\n] +es,dsgw,158,[<= app_suffix no ha podido abrir el archivo temporal "%s"\n] +es,dsgw,159,[Imposible cambiar el nombre de %s a %s] +es,dsgw,160,[dbconf_read_default_dbinfo() ha devuelto un puntero NULL.] +es,dsgw,161,[El URL "ldapdb" es erróneo: falta el DN de base\n] +es,dsgw,162,[El URL "ldapdb" es erróneo\n] +es,dsgw,163,[Se ha especificado un URL erróneo en la directiva "baseurl": falta el DN de base\n] +es,dsgw,164,[analizando la directiva baseurl] +es,dsgw,165,[Se ha especificado un URL erróneo en la directiva "baseurl": no es un URL "ldap:// o ldapdb://"\n] +es,dsgw,166,[Todavía no son compatibles las direcciones URL "ldap://"\n] +es,dsgw,167,[No se ha dado ningún valor para binddn] +es,dsgw,168,[No se ha dado ningún valor para bindpw] +es,dsgw,169,[No se ha definido un servicio predeterminado de directorios en el archivo dbswitch.conf] +es,dsgw,170,[Imposible abrir el archivo de configuración "%s" para escribir en él] +es,dsgw,171,[Imposible cambiar el nombre de %s a %s] +es,dsgw,172,[archivo de configuración %s: ] +es,dsgw,173,[archivo de configuración %s: línea %d: ] +es,dsgw,174,[máx %d] +es,dsgw,175,[ OK ] +es,dsgw,176,[Cerrar la ventana] +es,dsgw,177,[Retroceder] +es,dsgw,178,[{crypt}BLOQUEADO [%s GMT]] +es,dsgw,179,[Volver a la pantalla principal] +es,dsgw,181,[ Help ] +es,dsgw,182,[Ayuda] +es,dsgw,184,[Todavía no hay ayuda disponible.] +es,dsgw,186,[Cerrar la ventana] +es,dsgw,187,[Cerrar la ventana] +es,dsgw,188,[El URL no incluía un nombre de plantilla justo después de "?"] +es,dsgw,189,[Autentificar...] +es,dsgw,190,[¿Desea descartar las credenciales de autentificación (finalizar la sesión?] +es,dsgw,191,[Escriba una cadena de búsqueda] +es,dsgw,192,[Como primer paso para autentificarse ante el directorio,\n identifíquese.
              Introduzca su nombre:] +es,dsgw,193,[Continuar] +es,dsgw,194,[Continuar] +es,dsgw,195,[Cancelar] +es,dsgw,196,[Autentificarse como gestor de directorios"> Â (solamente para los administradores de directorios)\n] +es,dsgw,197,[Autentificar...] +es,dsgw,198,[¿Desea descartar las credenciales de autentificación?] +es,dsgw,200,[Continuar] +es,dsgw,201,[Continuar] +es,dsgw,202,[Cancelar] +es,dsgw,203,[Autentifíquese (inicie la sesión) en el directorio] +es,dsgw,204,[Está a punto de autentificarse en el directorio como %s. Para concluir el proceso de autentificación, escriba su contraseña.\n] +es,dsgw,206,[Para poder modificar o añadir entradas, es necesario autentificarse\n(iniciar sesión) en el directorio. Esta ventana le servirá de\nguía para realizar el proceso\nde autentificación.\n] +es,dsgw,207,[Desde esta pantalla, es posible autentificarse (iniciar sesión)\nen el directorio. Para poder modificar entradas del directorio, es necesario\realizar la autentificación en primer lugar.\nSi intenta modificar una entrada si haberse autentificado,\nel sistema le pedirá que inicie sesión.\n] +es,dsgw,208,[Estado de la autentificación] +es,dsgw,209,[\nActualmente, se encuentra autentificado en el directorio como ] +es,dsgw,210,[.\nSi desea descartar las credenciales de autentificación y finalizar la sesión en el directorio, haga clic en el botón que aparece a continuación.] +es,dsgw,211,[Descartar credenciales de autentificación (finalizar sesión)] +es,dsgw,212,[Sus credenciales de autentificación en ] +es,dsgw,213,[han caducado.\n


              \n] +es,dsgw,214,[Actualmente, no se encuentra autentificado en el directorio.
              \n] +es,dsgw,215,[falta "%s=" ] +es,dsgw,216,[se desconoce "%s=%s"] +es,dsgw,217,[se desconoce la opción %s] +es,dsgw,218,[se desconoce la sintaxis=%s\n] +es,dsgw,219,[** El tipo de HTML "%s" no es compatible **
              \n] +es,dsgw,224,[Modificar] +es,dsgw,225,[Save Changes] +es,dsgw,226,[modify] +es,dsgw,227,[add] +es,dsgw,228,[Eliminar] +es,dsgw,229,[¿Desea eliminar esta entrada?] +es,dsgw,230,[Cambiar el nombre] +es,dsgw,231,[Escriba un nombre nuevo para esta entrada:] +es,dsgw,232,[Modificar como] +es,dsgw,233,[falta %s=] +es,dsgw,234,[Cerrar la ventana] +es,dsgw,235,[Modificar...] +es,dsgw,236,[falta"%s="\n] +es,dsgw,237,[se desconoce el conjunto "%s"\n] +es,dsgw,238,[se desconoce la sintaxis "%s"\n] +es,dsgw,239,[Repetir la autentificación] +es,dsgw,240,[Cerrar la ventana] +es,dsgw,241,[Confirme que desea ] +es,dsgw,242,[?] +es,dsgw,243,[ Aceptar ] +es,dsgw,244,[ Aceptar ] +es,dsgw,245,[ Restablecer ] +es,dsgw,246,[ Terminado ] +es,dsgw,247,[ Cancelar ] +es,dsgw,248,[se ha encontrado otra sentencia IF (no se admiten las sentencias IF anidadas)] +es,dsgw,249,[se ha encontrado una sentencia ELSE, pero no aparece la IF] +es,dsgw,250,[se ha encontrado una sentencia ELSE después de ELSE (se esperaba encontrar ENDIF)] +es,dsgw,251,[se ha encontrado una sentencia ELIF, pero no aparece la IF] +es,dsgw,252,[se ha encontrado una sentencia ELIF después de ELSE (se esperaba encontrar ENDIF)] +es,dsgw,253,[se ha encontrado una sentencia ENDIF, pero no aparece la IF] +es,dsgw,254,[
              error de plantilla: %s
              \n] +es,dsgw,255,[se ha intentado el proceso ldap_init/lcache_init antes de leer el archivo de configuración] +es,dsgw,256,[no se ejecuta bajo el Administration Server] +es,dsgw,257,[No se han podido inicializar los permisos] +es,dsgw,258,[No ha sido posible asignar el nombre de usuario a un DN (el Administration Server ha comunicado un error)] +es,dsgw,259,[No se ha recibido el nombre de usuario actual] +es,dsgw,260,[No se ha recibido la contraseña del usuario actual] +es,dsgw,261,[Error: %s] +es,dsgw,262,[Nota: no se encuentra disponible ninguna plantilla de presentación para este tipo de\nentrada; la entrada se muestra a continuación con un método predeterminado.] +es,dsgw,263,[La identifación de usuario no es válida o el identifador LDAP tiene el valor NULL] +es,dsgw,264,[no coincide ninguna identificación de usuario] +es,dsgw,265,[coinciden varias identificaciones de usuario] +es,dsgw,266,[the entire directory] +es,dsgw,267,[La directiva "includeset" necesita dos argumentos\n] +es,dsgw,268,[No se ha encontrado en esta entrada el valor de atributo solicitado] +es,dsgw,269,[Falta un argumento en la directiva "NLS"\n] +es,dsgw,270,[Es necesario especificar un valor de identificación de usuario NT\n ] +es,dsgw,271,[La combinación de identificaciones de usuario NT y dominio NT ya se utiliza en el directorio\n] +es,dsgw,272,[Es necesario especificar valores de identificación de usuario NT y de dominio NT\n] +es,dsgw,273,[La identifiación de usuario NT no puede contener más de 20 caracteres.\n] +es,dsgw,274,[Especifique el nombre de la entrada nueva.] +es,dsgw,275,[Seleccione la ubicación de la entrada nueva.] +es,dsgw,276,[Entrada nueva] +es,dsgw,277,[Para poder utilizar esta función, el archivo dsgw.conf debe contener una definición de dirmgr] +es,dsgw,278,[La directiva "vcard-property" necesita tres o cuatro argumentos\n] +es,dsgw,279,[La sintaxis de la propiedad VCard debe ser "cis" o "mls"\n] +es,dsgw,280,[No se han encontrado entradas.\n%2$s] +es,dsgw,281,[No se han encontrado entradas en las que %2$s %3$s '%4$s'.\n] +es,dsgw,282,[Se ha realizado la búsqueda, pero no se ha encontrado ninguna entrada.\n%2$s] +es,dsgw,283,[Se ha realizado la búsqueda, pero no se ha encontrado ninguna entrada en la que %2$s %3$s %4$s'.\n] +es,dsgw,284,[Se ha encontrado 1 entrada.\n%2$s] +es,dsgw,285,[Se ha encontrado 1 entrada en la que %2$s %3$s '%4$s'.\n] +es,dsgw,286,[Se ha realizado la búsqueda y se ha encontrado 1 entrada.\n%2$s] +es,dsgw,287,[Se ha realizado la búsqueda y se ha encontrado 1 entrada en la que %2$s %3$s '%4$s'.\n] +es,dsgw,288,[Se han encontrado %1$li entradas.\n%2$s] +es,dsgw,289,[Se han encontrado %1$li entradas en las que %2$s %3$s '%4$s'.\n] +es,dsgw,290,[Se ha realizado la búsqueda y se han encontrado %1$li entradas.\n%2$s] +es,dsgw,291,[Se ha realizado la búsqueda y se han encontrado %1$li entradas en las que %2$s %3$s '%4$s'.\n] +es,dsgw,292,[el filtro LDAP es] +es,dsgw,293,[El servidor no ha encontrado la entrada que usted ha utilizado el autentificarse. Es posible que se haya eliminado la entrada o que alguien le haya cambiado el nombre. Intente volver a realizar la autentificación.] +es,dsgw,294,[La sintaxis de la contraseña nueva no es válida.\n] +es,dsgw,295,[La contraseña nueva ya existe en el historial de contraseñas.\n] +es,dsgw,296,[Ha sobrepasado el límite de reintentos de contraseña. Consulte con el administrador del sistema.\n] +es,dsgw,297,[Ha sobrepasado el límite de reintentos de contraseña. Vuelva a intentarlo más adelante.\n] +es,dsgw,298,[La contraseña ha caducado. Consulte con el administrador del sistema para restablecer la contraseña.\n] +es,frame,-1,[$DBT: frame in DB file v1 $] +es,frame,1,[No se ha encontrado

              No se ha encontrado

              El objeto solicitado no existe en este servidor. El vínculo que ha seguido no está actualizado o no es exacto, o bien el servidor ha recibido instrucciones para no permitirle el acceso.] +es,frame,2,[Informe al administrador de la oficina acerca de la página que contiene la referencia.] +es,frame,3,[El navegador ha enviado una solicitud que este servidor proxy no ha entendido.] +es,frame,4,[Es necesario disponer de la autorización adecuada para la administración de\neste servidor proxy. El navegador no puede conceder la autorización,\no la autorización no se ha podido realizar.] +es,frame,5,[Es necesaria la autentificación de nombre de usuario para utilizar\neste servidor proxy. El navegador no puede conceder la autorización,\no la autorización no se ha podido realizar.] +es,frame,6,[La configuración de control de acceso al servidor proxy deniega\nel acceso al objeto solicitado mediante este servidor proxy.] +es,frame,7,[El servidor proxy ha encontrado un error interno que le impide\natender su solicitud. Lo más probable es que se deba a una configuración\nerrónea. Solicite al administrador que examine el registro de errores del servidor proxy.] +es,frame,8,[Este servidor proxy no utiliza el método solicitado.] +es,frame,9,[Se ha producido un error en el servidor proxy.] +es,frame,10,[El navegador ha enviado una consulta que este servidor no ha entendido.] +es,frame,11,[Es necesario disponer de la autorización adecuada para acceder a esta zona. El navegador no puede conceder la autorización o la autorización no se ha podido realizar] +es,frame,12,[Su cliente no está autorizado a acceder al objeto que ha solicitado.] +es,frame,13,[El servidor ha encontrado un error interno que le impide atender su solicitud. Lo más probable es que se deba a una configuración errónea. Solicite al administrador que examine el registro de errores del servidor.] +es,frame,14,[Este servidor no utiliza el método solicitado.] +es,frame,15,[Se ha producido un error.] +es,frame,16,[El navegador ha enviado un mensaje que este servidor no ha entendido.] +es,frame,17,[%s

              %s

              \nEste documento ha sido trasladado a otra ubicación. Actualice los documentos y listas de acceso con los nuevos datos.] +es,frame,18,[%s\n

              %s

              \n%s\n] +es,frame,19,[process-uri-objects] +es,frame,20,[cannot find template %s] +es,frame,21,[process-uri-objects] +es,frame,22,[no partial path after object processing] +es,frame,23,[find-service] +es,frame,24,[invalid shexp %s] +es,frame,25,[find-service] +es,frame,26,[invalid shexp %s] +es,frame,27,[handle-processed] +es,frame,28,[no way to service request for %s] +es,frame,29,[finish-socks-request] +es,frame,30,[close failed (%s), csd=%d] +es,frame,31,[This beta software has expired.\n] +es,frame,32,[mr_accept(%d)] +es,frame,33,[Error issuing read on accept socket] +es,frame,34,[acb_accept_connection(%d)] +es,frame,35,[Error getting accept socket (%d)] +es,frame,36,[Error in accept! (%d, %s)] +es,frame,37,[Error creating new accept request] +es,frame,38,[accepted connection: %d (NSPR %d)] +es,frame,39,[Error creating new session structure] +es,frame,40,[accel_read_request()] +es,frame,41,[Error allocating request read buffer] +es,frame,42,[Error issuing async read request] +es,frame,43,[acb_read_request(%d, bytes %d)] +es,frame,44,[acb_read_req(1 session = %d)] +es,frame,45,[Error reading request (%d, %s)] +es,frame,46,[Client aborted connection] +es,frame,47,[Error reading request] +es,frame,48,[Error creating new request] +es,frame,49,[error occurred, closing %d, io was for %d] +es,frame,50,[accel_async_scan_headers()] +es,frame,51,[out of memory: accel_async_scan_headers] +es,frame,52,[out of memory: accel_async_scan_headers] +es,frame,53,[Error during async read (%d, %s)] +es,frame,54,[scan-headers reports: line too long] +es,frame,55,[scan-headers reports: too many headers] +es,frame,56,[Error reading headers] +es,frame,57,[scan-headers reports: header missing terminator (an empty line)] +es,frame,58,[scan-headers reports: header was empty] +es,frame,59,[nombre sin valor: se ha recibido la línea "%s"] +es,frame,60,[accel_send_plain_file()] +es,frame,61,[accel_send_plain_file() - found request %d] +es,frame,62,[Parse headers lost the URI!] +es,frame,63,[accel_send_plain_file() - found uri %s] +es,frame,64,[accel_send_plain_file() - found in cache?] +es,frame,65,[malloc died!] +es,frame,66,[Error writing back file\n] +es,frame,67,[acb_send_plain_file(%d)] +es,frame,68,[Error writing in acb_send_plain_file (%d, %s)] +es,frame,69,[acb_close_connection(%d)] +es,frame,70,[Errored IO in acb_close_connection (%d, %s)] +es,frame,71,[Unable to close socket %d] +es,frame,72,[accel-cache-insert: Error allocating entry] +es,frame,73,[cache-init: server cache disabled] +es,frame,74,[accel_file_cache: Error initializing file cache] +es,frame,75,[accel_file_cache: Error creating cache] +es,frame,76,[accel_file_cache_init: CacheHashSize < %d, using %d] +es,frame,77,[accel_file_cache_init: CacheHashSize > %d, using %d] +es,frame,78,[accel_file_cache_init: MaxNumberOfCachedFiles < %d, using %d] +es,frame,79,[accel_file_cache_init: MaxNumberOfCachedFiles > %d, using %d] +es,frame,80,[accel_file_cache_init: MaxNumberOfOpenCachedFiles < %d, using %d] +es,frame,81,[accel_file_cache_init: MaxNumberOfOpenCachedFiles > %d, using %d] +es,frame,82,[accel_file_cache: Error initializing file cache] +es,frame,83,[file-cache: enabled = %s ] +es,frame,84,[on] +es,frame,85,[off] +es,frame,86,[file-cache: MaxNumberOfCachedFiles %d (0x%x)] +es,frame,87,[file-cache: CacheHashSize %d (0x%x)] +es,frame,88,[file-cache: MaxNumberOfOpenCachedFiles %d (0x%x)] +es,frame,89,[accel-cache-insert: Error allocating entry] +es,frame,90,[file-cache-cleanup: munmap failed (%s)] +es,frame,91,[file-cache-cleanup: found mmapped file \non system without mmap] +es,frame,92,[file_cache_init: MaxTotalCachedFileSize < %d, using %d] +es,frame,93,[file_cache_init: MaxTotalCachedFileSize > %d, using %d] +es,frame,94,[file cache using mmap flags 0x%x] +es,frame,95,[file cache using mmap prots 0x%x] +es,frame,96,[file-cache-init: could not create lock] +es,frame,97,[file-cache: unable to create temporary directory %s.\n] +es,frame,98,[file-cache: unable to create temporary directory %s.\n] +es,frame,99,[file-cache: GetTempPath() Cannot find temp directory to store file!] +es,frame,100,[file-cache-init: set max cached file size to %d] +es,frame,101,[file-cache-init: could not create lock] +es,frame,102,[file_cache_destroy()] +es,frame,103,[file-cache: Unable to get temp file name. Error %s] +es,frame,104,[file-cache: Unable to get temp file name. Error %s] +es,frame,105,[file-cache-insert: Error allocating entry] +es,frame,106,[file-cache-create: Error opening file %s (%s)] +es,frame,107,[file-cache-create: Error stat()ing file %s (%s)] +es,frame,108,[file-cache-create: Error mmap()ing file %s (%s)] +es,frame,109,[file-cache-create: malloc failure] +es,frame,110,[file-cache-create: error case failed to munmap(%d, %d) (%s)] +es,frame,111,[file-cache-valid: cannot stat %s] +es,frame,112,[dir change: invalidating %s (%d)] +es,frame,113,[file-cache: asynchronous file change notification failed.] +es,frame,114,[dir change: offset %d, action %d, len %d, name %s] +es,frame,115,[unable to check async file status] +es,frame,116,[ReadDirectoryChangesW failure- unable to continue watching %s. Error is %s] +es,frame,117,[file-cache-add-watch failure- unable to open directory %s. Error %s] +es,frame,118,[ReadDirectoryChangesW failure- unable to start watching %s. Error %s] +es,frame,119,[func_exec] +es,frame,120,[no handler function given for directive] +es,frame,121,[func_exec] +es,frame,122,[cannot find function named %s] +es,frame,123,[handle-request] +es,frame,124,[method without URI] +es,frame,125,[http-parse-request] +es,frame,126,[while scanning HTTP headers, %s] +es,frame,127,[handle-request] +es,frame,128,[read from %s failed, error is %s] +es,frame,129,[handle-request] +es,frame,130,[request too long] +es,frame,131,[start-http-response] +es,frame,132,[write failed (%s)] +es,frame,133,[start-http-response] +es,frame,134,[write failed (%s)] +es,frame,135,[http-status] +es,frame,136,[%d is not a valid HTTP status code] +es,frame,137,[finish-request] +es,frame,138,[close failed (%s)] +es,frame,139,[Unable to close socket for writing] +es,frame,140,[os has %d objects] +es,frame,141,[obj %d has no hash table at %d] +es,frame,142,[obj %d has no param] +es,frame,143,[obj %d name %s value %s] +es,frame,144,[.....directives %d.......] +es,frame,145,[.....directive %d] +es,frame,146,[.......instance %d] +es,frame,147,[...........param name %s value %s] +es,frame,148,[ClearConfigurationParameters:RegCreateKey %s] +es,frame,149,[ClearConfigurationParameters:RegEnumKey %s failed] +es,frame,150,[obj.conf line %d: error in filter file "%s" at line %d: %s] +es,frame,151,[obj.conf line %d: error in filter file "%s" at line %d: %s] +es,frame,152,[Unable to allocate Subject property list.\n] +es,frame,153,[Unable to set session ptr in Subject property list - error=%d\n] +es,frame,154,[Unable to set request ptr in Subject property list - error=%d\n] +es,frame,155,[file-cache-valid: cannot stat %s] +es,frame,156,[file-cache-create: Error stat()ing file %s (%s)] +es,httpdaemon,-1,[$DBT: httpdaemon in DB file v1 $] +es,httpdaemon,1,[Error in ConvertThreadToFiber] +es,httpdaemon,2,[Error in ConvertThreadToFiber] +es,httpdaemon,3,[Error in md_start_system] +es,httpdaemon,4,[Error in CreateFiber - idlefiber] +es,httpdaemon,5,[Error in GetQueuedCompletionStatus] +es,httpdaemon,6,[Error creating completion port] +es,httpdaemon,7,[Could not SetHandleNonInheritable (%s)] +es,httpdaemon,8,[Error accept/read new conn] +es,httpdaemon,9,[Error in Respond()] +es,httpdaemon,10,[Error in RespondCompleted()] +es,httpdaemon,11,[daemon: unable to fork new process (%s)\n] +es,httpdaemon,12,[daemon: setsid failed (%s)\n] +es,httpdaemon,13,[daemon: can't log pid to %s (%s)\n] +es,httpdaemon,14,[warning: could not set group id to %d (%s)\n] +es,httpdaemon,15,[warning: could not set user id to %d (%s)\n] +es,httpdaemon,16,[warning: daemon is running as super-user\n] +es,httpdaemon,17,[could not determine current user name\n] +es,httpdaemon,18,[error: chroot to %s failed (%s)\n] +es,httpdaemon,19,[WARNING! netscape executable and library have different versions.\n] +es,httpdaemon,20,[startup: listening to %s://%s, port %d as %s\n] +es,httpdaemon,21,[startup: listening to %s://%s, port %d as %s\n] +es,httpdaemon,22,[seminit failed (%s)\n] +es,httpdaemon,23,[Using single threaded accepts.] +es,httpdaemon,24,[Using multi threaded accepts.] +es,httpdaemon,25,[Using partial single threaded accepts.] +es,httpdaemon,26,[This machine has %d processors.] +es,httpdaemon,27,[Error calling thr_seconcurrency(%d)- (%s)] +es,httpdaemon,28,[Set conncurrency to %d.] +es,httpdaemon,29,[can't fork new process (%s)] +es,httpdaemon,30,[This beta software has expired.\n] +es,httpdaemon,31,[can't create IPC pipe (%s)] +es,httpdaemon,32,[write to wakeup pipe failed (%s)] +es,httpdaemon,33,[select thread miss] +es,httpdaemon,34,[startup failure: could not bind to port %d (%s)\n] +es,httpdaemon,35,[startup failure: could not bind to port %d, IP address %s (%s)\n] +es,libaccess,-1,[$DBT: libaccess in DB file v1 $] +es,libaccess,1,[basic-ncsa] +es,libaccess,2,[cannot open database %s] +es,libaccess,3,[basic-ncsa] +es,libaccess,4,[user %s password did not match database %s] +es,libaccess,5,[basic-ncsa] +es,libaccess,6,[cannot open connection to LDAP server on %s:%d] +es,libaccess,7,[basic-ncsa] +es,libaccess,8,[user %s password did not match LDAP on %s:%d] +es,libaccess,9,[acl-state] +es,libaccess,10,[missing realm] +es,libaccess,11,[Unable to allocate ACL List Hash\n] +es,libaccess,12,[ACLEvalBuildContext unable to PERM_MALLOC cache structure\n] +es,libaccess,13,[ACLEvalBuildContext unable to create hash table\n] +es,libaccess,14,[ACLEvalBuildContext unable to allocate ACE Entry\n] +es,libaccess,15,[ACLEvalBuildContext unable to allocate ACE entry\n] +es,libaccess,16,[ACLEvalBuildContext unable to allocate Boundary Entry\n] +es,libaccess,17,[ACLEvalBuildContext failed.\n] +es,libaccess,18,[ACL_EvalTestRights: an interim, absolute non-allow value was encountered. right=%s, value=%d\n] +es,libaccess,19,[LASDnsBuild unable to allocate hash table header\n] +es,libaccess,20,[LASDnsBuild unable to add key %s\n] +es,libaccess,21,[LASDnsBuild unable to add key %s\n] +es,libaccess,22,[LASDnsBuild unable to add key %s\n] +es,libaccess,23,[LASDnsBuild unable to add key %s\n] +es,libaccess,24,[LASDnsBuild unable to add key %s\n] +es,libaccess,25,[LAS DNS build received request for attribute %s\n] +es,libaccess,26,[LASDnsEval - illegal comparator %s\n] +es,libaccess,27,[LASDnsEval unable to allocate Context struct\n\n] +es,libaccess,28,[LASDnsEval unable to get session address %d\n] +es,libaccess,29,[LASDnsEval unable to get DNS - error=%s\n] +es,libaccess,30,[LAS Group Eval received request for attribute %s\n] +es,libaccess,31,[LASGroupEval - illegal comparator %s\n] +es,libaccess,32,[LASGroupEval - ran out of memory\n] +es,libaccess,33,[LASGroupEval unable to get session address %d\n] +es,libaccess,34,[LASGroupEval unable to get session address %d\n] +es,libaccess,35,[LASGroupEval - couldn't locate getter for auth-user\n] +es,libaccess,36,[LASGroupEval - Attribute getter for auth-user failed\n] +es,libaccess,37,[LASGroupEval - Attribute getter didn't set auth-user\n] +es,libaccess,38,[Check group membership of user "%s" for group "%s"\n] +es,libaccess,39,[LDAPU_SUCCESS for group "%s"\n] +es,libaccess,40,[LDAPU_FAILED for group "%s"\n] +es,libaccess,41,[LAS_EVAL_FALSE\n] +es,libaccess,42,[LAS_EVAL_TRUE\n] +es,libaccess,43,[LASIpTreeAlloc - no memory\n] +es,libaccess,44,[IP LAS unable to allocate tree node\n] +es,libaccess,45,[IP LAS unable to allocate tree node\n] +es,libaccess,46,[LAS IP build received request for attribute %s\n] +es,libaccess,47,[LASIpEval - illegal comparator %s\n] +es,libaccess,48,[LASIpEval unable to get session address - error=%s\n] +es,libaccess,49,[LASIpEval unable to allocate Context struct\n\n] +es,libaccess,50,[LASIpEval - reach 32 bits without conclusion value=%s] +es,libaccess,51,[LAS Program Eval received request for attribute %s\n] +es,libaccess,52,[LASProgramEval - illegal comparator %s\n] +es,libaccess,53,[LASProgram unable to get session address %d\n] +es,libaccess,54,[bin] +es,libaccess,55,[LASProgramEval: request not of type admin or bin, passing.\n] +es,libaccess,56,[LASProgramEval: check if program %s matches pattern %s.\n] +es,libaccess,57,[LASProgramEval: Invalid wildcard expression %s.\n] +es,libaccess,58,[LAS_EVAL_FALSE\n] +es,libaccess,59,[LAS_EVAL_TRUE\n] +es,libaccess,60,[Unexpected attribute in dayOfWeek - %s\n] +es,libaccess,61,[Illegal comparator for dayOfWeek - %s\n] +es,libaccess,62,[Unexpected attribute in timeOfDay - %s\n] +es,libaccess,63,[LAS User Eval received request for attribute %s\n] +es,libaccess,64,[LASUserEval - illegal comparator %s\n] +es,libaccess,65,[LASUserEval - ran out of memory\n] +es,libaccess,66,[LASUserEval unable to get session address %d\n] +es,libaccess,67,[LASUserEval unable to get session address %d\n] +es,libaccess,68,[LASGroupEval - couldn't locate getter for auth-user\n] +es,libaccess,69,[LASGroupEval - Attribute getter for auth-user failed\n] +es,libaccess,70,[LASGroupEval - Attribute getter didn't set auth-user\n] +es,libaccess,71,[Check if uid == user (i.e. check "%s" == "%s)"\n] +es,libaccess,72,[SUCCESS for user "%s"\n] +es,libaccess,73,[FAILED for user "%s"\n] +es,libaccess,74,[LAS_EVAL_FALSE\n] +es,libaccess,75,[LAS_EVAL_TRUE\n] +es,libaccess,76,[] +es,libaccess,77,[LASProgram unable to get request address - error=%s] +es,libaccess,78,[LASProgram rejecting request for program %s from pattern %s] +es,libaccess,79,[ACL_CacheFlush: unable to parse file "%s"\n] +es,libaccess,80,[ACL_CacheFlush: unable to concatenate ACL list "%s"\n] +es,libaccess,81,[ACL_CacheFlush: unable to open and process the magnus file "%s"\n] +es,libaccess,82,[Illegal comparator for timeOfDay - %s\n] +es,libaccess,83,[ACL_EvalBuildContext unable to create hash table\n] +es,libaccess,84,[ACL_EvalBuildContext unable to PERM_CALLOC cache structure\n] +es,libaccess,85,[ACL_EvalBuildContext unable to allocate ACE entry\n] +es,libaccess,86,[ACL_EvalBuildContext unable to allocate auth pointer array\n] +es,libaccess,87,[ACL_EvalBuildContext unable to allocate auth plist\n] +es,libaccess,88,[ACL_EvalTestRights: an interim, absolute non-allow value was encountered. right=%s, value=%s\n] +es,libaccess,89,[ACL_INTEvalTestRights: call to ACL_EvalBuildContext returned failure status\n] +es,libaccess,90,[ACL_ModuleRegister: module name is missing\n] +es,libaccess,91,[ACL_ModuleRegister: call to module init function returned a failed status\n] +es,libaccess,92,[ACL_GetAttribute: couldn't determine method for %s\n] +es,libaccess,93,[ACL_GetAttribute: couldn't locate getter for %s] +es,libaccess,94,[ACL_GetAttribute: attr getter failed to get %s] +es,libaccess,95,[ACL_GetAttribute: attr getter failed to get %s] +es,libaccess,96,[ACL_GetAttribute: All attribute getters declined for attr %s] +es,libaccess,97,[ACL_DatabaseRegister: dbtype for database "%s" is not defined yet!] +es,libaccess,98,[ACL_DatabaseRegister: database name is missing] +es,libaccess,99,[Error reading the DB Map File: %s. Reason: %s] +es,libaccess,100,[URL is missing for database %s] +es,libaccess,101,[Invalid property value pair for database %s] +es,libaccess,102,["default" database must be an LDAP database] +es,libaccess,103,[Multiple "default" databases are being registered] +es,libaccess,104,["default" LDAP database must be registered] +es,libaccess,105,[LASGroupEval unable to get database name - error= %s] +es,libaccess,106,[received invalid program expression %s] +es,libaccess,107,[parse_ldap_url: database url is missing] +es,libaccess,108,[parse_ldap_url: database name is missing] +es,libaccess,109,[parse_ldap_url: error in parsing ldap url. Reason: %s] +es,libaccess,110,[ldap password check: unable to get database name - error=%s] +es,libaccess,111,[ldap password check: unable to get parsed database %s] +es,libaccess,112,[ldap password check: couldn't initialize connection to LDAP. Reason: %s] +es,libaccess,113,[ldap password check: LDAP error: "%s"] +es,libaccess,114,[get_user_ismember_ldap unable to get database name - error=%s] +es,libaccess,115,[get_user_ismember_ldap unable to get parsed database %s] +es,libaccess,116,[ldap password check: couldn't initialize connection to LDAP. Reason: %s] +es,libaccess,117,[get_user_ismember_ldap: group %s does not exist] +es,libaccess,118,[get_user_ismember_ldap: LDAP error: "%s"] +es,libaccess,119,[ACL_LDAPDatabaseHandle: %s is not a registered database] +es,libaccess,120,[ACL_LDAPDatabaseHandle: %s is not an LDAP database] +es,libaccess,121,[ACL_LDAPDatabaseHandle: out of memory] +es,libaccess,122,[ACL_LDAPDatabaseHandle: couldn't initialize connection to LDAP. Reason: %s] +es,libaccess,123,[ACL_LDAPDatabaseHandle: couldn't bind to LDAP server. Reason: %s] +es,libaccess,124,[insufficient dynamic memory] +es,libaccess,125,[error opening file, %s: %s] +es,libaccess,126,[duplicate definition of %s] +es,libaccess,127,[file %s, line %s: duplicate definition of %s] +es,libaccess,128,[file %s, line %s: syntax error] +es,libaccess,129,[file %s, line %s: %s is undefined] +es,libaccess,130,[in acl %s, %s %s is undefined] +es,libaccess,131,[database %s: error accessing %s] +es,libaccess,132,[%s] +es,libaccess,133,[file %s, line %s: invalid syntax] +es,libaccess,134,[file %s, line %s: syntax error at "%s"] +es,libaccess,135,[realm %s is not defined] +es,libaccess,136,[error code = %d] +es,libaccess,137,[internal ACL error] +es,libaccess,138,[invalid argument] +es,libaccess,139,[ACL_DatabaseRegister: dbtype for database "%s" is not defined yet!] +es,libaccess,140,[couldn't determine dbtype from: %s] +es,libaccess,141,[Failed to register database %s] +es,libaccess,142,[ACL call returned failed status] +es,libaccess,143,[file %s: ACL IO error - %s] +es,libaccess,144,[acl_user_exists: memoria agotada] +es,libaccess,145,[acl_user_exists: ya no existe el usuario] +es,libaccess,146,[acl_user_exists: error de plist] +es,libadmin,-1,[$DBT: libadmin in DB file v1 $] +es,libadmin,1,[ Help ] +es,libadmin,2,[ OK ] +es,libadmin,3,[ Reset ] +es,libadmin,4,[ Done ] +es,libadmin,5,[ Cancel ] +es,libir,-1,[$DBT: libadmin in DB file v1 $] +es,libir,1,[An I/O error occurred before all form data could be read.] diff --git a/l10n/dirserv/fr/ns-slapd.txt b/l10n/dirserv/fr/ns-slapd.txt new file mode 100644 index 00000000..394c3881 --- /dev/null +++ b/l10n/dirserv/fr/ns-slapd.txt @@ -0,0 +1,898 @@ +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +/**************************************************************************/ +/* The copyright notice(s) in this Source Code does not indicate actual */ +/* or intended publication of this Source Code. */ +/**************************************************************************/ + +/* This text file was generated by program dblink */ + +$Revision: 1.1 $ +$Log: ns-slapd.txt,v $ +Revision 1.1 2005/01/21 00:40:48 cvsadm +Initial revision + +Revision 1.2.10.5 2003/09/22 19:36:42 ulfw +Update copyright years from 2001 to 2001-2003 + +Revision 1.2.10.4 2001/11/03 01:07:03 richm +XXX use new copyright XXX + +Revision 1.2.10.3 2001/09/20 16:39:16 richm +removed 8 bit copyright character + +Revision 1.2.10.3 2001/09/18 11:48:16 rmarco +Remove copyright caracter from copyright + +Revision 1.2.10.2 2001/02/13 09:59:55 rmarco +Copyrights + +Revision 1.2.10.1 1998/10/10 02:14:08 ggood +Copy from Directory40RtmBranchpoint to DirectoryBranch + +Revision 1.2.2.3.6.1 1998/04/04 23:16:54 mcs +merge changes made on directory31_rtm_branch into server4_directory_branch + +Revision 1.2.2.3.2.1 1998/02/24 05:51:56 noriko +Synched with server3_i18npkg_branch + +Revision 1.1.2.5 1997/12/31 00:28:47 werudge +UTF8 Encoded from fr/ns-slapd.txt.iso8859 : 1.1.2.6 +Based on en/ns-slapd.txt : 1.1.2.3 + +Revision 1.1.2.6 1997/12/31 00:23:39 werudge +Remove \n from dsgw,198 to fix JavaScript problem + +Revision 1.1.2.5 1997/12/19 02:03:54 werudge +Based on en/ns-slapd.txt : 1.1.2.3 +daily 971113.1 SOLARIS-export-optimize-normal-slapd +$EndLog$ + +$StartStringData$ + +fr,base,-1,[$DBT: base in DB file v1 $] +fr,base,1,[mémoire insuffisante pour créer la table de hachage] +fr,base,2,[mémoire insuffisante pour créer la table de hachage ] +fr,base,3,[cache_destroy : les tables du cache semblent corrompues.] +fr,base,4,[impossible d´allouer l´entrée de hachage] +fr,base,5,[cache_insert : impossible de créer l´entrée de cache] +fr,base,6,[HTTP/1.0 200 OK\nContent-type: text/html\n\n] +fr,base,7,[

              Rapport d'état du cache Netscape\n(Netscape cache status report)

              \n] +fr,base,8,[Aucun cache sur le système (No caches on system)

              ] +fr,base,9,[

              cache %s

              \n] +fr,base,10,[Rapport de connexions au cache: %d/%d (%f)\n(Cache hit ratio: as shown)

              \n

              \n] +fr,base,11,[Taille du cache: %d/%d\n(Cache size: as shown)

              \n

              \n] +fr,base,12,[Taille de la table de hachage: %d\n(Hash table size: as shown)

              \n

              \n] +fr,base,13,[mru : %d

              \nlru : %d

              \n] +fr,base,14,[
                Sector de almacenamiento Dirección Clave Recuento de accesos Eliminar Siguiente LRU MRU Datos
                \n] +fr,base,15,[munmap failed (%s)] +fr,base,16,[munmap failed (%s)] +fr,base,17,[close failed (%s)] +fr,base,18,[daemon: unable to fork new process (%s)\n] +fr,base,19,[daemon: setsid failed (%s)\n] +fr,base,20,[daemon: can't log pid to %s (%s)\n] +fr,base,21,[warning: could not set group id to %d (%s)\n] +fr,base,22,[warning: could not set user id to %d (%s)\n] +fr,base,23,[warning: daemon is running as super-user\n] +fr,base,24,[could not determine current user name\n] +fr,base,25,[error: chroot to %s failed (%s)\n] +fr,base,27,[, address %s] +fr,base,28,[warning: statistics disabled (%s)\n] +fr,base,29,[security handshake timed out for pid %d] +fr,base,30,[warning: statistics disabled (%s)\n] +fr,base,31,[secure handshake failed (code %d)\n] +fr,base,32,[accept failed (%s)] +fr,base,33,[warning: statistics disabled (%s)\n] +fr,base,34,[select thread miss] +fr,base,35,[keepalive worker awoken with no work to do] +fr,base,36,[could not create new thread: %d (%s)] +fr,base,37,[wait for sema succeeded, but nothing to dequeue] +fr,base,38,[queue-sema creation failure] +fr,base,39,[error getting processor info for processor %d] +fr,base,40,[Error binding to processor %d] +fr,base,41,[bound process %d to processor %d] +fr,base,42,[Netscape server is not explicitly binding to any processors.] +fr,base,43,[cache monitor exited] +fr,base,44,[cache batch update daemon exited] +fr,base,45,[Using single threaded accepts.] +fr,base,46,[Using multi threaded accepts.] +fr,base,47,[Using partial single threaded accepts.] +fr,base,48,[This machine has %d processors.] +fr,base,49,[Error calling thr_seconcurrency(%d)- (%s)] +fr,base,50,[Set conncurrency to %d.] +fr,base,51,[WARNING! netscape executable and library have different versions.\n] +fr,base,54,[seminit failed (%s)\n] +fr,base,55,[This beta software has expired.\n] +fr,base,56,[Cache monitor respawned] +fr,base,57,[Cache batch update daemon respawned] +fr,base,58,[can't find empty statistics slot] +fr,base,59,[can't fork new process (%s)] +fr,base,60,[assert failed! %s\n] +fr,base,61,[mr_table_init()] +fr,base,62,[malloc failed] +fr,base,63,[malloc failed!] +fr,base,64,[mr_add_io(%d, type %d, file %d)] +fr,base,65,[mr_add_io - stage 1] +fr,base,66,[mr_add_io - stage 2] +fr,base,67,[mr_add_io found invalid IO type %d] +fr,base,68,[mr_add_io - adding timeout] +fr,base,69,[Out of memory!\n] +fr,base,70,[done with mr_add_io] +fr,base,71,[mr_del_io(%d, type %d, file %d)] +fr,base,72,[mr_del_io found invalid IO type %d] +fr,base,73,[mr_lookup_io(%d)] +fr,base,74,[mr_async_io(%d, %d bytes, file %d)] +fr,base,75,[malloc failure adding async IO] +fr,base,76,[Error adding async io!] +fr,base,77,[Cannot seek for read!] +fr,base,78,[read failure! (%d, %s)] +fr,base,79,[do_read read %d bytes for file %d] +fr,base,80,[Cannot seek for write!] +fr,base,81,[writev failure! (%d, %s)] +fr,base,82,[write failure! (%d, %s)] +fr,base,83,[do_write wrote %d bytes for file %d] +fr,base,84,[do_timeout(mrp %d)] +fr,base,85,[do_timeout: found IO (timer=%d, time=%d)] +fr,base,86,[error deleting io] +fr,base,87,[timeout callback failure for %d\n] +fr,base,88,[mr_get_event(%d) - outstanding io %d] +fr,base,89,[mr_get_event: Waiting for reads on FD:] +fr,base,90,[mr_get_event: Waiting for writes on FD:] +fr,base,91,[ %d] +fr,base,92,[ %d] +fr,base,93,[mr_get_event set no timeout] +fr,base,94,[mr_get_event set timeout to: %d.%d sec] +fr,base,95,[error in select (%d, %s)] +fr,base,96,[mr_get_event() - select found %d] +fr,base,97,[error looking up IO fd %d] +fr,base,98,[read failed for fd %d] +fr,base,99,[error deleting io] +fr,base,100,[callback failure for %d\n] +fr,base,101,[error looking up IO fd %d] +fr,base,102,[writing: header len %d, writelen %d, total %d] +fr,base,103,[write failed for fd %d] +fr,base,104,[error deleting io] +fr,base,105,[callback failure for %d\n] +fr,base,106,[Error creating dns cache] +fr,base,107,[dns_cache_init: hash_size <= 0, using %d] +fr,base,108,[dns_cache_init: cache-size <= %d, using %d] +fr,base,109,[dns_cache_init: cache-size is %d is too large, using %d.] +fr,base,110,[dns_cache_init: expire_time <= 0, using %d] +fr,base,111,[dns_cache_init: expire is %d is too large, using %d seconds.] +fr,base,112,[Error creating dns cache] +fr,base,113,[dns-cache-insert: Error allocating entry] +fr,base,114,[dns-cache-insert: malloc failure] +fr,base,115,[successful server startup] +fr,base,116,[%s B%s] +fr,base,117,[Netscape executable and shared library have different versions] +fr,base,118,[ executable version is %s] +fr,base,119,[ shared library version is %s] +fr,base,120,[error reporting shutting down] +fr,base,121,[warning] +fr,base,122,[config] +fr,base,123,[security] +fr,base,124,[failure] +fr,base,125,[catastrophe] +fr,base,126,[info] +fr,base,127,[verbose] +fr,base,128,[event_handler:Failed to wait on events %s] +fr,base,129,[could not wait on resume event event (%s)] +fr,base,130,[dlopen of %s failed (%s)] +fr,base,131,[dlopen of %s failed (%s)] +fr,base,132,[The server is terminating due to an error. Check the event viewer for the error message. SERVER EXITING!] +fr,base,133,[Terminating the server %s] +fr,base,134,[kill_server:cannot open server event %s] +fr,base,135,[kill_server:cannot set server event %s] +fr,base,136,[error: could not get socket (%s)\n] +fr,base,137,[error: could not set socket option (%s)\n] +fr,base,138,[Terminating Service:error: could not bind to address %s port %d (%s)\n] +fr,base,139,[Terminating Service:error: could not bind to port %d (%s)\n] +fr,base,140,[SetHandleNonInheritable: could not duplicate socket (%s)] +fr,base,141,[SetHandleNonInheritable: closing the original socket failed (%s)] +fr,base,142,[Could not SetHandleInformation (%s)] +fr,base,143,[Terminating Service:Failure: Could not open statistics file (%s)\n] +fr,base,144,[Could not set Thread Local Storage Value for thread at slot %d] +fr,base,145,[secure handshake failed (code %d)\n] +fr,base,146,[accept failed %d (%s)] +fr,base,147,[Failed to pulse Event %d %s] +fr,base,148,[Failed to send MobGrowth Event to parent %s] +fr,base,149,[Pulsing MobRespawn Event %d] +fr,base,150,[respawn thread pool to %d (%d)] +fr,base,151,[Could not open event to signal rotate application. Could not create the MoveLog event:%s] +fr,base,152,[Failed to send MoveLog Event to rotate app %s] +fr,base,153,[growing thread pool from %d to %d] +fr,base,154,[Could not open the ServiceControlManager, Error %d] +fr,base,155,[StartNetsiteService:Could not open the service %s: Error %d] +fr,base,156,[StartNetsiteService:Could not start the service %s] +fr,base,157,[Service Startup: Could not allocate security descriptor] +fr,base,158,[Service Startup: Could not init security descriptor] +fr,base,159,[Service Startup: Could not set the security Dacl] +fr,base,160,[Terminating Service:WinSock init failed: %s] +fr,base,161,[Httpd Server Startup failed: %s] +fr,base,162,[can't find empty statistics slot] +fr,base,163,[NT daemon: could not create new thread %d] +fr,base,164,[Service Startup Failure. Terminating Service:Could not create event %d:%s] +fr,base,165,[Service Startup Error. Could not create the MoveLog event:%s] +fr,base,166,[Failed to wait on Event objects %s] +fr,base,167,[Failed to wait on Event objects %s] +fr,base,168,[pipebuf_buf2sd: pipebuf_grab IO_ERROR %d] +fr,base,169,[pool-init: memory pools disabled] +fr,base,170,[pool-init: free_size <= 0, using %d] +fr,base,171,[pool-create-block: out of memory] +fr,base,172,[pool-create: out of memory] +fr,base,173,[pool-create: out of memory] +fr,base,174,[pool-malloc: out of memory] +fr,base,175,[FREE() used where PERM_FREE() should have been used- problem corrected and supressing further warnings.] +fr,base,176,[regex error: %s (regex: '%s')] +fr,base,177,[can't create IPC pipe (%s)] +fr,base,178,[write to wakeup pipe failed (%s)] +fr,base,179,[flushing %d connections; current %d; tot %d] +fr,base,180,[accept failed (%s)] +fr,base,181,[Error creating time cache] +fr,base,182,[time-cache: cache disabled] +fr,base,183,[time_cache_init: hash_size < %d, using default, %d] +fr,base,184,[time_cache_init: hash_size > %d, using default, %d] +fr,base,185,[time_cache_init: cache_size < %d, using default, %d] +fr,base,186,[time_cache_init: cache_size > %d, using default, %d] +fr,base,187,[Error allocating memory for time_cache] +fr,base,188,[Error allocating memory for time_cache entry] +fr,base,189,[Error allocating memory for time_cache entry] +fr,base,190,[Error inserting new time_cache entry] +fr,base,191,[Error allocating memory for time_cache] +fr,base,192,[cs-terminate failure (%s)] +fr,base,193,[cs-init failure (%s)] +fr,base,194,[cs-wait failure (%s)] +fr,base,195,[cs-post failure (%s)] +fr,base,196,[Unable to create nonblocking socket (%s)] +fr,base,197,[error: could not set keepalive (%s)\n] +fr,base,198,[error: could not set recv timeout (%s)\n] +fr,base,199,[error: could not set send timeout (%s)\n] +fr,base,200,[Unable to create nonblocking socket (%s)] +fr,base,201,[sem_grab failed (%s)] +fr,base,202,[sem_release failed (%s)] +fr,base,203,[sem_release failed (%s)] +fr,base,204,[Could not remove temporary directory %s, Error %d] +fr,base,205,[Could not remove temporary directory %s, Error %d] +fr,dsgw,-1,[$DBT: dsgw in DB file v1 $] +fr,dsgw,1,[Méthode de demande HTTP inconnue (Unknown HTTP request method)] +fr,dsgw,2,[Données HTML de formulaire non valides ou incomplètes (Invalid or incomplete HTML form data)] +fr,dsgw,3,[Mémoire épuisée (Out of memory)] +fr,dsgw,4,[L´entrée de requête/formulaire exigée est manquante (Required query/form input is missing)] +fr,dsgw,5,[Caractère non autorisé dans le chemin d´accès au fichier (Illegal character in file path)] +fr,dsgw,6,[Fichier de configuration erroné ou manquant (Bad or missing configuration file)] +fr,dsgw,7,[Impossible d´initialiser LDAP (Unable to initialize LDAP)] +fr,dsgw,8,[Une erreur est survenue lors du contact du serveur LDAP (An error occurred while contacting the LDAP server)] +fr,dsgw,9,[Type d´objet de recherche inconnu (Unknown search object type)] +fr,dsgw,10,[Etiquette d´attribut inconnue (Unknown attribute label)] +fr,dsgw,11,[Invite de correspondance inconnue (Unknown match prompt)] +fr,dsgw,12,[Aucun filtre de recherche pour ce type d´objet (No search filters for object type)] +fr,dsgw,13,[Impossible d´ouvrir le fichier de modèle HTML (Unable to open HTML template file)] +fr,dsgw,14,[Mode de recherche inconnu; utiliser "smart", "complex", "pattern" ou "auth" (Unknown search mode - use "smart", "complex", "pattern", or "auth")] +fr,dsgw,15,[Nom distinctif manquant dans l´URL (Distinguished Name missing in URL)] +fr,dsgw,16,[Portée inconnue dans l´URL (doit être: base, sub ou one) (Unknown scope in URL (should be base, sub, or one))] +fr,dsgw,17,[URL non reconnu ou erreur inconnue (Unrecognized URL or unknown error)] +fr,dsgw,18,[Format d´URL erroné (Bad URL format)] +fr,dsgw,19,[Erreur interne (Internal error)] +fr,dsgw,20,[Impossible d´écrire sur le fichier d´index de modèles (Unable to write template index file)] +fr,dsgw,21,[Impossible d´ouvrir le fichier d´index de modèles (Unable to open template index file)] +fr,dsgw,22,[Impossible de lire le répertoire (Unable to read directory)] +fr,dsgw,23,[Echec de l´initialisation SSL LDAP (vérifiez le chemin de sécurité) (LDAP SSL initialization failed (check the security path))] +fr,dsgw,24,[Pour que les formulaires d'utilisateurs et de groupes puissent fonctionner sur SSL avec Administration Server, vous-même ou l'administrateur de votre système devez activer SSL. La page Encryption|On/Off peut être utilisée à cette fin.\n(For the Users and Groups forms to work over SSL, you or your server administrator needs to activate SSL for this Administration Server. The Encryption|On/Off page can be used to do so] +fr,dsgw,25,[Références d´authentification introuvables dans la base de données d´authentification (Authentication credentials not found in authentication database)] +fr,dsgw,26,[Erreur de récupération des données depuis la base de données d´authentification (Error retrieving data from the authentication database)] +fr,dsgw,27,[Vos références d´authentification ont expiré (Your authentication credentials have expired)] +fr,dsgw,28,[Impossible de créer une chaîne aléatoire] +fr,dsgw,29,[Aucun nom distinctif n´a été fourni lors du retrait des références (No distinguished name was provided when retrieving credentials)] +fr,dsgw,30,[Impossible d´ouvrir la base de données d´authentification (Cannot open authentication database)] +fr,dsgw,31,[Impossible d´annexer des données à la base de données d´authentification (Could not append data to the authentication database)] +fr,dsgw,32,[Aucun gestionnaire de répertoires n´est défini (No Directory Manager is defined)] +fr,dsgw,33,[Aucune chaîne de recherche n´a été fournie. Veuillez essayer à nouveau (No search string was provided. Please try again)] +fr,dsgw,34,[Le fichier de configuration comporte trop d´arguments sur une ligne (Too many arguments on one line in the config. file)] +fr,dsgw,35,[Echec de l´initialisation des sockets Windows (Failed to initialize Windows Sockets)] +fr,dsgw,36,[Les références d´authentification n´ont pas pu être obtenues auprès d´Administration Server (Authentication credentials could not be obtained from the Administration Server)] +fr,dsgw,37,[Nom distinctif manquant dans l´URL ldapdb:// (Distinguished Name missing in ldapdb:// URL)] +fr,dsgw,38,[URL non reconnu ou erreur inconnue (Unrecognized URL or unknown error)] +fr,dsgw,39,[Format d´URL erroné (Bad URL format)] +fr,dsgw,40,[Une erreur est survenue lors de l'initialisation de la base de données LDAP locale\n(An error occurred while initializing the local LDAP database)] +fr,dsgw,41,[Type de service de répertoires inconnu; utiliser "local" ou "remote" (Unknown directory service type - use "local" or "remote")] +fr,dsgw,42,[Une erreur est survenue lors de la lecture du fichier de configuration db (An error occurred while reading the db configuration file)] +fr,dsgw,43,[Le chemin d´accès à NSHOME/userdb était NULL (NSHOME/userdb path was NULL)] +fr,dsgw,44,[Impossible de mettre à jour la configuration du service de répertoires. (The directory service configuration could not be updated.)] +fr,dsgw,45,[Impossible de lire l´entrée à partir du répertoire. (The entry could not be read from the directory.)] +fr,dsgw,46,[Impossible d´effacer la base de données LDAP. (The LDAP database could not be erased.)] +fr,dsgw,47,[Vous pouvez seulement modifier les entrées que vous avez créées. (You may not change entries besides your own.)] +fr,dsgw,48,[Problème (Problem)] +fr,dsgw,49,[Problème d´authentification (Authentication Problem)] +fr,dsgw,50,[.\n

                Vous devez ré-authentifier avant de continuer. (You must re-authenticate before continuing.)\n] +fr,dsgw,51,[.\n

                Vous devez ré-authentifier avant de continuer. (You must re-authenticate before continuing.)\n] +fr,dsgw,52,[erreur inconnue (unknown error)] +fr,dsgw,53,[L´opération a réussi. (The operation was successful.)] +fr,dsgw,54,[Une erreur interne est survenue sur le serveur. Ceci indique généralement une sérieuse défaillance du serveur et doit être immédiatement porté à l´attention de l´administrateur de votre serveur. (An internal error occurred in the server. This usually indicates a serious malfunction in the server and should be brought to the attention of your server administrator.)] +fr,dsgw,55,[Le serveur n´a pas compris la demande qui lui a été transmise par la passerelle. (The server could not understand the request which was sent to it by the gateway.)] +fr,dsgw,56,[La réponse à votre demande a dépassé le temps imparti. Si vous recherchez des entrées, vous obtiendrez sans doute de meilleurs résultats en étant plus précis dans votre recherche. (A time limit was exceeded in responding to your request. If you are searching for entries, you may achieve better results if you are more specific in your search.)] +fr,dsgw,57,[La réponse à votre demande a dépassé la taille autorisée. Si vous recherchez des entrées, vous obtiendrez sans doute de meilleurs résultats en étant plus précis car trop d´entrées répondent à vos critères de recherche. (A size limit was exceeded in responding to your request. If you are searching for entries, you may achieve better results if you are more specific in your search, because too many entries matched your search criteria.)] +fr,dsgw,58,[La passerelle a tenté d'authentifier l'accès au serveur en utilisant\nune méthode incomprise par ce dernier.\n(The gateway attempted to authenticate to the server using\na method the server doesn't understand.)] +fr,dsgw,59,[La passerelle a tenté d´authentifier l´accès au serveur en utilisant une méthode d´authentification non supportée par le serveur. (The gateway attempted to authenticate to the server using an authentication method which the server does not support.)] +fr,dsgw,60,[Impossible d´honorer votre demande, sans doute parce que le serveur contacté ne contient pas les données que vous recherchez. Il est possible qu´une orientation vers un autre serveur ait été renvoyée sans avoir pu être suivie. Si vous étiez en train d´essayer de modifier le répertoire, il se peut que le serveur contenant la copie maîtresse des données ne soit pas disponible. (Your request could not be fulfilled, probably because the server that was contacted does not contain the data you are looking for. It is possible that a referral to another server was returned but could not be followed. If you were trying to make changes to the directory, it may be that the server that holds the master copy of the data is not available.)] +fr,dsgw,61,[Votre demande a dépassé une limite administrative sur le serveur. (Your request exceeded an administrative limit in the server.)] +fr,dsgw,62,[Une extension importante demandée par la passerelle n´est pas disponible sur ce serveur. (A critical extension that the gateway requested is not available in this server.)] +fr,dsgw,63,[Le serveur n'a pas pu traiter la demande car celle-ci\nrenvoie à un attribut inexistant dans\nl'entrée.\n(The server was unable to process the request, because the\nrequest referred to an attribute which does not exist in the\nentry.)] +fr,dsgw,64,[Le serveur n´a pas pu répondre à votre demande, car \ncelle-ci va à l´encontre d´une contrainte de la base de données.\n(The server was unable to fulfill your request, because the\nrequest violates a constraint.)] +fr,dsgw,65,[Le serveur n´a pas pu ajouter une valeur à cette entrée car elle la contient déjà. (The server could not add a value to the entry, because that value is already contained in the entry.)] +fr,dsgw,66,[Le serveur n'a pas pu localiser l'entrée. Si vous ajoutez une nouvelle entrée,\nassurez-vous qu'elle comporte une entrée principale.\nLa réception de ce message d'erreur lors d'une recherche indique que l'entrée\nrecherchée n'existe pas.\nSi vous étiez en train d'essayer d'authentifier l'accès en tant que gestionnaire de répertoires et que vous\navez vu apparaître ce message, vérifiez le fichier de configuration de la passerelle.\n(The server could not locate the entry. If adding a new entry,\nbe sure that the parent of the entry you are trying to add exists.\nIf you received this error while searching, it indicates that the\nentry which was being searched for does not exist.\nIf you were attempting to authenticate as the directory manager and\nreceived this error, check the gateway configuration file.)] +fr,dsgw,67,[Le format d´un nom distinctif est incorrect. (A distinguished name was not in the proper format.)] +fr,dsgw,68,[L´entrée que vous étiez en train d´essayer d´authentifier ne comporte pas de jeu de mots de passe, ou bien il lui manque d´autres références d´authentification requises. Pour que vous puissiez authentifier cette entrée, les attributs appropriés doivent avoir été ajoutés par le gestionnaire de répertoires. (The entry you attempted to authenticate as does not have a password set, or is missing other required authentication credentials. You cannot authenticate as that entry until the appropriate attributes have been added by the directory manager. )] +fr,dsgw,69,[Le mot de passe (ou d'autres références d'authentification) que vous avez fourni\nest incorrect. (The password (or other authentication credentials) you supplied\nis incorrect. If you just changed your password, you might try exiting your browser and connecting again.)] +fr,dsgw,70,[Vos privilèges sont insuffisants pour effectuer cette opération. (You do not have sufficient privileges to perform the operation.)] +fr,dsgw,71,[Le serveur est trop occupé pour honorer votre demande. Essayez à nouveau dans quelques minutes. (The server is too busy to service your request. Try again in a few minutes.)] +fr,dsgw,72,[Impossible de contacter le serveur LDAP. (The LDAP server could not be contacted.)] +fr,dsgw,73,[Le serveur refuse de traiter votre demande. Cette dernière risquerait sans doute de le surcharger. Il se peut également qu´il ne soit pas configuré pour traiter votre demande. Si vous tentez d´effectuer une recherche, vous avez intérêt à en limiter la portée. (The server was unwilliing to process your request. Usually, this indicates that serving your request would put a heavy load on the server. It may also indicate that the server is not configured to process your request. If searching, you may wish to limit the scope of your search.)] +fr,dsgw,74,[Le serveur de répertoires ne peut honorer votre demande car elle viole les exigences du schéma. Vous n´avez sans doute pas fourni de valeur pour un champ requis. Il se peut également que le schéma du serveur de répertoires nécessite une mise à jour. (The directory server could not honor your request because it violates the schema requirements. Typically, this means that you have not provided a value for a required field. It could also mean that the schema in the directory server needs to be updated.)] +fr,dsgw,75,[Le serveur de répertoires ne vous permettra pas de supprimer ou de renommer une entrée qui comporte des sous-entrées. Si vous souhaitez continuer, vous devez d´abord supprimer toutes les sous-entrées. (The directory server will not allow you to delete or rename an entry if that entry has children. If you wish to do this, you must first delete all the child entries.)] +fr,dsgw,76,[Le serveur ne peut ajouter une nouvelle entrée ni renommer une entrée existante car il existe déjà une entrée sous ce nom. (The server was unable to add a new entry, or rename an existing entry, because an entry by that name already exists.)] +fr,dsgw,77,[Votre demande affecterait plusieurs serveurs de répertoires. (Your request would affect several directory servers.)] +fr,dsgw,78,[Impossible de contacter le serveur de répertoires. Contactez\nl'administrateur de votre serveur de répertoires pour obtenir de l'aide.\n(The directory server could not be contacted. Contact your\ndirectory server administrator for assistance.)] +fr,dsgw,79,[Une erreur est survenue lors de l´envoi de données au serveur. (An error occured while sending data to the server.)] +fr,dsgw,80,[Une erreur est survenue lors de la lecture des données en provenance du serveur. (An error occured while reading data from the server.)] +fr,dsgw,81,[Le serveur n´a pas répondu à la demande. La demande a dépassé le temps imparti. (The server did not respond to the request. The request timed out.)] +fr,dsgw,82,[Le serveur ne supporte pas la méthode d´authentification utilisée par la passerelle. (The server does not support the authentication method used by the gateway.)] +fr,dsgw,83,[Le filtre de recherche créé par la passerelle est erroné. (The search filter constructed by the gateway was in error.)] +fr,dsgw,84,[L´opération a été annulée à votre demande. (The operation was cancelled at your request.)] +fr,dsgw,85,[Une erreur interne est survenue dans la bibliothèque; un paramètre est incorrect. (An internal error occurred in the library - a parameter was incorrect.)] +fr,dsgw,86,[Impossible d'ouvrir une connexion au serveur de répertoires. Contactez\nl'administrateur de votre serveur de répertoires pour obtenir de l'aide.\n(A connection to the directory server could not be opened. Contact your\ndirectory server administrator for assistance.)] +fr,dsgw,87,[Une erreur inconnue est survenue. (An unknown error was encountered.)] +fr,dsgw,88,[Cette entrée existe déjà (Entry Already Exists)] +fr,dsgw,89,[Une entrée nommée (An entry named) ] +fr,dsgw,90,[onMouseOver="window.status='Cliquez ici pour afficher cette entrée'; return true"\n(onMouseOver="window.status='Click here to view this entry'; return true")] +fr,dsgw,91,[ existe déjà (already exists).

                Veuillez choisir un autre nom et/ou une autre adresse.\n(Please choose another name and/or location.)\n

                \n] +fr,dsgw,92,[L´entrée principale n´existe pas (Parent entry does not exist)] +fr,dsgw,93,[Impossible d´ajouter une entrée par le nom:

                %s,

                \ncar il n´existe pas d´entrée principale.

                \nPour pouvoir ajouter cette entrée, vous devez d´abord ajouter\n(You cannot add an entry by the name shown\nbecause the parent of that entry does not exist.

                \nBefore you can add this entry, you must first add)\n] +fr,dsgw,94,[l´entrée principale (its parent).\n] +fr,dsgw,95,[une entrée nommée (an entry named):

                %s.\n] +fr,dsgw,96,[Avertissement: pas d´authentification (continuation)...\n(Warning: no authentication (continuing)...)\n] +fr,dsgw,97,[Entrée de répertoire %s (Directory Entry)] +fr,dsgw,98,[

                DN de l´entrée (Entry DN): %s

                \n] +fr,dsgw,99,[Les changements apportés à %s ont été enregistrés.] +fr,dsgw,100,[%s has been added.] +fr,dsgw,101,[%s has been deleted.] +fr,dsgw,102,[Renamed %s to %s.] +fr,dsgw,103,[

                Remarque: Parce que vous avez %s l´entrée pour laquelle vous étiez\nauthentifié, il a fallu mettre vos références \nd´authentification au rebut. Vous aurez besoin d´une nouvelle \nauthentification pour pouvoir apporter des modifications supplémentaires.\n(Note: because of your action on the entry you were \nauthenticated as, it was necessary to discard your \nauthentication credentials. You will need to authenticate \nagain to make additional changes.)\n] +fr,dsgw,104,[supprimé (deleted)] +fr,dsgw,105,[renommé (renamed)] +fr,dsgw,106,[a changé le mot de passe de (changed the password of)] +fr,dsgw,107,[L´attribut %s a été changé
                \n(Attribute shown was changed
                )\n] +fr,dsgw,108,[ NON ASCII (%ld octets)\n(NOT ASCII (number of bytes shown))\n] +fr,dsgw,109,[Aucune valeur n´a été entrée. Veuillez essayer à nouveau.\n(No values were entered. Please try again.)\n] +fr,dsgw,110,[Aucun changement n´a été apporté.\n] +fr,dsgw,111,[

                Envoi de %s au serveur de répertoires...\n] +fr,dsgw,112,[informations (information)] +fr,dsgw,113,[changements (changes)] +fr,dsgw,114,[

                L´ajout de cette entrée a réussi.\n(Successfully added entry.)\n] +fr,dsgw,115,[

                La modification de cette entrée a réussi. Vos changements ont été enregistrés.\n(Successfully edited entry. Your changes have been saved.)\n] +fr,dsgw,116,[

                La suppression de cette entrée a réussi.\n(Successfully deleted entry.)\n] +fr,dsgw,117,[

                Le nouveau nom de cette entrée est: %s\n(The new name for the entry is as shown)\n

                \n] +fr,dsgw,118,[

                Le renommage de cette entrée a réussi.\n(Successfully renamed entry.)\n] +fr,dsgw,119,[Vous devez fournir l´ancien mot de passe.] +fr,dsgw,120,[Vous devez spécifier un nouveau mot de passe. Essayez à nouveau.] +fr,dsgw,121,[Le nouveau mot de passe et sa confirmation ne correspondent pas. Veuillez essayer à nouveau] +fr,dsgw,122,[
                Le %s %s est déjà utilisé. Veuillez en choisir un autre.\n(The item shown is already in use. Please choose a different one.)
                \n] +fr,dsgw,123,[élément "%.100s" de données de formulaire manquant\n(missing form data element shown)] +fr,dsgw,124,[Initialisation des données de configuration\n(Initializing config info)] +fr,dsgw,125,[Impossible d´ouvrir le fichier. (Cannot open file.)] +fr,dsgw,126,[Fichier dbconf mal formé. (Malformed dbconf file.)] +fr,dsgw,127,[Nom du propriétaire manquant dans le fichier dbconf.\n(Missing property name in dbconf file.)] +fr,dsgw,128,[Mémoire épuisée. (Out of memory.)] +fr,dsgw,129,[Directive manquante dans le fichier dbconf.\n(Missing directive in dbconf file.)] +fr,dsgw,130,[Impossible d'ouvrir le fichier de configuration "%s"\n(Cannot open config file with name shown)\n] +fr,dsgw,131,[Argument manquant pour la directive "authlifetime"\n(Missing argument for "authlifetime" directive)\n] +fr,dsgw,132,[Argument manquant pour la directive "dirmgr"\n(Missing argument for "dirmgr" directive)\n] +fr,dsgw,133,[Argument manquant pour la directive "baseurl"\n(Missing argument for "baseurl" directive)\n] +fr,dsgw,134,[URL erroné fourni pour la directive "baseurl"; le DN de base est manquant\n(Bad URL provided for "baseurl" directive - the base DN is missing)\n] +fr,dsgw,135,[analyse de la directive baseurl\n(parsing baseurl directive)] +fr,dsgw,136,[URL erroné fourni pour la directive "baseurl"; pas un URL "ldap://"\n(Bad URL provided for "baseurl" directive - not an "ldap://" URL)\n] +fr,dsgw,137,[Les URL "ldaps://" ne sont pas encore supportés\n("ldaps://" URLs are not yet supported)\n] +fr,dsgw,138,[Arguments manquants pour la directive "template"\n(Missing arguments for "template" directive)\n] +fr,dsgw,139,[Argument manquant pour la directive "sslrequired"\n(Missing argument for "sslrequired" directive)\n] +fr,dsgw,140,[Argument inconnu pour la directive "sslrequired" (l´argument doit être "never", "whenauthenticated", "always")\n(Unknown argument to "sslrequired" directive (should be "never", "whenauthenticated", "always"))\n] +fr,dsgw,141,[Argument manquant pour la directive "securitypath"\n(Missing argument for "securitypath" directive)\n] +fr,dsgw,142,[Argument manquant pour la directive "location-suffix"\n(Missing argument for "location-suffix" directive)\n] +fr,dsgw,143,[Trois arguments sont requis pour la directive "location"\n(Three arguments are required for the "location" directive)\n] +fr,dsgw,144,[Au moins deux arguments sont requis pour la directive "newtype"\n(At least two arguments are required for the "newtype" directive)\n] +fr,dsgw,145,[Adresse inconnue dans la directive "newtype"\n(Unknown location in "newtype" directive)\n] +fr,dsgw,146,[Trois ou quatre arguments sont requis pour la directive "tmplset"\n(Three or four arguments are required for the "tmplset" directive)\n] +fr,dsgw,147,[Quatre arguments sont requis pour la directive "attrvset"\n(Four arguments are required for the "attrvset" directive)\n] +fr,dsgw,148,[Argument manquant pour la directive "charset"\n(Missing argument for "charset" directive)\n] +fr,dsgw,149,[Argument manquant pour la directive "ClientLanguage"\n(Missing argument for "ClientLanguage" directive)\n] +fr,dsgw,150,[Argument manquant pour la directive "AdminLanguage"\n(Missing argument for "AdminLanguage" directive)\n] +fr,dsgw,151,[Argument manquant pour la directive "DefaultLanguage"\n(Missing argument for "DefaultLanguage" directive)\n] +fr,dsgw,152,[Nom de fichier manquant pour la directive "include"\n(Missing filename for "include" directive)\n] +fr,dsgw,153,[Directive inconnue dans le fichier de configuration\n(Unknown directive in config file)\n] +fr,dsgw,154,[<= erase_db n´a pas réussi à ouvrir le fichier lcache.conf "%s"\n(<= erase_db could not open lcache.conf file with name shown)\n] +fr,dsgw,155,[\n

                La base de données a été supprimée. Création d´une nouvelle base de données... \n(The database has been deleted. Creating new database...)\n\n] +fr,dsgw,156,[\n

                Impossible de supprimer la base de données\n(The database could not be deleted)\n(\n] +fr,dsgw,157,[<= app_suffix n´a pas réussi à ouvrir le fichier ldif "%s"\n(<= app_suffix could not open ldif file with name shown)\n] +fr,dsgw,158,[<= app_suffix n´a pas réussi à ouvrir le fichier tmp "%s"\n(<= app_suffix could not open tmp file with name shown)\n] +fr,dsgw,159,[Impossible de renommer %s en %s (Unable to rename with names as shown)] +fr,dsgw,160,[pointeur null renvoyé par dbconf_read_default_dbinfo().\n(null pointer returned by dbconf_read_default_dbinfo().)] +fr,dsgw,161,[URL "ldapdb" erroné; le DN de base est manquant\n(Bad "ldapdb" URL - the base DN is missing)\n] +fr,dsgw,162,[URL "ldapdb" erroné\n (Bad "ldapdb" URL)\n] +fr,dsgw,163,[URL fourni pour la directive "baseurl" erroné; le DN de base est manquant\n(Bad URL provided for "baseurl" directive - the base DN is missing)\n] +fr,dsgw,164,[analyse de la directive baseurl\n(parsing baseurl directive)] +fr,dsgw,165,[URL fourni pour la directive "baseurl" erroné; pas un URL "ldap:// ou ldapdb://"\n(Bad URL provided for "baseurl" directive - not an "ldap:// or ldapdb://" URL)\n] +fr,dsgw,166,[Les URL "ldaps://" ne sont pas encore supportés\n("ldaps://" URLs are not yet supported)\n] +fr,dsgw,167,[Aucune valeur donnée pour binddn\n(No value given for binddn)] +fr,dsgw,168,[Aucune valeur donnée pour bindpw\n(No value given for bindpw)] +fr,dsgw,169,[Aucun service de répertoires par défaut n´est défini dans le fichier dbswitch.conf\n(There is no default directory service defined in the dbswitch.conf file)] +fr,dsgw,170,[Impossible d'ouvrir le fichier de configuration "%s" en écriture\n(Cannot open config file with name shown for writing)\n] +fr,dsgw,171,[Impossible de renommer %s en %s (Unable to rename with names as shown)] +fr,dsgw,172,[fichier de configuration (config file) %s:] +fr,dsgw,173,[fichier de configuration %s: ligne %d: \n(config file and line as shown)] +fr,dsgw,174,[max %d] +fr,dsgw,175,[ OK ] +fr,dsgw,176,[Fermer la fenêtre (Close Window)] +fr,dsgw,177,[Précédent] +fr,dsgw,178,[{crypt}VERROUILLE (LOCKED) [%s GMT]] +fr,dsgw,179,[Retourner à l´écran principal (Return to Main)] +fr,dsgw,181,[ Help ] +fr,dsgw,182,[Aide (Help)] +fr,dsgw,184,[L´aide n´est pas encore disponible. (Help is not yet available.)] +fr,dsgw,186,[Fermer la fenêtre (Close Window)] +fr,dsgw,187,[Fermer la fenêtre (Close Window)] +fr,dsgw,188,[modèle manquant? (missing ?template)] +fr,dsgw,189,[Authentifier... (Authenticate...)] +fr,dsgw,190,[Mettre les références d´authentification au rebut (déconnexion)?\n(Discard authentication credentials (log out)?)] +fr,dsgw,191,[Veuillez taper une chaîne de recherche] +fr,dsgw,192,[La première étape de l´authentification de l´accès à ce répertoire consiste en votre\npropre identification.
                Tapez votre nom:\n(The first step in authenticating to the directory is identifying\nyourself.
                Please type your name:)] +fr,dsgw,193,[Continuer (Continue)] +fr,dsgw,194,[Continuer (Continue)] +fr,dsgw,195,[Annuler (Cancel)] +fr,dsgw,196,[Authentifier comme gestionnaire de répertoires">  (uniquement disponible pour les administrateurs de répertoires)\n(Authenticate as directory manager">  (only available to Directory Administrators))\n] +fr,dsgw,197,[Authentifier... (Authenticate...)] +fr,dsgw,198,[Mettre les références d´authentification au rebut? (Discard authentication credentials?)] +fr,dsgw,200,[Continuer (Continue)] +fr,dsgw,201,[Continuer (Continue)] +fr,dsgw,202,[Annuler (Cancel)] +fr,dsgw,203,[Authentifier l´accès au répertoire (connexion)\n(Authenticate (log in) to the directory)] +fr,dsgw,204,[Vous êtes sur le point de vous authentifier auprès de l'annuaire en tant que %s. Pour terminer le processus d'authentification, tapez votre mot de passe.\n] +fr,dsgw,206,[Avant de pouvoir modifier ou ajouter des entrées, vous devez authentifier\nl´accès au répertoire (connexion). Cette fenêtre vous\nguidera tout au long du processus\nd´authentification.\n(Before you can edit or add entries, you must authenticate\n(log in) to the directory. This window will guide\nyou through the steps of the authentication\nprocess.)\n] +fr,dsgw,207,[Cet écran vous permet d´authentifier l´accès au répertoire, \nou de vous y connecter. Vous devrez vous authentifier\navant de pouvoir modifier les entrées du répertoire. Si vous\ntentez de modifier une entrée sans authentification,\nil vous sera demandé de vous connecter.\n(From this screen you may authenticate, or log in, \nto the directory. You will need to authenticate\nbefore you can modify directory entries. If you\nattempt to modify an entry without authenticating,\nyou will be asked to log in.)\n] +fr,dsgw,208,[Statut de l´authentification (Authentication Status)] +fr,dsgw,209,[\nVotre accès au répertoire est actuellement authentifié sous\n(You are currently authenticated to the directory as) ] +fr,dsgw,210,[.\nSi vous voulez mettre vos références d´authentification au rebut et vous déconnecter du répertoire, cliquez sur le bouton ci-dessous.\n(.\nIf you wish to discard your authentication credentials and log out of the directory, click on the button below.)] +fr,dsgw,211,[Mettre les références d´authentification au rebut (déconnexion)\n(Discard Authentication Credentials (log out))] +fr,dsgw,212,[Vos références d´authentification pour \n(Your authentication credentials for )] +fr,dsgw,213,[ont expiré (have expired).\n


                )\n] +fr,dsgw,214,[Votre accès au répertoire n´est actuellement pas authentifié.\n(Currently, you are not authenticated to the directory.)
                \n] +fr,dsgw,215,["%s=" manquant (missing definition shown)] +fr,dsgw,216,["%s=%s" inconnu (unknown assignment as shown)] +fr,dsgw,217,[option inconnue %s (unknown option as shown)] +fr,dsgw,218,[syntaxe inconnue=%s\n(syntax shown unknown)\n] +fr,dsgw,219,[** Type HTML "%s" non supporté **\n(** HTML type shown not supported **
                )\n] +fr,dsgw,224,[Modifier (Edit)] +fr,dsgw,225,[Save Changes] +fr,dsgw,226,[modify] +fr,dsgw,227,[add] +fr,dsgw,228,[Supprimer (Delete)] +fr,dsgw,229,[Supprimer cette entrée? (Delete this entry?)] +fr,dsgw,230,[Renommer (Rename)] +fr,dsgw,231,[Entrez un nouveau nom pour cette entrée: (Enter a new name for this entry:)] +fr,dsgw,232,[Modifier sous (Edit As)] +fr,dsgw,233,[%s= manquant (missing definition shown)] +fr,dsgw,234,[Fermer la fenêtre (Close Window)] +fr,dsgw,235,[Modifier... (Edit...)] +fr,dsgw,236,["%s=" manquant\n (missing definition shown")\n] +fr,dsgw,237,[ensemble inconnu "%s"\n (set shown is unknown)\n] +fr,dsgw,238,[syntaxe inconnue "%s"\n (syntax shown is unknown)\n] +fr,dsgw,239,[Ré-authentifier (Re-Authenticate)] +fr,dsgw,240,[Fermer la fenêtre (Close Window)] +fr,dsgw,241,[Voulez-vous vraiment (Do you really want to) ] +fr,dsgw,242,[?] +fr,dsgw,243,[ OK ] +fr,dsgw,244,[ OK ] +fr,dsgw,245,[Remettre à zéro (Reset)] +fr,dsgw,246,[Terminé (Done)] +fr,dsgw,247,[Annuler (Cancel)] +fr,dsgw,248,[a trouvé un autre IF (les IF emboîtés ne sont pas supportés)\n(found another IF (nested IFs are not supported))] +fr,dsgw,249,[a trouvé ELSE mais n´a pas vu de IF\n(found ELSE but didn't see an IF)] +fr,dsgw,250,[a trouvé ELSE après ELSE (ENDIF attendu)\n(found ELSE after ELSE (expecting ENDIF))] +fr,dsgw,251,[a trouvé ELIF mais n´a pas vu de IF\n(found ELIF but didn't see an IF)] +fr,dsgw,252,[a trouvé ELIF après ELSE (ENDIF attendu)\n(found ELIF after ELSE (expecting ENDIF))] +fr,dsgw,253,[a trouvé ENDIF mais n´a pas vu de IF\n(found ENDIF but didn't see an IF)] +fr,dsgw,254,[
                erreur de modèle: %s\n(template error as shown)
                \n] +fr,dsgw,255,[ldap_init/lcache_init tenté avant la lecture du fichier de configuration\n(ldap_init/lcache_init attempted before config file read)] +fr,dsgw,256,[ne tourne pas sous Administration Server\n(not running under the administration server)] +fr,dsgw,257,[Impossible d´initialiser les permissions\n(Could not initialize permissions)] +fr,dsgw,258,[Impossible de faire correspondre un nom d´utilisateur avec un DN (erreur d´Administration Server)\n(Could not map username to a DN (error from admin server))] +fr,dsgw,259,[Impossible d´obtenir le nom d´utilisateur courant\n(Could not get current username)] +fr,dsgw,260,[Impossible d´obtenir le mot de passe utilisateur courant\n(Could not get current user password)] +fr,dsgw,261,[Erreur (Error): %s] +fr,dsgw,262,[Remarque: aucun modèle d´affichage n´est disponible pour ce type d´entrée; une méthode par défaut\nest donc utilisée dans l´affichage ci-dessous.\n(Note: there is no display template for this type of entry available, so it is\ndisplayed below using a default method.)] +fr,dsgw,263,[Identification de l´utilisateur ou identificateur NULL LDAP non valide\n(Invalid user id or NULL LDAP handle)] +fr,dsgw,264,[aucune correspondance pour l´identification de l´utilisateur\n(no match for user id)] +fr,dsgw,265,[plusieurs correspondances pour l´identification de l´utilisateur\n(more than one match for user id)] +fr,dsgw,266,[the entire directory] +fr,dsgw,267,[Deux arguments sont requis pour la directive "includeset"\n(Two arguments are required for the "includeset" directive)\n] +fr,dsgw,268,[La valeur d'attribut demandée est introuvable dans l'entrée\n(An error occurred while trying to access the database)] +fr,dsgw,269,[Argument introuvable pour la directive "NLS"] +fr,dsgw,270,[Une valeur doit être spécifiée pour l'id d'utilisateur NT\n] +fr,dsgw,271,[La combinaison de l'id d'utilisateur NT et de l'id de domaine NT n'est pas unique dans le répertoire.] +fr,dsgw,272,[Des valeurs doivent être spécifiées pour l'id d'utilisateur NT et l'id de domaine NT\n] +fr,dsgw,273,[La valeur d'id d'utilisateur NT ne doit pas dépasser 20 caractères.\n] +fr,dsgw,274,[Veuillez créer un nom pour la nouvelle entrée.] +fr,dsgw,275,[Veuillez sélectionner une adresse pour la nouvelle entrée.] +fr,dsgw,276,[Nouvelle entrée] +fr,dsgw,277,[Afin de pouvoir utiliser cette fonction, un dirmgr doit être défini dans dsgw.conf] +fr,dsgw,278,[Trois ou quatre arguments sont requis pour la directive "vcard-property"\n] +fr,dsgw,279,[La syntaxe de la propriété Vcard doit être "cis" ou "mls"\n] +fr,dsgw,280,[Aucune entrée n'a été trouvée.\n%2$s] +fr,dsgw,281,[Aucune entrée n'a été trouvée dans les %2$s %3$s '%4$s'.\n] +fr,dsgw,282,[Aucune entrée recherchée n'a été trouvée\n%2$s] +fr,dsgw,283,[Aucune entrée recherchée n'a été trouvée dans les %2$s %3$s %4$s'.\n] +fr,dsgw,284,[1 entrée a été trouvée.\n%2$s] +fr,dsgw,285,[1 entrée a été trouvée dans les %2$s %3$s '%4$s'.\n] +fr,dsgw,286,[1 entrée recherchée a été trouvée.\n%2$s] +fr,dsgw,287,[1 entrée recherchée a été trouvée dans les %2$s %3$s '%4$s'.\n] +fr,dsgw,288,[%1$li entrées ont été trouvées.\n%2$s] +fr,dsgw,289,[%1$li entrées ont été trouvées dans les %2$s %3$s '%4$s'.\n] +fr,dsgw,290,[%1$li entrées recherchées ont été trouvées.\n%2$s] +fr,dsgw,291,[%1$li entrées recherchées ont été trouvées dans les %2$s %3$s '%4$s'.\n ] +fr,dsgw,292,[le filtre LDAP est] +fr,dsgw,293,[Le serveur n´a pas pu trouver l´entrée que vous avez utilisée lors de l´authentification. Quelqu´un a peut-être renommé ou supprimé l´entrée. Procédez à une nouvelle authentification.] +fr,dsgw,294,[La nouvelle syntaxe du mot de passe n´est pas valide.\n] +fr,dsgw,295,[Le nouveau mot de passe figure dans l´historique des mots de passe.\n] +fr,dsgw,296,[Vous avez atteint la limite de nouvelle tentative de mot de passe. Contactez votre administrateur système.\n] +fr,dsgw,297,[Vous avez atteint la limite de nouvelle tentative de mot de passe. Essayez à nouveau.\n] +fr,dsgw,298,[Le mot de passe a expiré. Contactez votre administrateur système pour redéfinir le mot de passe.\n] +fr,frame,-1,[$DBT: frame in DB file v1 $] +fr,frame,1,[Introuvable (Not Found)

                Introuvable (Not Found)

                L'objet demandé n'existe pas sur ce serveur. Le lien que vous avez consulté est peut-être désuet, inexact, ou bien le serveur a reçu l'ordre de ne pas vous laisser y accéder.\n(The requested object does not exist on this server. The link you followed is either outdated, inaccurate, or the server has been instructed not to let you have it. )] +fr,frame,2,[Veuillez informer l'administrateur de site de la page de référence.\n(Please inform the site administrator of the referring page.)] +fr,frame,3,[Votre navigateur a envoyé une demande que ce Proxy n'arrive pas à comprendre.\n(Your browser sent a request that this proxy could not understand.)] +fr,frame,4,[Une autorisation adéquate est requise pour l'administration de ce Proxy.\nVotre navigateur n'effectue peut-être pas l'autorisation, ou bien votre autorisation\na échoué.\n(Proper authorization is required for the administration of this proxy.\nEither your browser does not perform authorization, or your authorization\nhas failed.)] +fr,frame,5,[L'authentification du nom d'utilisateur est requise pour utiliser ce Proxy.\nVotre navigateur n'effectue peut-être par l'autorisation de Proxy, ou bien votre\nautorisation a échoué.\n(Username authentication is required for using this proxy.\nEither your browser does not perform proxy authorization, or your\nauthorization has failed.)] +fr,frame,6,[La configuration du contrôle d'accès de ce Proxy refuse l'accès à\nl'objet demandé par le biais de ce Proxy.\n(The proxy's access control configuration denies access to\nthe requested object through this proxy.)] +fr,frame,7,[Le Proxy a rencontré une erreur interne qui l'empêche \nd'honorer votre demande. La cause la plus probable est une mauvaise configuration.\nVeuillez demander à l'administrateur de consulter le journal d'erreurs du Proxy.\n(The proxy has encountered an internal error which prevents it from\nfulfilling your request. The most likely cause is a misconfiguration.\nPlease ask the administrator to look for messages in the proxy's error log.)] +fr,frame,8,[Ce serveur de Proxy ne met pas en oeuvre la méthode demandée.\n(This proxy server does not implement the requested method.)] +fr,frame,9,[Une erreur est survenue sur le serveur de Proxy.\n(An error has occurred on the proxy server.)] +fr,frame,10,[Votre navigateur a envoyé une requête que ce serveur n'arrive pas à comprendre.\n(Your browser sent a query this server could not understand.)] +fr,frame,11,[Une autorisation adéquate est requise pour ce domaine. Votre navigateur n'effectue peut-être pas l'autorisation, ou bien votre autorisation a échoué.\n(Proper authorization is required for this area. Either your browser does not perform authorization, or your authorization has failed.)] +fr,frame,12,[Votre client n'est pas autorisé à accéder à l'objet demandé.\n(Your client is not allowed to access the requested object.)] +fr,frame,13,[Ce serveur a rencontré une erreur interne qui l'empêche d'honorer votre demande. La cause la plus probable est une mauvaise configuration. Veuillez demander à l'administrateur de consulter le journal d'erreurs du serveur.\n(This server has encountered an internal error which prevents it from fulfilling your request. The most likely cause is a misconfiguration. Please ask the administrator to look for messages in the server's error log.)] +fr,frame,14,[Ce serveur ne met pas en oeuvre la méthode demandée.\n(This server does not implement the requested method.)] +fr,frame,15,[Une erreur est survenue. (An error has occurred.)] +fr,frame,16,[Votre navigateur a envoyé un message que ce serveur n'arrive pas à comprendre.\n(Your browser sent a message this server could not understand.)] +fr,frame,17,[%s

                %s

                \nCe document a été déplacé à une nouvelle adresse. Veuillez mettre à jour vos documents et listes d'accès en conséquence.\n(This document has moved to a new location. Please update your documents and hotlists accordingly.)] +fr,frame,18,[%s\n

                %s

                \n%s\n] +fr,frame,19,[process-uri-objects] +fr,frame,20,[cannot find template %s] +fr,frame,21,[process-uri-objects] +fr,frame,22,[no partial path after object processing] +fr,frame,23,[find-service] +fr,frame,24,[invalid shexp %s] +fr,frame,25,[find-service] +fr,frame,26,[invalid shexp %s] +fr,frame,27,[handle-processed] +fr,frame,28,[no way to service request for %s] +fr,frame,29,[finish-socks-request] +fr,frame,30,[close failed (%s), csd=%d] +fr,frame,31,[This beta software has expired.\n] +fr,frame,32,[mr_accept(%d)] +fr,frame,33,[Error issuing read on accept socket] +fr,frame,34,[acb_accept_connection(%d)] +fr,frame,35,[Error getting accept socket (%d)] +fr,frame,36,[Error in accept! (%d, %s)] +fr,frame,37,[Error creating new accept request] +fr,frame,38,[accepted connection: %d (NSPR %d)] +fr,frame,39,[Error creating new session structure] +fr,frame,40,[accel_read_request()] +fr,frame,41,[Error allocating request read buffer] +fr,frame,42,[Error issuing async read request] +fr,frame,43,[acb_read_request(%d, bytes %d)] +fr,frame,44,[acb_read_req(1 session = %d)] +fr,frame,45,[Error reading request (%d, %s)] +fr,frame,46,[Client aborted connection] +fr,frame,47,[Error reading request] +fr,frame,48,[Error creating new request] +fr,frame,49,[error occurred, closing %d, io was for %d] +fr,frame,50,[accel_async_scan_headers()] +fr,frame,51,[out of memory: accel_async_scan_headers] +fr,frame,52,[out of memory: accel_async_scan_headers] +fr,frame,53,[Error during async read (%d, %s)] +fr,frame,54,[scan-headers reports: line too long] +fr,frame,55,[scan-headers reports: too many headers] +fr,frame,56,[Error reading headers] +fr,frame,57,[scan-headers reports: header missing terminator (an empty line)] +fr,frame,58,[scan-headers reports: header was empty] +fr,frame,59,[nom sans valeur: obtention de la ligne "%s"\n(name without value: got line as shown)] +fr,frame,60,[accel_send_plain_file()] +fr,frame,61,[accel_send_plain_file() - found request %d] +fr,frame,62,[Parse headers lost the URI!] +fr,frame,63,[accel_send_plain_file() - found uri %s] +fr,frame,64,[accel_send_plain_file() - found in cache?] +fr,frame,65,[malloc died!] +fr,frame,66,[Error writing back file\n] +fr,frame,67,[acb_send_plain_file(%d)] +fr,frame,68,[Error writing in acb_send_plain_file (%d, %s)] +fr,frame,69,[acb_close_connection(%d)] +fr,frame,70,[Errored IO in acb_close_connection (%d, %s)] +fr,frame,71,[Unable to close socket %d] +fr,frame,72,[accel-cache-insert: Error allocating entry] +fr,frame,73,[cache-init: server cache disabled] +fr,frame,74,[accel_file_cache: Error initializing file cache] +fr,frame,75,[accel_file_cache: Error creating cache] +fr,frame,76,[accel_file_cache_init: CacheHashSize < %d, using %d] +fr,frame,77,[accel_file_cache_init: CacheHashSize > %d, using %d] +fr,frame,78,[accel_file_cache_init: MaxNumberOfCachedFiles < %d, using %d] +fr,frame,79,[accel_file_cache_init: MaxNumberOfCachedFiles > %d, using %d] +fr,frame,80,[accel_file_cache_init: MaxNumberOfOpenCachedFiles < %d, using %d] +fr,frame,81,[accel_file_cache_init: MaxNumberOfOpenCachedFiles > %d, using %d] +fr,frame,82,[accel_file_cache: Error initializing file cache] +fr,frame,83,[file-cache: enabled = %s ] +fr,frame,84,[on] +fr,frame,85,[off] +fr,frame,86,[file-cache: MaxNumberOfCachedFiles %d (0x%x)] +fr,frame,87,[file-cache: CacheHashSize %d (0x%x)] +fr,frame,88,[file-cache: MaxNumberOfOpenCachedFiles %d (0x%x)] +fr,frame,89,[accel-cache-insert: Error allocating entry] +fr,frame,90,[file-cache-cleanup: munmap failed (%s)] +fr,frame,91,[file-cache-cleanup: found mmapped file \non system without mmap] +fr,frame,92,[file_cache_init: MaxTotalCachedFileSize < %d, using %d] +fr,frame,93,[file_cache_init: MaxTotalCachedFileSize > %d, using %d] +fr,frame,94,[file cache using mmap flags 0x%x] +fr,frame,95,[file cache using mmap prots 0x%x] +fr,frame,96,[file-cache-init: could not create lock] +fr,frame,97,[file-cache: unable to create temporary directory %s.\n] +fr,frame,98,[file-cache: unable to create temporary directory %s.\n] +fr,frame,99,[file-cache: GetTempPath() Cannot find temp directory to store file!] +fr,frame,100,[file-cache-init: set max cached file size to %d] +fr,frame,101,[file-cache-init: could not create lock] +fr,frame,102,[file_cache_destroy()] +fr,frame,103,[file-cache: Unable to get temp file name. Error %s] +fr,frame,104,[file-cache: Unable to get temp file name. Error %s] +fr,frame,105,[file-cache-insert: Error allocating entry] +fr,frame,106,[file-cache-create: Error opening file %s (%s)] +fr,frame,107,[file-cache-create: Error stat()ing file %s (%s)] +fr,frame,108,[file-cache-create: Error mmap()ing file %s (%s)] +fr,frame,109,[file-cache-create: malloc failure] +fr,frame,110,[file-cache-create: error case failed to munmap(%d, %d) (%s)] +fr,frame,111,[file-cache-valid: cannot stat %s] +fr,frame,112,[dir change: invalidating %s (%d)] +fr,frame,113,[file-cache: asynchronous file change notification failed.] +fr,frame,114,[dir change: offset %d, action %d, len %d, name %s] +fr,frame,115,[unable to check async file status] +fr,frame,116,[ReadDirectoryChangesW failure- unable to continue watching %s. Error is %s] +fr,frame,117,[file-cache-add-watch failure- unable to open directory %s. Error %s] +fr,frame,118,[ReadDirectoryChangesW failure- unable to start watching %s. Error %s] +fr,frame,119,[func_exec] +fr,frame,120,[no handler function given for directive] +fr,frame,121,[func_exec] +fr,frame,122,[cannot find function named %s] +fr,frame,123,[handle-request] +fr,frame,124,[method without URI] +fr,frame,125,[http-parse-request] +fr,frame,126,[while scanning HTTP headers, %s] +fr,frame,127,[handle-request] +fr,frame,128,[read from %s failed, error is %s] +fr,frame,129,[handle-request] +fr,frame,130,[request too long] +fr,frame,131,[start-http-response] +fr,frame,132,[write failed (%s)] +fr,frame,133,[start-http-response] +fr,frame,134,[write failed (%s)] +fr,frame,135,[http-status] +fr,frame,136,[%d is not a valid HTTP status code] +fr,frame,137,[finish-request] +fr,frame,138,[close failed (%s)] +fr,frame,139,[Unable to close socket for writing] +fr,frame,140,[os has %d objects] +fr,frame,141,[obj %d has no hash table at %d] +fr,frame,142,[obj %d has no param] +fr,frame,143,[obj %d name %s value %s] +fr,frame,144,[.....directives %d.......] +fr,frame,145,[.....directive %d] +fr,frame,146,[.......instance %d] +fr,frame,147,[...........param name %s value %s] +fr,frame,148,[ClearConfigurationParameters:RegCreateKey %s] +fr,frame,149,[ClearConfigurationParameters:RegEnumKey %s failed] +fr,frame,150,[obj.conf line %d: error in filter file "%s" at line %d: %s] +fr,frame,151,[obj.conf line %d: error in filter file "%s" at line %d: %s] +fr,frame,152,[Unable to allocate Subject property list.\n] +fr,frame,153,[Unable to set session ptr in Subject property list - error=%d\n] +fr,frame,154,[Unable to set request ptr in Subject property list - error=%d\n] +fr,frame,155,[file-cache-valid: cannot stat %s] +fr,frame,156,[file-cache-create: Error stat()ing file %s (%s)] +fr,httpdaemon,-1,[$DBT: httpdaemon in DB file v1 $] +fr,httpdaemon,1,[Error in ConvertThreadToFiber] +fr,httpdaemon,2,[Error in ConvertThreadToFiber] +fr,httpdaemon,3,[Error in md_start_system] +fr,httpdaemon,4,[Error in CreateFiber - idlefiber] +fr,httpdaemon,5,[Error in GetQueuedCompletionStatus] +fr,httpdaemon,6,[Error creating completion port] +fr,httpdaemon,7,[Could not SetHandleNonInheritable (%s)] +fr,httpdaemon,8,[Error accept/read new conn] +fr,httpdaemon,9,[Error in Respond()] +fr,httpdaemon,10,[Error in RespondCompleted()] +fr,httpdaemon,11,[daemon: unable to fork new process (%s)\n] +fr,httpdaemon,12,[daemon: setsid failed (%s)\n] +fr,httpdaemon,13,[daemon: can't log pid to %s (%s)\n] +fr,httpdaemon,14,[warning: could not set group id to %d (%s)\n] +fr,httpdaemon,15,[warning: could not set user id to %d (%s)\n] +fr,httpdaemon,16,[warning: daemon is running as super-user\n] +fr,httpdaemon,17,[could not determine current user name\n] +fr,httpdaemon,18,[error: chroot to %s failed (%s)\n] +fr,httpdaemon,19,[WARNING! netscape executable and library have different versions.\n] +fr,httpdaemon,20,[startup: listening to %s://%s, port %d as %s\n] +fr,httpdaemon,21,[startup: listening to %s://%s, port %d as %s\n] +fr,httpdaemon,22,[seminit failed (%s)\n] +fr,httpdaemon,23,[Using single threaded accepts.] +fr,httpdaemon,24,[Using multi threaded accepts.] +fr,httpdaemon,25,[Using partial single threaded accepts.] +fr,httpdaemon,26,[This machine has %d processors.] +fr,httpdaemon,27,[Error calling thr_seconcurrency(%d)- (%s)] +fr,httpdaemon,28,[Set conncurrency to %d.] +fr,httpdaemon,29,[can't fork new process (%s)] +fr,httpdaemon,30,[This beta software has expired.\n] +fr,httpdaemon,31,[can't create IPC pipe (%s)] +fr,httpdaemon,32,[write to wakeup pipe failed (%s)] +fr,httpdaemon,33,[select thread miss] +fr,httpdaemon,34,[startup failure: could not bind to port %d (%s)\n] +fr,httpdaemon,35,[startup failure: could not bind to port %d, IP address %s (%s)\n] +fr,libaccess,-1,[$DBT: libaccess in DB file v1 $] +fr,libaccess,1,[basic-ncsa] +fr,libaccess,2,[cannot open database %s] +fr,libaccess,3,[basic-ncsa] +fr,libaccess,4,[user %s password did not match database %s] +fr,libaccess,5,[basic-ncsa] +fr,libaccess,6,[cannot open connection to LDAP server on %s:%d] +fr,libaccess,7,[basic-ncsa] +fr,libaccess,8,[user %s password did not match LDAP on %s:%d] +fr,libaccess,9,[acl-state] +fr,libaccess,10,[missing realm] +fr,libaccess,11,[Unable to allocate ACL List Hash\n] +fr,libaccess,12,[ACLEvalBuildContext unable to PERM_MALLOC cache structure\n] +fr,libaccess,13,[ACLEvalBuildContext unable to create hash table\n] +fr,libaccess,14,[ACLEvalBuildContext unable to allocate ACE Entry\n] +fr,libaccess,15,[ACLEvalBuildContext unable to allocate ACE entry\n] +fr,libaccess,16,[ACLEvalBuildContext unable to allocate Boundary Entry\n] +fr,libaccess,17,[ACLEvalBuildContext failed.\n] +fr,libaccess,18,[ACL_EvalTestRights: an interim, absolute non-allow value was encountered. right=%s, value=%d\n] +fr,libaccess,19,[LASDnsBuild unable to allocate hash table header\n] +fr,libaccess,20,[LASDnsBuild unable to add key %s\n] +fr,libaccess,21,[LASDnsBuild unable to add key %s\n] +fr,libaccess,22,[LASDnsBuild unable to add key %s\n] +fr,libaccess,23,[LASDnsBuild unable to add key %s\n] +fr,libaccess,24,[LASDnsBuild unable to add key %s\n] +fr,libaccess,25,[LAS DNS build received request for attribute %s\n] +fr,libaccess,26,[LASDnsEval - illegal comparator %s\n] +fr,libaccess,27,[LASDnsEval unable to allocate Context struct\n\n] +fr,libaccess,28,[LASDnsEval unable to get session address %d\n] +fr,libaccess,29,[LASDnsEval unable to get DNS - error=%s\n] +fr,libaccess,30,[LAS Group Eval received request for attribute %s\n] +fr,libaccess,31,[LASGroupEval - illegal comparator %s\n] +fr,libaccess,32,[LASGroupEval - ran out of memory\n] +fr,libaccess,33,[LASGroupEval unable to get session address %d\n] +fr,libaccess,34,[LASGroupEval unable to get session address %d\n] +fr,libaccess,35,[LASGroupEval - couldn't locate getter for auth-user\n] +fr,libaccess,36,[LASGroupEval - Attribute getter for auth-user failed\n] +fr,libaccess,37,[LASGroupEval - Attribute getter didn't set auth-user\n] +fr,libaccess,38,[Check group membership of user "%s" for group "%s"\n] +fr,libaccess,39,[LDAPU_SUCCESS for group "%s"\n] +fr,libaccess,40,[LDAPU_FAILED for group "%s"\n] +fr,libaccess,41,[LAS_EVAL_FALSE\n] +fr,libaccess,42,[LAS_EVAL_TRUE\n] +fr,libaccess,43,[LASIpTreeAlloc - no memory\n] +fr,libaccess,44,[IP LAS unable to allocate tree node\n] +fr,libaccess,45,[IP LAS unable to allocate tree node\n] +fr,libaccess,46,[LAS IP build received request for attribute %s\n] +fr,libaccess,47,[LASIpEval - illegal comparator %s\n] +fr,libaccess,48,[LASIpEval unable to get session address - error=%s\n] +fr,libaccess,49,[LASIpEval unable to allocate Context struct\n\n] +fr,libaccess,50,[LASIpEval - reach 32 bits without conclusion value=%s] +fr,libaccess,51,[LAS Program Eval received request for attribute %s\n] +fr,libaccess,52,[LASProgramEval - illegal comparator %s\n] +fr,libaccess,53,[LASProgram unable to get session address %d\n] +fr,libaccess,54,[bin] +fr,libaccess,55,[LASProgramEval: request not of type admin or bin, passing.\n] +fr,libaccess,56,[LASProgramEval: check if program %s matches pattern %s.\n] +fr,libaccess,57,[LASProgramEval: Invalid wildcard expression %s.\n] +fr,libaccess,58,[LAS_EVAL_FALSE\n] +fr,libaccess,59,[LAS_EVAL_TRUE\n] +fr,libaccess,60,[Unexpected attribute in dayOfWeek - %s\n] +fr,libaccess,61,[Illegal comparator for dayOfWeek - %s\n] +fr,libaccess,62,[Unexpected attribute in timeOfDay - %s\n] +fr,libaccess,63,[LAS User Eval received request for attribute %s\n] +fr,libaccess,64,[LASUserEval - illegal comparator %s\n] +fr,libaccess,65,[LASUserEval - ran out of memory\n] +fr,libaccess,66,[LASUserEval unable to get session address %d\n] +fr,libaccess,67,[LASUserEval unable to get session address %d\n] +fr,libaccess,68,[LASGroupEval - couldn't locate getter for auth-user\n] +fr,libaccess,69,[LASGroupEval - Attribute getter for auth-user failed\n] +fr,libaccess,70,[LASGroupEval - Attribute getter didn't set auth-user\n] +fr,libaccess,71,[Check if uid == user (i.e. check "%s" == "%s)"\n] +fr,libaccess,72,[SUCCESS for user "%s"\n] +fr,libaccess,73,[FAILED for user "%s"\n] +fr,libaccess,74,[LAS_EVAL_FALSE\n] +fr,libaccess,75,[LAS_EVAL_TRUE\n] +fr,libaccess,76,[] +fr,libaccess,77,[LASProgram unable to get request address - error=%s] +fr,libaccess,78,[LASProgram rejecting request for program %s from pattern %s] +fr,libaccess,79,[ACL_CacheFlush: unable to parse file "%s"\n] +fr,libaccess,80,[ACL_CacheFlush: unable to concatenate ACL list "%s"\n] +fr,libaccess,81,[ACL_CacheFlush: unable to open and process the magnus file "%s"\n] +fr,libaccess,82,[Illegal comparator for timeOfDay - %s\n] +fr,libaccess,83,[ACL_EvalBuildContext unable to create hash table\n] +fr,libaccess,84,[ACL_EvalBuildContext unable to PERM_CALLOC cache structure\n] +fr,libaccess,85,[ACL_EvalBuildContext unable to allocate ACE entry\n] +fr,libaccess,86,[ACL_EvalBuildContext unable to allocate auth pointer array\n] +fr,libaccess,87,[ACL_EvalBuildContext unable to allocate auth plist\n] +fr,libaccess,88,[ACL_EvalTestRights: an interim, absolute non-allow value was encountered. right=%s, value=%s\n] +fr,libaccess,89,[ACL_INTEvalTestRights: call to ACL_EvalBuildContext returned failure status\n] +fr,libaccess,90,[ACL_ModuleRegister: module name is missing\n] +fr,libaccess,91,[ACL_ModuleRegister: call to module init function returned a failed status\n] +fr,libaccess,92,[ACL_GetAttribute: couldn't determine method for %s\n] +fr,libaccess,93,[ACL_GetAttribute: couldn't locate getter for %s] +fr,libaccess,94,[ACL_GetAttribute: attr getter failed to get %s] +fr,libaccess,95,[ACL_GetAttribute: attr getter failed to get %s] +fr,libaccess,96,[ACL_GetAttribute: All attribute getters declined for attr %s] +fr,libaccess,97,[ACL_DatabaseRegister: dbtype for database "%s" is not defined yet!] +fr,libaccess,98,[ACL_DatabaseRegister: database name is missing] +fr,libaccess,99,[Error reading the DB Map File: %s. Reason: %s] +fr,libaccess,100,[URL is missing for database %s] +fr,libaccess,101,[Invalid property value pair for database %s] +fr,libaccess,102,["default" database must be an LDAP database] +fr,libaccess,103,[Multiple "default" databases are being registered] +fr,libaccess,104,["default" LDAP database must be registered] +fr,libaccess,105,[LASGroupEval unable to get database name - error= %s] +fr,libaccess,106,[received invalid program expression %s] +fr,libaccess,107,[parse_ldap_url: database url is missing] +fr,libaccess,108,[parse_ldap_url: database name is missing] +fr,libaccess,109,[parse_ldap_url: error in parsing ldap url. Reason: %s] +fr,libaccess,110,[ldap password check: unable to get database name - error=%s] +fr,libaccess,111,[ldap password check: unable to get parsed database %s] +fr,libaccess,112,[ldap password check: couldn't initialize connection to LDAP. Reason: %s] +fr,libaccess,113,[ldap password check: LDAP error: "%s"] +fr,libaccess,114,[get_user_ismember_ldap unable to get database name - error=%s] +fr,libaccess,115,[get_user_ismember_ldap unable to get parsed database %s] +fr,libaccess,116,[ldap password check: couldn't initialize connection to LDAP. Reason: %s] +fr,libaccess,117,[get_user_ismember_ldap: group %s does not exist] +fr,libaccess,118,[get_user_ismember_ldap: LDAP error: "%s"] +fr,libaccess,119,[ACL_LDAPDatabaseHandle: %s is not a registered database] +fr,libaccess,120,[ACL_LDAPDatabaseHandle: %s is not an LDAP database] +fr,libaccess,121,[ACL_LDAPDatabaseHandle: out of memory] +fr,libaccess,122,[ACL_LDAPDatabaseHandle: couldn't initialize connection to LDAP. Reason: %s] +fr,libaccess,123,[ACL_LDAPDatabaseHandle: couldn't bind to LDAP server. Reason: %s] +fr,libaccess,124,[insufficient dynamic memory] +fr,libaccess,125,[error opening file, %s: %s] +fr,libaccess,126,[duplicate definition of %s] +fr,libaccess,127,[file %s, line %s: duplicate definition of %s] +fr,libaccess,128,[file %s, line %s: syntax error] +fr,libaccess,129,[file %s, line %s: %s is undefined] +fr,libaccess,130,[in acl %s, %s %s is undefined] +fr,libaccess,131,[database %s: error accessing %s] +fr,libaccess,132,[%s] +fr,libaccess,133,[file %s, line %s: invalid syntax] +fr,libaccess,134,[file %s, line %s: syntax error at "%s"] +fr,libaccess,135,[realm %s is not defined] +fr,libaccess,136,[error code = %d] +fr,libaccess,137,[internal ACL error] +fr,libaccess,138,[invalid argument] +fr,libaccess,139,[ACL_DatabaseRegister: dbtype for database "%s" is not defined yet!] +fr,libaccess,140,[couldn't determine dbtype from: %s] +fr,libaccess,141,[Failed to register database %s] +fr,libaccess,142,[ACL call returned failed status] +fr,libaccess,143,[file %s: ACL IO error - %s] +fr,libaccess,144,[acl_user_exists: mémoire insuffisante] +fr,libaccess,145,[acl_user_exists: l'utilisateur n'existe plus] +fr,libaccess,146,[acl_user_exists: erreur de plist] +fr,libadmin,-1,[$DBT: libadmin in DB file v1 $] +fr,libadmin,1,[ Help ] +fr,libadmin,2,[ OK ] +fr,libadmin,3,[ Reset ] +fr,libadmin,4,[ Done ] +fr,libadmin,5,[ Cancel ] +fr,libir,-1,[$DBT: libadmin in DB file v1 $] +fr,libir,1,[An I/O error occurred before all form data could be read.] diff --git a/l10n/dirserv/fr/ns-slapd.txt.iso8859 b/l10n/dirserv/fr/ns-slapd.txt.iso8859 new file mode 100644 index 00000000..829750db --- /dev/null +++ b/l10n/dirserv/fr/ns-slapd.txt.iso8859 @@ -0,0 +1,883 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/**************************************************************************/ +/* The copyright notice(s) in this Source Code does not indicate actual */ +/* or intended publication of this Source Code. */ +/**************************************************************************/ + +/* This text file was generated by program dblink */ + +$Revision: 1.1 $ +$Log: ns-slapd.txt.iso8859,v $ +Revision 1.1 2005/01/21 00:40:48 cvsadm +Initial revision + +Revision 1.1.4.3 2003/09/22 19:36:43 ulfw +Update copyright years from 2001 to 2001-2003 + +Revision 1.1.4.2 2001/11/03 01:07:25 richm +XXX use new copyright XXX + +Revision 1.1.4.1 1998/10/10 02:14:09 ggood +Copy from Directory40RtmBranchpoint to DirectoryBranch + +Revision 1.1.2.4.2.2.6.1 1998/04/04 23:16:55 mcs +merge changes made on directory31_rtm_branch into server4_directory_branch + +Revision 1.1.2.4.2.2.2.1 1998/02/24 05:51:57 noriko +Synched with server3_i18npkg_branch + +Revision 1.1.2.6 1997/12/31 00:23:39 werudge +Remove \n from dsgw,198 to fix JavaScript problem + +Revision 1.1.2.5 1997/12/19 02:03:54 werudge +Based on en/ns-slapd.txt : 1.1.2.3 +daily 971113.1 SOLARIS-export-optimize-normal-slapd +$EndLog$ + +$StartStringData$ + +fr,base,-1,[$DBT: base in DB file v1 $] +fr,base,1,[mémoire insuffisante pour créer la table de hachage] +fr,base,2,[mémoire insuffisante pour créer la table de hachage ] +fr,base,3,[cache_destroy : les tables du cache semblent corrompues.] +fr,base,4,[impossible d´allouer l´entrée de hachage] +fr,base,5,[cache_insert : impossible de créer l´entrée de cache] +fr,base,6,[HTTP/1.0 200 OK\nContent-type: text/html\n\n] +fr,base,7,[

                Rapport d'état du cache Netscape\n(Netscape cache status report)

                \n] +fr,base,8,[Aucun cache sur le système (No caches on system)

                ] +fr,base,9,[

                cache %s

                \n] +fr,base,10,[Rapport de connexions au cache: %d/%d (%f)\n(Cache hit ratio: as shown)

                \n

                \n] +fr,base,11,[Taille du cache: %d/%d\n(Cache size: as shown)

                \n

                \n] +fr,base,12,[Taille de la table de hachage: %d\n(Hash table size: as shown)

                \n

                \n] +fr,base,13,[mru : %d

                \nlru : %d

                \n] +fr,base,14,[
                  Compartiment (Bucket) Adresse (Address) Clef (Key) Nombre d'accès (Access Count) Supprimer (Delete) Suivant (Next) LRU MRU Données (Data)
                  \n] +fr,base,15,[munmap failed (%s)] +fr,base,16,[munmap failed (%s)] +fr,base,17,[close failed (%s)] +fr,base,18,[daemon: unable to fork new process (%s)\n] +fr,base,19,[daemon: setsid failed (%s)\n] +fr,base,20,[daemon: can't log pid to %s (%s)\n] +fr,base,21,[warning: could not set group id to %d (%s)\n] +fr,base,22,[warning: could not set user id to %d (%s)\n] +fr,base,23,[warning: daemon is running as super-user\n] +fr,base,24,[could not determine current user name\n] +fr,base,25,[error: chroot to %s failed (%s)\n] +fr,base,27,[, address %s] +fr,base,28,[warning: statistics disabled (%s)\n] +fr,base,29,[security handshake timed out for pid %d] +fr,base,30,[warning: statistics disabled (%s)\n] +fr,base,31,[secure handshake failed (code %d)\n] +fr,base,32,[accept failed (%s)] +fr,base,33,[warning: statistics disabled (%s)\n] +fr,base,34,[select thread miss] +fr,base,35,[keepalive worker awoken with no work to do] +fr,base,36,[could not create new thread: %d (%s)] +fr,base,37,[wait for sema succeeded, but nothing to dequeue] +fr,base,38,[queue-sema creation failure] +fr,base,39,[error getting processor info for processor %d] +fr,base,40,[Error binding to processor %d] +fr,base,41,[bound process %d to processor %d] +fr,base,42,[Netscape server is not explicitly binding to any processors.] +fr,base,43,[cache monitor exited] +fr,base,44,[cache batch update daemon exited] +fr,base,45,[Using single threaded accepts.] +fr,base,46,[Using multi threaded accepts.] +fr,base,47,[Using partial single threaded accepts.] +fr,base,48,[This machine has %d processors.] +fr,base,49,[Error calling thr_seconcurrency(%d)- (%s)] +fr,base,50,[Set conncurrency to %d.] +fr,base,51,[WARNING! netscape executable and library have different versions.\n] +fr,base,54,[seminit failed (%s)\n] +fr,base,55,[This beta software has expired.\n] +fr,base,56,[Cache monitor respawned] +fr,base,57,[Cache batch update daemon respawned] +fr,base,58,[can't find empty statistics slot] +fr,base,59,[can't fork new process (%s)] +fr,base,60,[assert failed! %s\n] +fr,base,61,[mr_table_init()] +fr,base,62,[malloc failed] +fr,base,63,[malloc failed!] +fr,base,64,[mr_add_io(%d, type %d, file %d)] +fr,base,65,[mr_add_io - stage 1] +fr,base,66,[mr_add_io - stage 2] +fr,base,67,[mr_add_io found invalid IO type %d] +fr,base,68,[mr_add_io - adding timeout] +fr,base,69,[Out of memory!\n] +fr,base,70,[done with mr_add_io] +fr,base,71,[mr_del_io(%d, type %d, file %d)] +fr,base,72,[mr_del_io found invalid IO type %d] +fr,base,73,[mr_lookup_io(%d)] +fr,base,74,[mr_async_io(%d, %d bytes, file %d)] +fr,base,75,[malloc failure adding async IO] +fr,base,76,[Error adding async io!] +fr,base,77,[Cannot seek for read!] +fr,base,78,[read failure! (%d, %s)] +fr,base,79,[do_read read %d bytes for file %d] +fr,base,80,[Cannot seek for write!] +fr,base,81,[writev failure! (%d, %s)] +fr,base,82,[write failure! (%d, %s)] +fr,base,83,[do_write wrote %d bytes for file %d] +fr,base,84,[do_timeout(mrp %d)] +fr,base,85,[do_timeout: found IO (timer=%d, time=%d)] +fr,base,86,[error deleting io] +fr,base,87,[timeout callback failure for %d\n] +fr,base,88,[mr_get_event(%d) - outstanding io %d] +fr,base,89,[mr_get_event: Waiting for reads on FD:] +fr,base,90,[mr_get_event: Waiting for writes on FD:] +fr,base,91,[ %d] +fr,base,92,[ %d] +fr,base,93,[mr_get_event set no timeout] +fr,base,94,[mr_get_event set timeout to: %d.%d sec] +fr,base,95,[error in select (%d, %s)] +fr,base,96,[mr_get_event() - select found %d] +fr,base,97,[error looking up IO fd %d] +fr,base,98,[read failed for fd %d] +fr,base,99,[error deleting io] +fr,base,100,[callback failure for %d\n] +fr,base,101,[error looking up IO fd %d] +fr,base,102,[writing: header len %d, writelen %d, total %d] +fr,base,103,[write failed for fd %d] +fr,base,104,[error deleting io] +fr,base,105,[callback failure for %d\n] +fr,base,106,[Error creating dns cache] +fr,base,107,[dns_cache_init: hash_size <= 0, using %d] +fr,base,108,[dns_cache_init: cache-size <= %d, using %d] +fr,base,109,[dns_cache_init: cache-size is %d is too large, using %d.] +fr,base,110,[dns_cache_init: expire_time <= 0, using %d] +fr,base,111,[dns_cache_init: expire is %d is too large, using %d seconds.] +fr,base,112,[Error creating dns cache] +fr,base,113,[dns-cache-insert: Error allocating entry] +fr,base,114,[dns-cache-insert: malloc failure] +fr,base,115,[successful server startup] +fr,base,116,[%s B%s] +fr,base,117,[Netscape executable and shared library have different versions] +fr,base,118,[ executable version is %s] +fr,base,119,[ shared library version is %s] +fr,base,120,[error reporting shutting down] +fr,base,121,[warning] +fr,base,122,[config] +fr,base,123,[security] +fr,base,124,[failure] +fr,base,125,[catastrophe] +fr,base,126,[info] +fr,base,127,[verbose] +fr,base,128,[event_handler:Failed to wait on events %s] +fr,base,129,[could not wait on resume event event (%s)] +fr,base,130,[dlopen of %s failed (%s)] +fr,base,131,[dlopen of %s failed (%s)] +fr,base,132,[The server is terminating due to an error. Check the event viewer for the error message. SERVER EXITING!] +fr,base,133,[Terminating the server %s] +fr,base,134,[kill_server:cannot open server event %s] +fr,base,135,[kill_server:cannot set server event %s] +fr,base,136,[error: could not get socket (%s)\n] +fr,base,137,[error: could not set socket option (%s)\n] +fr,base,138,[Terminating Service:error: could not bind to address %s port %d (%s)\n] +fr,base,139,[Terminating Service:error: could not bind to port %d (%s)\n] +fr,base,140,[SetHandleNonInheritable: could not duplicate socket (%s)] +fr,base,141,[SetHandleNonInheritable: closing the original socket failed (%s)] +fr,base,142,[Could not SetHandleInformation (%s)] +fr,base,143,[Terminating Service:Failure: Could not open statistics file (%s)\n] +fr,base,144,[Could not set Thread Local Storage Value for thread at slot %d] +fr,base,145,[secure handshake failed (code %d)\n] +fr,base,146,[accept failed %d (%s)] +fr,base,147,[Failed to pulse Event %d %s] +fr,base,148,[Failed to send MobGrowth Event to parent %s] +fr,base,149,[Pulsing MobRespawn Event %d] +fr,base,150,[respawn thread pool to %d (%d)] +fr,base,151,[Could not open event to signal rotate application. Could not create the MoveLog event:%s] +fr,base,152,[Failed to send MoveLog Event to rotate app %s] +fr,base,153,[growing thread pool from %d to %d] +fr,base,154,[Could not open the ServiceControlManager, Error %d] +fr,base,155,[StartNetsiteService:Could not open the service %s: Error %d] +fr,base,156,[StartNetsiteService:Could not start the service %s] +fr,base,157,[Service Startup: Could not allocate security descriptor] +fr,base,158,[Service Startup: Could not init security descriptor] +fr,base,159,[Service Startup: Could not set the security Dacl] +fr,base,160,[Terminating Service:WinSock init failed: %s] +fr,base,161,[Httpd Server Startup failed: %s] +fr,base,162,[can't find empty statistics slot] +fr,base,163,[NT daemon: could not create new thread %d] +fr,base,164,[Service Startup Failure. Terminating Service:Could not create event %d:%s] +fr,base,165,[Service Startup Error. Could not create the MoveLog event:%s] +fr,base,166,[Failed to wait on Event objects %s] +fr,base,167,[Failed to wait on Event objects %s] +fr,base,168,[pipebuf_buf2sd: pipebuf_grab IO_ERROR %d] +fr,base,169,[pool-init: memory pools disabled] +fr,base,170,[pool-init: free_size <= 0, using %d] +fr,base,171,[pool-create-block: out of memory] +fr,base,172,[pool-create: out of memory] +fr,base,173,[pool-create: out of memory] +fr,base,174,[pool-malloc: out of memory] +fr,base,175,[FREE() used where PERM_FREE() should have been used- problem corrected and supressing further warnings.] +fr,base,176,[regex error: %s (regex: '%s')] +fr,base,177,[can't create IPC pipe (%s)] +fr,base,178,[write to wakeup pipe failed (%s)] +fr,base,179,[flushing %d connections; current %d; tot %d] +fr,base,180,[accept failed (%s)] +fr,base,181,[Error creating time cache] +fr,base,182,[time-cache: cache disabled] +fr,base,183,[time_cache_init: hash_size < %d, using default, %d] +fr,base,184,[time_cache_init: hash_size > %d, using default, %d] +fr,base,185,[time_cache_init: cache_size < %d, using default, %d] +fr,base,186,[time_cache_init: cache_size > %d, using default, %d] +fr,base,187,[Error allocating memory for time_cache] +fr,base,188,[Error allocating memory for time_cache entry] +fr,base,189,[Error allocating memory for time_cache entry] +fr,base,190,[Error inserting new time_cache entry] +fr,base,191,[Error allocating memory for time_cache] +fr,base,192,[cs-terminate failure (%s)] +fr,base,193,[cs-init failure (%s)] +fr,base,194,[cs-wait failure (%s)] +fr,base,195,[cs-post failure (%s)] +fr,base,196,[Unable to create nonblocking socket (%s)] +fr,base,197,[error: could not set keepalive (%s)\n] +fr,base,198,[error: could not set recv timeout (%s)\n] +fr,base,199,[error: could not set send timeout (%s)\n] +fr,base,200,[Unable to create nonblocking socket (%s)] +fr,base,201,[sem_grab failed (%s)] +fr,base,202,[sem_release failed (%s)] +fr,base,203,[sem_release failed (%s)] +fr,base,204,[Could not remove temporary directory %s, Error %d] +fr,base,205,[Could not remove temporary directory %s, Error %d] +fr,dsgw,-1,[$DBT: dsgw in DB file v1 $] +fr,dsgw,1,[Méthode de demande HTTP inconnue (Unknown HTTP request method)] +fr,dsgw,2,[Données HTML de formulaire non valides ou incomplètes (Invalid or incomplete HTML form data)] +fr,dsgw,3,[Mémoire épuisée (Out of memory)] +fr,dsgw,4,[L´entrée de requête/formulaire exigée est manquante (Required query/form input is missing)] +fr,dsgw,5,[Caractère non autorisé dans le chemin d´accès au fichier (Illegal character in file path)] +fr,dsgw,6,[Fichier de configuration erroné ou manquant (Bad or missing configuration file)] +fr,dsgw,7,[Impossible d´initialiser LDAP (Unable to initialize LDAP)] +fr,dsgw,8,[Une erreur est survenue lors du contact du serveur LDAP (An error occurred while contacting the LDAP server)] +fr,dsgw,9,[Type d´objet de recherche inconnu (Unknown search object type)] +fr,dsgw,10,[Etiquette d´attribut inconnue (Unknown attribute label)] +fr,dsgw,11,[Invite de correspondance inconnue (Unknown match prompt)] +fr,dsgw,12,[Aucun filtre de recherche pour ce type d´objet (No search filters for object type)] +fr,dsgw,13,[Impossible d´ouvrir le fichier de modèle HTML (Unable to open HTML template file)] +fr,dsgw,14,[Mode de recherche inconnu; utiliser "smart", "complex", "pattern" ou "auth" (Unknown search mode - use "smart", "complex", "pattern", or "auth")] +fr,dsgw,15,[Nom distinctif manquant dans l´URL (Distinguished Name missing in URL)] +fr,dsgw,16,[Portée inconnue dans l´URL (doit être: base, sub ou one) (Unknown scope in URL (should be base, sub, or one))] +fr,dsgw,17,[URL non reconnu ou erreur inconnue (Unrecognized URL or unknown error)] +fr,dsgw,18,[Format d´URL erroné (Bad URL format)] +fr,dsgw,19,[Erreur interne (Internal error)] +fr,dsgw,20,[Impossible d´écrire sur le fichier d´index de modèles (Unable to write template index file)] +fr,dsgw,21,[Impossible d´ouvrir le fichier d´index de modèles (Unable to open template index file)] +fr,dsgw,22,[Impossible de lire le répertoire (Unable to read directory)] +fr,dsgw,23,[Echec de l´initialisation SSL LDAP (vérifiez le chemin de sécurité) (LDAP SSL initialization failed (check the security path))] +fr,dsgw,24,[Pour que les formulaires d'utilisateurs et de groupes puissent fonctionner sur SSL avec Administration Server, vous-même ou l'administrateur de votre système devez activer SSL. La page Encryption|On/Off peut être utilisée à cette fin.\n(For the Users and Groups forms to work over SSL, you or your server administrator needs to activate SSL for this Administration Server. The Encryption|On/Off page can be used to do so] +fr,dsgw,25,[Références d´authentification introuvables dans la base de données d´authentification (Authentication credentials not found in authentication database)] +fr,dsgw,26,[Erreur de récupération des données depuis la base de données d´authentification (Error retrieving data from the authentication database)] +fr,dsgw,27,[Vos références d´authentification ont expiré (Your authentication credentials have expired)] +fr,dsgw,28,[Impossible de créer une chaîne aléatoire] +fr,dsgw,29,[Aucun nom distinctif n´a été fourni lors du retrait des références (No distinguished name was provided when retrieving credentials)] +fr,dsgw,30,[Impossible d´ouvrir la base de données d´authentification (Cannot open authentication database)] +fr,dsgw,31,[Impossible d´annexer des données à la base de données d´authentification (Could not append data to the authentication database)] +fr,dsgw,32,[Aucun gestionnaire de répertoires n´est défini (No Directory Manager is defined)] +fr,dsgw,33,[Aucune chaîne de recherche n´a été fournie. Veuillez essayer à nouveau (No search string was provided. Please try again)] +fr,dsgw,34,[Le fichier de configuration comporte trop d´arguments sur une ligne (Too many arguments on one line in the config. file)] +fr,dsgw,35,[Echec de l´initialisation des sockets Windows (Failed to initialize Windows Sockets)] +fr,dsgw,36,[Les références d´authentification n´ont pas pu être obtenues auprès d´Administration Server (Authentication credentials could not be obtained from the Administration Server)] +fr,dsgw,37,[Nom distinctif manquant dans l´URL ldapdb:// (Distinguished Name missing in ldapdb:// URL)] +fr,dsgw,38,[URL non reconnu ou erreur inconnue (Unrecognized URL or unknown error)] +fr,dsgw,39,[Format d´URL erroné (Bad URL format)] +fr,dsgw,40,[Une erreur est survenue lors de l'initialisation de la base de données LDAP locale\n(An error occurred while initializing the local LDAP database)] +fr,dsgw,41,[Type de service de répertoires inconnu; utiliser "local" ou "remote" (Unknown directory service type - use "local" or "remote")] +fr,dsgw,42,[Une erreur est survenue lors de la lecture du fichier de configuration db (An error occurred while reading the db configuration file)] +fr,dsgw,43,[Le chemin d´accès à NSHOME/userdb était NULL (NSHOME/userdb path was NULL)] +fr,dsgw,44,[Impossible de mettre à jour la configuration du service de répertoires. (The directory service configuration could not be updated.)] +fr,dsgw,45,[Impossible de lire l´entrée à partir du répertoire. (The entry could not be read from the directory.)] +fr,dsgw,46,[Impossible d´effacer la base de données LDAP. (The LDAP database could not be erased.)] +fr,dsgw,47,[Vous pouvez seulement modifier les entrées que vous avez créées. (You may not change entries besides your own.)] +fr,dsgw,48,[Problème (Problem)] +fr,dsgw,49,[Problème d´authentification (Authentication Problem)] +fr,dsgw,50,[.\n

                  Vous devez ré-authentifier avant de continuer. (You must re-authenticate before continuing.)\n] +fr,dsgw,51,[.\n

                  Vous devez ré-authentifier avant de continuer. (You must re-authenticate before continuing.)\n] +fr,dsgw,52,[erreur inconnue (unknown error)] +fr,dsgw,53,[L´opération a réussi. (The operation was successful.)] +fr,dsgw,54,[Une erreur interne est survenue sur le serveur. Ceci indique généralement une sérieuse défaillance du serveur et doit être immédiatement porté à l´attention de l´administrateur de votre serveur. (An internal error occurred in the server. This usually indicates a serious malfunction in the server and should be brought to the attention of your server administrator.)] +fr,dsgw,55,[Le serveur n´a pas compris la demande qui lui a été transmise par la passerelle. (The server could not understand the request which was sent to it by the gateway.)] +fr,dsgw,56,[La réponse à votre demande a dépassé le temps imparti. Si vous recherchez des entrées, vous obtiendrez sans doute de meilleurs résultats en étant plus précis dans votre recherche. (A time limit was exceeded in responding to your request. If you are searching for entries, you may achieve better results if you are more specific in your search.)] +fr,dsgw,57,[La réponse à votre demande a dépassé la taille autorisée. Si vous recherchez des entrées, vous obtiendrez sans doute de meilleurs résultats en étant plus précis car trop d´entrées répondent à vos critères de recherche. (A size limit was exceeded in responding to your request. If you are searching for entries, you may achieve better results if you are more specific in your search, because too many entries matched your search criteria.)] +fr,dsgw,58,[La passerelle a tenté d'authentifier l'accès au serveur en utilisant\nune méthode incomprise par ce dernier.\n(The gateway attempted to authenticate to the server using\na method the server doesn't understand.)] +fr,dsgw,59,[La passerelle a tenté d´authentifier l´accès au serveur en utilisant une méthode d´authentification non supportée par le serveur. (The gateway attempted to authenticate to the server using an authentication method which the server does not support.)] +fr,dsgw,60,[Impossible d´honorer votre demande, sans doute parce que le serveur contacté ne contient pas les données que vous recherchez. Il est possible qu´une orientation vers un autre serveur ait été renvoyée sans avoir pu être suivie. Si vous étiez en train d´essayer de modifier le répertoire, il se peut que le serveur contenant la copie maîtresse des données ne soit pas disponible. (Your request could not be fulfilled, probably because the server that was contacted does not contain the data you are looking for. It is possible that a referral to another server was returned but could not be followed. If you were trying to make changes to the directory, it may be that the server that holds the master copy of the data is not available.)] +fr,dsgw,61,[Votre demande a dépassé une limite administrative sur le serveur. (Your request exceeded an administrative limit in the server.)] +fr,dsgw,62,[Une extension importante demandée par la passerelle n´est pas disponible sur ce serveur. (A critical extension that the gateway requested is not available in this server.)] +fr,dsgw,63,[Le serveur n'a pas pu traiter la demande car celle-ci\nrenvoie à un attribut inexistant dans\nl'entrée.\n(The server was unable to process the request, because the\nrequest referred to an attribute which does not exist in the\nentry.)] +fr,dsgw,64,[Le serveur n´a pas pu répondre à votre demande, car \ncelle-ci va à l´encontre d´une contrainte de la base de données.\n(The server was unable to fulfill your request, because the\nrequest violates a constraint.)] +fr,dsgw,65,[Le serveur n´a pas pu ajouter une valeur à cette entrée car elle la contient déjà. (The server could not add a value to the entry, because that value is already contained in the entry.)] +fr,dsgw,66,[Le serveur n'a pas pu localiser l'entrée. Si vous ajoutez une nouvelle entrée,\nassurez-vous qu'elle comporte une entrée principale.\nLa réception de ce message d'erreur lors d'une recherche indique que l'entrée\nrecherchée n'existe pas.\nSi vous étiez en train d'essayer d'authentifier l'accès en tant que gestionnaire de répertoires et que vous\navez vu apparaître ce message, vérifiez le fichier de configuration de la passerelle.\n(The server could not locate the entry. If adding a new entry,\nbe sure that the parent of the entry you are trying to add exists.\nIf you received this error while searching, it indicates that the\nentry which was being searched for does not exist.\nIf you were attempting to authenticate as the directory manager and\nreceived this error, check the gateway configuration file.)] +fr,dsgw,67,[Le format d´un nom distinctif est incorrect. (A distinguished name was not in the proper format.)] +fr,dsgw,68,[L´entrée que vous étiez en train d´essayer d´authentifier ne comporte pas de jeu de mots de passe, ou bien il lui manque d´autres références d´authentification requises. Pour que vous puissiez authentifier cette entrée, les attributs appropriés doivent avoir été ajoutés par le gestionnaire de répertoires. (The entry you attempted to authenticate as does not have a password set, or is missing other required authentication credentials. You cannot authenticate as that entry until the appropriate attributes have been added by the directory manager. )] +fr,dsgw,69,[Le mot de passe (ou d'autres références d'authentification) que vous avez fourni\nest incorrect. (The password (or other authentication credentials) you supplied\nis incorrect. If you just changed your password, you might try exiting your browser and connecting again.)] +fr,dsgw,70,[Vos privilèges sont insuffisants pour effectuer cette opération. (You do not have sufficient privileges to perform the operation.)] +fr,dsgw,71,[Le serveur est trop occupé pour honorer votre demande. Essayez à nouveau dans quelques minutes. (The server is too busy to service your request. Try again in a few minutes.)] +fr,dsgw,72,[Impossible de contacter le serveur LDAP. (The LDAP server could not be contacted.)] +fr,dsgw,73,[Le serveur refuse de traiter votre demande. Cette dernière risquerait sans doute de le surcharger. Il se peut également qu´il ne soit pas configuré pour traiter votre demande. Si vous tentez d´effectuer une recherche, vous avez intérêt à en limiter la portée. (The server was unwilliing to process your request. Usually, this indicates that serving your request would put a heavy load on the server. It may also indicate that the server is not configured to process your request. If searching, you may wish to limit the scope of your search.)] +fr,dsgw,74,[Le serveur de répertoires ne peut honorer votre demande car elle viole les exigences du schéma. Vous n´avez sans doute pas fourni de valeur pour un champ requis. Il se peut également que le schéma du serveur de répertoires nécessite une mise à jour. (The directory server could not honor your request because it violates the schema requirements. Typically, this means that you have not provided a value for a required field. It could also mean that the schema in the directory server needs to be updated.)] +fr,dsgw,75,[Le serveur de répertoires ne vous permettra pas de supprimer ou de renommer une entrée qui comporte des sous-entrées. Si vous souhaitez continuer, vous devez d´abord supprimer toutes les sous-entrées. (The directory server will not allow you to delete or rename an entry if that entry has children. If you wish to do this, you must first delete all the child entries.)] +fr,dsgw,76,[Le serveur ne peut ajouter une nouvelle entrée ni renommer une entrée existante car il existe déjà une entrée sous ce nom. (The server was unable to add a new entry, or rename an existing entry, because an entry by that name already exists.)] +fr,dsgw,77,[Votre demande affecterait plusieurs serveurs de répertoires. (Your request would affect several directory servers.)] +fr,dsgw,78,[Impossible de contacter le serveur de répertoires. Contactez\nl'administrateur de votre serveur de répertoires pour obtenir de l'aide.\n(The directory server could not be contacted. Contact your\ndirectory server administrator for assistance.)] +fr,dsgw,79,[Une erreur est survenue lors de l´envoi de données au serveur. (An error occured while sending data to the server.)] +fr,dsgw,80,[Une erreur est survenue lors de la lecture des données en provenance du serveur. (An error occured while reading data from the server.)] +fr,dsgw,81,[Le serveur n´a pas répondu à la demande. La demande a dépassé le temps imparti. (The server did not respond to the request. The request timed out.)] +fr,dsgw,82,[Le serveur ne supporte pas la méthode d´authentification utilisée par la passerelle. (The server does not support the authentication method used by the gateway.)] +fr,dsgw,83,[Le filtre de recherche créé par la passerelle est erroné. (The search filter constructed by the gateway was in error.)] +fr,dsgw,84,[L´opération a été annulée à votre demande. (The operation was cancelled at your request.)] +fr,dsgw,85,[Une erreur interne est survenue dans la bibliothèque; un paramètre est incorrect. (An internal error occurred in the library - a parameter was incorrect.)] +fr,dsgw,86,[Impossible d'ouvrir une connexion au serveur de répertoires. Contactez\nl'administrateur de votre serveur de répertoires pour obtenir de l'aide.\n(A connection to the directory server could not be opened. Contact your\ndirectory server administrator for assistance.)] +fr,dsgw,87,[Une erreur inconnue est survenue. (An unknown error was encountered.)] +fr,dsgw,88,[Cette entrée existe déjà (Entry Already Exists)] +fr,dsgw,89,[Une entrée nommée (An entry named) ] +fr,dsgw,90,[onMouseOver="window.status='Cliquez ici pour afficher cette entrée'; return true"\n(onMouseOver="window.status='Click here to view this entry'; return true")] +fr,dsgw,91,[ existe déjà (already exists).

                  Veuillez choisir un autre nom et/ou une autre adresse.\n(Please choose another name and/or location.)\n

                  \n] +fr,dsgw,92,[L´entrée principale n´existe pas (Parent entry does not exist)] +fr,dsgw,93,[Impossible d´ajouter une entrée par le nom:

                  %s,

                  \ncar il n´existe pas d´entrée principale.

                  \nPour pouvoir ajouter cette entrée, vous devez d´abord ajouter\n(You cannot add an entry by the name shown\nbecause the parent of that entry does not exist.

                  \nBefore you can add this entry, you must first add)\n] +fr,dsgw,94,[l´entrée principale (its parent).\n] +fr,dsgw,95,[une entrée nommée (an entry named):

                  %s.\n] +fr,dsgw,96,[Avertissement: pas d´authentification (continuation)...\n(Warning: no authentication (continuing)...)\n] +fr,dsgw,97,[Entrée de répertoire %s (Directory Entry)] +fr,dsgw,98,[

                  DN de l´entrée (Entry DN): %s

                  \n] +fr,dsgw,99,[Les changements apportés à %s ont été enregistrés.] +fr,dsgw,100,[%s has been added.] +fr,dsgw,101,[%s has been deleted.] +fr,dsgw,102,[Renamed %s to %s.] +fr,dsgw,103,[

                  Remarque: Parce que vous avez %s l´entrée pour laquelle vous étiez\nauthentifié, il a fallu mettre vos références \nd´authentification au rebut. Vous aurez besoin d´une nouvelle \nauthentification pour pouvoir apporter des modifications supplémentaires.\n(Note: because of your action on the entry you were \nauthenticated as, it was necessary to discard your \nauthentication credentials. You will need to authenticate \nagain to make additional changes.)\n] +fr,dsgw,104,[supprimé (deleted)] +fr,dsgw,105,[renommé (renamed)] +fr,dsgw,106,[a changé le mot de passe de (changed the password of)] +fr,dsgw,107,[L´attribut %s a été changé
                  \n(Attribute shown was changed
                  )\n] +fr,dsgw,108,[ NON ASCII (%ld octets)\n(NOT ASCII (number of bytes shown))\n] +fr,dsgw,109,[Aucune valeur n´a été entrée. Veuillez essayer à nouveau.\n(No values were entered. Please try again.)\n] +fr,dsgw,110,[Aucun changement n´a été apporté.\n] +fr,dsgw,111,[

                  Envoi de %s au serveur de répertoires...\n] +fr,dsgw,112,[informations (information)] +fr,dsgw,113,[changements (changes)] +fr,dsgw,114,[

                  L´ajout de cette entrée a réussi.\n(Successfully added entry.)\n] +fr,dsgw,115,[

                  La modification de cette entrée a réussi. Vos changements ont été enregistrés.\n(Successfully edited entry. Your changes have been saved.)\n] +fr,dsgw,116,[

                  La suppression de cette entrée a réussi.\n(Successfully deleted entry.)\n] +fr,dsgw,117,[

                  Le nouveau nom de cette entrée est: %s\n(The new name for the entry is as shown)\n

                  \n] +fr,dsgw,118,[

                  Le renommage de cette entrée a réussi.\n(Successfully renamed entry.)\n] +fr,dsgw,119,[Vous devez fournir l´ancien mot de passe.] +fr,dsgw,120,[Vous devez spécifier un nouveau mot de passe. Essayez à nouveau.] +fr,dsgw,121,[Le nouveau mot de passe et sa confirmation ne correspondent pas. Veuillez essayer à nouveau] +fr,dsgw,122,[
                  Le %s %s est déjà utilisé. Veuillez en choisir un autre.\n(The item shown is already in use. Please choose a different one.)
                  \n] +fr,dsgw,123,[élément "%.100s" de données de formulaire manquant\n(missing form data element shown)] +fr,dsgw,124,[Initialisation des données de configuration\n(Initializing config info)] +fr,dsgw,125,[Impossible d´ouvrir le fichier. (Cannot open file.)] +fr,dsgw,126,[Fichier dbconf mal formé. (Malformed dbconf file.)] +fr,dsgw,127,[Nom du propriétaire manquant dans le fichier dbconf.\n(Missing property name in dbconf file.)] +fr,dsgw,128,[Mémoire épuisée. (Out of memory.)] +fr,dsgw,129,[Directive manquante dans le fichier dbconf.\n(Missing directive in dbconf file.)] +fr,dsgw,130,[Impossible d'ouvrir le fichier de configuration "%s"\n(Cannot open config file with name shown)\n] +fr,dsgw,131,[Argument manquant pour la directive "authlifetime"\n(Missing argument for "authlifetime" directive)\n] +fr,dsgw,132,[Argument manquant pour la directive "dirmgr"\n(Missing argument for "dirmgr" directive)\n] +fr,dsgw,133,[Argument manquant pour la directive "baseurl"\n(Missing argument for "baseurl" directive)\n] +fr,dsgw,134,[URL erroné fourni pour la directive "baseurl"; le DN de base est manquant\n(Bad URL provided for "baseurl" directive - the base DN is missing)\n] +fr,dsgw,135,[analyse de la directive baseurl\n(parsing baseurl directive)] +fr,dsgw,136,[URL erroné fourni pour la directive "baseurl"; pas un URL "ldap://"\n(Bad URL provided for "baseurl" directive - not an "ldap://" URL)\n] +fr,dsgw,137,[Les URL "ldaps://" ne sont pas encore supportés\n("ldaps://" URLs are not yet supported)\n] +fr,dsgw,138,[Arguments manquants pour la directive "template"\n(Missing arguments for "template" directive)\n] +fr,dsgw,139,[Argument manquant pour la directive "sslrequired"\n(Missing argument for "sslrequired" directive)\n] +fr,dsgw,140,[Argument inconnu pour la directive "sslrequired" (l´argument doit être "never", "whenauthenticated", "always")\n(Unknown argument to "sslrequired" directive (should be "never", "whenauthenticated", "always"))\n] +fr,dsgw,141,[Argument manquant pour la directive "securitypath"\n(Missing argument for "securitypath" directive)\n] +fr,dsgw,142,[Argument manquant pour la directive "location-suffix"\n(Missing argument for "location-suffix" directive)\n] +fr,dsgw,143,[Trois arguments sont requis pour la directive "location"\n(Three arguments are required for the "location" directive)\n] +fr,dsgw,144,[Au moins deux arguments sont requis pour la directive "newtype"\n(At least two arguments are required for the "newtype" directive)\n] +fr,dsgw,145,[Adresse inconnue dans la directive "newtype"\n(Unknown location in "newtype" directive)\n] +fr,dsgw,146,[Trois ou quatre arguments sont requis pour la directive "tmplset"\n(Three or four arguments are required for the "tmplset" directive)\n] +fr,dsgw,147,[Quatre arguments sont requis pour la directive "attrvset"\n(Four arguments are required for the "attrvset" directive)\n] +fr,dsgw,148,[Argument manquant pour la directive "charset"\n(Missing argument for "charset" directive)\n] +fr,dsgw,149,[Argument manquant pour la directive "ClientLanguage"\n(Missing argument for "ClientLanguage" directive)\n] +fr,dsgw,150,[Argument manquant pour la directive "AdminLanguage"\n(Missing argument for "AdminLanguage" directive)\n] +fr,dsgw,151,[Argument manquant pour la directive "DefaultLanguage"\n(Missing argument for "DefaultLanguage" directive)\n] +fr,dsgw,152,[Nom de fichier manquant pour la directive "include"\n(Missing filename for "include" directive)\n] +fr,dsgw,153,[Directive inconnue dans le fichier de configuration\n(Unknown directive in config file)\n] +fr,dsgw,154,[<= erase_db n´a pas réussi à ouvrir le fichier lcache.conf "%s"\n(<= erase_db could not open lcache.conf file with name shown)\n] +fr,dsgw,155,[\n

                  La base de données a été supprimée. Création d´une nouvelle base de données... \n(The database has been deleted. Creating new database...)\n\n] +fr,dsgw,156,[\n

                  Impossible de supprimer la base de données\n(The database could not be deleted)\n(\n] +fr,dsgw,157,[<= app_suffix n´a pas réussi à ouvrir le fichier ldif "%s"\n(<= app_suffix could not open ldif file with name shown)\n] +fr,dsgw,158,[<= app_suffix n´a pas réussi à ouvrir le fichier tmp "%s"\n(<= app_suffix could not open tmp file with name shown)\n] +fr,dsgw,159,[Impossible de renommer %s en %s (Unable to rename with names as shown)] +fr,dsgw,160,[pointeur null renvoyé par dbconf_read_default_dbinfo().\n(null pointer returned by dbconf_read_default_dbinfo().)] +fr,dsgw,161,[URL "ldapdb" erroné; le DN de base est manquant\n(Bad "ldapdb" URL - the base DN is missing)\n] +fr,dsgw,162,[URL "ldapdb" erroné\n (Bad "ldapdb" URL)\n] +fr,dsgw,163,[URL fourni pour la directive "baseurl" erroné; le DN de base est manquant\n(Bad URL provided for "baseurl" directive - the base DN is missing)\n] +fr,dsgw,164,[analyse de la directive baseurl\n(parsing baseurl directive)] +fr,dsgw,165,[URL fourni pour la directive "baseurl" erroné; pas un URL "ldap:// ou ldapdb://"\n(Bad URL provided for "baseurl" directive - not an "ldap:// or ldapdb://" URL)\n] +fr,dsgw,166,[Les URL "ldaps://" ne sont pas encore supportés\n("ldaps://" URLs are not yet supported)\n] +fr,dsgw,167,[Aucune valeur donnée pour binddn\n(No value given for binddn)] +fr,dsgw,168,[Aucune valeur donnée pour bindpw\n(No value given for bindpw)] +fr,dsgw,169,[Aucun service de répertoires par défaut n´est défini dans le fichier dbswitch.conf\n(There is no default directory service defined in the dbswitch.conf file)] +fr,dsgw,170,[Impossible d'ouvrir le fichier de configuration "%s" en écriture\n(Cannot open config file with name shown for writing)\n] +fr,dsgw,171,[Impossible de renommer %s en %s (Unable to rename with names as shown)] +fr,dsgw,172,[fichier de configuration (config file) %s:] +fr,dsgw,173,[fichier de configuration %s: ligne %d: \n(config file and line as shown)] +fr,dsgw,174,[max %d] +fr,dsgw,175,[ OK ] +fr,dsgw,176,[Fermer la fenêtre (Close Window)] +fr,dsgw,177,[Précédent] +fr,dsgw,178,[{crypt}VERROUILLE (LOCKED) [%s GMT]] +fr,dsgw,179,[Retourner à l´écran principal (Return to Main)] +fr,dsgw,181,[ Help ] +fr,dsgw,182,[Aide (Help)] +fr,dsgw,184,[L´aide n´est pas encore disponible. (Help is not yet available.)] +fr,dsgw,186,[Fermer la fenêtre (Close Window)] +fr,dsgw,187,[Fermer la fenêtre (Close Window)] +fr,dsgw,188,[modèle manquant? (missing ?template)] +fr,dsgw,189,[Authentifier... (Authenticate...)] +fr,dsgw,190,[Mettre les références d´authentification au rebut (déconnexion)?\n(Discard authentication credentials (log out)?)] +fr,dsgw,191,[Veuillez taper une chaîne de recherche] +fr,dsgw,192,[La première étape de l´authentification de l´accès à ce répertoire consiste en votre\npropre identification.
                  Tapez votre nom:\n(The first step in authenticating to the directory is identifying\nyourself.
                  Please type your name:)] +fr,dsgw,193,[Continuer (Continue)] +fr,dsgw,194,[Continuer (Continue)] +fr,dsgw,195,[Annuler (Cancel)] +fr,dsgw,196,[Authentifier comme gestionnaire de répertoires">  (uniquement disponible pour les administrateurs de répertoires)\n(Authenticate as directory manager">  (only available to Directory Administrators))\n] +fr,dsgw,197,[Authentifier... (Authenticate...)] +fr,dsgw,198,[Mettre les références d´authentification au rebut? (Discard authentication credentials?)] +fr,dsgw,200,[Continuer (Continue)] +fr,dsgw,201,[Continuer (Continue)] +fr,dsgw,202,[Annuler (Cancel)] +fr,dsgw,203,[Authentifier l´accès au répertoire (connexion)\n(Authenticate (log in) to the directory)] +fr,dsgw,204,[Vous êtes sur le point de vous authentifier auprès de l'annuaire en tant que %s. Pour terminer le processus d'authentification, tapez votre mot de passe.\n] +fr,dsgw,206,[Avant de pouvoir modifier ou ajouter des entrées, vous devez authentifier\nl´accès au répertoire (connexion). Cette fenêtre vous\nguidera tout au long du processus\nd´authentification.\n(Before you can edit or add entries, you must authenticate\n(log in) to the directory. This window will guide\nyou through the steps of the authentication\nprocess.)\n] +fr,dsgw,207,[Cet écran vous permet d´authentifier l´accès au répertoire, \nou de vous y connecter. Vous devrez vous authentifier\navant de pouvoir modifier les entrées du répertoire. Si vous\ntentez de modifier une entrée sans authentification,\nil vous sera demandé de vous connecter.\n(From this screen you may authenticate, or log in, \nto the directory. You will need to authenticate\nbefore you can modify directory entries. If you\nattempt to modify an entry without authenticating,\nyou will be asked to log in.)\n] +fr,dsgw,208,[Statut de l´authentification (Authentication Status)] +fr,dsgw,209,[\nVotre accès au répertoire est actuellement authentifié sous\n(You are currently authenticated to the directory as) ] +fr,dsgw,210,[.\nSi vous voulez mettre vos références d´authentification au rebut et vous déconnecter du répertoire, cliquez sur le bouton ci-dessous.\n(.\nIf you wish to discard your authentication credentials and log out of the directory, click on the button below.)] +fr,dsgw,211,[Mettre les références d´authentification au rebut (déconnexion)\n(Discard Authentication Credentials (log out))] +fr,dsgw,212,[Vos références d´authentification pour \n(Your authentication credentials for )] +fr,dsgw,213,[ont expiré (have expired).\n


                  )\n] +fr,dsgw,214,[Votre accès au répertoire n´est actuellement pas authentifié.\n(Currently, you are not authenticated to the directory.)
                  \n] +fr,dsgw,215,["%s=" manquant (missing definition shown)] +fr,dsgw,216,["%s=%s" inconnu (unknown assignment as shown)] +fr,dsgw,217,[option inconnue %s (unknown option as shown)] +fr,dsgw,218,[syntaxe inconnue=%s\n(syntax shown unknown)\n] +fr,dsgw,219,[** Type HTML "%s" non supporté **\n(** HTML type shown not supported **
                  )\n] +fr,dsgw,224,[Modifier (Edit)] +fr,dsgw,225,[Save Changes] +fr,dsgw,226,[modify] +fr,dsgw,227,[add] +fr,dsgw,228,[Supprimer (Delete)] +fr,dsgw,229,[Supprimer cette entrée? (Delete this entry?)] +fr,dsgw,230,[Renommer (Rename)] +fr,dsgw,231,[Entrez un nouveau nom pour cette entrée: (Enter a new name for this entry:)] +fr,dsgw,232,[Modifier sous (Edit As)] +fr,dsgw,233,[%s= manquant (missing definition shown)] +fr,dsgw,234,[Fermer la fenêtre (Close Window)] +fr,dsgw,235,[Modifier... (Edit...)] +fr,dsgw,236,["%s=" manquant\n (missing definition shown")\n] +fr,dsgw,237,[ensemble inconnu "%s"\n (set shown is unknown)\n] +fr,dsgw,238,[syntaxe inconnue "%s"\n (syntax shown is unknown)\n] +fr,dsgw,239,[Ré-authentifier (Re-Authenticate)] +fr,dsgw,240,[Fermer la fenêtre (Close Window)] +fr,dsgw,241,[Voulez-vous vraiment (Do you really want to) ] +fr,dsgw,242,[?] +fr,dsgw,243,[ OK ] +fr,dsgw,244,[ OK ] +fr,dsgw,245,[Remettre à zéro (Reset)] +fr,dsgw,246,[Terminé (Done)] +fr,dsgw,247,[Annuler (Cancel)] +fr,dsgw,248,[a trouvé un autre IF (les IF emboîtés ne sont pas supportés)\n(found another IF (nested IFs are not supported))] +fr,dsgw,249,[a trouvé ELSE mais n´a pas vu de IF\n(found ELSE but didn't see an IF)] +fr,dsgw,250,[a trouvé ELSE après ELSE (ENDIF attendu)\n(found ELSE after ELSE (expecting ENDIF))] +fr,dsgw,251,[a trouvé ELIF mais n´a pas vu de IF\n(found ELIF but didn't see an IF)] +fr,dsgw,252,[a trouvé ELIF après ELSE (ENDIF attendu)\n(found ELIF after ELSE (expecting ENDIF))] +fr,dsgw,253,[a trouvé ENDIF mais n´a pas vu de IF\n(found ENDIF but didn't see an IF)] +fr,dsgw,254,[
                  erreur de modèle: %s\n(template error as shown)
                  \n] +fr,dsgw,255,[ldap_init/lcache_init tenté avant la lecture du fichier de configuration\n(ldap_init/lcache_init attempted before config file read)] +fr,dsgw,256,[ne tourne pas sous Administration Server\n(not running under the administration server)] +fr,dsgw,257,[Impossible d´initialiser les permissions\n(Could not initialize permissions)] +fr,dsgw,258,[Impossible de faire correspondre un nom d´utilisateur avec un DN (erreur d´Administration Server)\n(Could not map username to a DN (error from admin server))] +fr,dsgw,259,[Impossible d´obtenir le nom d´utilisateur courant\n(Could not get current username)] +fr,dsgw,260,[Impossible d´obtenir le mot de passe utilisateur courant\n(Could not get current user password)] +fr,dsgw,261,[Erreur (Error): %s] +fr,dsgw,262,[Remarque: aucun modèle d´affichage n´est disponible pour ce type d´entrée; une méthode par défaut\nest donc utilisée dans l´affichage ci-dessous.\n(Note: there is no display template for this type of entry available, so it is\ndisplayed below using a default method.)] +fr,dsgw,263,[Identification de l´utilisateur ou identificateur NULL LDAP non valide\n(Invalid user id or NULL LDAP handle)] +fr,dsgw,264,[aucune correspondance pour l´identification de l´utilisateur\n(no match for user id)] +fr,dsgw,265,[plusieurs correspondances pour l´identification de l´utilisateur\n(more than one match for user id)] +fr,dsgw,266,[the entire directory] +fr,dsgw,267,[Deux arguments sont requis pour la directive "includeset"\n(Two arguments are required for the "includeset" directive)\n] +fr,dsgw,268,[La valeur d'attribut demandée est introuvable dans l'entrée\n(An error occurred while trying to access the database)] +fr,dsgw,269,[Argument introuvable pour la directive "NLS"] +fr,dsgw,270,[Une valeur doit être spécifiée pour l'id d'utilisateur NT\n] +fr,dsgw,271,[La combinaison de l'id d'utilisateur NT et de l'id de domaine NT n'est pas unique dans le répertoire.] +fr,dsgw,272,[Des valeurs doivent être spécifiées pour l'id d'utilisateur NT et l'id de domaine NT\n] +fr,dsgw,273,[La valeur d'id d'utilisateur NT ne doit pas dépasser 20 caractères.\n] +fr,dsgw,274,[Veuillez créer un nom pour la nouvelle entrée.] +fr,dsgw,275,[Veuillez sélectionner une adresse pour la nouvelle entrée.] +fr,dsgw,276,[Nouvelle entrée] +fr,dsgw,277,[Afin de pouvoir utiliser cette fonction, un dirmgr doit être défini dans dsgw.conf] +fr,dsgw,278,[Trois ou quatre arguments sont requis pour la directive "vcard-property"\n] +fr,dsgw,279,[La syntaxe de la propriété Vcard doit être "cis" ou "mls"\n] +fr,dsgw,280,[Aucune entrée n'a été trouvée.\n%2$s] +fr,dsgw,281,[Aucune entrée n'a été trouvée dans les %2$s %3$s '%4$s'.\n] +fr,dsgw,282,[Aucune entrée recherchée n'a été trouvée\n%2$s] +fr,dsgw,283,[Aucune entrée recherchée n'a été trouvée dans les %2$s %3$s %4$s'.\n] +fr,dsgw,284,[1 entrée a été trouvée.\n%2$s] +fr,dsgw,285,[1 entrée a été trouvée dans les %2$s %3$s '%4$s'.\n] +fr,dsgw,286,[1 entrée recherchée a été trouvée.\n%2$s] +fr,dsgw,287,[1 entrée recherchée a été trouvée dans les %2$s %3$s '%4$s'.\n] +fr,dsgw,288,[%1$li entrées ont été trouvées.\n%2$s] +fr,dsgw,289,[%1$li entrées ont été trouvées dans les %2$s %3$s '%4$s'.\n] +fr,dsgw,290,[%1$li entrées recherchées ont été trouvées.\n%2$s] +fr,dsgw,291,[%1$li entrées recherchées ont été trouvées dans les %2$s %3$s '%4$s'.\n ] +fr,dsgw,292,[le filtre LDAP est] +fr,dsgw,293,[Le serveur n´a pas pu trouver l´entrée que vous avez utilisée lors de l´authentification. Quelqu´un a peut-être renommé ou supprimé l´entrée. Procédez à une nouvelle authentification.] +fr,dsgw,294,[La nouvelle syntaxe du mot de passe n´est pas valide.\n] +fr,dsgw,295,[Le nouveau mot de passe figure dans l´historique des mots de passe.\n] +fr,dsgw,296,[Vous avez atteint la limite de nouvelle tentative de mot de passe. Contactez votre administrateur système.\n] +fr,dsgw,297,[Vous avez atteint la limite de nouvelle tentative de mot de passe. Essayez à nouveau.\n] +fr,dsgw,298,[Le mot de passe a expiré. Contactez votre administrateur système pour redéfinir le mot de passe.\n] +fr,frame,-1,[$DBT: frame in DB file v1 $] +fr,frame,1,[Introuvable (Not Found)

                  Introuvable (Not Found)

                  L'objet demandé n'existe pas sur ce serveur. Le lien que vous avez consulté est peut-être désuet, inexact, ou bien le serveur a reçu l'ordre de ne pas vous laisser y accéder.\n(The requested object does not exist on this server. The link you followed is either outdated, inaccurate, or the server has been instructed not to let you have it. )] +fr,frame,2,[Veuillez informer l'administrateur de site de la page de référence.\n(Please inform the site administrator of the referring page.)] +fr,frame,3,[Votre navigateur a envoyé une demande que ce Proxy n'arrive pas à comprendre.\n(Your browser sent a request that this proxy could not understand.)] +fr,frame,4,[Une autorisation adéquate est requise pour l'administration de ce Proxy.\nVotre navigateur n'effectue peut-être pas l'autorisation, ou bien votre autorisation\na échoué.\n(Proper authorization is required for the administration of this proxy.\nEither your browser does not perform authorization, or your authorization\nhas failed.)] +fr,frame,5,[L'authentification du nom d'utilisateur est requise pour utiliser ce Proxy.\nVotre navigateur n'effectue peut-être par l'autorisation de Proxy, ou bien votre\nautorisation a échoué.\n(Username authentication is required for using this proxy.\nEither your browser does not perform proxy authorization, or your\nauthorization has failed.)] +fr,frame,6,[La configuration du contrôle d'accès de ce Proxy refuse l'accès à\nl'objet demandé par le biais de ce Proxy.\n(The proxy's access control configuration denies access to\nthe requested object through this proxy.)] +fr,frame,7,[Le Proxy a rencontré une erreur interne qui l'empêche \nd'honorer votre demande. La cause la plus probable est une mauvaise configuration.\nVeuillez demander à l'administrateur de consulter le journal d'erreurs du Proxy.\n(The proxy has encountered an internal error which prevents it from\nfulfilling your request. The most likely cause is a misconfiguration.\nPlease ask the administrator to look for messages in the proxy's error log.)] +fr,frame,8,[Ce serveur de Proxy ne met pas en oeuvre la méthode demandée.\n(This proxy server does not implement the requested method.)] +fr,frame,9,[Une erreur est survenue sur le serveur de Proxy.\n(An error has occurred on the proxy server.)] +fr,frame,10,[Votre navigateur a envoyé une requête que ce serveur n'arrive pas à comprendre.\n(Your browser sent a query this server could not understand.)] +fr,frame,11,[Une autorisation adéquate est requise pour ce domaine. Votre navigateur n'effectue peut-être pas l'autorisation, ou bien votre autorisation a échoué.\n(Proper authorization is required for this area. Either your browser does not perform authorization, or your authorization has failed.)] +fr,frame,12,[Votre client n'est pas autorisé à accéder à l'objet demandé.\n(Your client is not allowed to access the requested object.)] +fr,frame,13,[Ce serveur a rencontré une erreur interne qui l'empêche d'honorer votre demande. La cause la plus probable est une mauvaise configuration. Veuillez demander à l'administrateur de consulter le journal d'erreurs du serveur.\n(This server has encountered an internal error which prevents it from fulfilling your request. The most likely cause is a misconfiguration. Please ask the administrator to look for messages in the server's error log.)] +fr,frame,14,[Ce serveur ne met pas en oeuvre la méthode demandée.\n(This server does not implement the requested method.)] +fr,frame,15,[Une erreur est survenue. (An error has occurred.)] +fr,frame,16,[Votre navigateur a envoyé un message que ce serveur n'arrive pas à comprendre.\n(Your browser sent a message this server could not understand.)] +fr,frame,17,[%s

                  %s

                  \nCe document a été déplacé à une nouvelle adresse. Veuillez mettre à jour vos documents et listes d'accès en conséquence.\n(This document has moved to a new location. Please update your documents and hotlists accordingly.)] +fr,frame,18,[%s\n

                  %s

                  \n%s\n] +fr,frame,19,[process-uri-objects] +fr,frame,20,[cannot find template %s] +fr,frame,21,[process-uri-objects] +fr,frame,22,[no partial path after object processing] +fr,frame,23,[find-service] +fr,frame,24,[invalid shexp %s] +fr,frame,25,[find-service] +fr,frame,26,[invalid shexp %s] +fr,frame,27,[handle-processed] +fr,frame,28,[no way to service request for %s] +fr,frame,29,[finish-socks-request] +fr,frame,30,[close failed (%s), csd=%d] +fr,frame,31,[This beta software has expired.\n] +fr,frame,32,[mr_accept(%d)] +fr,frame,33,[Error issuing read on accept socket] +fr,frame,34,[acb_accept_connection(%d)] +fr,frame,35,[Error getting accept socket (%d)] +fr,frame,36,[Error in accept! (%d, %s)] +fr,frame,37,[Error creating new accept request] +fr,frame,38,[accepted connection: %d (NSPR %d)] +fr,frame,39,[Error creating new session structure] +fr,frame,40,[accel_read_request()] +fr,frame,41,[Error allocating request read buffer] +fr,frame,42,[Error issuing async read request] +fr,frame,43,[acb_read_request(%d, bytes %d)] +fr,frame,44,[acb_read_req(1 session = %d)] +fr,frame,45,[Error reading request (%d, %s)] +fr,frame,46,[Client aborted connection] +fr,frame,47,[Error reading request] +fr,frame,48,[Error creating new request] +fr,frame,49,[error occurred, closing %d, io was for %d] +fr,frame,50,[accel_async_scan_headers()] +fr,frame,51,[out of memory: accel_async_scan_headers] +fr,frame,52,[out of memory: accel_async_scan_headers] +fr,frame,53,[Error during async read (%d, %s)] +fr,frame,54,[scan-headers reports: line too long] +fr,frame,55,[scan-headers reports: too many headers] +fr,frame,56,[Error reading headers] +fr,frame,57,[scan-headers reports: header missing terminator (an empty line)] +fr,frame,58,[scan-headers reports: header was empty] +fr,frame,59,[nom sans valeur: obtention de la ligne "%s"\n(name without value: got line as shown)] +fr,frame,60,[accel_send_plain_file()] +fr,frame,61,[accel_send_plain_file() - found request %d] +fr,frame,62,[Parse headers lost the URI!] +fr,frame,63,[accel_send_plain_file() - found uri %s] +fr,frame,64,[accel_send_plain_file() - found in cache?] +fr,frame,65,[malloc died!] +fr,frame,66,[Error writing back file\n] +fr,frame,67,[acb_send_plain_file(%d)] +fr,frame,68,[Error writing in acb_send_plain_file (%d, %s)] +fr,frame,69,[acb_close_connection(%d)] +fr,frame,70,[Errored IO in acb_close_connection (%d, %s)] +fr,frame,71,[Unable to close socket %d] +fr,frame,72,[accel-cache-insert: Error allocating entry] +fr,frame,73,[cache-init: server cache disabled] +fr,frame,74,[accel_file_cache: Error initializing file cache] +fr,frame,75,[accel_file_cache: Error creating cache] +fr,frame,76,[accel_file_cache_init: CacheHashSize < %d, using %d] +fr,frame,77,[accel_file_cache_init: CacheHashSize > %d, using %d] +fr,frame,78,[accel_file_cache_init: MaxNumberOfCachedFiles < %d, using %d] +fr,frame,79,[accel_file_cache_init: MaxNumberOfCachedFiles > %d, using %d] +fr,frame,80,[accel_file_cache_init: MaxNumberOfOpenCachedFiles < %d, using %d] +fr,frame,81,[accel_file_cache_init: MaxNumberOfOpenCachedFiles > %d, using %d] +fr,frame,82,[accel_file_cache: Error initializing file cache] +fr,frame,83,[file-cache: enabled = %s ] +fr,frame,84,[on] +fr,frame,85,[off] +fr,frame,86,[file-cache: MaxNumberOfCachedFiles %d (0x%x)] +fr,frame,87,[file-cache: CacheHashSize %d (0x%x)] +fr,frame,88,[file-cache: MaxNumberOfOpenCachedFiles %d (0x%x)] +fr,frame,89,[accel-cache-insert: Error allocating entry] +fr,frame,90,[file-cache-cleanup: munmap failed (%s)] +fr,frame,91,[file-cache-cleanup: found mmapped file \non system without mmap] +fr,frame,92,[file_cache_init: MaxTotalCachedFileSize < %d, using %d] +fr,frame,93,[file_cache_init: MaxTotalCachedFileSize > %d, using %d] +fr,frame,94,[file cache using mmap flags 0x%x] +fr,frame,95,[file cache using mmap prots 0x%x] +fr,frame,96,[file-cache-init: could not create lock] +fr,frame,97,[file-cache: unable to create temporary directory %s.\n] +fr,frame,98,[file-cache: unable to create temporary directory %s.\n] +fr,frame,99,[file-cache: GetTempPath() Cannot find temp directory to store file!] +fr,frame,100,[file-cache-init: set max cached file size to %d] +fr,frame,101,[file-cache-init: could not create lock] +fr,frame,102,[file_cache_destroy()] +fr,frame,103,[file-cache: Unable to get temp file name. Error %s] +fr,frame,104,[file-cache: Unable to get temp file name. Error %s] +fr,frame,105,[file-cache-insert: Error allocating entry] +fr,frame,106,[file-cache-create: Error opening file %s (%s)] +fr,frame,107,[file-cache-create: Error stat()ing file %s (%s)] +fr,frame,108,[file-cache-create: Error mmap()ing file %s (%s)] +fr,frame,109,[file-cache-create: malloc failure] +fr,frame,110,[file-cache-create: error case failed to munmap(%d, %d) (%s)] +fr,frame,111,[file-cache-valid: cannot stat %s] +fr,frame,112,[dir change: invalidating %s (%d)] +fr,frame,113,[file-cache: asynchronous file change notification failed.] +fr,frame,114,[dir change: offset %d, action %d, len %d, name %s] +fr,frame,115,[unable to check async file status] +fr,frame,116,[ReadDirectoryChangesW failure- unable to continue watching %s. Error is %s] +fr,frame,117,[file-cache-add-watch failure- unable to open directory %s. Error %s] +fr,frame,118,[ReadDirectoryChangesW failure- unable to start watching %s. Error %s] +fr,frame,119,[func_exec] +fr,frame,120,[no handler function given for directive] +fr,frame,121,[func_exec] +fr,frame,122,[cannot find function named %s] +fr,frame,123,[handle-request] +fr,frame,124,[method without URI] +fr,frame,125,[http-parse-request] +fr,frame,126,[while scanning HTTP headers, %s] +fr,frame,127,[handle-request] +fr,frame,128,[read from %s failed, error is %s] +fr,frame,129,[handle-request] +fr,frame,130,[request too long] +fr,frame,131,[start-http-response] +fr,frame,132,[write failed (%s)] +fr,frame,133,[start-http-response] +fr,frame,134,[write failed (%s)] +fr,frame,135,[http-status] +fr,frame,136,[%d is not a valid HTTP status code] +fr,frame,137,[finish-request] +fr,frame,138,[close failed (%s)] +fr,frame,139,[Unable to close socket for writing] +fr,frame,140,[os has %d objects] +fr,frame,141,[obj %d has no hash table at %d] +fr,frame,142,[obj %d has no param] +fr,frame,143,[obj %d name %s value %s] +fr,frame,144,[.....directives %d.......] +fr,frame,145,[.....directive %d] +fr,frame,146,[.......instance %d] +fr,frame,147,[...........param name %s value %s] +fr,frame,148,[ClearConfigurationParameters:RegCreateKey %s] +fr,frame,149,[ClearConfigurationParameters:RegEnumKey %s failed] +fr,frame,150,[obj.conf line %d: error in filter file "%s" at line %d: %s] +fr,frame,151,[obj.conf line %d: error in filter file "%s" at line %d: %s] +fr,frame,152,[Unable to allocate Subject property list.\n] +fr,frame,153,[Unable to set session ptr in Subject property list - error=%d\n] +fr,frame,154,[Unable to set request ptr in Subject property list - error=%d\n] +fr,frame,155,[file-cache-valid: cannot stat %s] +fr,frame,156,[file-cache-create: Error stat()ing file %s (%s)] +fr,httpdaemon,-1,[$DBT: httpdaemon in DB file v1 $] +fr,httpdaemon,1,[Error in ConvertThreadToFiber] +fr,httpdaemon,2,[Error in ConvertThreadToFiber] +fr,httpdaemon,3,[Error in md_start_system] +fr,httpdaemon,4,[Error in CreateFiber - idlefiber] +fr,httpdaemon,5,[Error in GetQueuedCompletionStatus] +fr,httpdaemon,6,[Error creating completion port] +fr,httpdaemon,7,[Could not SetHandleNonInheritable (%s)] +fr,httpdaemon,8,[Error accept/read new conn] +fr,httpdaemon,9,[Error in Respond()] +fr,httpdaemon,10,[Error in RespondCompleted()] +fr,httpdaemon,11,[daemon: unable to fork new process (%s)\n] +fr,httpdaemon,12,[daemon: setsid failed (%s)\n] +fr,httpdaemon,13,[daemon: can't log pid to %s (%s)\n] +fr,httpdaemon,14,[warning: could not set group id to %d (%s)\n] +fr,httpdaemon,15,[warning: could not set user id to %d (%s)\n] +fr,httpdaemon,16,[warning: daemon is running as super-user\n] +fr,httpdaemon,17,[could not determine current user name\n] +fr,httpdaemon,18,[error: chroot to %s failed (%s)\n] +fr,httpdaemon,19,[WARNING! netscape executable and library have different versions.\n] +fr,httpdaemon,20,[startup: listening to %s://%s, port %d as %s\n] +fr,httpdaemon,21,[startup: listening to %s://%s, port %d as %s\n] +fr,httpdaemon,22,[seminit failed (%s)\n] +fr,httpdaemon,23,[Using single threaded accepts.] +fr,httpdaemon,24,[Using multi threaded accepts.] +fr,httpdaemon,25,[Using partial single threaded accepts.] +fr,httpdaemon,26,[This machine has %d processors.] +fr,httpdaemon,27,[Error calling thr_seconcurrency(%d)- (%s)] +fr,httpdaemon,28,[Set conncurrency to %d.] +fr,httpdaemon,29,[can't fork new process (%s)] +fr,httpdaemon,30,[This beta software has expired.\n] +fr,httpdaemon,31,[can't create IPC pipe (%s)] +fr,httpdaemon,32,[write to wakeup pipe failed (%s)] +fr,httpdaemon,33,[select thread miss] +fr,httpdaemon,34,[startup failure: could not bind to port %d (%s)\n] +fr,httpdaemon,35,[startup failure: could not bind to port %d, IP address %s (%s)\n] +fr,libaccess,-1,[$DBT: libaccess in DB file v1 $] +fr,libaccess,1,[basic-ncsa] +fr,libaccess,2,[cannot open database %s] +fr,libaccess,3,[basic-ncsa] +fr,libaccess,4,[user %s password did not match database %s] +fr,libaccess,5,[basic-ncsa] +fr,libaccess,6,[cannot open connection to LDAP server on %s:%d] +fr,libaccess,7,[basic-ncsa] +fr,libaccess,8,[user %s password did not match LDAP on %s:%d] +fr,libaccess,9,[acl-state] +fr,libaccess,10,[missing realm] +fr,libaccess,11,[Unable to allocate ACL List Hash\n] +fr,libaccess,12,[ACLEvalBuildContext unable to PERM_MALLOC cache structure\n] +fr,libaccess,13,[ACLEvalBuildContext unable to create hash table\n] +fr,libaccess,14,[ACLEvalBuildContext unable to allocate ACE Entry\n] +fr,libaccess,15,[ACLEvalBuildContext unable to allocate ACE entry\n] +fr,libaccess,16,[ACLEvalBuildContext unable to allocate Boundary Entry\n] +fr,libaccess,17,[ACLEvalBuildContext failed.\n] +fr,libaccess,18,[ACL_EvalTestRights: an interim, absolute non-allow value was encountered. right=%s, value=%d\n] +fr,libaccess,19,[LASDnsBuild unable to allocate hash table header\n] +fr,libaccess,20,[LASDnsBuild unable to add key %s\n] +fr,libaccess,21,[LASDnsBuild unable to add key %s\n] +fr,libaccess,22,[LASDnsBuild unable to add key %s\n] +fr,libaccess,23,[LASDnsBuild unable to add key %s\n] +fr,libaccess,24,[LASDnsBuild unable to add key %s\n] +fr,libaccess,25,[LAS DNS build received request for attribute %s\n] +fr,libaccess,26,[LASDnsEval - illegal comparator %s\n] +fr,libaccess,27,[LASDnsEval unable to allocate Context struct\n\n] +fr,libaccess,28,[LASDnsEval unable to get session address %d\n] +fr,libaccess,29,[LASDnsEval unable to get DNS - error=%s\n] +fr,libaccess,30,[LAS Group Eval received request for attribute %s\n] +fr,libaccess,31,[LASGroupEval - illegal comparator %s\n] +fr,libaccess,32,[LASGroupEval - ran out of memory\n] +fr,libaccess,33,[LASGroupEval unable to get session address %d\n] +fr,libaccess,34,[LASGroupEval unable to get session address %d\n] +fr,libaccess,35,[LASGroupEval - couldn't locate getter for auth-user\n] +fr,libaccess,36,[LASGroupEval - Attribute getter for auth-user failed\n] +fr,libaccess,37,[LASGroupEval - Attribute getter didn't set auth-user\n] +fr,libaccess,38,[Check group membership of user "%s" for group "%s"\n] +fr,libaccess,39,[LDAPU_SUCCESS for group "%s"\n] +fr,libaccess,40,[LDAPU_FAILED for group "%s"\n] +fr,libaccess,41,[LAS_EVAL_FALSE\n] +fr,libaccess,42,[LAS_EVAL_TRUE\n] +fr,libaccess,43,[LASIpTreeAlloc - no memory\n] +fr,libaccess,44,[IP LAS unable to allocate tree node\n] +fr,libaccess,45,[IP LAS unable to allocate tree node\n] +fr,libaccess,46,[LAS IP build received request for attribute %s\n] +fr,libaccess,47,[LASIpEval - illegal comparator %s\n] +fr,libaccess,48,[LASIpEval unable to get session address - error=%s\n] +fr,libaccess,49,[LASIpEval unable to allocate Context struct\n\n] +fr,libaccess,50,[LASIpEval - reach 32 bits without conclusion value=%s] +fr,libaccess,51,[LAS Program Eval received request for attribute %s\n] +fr,libaccess,52,[LASProgramEval - illegal comparator %s\n] +fr,libaccess,53,[LASProgram unable to get session address %d\n] +fr,libaccess,54,[bin] +fr,libaccess,55,[LASProgramEval: request not of type admin or bin, passing.\n] +fr,libaccess,56,[LASProgramEval: check if program %s matches pattern %s.\n] +fr,libaccess,57,[LASProgramEval: Invalid wildcard expression %s.\n] +fr,libaccess,58,[LAS_EVAL_FALSE\n] +fr,libaccess,59,[LAS_EVAL_TRUE\n] +fr,libaccess,60,[Unexpected attribute in dayOfWeek - %s\n] +fr,libaccess,61,[Illegal comparator for dayOfWeek - %s\n] +fr,libaccess,62,[Unexpected attribute in timeOfDay - %s\n] +fr,libaccess,63,[LAS User Eval received request for attribute %s\n] +fr,libaccess,64,[LASUserEval - illegal comparator %s\n] +fr,libaccess,65,[LASUserEval - ran out of memory\n] +fr,libaccess,66,[LASUserEval unable to get session address %d\n] +fr,libaccess,67,[LASUserEval unable to get session address %d\n] +fr,libaccess,68,[LASGroupEval - couldn't locate getter for auth-user\n] +fr,libaccess,69,[LASGroupEval - Attribute getter for auth-user failed\n] +fr,libaccess,70,[LASGroupEval - Attribute getter didn't set auth-user\n] +fr,libaccess,71,[Check if uid == user (i.e. check "%s" == "%s)"\n] +fr,libaccess,72,[SUCCESS for user "%s"\n] +fr,libaccess,73,[FAILED for user "%s"\n] +fr,libaccess,74,[LAS_EVAL_FALSE\n] +fr,libaccess,75,[LAS_EVAL_TRUE\n] +fr,libaccess,76,[] +fr,libaccess,77,[LASProgram unable to get request address - error=%s] +fr,libaccess,78,[LASProgram rejecting request for program %s from pattern %s] +fr,libaccess,79,[ACL_CacheFlush: unable to parse file "%s"\n] +fr,libaccess,80,[ACL_CacheFlush: unable to concatenate ACL list "%s"\n] +fr,libaccess,81,[ACL_CacheFlush: unable to open and process the magnus file "%s"\n] +fr,libaccess,82,[Illegal comparator for timeOfDay - %s\n] +fr,libaccess,83,[ACL_EvalBuildContext unable to create hash table\n] +fr,libaccess,84,[ACL_EvalBuildContext unable to PERM_CALLOC cache structure\n] +fr,libaccess,85,[ACL_EvalBuildContext unable to allocate ACE entry\n] +fr,libaccess,86,[ACL_EvalBuildContext unable to allocate auth pointer array\n] +fr,libaccess,87,[ACL_EvalBuildContext unable to allocate auth plist\n] +fr,libaccess,88,[ACL_EvalTestRights: an interim, absolute non-allow value was encountered. right=%s, value=%s\n] +fr,libaccess,89,[ACL_INTEvalTestRights: call to ACL_EvalBuildContext returned failure status\n] +fr,libaccess,90,[ACL_ModuleRegister: module name is missing\n] +fr,libaccess,91,[ACL_ModuleRegister: call to module init function returned a failed status\n] +fr,libaccess,92,[ACL_GetAttribute: couldn't determine method for %s\n] +fr,libaccess,93,[ACL_GetAttribute: couldn't locate getter for %s] +fr,libaccess,94,[ACL_GetAttribute: attr getter failed to get %s] +fr,libaccess,95,[ACL_GetAttribute: attr getter failed to get %s] +fr,libaccess,96,[ACL_GetAttribute: All attribute getters declined for attr %s] +fr,libaccess,97,[ACL_DatabaseRegister: dbtype for database "%s" is not defined yet!] +fr,libaccess,98,[ACL_DatabaseRegister: database name is missing] +fr,libaccess,99,[Error reading the DB Map File: %s. Reason: %s] +fr,libaccess,100,[URL is missing for database %s] +fr,libaccess,101,[Invalid property value pair for database %s] +fr,libaccess,102,["default" database must be an LDAP database] +fr,libaccess,103,[Multiple "default" databases are being registered] +fr,libaccess,104,["default" LDAP database must be registered] +fr,libaccess,105,[LASGroupEval unable to get database name - error= %s] +fr,libaccess,106,[received invalid program expression %s] +fr,libaccess,107,[parse_ldap_url: database url is missing] +fr,libaccess,108,[parse_ldap_url: database name is missing] +fr,libaccess,109,[parse_ldap_url: error in parsing ldap url. Reason: %s] +fr,libaccess,110,[ldap password check: unable to get database name - error=%s] +fr,libaccess,111,[ldap password check: unable to get parsed database %s] +fr,libaccess,112,[ldap password check: couldn't initialize connection to LDAP. Reason: %s] +fr,libaccess,113,[ldap password check: LDAP error: "%s"] +fr,libaccess,114,[get_user_ismember_ldap unable to get database name - error=%s] +fr,libaccess,115,[get_user_ismember_ldap unable to get parsed database %s] +fr,libaccess,116,[ldap password check: couldn't initialize connection to LDAP. Reason: %s] +fr,libaccess,117,[get_user_ismember_ldap: group %s does not exist] +fr,libaccess,118,[get_user_ismember_ldap: LDAP error: "%s"] +fr,libaccess,119,[ACL_LDAPDatabaseHandle: %s is not a registered database] +fr,libaccess,120,[ACL_LDAPDatabaseHandle: %s is not an LDAP database] +fr,libaccess,121,[ACL_LDAPDatabaseHandle: out of memory] +fr,libaccess,122,[ACL_LDAPDatabaseHandle: couldn't initialize connection to LDAP. Reason: %s] +fr,libaccess,123,[ACL_LDAPDatabaseHandle: couldn't bind to LDAP server. Reason: %s] +fr,libaccess,124,[insufficient dynamic memory] +fr,libaccess,125,[error opening file, %s: %s] +fr,libaccess,126,[duplicate definition of %s] +fr,libaccess,127,[file %s, line %s: duplicate definition of %s] +fr,libaccess,128,[file %s, line %s: syntax error] +fr,libaccess,129,[file %s, line %s: %s is undefined] +fr,libaccess,130,[in acl %s, %s %s is undefined] +fr,libaccess,131,[database %s: error accessing %s] +fr,libaccess,132,[%s] +fr,libaccess,133,[file %s, line %s: invalid syntax] +fr,libaccess,134,[file %s, line %s: syntax error at "%s"] +fr,libaccess,135,[realm %s is not defined] +fr,libaccess,136,[error code = %d] +fr,libaccess,137,[internal ACL error] +fr,libaccess,138,[invalid argument] +fr,libaccess,139,[ACL_DatabaseRegister: dbtype for database "%s" is not defined yet!] +fr,libaccess,140,[couldn't determine dbtype from: %s] +fr,libaccess,141,[Failed to register database %s] +fr,libaccess,142,[ACL call returned failed status] +fr,libaccess,143,[file %s: ACL IO error - %s] +fr,libaccess,144,[acl_user_exists: mémoire insuffisante] +fr,libaccess,145,[acl_user_exists: l'utilisateur n'existe plus] +fr,libaccess,146,[acl_user_exists: erreur de plist] +fr,libadmin,-1,[$DBT: libadmin in DB file v1 $] +fr,libadmin,1,[ Help ] +fr,libadmin,2,[ OK ] +fr,libadmin,3,[ Reset ] +fr,libadmin,4,[ Done ] +fr,libadmin,5,[ Cancel ] +fr,libir,-1,[$DBT: libadmin in DB file v1 $] +fr,libir,1,[An I/O error occurred before all form data could be read.] diff --git a/l10n/dirserv/ja/ns-slapd.txt b/l10n/dirserv/ja/ns-slapd.txt new file mode 100644 index 00000000..2ce736c2 --- /dev/null +++ b/l10n/dirserv/ja/ns-slapd.txt @@ -0,0 +1,1018 @@ +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +/**************************************************************************/ +/* The copyright notice(s) in this Source Code does not indicate actual */ +/* or intended publication of this Source Code. */ +/**************************************************************************/ + +/* This text file was generated by program dblink */ + +$Revision: 1.1 $ +$Log: ns-slapd.txt,v $ +Revision 1.1 2005/01/21 00:40:48 cvsadm +Initial revision + +Revision 1.2.10.6 2003/09/22 19:36:43 ulfw +Update copyright years from 2001 to 2001-2003 + +Revision 1.2.10.5 2001/11/03 01:07:47 richm +XXX use new copyright XXX + +Revision 1.2.10.4 2001/10/06 17:54:34 richm +ns/netsite/l10n/dirserv/ja/ns-slapd.txt +1.2.10.3 +20010918 + +Remove copyright caracter from copyright + + +==================================================== + +Revision 1.2.10.3 2001/09/18 11:48:17 rmarco +Remove copyright caracter from copyright + +Revision 1.2.10.2 2001/02/13 09:59:57 rmarco +Copyrights + +Revision 1.2.10.1 1998/10/10 02:14:12 ggood +Copy from Directory40RtmBranchpoint to DirectoryBranch + +Revision 1.2.2.2.6.2 1998/04/04 23:16:59 mcs +merge changes made on directory31_rtm_branch into server4_directory_branch + +Revision 1.2.2.6.2.1 1998/02/24 05:39:08 noriko +Added new updates from the translators + +Revision 1.1.2.7 1998/02/19 23:47:54 scronin +Merged Noriko's edits with translated updates + +Revision 1.2.2.6 1998/02/17 22:01:21 noriko +Fixed + +Revision 1.2.2.5 1998/02/16 22:33:53 noriko +Replaced words to display them correctly on NT Communicator 4.04 -- see also http://xiulu/ds30/l10n/translation-ja.htm + +Revision 1.2.2.4 1998/02/16 02:01:02 noriko +removed the last dash from Japanese + +Revision 1.2.2.3 1998/02/16 01:31:41 noriko +Fixed search result message + +Revision 1.2.2.2 1997/12/20 03:32:16 werudge +Copy from server3_i18npkg_branch to server3_directory_branch + +Revision 1.1.2.5 1997/12/19 02:19:37 werudge +UTF8 Encoded from ja/ns-slapd.txt.eucjp : 1.1.2.5 +Based on en/ns-slapd.txt : 1.1.2.3 + +Revision 1.1.2.5 1997/12/19 02:04:05 werudge +Based on en/ns-slapd.txt : 1.1.2.3 +daily 971113.1 SOLARIS-export-optimize-normal-slapd +$EndLog$ + +$StartStringData$ + +ja,base,-1,[$DBT: base in DB file v1 $] +ja,base,1,[¥Ï¥Ã¥·¥å ¥Æ¡¼¥Ö¥ë¤òºîÀ®¤¹¤ë¤¿¤á¤Î¥á¥â¥ê¤¬ÉÔ­¤·¤Æ¤¤¤Þ¤¹¡£] +ja,base,2,[¥Ï¥Ã¥·¥å ¥Æ¡¼¥Ö¥ë¤òºîÀ®¤¹¤ë¤¿¤á¤Î¥á¥â¥ê¤¬ÉÔ­¤·¤Æ¤¤¤Þ¤¹] +ja,base,3,[cache_destroy: ¥­¥ã¥Ã¥·¥å ¥Æ¡¼¥Ö¥ë¤¬ÉÔÀµ¤Ç¤¹¡£] +ja,base,4,[¥Ï¥Ã¥·¥å ¥¨¥ó¥È¥ê¤ò³ä¤êÅö¤Æ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£] +ja,base,5,[cache_insert: ¥­¥ã¥Ã¥·¥å ¥¨¥ó¥È¥ê¤òºîÀ®¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£] +ja,base,6,[HTTP/1.0 200 OK\nContent-type: text/html\n\n] +ja,base,7,[

                  Netscape ¥­¥ã¥Ã¥·¥å ¥¹¥Æ¡¼¥¿¥¹ ¥ì¥Ý¡¼¥È

                  \n] +ja,base,8,[¥·¥¹¥Æ¥à¾å¤Ë¥­¥ã¥Ã¥·¥å¤¬Â¸ºß¤·¤Þ¤»¤ó¡£

                  ] +ja,base,9,[

                  %s ¥­¥ã¥Ã¥·¥å

                  \n] +ja,base,10,[¥­¥ã¥Ã¥·¥å ¥Ò¥Ã¥È ¥ì¥·¥ª¡§ %d/%d (%f)

                  \n

                  \n] +ja,base,11,[¥­¥ã¥Ã¥·¥å ¥µ¥¤¥º¡§ %d/%d

                  \n

                  \n] +ja,base,12,[¥Ï¥Ã¥·¥å ¥Æ¡¼¥Ö¥ë ¥µ¥¤¥º¡§ %d

                  \n

                  \n] +ja,base,13,[mru : %d

                  \nlru : %d

                  \n] +ja,base,14,[
                    Compartiment (Bucket) Adresse (Address) Clef (Key) Nombre d'accès (Access Count) Supprimer (Delete) Suivant (Next) LRU MRU Données (Data)
                    \n] +ja,base,15,[munmap failed (%s)] +ja,base,16,[munmap failed (%s)] +ja,base,17,[close failed (%s)] +ja,base,18,[daemon: unable to fork new process (%s)\n] +ja,base,19,[daemon: setsid failed (%s)\n] +ja,base,20,[daemon: can't log pid to %s (%s)\n] +ja,base,21,[warning: could not set group id to %d (%s)\n] +ja,base,22,[warning: could not set user id to %d (%s)\n] +ja,base,23,[warning: daemon is running as super-user\n] +ja,base,24,[could not determine current user name\n] +ja,base,25,[error: chroot to %s failed (%s)\n] +ja,base,27,[, address %s] +ja,base,28,[warning: statistics disabled (%s)\n] +ja,base,29,[security handshake timed out for pid %d] +ja,base,30,[warning: statistics disabled (%s)\n] +ja,base,31,[secure handshake failed (code %d)\n] +ja,base,32,[accept failed (%s)] +ja,base,33,[warning: statistics disabled (%s)\n] +ja,base,34,[select thread miss] +ja,base,35,[keepalive worker awoken with no work to do] +ja,base,36,[could not create new thread: %d (%s)] +ja,base,37,[wait for sema succeeded, but nothing to dequeue] +ja,base,38,[queue-sema creation failure] +ja,base,39,[error getting processor info for processor %d] +ja,base,40,[Error binding to processor %d] +ja,base,41,[bound process %d to processor %d] +ja,base,42,[Netscape server is not explicitly binding to any processors.] +ja,base,43,[cache monitor exited] +ja,base,44,[cache batch update daemon exited] +ja,base,45,[Using single threaded accepts.] +ja,base,46,[Using multi threaded accepts.] +ja,base,47,[Using partial single threaded accepts.] +ja,base,48,[This machine has %d processors.] +ja,base,49,[Error calling thr_seconcurrency(%d)- (%s)] +ja,base,50,[Set conncurrency to %d.] +ja,base,51,[WARNING! netscape executable and library have different versions.\n] +ja,base,54,[seminit failed (%s)\n] +ja,base,55,[This beta software has expired.\n] +ja,base,56,[Cache monitor respawned] +ja,base,57,[Cache batch update daemon respawned] +ja,base,58,[can't find empty statistics slot] +ja,base,59,[can't fork new process (%s)] +ja,base,60,[assert failed! %s\n] +ja,base,61,[mr_table_init()] +ja,base,62,[malloc failed] +ja,base,63,[malloc failed!] +ja,base,64,[mr_add_io(%d, type %d, file %d)] +ja,base,65,[mr_add_io - stage 1] +ja,base,66,[mr_add_io - stage 2] +ja,base,67,[mr_add_io found invalid IO type %d] +ja,base,68,[mr_add_io - adding timeout] +ja,base,69,[Out of memory!\n] +ja,base,70,[done with mr_add_io] +ja,base,71,[mr_del_io(%d, type %d, file %d)] +ja,base,72,[mr_del_io found invalid IO type %d] +ja,base,73,[mr_lookup_io(%d)] +ja,base,74,[mr_async_io(%d, %d bytes, file %d)] +ja,base,75,[malloc failure adding async IO] +ja,base,76,[Error adding async io!] +ja,base,77,[Cannot seek for read!] +ja,base,78,[read failure! (%d, %s)] +ja,base,79,[do_read read %d bytes for file %d] +ja,base,80,[Cannot seek for write!] +ja,base,81,[writev failure! (%d, %s)] +ja,base,82,[write failure! (%d, %s)] +ja,base,83,[do_write wrote %d bytes for file %d] +ja,base,84,[do_timeout(mrp %d)] +ja,base,85,[do_timeout: found IO (timer=%d, time=%d)] +ja,base,86,[error deleting io] +ja,base,87,[timeout callback failure for %d\n] +ja,base,88,[mr_get_event(%d) - outstanding io %d] +ja,base,89,[mr_get_event: Waiting for reads on FD:] +ja,base,90,[mr_get_event: Waiting for writes on FD:] +ja,base,91,[ %d] +ja,base,92,[ %d] +ja,base,93,[mr_get_event set no timeout] +ja,base,94,[mr_get_event set timeout to: %d.%d sec] +ja,base,95,[error in select (%d, %s)] +ja,base,96,[mr_get_event() - select found %d] +ja,base,97,[error looking up IO fd %d] +ja,base,98,[read failed for fd %d] +ja,base,99,[error deleting io] +ja,base,100,[callback failure for %d\n] +ja,base,101,[error looking up IO fd %d] +ja,base,102,[writing: header len %d, writelen %d, total %d] +ja,base,103,[write failed for fd %d] +ja,base,104,[error deleting io] +ja,base,105,[callback failure for %d\n] +ja,base,106,[Error creating dns cache] +ja,base,107,[dns_cache_init: hash_size <= 0, using %d] +ja,base,108,[dns_cache_init: cache-size <= %d, using %d] +ja,base,109,[dns_cache_init: cache-size is %d is too large, using %d.] +ja,base,110,[dns_cache_init: expire_time <= 0, using %d] +ja,base,111,[dns_cache_init: expire is %d is too large, using %d seconds.] +ja,base,112,[Error creating dns cache] +ja,base,113,[dns-cache-insert: Error allocating entry] +ja,base,114,[dns-cache-insert: malloc failure] +ja,base,115,[successful server startup] +ja,base,116,[%s B%s] +ja,base,117,[Netscape executable and shared library have different versions] +ja,base,118,[ executable version is %s] +ja,base,119,[ shared library version is %s] +ja,base,120,[error reporting shutting down] +ja,base,121,[warning] +ja,base,122,[config] +ja,base,123,[security] +ja,base,124,[failure] +ja,base,125,[catastrophe] +ja,base,126,[info] +ja,base,127,[verbose] +ja,base,128,[event_handler:Failed to wait on events %s] +ja,base,129,[could not wait on resume event event (%s)] +ja,base,130,[dlopen of %s failed (%s)] +ja,base,131,[dlopen of %s failed (%s)] +ja,base,132,[The server is terminating due to an error. Check the event viewer for the error message. SERVER EXITING!] +ja,base,133,[Terminating the server %s] +ja,base,134,[kill_server:cannot open server event %s] +ja,base,135,[kill_server:cannot set server event %s] +ja,base,136,[error: could not get socket (%s)\n] +ja,base,137,[error: could not set socket option (%s)\n] +ja,base,138,[Terminating Service:error: could not bind to address %s port %d (%s)\n] +ja,base,139,[Terminating Service:error: could not bind to port %d (%s)\n] +ja,base,140,[SetHandleNonInheritable: could not duplicate socket (%s)] +ja,base,141,[SetHandleNonInheritable: closing the original socket failed (%s)] +ja,base,142,[Could not SetHandleInformation (%s)] +ja,base,143,[Terminating Service:Failure: Could not open statistics file (%s)\n] +ja,base,144,[Could not set Thread Local Storage Value for thread at slot %d] +ja,base,145,[secure handshake failed (code %d)\n] +ja,base,146,[accept failed %d (%s)] +ja,base,147,[Failed to pulse Event %d %s] +ja,base,148,[Failed to send MobGrowth Event to parent %s] +ja,base,149,[Pulsing MobRespawn Event %d] +ja,base,150,[respawn thread pool to %d (%d)] +ja,base,151,[Could not open event to signal rotate application. Could not create the MoveLog event:%s] +ja,base,152,[Failed to send MoveLog Event to rotate app %s] +ja,base,153,[growing thread pool from %d to %d] +ja,base,154,[Could not open the ServiceControlManager, Error %d] +ja,base,155,[StartNetsiteService:Could not open the service %s: Error %d] +ja,base,156,[StartNetsiteService:Could not start the service %s] +ja,base,157,[Service Startup: Could not allocate security descriptor] +ja,base,158,[Service Startup: Could not init security descriptor] +ja,base,159,[Service Startup: Could not set the security Dacl] +ja,base,160,[Terminating Service:WinSock init failed: %s] +ja,base,161,[Httpd Server Startup failed: %s] +ja,base,162,[can't find empty statistics slot] +ja,base,163,[NT daemon: could not create new thread %d] +ja,base,164,[Service Startup Failure. Terminating Service:Could not create event %d:%s] +ja,base,165,[Service Startup Error. Could not create the MoveLog event:%s] +ja,base,166,[Failed to wait on Event objects %s] +ja,base,167,[Failed to wait on Event objects %s] +ja,base,168,[pipebuf_buf2sd: pipebuf_grab IO_ERROR %d] +ja,base,169,[pool-init: memory pools disabled] +ja,base,170,[pool-init: free_size <= 0, using %d] +ja,base,171,[pool-create-block: out of memory] +ja,base,172,[pool-create: out of memory] +ja,base,173,[pool-create: out of memory] +ja,base,174,[pool-malloc: out of memory] +ja,base,175,[FREE() used where PERM_FREE() should have been used- problem corrected and supressing further warnings.] +ja,base,176,[regex error: %s (regex: '%s')] +ja,base,177,[can't create IPC pipe (%s)] +ja,base,178,[write to wakeup pipe failed (%s)] +ja,base,179,[flushing %d connections; current %d; tot %d] +ja,base,180,[accept failed (%s)] +ja,base,181,[Error creating time cache] +ja,base,182,[time-cache: cache disabled] +ja,base,183,[time_cache_init: hash_size < %d, using default, %d] +ja,base,184,[time_cache_init: hash_size > %d, using default, %d] +ja,base,185,[time_cache_init: cache_size < %d, using default, %d] +ja,base,186,[time_cache_init: cache_size > %d, using default, %d] +ja,base,187,[Error allocating memory for time_cache] +ja,base,188,[Error allocating memory for time_cache entry] +ja,base,189,[Error allocating memory for time_cache entry] +ja,base,190,[Error inserting new time_cache entry] +ja,base,191,[Error allocating memory for time_cache] +ja,base,192,[cs-terminate failure (%s)] +ja,base,193,[cs-init failure (%s)] +ja,base,194,[cs-wait failure (%s)] +ja,base,195,[cs-post failure (%s)] +ja,base,196,[Unable to create nonblocking socket (%s)] +ja,base,197,[error: could not set keepalive (%s)\n] +ja,base,198,[error: could not set recv timeout (%s)\n] +ja,base,199,[error: could not set send timeout (%s)\n] +ja,base,200,[Unable to create nonblocking socket (%s)] +ja,base,201,[sem_grab failed (%s)] +ja,base,202,[sem_release failed (%s)] +ja,base,203,[sem_release failed (%s)] +ja,base,204,[Could not remove temporary directory %s, Error %d] +ja,base,205,[Could not remove temporary directory %s, Error %d] +ja,dsgw,-1,[$DBT: dsgw in DB file v1 $] +ja,dsgw,1,[ç†è§£ã§ããªã„ HTTP リクエストã§ã™ã€‚] +ja,dsgw,2,[䏿­£ãªã¾ãŸã¯ã€å®Œäº†ã—ã¦ã„ãªã„ HTML フォーム データã§ã™ã€‚] +ja,dsgw,3,[メモリä¸è¶³ã§ã™ã€‚] +ja,dsgw,4,[query/form ã®å…¥åŠ›ãŒã•れã¦ã„ã¾ã›ã‚“。] +ja,dsgw,5,[ファイルã¾ãŸã¯ãƒ‘ã‚¹ã®æŒ‡å®šã«ä¸æ­£ãªæ–‡å­—ãŒä½¿ç”¨ã•れã¦ã„ã¾ã™ã€‚] +ja,dsgw,6,[設定ファイルãŒè¦‹ã¤ã‹ã‚‰ãªã„ã‹ä¸æ­£ã§ã™ã€‚] +ja,dsgw,7,[LDAP ã‚’åˆæœŸåŒ–ã§ãã¾ã›ã‚“。] +ja,dsgw,8,[LDAP ã¨ã®æŽ¥ç¶šæ™‚ã«ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¾ã—ãŸã€‚] +ja,dsgw,9,[検索ã®å¯¾è±¡ã¨ãªã‚‹ã‚ªãƒ–ジェクトをèªè­˜ã§ãã¾ã›ã‚“。] +ja,dsgw,10,[ç†è§£ã§ããªã„属性ラベルã§ã™ã€‚] +ja,dsgw,11,[マッムプロンプトをç†è§£ã§ãã¾ã›ã‚“。] +ja,dsgw,12,[オブジェクト タイプã«å¯¾ã™ã‚‹æ¤œç´¢ãƒ•ィルタãŒã‚りã¾ã›ã‚“。] +ja,dsgw,13,[HTML テンプレート ファイルを開ãã“ã¨ãŒã§ãã¾ã›ã‚“。] +ja,dsgw,14,[検索モードをç†è§£ã§ãã¾ã›ã‚“。 - "smart", "complex", "pattern", ã¾ãŸã¯ "auth" を指定ã—ã¦ãã ã•ã„。] +ja,dsgw,15,[URL を指定ã™ã‚‹æƒ…å ±ãŒæ¬ è½ã—ã¦ã„ã¾ã™ã€‚] +ja,dsgw,16,[URL ã®æŒ‡å®šãŒä¸æ˜Žã§ã™ã€‚] +ja,dsgw,17,[未承èªã® URL ã‚‚ã—ãã¯æœªçŸ¥ã®ã‚¨ãƒ©ãƒ¼] +ja,dsgw,18,[URL フォーマットãŒä¸æ­£ã§ã™ã€‚] +ja,dsgw,19,[内部エラー] +ja,dsgw,20,[テンプレート インデックス ãƒ•ã‚¡ã‚¤ãƒ«ã®æ›¸ãè¾¼ã¿ã«å¤±æ•—ã—ã¾ã—ãŸã€‚] +ja,dsgw,21,[テンプレート インデックス ファイルを開ãã“ã¨ãŒã§ãã¾ã›ã‚“ã§ã—ãŸã€‚] +ja,dsgw,22,[Directory を読ã¿è¾¼ã‚€ã“ã¨ãŒã§ãã¾ã›ã‚“。] +ja,dsgw,23,[LDAP SSL ã®åˆæœŸåŒ–ã«å¤±æ•—ã—ã¾ã—ãŸã€‚ (セキュリティ パスを確èªã—ã¦ãã ã•ã„。)] +ja,dsgw,24,[SSLã§ä½œæ¥­ã™ã‚‹ãŸã‚ã®ãƒ¦ãƒ¼ã‚¶ã¨ã‚°ãƒ«ãƒ¼ãƒ— フォームã®å ´åˆã€ãƒ¦ãƒ¼ã‚¶ã¾ãŸã¯ã‚µãƒ¼ãƒç®¡ç†è€…ãŒã“ã®Administration Serverã® SSL ã‚’èµ·å‹•ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™ã€‚ã“れを行ã†ã®ã«[æš—å·åŒ–]ã®[オン/オフ]ページを使用ã§ãã¾ã™ã€‚] +ja,dsgw,25,[証明書データベースã«è¨¼æ˜Žæ›¸ãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“ã§ã—ãŸã€‚] +ja,dsgw,26,[エラー: 証明書データベースã‹ã‚‰ãƒ‡ãƒ¼ã‚¿ã‚’å¾—ã‚‹ã“ã¨ãŒã§ãã¾ã›ã‚“ã§ã—ãŸã€‚] +ja,dsgw,27,[ã‚ãªãŸã®è¨¼æ˜Žæ›¸ã®æœ‰åŠ¹æœŸé™ã¯åˆ‡ã‚Œã¦ã„ã¾ã™ã€‚] +ja,dsgw,28,[ç„¡ä½œç‚ºã®æ–‡å­—列を作æˆã§ãã¾ã›ã‚“] +ja,dsgw,29,[証明書を検索ã—ã¾ã—ãŸãŒã€è­˜åˆ¥åを見ã¤ã‘ã‚‹ã“ã¨ãŒã§ãã¾ã›ã‚“ã§ã—ãŸã€‚] +ja,dsgw,30,[証明書データベースを開ãã“ã¨ãŒã§ãã¾ã›ã‚“。] +ja,dsgw,31,[証明書データベースã«è¿½åŠ ã‚’è¡Œã†ã“ã¨ãŒã§ãã¾ã›ã‚“ã§ã—ãŸã€‚] +ja,dsgw,32,[Directory Manager ãŒå®šç¾©ã•れã¦ã„ã¾ã›ã‚“。] +ja,dsgw,33,[検索文字列ãŒå…¥åŠ›ã•れã¦ã„ã¾ã›ã‚“。もã†ä¸€åº¦å…¥åŠ›ã—ã¦ãã ã•ã„。] +ja,dsgw,34,[設定ファイルã®ï¼‘行中ã«è¨­å®šé …ç›®ãŒå¤šã™ãŽã¾ã™ã€‚] +ja,dsgw,35,[ウインドウズ ソケットã®åˆæœŸåŒ–ã«å¤±æ•—ã—ã¾ã—ãŸã€‚] +ja,dsgw,36,[証明書をアドミニストレーション サーãƒã‹ã‚‰å¾—ã‚‹ã“ã¨ãŒã§ãã¾ã›ã‚“ã§ã—ãŸã€‚] +ja,dsgw,37,[識別ã•れるåå‰ãŒ ldapdb:// ã«è¦‹ã¤ã‹ã‚Šã¾ã›ã‚“。] +ja,dsgw,38,[未承èªã® URL ã¾ãŸã¯æœªçŸ¥ã®ã‚¨ãƒ©ãƒ¼] +ja,dsgw,39,[URL ã®ãƒ•ォーマットã«ä¸æ­£ãŒã‚りã¾ã™ã€‚] +ja,dsgw,40,[ローカル LDAP データベースã®åˆæœŸåŒ–中ã«ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¾ã—ãŸ] +ja,dsgw,41,[Directory サービスã®ã‚¿ã‚¤ãƒ—ãŒä¸æ˜Žã§ã™ã€‚ - "local" ã¾ãŸã¯ "remote" を指定ã—ã¦ãã ã•ã„。] +ja,dsgw,42,[db 設定ファイルã®èª­ã¿è¾¼ã¿ä¸­ã«ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¾ã—ãŸã€‚] +ja,dsgw,43,[NSHOME/userdb ã®ãƒ‘ã‚¹ãŒæŒ‡å®šã•れã¦ã„ã¾ã›ã‚“。] +ja,dsgw,44,[Directory サービスã®è¨­å®šã‚’æ›´æ–°ã™ã‚‹ã“ã¨ãŒã§ãã¾ã›ã‚“。] +ja,dsgw,45,[エントリを Directory ã‹ã‚‰èª­ã¿è¾¼ã‚€ã“ã¨ãŒã§ãã¾ã›ã‚“。] +ja,dsgw,46,[LDAP データベースを消去ã™ã‚‹ã“ã¨ãŒã§ãã¾ã›ã‚“。] +ja,dsgw,47,[エントリã®å¤‰æ›´ãŠã‚ˆã³è¿½åŠ ã‚’è¡Œã†ã“ã¨ã¯ã§ãã¾ã›ã‚“。] +ja,dsgw,48,[å•題] +ja,dsgw,49,[証明書ã«å•題ãŒã‚りã¾ã™ã€‚] +ja,dsgw,50,[.\n

                    次ã«ç§»ã‚‹å‰ã«å†åº¦èªè¨¼ã‚’å—ã‘ã‚‹å¿…è¦ãŒã‚りã¾ã™ã€‚\n] +ja,dsgw,51,[.\n

                    次ã«ç§»ã‚‹å‰ã«å†åº¦èªè¨¼ã‚’å—ã‘ã‚‹å¿…è¦ãŒã‚りã¾ã™ã€‚\n] +ja,dsgw,52,[未知ã®ã‚¨ãƒ©ãƒ¼] +ja,dsgw,53,[æ“作ã¯å®Œäº†ã—ã¾ã—ãŸã€‚] +ja,dsgw,54,[サーãƒå†…部ã§ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¾ã—ãŸã€‚\n サーãƒç®¡ç†è€…ã«ç¾åœ¨ã®çŠ¶æ…‹ã‚’é€£çµ¡ã—ã¦ãã ã•ã„。] +ja,dsgw,55,[サーãƒã¯ã‚²ãƒ¼ãƒˆã‚¦ã‚¨ã‚¤ã‹ã‚‰å—ã‘å–ã£ãŸãƒªã‚¯ã‚¨ã‚¹ãƒˆã‚’ç†è§£ã§ãã¾ã›ã‚“。] +ja,dsgw,56,[ã‚ãªãŸã®ãƒªã‚¯ã‚¨ã‚¹ãƒˆã¯å¿œç­”ãŒãªã„ã¾ã¾ã‚¿ã‚¤ãƒ ã‚¢ã‚¦ãƒˆã—ã¾ã—ãŸã€‚\n å†åº¦æ¤œç´¢ã‚’行ã†éš›ã«ã¯ã€æ¤œç´¢ã®çµæžœã‚’よã考慮ã—ã€åŠ¹çŽ‡ã®ã‚ˆã„æ–¹æ³•ã§æ¤œç´¢ã‚’ãŠã“ãªã£ã¦ãã ã•ã„。] +ja,dsgw,57,[ã‚ãªãŸã®ãƒªã‚¯ã‚¨ã‚¹ãƒˆã§å¾—ãŸçµæžœãŒå¤§ãã™ãŽã¾ã™ã€‚\n å†åº¦æ¤œç´¢ã‚’行ã†éš›ã«ã¯ã€æ¤œç´¢ã®çµæžœã‚’よã考慮ã—ã€åŠ¹çŽ‡ã®ã‚ˆã„æ–¹æ³•ã§æ¤œç´¢ã‚’ãŠã“ãªã£ã¦ãã ã•ã„。] +ja,dsgw,58,[サーãƒãŒç†è§£ã§ããªã„方法を使用ã—ã¦ã€\nゲートウエイãŒã‚µãƒ¼ãƒã«èªè¨¼ã‚’試ã¿ã¾ã—ãŸã€‚] +ja,dsgw,59,[ゲートウエイを経由ã—ãŸèªè¨¼ã¯ã€ã‚µãƒ¼ãƒã§è¡Œã†ã“ã¨ãŒã§ãã¾ã›ã‚“。] +ja,dsgw,60,[リクエストã«å¿…è¦ãªæƒ…å ±ãŒæ¬ è½ã—ã¦ã„ã¾ã™ã€‚ リクエストをサーãƒãŒ \n å—ã‘付ã‘ã‚‹ã“ã¨ãŒã§ãã¾ã›ã‚“。ã»ã‹ã®ã‚µãƒ¼ãƒã§ãƒªã‚¯ã‚¨ã‚¹ãƒˆã‚’処ç†ã™ã‚‹ã“ã¨ãŒã§ãれã°ã€ãƒ‡ãƒ¼ã‚¿ã®ãƒžã‚¹ã‚¿ã‚³ãƒ”ãƒ¼ã‚’ä¿æŒã™ã‚‹ã‚µãƒ¼ãƒã‚’りよã†ã—ã¦ãã ã•ã„。] +ja,dsgw,61,[ã‚ãªãŸã®ãƒªã‚¯ã‚¨ã‚¹ãƒˆã®å®Ÿè¡Œã¯ç®¡ç†ã®ç¯„囲を超ãˆã¦ã„ã¾ã™ã€‚] +ja,dsgw,62,[ゲートウエイãŒè¦æ±‚ã—ãŸé‡å¤§ãªæ‹¡å¼µã¯ã“ã®ã‚µãƒ¼ãƒã§åˆ©ç”¨ã™ã‚‹ã“ã¨ã¯ã§ãã¾ã›ã‚“。] +ja,dsgw,63,[エントリã«å­˜åœ¨ã—ãªã„属性ãŒè¦æ±‚ã«ã‚ˆã£ã¦å‚ç…§ã•れãŸãŸã‚\nã€ã‚µãƒ¼ãƒã¯ã“ã®è¦æ±‚を処ç†ã§ãã¾ã›ã‚“ã§ã—ãŸã€‚] +ja,dsgw,64,[è¦æ±‚ãŒãƒ‡ãƒ¼ã‚¿ãƒ™ãƒ¼ã‚¹ã®åˆ¶ç´„ã«é•åã—ã¦ã„ã‚‹ãŸã‚ã€\nサーãƒã¯è¦æ±‚を完了ã§ãã¾ã›ã‚“ã§ã—ãŸã€‚] +ja,dsgw,65,[サーãƒã¯å…¥åŠ›ã•れãŸå€¤ã‚’追加ã§ãã¾ã›ã‚“ã§ã—ãŸã€‚\n æ—¢ã«å…¥åŠ›ã—ãŸå€¤ãŒã‚¨ãƒ³ãƒˆãƒªã«å«ã¾ã‚Œã¦ã„ã‚‹ã“ã¨ã‚‚考ãˆã‚‰ã‚Œã¾ã™ã€‚] +ja,dsgw,66,[サーãƒã¯ã‚¨ãƒ³ãƒˆãƒªã‚’見ã¤ã‘られã¾ã›ã‚“ã§ã—ãŸã€‚\n æ–°ã—ã„エントリを追加ã™ã‚‹å ´åˆã€è¿½åŠ ã™ã‚‹ã‚¨ãƒ³ãƒˆãƒªã®è¦ªãŒå¿…ãšå­˜åœ¨ã™ã‚‹ã“ã¨ã‚’確èªã—ã¦ãã ã•ã„。\n 検索中ã«ã“ã®ã‚¨ãƒ©ãƒ¼ã‚’å—ä¿¡ã—ãŸã‚‰ã€æ¤œç´¢ã—ã¦ã„ãŸã‚¨ãƒ³ãƒˆãƒªãŒå­˜åœ¨ã—ãªã„ã“ã¨ã‚’示ã—ã¦ã„ã¾ã™ã€‚\nDirectory Manager ã¨ã—ã¦èªè¨¼ã‚’試ã¿ã¦ã„ã‚‹å ´åˆã«ã“ã®ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ãŸã‚‰ã€ã‚²ãƒ¼ãƒˆã‚¦ã‚¨ã‚¤ã®æ§‹æˆãƒ•ァイルをãƒã‚§ãƒƒã‚¯ã—ã¦ãã ã•ã„。] +ja,dsgw,67,[識別ã•れãŸåå‰ã®ãƒ•ォーマットãŒä¸æ­£ã§ã™ã€‚] +ja,dsgw,68,[ã‚ãªãŸãŒè©¦ã¿ãŸã‚¨ãƒ³ãƒˆãƒªã¯ã€ãƒ‘スワードを使用ã—ã¦ã„ãªã„ã‹ã€èª¤ã‚ŠãŒã‚りã¾ã™ã€‚Directory Manager ã§åŠ ãˆã‚‰ã‚ŒãŸã‚¨ãƒ³ãƒˆãƒªãŒé©åˆ‡ãªå±žæ€§ã§ã‚ã‚‹ã‹ç¢ºèªã—ã¦ãã ã•ã„。 ] +ja,dsgw,69,[入力ã—ãŸãƒ‘スワード(ã¾ãŸã¯ãã®ä»–ã®èªè¨¼è³‡æ ¼è¨¼æ˜Žæ›¸)ã¯æ­£ã—ãã‚りã¾ã›ã‚“。] +ja,dsgw,70,[æ“作を実行ã™ã‚‹ãŸã‚ã®æ¨©é™ã‚’æŒã£ã¦ã„ã¾ã›ã‚“。] +ja,dsgw,71,[サーãƒãŒæ··ã¿åˆã£ã¦ã„ã¾ã™ã€‚数分後ã«å†åº¦æŽ¥ç¶šã‚’行ã£ã¦ãã ã•ã„。] +ja,dsgw,72,[LDAP サーãƒã«æŽ¥ç¶šã™ã‚‹ã“ã¨ãŒã§ãã¾ã›ã‚“。] +ja,dsgw,73,[サーãƒã¯ã‚ãªãŸã®ãƒªã‚¯ã‚¨ã‚¹ãƒˆã‚’処ç†ã™ã‚‹ã“ã¨ãŒã§ãã¾ã›ã‚“。\n サーãƒã«å¤§ããªè² è·ãŒã‹ã‹ã£ã¦ã„ã‚‹ã‹ã€ã‚µãƒ¼ãƒãŒã‚ãªãŸã®ãƒªã‚¯ã‚¨ã‚¹ãƒˆã‚’ \n 処ç†ã™ã‚‹ã‚ˆã†ã«è¨­å®šã•れã¦ã„ãªã„ã“ã¨ãŒè€ƒãˆã‚‰ã‚Œã¾ã™ã€‚] +ja,dsgw,74,[Directory サーãƒã¯ã‚ãªãŸã®ãƒªã‚¯ã‚¨ã‚¹ãƒˆã‚’処ç†ã™ã‚‹ã“ã¨ãŒã§ãã¾ã›ã‚“。\n リクエストã®å†…å®¹ãŒæ­£ã—ããªã„ã‹ã€ã‚µãƒ¼ãƒãŒæ›´æ–°å‡¦ç†ã‚’行ã£ã¦ã„ã‚‹ \n 最中ã§ã‚ã‚‹å¯èƒ½æ€§ãŒã‚りã¾ã™ã€‚] +ja,dsgw,75,[Directory サーãƒã¯æŒ‡å®šã—ãŸã‚¨ãƒ³ãƒˆãƒªã«å­ãŒã„ã‚‹å ´åˆã€\n エントリã®å‰Šé™¤ãƒ»åå‰ã®å¤‰æ›´ã‚’行ã†ã“ã¨ãŒã§ãã¾ã›ã‚“。ã“ã®æ“作を行ã†ã«ã¯ã€\n æ“作ã®å‰ã«å­ã®ã‚¨ãƒ³ãƒˆãƒªã‚’å…¨ã¦å‰Šé™¤ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™ã€‚] +ja,dsgw,76,[サーãƒã«æ–°ã—ã„エントリを追加・åå‰ã®å¤‰æ›´ã‚’行ã†ã“ã¨ãŒã§ãã¾ã›ã‚“。\n æ—¢ã«åŒã˜åå‰ã®ã‚¨ãƒ³ãƒˆãƒªãŒå­˜åœ¨ã—ã¦ã„ã¾ã™ã€‚] +ja,dsgw,77,[ã‚ãªãŸã®ãƒªã‚¯ã‚¨ã‚¹ãƒˆã¯è¤‡æ•°ã® Directory サーãƒã«å映ã•れã¾ã™ã€‚] +ja,dsgw,78,[Directory サーãƒã«æŽ¥ç¶šã§ãã¾ã›ã‚“ã§ã—ãŸã€‚\n サーãƒç®¡ç†è€…ã«ã”相談ãã ã•ã„。] +ja,dsgw,79,[サーãƒã«ãƒ‡ãƒ¼ã‚¿ã‚’é€ä¿¡ä¸­ã«ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¾ã—ãŸã€‚] +ja,dsgw,80,[サーãƒã‹ã‚‰ãƒ‡ãƒ¼ã‚¿ã‚’読ã¿è¾¼ã¿ä¸­ã«ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¾ã—ãŸã€‚] +ja,dsgw,81,[サーãƒã‹ã‚‰ã®å¿œç­”ãŒã‚りã¾ã›ã‚“。タイムアウトã—ã¾ã—ãŸã€‚] +ja,dsgw,82,[サーãƒã¯ã‚²ãƒ¼ãƒˆã‚¦ã‚¨ã‚¤ãŒä½¿ç”¨ã™ã‚‹èªè¨¼æ–¹æ³•をサãƒãƒ¼ãƒˆã—ã¦ã„ã¾ã›ã‚“。] +ja,dsgw,83,[検索フィルタを構æˆä¸­ã«ã‚²ãƒ¼ãƒˆã‚¦ã‚¨ã‚¤ã§ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¾ã—ãŸã€‚] +ja,dsgw,84,[æ“作ã¯ãƒªã‚¯ã‚¨ã‚¹ãƒˆã«ã‚ˆã‚Šã‚­ãƒ£ãƒ³ã‚»ãƒ«ã•れã¾ã—ãŸã€‚] +ja,dsgw,85,[ライブラリã§å†…部エラーãŒç™ºç”Ÿã—ã¾ã—ãŸã€‚パラメータã«ä¸æ­£ãŒã‚りã¾ã™ã€‚] +ja,dsgw,86,[サーãƒã¸ã®æŽ¥ç¶šã‚’é–‹ã‘られã¾ã›ã‚“ã§ã—ãŸã€‚サーãƒç®¡ç†è€…ã«ã”相談ãã ã•ã„。] +ja,dsgw,87,[未知ã®ã‚¨ãƒ©ãƒ¼ã«é­é‡ã—ã¾ã—ãŸã€‚] +ja,dsgw,88,[ã‚¨ãƒ³ãƒˆãƒªã¯æ—¢ã«å­˜åœ¨ã—ã¾ã™ã€‚] +ja,dsgw,89,[エントリå ] +ja,dsgw,90,[onMouseOver="window.status='エントリをå‚ç…§ã™ã‚‹ã«ã¯ã‚¯ãƒªãƒƒã‚¯ã—ã¦ãã ã•ã„。'; return true"] +ja,dsgw,91,[ æ—¢ã«å­˜åœ¨ã—ã¾ã™ã€‚

                    別ã®åå‰ãƒ»å ´æ‰€ã‚’é¸æŠžã—ã¦ãã ã•ã„。\n

                    \n] +ja,dsgw,92,[親エントリã¯å­˜åœ¨ã—ã¾ã›ã‚“。] +ja,dsgw,93,[次ã®åå‰ã®ã‚¨ãƒ³ãƒˆãƒªã®è¿½åŠ ãŒã§ãã¾ã›ã‚“:

                    %s,

                    \n 親エントリãŒå­˜åœ¨ã—ã¾ã›ã‚“。

                    \n 親エントリを最åˆã«ç™»éŒ²ã—ã¦ãã ã•ã„。\n] +ja,dsgw,94,[ã“れã®è¦ª\n] +ja,dsgw,95,[エントリå:

                    %s.\n] +ja,dsgw,96,[警告: èªè¨¼ã•れã¦ã„ã¾ã›ã‚“。 (次ã¸)...\n] +ja,dsgw,97,[%s Directory エントリ] +ja,dsgw,98,[

                    エントリ DN: %s

                    \n] +ja,dsgw,99,[%s ã«å¤‰æ›´ã—ä¿å­˜ã—ã¾ã—ãŸã€‚] +ja,dsgw,100,[%s を追加ã—ã¾ã—ãŸã€‚] +ja,dsgw,101,[%s を削除ã—ã¾ã—ãŸã€‚] +ja,dsgw,102,[%s ã‹ã‚‰ %s ã¸åå‰ã‚’変更ã—ã¾ã—ãŸã€‚] +ja,dsgw,103,[

                    ノート: ã‚ãªãŸã® %s エントリã¯ç ´æ£„ã•れã¾ã—ãŸã€‚\n ã‚ãªãŸã¯å†åº¦èªè¨¼ã‚’å—ã‘変更を追加ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™ã€‚\n] +ja,dsgw,104,[削除] +ja,dsgw,105,[åå‰ã®å¤‰æ›´] +ja,dsgw,106,[パスワード変更] +ja,dsgw,107,[属性 %s を変更ã—ã¾ã—ãŸã€‚
                    \n] +ja,dsgw,108,[ アスキーã§ã¯ãªã„ (%ld ãƒã‚¤ãƒˆ)\n] +ja,dsgw,109,[å€¤ãŒæŒ‡å®šã•れã¦ã„ã¾ã›ã‚“。 ã‚‚ã†ä¸€åº¦å…¥åŠ›ã—ã¦ãã ã•ã„。\n] +ja,dsgw,110,[変更ã¯ã‚りã¾ã›ã‚“。\n] +ja,dsgw,111,[

                    %s ã‚’ Directory サーãƒã«é€ä¿¡ã—ã¾ã—ãŸã€‚\n] +ja,dsgw,112,[情報] +ja,dsgw,113,[変更] +ja,dsgw,114,[

                    円å–ã‚‹ã®è¿½åŠ ã«æˆåŠŸã—ã¾ã—ãŸã€‚\n] +ja,dsgw,115,[

                    エントリã®ä¿®æ­£ã«æˆåŠŸã—ã¾ã—ãŸã€‚変更ã¯ä¿å­˜ã•れã¾ã—ãŸã€‚\n] +ja,dsgw,116,[

                    エントリã®å‰Šé™¤ã¯æˆåŠŸã—ã¾ã—ãŸã€‚\n] +ja,dsgw,117,[

                    æ–°ã—ã„エントリã®åå‰ã¯ã€æ¬¡ã®ã¨ãŠã‚Šã§ã™ï¼š %s\n

                    \n] +ja,dsgw,118,[

                    åå‰ã®å¤‰æ›´ã«æˆåŠŸã—ã¾ã—ãŸã€‚\n] +ja,dsgw,119,[以å‰ã®ãƒ‘スワードを用æ„ã—ã¦ãã ã•ã„。] +ja,dsgw,120,[æ–°ã—ã„パスワードã®å…¥åŠ›ãŒå¿…è¦ã§ã™ã€‚ã‚‚ã†ä¸€åº¦è¡Œã£ã¦ãã ã•ã„。] +ja,dsgw,121,[æ–°ã—ã„パスワードã¨ã€ç¢ºèªã®ãŸã‚ã«å…¥åŠ›ã—ãŸãƒ‘スワードãŒç•°ãªã‚Šã¾ã™ã€‚ã‚‚ã†ä¸€åº¦å…¥åŠ›ã—ã¦ãã ã•ã„。] +ja,dsgw,122,[
                    %s %s ã¯ä½¿ç”¨ä¸­ã§ã™ã€‚åˆ¥ã®æŒ‡å®šã‚’行ã£ã¦ãã ã•ã„。
                    \n] +ja,dsgw,123,[データ エレメント "%.100s" ãŒä¸è¶³ã—ã¦ã„ã¾ã™ã€‚] +ja,dsgw,124,[è¨­å®šæƒ…å ±ã‚’åˆæœŸåŒ–ã—ã¦ã„ã¾ã™ã€‚] +ja,dsgw,125,[ファイルを開ãã“ã¨ãŒã§ãã¾ã›ã‚“。] +ja,dsgw,126,[dbconf ファイルã®å½¢å¼ãŒä¸æ­£ã§ã™ã€‚] +ja,dsgw,127,[dbconf ã®ä¸­ã®å±žæ€§åç§°ã®æŒ‡å®šãŒä¸è¶³ã—ã¦ã„ã¾ã™ã€‚] +ja,dsgw,128,[メモリä¸è¶³ã§ã™ã€‚] +ja,dsgw,129,[dbconf ファイルã®ä¸­ã®æŒ‡ä»¤ã®æŒ‡å®šãŒä¸è¶³ã—ã¦ã„ã¾ã™ã€‚] +ja,dsgw,130,[æ§‹æˆãƒ•ァイル"%s"ã‚’é–‹ã‘られã¾ã›ã‚“\n] +ja,dsgw,131,["authlifetime" ã®æŒ‡å®šãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“。\n] +ja,dsgw,132,["dirmgr" ã®æŒ‡å®šãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“。\n] +ja,dsgw,133,["baseurl" ã®æŒ‡å®šãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“。\n] +ja,dsgw,134,["baseurl" ã®ä¸­ã§æŒ‡å®šã•れã¦ã„ã‚‹ URL ãŒä¸æ­£ã§ã™ã€‚ - DN ãŒä¸è¶³ã—ã¦ã„ã¾ã™ã€‚\n] +ja,dsgw,135,[baseurl をパースã—ã¦ã„ã¾ã™ã€‚] +ja,dsgw,136,["baseurl" ã®ä¸­ã§æŒ‡å®šã•れã¦ã„ã‚‹ URL ãŒä¸æ­£ã§ã™ã€‚ - "ldap://" URL ã®æŒ‡å®šã§ã¯ã‚りã¾ã›ã‚“。\n] +ja,dsgw,137,["ldaps://" ã® URL 指定方法ã¯ã‚µãƒãƒ¼ãƒˆã•れã¦ã„ã¾ã›ã‚“。\n] +ja,dsgw,138,["template" ã®æŒ‡å®šãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“。\n] +ja,dsgw,139,["sslrequired" ã®æŒ‡å®šãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“。\n] +ja,dsgw,140,[ç†è§£ã§ããªã„値㌠"sslrequired" ã«ã‚りã¾ã™ã€‚("never", "whenauthenticated", "always" を指定ã—ã¦ãã ã•ã„。)\n] +ja,dsgw,141,["securitypath" ã®æŒ‡å®šãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“。\n] +ja,dsgw,142,["location-suffix" ã®æŒ‡å®šãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“。\n] +ja,dsgw,143,["location" ã®æŒ‡å®šãŒå¿…è¦ã§ã™ã€‚\n] +ja,dsgw,144,["newtype" ã®æŒ‡å®šã«ã¯ï¼’ã¤ã®å€¤ã‚’指定ã—ã¦ãã ã•ã„。\n] +ja,dsgw,145,["newtype" ã®å ´æ‰€ãŒä¸æ˜Žã§ã™ã€‚\n] +ja,dsgw,146,[3ã¤ã¾ãŸã¯ï¼”ã¤ã®æŒ‡å®šãŒ "tmplset" ã«ã¯å¿…è¦ã§ã™ã€‚\n] +ja,dsgw,147,["attrvset" ã«ã¯ï¼”ã¤ã®æŒ‡å®šãŒå¿…è¦ã§ã™ã€‚\n] +ja,dsgw,148,["charset" ã®æŒ‡å®šã‚’見ã¤ã‘ã‚‹ã“ã¨ãŒã§ãã¾ã›ã‚“。\n] +ja,dsgw,149,["ClientLanguage" ã®æŒ‡å®šã‚’見ã¤ã‘ã‚‹ã“ã¨ãŒã§ãã¾ã›ã‚“。\n] +ja,dsgw,150,["AdminLanguage" ã®æŒ‡å®šã‚’見ã¤ã‘ã‚‹ã“ã¨ãŒã§ãã¾ã›ã‚“。\n] +ja,dsgw,151,["DefaultLanguage"ã®æŒ‡å®šã‚’見ã¤ã‘ã‚‹ã“ã¨ãŒã§ãã¾ã›ã‚“。\n] +ja,dsgw,152,["include" ã«å¯¾å¿œã™ã‚‹ãƒ•ァイルåãŒæŒ‡å®šã•れã¦ã„ã¾ã›ã‚“\n] +ja,dsgw,153,[è¨­å®šãƒ•ã‚¡ã‚¤ãƒ«ã«æœªçŸ¥ã®å‘½ä»¤ãŒã‚りã¾ã™\n] +ja,dsgw,154,[<= erase_db lcache.conf ファイルを開ãã“ã¨ãŒã§ãã¾ã›ã‚“。"%s"\n] +ja,dsgw,155,[\n

                    データベースã¯å‰Šé™¤ã•れã¦ã„ã¾ã™ã€‚ æ–°ã—ã„データベースを作æˆã—ã¾ã™... \n\n ] +ja,dsgw,156,[\n

                    データベースを削除ã™ã‚‹ã“ã¨ãŒã§ãã¾ã›ã‚“。\n\n ] +ja,dsgw,157,[<= app_suffix ldif ファイルを開ãã“ã¨ãŒã§ãã¾ã›ã‚“。 "%s"\n] +ja,dsgw,158,[<= app_suffix 一時ファイルを開ãã“ã¨ãŒã§ãã¾ã›ã‚“。 "%s"\n] +ja,dsgw,159,[%s ã‹ã‚‰ %s ã¸åå‰ã®å¤‰æ›´ã‚’行ã†ã“ã¨ãŒã§ãã¾ã›ã‚“。] +ja,dsgw,160,[ヌル ãƒã‚¤ãƒ³ã‚¿ãŒ dbconf_read_default_dbinfo() ã‹ã‚‰è¿”ã•れã¾ã—ãŸã€‚] +ja,dsgw,161,["ldapdb" URL ãŒä¸æ­£ã§ã™ã€‚- ベース DN ãŒæ¬ è½ã—ã¦ã„ã¾ã™ã€‚\n] +ja,dsgw,162,["ldapdb" URL ãŒä¸æ­£ã§ã™ã€‚\n] +ja,dsgw,163,["baseurl" ã§è¨˜è¿°ã•れ㟠URL ãŒä¸æ­£ã§ã™ã€‚ - ベース DN ãŒæ¬ è½ã—ã¦ã„ã¾ã™ã€‚\n] +ja,dsgw,164,[baseurl をパースã—ã¦ã„ã¾ã™ã€‚] +ja,dsgw,165,["baseurl" ã§è¨˜è¿°ã•れ㟠URL ãŒä¸æ­£ã§ã™ã€‚ - "ldap:// ã¾ãŸã¯ ldapdb://" ã® URL ã§æŒ‡å®šã—ã¦ãã ã•ã„。\n] +ja,dsgw,166,["ldaps://" ã® URL 指定方法ã¯ã€ã‚µãƒãƒ¼ãƒˆã•れã¦ã„ã¾ã›ã‚“。\n] +ja,dsgw,167,[binddn ã¯å€¤ã‚’æŒã£ã¦ã„ã¾ã›ã‚“。] +ja,dsgw,168,[bindpw ã¯å€¤ã‚’æŒã£ã¦ã„ã¾ã›ã‚“。] +ja,dsgw,169,[デフォルト Directory サービス㧠dbswitch.conf ファイルãŒå®šç¾©ã•れã¦ã„ã¾ã›ã‚“。] +ja,dsgw,170,[書込ã¿ã®ãŸã‚ã«æ§‹æˆãƒ•ァイル"%s" ã‚’é–‹ã‘られã¾ã›ã‚“\n] +ja,dsgw,171,[%s ã‹ã‚‰ %s ã¸åå‰ã‚’変更ã™ã‚‹ã“ã¨ãŒã§ãã¾ã›ã‚“。] +ja,dsgw,172,[設定ファイル %s: ] +ja,dsgw,173,[設定ファイル %s: %d 行: ] +ja,dsgw,174,[最大 %d] +ja,dsgw,175,[ OK ] +ja,dsgw,176,[ウインドウを閉ã˜ã‚‹] +ja,dsgw,177,[å‰ã¸] +ja,dsgw,178,[{crypt}ロック中 [%s GMT]] +ja,dsgw,179,[メインã¸] +ja,dsgw,181,[ Help ] +ja,dsgw,182,[Help] +ja,dsgw,184,[Help ã¯ä½¿ç”¨ã§ãã¾ã›ã‚“。] +ja,dsgw,186,[ウインドウを閉ã˜ã‚‹] +ja,dsgw,187,[ウインドウを閉ã˜ã‚‹] +ja,dsgw,188,[テンプレートãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“。] +ja,dsgw,189,[èªè¨¼ä¸­ ...] +ja,dsgw,190,[èªè¨¼ã‚’å–り消ã—ã¾ã™ã‹ (Log out)?] +ja,dsgw,191,[検索文字列を入力ã—ã¦ãã ã•ã„] +ja,dsgw,192,[èªè¨¼ã®æœ€åˆã®ã‚¹ãƒ†ãƒƒãƒ—ã¯ã€Directory ã« ID を入力ã™ã‚‹ã“ã¨ã§ã™ã€‚\n
                    åå‰ã‚’入力ã—ã¦ãã ã•ã„:] +ja,dsgw,193,[次ã¸] +ja,dsgw,194,[次ã¸] +ja,dsgw,195,[キャンセル] +ja,dsgw,196,[Directory Manager ã¨ã—ã¦èªè¨¼">  (Directory Administrator ã®ã¿åˆ©ç”¨å¯èƒ½)\n] +ja,dsgw,197,[èªè¨¼ ...] +ja,dsgw,198,[èªè¨¼ã‚’å–り消ã—ã¾ã™ã‹ï¼Ÿ] +ja,dsgw,200,[次ã¸] +ja,dsgw,201,[次ã¸] +ja,dsgw,202,[キャンセル] +ja,dsgw,203,[Directory ã§èªè¨¼ (Log in)] +ja,dsgw,204,[%sã¨ã—㦠Directory ã«èªè¨¼ã—よã†ã¨ã—ã¦ã„ã¾ã™ã€‚èªè¨¼éŽç¨‹ã‚’完了ã™ã‚‹ã«ã¯ã€ãƒ‘スワードをタイプã—ã¦ãã ã•ã„。\n] +ja,dsgw,206,[後㧠Directory ã®ã‚ãªãŸã®ã‚¨ãƒ³ãƒˆãƒªã®è¿½åŠ ãƒ»å¤‰æ›´ã‚’è¡Œã†ã«ã¯ã€\nDirectory ã«èªè¨¼(Log in)ã—ãŸå¾Œã€ã‚¬ã‚¤ãƒ‰ã‚’ウインドウ㫠\n 表示ã•ã›ã€ãれをå‚ç…§ã—ãªãŒã‚‰ä½œæ¥­ã‚’行ã£ã¦ãã ã•ã„。\n] +ja,dsgw,207,[ã“ã®ã‚¹ã‚¯ãƒªãƒ¼ãƒ³ä¸Šã§ Directory ã«èªè¨¼(Log in)ã—ã¦\nã„ã‚‹éš›ã«ã¯ã€æ—¢ã«è¿½åŠ ãƒ»å¤‰æ›´ã®ä½œæ¥­ã‚’行ã†ã“ã¨ãŒå¯èƒ½ã§ã™ã€‚ã¾ã èªè¨¼\n(Log in)ã—ã¦ã„ãªã„å ´åˆã«ã¯ãれを行ã£ãŸã‚ã¨ä½œæ¥­ã‚’行ã£ã¦ãã ã•ã„。\n] +ja,dsgw,208,[èªè¨¼ã‚¹ãƒ†ãƒ¼ã‚¿ã‚¹] +ja,dsgw,209,[\nã‚ãªãŸã¯ç¾åœ¨ Directory ã«èªè¨¼ã•れã¦ã„ã¾ã™ã€‚] +ja,dsgw,210,[.\nã‚‚ã—ã‚ãªãŸãŒ Directory ã®èªè¨¼ã‚’å–り消ã™(Log out)ã®ã§ã‚れã°ãƒœã‚¿ãƒ³ã‚’押ã—ã¦ãã ã•ã„。] +ja,dsgw,211,[èªè¨¼ã®å–り消ã—(Log out)] +ja,dsgw,212,[ã‚ãªãŸãŒç ´æ£„ã™ã‚‹èªè¨¼] +ja,dsgw,213,[有効期é™ã¯åˆ‡ã‚Œã¾ã—ãŸã€‚\n


                    \n] +ja,dsgw,214,[ç¾åœ¨ã‚ãªãŸã¯ã€Directory ã«èªè¨¼ã•れã¦ã„ã¾ã›ã‚“。
                    \n] +ja,dsgw,215,["%s=" ãŒä¸è¶³ã—ã¦ã„ã¾ã™ã€‚] +ja,dsgw,216,["%s=%s" ãŒä¸æ˜Žã§ã™ã€‚] +ja,dsgw,217,[%s オプションãŒä¸æ˜Žã§ã™ã€‚] +ja,dsgw,218,[%s ã®æ›¸å¼ãŒä¸æ˜Žã§ã™ã€‚\n] +ja,dsgw,219,[** HTML タイプ "%s" ã¯ã‚µãƒãƒ¼ãƒˆã•れã¦ã„ã¾ã›ã‚“。 **
                    \n] +ja,dsgw,224,[修正] +ja,dsgw,225,[変更ä¿ç®¡] +ja,dsgw,226,[変更] +ja,dsgw,227,[追加] +ja,dsgw,228,[削除] +ja,dsgw,229,[エントリを削除ã—ã¦ã‚ˆã‚ã—ã„ã§ã™ã‹ï¼Ÿ] +ja,dsgw,230,[åå‰ã®å¤‰æ›´] +ja,dsgw,231,[ã‚¨ãƒ³ãƒˆãƒªã®æ–°ã—ã„åå‰ã‚’入力ã—ã¦ãã ã•ã„:] +ja,dsgw,232,[修正] +ja,dsgw,233,[%s= ãŒä¸è¶³ã—ã¦ã„ã¾ã™ã€‚] +ja,dsgw,234,[ウインドウを閉ã˜ã‚‹ã€‚] +ja,dsgw,235,[修正 ...] +ja,dsgw,236,["%s=" ä¸è¶³ã—ã¦ã„ã¾ã™ã€‚\n] +ja,dsgw,237,["%s" ãŒã‚»ãƒƒãƒˆã•れã¦ã„ã¾ã›ã‚“。\n] +ja,dsgw,238,["%s" ã®æ›¸å¼ãŒä¸æ˜Žã§ã™ã€‚\n] +ja,dsgw,239,[å†èªè¨¼] +ja,dsgw,240,[ウインドウを閉ã˜ã‚‹] +ja,dsgw,241,[よã‚ã—ã„ã§ã™ã‹ï¼Ÿ] +ja,dsgw,242,[width=400,height=130,resizable] +ja,dsgw,243,[ OK ] +ja,dsgw,244,[ OK ] +ja,dsgw,245,[ リセット ] +ja,dsgw,246,[ 終了 ] +ja,dsgw,247,[ キャンセル ] +ja,dsgw,248,[別㮠IF を発見(入れå­ã® IF ã¯ã‚µãƒãƒ¼ãƒˆã•れ定ã¾ã›ã‚“)] +ja,dsgw,249,[ELESE を見ã¤ã‘ã¾ã—ãŸãŒã€IF ãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“。] +ja,dsgw,250,[ELSE を見ã¤ã‘ã¾ã—ãŸãŒã€å¾Œã® ELSE ãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“。(ã‚‚ã—ã㯠ENDIF)] +ja,dsgw,251,[ELIF を見ã¤ã‘ã¾ã—ãŸãŒ IF を見ã¤ã‘ã‚‹ã“ã¨ãŒã§ãã¾ã›ã‚“。] +ja,dsgw,252,[ELIF を見ã¤ã‘ã¾ã—ãŸãŒã€å¾Œã® ELSE ãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“。(ã‚‚ã—ã㯠ENDIF)] +ja,dsgw,253,[ENDIF を見ã¤ã‘ã¾ã—ãŸãŒ IF ãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“。] +ja,dsgw,254,[
                    テンプレート エラー: %s
                    \n] +ja,dsgw,255,[ldap_init/lcache_init ãŒè¨­å®šãƒ•ァイルを読ã¿è¾¼ã‚€å‰ã«å®Ÿè¡Œã•れã¾ã—ãŸã€‚] +ja,dsgw,256,[アドミニストレーション サーãƒã¯å®Ÿè¡Œä¸­ã§ã¯ã‚りã¾ã›ã‚“。] +ja,dsgw,257,[ãƒ‘ãƒ¼ãƒŸãƒƒã‚·ãƒ§ãƒ³ã‚’åˆæœŸåŒ–ã™ã‚‹ã“ã¨ãŒã§ãã¾ã›ã‚“ã§ã—ãŸã€‚] +ja,dsgw,258,[DN ã«ãƒ¦ãƒ¼ã‚¶åãŒãƒžãƒƒãƒ—ã•れã¦ã„ã¾ã›ã‚“。(アドミン サーãƒã®ã‚¨ãƒ©ãƒ¼ã§ã™ã€‚)] +ja,dsgw,259,[ç¾åœ¨ã®ãƒ¦ãƒ¼ã‚¶åã‚’å¾—ã‚‹ã“ã¨ãŒã§ãã¾ã›ã‚“。] +ja,dsgw,260,[ç¾åœ¨ã®ãƒ¦ãƒ¼ã‚¶ãƒ‘スワードを得るã“ã¨ãŒã§ãã¾ã›ã‚“。] +ja,dsgw,261,[エラー: %s] +ja,dsgw,262,[ノート: ディスプレイ テンプレートã¯å­˜åœ¨ã—ã¾ã›ã‚“。デフォルト値を使用ã—ã¾ã™ã€‚] +ja,dsgw,263,[ユーザ ID ãŒä¸æ­£ã‚‚ã—ã㯠LDAP ㌠NULL ã‚’è¿”ã—ã¾ã—ãŸã€‚] +ja,dsgw,264,[ユーザ ID ã«ãƒžãƒƒãƒã™ã‚‹ã‚‚ã®ãŒã‚りã¾ã›ã‚“。] +ja,dsgw,265,[ユーザ ID ãŒï¼‘ã¤ä»¥ä¸Šè©²å½“ã—ã¾ã™ã€‚] +ja,dsgw,266,[the entire directory] +ja,dsgw,267,["includeset" ã«ã¯ï¼’ã¤ã®å€¤ãŒå¿…è¦ã§ã™ã€‚\n] +ja,dsgw,268,[エントリã«ã¯è¦æ±‚ã•れãŸå±žæ€§å€¤ãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“ã§ã—ãŸ] +ja,dsgw,269,["NLS" 指é‡ã®å¼•æ•°ãŒæ¬ ã‘ã¦ã„ã¾ã™\n] +ja,dsgw,270,[NTユーザIDã®å€¤ã‚’指定ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™\n] +ja,dsgw,271,[指é‡å†…ã®NTユーザIDã¨NTドメインIDã®çµ„åˆã‚ã›ã¯å›ºæœ‰ã®ã‚‚ã®ã§ã¯ã‚りã¾ã›ã‚“\n] +ja,dsgw,272,[NTユーザIDã¨NTドメインIDã®ä¸¡æ–¹ã®å€¤ã‚’指定ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™\n] +ja,dsgw,273,[NTユーザID値ã®é•·ã•ã¯20文字を超éŽã—ã¦ã¯ãªã‚Šã¾ã›ã‚“。\n] +ja,dsgw,274,[æ–°è¦ã‚¨ãƒ³ãƒˆãƒªã®åå‰ã‚’入力ã—ã¦ãã ã•ã„。] +ja,dsgw,275,[æ–°è¦ã‚¨ãƒ³ãƒˆãƒªã®å ´æ‰€ã‚’é¸æŠžã—ã¦ãã ã•ã„。] +ja,dsgw,276,[æ–°è¦ã‚¨ãƒ³ãƒˆãƒª] +ja,dsgw,277,[ã“ã®æ©Ÿèƒ½ã‚’使用ã™ã‚‹ã«ã¯ã€dsgw.confã§å®šç¾©ã•れãŸdirmgrãŒãªã‘れã°ãªã‚Šã¾ã›ã‚“] +ja,dsgw,278,["vcard-property"ã®æŒ‡é‡ã«ã¯3ã¾ãŸã¯4ã¤ã®å¼•æ•°ãŒå¿…è¦ã§ã™\n] +ja,dsgw,279,[Vcardプロパティ構文ã¯"cis" ã¾ãŸã¯ "mls"ã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“\n] +ja,dsgw,280,[ã‚¨ãƒ³ãƒˆãƒªãŒæ¤œç´¢ã•れã¾ã›ã‚“ã§ã—ãŸ\n%2$s] +ja,dsgw,281,['%4$s'ãŒ%2$s%3$sã€ã‚¨ãƒ³ãƒˆãƒªã¯æ¤œç´¢ã•れã¾ã›ã‚“ã§ã—ãŸ\n] +ja,dsgw,282,[ã‚¨ãƒ³ãƒˆãƒªã¯æ¤œç´¢ã•れã¾ã›ã‚“ã§ã—ãŸ\n%2$s] +ja,dsgw,283,['%4$s'ãŒ%2$s%3$sã€ã‚¨ãƒ³ãƒˆãƒªã¯æ¤œç´¢ã•れã¾ã›ã‚“ã§ã—ãŸ\n] +ja,dsgw,284,[1個ã®ã‚¨ãƒ³ãƒˆãƒªãŒæ¤œç´¢ã•れã¾ã—ãŸ\n%2$s] +ja,dsgw,285,['%4$s'ãŒ%2$s%3$sã€1個ã®ã‚¨ãƒ³ãƒˆãƒªãŒæ¤œç´¢ã•れã¾ã—ãŸ\n] +ja,dsgw,286,[1個ã®ã‚¨ãƒ³ãƒˆãƒªãŒæ¤œç´¢ã•れã¾ã—ãŸ\n%2$s] +ja,dsgw,287,[%2$sãŒ'%4$s'%3$sã€1個ã®ã‚¨ãƒ³ãƒˆãƒªãŒæ¤œç´¢ã•れã¾ã—ãŸ\n] +ja,dsgw,288,[%1$li個ã®ã‚¨ãƒ³ãƒˆãƒªãŒæ¤œç´¢ã•れã¾ã—ãŸ\n%2$s] +ja,dsgw,289,['%4$s'ãŒ%2$s%3$sã€%1$li個ã®ã‚¨ãƒ³ãƒˆãƒªãŒæ¤œç´¢ã•れã¾ã—ãŸ\n] +ja,dsgw,290,[%1$li個ã®ã‚¨ãƒ³ãƒˆãƒªãŒæ¤œç´¢ã•れã¾ã—ãŸ\n%2$s] +ja,dsgw,291,['%4$s'ãŒ%2$s%3$sã€%1$li個ã®ã‚¨ãƒ³ãƒˆãƒªãŒæ¤œç´¢ã•れã¾ã—ãŸ\n] +ja,dsgw,292,[LDAPフィルタ] +ja,dsgw,293,[èªè¨¼ã«ä½¿ç”¨ã—ãŸã‚¨ãƒ³ãƒˆãƒªãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“ã§ã—ãŸã€‚エントリåãŒå¤‰æ›´ã•れãŸã‹ã€å‰Šé™¤ã•れãŸå¯èƒ½æ€§ãŒã‚りã¾ã™ã€‚ã‚‚ã†ä¸€åº¦èªè¨¼ã‚’行ã£ã¦ã¿ã¦ãã ã•ã„。] +ja,dsgw,294,[æ–°ã—ã„ãƒ‘ã‚¹ãƒ¯ãƒ¼ãƒ‰ã®æ§‹æ–‡ã¯ç„¡åйã§ã™ã€‚\n] +ja,dsgw,295,[æ–°ã—ã„パスワードã¯ãƒ‘スワード履歴ã®ä¸­ã«ã‚りã¾ã™ã€‚\n] +ja,dsgw,296,[パスワードå†å…¥åŠ›ã®åˆ¶é™å›žæ•°ã‚’è¶Šãˆã¾ã—ãŸã€‚システム アドミニストレータã«é€£çµ¡ã—ã¦ãã ã•ã„。\n] +ja,dsgw,297,[パスワードå†å…¥åŠ›ã®åˆ¶é™å›žæ•°ã‚’è¶Šãˆã¾ã—ãŸã€‚ã‚ã¨ã§ã‚‚ã†ä¸€åº¦è¡Œã£ã¦ãã ã•ã„。\n] +ja,dsgw,298,[ã“ã®ãƒ‘ã‚¹ãƒ¯ãƒ¼ãƒ‰ã¯æœŸé™åˆ‡ã‚Œã§ã™ã€‚システム アドミニストレータã«é€£çµ¡ã—ã¦ã€ãƒ‘スワードをリセットã—ã¦ãã ã•ã„。\n] +ja,dsgw,299,[修正ã—ã¦ã„ã¾ã™ã€‚] +ja,dsgw,300,[追加ã—ã¦ã„ã¾ã™ã€‚] +ja,dsgw,301,[削除ã—ã¦ã„ã¾ã™ã€‚] +ja,dsgw,302,[åå‰ã‚’変更ã—ã¦ã„ã¾ã™ã€‚] +ja,dsgw,303,[リストã«åå‰ãŒã‚りã¾ã›ã‚“。] +ja,dsgw,304,[リスト㫠1 ã¤ã®åå‰ãŒã‚りã¾ã™ã€‚] +ja,dsgw,305,[リスト㫠%s個ã®åå‰ãŒã‚りã¾ã™ã€‚] +ja,dsgw,306,[リスト\\nã‹ã‚‰\\n削除ã—ã¾ã™ã‹ï¼Ÿ åå‰] +ja,dsgw,307,[変更を破棄ã—ã¾ã™ã‹ï¼Ÿ] +ja,dsgw,308,[width=300,height=130,resizable] +ja,dsgw,309,[変更をä¿å­˜ã›ãšã«ç¶šè¡Œã—ã¾ã™ã‹ï¼Ÿ
                    ä¿å­˜ã•れã¦ã„ãªã„変更ã¯å¤±ã‚れã¾ã™ã€‚] +ja,dsgw,310,[width=400,height=150,resizable] +ja,dsgw,311,[警告] +ja,dsgw,312,[確èª] +ja,dsgw,313,[èªè¨¼ã«å¤±æ•—ã—ã¾ã—ãŸã€‚\n] +ja,dsgw,314,[èªè¨¼ã«æˆåŠŸã—ã¾ã—ãŸã€‚] +ja,dsgw,315,[ディレクトリ㫠%s ã¨ã—ã¦èªè¨¼ã•れã¦ã„ã¾ã™ã€‚] +ja,dsgw,316,[ã‚ãªãŸã®èªè¨¼è³‡æ ¼è¨¼æ˜Žæ›¸ã¯ %d 分ã§å¤±åйã—ã¾ã™ã€‚\n] +ja,dsgw,317,[èªè¨¼ã®å¤±åŠ¹å¾Œã€ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã«å†åº¦èªè¨¼ã‚’å—ã‘ã‚‹å¿…è¦ãŒã‚りã¾ã™ã€‚\n] +ja,dsgw,318,[

                    ã“ã®ã‚¨ãƒ³ãƒˆãƒªã®ãƒ‘スワード㯠%s ã§å¤±åйã—ã¾ã™ã€‚\n] +ja,dsgw,319,[èªè¨¼ã«å¤±æ•—ã—ãŸç†ç”±] +ja,dsgw,320,[ディレクトリã«å­˜åœ¨ã—ãªã„エントリã®èªè¨¼ã‚’å—ã‘よã†ã¨ã—ãŸãŸã‚ã€èªè¨¼ã«å¤±æ•—ã—ã¾ã—ãŸã€‚\nèªè¨¼ãŒå—ã‘られるã®ã¯ã€æ—¢å­˜ã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒª エントリã ã‘ã§ã™ã€‚\n] +ja,dsgw,321,[パスワードãŒè¨­å®šã•れã¦ã„ãªã„エントリã®èªè¨¼ã‚’å—ã‘よã†ã¨ã—ãŸãŸã‚ã€èªè¨¼ã«å¤±æ•—ã—ã¾ã—ãŸã€‚\nèªè¨¼ãŒå—ã‘られるã®ã¯ã€ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªç®¡ç†è€…ã«ã‚ˆã£ã¦ãƒ‘スワードãŒè¨­å®šã•れã¦ã„るエントリã ã‘ã§ã™ã€‚\n] +ja,dsgw,322,[入力ã—ãŸãƒ‘ã‚¹ãƒ¯ãƒ¼ãƒ‰ãŒæ­£ã—ããªã„ãŸã‚ã€èªè¨¼ã«å¤±æ•—ã—ã¾ã—ãŸã€‚\n[ã‚‚ã†ä¸€åº¦]をクリックã—ã¦å†åº¦ãƒ‘スワードを入力ã—ã¦ãã ã•ã„。\nエントリã®ãƒ‘スワードを忘れãŸå ´åˆã¯ã€Directory Administratorã«é€£çµ¡ã—ã€ãƒ‘スワードをå†è¨­å®šã™ã‚‹å¿…è¦ãŒã‚りã¾ã™ã€‚\n] +ja,dsgw,323,[予期ã—ãªã„エラー: %s ãŒç™ºç”Ÿã—ãŸãŸã‚ã€èªè¨¼ã«å¤±æ•—ã—ã¾ã—ãŸã€‚\n] +ja,dsgw,324,[å†å…¥åŠ›] +ja,dsgw,325,[続行ã™ã‚‹ã«ã¯ã€ä¸Šè¨˜ã®ãƒªã‚¹ãƒˆã‹ã‚‰ã‚¿ã‚¹ã‚¯ã‚’é¸æŠžã—ã¦ãã ã•ã„。\n] +ja,dsgw,326,[パスワード修正] +ja,dsgw,327,[

                    %s ã®ãŸã‚ã«ãƒ‘スワード失効

                    \n] +ja,dsgw,328,[ディレクトリ サーãƒã®ãƒ‘スワードãŒå¤±åйã—ã¾ã—ãŸã€‚] +ja,dsgw,329,[ ã™ãã«ãƒ‘スワードを変更ã—ã¦ãã ã•ã„。\n] +ja,dsgw,330,[パスワードãŒå…¥åŠ›ã•れã¦ã„ã¾ã›ã‚“。èªè¨¼ã‚’å—ã‘ã‚‹ã¨ãã¯å¿…ãšãƒ‘スワードを入力ã—ã€ã‚µãƒ¼ãƒã§æœ¬äººã§ã‚ã‚‹ã“ã¨ã‚’ç…§åˆã§ãるよã†ã«ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™ã€‚] +ja,dsgw,331,[サーãƒã¯èªè¨¼è³‡æ ¼è¨¼æ˜Žæ›¸ã‚’生æˆã§ãã¾ã›ã‚“ã§ã—ãŸã€‚èªè¨¼ãƒ‡ãƒ¼ã‚¿ãƒ™ãƒ¼ã‚¹ã‚’é–‹ãã“ã¨ãŒã§ãã¾ã›ã‚“ã§ã—ãŸã€‚] +ja,dsgw,332,[サーãƒã¯èªè¨¼è³‡æ ¼è¨¼æ˜Žæ›¸ã‚’生æˆã§ãã¾ã›ã‚“ã§ã—ãŸã€‚データをèªè¨¼ãƒ‡ãƒ¼ã‚¿ãƒ™ãƒ¼ã‚¹ã«è¿½åŠ ã§ãã¾ã›ã‚“ã§ã—ãŸã€‚] +ja,dsgw,333,[次ã¸] +ja,dsgw,334,[ウィンドウを閉ã˜ã‚‹] +ja,dsgw,335,[æˆåŠŸ] +ja,dsgw,336,[èªè¨¼è³‡æ ¼è¨¼æ˜Žæ›¸ãŒç„¡åйã«ãªã‚Šã¾ã—ãŸã€‚ç¾åœ¨Directoryã«èªè¨¼ã•れã¦ã„ã¾ã›ã‚“。\n] +ja,dsgw,337,[å‰ã¸] +ja,dsgw,338,[æˆåŠŸ] +ja,dsgw,339,[オペレーション エラー] +ja,dsgw,340,[プロトコル エラー] +ja,dsgw,341,[警告: タイムアウトã—ã¾ã—ãŸã€‚一致ã™ã‚‹ã‚¨ãƒ³ãƒˆãƒªã®ã†ã¡ã€è¡¨ç¤ºã•れã¦ã„ãªã„ã‚‚ã®ã‚‚ã‚りã¾ã™ã€‚] +ja,dsgw,342,[警告: サイズã®ä¸Šé™ã‚’è¶…ãˆã¾ã—ãŸã€‚一致ã™ã‚‹ã‚¨ãƒ³ãƒˆãƒªã®ã†ã¡ã€è¡¨ç¤ºã•れã¦ã„ãªã„ã‚‚ã®ã‚‚ã‚りã¾ã™ã€‚] +ja,dsgw,343,[false を比較] +ja,dsgw,344,[true を比較] +ja,dsgw,345,[厳密ãªèªè¨¼ã¯ã‚µãƒãƒ¼ãƒˆã•れã¦ã„ã¾ã›ã‚“。] +ja,dsgw,346,[厳密ãªèªè¨¼ãŒå¿…è¦ã§ã™ã€‚] +ja,dsgw,347,[警告: 一部ã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒª サーãƒã«æŽ¥ç¶šã§ãã¾ã›ã‚“ã§ã—ãŸã€‚一致ã™ã‚‹ã‚¨ãƒ³ãƒˆãƒªã®ã†ã¡ã€è¡¨ç¤ºã•れã¦ã„ãªã„ã‚‚ã®ã‚‚ã‚りã¾ã™ã€‚] +ja,dsgw,348,[レフェラルをå—ä¿¡ã—ã¾ã—ãŸã€‚] +ja,dsgw,349,[管ç†ã®ç¯„囲を超ãˆã¦ã„ã¾ã™ã€‚] +ja,dsgw,350,[é‡å¤§ãªæ‹¡å¼µãŒåˆ©ç”¨ã§ãã¾ã›ã‚“。] +ja,dsgw,351,[機密性ãŒå¿…è¦ã§ã™ã€‚] +ja,dsgw,352,[SASL ãƒã‚¤ãƒ³ãƒ‰ä¸­ã§ã™ã€‚] +ja,dsgw,353,[ãã®ã‚ˆã†ãªå±žæ€§ã¯ã‚りã¾ã›ã‚“。] +ja,dsgw,354,[属性ã®ç¨®é¡žãŒå®šç¾©ã•れã¦ã„ã¾ã›ã‚“。] +ja,dsgw,355,[マッãƒãƒ³ã‚°ãŒä¸é©åˆ‡ã§ã™ã€‚] +ja,dsgw,356,[制約é•åã§ã™ã€‚] +ja,dsgw,357,[タイプã¾ãŸã¯å€¤ãŒå­˜åœ¨ã—ã¾ã™ã€‚] +ja,dsgw,358,[æ§‹æ–‡ã«èª¤ã‚ŠãŒã‚りã¾ã™ã€‚] +ja,dsgw,359,[ãã®ã‚ˆã†ãªã‚ªãƒ–ジェクトã¯ã‚りã¾ã›ã‚“。] +ja,dsgw,360,[エイリアスã«å•題ãŒã‚りã¾ã™ã€‚] +ja,dsgw,361,[DN ã®æ§‹æ–‡ã«èª¤ã‚ŠãŒã‚りã¾ã™ã€‚] +ja,dsgw,362,[オブジェクトã¯è‘‰ã§ã™ã€‚] +ja,dsgw,363,[エイリアス デリファレンスã«å•題ãŒã‚りã¾ã™ã€‚] +ja,dsgw,364,[èªè¨¼ãŒä¸é©å½“ã§ã™ã€‚] +ja,dsgw,365,[証明書ãŒç„¡åйã§ã™ã€‚] +ja,dsgw,366,[アクセスãŒä¸é©åˆ‡ã§ã™ã€‚] +ja,dsgw,367,[DSA ãŒãƒ“ジー状態ã§ã™ã€‚] +ja,dsgw,368,[DSA ãŒåˆ©ç”¨ã§ãã¾ã›ã‚“。] +ja,dsgw,369,[DSA ãŒå®Ÿè¡Œã•れã¾ã›ã‚“。] +ja,dsgw,370,[ãƒ«ãƒ¼ãƒ—ãŒæ¤œå‡ºã•れã¾ã—ãŸã€‚] +ja,dsgw,371,[åå‰ä»˜ã‘é•å] +ja,dsgw,372,[オブジェクト クラスé•å] +ja,dsgw,373,[è‘‰ãƒŽãƒ¼ãƒ‰ä»¥å¤–ã§æ“作を行ã†ã“ã¨ã¯ã§ãã¾ã›ã‚“。] +ja,dsgw,374,[RDN ã§æ“作を行ã†ã“ã¨ã¯ã§ãã¾ã›ã‚“。] +ja,dsgw,375,[æ—¢ã«å­˜åœ¨ã—ã¦ã„ã¾ã™ã€‚] +ja,dsgw,376,[オブジェクト クラスを変更ã§ãã¾ã›ã‚“。] +ja,dsgw,377,[çµæžœãŒå¤§ãã™ãŽã¾ã™ã€‚] +ja,dsgw,378,[複数ã®ã‚µãƒ¼ãƒã«å½±éŸ¿ã—ã¾ã™ã€‚] +ja,dsgw,379,[åŽŸå› ä¸æ˜Žã®ã‚¨ãƒ©ãƒ¼] +ja,dsgw,380,[LDAP サーãƒã«æŽ¥ç¶šã§ãã¾ã›ã‚“。] +ja,dsgw,381,[ローカル エラー] +ja,dsgw,382,[エンコード エラー] +ja,dsgw,383,[デコード エラー] +ja,dsgw,384,[タイムアウト] +ja,dsgw,385,[èªè¨¼æ–¹æ³•ãŒä¸æ˜Žã§ã™ã€‚] +ja,dsgw,386,[検索フィルタãŒä¸æ­£ã§ã™ã€‚] +ja,dsgw,387,[ãƒ¦ãƒ¼ã‚¶ãŒæ“作をキャンセルã—ã¾ã—ãŸã€‚] +ja,dsgw,388,[LDAP ルーãƒãƒ³ã«å¯¾ã™ã‚‹ãƒ‘ラメータãŒä¸æ­£ã§ã™ã€‚] +ja,dsgw,389,[メモリä¸è¶³ã§ã™ã€‚] +ja,dsgw,390,[LDAP サーãƒã«æŽ¥ç¶šã§ãã¾ã›ã‚“。] +ja,dsgw,391,[ã“ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã® LDAP プロトコルã§ã¯ã‚µãƒãƒ¼ãƒˆã•れã¦ã„ã¾ã›ã‚“。] +ja,dsgw,392,[è¦æ±‚ã•れ㟠LDAP コントロールãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“。] +ja,dsgw,393,[çµæžœãŒè¿”ã•れã¾ã›ã‚“。] +ja,dsgw,394,[ã•らã«çµæžœãŒè¿”ã•れã¾ã™ã€‚] +ja,dsgw,395,[クライアントãŒãƒ«ãƒ¼ãƒ—を検出ã—ã¾ã—ãŸã€‚] +ja,dsgw,396,[レフェラル ホップ リミットを超éŽã—ã¾ã—ãŸã€‚] +ja,frame,-1,[$DBT: frame in DB file v1 $] +ja,frame,1,[¸«¤Ä¤«¤ê¤Þ¤»¤ó¡£

                    ¸«¤Ä¤«¤ê¤Þ¤»¤ó¡£

                    ¥ê¥¯¥¨¥¹¥È¤µ¤ì¤¿¥ª¥Ö¥¸¥§¥¯¥È¤ò¸«¤Ä¤±¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£¥ê¥ó¥¯¤¬ÀÚ¤ì¤Æ¤¤¤ë¡¢¥ê¥¯¥¨¥¹¥È¤¬ÉÔÀµ³Î¡¢¥¢¥¯¥»¥¹¸¢¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤Ê¤¤Åù¤Î²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹¡£ ] +ja,frame,2,[»²¾È¤·¤Æ¤¤¤ë¥Ú¡¼¥¸¤Î¾ðÊó¤ò¥µ¥¤¥È´ÉÍý¼Ô¤ËÃΤ餻¤Æ¤¯¤À¤µ¤¤¡£] +ja,frame,3,[¤¢¤Ê¤¿¤Î¥Ö¥é¥¦¥¶¤¬Á÷¤Ã¤¿¥ê¥¯¥¨¥¹¥È¤ò¥×¥í¥¯¥· ¥µ¡¼¥Ð¤¬Íý²ò¤Ç¤­¤Þ¤»¤ó¡£] +ja,frame,4,[ŬÀÚ¤Êǧ¾Ú¤Ï¥×¥í¥¯¥·¤¬´ÉÍý¤Î¤¿¤á¤ËɬÍפǤ¹¡£\n¤¢¤Ê¤¿¤Î¥Ö¥é¥¦¥¶¤Îǧ¾Ú¤Ï¼ºÇÔ¤·¤Þ¤·¤¿¡£] +ja,frame,5,[¥æ¡¼¥¶Ì¾¤Îǧ¾Ú¤Ë¤Ï¥×¥í¥¯¥·¤òÍøÍѤ¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£\n¤¢¤Ê¤¿¤Î¥Ö¥é¥¦¥¶¤Ï¥×¥í¥¯¥·¤Ë¤è¤ëǧ¾Ú¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£] +ja,frame,6,[¥ê¥¯¥¨¥¹¥È¤µ¤ì¤¿¥ª¥Ö¥¸¥§¥¯¥È¤ËÂФ¹¤ë¥¢¥¯¥»¥¹¤Ï\n¥×¥í¥¯¥·¤ÎÀßÄê¾åµö¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£] +ja,frame,7,[¥×¥í¥¯¥·¤Ï¤¢¤Ê¤¿¤Î¥ê¥¯¥¨¥¹¥È¤ò¼Â¹Ô¤¹¤ëºÝ¤Ë¥¨¥é¡¼¤òȯÀ¸¤·¤Þ¤·¤¿¡£\nÀßÄ꤬¸í¤Ã¤Æ¤¤¤ë²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹¡£\n¥×¥í¥¯¥· ¥¨¥é¡¼ ¥í¥°¤Î¥á¥Ã¥»¡¼¥¸¤ò»²¾È¤¹¤ë¤è¤¦´ÉÍý¼Ô¤Ë°ÍÍꤷ¤Æ¤¯¤À¤µ¤¤¡£] +ja,frame,8,[¥ê¥¯¥¨¥¹¥È¤µ¤ì¤¿ÆâÍÆ¤Ï¥×¥í¥¯¥·¤Ë¼ÂÁõ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£] +ja,frame,9,[¥×¥í¥¯¥·¾å¤Ç¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿¡£] +ja,frame,10,[¤¢¤Ê¤¿¤Î¥Ö¥é¥¦¥¶¤¬Á÷¿®¤·¤¿¥ê¥¯¥¨¥¹¥È¤Ï¡¢¥µ¡¼¥Ð¤ËÍý²ò¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¤â¤Î¤Ç¤¹¡£] +ja,frame,11,[ŬÀÚ¤Êǧ¾Ú¤Ï¤³¤Î¥¨¥ê¥¢¤Î´ÉÍý¤Î¤¿¤á¤ËɬÍפǤ¹¡£\n¤¢¤Ê¤¿¤Î¥Ö¥é¥¦¥¶¤Îǧ¾Ú¤Ï¼ºÇÔ¤·¤Þ¤·¤¿¡£] +ja,frame,12,[¤¢¤Ê¤¿¤Î¥¯¥é¥¤¥¢¥ó¥È¤Ï¥ª¥Ö¥¸¥§¥¯¥È¤ËÂФ¹¤ë¥¢¥¯¥»¥¹¤òµö²Ä¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£] +ja,frame,13,[¤³¤Î¥µ¡¼¥Ð¤Ï¥ê¥¯¥¨¥¹¥È¤Î½èÍýÃæ¤Ë¥¨¥é¡¼¤ËÁø¶ø¤·¤Þ¤·¤¿¡£¸í¤Ã¤¿ÀßÄ꤬¤Ê¤µ¤ì¤Æ¤¤¤ë²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹¡£¥µ¡¼¥Ð¤Î¥¨¥é¡¼ ¥í¥°¤ò»²¾È¤¹¤ë¤è¤¦´ÉÍý¼Ô¤ËÏ¢Íí¤·¤Æ¤¯¤À¤µ¤¤¡£] +ja,frame,14,[¥ê¥¯¥¨¥¹¥È¤µ¤ì¤¿ÆâÍÆ¤Ï¥µ¡¼¥Ð¤Ë¼ÂÁõ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó] +ja,frame,15,[¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿¡£] +ja,frame,16,[¤¢¤Ê¤¿¤Î¥Ö¥é¥¦¥¶¤¬¥µ¡¼¥Ð¤ËÁ÷¤Ã¤¿¥ê¥¯¥¨¥¹¥È¤Ï¥µ¡¼¥Ð¤¬Íý²ò¤Ç¤­¤Ê¤¤¥ê¥¯¥¨¥¹¥È¤Ç¤¹¡£] +ja,frame,17,[%s

                    %s

                    \n¤³¤Î¥É¥­¥å¥á¥ó¥È¤Ï¿·¤·¤¤¾ì½ê¤Ë°Üư¤·¤Þ¤·¤¿¡£ . ¥É¥­¥å¥á¥ó¥È¤È¥Û¥Ã¥È¥ê¥¹¥È¤Î¹¹¿·¤ò¤·¤Æ¤¯¤À¤µ¤¤¡£] +ja,frame,18,[%s\n

                    %s

                    \n%s\n] +ja,frame,19,[process-uri-objects] +ja,frame,20,[cannot find template %s] +ja,frame,21,[process-uri-objects] +ja,frame,22,[no partial path after object processing] +ja,frame,23,[find-service] +ja,frame,24,[invalid shexp %s] +ja,frame,25,[find-service] +ja,frame,26,[invalid shexp %s] +ja,frame,27,[handle-processed] +ja,frame,28,[no way to service request for %s] +ja,frame,29,[finish-socks-request] +ja,frame,30,[close failed (%s), csd=%d] +ja,frame,31,[This beta software has expired.\n] +ja,frame,32,[mr_accept(%d)] +ja,frame,33,[Error issuing read on accept socket] +ja,frame,34,[acb_accept_connection(%d)] +ja,frame,35,[Error getting accept socket (%d)] +ja,frame,36,[Error in accept! (%d, %s)] +ja,frame,37,[Error creating new accept request] +ja,frame,38,[accepted connection: %d (NSPR %d)] +ja,frame,39,[Error creating new session structure] +ja,frame,40,[accel_read_request()] +ja,frame,41,[Error allocating request read buffer] +ja,frame,42,[Error issuing async read request] +ja,frame,43,[acb_read_request(%d, bytes %d)] +ja,frame,44,[acb_read_req(1 session = %d)] +ja,frame,45,[Error reading request (%d, %s)] +ja,frame,46,[Client aborted connection] +ja,frame,47,[Error reading request] +ja,frame,48,[Error creating new request] +ja,frame,49,[error occurred, closing %d, io was for %d] +ja,frame,50,[accel_async_scan_headers()] +ja,frame,51,[out of memory: accel_async_scan_headers] +ja,frame,52,[out of memory: accel_async_scan_headers] +ja,frame,53,[Error during async read (%d, %s)] +ja,frame,54,[scan-headers reports: line too long] +ja,frame,55,[scan-headers reports: too many headers] +ja,frame,56,[Error reading headers] +ja,frame,57,[scan-headers reports: header missing terminator (an empty line)] +ja,frame,58,[scan-headers reports: header was empty] +ja,frame,59,[̾Á°¤ËÃͤ¬¤¢¤ê¤Þ¤»¤ó¡§ "%s" ¹Ô] +ja,frame,60,[accel_send_plain_file()] +ja,frame,61,[accel_send_plain_file() - found request %d] +ja,frame,62,[Parse headers lost the URI!] +ja,frame,63,[accel_send_plain_file() - found uri %s] +ja,frame,64,[accel_send_plain_file() - found in cache?] +ja,frame,65,[malloc died!] +ja,frame,66,[Error writing back file\n] +ja,frame,67,[acb_send_plain_file(%d)] +ja,frame,68,[Error writing in acb_send_plain_file (%d, %s)] +ja,frame,69,[acb_close_connection(%d)] +ja,frame,70,[Errored IO in acb_close_connection (%d, %s)] +ja,frame,71,[Unable to close socket %d] +ja,frame,72,[accel-cache-insert: Error allocating entry] +ja,frame,73,[cache-init: server cache disabled] +ja,frame,74,[accel_file_cache: Error initializing file cache] +ja,frame,75,[accel_file_cache: Error creating cache] +ja,frame,76,[accel_file_cache_init: CacheHashSize < %d, using %d] +ja,frame,77,[accel_file_cache_init: CacheHashSize > %d, using %d] +ja,frame,78,[accel_file_cache_init: MaxNumberOfCachedFiles < %d, using %d] +ja,frame,79,[accel_file_cache_init: MaxNumberOfCachedFiles > %d, using %d] +ja,frame,80,[accel_file_cache_init: MaxNumberOfOpenCachedFiles < %d, using %d] +ja,frame,81,[accel_file_cache_init: MaxNumberOfOpenCachedFiles > %d, using %d] +ja,frame,82,[accel_file_cache: Error initializing file cache] +ja,frame,83,[file-cache: enabled = %s ] +ja,frame,84,[on] +ja,frame,85,[off] +ja,frame,86,[file-cache: MaxNumberOfCachedFiles %d (0x%x)] +ja,frame,87,[file-cache: CacheHashSize %d (0x%x)] +ja,frame,88,[file-cache: MaxNumberOfOpenCachedFiles %d (0x%x)] +ja,frame,89,[accel-cache-insert: Error allocating entry] +ja,frame,90,[file-cache-cleanup: munmap failed (%s)] +ja,frame,91,[file-cache-cleanup: found mmapped file \non system without mmap] +ja,frame,92,[file_cache_init: MaxTotalCachedFileSize < %d, using %d] +ja,frame,93,[file_cache_init: MaxTotalCachedFileSize > %d, using %d] +ja,frame,94,[file cache using mmap flags 0x%x] +ja,frame,95,[file cache using mmap prots 0x%x] +ja,frame,96,[file-cache-init: could not create lock] +ja,frame,97,[file-cache: unable to create temporary directory %s.\n] +ja,frame,98,[file-cache: unable to create temporary directory %s.\n] +ja,frame,99,[file-cache: GetTempPath() Cannot find temp directory to store file!] +ja,frame,100,[file-cache-init: set max cached file size to %d] +ja,frame,101,[file-cache-init: could not create lock] +ja,frame,102,[file_cache_destroy()] +ja,frame,103,[file-cache: Unable to get temp file name. Error %s] +ja,frame,104,[file-cache: Unable to get temp file name. Error %s] +ja,frame,105,[file-cache-insert: Error allocating entry] +ja,frame,106,[file-cache-create: Error opening file %s (%s)] +ja,frame,107,[file-cache-create: Error stat()ing file %s (%s)] +ja,frame,108,[file-cache-create: Error mmap()ing file %s (%s)] +ja,frame,109,[file-cache-create: malloc failure] +ja,frame,110,[file-cache-create: error case failed to munmap(%d, %d) (%s)] +ja,frame,111,[file-cache-valid: cannot stat %s] +ja,frame,112,[dir change: invalidating %s (%d)] +ja,frame,113,[file-cache: asynchronous file change notification failed.] +ja,frame,114,[dir change: offset %d, action %d, len %d, name %s] +ja,frame,115,[unable to check async file status] +ja,frame,116,[ReadDirectoryChangesW failure- unable to continue watching %s. Error is %s] +ja,frame,117,[file-cache-add-watch failure- unable to open directory %s. Error %s] +ja,frame,118,[ReadDirectoryChangesW failure- unable to start watching %s. Error %s] +ja,frame,119,[func_exec] +ja,frame,120,[no handler function given for directive] +ja,frame,121,[func_exec] +ja,frame,122,[cannot find function named %s] +ja,frame,123,[handle-request] +ja,frame,124,[method without URI] +ja,frame,125,[http-parse-request] +ja,frame,126,[while scanning HTTP headers, %s] +ja,frame,127,[handle-request] +ja,frame,128,[read from %s failed, error is %s] +ja,frame,129,[handle-request] +ja,frame,130,[request too long] +ja,frame,131,[start-http-response] +ja,frame,132,[write failed (%s)] +ja,frame,133,[start-http-response] +ja,frame,134,[write failed (%s)] +ja,frame,135,[http-status] +ja,frame,136,[%d is not a valid HTTP status code] +ja,frame,137,[finish-request] +ja,frame,138,[close failed (%s)] +ja,frame,139,[Unable to close socket for writing] +ja,frame,140,[os has %d objects] +ja,frame,141,[obj %d has no hash table at %d] +ja,frame,142,[obj %d has no param] +ja,frame,143,[obj %d name %s value %s] +ja,frame,144,[.....directives %d.......] +ja,frame,145,[.....directive %d] +ja,frame,146,[.......instance %d] +ja,frame,147,[...........param name %s value %s] +ja,frame,148,[ClearConfigurationParameters:RegCreateKey %s] +ja,frame,149,[ClearConfigurationParameters:RegEnumKey %s failed] +ja,frame,150,[obj.conf line %d: error in filter file "%s" at line %d: %s] +ja,frame,151,[obj.conf line %d: error in filter file "%s" at line %d: %s] +ja,frame,152,[Unable to allocate Subject property list.\n] +ja,frame,153,[Unable to set session ptr in Subject property list - error=%d\n] +ja,frame,154,[Unable to set request ptr in Subject property list - error=%d\n] +ja,frame,155,[file-cache-valid: cannot stat %s] +ja,frame,156,[file-cache-create: Error stat()ing file %s (%s)] +ja,httpdaemon,-1,[$DBT: httpdaemon in DB file v1 $] +ja,httpdaemon,1,[Error in ConvertThreadToFiber] +ja,httpdaemon,2,[Error in ConvertThreadToFiber] +ja,httpdaemon,3,[Error in md_start_system] +ja,httpdaemon,4,[Error in CreateFiber - idlefiber] +ja,httpdaemon,5,[Error in GetQueuedCompletionStatus] +ja,httpdaemon,6,[Error creating completion port] +ja,httpdaemon,7,[Could not SetHandleNonInheritable (%s)] +ja,httpdaemon,8,[Error accept/read new conn] +ja,httpdaemon,9,[Error in Respond()] +ja,httpdaemon,10,[Error in RespondCompleted()] +ja,httpdaemon,11,[daemon: unable to fork new process (%s)\n] +ja,httpdaemon,12,[daemon: setsid failed (%s)\n] +ja,httpdaemon,13,[daemon: can't log pid to %s (%s)\n] +ja,httpdaemon,14,[warning: could not set group id to %d (%s)\n] +ja,httpdaemon,15,[warning: could not set user id to %d (%s)\n] +ja,httpdaemon,16,[warning: daemon is running as super-user\n] +ja,httpdaemon,17,[could not determine current user name\n] +ja,httpdaemon,18,[error: chroot to %s failed (%s)\n] +ja,httpdaemon,19,[WARNING! netscape executable and library have different versions.\n] +ja,httpdaemon,20,[startup: listening to %s://%s, port %d as %s\n] +ja,httpdaemon,21,[startup: listening to %s://%s, port %d as %s\n] +ja,httpdaemon,22,[seminit failed (%s)\n] +ja,httpdaemon,23,[Using single threaded accepts.] +ja,httpdaemon,24,[Using multi threaded accepts.] +ja,httpdaemon,25,[Using partial single threaded accepts.] +ja,httpdaemon,26,[This machine has %d processors.] +ja,httpdaemon,27,[Error calling thr_seconcurrency(%d)- (%s)] +ja,httpdaemon,28,[Set conncurrency to %d.] +ja,httpdaemon,29,[can't fork new process (%s)] +ja,httpdaemon,30,[This beta software has expired.\n] +ja,httpdaemon,31,[can't create IPC pipe (%s)] +ja,httpdaemon,32,[write to wakeup pipe failed (%s)] +ja,httpdaemon,33,[select thread miss] +ja,httpdaemon,34,[startup failure: could not bind to port %d (%s)\n] +ja,httpdaemon,35,[startup failure: could not bind to port %d, IP address %s (%s)\n] +ja,libaccess,-1,[$DBT: libaccess in DB file v1 $] +ja,libaccess,1,[basic-ncsa] +ja,libaccess,2,[cannot open database %s] +ja,libaccess,3,[basic-ncsa] +ja,libaccess,4,[user %s password did not match database %s] +ja,libaccess,5,[basic-ncsa] +ja,libaccess,6,[cannot open connection to LDAP server on %s:%d] +ja,libaccess,7,[basic-ncsa] +ja,libaccess,8,[user %s password did not match LDAP on %s:%d] +ja,libaccess,9,[acl-state] +ja,libaccess,10,[missing realm] +ja,libaccess,11,[Unable to allocate ACL List Hash\n] +ja,libaccess,12,[ACLEvalBuildContext unable to PERM_MALLOC cache structure\n] +ja,libaccess,13,[ACLEvalBuildContext unable to create hash table\n] +ja,libaccess,14,[ACLEvalBuildContext unable to allocate ACE Entry\n] +ja,libaccess,15,[ACLEvalBuildContext unable to allocate ACE entry\n] +ja,libaccess,16,[ACLEvalBuildContext unable to allocate Boundary Entry\n] +ja,libaccess,17,[ACLEvalBuildContext failed.\n] +ja,libaccess,18,[ACL_EvalTestRights: an interim, absolute non-allow value was encountered. right=%s, value=%d\n] +ja,libaccess,19,[LASDnsBuild unable to allocate hash table header\n] +ja,libaccess,20,[LASDnsBuild unable to add key %s\n] +ja,libaccess,21,[LASDnsBuild unable to add key %s\n] +ja,libaccess,22,[LASDnsBuild unable to add key %s\n] +ja,libaccess,23,[LASDnsBuild unable to add key %s\n] +ja,libaccess,24,[LASDnsBuild unable to add key %s\n] +ja,libaccess,25,[LAS DNS build received request for attribute %s\n] +ja,libaccess,26,[LASDnsEval - illegal comparator %s\n] +ja,libaccess,27,[LASDnsEval unable to allocate Context struct\n\n] +ja,libaccess,28,[LASDnsEval unable to get session address %d\n] +ja,libaccess,29,[LASDnsEval unable to get DNS - error=%s\n] +ja,libaccess,30,[LAS Group Eval received request for attribute %s\n] +ja,libaccess,31,[LASGroupEval - illegal comparator %s\n] +ja,libaccess,32,[LASGroupEval - ran out of memory\n] +ja,libaccess,33,[LASGroupEval unable to get session address %d\n] +ja,libaccess,34,[LASGroupEval unable to get session address %d\n] +ja,libaccess,35,[LASGroupEval - couldn't locate getter for auth-user\n] +ja,libaccess,36,[LASGroupEval - Attribute getter for auth-user failed\n] +ja,libaccess,37,[LASGroupEval - Attribute getter didn't set auth-user\n] +ja,libaccess,38,[Check group membership of user "%s" for group "%s"\n] +ja,libaccess,39,[LDAPU_SUCCESS for group "%s"\n] +ja,libaccess,40,[LDAPU_FAILED for group "%s"\n] +ja,libaccess,41,[LAS_EVAL_FALSE\n] +ja,libaccess,42,[LAS_EVAL_TRUE\n] +ja,libaccess,43,[LASIpTreeAlloc - no memory\n] +ja,libaccess,44,[IP LAS unable to allocate tree node\n] +ja,libaccess,45,[IP LAS unable to allocate tree node\n] +ja,libaccess,46,[LAS IP build received request for attribute %s\n] +ja,libaccess,47,[LASIpEval - illegal comparator %s\n] +ja,libaccess,48,[LASIpEval unable to get session address - error=%s\n] +ja,libaccess,49,[LASIpEval unable to allocate Context struct\n\n] +ja,libaccess,50,[LASIpEval - reach 32 bits without conclusion value=%s] +ja,libaccess,51,[LAS Program Eval received request for attribute %s\n] +ja,libaccess,52,[LASProgramEval - illegal comparator %s\n] +ja,libaccess,53,[LASProgram unable to get session address %d\n] +ja,libaccess,54,[bin] +ja,libaccess,55,[LASProgramEval: request not of type admin or bin, passing.\n] +ja,libaccess,56,[LASProgramEval: check if program %s matches pattern %s.\n] +ja,libaccess,57,[LASProgramEval: Invalid wildcard expression %s.\n] +ja,libaccess,58,[LAS_EVAL_FALSE\n] +ja,libaccess,59,[LAS_EVAL_TRUE\n] +ja,libaccess,60,[Unexpected attribute in dayOfWeek - %s\n] +ja,libaccess,61,[Illegal comparator for dayOfWeek - %s\n] +ja,libaccess,62,[Unexpected attribute in timeOfDay - %s\n] +ja,libaccess,63,[LAS User Eval received request for attribute %s\n] +ja,libaccess,64,[LASUserEval - illegal comparator %s\n] +ja,libaccess,65,[LASUserEval - ran out of memory\n] +ja,libaccess,66,[LASUserEval unable to get session address %d\n] +ja,libaccess,67,[LASUserEval unable to get session address %d\n] +ja,libaccess,68,[LASGroupEval - couldn't locate getter for auth-user\n] +ja,libaccess,69,[LASGroupEval - Attribute getter for auth-user failed\n] +ja,libaccess,70,[LASGroupEval - Attribute getter didn't set auth-user\n] +ja,libaccess,71,[Check if uid == user (i.e. check "%s" == "%s)"\n] +ja,libaccess,72,[SUCCESS for user "%s"\n] +ja,libaccess,73,[FAILED for user "%s"\n] +ja,libaccess,74,[LAS_EVAL_FALSE\n] +ja,libaccess,75,[LAS_EVAL_TRUE\n] +ja,libaccess,76,[] +ja,libaccess,77,[LASProgram unable to get request address - error=%s] +ja,libaccess,78,[LASProgram rejecting request for program %s from pattern %s] +ja,libaccess,79,[ACL_CacheFlush: unable to parse file "%s"\n] +ja,libaccess,80,[ACL_CacheFlush: unable to concatenate ACL list "%s"\n] +ja,libaccess,81,[ACL_CacheFlush: unable to open and process the magnus file "%s"\n] +ja,libaccess,82,[Illegal comparator for timeOfDay - %s\n] +ja,libaccess,83,[ACL_EvalBuildContext unable to create hash table\n] +ja,libaccess,84,[ACL_EvalBuildContext unable to PERM_CALLOC cache structure\n] +ja,libaccess,85,[ACL_EvalBuildContext unable to allocate ACE entry\n] +ja,libaccess,86,[ACL_EvalBuildContext unable to allocate auth pointer array\n] +ja,libaccess,87,[ACL_EvalBuildContext unable to allocate auth plist\n] +ja,libaccess,88,[ACL_EvalTestRights: an interim, absolute non-allow value was encountered. right=%s, value=%s\n] +ja,libaccess,89,[ACL_INTEvalTestRights: call to ACL_EvalBuildContext returned failure status\n] +ja,libaccess,90,[ACL_ModuleRegister: module name is missing\n] +ja,libaccess,91,[ACL_ModuleRegister: call to module init function returned a failed status\n] +ja,libaccess,92,[ACL_GetAttribute: couldn't determine method for %s\n] +ja,libaccess,93,[ACL_GetAttribute: couldn't locate getter for %s] +ja,libaccess,94,[ACL_GetAttribute: attr getter failed to get %s] +ja,libaccess,95,[ACL_GetAttribute: attr getter failed to get %s] +ja,libaccess,96,[ACL_GetAttribute: All attribute getters declined for attr %s] +ja,libaccess,97,[ACL_DatabaseRegister: dbtype for database "%s" is not defined yet!] +ja,libaccess,98,[ACL_DatabaseRegister: database name is missing] +ja,libaccess,99,[Error reading the DB Map File: %s. Reason: %s] +ja,libaccess,100,[URL is missing for database %s] +ja,libaccess,101,[Invalid property value pair for database %s] +ja,libaccess,102,["default" database must be an LDAP database] +ja,libaccess,103,[Multiple "default" databases are being registered] +ja,libaccess,104,["default" LDAP database must be registered] +ja,libaccess,105,[LASGroupEval unable to get database name - error= %s] +ja,libaccess,106,[received invalid program expression %s] +ja,libaccess,107,[parse_ldap_url: database url is missing] +ja,libaccess,108,[parse_ldap_url: database name is missing] +ja,libaccess,109,[parse_ldap_url: error in parsing ldap url. Reason: %s] +ja,libaccess,110,[ldap password check: unable to get database name - error=%s] +ja,libaccess,111,[ldap password check: unable to get parsed database %s] +ja,libaccess,112,[ldap password check: couldn't initialize connection to LDAP. Reason: %s] +ja,libaccess,113,[ldap password check: LDAP error: "%s"] +ja,libaccess,114,[get_user_ismember_ldap unable to get database name - error=%s] +ja,libaccess,115,[get_user_ismember_ldap unable to get parsed database %s] +ja,libaccess,116,[ldap password check: couldn't initialize connection to LDAP. Reason: %s] +ja,libaccess,117,[get_user_ismember_ldap: group %s does not exist] +ja,libaccess,118,[get_user_ismember_ldap: LDAP error: "%s"] +ja,libaccess,119,[ACL_LDAPDatabaseHandle: %s is not a registered database] +ja,libaccess,120,[ACL_LDAPDatabaseHandle: %s is not an LDAP database] +ja,libaccess,121,[ACL_LDAPDatabaseHandle: out of memory] +ja,libaccess,122,[ACL_LDAPDatabaseHandle: couldn't initialize connection to LDAP. Reason: %s] +ja,libaccess,123,[ACL_LDAPDatabaseHandle: couldn't bind to LDAP server. Reason: %s] +ja,libaccess,124,[insufficient dynamic memory] +ja,libaccess,125,[error opening file, %s: %s] +ja,libaccess,126,[duplicate definition of %s] +ja,libaccess,127,[file %s, line %s: duplicate definition of %s] +ja,libaccess,128,[file %s, line %s: syntax error] +ja,libaccess,129,[file %s, line %s: %s is undefined] +ja,libaccess,130,[in acl %s, %s %s is undefined] +ja,libaccess,131,[database %s: error accessing %s] +ja,libaccess,132,[%s] +ja,libaccess,133,[file %s, line %s: invalid syntax] +ja,libaccess,134,[file %s, line %s: syntax error at "%s"] +ja,libaccess,135,[realm %s is not defined] +ja,libaccess,136,[error code = %d] +ja,libaccess,137,[internal ACL error] +ja,libaccess,138,[invalid argument] +ja,libaccess,139,[ACL_DatabaseRegister: dbtype for database "%s" is not defined yet!] +ja,libaccess,140,[couldn't determine dbtype from: %s] +ja,libaccess,141,[Failed to register database %s] +ja,libaccess,142,[ACL call returned failed status] +ja,libaccess,143,[file %s: ACL IO error - %s] +ja,libaccess,144,[acl_user_exists: ¥á¥â¥êÉÔ­¤Ç¤¹] +ja,libaccess,145,[acl_user_exists: ¥æ¡¼¥¶¤¬¤â¤¦Â¸ºß¤·¤Þ¤»¤ó] +ja,libaccess,146,[acl_user_exists: plist ¥¨¥é¡¼] +ja,libadmin,-1,[$DBT: libadmin in DB file v1 $] +ja,libadmin,1,[ Help ] +ja,libadmin,2,[ OK ] +ja,libadmin,3,[ Reset ] +ja,libadmin,4,[ Done ] +ja,libadmin,5,[ Cancel ] +ja,libir,-1,[$DBT: libadmin in DB file v1 $] +ja,libir,1,[An I/O error occurred before all form data could be read.] diff --git a/l10n/dirserv/ja/ns-slapd.txt.eucjp b/l10n/dirserv/ja/ns-slapd.txt.eucjp new file mode 100644 index 00000000..67175934 --- /dev/null +++ b/l10n/dirserv/ja/ns-slapd.txt.eucjp @@ -0,0 +1,981 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/**************************************************************************/ +/* The copyright notice(s) in this Source Code does not indicate actual */ +/* or intended publication of this Source Code. */ +/**************************************************************************/ + +/* This text file was generated by program dblink */ + +$Revision: 1.1 $ +$Log: ns-slapd.txt.eucjp,v $ +Revision 1.1 2005/01/21 00:40:48 cvsadm +Initial revision + +Revision 1.1.4.3 2003/09/22 19:36:44 ulfw +Update copyright years from 2001 to 2001-2003 + +Revision 1.1.4.2 2001/11/03 01:08:09 richm +XXX use new copyright XXX + +Revision 1.1.4.1 1998/10/10 02:14:13 ggood +Copy from Directory40RtmBranchpoint to DirectoryBranch + +Revision 1.1.2.4.2.1.6.2 1998/04/04 23:17:00 mcs +merge changes made on directory31_rtm_branch into server4_directory_branch + +Revision 1.1.2.4.2.5.2.2 1998/02/24 05:44:41 noriko +Fixed backslashes + +Revision 1.1.2.4.2.5.2.1 1998/02/24 05:39:08 noriko +Added new updates from the translators + +Revision 1.1.2.7 1998/02/12 01:55:50 scronin +Based on en/ns-slapd.txt : 1.1.2.4 +Build by scronin on 2/8/1998 Solaris +$EndLog$ + +$StartStringData$ + +ja,base,-1,[$DBT: base in DB file v1 $] +ja,base,1,[¥Ï¥Ã¥·¥å ¥Æ¡¼¥Ö¥ë¤òºîÀ®¤¹¤ë¤¿¤á¤Î¥á¥â¥ê¤¬ÉÔ­¤·¤Æ¤¤¤Þ¤¹¡£] +ja,base,2,[¥Ï¥Ã¥·¥å ¥Æ¡¼¥Ö¥ë¤òºîÀ®¤¹¤ë¤¿¤á¤Î¥á¥â¥ê¤¬ÉÔ­¤·¤Æ¤¤¤Þ¤¹] +ja,base,3,[cache_destroy: ¥­¥ã¥Ã¥·¥å ¥Æ¡¼¥Ö¥ë¤¬ÉÔÀµ¤Ç¤¹¡£] +ja,base,4,[¥Ï¥Ã¥·¥å ¥¨¥ó¥È¥ê¤ò³ä¤êÅö¤Æ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£] +ja,base,5,[cache_insert: ¥­¥ã¥Ã¥·¥å ¥¨¥ó¥È¥ê¤òºîÀ®¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£] +ja,base,6,[HTTP/1.0 200 OK\nContent-type: text/html\n\n] +ja,base,7,[

                    Netscape ¥­¥ã¥Ã¥·¥å ¥¹¥Æ¡¼¥¿¥¹ ¥ì¥Ý¡¼¥È

                    \n] +ja,base,8,[¥·¥¹¥Æ¥à¾å¤Ë¥­¥ã¥Ã¥·¥å¤¬Â¸ºß¤·¤Þ¤»¤ó¡£

                    ] +ja,base,9,[

                    %s ¥­¥ã¥Ã¥·¥å

                    \n] +ja,base,10,[¥­¥ã¥Ã¥·¥å ¥Ò¥Ã¥È ¥ì¥·¥ª¡§ %d/%d (%f)

                    \n

                    \n] +ja,base,11,[¥­¥ã¥Ã¥·¥å ¥µ¥¤¥º¡§ %d/%d

                    \n

                    \n] +ja,base,12,[¥Ï¥Ã¥·¥å ¥Æ¡¼¥Ö¥ë ¥µ¥¤¥º¡§ %d

                    \n

                    \n] +ja,base,13,[mru : %d

                    \nlru : %d

                    \n] +ja,base,14,[
                      Bucket ¥¢¥É¥ì¥¹ ¥­¡¼ ¥¢¥¯¥»¥¹²ó¿ô ºï½ü ¼¡¤Ø LRU MRU ¥Ç¡¼¥¿
                      \n] +ja,base,15,[munmap failed (%s)] +ja,base,16,[munmap failed (%s)] +ja,base,17,[close failed (%s)] +ja,base,18,[daemon: unable to fork new process (%s)\n] +ja,base,19,[daemon: setsid failed (%s)\n] +ja,base,20,[daemon: can't log pid to %s (%s)\n] +ja,base,21,[warning: could not set group id to %d (%s)\n] +ja,base,22,[warning: could not set user id to %d (%s)\n] +ja,base,23,[warning: daemon is running as super-user\n] +ja,base,24,[could not determine current user name\n] +ja,base,25,[error: chroot to %s failed (%s)\n] +ja,base,27,[, address %s] +ja,base,28,[warning: statistics disabled (%s)\n] +ja,base,29,[security handshake timed out for pid %d] +ja,base,30,[warning: statistics disabled (%s)\n] +ja,base,31,[secure handshake failed (code %d)\n] +ja,base,32,[accept failed (%s)] +ja,base,33,[warning: statistics disabled (%s)\n] +ja,base,34,[select thread miss] +ja,base,35,[keepalive worker awoken with no work to do] +ja,base,36,[could not create new thread: %d (%s)] +ja,base,37,[wait for sema succeeded, but nothing to dequeue] +ja,base,38,[queue-sema creation failure] +ja,base,39,[error getting processor info for processor %d] +ja,base,40,[Error binding to processor %d] +ja,base,41,[bound process %d to processor %d] +ja,base,42,[Netscape server is not explicitly binding to any processors.] +ja,base,43,[cache monitor exited] +ja,base,44,[cache batch update daemon exited] +ja,base,45,[Using single threaded accepts.] +ja,base,46,[Using multi threaded accepts.] +ja,base,47,[Using partial single threaded accepts.] +ja,base,48,[This machine has %d processors.] +ja,base,49,[Error calling thr_seconcurrency(%d)- (%s)] +ja,base,50,[Set conncurrency to %d.] +ja,base,51,[WARNING! netscape executable and library have different versions.\n] +ja,base,54,[seminit failed (%s)\n] +ja,base,55,[This beta software has expired.\n] +ja,base,56,[Cache monitor respawned] +ja,base,57,[Cache batch update daemon respawned] +ja,base,58,[can't find empty statistics slot] +ja,base,59,[can't fork new process (%s)] +ja,base,60,[assert failed! %s\n] +ja,base,61,[mr_table_init()] +ja,base,62,[malloc failed] +ja,base,63,[malloc failed!] +ja,base,64,[mr_add_io(%d, type %d, file %d)] +ja,base,65,[mr_add_io - stage 1] +ja,base,66,[mr_add_io - stage 2] +ja,base,67,[mr_add_io found invalid IO type %d] +ja,base,68,[mr_add_io - adding timeout] +ja,base,69,[Out of memory!\n] +ja,base,70,[done with mr_add_io] +ja,base,71,[mr_del_io(%d, type %d, file %d)] +ja,base,72,[mr_del_io found invalid IO type %d] +ja,base,73,[mr_lookup_io(%d)] +ja,base,74,[mr_async_io(%d, %d bytes, file %d)] +ja,base,75,[malloc failure adding async IO] +ja,base,76,[Error adding async io!] +ja,base,77,[Cannot seek for read!] +ja,base,78,[read failure! (%d, %s)] +ja,base,79,[do_read read %d bytes for file %d] +ja,base,80,[Cannot seek for write!] +ja,base,81,[writev failure! (%d, %s)] +ja,base,82,[write failure! (%d, %s)] +ja,base,83,[do_write wrote %d bytes for file %d] +ja,base,84,[do_timeout(mrp %d)] +ja,base,85,[do_timeout: found IO (timer=%d, time=%d)] +ja,base,86,[error deleting io] +ja,base,87,[timeout callback failure for %d\n] +ja,base,88,[mr_get_event(%d) - outstanding io %d] +ja,base,89,[mr_get_event: Waiting for reads on FD:] +ja,base,90,[mr_get_event: Waiting for writes on FD:] +ja,base,91,[ %d] +ja,base,92,[ %d] +ja,base,93,[mr_get_event set no timeout] +ja,base,94,[mr_get_event set timeout to: %d.%d sec] +ja,base,95,[error in select (%d, %s)] +ja,base,96,[mr_get_event() - select found %d] +ja,base,97,[error looking up IO fd %d] +ja,base,98,[read failed for fd %d] +ja,base,99,[error deleting io] +ja,base,100,[callback failure for %d\n] +ja,base,101,[error looking up IO fd %d] +ja,base,102,[writing: header len %d, writelen %d, total %d] +ja,base,103,[write failed for fd %d] +ja,base,104,[error deleting io] +ja,base,105,[callback failure for %d\n] +ja,base,106,[Error creating dns cache] +ja,base,107,[dns_cache_init: hash_size <= 0, using %d] +ja,base,108,[dns_cache_init: cache-size <= %d, using %d] +ja,base,109,[dns_cache_init: cache-size is %d is too large, using %d.] +ja,base,110,[dns_cache_init: expire_time <= 0, using %d] +ja,base,111,[dns_cache_init: expire is %d is too large, using %d seconds.] +ja,base,112,[Error creating dns cache] +ja,base,113,[dns-cache-insert: Error allocating entry] +ja,base,114,[dns-cache-insert: malloc failure] +ja,base,115,[successful server startup] +ja,base,116,[%s B%s] +ja,base,117,[Netscape executable and shared library have different versions] +ja,base,118,[ executable version is %s] +ja,base,119,[ shared library version is %s] +ja,base,120,[error reporting shutting down] +ja,base,121,[warning] +ja,base,122,[config] +ja,base,123,[security] +ja,base,124,[failure] +ja,base,125,[catastrophe] +ja,base,126,[info] +ja,base,127,[verbose] +ja,base,128,[event_handler:Failed to wait on events %s] +ja,base,129,[could not wait on resume event event (%s)] +ja,base,130,[dlopen of %s failed (%s)] +ja,base,131,[dlopen of %s failed (%s)] +ja,base,132,[The server is terminating due to an error. Check the event viewer for the error message. SERVER EXITING!] +ja,base,133,[Terminating the server %s] +ja,base,134,[kill_server:cannot open server event %s] +ja,base,135,[kill_server:cannot set server event %s] +ja,base,136,[error: could not get socket (%s)\n] +ja,base,137,[error: could not set socket option (%s)\n] +ja,base,138,[Terminating Service:error: could not bind to address %s port %d (%s)\n] +ja,base,139,[Terminating Service:error: could not bind to port %d (%s)\n] +ja,base,140,[SetHandleNonInheritable: could not duplicate socket (%s)] +ja,base,141,[SetHandleNonInheritable: closing the original socket failed (%s)] +ja,base,142,[Could not SetHandleInformation (%s)] +ja,base,143,[Terminating Service:Failure: Could not open statistics file (%s)\n] +ja,base,144,[Could not set Thread Local Storage Value for thread at slot %d] +ja,base,145,[secure handshake failed (code %d)\n] +ja,base,146,[accept failed %d (%s)] +ja,base,147,[Failed to pulse Event %d %s] +ja,base,148,[Failed to send MobGrowth Event to parent %s] +ja,base,149,[Pulsing MobRespawn Event %d] +ja,base,150,[respawn thread pool to %d (%d)] +ja,base,151,[Could not open event to signal rotate application. Could not create the MoveLog event:%s] +ja,base,152,[Failed to send MoveLog Event to rotate app %s] +ja,base,153,[growing thread pool from %d to %d] +ja,base,154,[Could not open the ServiceControlManager, Error %d] +ja,base,155,[StartNetsiteService:Could not open the service %s: Error %d] +ja,base,156,[StartNetsiteService:Could not start the service %s] +ja,base,157,[Service Startup: Could not allocate security descriptor] +ja,base,158,[Service Startup: Could not init security descriptor] +ja,base,159,[Service Startup: Could not set the security Dacl] +ja,base,160,[Terminating Service:WinSock init failed: %s] +ja,base,161,[Httpd Server Startup failed: %s] +ja,base,162,[can't find empty statistics slot] +ja,base,163,[NT daemon: could not create new thread %d] +ja,base,164,[Service Startup Failure. Terminating Service:Could not create event %d:%s] +ja,base,165,[Service Startup Error. Could not create the MoveLog event:%s] +ja,base,166,[Failed to wait on Event objects %s] +ja,base,167,[Failed to wait on Event objects %s] +ja,base,168,[pipebuf_buf2sd: pipebuf_grab IO_ERROR %d] +ja,base,169,[pool-init: memory pools disabled] +ja,base,170,[pool-init: free_size <= 0, using %d] +ja,base,171,[pool-create-block: out of memory] +ja,base,172,[pool-create: out of memory] +ja,base,173,[pool-create: out of memory] +ja,base,174,[pool-malloc: out of memory] +ja,base,175,[FREE() used where PERM_FREE() should have been used- problem corrected and supressing further warnings.] +ja,base,176,[regex error: %s (regex: '%s')] +ja,base,177,[can't create IPC pipe (%s)] +ja,base,178,[write to wakeup pipe failed (%s)] +ja,base,179,[flushing %d connections; current %d; tot %d] +ja,base,180,[accept failed (%s)] +ja,base,181,[Error creating time cache] +ja,base,182,[time-cache: cache disabled] +ja,base,183,[time_cache_init: hash_size < %d, using default, %d] +ja,base,184,[time_cache_init: hash_size > %d, using default, %d] +ja,base,185,[time_cache_init: cache_size < %d, using default, %d] +ja,base,186,[time_cache_init: cache_size > %d, using default, %d] +ja,base,187,[Error allocating memory for time_cache] +ja,base,188,[Error allocating memory for time_cache entry] +ja,base,189,[Error allocating memory for time_cache entry] +ja,base,190,[Error inserting new time_cache entry] +ja,base,191,[Error allocating memory for time_cache] +ja,base,192,[cs-terminate failure (%s)] +ja,base,193,[cs-init failure (%s)] +ja,base,194,[cs-wait failure (%s)] +ja,base,195,[cs-post failure (%s)] +ja,base,196,[Unable to create nonblocking socket (%s)] +ja,base,197,[error: could not set keepalive (%s)\n] +ja,base,198,[error: could not set recv timeout (%s)\n] +ja,base,199,[error: could not set send timeout (%s)\n] +ja,base,200,[Unable to create nonblocking socket (%s)] +ja,base,201,[sem_grab failed (%s)] +ja,base,202,[sem_release failed (%s)] +ja,base,203,[sem_release failed (%s)] +ja,base,204,[Could not remove temporary directory %s, Error %d] +ja,base,205,[Could not remove temporary directory %s, Error %d] +ja,dsgw,-1,[$DBT: dsgw in DB file v1 $] +ja,dsgw,1,[Íý²ò¤Ç¤­¤Ê¤¤ HTTP ¥ê¥¯¥¨¥¹¥È¤Ç¤¹¡£] +ja,dsgw,2,[ÉÔÀµ¤Ê¤Þ¤¿¤Ï¡¢´°Î»¤·¤Æ¤¤¤Ê¤¤ HTML ¥Õ¥©¡¼¥à ¥Ç¡¼¥¿¤Ç¤¹¡£] +ja,dsgw,3,[¥á¥â¥êÉÔ­¤Ç¤¹¡£] +ja,dsgw,4,[query/form ¤ÎÆþÎϤ¬¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£] +ja,dsgw,5,[¥Õ¥¡¥¤¥ë¤Þ¤¿¤Ï¥Ñ¥¹¤Î»ØÄê¤ËÉÔÀµ¤Êʸ»ú¤¬»ÈÍѤµ¤ì¤Æ¤¤¤Þ¤¹¡£] +ja,dsgw,6,[ÀßÄê¥Õ¥¡¥¤¥ë¤¬¸«¤Ä¤«¤é¤Ê¤¤¤«ÉÔÀµ¤Ç¤¹¡£] +ja,dsgw,7,[LDAP ¤ò½é´ü²½¤Ç¤­¤Þ¤»¤ó¡£] +ja,dsgw,8,[LDAP ¤È¤ÎÀܳ»þ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿¡£] +ja,dsgw,9,[¸¡º÷¤ÎÂоݤȤʤ륪¥Ö¥¸¥§¥¯¥È¤òǧ¼±¤Ç¤­¤Þ¤»¤ó¡£] +ja,dsgw,10,[Íý²ò¤Ç¤­¤Ê¤¤Â°À­¥é¥Ù¥ë¤Ç¤¹¡£] +ja,dsgw,11,[¥Þ¥Ã¥Á ¥×¥í¥ó¥×¥È¤òÍý²ò¤Ç¤­¤Þ¤»¤ó¡£] +ja,dsgw,12,[¥ª¥Ö¥¸¥§¥¯¥È ¥¿¥¤¥×¤ËÂФ¹¤ë¸¡º÷¥Õ¥£¥ë¥¿¤¬¤¢¤ê¤Þ¤»¤ó¡£] +ja,dsgw,13,[HTML ¥Æ¥ó¥×¥ì¡¼¥È ¥Õ¥¡¥¤¥ë¤ò³«¤¯¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£] +ja,dsgw,14,[¸¡º÷¥â¡¼¥É¤òÍý²ò¤Ç¤­¤Þ¤»¤ó¡£ - "smart", "complex", "pattern", ¤Þ¤¿¤Ï "auth" ¤ò»ØÄꤷ¤Æ¤¯¤À¤µ¤¤¡£] +ja,dsgw,15,[URL ¤ò»ØÄꤹ¤ë¾ðÊ󤬷çÍ¤Æ¤¤¤Þ¤¹¡£] +ja,dsgw,16,[URL ¤Î»ØÄ꤬ÉÔÌÀ¤Ç¤¹¡£] +ja,dsgw,17,[̤¾µÇ§¤Î URL ¤â¤·¤¯¤Ï̤ÃΤΥ¨¥é¡¼] +ja,dsgw,18,[URL ¥Õ¥©¡¼¥Þ¥Ã¥È¤¬ÉÔÀµ¤Ç¤¹¡£] +ja,dsgw,19,[ÆâÉô¥¨¥é¡¼] +ja,dsgw,20,[¥Æ¥ó¥×¥ì¡¼¥È ¥¤¥ó¥Ç¥Ã¥¯¥¹ ¥Õ¥¡¥¤¥ë¤Î½ñ¤­¹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£] +ja,dsgw,21,[¥Æ¥ó¥×¥ì¡¼¥È ¥¤¥ó¥Ç¥Ã¥¯¥¹ ¥Õ¥¡¥¤¥ë¤ò³«¤¯¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£] +ja,dsgw,22,[Directory ¤òÆÉ¤ß¹þ¤à¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£] +ja,dsgw,23,[LDAP SSL ¤Î½é´ü²½¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£ (¥»¥­¥å¥ê¥Æ¥£ ¥Ñ¥¹¤ò³Îǧ¤·¤Æ¤¯¤À¤µ¤¤¡£)] +ja,dsgw,24,[SSL¤Çºî¶È¤¹¤ë¤¿¤á¤Î¥æ¡¼¥¶¤È¥°¥ë¡¼¥× ¥Õ¥©¡¼¥à¤Î¾ì¹ç¡¢¥æ¡¼¥¶¤Þ¤¿¤Ï¥µ¡¼¥Ð´ÉÍý¼Ô¤¬¤³¤ÎAdministration Server¤Î SSL ¤òµ¯Æ°¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£¤³¤ì¤ò¹Ô¤¦¤Î¤Ë[°Å¹æ²½]¤Î[¥ª¥ó/¥ª¥Õ]¥Ú¡¼¥¸¤ò»ÈÍѤǤ­¤Þ¤¹¡£] +ja,dsgw,25,[¾ÚÌÀ½ñ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¾ÚÌÀ½ñ¤¬¸«¤Ä¤«¤ê¤Þ¤»¤ó¤Ç¤·¤¿¡£] +ja,dsgw,26,[¥¨¥é¡¼¡§ ¾ÚÌÀ½ñ¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤é¥Ç¡¼¥¿¤òÆÀ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£] +ja,dsgw,27,[¤¢¤Ê¤¿¤Î¾ÚÌÀ½ñ¤ÎÍ­¸ú´ü¸Â¤ÏÀÚ¤ì¤Æ¤¤¤Þ¤¹¡£] +ja,dsgw,28,[̵ºî°Ù¤Îʸ»úÎó¤òºîÀ®¤Ç¤­¤Þ¤»¤ó] +ja,dsgw,29,[¾ÚÌÀ½ñ¤ò¸¡º÷¤·¤Þ¤·¤¿¤¬¡¢¼±ÊÌ̾¤ò¸«¤Ä¤±¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£] +ja,dsgw,30,[¾ÚÌÀ½ñ¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò³«¤¯¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£] +ja,dsgw,31,[¾ÚÌÀ½ñ¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÄɲäò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£] +ja,dsgw,32,[Directory Manager ¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£] +ja,dsgw,33,[¸¡º÷ʸ»úÎ󤬯þÎϤµ¤ì¤Æ¤¤¤Þ¤»¤ó¡£¤â¤¦°ìÅÙÆþÎϤ·¤Æ¤¯¤À¤µ¤¤¡£] +ja,dsgw,34,[ÀßÄê¥Õ¥¡¥¤¥ë¤Î£±¹ÔÃæ¤ËÀßÄê¹àÌܤ¬Â¿¤¹¤®¤Þ¤¹¡£] +ja,dsgw,35,[¥¦¥¤¥ó¥É¥¦¥º ¥½¥±¥Ã¥È¤Î½é´ü²½¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£] +ja,dsgw,36,[¾ÚÌÀ½ñ¤ò¥¢¥É¥ß¥Ë¥¹¥È¥ì¡¼¥·¥ç¥ó ¥µ¡¼¥Ð¤«¤éÆÀ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£] +ja,dsgw,37,[¼±Ê̤µ¤ì¤ë̾Á°¤¬ ldapdb:// ¤Ë¸«¤Ä¤«¤ê¤Þ¤»¤ó¡£] +ja,dsgw,38,[̤¾µÇ§¤Î URL ¤Þ¤¿¤Ï̤ÃΤΥ¨¥é¡¼] +ja,dsgw,39,[URL ¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤ËÉÔÀµ¤¬¤¢¤ê¤Þ¤¹¡£] +ja,dsgw,40,[¥í¡¼¥«¥ë LDAP ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î½é´ü²½Ãæ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿] +ja,dsgw,41,[Directory ¥µ¡¼¥Ó¥¹¤Î¥¿¥¤¥×¤¬ÉÔÌÀ¤Ç¤¹¡£ - "local" ¤Þ¤¿¤Ï "remote" ¤ò»ØÄꤷ¤Æ¤¯¤À¤µ¤¤¡£] +ja,dsgw,42,[db ÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆÉ¤ß¹þ¤ßÃæ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿¡£] +ja,dsgw,43,[NSHOME/userdb ¤Î¥Ñ¥¹¤¬»ØÄꤵ¤ì¤Æ¤¤¤Þ¤»¤ó¡£] +ja,dsgw,44,[Directory ¥µ¡¼¥Ó¥¹¤ÎÀßÄê¤ò¹¹¿·¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£] +ja,dsgw,45,[¥¨¥ó¥È¥ê¤ò Directory ¤«¤éÆÉ¤ß¹þ¤à¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£] +ja,dsgw,46,[LDAP ¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¾Ãµî¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£] +ja,dsgw,47,[¥¨¥ó¥È¥ê¤ÎÊѹ¹¤ª¤è¤ÓÄɲäò¹Ô¤¦¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£] +ja,dsgw,48,[ÌäÂê] +ja,dsgw,49,[¾ÚÌÀ½ñ¤ËÌäÂ꤬¤¢¤ê¤Þ¤¹¡£] +ja,dsgw,50,[.\n

                      ¼¡¤Ë°Ü¤ëÁ°¤ËºÆÅÙǧ¾Ú¤ò¼õ¤±¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£\n] +ja,dsgw,51,[.\n

                      ¼¡¤Ë°Ü¤ëÁ°¤ËºÆÅÙǧ¾Ú¤ò¼õ¤±¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£\n] +ja,dsgw,52,[̤ÃΤΥ¨¥é¡¼] +ja,dsgw,53,[Áàºî¤Ï´°Î»¤·¤Þ¤·¤¿¡£] +ja,dsgw,54,[¥µ¡¼¥ÐÆâÉô¤Ç¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿¡£\n ¥µ¡¼¥Ð´ÉÍý¼Ô¤Ë¸½ºß¤Î¾õÂÖ¤òÏ¢Íí¤·¤Æ¤¯¤À¤µ¤¤¡£] +ja,dsgw,55,[¥µ¡¼¥Ð¤Ï¥²¡¼¥È¥¦¥¨¥¤¤«¤é¼õ¤±¼è¤Ã¤¿¥ê¥¯¥¨¥¹¥È¤òÍý²ò¤Ç¤­¤Þ¤»¤ó¡£] +ja,dsgw,56,[¤¢¤Ê¤¿¤Î¥ê¥¯¥¨¥¹¥È¤Ï±þÅú¤¬¤Ê¤¤¤Þ¤Þ¥¿¥¤¥à¥¢¥¦¥È¤·¤Þ¤·¤¿¡£\n ºÆÅÙ¸¡º÷¤ò¹Ô¤¦ºÝ¤Ë¤Ï¡¢¸¡º÷¤Î·ë²Ì¤ò¤è¤¯¹Íθ¤·¡¢¸úΨ¤Î¤è¤¤ÊýË¡¤Ç¸¡º÷¤ò¤ª¤³¤Ê¤Ã¤Æ¤¯¤À¤µ¤¤¡£] +ja,dsgw,57,[¤¢¤Ê¤¿¤Î¥ê¥¯¥¨¥¹¥È¤ÇÆÀ¤¿·ë²Ì¤¬Â礭¤¹¤®¤Þ¤¹¡£\n ºÆÅÙ¸¡º÷¤ò¹Ô¤¦ºÝ¤Ë¤Ï¡¢¸¡º÷¤Î·ë²Ì¤ò¤è¤¯¹Íθ¤·¡¢¸úΨ¤Î¤è¤¤ÊýË¡¤Ç¸¡º÷¤ò¤ª¤³¤Ê¤Ã¤Æ¤¯¤À¤µ¤¤¡£] +ja,dsgw,58,[¥µ¡¼¥Ð¤¬Íý²ò¤Ç¤­¤Ê¤¤ÊýË¡¤ò»ÈÍѤ·¤Æ¡¢\n¥²¡¼¥È¥¦¥¨¥¤¤¬¥µ¡¼¥Ð¤Ëǧ¾Ú¤ò»î¤ß¤Þ¤·¤¿¡£] +ja,dsgw,59,[¥²¡¼¥È¥¦¥¨¥¤¤ò·Ðͳ¤·¤¿Ç§¾Ú¤Ï¡¢¥µ¡¼¥Ð¤Ç¹Ô¤¦¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£] +ja,dsgw,60,[¥ê¥¯¥¨¥¹¥È¤ËɬÍפʾðÊ󤬷çÍ¤Æ¤¤¤Þ¤¹¡£ ¥ê¥¯¥¨¥¹¥È¤ò¥µ¡¼¥Ð¤¬ \n ¼õ¤±ÉÕ¤±¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£¤Û¤«¤Î¥µ¡¼¥Ð¤Ç¥ê¥¯¥¨¥¹¥È¤ò½èÍý¤¹¤ë¤³¤È¤¬¤Ç¤­¤ì¤Ð¡¢¥Ç¡¼¥¿¤Î¥Þ¥¹¥¿¥³¥Ô¡¼¤òÊÝ»ý¤¹¤ë¥µ¡¼¥Ð¤ò¤ê¤è¤¦¤·¤Æ¤¯¤À¤µ¤¤¡£] +ja,dsgw,61,[¤¢¤Ê¤¿¤Î¥ê¥¯¥¨¥¹¥È¤Î¼Â¹Ô¤Ï´ÉÍý¤ÎÈϰϤòͤ¨¤Æ¤¤¤Þ¤¹¡£] +ja,dsgw,62,[¥²¡¼¥È¥¦¥¨¥¤¤¬Í׵ᤷ¤¿½ÅÂç¤Ê³ÈÄ¥¤Ï¤³¤Î¥µ¡¼¥Ð¤ÇÍøÍѤ¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£] +ja,dsgw,63,[¥¨¥ó¥È¥ê¤Ë¸ºß¤·¤Ê¤¤Â°À­¤¬Í×µá¤Ë¤è¤Ã¤Æ»²¾È¤µ¤ì¤¿¤¿¤á\n¡¢¥µ¡¼¥Ð¤Ï¤³¤ÎÍ×µá¤ò½èÍý¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£] +ja,dsgw,64,[Í׵᤬¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÀ©Ìó¤Ë°ãÈ¿¤·¤Æ¤¤¤ë¤¿¤á¡¢\n¥µ¡¼¥Ð¤ÏÍ×µá¤ò´°Î»¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£] +ja,dsgw,65,[¥µ¡¼¥Ð¤ÏÆþÎϤµ¤ì¤¿ÃͤòÄɲäǤ­¤Þ¤»¤ó¤Ç¤·¤¿¡£\n ´û¤ËÆþÎϤ·¤¿Ãͤ¬¥¨¥ó¥È¥ê¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¤³¤È¤â¹Í¤¨¤é¤ì¤Þ¤¹¡£] +ja,dsgw,66,[¥µ¡¼¥Ð¤Ï¥¨¥ó¥È¥ê¤ò¸«¤Ä¤±¤é¤ì¤Þ¤»¤ó¤Ç¤·¤¿¡£\n ¿·¤·¤¤¥¨¥ó¥È¥ê¤òÄɲ乤ë¾ì¹ç¡¢Äɲ乤륨¥ó¥È¥ê¤Î¿Æ¤¬É¬¤ºÂ¸ºß¤¹¤ë¤³¤È¤ò³Îǧ¤·¤Æ¤¯¤À¤µ¤¤¡£\n ¸¡º÷Ãæ¤Ë¤³¤Î¥¨¥é¡¼¤ò¼õ¿®¤·¤¿¤é¡¢¸¡º÷¤·¤Æ¤¤¤¿¥¨¥ó¥È¥ê¤¬Â¸ºß¤·¤Ê¤¤¤³¤È¤ò¼¨¤·¤Æ¤¤¤Þ¤¹¡£\nDirectory Manager ¤È¤·¤ÆÇ§¾Ú¤ò»î¤ß¤Æ¤¤¤ë¾ì¹ç¤Ë¤³¤Î¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤é¡¢¥²¡¼¥È¥¦¥¨¥¤¤Î¹½À®¥Õ¥¡¥¤¥ë¤ò¥Á¥§¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡£] +ja,dsgw,67,[¼±Ê̤µ¤ì¤¿Ì¾Á°¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤¬ÉÔÀµ¤Ç¤¹¡£] +ja,dsgw,68,[¤¢¤Ê¤¿¤¬»î¤ß¤¿¥¨¥ó¥È¥ê¤Ï¡¢¥Ñ¥¹¥ï¡¼¥É¤ò»ÈÍѤ·¤Æ¤¤¤Ê¤¤¤«¡¢¸í¤ê¤¬¤¢¤ê¤Þ¤¹¡£Directory Manager ¤Ç²Ã¤¨¤é¤ì¤¿¥¨¥ó¥È¥ê¤¬Å¬ÀڤʰÀ­¤Ç¤¢¤ë¤«³Îǧ¤·¤Æ¤¯¤À¤µ¤¤¡£ ] +ja,dsgw,69,[ÆþÎϤ·¤¿¥Ñ¥¹¥ï¡¼¥É(¤Þ¤¿¤Ï¤½¤Î¾¤Îǧ¾Ú»ñ³Ê¾ÚÌÀ½ñ)¤ÏÀµ¤·¤¯¤¢¤ê¤Þ¤»¤ó¡£] +ja,dsgw,70,[Áàºî¤ò¼Â¹Ô¤¹¤ë¤¿¤á¤Î¸¢¸Â¤ò»ý¤Ã¤Æ¤¤¤Þ¤»¤ó¡£] +ja,dsgw,71,[¥µ¡¼¥Ð¤¬º®¤ß¹ç¤Ã¤Æ¤¤¤Þ¤¹¡£¿ôʬ¸å¤ËºÆÅÙÀܳ¤ò¹Ô¤Ã¤Æ¤¯¤À¤µ¤¤¡£] +ja,dsgw,72,[LDAP ¥µ¡¼¥Ð¤ËÀܳ¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£] +ja,dsgw,73,[¥µ¡¼¥Ð¤Ï¤¢¤Ê¤¿¤Î¥ê¥¯¥¨¥¹¥È¤ò½èÍý¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£\n ¥µ¡¼¥Ð¤ËÂ礭¤ÊÉé²Ù¤¬¤«¤«¤Ã¤Æ¤¤¤ë¤«¡¢¥µ¡¼¥Ð¤¬¤¢¤Ê¤¿¤Î¥ê¥¯¥¨¥¹¥È¤ò \n ½èÍý¤¹¤ë¤è¤¦¤ËÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤¬¹Í¤¨¤é¤ì¤Þ¤¹¡£] +ja,dsgw,74,[Directory ¥µ¡¼¥Ð¤Ï¤¢¤Ê¤¿¤Î¥ê¥¯¥¨¥¹¥È¤ò½èÍý¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£\n ¥ê¥¯¥¨¥¹¥È¤ÎÆâÍÆ¤¬Àµ¤·¤¯¤Ê¤¤¤«¡¢¥µ¡¼¥Ð¤¬¹¹¿·½èÍý¤ò¹Ô¤Ã¤Æ¤¤¤ë \n ºÇÃæ¤Ç¤¢¤ë²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹¡£] +ja,dsgw,75,[Directory ¥µ¡¼¥Ð¤Ï»ØÄꤷ¤¿¥¨¥ó¥È¥ê¤Ë»Ò¤¬¤¤¤ë¾ì¹ç¡¢\n ¥¨¥ó¥È¥ê¤Îºï½ü¡¦Ì¾Á°¤ÎÊѹ¹¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£¤³¤ÎÁàºî¤ò¹Ô¤¦¤Ë¤Ï¡¢\n Áàºî¤ÎÁ°¤Ë»Ò¤Î¥¨¥ó¥È¥ê¤òÁ´¤Æºï½ü¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£] +ja,dsgw,76,[¥µ¡¼¥Ð¤Ë¿·¤·¤¤¥¨¥ó¥È¥ê¤òÄɲá¦Ì¾Á°¤ÎÊѹ¹¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£\n ´û¤ËƱ¤¸Ì¾Á°¤Î¥¨¥ó¥È¥ê¤¬Â¸ºß¤·¤Æ¤¤¤Þ¤¹¡£] +ja,dsgw,77,[¤¢¤Ê¤¿¤Î¥ê¥¯¥¨¥¹¥È¤ÏÊ£¿ô¤Î Directory ¥µ¡¼¥Ð¤ËÈ¿±Ç¤µ¤ì¤Þ¤¹¡£] +ja,dsgw,78,[Directory ¥µ¡¼¥Ð¤ËÀܳ¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£\n ¥µ¡¼¥Ð´ÉÍý¼Ô¤Ë¤´ÁêÃ̤¯¤À¤µ¤¤¡£] +ja,dsgw,79,[¥µ¡¼¥Ð¤Ë¥Ç¡¼¥¿¤òÁ÷¿®Ãæ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿¡£] +ja,dsgw,80,[¥µ¡¼¥Ð¤«¤é¥Ç¡¼¥¿¤òÆÉ¤ß¹þ¤ßÃæ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿¡£] +ja,dsgw,81,[¥µ¡¼¥Ð¤«¤é¤Î±þÅú¤¬¤¢¤ê¤Þ¤»¤ó¡£¥¿¥¤¥à¥¢¥¦¥È¤·¤Þ¤·¤¿¡£] +ja,dsgw,82,[¥µ¡¼¥Ð¤Ï¥²¡¼¥È¥¦¥¨¥¤¤¬»ÈÍѤ¹¤ëǧ¾ÚÊýË¡¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Þ¤»¤ó¡£] +ja,dsgw,83,[¸¡º÷¥Õ¥£¥ë¥¿¤ò¹½À®Ãæ¤Ë¥²¡¼¥È¥¦¥¨¥¤¤Ç¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿¡£] +ja,dsgw,84,[Áàºî¤Ï¥ê¥¯¥¨¥¹¥È¤Ë¤è¤ê¥­¥ã¥ó¥»¥ë¤µ¤ì¤Þ¤·¤¿¡£] +ja,dsgw,85,[¥é¥¤¥Ö¥é¥ê¤ÇÆâÉô¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿¡£¥Ñ¥é¥á¡¼¥¿¤ËÉÔÀµ¤¬¤¢¤ê¤Þ¤¹¡£] +ja,dsgw,86,[¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤ò³«¤±¤é¤ì¤Þ¤»¤ó¤Ç¤·¤¿¡£¥µ¡¼¥Ð´ÉÍý¼Ô¤Ë¤´ÁêÃ̤¯¤À¤µ¤¤¡£] +ja,dsgw,87,[̤ÃΤΥ¨¥é¡¼¤ËÁø¶ø¤·¤Þ¤·¤¿¡£] +ja,dsgw,88,[¥¨¥ó¥È¥ê¤Ï´û¤Ë¸ºß¤·¤Þ¤¹¡£] +ja,dsgw,89,[¥¨¥ó¥È¥ê̾ ] +ja,dsgw,90,[onMouseOver="window.status='¥¨¥ó¥È¥ê¤ò»²¾È¤¹¤ë¤Ë¤Ï¥¯¥ê¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡£'; return true"] +ja,dsgw,91,[ ´û¤Ë¸ºß¤·¤Þ¤¹¡£

                      Ê̤Î̾Á°¡¦¾ì½ê¤òÁªÂò¤·¤Æ¤¯¤À¤µ¤¤¡£\n

                      \n] +ja,dsgw,92,[¿Æ¥¨¥ó¥È¥ê¤Ï¸ºß¤·¤Þ¤»¤ó¡£] +ja,dsgw,93,[¼¡¤Î̾Á°¤Î¥¨¥ó¥È¥ê¤ÎÄɲ䬤Ǥ­¤Þ¤»¤ó¡§

                      %s,

                      \n ¿Æ¥¨¥ó¥È¥ê¤¬Â¸ºß¤·¤Þ¤»¤ó¡£

                      \n ¿Æ¥¨¥ó¥È¥ê¤òºÇ½é¤ËÅÐÏ¿¤·¤Æ¤¯¤À¤µ¤¤¡£\n] +ja,dsgw,94,[¤³¤ì¤Î¿Æ\n] +ja,dsgw,95,[¥¨¥ó¥È¥ê̾¡§

                      %s.\n] +ja,dsgw,96,[·Ù¹ð¡§ ǧ¾Ú¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£ (¼¡¤Ø)...\n] +ja,dsgw,97,[%s Directory ¥¨¥ó¥È¥ê] +ja,dsgw,98,[

                      ¥¨¥ó¥È¥ê DN: %s

                      \n] +ja,dsgw,99,[%s ¤ËÊѹ¹¤·Êݸ¤·¤Þ¤·¤¿¡£] +ja,dsgw,100,[%s ¤òÄɲä·¤Þ¤·¤¿¡£] +ja,dsgw,101,[%s ¤òºï½ü¤·¤Þ¤·¤¿¡£] +ja,dsgw,102,[%s ¤«¤é %s ¤ØÌ¾Á°¤òÊѹ¹¤·¤Þ¤·¤¿¡£] +ja,dsgw,103,[

                      ¥Î¡¼¥È¡§ ¤¢¤Ê¤¿¤Î %s ¥¨¥ó¥È¥ê¤ÏÇË´þ¤µ¤ì¤Þ¤·¤¿¡£\n ¤¢¤Ê¤¿¤ÏºÆÅÙǧ¾Ú¤ò¼õ¤±Êѹ¹¤òÄɲ乤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£\n] +ja,dsgw,104,[ºï½ü] +ja,dsgw,105,[̾Á°¤ÎÊѹ¹] +ja,dsgw,106,[¥Ñ¥¹¥ï¡¼¥ÉÊѹ¹] +ja,dsgw,107,[°À­ %s ¤òÊѹ¹¤·¤Þ¤·¤¿¡£
                      \n] +ja,dsgw,108,[ ¥¢¥¹¥­¡¼¤Ç¤Ï¤Ê¤¤ (%ld ¥Ð¥¤¥È)\n] +ja,dsgw,109,[Ãͤ¬»ØÄꤵ¤ì¤Æ¤¤¤Þ¤»¤ó¡£ ¤â¤¦°ìÅÙÆþÎϤ·¤Æ¤¯¤À¤µ¤¤¡£\n] +ja,dsgw,110,[Êѹ¹¤Ï¤¢¤ê¤Þ¤»¤ó¡£\n] +ja,dsgw,111,[

                      %s ¤ò Directory ¥µ¡¼¥Ð¤ËÁ÷¿®¤·¤Þ¤·¤¿¡£\n] +ja,dsgw,112,[¾ðÊó] +ja,dsgw,113,[Êѹ¹] +ja,dsgw,114,[

                      ±ß¼è¤ë¤ÎÄɲäËÀ®¸ù¤·¤Þ¤·¤¿¡£\n] +ja,dsgw,115,[

                      ¥¨¥ó¥È¥ê¤Î½¤Àµ¤ËÀ®¸ù¤·¤Þ¤·¤¿¡£Êѹ¹¤ÏÊݸ¤µ¤ì¤Þ¤·¤¿¡£\n] +ja,dsgw,116,[

                      ¥¨¥ó¥È¥ê¤Îºï½ü¤ÏÀ®¸ù¤·¤Þ¤·¤¿¡£\n] +ja,dsgw,117,[

                      ¿·¤·¤¤¥¨¥ó¥È¥ê¤Î̾Á°¤Ï¡¢¼¡¤Î¤È¤ª¤ê¤Ç¤¹¡§ %s\n

                      \n] +ja,dsgw,118,[

                      ̾Á°¤ÎÊѹ¹¤ËÀ®¸ù¤·¤Þ¤·¤¿¡£\n] +ja,dsgw,119,[°ÊÁ°¤Î¥Ñ¥¹¥ï¡¼¥É¤òÍѰդ·¤Æ¤¯¤À¤µ¤¤¡£] +ja,dsgw,120,[¿·¤·¤¤¥Ñ¥¹¥ï¡¼¥É¤ÎÆþÎϤ¬É¬ÍפǤ¹¡£¤â¤¦°ìÅٹԤäƤ¯¤À¤µ¤¤¡£] +ja,dsgw,121,[¿·¤·¤¤¥Ñ¥¹¥ï¡¼¥É¤È¡¢³Îǧ¤Î¤¿¤á¤ËÆþÎϤ·¤¿¥Ñ¥¹¥ï¡¼¥É¤¬°Û¤Ê¤ê¤Þ¤¹¡£¤â¤¦°ìÅÙÆþÎϤ·¤Æ¤¯¤À¤µ¤¤¡£] +ja,dsgw,122,[
                      %s %s ¤Ï»ÈÍÑÃæ¤Ç¤¹¡£Ê̤λØÄê¤ò¹Ô¤Ã¤Æ¤¯¤À¤µ¤¤¡£
                      \n] +ja,dsgw,123,[¥Ç¡¼¥¿ ¥¨¥ì¥á¥ó¥È "%.100s" ¤¬ÉÔ­¤·¤Æ¤¤¤Þ¤¹¡£] +ja,dsgw,124,[ÀßÄê¾ðÊó¤ò½é´ü²½¤·¤Æ¤¤¤Þ¤¹¡£] +ja,dsgw,125,[¥Õ¥¡¥¤¥ë¤ò³«¤¯¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£] +ja,dsgw,126,[dbconf ¥Õ¥¡¥¤¥ë¤Î·Á¼°¤¬ÉÔÀµ¤Ç¤¹¡£] +ja,dsgw,127,[dbconf ¤ÎÃæ¤Î°À­Ì¾¾Î¤Î»ØÄ꤬ÉÔ­¤·¤Æ¤¤¤Þ¤¹¡£] +ja,dsgw,128,[¥á¥â¥êÉÔ­¤Ç¤¹¡£] +ja,dsgw,129,[dbconf ¥Õ¥¡¥¤¥ë¤ÎÃæ¤Î»ØÎá¤Î»ØÄ꤬ÉÔ­¤·¤Æ¤¤¤Þ¤¹¡£] +ja,dsgw,130,[¹½À®¥Õ¥¡¥¤¥ë"%s"¤ò³«¤±¤é¤ì¤Þ¤»¤ó\n] +ja,dsgw,131,["authlifetime" ¤Î»ØÄ꤬¸«¤Ä¤«¤ê¤Þ¤»¤ó¡£\n] +ja,dsgw,132,["dirmgr" ¤Î»ØÄ꤬¸«¤Ä¤«¤ê¤Þ¤»¤ó¡£\n] +ja,dsgw,133,["baseurl" ¤Î»ØÄ꤬¸«¤Ä¤«¤ê¤Þ¤»¤ó¡£\n] +ja,dsgw,134,["baseurl" ¤ÎÃæ¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë URL ¤¬ÉÔÀµ¤Ç¤¹¡£ - DN ¤¬ÉÔ­¤·¤Æ¤¤¤Þ¤¹¡£\n] +ja,dsgw,135,[baseurl ¤ò¥Ñ¡¼¥¹¤·¤Æ¤¤¤Þ¤¹¡£] +ja,dsgw,136,["baseurl" ¤ÎÃæ¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë URL ¤¬ÉÔÀµ¤Ç¤¹¡£ - "ldap://" URL ¤Î»ØÄê¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£\n] +ja,dsgw,137,["ldaps://" ¤Î URL »ØÄêÊýË¡¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£\n] +ja,dsgw,138,["template" ¤Î»ØÄ꤬¸«¤Ä¤«¤ê¤Þ¤»¤ó¡£\n] +ja,dsgw,139,["sslrequired" ¤Î»ØÄ꤬¸«¤Ä¤«¤ê¤Þ¤»¤ó¡£\n] +ja,dsgw,140,[Íý²ò¤Ç¤­¤Ê¤¤Ãͤ¬ "sslrequired" ¤Ë¤¢¤ê¤Þ¤¹¡£("never", "whenauthenticated", "always" ¤ò»ØÄꤷ¤Æ¤¯¤À¤µ¤¤¡£)\n] +ja,dsgw,141,["securitypath" ¤Î»ØÄ꤬¸«¤Ä¤«¤ê¤Þ¤»¤ó¡£\n] +ja,dsgw,142,["location-suffix" ¤Î»ØÄ꤬¸«¤Ä¤«¤ê¤Þ¤»¤ó¡£\n] +ja,dsgw,143,["location" ¤Î»ØÄ꤬ɬÍפǤ¹¡£\n] +ja,dsgw,144,["newtype" ¤Î»ØÄê¤Ë¤Ï£²¤Ä¤ÎÃͤò»ØÄꤷ¤Æ¤¯¤À¤µ¤¤¡£\n] +ja,dsgw,145,["newtype" ¤Î¾ì½ê¤¬ÉÔÌÀ¤Ç¤¹¡£\n] +ja,dsgw,146,[£³¤Ä¤Þ¤¿¤Ï£´¤Ä¤Î»ØÄ꤬ "tmplset" ¤Ë¤ÏɬÍפǤ¹¡£\n] +ja,dsgw,147,["attrvset" ¤Ë¤Ï£´¤Ä¤Î»ØÄ꤬ɬÍפǤ¹¡£\n] +ja,dsgw,148,["charset" ¤Î»ØÄê¤ò¸«¤Ä¤±¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£\n] +ja,dsgw,149,["ClientLanguage" ¤Î»ØÄê¤ò¸«¤Ä¤±¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£\n] +ja,dsgw,150,["AdminLanguage" ¤Î»ØÄê¤ò¸«¤Ä¤±¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£\n] +ja,dsgw,151,["DefaultLanguage"¤Î»ØÄê¤ò¸«¤Ä¤±¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£\n] +ja,dsgw,152,["include" ¤ËÂбþ¤¹¤ë¥Õ¥¡¥¤¥ë̾¤¬»ØÄꤵ¤ì¤Æ¤¤¤Þ¤»¤ó\n] +ja,dsgw,153,[ÀßÄê¥Õ¥¡¥¤¥ë¤Ë̤ÃΤÎÌ¿Î᤬¤¢¤ê¤Þ¤¹\n] +ja,dsgw,154,[<= erase_db lcache.conf ¥Õ¥¡¥¤¥ë¤ò³«¤¯¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£"%s"\n] +ja,dsgw,155,[\n

                      ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ïºï½ü¤µ¤ì¤Æ¤¤¤Þ¤¹¡£ ¿·¤·¤¤¥Ç¡¼¥¿¥Ù¡¼¥¹¤òºîÀ®¤·¤Þ¤¹... \n\n ] +ja,dsgw,156,[\n

                      ¥Ç¡¼¥¿¥Ù¡¼¥¹¤òºï½ü¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£\n\n ] +ja,dsgw,157,[<= app_suffix ldif ¥Õ¥¡¥¤¥ë¤ò³«¤¯¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£ "%s"\n] +ja,dsgw,158,[<= app_suffix °ì»þ¥Õ¥¡¥¤¥ë¤ò³«¤¯¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£ "%s"\n] +ja,dsgw,159,[%s ¤«¤é %s ¤ØÌ¾Á°¤ÎÊѹ¹¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£] +ja,dsgw,160,[¥Ì¥ë ¥Ý¥¤¥ó¥¿¤¬ dbconf_read_default_dbinfo() ¤«¤éÊÖ¤µ¤ì¤Þ¤·¤¿¡£] +ja,dsgw,161,["ldapdb" URL ¤¬ÉÔÀµ¤Ç¤¹¡£- ¥Ù¡¼¥¹ DN ¤¬·çÍ¤Æ¤¤¤Þ¤¹¡£\n] +ja,dsgw,162,["ldapdb" URL ¤¬ÉÔÀµ¤Ç¤¹¡£\n] +ja,dsgw,163,["baseurl" ¤Çµ­½Ò¤µ¤ì¤¿ URL ¤¬ÉÔÀµ¤Ç¤¹¡£ - ¥Ù¡¼¥¹ DN ¤¬·çÍ¤Æ¤¤¤Þ¤¹¡£\n] +ja,dsgw,164,[baseurl ¤ò¥Ñ¡¼¥¹¤·¤Æ¤¤¤Þ¤¹¡£] +ja,dsgw,165,["baseurl" ¤Çµ­½Ò¤µ¤ì¤¿ URL ¤¬ÉÔÀµ¤Ç¤¹¡£ - "ldap:// ¤Þ¤¿¤Ï ldapdb://" ¤Î URL ¤Ç»ØÄꤷ¤Æ¤¯¤À¤µ¤¤¡£\n] +ja,dsgw,166,["ldaps://" ¤Î URL »ØÄêÊýË¡¤Ï¡¢¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£\n] +ja,dsgw,167,[binddn ¤ÏÃͤò»ý¤Ã¤Æ¤¤¤Þ¤»¤ó¡£] +ja,dsgw,168,[bindpw ¤ÏÃͤò»ý¤Ã¤Æ¤¤¤Þ¤»¤ó¡£] +ja,dsgw,169,[¥Ç¥Õ¥©¥ë¥È Directory ¥µ¡¼¥Ó¥¹¤Ç dbswitch.conf ¥Õ¥¡¥¤¥ë¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£] +ja,dsgw,170,[½ñ¹þ¤ß¤Î¤¿¤á¤Ë¹½À®¥Õ¥¡¥¤¥ë"%s" ¤ò³«¤±¤é¤ì¤Þ¤»¤ó\n] +ja,dsgw,171,[%s ¤«¤é %s ¤ØÌ¾Á°¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£] +ja,dsgw,172,[ÀßÄê¥Õ¥¡¥¤¥ë %s: ] +ja,dsgw,173,[ÀßÄê¥Õ¥¡¥¤¥ë %s: %d ¹Ô¡§ ] +ja,dsgw,174,[ºÇÂç %d] +ja,dsgw,175,[ OK ] +ja,dsgw,176,[¥¦¥¤¥ó¥É¥¦¤òÊĤ¸¤ë] +ja,dsgw,177,[Á°¤Ø] +ja,dsgw,178,[{crypt}¥í¥Ã¥¯Ãæ [%s GMT]] +ja,dsgw,179,[¥á¥¤¥ó¤Ø] +ja,dsgw,181,[ Help ] +ja,dsgw,182,[Help] +ja,dsgw,184,[Help ¤Ï»ÈÍѤǤ­¤Þ¤»¤ó¡£] +ja,dsgw,186,[¥¦¥¤¥ó¥É¥¦¤òÊĤ¸¤ë] +ja,dsgw,187,[¥¦¥¤¥ó¥É¥¦¤òÊĤ¸¤ë] +ja,dsgw,188,[¥Æ¥ó¥×¥ì¡¼¥È¤¬¸«¤Ä¤«¤ê¤Þ¤»¤ó¡£] +ja,dsgw,189,[ǧ¾ÚÃæ ...] +ja,dsgw,190,[ǧ¾Ú¤ò¼è¤ê¾Ã¤·¤Þ¤¹¤« (Log out)¡©] +ja,dsgw,191,[¸¡º÷ʸ»úÎó¤òÆþÎϤ·¤Æ¤¯¤À¤µ¤¤] +ja,dsgw,192,[ǧ¾Ú¤ÎºÇ½é¤Î¥¹¥Æ¥Ã¥×¤Ï¡¢Directory ¤Ë ID ¤òÆþÎϤ¹¤ë¤³¤È¤Ç¤¹¡£\n
                      ̾Á°¤òÆþÎϤ·¤Æ¤¯¤À¤µ¤¤¡§] +ja,dsgw,193,[¼¡¤Ø] +ja,dsgw,194,[¼¡¤Ø] +ja,dsgw,195,[¥­¥ã¥ó¥»¥ë] +ja,dsgw,196,[Directory Manager ¤È¤·¤ÆÇ§¾Ú">  (Directory Administrator ¤Î¤ßÍøÍѲÄǽ)\n] +ja,dsgw,197,[ǧ¾Ú ...] +ja,dsgw,198,[ǧ¾Ú¤ò¼è¤ê¾Ã¤·¤Þ¤¹¤«¡©] +ja,dsgw,200,[¼¡¤Ø] +ja,dsgw,201,[¼¡¤Ø] +ja,dsgw,202,[¥­¥ã¥ó¥»¥ë] +ja,dsgw,203,[Directory ¤Çǧ¾Ú (Log in)] +ja,dsgw,204,[%s¤È¤·¤Æ Directory ¤Ëǧ¾Ú¤·¤è¤¦¤È¤·¤Æ¤¤¤Þ¤¹¡£Ç§¾Ú²áÄø¤ò´°Î»¤¹¤ë¤Ë¤Ï¡¢¥Ñ¥¹¥ï¡¼¥É¤ò¥¿¥¤¥×¤·¤Æ¤¯¤À¤µ¤¤¡£\n] +ja,dsgw,206,[¸å¤Ç Directory ¤Î¤¢¤Ê¤¿¤Î¥¨¥ó¥È¥ê¤ÎÄɲá¦Êѹ¹¤ò¹Ô¤¦¤Ë¤Ï¡¢\nDirectory ¤Ëǧ¾Ú(Log in)¤·¤¿¸å¡¢¥¬¥¤¥É¤ò¥¦¥¤¥ó¥É¥¦¤Ë \n ɽ¼¨¤µ¤»¡¢¤½¤ì¤ò»²¾È¤·¤Ê¤¬¤éºî¶È¤ò¹Ô¤Ã¤Æ¤¯¤À¤µ¤¤¡£\n] +ja,dsgw,207,[¤³¤Î¥¹¥¯¥ê¡¼¥ó¾å¤Ç Directory ¤Ëǧ¾Ú(Log in)¤·¤Æ\n¤¤¤ëºÝ¤Ë¤Ï¡¢´û¤ËÄɲá¦Êѹ¹¤Îºî¶È¤ò¹Ô¤¦¤³¤È¤¬²Äǽ¤Ç¤¹¡£¤Þ¤Àǧ¾Ú\n(Log in)¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï¤½¤ì¤ò¹Ô¤Ã¤¿¤¢¤Èºî¶È¤ò¹Ô¤Ã¤Æ¤¯¤À¤µ¤¤¡£\n] +ja,dsgw,208,[ǧ¾Ú¥¹¥Æ¡¼¥¿¥¹] +ja,dsgw,209,[\n¤¢¤Ê¤¿¤Ï¸½ºß Directory ¤Ëǧ¾Ú¤µ¤ì¤Æ¤¤¤Þ¤¹¡£] +ja,dsgw,210,[.\n¤â¤·¤¢¤Ê¤¿¤¬ Directory ¤Îǧ¾Ú¤ò¼è¤ê¾Ã¤¹(Log out)¤Î¤Ç¤¢¤ì¤Ð¥Ü¥¿¥ó¤ò²¡¤·¤Æ¤¯¤À¤µ¤¤¡£] +ja,dsgw,211,[ǧ¾Ú¤Î¼è¤ê¾Ã¤·(Log out)] +ja,dsgw,212,[¤¢¤Ê¤¿¤¬ÇË´þ¤¹¤ëǧ¾Ú] +ja,dsgw,213,[Í­¸ú´ü¸Â¤ÏÀÚ¤ì¤Þ¤·¤¿¡£\n


                      \n] +ja,dsgw,214,[¸½ºß¤¢¤Ê¤¿¤Ï¡¢Directory ¤Ëǧ¾Ú¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£
                      \n] +ja,dsgw,215,["%s=" ¤¬ÉÔ­¤·¤Æ¤¤¤Þ¤¹¡£] +ja,dsgw,216,["%s=%s" ¤¬ÉÔÌÀ¤Ç¤¹¡£] +ja,dsgw,217,[%s ¥ª¥×¥·¥ç¥ó¤¬ÉÔÌÀ¤Ç¤¹¡£] +ja,dsgw,218,[%s ¤Î½ñ¼°¤¬ÉÔÌÀ¤Ç¤¹¡£\n] +ja,dsgw,219,[** HTML ¥¿¥¤¥× "%s" ¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£ **
                      \n] +ja,dsgw,224,[½¤Àµ] +ja,dsgw,225,[Êѹ¹ÊÝ´É] +ja,dsgw,226,[Êѹ¹] +ja,dsgw,227,[ÄɲÃ] +ja,dsgw,228,[ºï½ü] +ja,dsgw,229,[¥¨¥ó¥È¥ê¤òºï½ü¤·¤Æ¤è¤í¤·¤¤¤Ç¤¹¤«¡©] +ja,dsgw,230,[̾Á°¤ÎÊѹ¹] +ja,dsgw,231,[¥¨¥ó¥È¥ê¤Î¿·¤·¤¤Ì¾Á°¤òÆþÎϤ·¤Æ¤¯¤À¤µ¤¤¡§] +ja,dsgw,232,[½¤Àµ] +ja,dsgw,233,[%s= ¤¬ÉÔ­¤·¤Æ¤¤¤Þ¤¹¡£] +ja,dsgw,234,[¥¦¥¤¥ó¥É¥¦¤òÊĤ¸¤ë¡£] +ja,dsgw,235,[½¤Àµ ...] +ja,dsgw,236,["%s=" ÉÔ­¤·¤Æ¤¤¤Þ¤¹¡£\n] +ja,dsgw,237,["%s" ¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£\n] +ja,dsgw,238,["%s" ¤Î½ñ¼°¤¬ÉÔÌÀ¤Ç¤¹¡£\n] +ja,dsgw,239,[ºÆÇ§¾Ú] +ja,dsgw,240,[¥¦¥¤¥ó¥É¥¦¤òÊĤ¸¤ë] +ja,dsgw,241,[¤è¤í¤·¤¤¤Ç¤¹¤«¡©] +ja,dsgw,242,[width=400,height=130,resizable] +ja,dsgw,243,[ OK ] +ja,dsgw,244,[ OK ] +ja,dsgw,245,[ ¥ê¥»¥Ã¥È ] +ja,dsgw,246,[ ½ªÎ» ] +ja,dsgw,247,[ ¥­¥ã¥ó¥»¥ë ] +ja,dsgw,248,[Ê̤ΠIF ¤òȯ¸«(Æþ¤ì»Ò¤Î IF ¤Ï¥µ¥Ý¡¼¥È¤µ¤ìÄê¤Þ¤»¤ó)] +ja,dsgw,249,[ELESE ¤ò¸«¤Ä¤±¤Þ¤·¤¿¤¬¡¢IF ¤¬¸«¤Ä¤«¤ê¤Þ¤»¤ó¡£] +ja,dsgw,250,[ELSE ¤ò¸«¤Ä¤±¤Þ¤·¤¿¤¬¡¢¸å¤Î ELSE ¤¬¸«¤Ä¤«¤ê¤Þ¤»¤ó¡£(¤â¤·¤¯¤Ï ENDIF)] +ja,dsgw,251,[ELIF ¤ò¸«¤Ä¤±¤Þ¤·¤¿¤¬ IF ¤ò¸«¤Ä¤±¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£] +ja,dsgw,252,[ELIF ¤ò¸«¤Ä¤±¤Þ¤·¤¿¤¬¡¢¸å¤Î ELSE ¤¬¸«¤Ä¤«¤ê¤Þ¤»¤ó¡£(¤â¤·¤¯¤Ï ENDIF)] +ja,dsgw,253,[ENDIF ¤ò¸«¤Ä¤±¤Þ¤·¤¿¤¬ IF ¤¬¸«¤Ä¤«¤ê¤Þ¤»¤ó¡£] +ja,dsgw,254,[
                      ¥Æ¥ó¥×¥ì¡¼¥È ¥¨¥é¡¼¡§ %s
                      \n] +ja,dsgw,255,[ldap_init/lcache_init ¤¬ÀßÄê¥Õ¥¡¥¤¥ë¤òÆÉ¤ß¹þ¤àÁ°¤Ë¼Â¹Ô¤µ¤ì¤Þ¤·¤¿¡£] +ja,dsgw,256,[¥¢¥É¥ß¥Ë¥¹¥È¥ì¡¼¥·¥ç¥ó ¥µ¡¼¥Ð¤Ï¼Â¹ÔÃæ¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£] +ja,dsgw,257,[¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤ò½é´ü²½¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£] +ja,dsgw,258,[DN ¤Ë¥æ¡¼¥¶Ì¾¤¬¥Þ¥Ã¥×¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£(¥¢¥É¥ß¥ó ¥µ¡¼¥Ð¤Î¥¨¥é¡¼¤Ç¤¹¡£)] +ja,dsgw,259,[¸½ºß¤Î¥æ¡¼¥¶Ì¾¤òÆÀ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£] +ja,dsgw,260,[¸½ºß¤Î¥æ¡¼¥¶¥Ñ¥¹¥ï¡¼¥É¤òÆÀ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£] +ja,dsgw,261,[¥¨¥é¡¼¡§ %s] +ja,dsgw,262,[¥Î¡¼¥È¡§ ¥Ç¥£¥¹¥×¥ì¥¤ ¥Æ¥ó¥×¥ì¡¼¥È¤Ï¸ºß¤·¤Þ¤»¤ó¡£¥Ç¥Õ¥©¥ë¥ÈÃͤò»ÈÍѤ·¤Þ¤¹¡£] +ja,dsgw,263,[¥æ¡¼¥¶ ID ¤¬ÉÔÀµ¤â¤·¤¯¤Ï LDAP ¤¬ NULL ¤òÊÖ¤·¤Þ¤·¤¿¡£] +ja,dsgw,264,[¥æ¡¼¥¶ ID ¤Ë¥Þ¥Ã¥Á¤¹¤ë¤â¤Î¤¬¤¢¤ê¤Þ¤»¤ó¡£] +ja,dsgw,265,[¥æ¡¼¥¶ ID ¤¬£±¤Ä°Ê¾å³ºÅö¤·¤Þ¤¹¡£] +ja,dsgw,266,[the entire directory] +ja,dsgw,267,["includeset" ¤Ë¤Ï£²¤Ä¤ÎÃͤ¬É¬ÍפǤ¹¡£\n] +ja,dsgw,268,[¥¨¥ó¥È¥ê¤Ë¤ÏÍ׵ᤵ¤ì¤¿Â°À­Ãͤ¬¸«¤Ä¤«¤ê¤Þ¤»¤ó¤Ç¤·¤¿] +ja,dsgw,269,["NLS" »Ø¿Ë¤Î°ú¿ô¤¬·ç¤±¤Æ¤¤¤Þ¤¹\n] +ja,dsgw,270,[NT¥æ¡¼¥¶ID¤ÎÃͤò»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹\n] +ja,dsgw,271,[»Ø¿ËÆâ¤ÎNT¥æ¡¼¥¶ID¤ÈNT¥É¥á¥¤¥óID¤ÎÁȹç¤ï¤»¤Ï¸ÇÍ­¤Î¤â¤Î¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó\n] +ja,dsgw,272,[NT¥æ¡¼¥¶ID¤ÈNT¥É¥á¥¤¥óID¤ÎξÊý¤ÎÃͤò»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹\n] +ja,dsgw,273,[NT¥æ¡¼¥¶IDÃͤÎŤµ¤Ï20ʸ»ú¤òĶ²á¤·¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£\n] +ja,dsgw,274,[¿·µ¬¥¨¥ó¥È¥ê¤Î̾Á°¤òÆþÎϤ·¤Æ¤¯¤À¤µ¤¤¡£] +ja,dsgw,275,[¿·µ¬¥¨¥ó¥È¥ê¤Î¾ì½ê¤òÁªÂò¤·¤Æ¤¯¤À¤µ¤¤¡£] +ja,dsgw,276,[¿·µ¬¥¨¥ó¥È¥ê] +ja,dsgw,277,[¤³¤Îµ¡Ç½¤ò»ÈÍѤ¹¤ë¤Ë¤Ï¡¢dsgw.conf¤ÇÄêµÁ¤µ¤ì¤¿dirmgr¤¬¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó] +ja,dsgw,278,["vcard-property"¤Î»Ø¿Ë¤Ë¤Ï3¤Þ¤¿¤Ï4¤Ä¤Î°ú¿ô¤¬É¬ÍפǤ¹\n] +ja,dsgw,279,[Vcard¥×¥í¥Ñ¥Æ¥£¹½Ê¸¤Ï"cis" ¤Þ¤¿¤Ï "mls"¤Ç¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó\n] +ja,dsgw,280,[¥¨¥ó¥È¥ê¤¬¸¡º÷¤µ¤ì¤Þ¤»¤ó¤Ç¤·¤¿\n%2$s] +ja,dsgw,281,['%4$s'¤¬%2$s%3$s¡¢¥¨¥ó¥È¥ê¤Ï¸¡º÷¤µ¤ì¤Þ¤»¤ó¤Ç¤·¤¿\n] +ja,dsgw,282,[¥¨¥ó¥È¥ê¤Ï¸¡º÷¤µ¤ì¤Þ¤»¤ó¤Ç¤·¤¿\n%2$s] +ja,dsgw,283,['%4$s'¤¬%2$s%3$s¡¢¥¨¥ó¥È¥ê¤Ï¸¡º÷¤µ¤ì¤Þ¤»¤ó¤Ç¤·¤¿\n] +ja,dsgw,284,[1¸Ä¤Î¥¨¥ó¥È¥ê¤¬¸¡º÷¤µ¤ì¤Þ¤·¤¿\n%2$s] +ja,dsgw,285,['%4$s'¤¬%2$s%3$s¡¢1¸Ä¤Î¥¨¥ó¥È¥ê¤¬¸¡º÷¤µ¤ì¤Þ¤·¤¿\n] +ja,dsgw,286,[1¸Ä¤Î¥¨¥ó¥È¥ê¤¬¸¡º÷¤µ¤ì¤Þ¤·¤¿\n%2$s] +ja,dsgw,287,[%2$s¤¬'%4$s'%3$s¡¢1¸Ä¤Î¥¨¥ó¥È¥ê¤¬¸¡º÷¤µ¤ì¤Þ¤·¤¿\n] +ja,dsgw,288,[%1$li¸Ä¤Î¥¨¥ó¥È¥ê¤¬¸¡º÷¤µ¤ì¤Þ¤·¤¿\n%2$s] +ja,dsgw,289,['%4$s'¤¬%2$s%3$s¡¢%1$li¸Ä¤Î¥¨¥ó¥È¥ê¤¬¸¡º÷¤µ¤ì¤Þ¤·¤¿\n] +ja,dsgw,290,[%1$li¸Ä¤Î¥¨¥ó¥È¥ê¤¬¸¡º÷¤µ¤ì¤Þ¤·¤¿\n%2$s] +ja,dsgw,291,['%4$s'¤¬%2$s%3$s¡¢%1$li¸Ä¤Î¥¨¥ó¥È¥ê¤¬¸¡º÷¤µ¤ì¤Þ¤·¤¿\n] +ja,dsgw,292,[LDAP¥Õ¥£¥ë¥¿] +ja,dsgw,293,[ǧ¾Ú¤Ë»ÈÍѤ·¤¿¥¨¥ó¥È¥ê¤¬¸«¤Ä¤«¤ê¤Þ¤»¤ó¤Ç¤·¤¿¡£¥¨¥ó¥È¥ê̾¤¬Êѹ¹¤µ¤ì¤¿¤«¡¢ºï½ü¤µ¤ì¤¿²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹¡£¤â¤¦°ìÅÙǧ¾Ú¤ò¹Ô¤Ã¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£] +ja,dsgw,294,[¿·¤·¤¤¥Ñ¥¹¥ï¡¼¥É¤Î¹½Ê¸¤Ï̵¸ú¤Ç¤¹¡£\n] +ja,dsgw,295,[¿·¤·¤¤¥Ñ¥¹¥ï¡¼¥É¤Ï¥Ñ¥¹¥ï¡¼¥ÉÍúÎò¤ÎÃæ¤Ë¤¢¤ê¤Þ¤¹¡£\n] +ja,dsgw,296,[¥Ñ¥¹¥ï¡¼¥ÉºÆÆþÎϤÎÀ©¸Â²ó¿ô¤ò±Û¤¨¤Þ¤·¤¿¡£¥·¥¹¥Æ¥à ¥¢¥É¥ß¥Ë¥¹¥È¥ì¡¼¥¿¤ËÏ¢Íí¤·¤Æ¤¯¤À¤µ¤¤¡£\n] +ja,dsgw,297,[¥Ñ¥¹¥ï¡¼¥ÉºÆÆþÎϤÎÀ©¸Â²ó¿ô¤ò±Û¤¨¤Þ¤·¤¿¡£¤¢¤È¤Ç¤â¤¦°ìÅٹԤäƤ¯¤À¤µ¤¤¡£\n] +ja,dsgw,298,[¤³¤Î¥Ñ¥¹¥ï¡¼¥É¤Ï´ü¸ÂÀÚ¤ì¤Ç¤¹¡£¥·¥¹¥Æ¥à ¥¢¥É¥ß¥Ë¥¹¥È¥ì¡¼¥¿¤ËÏ¢Íí¤·¤Æ¡¢¥Ñ¥¹¥ï¡¼¥É¤ò¥ê¥»¥Ã¥È¤·¤Æ¤¯¤À¤µ¤¤¡£\n] +ja,dsgw,299,[½¤Àµ¤·¤Æ¤¤¤Þ¤¹¡£] +ja,dsgw,300,[Äɲ䷤Ƥ¤¤Þ¤¹¡£] +ja,dsgw,301,[ºï½ü¤·¤Æ¤¤¤Þ¤¹¡£] +ja,dsgw,302,[̾Á°¤òÊѹ¹¤·¤Æ¤¤¤Þ¤¹¡£] +ja,dsgw,303,[¥ê¥¹¥È¤Ë̾Á°¤¬¤¢¤ê¤Þ¤»¤ó¡£] +ja,dsgw,304,[¥ê¥¹¥È¤Ë 1 ¤Ä¤Î̾Á°¤¬¤¢¤ê¤Þ¤¹¡£] +ja,dsgw,305,[¥ê¥¹¥È¤Ë %s¸Ä¤Î̾Á°¤¬¤¢¤ê¤Þ¤¹¡£] +ja,dsgw,306,[¥ê¥¹¥È\\n¤«¤é\\nºï½ü¤·¤Þ¤¹¤«¡© ̾Á°] +ja,dsgw,307,[Êѹ¹¤òÇË´þ¤·¤Þ¤¹¤«¡©] +ja,dsgw,308,[width=300,height=130,resizable] +ja,dsgw,309,[Êѹ¹¤òÊݸ¤»¤º¤Ë³¹Ô¤·¤Þ¤¹¤«¡©
                      Êݸ¤µ¤ì¤Æ¤¤¤Ê¤¤Êѹ¹¤Ï¼º¤ï¤ì¤Þ¤¹¡£] +ja,dsgw,310,[width=400,height=150,resizable] +ja,dsgw,311,[·Ù¹ð] +ja,dsgw,312,[³Îǧ] +ja,dsgw,313,[ǧ¾Ú¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£\n] +ja,dsgw,314,[ǧ¾Ú¤ËÀ®¸ù¤·¤Þ¤·¤¿¡£] +ja,dsgw,315,[¥Ç¥£¥ì¥¯¥È¥ê¤Ë %s ¤È¤·¤ÆÇ§¾Ú¤µ¤ì¤Æ¤¤¤Þ¤¹¡£] +ja,dsgw,316,[¤¢¤Ê¤¿¤Îǧ¾Ú»ñ³Ê¾ÚÌÀ½ñ¤Ï %d ʬ¤Ç¼º¸ú¤·¤Þ¤¹¡£\n] +ja,dsgw,317,[ǧ¾Ú¤Î¼º¸ú¸å¡¢¥Ç¥£¥ì¥¯¥È¥ê¤ËºÆÅÙǧ¾Ú¤ò¼õ¤±¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£\n] +ja,dsgw,318,[

                      ¤³¤Î¥¨¥ó¥È¥ê¤Î¥Ñ¥¹¥ï¡¼¥É¤Ï %s ¤Ç¼º¸ú¤·¤Þ¤¹¡£\n] +ja,dsgw,319,[ǧ¾Ú¤Ë¼ºÇÔ¤·¤¿Íýͳ] +ja,dsgw,320,[¥Ç¥£¥ì¥¯¥È¥ê¤Ë¸ºß¤·¤Ê¤¤¥¨¥ó¥È¥ê¤Îǧ¾Ú¤ò¼õ¤±¤è¤¦¤È¤·¤¿¤¿¤á¡¢Ç§¾Ú¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£\nǧ¾Ú¤¬¼õ¤±¤é¤ì¤ë¤Î¤Ï¡¢´û¸¤Î¥Ç¥£¥ì¥¯¥È¥ê ¥¨¥ó¥È¥ê¤À¤±¤Ç¤¹¡£\n] +ja,dsgw,321,[¥Ñ¥¹¥ï¡¼¥É¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¥¨¥ó¥È¥ê¤Îǧ¾Ú¤ò¼õ¤±¤è¤¦¤È¤·¤¿¤¿¤á¡¢Ç§¾Ú¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£\nǧ¾Ú¤¬¼õ¤±¤é¤ì¤ë¤Î¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê´ÉÍý¼Ô¤Ë¤è¤Ã¤Æ¥Ñ¥¹¥ï¡¼¥É¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¥¨¥ó¥È¥ê¤À¤±¤Ç¤¹¡£\n] +ja,dsgw,322,[ÆþÎϤ·¤¿¥Ñ¥¹¥ï¡¼¥É¤¬Àµ¤·¤¯¤Ê¤¤¤¿¤á¡¢Ç§¾Ú¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£\n[¤â¤¦°ìÅÙ]¤ò¥¯¥ê¥Ã¥¯¤·¤ÆºÆÅ٥ѥ¹¥ï¡¼¥É¤òÆþÎϤ·¤Æ¤¯¤À¤µ¤¤¡£\n¥¨¥ó¥È¥ê¤Î¥Ñ¥¹¥ï¡¼¥É¤ò˺¤ì¤¿¾ì¹ç¤Ï¡¢Directory Administrator¤ËÏ¢Íí¤·¡¢¥Ñ¥¹¥ï¡¼¥É¤òºÆÀßÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£\n] +ja,dsgw,323,[ͽ´ü¤·¤Ê¤¤¥¨¥é¡¼: %s ¤¬È¯À¸¤·¤¿¤¿¤á¡¢Ç§¾Ú¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£\n] +ja,dsgw,324,[ºÆÆþÎÏ] +ja,dsgw,325,[³¹Ô¤¹¤ë¤Ë¤Ï¡¢¾åµ­¤Î¥ê¥¹¥È¤«¤é¥¿¥¹¥¯¤òÁªÂò¤·¤Æ¤¯¤À¤µ¤¤¡£\n] +ja,dsgw,326,[¥Ñ¥¹¥ï¡¼¥É½¤Àµ] +ja,dsgw,327,[

                      %s ¤Î¤¿¤á¤Ë¥Ñ¥¹¥ï¡¼¥É¼º¸ú

                      \n] +ja,dsgw,328,[¥Ç¥£¥ì¥¯¥È¥ê ¥µ¡¼¥Ð¤Î¥Ñ¥¹¥ï¡¼¥É¤¬¼º¸ú¤·¤Þ¤·¤¿¡£] +ja,dsgw,329,[ ¤¹¤°¤Ë¥Ñ¥¹¥ï¡¼¥É¤òÊѹ¹¤·¤Æ¤¯¤À¤µ¤¤¡£\n] +ja,dsgw,330,[¥Ñ¥¹¥ï¡¼¥É¤¬ÆþÎϤµ¤ì¤Æ¤¤¤Þ¤»¤ó¡£Ç§¾Ú¤ò¼õ¤±¤ë¤È¤­¤Ïɬ¤º¥Ñ¥¹¥ï¡¼¥É¤òÆþÎϤ·¡¢¥µ¡¼¥Ð¤ÇËܿͤǤ¢¤ë¤³¤È¤ò¾È¹ç¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£] +ja,dsgw,331,[¥µ¡¼¥Ð¤Ïǧ¾Ú»ñ³Ê¾ÚÌÀ½ñ¤òÀ¸À®¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£Ç§¾Ú¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò³«¤¯¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£] +ja,dsgw,332,[¥µ¡¼¥Ð¤Ïǧ¾Ú»ñ³Ê¾ÚÌÀ½ñ¤òÀ¸À®¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£¥Ç¡¼¥¿¤òǧ¾Ú¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÄɲäǤ­¤Þ¤»¤ó¤Ç¤·¤¿¡£] +ja,dsgw,333,[¼¡¤Ø] +ja,dsgw,334,[¥¦¥£¥ó¥É¥¦¤òÊĤ¸¤ë] +ja,dsgw,335,[À®¸ù] +ja,dsgw,336,[ǧ¾Ú»ñ³Ê¾ÚÌÀ½ñ¤¬Ìµ¸ú¤Ë¤Ê¤ê¤Þ¤·¤¿¡£¸½ºßDirectory¤Ëǧ¾Ú¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£\n] +ja,dsgw,337,[Á°¤Ø] +ja,dsgw,338,[À®¸ù] +ja,dsgw,339,[¥ª¥Ú¥ì¡¼¥·¥ç¥ó ¥¨¥é¡¼] +ja,dsgw,340,[¥×¥í¥È¥³¥ë ¥¨¥é¡¼] +ja,dsgw,341,[·Ù¹ð: ¥¿¥¤¥à¥¢¥¦¥È¤·¤Þ¤·¤¿¡£°ìÃפ¹¤ë¥¨¥ó¥È¥ê¤Î¤¦¤Á¡¢É½¼¨¤µ¤ì¤Æ¤¤¤Ê¤¤¤â¤Î¤â¤¢¤ê¤Þ¤¹¡£] +ja,dsgw,342,[·Ù¹ð: ¥µ¥¤¥º¤Î¾å¸Â¤òͤ¨¤Þ¤·¤¿¡£°ìÃפ¹¤ë¥¨¥ó¥È¥ê¤Î¤¦¤Á¡¢É½¼¨¤µ¤ì¤Æ¤¤¤Ê¤¤¤â¤Î¤â¤¢¤ê¤Þ¤¹¡£] +ja,dsgw,343,[false ¤òÈæ³Ó] +ja,dsgw,344,[true ¤òÈæ³Ó] +ja,dsgw,345,[¸·Ì©¤Êǧ¾Ú¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£] +ja,dsgw,346,[¸·Ì©¤Êǧ¾Ú¤¬É¬ÍפǤ¹¡£] +ja,dsgw,347,[·Ù¹ð: °ìÉô¤Î¥Ç¥£¥ì¥¯¥È¥ê ¥µ¡¼¥Ð¤ËÀܳ¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£°ìÃפ¹¤ë¥¨¥ó¥È¥ê¤Î¤¦¤Á¡¢É½¼¨¤µ¤ì¤Æ¤¤¤Ê¤¤¤â¤Î¤â¤¢¤ê¤Þ¤¹¡£] +ja,dsgw,348,[¥ì¥Õ¥§¥é¥ë¤ò¼õ¿®¤·¤Þ¤·¤¿¡£] +ja,dsgw,349,[´ÉÍý¤ÎÈϰϤòͤ¨¤Æ¤¤¤Þ¤¹¡£] +ja,dsgw,350,[½ÅÂç¤Ê³ÈÄ¥¤¬ÍøÍѤǤ­¤Þ¤»¤ó¡£] +ja,dsgw,351,[µ¡Ì©À­¤¬É¬ÍפǤ¹¡£] +ja,dsgw,352,[SASL ¥Ð¥¤¥ó¥ÉÃæ¤Ç¤¹¡£] +ja,dsgw,353,[¤½¤Î¤è¤¦¤Ê°À­¤Ï¤¢¤ê¤Þ¤»¤ó¡£] +ja,dsgw,354,[°À­¤Î¼ïÎबÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£] +ja,dsgw,355,[¥Þ¥Ã¥Á¥ó¥°¤¬ÉÔŬÀڤǤ¹¡£] +ja,dsgw,356,[À©Ìó°ãÈ¿¤Ç¤¹¡£] +ja,dsgw,357,[¥¿¥¤¥×¤Þ¤¿¤ÏÃͤ¬Â¸ºß¤·¤Þ¤¹¡£] +ja,dsgw,358,[¹½Ê¸¤Ë¸í¤ê¤¬¤¢¤ê¤Þ¤¹¡£] +ja,dsgw,359,[¤½¤Î¤è¤¦¤Ê¥ª¥Ö¥¸¥§¥¯¥È¤Ï¤¢¤ê¤Þ¤»¤ó¡£] +ja,dsgw,360,[¥¨¥¤¥ê¥¢¥¹¤ËÌäÂ꤬¤¢¤ê¤Þ¤¹¡£] +ja,dsgw,361,[DN ¤Î¹½Ê¸¤Ë¸í¤ê¤¬¤¢¤ê¤Þ¤¹¡£] +ja,dsgw,362,[¥ª¥Ö¥¸¥§¥¯¥È¤ÏÍդǤ¹¡£] +ja,dsgw,363,[¥¨¥¤¥ê¥¢¥¹ ¥Ç¥ê¥Õ¥¡¥ì¥ó¥¹¤ËÌäÂ꤬¤¢¤ê¤Þ¤¹¡£] +ja,dsgw,364,[ǧ¾Ú¤¬ÉÔŬÅö¤Ç¤¹¡£] +ja,dsgw,365,[¾ÚÌÀ½ñ¤¬Ìµ¸ú¤Ç¤¹¡£] +ja,dsgw,366,[¥¢¥¯¥»¥¹¤¬ÉÔŬÀڤǤ¹¡£] +ja,dsgw,367,[DSA ¤¬¥Ó¥¸¡¼¾õÂ֤Ǥ¹¡£] +ja,dsgw,368,[DSA ¤¬ÍøÍѤǤ­¤Þ¤»¤ó¡£] +ja,dsgw,369,[DSA ¤¬¼Â¹Ô¤µ¤ì¤Þ¤»¤ó¡£] +ja,dsgw,370,[¥ë¡¼¥×¤¬¸¡½Ð¤µ¤ì¤Þ¤·¤¿¡£] +ja,dsgw,371,[̾Á°ÉÕ¤±°ãÈ¿] +ja,dsgw,372,[¥ª¥Ö¥¸¥§¥¯¥È ¥¯¥é¥¹°ãÈ¿] +ja,dsgw,373,[ÍեΡ¼¥É°Ê³°¤ÇÁàºî¤ò¹Ô¤¦¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£] +ja,dsgw,374,[RDN ¤ÇÁàºî¤ò¹Ô¤¦¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£] +ja,dsgw,375,[´û¤Ë¸ºß¤·¤Æ¤¤¤Þ¤¹¡£] +ja,dsgw,376,[¥ª¥Ö¥¸¥§¥¯¥È ¥¯¥é¥¹¤òÊѹ¹¤Ç¤­¤Þ¤»¤ó¡£] +ja,dsgw,377,[·ë²Ì¤¬Â礭¤¹¤®¤Þ¤¹¡£] +ja,dsgw,378,[Ê£¿ô¤Î¥µ¡¼¥Ð¤Ë±Æ¶Á¤·¤Þ¤¹¡£] +ja,dsgw,379,[¸¶°øÉÔÌÀ¤Î¥¨¥é¡¼] +ja,dsgw,380,[LDAP ¥µ¡¼¥Ð¤ËÀܳ¤Ç¤­¤Þ¤»¤ó¡£] +ja,dsgw,381,[¥í¡¼¥«¥ë ¥¨¥é¡¼] +ja,dsgw,382,[¥¨¥ó¥³¡¼¥É ¥¨¥é¡¼] +ja,dsgw,383,[¥Ç¥³¡¼¥É ¥¨¥é¡¼] +ja,dsgw,384,[¥¿¥¤¥à¥¢¥¦¥È] +ja,dsgw,385,[ǧ¾ÚÊýË¡¤¬ÉÔÌÀ¤Ç¤¹¡£] +ja,dsgw,386,[¸¡º÷¥Õ¥£¥ë¥¿¤¬ÉÔÀµ¤Ç¤¹¡£] +ja,dsgw,387,[¥æ¡¼¥¶¤¬Áàºî¤ò¥­¥ã¥ó¥»¥ë¤·¤Þ¤·¤¿¡£] +ja,dsgw,388,[LDAP ¥ë¡¼¥Á¥ó¤ËÂФ¹¤ë¥Ñ¥é¥á¡¼¥¿¤¬ÉÔÀµ¤Ç¤¹¡£] +ja,dsgw,389,[¥á¥â¥êÉÔ­¤Ç¤¹¡£] +ja,dsgw,390,[LDAP ¥µ¡¼¥Ð¤ËÀܳ¤Ç¤­¤Þ¤»¤ó¡£] +ja,dsgw,391,[¤³¤Î¥Ð¡¼¥¸¥ç¥ó¤Î LDAP ¥×¥í¥È¥³¥ë¤Ç¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£] +ja,dsgw,392,[Í׵ᤵ¤ì¤¿ LDAP ¥³¥ó¥È¥í¡¼¥ë¤¬¸«¤Ä¤«¤ê¤Þ¤»¤ó¡£] +ja,dsgw,393,[·ë²Ì¤¬ÊÖ¤µ¤ì¤Þ¤»¤ó¡£] +ja,dsgw,394,[¤µ¤é¤Ë·ë²Ì¤¬ÊÖ¤µ¤ì¤Þ¤¹¡£] +ja,dsgw,395,[¥¯¥é¥¤¥¢¥ó¥È¤¬¥ë¡¼¥×¤ò¸¡½Ð¤·¤Þ¤·¤¿¡£] +ja,dsgw,396,[¥ì¥Õ¥§¥é¥ë ¥Û¥Ã¥× ¥ê¥ß¥Ã¥È¤òĶ²á¤·¤Þ¤·¤¿¡£] +ja,frame,-1,[$DBT: frame in DB file v1 $] +ja,frame,1,[¸«¤Ä¤«¤ê¤Þ¤»¤ó¡£

                      ¸«¤Ä¤«¤ê¤Þ¤»¤ó¡£

                      ¥ê¥¯¥¨¥¹¥È¤µ¤ì¤¿¥ª¥Ö¥¸¥§¥¯¥È¤ò¸«¤Ä¤±¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£¥ê¥ó¥¯¤¬ÀÚ¤ì¤Æ¤¤¤ë¡¢¥ê¥¯¥¨¥¹¥È¤¬ÉÔÀµ³Î¡¢¥¢¥¯¥»¥¹¸¢¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤Ê¤¤Åù¤Î²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹¡£ ] +ja,frame,2,[»²¾È¤·¤Æ¤¤¤ë¥Ú¡¼¥¸¤Î¾ðÊó¤ò¥µ¥¤¥È´ÉÍý¼Ô¤ËÃΤ餻¤Æ¤¯¤À¤µ¤¤¡£] +ja,frame,3,[¤¢¤Ê¤¿¤Î¥Ö¥é¥¦¥¶¤¬Á÷¤Ã¤¿¥ê¥¯¥¨¥¹¥È¤ò¥×¥í¥¯¥· ¥µ¡¼¥Ð¤¬Íý²ò¤Ç¤­¤Þ¤»¤ó¡£] +ja,frame,4,[ŬÀÚ¤Êǧ¾Ú¤Ï¥×¥í¥¯¥·¤¬´ÉÍý¤Î¤¿¤á¤ËɬÍפǤ¹¡£\n¤¢¤Ê¤¿¤Î¥Ö¥é¥¦¥¶¤Îǧ¾Ú¤Ï¼ºÇÔ¤·¤Þ¤·¤¿¡£] +ja,frame,5,[¥æ¡¼¥¶Ì¾¤Îǧ¾Ú¤Ë¤Ï¥×¥í¥¯¥·¤òÍøÍѤ¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£\n¤¢¤Ê¤¿¤Î¥Ö¥é¥¦¥¶¤Ï¥×¥í¥¯¥·¤Ë¤è¤ëǧ¾Ú¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£] +ja,frame,6,[¥ê¥¯¥¨¥¹¥È¤µ¤ì¤¿¥ª¥Ö¥¸¥§¥¯¥È¤ËÂФ¹¤ë¥¢¥¯¥»¥¹¤Ï\n¥×¥í¥¯¥·¤ÎÀßÄê¾åµö¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£] +ja,frame,7,[¥×¥í¥¯¥·¤Ï¤¢¤Ê¤¿¤Î¥ê¥¯¥¨¥¹¥È¤ò¼Â¹Ô¤¹¤ëºÝ¤Ë¥¨¥é¡¼¤òȯÀ¸¤·¤Þ¤·¤¿¡£\nÀßÄ꤬¸í¤Ã¤Æ¤¤¤ë²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹¡£\n¥×¥í¥¯¥· ¥¨¥é¡¼ ¥í¥°¤Î¥á¥Ã¥»¡¼¥¸¤ò»²¾È¤¹¤ë¤è¤¦´ÉÍý¼Ô¤Ë°ÍÍꤷ¤Æ¤¯¤À¤µ¤¤¡£] +ja,frame,8,[¥ê¥¯¥¨¥¹¥È¤µ¤ì¤¿ÆâÍÆ¤Ï¥×¥í¥¯¥·¤Ë¼ÂÁõ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£] +ja,frame,9,[¥×¥í¥¯¥·¾å¤Ç¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿¡£] +ja,frame,10,[¤¢¤Ê¤¿¤Î¥Ö¥é¥¦¥¶¤¬Á÷¿®¤·¤¿¥ê¥¯¥¨¥¹¥È¤Ï¡¢¥µ¡¼¥Ð¤ËÍý²ò¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¤â¤Î¤Ç¤¹¡£] +ja,frame,11,[ŬÀÚ¤Êǧ¾Ú¤Ï¤³¤Î¥¨¥ê¥¢¤Î´ÉÍý¤Î¤¿¤á¤ËɬÍפǤ¹¡£\n¤¢¤Ê¤¿¤Î¥Ö¥é¥¦¥¶¤Îǧ¾Ú¤Ï¼ºÇÔ¤·¤Þ¤·¤¿¡£] +ja,frame,12,[¤¢¤Ê¤¿¤Î¥¯¥é¥¤¥¢¥ó¥È¤Ï¥ª¥Ö¥¸¥§¥¯¥È¤ËÂФ¹¤ë¥¢¥¯¥»¥¹¤òµö²Ä¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£] +ja,frame,13,[¤³¤Î¥µ¡¼¥Ð¤Ï¥ê¥¯¥¨¥¹¥È¤Î½èÍýÃæ¤Ë¥¨¥é¡¼¤ËÁø¶ø¤·¤Þ¤·¤¿¡£¸í¤Ã¤¿ÀßÄ꤬¤Ê¤µ¤ì¤Æ¤¤¤ë²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹¡£¥µ¡¼¥Ð¤Î¥¨¥é¡¼ ¥í¥°¤ò»²¾È¤¹¤ë¤è¤¦´ÉÍý¼Ô¤ËÏ¢Íí¤·¤Æ¤¯¤À¤µ¤¤¡£] +ja,frame,14,[¥ê¥¯¥¨¥¹¥È¤µ¤ì¤¿ÆâÍÆ¤Ï¥µ¡¼¥Ð¤Ë¼ÂÁõ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó] +ja,frame,15,[¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿¡£] +ja,frame,16,[¤¢¤Ê¤¿¤Î¥Ö¥é¥¦¥¶¤¬¥µ¡¼¥Ð¤ËÁ÷¤Ã¤¿¥ê¥¯¥¨¥¹¥È¤Ï¥µ¡¼¥Ð¤¬Íý²ò¤Ç¤­¤Ê¤¤¥ê¥¯¥¨¥¹¥È¤Ç¤¹¡£] +ja,frame,17,[%s

                      %s

                      \n¤³¤Î¥É¥­¥å¥á¥ó¥È¤Ï¿·¤·¤¤¾ì½ê¤Ë°Üư¤·¤Þ¤·¤¿¡£ . ¥É¥­¥å¥á¥ó¥È¤È¥Û¥Ã¥È¥ê¥¹¥È¤Î¹¹¿·¤ò¤·¤Æ¤¯¤À¤µ¤¤¡£] +ja,frame,18,[%s\n

                      %s

                      \n%s\n] +ja,frame,19,[process-uri-objects] +ja,frame,20,[cannot find template %s] +ja,frame,21,[process-uri-objects] +ja,frame,22,[no partial path after object processing] +ja,frame,23,[find-service] +ja,frame,24,[invalid shexp %s] +ja,frame,25,[find-service] +ja,frame,26,[invalid shexp %s] +ja,frame,27,[handle-processed] +ja,frame,28,[no way to service request for %s] +ja,frame,29,[finish-socks-request] +ja,frame,30,[close failed (%s), csd=%d] +ja,frame,31,[This beta software has expired.\n] +ja,frame,32,[mr_accept(%d)] +ja,frame,33,[Error issuing read on accept socket] +ja,frame,34,[acb_accept_connection(%d)] +ja,frame,35,[Error getting accept socket (%d)] +ja,frame,36,[Error in accept! (%d, %s)] +ja,frame,37,[Error creating new accept request] +ja,frame,38,[accepted connection: %d (NSPR %d)] +ja,frame,39,[Error creating new session structure] +ja,frame,40,[accel_read_request()] +ja,frame,41,[Error allocating request read buffer] +ja,frame,42,[Error issuing async read request] +ja,frame,43,[acb_read_request(%d, bytes %d)] +ja,frame,44,[acb_read_req(1 session = %d)] +ja,frame,45,[Error reading request (%d, %s)] +ja,frame,46,[Client aborted connection] +ja,frame,47,[Error reading request] +ja,frame,48,[Error creating new request] +ja,frame,49,[error occurred, closing %d, io was for %d] +ja,frame,50,[accel_async_scan_headers()] +ja,frame,51,[out of memory: accel_async_scan_headers] +ja,frame,52,[out of memory: accel_async_scan_headers] +ja,frame,53,[Error during async read (%d, %s)] +ja,frame,54,[scan-headers reports: line too long] +ja,frame,55,[scan-headers reports: too many headers] +ja,frame,56,[Error reading headers] +ja,frame,57,[scan-headers reports: header missing terminator (an empty line)] +ja,frame,58,[scan-headers reports: header was empty] +ja,frame,59,[̾Á°¤ËÃͤ¬¤¢¤ê¤Þ¤»¤ó¡§ "%s" ¹Ô] +ja,frame,60,[accel_send_plain_file()] +ja,frame,61,[accel_send_plain_file() - found request %d] +ja,frame,62,[Parse headers lost the URI!] +ja,frame,63,[accel_send_plain_file() - found uri %s] +ja,frame,64,[accel_send_plain_file() - found in cache?] +ja,frame,65,[malloc died!] +ja,frame,66,[Error writing back file\n] +ja,frame,67,[acb_send_plain_file(%d)] +ja,frame,68,[Error writing in acb_send_plain_file (%d, %s)] +ja,frame,69,[acb_close_connection(%d)] +ja,frame,70,[Errored IO in acb_close_connection (%d, %s)] +ja,frame,71,[Unable to close socket %d] +ja,frame,72,[accel-cache-insert: Error allocating entry] +ja,frame,73,[cache-init: server cache disabled] +ja,frame,74,[accel_file_cache: Error initializing file cache] +ja,frame,75,[accel_file_cache: Error creating cache] +ja,frame,76,[accel_file_cache_init: CacheHashSize < %d, using %d] +ja,frame,77,[accel_file_cache_init: CacheHashSize > %d, using %d] +ja,frame,78,[accel_file_cache_init: MaxNumberOfCachedFiles < %d, using %d] +ja,frame,79,[accel_file_cache_init: MaxNumberOfCachedFiles > %d, using %d] +ja,frame,80,[accel_file_cache_init: MaxNumberOfOpenCachedFiles < %d, using %d] +ja,frame,81,[accel_file_cache_init: MaxNumberOfOpenCachedFiles > %d, using %d] +ja,frame,82,[accel_file_cache: Error initializing file cache] +ja,frame,83,[file-cache: enabled = %s ] +ja,frame,84,[on] +ja,frame,85,[off] +ja,frame,86,[file-cache: MaxNumberOfCachedFiles %d (0x%x)] +ja,frame,87,[file-cache: CacheHashSize %d (0x%x)] +ja,frame,88,[file-cache: MaxNumberOfOpenCachedFiles %d (0x%x)] +ja,frame,89,[accel-cache-insert: Error allocating entry] +ja,frame,90,[file-cache-cleanup: munmap failed (%s)] +ja,frame,91,[file-cache-cleanup: found mmapped file \non system without mmap] +ja,frame,92,[file_cache_init: MaxTotalCachedFileSize < %d, using %d] +ja,frame,93,[file_cache_init: MaxTotalCachedFileSize > %d, using %d] +ja,frame,94,[file cache using mmap flags 0x%x] +ja,frame,95,[file cache using mmap prots 0x%x] +ja,frame,96,[file-cache-init: could not create lock] +ja,frame,97,[file-cache: unable to create temporary directory %s.\n] +ja,frame,98,[file-cache: unable to create temporary directory %s.\n] +ja,frame,99,[file-cache: GetTempPath() Cannot find temp directory to store file!] +ja,frame,100,[file-cache-init: set max cached file size to %d] +ja,frame,101,[file-cache-init: could not create lock] +ja,frame,102,[file_cache_destroy()] +ja,frame,103,[file-cache: Unable to get temp file name. Error %s] +ja,frame,104,[file-cache: Unable to get temp file name. Error %s] +ja,frame,105,[file-cache-insert: Error allocating entry] +ja,frame,106,[file-cache-create: Error opening file %s (%s)] +ja,frame,107,[file-cache-create: Error stat()ing file %s (%s)] +ja,frame,108,[file-cache-create: Error mmap()ing file %s (%s)] +ja,frame,109,[file-cache-create: malloc failure] +ja,frame,110,[file-cache-create: error case failed to munmap(%d, %d) (%s)] +ja,frame,111,[file-cache-valid: cannot stat %s] +ja,frame,112,[dir change: invalidating %s (%d)] +ja,frame,113,[file-cache: asynchronous file change notification failed.] +ja,frame,114,[dir change: offset %d, action %d, len %d, name %s] +ja,frame,115,[unable to check async file status] +ja,frame,116,[ReadDirectoryChangesW failure- unable to continue watching %s. Error is %s] +ja,frame,117,[file-cache-add-watch failure- unable to open directory %s. Error %s] +ja,frame,118,[ReadDirectoryChangesW failure- unable to start watching %s. Error %s] +ja,frame,119,[func_exec] +ja,frame,120,[no handler function given for directive] +ja,frame,121,[func_exec] +ja,frame,122,[cannot find function named %s] +ja,frame,123,[handle-request] +ja,frame,124,[method without URI] +ja,frame,125,[http-parse-request] +ja,frame,126,[while scanning HTTP headers, %s] +ja,frame,127,[handle-request] +ja,frame,128,[read from %s failed, error is %s] +ja,frame,129,[handle-request] +ja,frame,130,[request too long] +ja,frame,131,[start-http-response] +ja,frame,132,[write failed (%s)] +ja,frame,133,[start-http-response] +ja,frame,134,[write failed (%s)] +ja,frame,135,[http-status] +ja,frame,136,[%d is not a valid HTTP status code] +ja,frame,137,[finish-request] +ja,frame,138,[close failed (%s)] +ja,frame,139,[Unable to close socket for writing] +ja,frame,140,[os has %d objects] +ja,frame,141,[obj %d has no hash table at %d] +ja,frame,142,[obj %d has no param] +ja,frame,143,[obj %d name %s value %s] +ja,frame,144,[.....directives %d.......] +ja,frame,145,[.....directive %d] +ja,frame,146,[.......instance %d] +ja,frame,147,[...........param name %s value %s] +ja,frame,148,[ClearConfigurationParameters:RegCreateKey %s] +ja,frame,149,[ClearConfigurationParameters:RegEnumKey %s failed] +ja,frame,150,[obj.conf line %d: error in filter file "%s" at line %d: %s] +ja,frame,151,[obj.conf line %d: error in filter file "%s" at line %d: %s] +ja,frame,152,[Unable to allocate Subject property list.\n] +ja,frame,153,[Unable to set session ptr in Subject property list - error=%d\n] +ja,frame,154,[Unable to set request ptr in Subject property list - error=%d\n] +ja,frame,155,[file-cache-valid: cannot stat %s] +ja,frame,156,[file-cache-create: Error stat()ing file %s (%s)] +ja,httpdaemon,-1,[$DBT: httpdaemon in DB file v1 $] +ja,httpdaemon,1,[Error in ConvertThreadToFiber] +ja,httpdaemon,2,[Error in ConvertThreadToFiber] +ja,httpdaemon,3,[Error in md_start_system] +ja,httpdaemon,4,[Error in CreateFiber - idlefiber] +ja,httpdaemon,5,[Error in GetQueuedCompletionStatus] +ja,httpdaemon,6,[Error creating completion port] +ja,httpdaemon,7,[Could not SetHandleNonInheritable (%s)] +ja,httpdaemon,8,[Error accept/read new conn] +ja,httpdaemon,9,[Error in Respond()] +ja,httpdaemon,10,[Error in RespondCompleted()] +ja,httpdaemon,11,[daemon: unable to fork new process (%s)\n] +ja,httpdaemon,12,[daemon: setsid failed (%s)\n] +ja,httpdaemon,13,[daemon: can't log pid to %s (%s)\n] +ja,httpdaemon,14,[warning: could not set group id to %d (%s)\n] +ja,httpdaemon,15,[warning: could not set user id to %d (%s)\n] +ja,httpdaemon,16,[warning: daemon is running as super-user\n] +ja,httpdaemon,17,[could not determine current user name\n] +ja,httpdaemon,18,[error: chroot to %s failed (%s)\n] +ja,httpdaemon,19,[WARNING! netscape executable and library have different versions.\n] +ja,httpdaemon,20,[startup: listening to %s://%s, port %d as %s\n] +ja,httpdaemon,21,[startup: listening to %s://%s, port %d as %s\n] +ja,httpdaemon,22,[seminit failed (%s)\n] +ja,httpdaemon,23,[Using single threaded accepts.] +ja,httpdaemon,24,[Using multi threaded accepts.] +ja,httpdaemon,25,[Using partial single threaded accepts.] +ja,httpdaemon,26,[This machine has %d processors.] +ja,httpdaemon,27,[Error calling thr_seconcurrency(%d)- (%s)] +ja,httpdaemon,28,[Set conncurrency to %d.] +ja,httpdaemon,29,[can't fork new process (%s)] +ja,httpdaemon,30,[This beta software has expired.\n] +ja,httpdaemon,31,[can't create IPC pipe (%s)] +ja,httpdaemon,32,[write to wakeup pipe failed (%s)] +ja,httpdaemon,33,[select thread miss] +ja,httpdaemon,34,[startup failure: could not bind to port %d (%s)\n] +ja,httpdaemon,35,[startup failure: could not bind to port %d, IP address %s (%s)\n] +ja,libaccess,-1,[$DBT: libaccess in DB file v1 $] +ja,libaccess,1,[basic-ncsa] +ja,libaccess,2,[cannot open database %s] +ja,libaccess,3,[basic-ncsa] +ja,libaccess,4,[user %s password did not match database %s] +ja,libaccess,5,[basic-ncsa] +ja,libaccess,6,[cannot open connection to LDAP server on %s:%d] +ja,libaccess,7,[basic-ncsa] +ja,libaccess,8,[user %s password did not match LDAP on %s:%d] +ja,libaccess,9,[acl-state] +ja,libaccess,10,[missing realm] +ja,libaccess,11,[Unable to allocate ACL List Hash\n] +ja,libaccess,12,[ACLEvalBuildContext unable to PERM_MALLOC cache structure\n] +ja,libaccess,13,[ACLEvalBuildContext unable to create hash table\n] +ja,libaccess,14,[ACLEvalBuildContext unable to allocate ACE Entry\n] +ja,libaccess,15,[ACLEvalBuildContext unable to allocate ACE entry\n] +ja,libaccess,16,[ACLEvalBuildContext unable to allocate Boundary Entry\n] +ja,libaccess,17,[ACLEvalBuildContext failed.\n] +ja,libaccess,18,[ACL_EvalTestRights: an interim, absolute non-allow value was encountered. right=%s, value=%d\n] +ja,libaccess,19,[LASDnsBuild unable to allocate hash table header\n] +ja,libaccess,20,[LASDnsBuild unable to add key %s\n] +ja,libaccess,21,[LASDnsBuild unable to add key %s\n] +ja,libaccess,22,[LASDnsBuild unable to add key %s\n] +ja,libaccess,23,[LASDnsBuild unable to add key %s\n] +ja,libaccess,24,[LASDnsBuild unable to add key %s\n] +ja,libaccess,25,[LAS DNS build received request for attribute %s\n] +ja,libaccess,26,[LASDnsEval - illegal comparator %s\n] +ja,libaccess,27,[LASDnsEval unable to allocate Context struct\n\n] +ja,libaccess,28,[LASDnsEval unable to get session address %d\n] +ja,libaccess,29,[LASDnsEval unable to get DNS - error=%s\n] +ja,libaccess,30,[LAS Group Eval received request for attribute %s\n] +ja,libaccess,31,[LASGroupEval - illegal comparator %s\n] +ja,libaccess,32,[LASGroupEval - ran out of memory\n] +ja,libaccess,33,[LASGroupEval unable to get session address %d\n] +ja,libaccess,34,[LASGroupEval unable to get session address %d\n] +ja,libaccess,35,[LASGroupEval - couldn't locate getter for auth-user\n] +ja,libaccess,36,[LASGroupEval - Attribute getter for auth-user failed\n] +ja,libaccess,37,[LASGroupEval - Attribute getter didn't set auth-user\n] +ja,libaccess,38,[Check group membership of user "%s" for group "%s"\n] +ja,libaccess,39,[LDAPU_SUCCESS for group "%s"\n] +ja,libaccess,40,[LDAPU_FAILED for group "%s"\n] +ja,libaccess,41,[LAS_EVAL_FALSE\n] +ja,libaccess,42,[LAS_EVAL_TRUE\n] +ja,libaccess,43,[LASIpTreeAlloc - no memory\n] +ja,libaccess,44,[IP LAS unable to allocate tree node\n] +ja,libaccess,45,[IP LAS unable to allocate tree node\n] +ja,libaccess,46,[LAS IP build received request for attribute %s\n] +ja,libaccess,47,[LASIpEval - illegal comparator %s\n] +ja,libaccess,48,[LASIpEval unable to get session address - error=%s\n] +ja,libaccess,49,[LASIpEval unable to allocate Context struct\n\n] +ja,libaccess,50,[LASIpEval - reach 32 bits without conclusion value=%s] +ja,libaccess,51,[LAS Program Eval received request for attribute %s\n] +ja,libaccess,52,[LASProgramEval - illegal comparator %s\n] +ja,libaccess,53,[LASProgram unable to get session address %d\n] +ja,libaccess,54,[bin] +ja,libaccess,55,[LASProgramEval: request not of type admin or bin, passing.\n] +ja,libaccess,56,[LASProgramEval: check if program %s matches pattern %s.\n] +ja,libaccess,57,[LASProgramEval: Invalid wildcard expression %s.\n] +ja,libaccess,58,[LAS_EVAL_FALSE\n] +ja,libaccess,59,[LAS_EVAL_TRUE\n] +ja,libaccess,60,[Unexpected attribute in dayOfWeek - %s\n] +ja,libaccess,61,[Illegal comparator for dayOfWeek - %s\n] +ja,libaccess,62,[Unexpected attribute in timeOfDay - %s\n] +ja,libaccess,63,[LAS User Eval received request for attribute %s\n] +ja,libaccess,64,[LASUserEval - illegal comparator %s\n] +ja,libaccess,65,[LASUserEval - ran out of memory\n] +ja,libaccess,66,[LASUserEval unable to get session address %d\n] +ja,libaccess,67,[LASUserEval unable to get session address %d\n] +ja,libaccess,68,[LASGroupEval - couldn't locate getter for auth-user\n] +ja,libaccess,69,[LASGroupEval - Attribute getter for auth-user failed\n] +ja,libaccess,70,[LASGroupEval - Attribute getter didn't set auth-user\n] +ja,libaccess,71,[Check if uid == user (i.e. check "%s" == "%s)"\n] +ja,libaccess,72,[SUCCESS for user "%s"\n] +ja,libaccess,73,[FAILED for user "%s"\n] +ja,libaccess,74,[LAS_EVAL_FALSE\n] +ja,libaccess,75,[LAS_EVAL_TRUE\n] +ja,libaccess,76,[] +ja,libaccess,77,[LASProgram unable to get request address - error=%s] +ja,libaccess,78,[LASProgram rejecting request for program %s from pattern %s] +ja,libaccess,79,[ACL_CacheFlush: unable to parse file "%s"\n] +ja,libaccess,80,[ACL_CacheFlush: unable to concatenate ACL list "%s"\n] +ja,libaccess,81,[ACL_CacheFlush: unable to open and process the magnus file "%s"\n] +ja,libaccess,82,[Illegal comparator for timeOfDay - %s\n] +ja,libaccess,83,[ACL_EvalBuildContext unable to create hash table\n] +ja,libaccess,84,[ACL_EvalBuildContext unable to PERM_CALLOC cache structure\n] +ja,libaccess,85,[ACL_EvalBuildContext unable to allocate ACE entry\n] +ja,libaccess,86,[ACL_EvalBuildContext unable to allocate auth pointer array\n] +ja,libaccess,87,[ACL_EvalBuildContext unable to allocate auth plist\n] +ja,libaccess,88,[ACL_EvalTestRights: an interim, absolute non-allow value was encountered. right=%s, value=%s\n] +ja,libaccess,89,[ACL_INTEvalTestRights: call to ACL_EvalBuildContext returned failure status\n] +ja,libaccess,90,[ACL_ModuleRegister: module name is missing\n] +ja,libaccess,91,[ACL_ModuleRegister: call to module init function returned a failed status\n] +ja,libaccess,92,[ACL_GetAttribute: couldn't determine method for %s\n] +ja,libaccess,93,[ACL_GetAttribute: couldn't locate getter for %s] +ja,libaccess,94,[ACL_GetAttribute: attr getter failed to get %s] +ja,libaccess,95,[ACL_GetAttribute: attr getter failed to get %s] +ja,libaccess,96,[ACL_GetAttribute: All attribute getters declined for attr %s] +ja,libaccess,97,[ACL_DatabaseRegister: dbtype for database "%s" is not defined yet!] +ja,libaccess,98,[ACL_DatabaseRegister: database name is missing] +ja,libaccess,99,[Error reading the DB Map File: %s. Reason: %s] +ja,libaccess,100,[URL is missing for database %s] +ja,libaccess,101,[Invalid property value pair for database %s] +ja,libaccess,102,["default" database must be an LDAP database] +ja,libaccess,103,[Multiple "default" databases are being registered] +ja,libaccess,104,["default" LDAP database must be registered] +ja,libaccess,105,[LASGroupEval unable to get database name - error= %s] +ja,libaccess,106,[received invalid program expression %s] +ja,libaccess,107,[parse_ldap_url: database url is missing] +ja,libaccess,108,[parse_ldap_url: database name is missing] +ja,libaccess,109,[parse_ldap_url: error in parsing ldap url. Reason: %s] +ja,libaccess,110,[ldap password check: unable to get database name - error=%s] +ja,libaccess,111,[ldap password check: unable to get parsed database %s] +ja,libaccess,112,[ldap password check: couldn't initialize connection to LDAP. Reason: %s] +ja,libaccess,113,[ldap password check: LDAP error: "%s"] +ja,libaccess,114,[get_user_ismember_ldap unable to get database name - error=%s] +ja,libaccess,115,[get_user_ismember_ldap unable to get parsed database %s] +ja,libaccess,116,[ldap password check: couldn't initialize connection to LDAP. Reason: %s] +ja,libaccess,117,[get_user_ismember_ldap: group %s does not exist] +ja,libaccess,118,[get_user_ismember_ldap: LDAP error: "%s"] +ja,libaccess,119,[ACL_LDAPDatabaseHandle: %s is not a registered database] +ja,libaccess,120,[ACL_LDAPDatabaseHandle: %s is not an LDAP database] +ja,libaccess,121,[ACL_LDAPDatabaseHandle: out of memory] +ja,libaccess,122,[ACL_LDAPDatabaseHandle: couldn't initialize connection to LDAP. Reason: %s] +ja,libaccess,123,[ACL_LDAPDatabaseHandle: couldn't bind to LDAP server. Reason: %s] +ja,libaccess,124,[insufficient dynamic memory] +ja,libaccess,125,[error opening file, %s: %s] +ja,libaccess,126,[duplicate definition of %s] +ja,libaccess,127,[file %s, line %s: duplicate definition of %s] +ja,libaccess,128,[file %s, line %s: syntax error] +ja,libaccess,129,[file %s, line %s: %s is undefined] +ja,libaccess,130,[in acl %s, %s %s is undefined] +ja,libaccess,131,[database %s: error accessing %s] +ja,libaccess,132,[%s] +ja,libaccess,133,[file %s, line %s: invalid syntax] +ja,libaccess,134,[file %s, line %s: syntax error at "%s"] +ja,libaccess,135,[realm %s is not defined] +ja,libaccess,136,[error code = %d] +ja,libaccess,137,[internal ACL error] +ja,libaccess,138,[invalid argument] +ja,libaccess,139,[ACL_DatabaseRegister: dbtype for database "%s" is not defined yet!] +ja,libaccess,140,[couldn't determine dbtype from: %s] +ja,libaccess,141,[Failed to register database %s] +ja,libaccess,142,[ACL call returned failed status] +ja,libaccess,143,[file %s: ACL IO error - %s] +ja,libaccess,144,[acl_user_exists: ¥á¥â¥êÉÔ­¤Ç¤¹] +ja,libaccess,145,[acl_user_exists: ¥æ¡¼¥¶¤¬¤â¤¦Â¸ºß¤·¤Þ¤»¤ó] +ja,libaccess,146,[acl_user_exists: plist ¥¨¥é¡¼] +ja,libadmin,-1,[$DBT: libadmin in DB file v1 $] +ja,libadmin,1,[ Help ] +ja,libadmin,2,[ OK ] +ja,libadmin,3,[ Reset ] +ja,libadmin,4,[ Done ] +ja,libadmin,5,[ Cancel ] +ja,libir,-1,[$DBT: libadmin in DB file v1 $] +ja,libir,1,[An I/O error occurred before all form data could be read.] diff --git a/ldap/Makefile b/ldap/Makefile new file mode 100644 index 00000000..61c3f57b --- /dev/null +++ b/ldap/Makefile @@ -0,0 +1,95 @@ +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# + +# GNU Makefile for Directory Server and Ldap SDK +# + +MCOM_ROOT = ../.. +LDAP_SRC = $(MCOM_ROOT)/ldapserver/ldap + +NOSTDCLEAN=true # don't let nsconfig.mk define target clean +NOSTDSTRIP=true # don't let nsconfig.mk define target strip +NSPR20=true # probably should be defined somewhere else (not sure where) + +include $(MCOM_ROOT)/ldapserver/nsdefs.mk +include $(MCOM_ROOT)/ldapserver/nsconfig.mk +include $(LDAP_SRC)/nsldap.mk + +all: $(LDAP_LIBDIR) $(LDAP_BINDIR) $(LDAP_OBJDIR) ldapprogs ldapdocs + +ldapprogs: + cd include; $(MAKE) $(MFLAGS) all + cd libraries; $(MAKE) $(MFLAGS) buildDirectory + cd servers; $(MAKE) $(MFLAGS) all +ifneq ($(ARCH), WINNT) + cd systools; $(MAKE) $(MFLAGS) all + # new unix installer + cd cm/newinst; $(MAKE) $(MFLAGS) all +ifeq ($(USE_64),1) + # In 64-bit builds, we build the installer 32-bit, which has the side-effect that the uninstaller and ns-update scripts + # get copied into the 32-bit output directory by the makefile above. However, we later want to package them and expect + # to see them in the 64-bit output directory. So, here we copy them over. + $(CP) $(RELDIR_32)/bin/slapd/admin/bin/ns-update $(LDAP_ADMIN_BIN_RELDIR) + $(CP) $(RELDIR_32)/bin/slapd/admin/bin/uninstall $(LDAP_ADMIN_BIN_RELDIR) +endif +else + cd cm/newinstnt; $(MAKE) $(MFLAGS) all +endif + cd admin; $(MAKE) $(MFLAGS) all + +ldapdocs: + if [ -d docs ]; then cd docs/dirhlp; $(MAKE) $(MFLAGS) ; fi + if [ -d docs ]; then cd docs/dirhlp/ag; $(MAKE) $(MFLAGS) ; fi + if [ -d docs ]; then cd docs/dirhlp/deploy; $(MAKE) $(MFLAGS) ; fi + if [ -d docs ]; then cd docs/dirhlp/cli; $(MAKE) $(MFLAGS) ; fi + if [ -d docs ]; then cd docs/dirhlp/schema; $(MAKE) $(MFLAGS) ; fi + if [ -d docs ]; then cd docs/dirhlp/install; $(MAKE) $(MFLAGS) ; fi + if [ -d docs ]; then cd docs/dirhlp/gwcust; $(MAKE) $(MFLAGS) ; fi + if [ -d docs ]; then cd docs/dirhlp/plugin; $(MAKE) $(MFLAGS) ; fi + if [ -d docs ]; then cd docs/dirhlp/orgchart; $(MAKE) $(MFLAGS) ; fi + if [ -d docs ]; then cd docs/dirhlp/dsmlgw; $(MAKE) $(MFLAGS) ; fi + +clientSDK: $(LDAP_LIBDIR) $(LDAP_BINDIR) $(LDAP_OBJDIR) + cd include; $(MAKE) $(MFLAGS) clientSDK +ifeq ($(ARCH), WINNT) + cd servers/slapd/ntmsgdll; $(MAKE) $(MFLAGS) all +endif + cd libraries; $(MAKE) $(MFLAGS) clientSDK + cd clients/tools; $(MAKE) $(MFLAGS) clientSDK + +clean: + cd include; $(MAKE) $(MFLAGS) clean + cd libraries; $(MAKE) $(MFLAGS) clean + cd servers; $(MAKE) $(MFLAGS) clean + cd admin; $(MAKE) $(MFLAGS) clean +ifneq ($(ARCH), WINNT) # new unix installer + cd systools; $(MAKE) $(MFLAGS) clean + cd cm/newinst; $(MAKE) $(MFLAGS) clean +else + cd cm/newinstnt; $(MAKE) $(MFLAGS) clean +endif + +cleanSDK: + cd include; $(MAKE) $(MFLAGS) clean +ifeq ($(ARCH), WINNT) + cd servers/slapd/ntmsgdll; $(MAKE) $(MFLAGS) clean +endif + cd libraries; $(MAKE) $(MFLAGS) clean + cd clients/tools; $(MAKE) $(MFLAGS) clean + +veryclean: clean + +$(LDAP_LIBDIR): + $(MKDIR) $(LDAP_LIBDIR) + +$(LDAP_BINDIR): + $(MKDIR) $(LDAP_BINDIR) + +$(LDAP_OBJDIR): + $(MKDIR) $(LDAP_OBJDIR) + diff --git a/ldap/Makefile.client b/ldap/Makefile.client new file mode 100644 index 00000000..b6688141 --- /dev/null +++ b/ldap/Makefile.client @@ -0,0 +1,39 @@ +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +DEPTH = ../.. + +SRCDIRS = build include libraries + +include $(DEPTH)/config/rules.mk + +all export:: FORCE + @for i in $(SRCDIRS); do \ + echo " cd $$i; $(MAKE) -f Makefile.client $(MFLAGS) export"; \ + ( cd $$i; $(MAKE) -f Makefile.client $(MFLAGS) export ); \ + done + +libs install:: FORCE + @for i in $(SRCDIRS); do \ + echo "cd $$i; $(MAKE) -f Makefile.client $(MFLAGS) install"; \ + ( cd $$i; $(MAKE) -f Makefile.client $(MFLAGS) install ); \ + done + +clean clobber:: FORCE + @for i in $(SRCDIRS); do \ + echo "cd $$i; $(MAKE) -f Makefile.client $(MFLAGS) clean"; \ + ( cd $$i; $(MAKE) -f Makefile.client $(MFLAGS) clean ); \ + done + +realclean clobber_all:: FORCE + @for i in $(SRCDIRS); do \ + echo "cd $$i; $(MAKE) -f Makefile.client $(MFLAGS) realclean"; \ + ( cd $$i; $(MAKE) -f Makefile.client $(MFLAGS) realclean ); \ + done + +FORCE: + diff --git a/ldap/admin/Makefile b/ldap/admin/Makefile new file mode 100644 index 00000000..99b1653b --- /dev/null +++ b/ldap/admin/Makefile @@ -0,0 +1,33 @@ +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# +# GNU Makefile for Directory Server Admin components +# + +MCOM_ROOT = ../../.. +LDAP_SRC = ../ + +NOSTDCLEAN=true # don't let nsconfig.mk define target clean +NOSTDSTRIP=true # don't let nsconfig.mk define target strip +NSPR20=true # probably should be defined somewhere else (not sure where) + +include $(MCOM_ROOT)/ldapserver/nsdefs.mk +include $(MCOM_ROOT)/ldapserver/nsconfig.mk +include $(LDAP_SRC)/nsldap.mk + +all: + cd include; $(MAKE) $(MFLAGS) all + cd lib; $(MAKE) $(MFLAGS) all + cd src; $(MAKE) $(MFLAGS) all + +veryclean: clean + +clean: + cd include; $(MAKE) $(MFLAGS) clean + cd lib; $(MAKE) $(MFLAGS) clean + cd src; $(MAKE) $(MFLAGS) clean diff --git a/ldap/admin/include/Makefile b/ldap/admin/include/Makefile new file mode 100644 index 00000000..0b45ede0 --- /dev/null +++ b/ldap/admin/include/Makefile @@ -0,0 +1,39 @@ +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# +# GNU Makefile for Directory Server Admin include directory. +# + +MCOM_ROOT = ../../../.. +LDAP_SRC = ../.. + +NOSTDCLEAN=true # don't let nsconfig.mk define target clean + +include $(MCOM_ROOT)/ldapserver/nsdefs.mk +include $(MCOM_ROOT)/ldapserver/nsconfig.mk +include $(LDAP_SRC)/nsldap.mk + +HDRDEST=$(LDAP_ADMROOT)/include + +HEADERS=dsalib.h dsalib_pw.h +BINS=$(addprefix $(HDRDEST)/,$(HEADERS)) + +all: $(HDRDEST) $(BINS) + +$(HDRDEST): + $(MKDIR) $(HDRDEST) + +strip: +depend: + +clean: + -$(RM) $(BINS) + +$(HDRDEST)/%.h: %.h + -@$(RM) $@ + $(CP) $< $@ diff --git a/ldap/admin/include/dsalib.h b/ldap/admin/include/dsalib.h new file mode 100644 index 00000000..c00f6cb0 --- /dev/null +++ b/ldap/admin/include/dsalib.h @@ -0,0 +1,450 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ + +#ifndef __dsalib_h +#define __dsalib_h + +#include +#include +#include +#ifdef HPUX +#include /* for PATH_MAX */ +#endif + +/* error types */ +#define DS_FILE_ERROR 0 +#define DS_MEMORY_ERROR 1 +#define DS_SYSTEM_ERROR 2 +#define DS_INCORRECT_USAGE 3 +#define DS_ELEM_MISSING 4 +#define DS_REGISTRY_DATABASE_ERROR 5 +#define DS_NETWORK_ERROR 6 +#define DS_GENERAL_FAILURE 7 +#define DS_WARNING 8 + +/* The upper bound on error types */ +#define DS_MAX_ERROR 9 + +/* The default error type (in case something goes wrong */ +#define DS_DEFAULT_ERROR 3 + +#ifndef BIG_LINE +#define BIG_LINE 1024 +#endif +#ifndef PATH_MAX +#if defined( _WIN32 ) +#define PATH_MAX _MAX_PATH +#else +#define PATH_MAX 256 +#endif /* _WIN32 */ +#endif /* PATH_MAX */ +#ifndef HTML_ERRCOLOR +#define HTML_ERRCOLOR "#AA0000" +#endif +#ifndef CONTENT_NAME +#define CONTENT_NAME "content" +#endif + +#ifdef XP_UNIX + +#define FILE_PATHSEP '/' +#define FILE_PATHSEPP "/" +#define FILE_PARENT "../" +#define WSACleanup() + +#elif defined(XP_WIN32) + +#define FILE_PATHSEP '/' +#define FILE_PATHSEPP "\\\\" +#define FILE_PARENT "..\\" + +#endif /* XP_WIN32 */ + +#define PATH_SIZE 1024 +#define ERR_SIZE 8192 + +/* + NT doesn't strictly need these, but the libadmin API which is emulated + below uses them. + */ +#define NEWSCRIPT_MODE 0755 +#define NEWFILE_MODE 0644 +#define NEWDIR_MODE 0755 + +#if defined( XP_WIN32 ) +#define DS_EXPORT_SYMBOL __declspec( dllexport ) +#else +#define DS_EXPORT_SYMBOL +#endif + +#if defined( XP_WIN32 ) +#define ENQUOTE "\"" +#else +#define ENQUOTE "" +#endif + +#ifndef FILE_SEP +#ifdef XP_WIN32 + #define FILE_SEP '\\' +#else + #define FILE_SEP '/' +#endif +#endif + +#if defined( XP_WIN32 ) + #define PATH_FOR_PLATFORM(_path) ds_unixtodospath(_path) +#else + #define PATH_FOR_PLATFORM(_path) +#endif + +#define START_SCRIPT "start-slapd" +#define RESTART_SCRIPT "restart-slapd" +#define STOP_SCRIPT "stop-slapd" + +#if defined( XP_WIN32 ) +#define SLAPD_NAME "slapd" +#else +#define SLAPD_NAME "ns-slapd" +#endif + +#define MOCHA_NAME "JavaScript" + +/* + * Return values from ds_get_updown_status() + */ +#define DS_SERVER_UP 1 +#define DS_SERVER_DOWN 0 +#define DS_SERVER_UNKNOWN -1 +/* + * Return values from ds_bring_up_server() + */ +#define DS_SERVER_ALREADY_UP -2 +#define DS_SERVER_ALREADY_DOWN -3 +#define DS_SERVER_PORT_IN_USE -4 +#define DS_SERVER_MAX_SEMAPHORES -5 +#define DS_SERVER_CORRUPTED_DB -6 +#define DS_SERVER_NO_RESOURCES -7 +#define DS_SERVER_COULD_NOT_START -8 + +/* + * Other return values + */ +#define DS_UNKNOWN_ERROR -1 +#define DS_NO_SERVER_ROOT -10 +#define DS_CANNOT_EXEC -11 +#define DS_CANNOT_OPEN_STAT_FILE -12 +#define DS_NULL_PARAMETER -13 +#define DS_SERVER_MUST_BE_DOWN -14 +#define DS_CANNOT_OPEN_BACKUP_FILE -15 +#define DS_NOT_A_DIRECTORY -16 +#define DS_CANNOT_CREATE_DIRECTORY -17 +#define DS_CANNOT_OPEN_LDIF_FILE -18 +#define DS_IS_A_DIRECTORY -19 +#define DS_CANNOT_CREATE_FILE -20 +#define DS_UNDEFINED_VARIABLE -21 +#define DS_NO_SUCH_FILE -22 +#define DS_CANNOT_DELETE_FILE -23 +#define DS_UNKNOWN_SNMP_COMMAND -24 +#define DS_NON_NUMERIC_VALUE -25 +#define DS_NO_LOGFILE_NAME -26 +#define DS_CANNOT_OPEN_LOG_FILE -27 +#define DS_HAS_TOBE_READONLY_MODE -28 +#define DS_INVALID_LDIF_FILE -29 + +/* + * Types of config files. + */ +#define DS_REAL_CONFIG 1 +#define DS_TMP_CONFIG 2 + +/* + * Maximum numeric value we will accept in admin interface + * We may at some point need per-option bounds, but for now, + * there's just one global maximum. + */ +#define DS_MAX_NUMERIC_VALUE 4294967295 /* 2^32 - 1 */ + +/* Use our own macro for rpt_err, so we can put our own error code in + NMC_STATUS */ +#undef rpt_err +#define rpt_err(CODE, STR1, STR2, STR3) \ + fprintf( stdout, "NMC_ErrInfo: %s\n", (STR1) ); \ + fprintf( stdout, "NMC_STATUS: %d\n", CODE ) + +/* + * Flags for ds_display_config() + */ +#define DS_DISP_HRB 1 /* horizontal line to begin with */ +#define DS_DISP_HRE 2 /* horizontal line to end with */ +#define DS_DISP_TB 4 /* table begin */ +#define DS_DISP_TE 8 /* table end */ +#define DS_DISP_EOL 16 /* End Of Line */ +#define DS_DISP_NOMT 32 /* display only non empty */ +#define DS_DISP_NOIN 64 /* display with no input field */ +#define DS_DISP_HELP 128 /* display with a help button */ +#define DS_DISP_PLAIN 256 /* No table, no nothin */ +#define DS_SIMPLE (DS_DISP_EOL | DS_DISP_NOIN | DS_DISP_HELP) + +/* + * dci_type for ds_cfg_info + */ +#define DS_ATTR_STRING 1 +#define DS_ATTR_NUMBER 2 +#define DS_ATTR_ONOFF 3 +#define DS_ATTR_LIMIT 4 /* a number where -1 is displayed as blank */ + +struct ds_cfg_info { + char *dci_varname; + char *dci_display; + int dci_type; + char *dci_help; +}; + +extern struct ds_cfg_info ds_cfg_info[]; + +#define LDBM_DATA_SIZE 5 + +/*ldbm specific backend information*/ +struct ldbm_data { + char *tv[LDBM_DATA_SIZE][2]; /*type and value*/ +}; + + +/* + * varname for ds_showparam() + * NOTE: these must be kept in synch with the ds_cfg_info array defined + * in ../lib/dsalib_conf.c + */ +#define DS_LOGLEVEL 0 +#define DS_REFERRAL 1 +#define DS_AUDITFILE 2 +#define DS_LOCALHOST 3 +#define DS_PORT 4 +#define DS_SECURITY 5 +#define DS_SECURE_PORT 6 +#define DS_SSL3CIPHERS 7 +#define DS_PASSWDHASH 8 +#define DS_ACCESSLOG 9 +#define DS_ERRORLOG 10 +#define DS_ROOTDN 11 +#define DS_ROOTPW 12 +#define DS_SUFFIX 13 +#define DS_LOCALUSER 14 +#define DS_CFG_MAX 15 /* MUST be one greater than the last option */ + +/* These control how long we wait for the server to start up or shutdown */ +#define SERVER_START_TIMEOUT 600 /* seconds */ +#define SERVER_STOP_TIMEOUT SERVER_START_TIMEOUT /* same as start timeout */ + +typedef int (*DS_RM_RF_ERR_FUNC)(const char *path, const char *op, void *arg); + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ +extern DS_EXPORT_SYMBOL char *ds_get_server_root(); +extern DS_EXPORT_SYMBOL char *ds_get_install_root(); +extern DS_EXPORT_SYMBOL char *ds_get_admserv_based_root(); +extern DS_EXPORT_SYMBOL void ds_log_debug_message(char *msg); +extern DS_EXPORT_SYMBOL void ds_log_env(char **envp); +extern DS_EXPORT_SYMBOL int ds_get_updown_status(); +extern DS_EXPORT_SYMBOL void ds_print_startstop(int stop); +extern DS_EXPORT_SYMBOL int ds_bring_up_server_install(int verbose, + char *root, char *errorlog); +extern DS_EXPORT_SYMBOL int ds_bring_up_server(int verbose); +extern DS_EXPORT_SYMBOL char *ds_get_server_name(); +extern DS_EXPORT_SYMBOL void ds_send_error(char *errstr, int print_errno); +extern DS_EXPORT_SYMBOL void ds_send_status(char *str); +extern DS_EXPORT_SYMBOL char *ds_get_cgi_var(char *cgi_var_name); +extern DS_EXPORT_SYMBOL char *ds_get_cgi_var_simple(int index); +extern DS_EXPORT_SYMBOL char *ds_get_cgi_multiple(char *cgi_var_name); +extern DS_EXPORT_SYMBOL char *ds_get_errors_name(); +extern DS_EXPORT_SYMBOL char *ds_get_access_name(); +extern DS_EXPORT_SYMBOL char *ds_get_audit_name(); +extern DS_EXPORT_SYMBOL char *ds_get_logfile_name(int config_type); + + +extern DS_EXPORT_SYMBOL int ds_bring_down_server(); +extern DS_EXPORT_SYMBOL void ds_print_server_status(int isrunning); +extern DS_EXPORT_SYMBOL int ds_get_file_size(char *fileName); +extern DS_EXPORT_SYMBOL void ds_display_tail(char *fileName, int timeOut, + int startSeek, char *doneMsg, char *lastLine); +extern DS_EXPORT_SYMBOL char **ds_get_ldif_files(); +extern DS_EXPORT_SYMBOL int ds_ldif2db_preserve(char *file); +extern DS_EXPORT_SYMBOL int ds_ldif2db(char *file); +extern DS_EXPORT_SYMBOL int ds_ldif2db_backend_subtree(char *file, char *backend, char *subtree); +extern DS_EXPORT_SYMBOL int ds_db2ldif(char *file); +extern DS_EXPORT_SYMBOL int ds_vlvindex(char **backendList, char **attrList); +extern DS_EXPORT_SYMBOL int ds_addindex(char **attrList, char *backendName); +extern DS_EXPORT_SYMBOL int ds_db2ldif_subtree(char *file, char *subtree); +extern DS_EXPORT_SYMBOL char **ds_get_bak_dirs(); +extern DS_EXPORT_SYMBOL int ds_db2bak(char *file); +extern DS_EXPORT_SYMBOL int ds_bak2db(char *file); +extern DS_EXPORT_SYMBOL int ds_get_monitor(int frontend, char *port); +extern DS_EXPORT_SYMBOL int ds_get_bemonitor(char *bemdn, char *port); +extern DS_EXPORT_SYMBOL int ds_client_access(char *port, char *dn); +extern DS_EXPORT_SYMBOL char **ds_get_config(int type); +extern DS_EXPORT_SYMBOL char *ds_get_pwenc(char *passwd_hash, char *password); +extern DS_EXPORT_SYMBOL int ds_check_config(int type); +extern DS_EXPORT_SYMBOL int ds_check_pw(char *pwhash, char *pwclear); +extern DS_EXPORT_SYMBOL int ds_set_config(char *change_file_name); +extern DS_EXPORT_SYMBOL char **ds_get_conf_from_file(FILE *conf); +extern DS_EXPORT_SYMBOL void ds_display_config(char **ds_config); +extern DS_EXPORT_SYMBOL char *ds_get_var_name(int varnum); +extern DS_EXPORT_SYMBOL int ds_showparam(char **ds_config, int varname, int phase, + int occurance, char *dispname, int size, int maxlength, unsigned flags, + char *url); +extern DS_EXPORT_SYMBOL void ds_show_pwmaxage(char *value); +extern DS_EXPORT_SYMBOL void ds_show_pwhash(char *value); +extern DS_EXPORT_SYMBOL char *ds_get_value(char **ds_config, char *parm, int phase, int occurance); +extern DS_EXPORT_SYMBOL void ds_apply_cfg_changes(int param_list[], int changed); +extern DS_EXPORT_SYMBOL int ds_commit_cfg_changes(); +extern DS_EXPORT_SYMBOL int ds_config_updated(); +extern DS_EXPORT_SYMBOL void ds_display_header(char *font_size, char *header); +extern DS_EXPORT_SYMBOL void ds_display_message(char *font_size, char *header); +extern DS_EXPORT_SYMBOL void ds_print_file_form(char *action, char *fileptr, char *full_fileptr); +extern DS_EXPORT_SYMBOL char *ds_get_file_meaning(char *file); +extern DS_EXPORT_SYMBOL void ds_print_file_name(char *fileptr); +extern DS_EXPORT_SYMBOL int ds_file_exists(char *filename); +extern DS_EXPORT_SYMBOL int ds_cp_file(char *sfile, char *dfile, int mode); +extern DS_EXPORT_SYMBOL time_t ds_get_mtime(char *filename); +extern DS_EXPORT_SYMBOL char *ds_get_config_value( int option ); +extern DS_EXPORT_SYMBOL char **ds_get_file_list( char *dir ); +extern DS_EXPORT_SYMBOL char *ds_get_tmp_dir(); +extern DS_EXPORT_SYMBOL void ds_unixtodospath(char *szText); +extern DS_EXPORT_SYMBOL void ds_timetofname(char *szText); +extern DS_EXPORT_SYMBOL void ds_dostounixpath(char *szText); +extern DS_EXPORT_SYMBOL int ds_saferename(char *szSrc, char *szTarget); +extern DS_EXPORT_SYMBOL char *get_specific_help_button(char *help_link, + char *dispname, char *helpinfo); + +/* Change the DN to a canonical format (in place); return DN. */ +extern DS_EXPORT_SYMBOL char* dn_normalize (char* DN); + +/* Change the DN to a canonical format (in place) and convert to v3; return DN. */ +extern DS_EXPORT_SYMBOL char* dn_normalize_convert (char* DN); + +/* if dn contains an unescaped quote return true */ +extern DS_EXPORT_SYMBOL int ds_dn_uses_LDAPv2_quoting(const char *dn); + +/* Return != 0 iff the DN equals or ends with the given suffix. + Both DN and suffix must be normalized, by dn_normalize(). */ +extern DS_EXPORT_SYMBOL int dn_issuffix (char* DN, char* suffix); + +/* Return a copy of the DN, but with optional whitespace inserted. */ +extern DS_EXPORT_SYMBOL char* ds_dn_expand (char* DN); + +/* Return the value if it can be stored 'as is' in a config file. + If it requires enquoting, allocate and return its enquoted form. + The caller should free() the returned pointer iff it's != value. + On Windows, we don't want to double up on "\" characters in filespecs, + so we need to pass in the value type */ +extern DS_EXPORT_SYMBOL char* ds_enquote_config_value (int paramnum, char* value); + +/* + * Bring up a javascript alert. + */ +extern DS_EXPORT_SYMBOL void ds_alert_user(char *header, char *message); + +/* Construct and return the DN that corresponds to the give DNS name. + The caller should free() the returned pointer. */ +extern DS_EXPORT_SYMBOL char* ds_DNS_to_DN (char* DNS); + +/* Construct and return the DN of the LDAP server's own entry. + The caller must NOT free() the returned pointer. */ +extern DS_EXPORT_SYMBOL char* ds_get_config_DN (char** ds_config); + +/* Encode characters, as described in RFC 1738 section 2.2, + if they're 'unsafe' (as defined in RFC 1738), or '?' or + (as defined in RFC 1779). + The caller should free() the returned pointer. */ +extern DS_EXPORT_SYMBOL char* ds_URL_encode (const char*); + +/* Decode characters, as described in RFC 1738 section 2.2. + The caller should free() the returned pointer. */ +extern DS_EXPORT_SYMBOL char* ds_URL_decode (const char*); + +/* Encode all characters, even if 'safe' */ +extern DS_EXPORT_SYMBOL char* ds_encode_all (const char*); + +/* Change the effective UID and GID of this process to + those associated with the given localuser (if any). */ +extern DS_EXPORT_SYMBOL char* ds_become_localuser_name (char* localuser); + +/* Change the effective UID and GID of this process to + those associated with ds_config's localuser (if any). */ +extern DS_EXPORT_SYMBOL char* ds_become_localuser (char** ds_config); + +/* Change the effective UID and GID of this process back to + what they were before calling ds_become_localuser(). */ +extern DS_EXPORT_SYMBOL char* ds_become_original(); + +extern DS_EXPORT_SYMBOL char* ds_makeshort(char *filepath); + +extern DS_EXPORT_SYMBOL int ds_search_file(char *filename, char *searchstring); + +/* Begin parsing a POST in a CGI context */ +extern DS_EXPORT_SYMBOL int ds_post_begin(FILE *input); + +/* Begin parsing a GET in a CGI context */ +extern DS_EXPORT_SYMBOL void ds_get_begin(char *query_string); + +/* Display an error to the user and exit from a CGI */ +extern DS_EXPORT_SYMBOL void ds_report_error(int type, char *errmsg, char *details); + +/* Display a warning to the user */ +extern DS_EXPORT_SYMBOL void ds_report_warning(int type, char *errmsg, char *details); + +/* These functions are used by the program to alter the output behaviour +if not executing in a CGI context */ +extern DS_EXPORT_SYMBOL int ds_get_formatted_output(void); +extern DS_EXPORT_SYMBOL void ds_set_formatted_output(int val); + +/* return the value of a CGI variable */ +extern DS_EXPORT_SYMBOL char *ds_a_get_cgi_var(char *varname, char *elem_id, char *bongmsg); + +/* return a multi-valued CGI variable */ +extern DS_EXPORT_SYMBOL char **ds_a_get_cgi_multiple(char *varname, char *elem_id, char *bongmsg); + +/* open an html file */ +extern DS_EXPORT_SYMBOL FILE *ds_open_html_file(char *filename); + +/* show a message to be parsed by the non-HTML front end */ +extern DS_EXPORT_SYMBOL void ds_show_message(const char *message); + +/* show a key/value pair to be parsed by the non-HTML front end */ +extern DS_EXPORT_SYMBOL void ds_show_key_value(char *key, char *value); + +extern DS_EXPORT_SYMBOL void ds_submit(char *helptarget) ; +extern DS_EXPORT_SYMBOL char *ds_get_helpbutton(char *topic); + +extern DS_EXPORT_SYMBOL void alter_startup_line(char *startup_line); + +extern DS_EXPORT_SYMBOL int ds_dir_exists(char *fn); +extern DS_EXPORT_SYMBOL int ds_mkdir(char *dir, int mode); +extern DS_EXPORT_SYMBOL char *ds_mkdir_p(char *dir, int mode); +extern DS_EXPORT_SYMBOL char *ds_salted_sha1_pw_enc (char* pwd); +extern DS_EXPORT_SYMBOL char * ds_escape_for_shell( char *s ); + +extern DS_EXPORT_SYMBOL char **ds_string_to_vec(char *s); + +extern DS_EXPORT_SYMBOL char *ds_system_errmsg(void); + +extern DS_EXPORT_SYMBOL int ds_exec_and_report(char *cmd); + +/* remove a directory hierarchy - if the error function is given, it will be called upon + error (e.g. directory not readable, cannot remove file, etc.) - if the callback function + returns 0, this means to abort the removal, otherwise, continue +*/ +extern DS_EXPORT_SYMBOL int ds_rm_rf(const char *dir, DS_RM_RF_ERR_FUNC ds_rm_rf_err_func, void *arg); +/* + remove a registry key and report an error message if unsuccessful +*/ +extern DS_EXPORT_SYMBOL int ds_remove_reg_key(void *base, const char *format, ...); +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __dsalib_h */ diff --git a/ldap/admin/include/dsalib_pw.h b/ldap/admin/include/dsalib_pw.h new file mode 100644 index 00000000..78c22c11 --- /dev/null +++ b/ldap/admin/include/dsalib_pw.h @@ -0,0 +1,17 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ + +#ifndef __dsalib_pw_h +#define __dsalib_pw_h + +extern DS_EXPORT_SYMBOL void dsparm_help_button(char *var_name, char *dispname, + char *helpinfo); +extern DS_EXPORT_SYMBOL LDAP* bind_as_root (char** cfg, char* rootdn, + char* rootpw); +extern DS_EXPORT_SYMBOL void get_pw_policy(char*** pValue, char** cfg); +extern DS_EXPORT_SYMBOL void ds_showpw( char** cfg); + +#endif /* __dsalib_pw_h */ diff --git a/ldap/admin/include/dsalib_schema.h b/ldap/admin/include/dsalib_schema.h new file mode 100644 index 00000000..ff3488eb --- /dev/null +++ b/ldap/admin/include/dsalib_schema.h @@ -0,0 +1,255 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/* + * Routines to parse schema LDIF + * + * -atom + * + */ + +#ifndef __DSALIB_SCHEMA_H +#define __DSALIB_SCHEMA_H__ + + + +/************************************************************************ + + BNF for attributes and objectclasses: + + AttributeTypeDescription = "(" whsp + numericoid whsp ; AttributeType identifier + [ "NAME" qdescrs ] ; name used in AttributeType + [ "DESC" qdstring ] ; description + [ "OBSOLETE" whsp ] + [ "SUP" woid ] ; derived from this other + ; AttributeType + [ "EQUALITY" woid ; Matching Rule name + [ "ORDERING" woid ; Matching Rule name + [ "SUBSTR" woid ] ; Matching Rule name + [ "SYNTAX" whsp noidlen whsp ] ; see section 4.3 + [ "SINGLE-VALUE" whsp ] ; default multi-valued + [ "COLLECTIVE" whsp ] ; default not collective + [ "NO-USER-MODIFICATION" whsp ]; default user modifiable + [ "USAGE" whsp AttributeUsage ]; default user applications + whsp ")" + + + + ObjectClassDescription = "(" whsp + numericoid whsp ; ObjectClass identifier + [ "NAME" qdescrs ] + [ "DESC" qdstring ] + [ "OBSOLETE" whsp ] + [ "SUP" oids ] ; Superior ObjectClasses + [ ( "ABSTRACT" / "STRUCTURAL" / "AUXILIARY" ) whsp ] + ; default structural + [ "MUST" oids ] ; AttributeTypes + [ "MAY" oids ] ; AttributeTypes + whsp ")" + + +************************************************************************/ + + +/* + * ds_check_valid_oid: check to see if an oid is valid. + * Oids should only contain digits and dots. + * + * returns 1 if valid, 0 if not + */ + +DS_EXPORT_SYMBOL int ds_check_valid_oid (char *oid); + + +/* + * ds_check_valid_name: check to see if an attribute name or an objectclass + * name is valid. A valid name contains only digits, letters, or hyphens + * + * returns 1 if valid, 0 if not + * + */ + +DS_EXPORT_SYMBOL int ds_check_valid_name (char *name); + +/* + * ds_get_oc_desc: + * + * Input : pointer to string containing an ObjectClassDescription + * Returns : pointer to string containing objectclass DESC + * + * The caller must free the return value + * + */ + +DS_EXPORT_SYMBOL char * ds_get_oc_desc (char *oc); + + +/* + * ds_get_oc_name: + * + * Input : pointer to string containing an ObjectClassDescription + * Returns: pointer to string containing objectclass name. + * + * The caller must free the return value + * + */ + +DS_EXPORT_SYMBOL char *ds_get_oc_name (char *o); + + +/* + * ds_get_attr_name: + * + * Input : pointer to string containing an AttributeTypeDescription + * Returns: pointer to string containing an attribute name. + * + * The caller must free the return value + * + */ + +DS_EXPORT_SYMBOL char *ds_get_attr_name (char *a); + + + +/* + * ds_get_oc_superior: + * + * Input : pointer to string containing an ObjectClassDescription + * Returns: pointer to string containing the objectclass's SUP (superior/parent) + * objectclass + * + * The caller must free the return value + * + */ + +DS_EXPORT_SYMBOL char *ds_get_oc_superior (char *o); + + +/* + * ds_get_attr_desc: + * + * Input : Pointer to string containing an AttributeTypeDescription + * Returns: Pointer to string containing the attribute's description + * + * The caller must free the return value + * + */ + +DS_EXPORT_SYMBOL char *ds_get_attr_desc (char *a); + + +/* + * ds_get_attr_syntax: + * + * Input: Pointer to string containing an AttributeTypeDescription + * Returns: Pointer to string containing the attribute's syntax + * + * The caller must free the return value + * + */ + +DS_EXPORT_SYMBOL char *ds_get_attr_syntax (char *a); + + +/* + * ds_get_attr_oid: + * + * Input : Pointer to string containing an AttributeTypeDescription + * Returns: Pointer to string containing an attribute's oid + * + * The caller must free the return value + * + */ +DS_EXPORT_SYMBOL char *ds_get_attr_oid (char *a); + + +/* + * ds_get_attr_name: + * + * Input : Pointer to string containing an AttributeTypeDescription + * Returns: Pointer to string containing the attribute's name + * + * The caller must free the return value + * + */ + +DS_EXPORT_SYMBOL char *ds_get_attr_name (char *a); + + + +/* + * syntax_oid_to_english: convert an attribute syntax oid to something more + * human readable + * + * Input : string containing numeric OID for a attribute syntax + * Returns: Human readable string + */ + + +DS_EXPORT_SYMBOL char *syntax_oid_to_english (char *oid); + + +/* StripSpaces: Remove all leading and trailing spaces from a string */ + +DS_EXPORT_SYMBOL char *StripSpaces (char **s); + + +/* ds_print_required_attrs: + * + * input: pointer to string containing an ObjectClassDescription + * + * prints JavaScript array containing the required attributes of an objectclass + * The array name is oc__requires + */ + +DS_EXPORT_SYMBOL void ds_print_required_attrs (char *o); + + +/* ds_print_allowed_attrs: + * + * input: pointer to string containing an ObjectClassDescription + * + * prints JavaScript array containing the allowed attributes of an objectclass + * The array name is oc__allows + */ +DS_EXPORT_SYMBOL void ds_print_allowed_attrs (char *o); + + +/* ds_print_oc_oid: + * + * input: pointer to string containing an ObjectClassDescription + * + * prints JavaScript string containing an objectclass oid + * The variable name is oc__oid + */ + +DS_EXPORT_SYMBOL void ds_print_oc_oid (char *o); + +/* ds_print_oc_superior: + * + * input: pointer to string containing an ObjectClassDescription + * + * prints JavaScript string containing an objectclass superior + * The variable name is oc__superior + */ + +DS_EXPORT_SYMBOL void ds_print_oc_superior (char *o); + + +/* underscore2hyphen: + * transform underscores to hyphens in a string + */ + +DS_EXPORT_SYMBOL char *underscore2hyphen (char *src); + +/* hyphen2underscore: + * transform hyphens to underscores in a string + */ + +DS_EXPORT_SYMBOL char *hyphen2underscore (char *src); + + +#endif /* __DSALIB_SCHEMA_H__ */ diff --git a/ldap/admin/include/nterrors.h b/ldap/admin/include/nterrors.h new file mode 100644 index 00000000..a15c9ea0 --- /dev/null +++ b/ldap/admin/include/nterrors.h @@ -0,0 +1,728 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/* DO NOT EDIT THIS FILE - it is automatically generated */ + +struct _NtError { + int ErrorNumber; + char *ErrorString; + struct _NtError *next; +} ; + +typedef struct _NtError NtError; + +NtError NtErrorStrings[] = { +{ 0 , "ERROR_SUCCESS" }, +{ 0 , "NO_ERROR" }, +{ 1 , "ERROR_INVALID_FUNCTION" }, +{ 2 , "ERROR_FILE_NOT_FOUND" }, +{ 3 , "ERROR_PATH_NOT_FOUND" }, +{ 4 , "ERROR_TOO_MANY_OPEN_FILES" }, +{ 5 , "ERROR_ACCESS_DENIED" }, +{ 6 , "ERROR_INVALID_HANDLE" }, +{ 7 , "ERROR_ARENA_TRASHED" }, +{ 8 , "ERROR_NOT_ENOUGH_MEMORY" }, +{ 9 , "ERROR_INVALID_BLOCK" }, +{ 10 , "ERROR_BAD_ENVIRONMENT" }, +{ 11 , "ERROR_BAD_FORMAT" }, +{ 12 , "ERROR_INVALID_ACCESS" }, +{ 13 , "ERROR_INVALID_DATA" }, +{ 14 , "ERROR_OUTOFMEMORY" }, +{ 15 , "ERROR_INVALID_DRIVE" }, +{ 16 , "ERROR_CURRENT_DIRECTORY" }, +{ 17 , "ERROR_NOT_SAME_DEVICE" }, +{ 18 , "ERROR_NO_MORE_FILES" }, +{ 19 , "ERROR_WRITE_PROTECT" }, +{ 20 , "ERROR_BAD_UNIT" }, +{ 21 , "ERROR_NOT_READY" }, +{ 22 , "ERROR_BAD_COMMAND" }, +{ 23 , "ERROR_CRC" }, +{ 24 , "ERROR_BAD_LENGTH" }, +{ 25 , "ERROR_SEEK" }, +{ 26 , "ERROR_NOT_DOS_DISK" }, +{ 27 , "ERROR_SECTOR_NOT_FOUND" }, +{ 28 , "ERROR_OUT_OF_PAPER" }, +{ 29 , "ERROR_WRITE_FAULT" }, +{ 30 , "ERROR_READ_FAULT" }, +{ 31 , "ERROR_GEN_FAILURE" }, +{ 32 , "ERROR_SHARING_VIOLATION" }, +{ 33 , "ERROR_LOCK_VIOLATION" }, +{ 34 , "ERROR_WRONG_DISK" }, +{ 36 , "ERROR_SHARING_BUFFER_EXCEEDED" }, +{ 38 , "ERROR_HANDLE_EOF" }, +{ 39 , "ERROR_HANDLE_DISK_FULL" }, +{ 50 , "ERROR_NOT_SUPPORTED" }, +{ 51 , "ERROR_REM_NOT_LIST" }, +{ 52 , "ERROR_DUP_NAME" }, +{ 53 , "ERROR_BAD_NETPATH" }, +{ 54 , "ERROR_NETWORK_BUSY" }, +{ 55 , "ERROR_DEV_NOT_EXIST" }, +{ 56 , "ERROR_TOO_MANY_CMDS" }, +{ 57 , "ERROR_ADAP_HDW_ERR" }, +{ 58 , "ERROR_BAD_NET_RESP" }, +{ 59 , "ERROR_UNEXP_NET_ERR" }, +{ 60 , "ERROR_BAD_REM_ADAP" }, +{ 61 , "ERROR_PRINTQ_FULL" }, +{ 62 , "ERROR_NO_SPOOL_SPACE" }, +{ 63 , "ERROR_PRINT_CANCELLED" }, +{ 64 , "ERROR_NETNAME_DELETED" }, +{ 65 , "ERROR_NETWORK_ACCESS_DENIED" }, +{ 66 , "ERROR_BAD_DEV_TYPE" }, +{ 67 , "ERROR_BAD_NET_NAME" }, +{ 68 , "ERROR_TOO_MANY_NAMES" }, +{ 69 , "ERROR_TOO_MANY_SESS" }, +{ 70 , "ERROR_SHARING_PAUSED" }, +{ 71 , "ERROR_REQ_NOT_ACCEP" }, +{ 72 , "ERROR_REDIR_PAUSED" }, +{ 80 , "ERROR_FILE_EXISTS" }, +{ 82 , "ERROR_CANNOT_MAKE" }, +{ 83 , "ERROR_FAIL_I24" }, +{ 84 , "ERROR_OUT_OF_STRUCTURES" }, +{ 85 , "ERROR_ALREADY_ASSIGNED" }, +{ 86 , "ERROR_INVALID_PASSWORD" }, +{ 87 , "ERROR_INVALID_PARAMETER" }, +{ 88 , "ERROR_NET_WRITE_FAULT" }, +{ 89 , "ERROR_NO_PROC_SLOTS" }, +{ 100 , "ERROR_TOO_MANY_SEMAPHORES" }, +{ 101 , "ERROR_EXCL_SEM_ALREADY_OWNED" }, +{ 102 , "ERROR_SEM_IS_SET" }, +{ 103 , "ERROR_TOO_MANY_SEM_REQUESTS" }, +{ 104 , "ERROR_INVALID_AT_INTERRUPT_TIME" }, +{ 105 , "ERROR_SEM_OWNER_DIED" }, +{ 106 , "ERROR_SEM_USER_LIMIT" }, +{ 107 , "ERROR_DISK_CHANGE" }, +{ 108 , "ERROR_DRIVE_LOCKED" }, +{ 109 , "ERROR_BROKEN_PIPE" }, +{ 110 , "ERROR_OPEN_FAILED" }, +{ 111 , "ERROR_BUFFER_OVERFLOW" }, +{ 112 , "ERROR_DISK_FULL" }, +{ 113 , "ERROR_NO_MORE_SEARCH_HANDLES" }, +{ 114 , "ERROR_INVALID_TARGET_HANDLE" }, +{ 117 , "ERROR_INVALID_CATEGORY" }, +{ 118 , "ERROR_INVALID_VERIFY_SWITCH" }, +{ 119 , "ERROR_BAD_DRIVER_LEVEL" }, +{ 120 , "ERROR_CALL_NOT_IMPLEMENTED" }, +{ 121 , "ERROR_SEM_TIMEOUT" }, +{ 122 , "ERROR_INSUFFICIENT_BUFFER" }, +{ 123 , "ERROR_INVALID_NAME" }, +{ 124 , "ERROR_INVALID_LEVEL" }, +{ 125 , "ERROR_NO_VOLUME_LABEL" }, +{ 126 , "ERROR_MOD_NOT_FOUND" }, +{ 127 , "ERROR_PROC_NOT_FOUND" }, +{ 128 , "ERROR_WAIT_NO_CHILDREN" }, +{ 129 , "ERROR_CHILD_NOT_COMPLETE" }, +{ 130 , "ERROR_DIRECT_ACCESS_HANDLE" }, +{ 131 , "ERROR_NEGATIVE_SEEK" }, +{ 132 , "ERROR_SEEK_ON_DEVICE" }, +{ 133 , "ERROR_IS_JOIN_TARGET" }, +{ 134 , "ERROR_IS_JOINED" }, +{ 135 , "ERROR_IS_SUBSTED" }, +{ 136 , "ERROR_NOT_JOINED" }, +{ 137 , "ERROR_NOT_SUBSTED" }, +{ 138 , "ERROR_JOIN_TO_JOIN" }, +{ 139 , "ERROR_SUBST_TO_SUBST" }, +{ 140 , "ERROR_JOIN_TO_SUBST" }, +{ 141 , "ERROR_SUBST_TO_JOIN" }, +{ 142 , "ERROR_BUSY_DRIVE" }, +{ 143 , "ERROR_SAME_DRIVE" }, +{ 144 , "ERROR_DIR_NOT_ROOT" }, +{ 145 , "ERROR_DIR_NOT_EMPTY" }, +{ 146 , "ERROR_IS_SUBST_PATH" }, +{ 147 , "ERROR_IS_JOIN_PATH" }, +{ 148 , "ERROR_PATH_BUSY" }, +{ 149 , "ERROR_IS_SUBST_TARGET" }, +{ 150 , "ERROR_SYSTEM_TRACE" }, +{ 151 , "ERROR_INVALID_EVENT_COUNT" }, +{ 152 , "ERROR_TOO_MANY_MUXWAITERS" }, +{ 153 , "ERROR_INVALID_LIST_FORMAT" }, +{ 154 , "ERROR_LABEL_TOO_LONG" }, +{ 155 , "ERROR_TOO_MANY_TCBS" }, +{ 156 , "ERROR_SIGNAL_REFUSED" }, +{ 157 , "ERROR_DISCARDED" }, +{ 158 , "ERROR_NOT_LOCKED" }, +{ 159 , "ERROR_BAD_THREADID_ADDR" }, +{ 160 , "ERROR_BAD_ARGUMENTS" }, +{ 161 , "ERROR_BAD_PATHNAME" }, +{ 162 , "ERROR_SIGNAL_PENDING" }, +{ 164 , "ERROR_MAX_THRDS_REACHED" }, +{ 167 , "ERROR_LOCK_FAILED" }, +{ 170 , "ERROR_BUSY" }, +{ 173 , "ERROR_CANCEL_VIOLATION" }, +{ 174 , "ERROR_ATOMIC_LOCKS_NOT_SUPPORTED" }, +{ 180 , "ERROR_INVALID_SEGMENT_NUMBER" }, +{ 182 , "ERROR_INVALID_ORDINAL" }, +{ 183 , "ERROR_ALREADY_EXISTS" }, +{ 186 , "ERROR_INVALID_FLAG_NUMBER" }, +{ 187 , "ERROR_SEM_NOT_FOUND" }, +{ 188 , "ERROR_INVALID_STARTING_CODESEG" }, +{ 189 , "ERROR_INVALID_STACKSEG" }, +{ 190 , "ERROR_INVALID_MODULETYPE" }, +{ 191 , "ERROR_INVALID_EXE_SIGNATURE" }, +{ 192 , "ERROR_EXE_MARKED_INVALID" }, +{ 193 , "ERROR_BAD_EXE_FORMAT" }, +{ 194 , "ERROR_ITERATED_DATA_EXCEEDS_64k" }, +{ 195 , "ERROR_INVALID_MINALLOCSIZE" }, +{ 196 , "ERROR_DYNLINK_FROM_INVALID_RING" }, +{ 197 , "ERROR_IOPL_NOT_ENABLED" }, +{ 198 , "ERROR_INVALID_SEGDPL" }, +{ 199 , "ERROR_AUTODATASEG_EXCEEDS_64k" }, +{ 200 , "ERROR_RING2SEG_MUST_BE_MOVABLE" }, +{ 201 , "ERROR_RELOC_CHAIN_XEEDS_SEGLIM" }, +{ 202 , "ERROR_INFLOOP_IN_RELOC_CHAIN" }, +{ 203 , "ERROR_ENVVAR_NOT_FOUND" }, +{ 205 , "ERROR_NO_SIGNAL_SENT" }, +{ 206 , "ERROR_FILENAME_EXCED_RANGE" }, +{ 207 , "ERROR_RING2_STACK_IN_USE" }, +{ 208 , "ERROR_META_EXPANSION_TOO_LONG" }, +{ 209 , "ERROR_INVALID_SIGNAL_NUMBER" }, +{ 210 , "ERROR_THREAD_1_INACTIVE" }, +{ 212 , "ERROR_LOCKED" }, +{ 214 , "ERROR_TOO_MANY_MODULES" }, +{ 215 , "ERROR_NESTING_NOT_ALLOWED" }, +{ 230 , "ERROR_BAD_PIPE" }, +{ 231 , "ERROR_PIPE_BUSY" }, +{ 232 , "ERROR_NO_DATA" }, +{ 233 , "ERROR_PIPE_NOT_CONNECTED" }, +{ 234 , "ERROR_MORE_DATA" }, +{ 240 , "ERROR_VC_DISCONNECTED" }, +{ 254 , "ERROR_INVALID_EA_NAME" }, +{ 255 , "ERROR_EA_LIST_INCONSISTENT" }, +{ 259 , "ERROR_NO_MORE_ITEMS" }, +{ 266 , "ERROR_CANNOT_COPY" }, +{ 267 , "ERROR_DIRECTORY" }, +{ 275 , "ERROR_EAS_DIDNT_FIT" }, +{ 276 , "ERROR_EA_FILE_CORRUPT" }, +{ 277 , "ERROR_EA_TABLE_FULL" }, +{ 278 , "ERROR_INVALID_EA_HANDLE" }, +{ 282 , "ERROR_EAS_NOT_SUPPORTED" }, +{ 288 , "ERROR_NOT_OWNER" }, +{ 298 , "ERROR_TOO_MANY_POSTS" }, +{ 299 , "ERROR_PARTIAL_COPY" }, +{ 317 , "ERROR_MR_MID_NOT_FOUND" }, +{ 487 , "ERROR_INVALID_ADDRESS" }, +{ 534 , "ERROR_ARITHMETIC_OVERFLOW" }, +{ 535 , "ERROR_PIPE_CONNECTED" }, +{ 536 , "ERROR_PIPE_LISTENING" }, +{ 994 , "ERROR_EA_ACCESS_DENIED" }, +{ 995 , "ERROR_OPERATION_ABORTED" }, +{ 996 , "ERROR_IO_INCOMPLETE" }, +{ 997 , "ERROR_IO_PENDING" }, +{ 998 , "ERROR_NOACCESS" }, +{ 999 , "ERROR_SWAPERROR" }, +{ 1001 , "ERROR_STACK_OVERFLOW" }, +{ 1002 , "ERROR_INVALID_MESSAGE" }, +{ 1003 , "ERROR_CAN_NOT_COMPLETE" }, +{ 1004 , "ERROR_INVALID_FLAGS" }, +{ 1005 , "ERROR_UNRECOGNIZED_VOLUME" }, +{ 1006 , "ERROR_FILE_INVALID" }, +{ 1007 , "ERROR_FULLSCREEN_MODE" }, +{ 1008 , "ERROR_NO_TOKEN" }, +{ 1009 , "ERROR_BADDB" }, +{ 1010 , "ERROR_BADKEY" }, +{ 1011 , "ERROR_CANTOPEN" }, +{ 1012 , "ERROR_CANTREAD" }, +{ 1013 , "ERROR_CANTWRITE" }, +{ 1014 , "ERROR_REGISTRY_RECOVERED" }, +{ 1015 , "ERROR_REGISTRY_CORRUPT" }, +{ 1016 , "ERROR_REGISTRY_IO_FAILED" }, +{ 1017 , "ERROR_NOT_REGISTRY_FILE" }, +{ 1018 , "ERROR_KEY_DELETED" }, +{ 1019 , "ERROR_NO_LOG_SPACE" }, +{ 1020 , "ERROR_KEY_HAS_CHILDREN" }, +{ 1021 , "ERROR_CHILD_MUST_BE_VOLATILE" }, +{ 1022 , "ERROR_NOTIFY_ENUM_DIR" }, +{ 1051 , "ERROR_DEPENDENT_SERVICES_RUNNING" }, +{ 1052 , "ERROR_INVALID_SERVICE_CONTROL" }, +{ 1053 , "ERROR_SERVICE_REQUEST_TIMEOUT" }, +{ 1054 , "ERROR_SERVICE_NO_THREAD" }, +{ 1055 , "ERROR_SERVICE_DATABASE_LOCKED" }, +{ 1056 , "ERROR_SERVICE_ALREADY_RUNNING" }, +{ 1057 , "ERROR_INVALID_SERVICE_ACCOUNT" }, +{ 1058 , "ERROR_SERVICE_DISABLED" }, +{ 1059 , "ERROR_CIRCULAR_DEPENDENCY" }, +{ 1060 , "ERROR_SERVICE_DOES_NOT_EXIST" }, +{ 1061 , "ERROR_SERVICE_CANNOT_ACCEPT_CTRL" }, +{ 1062 , "ERROR_SERVICE_NOT_ACTIVE" }, +{ 1063 , "ERROR_FAILED_SERVICE_CONTROLLER_CONNECT" }, +{ 1064 , "ERROR_EXCEPTION_IN_SERVICE" }, +{ 1065 , "ERROR_DATABASE_DOES_NOT_EXIST" }, +{ 1066 , "ERROR_SERVICE_SPECIFIC_ERROR" }, +{ 1067 , "ERROR_PROCESS_ABORTED" }, +{ 1068 , "ERROR_SERVICE_DEPENDENCY_FAIL" }, +{ 1069 , "ERROR_SERVICE_LOGON_FAILED" }, +{ 1070 , "ERROR_SERVICE_START_HANG" }, +{ 1071 , "ERROR_INVALID_SERVICE_LOCK" }, +{ 1072 , "ERROR_SERVICE_MARKED_FOR_DELETE" }, +{ 1073 , "ERROR_SERVICE_EXISTS" }, +{ 1074 , "ERROR_ALREADY_RUNNING_LKG" }, +{ 1075 , "ERROR_SERVICE_DEPENDENCY_DELETED" }, +{ 1076 , "ERROR_BOOT_ALREADY_ACCEPTED" }, +{ 1077 , "ERROR_SERVICE_NEVER_STARTED" }, +{ 1078 , "ERROR_DUPLICATE_SERVICE_NAME" }, +{ 1100 , "ERROR_END_OF_MEDIA" }, +{ 1101 , "ERROR_FILEMARK_DETECTED" }, +{ 1102 , "ERROR_BEGINNING_OF_MEDIA" }, +{ 1103 , "ERROR_SETMARK_DETECTED" }, +{ 1104 , "ERROR_NO_DATA_DETECTED" }, +{ 1105 , "ERROR_PARTITION_FAILURE" }, +{ 1106 , "ERROR_INVALID_BLOCK_LENGTH" }, +{ 1107 , "ERROR_DEVICE_NOT_PARTITIONED" }, +{ 1108 , "ERROR_UNABLE_TO_LOCK_MEDIA" }, +{ 1109 , "ERROR_UNABLE_TO_UNLOAD_MEDIA" }, +{ 1110 , "ERROR_MEDIA_CHANGED" }, +{ 1111 , "ERROR_BUS_RESET" }, +{ 1112 , "ERROR_NO_MEDIA_IN_DRIVE" }, +{ 1113 , "ERROR_NO_UNICODE_TRANSLATION" }, +{ 1114 , "ERROR_DLL_INIT_FAILED" }, +{ 1115 , "ERROR_SHUTDOWN_IN_PROGRESS" }, +{ 1116 , "ERROR_NO_SHUTDOWN_IN_PROGRESS" }, +{ 1117 , "ERROR_IO_DEVICE" }, +{ 1118 , "ERROR_SERIAL_NO_DEVICE" }, +{ 1119 , "ERROR_IRQ_BUSY" }, +{ 1120 , "ERROR_MORE_WRITES" }, +{ 1121 , "ERROR_COUNTER_TIMEOUT" }, +{ 1122 , "ERROR_FLOPPY_ID_MARK_NOT_FOUND" }, +{ 1123 , "ERROR_FLOPPY_WRONG_CYLINDER" }, +{ 1124 , "ERROR_FLOPPY_UNKNOWN_ERROR" }, +{ 1125 , "ERROR_FLOPPY_BAD_REGISTERS" }, +{ 1126 , "ERROR_DISK_RECALIBRATE_FAILED" }, +{ 1127 , "ERROR_DISK_OPERATION_FAILED" }, +{ 1128 , "ERROR_DISK_RESET_FAILED" }, +{ 1129 , "ERROR_EOM_OVERFLOW" }, +{ 1130 , "ERROR_NOT_ENOUGH_SERVER_MEMORY" }, +{ 1131 , "ERROR_POSSIBLE_DEADLOCK" }, +{ 1132 , "ERROR_MAPPED_ALIGNMENT" }, +{ 1140 , "ERROR_SET_POWER_STATE_VETOED" }, +{ 1141 , "ERROR_SET_POWER_STATE_FAILED" }, +{ 1150 , "ERROR_OLD_WIN_VERSION" }, +{ 1151 , "ERROR_APP_WRONG_OS" }, +{ 1152 , "ERROR_SINGLE_INSTANCE_APP" }, +{ 1153 , "ERROR_RMODE_APP" }, +{ 1154 , "ERROR_INVALID_DLL" }, +{ 1155 , "ERROR_NO_ASSOCIATION" }, +{ 1156 , "ERROR_DDE_FAIL" }, +{ 1157 , "ERROR_DLL_NOT_FOUND" }, +{ 2202 , "ERROR_BAD_USERNAME" }, +{ 2250 , "ERROR_NOT_CONNECTED" }, +{ 2401 , "ERROR_OPEN_FILES" }, +{ 2402 , "ERROR_ACTIVE_CONNECTIONS" }, +{ 2404 , "ERROR_DEVICE_IN_USE" }, +{ 1200 , "ERROR_BAD_DEVICE" }, +{ 1201 , "ERROR_CONNECTION_UNAVAIL" }, +{ 1202 , "ERROR_DEVICE_ALREADY_REMEMBERED" }, +{ 1203 , "ERROR_NO_NET_OR_BAD_PATH" }, +{ 1204 , "ERROR_BAD_PROVIDER" }, +{ 1205 , "ERROR_CANNOT_OPEN_PROFILE" }, +{ 1206 , "ERROR_BAD_PROFILE" }, +{ 1207 , "ERROR_NOT_CONTAINER" }, +{ 1208 , "ERROR_EXTENDED_ERROR" }, +{ 1209 , "ERROR_INVALID_GROUPNAME" }, +{ 1210 , "ERROR_INVALID_COMPUTERNAME" }, +{ 1211 , "ERROR_INVALID_EVENTNAME" }, +{ 1212 , "ERROR_INVALID_DOMAINNAME" }, +{ 1213 , "ERROR_INVALID_SERVICENAME" }, +{ 1214 , "ERROR_INVALID_NETNAME" }, +{ 1215 , "ERROR_INVALID_SHARENAME" }, +{ 1216 , "ERROR_INVALID_PASSWORDNAME" }, +{ 1217 , "ERROR_INVALID_MESSAGENAME" }, +{ 1218 , "ERROR_INVALID_MESSAGEDEST" }, +{ 1219 , "ERROR_SESSION_CREDENTIAL_CONFLICT" }, +{ 1220 , "ERROR_REMOTE_SESSION_LIMIT_EXCEEDED" }, +{ 1221 , "ERROR_DUP_DOMAINNAME" }, +{ 1222 , "ERROR_NO_NETWORK" }, +{ 1223 , "ERROR_CANCELLED" }, +{ 1224 , "ERROR_USER_MAPPED_FILE" }, +{ 1225 , "ERROR_CONNECTION_REFUSED" }, +{ 1226 , "ERROR_GRACEFUL_DISCONNECT" }, +{ 1227 , "ERROR_ADDRESS_ALREADY_ASSOCIATED" }, +{ 1228 , "ERROR_ADDRESS_NOT_ASSOCIATED" }, +{ 1229 , "ERROR_CONNECTION_INVALID" }, +{ 1230 , "ERROR_CONNECTION_ACTIVE" }, +{ 1231 , "ERROR_NETWORK_UNREACHABLE" }, +{ 1232 , "ERROR_HOST_UNREACHABLE" }, +{ 1233 , "ERROR_PROTOCOL_UNREACHABLE" }, +{ 1234 , "ERROR_PORT_UNREACHABLE" }, +{ 1235 , "ERROR_REQUEST_ABORTED" }, +{ 1236 , "ERROR_CONNECTION_ABORTED" }, +{ 1237 , "ERROR_RETRY" }, +{ 1238 , "ERROR_CONNECTION_COUNT_LIMIT" }, +{ 1239 , "ERROR_LOGIN_TIME_RESTRICTION" }, +{ 1240 , "ERROR_LOGIN_WKSTA_RESTRICTION" }, +{ 1241 , "ERROR_INCORRECT_ADDRESS" }, +{ 1242 , "ERROR_ALREADY_REGISTERED" }, +{ 1243 , "ERROR_SERVICE_NOT_FOUND" }, +{ 1244 , "ERROR_NOT_AUTHENTICATED" }, +{ 1245 , "ERROR_NOT_LOGGED_ON" }, +{ 1246 , "ERROR_CONTINUE" }, +{ 1247 , "ERROR_ALREADY_INITIALIZED" }, +{ 1248 , "ERROR_NO_MORE_DEVICES" }, +{ 1300 , "ERROR_NOT_ALL_ASSIGNED" }, +{ 1301 , "ERROR_SOME_NOT_MAPPED" }, +{ 1302 , "ERROR_NO_QUOTAS_FOR_ACCOUNT" }, +{ 1303 , "ERROR_LOCAL_USER_SESSION_KEY" }, +{ 1304 , "ERROR_NULL_LM_PASSWORD" }, +{ 1305 , "ERROR_UNKNOWN_REVISION" }, +{ 1306 , "ERROR_REVISION_MISMATCH" }, +{ 1307 , "ERROR_INVALID_OWNER" }, +{ 1308 , "ERROR_INVALID_PRIMARY_GROUP" }, +{ 1309 , "ERROR_NO_IMPERSONATION_TOKEN" }, +{ 1310 , "ERROR_CANT_DISABLE_MANDATORY" }, +{ 1311 , "ERROR_NO_LOGON_SERVERS" }, +{ 1312 , "ERROR_NO_SUCH_LOGON_SESSION" }, +{ 1313 , "ERROR_NO_SUCH_PRIVILEGE" }, +{ 1314 , "ERROR_PRIVILEGE_NOT_HELD" }, +{ 1315 , "ERROR_INVALID_ACCOUNT_NAME" }, +{ 1316 , "ERROR_USER_EXISTS" }, +{ 1317 , "ERROR_NO_SUCH_USER" }, +{ 1318 , "ERROR_GROUP_EXISTS" }, +{ 1319 , "ERROR_NO_SUCH_GROUP" }, +{ 1320 , "ERROR_MEMBER_IN_GROUP" }, +{ 1321 , "ERROR_MEMBER_NOT_IN_GROUP" }, +{ 1322 , "ERROR_LAST_ADMIN" }, +{ 1323 , "ERROR_WRONG_PASSWORD" }, +{ 1324 , "ERROR_ILL_FORMED_PASSWORD" }, +{ 1325 , "ERROR_PASSWORD_RESTRICTION" }, +{ 1326 , "ERROR_LOGON_FAILURE" }, +{ 1327 , "ERROR_ACCOUNT_RESTRICTION" }, +{ 1328 , "ERROR_INVALID_LOGON_HOURS" }, +{ 1329 , "ERROR_INVALID_WORKSTATION" }, +{ 1330 , "ERROR_PASSWORD_EXPIRED" }, +{ 1331 , "ERROR_ACCOUNT_DISABLED" }, +{ 1332 , "ERROR_NONE_MAPPED" }, +{ 1333 , "ERROR_TOO_MANY_LUIDS_REQUESTED" }, +{ 1334 , "ERROR_LUIDS_EXHAUSTED" }, +{ 1335 , "ERROR_INVALID_SUB_AUTHORITY" }, +{ 1336 , "ERROR_INVALID_ACL" }, +{ 1337 , "ERROR_INVALID_SID" }, +{ 1338 , "ERROR_INVALID_SECURITY_DESCR" }, +{ 1340 , "ERROR_BAD_INHERITANCE_ACL" }, +{ 1341 , "ERROR_SERVER_DISABLED" }, +{ 1342 , "ERROR_SERVER_NOT_DISABLED" }, +{ 1343 , "ERROR_INVALID_ID_AUTHORITY" }, +{ 1344 , "ERROR_ALLOTTED_SPACE_EXCEEDED" }, +{ 1345 , "ERROR_INVALID_GROUP_ATTRIBUTES" }, +{ 1346 , "ERROR_BAD_IMPERSONATION_LEVEL" }, +{ 1347 , "ERROR_CANT_OPEN_ANONYMOUS" }, +{ 1348 , "ERROR_BAD_VALIDATION_CLASS" }, +{ 1349 , "ERROR_BAD_TOKEN_TYPE" }, +{ 1350 , "ERROR_NO_SECURITY_ON_OBJECT" }, +{ 1351 , "ERROR_CANT_ACCESS_DOMAIN_INFO" }, +{ 1352 , "ERROR_INVALID_SERVER_STATE" }, +{ 1353 , "ERROR_INVALID_DOMAIN_STATE" }, +{ 1354 , "ERROR_INVALID_DOMAIN_ROLE" }, +{ 1355 , "ERROR_NO_SUCH_DOMAIN" }, +{ 1356 , "ERROR_DOMAIN_EXISTS" }, +{ 1357 , "ERROR_DOMAIN_LIMIT_EXCEEDED" }, +{ 1358 , "ERROR_INTERNAL_DB_CORRUPTION" }, +{ 1359 , "ERROR_INTERNAL_ERROR" }, +{ 1360 , "ERROR_GENERIC_NOT_MAPPED" }, +{ 1361 , "ERROR_BAD_DESCRIPTOR_FORMAT" }, +{ 1362 , "ERROR_NOT_LOGON_PROCESS" }, +{ 1363 , "ERROR_LOGON_SESSION_EXISTS" }, +{ 1364 , "ERROR_NO_SUCH_PACKAGE" }, +{ 1365 , "ERROR_BAD_LOGON_SESSION_STATE" }, +{ 1366 , "ERROR_LOGON_SESSION_COLLISION" }, +{ 1367 , "ERROR_INVALID_LOGON_TYPE" }, +{ 1368 , "ERROR_CANNOT_IMPERSONATE" }, +{ 1369 , "ERROR_RXACT_INVALID_STATE" }, +{ 1370 , "ERROR_RXACT_COMMIT_FAILURE" }, +{ 1371 , "ERROR_SPECIAL_ACCOUNT" }, +{ 1372 , "ERROR_SPECIAL_GROUP" }, +{ 1373 , "ERROR_SPECIAL_USER" }, +{ 1374 , "ERROR_MEMBERS_PRIMARY_GROUP" }, +{ 1375 , "ERROR_TOKEN_ALREADY_IN_USE" }, +{ 1376 , "ERROR_NO_SUCH_ALIAS" }, +{ 1377 , "ERROR_MEMBER_NOT_IN_ALIAS" }, +{ 1378 , "ERROR_MEMBER_IN_ALIAS" }, +{ 1379 , "ERROR_ALIAS_EXISTS" }, +{ 1380 , "ERROR_LOGON_NOT_GRANTED" }, +{ 1381 , "ERROR_TOO_MANY_SECRETS" }, +{ 1382 , "ERROR_SECRET_TOO_LONG" }, +{ 1383 , "ERROR_INTERNAL_DB_ERROR" }, +{ 1384 , "ERROR_TOO_MANY_CONTEXT_IDS" }, +{ 1385 , "ERROR_LOGON_TYPE_NOT_GRANTED" }, +{ 1386 , "ERROR_NT_CROSS_ENCRYPTION_REQUIRED" }, +{ 1387 , "ERROR_NO_SUCH_MEMBER" }, +{ 1388 , "ERROR_INVALID_MEMBER" }, +{ 1389 , "ERROR_TOO_MANY_SIDS" }, +{ 1390 , "ERROR_LM_CROSS_ENCRYPTION_REQUIRED" }, +{ 1391 , "ERROR_NO_INHERITANCE" }, +{ 1392 , "ERROR_FILE_CORRUPT" }, +{ 1393 , "ERROR_DISK_CORRUPT" }, +{ 1394 , "ERROR_NO_USER_SESSION_KEY" }, +{ 1395 , "ERROR_LICENSE_QUOTA_EXCEEDED" }, +{ 1400 , "ERROR_INVALID_WINDOW_HANDLE" }, +{ 1401 , "ERROR_INVALID_MENU_HANDLE" }, +{ 1402 , "ERROR_INVALID_CURSOR_HANDLE" }, +{ 1403 , "ERROR_INVALID_ACCEL_HANDLE" }, +{ 1404 , "ERROR_INVALID_HOOK_HANDLE" }, +{ 1405 , "ERROR_INVALID_DWP_HANDLE" }, +{ 1406 , "ERROR_TLW_WITH_WSCHILD" }, +{ 1407 , "ERROR_CANNOT_FIND_WND_CLASS" }, +{ 1408 , "ERROR_WINDOW_OF_OTHER_THREAD" }, +{ 1409 , "ERROR_HOTKEY_ALREADY_REGISTERED" }, +{ 1410 , "ERROR_CLASS_ALREADY_EXISTS" }, +{ 1411 , "ERROR_CLASS_DOES_NOT_EXIST" }, +{ 1412 , "ERROR_CLASS_HAS_WINDOWS" }, +{ 1413 , "ERROR_INVALID_INDEX" }, +{ 1414 , "ERROR_INVALID_ICON_HANDLE" }, +{ 1415 , "ERROR_PRIVATE_DIALOG_INDEX" }, +{ 1416 , "ERROR_LISTBOX_ID_NOT_FOUND" }, +{ 1417 , "ERROR_NO_WILDCARD_CHARACTERS" }, +{ 1418 , "ERROR_CLIPBOARD_NOT_OPEN" }, +{ 1419 , "ERROR_HOTKEY_NOT_REGISTERED" }, +{ 1420 , "ERROR_WINDOW_NOT_DIALOG" }, +{ 1421 , "ERROR_CONTROL_ID_NOT_FOUND" }, +{ 1422 , "ERROR_INVALID_COMBOBOX_MESSAGE" }, +{ 1423 , "ERROR_WINDOW_NOT_COMBOBOX" }, +{ 1424 , "ERROR_INVALID_EDIT_HEIGHT" }, +{ 1425 , "ERROR_DC_NOT_FOUND" }, +{ 1426 , "ERROR_INVALID_HOOK_FILTER" }, +{ 1427 , "ERROR_INVALID_FILTER_PROC" }, +{ 1428 , "ERROR_HOOK_NEEDS_HMOD" }, +{ 1429 , "ERROR_GLOBAL_ONLY_HOOK" }, +{ 1430 , "ERROR_JOURNAL_HOOK_SET" }, +{ 1431 , "ERROR_HOOK_NOT_INSTALLED" }, +{ 1432 , "ERROR_INVALID_LB_MESSAGE" }, +{ 1433 , "ERROR_SETCOUNT_ON_BAD_LB" }, +{ 1434 , "ERROR_LB_WITHOUT_TABSTOPS" }, +{ 1435 , "ERROR_DESTROY_OBJECT_OF_OTHER_THREAD" }, +{ 1436 , "ERROR_CHILD_WINDOW_MENU" }, +{ 1437 , "ERROR_NO_SYSTEM_MENU" }, +{ 1438 , "ERROR_INVALID_MSGBOX_STYLE" }, +{ 1439 , "ERROR_INVALID_SPI_VALUE" }, +{ 1440 , "ERROR_SCREEN_ALREADY_LOCKED" }, +{ 1441 , "ERROR_HWNDS_HAVE_DIFF_PARENT" }, +{ 1442 , "ERROR_NOT_CHILD_WINDOW" }, +{ 1443 , "ERROR_INVALID_GW_COMMAND" }, +{ 1444 , "ERROR_INVALID_THREAD_ID" }, +{ 1445 , "ERROR_NON_MDICHILD_WINDOW" }, +{ 1446 , "ERROR_POPUP_ALREADY_ACTIVE" }, +{ 1447 , "ERROR_NO_SCROLLBARS" }, +{ 1448 , "ERROR_INVALID_SCROLLBAR_RANGE" }, +{ 1449 , "ERROR_INVALID_SHOWWIN_COMMAND" }, +{ 1450 , "ERROR_NO_SYSTEM_RESOURCES" }, +{ 1451 , "ERROR_NONPAGED_SYSTEM_RESOURCES" }, +{ 1452 , "ERROR_PAGED_SYSTEM_RESOURCES" }, +{ 1453 , "ERROR_WORKING_SET_QUOTA" }, +{ 1454 , "ERROR_PAGEFILE_QUOTA" }, +{ 1455 , "ERROR_COMMITMENT_LIMIT" }, +{ 1456 , "ERROR_MENU_ITEM_NOT_FOUND" }, +{ 1500 , "ERROR_EVENTLOG_FILE_CORRUPT" }, +{ 1501 , "ERROR_EVENTLOG_CANT_START" }, +{ 1502 , "ERROR_LOG_FILE_FULL" }, +{ 1503 , "ERROR_EVENTLOG_FILE_CHANGED" }, +{ 1700 , "RPC_S_INVALID_STRING_BINDING" }, +{ 1701 , "RPC_S_WRONG_KIND_OF_BINDING" }, +{ 1702 , "RPC_S_INVALID_BINDING" }, +{ 1703 , "RPC_S_PROTSEQ_NOT_SUPPORTED" }, +{ 1704 , "RPC_S_INVALID_RPC_PROTSEQ" }, +{ 1705 , "RPC_S_INVALID_STRING_UUID" }, +{ 1706 , "RPC_S_INVALID_ENDPOINT_FORMAT" }, +{ 1707 , "RPC_S_INVALID_NET_ADDR" }, +{ 1708 , "RPC_S_NO_ENDPOINT_FOUND" }, +{ 1709 , "RPC_S_INVALID_TIMEOUT" }, +{ 1710 , "RPC_S_OBJECT_NOT_FOUND" }, +{ 1711 , "RPC_S_ALREADY_REGISTERED" }, +{ 1712 , "RPC_S_TYPE_ALREADY_REGISTERED" }, +{ 1713 , "RPC_S_ALREADY_LISTENING" }, +{ 1714 , "RPC_S_NO_PROTSEQS_REGISTERED" }, +{ 1715 , "RPC_S_NOT_LISTENING" }, +{ 1716 , "RPC_S_UNKNOWN_MGR_TYPE" }, +{ 1717 , "RPC_S_UNKNOWN_IF" }, +{ 1718 , "RPC_S_NO_BINDINGS" }, +{ 1719 , "RPC_S_NO_PROTSEQS" }, +{ 1720 , "RPC_S_CANT_CREATE_ENDPOINT" }, +{ 1721 , "RPC_S_OUT_OF_RESOURCES" }, +{ 1722 , "RPC_S_SERVER_UNAVAILABLE" }, +{ 1723 , "RPC_S_SERVER_TOO_BUSY" }, +{ 1724 , "RPC_S_INVALID_NETWORK_OPTIONS" }, +{ 1725 , "RPC_S_NO_CALL_ACTIVE" }, +{ 1726 , "RPC_S_CALL_FAILED" }, +{ 1727 , "RPC_S_CALL_FAILED_DNE" }, +{ 1728 , "RPC_S_PROTOCOL_ERROR" }, +{ 1730 , "RPC_S_UNSUPPORTED_TRANS_SYN" }, +{ 1732 , "RPC_S_UNSUPPORTED_TYPE" }, +{ 1733 , "RPC_S_INVALID_TAG" }, +{ 1734 , "RPC_S_INVALID_BOUND" }, +{ 1735 , "RPC_S_NO_ENTRY_NAME" }, +{ 1736 , "RPC_S_INVALID_NAME_SYNTAX" }, +{ 1737 , "RPC_S_UNSUPPORTED_NAME_SYNTAX" }, +{ 1739 , "RPC_S_UUID_NO_ADDRESS" }, +{ 1740 , "RPC_S_DUPLICATE_ENDPOINT" }, +{ 1741 , "RPC_S_UNKNOWN_AUTHN_TYPE" }, +{ 1742 , "RPC_S_MAX_CALLS_TOO_SMALL" }, +{ 1743 , "RPC_S_STRING_TOO_LONG" }, +{ 1744 , "RPC_S_PROTSEQ_NOT_FOUND" }, +{ 1745 , "RPC_S_PROCNUM_OUT_OF_RANGE" }, +{ 1746 , "RPC_S_BINDING_HAS_NO_AUTH" }, +{ 1747 , "RPC_S_UNKNOWN_AUTHN_SERVICE" }, +{ 1748 , "RPC_S_UNKNOWN_AUTHN_LEVEL" }, +{ 1749 , "RPC_S_INVALID_AUTH_IDENTITY" }, +{ 1750 , "RPC_S_UNKNOWN_AUTHZ_SERVICE" }, +{ 1751 , "EPT_S_INVALID_ENTRY" }, +{ 1752 , "EPT_S_CANT_PERFORM_OP" }, +{ 1753 , "EPT_S_NOT_REGISTERED" }, +{ 1754 , "RPC_S_NOTHING_TO_EXPORT" }, +{ 1755 , "RPC_S_INCOMPLETE_NAME" }, +{ 1756 , "RPC_S_INVALID_VERS_OPTION" }, +{ 1757 , "RPC_S_NO_MORE_MEMBERS" }, +{ 1758 , "RPC_S_NOT_ALL_OBJS_UNEXPORTED" }, +{ 1759 , "RPC_S_INTERFACE_NOT_FOUND" }, +{ 1760 , "RPC_S_ENTRY_ALREADY_EXISTS" }, +{ 1761 , "RPC_S_ENTRY_NOT_FOUND" }, +{ 1762 , "RPC_S_NAME_SERVICE_UNAVAILABLE" }, +{ 1763 , "RPC_S_INVALID_NAF_ID" }, +{ 1764 , "RPC_S_CANNOT_SUPPORT" }, +{ 1765 , "RPC_S_NO_CONTEXT_AVAILABLE" }, +{ 1766 , "RPC_S_INTERNAL_ERROR" }, +{ 1767 , "RPC_S_ZERO_DIVIDE" }, +{ 1768 , "RPC_S_ADDRESS_ERROR" }, +{ 1769 , "RPC_S_FP_DIV_ZERO" }, +{ 1770 , "RPC_S_FP_UNDERFLOW" }, +{ 1771 , "RPC_S_FP_OVERFLOW" }, +{ 1772 , "RPC_X_NO_MORE_ENTRIES" }, +{ 1773 , "RPC_X_SS_CHAR_TRANS_OPEN_FAIL" }, +{ 1774 , "RPC_X_SS_CHAR_TRANS_SHORT_FILE" }, +{ 1775 , "RPC_X_SS_IN_NULL_CONTEXT" }, +{ 1777 , "RPC_X_SS_CONTEXT_DAMAGED" }, +{ 1778 , "RPC_X_SS_HANDLES_MISMATCH" }, +{ 1779 , "RPC_X_SS_CANNOT_GET_CALL_HANDLE" }, +{ 1780 , "RPC_X_NULL_REF_POINTER" }, +{ 1781 , "RPC_X_ENUM_VALUE_OUT_OF_RANGE" }, +{ 1782 , "RPC_X_BYTE_COUNT_TOO_SMALL" }, +{ 1783 , "RPC_X_BAD_STUB_DATA" }, +{ 1784 , "ERROR_INVALID_USER_BUFFER" }, +{ 1785 , "ERROR_UNRECOGNIZED_MEDIA" }, +{ 1786 , "ERROR_NO_TRUST_LSA_SECRET" }, +{ 1787 , "ERROR_NO_TRUST_SAM_ACCOUNT" }, +{ 1788 , "ERROR_TRUSTED_DOMAIN_FAILURE" }, +{ 1789 , "ERROR_TRUSTED_RELATIONSHIP_FAILURE" }, +{ 1790 , "ERROR_TRUST_FAILURE" }, +{ 1791 , "RPC_S_CALL_IN_PROGRESS" }, +{ 1792 , "ERROR_NETLOGON_NOT_STARTED" }, +{ 1793 , "ERROR_ACCOUNT_EXPIRED" }, +{ 1794 , "ERROR_REDIRECTOR_HAS_OPEN_HANDLES" }, +{ 1795 , "ERROR_PRINTER_DRIVER_ALREADY_INSTALLED" }, +{ 1796 , "ERROR_UNKNOWN_PORT" }, +{ 1797 , "ERROR_UNKNOWN_PRINTER_DRIVER" }, +{ 1798 , "ERROR_UNKNOWN_PRINTPROCESSOR" }, +{ 1799 , "ERROR_INVALID_SEPARATOR_FILE" }, +{ 1800 , "ERROR_INVALID_PRIORITY" }, +{ 1801 , "ERROR_INVALID_PRINTER_NAME" }, +{ 1802 , "ERROR_PRINTER_ALREADY_EXISTS" }, +{ 1803 , "ERROR_INVALID_PRINTER_COMMAND" }, +{ 1804 , "ERROR_INVALID_DATATYPE" }, +{ 1805 , "ERROR_INVALID_ENVIRONMENT" }, +{ 1806 , "RPC_S_NO_MORE_BINDINGS" }, +{ 1807 , "ERROR_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT" }, +{ 1808 , "ERROR_NOLOGON_WORKSTATION_TRUST_ACCOUNT" }, +{ 1809 , "ERROR_NOLOGON_SERVER_TRUST_ACCOUNT" }, +{ 1810 , "ERROR_DOMAIN_TRUST_INCONSISTENT" }, +{ 1811 , "ERROR_SERVER_HAS_OPEN_HANDLES" }, +{ 1812 , "ERROR_RESOURCE_DATA_NOT_FOUND" }, +{ 1813 , "ERROR_RESOURCE_TYPE_NOT_FOUND" }, +{ 1814 , "ERROR_RESOURCE_NAME_NOT_FOUND" }, +{ 1815 , "ERROR_RESOURCE_LANG_NOT_FOUND" }, +{ 1816 , "ERROR_NOT_ENOUGH_QUOTA" }, +{ 1817 , "RPC_S_NO_INTERFACES" }, +{ 1818 , "RPC_S_CALL_CANCELLED" }, +{ 1819 , "RPC_S_BINDING_INCOMPLETE" }, +{ 1820 , "RPC_S_COMM_FAILURE" }, +{ 1821 , "RPC_S_UNSUPPORTED_AUTHN_LEVEL" }, +{ 1822 , "RPC_S_NO_PRINC_NAME" }, +{ 1823 , "RPC_S_NOT_RPC_ERROR" }, +{ 1824 , "RPC_S_UUID_LOCAL_ONLY" }, +{ 1825 , "RPC_S_SEC_PKG_ERROR" }, +{ 1826 , "RPC_S_NOT_CANCELLED" }, +{ 1827 , "RPC_X_INVALID_ES_ACTION" }, +{ 1828 , "RPC_X_WRONG_ES_VERSION" }, +{ 1829 , "RPC_X_WRONG_STUB_VERSION" }, +{ 1898 , "RPC_S_GROUP_MEMBER_NOT_FOUND" }, +{ 1899 , "EPT_S_CANT_CREATE" }, +{ 1900 , "RPC_S_INVALID_OBJECT" }, +{ 1901 , "ERROR_INVALID_TIME" }, +{ 1902 , "ERROR_INVALID_FORM_NAME" }, +{ 1903 , "ERROR_INVALID_FORM_SIZE" }, +{ 1904 , "ERROR_ALREADY_WAITING" }, +{ 1905 , "ERROR_PRINTER_DELETED" }, +{ 1906 , "ERROR_INVALID_PRINTER_STATE" }, +{ 1907 , "ERROR_PASSWORD_MUST_CHANGE" }, +{ 1908 , "ERROR_DOMAIN_CONTROLLER_NOT_FOUND" }, +{ 1909 , "ERROR_ACCOUNT_LOCKED_OUT" }, +{ 6118 , "ERROR_NO_BROWSER_SERVERS_FOUND" }, +{ 2000 , "ERROR_INVALID_PIXEL_FORMAT" }, +{ 2001 , "ERROR_BAD_DRIVER" }, +{ 2002 , "ERROR_INVALID_WINDOW_STYLE" }, +{ 2003 , "ERROR_METAFILE_NOT_SUPPORTED" }, +{ 2004 , "ERROR_TRANSFORM_NOT_SUPPORTED" }, +{ 2005 , "ERROR_CLIPPING_NOT_SUPPORTED" }, +{ 3000 , "ERROR_UNKNOWN_PRINT_MONITOR" }, +{ 3001 , "ERROR_PRINTER_DRIVER_IN_USE" }, +{ 3002 , "ERROR_SPOOL_FILE_NOT_FOUND" }, +{ 3003 , "ERROR_SPL_NO_STARTDOC" }, +{ 3004 , "ERROR_SPL_NO_ADDJOB" }, +{ 3005 , "ERROR_PRINT_PROCESSOR_ALREADY_INSTALLED" }, +{ 3006 , "ERROR_PRINT_MONITOR_ALREADY_INSTALLED" }, +{ 4000 , "ERROR_WINS_INTERNAL" }, +{ 4001 , "ERROR_CAN_NOT_DEL_LOCAL_WINS" }, +{ 4002 , "ERROR_STATIC_INIT" }, +{ 4003 , "ERROR_INC_BACKUP" }, +{ 4004 , "ERROR_FULL_BACKUP" }, +{ 4005 , "ERROR_REC_NON_EXISTENT" }, +{ 4006 , "ERROR_RPL_NOT_ALLOWED" }, +{ 10004 , "WSAEINTR" }, +{ 10009 , "WSAEBADF" }, +{ 10013 , "WSAEACCES" }, +{ 10014 , "WSAEFAULT" }, +{ 10022 , "WSAEINVAL" }, +{ 10024 , "WSAEMFILE" }, +{ 10035 , "WSAEWOULDBLOCK" }, +{ 10036 , "WSAEINPROGRESS" }, +{ 10037 , "WSAEALREADY" }, +{ 10038 , "WSAENOTSOCK" }, +{ 10039 , "WSAEDESTADDRREQ" }, +{ 10040 , "WSAEMSGSIZE" }, +{ 10041 , "WSAEPROTOTYPE" }, +{ 10042 , "WSAENOPROTOOPT" }, +{ 10043 , "WSAEPROTONOSUPPORT" }, +{ 10044 , "WSAESOCKTNOSUPPORT" }, +{ 10045 , "WSAEOPNOTSUPP" }, +{ 10046 , "WSAEPFNOSUPPORT" }, +{ 10047 , "WSAEAFNOSUPPORT" }, +{ 10048 , "WSAEADDRINUSE" }, +{ 10049 , "WSAEADDRNOTAVAIL" }, +{ 10050 , "WSAENETDOWN" }, +{ 10051 , "WSAENETUNREACH" }, +{ 10052 , "WSAENETRESET" }, +{ 10053 , "WSAECONNABORTED" }, +{ 10054 , "WSAECONNRESET" }, +{ 10055 , "WSAENOBUFS" }, +{ 10056 , "WSAEISCONN" }, +{ 10057 , "WSAENOTCONN" }, +{ 10058 , "WSAESHUTDOWN" }, +{ 10059 , "WSAETOOMANYREFS" }, +{ 10060 , "WSAETIMEDOUT" }, +{ 10061 , "WSAECONNREFUSED" }, +{ 10062 , "WSAELOOP" }, +{ 10063 , "WSAENAMETOOLONG" }, +{ 10064 , "WSAEHOSTDOWN" }, +{ 10065 , "WSAEHOSTUNREACH" }, +{ 10066 , "WSAENOTEMPTY" }, +{ 10067 , "WSAEPROCLIM" }, +{ 10068 , "WSAEUSERS" }, +{ 10069 , "WSAEDQUOT" }, +{ 10070 , "WSAESTALE" }, +{ 10071 , "WSAEREMOTE" }, +{ 10101 , "WSAEDISCON" }, +{ 10091 , "WSASYSNOTREADY" }, +{ 10092 , "WSAVERNOTSUPPORTED" }, +{ 10093 , "WSANOTINITIALISED" }, +{ 11001 , "WSAHOST_NOT_FOUND" }, +{ 11002 , "WSATRY_AGAIN" }, +{ 11003 , "WSANO_RECOVERY" }, +{ 11004 , "WSANO_DATA" }, +{ 0, NULL } +}; diff --git a/ldap/admin/lib/Makefile b/ldap/admin/lib/Makefile new file mode 100644 index 00000000..8aa9a705 --- /dev/null +++ b/ldap/admin/lib/Makefile @@ -0,0 +1,108 @@ +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# +# GNU Makefile for Directory Server Admin DLL/SO. +# + +LDAP_SRC = ../.. +MCOM_ROOT = ../../../.. + +NOSTDCLEAN=true # don't let nsconfig.mk define target clean +NOSTDSTRIP=true # don't let nsconfig.mk define target strip +NSPR20=true # probably should be defined somewhere else (not sure where) + +OBJDEST = $(LDAP_ADMOBJDIR) +LIBDIR = $(LDAP_LIBDIR) +ALIBDIR = $(LDAP_ADMLIBDIR) +BINDIR=$(LDAP_ADMIN_BIN_RELDIR) + +include $(MCOM_ROOT)/ldapserver/nsdefs.mk +include $(MCOM_ROOT)/ldapserver/nsconfig.mk +include $(LDAP_SRC)/nsldap.mk + +SRCS = dsalib_location.c dsalib_debug.c dsalib_updown.c dsalib_tailf.c \ + dsalib_ldif.c dsalib_db.c dsalib_conf.c dsalib_html.c \ + dsalib_filename.c dsalib_util.c dsalib_dn.c dsalib_confs.c dsalib_pw.c + +PWDOBJ=$(OBJDIR)/lib/libpwdstorage/ssha_pwd.o + +OBJS1 = $(addprefix $(OBJDEST)/, $(subst .c,.o,$(SRCS))) +OBJS = $(OBJS1) $(PWDOBJ) + +INCLUDES += -I$(LDAP_SRC)/admin/include +ifdef FORTEZZA +INCLUDES += -I$(MCOM_ROOT)/lib +endif + +EXTRA_LIBS += $(LDAP_COMMON_LIBS) $(SECURITYLINK) $(NSPRLINK) + +LIBS= $(LDAP_ADMDLLDIR)/libds_admin$(DLL_PRESUF).$(DLL_SUFFIX) +ifeq ($(ARCH), WINNT) +IMPLIB= /IMPLIB:$(LDAP_ADMLIBDIR)/libds_admin.lib +MAPFILE= /MAP:$(LDAP_ADMLIBDIR)/libds_admin.map +EXTRA_LIBS_DEP += $(LDAP_COMMON_LIBS_DEP) $(LDAP_LIBLDIF_DEP) +#EXTRA_LIBS += $(LDAP_COMMON_LIBS) $(LDAP_LIBLDIF) $(LDAP_SDK_LIBLDAP_DLL) \ +# $(ADMINUTIL_LINK) $(SECURITYLINK) $(NSPRLINK) +else # WINNT +ifdef FORTEZZA +# libci.a needs to be recompiled with the -Z option on HPUX, until then, +# we'll link libci.a with the executables which need it -atom +ifneq ($(ARCH), HPUX) +EXTRA_LIBS_DEP += $(FORTEZZA_DRIVER) +EXTRA_LIBS += $(FORTEZZA_DRIVER) +endif # !HPUX +endif # FORTEZZA +endif # WINNT + +ifeq ($(ARCH), Linux) +# XXXsspitzer: we do this so that cgi's the link against libds_admin.so +# will be able to find libns-dshttpd.so at run time. Only platforms that +# build with gcc need to do this. +RPATHFLAG_EXTRAS+=:../..:.. +endif # Linux + +ifeq ($(ARCH), AIX) +EXTRA_LIBS_DEP += $(LDAPSDK_DEP) +#EXTRA_LIBS += $(LDAP_SDK_LIBLDAP_DLL) $(SECURITYLINK) $(ADMINUTIL_LINK) $(NSPRLINK) $(DBMLINK) +LD=ld -noquiet +endif + +# for Solaris, our most common unix build platform, we check for undefined symbols +# at link time so we don't catch them at run time. To do this, we set the -z defs +# flag. We also have to add -lc to the end because, even though ld and cc link with +# it implicitly, -z defs will throw errors if we do not link with it explicitly +ifeq ($(ARCH), SOLARIS) +LINK_DLL += -z defs +EXTRA_LIBS += -lc +endif + +all: $(LIBS) $(LDAP_ADMDLL_RELDLLS) + +$(LIBS): $(OBJDEST) $(LDAP_ADMDLLDIR) $(LDAP_ADMLIBDIR) $(OBJS) $(EXTRA_LIBS_DEP) + $(LINK_DLL) $(IMPLIB) $(MAPFILE) $(EXTRA_LIBS) + +ifeq ($(ARCH), WINNT) +$(LDAP_ADMDLL_RELDLLS): $(LIBS) $(LDAP_ADMDLL_RELDIRS) + cp $< $@ + +endif + +veryclean: clean + +clean: + -$(RM) $(OBJS1) + -$(RM) $(LIBS) +ifeq ($(ARCH), WINNT) + -$(RM) $(IMPLIB) +endif + +$(OBJS1): $(OBJDEST)/%.o: %.c + $(CC) -c $(NONSHARED) $(CFLAGS) $(MCC_INCLUDE) $(OFFLAG)$(OBJDEST)/$*.o $*.c +ifdef USE_LINT + $(LINT) $(LINTCCFLAGS) $(DEFS) $(MCC_SERVER) $(INCLUDES) $(MCC_INCLUDE) $*.c > $(OBJDEST)/$*.ln 2>&1 +endif diff --git a/ldap/admin/lib/dsalib_conf.c b/ldap/admin/lib/dsalib_conf.c new file mode 100644 index 00000000..cc331619 --- /dev/null +++ b/ldap/admin/lib/dsalib_conf.c @@ -0,0 +1,213 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#if defined( XP_WIN32 ) +#include +#include +#endif +#include +#include +#include +#include + +#include "dsalib.h" +#include +#include "portable.h" +#include + +#define CONF_FILE_NAME "config/dse.ldif" +#define CONF_SUFFIX "cn=config" + +DS_EXPORT_SYMBOL char * +ds_get_var_name(int varnum) +{ + if ( (varnum >= DS_CFG_MAX) || (varnum < 0) ) + return(NULL); /* failure */ + return(ds_cfg_info[varnum].dci_varname); +} + +/* + * Get config info. + */ +DS_EXPORT_SYMBOL char ** +ds_get_config(int type) +{ + char conffile[PATH_MAX]; + char *root; + FILE *sf = NULL; + char **conf_list = NULL; + + if ( (type != DS_REAL_CONFIG) && (type != DS_TMP_CONFIG) ) { + ds_send_error("Invalid config file type.", 0); + return(NULL); + } + + if ( (root = ds_get_install_root()) == NULL ) { + ds_send_error("Cannot find server root directory.", 0); + return(NULL); + } + + sprintf(conffile, "%s/%s", root, CONF_FILE_NAME); + + if ( !(sf = fopen(conffile, "r")) ) { + ds_send_error("could not read config file.", 1); + return(NULL); + } + + conf_list = ds_get_conf_from_file(sf); + + fclose(sf); + if (!conf_list) { + ds_send_error("failed to read the config file successfully.", 0); + return(NULL); + } + return(conf_list); +} + +/* + * NOTE: the ordering of the following array elements must be kept in sync + * with the ordering of the #defines in ../include/dsalib.h. + */ +struct ds_cfg_info ds_cfg_info[] = { +{"nsslapd-errorlog-level" }, +{"nsslapd-referral" }, +{"nsslapd-auditlog" }, +{"nsslapd-localhost" }, +{"nsslapd-port" }, +{"nsslapd-security" }, +{"nsslapd-secureport" }, +{"nsslapd-ssl3ciphers"}, +{"passwordstoragescheme"}, +{"nsslapd-accesslog"}, +{"nsslapd-errorlog"}, +{"nsslapd-rootdn"}, +{"nsslapd-rootpwstoragescheme"}, +{"nsslapd-suffix"}, +{"nsslapd-localuser"}, +{0} +}; + +/* + * Open the config file and look for option "option". Return its + * value, or NULL if the option was not found. + */ +DS_EXPORT_SYMBOL char * +ds_get_config_value( int option ) +{ + char **all, *value; + int i; + char *attr = ds_get_var_name(option); + + if (attr == NULL) + return NULL; + + all = ds_get_config( DS_REAL_CONFIG ); + if ( all == NULL ) { + return NULL; + } + for ( i = 0; all[ i ] != NULL; i++ ) { + if (( value = strchr( all[ i ], ':' )) != NULL ) { + *value = '\0'; + ++value; + while (*value && isspace(*value)) + ++value; + } + if ( !strcasecmp( attr, all[ i ] )) { + return strdup( value ); + } + } + return NULL; +} + +static size_t +count_quotes (const char* s) +{ + size_t count = 0; + const char* t = s; + if (t) while ((t = strpbrk (t, "\"\\")) != NULL) { + ++count; + ++t; + } + return count; +} + +DS_EXPORT_SYMBOL char* +ds_enquote_config_value (int paramnum, char* s) +{ + char* result; + char* brkcharset = "\"\\ \t\r\n"; + char *encoded_quote = "22"; /* replace quote with \22 */ + int encoded_quote_len = strlen(encoded_quote); + char *begin = s; + if (*s && ! strpbrk (s, brkcharset) && + ! (paramnum == DS_AUDITFILE || paramnum == DS_ACCESSLOG || +#if defined( XP_WIN32 ) + paramnum == DS_SUFFIX || +#endif + paramnum == DS_ERRORLOG)) { + result = s; + } else { + char* t = malloc (strlen (s) + count_quotes (s) + 3); + result = t; + *t++ = '"'; + while (*s) { + switch (*s) { + + case '"': + /* convert escaped quotes by replacing the quote with + escape code e.g. 22 so that \" is converted to \22 "*/ + if ((s > begin) && (*(s - 1) == '\\')) + { + strcpy(t, encoded_quote); + t += encoded_quote_len; + } + else /* unescaped ", just replace with \22 "*/ + { + *t++ = '\\'; + strcpy(t, encoded_quote); + t += encoded_quote_len; + } + ++s; + break; + + default: + *t++ = *s++; /* just copy it */ + break; + } + } + *t++ = '"'; + *t = '\0'; + } + return result; +} + +DS_EXPORT_SYMBOL char* +ds_DNS_to_DN (char* DNS) +{ + static const char* const RDN = "dc="; + char* DN; + char* dot; + size_t components; + if (DNS == NULL || *DNS == '\0') { + return strdup (""); + } + components = 1; + for (dot = strchr (DNS, '.'); dot != NULL; dot = strchr (dot + 1, '.')) { + ++components; + } + DN = malloc (strlen (DNS) + (components * strlen(RDN)) + 1); + strcpy (DN, RDN); + for (dot = strchr (DNS, '.'); dot != NULL; dot = strchr (dot + 1, '.')) { + *dot = '\0'; + strcat (DN, DNS); + strcat (DN, ","); + strcat (DN, RDN); + DNS = dot + 1; + *dot = '.'; + } + strcat (DN, DNS); + dn_normalize (DN); + return DN; +} diff --git a/ldap/admin/lib/dsalib_confs.c b/ldap/admin/lib/dsalib_confs.c new file mode 100644 index 00000000..ccaf8bd9 --- /dev/null +++ b/ldap/admin/lib/dsalib_confs.c @@ -0,0 +1,130 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/* + * Some of the simple conf stuff here. Must not call any + * libadmin functions! This is needed by ds_config.c + */ +#if defined( XP_WIN32 ) +#include +#endif +#include "dsalib.h" +#include +#include +#include +#include +#include +#include +#include "plstr.h" + +/* + * Read the configuration info into a null-terminated list of strings. + */ +DS_EXPORT_SYMBOL char ** +ds_get_conf_from_file(FILE *conf) +{ + static char config_entry[] = "dn: cn=config"; + static int cfg_ent_len = sizeof(config_entry)-1; + int listsize = 0; + char **conf_list = NULL; + char *entry = 0; + int lineno = 0; + + while (entry = ldif_get_entry(conf, &lineno)) { + char *begin = entry; + if (!PL_strncasecmp(entry, config_entry, cfg_ent_len)) { + char *line = entry; + while (line = ldif_getline(&entry)) { + listsize++; + conf_list = (char **) realloc(conf_list, + ((listsize + 1) * sizeof(char *))); + conf_list[listsize - 1] = strdup(line); + conf_list[listsize] = NULL; /* always null terminated */ + } + } + free(begin); + } + + return(conf_list); +} + +/* + * Returns 1 if parm is in confline else 0 + */ +static int +ds_parm_in_line(char *confline, char *parm) +{ + int parm_size; + + if ( confline == NULL ) + return(0); + if ( parm == NULL ) + return(0); + parm_size = strlen(parm); + if ( parm_size == (int)NULL ) + return(0); + if ( PL_strncasecmp(confline, parm, parm_size) == 0 ) + if ( ((int) strlen(confline)) > parm_size ) + if ( confline[parm_size] == ':' ) + return(1); + return(0); +} + +/* + * Gets the string that corresponds to the parameter supplied from the + * list of config lines. Returns a malloc'd string. + */ +DS_EXPORT_SYMBOL char * +ds_get_value(char **ds_config, char *parm, int phase, int occurance) +{ + char *line; + int line_num = 0; + int cur_phase = 0; + int cur_occurance = 0; + + if ( (parm == NULL) || (ds_config == NULL) ) + return(NULL); + if ( (phase < 0) || (occurance < 1) ) + return(NULL); + line = ds_config[line_num]; + while ( line != NULL ) { + if ( ds_parm_in_line(line, "database") ) + cur_phase++; + if ( ds_parm_in_line(line, parm) ) { /* found it */ + if ( phase == cur_phase ) + if ( ++cur_occurance == occurance ) { + /* + * Use ldif_parse_line() so continuation markers are + * handled correctly, etc. + */ + char *errmsg, *type = NULL, *value = NULL, *tmpvalue = NULL; + int ldif_rc, tmpvlen = 0; + char *tmpline = strdup(line); + + if ( NULL == tmpline ) { + ds_send_error( + "ds_get_value() failed: strdup() returned NULL\n", + 1 /* print errno */ ); + return(NULL); + } + + ldif_rc = ldif_parse_line( tmpline, &type, &tmpvalue, + &tmpvlen, &errmsg ); + if (ldif_rc < 0) { + ds_send_error(errmsg, 0 /* do not print errno */); + } else if (ldif_rc == 0) { /* value returned in place */ + value = strdup(tmpvalue); + } else { /* malloc'd value */ + value = tmpvalue; + } + free(tmpline); + return value; + } + } + line_num++; + line = ds_config[line_num]; + } + return(NULL); +} diff --git a/ldap/admin/lib/dsalib_db.c b/ldap/admin/lib/dsalib_db.c new file mode 100644 index 00000000..02d9498f --- /dev/null +++ b/ldap/admin/lib/dsalib_db.c @@ -0,0 +1,374 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#if defined( XP_WIN32 ) +#include +#include +#include +#endif +#include "dsalib.h" +#include +#include +#include +#include +#include +#if !defined( XP_WIN32 ) +#include +#include +#else +#define popen _popen +#define pclose _pclose +#endif +#include "portable.h" + +/* + * Get a listing of backup directories + * Return NULL for errors and a NULL list for an empty list. + */ + +DS_EXPORT_SYMBOL char ** +ds_get_bak_dirs() +{ + char format_str[PATH_MAX]; + char *root; + int i = 0; + char **bak_dirs = NULL; + + if ( (root = ds_get_install_root()) == NULL ) + { + ds_send_error("Cannot find server root directory.", 0); + return(bak_dirs); + } + + sprintf( format_str, "%s%cbak", root, FILE_SEP ); + bak_dirs = ds_get_file_list( format_str ); + if( bak_dirs ) + { + while( bak_dirs[i] != NULL ) + { + /* Prepend the filename with the install root */ + char filename[PATH_MAX]; + sprintf( filename, "%s%cbak%c%s", root, FILE_SEP, + FILE_SEP, bak_dirs[i] ); + free( bak_dirs[i] ); + bak_dirs[i] = strdup( filename ); +#if defined( XP_WIN32 ) + ds_dostounixpath( bak_dirs[i] ); +#endif + i++; + } + } + + return(bak_dirs); +} + +/* + * Restore a database based on a backup directory name. + * 0: success + * anything else: failure + */ +DS_EXPORT_SYMBOL int +ds_bak2db(char *file) +{ + char startup_line[BIG_LINE]; + char statfile[PATH_MAX]; + char *tmp_dir; + char *root; + int haderror = 0; + int error = -1; + int status; + FILE *sf = NULL; + struct stat fstats; + + if ( file == NULL ) { + return DS_NULL_PARAMETER; + } + status = ds_get_updown_status(); + if ( status == DS_SERVER_UP ) { + return DS_SERVER_MUST_BE_DOWN; + } + if ( (root = ds_get_install_root()) == NULL ) { + return DS_NO_SERVER_ROOT; + } + + if ( file[strlen(file) - 1] == '\n' ) /* strip out returns */ + file[strlen(file) - 1] = '\0'; + + if( stat( file, &fstats ) == -1 && errno == ENOENT ) { + return DS_CANNOT_OPEN_BACKUP_FILE; + } else if( !(fstats.st_mode & S_IFDIR) ) { + return DS_NOT_A_DIRECTORY; + } + + tmp_dir = ds_get_tmp_dir(); + sprintf(statfile, "%s%cbak2db.%d", tmp_dir, FILE_SEP, (int)getpid()); + sprintf(startup_line, + "%s%cbak2db " + "%s%s%s > " + "%s%s%s 2>&1", + root, FILE_SEP, + ENQUOTE, file, ENQUOTE, + ENQUOTE, statfile, ENQUOTE ); + alter_startup_line(startup_line); + fflush(0); + error = system(startup_line); + fflush(0); + if ( error == -1 ) { + return DS_CANNOT_EXEC; + } + fflush(0); + if( !(sf = fopen(statfile, "r")) ) { + return DS_CANNOT_OPEN_STAT_FILE; + } + + while ( fgets(startup_line, BIG_LINE, sf) ) { + if ((strstr(startup_line, "- Restoring file")) || + (strstr(startup_line, "- Checkpointing"))) { + ds_show_message(startup_line); + } else { + haderror = 1; + ds_send_error(startup_line, 0); + } + } + + fclose(sf); + unlink(statfile); + + if ( haderror ) + return DS_UNKNOWN_ERROR; + return 0; +} + +/* + * Create a backup based on a file name. + * 0: success + * anything else: failure + */ +DS_EXPORT_SYMBOL int +ds_db2bak(char *file) +{ + char startup_line[BIG_LINE]; + char statfile[PATH_MAX]; + char *tmp_dir; + char *root; + int haderror = 0; + int error = -1; + FILE *sf = NULL; + int lite = 0; +#ifdef XP_WIN32 + time_t ltime; +#endif + + if ( (root = ds_get_install_root()) == NULL ) { + return DS_NO_SERVER_ROOT; + } + + if ( (file == NULL) || (strlen(file) == 0) ) + file = NULL; + + tmp_dir = ds_get_tmp_dir(); + sprintf(statfile, "%s%cdb2bak.%d", tmp_dir, FILE_SEP, (int)getpid()); + + +#if defined( XP_WIN32 ) + if( file == NULL ) + { + file = malloc( BIG_LINE ); + + time( <ime ); + sprintf( file, "%s", ctime( <ime ) ); + ds_timetofname( file ); + } + + /* Check if the directory exists or can be created */ + if ( !ds_file_exists( file ) ) { + char *errmsg = ds_mkdir_p( file, NEWDIR_MODE ); + if( errmsg != NULL ) { +/* ds_send_error(errmsg, 10); + */ + return DS_CANNOT_CREATE_DIRECTORY; + } + } +#endif + +/* DBDB: note on the following line. + * Originally this had quotes round the directory name. + * I found that this made the script not work becuase + * a path of the form "foo"/bar/"baz" was passed to slapd. + * the c runtime didn't like this. Perhaps there's a simple + * solution, but for now I've modified this line here to + * not quote the directory name. This means that backup + * directories can't have spaces in them. + */ + + + sprintf(startup_line, + "%s%cdb2bak " + "%s%s%s > " + "%s%s%s 2>&1", + root, FILE_SEP, + ENQUOTE, + (file == NULL) ? "" : file, + ENQUOTE, + ENQUOTE, statfile, ENQUOTE); + + PATH_FOR_PLATFORM( startup_line ); + alter_startup_line(startup_line); + fflush(0); + error = system(startup_line); + if ( error == -1 ) { + return DS_CANNOT_EXEC; + } + if( !(sf = fopen(statfile, "r")) ) { + return DS_CANNOT_OPEN_STAT_FILE; + } + + while ( fgets(startup_line, BIG_LINE, sf) ) { + if (strstr(startup_line, " - Backing up file") || + strstr(startup_line, " - Checkpointing database")) { + ds_show_message(startup_line); + } else { + haderror = 1; + if (strstr ( startup_line, "restricted mode")) { + lite = 1; + } + ds_send_error(startup_line, 0); + } + } + fclose(sf); + unlink(statfile); + + if ( lite && haderror ) + return DS_HAS_TOBE_READONLY_MODE; + + if ( haderror ) + return DS_UNKNOWN_ERROR; + return 0; +} + +static void +process_and_report( char *line, int line_size, FILE *cmd ) +{ + while(fgets(line, line_size, cmd)) { + /* Strip off line feeds */ + int ind = strlen( line ) - 1; + while ( (ind >= 0) && + ((line[ind] == '\n') || + (line[ind] == '\r')) ) { + line[ind] = 0; + ind--; + } + if ( ind < 1 ) { + continue; + } + ds_send_status(line); + } +} + +static int exec_and_report( char *startup_line ) +{ + FILE *cmd = NULL; + char line[BIG_LINE]; + int haderror = 0; + + PATH_FOR_PLATFORM( startup_line ); + alter_startup_line(startup_line); + + /* + fprintf( stdout, "Launching <%s>\n", startup_line ); + */ + + fflush(0); + cmd = popen(startup_line, "r"); + if(!cmd) { + return DS_CANNOT_EXEC; + } + process_and_report( line, sizeof(line), cmd ); + pclose(cmd); + + /* + ** The VLV indexing code prints OK, + ** if the index was successfully created. + */ + if (strcmp(line,"OK")==0) { + haderror = 0; + } else { + haderror = DS_UNKNOWN_ERROR; + } + + return haderror; +} + +/* + * Create a vlv index + * 0: success + * anything else: failure + */ +DS_EXPORT_SYMBOL int +ds_vlvindex(char **backendList, char **vlvList) +{ + char startup_line[BIG_LINE]; + char *root; + char *instroot; + char **vlvc = NULL; + + + root = ds_get_server_root(); + instroot = ds_get_install_root(); + if ( (root == NULL) || (instroot == NULL) ) { + return DS_NO_SERVER_ROOT; + } + + sprintf(startup_line, "%s/bin/slapd/server/%s db2index " + "-D %s%s/%s " + "-n %s ", + root, SLAPD_NAME, + ENQUOTE, instroot, ENQUOTE, + backendList[0]); + + + /* Create vlv TAG */ + vlvc=vlvList; + while( *vlvc != NULL ) { + sprintf( startup_line, "%s -T %s%s%s", startup_line,"\"",*vlvc,"\"" ); + vlvc++; + } + + return exec_and_report( startup_line ); +} + +/* + * Create one or more indexes + * 0: success + * anything else: failure + */ +DS_EXPORT_SYMBOL int +ds_addindex(char **attrList, char *backendName) +{ + char startup_line[BIG_LINE]; + char *root; + char *instroot; + + root = ds_get_server_root(); + instroot = ds_get_install_root(); + + if ( (root == NULL) || (instroot == NULL) ) { + return DS_NO_SERVER_ROOT; + } + + sprintf(startup_line, "%s/bin/slapd/server/%s db2index " + "-D %s%s%s " + "-n %s", + root, SLAPD_NAME, + ENQUOTE, instroot, ENQUOTE, + backendName); + + while( *attrList != NULL ) { + sprintf( startup_line, "%s -t %s", startup_line, *attrList ); + attrList++; + } + + return exec_and_report( startup_line ); +} diff --git a/ldap/admin/lib/dsalib_debug.c b/ldap/admin/lib/dsalib_debug.c new file mode 100644 index 00000000..4819a94d --- /dev/null +++ b/ldap/admin/lib/dsalib_debug.c @@ -0,0 +1,73 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#if defined( XP_WIN32 ) +#include +#endif +#include "dsalib.h" +#include +#include +#include + +#if defined( XP_WIN32 ) +int ldap_debug = 0; +#endif + +DS_EXPORT_SYMBOL void +ds_log_env(char **envp) +{ + FILE *file; + char admin_logfile[PATH_MAX], *tmp_dir; + + tmp_dir = ds_get_tmp_dir(); + memset( admin_logfile, 0, sizeof( admin_logfile ) ); + strcat( admin_logfile, tmp_dir ); +#if defined( XP_WIN32 ) + if( tmp_dir ) + { + free( tmp_dir ); + tmp_dir = NULL; + } +#endif + strcat( admin_logfile, "/admin.log"); + + file = fopen(admin_logfile, "a+"); + if (file != NULL) { + int i; + for ( i = 0; envp[i] != (char *) 0; i++ ) { + char envstr[200]; + + sprintf(envstr, "%s\n", envp[i]); + fwrite(envstr, strlen(envstr), 1, file); + } + fclose(file); + } +} + +DS_EXPORT_SYMBOL void +ds_log_debug_message(char *msg) +{ + FILE *file; + char admin_logfile[PATH_MAX], *tmp_dir; + + tmp_dir = ds_get_tmp_dir(); + memset( admin_logfile, 0, sizeof( admin_logfile ) ); + strcat( admin_logfile, tmp_dir ); +#if defined( XP_WIN32 ) + if( tmp_dir ) + { + free( tmp_dir ); + tmp_dir = NULL; + } +#endif + strcat( admin_logfile, "/admin.log"); + + file = fopen(admin_logfile, "a+"); + if (file != NULL) { + fwrite(msg, strlen(msg), 1, file); + fclose(file); + } +} + diff --git a/ldap/admin/lib/dsalib_dn.c b/ldap/admin/lib/dsalib_dn.c new file mode 100644 index 00000000..d7de36d9 --- /dev/null +++ b/ldap/admin/lib/dsalib_dn.c @@ -0,0 +1,465 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ + +#if defined( XP_WIN32 ) +#include +#else +#include +#endif +#include +#include "dsalib.h" +#include "portable.h" +#include + +#define DNSEPARATOR(c) (c == ',' || c == ';') +#define SEPARATOR(c) (c == ',' || c == ';' || c == '+') +#define SPACE(c) (c == ' ' || c == '\n') +#define NEEDSESCAPE(c) (c == '\\' || c == '"') +#define B4TYPE 0 +#define INTYPE 1 +#define B4EQUAL 2 +#define B4VALUE 3 +#define INVALUE 4 +#define INQUOTEDVALUE 5 +#define B4SEPARATOR 6 + +DS_EXPORT_SYMBOL char* +dn_normalize( char *dn ) +{ + char *d, *s; + int state, gotesc; + + /* Debug( LDAP_DEBUG_TRACE, "=> dn_normalize \"%s\"\n", dn, 0, 0 ); */ + + gotesc = 0; + state = B4TYPE; + for ( d = s = dn; *s; s++ ) { + switch ( state ) { + case B4TYPE: + if ( ! SPACE( *s ) ) { + state = INTYPE; + *d++ = *s; + } + break; + case INTYPE: + if ( *s == '=' ) { + state = B4VALUE; + *d++ = *s; + } else if ( SPACE( *s ) ) { + state = B4EQUAL; + } else { + *d++ = *s; + } + break; + case B4EQUAL: + if ( *s == '=' ) { + state = B4VALUE; + *d++ = *s; + } else if ( ! SPACE( *s ) ) { + /* not a valid dn - but what can we do here? */ + *d++ = *s; + } + break; + case B4VALUE: + if ( *s == '"' ) { + state = INQUOTEDVALUE; + *d++ = *s; + } else if ( ! SPACE( *s ) ) { + state = INVALUE; + *d++ = *s; + } + break; + case INVALUE: + if ( !gotesc && SEPARATOR( *s ) ) { + while ( SPACE( *(d - 1) ) ) + d--; + state = B4TYPE; + if ( *s == '+' ) { + *d++ = *s; + } else { + *d++ = ','; + } + } else if ( gotesc && !NEEDSESCAPE( *s ) && + !SEPARATOR( *s ) ) { + *--d = *s; + d++; + } else { + *d++ = *s; + } + break; + case INQUOTEDVALUE: + if ( !gotesc && *s == '"' ) { + state = B4SEPARATOR; + *d++ = *s; + } else if ( gotesc && !NEEDSESCAPE( *s ) ) { + *--d = *s; + d++; + } else { + *d++ = *s; + } + break; + case B4SEPARATOR: + if ( SEPARATOR( *s ) ) { + state = B4TYPE; + if ( *s == '+' ) { + *d++ = *s; + } else { + *d++ = ','; + } + } + break; + default: + break; + } + if ( *s == '\\' ) { + gotesc = 1; + } else { + gotesc = 0; + } + } + *d = '\0'; + + /* Debug( LDAP_DEBUG_TRACE, "<= dn_normalize \"%s\"\n", dn, 0, 0 ); */ + return( dn ); +} + +DS_EXPORT_SYMBOL int +dn_issuffix( + char *dn, + char *suffix +) +{ + int dnlen, suffixlen; + + if ( dn == NULL ) { + return( 0 ); + } + + suffixlen = strlen( suffix ); + dnlen = strlen( dn ); + + if ( suffixlen > dnlen ) { + return( 0 ); + } + + return( strcasecmp( dn + dnlen - suffixlen, suffix ) == 0 ); +} + +DS_EXPORT_SYMBOL char* +ds_dn_expand (char* dn) +{ + char* edn; + size_t i = 0; + char* s; + int state = B4TYPE; + int gotesc = 0; + + if (dn == NULL) return NULL; + edn = strdup (dn); + for (s = dn; *s != '\0'; ++s, ++i) { + switch (state) { + case B4TYPE: + if ( ! SPACE (*s)) { + state = INTYPE; + } + break; + case INTYPE: + if (*s == '=') { + state = B4VALUE; + } else if (SPACE (*s)) { + state = B4EQUAL; + } + break; + case B4EQUAL: + if (*s == '=') { + state = B4VALUE; + } + break; + case B4VALUE: + if (*s == '"') { + state = INQUOTEDVALUE; + } else if ( ! SPACE (*s)) { + state = INVALUE; + } + break; + case INQUOTEDVALUE: + if (gotesc) { + if ( ! NEEDSESCAPE (*s)) { + --i; + memmove (edn+i, edn+i+1, strlen (edn+i)); + } + } else { + if (*s == '"') { + state = B4SEPARATOR; + } + } + break; + case INVALUE: + if (gotesc) { + if ( ! NEEDSESCAPE (*s) && ! SEPARATOR (*s)) { + --i; + memmove (edn+i, edn+i+1, strlen (edn+i)); + } + break; + } + case B4SEPARATOR: + if (SEPARATOR (*s)) { + state = B4TYPE; + if ( ! SPACE (s[1])) { + /* insert a space following edn[i] */ + edn = (char*) realloc (edn, strlen (edn)+2); + ++i; + memmove (edn+i+1, edn+i, strlen (edn+i)+1); + edn[i] = ' '; + } + } + break; + default: + break; + } + gotesc = (*s == '\\'); + } + return edn; +} + +int +hexchar2int( char c ) +{ + if ( '0' <= c && c <= '9' ) { + return( c - '0' ); + } + if ( 'a' <= c && c <= 'f' ) { + return( c - 'a' + 10 ); + } + if ( 'A' <= c && c <= 'F' ) { + return( c - 'A' + 10 ); + } + return( -1 ); +} + +/* + * substr_dn_normalize - map a DN to a canonical form. + * The DN is read from *dn through *(end-1) and normalized in place. + * The new end is returned; that is, the canonical form is in + * *dn through *(the_return_value-1). + */ + +/* The goals of this function are: + * 1. be compatible with previous implementations. Especially, enable + * a server running this code to find database index keys that were + * computed by Directory Server 3.0 with a prior version of this code. + * 2. Normalize in place; that is, avoid allocating memory to contain + * the canonical form. + * 3. eliminate insignificant differences; that is, any two DNs are + * not significantly different if and only if their canonical forms + * are identical (ignoring upper/lower case). + * 4. handle a DN in the syntax defined by RFC 2253. + * 5. handle a DN in the syntax defined by RFC 1779. + * + * Goals 3 through 5 are not entirely achieved by this implementation, + * because it can't be done without violating goal 1. Specifically, + * DNs like cn="a,b" and cn=a\,b are not mapped to the same canonical form, + * although they're not significantly different. Likewise for any pair + * of DNs that differ only in their choice of quoting convention. + * A previous version of this code changed all DNs to the most compact + * quoting convention, but that violated goal 1, since Directory Server + * 3.0 did not. + * + * Also, this implementation handles the \xx convention of RFC 2253 and + * consequently violates RFC 1779, according to which this type of quoting + * would be interpreted as a sequence of 2 numerals (not a single byte). + */ + +DS_EXPORT_SYMBOL char * +dn_normalize_convert( char *dn ) +{ + /* \xx is changed to \c. + \c is changed to c, unless this would change its meaning. + All values that contain 2 or more separators are "enquoted"; + all other values are not enquoted. + */ + char *value, *value_separator; + char *d, *s; + char *end; + + int gotesc = 0; + int state = B4TYPE; + if (NULL == dn) + return dn; + + end = dn + strlen(dn); + for ( d = s = dn; s != end; s++ ) { + switch ( state ) { + case B4TYPE: + if ( ! SPACE( *s ) ) { + state = INTYPE; + *d++ = *s; + } + break; + case INTYPE: + if ( *s == '=' ) { + state = B4VALUE; + *d++ = *s; + } else if ( SPACE( *s ) ) { + state = B4EQUAL; + } else { + *d++ = *s; + } + break; + case B4EQUAL: + if ( *s == '=' ) { + state = B4VALUE; + *d++ = *s; + } else if ( ! SPACE( *s ) ) { + /* not a valid dn - but what can we do here? */ + *d++ = *s; + } + break; + case B4VALUE: + if ( *s == '"' || ! SPACE( *s ) ) { + value_separator = NULL; + value = d; + state = ( *s == '"' ) ? INQUOTEDVALUE : INVALUE; + *d++ = *s; + } + break; + case INVALUE: + if ( gotesc ) { + if ( SEPARATOR( *s ) ) { + if ( value_separator ) value_separator = dn; + else value_separator = d; + } else if ( ! NEEDSESCAPE( *s ) ) { + --d; /* eliminate the \ */ + } + } else if ( SEPARATOR( *s ) ) { + while ( SPACE( *(d - 1) ) ) + d--; + if ( value_separator == dn ) { /* 2 or more separators */ + /* convert to quoted value: */ + auto char *L = NULL; + auto char *R; + for ( R = value; (R = strchr( R, '\\' )) && (R < d); L = ++R ) { + if ( SEPARATOR( R[1] )) { + if ( L == NULL ) { + auto const size_t len = R - value; + if ( len > 0 ) memmove( value+1, value, len ); + *value = '"'; /* opening quote */ + value = R + 1; + } else { + auto const size_t len = R - L; + if ( len > 0 ) { + memmove( value, L, len ); + value += len; + } + --d; + } + } + } + memmove( value, L, d - L + 1 ); + *d++ = '"'; /* closing quote */ + } + state = B4TYPE; + *d++ = (*s == '+') ? '+' : ','; + break; + } + *d++ = *s; + break; + case INQUOTEDVALUE: + if ( gotesc ) { + if ( ! NEEDSESCAPE( *s ) ) { + --d; /* eliminate the \ */ + } + } else if ( *s == '"' ) { + state = B4SEPARATOR; + if ( value_separator == dn /* 2 or more separators */ + || SPACE( value[1] ) || SPACE( d[-1] ) ) { + *d++ = *s; + } else { + /* convert to non-quoted value: */ + if ( value_separator == NULL ) { /* no separators */ + memmove ( value, value+1, (d-value)-1 ); + --d; + } else { /* 1 separator */ + memmove ( value, value+1, (value_separator-value)-1 ); + *(value_separator - 1) = '\\'; + } + } + break; + } + if ( SEPARATOR( *s )) { + if ( value_separator ) value_separator = dn; + else value_separator = d; + } + *d++ = *s; + break; + case B4SEPARATOR: + if ( SEPARATOR( *s ) ) { + state = B4TYPE; + *d++ = (*s == '+') ? '+' : ','; + } + break; + default: +/* LDAPDebug( LDAP_DEBUG_ANY, + "slapi_dn_normalize - unknown state %d\n", state, 0, 0 );*/ + break; + } + if ( *s != '\\' ) { + gotesc = 0; + } else { + gotesc = 1; + if ( s+2 < end ) { + auto int n = hexchar2int( s[1] ); + if ( n >= 0 ) { + auto int n2 = hexchar2int( s[2] ); + if ( n2 >= 0 ) { + n = (n << 4) + n2; + if (n == 0) { /* don't change \00 */ + *d++ = *++s; + *d++ = *++s; + gotesc = 0; + } else { /* change \xx to a single char */ + ++s; + *(unsigned char*)(s+1) = n; + } + } + } + } + } + } + + /* Trim trailing spaces */ + while ( d != dn && *(d - 1) == ' ' ) d--; + + *d = 0; + + return( dn ); +} + +/* if dn contains an unescaped quote return true */ +DS_EXPORT_SYMBOL int +ds_dn_uses_LDAPv2_quoting(const char *dn) +{ + const char ESC = '\\'; + const char Q = '"'; + int ret = 0; + const char *p = 0; + + /* check dn for a even number (incl. 0) of ESC followed by Q */ + if (!dn) + return ret; + + p = strchr(dn, Q); + if (p) + { + int nESC = 0; + for (--p; (p >= dn) && (*p == ESC); --p) + ++nESC; + if (!(nESC % 2)) + ret = 1; + } + + return ret; +} diff --git a/ldap/admin/lib/dsalib_filename.c b/ldap/admin/lib/dsalib_filename.c new file mode 100644 index 00000000..e7ecfb12 --- /dev/null +++ b/ldap/admin/lib/dsalib_filename.c @@ -0,0 +1,95 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#if defined( XP_WIN32 ) +#include +#endif +#include "dsalib.h" +#include +#include +#include +#include + +static char * +get_month_str(int month) +{ + static char *month_str[] = { + "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", + "Nov", "Dec"}; + + if ( (month < 1) || (month > 12) ) + return("Unknown month"); + return(month_str[month - 1]); +} + +/* + * Returns a string describing the meaning of the filename. + * Two different formats are supported. + */ +DS_EXPORT_SYMBOL char * +ds_get_file_meaning(char *file) +{ + static char meaning[BIG_LINE]; +#define FILE_EXPECTED_SIZE1 14 +#define FILE_EXPECTED_SIZE2 17 + char *name; + char *tmp; + int i; + int month; + int day; + int hour; + int minute; + int sec; + int year; + + /* + * Expect a file name in format 06041996123401 (FILE_EXPECTED_SIZE1) + * which should return "Jun 4 12:34:01 1996" + * OR 1996_06_04_123401 + * which should return "Jun 4 12:34:01 1996" + */ + + if ( file == NULL ) + return(NULL); + name = malloc(strlen(file) + 1); + if ( name == NULL ) + return(NULL); + strcpy(name, file); + if ( (tmp = strrchr(name, '.')) != NULL ) + *tmp = '\0'; + if ( strlen(name) == FILE_EXPECTED_SIZE1 ) { + for ( i = 0; i < FILE_EXPECTED_SIZE1; i++ ) + if ( !isdigit(name[i]) ) + return(NULL); + if ( (sscanf(name, "%2d%2d%4d%2d%2d%2d", &month, &day, &year, &hour, + &minute, &sec)) == -1 ) + return(NULL); + } else if ( strlen(name) == FILE_EXPECTED_SIZE2 ) { + for ( i = 0; i < FILE_EXPECTED_SIZE2; i++ ) + if ( !isdigit(name[i]) ) + if ( name[i] != '_' ) + return(NULL); + if ( (sscanf(name, "%4d_%2d_%2d_%2d%2d%2d", &year, &month, &day, &hour, + &minute, &sec)) == -1 ) + return(NULL); + } else + return(NULL); + + if ( (month < 1) || (month > 12) ) + return(NULL); + if ( (day < 1) || (day > 31) ) + return(NULL); + if ( (year < 1000) || (year > 2100) ) + return(NULL); + if ( (hour < 0) || (hour > 24) ) + return(NULL); + if ( (minute < 0) || (minute > 60) ) + return(NULL); + if ( (sec < 0) || (sec > 60) ) + return(NULL); + sprintf(meaning, "%s % 2d %02d:%02d:%02d %4d", get_month_str(month), + day, hour, minute, sec, year); + return(meaning); +} diff --git a/ldap/admin/lib/dsalib_html.c b/ldap/admin/lib/dsalib_html.c new file mode 100644 index 00000000..cffae406 --- /dev/null +++ b/ldap/admin/lib/dsalib_html.c @@ -0,0 +1,201 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#if defined( XP_WIN32 ) +#include +#endif + +#include "dsalib.h" +#include "prprf.h" +#include +#include +#include +#include +#include + +/* holds the contents of the POSTed data from stdin as an array +of key/value pairs parsed from the key=value input */ +static char **input = 0; + +/* This variable is true if the program should assume stdout is connected + to an HTML context e.g. if this is being run as a normal CGI. It is + false to indicate that output should not contain HTML formatting, + Javascript, etc. put plain ol' ASCII only +*/ +static int formattedOutput = 1; + +/* This is the separator string to use when outputting key/value pairs + to be read by the non-HTML front end (Java console) +*/ +static const char *SEPARATOR = ":"; /* from AdmTask.java */ + +DS_EXPORT_SYMBOL int +ds_get_formatted_output(void) +{ + return formattedOutput; +} + +DS_EXPORT_SYMBOL void +ds_set_formatted_output(int val) +{ + formattedOutput = val; +} + +DS_EXPORT_SYMBOL void +ds_print_file_name(char *fileptr) +{ + char *meaning; + + fprintf(stdout, "%s", fileptr); + if ( (meaning = ds_get_file_meaning(fileptr)) != NULL ) { + fprintf(stdout, " (%s)", meaning); + } +} + +/* + * Get a CGI variable. + */ +DS_EXPORT_SYMBOL char * +ds_get_cgi_var(char *cgi_var_name) +{ + char *cgi_var_value; + + cgi_var_value = (char *) ds_a_get_cgi_var(cgi_var_name, NULL, NULL); + if ( cgi_var_value == NULL ) { + /* + * The ds_a_get_cgi_var() lies! It gives a NULL even if the + * value is "". So assume the variable is there and + * return an empty string. + */ + return(""); + } + return(cgi_var_value); +} + +/* parse POST input to a CGI program */ +DS_EXPORT_SYMBOL int +ds_post_begin(FILE *in) +{ + char *vars = NULL, *tmp = NULL, *decoded_vars = NULL; + int cl; + + if(!(tmp = getenv("CONTENT_LENGTH"))) + { + ds_report_error(DS_INCORRECT_USAGE, "Browser Error", "Your browser" + " sent no content length with a POST command." + " Please be sure to use a fully compliant browser."); + return 1; + } + + cl = atoi(tmp); + + vars = (char *)malloc(cl+1); + + if( !(fread(vars, 1, cl, in)) ) + { + ds_report_error(DS_SYSTEM_ERROR, "CGI error", + "The POST variables could not be read from stdin."); + return 1; + } + + vars[cl] = '\0'; + + decoded_vars = ds_URL_decode(vars); + free(vars); + + input = ds_string_to_vec(decoded_vars); + free(decoded_vars); +/* + for (cl = 0; input[cl]; ++cl) + printf("ds_post_begin: read cgi var=[%s]\n", input[cl]); +*/ + return 0; +} + +/* parse GET input to a CGI program */ +DS_EXPORT_SYMBOL void +ds_get_begin(char *query_string) +{ + char *decoded_input = ds_URL_decode(query_string); + input = ds_string_to_vec(decoded_input); + free(decoded_input); +} + +/* + Borrowed from libadmin/form_post.c +*/ +DS_EXPORT_SYMBOL char * +ds_a_get_cgi_var(char *varname, char *elem_id, char *bongmsg) +{ + register int x = 0; + int len = strlen(varname); + char *ans = NULL; + + while(input[x]) { + /* We want to get rid of the =, so len, len+1 */ + if((!strncmp(input[x], varname, len)) && (*(input[x]+len) == '=')) { + ans = strdup(input[x] + len + 1); + if(!strcmp(ans, "")) + ans = NULL; + break; + } else + x++; + } + if(ans == NULL) { + if ((bongmsg) && strlen(bongmsg)) + { + /* prefix error with varname so output interpreters can determine */ + /* which parameter is in error */ + char *msg; + if (!ds_get_formatted_output() && (varname != NULL)) + { + msg = PR_smprintf("%s.error: %s %s", varname, elem_id, bongmsg); + } + else + { + msg = PR_smprintf("error: %s %s", elem_id, bongmsg); + } + ds_show_message(msg); + PR_smprintf_free(msg); + } + else + return NULL; + } + else + return(ans); + /* shut up gcc */ + return NULL; +} + +DS_EXPORT_SYMBOL char ** +ds_string_to_vec(char *in) +{ + char **ans; + int vars = 0; + register int x = 0; + char *tmp; + + in = strdup(in); + + while(in[x]) + if(in[x++]=='=') + vars++; + + + ans = (char **)calloc(vars+1, sizeof(char *)); + + x=0; + /* strtok() is not MT safe, but it is okay to call here because it is used in monothreaded env */ + tmp = strtok(in, "&"); + ans[x++]=strdup(tmp); + + while((tmp = strtok(NULL, "&"))) { + ans[x++] = strdup(tmp); + } + + free(in); + + return(ans); +} diff --git a/ldap/admin/lib/dsalib_ldif.c b/ldap/admin/lib/dsalib_ldif.c new file mode 100644 index 00000000..94c0d77f --- /dev/null +++ b/ldap/admin/lib/dsalib_ldif.c @@ -0,0 +1,374 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#if defined( XP_WIN32 ) +#include +#include +#include +#define popen _popen +#define pclose _pclose +#else +#include +#endif +#include "dsalib.h" +#include +#include +#include +#include +#include +#include + +#ifndef XP_WIN32 +#define SCRIPT_SUFFIX "" /* shell scripts have no suffix */ +#else +#define SCRIPT_SUFFIX ".bat" /* batch file suffix */ +#endif + + +static int +process_and_report( char *line, int line_size, FILE *cmd ) +{ + int err = 0; + while(fgets(line, line_size, cmd)) { + /* Strip off line feeds */ + int ind = strlen( line ) - 1; +#ifdef DEBUG_CGI + fprintf(stderr, "read line=[%s] ind=%d\n", line, ind); +#endif /* DEBUG_CGI */ + fprintf( stdout, ": %s", line ); + fflush(0); + while ( (ind >= 0) && + ((line[ind] == '\n') || + (line[ind] == '\r')) ) { + line[ind] = 0; + ind--; + } + if ( ind < 1 ) { + continue; + } + ds_send_status(line); + if ( (strstr(line, "bad LDIF") != NULL) ) { +#ifdef DEBUG_CGI + fprintf(stderr, "invalid ldif file\n"); +#endif /* DEBUG_CGI */ + err = DS_INVALID_LDIF_FILE; + } else if ( 0 == err ) { + if ( (strstr(line, "err=") != NULL) ) { +#ifdef DEBUG_CGI + fprintf(stderr, "unknown error\n"); +#endif /* DEBUG_CGI */ + err = DS_UNKNOWN_ERROR; + } + } + } +#ifdef DEBUG_CGI + fprintf(stderr, "process_and_report finished err=%d\n", err); +#endif /* DEBUG_CGI */ + return err; +} + +static int exec_and_report( char *startup_line ) +{ + FILE *cmd = NULL; + char line[BIG_LINE]; + int haderror = 0; + + PATH_FOR_PLATFORM( startup_line ); + alter_startup_line(startup_line); + + fflush(stdout); + cmd = popen(startup_line, "r"); + if(!cmd) { + printf("could not open pipe [%s]: %d\n", + startup_line, errno); +#ifdef DEBUG_CGI + fprintf(stderr, "could not open pipe [%s]: %d\n", + startup_line, errno); +#endif /* DEBUG_CGI */ + return DS_CANNOT_EXEC; + } + haderror = process_and_report( line, sizeof(line), cmd ); + pclose(cmd); + + return haderror; +} + +/* + * Execute a shell command. + * 0: success + * anything else: failure + */ +DS_EXPORT_SYMBOL int +ds_exec_and_report( char *startup_line ) +{ + return exec_and_report( startup_line ); +} + +/* + * Create a database based on a file name. + * 0: success + * anything else: failure + */ +static int +importldif(char *file, int preserve, char *backend, char *subtree) +{ + char startup_line[BIG_LINE]; + char *root; + int haderror = 0; + int i = 0, error = -1; + int status; + struct stat fstats; + char errbuf[ BIG_LINE ]; + char **db_files = NULL, *changelogdir = NULL; + int rc; + + errbuf[ 0 ] = '\0'; + + if ( file == NULL ) { +#ifdef DEBUG_CGI + fprintf(stderr, "importldif: null file\n"); +#endif /* DEBUG_CGI */ + return DS_NULL_PARAMETER; + } + status = ds_get_updown_status(); + if ( status == DS_SERVER_UP ) { +#ifdef DEBUG_CGI + fprintf(stderr, "importldif: server is not down\n"); +#endif /* DEBUG_CGI */ + return DS_SERVER_MUST_BE_DOWN; + } + if ( (root = ds_get_install_root()) == NULL ) { +#ifdef DEBUG_CGI + fprintf(stderr, "importldif: could not get server root\n"); +#endif /* DEBUG_CGI */ + return DS_NO_SERVER_ROOT; + } + + if ( file[strlen(file) - 1] == '\n' ) /* strip out returns */ + file[strlen(file) - 1] = '\0'; + + /* Make sure the file exists and is not a directory: 34347 */ + if( stat( file, &fstats ) == -1 && errno == ENOENT ) { +#ifdef DEBUG_CGI + fprintf(stderr, "importldif: could not open %s\n", file); +#endif /* DEBUG_CGI */ + return DS_CANNOT_OPEN_LDIF_FILE; + } else if( fstats.st_mode & S_IFDIR ) { +#ifdef DEBUG_CGI + fprintf(stderr, "importldif: not a file %s\n", file); +#endif /* DEBUG_CGI */ + return DS_IS_A_DIRECTORY; + } + + if ( preserve ) { + sprintf(startup_line, "%s%cldif2db%s -i %s%s%s", + root, FILE_SEP, SCRIPT_SUFFIX, + ENQUOTE, file, ENQUOTE); + } else if (backend) { + sprintf(startup_line, "%s%cldif2db%s -n %s%s%s -i %s%s%s", + root, FILE_SEP, SCRIPT_SUFFIX, + ENQUOTE, backend, ENQUOTE, + ENQUOTE, file, ENQUOTE); + } else if (subtree) { + sprintf(startup_line, "%s%cldif2db%s -s %s%s%s -i %s%s%s", + root, FILE_SEP, SCRIPT_SUFFIX, + ENQUOTE, subtree, ENQUOTE, + ENQUOTE, file, ENQUOTE); + } else { + sprintf(startup_line, "%s%cldif2db%s -i %s%s%s -noconfig", + root, FILE_SEP, SCRIPT_SUFFIX, + ENQUOTE, file, ENQUOTE); + } + alter_startup_line(startup_line); + fflush(stdout); +#ifdef DEBUG_CGI + fprintf(stderr, "importldif: executing %s\n", startup_line); +#endif /* DEBUG_CGI */ + error = exec_and_report(startup_line); + /*error = system(startup_line);*/ + if ( error != 0 ) { +#ifdef DEBUG_CGI + fprintf(stderr, "importldif: error=%d\n", error); +#endif /* DEBUG_CGI */ + return error; + } + + /* Remove the changelog database, if present */ + changelogdir = ds_get_config_value(0xdeadbeef); + if ( changelogdir != NULL ) { + db_files = ds_get_file_list( changelogdir ); + if ( db_files != NULL ) { + ds_send_status("Removing changelog database..."); + } + for ( i = 0; db_files != NULL && db_files[ i ] != NULL; i++ ) { + char sbuf[ BIG_LINE ]; + char filename[ BIG_LINE ]; + if ( strlen( db_files[ i ]) > 0 ) { + sprintf( filename, "%s%c%s", changelogdir, + FILE_SEP, db_files[ i ]); + sprintf(sbuf, "Removing %s", filename); + ds_send_status( sbuf ); + rc = unlink( filename); + if ( rc != 0 ) { + sprintf( errbuf, "Warning: some files in %s could not " + "be removed\n", changelogdir ); + haderror++; + } + } + } + } + if ( strlen( errbuf ) > 0 ) { + ds_send_error( errbuf, 0 ); + } + + return error; +} + +/* + * Create a database based on a file name. + * 0: success + * anything else: failure + */ +DS_EXPORT_SYMBOL int +ds_ldif2db(char *file) +{ + return importldif( file, 0, NULL, NULL ); +} + +/* + * Create a database based on a file name. + * 0: success + * anything else: failure + */ +DS_EXPORT_SYMBOL int +ds_ldif2db_preserve(char *file) +{ + return importldif( file, 1, NULL, NULL ); +} + +/* + * import an ldif file into a named backend or subtree + * 0: success + * anything else: failure + */ +DS_EXPORT_SYMBOL int +ds_ldif2db_backend_subtree(char *file, char *backend, char *subtree) +{ + return importldif( file, 0, backend, subtree ); +} + +/* + * Create a LDIF file based on a file name. + * 0: success + * anything else: failure + */ +DS_EXPORT_SYMBOL int +ds_db2ldif_subtree(char *file, char *subtree) +{ + char startup_line[BIG_LINE]; + char statfile[PATH_MAX]; + char outfile[PATH_MAX]; + char scriptfile[PATH_MAX]; + char *tmp_dir; + char *root; + int haderror = 0; + int error = -1; + FILE *sf = NULL; + + if ( (root = ds_get_install_root()) == NULL ) { + return DS_NO_SERVER_ROOT; + } + + if ( (file == NULL) || (strlen(file) == 0) ) + file = NULL; + + tmp_dir = ds_get_tmp_dir(); + sprintf(statfile, "%s%cdb2ldif.%d", tmp_dir, FILE_SEP, (int) getpid()); + +#if defined( XP_WIN32 ) + if( file == NULL ) + { + time_t ltime; + file = malloc( BIG_LINE ); + + time( <ime ); + sprintf( file, "%s", ctime( <ime ) ); + ds_timetofname( file ); + } +#endif + + if ( file == NULL ) + *outfile = 0; + else + strcpy( outfile, file ); + + sprintf(scriptfile, "%s%cdb2ldif", root, FILE_SEP); + + PATH_FOR_PLATFORM( outfile ); + PATH_FOR_PLATFORM( scriptfile ); + + if ( subtree == NULL ) { + sprintf(startup_line, + "%s " + "%s%s%s > " + "%s%s%s 2>&1", + scriptfile, + ENQUOTE, outfile, ENQUOTE, + ENQUOTE, statfile, ENQUOTE); + } else { + sprintf(startup_line, + "%s " + "%s%s%s " + "-s \"%s\" > " + "%s%s%s 2>&1", + scriptfile, + ENQUOTE, outfile, ENQUOTE, + subtree, + ENQUOTE, statfile, ENQUOTE); + } + + fflush(0); + alter_startup_line(startup_line); + error = system(startup_line); + if ( error == -1 ) { + return DS_CANNOT_EXEC; + } + sf = fopen(statfile, "r"); + if( sf ) { + while ( fgets(startup_line, BIG_LINE, sf) ) { + /* + The db2ldif process will usually print out a summary at the + end, but that is not an error + */ + char *ptr = strstr(startup_line, "Processed"); + if (ptr && strstr(ptr, "entries.")) + { + ds_show_message(startup_line); + } + else + { + haderror = 1; + ds_send_error(startup_line, 0); + } + } + fclose(sf); + unlink(statfile); + } + + if ( haderror ) + return DS_UNKNOWN_ERROR; + return 0; +} + +/* + * Create a LDIF file based on a file name. + * 0: success + * anything else: failure + */ +DS_EXPORT_SYMBOL int +ds_db2ldif(char *file) +{ + return ds_db2ldif_subtree(file, NULL); +} diff --git a/ldap/admin/lib/dsalib_location.c b/ldap/admin/lib/dsalib_location.c new file mode 100644 index 00000000..06cbafb5 --- /dev/null +++ b/ldap/admin/lib/dsalib_location.c @@ -0,0 +1,142 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#if defined( XP_WIN32 ) +#include +#endif +#include "dsalib.h" +#include +#include +#include + +/* + * Returns the server root. Info is + * returned in a static area. The caller must copy it + * for reuse if needed. + */ +DS_EXPORT_SYMBOL char * +ds_get_server_root() +{ + char *root; + + if ( (root = getenv("NETSITE_ROOT")) == NULL ) + return(NULL); + + /* WIN32: Needed to take care of embedded space, */ + /* otherwise system() call fails */ + root = ds_makeshort( root ); + + return root; +} + +/* + * Returns the install location of the server. Info is + * returned in a static area. The caller must copy it + * for reuse if needed. + */ +DS_EXPORT_SYMBOL char * +ds_get_install_root() +{ + char *root; + char *ds_name; + static char install_root[PATH_MAX]; + + if ( (root = ds_get_server_root()) == NULL ) + return(NULL); + if ( (ds_name = ds_get_server_name()) == NULL ) + return(NULL); + + sprintf(install_root, "%s/%s", root, ds_name); + return(install_root); +} + +/* + * Returns the install location of the server under the admserv + * directory. + */ +DS_EXPORT_SYMBOL char * +ds_get_admserv_based_root() +{ + char *root; + char *ds_name; + static char install_root[PATH_MAX]; + + if ( (root = getenv("ADMSERV_ROOT")) == NULL ) + return(NULL); + if ( (ds_name = ds_get_server_name()) == NULL ) + return(NULL); + sprintf(install_root, "%s/%s", root, ds_name); + return(install_root); +} + +DS_EXPORT_SYMBOL char * +ds_get_server_name() +{ + if( getenv("SERVER_NAMES") ) + return( getenv("SERVER_NAMES") ); + else { + static char logfile[PATH_MAX]; + char *buf; + char *out = logfile; + buf = getenv("SCRIPT_NAME"); + if ( buf && (*buf == '/') ) + buf++; + while ( *buf && (*buf != '/') ) { + *out++ = *buf++; + } + *out = 0; + return logfile; + } +} + +DS_EXPORT_SYMBOL char * +ds_get_logfile_name(int config_type) +{ + char *filename; + char **ds_config = NULL; + static char logfile[PATH_MAX]; + + if ( (ds_config = ds_get_config(DS_REAL_CONFIG)) == NULL ) { + /* For DS 4.0, no error output if file doesn't exist - that's + a normal situation */ + /* ds_send_error("ds_get_config(DS_REAL_CONFIG) == NULL", 0); */ + return(NULL); + } + filename = ds_get_value(ds_config, ds_get_var_name(config_type), 0, 1); + + if ( filename == NULL ) { + /* For DS 4.0, no error output if file doesn't exist - that's + a normal situation */ + /* ds_send_error("ds_get_logfile_name: filename == NULL", 0); */ + return(NULL); + } + if ( ((int) strlen(filename)) >= PATH_MAX ) { + ds_send_error("ds_get_logfile_name: filename too long", 0); + free(filename); + return(NULL); + } + strcpy(logfile, filename); + free(filename); + return(logfile); +} + +DS_EXPORT_SYMBOL char * +ds_get_errors_name() +{ + return( ds_get_logfile_name(DS_ERRORLOG) ); +} + +DS_EXPORT_SYMBOL char * +ds_get_access_name() +{ + return( ds_get_logfile_name(DS_ACCESSLOG) ); +} + +DS_EXPORT_SYMBOL char * +ds_get_audit_name() +{ + return( ds_get_logfile_name(DS_AUDITFILE) ); +} + diff --git a/ldap/admin/lib/dsalib_pw.c b/ldap/admin/lib/dsalib_pw.c new file mode 100644 index 00000000..21fd8ecb --- /dev/null +++ b/ldap/admin/lib/dsalib_pw.c @@ -0,0 +1,29 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/* + * Adjust password policy management related variables. + * + * Valerie Chu + */ + +#include +#include +#include +#include +#include +#include "ldap.h" +#include "ldif.h" +#include "sechash.h" +#include "dsalib.h" +#include "dsalib_pw.h" + +extern char * salted_sha1_pw_enc(char *); + +DS_EXPORT_SYMBOL char * +ds_salted_sha1_pw_enc (char* pwd) +{ + return( salted_sha1_pw_enc(pwd) ); +} diff --git a/ldap/admin/lib/dsalib_tailf.c b/ldap/admin/lib/dsalib_tailf.c new file mode 100644 index 00000000..04e04578 --- /dev/null +++ b/ldap/admin/lib/dsalib_tailf.c @@ -0,0 +1,206 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#if defined( XP_WIN32 ) +#include +#endif +#include +#include +#include +#include +#include +#include "dsalib.h" +#include "prthread.h" + +/* + * Function: adjustFile + * Property: Adjust the file offset to the "tail" of the file + * Called by: DisplayTail + * Return: -1 for error, else file size + */ +static int +adjustFile(FILE *fp, int curSize) +{ + struct stat statBuf; + int fd = fileno(fp); + + if ( fstat(fd, &statBuf) == -1 ) + return(-1); + if ( statBuf.st_size < curSize ) /* file has shrunk! */ + { + if ( fseek(fp, 0L, 0) == -1 ) /* get back to the beginning */ + return(-1); + } + curSize = (int) statBuf.st_size; + if ( !curSize ) + curSize = 1; + return(curSize); +} + +/* + * Function: wrapLines + * Property: wrap lines at 50 characters. When a wrap point is encountered, + * insert the string "\n", since the buffer is going to be placed + * inside a JavaScript alert() call. + * Called by: ds_display_tail + * Return: pointer to wrapped buffer. Caller should free. + */ +static char * +wrapLines( char *buf ) +{ + char *src = buf; + char *obuf, *dst; + int lwidth = 0; + + obuf = malloc( strlen( buf ) * 2 ); /* conservative */ + if ( obuf == NULL ) { + return NULL; + } + dst = obuf; + while ( *src != '\0' ) { + if (( ++lwidth > 50 ) && isspace( *src )) { + *dst++ = '\\'; + *dst++ = 'n'; + lwidth = 0; + src++; + } else { + *dst++ = *src++; + } + } + *dst = '\0'; + return obuf; +} + +DS_EXPORT_SYMBOL int +ds_get_file_size(char *fileName) +{ + struct stat statBuf; + + if ( fileName == NULL ) + return(0); + + if ( stat(fileName, &statBuf) == -1 ) + return(0); + + return(statBuf.st_size); +} + +/* + * Function: ds_display_tail + * Property: follow the tail and display it for timeOut secs or until the line + * read from the file contains the string doneMsg; the lastLine, if not null, + * will be filled in with the last line read from the file; this is useful + * for determining why the server failed to start e.g. port in use, ran out + * of semaphores, database is corrupted, etc. + * Calls: adjustFile + */ +DS_EXPORT_SYMBOL void +ds_display_tail(char *fileName, int timeOut, int startSeek, char *doneMsg, + char *lastLine) +{ + FILE *fp = NULL; + int fd; + char msgBuf[BIG_LINE]; + struct stat statBuf; + int curSize; + int i = timeOut; + + if (lastLine != NULL) + lastLine[0] = 0; + + if ( fileName == NULL ) + return; + /* + * Open the file. + * Try to keep reading it assuming that it may get truncated. + */ + while (i && !fp) + { + fp = fopen(fileName, "r"); + if (!fp) + { + PR_Sleep(PR_SecondsToInterval(1)); + --i; + /* need to print something so http connection doesn't + timeout and also to let the user know something is + happening . . . + */ + if (!(i % 10)) + { + ds_send_status("Attempting to obtain server status . . ."); + } + } + } + + if (!i || !fp) + return; + + fd = fileno(fp); + if ( fstat(fd, &statBuf) == -1 ) { + (void) fclose(fp); + return; + } + curSize = (int) statBuf.st_size; + if ( startSeek < curSize ) + curSize = startSeek; + if ( curSize > 0 ) + if ( fseek(fp, curSize, SEEK_SET) == -1 ) { + (void) fclose(fp); + return; + } + if ( !curSize ) + curSize = 1; /* ensure minimum */ + + while ( i ) + { + int newCurSize; + + newCurSize = curSize = adjustFile(fp, curSize); + if ( curSize == -1 ) { + (void) fclose(fp); + return; + } + while ( fgets(msgBuf, sizeof(msgBuf), fp) ) + { + char *tmp; + if (lastLine != NULL) + strcpy(lastLine, msgBuf); + if ( (tmp = strchr(msgBuf, ((int) '\n'))) != NULL ) + *tmp = '\0'; /* strip out real newlines from here */ + ds_send_status(msgBuf); + if ( (strstr(msgBuf, "WARNING: ") != NULL) || + (strstr(msgBuf, "ERROR: ") != NULL) ) { + char *wrapBuf; + + wrapBuf = wrapLines( msgBuf ); + if ( wrapBuf != NULL ) { + ds_send_error(wrapBuf, 5); + } else { + ds_send_error(msgBuf, 5); + } + } + if ( (doneMsg != NULL) && (strstr(msgBuf, doneMsg)) ) { + (void) fclose(fp); + return; + } + newCurSize = adjustFile(fp, newCurSize); + if ( newCurSize == -1 ) { + (void) fclose(fp); + return; + } + } + if ( ferror(fp) ) { + (void) fclose(fp); + return; + } + clearerr(fp); /* clear eof condition */ + PR_Sleep(PR_SecondsToInterval(1)); + if ( newCurSize != curSize ) + i = timeOut; /* keep going till no more changes */ + else + i--; + } + (void) fclose(fp); +} diff --git a/ldap/admin/lib/dsalib_updown.c b/ldap/admin/lib/dsalib_updown.c new file mode 100644 index 00000000..4f041208 --- /dev/null +++ b/ldap/admin/lib/dsalib_updown.c @@ -0,0 +1,702 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#if defined( XP_WIN32 ) +#include +#include +#include "regparms.h" +#else +#include +#include +#include +#endif +#include +#include +#include +#include +#include "dsalib.h" +#include +#include "nspr.h" + +#if defined( XP_WIN32 ) +SC_HANDLE schService; +SC_HANDLE schSCManager; + +int StartServer(); +int StopandRestartServer(); +int StopServer(); + +int StopNetscapeProgram(); +int StartNetscapeProgram(); + +int StopNetscapeService(); +int StartNetscapeService(); +void WaitForServertoStop(); +#endif + +/* + * Get status for the Directory Server. + * 0 -- down + * 1 -- up + * -1 -- unknown + */ +#if !defined( XP_WIN32 ) +static pid_t server_pid; + +DS_EXPORT_SYMBOL int +ds_get_updown_status() +{ + char pid_file_name[BIG_LINE]; + char *root; + FILE *pidfile; + int ipid = -1; + int status = 0; + + if ( (root = ds_get_install_root()) == NULL ) { + fprintf(stderr, "ds_get_updown_status: could not get install root\n"); + return(DS_SERVER_UNKNOWN); + } + sprintf(pid_file_name, "%s/logs/pid", root); + pidfile = fopen(pid_file_name, "r"); + if ( pidfile == NULL ) { +/* + fprintf(stderr, + "ds_get_updown_status: could not open pid file=%s errno=%d\n", + pid_file_name, errno); +*/ + return(DS_SERVER_DOWN); + } + status = fscanf(pidfile, "%d\n", &ipid); + fclose(pidfile); + if ( status == -1 ) { + fprintf(stderr, + "ds_get_updown_status: pidfile=%s server_pid=%d errno=%d\n", + pid_file_name, ipid, errno); + unlink(pid_file_name); /* junk in file? */ + return(DS_SERVER_DOWN); + } + server_pid = (pid_t) ipid; + if ( (status = kill(server_pid, 0)) != 0 && errno != EPERM ) { + /* we should get ESRCH if the server is down, anything else may be + a real problem */ + if (errno != ESRCH) { + fprintf(stderr, + "ds_get_updown_status: pidfile=%s server_pid=%d status=%d errno=%d\n", + pid_file_name, server_pid, status, errno); + } + unlink(pid_file_name); /* pid does not exist! */ + return(DS_SERVER_DOWN); + } + return(DS_SERVER_UP); +} +#else +DS_EXPORT_SYMBOL int +ds_get_updown_status() +{ + char *ds_name = ds_get_server_name(); + HANDLE hServerDoneEvent = NULL; + + /* watchdog.c creates a global event of this same name */ + if((hServerDoneEvent = OpenEvent(EVENT_ALL_ACCESS, TRUE, ds_name)) != NULL) + { + CloseHandle(hServerDoneEvent); + return(DS_SERVER_UP); + } + if(GetLastError() == ERROR_ACCESS_DENIED) /* it exists */ + return(DS_SERVER_UP); + + /* assume it's not running. */ + return(DS_SERVER_DOWN); +} +#endif + +/* + This function does not require calling ds_get_config(), but requires + that that information be passed in. This is very useful for starting + the server during installation, because we already have all of the + configuration information in memory, we don't need to read it in +*/ +DS_EXPORT_SYMBOL int +ds_bring_up_server_install(int verbose, char *root, char *errorlog) +{ +#if !defined( XP_WIN32 ) + char startup_line[BIG_LINE]; + char statfile[PATH_MAX]; + char *tmp_dir; +#endif + int error = -1; + int status = DS_SERVER_DOWN; + int cur_size = 0; + FILE *sf = NULL; + char msgBuf[BIG_LINE] = {0}; + int secondsToWaitForServer = 600; + char *serverStartupString = "slapd started."; + + status = ds_get_updown_status(); + if ( status == DS_SERVER_UP ) + return(DS_SERVER_ALREADY_UP); + if (!root || !errorlog) + return(DS_SERVER_UNKNOWN); + + if (verbose) { + ds_send_status("starting up server ..."); + cur_size = ds_get_file_size(errorlog); + } + +#if !defined( XP_WIN32 ) + tmp_dir = ds_get_tmp_dir(); + sprintf(statfile, "%s%cstartup.%d", tmp_dir, FILE_SEP, (int)getpid()); + + sprintf(startup_line, "%s%c%s > %s 2>&1", + root, FILE_SEP, START_SCRIPT, statfile); + alter_startup_line(startup_line); + error = system(startup_line); + if (error == -1) + error = DS_SERVER_DOWN; /* could not start server */ + else + error = DS_SERVER_UP; /* started server */ +#else + error = StartServer(); +#endif + + if (error != DS_SERVER_UP) + { +#if !defined( XP_WIN32 ) + FILE* fp = fopen(statfile, "r"); + if (fp) + { + while(fgets(msgBuf, BIG_LINE, fp)) + ds_send_status(msgBuf); + fclose(fp); + } +#endif + return DS_SERVER_COULD_NOT_START; + } + + if (verbose) + { + /* + * Stop in N secs or whenever the startup message comes up. + * Do whichever happens first. msgBuf will contain the last + * line read from the errorlog. + */ + ds_display_tail(errorlog, secondsToWaitForServer, cur_size, + serverStartupString, msgBuf); + } + if ( error != DS_SERVER_UP ) { + int retval = DS_SERVER_UNKNOWN; + if (strstr(msgBuf, "semget")) + retval = DS_SERVER_MAX_SEMAPHORES; + else if (strstr(msgBuf, "Back-End Initialization Failed")) + retval = DS_SERVER_CORRUPTED_DB; + else if (strstr(msgBuf, "not initialized... exiting")) + retval = DS_SERVER_CORRUPTED_DB; + else if (strstr(msgBuf, "address is in use")) + retval = DS_SERVER_PORT_IN_USE; +#if defined( XP_WIN32 ) + /* on NT, if we run out of resources, there will not even be an error + log + */ + else if (msgBuf[0] == 0) { + retval = DS_SERVER_NO_RESOURCES; + } +#endif + if (verbose) + ds_send_error("error in starting server.", 1); + return(retval); + } + if (verbose) { +#if !defined( XP_WIN32 ) + if( !(sf = fopen(statfile, "r")) ) { + ds_send_error("could not read status file.", 1); + return(DS_SERVER_UNKNOWN); + } + + while ( fgets(startup_line, BIG_LINE, sf) ) + ds_send_error(startup_line, 0); + fclose(sf); + unlink(statfile); +#endif + status = DS_SERVER_UNKNOWN; + if (strstr(msgBuf, "semget")) + status = DS_SERVER_MAX_SEMAPHORES; + else if (strstr(msgBuf, "Back-End Initialization Failed")) + status = DS_SERVER_CORRUPTED_DB; + else if (strstr(msgBuf, "not initialized... exiting")) + status = DS_SERVER_CORRUPTED_DB; + else if (strstr(msgBuf, "address is in use")) + status = DS_SERVER_PORT_IN_USE; +#if defined( XP_WIN32 ) + /* on NT, if we run out of resources, there will not even be an error + log + */ + else if (msgBuf[0] == 0) { + status = DS_SERVER_NO_RESOURCES; + } +#endif + } else { + int tries; + for (tries = 0; tries < secondsToWaitForServer; tries++) { + if (ds_get_updown_status() == DS_SERVER_UP) break; + PR_Sleep(PR_SecondsToInterval(1)); + } + if (verbose) { + char str[100]; + sprintf(str, "Had to retry %d times", tries); + ds_send_status(str); + } + } + + if ( (status == DS_SERVER_DOWN) || (status == DS_SERVER_UNKNOWN) ) + status = ds_get_updown_status(); + + return(status); +} + +/* + * Start the Directory Server and return status. + * Do not start if the server is already started. + * 0 -- down + * 1 -- up + * -1 -- unknown + * -2 -- already up + */ + +DS_EXPORT_SYMBOL int +ds_bring_up_server(int verbose) +{ + char *root; + int status; + char *errorlog; + status = ds_get_updown_status(); + if ( status == DS_SERVER_UP ) + return(DS_SERVER_ALREADY_UP); + if ( (root = ds_get_install_root()) == NULL ) + return(DS_SERVER_UNKNOWN); + + errorlog = ds_get_config_value(DS_ERRORLOG); + if ( errorlog == NULL ) { + errorlog = ds_get_errors_name(); /* fallback */ + } + return ds_bring_up_server_install(verbose, root, errorlog); +} + +DS_EXPORT_SYMBOL int +ds_bring_down_server() +{ + char *root; + int status; + int cur_size; + char *errorlog; + + status = ds_get_updown_status(); /* set server_pid too! */ + if ( status != DS_SERVER_UP ) { + ds_send_error("The server is not up.", 0); + return(DS_SERVER_ALREADY_DOWN); + } + if ( (root = ds_get_install_root()) == NULL ) { + ds_send_error("Could not get the server root directory.", 0); + return(DS_SERVER_UNKNOWN); + } + + ds_send_status("shutting down server ..."); + if (!(errorlog = ds_get_errors_name())) { + ds_send_error("Could not get the error log filename.", 0); + return DS_SERVER_UNKNOWN; + } + + cur_size = ds_get_file_size(errorlog); +#if !defined( XP_WIN32 ) + if ( (kill(server_pid, SIGTERM)) != 0) { + if (errno == EPERM) { + ds_send_error("Not permitted to kill server.", 0); + fprintf (stdout, "[%s]: kill (%li, SIGTERM) failed with errno = EPERM.
                      \n", + ds_get_server_name(), (long)server_pid); + } else { + ds_send_error("error in killing server.", 1); + } + return(DS_SERVER_UNKNOWN); + } +#else + if( StopServer() == DS_SERVER_DOWN ) + { + ds_send_status("shutdown: server shut down"); + } + else + { + ds_send_error("error in killing server.", 1); + return(DS_SERVER_UNKNOWN); + } +#endif + /* + * Wait up to SERVER_STOP_TIMEOUT seconds for the stopped message to + * appear in the error log. + */ + ds_display_tail(errorlog, SERVER_STOP_TIMEOUT, cur_size, "slapd stopped.", NULL); + /* in some cases, the server will tell us it's down when it's really not, + so give the OS a chance to remove it from the process table */ + PR_Sleep(PR_SecondsToInterval(1)); + return(ds_get_updown_status()); +} + +#if defined( XP_WIN32 ) + +static BOOLEAN +IsService() +{ +#if 0 + CHAR ServerKey[512], *ValueString; + HKEY hServerKey; + DWORD dwType, ValueLength, Result; + + sprintf(ServerKey,"%s\\%s\0", COMPANY_KEY, PRODUCT_KEY); + + Result = RegOpenKey(HKEY_LOCAL_MACHINE, ServerKey, &hServerKey); + if (Result != ERROR_SUCCESS) { + return TRUE; + } + ValueLength = 512; + ValueString = (PCHAR)malloc(ValueLength); + + Result = RegQueryValueEx(hServerKey, IS_SERVICE_KEY, NULL, + &dwType, ValueString, &ValueLength); + if (Result != ERROR_SUCCESS) { + return TRUE; + } + if (strcmp(ValueString, "yes")) { + return FALSE; + } + else { + return TRUE; + } +#else + return TRUE; +#endif +} + +#if 0 +NSAPI_PUBLIC BOOLEAN +IsAdminService() +{ + CHAR AdminKey[512], *ValueString; + HKEY hAdminKey; + DWORD dwType, ValueLength, Result; + + sprintf(AdminKey,"%s\\%s\0", COMPANY_KEY, ADMIN_REGISTRY_ROOT_KEY); + + Result = RegOpenKey(HKEY_LOCAL_MACHINE, AdminKey, &hAdminKey); + if (Result != ERROR_SUCCESS) { + return TRUE; + } + ValueLength = 512; + ValueString = (PCHAR)malloc(ValueLength); + + Result = RegQueryValueEx(hAdminKey, IS_SERVICE_KEY, NULL, + &dwType, ValueString, &ValueLength); + if (Result != ERROR_SUCCESS) { + return TRUE; + } + if (strcmp(ValueString, "yes")) { + return FALSE; + } else { + return TRUE; + } +} +#endif + +int +StartServer() +{ + CHAR ErrorString[512]; + BOOLEAN Service; + + /* Figure out if the server is a service or an exe */ + Service = IsService(); + + if(Service) { + if (!(schSCManager = OpenSCManager( + NULL, // machine (NULL == local) + NULL, // database (NULL == default) + SC_MANAGER_ALL_ACCESS // access required + ))) { + sprintf(ErrorString, + "Error: Could not open the ServiceControlManager:%d " + "Please restart the server %s from the Services Program Item " + "in the Control Panel", ds_get_server_name(), GetLastError()); + ds_send_error(ErrorString, 0); + return(DS_SERVER_UNKNOWN); + } + return(StartNetscapeService()); + } else { + return(StartNetscapeProgram()); + } +} + +int +StopandRestartServer() +{ + CHAR ErrorString[512]; + BOOLEAN Service; + + + /* First figure out if the server is a service or an exe */ + Service = IsService(); + if(Service) { + if (!(schSCManager = OpenSCManager( + NULL, // machine (NULL == local) + NULL, // database (NULL == default) + SC_MANAGER_ALL_ACCESS // access required + ))) { + sprintf(ErrorString, + "Error: Could not restart server." + "Please restart the server %s from the Services Program Item " + "in the Control Panel", ds_get_server_name()); + ds_send_error(ErrorString, 0); + return(DS_SERVER_UNKNOWN); + } + if (StopNetscapeService() != DS_SERVER_DOWN) + return(DS_SERVER_UNKNOWN); + + return(StartNetscapeService()); + } else { + if (StopNetscapeProgram() != DS_SERVER_DOWN) + return(DS_SERVER_UNKNOWN); + return(StartNetscapeProgram()); + } + +} + +int +StopServer() +{ + CHAR ErrorString[512]; + BOOLEAN Service; + + /* First figure out if the server is a service or an exe */ + Service = IsService(); + + if(Service) { + if (!(schSCManager = OpenSCManager( + NULL, // machine (NULL == local) + NULL, // database (NULL == default) + SC_MANAGER_ALL_ACCESS // access required + ))) { + sprintf(ErrorString, + "Error: Could not open the ServiceControlManager:%d " + "Please restart the server %s from the Services Program Item " + "in the Control Panel", ds_get_server_name(), GetLastError()); + ds_send_error(ErrorString, 0); + return(DS_SERVER_UNKNOWN); + } + return(StopNetscapeService()); + } else { + return(StopNetscapeProgram()); + } +} + +int +StartNetscapeProgram() +{ + char line[BIG_LINE], cmd[BIG_LINE]; + char *tmp = ds_get_install_root(); + + CHAR ErrorString[512]; + STARTUPINFO siStartInfo; + PROCESS_INFORMATION piProcInfo; + FILE *CmdFile; + + ZeroMemory(line, BIG_LINE); + + sprintf(line, "%s\\startsrv.bat", tmp); + + CmdFile = fopen(line, "r"); + if (!CmdFile) + { + sprintf(ErrorString, "Error:Tried to start Netscape server %s " + ": Could not open the startup script %s :Error %d. Please " + "run startsrv.bat from the server's root directory.", + ds_get_server_name(), line, errno); + ds_send_error(ErrorString, 0); + return(DS_SERVER_DOWN); + } + + ZeroMemory(cmd, BIG_LINE); + if (!fread(cmd, 1, BIG_LINE, CmdFile)) + { + sprintf(ErrorString, "Error:Tried to start Netscape server %s " + ": Could not read the startup script %s :Error %d. Please " + "run startsrv.bat from the server's root directory.", + ds_get_server_name(), line, errno); + ds_send_error(ErrorString, 0); + return(DS_SERVER_DOWN); + } + + ZeroMemory(&siStartInfo, sizeof(STARTUPINFO)); + siStartInfo.cb = sizeof(STARTUPINFO); + siStartInfo.lpReserved = siStartInfo.lpReserved2 = NULL; + siStartInfo.cbReserved2 = 0; + siStartInfo.lpDesktop = NULL; + + if (!CreateProcess(NULL, cmd, NULL, NULL, FALSE, + 0, NULL, NULL, &siStartInfo, &piProcInfo)) + { + sprintf(ErrorString, "Error:Tried to start Netscape server %s " + ": Could not start up the startup script %s :Error %d. Please " + "run startsrv.bat from the server's root directory.", + ds_get_server_name(), line, GetLastError()); + ds_send_error(ErrorString, 0); + return(DS_SERVER_DOWN); + } + + CloseHandle(piProcInfo.hProcess); + CloseHandle(piProcInfo.hThread); + return(DS_SERVER_UP); +} + +int +StopNetscapeProgram() +{ + HANDLE hEvent; + CHAR ErrorString[512]; + char *servid = ds_get_server_name(); + + hEvent = CreateEvent(NULL, TRUE, FALSE, servid); + if(!SetEvent(hEvent)) + { + sprintf(ErrorString, "Tried to stop existing Netscape server %s" + ": Could not signal it to stop :Error %d", + servid, GetLastError()); + ds_send_error(ErrorString, 0); + return(DS_SERVER_UNKNOWN); + } + + return(DS_SERVER_DOWN); +} + +int +StopNetscapeService() +{ + BOOL ret; + SERVICE_STATUS ServiceStatus; + DWORD Error; + CHAR ErrorString[512]; + char *serviceName = ds_get_server_name(); + + schService = OpenService(schSCManager, serviceName, SERVICE_ALL_ACCESS); + + if (schService == NULL) + { + PR_snprintf(ErrorString, 512, "Tried to open Netscape service" + " %s: Error %d (%s). Please" + " stop the server from the Services Item in the Control Panel", + serviceName, GetLastError(), ds_system_errmsg()); + ds_send_error(ErrorString, 0); + return(DS_SERVER_UP); + } + + ret = ControlService(schService, SERVICE_CONTROL_STOP, &ServiceStatus); + Error = GetLastError(); + /* if ControlService returns with ERROR_SERVICE_CANNOT_ACCEPT_CTRL and + the server status indicates that it is either shutdown or in the process + of shutting down, then just wait for it to stop as usual */ + if (ret || + ((Error == ERROR_SERVICE_CANNOT_ACCEPT_CTRL) && + ((ServiceStatus.dwCurrentState == SERVICE_STOPPED) || + (ServiceStatus.dwCurrentState == SERVICE_STOP_PENDING)))) + { + CloseServiceHandle(schService); + /* We make sure that the service is stopped */ + WaitForServertoStop(); + return(DS_SERVER_DOWN); + } + else if (Error != ERROR_SERVICE_NOT_ACTIVE) + { + PR_snprintf(ErrorString, 512, "Tried to stop Netscape service" + " %s: Error %d (%s)." + " Please stop the server from the Services Item in the" + " Control Panel", serviceName, Error, ds_system_errmsg()); + ds_send_error(ErrorString, 0); + return(DS_SERVER_UNKNOWN); + } + return(DS_SERVER_DOWN); +} + + +int +StartNetscapeService() +{ + CHAR ErrorString[512]; + int retries = 0; + char *serviceName = ds_get_server_name(); + + schService = OpenService( + schSCManager, // SCManager database + serviceName, // name of service + SERVICE_ALL_ACCESS); + if (schService == NULL) + { + CloseServiceHandle(schService); + sprintf(ErrorString, "Tried to start" + " the Netscape service %s: Error %d. Please" + " start the server from the Services Item in the Control Panel", + serviceName, GetLastError()); + ds_send_error(ErrorString, 0); + return(DS_SERVER_DOWN); + } + + if (!StartService(schService, 0, NULL)) + { + CloseServiceHandle(schService); + sprintf(ErrorString, "StartService:Could not start " + "the Directory service %s: Error %d. Please restart the server " + "from the Services Item in the Control Panel", + serviceName, GetLastError()); + ds_send_error(ErrorString, 0); + return(DS_SERVER_DOWN); + } + + CloseServiceHandle(schService); + return(DS_SERVER_UP); +} + +void +WaitForServertoStop() +{ + HANDLE hServDoneSemaphore; + int result,retries = 0; + char *serviceName = ds_get_server_name(); + char *newServiceName; + +RETRY: + + newServiceName = (PCHAR)malloc(strlen(serviceName) + 5); + sprintf(newServiceName, "NS_%s\0", serviceName); + + hServDoneSemaphore = CreateSemaphore( + NULL, // security attributes + 0, // initial count for semaphore + 1, // maximum count for semaphore + newServiceName); + + free(newServiceName); + + if ( hServDoneSemaphore == NULL) { + result = GetLastError(); + if (result == ERROR_INVALID_HANDLE) { + if (retries < SERVER_STOP_TIMEOUT) { + retries++; + Sleep(1000); + goto RETRY; + } + } else { + /* We aren't too interested in why the creation failed + * if it is not because of another instance */ + return; + } + } // hServDoneSemaphore == NULL + CloseHandle(hServDoneSemaphore); + return; +} +#endif diff --git a/ldap/admin/lib/dsalib_util.c b/ldap/admin/lib/dsalib_util.c new file mode 100644 index 00000000..a6cf4bee --- /dev/null +++ b/ldap/admin/lib/dsalib_util.c @@ -0,0 +1,1123 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#if defined( XP_WIN32 ) +#include +#include +#else /* XP_WIN32 */ +# if defined( AIXV4 ) +# include +# else /* AIXV4 */ +# include +# endif /* AIXV4 */ +#include +#include +#include +#endif /* XP_WIN3 */ +#include "dsalib.h" +#include +#include +#include +#include +#include +#include +#include + +#define COPY_BUFFER_SIZE 4096 +/* This is the separator string to use when outputting key/value pairs + to be read by the non-HTML front end (Java console) +*/ +static const char *SEPARATOR = ":"; /* from AdmTask.java */ + +#define LOGFILEENVVAR "DEBUG_LOGFILE" /* used for logfp */ + +static int internal_rm_rf(const char *path, DS_RM_RF_ERR_FUNC ds_rm_rf_err_func, void *arg); + +/* return a FILE * opened in append mode to the log file + caller must use fclose to close it +*/ +static FILE * +get_logfp(void) +{ + FILE *logfp = NULL; + char *logfile = getenv(LOGFILEENVVAR); + + if (logfile) { + logfp = fopen(logfile, "a"); + } + return logfp; +} + +DS_EXPORT_SYMBOL int +ds_file_exists(char *filename) +{ + struct stat finfo; + + if ( filename == NULL ) + return 0; + + if ( stat(filename, &finfo) == 0 ) /* successful */ + return 1; + else + return 0; +} + +DS_EXPORT_SYMBOL int +ds_mkdir(char *dir, int mode) +{ + if(!ds_file_exists(dir)) { +#ifdef XP_UNIX + if(mkdir(dir, mode) == -1) +#else /* XP_WIN32 */ + if(!CreateDirectory(dir, NULL)) +#endif /* XP_WIN32 */ + return -1; + } + return 0; +} + + +DS_EXPORT_SYMBOL char * +ds_mkdir_p(char *dir, int mode) +{ + static char errmsg[ERR_SIZE]; + struct stat fi; + char *t; + +#ifdef XP_UNIX + t = dir + 1; +#else /* XP_WIN32 */ + t = dir + 3; +#endif /* XP_WIN32 */ + + while(1) { + t = strchr(t, FILE_PATHSEP); + + if(t) *t = '\0'; + if(stat(dir, &fi) == -1) { + if(ds_mkdir(dir, mode) == -1) { + sprintf(errmsg, "mkdir %s failed (%s)", dir, ds_system_errmsg()); + return errmsg; + } + } + if(t) *t++ = FILE_PATHSEP; + else break; + } + return NULL; +} + + +/* + * Given the name of a directory, return a NULL-terminated array of + * the file names contained in that directory. Returns NULL if the directory + * does not exist or an error occurs, and returns an array with a + * single NULL string if the directory exists but is empty. The caller + * is responsible for freeing the returned array of strings. + * File names "." and ".." are not returned. + */ +#if !defined( XP_WIN32 ) +DS_EXPORT_SYMBOL char ** +ds_get_file_list( char *dir ) +{ + DIR *dirp; + struct dirent *direntp; + char **ret = NULL; + int nfiles = 0; + + if (( dirp = opendir( dir )) == NULL ) { + return NULL; + } + + if (( ret = malloc( sizeof( char * ))) == NULL ) { + return NULL; + }; + + while (( direntp = readdir( dirp )) != NULL ) { + if ( strcmp( direntp->d_name, "." ) && + strcmp( direntp->d_name, ".." )) { + if (( ret = (char **) realloc( ret, + sizeof( char * ) * ( nfiles + 2 ))) == NULL ); + ret[ nfiles ] = strdup( direntp->d_name ); + nfiles++; + } + } + (void) closedir( dirp ); + + ret[ nfiles ] = NULL; + return ret; +} +#else +DS_EXPORT_SYMBOL char ** +ds_get_file_list( char *dir ) +{ + char szWildcardFileSpec[MAX_PATH]; + char **ret = NULL; + long hFile; + struct _finddata_t fileinfo; + int nfiles = 0; + + if( ( dir == NULL ) || (strlen( dir ) == 0) ) + return NULL; + + if( ( ret = malloc( sizeof( char * ) ) ) == NULL ) + return NULL; + + strcpy(szWildcardFileSpec, dir); + strcat(szWildcardFileSpec, "/*"); + + hFile = _findfirst( szWildcardFileSpec, &fileinfo); + if( hFile == -1 ) + return NULL; + + if( ( strcmp( fileinfo.name, "." ) != 0 ) && + ( strcmp( fileinfo.name, ".." ) != 0 ) ) + { + ret[ nfiles++ ] = strdup( fileinfo.name ); + } + + while( _findnext( hFile, &fileinfo ) == 0 ) + { + if( ( strcmp( fileinfo.name, "." ) != 0 ) && + ( strcmp( fileinfo.name, ".." ) != 0 ) ) + { + if( ( ret = (char **) realloc( ret, sizeof( char * ) * ( nfiles + 2 ) ) ) != NULL ) + ret[ nfiles++ ] = strdup( fileinfo.name); + } + } + + _findclose( hFile ); + ret[ nfiles ] = NULL; + return ret; +} +#endif /* ( XP_WIN32 ) */ + + +DS_EXPORT_SYMBOL time_t +ds_get_mtime(char *filename) +{ + struct stat fi; + + if ( stat(filename, &fi) ) + return 0; + return fi.st_mtime; +} + +/* + * Copy files: return is + * 1: success + * 0: failure + * Print errors as needed. + */ +DS_EXPORT_SYMBOL int +ds_cp_file(char *sfile, char *dfile, int mode) +{ +#if defined( XP_WIN32 ) + return( CopyFile( sfile, dfile, FALSE ) ); /* Copy even if dfile exists */ +#else + int sfd, dfd, len; + struct stat fi; + char copy_buffer[COPY_BUFFER_SIZE]; + unsigned long read_len; + char error[BIG_LINE]; + +/* Make sure we're in the right umask */ + umask(022); + + if( (sfd = open(sfile, O_RDONLY)) == -1) { + sprintf(error, "Can't open file %s for reading.", sfile); + ds_send_error(error, 1); + return(0); + } + + fstat(sfd, &fi); + if (!(S_ISREG(fi.st_mode))) { + sprintf(error, "File %s is not a regular file.", sfile); + ds_send_error(error, 1); + close(sfd); + return(0); + } + len = fi.st_size; + + if( (dfd = open(dfile, O_RDWR | O_CREAT | O_TRUNC, mode)) == -1) { + sprintf(error, "can't write to file %s", dfile); + ds_send_error(error, 1); + close(sfd); + return(0); + } + while (len) { + read_len = len>COPY_BUFFER_SIZE?COPY_BUFFER_SIZE:len; + + if ( (read_len = read(sfd, copy_buffer, read_len)) == -1) { + sprintf(error, "Error reading file %s for copy.", sfile); + ds_send_error(error, 1); + close(sfd); + close(dfd); + return(0); + } + + if ( write(dfd, copy_buffer, read_len) != read_len) { + sprintf(error, "Error writing file %s for copy.", dfile); + ds_send_error(error, 1); + close(sfd); + close(dfd); + return(0); + } + + len -= read_len; + } + close(sfd); + close(dfd); + return(1); +#endif +} + +/* Returns a directory path used for tmp files. */ +DS_EXPORT_SYMBOL char * +ds_get_tmp_dir() +{ + static char tmpdir[] = "/tmp"; + static char tmp[256] = {0}; + unsigned ilen; + char pch; + char* instanceDir = ds_get_install_root(); + + if(instanceDir == NULL) + { + #if defined( XP_WIN32 ) + ilen = strlen(tmp); + GetTempPath( ilen +1, tmp ); + /* Remove trailing slash. */ + pch = tmp[ilen-1]; + if( pch == '\\' || pch == '/' ) + tmp[ilen-1] = '\0'; + return tmp; + #else + return( tmpdir ); + #endif + } + + sprintf(tmp,"%s/tmp",instanceDir); + +#if defined( XP_WIN32 ) + for(ilen=0;ilen < strlen(tmp); ilen++) + { + if(tmp[ilen]=='/') + tmp[ilen]='\\'; + } +#endif + + if(!ds_file_exists(tmp)) + ds_mkdir_p(tmp,00770); + + return ( tmp ); +} + +DS_EXPORT_SYMBOL void +ds_unixtodospath(char *szText) +{ + if(szText) + { + while(*szText) + { + if( *szText == '/' ) + *szText = '\\'; + szText++; + } + } +} + +/* converts '\' chars to '/' */ +DS_EXPORT_SYMBOL void +ds_dostounixpath(char *szText) +{ + if(szText) + { + while(*szText) + { + if( *szText == '\\' ) + *szText = '/'; + szText++; + } + } +} + +/* converts ':' chars to ' ' */ +DS_EXPORT_SYMBOL void +ds_timetofname(char *szText) +{ + if(szText) + { + /* Replace trailing newline */ + szText[ strlen( szText ) -1 ] = 0; + while(*szText) + { + if( *szText == ':' || + *szText == ' ' ) + *szText = '_'; + szText++; + } + } +} + +/* Effects a rename in 2 steps, needed on NT because if the +target of a rename() already exists, the rename() will fail. */ +DS_EXPORT_SYMBOL int +ds_saferename(char *szSrc, char *szTarget) +{ +#ifdef XP_WIN32 + int iRetVal; + char *szTmpFile; + struct stat buf; +#endif + + if( !szSrc || !szTarget ) + return 1; + +#if defined( XP_WIN32 ) + + szTmpFile = mktemp("slrnXXXXXX" ); + if( stat( szTarget, &buf ) == 0 ) + { + /* Target file exists */ + if( !szTmpFile ) + return 1; + + if( !ds_cp_file( szTarget, szTmpFile, 0644) ) + return( 1 ); + + unlink( szTarget ); + if( (iRetVal = rename( szSrc, szTarget )) != 0 ) + { + /* Failed to rename, copy back. */ + ds_cp_file( szTmpFile, szTarget, 0644); + } + /* Now remove temp file */ + unlink( szTmpFile ); + } + else + iRetVal = rename(szSrc, szTarget); + + return iRetVal; +#else + return rename(szSrc, szTarget); +#endif + +} + +DS_EXPORT_SYMBOL char* +ds_encode_all (const char* s) +{ + char* r; + size_t l; + size_t i; + if (s == NULL || *s == '\0') { + return strdup (""); + } + l = strlen (s); + r = malloc (l * 3 + 1); + for (i = 0; *s != '\0'; ++s) { + r[i++] = '%'; + sprintf (r + i, "%.2X", 0xFF & (unsigned int)*s); + i += 2; + } + r[i] = '\0'; + return r; +} + +DS_EXPORT_SYMBOL char* +ds_URL_encode (const char* s) +{ + char* r; + size_t l; + size_t i; + if (s == NULL || *s == '\0') { + return strdup (""); + } + l = strlen (s) + 1; + r = malloc (l); + for (i = 0; *s != '\0'; ++s) { + if (*s >= 0x20 && *s <= 0x7E && strchr (" <>\"#%{}[]|\\^~`?,;=+\n", *s) == NULL) { + if (l - i <= 1) r = realloc (r, l *= 2); + r[i++] = *s; + } else { /* encode *s */ + if (l - i <= 3) r = realloc (r, l *= 2); + r[i++] = '%'; + sprintf (r + i, "%.2X", 0xFF & (unsigned int)*s); + i += 2; + } + } + r[i] = '\0'; + return r; +} + +DS_EXPORT_SYMBOL char* +ds_URL_decode (const char* original) +{ + char* r = strdup (original); + char* s; + for (s = r; *s != '\0'; ++s) { + if (*s == '+') { + *s = ' '; + } + else if (*s == '%' && isxdigit(s[1]) && isxdigit(s[2])) { + memmove (s, s+1, 2); + s[2] = '\0'; + *s = (char)strtoul (s, NULL, 16); + memmove (s+1, s+3, strlen (s+3) + 1); + } + } + return r; +} + +#if !defined( XP_WIN32 ) +#include /* errno */ +#include /* getpwnam */ + +static int saved_uid_valid = 0; +static uid_t saved_uid; +static int saved_gid_valid = 0; +static gid_t saved_gid; + +#if defined( HPUX ) +#define SETEUID(id) setresuid((uid_t) -1, id, (uid_t) -1) +#else +#define SETEUID(id) seteuid(id) +#endif + +#endif + +DS_EXPORT_SYMBOL char* +ds_become_localuser_name (char *localuser) +{ +#if !defined( XP_WIN32 ) + if (localuser != NULL) { + struct passwd* pw = getpwnam (localuser); + if (pw == NULL) { + fprintf (stderr, "getpwnam(%s) == NULL; errno %d", + localuser, errno); + fprintf (stderr, "\n"); + fflush (stderr); + } else { + if ( ! saved_uid_valid) saved_uid = geteuid(); + if ( ! saved_gid_valid) saved_gid = getegid(); + if (setgid (pw->pw_gid) == 0) { + saved_gid_valid = 1; + } else { + fprintf (stderr, "setgid(%li) != 0; errno %d", + (long)pw->pw_gid, errno); + fprintf (stderr, "\n"); + fflush (stderr); + } + if (SETEUID (pw->pw_uid) == 0) { + saved_uid_valid = 1; + } else { + fprintf (stderr, "seteuid(%li) != 0; errno %d", + (long)pw->pw_uid, errno); + fprintf (stderr, "\n"); + fflush (stderr); + } + } + } + return NULL; +#else + return NULL; +#endif +} + +DS_EXPORT_SYMBOL char* +ds_become_localuser (char **ds_config) +{ +#if !defined( XP_WIN32 ) + char* localuser = ds_get_value (ds_config, ds_get_var_name(DS_LOCALUSER), 0, 1); + if (localuser != NULL) { + char *rv = ds_become_localuser_name(localuser); + + free(localuser); + return rv; + } + return NULL; +#else + return NULL; +#endif +} + +DS_EXPORT_SYMBOL char* +ds_become_original (char **ds_config) +{ +#if !defined( XP_WIN32 ) + if (saved_uid_valid) { + if (SETEUID (saved_uid) == 0) { + saved_uid_valid = 0; + } else { + fprintf (stderr, "seteuid(%li) != 0; errno %d
                      n", + (long)saved_uid, errno); + fflush (stderr); + } + } + if (saved_gid_valid) { + if (setgid (saved_gid) == 0) { + saved_gid_valid = 0; + } else { + fprintf (stderr, "setgid(%li) != 0; errno %d
                      \n", + (long)saved_gid, errno); + fflush (stderr); + } + } + return NULL; +#else + return NULL; +#endif +} + +/* + * When a path containing a long filename is passed to system(), the call + * fails. Therfore, we need to use the short version of the path, when + * constructing the path to pass to system(). + */ +DS_EXPORT_SYMBOL char* +ds_makeshort( char * filepath ) +{ +#if defined( XP_WIN32 ) + char *shortpath = malloc( MAX_PATH ); + DWORD dwStatus; + if( shortpath ) + { + dwStatus = GetShortPathName( filepath, shortpath, MAX_PATH ); + return( shortpath ); + } +#endif + return filepath; +} + +/* returns 1 if string "searchstring" found in file "filename" */ +DS_EXPORT_SYMBOL int +ds_search_file(char *filename, char *searchstring) +{ + struct stat finfo; + FILE * sf; + char big_line[BIG_LINE]; + + if( filename == NULL ) + return 0; + + if( stat(filename, &finfo) != 0 ) /* successful */ + return 0; + + if( !(sf = fopen(filename, "r")) ) + return 0; + + while ( fgets(big_line, BIG_LINE, sf) ) { + if( strstr( big_line, searchstring ) != NULL ) { + fclose(sf); + return 1; + } + } + + fclose(sf); + + return 0; +} + +/* + * on linux when running as root, doing something like + * system("date > out.log 2>&1") will fail, because of an + * ambigious redirect. This works for /bin/sh, but not /bin/csh or /bin/tcsh + * + * using this would turn + * system("date > out.log 2>&1"); + * into + * system("/bin/sh/ -c \"date > out.log 2>&1\"") + * + */ +DS_EXPORT_SYMBOL void +alter_startup_line(char *startup_line) +{ +#if (defined Linux && !defined LINUX2_4) + char temp_startup_line[BIG_LINE+40]; + + sprintf(temp_startup_line, "/bin/sh -c \"%s\"", startup_line); + strcpy(startup_line, temp_startup_line); +#else + /* do nothing */ +#endif /* Linux */ +} + +DS_EXPORT_SYMBOL void +ds_send_error(char *errstr, int print_errno) +{ + FILE *logfp; + fprintf(stdout, "error%s%s\n", SEPARATOR, errstr); + if (print_errno && errno) + fprintf(stdout, "system_errno%s%d\n", SEPARATOR, errno); + + fflush(stdout); + + if (logfp = get_logfp()) { + fprintf(logfp, "error%s%s\n", SEPARATOR, errstr); + if (print_errno && errno) + fprintf(logfp, "system_errno%s%d\n", SEPARATOR, errno); + fclose(logfp); + } + +} + +DS_EXPORT_SYMBOL void +ds_send_status(char *str) +{ + FILE *logfp; + fprintf(stdout, "[%s]: %s\n", ds_get_server_name(), str); + fflush(stdout); + + if (logfp = get_logfp()) { + fprintf(logfp, "[%s]: %s\n", ds_get_server_name(), str); + fclose(logfp); + } +} + +/* type and doexit are unused + I'm not sure what type is supposed to be used for + removed the doexit code because we don't want to + exit abruptly anymore, we must exit by returning an + exit code from the return in main() +*/ +static void +report_error(int type, char *msg, char *details, int doexit) +{ + char error[BIG_LINE*4] = {0}; + + if (msg) + { + strcat(error, msg); + strcat(error, SEPARATOR); + } + if (details) + strcat(error, details); + ds_send_error(error, 1); +} + +DS_EXPORT_SYMBOL void +ds_report_error(int type, char *msg, char *details) +{ + /* richm - changed exit flag to 0 - we must not exit + abruptly, we should instead exit by returning a code + as the return value of main - this ensures that callers + are properly notified of the status + */ + report_error(type, msg, details, 0); +} + +DS_EXPORT_SYMBOL void +ds_report_warning(int type, char *msg, char *details) +{ + report_error(type, msg, details, 0); +} + +DS_EXPORT_SYMBOL void +ds_show_message(const char *message) +{ + FILE *logfp; + printf("%s\n", message); + fflush(stdout); + + if (logfp = get_logfp()) { + fprintf(logfp, "%s\n", message); + fclose(logfp); + } + + return; +} + +DS_EXPORT_SYMBOL void +ds_show_key_value(char *key, char *value) +{ + FILE *logfp; + printf("%s%s%s\n", key, SEPARATOR, value); + + if (logfp = get_logfp()) { + fprintf(logfp, "%s%s%s\n", key, SEPARATOR, value); + fclose(logfp); + } + return; +} + +/* Stolen from the Admin Server dsgw_escape_for_shell */ +DS_EXPORT_SYMBOL char * +ds_escape_for_shell( char *s ) +{ + char *escaped; + char tmpbuf[4]; + size_t x,l; + + if ( s == NULL ) { + return( s ); + } + + l = 3 * strlen( s ) + 1; + escaped = malloc( l ); + memset( escaped, 0, l ); + for ( x = 0; s[x]; x++ ) { + if (( (unsigned char)s[x] & 0x80 ) == 0 ) { + strncat( escaped, &s[x], 1 ); + } else { + /* not an ASCII character - escape it */ + sprintf( tmpbuf, "\\%x", (unsigned)(((unsigned char)(s[x])) & 0xff) ); + strcat( escaped, tmpbuf ); + } + } + return( escaped ); +} + +DS_EXPORT_SYMBOL char * +ds_system_errmsg(void) +{ + static char static_error[BUFSIZ]; + char *lmsg = 0; /* Local message pointer */ + size_t msglen = 0; + int sys_error = 0; +#ifdef XP_WIN32 + LPTSTR sysmsg = 0; +#endif + + /* Grab the OS error message */ +#ifdef XP_WIN32 + sys_error = GetLastError(); +#else + sys_error = errno; +#endif + +#if defined(XP_WIN32) + msglen = FormatMessage( + FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_ALLOCATE_BUFFER, + NULL, + GetLastError(), + LOCALE_SYSTEM_DEFAULT, + (LPTSTR)&sysmsg, + 0, + 0); + if (msglen > 0) + lmsg = sysmsg; + SetLastError(0); +#else + lmsg = strerror(errno); + errno = 0; +#endif + + if (!lmsg) + static_error[0] = 0; + else + { + /* At this point lmsg points to something. */ + int min = 0; + msglen = strlen(lmsg); + + min = msglen > BUFSIZ ? BUFSIZ : msglen; + strncpy(static_error, lmsg, min); + static_error[min-1] = 0; + } + +#ifdef XP_WIN32 + /* NT's FormatMessage() dynamically allocated the msg; free it */ + if (sysmsg) + LocalFree(sysmsg); +#endif + + return static_error; +} + +/* get db path dir info from dse.ldif and remove it if it's not under path +*/ +#ifndef MAXPATHLEN +#define MAXPATHLEN 1024 +#endif + +enum { + DB_DIRECTORY = 0, + DB_LOGDIRECTORY, + DB_CHANGELOGDIRECTORY, + DB_HOME_DIRECTORY +}; + +static int +is_fullpath(char *path) +{ + int len; + if (NULL == path || '\0' == *path) + return 0; + + if (FILE_PATHSEP == *path) /* UNIX */ + return 1; + + len = strlen(path); + if (len > 2) + { + if (':' == path[1] && ('/' == path[2] || '\\' == path[2])) /* Windows */ + return 1; + } + return 0; +} + +static void +rm_db_dirs(char *fullpath, DS_RM_RF_ERR_FUNC ds_rm_rf_err_func, void *arg) +{ + FILE *fp = fopen(fullpath, "r"); + char buf[2][MAXPATHLEN]; + char rmbuf[MAXPATHLEN]; + char *bufp, *nextbufp; + char *retp; + int readit = 0; + + if (fp == NULL) + { + ds_rm_rf_err_func(fullpath, "opening dse.ldif", arg); + return; + } + + bufp = buf[0]; *bufp = '\0'; + nextbufp = buf[1]; *nextbufp = '\0'; + + while (readit || (retp = fgets(bufp, MAXPATHLEN, fp)) != NULL) + { + int len = strlen(bufp); + int type = -1; + char *p, *q; + + if (strstr(bufp, "nsslapd-directory")) + type = DB_DIRECTORY; + else if (strstr(bufp, "nsslapd-db-home-directory")) + type = DB_HOME_DIRECTORY; + else if (strstr(bufp, "nsslapd-db-logdirectory")) + type = DB_LOGDIRECTORY; + else if (strstr(bufp, "nsslapd-changelogdir")) + type = DB_CHANGELOGDIRECTORY; + else + { + readit = 0; + continue; + } + + p = bufp + len; + + while ((retp = fgets(nextbufp, MAXPATHLEN, fp)) != NULL) + { + int thislen; + if (*nextbufp == ' ') + { + thislen = strlen(nextbufp); + len += thislen; + if (len < MAXPATHLEN) + { + strncpy(p, nextbufp, thislen); + p += thislen; + } + /* else too long as a path. ignore it */ + } + else + break; + } + if (retp == NULL) /* done */ + break; + + p = strchr(bufp, ':'); + if (p == NULL) + { + char *tmpp = bufp; + bufp = nextbufp; + nextbufp = tmpp; + readit = 1; + continue; + } + + while (*(++p) == ' ') ; + + q = p + strlen(p) - 1; + while (*q == ' ' || *q == '\t' || *q == '\n') + q--; + *(q+1) = '\0'; + + switch (type) + { + case DB_DIRECTORY: + case DB_LOGDIRECTORY: + case DB_CHANGELOGDIRECTORY: + if (is_fullpath(p)) + internal_rm_rf(p, ds_rm_rf_err_func, NULL); + break; + case DB_HOME_DIRECTORY: + internal_rm_rf(p, ds_rm_rf_err_func, NULL); + break; + } + } + + fclose(fp); +} + +/* this function will recursively remove a directory hierarchy from the file + system, like "rm -rf" + In order to handle errors, the user supplies a callback function. When an + error occurs, the callback function is called with the file or directory name + and the system errno. The callback function should return TRUE if it wants + to continue or FALSE if it wants the remove aborted. + The error callback should use PR_GetError and/or PR_GetOSError to + determine the cause of the failure +*/ +/* you could locate db dirs non standard location + we should remove them, as well. +*/ +static int +internal_rm_rf(const char *path, DS_RM_RF_ERR_FUNC ds_rm_rf_err_func, void *arg) +{ + struct PRFileInfo prfi; + char *fullpath = NULL; + int retval = 0; + + if (PR_GetFileInfo(path, &prfi) != PR_SUCCESS) { + if (!ds_rm_rf_err_func(path, "reading directory", arg)) { + return 1; + } + } + + if (prfi.type == PR_FILE_DIRECTORY) + { + PRDir *dir; + PRDirEntry *dirent; + + if (!(dir = PR_OpenDir(path))) { + if (!ds_rm_rf_err_func(path, "opening directory", arg)) { + return 1; + } + return 0; + } + + while (dirent = PR_ReadDir(dir, PR_SKIP_BOTH)) { + char *fullpath = PR_smprintf("%s%c%s", path, FILE_PATHSEP, dirent->name); + if (PR_GetFileInfo(fullpath, &prfi) != PR_SUCCESS) { + if (!ds_rm_rf_err_func(fullpath, "reading file", arg)) { + PR_smprintf_free(fullpath); + PR_CloseDir(dir); + return 1; + } /* else just continue */ + } else if (prfi.type == PR_FILE_DIRECTORY) { + retval = internal_rm_rf(fullpath, ds_rm_rf_err_func, arg); + if (retval) { /* non zero return means stop */ + PR_smprintf_free(fullpath); + break; + } + } else { + /* if dse.ldif, check db dir is under the instance dir or not */ + if (0 == strcmp(dirent->name, "dse.ldif")) + rm_db_dirs(fullpath, ds_rm_rf_err_func, arg); + + if (PR_Delete(fullpath) != PR_SUCCESS) { + if (!ds_rm_rf_err_func(fullpath, "deleting file", arg)) { + PR_smprintf_free(fullpath); + PR_CloseDir(dir); + return 1; + } + } + } + PR_smprintf_free(fullpath); + } + PR_CloseDir(dir); + if (PR_RmDir(path) != PR_SUCCESS) { + if (!ds_rm_rf_err_func(path, "removing directory", arg)) { + retval = 1; + } + } + } + + return retval; +} + +static int +default_err_func(const char *path, const char *op, void *arg) +{ + PRInt32 errcode = PR_GetError(); + char *msg; + const char *errtext; + + if (!errcode || (errcode == PR_UNKNOWN_ERROR)) { + errcode = PR_GetOSError(); + errtext = ds_system_errmsg(); + } else { + errtext = PR_ErrorToString(errcode, PR_LANGUAGE_I_DEFAULT); + } + + msg = PR_smprintf("%s %s: error code %d (%s)", op, path, errcode, errtext); + ds_send_error(msg, 0); + PR_smprintf_free(msg); + return 1; /* just continue */ +} + +DS_EXPORT_SYMBOL int +ds_rm_rf(const char *dir, DS_RM_RF_ERR_FUNC ds_rm_rf_err_func, void *arg) +{ + int retval = 0; + struct PRFileInfo prfi; + + if (!dir) { + ds_send_error("Could not remove NULL directory name", 1); + return 1; + } + + if (!ds_rm_rf_err_func) { + ds_rm_rf_err_func = default_err_func; + } + + if (PR_GetFileInfo(dir, &prfi) != PR_SUCCESS) { + if (ds_rm_rf_err_func(dir, "reading directory", arg)) { + return 0; + } else { + return 1; + } + } + if (prfi.type != PR_FILE_DIRECTORY) { + char *msg = PR_smprintf("Cannot remove directory %s because it is not a directory", dir); + ds_send_error(msg, 0); + PR_smprintf_free(msg); + return 1; + } + + return internal_rm_rf(dir, ds_rm_rf_err_func, arg); +} + +DS_EXPORT_SYMBOL int +ds_remove_reg_key(void *base, const char *format, ...) +{ + int rc = 0; +#ifdef XP_WIN32 + int retries = 3; + HKEY hkey = (HKEY)base; + char *key; + va_list ap; + + va_start(ap, format); + key = PR_vsmprintf(format, ap); + va_end(ap); + + do { + if (ERROR_SUCCESS != RegDeleteKey(hkey, key)) { + rc = GetLastError(); + if (rc == ERROR_BADKEY || rc == ERROR_CANTOPEN || + rc == ERROR_CANTREAD || + rc == ERROR_CANTWRITE || rc == ERROR_KEY_DELETED || + rc == ERROR_ALREADY_EXISTS || rc == ERROR_NO_MORE_FILES) { + rc = 0; /* key already deleted - no error */ + } else if ((retries > 1) && (rc == ERROR_IO_PENDING)) { + /* the key is busy - lets wait and try again */ + PR_Sleep(PR_SecondsToInterval(3)); + retries--; + } else { + char *errmsg = PR_smprintf("Could not remove registry key %s - error %d (%s)", + key, rc, ds_system_errmsg()); + ds_send_error(errmsg, 0); + PR_smprintf_free(errmsg); + break; /* no retry, just fail */ + } + } + } while (rc && retries); + PR_smprintf_free(key); +#endif + return rc; +} diff --git a/ldap/admin/src/AddPerlHeader.pl b/ldap/admin/src/AddPerlHeader.pl new file mode 100644 index 00000000..a3be11b5 --- /dev/null +++ b/ldap/admin/src/AddPerlHeader.pl @@ -0,0 +1,60 @@ +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# used to add the perl preamble to all perl scripts used by the directory +# server run time; the problem is that the INC paths are compiled into +# the executable and cannot be overridden at run time, so we have to make +# sure we fix them + +# the first argument is the source path for the INC path +# the second argument is the token to replace with the server root +# at install time +# the third argument is the source perl script +# the fourth argument is the destination perl script +# + +($sourceLibPath, $serverRootToken, $sourceScript, $destScript) = @ARGV; +open SRC, $sourceScript or die "Error: could not open $sourceScript: $!"; +open DEST, ">$destScript" or die "Error: could not write $destScript: $!"; + +$isNT = -d '\\'; + +print DEST<) { + print DEST; +} + +close DEST; +close SRC; diff --git a/ldap/admin/src/Base.def b/ldap/admin/src/Base.def new file mode 100644 index 00000000..ff1d1451 --- /dev/null +++ b/ldap/admin/src/Base.def @@ -0,0 +1,13 @@ +; BEGIN COPYRIGHT BLOCK +; Copyright 2001 Sun Microsystems, Inc. +; Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +; All rights reserved. +; END COPYRIGHT BLOCK +; +DESCRIPTION 'Netscape Setup SDK Dynamic perl module' +CODE SHARED READ EXECUTE +DATA SHARED READ WRITE +EXPORTS + XS_NSSetupSDK__Base_toLocal @2 + XS_NSSetupSDK__Base_toUTF8 @3 + boot_NSSetupSDK__Base @4 diff --git a/ldap/admin/src/Base.pm b/ldap/admin/src/Base.pm new file mode 100644 index 00000000..cbebf192 --- /dev/null +++ b/ldap/admin/src/Base.pm @@ -0,0 +1,63 @@ +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# + +package NSSetupSDK::Base; + +use POSIX; + +use strict; +use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $AUTOLOAD); + +require Exporter; +require DynaLoader; +require AutoLoader; + +@ISA = qw(Exporter DynaLoader); +# Items to export into callers namespace by default. Note: do not export +# names by default without a very good reason. Use EXPORT_OK instead. +# Do not simply export all your public functions/methods/constants. + +# Items to export into callers namespace by default. Note: do not export +# names by default without a very good reason. Use EXPORT_OK instead. +# Do not simply export all your public functions/methods/constants. +@EXPORT = qw( + toLocal toUTF8 +); +$VERSION = '1.00'; + +bootstrap NSSetupSDK::Base $VERSION; + +# Autoload methods go after =cut, and are processed by the autosplit program. + +1; +__END__ +# Below is the stub of documentation for your module. You better edit it! + +=head1 NAME + +NSSetupSDK::Base - Perl extension for directory server administrative utility functions + +=head1 SYNOPSIS + + use NSSetupSDK::Base; + +=head1 DESCRIPTION + +The NSSetupSDK::Base module is used by directory server administration scripts, such as +those used for installation/uninstallation, instance creation/removal, CGIs, +etc. + +=head1 AUTHOR + +Richard Megginson richm@netscape.com + +=head1 SEE ALSO + +perl(1). + +=cut diff --git a/ldap/admin/src/CGI_ENV b/ldap/admin/src/CGI_ENV new file mode 100644 index 00000000..d96d3ff8 --- /dev/null +++ b/ldap/admin/src/CGI_ENV @@ -0,0 +1,36 @@ +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +The following is a debug printout which is useful for reference. It +is a dump of all the env vars for a real running CGI admin program. +*********************************************************************** +HTTP_HOST=asterix.mcom.com:9616 +HTTP_ACCEPT=image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */* +HTTP_USER_AGENT=Mozilla/2.0 (X11; U; SunOS 5.4 sun4m) +HTTP_CONNECTION=Keep-Alive +ADMSERV_PID=14001 +ADMSERV_ROOT=/export/free2/ns-home/admserv +NETSITE_ROOT=/export/free2/ns-home +SERVER_NAMES=slapd-asterix +CONFIG_DIR=/export/free2/ns-home/admserv/%s/ +COMMIT_LOG=/export/free2/ns-home/admserv/commit +BACKUPS=10 +PATH=/usr/sbin:/usr/bin +TZ=US/Pacific +SERVER_SOFTWARE=Netscape-Administrator/2.0b3 +SERVER_PORT=9616 +SERVER_NAME=asterix.mcom.com +SERVER_URL=http://asterix.mcom.com:9616 +REMOTE_HOST=goa.mcom.com +REMOTE_ADDR=207.1.137.54 +REMOTE_USER=admin +AUTH_TYPE=basic +HTTPS=OFF +GATEWAY_INTERFACE=CGI/1.1 +SERVER_PROTOCOL=HTTP/1.0 +REQUEST_METHOD=GET +SCRIPT_NAME=/slapd-asterix/bin/ds_pcontrol diff --git a/ldap/admin/src/Cgi.pm b/ldap/admin/src/Cgi.pm new file mode 100644 index 00000000..aba11e75 --- /dev/null +++ b/ldap/admin/src/Cgi.pm @@ -0,0 +1,70 @@ +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +package Cgi; + +sub parse { + my $line = shift; + my $assign; + my $var; + my $value; + + # save time, don't parse empty lines + return if (!$line); + + chomp( $line ); + if ( $raw ) { + $raw .= '&' . $line; + } else { + $raw = $line; + } + # decode the line first + $line = &decode($line); + # this only works if there are no '&' characters in var or value . . . + foreach $assign ( split( /&/, $line ) ) { + # assume the var is everything before the first '=' in assign + # and the value is everything after the first '=' + ( $var, $value ) = split( /=/, $assign, 2 ); + $main::cgiVars{$var} = $value; + } +} + +sub decode { + my $string = shift; + + $string =~ s/\+/ /g; + $string =~ s/%(\w\w)/chr(hex($1))/ge; + + return $string; +} + +sub main::freakOut { + my $i; + + for ( $i = 0 ; $i < scalar( @_ ) ; ++$i ) { + $_[$i] =~ s/'/\\'/g; + } + print "\n"; + exit 0; +} + +if ($ENV{'QUERY_STRING'}) { + &parse( $ENV{'QUERY_STRING'} ); + $Cgi::QUERY_STRING = $ENV{'QUERY_STRING'}; +} + +if ( $ENV{'CONTENT_LENGTH'} ) { + read STDIN, $Cgi::CONTENT, $ENV{'CONTENT_LENGTH'}; + &parse( $Cgi::CONTENT ); +} + +# $Cgi::QUERY_STRING contains the query string and +# $Cgi::CONTENT contains what was passed in through stdin + +1; diff --git a/ldap/admin/src/CreateInstall.pl b/ldap/admin/src/CreateInstall.pl new file mode 100644 index 00000000..51714683 --- /dev/null +++ b/ldap/admin/src/CreateInstall.pl @@ -0,0 +1,34 @@ +#!perl +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# figure out what the server root assuming the path to this script is +# server root/bin/slapd/admin/bin + +($serverRoot = $0) =~ s@[\\/]?bin[\\/]slapd[\\/]admin[\\/]bin.*$@@g; + +# run the post install program +$isNT = -d '\\'; +$quote = $isNT ? "\"" : ""; +# make sure the arguments are correctly quoted on NT +@fixargs = map { /^[\"].*[\"]$/ ? $_ : $quote . $_ . $quote } @ARGV; +if (! $serverRoot) { + $serverRoot = "."; +} +chdir "$serverRoot/bin/slapd/admin/bin"; + +# note: exec on NT doesn't work the same way as exec on Unix. On Unix, exec replaces the calling +# process with the called process. The parent, if waiting for the calling process, will happily +# wait for it's replacement. On NT however, the parent thinks the calling process has gone, and +# it doesn't know about the called process, so it stops waiting. So, we have to do a system() +# on NT to force the calling process to wait for the called process. On Unix, we can do the +# faster and more memory efficient exec() call. +if ($isNT) { + system {'./ds_create'} './ds_create', @fixargs; +} else { + exec {'./ds_create'} './ds_create', @fixargs; +} diff --git a/ldap/admin/src/DSAdmin.def b/ldap/admin/src/DSAdmin.def new file mode 100644 index 00000000..a27ea129 --- /dev/null +++ b/ldap/admin/src/DSAdmin.def @@ -0,0 +1,11 @@ +; BEGIN COPYRIGHT BLOCK +; Copyright 2001 Sun Microsystems, Inc. +; Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +; All rights reserved. +; END COPYRIGHT BLOCK +; +LIBRARY "DSAdmin" +EXPORTS + boot_DSAdmin + _boot_DSAdmin = boot_DSAdmin + diff --git a/ldap/admin/src/DSAdmin.mk b/ldap/admin/src/DSAdmin.mk new file mode 100644 index 00000000..f81ca8a2 --- /dev/null +++ b/ldap/admin/src/DSAdmin.mk @@ -0,0 +1,134 @@ +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# Makefile for the DSAdmin dynamic loaded perl module + +LDAP_SRC = ../.. +MCOM_ROOT = ../../../.. + +NOSTDCLEAN=true # don't let nsconfig.mk define target clean +NOSTDSTRIP=true # don't let nsconfig.mk define target strip +NSPR20=true # probably should be defined somewhere else (not sure where) + +include $(MCOM_ROOT)/ldapserver/nsconfig.mk +include $(LDAP_SRC)/nsldap.mk +ifndef LDAP_USE_OLD_DB +include $(MCOM_ROOT)/ldapserver/ns_usedb.mk +endif + +BINDIR=$(LDAP_ADMIN_BIN_RELDIR) +OBJDEST=$(LDAP_ADMOBJDIR) + +INCLUDES += -I$(LDAP_SRC)/admin/include + +DS_SERVER_DEFS = -DNS_DS + +INFO = $(OBJDIR)/$(DIR) + +ifneq ($(ARCH), WINNT) +EXTRALDFLAGS += $(SSLLIBFLAG) +endif + +EXTRA_LIBS += $(LIBPERL_A) $(SETUPSDK_S_LINK) $(LDAP_ADMLIB) \ + $(LDAPLINK) $(DEPLINK) $(ADMINUTIL_LINK) \ + $(NSPRLINK) $(NLSLINK) \ + $(NLSLINK_CONV_STATIC) + +# the security libs are statically linked into libds_admin.so; osf doesn't like +# to link against them again, it thinks they are multiply defined +ifneq ($(ARCH), OSF1) +EXTRA_LIBS += $(SECURITYLINK) $(DBMLINK) +else +#DLL_LDFLAGS=-shared -all -error_unresolved -taso +#EXTRA_LIBS += -lcxx -lcxxstd -lcurses -lc +endif + +ifeq ($(ARCH), WINNT) +PLATFORM_INCLUDE = -I$(MCOM_ROOT)/ldapserver/include/nt +SUBSYSTEM=console +EXTRA_LIBS+=comctl32.lib $(LDAP_SDK_LIBLDAP_DLL) $(LDAP_LIBUTIL) +EXTRA_LIBS_DEP+=$(LDAP_LIBUTIL_DEP) +DEF_FILE:=DSAdmin.def +LINK_DLL += /NODEFAULTLIB:msvcrtd.lib +endif + +ifeq ($(ARCH), AIX) +EXTRA_LIBS += $(DLL_EXTRA_LIBS) -lbsd +LD=ld +endif + +# absolutely do not try to build perl-stuff with warnings-as-errors. +# (duh.) +ifeq ($(ARCH), Linux) +CFLAGS := $(subst -Werror,,$(CFLAGS)) +endif + +DSADMIN_OBJS = DSAdmin.o +DSADMIN_BASENAME = DSAdmin$(DLL_PRESUFFIX).$(DLL_SUFFIX) + +OBJS= $(addprefix $(OBJDEST)/, $(DSADMIN_OBJS)) +DSADMIN_SO = $(addprefix $(BINDIR)/, $(DSADMIN_BASENAME)) + +EXTRA_LIBS_DEP = $(SETUPSDK_DEP) + +# for Solaris, our most common unix build platform, we check for undefined +# symbols at link time so we don't catch them at run time. To do this, we +# set the -z defs flag. We also have to add explicitly link with the C and +# C++ runtime libraries (e.g., -lc) because, even though ld and CC link +# with them implicitly, -z defs will throw errors if we do not link with +# them explicitly. +ifeq ($(ARCH), SOLARIS) +LINK_DLL += -z defs +# removed -lcx from the following line +EXTRA_LIBS += -lCstd -lCrun -lm -lw -lc +# with the Forte 6 and later compilers, we must use CC to link +LD=CC +endif + +all: $(OBJDEST) $(BINDIR) $(DSADMIN_SO) + +dummy: + -@echo PERL_EXE = $(PERL_EXE) + -@echo PERL_EXENT = $(PERL_EXENT) + -@echo PERL_BASEDIR = $(PERL_BASEDIR) + -@echo PERL_ROOT = $(PERL_ROOT) + -@echo IS_ACTIVESTATE = $(IS_ACTIVESTATE) + -@echo PERL_CONFIG = $(PERL_CONFIG) + -@echo PERL_ROOT = $(PERL_ROOT) + -@echo PERL = $(PERL) + -@echo PERL_LIB = $(PERL_LIB) + -@echo PERL_ARCHLIB = $(PERL_ARCHLIB) + -@echo EXTRA_LIBS_DEP = $(EXTRA_LIBS_DEP) + abort + +ifeq ($(ARCH), WINNT) +$(DSADMIN_SO): $(OBJS) $(EXTRA_LIBS_DEP) $(DEF_FILE) + $(LINK_DLL) /DEF:$(DEF_FILE) +# linking this file causes a .exp and a .lib file to be generated which don't seem +# to be required while running, so I get rid of them + $(RM) $(subst .dll,.exp,$@) $(subst .dll,.lib,$@) +else +$(DSADMIN_SO): $(OBJS) + $(LINK_DLL) $(EXTRA_LIBS) +endif + +$(OBJDEST)/DSAdmin.o: $(OBJDEST)/DSAdmin.c +ifeq ($(ARCH), WINNT) + $(CC) -c $(CFLAGS) $(PERL_CFLAGS) $(MCC_INCLUDE) $(SETUPSDK_INCLUDE) $(PERL_INC) $< $(OFFLAG)$@ +else + $(CXX) $(EXCEPTIONS) -c $(CFLAGS) $(PERL_CFLAGS) $(MCC_INCLUDE) $(SETUPSDK_INCLUDE) $(PERL_INC) $< $(OFFLAG)$@ +endif + +$(OBJDEST)/DSAdmin.c: DSAdmin.xs + $(PERL) -w -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $< > $@ + +#MYCMD := "Mksymlists('NAME' => 'DSAdmin', 'DLBASE' => 'DSAdmin');" +#$(DEF_FILE): DSAdmin.xs +# $(PERL) -w "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -MExtUtils::Mksymlists -e "$(MYCMD)" + +clean: + -$(RM) $(OBJDEST)/DSAdmin.c $(OBJS) $(DSADMIN_SO) diff --git a/ldap/admin/src/DSAdmin.pm b/ldap/admin/src/DSAdmin.pm new file mode 100644 index 00000000..a8578a32 --- /dev/null +++ b/ldap/admin/src/DSAdmin.pm @@ -0,0 +1,225 @@ +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# + +package DSAdmin; + +use POSIX; + +use strict; +use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $AUTOLOAD +$isNT $PATHSEP $quote $script_suffix $exe_suffix $os +$dll_suffix $argumentative @args $first $rest $errs $pos +); + +require Exporter; +require DynaLoader; +require AutoLoader; + +@ISA = qw(Exporter DynaLoader); +# Items to export into callers namespace by default. Note: do not export +# names by default without a very good reason. Use EXPORT_OK instead. +# Do not simply export all your public functions/methods/constants. + +# Items to export into callers namespace by default. Note: do not export +# names by default without a very good reason. Use EXPORT_OK instead. +# Do not simply export all your public functions/methods/constants. +@EXPORT = qw( + normalizeDN toLocal toUTF8 +); +$VERSION = '1.00'; + +bootstrap DSAdmin $VERSION; + +BEGIN { + require 'uname.lib'; + $isNT = -d '\\'; +# @INC = ( '.', '../../../admin/admin/bin' ); +# grep { s@/@\\@g } @INC if $isNT; + $PATHSEP = $isNT ? '\\' : '/'; + # NT needs quotes around some things unix doesn't + $quote = $isNT ? "\"" : ""; + + $script_suffix = $isNT ? ".bat" : ""; + $exe_suffix = $isNT ? ".exe" : ""; + if ($isNT) { + $os = "WINNT"; + } else { + $os = &uname("-s"); + } + + # dll suffix for shared libraries in old instance; note that the dll suffix + # may have changed for the new instance e.g. AIX now uses .so + if ( $os eq "AIX" ) { + $dll_suffix = "_shr.a"; + } + elsif ( $os eq "HP-UX" ) { + $dll_suffix = ".sl"; + } + elsif ( $os eq "WINNT" ) { + $dll_suffix = ".dll"; + } + else { + $dll_suffix = ".so"; + } +} + +sub getCwd { + my $command = $isNT ? "cd" : "/bin/pwd"; + open(PWDCMD, "$command 2>&1 |") or + die "Error: could not execute $command: $!"; + # without the following sleep, reading from the pipe will + # return nothing; I guess it gives the pwd command time + # to get some data to read . . . + sleep(1); + my $curdir; + while () { + if (!$curdir) { + chomp($curdir = $_); + } + } + my $code = close(PWDCMD); +# if ($code || $?) { +# print "$command returned code=$code status=$? dir=$curdir\n"; +# } +# print "getCwd curdir=\[$curdir\]\n"; + return $curdir; +} + +# this is used to run the system() call, capture exit and signal codes, +# and die() upon badness; the first argument is a directory to change +# dir to, if any, and the rest are passed to system() +sub mySystem { + my $rc = &mySystemNoDie(@_); + my ($dir, @args) = @_; + if ($rc == 0) { +# success + } elsif ($rc == 0xff00) { + die "Error executing @args: error code $rc: $!"; + } elsif ($rc > 0x80) { + $rc >>= 8; + die "Error executing @args: error code $rc: $!"; + } else { + if ($rc & 0x80) { + $rc &= ~0x80; + } + die "Error executing @args: received signal $rc: $!"; + } + + # usually won't get return value + return $rc; +} + +# This version does not die but just returns the error code +sub mySystemNoDie { + my ($dir, @args) = @_; + if ($dir && ($dir ne "")) { + chdir($dir) or die "Could not change directory to $dir: $!"; + } + my $cmd = $args[0]; + # the system {$cmd} avoids some NT shell quoting problems if the $cmd + # needs to be quoted e.g. contains spaces; the map puts double quotes + # around the arguments on NT which are stripped by the command + # interpreter cmd.exe; but don't quote things which are already quoted + my @fixargs = map { /^[\"].*[\"]$/ ? $_ : $quote . $_ . $quote } @args; + my $rc = 0; + if ($cmd =~ /[.](bat|cmd)$/) { + # we have to pass batch files directly to the NT command interpreter + $cmd = $ENV{COMSPEC}; + if (!$cmd) { + $cmd = 'c:\winnt\system32\cmd.exe'; + } +# print "system $cmd /c \"@fixargs\"\n"; + $rc = 0xffff & system {$cmd} '/c', "\"@fixargs\""; + } else { + print "system $cmd @fixargs\n"; + $rc = 0xffff & system {$cmd} @fixargs; + } + return $rc; +} + +sub getTempFileName { + my $tmp = tmpnam(); + while (-f $tmp) { + $tmp = tmpnam(); + } + + return $tmp; +} + +sub getopts { + local($argumentative) = @_; + local(@args,$_,$first,$rest); + local($errs) = 0; + local($[) = 0; + + @args = split( / */, $argumentative ); + while(@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) { + ($first,$rest) = ($1,$2); + $pos = index($argumentative,$first); + if($pos >= $[) { + if($args[$pos+1] eq ':') { + shift(@ARGV); + if($rest eq '') { + ++$errs unless @ARGV; + $rest = shift(@ARGV); + } + eval "\$main::opt_$first = \$rest;"; + } + else { + eval "\$main::opt_$first = 1"; + if($rest eq '') { + shift(@ARGV); + } + else { + $ARGV[0] = "-$rest"; + } + } + } + else { + print STDERR "Unknown option: $first\n"; + ++$errs; + if($rest ne '') { + $ARGV[0] = "-$rest"; + } + else { + shift(@ARGV); + } + } + } + $errs == 0; +} + +# Autoload methods go after =cut, and are processed by the autosplit program. + +1; +__END__ +# Below is the stub of documentation for your module. You better edit it! + +=head1 NAME + +DSAdmin - Perl extension for directory server administrative utility functions + +=head1 SYNOPSIS + + use DSAdmin; + +=head1 DESCRIPTION + +The DSAdmin module is used by directory server administration scripts, such as +those used for installation/uninstallation, instance creation/removal, CGIs, +etc. + +=head1 AUTHOR + +Richard Megginson richm@netscape.com + +=head1 SEE ALSO + +perl(1). + +=cut diff --git a/ldap/admin/src/DSAdmin.xs b/ldap/admin/src/DSAdmin.xs new file mode 100644 index 00000000..22d862ce --- /dev/null +++ b/ldap/admin/src/DSAdmin.xs @@ -0,0 +1,76 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/* + This file contains the definitions of C functions callable from perl. + The perl interface for these functions is found in DSAdmin.pm. +*/ + +#include "dsalib.h" + +#include "nsutils.h" +#include "utf8.h" + +/* these are the perl include files needed */ +#ifdef __cplusplus +extern "C" { +#endif +#include "EXTERN.h" +/* The next two lines are hacks because someone build perl with gcc which +has this feature call __attribute__ which is not present with sun cc */ +#define HASATTRIBUTE +#define __attribute__(_attr_) + +#ifdef HPUX11 /* conflict with perl 'struct magic' and hpux 'struct magic' */ +#define magic p_magic +#define MAGIC p_MAGIC +#endif /* HPUX */ + +#include "perl.h" +#include "XSUB.h" +#ifdef __cplusplus +} +#endif + + +MODULE = DSAdmin PACKAGE = DSAdmin + +PROTOTYPES: DISABLE + +SV * +normalizeDN(dn) + char* dn + PREINIT: + char* temp_dn; + CODE: + /* duplicate the DN since dn_normalize_convert modifies the argument */ + temp_dn = (char *)malloc(strlen(dn) + 1); + strcpy(temp_dn, dn); + ST(0) = sv_newmortal(); + /* dn_normalize_convert returns its argument */ + sv_setpv( ST(0), dn_normalize_convert(temp_dn) ); + free(temp_dn); + +SV * +toLocal(s) + char* s + PREINIT: + char* temp_s; + CODE: + temp_s = UTF8ToLocal(s); + ST(0) = sv_newmortal(); + sv_setpv( ST(0), temp_s ); + nsSetupFree(temp_s); + +SV * +toUTF8(s) + char* s + PREINIT: + char* temp_s; + CODE: + temp_s = localToUTF8(s); + ST(0) = sv_newmortal(); + sv_setpv( ST(0), temp_s ); + nsSetupFree(temp_s); diff --git a/ldap/admin/src/Inf.pm b/ldap/admin/src/Inf.pm new file mode 100644 index 00000000..41d6458a --- /dev/null +++ b/ldap/admin/src/Inf.pm @@ -0,0 +1,243 @@ +#!perl +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# + +package NSSetupSDK::Inf; + +use NSSetupSDK::Base; + +%otherEnc = ('local' => "utf8", utf8 => "local"); +# mapping of encoding to the subroutine which converts from that encoding +%convertEnc = ('local' => \&toUTF8, utf8 => \&toLocal); + +############################################################################# +# Creator, the argument (optional) is the INF file to read +# +sub new { + my ($class, $filename) = @_; + my $self = {}; + + bless $self, $class; + + if ($filename) { + $self->read($filename); + } + + return $self; +} + +############################################################################# +# Read in and initialize ourself with the given INF file. The file will be +# encoded in either local or utf8 encoding. The type of encoding is given +# in the $enc argument. We first read in the values in the given encoding, +# then convert the file to the other encoding, then read in and initialize +# the values for the other encoding +# +sub read { + my ($self, $filename, $enc) = @_; + my $inf = {}; # the contents of the inf file + my @sectionList = (); # a list of section names, in order + my $sectionName = "General"; # default section name + + open INF, $filename or return undef; + + push @sectionList, $sectionName; + while () { + next if /^\s*#/; # skip comments + next if /^\s*$/; # skip blank lines + if (/^\s*\[([^\]]+)\]/) { + $sectionName = $1; # new section + if ($sectionName cmp "General") { + # General is already in the list + push @sectionList, $sectionName; + } + } else { + chop; + ($name, $value) = split(/\s*=\s*/, $_, 2); +# print "name=$name value=$value\n"; + $inf->{$sectionName}{$enc}{$name} = $value; + $inf->{$sectionName}{$otherEnc{$enc}}{$name} = + &{$convertEnc{$enc}}($value); + } + } + close INF; + + $self->{inf} = $inf; + $self->{sections} = [ @sectionList ]; + +# foreach $section (keys %inf) { +# print '[', $section, ']', "\n"; +# foreach $name (keys %{ $inf{$section} }) { +# print "local $name=$inf{$section}{local}{$name}\n"; +# print "UTF8 $name=$inf{$section}{utf8}{$name}\n"; +# } +# } + + return 1; +} + +sub readLocal { + my $self = shift; + return $self->read(@_, 'local'); +} + +sub readUTF8 { + my $self = shift; + return $self->read(@_, 'utf8'); +} + +############################################################################# +# Init from a hash; used to create a subsection as another inf +# +sub init { + my ($self, $hashRef) = @_; + my $inf = {}; + $inf->{General} = $hashRef; + $self->{inf} = $inf; + $self->{sections} = [ "General" ]; + + return 1; +} + +############################################################################# +# return the number of sections +# +sub numSections { + my $self = shift; + return scalar(@{$self->{sections}}); +} + +############################################################################# +# return the section corresponding to the given name or number +# +sub getSection { + my ($self, $section) = @_; + if ($section =~ /\d+/) { # section is a number + $section = $self->{sections}->[$section]; + } + + my $newSec = new Inf; + $newSec->init($self->{inf}->{$section}); + return $newSec; +} + +############################################################################# +# return the value of the given name in local encoding +# +sub getLocal { + my ($self, $name) = @_; + return getFromSection($self, "General", $name, "local"); +} + +############################################################################# +# return the value of the given name in UTF8 encoding +# +sub getUTF8 { + my ($self, $name) = @_; + return getFromSection($self, "General", $name, "utf8"); +} + +############################################################################# +# return the value of the given name in UTF8 encoding +# +sub get { + my ($self, $name) = @_; + return getFromSection($self, "General", $name, "utf8"); +} + +############################################################################# +# return the value of the given name in the given section +# +sub getFromSection { + my ($self, $section, $name, $enc) = @_; +# print "self inf = ", %{ $self->{inf} }, "\n"; +# print "self inf section = ", %{ $self->{inf}->{$section} }, "\n"; + return $self->{inf}->{$section}{$enc}{$name}; +} + +############################################################################# +# set the value +# +sub setInSection { + my ($self, $section, $name, $value, $enc) = @_; + if (!$enc) { + $enc = 'utf8'; + } + $self->{inf}->{$section}{$enc}{$name} = $value; + $self->{inf}->{$section}{$otherEnc{$enc}}{$name} = + &{$convertEnc{$enc}}($value); +} + +############################################################################# +# set the value; value is locally encoded +# +sub setLocal { + my ($self, $name, $value) = @_; + setInSection($self, "General", $name, $value, "local"); +} + +############################################################################# +# set the value; value is UTF-8 encoded +# +sub setUTF8 { + my ($self, $name, $value) = @_; + setInSection($self, "General", $name, $value, "utf8"); +} + +############################################################################# +# set the value, assume UTF-8 encoding +# +sub set { + my ($self, $name, $value) = @_; + setInSection($self, "General", $name, $value, "utf8"); +} + +sub write { + my ($self, $ref, $enc) = @_; + my $needClose = undef; + if (!$enc) { + $enc = "local"; # write file in local encoding by default + } + if (!$ref) { + # no filehandle given + $ref = \*STDOUT; + } elsif (!ref($ref)) { # not a ref, assume scalar filename + # filename + open(OUTPUT, ">$ref") or die "Error: could not write file $ref: $!"; + $ref = \*OUTPUT; + $needClose = 1; # be sure to close + } elsif (ref($ref) eq 'SCALAR') { + # filename + open(OUTPUT, ">$$ref") or die "Error: could not write file $$ref: $!"; + $ref = \*OUTPUT; + $needClose = 1; # be sure to close + } # else already a file handle ref + foreach $secName (@{ $self->{sections} }) { + print $ref "[", $secName, "]\n"; + foreach $name (keys %{ $self->{inf}->{$secName}{$enc} }) { + $value = $self->{inf}->{$secName}{$enc}{$name}; + print $ref $name, "=", $value, "\n"; + } + print $ref "\n"; + } + if ($needClose) { + close $ref; + } +} + +sub writeLocal { + my ($self, $ref) = @_; + $self->write($ref, 'local'); +} + +sub writeUTF8 { + my ($self, $ref) = @_; + $self->write($ref, 'utf8'); +} + +1; # the mandatory TRUE return from the package diff --git a/ldap/admin/src/Makefile b/ldap/admin/src/Makefile new file mode 100644 index 00000000..e3343791 --- /dev/null +++ b/ldap/admin/src/Makefile @@ -0,0 +1,304 @@ +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# Source for the admin forms and CGI programs + +LDAP_SRC = ../.. +MCOM_ROOT = ../../../.. + +NOSTDCLEAN=true # don't let nsconfig.mk define target clean +NOSTDSTRIP=true # don't let nsconfig.mk define target strip +NSPR20=true # probably should be defined somewhere else (not sure where) + +BINDIR=$(LDAP_ADMIN_BIN_RELDIR) +OBJDEST=$(LDAP_ADMOBJDIR) + +SCRIPTSDIR=$(LDAP_BASE_RELDIR)/admin/scripts + +include $(MCOM_ROOT)/ldapserver/nsconfig.mk +include $(LDAP_SRC)/nsldap.mk +ifndef LDAP_USE_OLD_DB +include $(MCOM_ROOT)/ldapserver/ns_usedb.mk +endif + +MCC_INCLUDE += $(ADMINUTIL_INCLUDE) + +INCLUDES += -I$(LDAP_SRC)/admin/include + +DS_SERVER_DEFS = -DNS_DS + +ifneq ($(ARCH), WINNT) +EXTRALDFLAGS += $(SSLLIBFLAG) +endif + +ifeq ($(BUILD_DLL), yes) +DYNAMIC_DEPLIBS=$(LDAP_ADMLIB) $(LDAP_COMMON_LIBS_DEP) $(ADMINUTIL) +DYNAMIC_DEPLINK=$(DYNAMIC_DEPLIBS) +else +DYNAMIC_DEPLIBS=$(LDAP_COMMON_LIBS_DEP) +DYNAMIC_DEPLINK=$(LDAP_ADMLIB) $(LDAP_COMMON_LIBS) +endif + +EXTRA_LIBS_DEP += $(NSPR_DEP) $(LDAPSDK_DEP) $(ADMINUTIL_DEP) $(ICU_DEP) + +# we don't want to build with warnings-as-errors for the admin/ stuff, because +# it's got crappy C++ code which is LITTERED with warnings, most of which we +# can't fix because it comes from files in dist/, etc. +ifeq ($(ARCH), Linux) +CFLAGS := $(subst -Werror,,$(CFLAGS)) +endif + +OLD_EXTRA_LIBS := $(EXTRA_LIBS) +EXTRA_LIBS = $(DYNAMIC_DEPLINK) $(ADMINUTIL_LINK) $(LDAP_NOSSL_LINK) \ + $(SECURITYLINK) $(NSPRLINK) $(SETUPSDK_S_LINK) $(ICULINK) $(OLD_EXTRA_LIBS) + +ifeq ($(ARCH), WINNT) +PLATFORM_INCLUDE = -I$(MCOM_ROOT)/ldapserver/include/nt +SUBSYSTEM=console +EXTRA_LIBS+=comctl32.lib $(LDAP_LIBUTIL) +EXTRA_LIBS_DEP+=$(LDAP_LIBUTIL_DEP) + +ifeq ($(DEBUG), optimize) +#NT_NOLIBS = /NODEFAULTLIB:LIBCMT /NODEFAULTLIB:MSVCRT +else +NT_NOLIBS = /NODEFAULTLIB:LIBCMTD /NODEFAULTLIB:MSVCRTD +endif + +else +ifeq ($(ARCH), IRIX) +EXCEPTIONS=-exceptions +else +ifeq ($(ARCH),SOLARIS) +ifeq ($(USE_64), 1) +EXTRALDFLAGS += -xarch=v9 +endif +EXTRA_LIBS += -lsocket -lnsl -lgen -lm -lposix4 -lthread +else +ifeq ($(ARCH),SOLARISx86) +EXTRA_LIBS += -lsocket -lnsl -lgen -lm -lposix4 -lthread +else +ifeq ($(ARCH),HPUX) +ifdef FORTEZZA +# link with libci.a for FORTEZZA builds. On other platforms, libci.a is +# linked into libds_admin.so, but not on HPUX +EXTRA_LIBS_DEP += $(FORTEZZA_DRIVER) +EXTRA_LIBS += $(FORTEZZA_DRIVER) +endif +ifeq ($(USE_64), 1) +EXTRALDFLAGS += +DA2.0W +DS2.0 +Z +endif +else +ifeq ($(ARCH),OSF1) +#CC += -E +#CXX += -Wl,-ymain +else +ifeq ($(ARCH),ReliantUNIX) +else +ifeq ($(ARCH), AIX) +EXTRA_LIBS += -lcurses +else +ifeq ($(ARCH), UnixWare) +# rgc: +EXTRA_LIBS += -lsocket -lnsl -lgen -lm +else +ifeq ($(ARCH), Linux) +EXTRA_LIBS += -lcrypt +else +#this will help with porting other platforms +EXTRA_LIBS+="you need to define EXTRA_LIBS for $(ARCH) in ldapserver/ldap/admin/src/Makefile" +endif # Linux +endif # UnixWare +endif # AIX +endif # ReliantUNIX +endif # OSF1 +endif # HPUX +endif # SOLARISx86 +endif # SOLARIS +endif # IRIX +endif # WINNT + +TEMP_EXTRALDFLAGS:=$(EXTRALDFLAGS) +EXTRALDFLAGS = -lpthread $(TEMP_EXTRALDFLAGS) + +ifeq ($(SECURITY),domestic) +SECUS_BINS= +MODULE_CFLAGS += -DUS_VERSION -DEXPORT_VERSION +endif + +ifeq ($(SECURITY),export) +MODULE_CFLAGS += -DEXPORT_VERSION +endif + +ifneq ($(SECURITY),none) +SECURE_BINS= +SECLIB=$(LIBSECURITY) +endif + +ADMIN_DLLGLUEOBJ=$(MCOM_ROOT)/ldapserver/built/$(ARCH)-$(SECURITY)-$(DEBUG)-admin/admin-lib/dllglue.o + +ifeq ($(ARCH),AIX) +DLLGLUEOBJ= +GLUEOBJS= +endif + +$(OBJDEST)/key.res: key.rc + $(RC) $(OFFLAG)$(OBJDEST)/key.res ey.rc + +OLD_PROGS = ds_pcontrol ds_impldif \ + ds_backldif ds_backdb ds_restdb \ + ds_monitor ds_conf ds_rmldif \ + commit index ds_acccon ds_perf ds_dbconf ds_conf_check \ + ds_net ds_ldap ds_pwconf ds_inconf ds_grplst ds_grpcrt \ + ds_version ds_client ds_secpref ds_secact instindex \ + ds_reploc ds_repinit ldif2replica ds_addldif ds_ldif2ldap clpstat \ + ds_sscfg ds_attr_manage ds_oc_view ds_oc_create ds_schema_update \ + ds_replov ds_pw ds_snmpconf + +PROGS = start restart shutdown ds_ldif2db \ + ds_db2ldif ds_db2bak ds_listdb \ + ds_bak2db ds_rmdb ds_create \ + ds_remove ds_snmpctrl vlvindex addindex + +ifeq ($(ARCH), WINNT) +SERVER_PROGS = namegen latest_file +endif + +OBJECTS= init_ds_env.o + +ifeq ($(ARCH), WINNT) +OBJECTS += namegen.o latest_file.o ds_remove_uninst.o +endif + +ifeq ($(ARCH), WINNT) +BINS = $(addprefix $(BINDIR)/, $(addsuffix .exe, $(PROGS))) $(addprefix $(LDAP_SERVER_RELDIR)/, $(addsuffix .exe, $(SERVER_PROGS))) +else +BINS = $(addprefix $(BINDIR)/, $(PROGS)) +endif +ALLOBJS = $(addprefix $(OBJDEST)/, $(OBJECTS)) + +PERL_SCRIPTS = migrateTo4 uname.lib Cgi.pm migrateInstance getConfigInfo migrateLocalDB migratePwdFile ds_viewlog.pl upgradeServer updatedsgw + +PERL_SCRIPTS_DEST = $(addprefix $(BINDIR)/, $(PERL_SCRIPTS)) + +INST_INCLUDES = $(OBJDIR)/install_keywords.h + +TEMPLATE_SCRIPTS_SRC = $(wildcard scripts/template-*) +TEMPLATE_SCRIPTS_DEST = $(subst scripts/,$(SCRIPTSDIR)/,$(TEMPLATE_SCRIPTS_SRC)) + +# gmake 3.74 will remove "intermediate" files if generated via a pattern match rule +# this is annoying for debugging since it tries to find the .o file +# if you're debugging and you want to make sure your file does not get removed +# by gmake, just uncomment the precious target and put your object files there +# or FIX IT! if you can figure out how . . . +#.PRECIOUS: $(OBJDEST)/ds_db2bak.o + +all: $(BINDIR) $(OBJDEST) $(INST_INCLUDES) $(ALLOBJS) $(BINS) \ + installPerlFiles $(SCRIPTSDIR) $(TEMPLATE_SCRIPTS_DEST) + +$(SCRIPTSDIR): + $(MKDIR) $@ + +.PHONY: installPerlFiles + +#NSSetupSDK: +# $(MAKE) -f NSSetupSDK_Base.mk $(MFLAGS) all + +clean: + -@echo $(BINS) + -$(RM) $(BINS) + -$(RM) $(OBJDEST)/*.o + +strip: + $(STRIP) $(BINS) + +# if $(DLLGLUEOBJ) isn't available, use $(ADMIN_DLLGLUEOBJ) as a substitute: +$(DLLGLUEOBJ): $(ADMIN_DLLGLUEOBJ) + cp $(ADMIN_DLLGLUEOBJ) $(DLLGLUEOBJ) + +# if $(SECGLUEOBJ) isn't available, use $(ADMIN_SECGLUEOBJ) as a substitute: +$(SECGLUEOBJ): $(ADMIN_SECGLUEOBJ) + cp $(ADMIN_SECGLUEOBJ) $(SECGLUEOBJ) + +# Special objects + +$(BINDIR)/ds_create: $(OBJDEST)/instindex.o $(OBJDEST)/cfg_sspt.o \ + $(OBJDEST)/create_instance.o $(OBJDEST)/configure_instance.o \ + $(OBJDEST)/script-gen.o $(DEPLIBS) + $(LINK_EXE_NOLIBSOBJS) $(SHARED) $(EXTRALDFLAGS) \ + $(OBJDEST)/instindex.o $(OBJDEST)/script-gen.o \ + $(OBJDEST)/create_instance.o $(OBJDEST)/cfg_sspt.o \ + $(OBJDEST)/configure_instance.o \ + $(GLUEOBJ) $(EXTRA_LIBS) + +$(BINDIR)/ds_create.exe: $(OBJDEST)/instindex.o $(OBJDEST)/cfg_sspt.o \ + $(OBJDEST)/create_instance.o $(OBJDEST)/configure_instance.o \ + $(OBJDEST)/script-gen.o $(LIBNT_DEP) $(DEPLIBS) + $(LINK_EXE) $(NT_NOLIBS) $(OBJDEST)/instindex.o \ + $(OBJDEST)/create_instance.o $(OBJDEST)/cfg_sspt.o \ + $(OBJDEST)/configure_instance.o $(OBJDEST)/script-gen.o \ + $(SETUPSDK_S_LINK) $(LDAP_SDK_LIBS) $(LIBNT) \ + $(NSPRLINK) $(EXTRA_LIBS) $(DB_LIB) +# linking this file causes a .exp and a .lib file to be generated which don't seem +# to be required while running, so I get rid of them + $(RM) $(subst .exe,.exp,$@) $(subst .exe,.lib,$@) + +$(BINDIR)/ds_remove: $(OBJDEST)/ds_remove.o $(OBJDEST)/ds_remove_uninst.o $(DEPLIBS) $(EXTRA_LIBS_DEP) + $(LINK_EXE_NOLIBSOBJS) $(SHARED) $(EXTRALDFLAGS) \ + $(OBJDEST)/ds_remove.o $(OBJDEST)/ds_remove_uninst.o $(OBJDEST)/init_ds_env.o \ + $(SETUPSDK_S_LINK) $(GLUEOBJ) $(EXTRA_LIBS) + +$(BINDIR)/ds_remove.exe: $(OBJDEST)/ds_remove.o $(OBJDEST)/ds_remove_uninst.o $(DEPLIBS) $(EXTRA_LIBS_DEP) + $(LINK_EXE) $(OBJDEST)/ds_remove_uninst.o $(OBJDEST)/ds_remove.o $(OBJDEST)/init_ds_env.o $(LDAP_SDK_LIBS) $(NSPRLINK) $(SETUPSDK_S_LINK) $(NT_NOLIBS) +# linking this file causes a .exp and a .lib file to be generated which don't seem +# to be required while running, so I get rid of them + $(RM) $(subst .exe,.exp,$@) $(subst .exe,.lib,$@) + +$(OBJDEST)/%.o: %.c + $(CC) -c $(CFLAGS) $(MCC_INCLUDE) $< $(OFFLAG)$@ + +$(OBJDEST)/%.o: %.cpp +ifeq ($(ARCH), WINNT) + $(CC) -c $(CFLAGS) $(MCC_INCLUDE) $(SETUPSDK_INCLUDE) $< $(OFFLAG)$@ +else + $(CXX) $(EXCEPTIONS) -c $(CFLAGS) $(MCC_INCLUDE) $(SETUPSDK_INCLUDE) $< $(OFFLAG)$@ +endif + +ifneq ($(ARCH), WINNT) +$(BINDIR)/%: $(OBJDEST)/%.o $(DEPLIBS) $(EXTRA_LIBS_DEP) $(GLUEOBJ) + $(LINK_EXE_NOLIBSOBJS) $< $(OBJDEST)/init_ds_env.o $(GLUEOBJ) $(EXTRA_LIBS) +else +$(BINDIR)/%.exe: $(OBJDEST)/%.o $(DEPLIBS) $(EXTRA_LIBS_DEP) + $(LINK_EXE) $(OBJDEST)/$*.o $(OBJDEST)/init_ds_env.o $(NSPRLINK) +endif + +$(LDAP_SERVER_RELDIR)/namegen.exe: $(OBJDEST)/namegen.o + $(LINK_EXE_NOLIBSOBJS) $^ + +$(LDAP_SERVER_RELDIR)/latest_file.exe: $(OBJDEST)/latest_file.o + $(LINK_EXE_NOLIBSOBJS) $^ + +installPerlFiles: $(BINDIR) $(BINDIR)/Install.pl + +$(BINDIR)/Install.pl: CreateInstall.pl $(PERL_SCRIPTS_DEST) + -@$(RM) $@ + $(CP) $< $@ + +$(BINDIR)/%: % + -@$(RM) $@ + $(CP) $< $@ + +$(LDAP_SERVER_RELDIR)/%: % $(LDAP_SERVER_RELDIR) + -@$(RM) $@ + $(CP) $< $@ + +$(INST_INCLUDES): install_keywords.h + -@$(RM) $@ + $(CP) $< $@ + +$(SCRIPTSDIR)/template-%: scripts/template-% $(SCRIPTSDIR) + -@$(RM) $@ + $(CP) $< $@ diff --git a/ldap/admin/src/addindex.c b/ldap/admin/src/addindex.c new file mode 100644 index 00000000..7e9e2671 --- /dev/null +++ b/ldap/admin/src/addindex.c @@ -0,0 +1,80 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/* + * addindex.c: Creates one or more indexes for specified attributes + * + * Rob Weltman + */ + +#include +#include +#include "libadminutil/admutil.h" +#include "dsalib.h" +#include "init_ds_env.h" +#include + +int main(int argc, char *argv[]) +{ + int status; + char *attributes; + char *attrs; + char **attrList; + int nAttrs; + char *nextAttr = NULL; + char *backendName; + + + fprintf(stdout, "Content-type: text/html\n\n"); + + if ( init_ds_env() ) + return 1; + + /* + * Get value of the "attributes" variable. + */ + attributes = ds_get_cgi_var("attributes"); + if ( (NULL == attributes) || (strlen(attributes) < 1) ) { + rpt_err( DS_UNDEFINED_VARIABLE, "attributes", NULL, NULL ); + return 1; + } + + + backendName = ds_get_cgi_var("backendID"); + if ( (NULL == backendName) || (strlen(backendName) < 1) ) { + rpt_err( DS_UNDEFINED_VARIABLE, "backendName", NULL, NULL ); + return 1; + } + + + attrs = strdup( attributes ); + /* Allocate for worst possible case */ + attrList = (char **)malloc(sizeof(*attrList) * (strlen(attrs)+1)); + nAttrs = 0; + /* strtok() is not MT safe, but it is okay to call here because this is a command line */ + attrList[nAttrs++] = strtok( attrs, " " ); + do { + nextAttr = strtok( NULL, " " ); + attrList[nAttrs++] = nextAttr; + } while( nextAttr != NULL ); + + ds_send_status((nAttrs > 1) ? "Creating indexes ..." : + "Creating index ..."); + + status = ds_addindex( attrList, backendName ); + + if ( !status ) { + rpt_success((nAttrs > 1) ? "Success! The indexes have been created." : + "Success! The index has been created."); + status = 0; + } else { + char msg[BIG_LINE]; + sprintf( msg,"[%s] %s", backendName, attributes); + rpt_err( status, msg, NULL, NULL ); + status = 1; + } + + return status; +} diff --git a/ldap/admin/src/cfg_sspt.c b/ldap/admin/src/cfg_sspt.c new file mode 100644 index 00000000..2ff883d3 --- /dev/null +++ b/ldap/admin/src/cfg_sspt.c @@ -0,0 +1,1621 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ + +#include +#include +#include +#include +#include "ldap.h" +#include "dsalib.h" +#include "nspr.h" +#include "plstr.h" +#include + +#define __CFG_SSPT_C + +#include "cfg_sspt.h" + +/*#define CGI_DEBUG 1*/ + +#define TEST_CONFIG /* for testing cn=config40 dummy entry instead of real one */ + +char* const class_top = "top"; +char* const class_organization = "organization"; +char* const class_organizationalUnit = "organizationalunit"; +char* const class_person = "person"; +char* const class_organizationalPerson = "organizationalperson"; +char* const class_inetOrgPerson = "inetorgperson"; +char* const class_groupOfUniqueNames = "groupofuniquenames"; +char* const class_domain = "domain"; +char* const class_extensibleObject = "extensibleObject"; +char* const class_adminDomain = "nsadmindomain"; +char* const class_country = "country"; +char* const class_locality = "locality"; + +char* const name_objectClass = "objectclass"; +char* const name_cn = "cn"; +char* const name_sn = "sn"; +char* const name_givenname = "givenname"; +char* const name_uid = "uid"; +char* const name_userPassword = "userpassword"; +char* const name_passwordExpirationTime = "passwordExpirationTime"; +char* const name_o = "o"; +char* const name_ou = "ou"; +char* const name_dc = "dc"; +char* const name_member = "member"; +char* const name_uniqueMember = "uniquemember"; +char* const name_aci = "aci"; +char* const name_description = "description"; +char* const name_adminDomain = "nsadmindomainname"; +char* const name_c = "c"; +char* const name_st = "st"; +char* const name_l = "l"; + +char* const value_configAdminGroupCN = "Configuration Administrators"; +char* const value_configAdminGroupRDN = "cn=Configuration Administrators"; +char* const value_configAdminCN = "Configuration Administrator"; +char* const value_configAdminSN = "Administrator"; +char* const value_configAdminGN = "Configuration"; +char* const value_globalPreferencesOU = "Global Preferences"; +char* const value_hostPreferencesOU = "Host Preferences"; +char* const value_netscapeConfigDesc = "Standard branch for configuration information"; +char* const value_peopleOU = "People"; +char* const value_peopleDesc = "Standard branch for people (uid) entries"; +char* const value_groupsOU = "Groups"; +char* const value_groupsDesc = "Standard Branch for group entries"; +#ifdef TEST_CONFIG +char* const value_config40 = "config40"; +char* const value_config40DN = "cn=config40"; +#endif /* TEST_CONFIG */ + +char* dbg_log_file = "ds_sscfg.log"; + +char* const name_netscaperoot = "NetscapeRoot"; +char* const name_netscaperootDN = "o=NetscapeRoot"; +char* const name_topology = "TopologyManagement"; +char* const name_topologyRDN = "ou=TopologyManagement"; +char* const value_topologyDESC = "Branch for Configuration Administration users and groups"; +char* const name_administratorsOU = "Administrators"; +char* const name_administratorsRDN = "ou=Administrators"; +char* const value_administratorsDESC = "Standard branch for Configuration Administrator (uid) entries"; +char* const name_localDAGroup = "Directory Administrators"; +char* const value_localDAGroupDesc = "Entities with administrative access to this directory server"; + +static char* const ACI_self_allow = "(targetattr=\"" + "carLicense ||" + "description ||" + "displayName ||" + "facsimileTelephoneNumber ||" + "homePhone ||" + "homePostalAddress ||" + "initials ||" + "jpegPhoto ||" + "labeledURL ||" + "mail ||" + "mobile ||" + "pager ||" + "photo ||" + "postOfficeBox ||" + "postalAddress ||" + "postalCode ||" + "preferredDeliveryMethod ||" + "preferredLanguage ||" + "registeredAddress ||" + "roomNumber ||" + "secretary ||" + "seeAlso ||" + "st ||" + "street ||" + "telephoneNumber ||" + "telexNumber ||" + "title ||" + "userCertificate ||" + "userPassword ||" + "userSMIMECertificate ||" + "x500UniqueIdentifier\")" + "(version 3.0; acl \"Enable self write for common attributes\"; allow (write) " + "userdn=\"ldap:///self\";)"; + +static char* const ACI_anonymous_allow = "(targetattr!=\"userPassword\")" + "(version 3.0; " + "acl \"Enable anonymous access\"; allow (read, search, compare)" + "userdn=\"ldap:///anyone\";)"; + +static char* const ACI_anonymous_allow_with_filter = + "(targetattr=\"*\")(targetfilter=(%s))" + "(version 3.0; acl \"Default anonymous access\"; " + "allow (read, search) userdn=\"ldap:///anyone\";)"; + +static char* const ACI_config_admin_group_allow_all = "(targetattr=\"*\")" + "(version 3.0; " + "acl \"Enable Configuration Administrator Group modification\"; " + "allow (all) groupdn=\"ldap:///%s, %s=%s, %s, %s\";)"; + +static char* const ACI_config_admin_group_allow = "(targetattr=\"*\")" + "(version 3.0; " + "acl \"Configuration Administrators Group\"; allow (%s) " + "groupdn=\"ldap:///%s\";)"; + +static char* const ACI_local_DA_allow = "(targetattr = \"*\")(version 3.0; " + "acl \"Local Directory Administrators Group\"; allow (%s) " + "groupdn=\"ldap:///%s\";)"; + +static char* const ACI_group_expansion = "(targetattr=\"*\")" + "(version 3.0; acl \"Enable Group Expansion\"; " + "allow (read, search, compare) groupdnattr=\"uniquemember\";)"; + +static char* const ACI_user_allow_1 = "(targetattr=\"*\")(version 3.0; " + "acl \"Configuration Administrator\"; allow (%s) " + "userdn=\"ldap:///uid=%s, %s\";)"; + +static char* const ACI_user_allow_2 = "(targetattr=\"*\")(version 3.0; " + "acl \"Configuration Administrator\"; allow (%s) " + "userdn=\"ldap:///%s\";)"; +/* + This is a list of DSE entries that the Configuration Admin Group has + access to and the access rights for that entry +*/ +static struct _DSEEntriesAndAccess { + char *entryDN; + char *access; +} entryAndAccessList[] = { + {"cn=config", "all"}, + {"cn=schema", "all"} +}; + +static int entryAndAccessListSize = + sizeof(entryAndAccessList)/sizeof(entryAndAccessList[0]); + +int +getEntryAndAccess(int index, const char **entry, const char **access) +{ + if (!entry || !access) + return 0; + + *entry = 0; + *access = 0; + + if (index < 0 || index >= entryAndAccessListSize) + return 0; + + *entry = entryAndAccessList[index].entryDN; + *access = entryAndAccessList[index].access; + + return 1; +} + +/* +** --------------------------------------------------------------------------- +** +** Utility Routines - Functions for performing string and file operations. +** +*/ + +#ifdef CGI_DEBUG +#include + +static void +debug_log (const char* file, const char* format, ...) +{ + va_list args; + FILE* fp = fopen(file, "a+"); + if (fp) { + va_start(args, format); + vfprintf(fp, format, args); + va_end(args); + fflush(fp); + fclose(fp); + } +} + +static void +debug_log_array (const char* file, char* name, char** vals) +{ + FILE* fp = fopen(file, "a+"); + + if (fp) { + if (vals != NULL) { + for (; *vals != NULL; LDAP_UTF8INC(vals)) { + fprintf (fp, "%s: %s\n", name, *vals); + } + fflush(fp); + } + fclose(fp); + } +} + +#endif /* CGI_DEBUG */ + +static char * +extract_name_from_dn(const char *dn) +{ + char **rdnList = 0; + char *ret = 0; + if (!dn) + return ret; + + rdnList = ldap_explode_dn(dn, 1); /* leave out types */ + if (!rdnList || !rdnList[0]) + ret = strdup(dn); /* the given dn is not really a dn */ + else + ret = strdup(rdnList[0]); + + if (rdnList) + ldap_value_free(rdnList); + + return ret; +} + +int +entry_exists(LDAP* ld, const char* entrydn) +{ + int exists = 0; + int err; + + struct timeval sto = { 10L, 0L }; + LDAPMessage* pLdapResult; + + err = ldap_search_st(ld, entrydn, LDAP_SCOPE_BASE, + "objectClass=*", NULL, 0, &sto, &pLdapResult); + + if (err == LDAP_SUCCESS) + { + LDAPMessage* pLdapEntry; + char* dn; + + for (pLdapEntry = ldap_first_entry(ld, pLdapResult); + pLdapEntry != NULL; + pLdapEntry = ldap_next_entry(ld, pLdapEntry)) + { + if ((dn = ldap_get_dn(ld, pLdapEntry)) != NULL) + { + exists = 1; + free(dn); + /*ldap_memfree(dn);*/ + break; + } + } + + ldap_msgfree(pLdapResult); + } + + return exists; +} + +int +add_aci(LDAP* ld, char* DN, char* privilege) +{ + int err; + int ret = 0; + LDAPMod mod; + LDAPMod* mods[2]; + char* aci[2]; + +#ifdef CGI_DEBUG + debug_log (dbg_log_file, "add_aci('%s', '%s')\n", + DN ? DN : "NULL", + privilege ? privilege : "NULL"); +#endif + + if (ld == NULL || DN == NULL || privilege == NULL) + { + return -1; + } + + mods[0] = &mod; + mods[1] = NULL; + mod.mod_op = LDAP_MOD_ADD; + mod.mod_type = name_aci; + mod.mod_values = aci; + aci[0] = privilege; + aci[1] = NULL; + /* fprintf (stdout, "ldap_modify_s('%s')
                      \n",DN); fflush (stdout); */ + err = ldap_modify_s (ld, DN, mods); + if (err != LDAP_SUCCESS && err != LDAP_TYPE_OR_VALUE_EXISTS) { + char* exp = "can't add privilege. "; + char* format; + char* errmsg; + char* explanation; + format = "%s (%i) returned from ldap_modify_s(%s, %i). Privilege: %s"; + errmsg = ldap_err2string (err); + explanation = (char*)malloc (strlen (format) + strlen (errmsg) + + 9 + strlen (DN) + 10 + strlen(aci[0])); + sprintf (explanation, format, errmsg, err, DN, LDAP_MOD_ADD, aci[0]); + ds_report_warning (DS_INCORRECT_USAGE, exp, explanation); + free (explanation); + ret = 1; + } + + return ret; +} + +/* + Same as add_aci, except that the 3rd parameter is a format string + in printf style format, and the 4th - Nth parameters are a NULL terminated + list of strings to substitute in the format; basically just constructs + the correct aci string and passes it to add_aci +*/ +int +add_aci_v(LDAP* ld, char* DN, char* format, ...) +{ + char* acistring = NULL; + int ii = 0; + int len = 0; + int status = 0; + int fudge = 10; /* a little extra just to make sure */ + char *s = 0; + va_list ap; + +#ifdef CGI_DEBUG + debug_log (dbg_log_file, "add_aci_v('%s', '%s')\n", + DN ? DN : "NULL", + format ? format : "NULL"); +#endif + + if (ld == NULL || DN == NULL || format == NULL) + { + return -1; + } + + /* determine the length of the string to allocate to hold + the aci string + */ + len += strlen(format) + fudge; + va_start(ap, format); + s = va_arg(ap, char*); + while (s) + { + len += strlen(s) + 1; + s = va_arg(ap, char*); + } + va_end(ap); + + va_start(ap, format); + acistring = (char *)malloc(len); + vsprintf(acistring, format, ap); + va_end(ap); + status = add_aci(ld, DN, acistring); + + free(acistring); + + return status; +} + +/* + Make a dn from lists of dn components. The format argument is in the + standard printf format. The varargs list contains the various dn + components. The string returned is malloc()'d and must be free()'d by + the caller after use. example: + make_dn("cn=%s, ou=%s, %s", "Admins", "TopologyManagement", "o=NetscapeRoot", NULL) + returns + "cn=Admins, ou=TopologyManagement, o=NetscapeRoot" +*/ +char * +make_dn(const char* format, ...) +{ + char *s; + int len = 0; + int fudge = 3; + va_list ap; + char *dnstring; + +#ifdef CGI_DEBUG + debug_log (dbg_log_file, "make_dn('%s', ...)\n", + format ? format : "NULL"); +#endif + + if (format == NULL) + { + return NULL; + } + + /* determine the length of the string to allocate to hold + the dn string + */ + len += strlen(format) + fudge; + va_start(ap, format); + s = va_arg(ap, char*); + while (s) + { + len += strlen(s) + 3; + s = va_arg(ap, char*); + } + va_end(ap); + + va_start(ap, format); + dnstring = (char *)malloc(len); + vsprintf(dnstring, format, ap); + va_end(ap); + + return dnstring; +} + +char * +admin_user_exists(LDAP* ld, char* base, char *userID) +{ + int exists = 0; + int err; + char search_str[MAX_STRING_LEN]; + + struct timeval sto = { 10L, 0L }; + LDAPMessage* pLdapResult; + sprintf (search_str, "uid=%s*", userID ? userID : "admin"); + + err = ldap_search_st(ld, base, LDAP_SCOPE_SUBTREE, + search_str, NULL, 0, &sto, &pLdapResult); + + if (err == LDAP_SUCCESS) + { + LDAPMessage* pLdapEntry; + char* dn = NULL; + + for (pLdapEntry = ldap_first_entry(ld, pLdapResult); + pLdapEntry != NULL; + pLdapEntry = ldap_next_entry(ld, pLdapEntry)) + { + if ((dn = ldap_get_dn(ld, pLdapEntry)) != NULL) + { + exists = 1; + /*ldap_memfree(dn);*/ + break; + } + } + + ldap_msgfree(pLdapResult); + return dn; + } + + return NULL; +} + +static void +getUIDFromDN(const char *userID, char *uid) +{ + char **rdnListTypes = 0; + char **rdnListNoTypes = 0; + int ii = 0; + int uidindex = -1; + uid[0] = 0; + + rdnListTypes = ldap_explode_dn(userID, 0); + if (!rdnListTypes) + return; /* userID is not a DN */ + + /* find the first rdn in the given userID DN which begins with + "uid=" */ + for (ii = 0; uidindex < 0 && rdnListTypes[ii]; ++ii) + { + if (!PL_strncasecmp(rdnListTypes[ii], "uid=", 4)) + uidindex = ii; + } + ldap_value_free(rdnListTypes); + + if (uidindex < 0) /* did not find an rdn beginning with "uid=" */ + return; + + rdnListNoTypes = ldap_explode_dn(userID, 1); + strcpy(uid, rdnListNoTypes[uidindex]); + ldap_value_free(rdnListNoTypes); + + return; +} + +static char * +create_ssadmin_user(LDAP* ld, char *base, char* userID, char* password) +{ + int err; + char *ret = 0; + char entrydn[1024] = {0}; + char realuid[1024] = {0}; + char *admin_dn = NULL; + +#ifdef CGI_DEBUG + debug_log (dbg_log_file, "create_ssadmin_user('%s','%s','%s')\n", + base ? base : "NULL", userID ? userID : "NULL", + password ? password : "NULL"); +#endif + + if (ld == NULL || base == NULL || userID == NULL || *userID == '\0' || + password == NULL || *password == '\0') + { + return NULL; + } + + getUIDFromDN(userID, realuid); + if (realuid[0]) + { + sprintf(entrydn, userID); + if (entry_exists(ld, entrydn)) + admin_dn = entrydn; + } + else + { + sprintf(entrydn, "%s=%s, %s", name_uid, userID, base); + admin_dn = admin_user_exists(ld, base, userID); + strcpy(realuid, userID); + } + + if (admin_dn) + { + char error[BIG_LINE]; + sprintf(error, "A user with uid=%s \"%s\" already exists in the directory" + " and will not be overwritten.", realuid[0] ? realuid : "admin", admin_dn); + ds_send_error(error, 0); + return admin_dn; + } + else + { + LDAPMod* attrs[8]; + LDAPMod attr[7]; + char* objectClasses[5]; + char* cn[2]; + char* sn[2]; + char* givenname[2]; + char* uid[2]; + char* userPassword[2]; + char* passwordExpirationTime[2]; + + attrs[0] = &attr[0]; + attrs[1] = &attr[1]; + attrs[2] = &attr[2]; + attrs[3] = &attr[3]; + attrs[4] = &attr[4]; + attrs[5] = &attr[5]; + attrs[6] = &attr[6]; + attrs[7] = NULL; + attr[0].mod_op = LDAP_MOD_ADD; + attr[0].mod_type = name_objectClass; + attr[0].mod_values = objectClasses; + objectClasses[0] = class_top; + objectClasses[1] = class_person; + objectClasses[2] = class_organizationalPerson; + objectClasses[3] = class_inetOrgPerson; + objectClasses[4] = NULL; + attr[1].mod_op = LDAP_MOD_ADD; + attr[1].mod_type = name_cn; + attr[1].mod_values = cn; + cn[0] = value_configAdminCN; + cn[1] = NULL; + attr[2].mod_op = LDAP_MOD_ADD; + attr[2].mod_type = name_sn; + attr[2].mod_values = sn; + sn[0] = value_configAdminSN; + sn[1] = NULL; + attr[3].mod_op = LDAP_MOD_ADD; + attr[3].mod_type = name_givenname; + attr[3].mod_values = givenname; + givenname[0] = value_configAdminGN; + givenname[1] = NULL; + attr[4].mod_op = LDAP_MOD_ADD; + attr[4].mod_type = name_uid; + attr[4].mod_values = uid; + uid[0] = realuid; + uid[1] = NULL; + attr[5].mod_op = LDAP_MOD_ADD; + attr[5].mod_type = name_userPassword; + attr[5].mod_values = userPassword; + userPassword[0] = password; + userPassword[1] = NULL; + attr[6].mod_op = LDAP_MOD_ADD; + attr[6].mod_type = name_passwordExpirationTime; + attr[6].mod_values = passwordExpirationTime; + passwordExpirationTime[0] = "20380119031407Z"; + passwordExpirationTime[1] = NULL; + + /* fprintf (stdout, "ldap_add_s(%s)
                      \n", entrydn); fflush (stdout); */ + + err = ldap_add_s (ld, entrydn, attrs); + + if (err != LDAP_SUCCESS) + { + char* format = "Unable to create administrative user." + " (%s (%i) returned from ldap_add_s(%s))"; + char* errmsg = ldap_err2string (err); + char* explanation = (char*)malloc (strlen (format) + strlen (errmsg) + + 9 + strlen (entrydn)); + sprintf (explanation, format, errmsg, err, entrydn); + ds_report_warning (DS_NETWORK_ERROR, " can't create user", explanation); + free (explanation); + ret = NULL; + } + } + + return NULL; +} + +static int +create_base_entry( + LDAP* ld, + char* basedn, + char *naming_attr_type, + char *naming_attr_value, + char *objectclassname +) +{ + int err; + int ret = 0; + +#ifdef CGI_DEBUG + debug_log (dbg_log_file, "create_base_entry('%s','%s')\n", + basedn ? basedn : "NULL", naming_attr_value: "NULL"); +#endif + + if (ld == NULL || basedn == NULL || *basedn == '\0') + { + return -1; + } + + if (!entry_exists(ld, basedn)) + { + LDAPMod* attrs[3]; + LDAPMod attr[2]; + char* objectClasses[3]; + char* names[2]; + + attrs[0] = &attr[0]; + attrs[2] = NULL; + attr[0].mod_op = LDAP_MOD_ADD; + attr[0].mod_type = name_objectClass; + attr[0].mod_values = objectClasses; + objectClasses[0] = class_top; + objectClasses[1] = objectclassname; + objectClasses[2] = NULL; + attrs[1] = &attr[1]; + attr[1].mod_op = LDAP_MOD_ADD; + attr[1].mod_type = naming_attr_type; + attr[1].mod_values = names; + names[0] = naming_attr_value; + names[1] = NULL; + + /* fprintf (stdout, "ldap_add_s(%s)
                      \n", basedn); fflush (stdout); */ + + err = ldap_add_s (ld, basedn, attrs); + + if (err != LDAP_SUCCESS) + { + char* format = "Unable to create base entry." + " (%s (%i) returned from ldap_add_s(%s))"; + char* errmsg = ldap_err2string (err); + char* explanation = (char*)malloc (strlen (format) + strlen (errmsg) + + 9 + strlen (basedn)); + sprintf (explanation, format, errmsg, err, basedn); + ds_report_warning (DS_NETWORK_ERROR, " can't create base entry", + explanation); + free (explanation); + ret = 1; + } + } + + return ret; +} + +static int +create_organization(LDAP* ld, char* base, char* org) +{ + return create_base_entry(ld, base, name_o, org, class_organization); +} + +static int +create_organizational_unit(LDAP* ld, char* base, char* unit, char *description, + char *extra_objectclassName, + char *extra_attrName, + char *extra_attrValue) +{ + int err; + int ret = 0; + char *entrydn = NULL; + +#ifdef CGI_DEBUG + debug_log (dbg_log_file, "create_organizational_unit('%s','%s')\n", + base ? base : "NULL", unit ? unit : "NULL"); +#endif + + if (ld == NULL || unit == NULL || *unit == '\0') + { + return -1; + } + + /* + if base is null, assume the unit is the full DN of the entry + to create; this assumes the caller knows what he/she is doing + and has already created the parent entry(ies) + */ + if (!base) + entrydn = strdup(unit); + else + entrydn = make_dn("%s=%s, %s", name_ou, unit, base, 0); + + if (!entry_exists(ld, entrydn)) + { + LDAPMod* attrs[5]; + LDAPMod attr[4]; + char* objectClasses[4]; + char* names[2]; + char* desc[2]; + char* extra[2]; + char *baseName = unit; + int attrnum = 0; + if (base) + { + baseName = strdup(unit); + } + else + { + /* since the unit is in DN form, we need to extract something to + use for the ou: attribute */ + baseName = extract_name_from_dn(unit); + } + attrs[0] = &attr[0]; + attrs[1] = &attr[1]; + attrs[2] = NULL; + attr[0].mod_op = LDAP_MOD_ADD; + attr[0].mod_type = name_objectClass; + attr[0].mod_values = objectClasses; + objectClasses[0] = class_top; + objectClasses[1] = class_organizationalUnit; + objectClasses[2] = extra_objectclassName; /* may be null */ + objectClasses[3] = NULL; + attr[1].mod_op = LDAP_MOD_ADD; + attr[1].mod_type = name_ou; + attr[1].mod_values = names; + names[0] = baseName; + names[1] = NULL; + attrnum = 2; + if (description && *description) + { + attr[attrnum].mod_op = LDAP_MOD_ADD; + attr[attrnum].mod_type = name_description; + attr[attrnum].mod_values = desc; + desc[0] = description; + desc[1] = NULL; + attrs[attrnum] = &attr[attrnum]; + attrs[++attrnum] = NULL; + } + if (extra_attrName && extra_attrValue && + *extra_attrName && *extra_attrValue) + { + attr[attrnum].mod_op = LDAP_MOD_ADD; + attr[attrnum].mod_type = extra_attrName; + attr[attrnum].mod_values = extra; + extra[0] = extra_attrValue; + extra[1] = NULL; + attrs[attrnum] = &attr[attrnum]; + attrs[++attrnum] = NULL; + } + + /* fprintf (stdout, "ldap_add_s(%s)
                      \n", DN); fflush (stdout); */ + + err = ldap_add_s (ld, entrydn, attrs); + if (baseName) + free(baseName); + + if (err != LDAP_SUCCESS) + { + char* format = "Unable to create organizational unit." + " (%s (%i) returned from ldap_add_s(%s))"; + char* errmsg = ldap_err2string (err); + char* explanation = (char*)malloc (strlen (format) + strlen (errmsg) + + 9 + strlen (entrydn)); + sprintf (explanation, format, errmsg, err, entrydn); + ds_report_warning (DS_NETWORK_ERROR, " can't create organizational unit", + explanation); + free (explanation); + ret = 1; + } + } + + if (entrydn) + free(entrydn); + + return ret; +} + +static int +create_domain_component(LDAP* ld, char* base, char* domcomp) +{ + return create_base_entry(ld, base, name_dc, domcomp, class_domain); +} + +static int +create_country(LDAP* ld, char* base, char* country) +{ + return create_base_entry(ld, base, name_c, country, class_country); +} + +static int +create_state(LDAP* ld, char* base, char* state) +{ + return create_base_entry(ld, base, name_st, state, class_locality); +} + +static int +create_locality(LDAP* ld, char* base, char* locality) +{ + return create_base_entry(ld, base, name_l, locality, class_locality); +} + +static int +create_base(LDAP* ld, char* base) +{ + int ret = 0; + char* attr; + char **rdnList = 0; + char **rdnListNoTypes = 0; + enum BASETYPE { unknown, org, orgunit, domcomp, country, state, locality } base_type = unknown; + +#ifdef CGI_DEBUG + debug_log (dbg_log_file, "create_base('%s')\n", base ? base : "NULL"); +#endif + + if (ld == NULL || base == NULL || *base == '\0') + { + return -1; + } + + rdnList = ldap_explode_dn(base, 0); + if (!rdnList) + { + char error[BIG_LINE]; + sprintf(error, "The given base suffix [%s] is not a valid DN", base); + ds_send_error(error, 0); + return -1; + } + + if (PL_strncasecmp(rdnList[0], "o=", 2) == 0) + { + base_type = org; + } + else if (PL_strncasecmp(rdnList[0], "ou=", 3) == 0) + { + base_type = orgunit; + } + else if (PL_strncasecmp(rdnList[0], "dc=", 3) == 0) + { + base_type = domcomp; + } + else if (PL_strncasecmp(rdnList[0], "c=", 2) == 0) + { + base_type = country; + } + else if (PL_strncasecmp(rdnList[0], "st=", 3) == 0) + { + base_type = state; + } + else if (PL_strncasecmp(rdnList[0], "l=", 2) == 0) + { + base_type = locality; + } + else + { + ds_report_warning (DS_INCORRECT_USAGE, " Unable to create the root suffix.", + "In order to create the root suffix in the directory, you must " + "specify a distinguished name beginning with o=, ou=, dc=, c=, st=, or l=. " + "If you wish to use something else for your root suffix, you " + "should first create the directory with one of these suffixes, then you can " + "create additional suffixes in any form you choose." + ); + return -1; + } + + ldap_value_free(rdnList); + /* + We need to extract from the base the value to use for the attribute + name_attr e.g. ou: foo or o: org. + */ + rdnListNoTypes = ldap_explode_dn(base, 1); + attr = rdnListNoTypes[0]; + + if (!entry_exists(ld, base)) + { + if (base_type == org) + { + ret = create_organization(ld, base, attr); + } + else if (base_type == orgunit) + { + /* this function is smart enough to extract the name from the DN */ + ret = create_organizational_unit(ld, 0, base, 0, 0, 0, 0); + } + else if (base_type == domcomp) + { + ret = create_domain_component(ld, base, attr); + } + else if (base_type == country) + { + ret = create_country(ld, base, attr); + } + else if (base_type == state) + { + ret = create_state(ld, base, attr); + } + else if (base_type == locality) + { + ret = create_locality(ld, base, attr); + } + } + + ldap_value_free(rdnListNoTypes); + + /* now add the anon search and self mod acis */ + if (!ret) + { + ret = add_aci(ld, base, ACI_anonymous_allow); + if (!ret) + ret = add_aci(ld, base, ACI_self_allow); + } + + return ret; +} + +static int +create_NetscapeRoot(LDAP* ld, const char *DN) +{ +/* + dn: o=NetscapeRoot + o: NetscapeRoot + objectclass: top + objectclass: organization + */ + int err; + int ret = 0; + +#ifdef CGI_DEBUG + debug_log (dbg_log_file, "create_NetscapeRoot()\n"); +#endif + + if (ld == NULL) + { + return -1; + } + + if (!entry_exists(ld, DN)) + { + LDAPMod* attrs[4]; + LDAPMod attr[3]; + char* objectClasses[4]; + char* names[2]; + + attrs[0] = &attr[0]; + attrs[3] = NULL; + attr[0].mod_op = LDAP_MOD_ADD; + attr[0].mod_type = name_objectClass; + attr[0].mod_values = objectClasses; + objectClasses[0] = class_top; + objectClasses[1] = class_organization; + objectClasses[2] = NULL; + attrs[1] = &attr[1]; + attr[1].mod_op = LDAP_MOD_ADD; + attr[1].mod_type = name_o; + attr[1].mod_values = names; + names[0] = name_netscaperoot; + names[1] = NULL; + attrs[2] = NULL; + + /* fprintf (stdout, "ldap_add_s(%s)
                      \n", DN); fflush (stdout); */ + + err = ldap_add_s (ld, DN, attrs); + + if (err != LDAP_SUCCESS) + { + char* format = "Unable to create %s." + " (%s (%i) returned from ldap_add_s(%s))"; + char* errmsg = ldap_err2string (err); + char* explanation = (char*)malloc (strlen (format) + strlen (errmsg) + + 9 + strlen (name_netscaperoot)); + sprintf (explanation, format, name_netscaperoot, errmsg, err, + DN); + ds_report_warning (DS_NETWORK_ERROR, " can't create NetscapeRoot", + explanation); + free (explanation); + ret = 1; + } + + } + + return ret; +} + +static int +create_configEntry(LDAP* ld) +{ +/* + dn: cn=config40 + objectclass: top + objectclass: extensibleObject + cn: config40 + */ + char *entrydn = NULL; + int err; + int ret = 0; + +#ifdef CGI_DEBUG + debug_log (dbg_log_file, "create_configEntry()\n"); +#endif + + if (ld == NULL) + { + return -1; + } + + entrydn = make_dn("%s=%s", name_cn, value_config40, 0); + if (!entry_exists(ld, entrydn)) + { + LDAPMod* attrs[3]; + LDAPMod attr[2]; + char* objectClasses[3]; + char* names[2]; + + attrs[0] = &attr[0]; + attrs[2] = NULL; + attr[0].mod_op = LDAP_MOD_ADD; + attr[0].mod_type = name_objectClass; + attr[0].mod_values = objectClasses; + objectClasses[0] = class_top; + objectClasses[1] = class_extensibleObject; + objectClasses[2] = NULL; + attrs[1] = &attr[1]; + attr[1].mod_op = LDAP_MOD_ADD; + attr[1].mod_type = name_cn; + attr[1].mod_values = names; + names[0] = value_config40; + names[1] = NULL; + + /* fprintf (stdout, "ldap_add_s(%s)
                      \n", DN); fflush (stdout); */ + + err = ldap_add_s (ld, entrydn, attrs); + + if (err != LDAP_SUCCESS) + { + char* format = "Unable to create %s." + " (%s (%i) returned from ldap_add_s(%s))"; + char* errmsg = ldap_err2string (err); + char* explanation = (char*)malloc (strlen (format) + strlen (errmsg) + + 9 + strlen (name_netscaperoot)); + sprintf (explanation, format, value_config40, errmsg, err, entrydn); + ds_report_warning (DS_NETWORK_ERROR, " can't create config40", + explanation); + free (explanation); + ret = 1; + } + + } + + if (entrydn) + free(entrydn); + + return ret; +} + +int +create_group(LDAP* ld, char* base, char* group) +{ + int err; + int ret = 0; + LDAPMod* attrs[3]; + LDAPMod attr[2]; + char* objectClasses[3]; + char* names[2]; + char *entrydn = 0; + +#ifdef CGI_DEBUG + debug_log (dbg_log_file, "create_group('%s','%s')\n", + base ? base : "NULL", group ? group : "NULL"); +#endif + + if (ld == NULL || base == NULL || *base == '\0' || + group == NULL || *group == '\0') + { + return -1; + } + + entrydn = make_dn("%s=%s, %s", name_cn, group, base, 0); + + if (!entry_exists(ld, entrydn)) + { + attrs[0] = &attr[0]; + attrs[1] = &attr[1]; + attrs[2] = NULL; + attr[0].mod_op = LDAP_MOD_ADD; + attr[0].mod_type = name_objectClass; + attr[0].mod_values = objectClasses; + objectClasses[0] = class_top; + objectClasses[1] = class_groupOfUniqueNames; + objectClasses[2] = NULL; + attr[1].mod_op = LDAP_MOD_ADD; + attr[1].mod_type = name_cn; + attr[1].mod_values = names; + names[0] = group; + names[1] = NULL; + /* fprintf (stdout, "ldap_add_s(%s)
                      \n", entrydn); fflush (stdout); */ + + err = ldap_add_s (ld, entrydn, attrs); + + if (err != LDAP_SUCCESS) + { + char* format = "Unable to create group." + " (%s (%i) returned from ldap_add_s(%s))"; + char* errmsg = ldap_err2string (err); + char* explanation = (char*)malloc (strlen (format) + strlen (errmsg) + + 9 + strlen (entrydn)); + sprintf (explanation, format, errmsg, err, entrydn); + ds_report_warning (DS_NETWORK_ERROR, " can't create group", explanation); + free (explanation); + ret = 1; + } + } + + if (entrydn) + free(entrydn); + + return ret; +} + +int +create_consumer_dn(LDAP* ld, char* dn, char* hashedpw) +{ + int err; + int ret = 0; + LDAPMod* attrs[7]; + LDAPMod attr[6]; + char* objectClasses[3]; + char* names[2]; + char* snames[2]; + char* desc[2]; + char* pwd[2]; + char* passwordExpirationTime[2]; + +#ifdef CGI_DEBUG + debug_log (dbg_log_file, "create_consumer_dn('%s','%s')\n", + dn ? dn : "NULL", hashedpw ? hashedpw : "NULL"); +#endif + + if (ld == NULL || dn == NULL || hashedpw == NULL) + { + return -1; + } + + if (!entry_exists(ld, dn)) + { + attrs[0] = &attr[0]; + attrs[1] = &attr[1]; + attrs[2] = &attr[2]; + attrs[3] = &attr[3]; + attrs[4] = &attr[4]; + attrs[5] = &attr[5]; + attrs[6] = NULL; + + attr[0].mod_op = LDAP_MOD_ADD; + attr[0].mod_type = name_objectClass; + attr[0].mod_values = objectClasses; + objectClasses[0] = class_top; + objectClasses[1] = class_person; + objectClasses[2] = NULL; + + attr[1].mod_op = LDAP_MOD_ADD; + attr[1].mod_type = name_cn; + attr[1].mod_values = names; + names[0] = "Replication Consumer"; + names[1] = NULL; + + attr[2].mod_op = LDAP_MOD_ADD; + attr[2].mod_type = name_sn; + attr[2].mod_values = snames; + snames[0] = "Consumer"; + snames[1] = NULL; + + attr[3].mod_op = LDAP_MOD_ADD; + attr[3].mod_type = name_description; + attr[3].mod_values = desc; + desc[0] = "Replication Consumer bind entity"; + desc[1] = NULL; + + attr[4].mod_op = LDAP_MOD_ADD; + attr[4].mod_type = name_userPassword; + attr[4].mod_values = pwd; + pwd[0] = hashedpw; + pwd[1] = NULL; + + attr[5].mod_op = LDAP_MOD_ADD; + attr[5].mod_type = name_passwordExpirationTime; + attr[5].mod_values = passwordExpirationTime; + passwordExpirationTime[0] = "20380119031407Z"; + passwordExpirationTime[1] = NULL; + + /* fprintf (stdout, "ldap_add_s(%s)
                      \n", DN); fflush (stdout); */ + + err = ldap_add_s (ld, dn, attrs); + + if (err != LDAP_SUCCESS) + { + char* format = "Unable to create consumer dn." + " (%s (%i) returned from ldap_add_s(%s))"; + char* errmsg = ldap_err2string (err); + char* explanation = (char*)malloc (strlen (format) + strlen (errmsg) + + 9 + strlen (dn)); + sprintf (explanation, format, errmsg, err, dn); + ds_report_warning (DS_NETWORK_ERROR, " can't create consumer dn", explanation); + free (explanation); + ret = 1; + } + } + + return ret; +} + +static int +add_group_member(LDAP* ld, char* DN, char* attr, char* member) +{ + int err; + int ret = 0; + LDAPMod mod; + LDAPMod* mods[2]; + char* members[2]; + +#ifdef CGI_DEBUG + debug_log (dbg_log_file, "add_group_member('%s', '%s', '%s')\n", + DN ? DN : "NULL", + attr ? attr : "NULL", + member ? member : "NULL"); +#endif + + if (ld == NULL || DN == NULL || attr == NULL || member == NULL) + { + return -1; + } + + mods[0] = &mod; + mods[1] = NULL; + mod.mod_op = LDAP_MOD_ADD; + mod.mod_type = attr; + mod.mod_values = members; + members[0] = member; + members[1] = NULL; + /* fprintf (stdout, "ldap_modify_s('%s')
                      \n",DN); fflush (stdout); */ + err = ldap_modify_s (ld, DN, mods); + if (err != LDAP_SUCCESS && err != LDAP_TYPE_OR_VALUE_EXISTS) { + char* exp = "can't add member. "; + char* format; + char* errmsg; + char* explanation; + format = "%s (%i) returned from ldap_modify_s(%s, %i)."; + errmsg = ldap_err2string (err); + explanation = (char*)malloc (strlen (format) + strlen (errmsg) + + 9 + strlen (DN) + 10); + sprintf (explanation, format, errmsg, err, DN, LDAP_MOD_ADD); + ds_report_warning (DS_INCORRECT_USAGE, exp, explanation); + free (explanation); + ret = 1; + } + + return ret; +} + +static LDAP* +do_bind(SLAPD_CONFIG* slapd, char* rootdn, char* rootpw) +{ + LDAP* connection = NULL; + int retrymax = 1800; /* wait up to 30 min; init dbcache could be slow. */ + int err = LDAP_SUCCESS; + + /* added error retry to work around the slow start introduced + by blackflag 624053 */ + while ( retrymax-- ) + { + if (connection == NULL) { + connection = ldap_open ("127.0.0.1", slapd->port); + } + + if (connection) { + err = ldap_simple_bind_s (connection, rootdn, rootpw ? rootpw : ""); + if (LDAP_SUCCESS == err) + break; + } + + PR_Sleep(PR_SecondsToInterval(1)); + } + + if (connection == NULL) { + char* format = " Cannot connect to server."; + ds_report_warning (DS_NETWORK_ERROR, format, ""); + } else if (err != LDAP_SUCCESS) { + char* errmsg = ldap_err2string (err); + char* format = "Unable to bind to server." + " (%s (%i) returned from ldap_simple_bind_s(%s))"; + char* explanation = malloc (strlen (format) + strlen (errmsg) + + 9 + strlen (rootdn) + 1); + sprintf (explanation, format, errmsg, err, rootdn); + ds_report_warning (DS_NETWORK_ERROR, " can't bind to server", + explanation); + free (explanation); + ldap_unbind (connection); + connection = NULL; + } + fflush (stdout); + return connection; +} + +static int +write_ldap_info(SLAPD_CONFIG* slapd, char* base, char* admnm) +{ + FILE* fp; + int ret = 0; + + char* fmt = "%s/shared/config/ldap.conf"; + char* infoFileName; + + infoFileName = (char*)malloc(strlen(fmt) + strlen(slapd->slapd_server_root) + 1); + sprintf(infoFileName, fmt, slapd->slapd_server_root); + + if ((fp = fopen(infoFileName, "w")) == NULL) + { + ret = -1; + } + else + { + fprintf(fp, "url\tldap://%s:%d/", + slapd->host, slapd->port); + + if (base) + fprintf(fp, "%s", base); + + fprintf(fp, "\n"); + + fprintf(fp, "admnm\t%s\n", admnm); + + fclose(fp); + } + + free(infoFileName); + + return ret; +} + +int +config_configEntry(LDAP* connection, QUERY_VARS* query) +{ + /* initial ACIs for o=NetscapeRoot */ + + int ret = add_aci_v (connection, value_config40DN, ACI_self_allow, 0); + return ret; +} + +int +config_suitespot(SLAPD_CONFIG* slapd, QUERY_VARS* query) +{ + LDAP* connection; + const char* DN_formatUID = "uid=%s,%s"; + char* usageShortMsg = " Required field missing."; + char* usageErrorMsg = NULL; + int status = 0; + char *admin_domainDN = 0; + int ii = 0; + char *configAdminDN = 0; + char *adminGroupDN = 0; + char *parentDN = 0; + char *localDAGroupDN = 0; + + if (!query->rootDN || *query->rootDN == '\0') { + usageErrorMsg = "You must enter the distinguished name of a user with " + "unrestricted access to the directory."; + } else if (!query->rootPW || *query->rootPW == '\0') { + usageErrorMsg = "You must enter the password of the user with " + "unrestricted access to the directory."; + } + + if (usageErrorMsg) { + ds_report_warning (DS_INCORRECT_USAGE, usageShortMsg, usageErrorMsg); + return -1; + } + + if (!(connection = do_bind (slapd, query->rootDN, query->rootPW))) + return 1; + + /* parent dn of admin uid entry */ + parentDN = make_dn("%s, %s, %s", name_administratorsRDN, + name_topologyRDN, query->netscaperoot, 0); + if (query->suffix) + { + status = create_base(connection, query->suffix); + if (!status) + { + add_aci_v(connection, query->suffix, ACI_user_allow_1, + "all", query->config_admin_uid, parentDN, 0); + + status = create_group(connection, query->suffix, name_localDAGroup); + } + } + + if (!status && query->consumerDN && query->consumerPW && + PL_strcasecmp(query->consumerDN, query->rootDN)) + status = create_consumer_dn(connection, + query->consumerDN, query->consumerPW); + + if (!status) + { + char realuid[1024] = {0}; + getUIDFromDN(query->config_admin_uid, realuid); + if (realuid[0]) + { + /* admid is already a DN */ + configAdminDN = strdup(query->config_admin_uid); + } + else + { + /* create a DN for admid */ + configAdminDN = make_dn(DN_formatUID, query->config_admin_uid, parentDN, 0); + } + + /* + Give the Configuration Admin group access to the root DSE entries + */ + adminGroupDN = make_dn("%s, %s=%s, %s, %s", value_configAdminGroupRDN, + name_ou, value_groupsOU, + name_topologyRDN, + query->netscaperoot, 0); + if (query->suffix) + { + localDAGroupDN = make_dn("cn=%s, %s", name_localDAGroup, + query->suffix, 0); + } + else + { + localDAGroupDN = NULL; + } + for (ii = 0; ii < entryAndAccessListSize; ++ii) + { + if (query->cfg_sspt) { + add_aci_v(connection, entryAndAccessList[ii].entryDN, + ACI_config_admin_group_allow, + entryAndAccessList[ii].access, + adminGroupDN, 0); + } + add_aci_v(connection, entryAndAccessList[ii].entryDN, + ACI_user_allow_2, + entryAndAccessList[ii].access, + configAdminDN, 0); + if (localDAGroupDN) + { + add_aci_v(connection, entryAndAccessList[ii].entryDN, + ACI_local_DA_allow, + entryAndAccessList[ii].access, + localDAGroupDN, 0); + } + } + } + + if (query->cfg_sspt) + { + /* create and set ACIs for o=netscaperoot entry */ + if (!status) + status = create_NetscapeRoot(connection, query->netscaperoot); + + if (!status) + status = add_aci_v(connection, query->netscaperoot, + ACI_config_admin_group_allow_all, + value_configAdminGroupRDN, + name_ou, value_groupsOU, name_topologyRDN, + query->netscaperoot, 0); + + if (!status) + status = add_aci_v(connection, query->netscaperoot, + ACI_anonymous_allow_with_filter, + query->netscaperoot, 0); + + if (!status) + status = add_aci_v(connection, query->netscaperoot, ACI_group_expansion, + query->netscaperoot, 0); + + /* create "topologyOU, netscaperoot" entry and set ACIs */ + if (!status) + { + char *dn = make_dn("%s, %s", name_topologyRDN, + query->netscaperoot, 0); + status = create_organizational_unit(connection, NULL, dn, + value_topologyDESC, + 0, 0, 0); + + if (!status) + add_aci(connection, dn, ACI_anonymous_allow); + + free(dn); + } + + /* create "ou=Groups, ..." */ + if (!status) + { + char *dn = make_dn("%s=%s, %s, %s", name_ou, value_groupsOU, + name_topologyRDN, query->netscaperoot, 0); + status = create_organizational_unit (connection, NULL, dn, + value_groupsDesc, 0, 0, 0); + free(dn); + } + + /* create "ou=Administrators, ..." */ + if (!status) + { + char *dn = make_dn("%s, %s, %s", name_administratorsRDN, + name_topologyRDN, query->netscaperoot, 0); + status = create_organizational_unit (connection, NULL, dn, + value_administratorsDESC, + 0, 0, 0); + free(dn); + } + + /* create "cn=Configuration Administrators, ou=Groups, ..." */ + if (!status) + { + char *dn = make_dn("%s=%s, %s, %s", name_ou, value_groupsOU, + name_topologyRDN, + query->netscaperoot, 0); + status = create_group (connection, dn, value_configAdminGroupCN); + free(dn); + } + + /* create the ss admin user */ + if (!status) + { + /* group to add the uid to */ + char *groupdn = make_dn("%s, %s=%s, %s, %s", value_configAdminGroupRDN, + name_ou, value_groupsOU, name_topologyRDN, + query->netscaperoot, 0); + create_ssadmin_user(connection, parentDN, + query->ssAdmID, query->ssAdmPW1); + + status = add_group_member (connection, groupdn, + name_uniqueMember, configAdminDN); + free (groupdn); + } + + admin_domainDN = make_dn("%s=%s, %s", name_ou, query->admin_domain, + query->netscaperoot, 0); + + if (!status) + status = create_organizational_unit (connection, 0, + admin_domainDN, + value_netscapeConfigDesc, + class_adminDomain, + name_adminDomain, + query->admin_domain); + + if (!status) { + status = create_organizational_unit(connection, + admin_domainDN, + value_globalPreferencesOU, 0, + 0, 0, 0); + } + if (!status) { + status = create_organizational_unit(connection, + admin_domainDN, + value_hostPreferencesOU, 0, + 0, 0, 0); + } + + /* + ** Write the ldap.info file and the SuiteSpot.ldif file + */ + + write_ldap_info(slapd, query->suffix, query->ssAdmID); + } + + if (!status && query->testconfig) + status = create_configEntry(connection); + + if (!status && query->testconfig) + status = config_configEntry(connection, query); + + if (connection) + ldap_unbind (connection); + if (adminGroupDN) + free(adminGroupDN); + if (configAdminDN) + free(configAdminDN); + if (parentDN) + free(parentDN); + if (localDAGroupDN) + free(localDAGroupDN); + + return status; +} diff --git a/ldap/admin/src/cfg_sspt.h b/ldap/admin/src/cfg_sspt.h new file mode 100644 index 00000000..a27d9891 --- /dev/null +++ b/ldap/admin/src/cfg_sspt.h @@ -0,0 +1,110 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +#ifndef __cfg_sspt_h +#define __cfg_sspt_h + +#ifdef __cplusplus +extern "C" { /* Assume C declarations for C++ */ +#endif /* __cplusplus */ + +#include "ldap.h" +#include "dsalib.h" + +#define MAX_STRING_LEN 512 + +typedef struct _SLAPD_CONFIG { + char slapd_server_root[MAX_STRING_LEN + 1]; + int port; + char host[MAX_STRING_LEN]; + char root_dn[MAX_STRING_LEN]; +#define MAX_SUFFIXES 1024 + char* suffixes[MAX_SUFFIXES]; + int num_suffixes; +} SLAPD_CONFIG; + +typedef struct _query_vars { + char* suffix; + char* ssAdmID; + char* ssAdmPW1; + char* ssAdmPW2; + char* rootDN; + char* rootPW; + char* consumerDN; + char* consumerPW; + char* netscaperoot; + char* testconfig; + char* admin_domain; + int cfg_sspt; + char* config_admin_uid; +} QUERY_VARS; + +extern int +entry_exists(LDAP* ld, const char* entrydn); + +extern int +config_suitespot(SLAPD_CONFIG* slapd, QUERY_VARS* query); + +extern int +create_group(LDAP* ld, char* base, char* group); + +#ifndef __CFG_SSPT_C + +extern char* const class_top; +extern char* const class_organization; +extern char* const class_organizationalUnit; +extern char* const class_person; +extern char* const class_organizationalPerson; +extern char* const class_inetOrgPerson; +extern char* const class_groupOfUniqueNames; + +extern char* const name_objectClass; +extern char* const name_cn; +extern char* const name_sn; +extern char* const name_givenname; +extern char* const name_uid; +extern char* const name_userPassword; +extern char* const name_o; +extern char* const name_ou; +extern char* const name_member; +extern char* const name_uniqueMember; +extern char* const name_subtreeaci; +extern char* const name_netscaperoot; +extern char* const name_netscaperootDN; + +extern char* const value_suiteSpotAdminCN; +extern char* const value_suiteSpotAdminSN; +extern char* const value_suiteSpotAdminGN; +extern char* const value_adminGroupCN; +extern char* const value_netscapeServersOU; + +extern char* const field_suffix; +extern char* const field_ssAdmID; +extern char* const field_ssAdmPW1; +extern char* const field_ssAdmPW2; +extern char* const field_rootDN; +extern char* const field_rootPW; +extern char* const format_DN; +extern char* const format_simpleSearch; + +extern char* const insize_text; + +extern char* html_file; +extern char* dbg_log_file; + +#endif /* __CFG_SSPT_C */ + +/* + * iterate over the root DSEs we need to setup special ACIs for + * return true if entry and access are valid, false when the list + * is empty and entry and access are null + */ +int getEntryAndAccess(int index, const char **entry, const char **access); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __cfg_sspt_h */ diff --git a/ldap/admin/src/configure_instance.cpp b/ldap/admin/src/configure_instance.cpp new file mode 100644 index 00000000..db356e7f --- /dev/null +++ b/ldap/admin/src/configure_instance.cpp @@ -0,0 +1,1969 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/********************************************************************* +** +** +** NAME: +** configure_instance.cpp +** +** DESCRIPTION: +** Netscape Directory Server Configuration Program +** +** NOTES: +** Derived from the original ux-config.cc +** +** +*********************************************************************/ + +#include +#include +#include /* printf, file I/O */ +#include /* strlen */ +#include +#include +#ifdef XP_UNIX +#include +#include +#include +#include +#include +#include +#include +#else +#include +#endif +#include /* memset, rand stuff */ +#include +#include +#include +#include + +extern "C" { +#include "ldap.h" +#include "dsalib.h" +} + +#include "prprf.h" + +#include "setupapi.h" +#ifdef XP_UNIX +#include "ux-util.h" +#endif +#include "ldapu.h" +#include "install_keywords.h" +#include "create_instance.h" +#include "cfg_sspt.h" +#include "configure_instance.h" +#include "dirver.h" + +#undef FILE_PATHSEP +#ifdef XP_WIN32 +#define FILE_PATHSEP "\\" +#else +#define FILE_PATHSEP "/" +#endif + +#ifdef XP_WIN32 +#define DEFAULT_TASKCONF "bin\\slapd\\install\\ldif\\tasks.ldif" +#define ROLEDIT_EXTENSION "bin\\slapd\\install\\ldif\\roledit.ldif" +#define COMMON_TASKS "bin\\slapd\\install\\ldif\\commonTasks.ldif" +#define SAMPLE_LDIF "bin\\slapd\\install\\ldif\\Example.ldif" +#define TEMPLATE_LDIF "bin\\slapd\\install\\ldif\\template.ldif" +#else +#define DEFAULT_TASKCONF "bin/slapd/install/ldif/tasks.ldif" +#define ROLEDIT_EXTENSION "bin/slapd/install/ldif/roledit.ldif" +#define COMMON_TASKS "bin/slapd/install/ldif/commonTasks.ldif" +#define SAMPLE_LDIF "bin/slapd/install/ldif/Example.ldif" +#define TEMPLATE_LDIF "bin/slapd/install/ldif/template.ldif" +#endif + +#ifndef PATH_MAX +#define PATH_MAX 256 +#endif + +// location of java runtime relative to server root +#ifdef XP_WIN32 +#define JAVA_RUNTIME "bin\\base\\jre\\bin\\jre" +#else +#define JAVA_RUNTIME "bin/base/jre/bin/jre" +#endif + +// location of class files for java +#define JAVA_DIR "java" +// location of jar files relative to java dir +#define JARS_DIR "jars" +// full name of class with main() for running admin console +#define CONSOLE_CLASS_NAME "com.netscape.management.client.console.Console" +// name of script file to generate relative to slapd instance directory +#define SCRIPT_FILE_NAME "start-console" + +#define DS_JAR_FILE_NAME "ds70.jar" +#define DS_CONSOLE_CLASS_NAME "com.netscape.admin.dirserv.DSAdmin" + +#ifdef XP_WIN32 +#define strtok_r(x,y,z) strtok(x,y) +#include "proto-ntutil.h" +#endif + +#define SERVER_MIGRATION_CLASS "com.netscape.admin.dirserv.task.MigrateCreate" +#define SERVER_CREATION_CLASS "com.netscape.admin.dirserv.task.MigrateCreate" + +static InstallMode installMode = Interactive; +static InstallInfo *installInfo = NULL; +static InstallInfo *slapdInfo = NULL; +static InstallInfo *slapdINFFileInfo = NULL; +static InstallInfo *adminInfo = NULL; +static const char *infoFile = NULL; +static const char *logFile = NULL; + +static InstallLog *installLog = NULL; +static int reconfig = 0; // set to 1 if we are reconfiguring +/* + * iDSISolaris is set to 1 for Solaris 9+ specific installation. + * This can be done by passing -S as the command line argument. + */ +int iDSISolaris = 0; + +/* + * There is currently a bug in LdapEntry->printEntry - it will crash if given a NULL argument + * This is a workaround + */ +static void +my_printEntry(LdapEntry *ent, const char *filename, int which) +{ + ostream *os = NULL; + if (filename && ent) + { + // just use LdapEntry, which should work given a good filename + ent->printEntry(filename); + return; + } + else if (which) + { + os = &cerr; + } + else + { + os = &cout; + } + + if (!ent || !ent->entryDN() || ent->isEmpty()) + { + *os << "Error: entry to print is empty" << endl; + } + else + { + *os << "dn: " << ent->entryDN() << endl; + char **attrs = ent->getAttributeNames(); + for (int ii = 0; attrs && attrs[ii]; ++ii) + { + char **values = ent->getAttributes(attrs[ii]); + for (int jj = 0; values && values[jj]; jj++) + { + *os << attrs[ii] << ": " << values[jj] << endl; + } + + if (values) + { + ent->freeAttributes(values); + } + } + if (attrs) + { + ent->freeAttributeNames(attrs); + } + } +} + +// changes empty strings ("") to NULLs (0) +static char * +my_strdup(const char *s) +{ + char *n = 0; + if (s && *s) + { + n = new char[strlen(s) + 1]; + strcpy(n, s); + } + + return n; +} + +// changes empty strings ("") to NULLs (0) +static char * +my_c_strdup(const char *s) +{ + char *n = 0; + if (s && *s) + { + n = (char *)malloc(strlen(s) + 1); + strcpy(n, s); + } + + return n; +} + +static int +isAValidDN(const char *dn_to_test) +{ + int ret = 1; + + if (!dn_to_test || !*dn_to_test) + { + ret = 0; + } + else + { + char **rdnList = ldap_explode_dn(dn_to_test, 0); + char **rdnNoTypes = ldap_explode_dn(dn_to_test, 1); + if (!rdnList || !rdnList[0] || !rdnNoTypes || !rdnNoTypes[0] || + !strcasecmp(rdnList[0], rdnNoTypes[0])) + { + ret = 0; + } + if (rdnList) + ldap_value_free(rdnList); + if (rdnNoTypes) + ldap_value_free(rdnNoTypes); + } + + return ret; +} + +static void +initMessageLog(const char *filename) +{ + if (filename && !installLog) + { + logFile = my_c_strdup(filename); +#ifdef XP_UNIX + if (!logFile && installMode != Silent) + { + logFile = "/dev/tty"; + } +#endif + installLog = new InstallLog(logFile); + } +} + +static void +dsLogMessage(const char *level, const char *which, + const char *format, ...) +{ + char bigbuf[BIG_BUF*4]; + va_list ap; + va_start(ap, format); + PR_vsnprintf(bigbuf, BIG_BUF*4, format, ap); + va_end(ap); +#ifdef _WIN32 // always output to stdout (for CGIs), and always log + // if a log is available + fprintf(stdout, "%s %s %s\n", level, which, bigbuf); + fflush(stdout); + if (installLog) + installLog->logMessage(level, which, bigbuf); +#else // not Windows + if (installMode == Interactive) + { + fprintf(stdout, "%s %s %s\n", level, which, bigbuf); + fflush(stdout); + } + else + { + if (installLog) + installLog->logMessage(level, which, bigbuf); + else + fprintf(stdout, "%s %s %s\n", level, which, bigbuf); + fflush(stdout); + } +#endif + + return; +} + +static char * +getGMT() +{ + static char buf[20]; + time_t curtime; + struct tm ltm; + + curtime = time( (time_t *)0 ); +#ifdef _WIN32 + ltm = *gmtime( &curtime ); +#else + gmtime_r( &curtime, <m ); +#endif + strftime( buf, sizeof(buf), "%Y%m%d%H%M%SZ", <m ); + return buf; +} + +static void +normalizeDNs() +{ + static const char *DN_VALUED_ATTRS[] = { + SLAPD_KEY_SUFFIX, + SLAPD_KEY_ROOTDN, + SLAPD_KEY_REPLICATIONDN, + SLAPD_KEY_CONSUMERDN, + SLAPD_KEY_SIR_SUFFIX, + SLAPD_KEY_SIR_BINDDN + }; + static const int N = sizeof(DN_VALUED_ATTRS)/sizeof(DN_VALUED_ATTRS[0]); + static const char *URL_ATTRS[] = { + SLAPD_KEY_K_LDAP_URL, + SLAPD_KEY_USER_GROUP_LDAP_URL + }; + static const int NURLS = sizeof(URL_ATTRS)/sizeof(URL_ATTRS[0]); + + int ii; + for (ii = 0; slapdInfo && (ii < N); ++ii) + { + const char *attr = DN_VALUED_ATTRS[ii]; + char *dn = my_strdup(slapdInfo->get(attr)); + if (dn) + { + slapdInfo->set(attr, dn_normalize_convert(dn)); + delete [] dn; + } + } + + for (ii = 0; installInfo && (ii < NURLS); ++ii) + { + const char *attr = URL_ATTRS[ii]; + const char *url = installInfo->get(attr); + LDAPURLDesc *desc = 0; + if (url && !ldap_url_parse((char *)url, &desc) && desc) + { + char *dn = dn_normalize_convert(my_strdup(desc->lud_dn)); + int isSSL = !strncmp(url, "ldaps:", strlen("ldaps:")); + if (dn) + { + char port[6]; + sprintf(port, "%d", desc->lud_port); + NSString newurl = NSString("ldap") + + (isSSL ? "s" : "") + + "://" + desc->lud_host + + ":" + port + "/" + dn; + installInfo->set(attr, newurl); + delete [] dn; + } + } + if (desc) + ldap_free_urldesc(desc); + } +} + + +static int +featureIsEnabled(const char *s) +{ + if (!s || !*s || !strncasecmp(s, "no", strlen(s))) + return 0; // feature is disabled + + return 1; // feature is enabled +} + +/* + * The following escape LDAP URL is from ldapserver/ldap/clients/dsgw/htmlout.c + */ + +#define HREF_CHAR_ACCEPTABLE( c ) (( c >= '-' && c <= '9' ) || \ + ( c >= '@' && c <= 'Z' ) || \ + ( c == '_' ) || \ + ( c >= 'a' && c <= 'z' )) +static void +escape_ldap_uri(char *s1, const char *s2) +{ + unsigned char *q; + char *p; + const char *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[*q >> 4]; + *p++ = hexdig[*q & 0x0F]; + } + } + + *p = '\0'; +} + +static LdapErrorCode +add_sample_entries(const char *sroot, LdapEntry *ldapEntry) +{ + char tmp[MED_BUF]; + + if (sroot) + sprintf(tmp, "%s%s%s", sroot, FILE_PATHSEP, SAMPLE_LDIF); + else + strcpy(tmp, "test.ldif"); + + return insertLdifEntries(ldapEntry->ldap(), NULL, tmp, NULL); + +} + + +// in the given string s, replace all occurrances of token with replace +// the string return is allocated with new char [] +static char * +replace_token(const char *s, const char *token, int tokenlen, + const char *replace, int replacelen) +{ + char *ptr = (char*)strstr(s, token); + char *n = 0; + if (!ptr) + { + n = my_strdup(s); + return n; + } + + // count the number of occurances of the token + int ntokens = 1; + while (ptr && *ptr) + { + ptr = (char*)strstr(ptr+1, token); + ++ntokens; + } + + n = new char [strlen(s) + (ntokens * replacelen)]; + char *d = n; + const char *begin = s; + for (ptr = (char*)strstr(s, token); ptr && *ptr;) + { + int len = int(ptr - begin); + strncpy(d, begin, len); + d += len; + begin = ptr + tokenlen; + len = replacelen; + strncpy(d, replace, len); + d += len; + ptr = strstr(ptr+1, token); + } + // no more occurances of token in string; copy the rest + for (ptr = (char *)begin; ptr && *ptr; LDAP_UTF8INC(ptr)) + { + *d = *ptr; + LDAP_UTF8INC(d); + } + *d = 0; + + return n; +} + +static void +add_org_entries(const char *sroot, LdapEntry *ldapEntry, + const char *initialLdifFile, const char *org_size, + NSString sieDN) +{ + org_size = org_size; + + char tmp[MED_BUF]; + char *dn; + + LdapError ldapError; + char **vals; + static const char *TOKEN[] = { + "%%%SUFFIX%%%", + "%%%ORG%%%", + "%%%CONFIG_ADMIN_DN%%%" + }; + static const int TOKENLEN[] = { 12, 9, 21 }; + static const int NTOKENS = 3; + static const char *REPLACE[] = { 0, 0, 0 }; + static int REPLACELEN[] = { 0, 0, 0 }; + + REPLACE[0] = slapdInfo->get(SLAPD_KEY_SUFFIX); + const char *org = strchr(REPLACE[0], '='); + if (org) + REPLACE[1] = org+1; + + REPLACE[2] = slapdInfo->get(SLAPD_KEY_CONFIG_ADMIN_DN); + for (int ii = 0; ii < NTOKENS; ++ii) + { + if (REPLACE[ii]) + REPLACELEN[ii] = strlen(REPLACE[ii]); + } + + if (sroot) + { + if (!initialLdifFile || !*initialLdifFile || + !strncasecmp(initialLdifFile, "suggest", strlen(initialLdifFile))) + sprintf(tmp, "%s%s%s", sroot, FILE_PATHSEP, TEMPLATE_LDIF); + else + strcpy(tmp, initialLdifFile); + } + else + strcpy(tmp, "test.ldif"); + + LdifEntry ldif(tmp); + + if (!ldif.isValid() || ldif.nextEntry() == -1) + { + dsLogMessage(SETUP_LOG_WARN, "Slapd", "File %s\ndoes not" + " appear to be a valid LDIF file.", tmp); + return; + } + + int entry_num = 0; + + do + { + entry_num++; + if (ldapEntry) + ldapEntry->clear(); + + for (int i = 0; i < ldif.numList(); i++) + { + const char *name = ldif.list(i); + if (!name || !*name) + continue; + + vals = ldif.getListItems(name); + if (!vals || !*vals) + continue; + + int n = ldif.numListItems(name); + if (!n) + continue; + + char **newvals = new char* [n+1]; + newvals[n] = 0; // null terminated + // go through the values replacing the token string with the value + for (int iii = 0; iii < n; ++iii) + { + newvals[iii] = my_strdup(vals[iii]); + for (int jj = 0; jj < NTOKENS; ++jj) + { + char *oldnewvals = newvals[iii]; + newvals[iii] = replace_token(newvals[iii], TOKEN[jj], TOKENLEN[jj], + REPLACE[jj], REPLACELEN[jj]); + delete [] oldnewvals; + } + } + + if (!strcasecmp(name, "dn")) + { + dn = my_strdup(newvals[0]); + } + else if (ldapEntry) + { + ldapEntry->addAttributes(name, (const char **) newvals); + } + else /* this is for debugging only */ + { + cerr << "name = " << name << " dn = " << dn << endl; + for (int jj = 0; jj < n; ++jj) + { + cerr << "old entry[" << jj << "] = " << vals[jj] << endl; + cerr << "new entry[" << jj << "] = " << newvals[jj] << endl; + } + cerr << "####" << endl; + } + ldif.freeListItems(vals); + for (int jj = 0; jj < n; ++jj) + delete [] newvals[jj]; + delete [] newvals; + } + + if (!ldapEntry) + continue; + + if (!dn || !*dn) + { + dsLogMessage(SETUP_LOG_WARN, "Slapd", "Entry number %d in file %s\ndoes not" + " contain a valid dn: attribute.\nThe file may be" + " corrupted or not in valid LDIF format.", + entry_num, tmp); + continue; + } + + if (entry_num == 1) + { + NSString aci = NSString( + "(targetattr = \"*\")(version 3.0; " + "acl \"SIE Group\"; allow (all)" + "groupdn = \"ldap:///") + sieDN + "\";)"; + // add the aci for the SIE group + ldapEntry->addAttribute("aci", aci); + } + + if (ldapEntry->exists(dn) == False) + { + ldapError = ldapEntry->insert(dn); + } + else + { + ldapError = ldapEntry->update(dn); + } + + if (ldapError != OKAY) + { + sprintf(tmp, "%d", ldapError.errorCode()); + dsLogMessage(SETUP_LOG_WARN, "Slapd", "Could not write entry %s (%s:%s)", dn, tmp, ldapError.msg()); + } + delete [] dn; + } while (ldif.nextEntry() != -1); +} + +// dsSIEDN will be something like: +// cn=slapd-foo, cn=NDS, cn=SS4.0, cn=FQDN, ou=admindomain, o=netscaperoot +static void +getAdminSIEDN(const char *dsSIEDN, const char *hostname, NSString& adminSIEDN) +{ + char *editablehostname = my_strdup(hostname); + char *eptr = strchr(editablehostname, '.'); + if (eptr) + *eptr = 0; + + char **rdnList = ldap_explode_dn(dsSIEDN, 0); + char *baseDN = 0; + if (rdnList && rdnList[0] && rdnList[1] && rdnList[2]) // dsSIEDN is a valid DN + { + int len = 0; + int ii; + for (ii = 2; rdnList[ii]; ++ii) + len += strlen(rdnList[ii]) + 3; + + baseDN = (char *)malloc(len+1); + baseDN[0] = 0; + for (ii = 2; rdnList[ii]; ++ii) + { + if (ii > 2) + strcat(baseDN, ", "); + strcat(baseDN, rdnList[ii]); + } + } + else + { + baseDN = my_c_strdup(dsSIEDN); + } + + if (rdnList) + ldap_value_free(rdnList); + + adminSIEDN = NSString("cn=admin-serv-") + editablehostname + + ", cn=Netscape Administration Server, " + baseDN; + + delete [] editablehostname; + free(baseDN); + + return; +} + +static void +setAppEntryInformation(LdapEntry *appEntry) +{ + // required attributes + if (!appEntry->getAttribute("objectclass")) + appEntry->addAttribute("objectclass", "nsApplication"); + appEntry->setAttribute("cn", slapdINFFileInfo->get("Name")); + appEntry->setAttribute("nsProductname", slapdINFFileInfo->get("Name")); + appEntry->setAttribute("nsProductversion", PRODUCTTEXT); + // optional attributes +/* + NSString temp = slapdINFFileInfo->get("Description"); + if ((NSString)NULL != temp) + appEntry->setAttribute("description", temp); +*/ + NSString temp = slapdINFFileInfo->get("NickName"); + if ((NSString)NULL == temp) + temp = "slapd"; + appEntry->setAttribute("nsNickName", temp); + temp = slapdINFFileInfo->get("BuildNumber"); + if ((NSString)NULL != temp) + appEntry->setAttribute("nsBuildNumber", temp); + temp = slapdINFFileInfo->get("Revision"); + if ((NSString)NULL != temp) + appEntry->setAttribute("nsRevisionNumber", temp); + temp = slapdINFFileInfo->get("SerialNumber"); + if ((NSString)NULL != temp) + appEntry->setAttribute("nsSerialNumber", temp); + temp = slapdINFFileInfo->get("Vendor"); + if ((NSString)NULL != temp) + appEntry->setAttribute("nsVendor", temp); + + if (!appEntry->getAttribute("nsInstalledLocation")) + appEntry->addAttribute("nsInstalledLocation", + installInfo->get(SLAPD_KEY_SERVER_ROOT)); + appEntry->setAttribute("installationTimeStamp", getGMT()); + temp = slapdINFFileInfo->get("Expires"); + if ((NSString)NULL != temp) + appEntry->setAttribute("nsExpirationDate", temp); + temp = slapdINFFileInfo->get("Security"); + if ((NSString)NULL != temp) + appEntry->setAttribute("nsBuildSecurity", temp); + + return; +} + +static LdapError +create_sie_and_isie(LdapEntry *sieEntry, LdapEntry *appEntry, NSString& sieDN) +{ + LdapError ldapError; // return value + + // Prepare sieEntry + sieEntry->clear(); + + sieEntry->addAttribute("objectclass", "netscapeServer"); + sieEntry->addAttribute("objectclass", "nsDirectoryServer"); + sieEntry->addAttribute("objectclass", "nsResourceRef"); + sieEntry->addAttribute("objectclass", "nsConfig"); + sieEntry->addAttribute("nsServerSecurity", "off"); + NSString serverID = NSString("slapd-") + slapdInfo->get(SLAPD_KEY_SERVER_IDENTIFIER); + sieEntry->addAttribute("nsServerID", serverID); + sieEntry->addAttribute("nsBindDN", slapdInfo->get(SLAPD_KEY_ROOTDN)); + sieEntry->addAttribute("nsBaseDN", slapdInfo->get(SLAPD_KEY_SUFFIX)); + char *hashedPwd = (char *)ds_salted_sha1_pw_enc ( + (char *)slapdInfo->get(SLAPD_KEY_ROOTDNPWD)); + if (hashedPwd) + sieEntry->addAttribute("userPassword", hashedPwd); +// sieEntry->addAttribute("AuthenticationPassword", slapdInfo->get(SLAPD_KEY_ROOTDNPWD)); + sieEntry->addAttribute("serverHostName", installInfo->get(SLAPD_KEY_FULL_MACHINE_NAME)); + sieEntry->addAttribute("serverRoot", installInfo->get(SLAPD_KEY_SERVER_ROOT)); + sieEntry->addAttribute("nsServerPort", slapdInfo->get(SLAPD_KEY_SERVER_PORT)); + sieEntry->addAttribute("nsSecureServerPort", "636"); +/* + NSString temp = slapdINFFileInfo->get("Description"); + if ((NSString)NULL != temp) + sieEntry->addAttribute("description", temp); +*/ + NSString name = NSString(slapdINFFileInfo->get("InstanceNamePrefix")) + " (" + + slapdInfo->get(SLAPD_KEY_SERVER_IDENTIFIER) + ")"; + sieEntry->addAttribute("serverProductName", name); + sieEntry->addAttribute("serverVersionNumber", slapdINFFileInfo->get("Version")); + sieEntry->addAttribute("installationTimeStamp", getGMT()); + NSString temp = installInfo->get(SLAPD_KEY_SUITESPOT_USERID); + if ((NSString)NULL != temp) // may not be present on NT . . . + sieEntry->addAttribute("nsSuiteSpotUser", temp); + + // Prepare appEntry + appEntry->clear(); + setAppEntryInformation(appEntry); + + NSString ssDN = installInfo->get(SLAPD_KEY_ADMIN_DOMAIN); + + // to make a disposable copy + char *fqdn = my_strdup(installInfo->get(SLAPD_KEY_FULL_MACHINE_NAME)); + + LdapErrorCode code = createSIE(sieEntry, appEntry, fqdn, + installInfo->get(SLAPD_KEY_SERVER_ROOT), + ssDN); + delete [] fqdn; + + if (code != OKAY) + { + dsLogMessage(SETUP_LOG_FATAL, "Slapd", + "createSIE returned error code %d for ssDN=%s machinename=%s " + "server root=%s", (int)code, (const char *)ssDN, + installInfo->get(SLAPD_KEY_FULL_MACHINE_NAME), + installInfo->get(SLAPD_KEY_SERVER_ROOT)); +#ifdef XP_UNIX + cerr << "Here is the sieEntry:" << endl; + my_printEntry(sieEntry, 0, 1); // output to cerr +#else + dsLogMessage(SETUP_LOG_FATAL, "Slapd", "SIE entry printed to c:/temp/SIE.out"); + sieEntry->printEntry("c:/temp/SIE.out"); +#endif +#ifdef XP_UNIX + cerr << "Here is the appEntry:" << endl; + my_printEntry(appEntry, 0, 1); // output to cerr +#else + dsLogMessage(SETUP_LOG_FATAL, "Slapd", "APP entry printed to c:/temp/APP.out"); + appEntry->printEntry("c:/temp/APP.out"); +#endif + return code; + } + +// dsLogMessage("Info", "Slapd", "Created configuration entry for server %s", +// (const char *)serverID); + + sieDN = sieEntry->entryDN(); + + NSString configDN, configTaskDN, opTaskDN, adminSIEDN; + getAdminSIEDN(sieDN, installInfo->get(SLAPD_KEY_FULL_MACHINE_NAME), + adminSIEDN); + + // append the adminSIE to the create and migrate class names + appEntry->clear(); + NSString classname = NSString(SERVER_MIGRATION_CLASS"@"DS_JAR_FILE_NAME"@") + + adminSIEDN; + appEntry->addAttribute("nsServerMigrationClassname", classname); + classname = NSString(SERVER_CREATION_CLASS"@"DS_JAR_FILE_NAME"@") + + adminSIEDN; + appEntry->addAttribute("nsServerCreationClassname", classname); + if ((ldapError = appEntry->update(appEntry->entryDN())) != OKAY) + { + dsLogMessage(SETUP_LOG_FATAL, "Slapd", "Error: Could not modify nsServerMigrationClassname " + "and/or nsServerCreationClassname in entry %s: error code %d\n", + appEntry->entryDN(), (int)ldapError); + return (int)ldapError; + } + + // Write configuration parameters (see ns-admin.conf) + sieEntry->clear(); + + sieEntry->addAttribute("objectclass", "nsResourceRef"); + sieEntry->addAttribute("objectclass", "nsAdminObject"); + sieEntry->addAttribute("objectclass", "nsDirectoryInfo"); + + /* + * Mandatory fields here + */ + NSString description = NSString("Configuration information for directory server ") + + serverID; + sieEntry->addAttribute ("cn", "configuration"); + NSString nsclassname = NSString(DS_CONSOLE_CLASS_NAME) + "@" + + DS_JAR_FILE_NAME + "@" + adminSIEDN; + sieEntry->addAttribute ("nsclassname", nsclassname); + sieEntry->addAttribute ("nsjarfilename", + DS_JAR_FILE_NAME); + char** rdnList = ldap_explode_dn(appEntry->entryDN(), 0); + if (rdnList) + { + int ii = 0; + int len = 0; + for (ii = 1; rdnList[ii]; ++ii) // skip first rdn + len += (strlen(rdnList[ii]) + 3); + char *adminGroupDN = (char *)calloc(1, len); + for (ii = 1; rdnList[ii]; ++ii) { + if (ii > 1) + strcat(adminGroupDN, ", "); + strcat(adminGroupDN, rdnList[ii]); + } + ldap_value_free(rdnList); + sieEntry->addAttribute("nsDirectoryInfoRef", adminGroupDN); + free(adminGroupDN); + } + + configDN = NSString("cn=configuration") + "," + sieDN; + + // allow modification by kingpin topology + createACIForConfigEntry(sieEntry, sieDN); + + if (sieEntry->exists(configDN) == False) + { + ldapError = sieEntry->insert(configDN); + } + else + { + ldapError = sieEntry->update(configDN); + } + + if (ldapError != OKAY) + { + dsLogMessage(SETUP_LOG_FATAL, "Slapd", + "Could not update the configuration entry %s: error code %d", + (const char *)configDN, ldapError.errorCode()); + return (int)ldapError; + } else { +// dsLogMessage("Info", "Slapd", "Updated configuration entry for server %s", +// (const char *)serverID); + } + + // Write Tasks nodes + installInfo->toLocal(SLAPD_KEY_SERVER_ROOT); // path needs local encoding + NSString filename = NSString(installInfo->get(SLAPD_KEY_SERVER_ROOT)) + + FILE_PATHSEP + DEFAULT_TASKCONF; + ldapError = insertLdifEntries(sieEntry->ldap(), sieDN, filename, + adminSIEDN); + installInfo->toUTF8(SLAPD_KEY_SERVER_ROOT); // back to utf8 + + if (ldapError != OKAY) + { + dsLogMessage(SETUP_LOG_FATAL, "Slapd", + "Could not update the instance specific tasks entry %s: error code %d", + (const char *)sieDN, ldapError.errorCode()); + return ldapError; + } else { +// dsLogMessage("Info", "Slapd", "Added task information for server %s", +// (const char *)serverID); + } + + installInfo->toLocal(SLAPD_KEY_SERVER_ROOT); // path needs local encoding + filename = NSString(installInfo->get(SLAPD_KEY_SERVER_ROOT)) + + FILE_PATHSEP + COMMON_TASKS; + ldapError = insertLdifEntries(sieEntry->ldap(), appEntry->entryDN(), + filename, adminSIEDN); + installInfo->toUTF8(SLAPD_KEY_SERVER_ROOT); // back to utf8 + + if (ldapError != OKAY) + { + dsLogMessage(SETUP_LOG_FATAL, "Slapd", + "Could not update the general tasks entry %s: error code %d", + (const char *)appEntry->entryDN(), ldapError.errorCode()); + } else { +// dsLogMessage("Info", "Slapd", "Updated common task information for server %s", +// (const char *)serverID); + } + + return ldapError; +} + + +static LdapErrorCode +create_roledit_extension(Ldap* ldap) +{ + // + // If needed, we create "ou=Global Preferences,ou=,o=NetscapeRoot". + // The following code has been duplicated from setupGlobalPreferences() in + // setupldap.cpp + // + LdapEntry ldapEntry(ldap); + LdapError err; + NSString globalPref = DEFAULT_GLOBAL_PREFS_RDN; + NSString adminDomain = installInfo->get(SLAPD_KEY_ADMIN_DOMAIN); + char * domain = setupFormAdminDomainDN(adminDomain); + + globalPref = globalPref + LDAP_PATHSEP + domain; + +// dsLogMessage("Info", "Slapd", "Beginning update console role editor extensions"); + if (ldapEntry.retrieve(globalPref) != OKAY) + { + ldapEntry.setAttribute("objectclass", DEFAULT_GLOBAL_PREFS_OBJECT); + ldapEntry.setAttribute("ou", DEFAULT_GLOBAL_PREFS); + ldapEntry.setAttribute("aci", DEFAULT_GLOBAL_PREFS_ACI); + ldapEntry.setAttribute("description", "Default branch for Netscape Server Products Global Preferences"); +// dsLogMessage("Info", "Slapd", "Updating global preferences for console role editor extensions"); + err = ldapEntry.insert(globalPref); + } + else + { + ldapEntry.setAttribute("aci", DEFAULT_GLOBAL_PREFS_ACI); + ldapEntry.setAttribute("description", "Default branch for Netscape Server Products Global Preferences"); +// dsLogMessage("Info", "Slapd", "Updating global preferences for console role editor extensions"); + err = ldapEntry.replace(globalPref); + } + + if (err == OKAY) { +// dsLogMessage("Info", "Slapd", "Updated global console preferences for role editor extensions"); + } + + // + // Now let try to add the AdminResourceExtension entries. + // They are defined in the LDIF file named ROLEDIT_EXTENSION. + // + if (err == OKAY) + { +// dsLogMessage("Info", "Slapd", "Updating console role editor extensions"); + + installInfo->toLocal(SLAPD_KEY_SERVER_ROOT); // path needs local encoding + NSString filename = NSString(installInfo->get(SLAPD_KEY_SERVER_ROOT)) + + FILE_PATHSEP + ROLEDIT_EXTENSION; + err = insertLdifEntries(ldap, domain, filename, NULL); + installInfo->toUTF8(SLAPD_KEY_SERVER_ROOT); // back to utf8 + } + + if(domain) free(domain); + + if (err.errorCode() == OKAY) { +// dsLogMessage("Info", "Slapd", "Updated console role editor extensions"); + } + + return err.errorCode(); +} + + +static int +create_ss_dir_tree(const char *hostname, NSString &sieDN) +{ + int status = 0; + + LdapError ldapError = OKAY; + NSString adminID = installInfo->get(SLAPD_KEY_SERVER_ADMIN_ID); + NSString adminPwd = installInfo->get(SLAPD_KEY_SERVER_ADMIN_PWD); + Ldap ldap (ldapError, installInfo->get(SLAPD_KEY_K_LDAP_URL), + adminID, adminPwd, 0, 0); + + if (ldapError != OKAY) + { + dsLogMessage(SETUP_LOG_FATAL, "Slapd", + "ERROR: Ldap authentication failed for url %s user id %s (%d:%s)" , + installInfo->get(SLAPD_KEY_K_LDAP_URL), adminID.data(), + ldapError.errorCode(), ldapError.msg()); + return ldapError.errorCode(); + } + + LdapEntry *sieEntry = new LdapEntry(&ldap); + LdapEntry *appEntry = new LdapEntry(&ldap); + + LdapErrorCode code = create_sie_and_isie(sieEntry, appEntry, sieDN); + + if (code != OKAY) + { + dsLogMessage(SETUP_LOG_FATAL, "Slapd", + "ERROR: failed to register Directory server as a Netscape server (%d)", + code); + return code; + } + + code = create_roledit_extension(&ldap); + + if (code != OKAY) + { + dsLogMessage(SETUP_LOG_WARN, "Slapd", + "WARNING: failed to add extensions for role edition (%d)", + code); + code = OKAY; // We can continue anyway + } + + const char *user_ldap_url = installInfo->get(SLAPD_KEY_USER_GROUP_LDAP_URL); + if (!user_ldap_url) + user_ldap_url = installInfo->get(SLAPD_KEY_K_LDAP_URL); + + code = addGlobalUserDirectory(&ldap, + installInfo->get(SLAPD_KEY_ADMIN_DOMAIN), + user_ldap_url, 0, 0); + + if (code != OKAY) + { + dsLogMessage(SETUP_LOG_FATAL, "Slapd", + "ERROR: failed to add Global User Directory (%d)", + code); + return code; + } + + // we need to add some ACIs which will allow the SIE group to have + // admin access to the newly created directory + Ldap *new_ldap = 0; + int port = atoi(slapdInfo->get(SLAPD_KEY_SERVER_PORT)); + if (strcasecmp(ldap.host(), hostname) || ldap.port() != port) + { + const char *suffix = 0; + if (featureIsEnabled(slapdInfo->get(SLAPD_KEY_USE_EXISTING_UG))) + suffix = DEFAULT_ROOT_DN; + else + suffix = slapdInfo->get(SLAPD_KEY_SUFFIX); + NSString new_url = NSString("ldap://") + + hostname + ":" + slapdInfo->get(SLAPD_KEY_SERVER_PORT) + + "/" + suffix; + const char *userDN; + const char *userPwd; + if (!(userDN = slapdInfo->get(SLAPD_KEY_ROOTDN))) + userDN = ldap.userDN(); + if (!(userPwd = slapdInfo->get(SLAPD_KEY_ROOTDNPWD))) + userPwd = ldap.userPassword(); + new_ldap = new Ldap(ldapError, new_url, userDN, userPwd, + userDN, userPwd); + if (ldapError != OKAY) + { + dsLogMessage(SETUP_LOG_WARN, "Slapd", + "Could not open the new directory server [%s:%s] to add an aci [%d].", + (const char *)new_url, userDN, ldapError.errorCode()); + delete new_ldap; + new_ldap = 0; + } + } + else + new_ldap = &ldap; + + if (new_ldap) + { + const char *entry = 0; + const char *access = 0; + LdapEntry ent(new_ldap); + int ii = 0; + while (getEntryAndAccess(ii, &entry, &access)) + { + ++ii; + NSString aci = NSString( + "(targetattr = \"*\")(version 3.0; " + "acl \"SIE Group\"; allow (") + access + ")" + "groupdn = \"ldap:///" + sieDN + "\";)"; + ent.clear(); + ent.addAttribute("aci", aci); + ldapError = ent.update(entry); + if (ldapError != OKAY) + dsLogMessage(SETUP_LOG_WARN, "Slapd", + "Could not add aci %s to entry %s [%d].", + (const char *)aci, entry, ldapError.errorCode()); + } + } + + if (new_ldap && new_ldap != &ldap) + delete new_ldap; + + destroyLdapEntry(sieEntry); + destroyLdapEntry(appEntry); + + if (status == OKAY) { +// dsLogMessage("Info", "Slapd", "Updated console administration access controls"); + } + + return status; +} + +static void +create_console_script() +{ +#if 0 // does not work right now +#ifdef XP_UNIX + const char *sroot = installInfo->get(SLAPD_KEY_SERVER_ROOT); + const char *sid = slapdInfo->get(SLAPD_KEY_SERVER_IDENTIFIER); + const char *hn = installInfo->get(SLAPD_KEY_FULL_MACHINE_NAME); + const char *port = slapdInfo->get(SLAPD_KEY_SERVER_PORT); + const char *suf = slapdInfo->get(SLAPD_KEY_SUFFIX); + const char *classpathSeparator = ":"; + + NSString scriptFilename = NSString(sroot) + FILE_PATHSEP + "slapd-" + + sid + FILE_PATHSEP + SCRIPT_FILE_NAME; + ofstream ofs(scriptFilename); + if (!ofs) + return; + + ofs << "#!/bin/sh" << endl; + ofs << "#" << endl; + ofs << "# This script will invoke the Netscape Console" << endl; + ofs << "#" << endl; + // see if there are any other .jar or .zip files in the java directory + // and add them to our class path too + ofs << "for file in " << sroot << FILE_PATHSEP << JAVA_DIR << FILE_PATHSEP + << JARS_DIR << FILE_PATHSEP << "*.jar ; do" << endl; + ofs << "\tCLASSPATH=${CLASSPATH}" << classpathSeparator << "$file" << endl; + ofs << "done" << endl; + + ofs << "for file in " << sroot << FILE_PATHSEP << JAVA_DIR << FILE_PATHSEP + << "*.jar ; do" << endl; + ofs << "\tCLASSPATH=${CLASSPATH}" << classpathSeparator << "$file" << endl; + ofs << "done" << endl; + + ofs << "for file in " << sroot << FILE_PATHSEP << JAVA_DIR << FILE_PATHSEP + << "*.zip ; do" << endl; + ofs << "\tCLASSPATH=${CLASSPATH}" << classpathSeparator << "$file" << endl; + ofs << "done" << endl; + + ofs << "export CLASSPATH" << endl; + + // go to the java dir + ofs << "cd " << sroot << FILE_PATHSEP << JAVA_DIR << endl; + // now, invoke the java runtime environment + ofs << sroot << FILE_PATHSEP << JAVA_RUNTIME + << " -classpath \"$CLASSPATH\" " + << CONSOLE_CLASS_NAME << " -d " << hn << " -p " << port << " -b " + << "\"" << suf << "\"" << endl; + + ofs.flush(); + ofs.close(); + + chmod(scriptFilename, 0755); +#endif +#endif // if 0 + + return; +} + +// check the install info read in to see if we have valid data +static int +info_is_valid() +{ + static const char *requiredFields[] = { + SLAPD_KEY_FULL_MACHINE_NAME, + SLAPD_KEY_SERVER_ROOT, + SLAPD_KEY_SERVER_IDENTIFIER, + SLAPD_KEY_SERVER_PORT, + SLAPD_KEY_ROOTDN, + SLAPD_KEY_ROOTDNPWD, + SLAPD_KEY_K_LDAP_URL, + SLAPD_KEY_SUFFIX, + SLAPD_KEY_SERVER_ADMIN_ID, + SLAPD_KEY_SERVER_ADMIN_PWD, + SLAPD_KEY_ADMIN_DOMAIN + }; + static int numRequiredFields = sizeof(requiredFields) / sizeof(requiredFields[0]); + + if (!installInfo || !slapdInfo) + return 0; + + for (int ii = 0; ii < numRequiredFields; ++ii) + { + const char *val = installInfo->get(requiredFields[ii]); + if (val && *val) + continue; + val = slapdInfo->get(requiredFields[ii]); + if (val && *val) + continue; + + // if we got here, the value was not found in either the install info or + // the slapd info + dsLogMessage(SETUP_LOG_FATAL, "Slapd", + "The required field %s is not present in the install info file.", + requiredFields[ii]); + return 0; + } + + return 1; +} + +static int +parse_commandline(int argc, char *argv[]) +{ + int opt; + + while ((opt = getopt(argc, argv, "rsSl:f:")) != EOF) + { + switch (opt) + { + case 'r': + reconfig = 1; + break; + case 's': + installMode = Silent; + break; + case 'S': + /* + * Solaris 9+ specific installation + */ + iDSISolaris = 1; + break; + case 'l': + initMessageLog(optarg); /* Log file to use */ + break; + case 'f': + infoFile = strdup(optarg); /* Install script */ + installInfo = new InstallInfo(infoFile); + installInfo->toUTF8(); + break; + default: + break; + } + } + + return 0; +} + +static const char * +changeYesNo2_0_1(const char *old) +{ + if (old && !strncasecmp(old, "yes", strlen(old))) + return "1"; + + return "0"; +} + +static void +init_from_config(server_config_s *cf) +{ + if (!cf) + return; + + if (!installInfo) + installInfo = new InstallInfo; + + if (!slapdInfo) + slapdInfo = new InstallInfo; + +#ifdef XP_WIN32 + ds_unixtodospath( cf->sroot); +#endif + + installInfo->set(SLAPD_KEY_SERVER_ROOT, cf->sroot); + installInfo->set(SLAPD_KEY_FULL_MACHINE_NAME, cf->servname); + + slapdInfo->set(SLAPD_KEY_SERVER_PORT, cf->servport); + installInfo->set(SLAPD_KEY_SERVER_ADMIN_ID, cf->cfg_sspt_uid); + installInfo->set(SLAPD_KEY_SERVER_ADMIN_PWD, cf->cfg_sspt_uidpw); + slapdInfo->set(SLAPD_KEY_SERVER_IDENTIFIER, cf->servid); + +#ifdef XP_UNIX + installInfo->set(SLAPD_KEY_SUITESPOT_USERID, cf->servuser); +#endif + + slapdInfo->set(SLAPD_KEY_SUFFIX, cf->suffix); + slapdInfo->set(SLAPD_KEY_ROOTDN, cf->rootdn); + slapdInfo->set(SLAPD_KEY_ROOTDNPWD, cf->rootpw); + + installInfo->set(SLAPD_KEY_ADMIN_DOMAIN, cf->admin_domain); + LDAPURLDesc *desc = 0; + if (cf->config_ldap_url && + !ldap_url_parse(cf->config_ldap_url, &desc) && desc) + { + const char *suffix = DEFAULT_ROOT_DN; + int isSSL = !strncmp(cf->config_ldap_url, "ldaps:", strlen("ldaps:")); + char port[6]; + sprintf(port, "%d", desc->lud_port); + NSString url = NSString("ldap") + + (isSSL ? "s" : "") + + "://" + desc->lud_host + + ":" + port + "/" + suffix; + installInfo->set(SLAPD_KEY_K_LDAP_URL, url); + ldap_free_urldesc(desc); + } + + if (cf->suitespot3x_uid) + slapdInfo->set(SLAPD_KEY_CONFIG_ADMIN_DN, cf->suitespot3x_uid); + else + slapdInfo->set(SLAPD_KEY_CONFIG_ADMIN_DN, cf->cfg_sspt_uid); + + /* + If we are here, that means we have been called as a CGI, which + means that there must already be an MC host, which means that + we are not creating an MC host, which means we must be creating + a UG host + */ + NSString UGLDAPURL = NSString("ldap://") + cf->servname + + ":" + cf->servport + "/" + cf->suffix; + installInfo->set(SLAPD_KEY_USER_GROUP_LDAP_URL, UGLDAPURL); + installInfo->set(SLAPD_KEY_USER_GROUP_ADMIN_ID, cf->rootdn); + installInfo->set(SLAPD_KEY_USER_GROUP_ADMIN_PWD, cf->rootpw); + + installInfo->addSection("slapd", slapdInfo); + + return; +} + +/* ----------------------- main ------------------------ */ + +/* + Initialize the cf structure based on data in the inf file, and also initialize + our static objects. Return 0 if everything was OK, and non-zero if there + were errors, like parsing a bogus inf file +*/ +extern "C" int create_config_from_inf( + server_config_s *cf, + int argc, + char *argv[] +) +{ + InstallInfo *admInfo; + if (parse_commandline(argc, argv)) + return 1; + + admInfo = installInfo->getSection("admin"); + slapdInfo = installInfo->getSection("slapd"); + if (!slapdInfo->get(SLAPD_KEY_SUFFIX)) + slapdInfo->set(SLAPD_KEY_SUFFIX, DEFAULT_ROOT_DN); + + if (installInfo->get(SLAPD_KEY_SERVER_ADMIN_ID)) + slapdInfo->set(SLAPD_KEY_CONFIG_ADMIN_DN, + installInfo->get(SLAPD_KEY_SERVER_ADMIN_ID)); + + if (!info_is_valid()) + return 1; + + normalizeDNs(); + + installInfo->toLocal(SLAPD_KEY_SERVER_ROOT); + cf->sroot = my_c_strdup(installInfo->get(SLAPD_KEY_SERVER_ROOT)); + installInfo->toUTF8(SLAPD_KEY_SERVER_ROOT); + cf->servname = my_c_strdup(installInfo->get(SLAPD_KEY_FULL_MACHINE_NAME)); + + cf->servport = my_c_strdup(slapdInfo->get(SLAPD_KEY_SERVER_PORT)); + + if (admInfo && admInfo->get(SLAPD_KEY_ADMIN_SERVER_PORT)) { + cf->adminport = my_c_strdup(admInfo->get(SLAPD_KEY_ADMIN_SERVER_PORT)); + } else { + cf->adminport = my_c_strdup("80"); + } + + cf->cfg_sspt = my_c_strdup( + changeYesNo2_0_1(slapdInfo->get(SLAPD_KEY_SLAPD_CONFIG_FOR_MC))); + cf->suitespot3x_uid = my_c_strdup(installInfo->get(SLAPD_KEY_SERVER_ADMIN_ID)); + cf->cfg_sspt_uid = my_c_strdup(installInfo->get(SLAPD_KEY_SERVER_ADMIN_ID)); + cf->cfg_sspt_uidpw = my_c_strdup(installInfo->get(SLAPD_KEY_SERVER_ADMIN_PWD)); + cf->servid = my_c_strdup(slapdInfo->get(SLAPD_KEY_SERVER_IDENTIFIER)); + +#ifdef XP_UNIX + cf->servuser = my_c_strdup(installInfo->get(SLAPD_KEY_SUITESPOT_USERID)); +#endif + + cf->suffix = my_c_strdup(slapdInfo->get(SLAPD_KEY_SUFFIX)); + cf->rootdn = my_c_strdup(slapdInfo->get(SLAPD_KEY_ROOTDN)); + /* Encode the password in SSHA by default */ + cf->rootpw = my_c_strdup(slapdInfo->get(SLAPD_KEY_ROOTDNPWD)); + cf->roothashedpw = (char *)ds_salted_sha1_pw_enc (cf->rootpw); + + const char *test = slapdInfo->get(SLAPD_KEY_REPLICATIONDN); + const char *testpw = slapdInfo->get(SLAPD_KEY_REPLICATIONPWD); + if (test && *test && testpw && *testpw) + { + cf->replicationdn = my_c_strdup(slapdInfo->get(SLAPD_KEY_REPLICATIONDN)); + cf->replicationpw = my_c_strdup(slapdInfo->get(SLAPD_KEY_REPLICATIONPWD)); + cf->replicationhashedpw = (char *)ds_salted_sha1_pw_enc (cf->replicationpw); + } + + test = slapdInfo->get(SLAPD_KEY_CONSUMERDN); + testpw = slapdInfo->get(SLAPD_KEY_CONSUMERPWD); + if (test && *test && testpw && *testpw) + { + cf->consumerdn = my_c_strdup(test); + cf->consumerpw = my_c_strdup(testpw); + cf->consumerhashedpw = (char *)ds_salted_sha1_pw_enc (cf->consumerpw); + } + + cf->changelogdir = my_c_strdup(slapdInfo->get(SLAPD_KEY_CHANGELOGDIR)); + cf->changelogsuffix = my_c_strdup(slapdInfo->get(SLAPD_KEY_CHANGELOGSUFFIX)); + cf->admin_domain = my_c_strdup(installInfo->get(SLAPD_KEY_ADMIN_DOMAIN)); + cf->disable_schema_checking = + my_c_strdup( + changeYesNo2_0_1(slapdInfo->get(SLAPD_KEY_DISABLE_SCHEMA_CHECKING))); + + /* + Don't create dc=example,dc=com if the user did not select to add the + sample entries + */ + if (!featureIsEnabled(slapdInfo->get(SLAPD_KEY_ADD_SAMPLE_ENTRIES))) + { + cf->samplesuffix = NULL; + } + + cf->config_ldap_url = (char *)installInfo->get(SLAPD_KEY_K_LDAP_URL); + LDAPURLDesc *desc = 0; + if (cf->config_ldap_url && + !ldap_url_parse(cf->config_ldap_url, &desc) && desc) + { + const char *suffix = DEFAULT_ROOT_DN; + int isSSL = !strncmp(cf->config_ldap_url, "ldaps:", strlen("ldaps:")); + char port[6]; + sprintf(port, "%d", desc->lud_port); + NSString url = NSString("ldap") + + (isSSL ? "s" : "") + + "://" + desc->lud_host + + ":" + port + "/" + suffix; + installInfo->set(SLAPD_KEY_K_LDAP_URL, url); + cf->config_ldap_url = my_c_strdup(url); + ldap_free_urldesc(desc); + } + + if (test = installInfo->get(SLAPD_KEY_USER_GROUP_LDAP_URL)) + cf->user_ldap_url = my_c_strdup(test); + else + cf->user_ldap_url = my_c_strdup(cf->config_ldap_url); + + cf->use_existing_config_ds = + featureIsEnabled(slapdInfo->get(SLAPD_KEY_USE_EXISTING_MC)); + + cf->use_existing_user_ds = + featureIsEnabled(slapdInfo->get(SLAPD_KEY_USE_EXISTING_UG)); + + if ((test = slapdInfo->get(SLAPD_KEY_INSTALL_LDIF_FILE)) && + !access(test, 0)) + { + cf->install_ldif_file = my_c_strdup(test); + // remove the fields from the slapdInfo so we don't try + // to handle this case later + slapdInfo->remove(SLAPD_KEY_ADD_ORG_ENTRIES); + slapdInfo->remove(SLAPD_KEY_INSTALL_LDIF_FILE); + } + + /* we also have to setup the environment to mimic a CGI */ + static char netsiteRoot[PATH_MAX+32]; + PR_snprintf(netsiteRoot, PATH_MAX+32, "NETSITE_ROOT=%s", cf->sroot); + putenv(netsiteRoot); + + /* set the admin SERVER_NAMES = slapd-slapdIdentifier */ + static char serverNames[PATH_MAX+32]; + PR_snprintf(serverNames, PATH_MAX+32, "SERVER_NAMES=slapd-%s", cf->servid); + putenv(serverNames); + + /* get and set the log file */ + /* use the one given on the command line by default, otherwise, use + the one from the inf file */ + if (logFile || (test = slapdInfo->get(SLAPD_INSTALL_LOG_FILE_NAME))) + { + static char s_logfile[PATH_MAX+32]; + if (logFile) + { + PR_snprintf(s_logfile, PATH_MAX+32, "DEBUG_LOGFILE=%s", logFile); + } + else + { + PR_snprintf(s_logfile, PATH_MAX+32, "DEBUG_LOGFILE=%s", test); + /* also init the C++ api message log */ + initMessageLog(test); + } + putenv(s_logfile); + } + + return 0; +} + +extern "C" int +configure_instance_with_config( + server_config_s *cf, + int verbose, // if false, silent; if true, verbose + const char *lfile +) +{ + if (!cf) + return 1; + + infoFile = 0; + initMessageLog(lfile); + + if (!verbose) + installMode = Silent; + + init_from_config(cf); + + return configure_instance(); +} + +extern "C" int +configure_instance() +{ + char hn[BUFSIZ]; + int status = 0; + + dsLogMessage(SETUP_LOG_START, "Slapd", "Starting Slapd server configuration."); + + if (!info_is_valid()) + { + dsLogMessage(SETUP_LOG_FATAL, "Slapd", "Missing Configuration Parameters."); + return 1; + } + + if (installInfo == NULL || slapdInfo == NULL) + { + dsLogMessage(SETUP_LOG_FATAL, "Slapd", "Answer cache not found or invalid"); + return 1; + } + + adminInfo = installInfo->getSection("admin"); + + // next, find the slapd.inf file; it is in the dir /setup/slapd + installInfo->toLocal(SLAPD_KEY_SERVER_ROOT); // path needs local encoding + NSString slapdinffile = NSString(installInfo->get(SLAPD_KEY_SERVER_ROOT)) + + FILE_PATHSEP + "setup" + FILE_PATHSEP + "slapd" + FILE_PATHSEP + + "slapd.inf"; + InstallInfo temp(slapdinffile); + if (!(slapdINFFileInfo = temp.getSection("slapd")) || + slapdINFFileInfo->isEmpty()) + { + dsLogMessage(SETUP_LOG_FATAL, "Slapd", "Missing configuration file %s", + (const char *)slapdinffile); + return 1; + } + installInfo->toUTF8(SLAPD_KEY_SERVER_ROOT); // back to utf8 + + hn[0] = '\0'; + + /* + * Get the full hostname. + */ + + if (!installInfo->get(SLAPD_KEY_FULL_MACHINE_NAME)) + { + NSString h; + /* Force automatic detection of host name */ +#ifdef XP_UNIX + h = InstUtil::guessHostname(); +#else + /* stevross: figure out NT equivalent */ +#endif + strcpy(hn, h); + installInfo->set(SLAPD_KEY_FULL_MACHINE_NAME, hn); + } + else + { + strcpy(hn,installInfo->get(SLAPD_KEY_FULL_MACHINE_NAME)); + } + + NSString sieDN; + if (status = create_ss_dir_tree(hn, sieDN)) + { + dsLogMessage(SETUP_LOG_FATAL, "Slapd", + "Did not add Directory Server information to Configuration Server."); + return status; + } + else + dsLogMessage(SETUP_LOG_SUCCESS, "Slapd", + "Added Directory Server information to Configuration Server."); + + // at this point we should be finished talking to the Mission Control LDAP + // server; we may need to establish a connection to the new instance + // we just created in order to write some of this optional stuff to it + + Ldap *ldap = 0; + LdapEntry *entry = 0; + LdapError ldapError = 0; + NSString newURL = NSString("ldap://") + hn + ":" + + slapdInfo->get(SLAPD_KEY_SERVER_PORT) + "/" + + slapdInfo->get(SLAPD_KEY_SUFFIX); + const char *bindDN = slapdInfo->get(SLAPD_KEY_ROOTDN); + const char *bindPwd = slapdInfo->get(SLAPD_KEY_ROOTDNPWD); + // install a sample tree + if (featureIsEnabled(slapdInfo->get(SLAPD_KEY_ADD_SAMPLE_ENTRIES))) + { + if (!ldap) + { + ldapError = 0; + ldap = new Ldap (ldapError, newURL, bindDN, bindPwd, 0, 0); + if (ldapError.errorCode()) + { + delete ldap; + ldap = 0; + dsLogMessage(SETUP_LOG_WARN, "Slapd", + "Could not add sample entries, ldap error code %d", + ldapError.errorCode()); + } + else + { + entry = new LdapEntry(ldap); + } + } + + if (entry) + { + installInfo->toLocal(SLAPD_KEY_SERVER_ROOT); // path needs local + ldapError = add_sample_entries(installInfo->get(SLAPD_KEY_SERVER_ROOT), + entry); + installInfo->toUTF8(SLAPD_KEY_SERVER_ROOT); // back to utf8 + if (ldapError.errorCode()) + { + delete ldap; + ldap = 0; + dsLogMessage(SETUP_LOG_WARN, "Slapd", + "Could not add sample entries, ldap error code %d", + ldapError.errorCode()); + destroyLdapEntry(entry); + entry = 0; + } + } + } + + // create some default organizational entries based on org size, but only + // if we're creating the User Directory + if (!featureIsEnabled(slapdInfo->get(SLAPD_KEY_USE_EXISTING_UG)) && + featureIsEnabled(slapdInfo->get(SLAPD_KEY_ADD_ORG_ENTRIES))) + { + if (!ldap) + { + ldapError = 0; + ldap = new Ldap (ldapError, newURL, bindDN, bindPwd, 0, 0); + if (ldapError.errorCode()) + { + delete ldap; + ldap = 0; + dsLogMessage(SETUP_LOG_WARN, "Slapd", + "Could not populate with ldif file %s error code %d", + slapdInfo->get(SLAPD_KEY_ADD_ORG_ENTRIES), + ldapError.errorCode()); + } + else + { + entry = new LdapEntry(ldap); + } + } + + if (!isAValidDN(slapdInfo->get(SLAPD_KEY_CONFIG_ADMIN_DN))) + { + // its a uid + NSString adminDN = NSString("uid=") + + slapdInfo->get(SLAPD_KEY_CONFIG_ADMIN_DN) + + ", ou=Administrators, ou=TopologyManagement, " + + DEFAULT_ROOT_DN; + slapdInfo->set(SLAPD_KEY_CONFIG_ADMIN_DN, adminDN); + } + + if (entry) + { + installInfo->toLocal(SLAPD_KEY_SERVER_ROOT); // path needs local + add_org_entries(installInfo->get(SLAPD_KEY_SERVER_ROOT), entry, + slapdInfo->get(SLAPD_KEY_INSTALL_LDIF_FILE), + slapdInfo->get(SLAPD_KEY_ORG_SIZE), sieDN); + installInfo->toUTF8(SLAPD_KEY_SERVER_ROOT); // back to utf8 + } + } + + if (ldap) + delete ldap; + if (entry) + destroyLdapEntry(entry); + + // create executable shell script to run the console + create_console_script(); + + return status; +} + +extern "C" int +reconfigure_instance(int argc, char *argv[]) +{ + char hn[BUFSIZ]; + int status = 0; + + dsLogMessage(SETUP_LOG_START, "Slapd", "Starting Slapd server reconfiguration."); + + if (parse_commandline(argc, argv)) + return 1; + + if (installInfo == NULL) + { + dsLogMessage(SETUP_LOG_FATAL, "Slapd", "Answer cache not found or invalid"); + return 1; + } + + // next, find the slapd.inf file; it is in the dir /setup/slapd + installInfo->toLocal(SLAPD_KEY_SERVER_ROOT); // path needs local + NSString slapdinffile = NSString(installInfo->get(SLAPD_KEY_SERVER_ROOT)) + + FILE_PATHSEP + "setup" + FILE_PATHSEP + "slapd" + FILE_PATHSEP + + "slapd.inf"; + InstallInfo temp(slapdinffile); + if (!(slapdINFFileInfo = temp.getSection("slapd")) || + slapdINFFileInfo->isEmpty()) + { + dsLogMessage(SETUP_LOG_FATAL, "Slapd", "Missing configuration file %s", + (const char *)slapdinffile); + return 1; + } + installInfo->toUTF8(SLAPD_KEY_SERVER_ROOT); // path needs local + + hn[0] = '\0'; + + /* + * Get the full hostname. + */ + + if (!installInfo->get(SLAPD_KEY_FULL_MACHINE_NAME)) + { + NSString h; + /* Force automatic detection of host name */ +#ifdef XP_UNIX + h = InstUtil::guessHostname(); +#else + /* stevross: figure out NT equivalent */ +#endif + strcpy(hn, h); + installInfo->set(SLAPD_KEY_FULL_MACHINE_NAME, hn); + } + else + { + strcpy(hn,installInfo->get(SLAPD_KEY_FULL_MACHINE_NAME)); + } + + // search for the app entry for the DS installation we just replaced + // open an LDAP connection to the Config Directory + LdapError le; + Ldap ldap(le, + installInfo->get(SLAPD_KEY_K_LDAP_URL), + installInfo->get(SLAPD_KEY_SERVER_ADMIN_ID), + installInfo->get(SLAPD_KEY_SERVER_ADMIN_PWD)); + if (le != OKAY) + { + dsLogMessage(SETUP_LOG_FATAL, "Slapd", + "ERROR: Ldap authentication failed for url %s user id %s (%d:%s)", + installInfo->get(SLAPD_KEY_K_LDAP_URL), + installInfo->get(SLAPD_KEY_SERVER_ADMIN_ID), + le.errorCode(), le.msg()); + return le.errorCode(); + } + + // construct the base of the search + NSString baseDN = NSString("cn=") + hn + ", ou=" + + installInfo->get(SLAPD_KEY_ADMIN_DOMAIN) + ", " + + DEFAULT_ROOT_DN; + + // find the nsApplication entry corresponding to the slapd installation + // in the given server root +#ifdef XP_WIN32 + + char *pszServerRoot = my_strdup(installInfo->get(SLAPD_KEY_SERVER_ROOT)); + char *pszEscapedServerRoot = (char *)malloc(2*strlen(installInfo->get(SLAPD_KEY_SERVER_ROOT)) ); + char *p,*q; + + for(p=pszServerRoot,q=pszEscapedServerRoot; p && *p; p++) + { + *q = *p; + if(*p == '\\') + { + q++; + *q='\\'; + } + q++; + } + /* null terminate it */ + *q= *p; + + + NSString filter = + NSString("(&(objectclass=nsApplication)") + + "(nsnickname=slapd)(nsinstalledlocation=" + + pszEscapedServerRoot + "))"; + + if(pszServerRoot) + { + free(pszServerRoot); + } + + if(pszEscapedServerRoot) + { + free(pszEscapedServerRoot); + } +#else + NSString filter = + NSString("(&(objectclass=nsApplication)") + + "(nsnickname=slapd)(nsinstalledlocation=" + + installInfo->get(SLAPD_KEY_SERVER_ROOT) + "))"; +#endif + + int scope = LDAP_SCOPE_SUBTREE; + + LdapEntry ldapent(&ldap); + le = ldapent.retrieve(filter, scope, baseDN); + if (le != OKAY) + { + dsLogMessage(SETUP_LOG_FATAL, "Slapd", + "ERROR: Could not find Directory Server Configuration\n" + "URL %s user id %s DN %s (%d:%s)" , + installInfo->get(SLAPD_KEY_K_LDAP_URL), + installInfo->get(SLAPD_KEY_SERVER_ADMIN_ID), + (const char *)baseDN, + le.errorCode(), le.msg()); + return le.errorCode(); + } + + setAppEntryInformation(&ldapent); + + le = ldapent.replace(ldapent.entryDN()); + if (le != OKAY) + { + dsLogMessage(SETUP_LOG_FATAL, "Slapd", + "ERROR: Could not update Directory Server Configuration\n" + "URL %s user id %s DN %s (%d:%s)" , + installInfo->get(SLAPD_KEY_K_LDAP_URL), + installInfo->get(SLAPD_KEY_SERVER_ADMIN_ID), + (const char *)baseDN, + le.errorCode(), le.msg()); + return le.errorCode(); + } + + // now update the values in the SIEs under the ISIE + filter = NSString("(objectclass=nsDirectoryServer)"); + scope = LDAP_SCOPE_ONELEVEL; + baseDN = NSString(ldapent.entryDN()); + + ldapent.clear(); + le = ldapent.retrieve(filter, scope, baseDN); + if (le != OKAY) + { + dsLogMessage(SETUP_LOG_FATAL, "Slapd", + "ERROR: Could not find Directory Server Instances\n" + "URL %s user id %s DN %s (%d:%s)", + installInfo->get(SLAPD_KEY_K_LDAP_URL), + installInfo->get(SLAPD_KEY_SERVER_ADMIN_ID), + (const char *)baseDN, + le.errorCode(), le.msg()); + return le.errorCode(); + } + + // ldapent holds the search results, but ldapent.replace will wipe out that + // information; so, create a new entry to actually do the replace operation + // while we use the original ldapent to iterate the search results + + do + { + LdapEntry repEntry(ldapent.ldap()); + repEntry.retrieve(ldapent.entryDN()); + repEntry.setAttribute("serverVersionNumber", slapdINFFileInfo->get("Version")); + repEntry.setAttribute("installationTimeStamp", getGMT()); + + le = repEntry.replace(repEntry.entryDN()); + if (le != OKAY) + { + dsLogMessage(SETUP_LOG_FATAL, "Slapd", + "ERROR: Could not update Directory Server Instance\n" + "URL %s user id %s DN %s (%d:%s)" , + installInfo->get(SLAPD_KEY_K_LDAP_URL), + installInfo->get(SLAPD_KEY_SERVER_ADMIN_ID), + (const char *)repEntry.entryDN(), + le.errorCode(), le.msg()); + return le.errorCode(); + } + } + while (ldapent.next() == OKAY); + + // we have a new jar file dsXX.jar so we need to update all + // references to the old jar file name + filter = NSString("(|(nsclassname=*)(nsjarfilename=*)" + "(nsservermigrationclassname=*)" + "(nsservercreationclassname=*))"); + scope = LDAP_SCOPE_SUBTREE; + + ldapent.clear(); + le = ldapent.retrieve(filter, scope, baseDN); + if (le != OKAY) + { + dsLogMessage(SETUP_LOG_FATAL, "Slapd", + "ERROR: Could not find Directory Server Instances\n" + "URL %s user id %s DN %s (%d:%s)", + installInfo->get(SLAPD_KEY_K_LDAP_URL), + installInfo->get(SLAPD_KEY_SERVER_ADMIN_ID), + (const char *)baseDN, + le.errorCode(), le.msg()); + return le.errorCode(); + } + + do + { + LdapEntry repEntry(ldapent.ldap()); + repEntry.retrieve(ldapent.entryDN()); + + const char *replace[] = { + "nsclassname", + "nsservermigrationclassname", + "nsservercreationclassname" + }; + const int replaceSize = sizeof(replace)/sizeof(replace[0]); + + if (repEntry.getAttribute("nsjarfilename")) + { + repEntry.setAttribute("nsjarfilename", DS_JAR_FILE_NAME); + } + + for (int ii = 0; ii < replaceSize; ++ii) + { + char *val = repEntry.getAttribute(replace[ii]); + // the class name is of the form + // full class path and name[@jar file[@admin SIE]] + // so here's what we'll do: + // search for the first @ in the string; if there's not one, just + // skip it + // save the full class path and name to a temp var + // create the new classname by appending @new jar file to the full class + // name + // if there is a second @ in the original string, grab the rest of the + // original string after the second @ and append @string to the new + // classname + + const char *ptr = 0; + if (val && *val && (ptr = strstr(val, "@"))) + { + int len = int(ptr - val); + NSString newClass = NSString(val, len) + "@" + + DS_JAR_FILE_NAME; + ++ptr; + if (*ptr && (ptr = strstr(ptr, "@"))) { + newClass = NSString(val, len) + "@" + + DS_JAR_FILE_NAME + ptr; + } + repEntry.setAttribute(replace[ii], newClass); + } + } + + le = repEntry.replace(repEntry.entryDN()); + if (le != OKAY) + { + dsLogMessage(SETUP_LOG_FATAL, "Slapd", + "ERROR: Could not update Directory Server Instance\n" + "URL %s user id %s DN %s (%d:%s)" , + installInfo->get(SLAPD_KEY_K_LDAP_URL), + installInfo->get(SLAPD_KEY_SERVER_ADMIN_ID), + (const char *)repEntry.entryDN(), + le.errorCode(), le.msg()); + return le.errorCode(); + } + } + while (ldapent.next() == OKAY); + + return 0; +} diff --git a/ldap/admin/src/configure_instance.h b/ldap/admin/src/configure_instance.h new file mode 100644 index 00000000..3da7670d --- /dev/null +++ b/ldap/admin/src/configure_instance.h @@ -0,0 +1,53 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/*********************************************************************** +** +** +** NAME +** configure_instance.h +** +** DESCRIPTION +** +** +** AUTHOR +** Rich Megginson +** +***********************************************************************/ + +#ifndef _CONFIGURE_INSTANCE_H_ +#define _CONFIGURE_INSTANCE_H_ + +#include "create_instance.h" + +#ifdef __cplusplus +extern "C" { +#endif + +int +create_config_from_inf( + server_config_s *cf, + int argc, + char *argv[] +); + +int +configure_instance_with_config( + server_config_s *cf, + int verbose, /* if false, silent; if true, verbose */ + const char *lfile /* log file */ +); + +int +configure_instance(); + +int +reconfigure_instance(int argc, char *argv[]); + +#ifdef __cplusplus +} +#endif + +#endif /* _CONFIGURE_INSTANCE_H_ */ diff --git a/ldap/admin/src/create_instance.c b/ldap/admin/src/create_instance.c new file mode 100644 index 00000000..20064b00 --- /dev/null +++ b/ldap/admin/src/create_instance.c @@ -0,0 +1,4640 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/* + * create_instance.c: Routines for creating an instance of a Directory Server + * + * These routines are not thread safe. + * + * Rob McCool + */ + +#define GW_CONF 1 +#define PB_CONF 2 + +#include "create_instance.h" +#include "cfg_sspt.h" + +#include +#include +#include + +#include +#include + +#define PATH_SIZE 1024 +#define ERR_SIZE 8192 + +/* delay time in seconds between referential integrity updates + 0 means continues */ +#define REFERINT_DELAY 0 + +/* 1=log changes for replaction, 0=don't replicate changes */ +#define REFERINT_LOG_CHANGES 0 + +#include "dsalib.h" +#include "dirver.h" + +#include "nspr.h" +#include "plstr.h" + +#ifdef XP_WIN32 +#define NOT_ABSOLUTE_PATH(str) \ + ((str[0] != '/') && (str[0] != '\\') && (str[2] != '/') && (str[2] != '\\')) +#define EADDRINUSE WSAEADDRINUSE +#define EACCES WSAEACCES +#include +#include +#include +#include +#define SHLIB_EXT "dll" +#else +#define NOT_ABSOLUTE_PATH(str) (str[0] != '/') +#include +#include + +#if !defined(HPUX) && !defined(LINUX2_0) +#include /* FD_SETSIZE */ +#else +#include /* FD_SETSIZE is in types.h on HPUX */ +#endif + +#if !defined(_WIN32) && !defined(AIX) +#include /* get/setrlimit stuff */ +#endif + +#include /* socket flags */ +#include /* sockaddr_in */ +#include /* inet_addr */ +#ifdef HPUX +#define SHLIB_EXT "sl" +#else +#define SHLIB_EXT "so" +#endif + +#endif + +/* + NT doesn't strictly need these, but the libadmin API which is emulated + below uses them. + */ +#define NEWSCRIPT_MODE 0755 +#define NEWFILE_MODE 0644 +#define NEWDIR_MODE 0755 +#define NEWSECDIR_MODE 0700 + +#include + +#ifdef XP_WIN32 + +OS_TYPE NS_WINAPI INFO_GetOperatingSystem (); +DWORD NS_WINAPI SERVICE_ReinstallNTService( LPCTSTR szServiceName, + LPCTSTR szServiceDisplayName, + LPCTSTR szServiceExe ); + + +#endif +static void ds_gen_index(FILE* f, char* belowdn); +static char *ds_gen_orgchart_conf(char *sroot, char *cs_path, server_config_s *cf); +static char *ds_gen_gw_conf(char *sroot, char *cs_path, server_config_s *cf, int conf_type); +static char *install_ds(char *sroot, server_config_s *cf, char *param_name); + +static int write_ldap_info(char *slapd_server_root, server_config_s *cf); +static char *gen_presence_init_script(char *sroot, server_config_s *cf, + char *cs_path); +static int init_presence(char *sroot, server_config_s *cf, char *cs_path); + +#if defined( SOLARIS ) +/* + * Solaris 9+ specific installation + */ +extern int iDSISolaris; +static char *sub_token(const char *, const char *, int, const char *, int); +/* + * If for some reasons, sub_token fails to generate the + * "etc" and "var" server_root from the actual "server_root", + * then the following hard-coded pathnames will be used. + */ +#define SOLARIS_ETC_DIR "/etc/iplanet/ds5" +#define SOLARIS_VAR_DIR "/var/ds5" + +/* + * Solaris 9+ specific installation + * The following function replaces the first occurence + * of "token" in the string "s" by "replace" + */ +static char * +sub_token(const char *s, const char *token, int tokenlen, + const char *replace, int replacelen) +{ + char *n = 0, *d; + char *ptr = (char*)strstr(s, token); + const char *begin; + int len; + if (!ptr) + return n; + + d = n = (char *) calloc(strlen(s) + replacelen + 1, 1); + if (!n) + return n; + begin = s; + len = (int)(ptr - begin); + strncpy(d, begin, len); + d += len; + begin = ptr + tokenlen; + len = replacelen; + strncpy(d, replace, len); + d += len; + for (ptr = (char *)begin; ptr && *ptr; LDAP_UTF8INC(ptr)) + { + *d = *ptr; + LDAP_UTF8INC(d); + } + *d = 0; + return n; +} +#endif /* SOLARIS */ + +static char *make_error(char *fmt, ...) +{ + static char errbuf[ERR_SIZE]; + va_list args; + + va_start(args, fmt); + vsprintf(errbuf, fmt, args); + va_end(args); + return errbuf; +} + + +/* This is to determine if we can skip the port number checks. During +migration or server cloning, we may want to copy over an old configuration, +including the old port number, which may not currently have permission to +use; if we don't need to start the server right away, we can skip +certain checks +*/ +static int needToStartServer(server_config_s *cf) +{ + if (cf && ( + (cf->cfg_sspt && !strcmp(cf->cfg_sspt, "1")) || + (cf->start_server && !strcmp(cf->start_server, "1")) + )) + { + return 1; + } + + return 0; +} + +static char * +myStrdup(const char *s) +{ + if (s == NULL) + return (char *)s; + + return strdup(s); +} + +static int getSuiteSpotUserGroup(server_config_s* cf) +{ +#ifdef XP_UNIX + static const char *ssUsersFile = "shared/config/ssusers.conf"; + char realFile[PATH_SIZE]; + char buf[1024]; + FILE *fp = NULL; + int status = 1; + + if (cf->servuser) + return 0; + + sprintf(realFile, "%s/%s", cf->sroot, ssUsersFile); + if (!(fp = fopen(realFile, "r"))) + return 1; + + while (fgets(buf, sizeof(buf), fp)) + { + char *p = NULL; + + if (buf[0] == '#' || buf[0] == '\n') + continue; + + buf[strlen(buf) - 1] = 0; + if (p = strstr(buf, "SuiteSpotUser")) + { + p += strlen("SuiteSpotUser"); + while (ldap_utf8isspace(p)) + LDAP_UTF8INC(p); + cf->servuser = strdup(p); + status = 0; + break; + } + } + + if (fp) + fclose(fp); + + return status; +#else + return 0; +#endif +} + +/* ----------------------- Create default settings ------------------------ */ + + +void set_defaults(char *sroot, char *hn, server_config_s *conf) +{ + char *id = 0, *t = 0; + + conf->sroot = sroot; + + if (hn) + { + if( (t = strchr(hn, '.')) ) + *t = '\0'; + id = (char *) malloc(strlen(hn) + 1); + sprintf(id, "%s", hn); + if(t) + *t = '.'; + } + + conf->servname = hn; + conf->bindaddr = ""; + conf->servport = "80"; + conf->cfg_sspt = NULL; + conf->suitespot3x_uid = NULL; + conf->cfg_sspt_uid = NULL; + conf->cfg_sspt_uidpw = NULL; + conf->servport = "389"; + conf->secserv = "off"; + conf->secservport = "636"; + conf->ntsynch = "off"; + conf->ntsynchssl = "on"; + conf->ntsynchport = "5009"; + conf->rootpw = ""; + conf->roothashedpw = ""; + conf->loglevel = NULL; + if (getenv("DEBUG_DS_LOG_LEVEL")) + conf->loglevel = getenv("DEBUG_DS_LOG_LEVEL"); + conf->suffix = "dc=example, dc=com"; +#ifndef DONT_ALWAYS_CREATE_NETSCAPEROOT + conf->netscaperoot = name_netscaperootDN; +#endif /* DONT_ALWAYS_CREATE_NETSCAPEROOT */ +#define CREATE_SAMPLE_SUFFIX +#ifdef CREATE_SAMPLE_SUFFIX + conf->samplesuffix = "dc=example, dc=com"; +#endif /* CREATE_SAMPLE_SUFFIX */ +#ifdef TEST_CONFIG + conf->netscaperoot = "cn=config40"; +#endif /* TEST_CONFIG */ + +#define ROOT_RDN "cn=Directory Manager" + conf->rootdn = ROOT_RDN; +/* conf->rootdn = malloc(strlen(ROOT_RDN) + 2 + strlen(conf->suffix) + 1); + sprintf(conf->rootdn, "%s, %s", ROOT_RDN, conf->suffix);*/ + conf->servid = id; + +#ifdef XP_UNIX + conf->servuser = NULL; +#ifdef THREAD_NSPR_KERNEL + conf->numprocs = "1"; + conf->maxthreads = "128"; +#else + conf->numprocs = "4"; + conf->maxthreads = "32"; +#endif +#else /* XP_WIN32 */ + conf->maxthreads = "32"; +#endif + conf->minthreads = "4"; + + conf->upgradingServer = 0; + + conf->start_server = "1"; + conf->admin_domain = NULL; + conf->config_ldap_url = NULL; + conf->user_ldap_url = NULL; + conf->use_existing_config_ds = 0; + conf->use_existing_user_ds = 0; + conf->consumerdn = NULL; + conf->disable_schema_checking = NULL; + conf->install_ldif_file = NULL; +} + + +/* ----------------- Sanity check a server configuration ------------------ */ + + +char *create_instance_checkport(char *, char *); +char *create_instance_checkuser(char *); +int create_instance_numbers(char *); +int create_instance_exists(char *fn); +char *create_instance_copy(char *, char *, int); +char *create_instance_concatenate(char *, char *, int); +int create_instance_mkdir(char *, int); +char *create_instance_mkdir_p(char *, int); + +#if defined( SOLARIS ) +/* + * Solaris 9+ specific installation + */ +int create_instance_symlink(char *, char *); +#endif /* SOLARIS */ + + +/* + returns NULL if the given dn is a valid dn, or an error string +*/ +static char * +isAValidDN(const char *dn_to_test) +{ + char *t = 0; + + if (!dn_to_test || !*dn_to_test) + { + t = "No value specified for the parameter."; + } + else + { + char **rdnList = ldap_explode_dn(dn_to_test, 0); + char **rdnNoTypes = ldap_explode_dn(dn_to_test, 1); + if (!rdnList || !rdnList[0] || !rdnNoTypes || !rdnNoTypes[0] || + !*rdnNoTypes[0] || !PL_strcasecmp(rdnList[0], rdnNoTypes[0])) + { + t = make_error("The given value [%s] is not a valid DN.", + dn_to_test); + } + if (rdnList) + ldap_value_free(rdnList); + if (rdnNoTypes) + ldap_value_free(rdnNoTypes); + } + + if (t) + return t; + + return NULL; +} + +/* + prints a message if the given dn uses LDAPv2 style quoting +*/ +void +checkForLDAPv2Quoting(const char *dn_to_test) +{ + if (ds_dn_uses_LDAPv2_quoting(dn_to_test)) + { + char *newdn = strdup(dn_to_test); + char *t; + dn_normalize_convert(newdn); + t = make_error( + "The given value [%s] is quoted in the deprecated LDAPv2 style\n" + "quoting format. It will be automatically converted to use the\n" + "LDAPv3 style escaped format [%s].", dn_to_test, newdn); + free(newdn); + ds_show_message(t); + } + + return; +} + +/* + returns NULL if the given string contains no 8 bit chars, otherwise an + error message +*/ +static char * +contains8BitChars(const char *s) +{ + char *t = 0; + + if (s && *s) + { + for (; !t && *s; ++s) + { + if (*s & 0x80) + { + t = make_error("The given value [%s] contains invalid 8 bit characters.", + s); + } + } + } + + return t; +} + +static char *sanity_check(server_config_s *cf, char *param_name) +{ + char *t, fn[PATH_SIZE]; + register int x; + + if (!param_name) + return "Parameter param_name is null"; + + /* if we don't need to start the server right away, we can skip the + port number checks + */ + if (!needToStartServer(cf)) + { + if( (t = create_instance_checkport(cf->bindaddr, cf->servport)) ) + { + strcpy(param_name, "servport"); + return t; + } + + if ( cf->secserv && (strcmp(cf->secserv, "on") == 0) && (cf->secservport != NULL) && + (*(cf->secservport) != '\0') ) { + if ( (t = create_instance_checkport(cf->bindaddr, cf->secservport)) ) { + strcpy(param_name, "secservport"); + return t; + } + } + if ( cf->ntsynch && (strcmp(cf->ntsynch, "on") == 0) && (cf->ntsynchport != NULL) && + (*(cf->ntsynchport) != '\0') ) { + if ( (t = create_instance_checkport(cf->bindaddr, cf->ntsynchport)) ) { + strcpy(param_name, "ntsynchport"); + return t; + } + } + } + + /* is the server identifier good? */ + for(x=0; cf->servid[x]; x++) { + if(strchr("/ &;`'\"|*!?~<>^()[]{}$\\", cf->servid[x])) { + strcpy(param_name, "servid"); + return make_error("You used a shell-specific character in " + "your server id (the character was %c).", + cf->servid[x]); + } + } + /* has that identifier already been used? */ + sprintf(fn, "%s%c%s-%s", cf->sroot, FILE_PATHSEP, + PRODUCT_NAME, cf->servid); + +/* Not an error to upgrade! ??? + if ( !cf->upgradingServer ) { + if(create_instance_exists(fn)) { + strcpy(param_name, "servid"); + return make_error ("A server named '%s' already exists." + "\nPlease choose another server identifier.", + cf->servid); + } + } + */ + +#ifdef XP_UNIX + if( (t = create_instance_checkuser(cf->servuser)) ) + { + strcpy(param_name, "servuser"); + return t; + } +#endif + + /* make sure some drooling imbecile doesn't put in bogus numbers */ +#ifdef XP_UNIX + if((!create_instance_numbers(cf->numprocs)) || (atoi(cf->numprocs) <= 0)) + { + strcpy(param_name, "numprocs"); + return ("The number of processes must be not be zero or " + "negative."); + } +#endif + if((!create_instance_numbers(cf->maxthreads)) || (atoi(cf->maxthreads) <= 0)) + { + strcpy(param_name, "maxthreads"); + return ("The maximum threads must be not be zero or negative."); + } + if((!create_instance_numbers(cf->minthreads)) || (atoi(cf->minthreads) <= 0)) + { + strcpy(param_name, "minthreads"); + return ("The minumum threads must be not be zero or negative."); + } + + if((atoi(cf->minthreads)) > (atoi(cf->maxthreads))) + { + strcpy(param_name, "minthreads"); + return ("Minimum threads must be less than maximum threads."); + } + + /* see if the DN parameters are valid DNs */ + if (!cf->use_existing_user_ds && (t = isAValidDN(cf->suffix))) + { + strcpy(param_name, "suffix"); + return t; + } + checkForLDAPv2Quoting(cf->suffix); + + if (t = isAValidDN(cf->rootdn)) + { + strcpy(param_name, "rootdn"); + return t; + } + checkForLDAPv2Quoting(cf->rootdn); + + if (cf->replicationdn && *cf->replicationdn && (t = isAValidDN(cf->replicationdn))) + { + strcpy(param_name, "replicationdn"); + return t; + } + checkForLDAPv2Quoting(cf->replicationdn); + + if (cf->consumerdn && *cf->consumerdn && (t = isAValidDN(cf->consumerdn))) + { + strcpy(param_name, "consumerdn"); + return t; + } + checkForLDAPv2Quoting(cf->consumerdn); + + if (cf->changelogsuffix && *cf->changelogsuffix && + (t = isAValidDN(cf->changelogsuffix))) + { + strcpy(param_name, "changelogsuffix"); + return t; + } + checkForLDAPv2Quoting(cf->changelogsuffix); + + if (cf->netscaperoot && *cf->netscaperoot && + (t = isAValidDN(cf->netscaperoot))) + { + strcpy(param_name, "netscaperoot"); + return t; + } + checkForLDAPv2Quoting(cf->netscaperoot); + + if (cf->samplesuffix && *cf->samplesuffix && + (t = isAValidDN(cf->samplesuffix))) + { + strcpy(param_name, "samplesuffix"); + return t; + } + checkForLDAPv2Quoting(cf->samplesuffix); + + if (t = contains8BitChars(cf->rootpw)) + { + strcpy(param_name, "rootpw"); + return t; + } + + if (t = contains8BitChars(cf->cfg_sspt_uidpw)) + { + strcpy(param_name, "cfg_sspt_uidpw"); + return t; + } + + if (t = contains8BitChars(cf->replicationpw)) + { + strcpy(param_name, "replicationpw"); + return t; + } + + if (t = contains8BitChars(cf->consumerpw)) + { + strcpy(param_name, "consumerpw"); + return t; + } + + if (cf->cfg_sspt_uid && *cf->cfg_sspt_uid) + { + /* + If it is a valid DN, ok. Otherwise, it should be a uid, and should + be checked for 8 bit chars + */ + if (t = isAValidDN(cf->cfg_sspt_uid)) + { + if (t = contains8BitChars(cf->cfg_sspt_uid)) + { + strcpy(param_name, "cfg_sspt_uid"); + return t; + } + } + else + checkForLDAPv2Quoting(cf->cfg_sspt_uid); + } + + return NULL; +} + +/* ----- From a configuration, set up a new server in the server root ----- */ + +/* ------------------ UNIX utilities for server creation ------------------ */ + +#ifdef XP_UNIX + +#include +#include + +char* +chownfile (struct passwd* pw, char* fn) +{ + if (pw != NULL && chown (fn, pw->pw_uid, pw->pw_gid) == -1) { + if (pw->pw_name != NULL) { + return make_error ("Could not change owner of %s to %s.", + fn, pw->pw_name); + } else { + return make_error ("Could not change owner of %s to (UID %li, GID %li).", + fn, (long)(pw->pw_uid), (long)(pw->pw_gid)); + } + } + return NULL; +} + +char *chownlogs(char *sroot, char *user) +{ + struct passwd *pw; + char fn[PATH_SIZE]; + if(user && *user && !geteuid()) { + if(!(pw = getpwnam(user))) + return make_error("Could not find UID and GID of user '%s'.", + user); + sprintf(fn, "%s%clogs", sroot, FILE_PATHSEP); + return chownfile (pw, fn); + } + return NULL; +} + +char *chownconfig(char *sroot, char *user) +{ + struct passwd *pw; + char fn[PATH_SIZE]; + if(user && *user && !geteuid()) { + if(!(pw = getpwnam(user))) + return make_error("Could not find UID and GID of user '%s'.", + user); + sprintf(fn, "%s%cconfig", sroot, FILE_PATHSEP); + return chownfile (pw, fn); + } + return NULL; +} + +#else + +#define chownfile(a, b) +#define chownlogs(a, b) +#define chownconfig(a, b) +#define chownsearch(a, b) + +#endif + +char *gen_script(char *s_root, char *name, char *fmt, ...) +{ + char fn[PATH_SIZE]; + FILE *f; + char *shell = "/bin/sh"; + va_list args; + + sprintf(fn, "%s%c%s", s_root, FILE_PATHSEP, name); + if(!(f = fopen(fn, "w"))) + return make_error("Could not write to %s (%s).", fn, ds_system_errmsg()); + va_start(args, fmt); +#if !defined( XP_WIN32 ) +#if defined( OSF1 ) + /* + The standard /bin/sh has some rather strange behavior with "$@", + so use the posix version wherever possible. OSF1 4.0D should + always have this one available. + */ + if (!access("/usr/bin/posix/sh", 0)) + shell = "/usr/bin/posix/sh"; +#endif /* OSF1 */ + fprintf(f, "#!%s\n\n", shell); + /* + Neutralize shared library access. + + On HP-UX, SHLIB_PATH is the historical variable. + However on HP-UX 64 bit, LD_LIBRARY_PATH is also used. + We unset both too. + */ +#if defined( SOLARIS ) || defined( OSF1 ) || defined( LINUX2_0 ) + fprintf(f, "unset LD_LIBRARY_PATH\n"); +#endif +#if defined( HPUX ) + fprintf(f, "unset SHLIB_PATH\n"); + fprintf(f, "unset LD_LIBRARY_PATH\n"); +#endif +#if defined( AIX ) + fprintf(f, "unset LIBPATH\n"); +#endif +#endif + vfprintf(f, fmt, args); + +#if defined( XP_UNIX ) + fchmod(fileno(f), NEWSCRIPT_MODE); +#endif + fclose(f); +#if defined( XP_WIN32 ) + chmod( fn, NEWSCRIPT_MODE); +#endif + return NULL; +} + +char *gen_perl_script(char *s_root, char *cs_path, char *name, char *fmt, ...) +{ + char myperl[PATH_SIZE]; + char fn[PATH_SIZE]; + FILE *f; + va_list args; + + sprintf(fn, "%s%c%s", cs_path, FILE_PATHSEP, name); + sprintf(myperl, "%s%cbin%cslapd%cadmin%cbin%cperl", + s_root, FILE_PATHSEP, FILE_PATHSEP, + FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP); + if(!(f = fopen(fn, "w"))) + return make_error("Could not write to %s (%s).", fn, ds_system_errmsg()); + va_start(args, fmt); +#if !defined( XP_WIN32 ) + fprintf(f, "#!%s\n\n", myperl); +#endif + vfprintf(f, fmt, args); + +#if defined( XP_UNIX ) + fchmod(fileno(f), NEWSCRIPT_MODE); +#endif + fclose(f); +#if defined( XP_WIN32 ) + chmod( fn, NEWSCRIPT_MODE); +#endif + +#if defined( SOLARIS ) + /* + * Solaris 9+ specific installation + * Log all non /slapd-identifier files/directories + * created by the post_installer so that they can be removed + * during un-install. + */ + if (iDSISolaris) + logUninstallInfo(s_root, PRODUCT_NAME, PRODUCT_NAME, fn); +#endif + + return NULL; +} + +char *gen_perl_script_auto(char *s_root, char *cs_path, char *name, + server_config_s *cf) +{ + char myperl[PATH_SIZE]; + char fn[PATH_SIZE], ofn[PATH_SIZE]; + const char *table[10][2]; + + sprintf(ofn, "%s%cbin%cslapd%cadmin%cscripts%ctemplate-%s", s_root, + FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, + FILE_PATHSEP, name); + sprintf(fn, "%s%c%s", cs_path, FILE_PATHSEP, name); + sprintf(myperl, "!%s%cbin%cslapd%cadmin%cbin%cperl", + s_root, FILE_PATHSEP, FILE_PATHSEP, + FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP); + + table[0][0] = "DS-ROOT"; + table[0][1] = s_root; + table[1][0] = "MY-DS-ROOT"; + table[1][1] = cs_path; + table[2][0] = "SEP"; + table[2][1] = FILE_PATHSEPP; + table[3][0] = "SERVER-NAME"; + table[3][1] = cf->servname; + table[4][0] = "SERVER-PORT"; + table[4][1] = cf->servport; + table[5][0] = "PERL-EXEC"; + table[6][0] = "DEV-NULL"; +#if !defined( XP_WIN32 ) + table[5][1] = myperl; + table[6][1] = " /dev/null "; +#else + table[5][1] = " perl script"; + table[6][1] = " NUL "; +#endif + table[7][0] = "ROOT-DN"; + table[7][1] = cf->rootdn; + table[8][0] = table[8][1] = NULL; + + if (generate_script(ofn, fn, NEWSCRIPT_MODE, table) != 0) { + return make_error("Could not write %s to %s (%s).", ofn, fn, + ds_system_errmsg()); + } +#if defined( SOLARIS ) + /* + * Solaris 9+ specific installation + */ + if (iDSISolaris) + logUninstallInfo(s_root, PRODUCT_NAME, PRODUCT_NAME, fn); +#endif + + return NULL; +} + +char *gen_perl_script_auto_for_migration(char *s_root, char *cs_path, char *name, + server_config_s *cf) +{ + char myperl[PATH_SIZE]; + char fn[PATH_SIZE], ofn[PATH_SIZE]; + const char *table[10][2]; + + sprintf(ofn, "%s%cbin%cslapd%cadmin%cscripts%ctemplate-%s", s_root, + FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, + FILE_PATHSEP, name); + sprintf(fn, "%s%cbin%cslapd%cadmin%cbin%c%s", s_root, FILE_PATHSEP, + FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, name); + sprintf(myperl, "!%s%cbin%cslapd%cadmin%cbin%cperl", + s_root, FILE_PATHSEP, FILE_PATHSEP, + FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP); + + table[0][0] = "DS-ROOT"; + table[0][1] = s_root; + table[1][0] = "MY-DS-ROOT"; + table[1][1] = cs_path; + table[2][0] = "SEP"; + table[2][1] = FILE_PATHSEPP; + table[3][0] = "SERVER-NAME"; + table[3][1] = cf->servname; + table[4][0] = "SERVER-PORT"; + table[4][1] = cf->servport; + table[5][0] = "PERL-EXEC"; + table[6][0] = "DEV-NULL"; +#if !defined( XP_WIN32 ) + table[5][1] = myperl; + table[6][1] = " /dev/null "; +#else + table[5][1] = " perl script"; + table[6][1] = " NUL "; +#endif + table[7][0] = "ROOT-DN"; + table[7][1] = cf->rootdn; + table[8][0] = table[8][1] = NULL; + + if (generate_script(ofn, fn, NEWSCRIPT_MODE, table) != 0) { + return make_error("Could not write %s to %s (%s).", ofn, fn, + ds_system_errmsg()); + } + +#if defined( SOLARIS ) + /* + * Solaris 9+ specific installation + */ + if (iDSISolaris) + logUninstallInfo(s_root, PRODUCT_NAME, PRODUCT_NAME, fn); +#endif + + return NULL; +} + +/* ------------------ NT utilities for server creation ------------------ */ + +#ifdef XP_WIN32 + +char * +service_exists(char *servid) +{ + DWORD status, lasterror = 0; + char szServiceName[MAX_PATH] = {0}; + sprintf(szServiceName,"%s-%s", SVR_ID_SERVICE, servid); + /* if the service already exists, error */ + status = SERVICE_GetNTServiceStatus(szServiceName, &lasterror ); + if ( (lasterror == ERROR_SERVICE_DOES_NOT_EXIST) || + (status == SERVRET_ERROR) || (status == SERVRET_REMOVED) ) { + return 0; + } else { return + make_error("Server %s already exists: cannot create another. " + "Please choose a different name or delete the " + "existing server.", + szServiceName); + } + + return 0; +} + +void setup_nteventlogging(char *szServiceId, char *szMessageFile) +{ + HKEY hKey; + char szKey[MAX_PATH]; + DWORD dwData; + + sprintf(szKey, "SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\%s", szServiceId); + + if(RegCreateKey(HKEY_LOCAL_MACHINE, szKey, &hKey) == ERROR_SUCCESS) + { + if(RegSetValueEx(hKey, "EventMessageFile", 0, REG_SZ, (LPBYTE)szMessageFile, strlen(szMessageFile) + 1) == ERROR_SUCCESS) + { + dwData = EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE | EVENTLOG_INFORMATION_TYPE; + RegSetValueEx(hKey, "TypesSupported", 0, REG_DWORD, (LPBYTE) &dwData, sizeof(DWORD)); + } + RegCloseKey(hKey); + } +} + + +char *add_ntservice(server_config_s *cf) +{ + char szMessageFile[MAX_PATH]; + char szServiceExe[MAX_PATH], szServiceDisplayName[MAX_PATH], szServiceName[MAX_PATH]; + DWORD dwLastError; + + sprintf ( szServiceExe, "%s/bin/%s/server/%s", cf->sroot, + SVR_DIR_ROOT, SVR_EXE); + sprintf ( szServiceName,"%s-%s", SVR_ID_SERVICE, cf->servid); + sprintf ( szServiceDisplayName, "%s (%s)", SVR_NAME_FULL_VERSION, + cf->servid); + + /* install new service - if already installed, try and remove and + then reinstall */ + dwLastError = SERVICE_ReinstallNTService( szServiceName, + szServiceDisplayName, szServiceExe ); + if ( dwLastError != NO_ERROR ) { + return make_error ( "While installing %s Service, the " + "NT Service Manager reported error %d (%s)", + szServiceDisplayName, dwLastError, ds_system_errmsg() ); + } + + // setup event logging registry keys, do this after service creation + sprintf(szMessageFile, "%s\\bin\\%s\\server\\%s", cf->sroot, + SVR_DIR_ROOT, "slapdmessages30.dll"); + setup_nteventlogging(szServiceName, szMessageFile); + + // TODO: add perfmon setup code -ahakim 11/22/96 + return NULL; +} + +char *setup_ntserver(server_config_s *cf) +{ + char line[MAX_PATH], *sroot = cf->sroot; + char subdir[MAX_PATH]; + char NumValuesBuf[3]; + DWORD Result; + HKEY hServerKey; + DWORD NumValues; + DWORD iterator; + int value_already_exists = 0; + DWORD type_buffer; + char value_data_buffer[MAX_PATH]; + DWORD sizeof_value_data_buffer; + + /* MLM - Adding ACL directories authdb and authdb/default */ + sprintf(subdir, "%s%cauthdb", sroot, FILE_PATHSEP); + if( (create_instance_mkdir(subdir, NEWDIR_MODE)) ) + return make_error("mkdir %s failed (%s)", subdir, ds_system_errmsg()); + + sprintf(subdir, "%s%cauthdb%cdefault", sroot, FILE_PATHSEP, FILE_PATHSEP); + if( (create_instance_mkdir(subdir, NEWDIR_MODE)) ) + return make_error("mkdir %s failed (%s)", subdir, ds_system_errmsg()); + + /* Create DS-nickname (corresponding to ServiceID) key in registry */ + sprintf(line, "%s\\%s\\%s-%s", KEY_SOFTWARE_NETSCAPE, SVR_KEY_ROOT, + SVR_ID_SERVICE, cf->servid); + + Result = RegCreateKey(HKEY_LOCAL_MACHINE, line, &hServerKey); + if (Result != ERROR_SUCCESS) { + return make_error("Could not create registry server key %s - error %d (%s)", + line, GetLastError(), ds_system_errmsg()); + } + + // note that SVR_ID_PRODUCT is being used here, which is of the form dsX + // as opposed to SVR_ID_SERVICE, which is of the form dsX30 + sprintf(line, "%s\\%s-%s\\config", sroot, SVR_ID_PRODUCT, cf->servid); + Result = RegSetValueEx(hServerKey, VALUE_CONFIG_PATH, 0, REG_SZ, + line, strlen(line) + 1); + + RegCloseKey(hServerKey); + + /* Create SNMP key in registry */ + sprintf(line, "%s\\%s\\%s", KEY_SOFTWARE_NETSCAPE, SVR_KEY_ROOT, + KEY_SNMP_CURRENTVERSION); + + Result = RegCreateKey(HKEY_LOCAL_MACHINE, line, &hServerKey); + if (Result != ERROR_SUCCESS) { + return make_error("Could not create registry server key %s - error %d (%s)", + line, GetLastError(), ds_system_errmsg()); + } + + + /* Create the SNMP Pathname value */ + sprintf(line, "%s\\%s", sroot, SNMP_PATH); + Result = RegSetValueEx(hServerKey, VALUE_APP_PATH, 0, REG_SZ, + line, strlen(line) + 1); + RegCloseKey(hServerKey); + + /* write SNMP extension agent value to Microsoft SNMP Part of Registry) */ + sprintf(line, "%s\\%s", KEY_SERVICES, KEY_SNMP_SERVICE); + Result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, + line, + 0, + KEY_ALL_ACCESS, + &hServerKey); + /* if its there set the value, otherwise go on to the next thing */ + if (Result == ERROR_SUCCESS) + { + /* extension agents should have linearly increasing value, + make sure it doesn't already exist, find last one and increment + value for new key */ + + sprintf(line, "%s\\%s\\%s", KEY_SOFTWARE_NETSCAPE, SVR_KEY_ROOT, KEY_SNMP_CURRENTVERSION); + + Result = RegQueryInfoKey(hServerKey, NULL, NULL, NULL, NULL, NULL, + NULL, &NumValues, NULL, NULL, NULL, NULL); + + if (Result == ERROR_SUCCESS){ + for(iterator = 0; iterator <= NumValues; iterator++) + { + /* initialize to max size to avoid + ERROR_MORE_DATA because size gets set + to actual size of key after call + to RegQueryValueEx, previously there + was a bug if last key was smaller + than this one it would return ERROR_MORE_DATA + and it would not find the key if it was already there + */ + sizeof_value_data_buffer=MAX_PATH; + sprintf(NumValuesBuf, "%d", iterator); + Result = RegQueryValueEx(hServerKey, + NumValuesBuf, + NULL, + &type_buffer, + value_data_buffer, + &sizeof_value_data_buffer + ); + + if(!strcmp(value_data_buffer, line)) + { + value_already_exists = 1; + } + } + } + + if(!value_already_exists) + { + sprintf(NumValuesBuf, "%d", NumValues + 1); + Result = RegSetValueEx(hServerKey, NumValuesBuf, 0, REG_SZ, + line, strlen(line) + 1); + + /* couldn't set this value, so there is a real problem */ + if (Result != ERROR_SUCCESS) + { + return make_error("Could not set value %s (%d)", + line, Result); + } + } + + } + RegCloseKey(hServerKey); + + return NULL; +} +#endif + +/* ---------------------- Create configuration files ---------------------- */ + + +char *create_server(server_config_s *cf, char *param_name) +{ + char line[PATH_SIZE], *t, *sroot = cf->sroot; + char subdir[PATH_SIZE]; + +#if defined( SOLARIS ) + /* + * Solaris 9+ specific installation + */ + char otherline[PATH_SIZE]; + char subdirvar[PATH_SIZE]; + char subdiretc[PATH_SIZE]; + char *sub; +#endif /* SOLARIS */ + + if (param_name) + param_name[0] = 0; /* init to empty string */ + +#ifdef XP_UNIX + if (!cf->servuser) + getSuiteSpotUserGroup(cf); +#else + /* Abort if the service exists on NT */ + if (t = service_exists(cf->servid)) { + strcpy(param_name, "servid"); + return t; + } +#endif + + if( (t = sanity_check(cf, param_name)) ) + return t; + + /* Create slapd-nickname directory */ +#if defined( SOLARIS ) + /* + * Verify if configuration is for native solaris packages + * This is because if console is used to create instance + * then -S is not passed to ds_create. + * /.native_solaris file acts as the flag + */ + if (!iDSISolaris) { + sprintf(otherline, "%s%c.native_solaris", sroot, FILE_PATHSEP); + if (create_instance_exists(otherline)) { + iDSISolaris = 1; + } + } + + if (iDSISolaris) { + /* + * Create the slapd-nickname directory under "var" + */ + sub = sub_token(sroot,"/usr/iplanet/",13,"/var/",5); + if (sub) { + sprintf(subdirvar, "%s/"PRODUCT_NAME"-%s", sub, cf->servid); + free(sub); + } + else { + sprintf(subdirvar, "%s/"PRODUCT_NAME"-%s", SOLARIS_VAR_DIR, cf->servid); + } + if( (create_instance_mkdir_p(subdirvar, NEWDIR_MODE)) ) + return make_error("mkdir %s failed (%s)", subdirvar, ds_system_errmsg()); + + /* + * Create the slapd-nickname directory under "etc" + */ + sub = sub_token(sroot,"/usr/",5,"/etc/",5); + if (sub) { + sprintf(subdiretc, "%s/"PRODUCT_NAME"-%s", sub, cf->servid); + free(sub); + } + else { + sprintf(subdiretc, "%s/"PRODUCT_NAME"-%s", SOLARIS_ETC_DIR, cf->servid); + } + if( (create_instance_mkdir_p(subdiretc, NEWDIR_MODE)) ) + return make_error("mkdir %s failed (%s)", subdiretc, ds_system_errmsg()); + sprintf(subdir, "%s%c"PRODUCT_NAME"-%s", sroot, FILE_PATHSEP, + cf->servid); + if( (create_instance_symlink(subdirvar, subdir)) ) + return make_error("symlink %s ==> %s failed (%s)", subdir, subdirvar, ds_system_errmsg()); + } + else { + sprintf(subdir, "%s%c"PRODUCT_NAME"-%s", sroot, FILE_PATHSEP, + cf->servid); + if( (create_instance_mkdir(subdir, NEWDIR_MODE)) ) + return make_error("mkdir %s failed (%s)", subdir, ds_system_errmsg()); + } +#else + sprintf(subdir, "%s%c"PRODUCT_NAME"-%s", sroot, FILE_PATHSEP, + cf->servid); + if( (create_instance_mkdir(subdir, NEWDIR_MODE)) ) + return make_error("mkdir %s failed (%s)", subdir, ds_system_errmsg()); +#endif /* SOLARIS */ + + /* Create slapd-nickname/config directory */ + sprintf(line, "%s%cconfig", subdir, FILE_PATHSEP); + if( (create_instance_mkdir(line, NEWDIR_MODE)) ) + return make_error("mkdir %s failed (%s)", line, ds_system_errmsg()); +#if defined( SOLARIS ) + if (iDSISolaris) { + sprintf(line, "%s%cconfig", subdirvar, FILE_PATHSEP); + sprintf(otherline, "%s%cconfig", subdiretc, FILE_PATHSEP); + if( (create_instance_symlink(line, otherline)) ) + return make_error("symlink %s ==> %s failed (%s)", otherline, line, ds_system_errmsg()); + } +#endif /* SOLARIS */ + + /* Create slapd-nickname/config/schema directory */ + sprintf(line, "%s%cconfig%cschema", subdir, FILE_PATHSEP, FILE_PATHSEP); + if( (create_instance_mkdir(line, NEWDIR_MODE)) ) + return make_error("mkdir %s failed (%s)", line, ds_system_errmsg()); + + /* Create slapd-nickname/config/presence directory */ + sprintf(line, "%s%cconfig%cpresence", subdir, FILE_PATHSEP, FILE_PATHSEP); + if( (create_instance_mkdir(line, NEWDIR_MODE)) ) + return make_error("mkdir %s failed (%s)", line, ds_system_errmsg()); + + /* Create slapd-nickname/logs directory */ + sprintf(line, "%s%clogs", subdir, FILE_PATHSEP); + if( (create_instance_mkdir(line, NEWSECDIR_MODE)) ) + return make_error("mkdir %s failed (%s)", line, ds_system_errmsg()); + + /* Create httpacl directory */ + sprintf(line, "%s%chttpacl", cf->sroot, FILE_PATHSEP); + if( (create_instance_mkdir(line, NEWDIR_MODE)) ) + return make_error("mkdir %s failed (%s)", line, ds_system_errmsg()); +#if defined( SOLARIS ) + if (iDSISolaris) + logUninstallInfo(sroot, PRODUCT_NAME, PRODUCT_NAME, line); +#endif /* SOLARIS */ + +#ifdef XP_UNIX + /* Start/stop/rotate/restart scripts */ +#if defined( SOLARIS ) + if (getenv("USE_DEBUGGER") && !iDSISolaris) +#else + if (getenv("USE_DEBUGGER")) +#endif /* SOLARIS */ + { + char *debugger = getenv("DSINST_DEBUGGER"); + char *debugger_command = getenv("DSINST_DEBUGGER_CMD"); + if (! debugger) { + debugger = "/tools/ns/workshop/bin/dbx"; + } + if (! debugger_command) { + debugger_command = "echo"; /* e.g. do nothing */ + } +#ifdef OSF1 + printf("-D %s -i %s/logs/pid -d %s -z\n", subdir, subdir, + cf->loglevel ? cf->loglevel : "0"); + t = gen_script(subdir, START_SCRIPT, + "\n" + "# Script that starts the ns-slapd server.\n" + "# Exit status can be:\n" + "# 0: Server started successfully\n" + "# 1: Server could not be started\n" + "# 2: Server already running\n" + "\n" + "NETSITE_ROOT=%s\n" + "export NETSITE_ROOT\n" + "PIDFILE=%s/logs/pid\n" + "if test -f $PIDFILE ; then\n" + " PID=`cat $PIDFILE`\n" + " if kill -0 $PID > /dev/null 2>&1 ; then\n" + " echo There is an ns-slapd process already running: $PID\n" + " exit 2;\n" + " else\n" + " rm -f $PIDFILE\n" + " fi\n" + "fi\n" + "cd %s/bin/%s/server; ./%s -D %s -i %s/logs/pid -d %s -z \"$@\" &\n" + "loop_counter=1\n" + "max_count=120\n" + "while test $loop_counter -le $max_count; do\n" + " loop_counter=`expr $loop_counter + 1`\n" + " if test ! -f $PIDFILE ; then\n" + " sleep 1;\n" + " else\n" + " PID=`cat $PIDFILE`\n" + /* rbyrne: setupsdk takes any message here as an error: + " echo Server has been started. ns-slapd process started: $PID\n"*/ + " exit 0;\n" + " fi\n" + "done\n" + "echo Server not running!! Failed to start ns-slapd process.\n" + "exit 1\n", + sroot, subdir, sroot, PRODUCT_NAME, PRODUCT_BIN, subdir, + subdir, + cf->loglevel ? cf->loglevel : "0" + ); +/* + t = gen_script(subdir, START_SCRIPT, + "NETSITE_ROOT=%s\n" + "export NETSITE_ROOT\n" + "cd %s/bin/%s/server; /usr/bin/X11/xterm -fn 10x20 -sb -sl 2000 -e /bin/ladebug " + "-I /u/richm/ds50/ldapserver/ldap/servers/slapd/back-ldbm " + "-I /u/richm/ds50/ldapserver/ldap/servers/slapd " + "%s &\n", + sroot, sroot, PRODUCT_NAME, PRODUCT_BIN + ); +*/ +#else + t = gen_script(subdir, START_SCRIPT, + "\n" + "# Script that starts the ns-slapd server.\n" + "# Exit status can be:\n" + "# 0: Server started successfully\n" + "# 1: Server could not be started\n" + "# 2: Server already running\n" + "\n" + "NETSITE_ROOT=%s\n" + "export NETSITE_ROOT\n" + "PIDFILE=%s/logs/pid\n" + "if test -f $PIDFILE ; then\n" + " PID=`cat $PIDFILE`\n" + " if kill -0 $PID > /dev/null 2>&1 ; then\n" + " echo There is an ns-slapd process already running: $PID\n" + " exit 2;\n" + " else\n" + " rm -f $PIDFILE\n" + " fi\n" + "fi\n" + "if [ -x /usr/local/bin/xterm ]; then\n" + " xterm=/usr/local/bin/xterm\n" + "else\n" + " xterm=/usr/openwin/bin/xterm\n" + "fi\n" + "cd %s/bin/%s/server; $xterm -title debugger -e %s -c \"dbxenv follow_fork_mode child ; stop in main ; %s ; run -D %s -i %s/logs/pid -d %s -z $*\" %s &\n" + "loop_counter=1\n" + "max_count=120\n" + "while test $loop_counter -le $max_count; do\n" + " loop_counter=`expr $loop_counter + 1`\n" + " if test ! -f $PIDFILE ; then\n" + " sleep 1;\n" + " else\n" + " PID=`cat $PIDFILE`\n" + /* rbyrne: setupsdk takes any message here as an error: + " echo Server has been started. ns-slapd process started: $PID\n"*/ + " exit 0;\n" + " fi\n" + "done\n" + "echo Server not running!! Failed to start ns-slapd process.\n" + "exit 1\n", + sroot, subdir, sroot, PRODUCT_NAME, debugger, debugger_command, + subdir, + subdir, cf->loglevel ? cf->loglevel : "0", PRODUCT_BIN + ); +#endif + } + else + { + t = gen_script(subdir, START_SCRIPT, + "\n" + "# Script that starts the ns-slapd server.\n" + "# Exit status can be:\n" + "# 0: Server started successfully\n" + "# 1: Server could not be started\n" + "# 2: Server already running\n" + "\n" + "NETSITE_ROOT=%s\n" + "export NETSITE_ROOT\n" + "PIDFILE=%s/logs/pid\n" + "STARTPIDFILE=%s/logs/startpid\n" + "if test -f $STARTPIDFILE ; then\n" + " PID=`cat $STARTPIDFILE`\n" + " if kill -0 $PID > /dev/null 2>&1 ; then\n" + " echo There is an ns-slapd process already running: $PID\n" + " exit 2;\n" + " else\n" + " rm -f $STARTPIDFILE\n" + " fi\n" + "fi\n" + "if test -f $PIDFILE ; then\n" + " PID=`cat $PIDFILE`\n" + " if kill -0 $PID > /dev/null 2>&1 ; then\n" + " echo There is an ns-slapd process already running: $PID\n" + " exit 2;\n" + " else\n" + " rm -f $PIDFILE\n" + " fi\n" + "fi\n" + "cd %s/bin/%s/server; ./%s -D %s -i %s/logs/pid -w $STARTPIDFILE \"$@\"\n" + "if [ $? -ne 0 ]; then\n" + " exit 1\n" + "fi\n" + "\n" + "loop_counter=1\n" + "# wait for 10 seconds for the start pid file to appear\n" + "max_count=10\n" + "while test $loop_counter -le $max_count; do\n" + " loop_counter=`expr $loop_counter + 1`\n" + " if test ! -f $STARTPIDFILE ; then\n" + " sleep 1;\n" + " else\n" + " PID=`cat $STARTPIDFILE`\n" + " fi\n" + "done\n" + "if test ! -f $STARTPIDFILE ; then\n" + " echo Server failed to start !!! Please check errors log for problems\n" + " exit 1\n" + "fi\n" + "loop_counter=1\n" + "# wait for 10 minutes (600 times 1 seconds)\n" + "max_count=600\n" /* 10 minutes */ + "while test $loop_counter -le $max_count; do\n" + " loop_counter=`expr $loop_counter + 1`\n" + " if test ! -f $PIDFILE ; then\n" + " if kill -0 $PID > /dev/null 2>&1 ; then\n" + " sleep 1\n" + " else\n" + " echo Server failed to start !!! Please check errors log for problems\n" + " exit 1\n" + " fi\n" + " else\n" + " PID=`cat $PIDFILE`\n" + /* rbyrne: setupsdk takes any message here as an error: + " echo Server has been started. ns-slapd process started: $PID\n"*/ + " exit 0;\n" + " fi\n" + "done\n" + "echo Server not running!! Failed to start ns-slapd process. Please check the errors log for problems.\n" + "exit 1\n", + sroot, subdir, subdir, sroot, PRODUCT_NAME, PRODUCT_BIN, subdir, + subdir + ); + } + if(t) return t; + + t = gen_script(subdir, STOP_SCRIPT, + "\n" + "# Script that stops the ns-slapd server.\n" + "# Exit status can be:\n" + "# 0: Server stopped successfully\n" + "# 1: Server could not be stopped\n" + "# 2: Server was not running\n" + "\n" + "PIDFILE=%s/logs/pid\n" + "if test ! -f $PIDFILE ; then\n" + " echo No ns-slapd PID file found. Server is probably not running\n" + " exit 2\n" + "fi\n" + "PID=`cat $PIDFILE`\n" + "# see if the server is already stopped\n" + "kill -0 $PID > /dev/null 2>&1 || {\n" + " echo Server not running\n" + " if test -f $PIDFILE ; then\n" + " rm -f $PIDFILE\n" + " fi\n" + " exit 2\n" + "}\n" + "# server is running - kill it\n" + "kill $PID\n" + "loop_counter=1\n" + "# wait for 10 minutes (600 times 1 second)\n" + "max_count=600\n" /* 10 minutes */ + "while test $loop_counter -le $max_count; do\n" + " loop_counter=`expr $loop_counter + 1`\n" + " if kill -0 $PID > /dev/null 2>&1 ; then\n" + " sleep 1;\n" + " else\n" + " if test -f $PIDFILE ; then\n" + " rm -f $PIDFILE\n" + " fi\n" + /* rbyrne: setupsdk takes any message here as an error: + " echo Server has been stopped. ns-slapd process stopped: $PID\n"*/ + " exit 0\n" + " fi\n" + "done\n" + "if test -f $PIDFILE ; then\n" + " echo Server still running!! Failed to stop the ns-slapd process: $PID. Please check the errors log for problems.\n" + "fi\n" + "exit 1\n", + subdir); + if(t) return t; + + t = gen_script(subdir, RESTART_SCRIPT, + "\n" + "# Script that restarts the ns-slapd server.\n" + "# Exit status can be:\n" + "# 0: Server restarted successfully\n" + "# 1: Server could not be started\n" + "# 2: Server started successfully (was not running)\n" + "# 3: Server could not be stopped\n" + "\n" + "server_already_stopped=0\n" + "%s/stop-slapd\n" + "status=$?\n" + "if [ $status -eq 1 ] ; then\n" + " exit 3;\n" + "else\n" + " if [ $status -eq 2 ] ; then\n" + " server_already_stopped=1\n" + " fi\n" + "fi\n" + "%s/start-slapd\n" + "status=$?\n" + "if [ $server_already_stopped -eq 1 ] && [ $status -eq 0 ] ; then\n" + " exit 2;\n" + "fi\n" + "exit $status\n", + subdir, subdir ); + if(t) return t; + + /* logs subdir owned by server user */ + if( (t = chownlogs(subdir, cf->servuser)) ) + return t; + + /* config subdir owned by server user */ + if( (t = chownconfig(subdir, cf->servuser)) ) + return t; +#if defined( SOLARIS ) + if (iDSISolaris) { + /* Need to change owner of the etc link too */ + if( (t = chownconfig(subdiretc, cf->servuser)) ) + return t; + } +#endif /* SOLARIS */ + + +#else /* XP_WIN32 */ + /* Windows platforms have some extra setup */ + if( (t = setup_ntserver(cf)) ) + return t; + + /* generate start script */ + t = gen_script(subdir, START_SCRIPT".bat", "net start slapd-%s\n", cf->servid); + if(t) return t; + + /* generate stop script */ + t = gen_script(subdir, STOP_SCRIPT".bat", "net stop slapd-%s\n", cf->servid); + if(t) return t; + + /* generate restart script */ + t = gen_script(subdir, RESTART_SCRIPT".bat", "net stop slapd-%s\n" + "net start slapd-%s\n", cf->servid, cf->servid); + if(t) return t; + + +#endif /* XP_WIN32 */ + +#ifdef XP_WIN32 + + if ( INFO_GetOperatingSystem () == OS_WINNT ) { + + if( (t = add_ntservice(cf)) ) + return t; + } +#endif + + /* Create subdirectories and config files for directory server */ + if( (t = install_ds(sroot, cf, param_name)) ) + return t; + + /* XXXrobm using link to start script instead of automatically doing it */ + return NULL; +} + + + + +/* ------------------------- Copied from libadmin ------------------------- */ + + +/* + These replace the versions in libadmin to allow error returns. + + XXXrobm because libadmin calls itself a lot, I'm replacing ALL the + functions this file requires + */ + + +int create_instance_exists(char *fn) +{ + struct stat finfo; + + if(stat(fn, &finfo) < 0) + return 0; + else + return 1; +} + + +int create_instance_mkdir(char *dir, int mode) +{ + if(!create_instance_exists(dir)) { +#ifdef XP_UNIX + if(mkdir(dir, mode) == -1) +#else /* XP_WIN32 */ + if(!CreateDirectory(dir, NULL)) +#endif /* XP_WIN32 */ + return -1; + } + return 0; +} + + +char *create_instance_mkdir_p(char *dir, int mode) +{ + static char errmsg[ERR_SIZE]; + struct stat fi; + char *t; + +#ifdef XP_UNIX + t = dir + 1; +#else /* XP_WIN32 */ + t = dir + 3; +#endif /* XP_WIN32 */ + + while(1) { + t = strchr(t, FILE_PATHSEP); + + if(t) *t = '\0'; + if(stat(dir, &fi) == -1) { + if(create_instance_mkdir(dir, mode) == -1) { + sprintf(errmsg, "mkdir %s failed (%s)", dir, ds_system_errmsg()); + return errmsg; + } + } + if(t) + { + *t = FILE_PATHSEP; + LDAP_UTF8INC(t); + } + else break; + } + return NULL; +} + + +int create_instance_numbers(char *target) +{ + char *p; + for(p=target; *p; LDAP_UTF8INC(p) ) + { + if(!ldap_utf8isdigit(p)) + return 0; + } + return 1; +} + +#if defined( SOLARIS ) +/* + * Solaris 9+ specific installation + */ +int create_instance_symlink(char *actualpath, char *sympath) +{ + if(symlink(actualpath, sympath) == -1) + return -1; + return 0; +} +#endif /* SOLARIS */ + + +/* --------------------------------- try* --------------------------------- */ + + +/* robm This doesn't use net_ abstractions because they drag in SSL */ +int trybind(char *addr, int port) +{ + int sd; + struct sockaddr_in sa_server; + int one = 1, ret; + +#ifdef XP_WIN32 + WSADATA wsd; + + if(WSAStartup(MAKEWORD(1, 1), &wsd) != 0) + return -1; +#endif + + if ((sd = socket(AF_INET,SOCK_STREAM,IPPROTO_TCP)) == -1) + goto you_lose; + + if (addr == NULL) + addr = "127.0.0.1"; /* use the local loopback address */ + + memset((char *) &sa_server, 0, sizeof(sa_server)); + sa_server.sin_family=AF_INET; + sa_server.sin_addr.s_addr = inet_addr(addr); + sa_server.sin_port=htons((short)port); + ret = connect(sd, (struct sockaddr *) &sa_server,sizeof(sa_server)); + if (ret == -1) + ret = 0; /* could not connect, so port is not in use; that's good */ + else + { + ret = -1; /* connection succeeded, port in use, bad */ + errno = EADDRINUSE; + } +#ifdef XP_UNIX + close(sd); +#else + closesocket(sd); + WSACleanup(); +#endif + return ret; + + you_lose: +#ifdef XP_WIN32 + WSACleanup(); +#endif + return -1; +} + + +#ifdef XP_UNIX +#include +#include + +int tryuser(char *user) +{ + struct passwd *pw; + char fn[128]; + int fd, ret; + + setpwent(); + if(!(pw = getpwnam(user))) + return -1; + + endpwent(); + + if(geteuid()) + return 0; + + sprintf(fn, "/tmp/trychown.%ld", (long)getpid()); + if( (fd = creat(fn, 0777)) == -1) + return 0; /* Hmm. */ + ret = chown(fn, pw->pw_uid, pw->pw_gid); + close(fd); + unlink(fn); + return (ret == -1 ? -2 : 0); +} +#endif /* XP_UNIX */ + + +/* --------------------------- create_instance_check* ---------------------------- */ + + +char *create_instance_checkport(char *addr, char *sport) +{ + int port; + + port = atoi(sport); + if((port < 1) || (port > 65535)) { + return ("Valid port numbers are between 1 and 65535"); + } + if(trybind(addr, port) == -1) { + if(errno == EADDRINUSE) { + return make_error("Port %d is already in use", port); + } + /* XXXrobm if admin server not running as root, you lose. */ + else if(errno == EACCES) { + return ("Ports below 1024 require super user access. " + "You must run the installation as root to install " + "on that port."); + } else { + ds_report_warning(DS_WARNING, "port", "That port is not available"); + } + } + return NULL; +} + +#ifdef XP_UNIX +char *create_instance_checkuser(char *user) +{ + if (user && *user) switch(tryuser(user)) { + case -1: + return make_error ("Can't find a user named '%s'." + "\nPlease select or create another user.", + user); + case -2: + return make_error ("Can't change a file to be owned by %s." + "\nPlease select or create another user.", + user); + } + return NULL; +} +#endif + + +/* --------------------------------- copy --------------------------------- */ + +#define COPY_BUFFER_SIZE 4096 + +#ifdef XP_UNIX + + +char *create_instance_copy(char *sfile, char *dfile, int mode) +{ + int sfd, dfd, len; + struct stat fi; + + char copy_buffer[COPY_BUFFER_SIZE]; + unsigned long read_len; + +/* Make sure we're in the right umask */ + umask(022); + + if( (sfd = open(sfile, O_RDONLY)) == -1) + return make_error("Cannot open %s for reading (%s)", sfile, + ds_system_errmsg()); + + fstat(sfd, &fi); + if(!(S_ISREG(fi.st_mode))) { + close(sfd); + return make_error("%s is not a regular file", sfile); + } + len = fi.st_size; + + if( (dfd = open(dfile, O_RDWR | O_CREAT | O_TRUNC, mode)) == -1) + return make_error("Cannot open file %s for writing (%s)", dfile, + ds_system_errmsg()); + + while(len) { + read_len = len>COPY_BUFFER_SIZE?COPY_BUFFER_SIZE:len; + + if ( (read_len = read(sfd, copy_buffer, read_len)) == -1) { + make_error("Cannot read from file %s (%s)", + sfile, ds_system_errmsg()); + } + + if ( write(dfd, copy_buffer, read_len) != read_len) { + make_error("Error writing to file %s from copy of %s (%s)", + dfile, sfile, ds_system_errmsg()); + } + + len -= read_len; + } + close(sfd); + close(dfd); + /* BERT! */ + return NULL; +} + +#else /* XP_WIN32 */ +char *create_instance_copy(char *sfile, char *dfile, int mode) +{ + HANDLE sfd, dfd, MapHandle; + PCHAR fp; + PCHAR fpBase; + DWORD BytesWritten = 0; + DWORD len; + + if( (sfd = CreateFile(sfile, GENERIC_READ, + FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, + OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) + == INVALID_HANDLE_VALUE) { + return make_error("Cannot open file %s for reading (%s)", sfile, + ds_system_errmsg()); + } + len = GetFileSize(sfd, NULL); + if( (MapHandle = CreateFileMapping(sfd, NULL, PAGE_READONLY, + 0, 0, NULL)) == NULL) { + return make_error("Cannot create file mapping of %s (%s)", sfile, + ds_system_errmsg()); + } + if (!(fpBase = fp = MapViewOfFile(MapHandle, FILE_MAP_READ, 0, 0, 0))) { + return make_error("Cannot map file %s (%s)", sfile, ds_system_errmsg()); + } + if( (dfd = CreateFile(dfile, GENERIC_READ | GENERIC_WRITE, + FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,OPEN_ALWAYS, + FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) { + return make_error("Cannot open destination file %s for writing (%s)", + dfile, ds_system_errmsg()); + } + while ( len) { + if(!WriteFile(dfd, fp, len, &BytesWritten, NULL)) { + return ("Cannot write new file %s (%s)", dfile, ds_system_errmsg()); + } + len -= BytesWritten; + fp += BytesWritten; + } + CloseHandle(sfd); + UnmapViewOfFile(fpBase); + CloseHandle(MapHandle); + FlushFileBuffers(dfd); + CloseHandle(dfd); + /* BERT! */ + return NULL; +} +#endif + +static int +file_is_type_x(const char *dirname, const char *filename, PRFileType x) +{ + struct PRFileInfo inf; + int status = 0; + int size = strlen(dirname) + strlen(filename) + 2; /* 1 for slash + 1 for null */ + char *fullpath = calloc(sizeof(char), size); + + sprintf(fullpath, "%s/%s", dirname, filename); + if (PR_SUCCESS == PR_GetFileInfo(fullpath, &inf) && + inf.type == x) + status = 1; + + free(fullpath); + + return status; +} + +/* return true if the given path and file corresponds to a directory */ +static int +is_a_dir(const char *dirname, const char *filename) +{ + return file_is_type_x(dirname, filename, PR_FILE_DIRECTORY); +} + +/* return true if the given path and file corresponds to a regular file */ +static int +is_a_file(const char *dirname, const char *filename) +{ + return file_is_type_x(dirname, filename, PR_FILE_FILE); +} + +static char * +ds_copy_group_files_using_mode(char *src_dir, char *dest_dir, + char *filter, int use_mode) +{ + char *t = 0; + PRDir *ds = 0; + PRDirEntry *d = 0; + char src_file[PATH_SIZE], dest_file[PATH_SIZE], fullname[PATH_SIZE]; + + if(!(ds = PR_OpenDir(src_dir))) { + return make_error("Can't read directory %s (%s)", src_dir, ds_system_errmsg()); + } + while( (d = PR_ReadDir(ds, 0)) ) { + if(d->name[0] != '.') { + if(!filter || strstr(d->name, filter)) { + sprintf(fullname, "%s/%s", src_dir, d->name); + if(PR_SUCCESS != PR_Access(fullname, PR_ACCESS_EXISTS)) + continue; + sprintf(src_file, "%s%c%s", src_dir, FILE_PATHSEP, d->name); + sprintf(dest_file, "%s%c%s", dest_dir, FILE_PATHSEP, d->name); + if(is_a_dir(src_dir, d->name)) { + char *sub_src_dir = strdup(src_file); + char *sub_dest_dir = strdup(dest_file); + if( (t = create_instance_mkdir_p(sub_dest_dir, NEWDIR_MODE)) ) + return(t); + if( (t = ds_copy_group_files_using_mode(sub_src_dir, sub_dest_dir, filter, use_mode)) ) + return t; + free(sub_src_dir); + free(sub_dest_dir); + } + else { + if( (t = create_instance_copy(src_file, dest_file, use_mode)) ) + return t; + } + } + } + } + PR_CloseDir(ds); + return(NULL); +} + +static char * +ds_copy_group_files(char *src_dir, char *dest_dir, char *filter) +{ + return ds_copy_group_files_using_mode(src_dir, dest_dir, filter, + NEWFILE_MODE); +} + +static char * +ds_copy_group_bins(char *src_dir, char *dest_dir, char *filter, + int use_mode) +{ + return ds_copy_group_files_using_mode(src_dir, dest_dir, filter, + NEWSCRIPT_MODE); +} + +/* 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 based on libldap/tmplout.c:strcat_escaped */ +void fputs_escaped(char *s, FILE *fp) +{ + char *hexdig = "0123456789ABCDEF"; + register unsigned char c; + for ( ; c = *(unsigned char*)s; ++s ) { + if ( HREF_CHAR_ACCEPTABLE( c )) { + putc( c, fp ); + } else { + fprintf( fp, "%%%c%c", hexdig[ (c >> 4) & 0x0F ], hexdig[ c & 0x0F ] ); + } + } +} + +/* ------------- Create config files for Directory Server -------------- */ + +char *ds_cre_subdirs(char *sroot, server_config_s *cf, char *cs_path, + struct passwd* pw) +{ + char subdir[PATH_SIZE], *t = NULL; + + /* create subdir /db */ + sprintf(subdir, "%s%cdb", cs_path, FILE_PATHSEP); + if( (t = create_instance_mkdir_p(subdir, NEWDIR_MODE)) ) + return(t); + chownfile (pw, subdir); + + /* create subdir /ldif */ + sprintf(subdir, "%s%cldif", cs_path, FILE_PATHSEP); + if( (t = create_instance_mkdir_p(subdir, NEWDIR_MODE)) ) + return(t); + chownfile (pw, subdir); + + /* create subdir /dsml */ + sprintf(subdir, "%s%cdsml", cs_path, FILE_PATHSEP); + if( (t = create_instance_mkdir_p(subdir, NEWDIR_MODE)) ) + return(t); + chownfile (pw, subdir); + + /* create subdir /bak */ + sprintf(subdir, "%s%cbak", cs_path, FILE_PATHSEP); + if( (t = create_instance_mkdir_p(subdir, NEWDIR_MODE)) ) + return(t); + chownfile (pw, subdir); + + /* Create slapd-nickname/confbak directory */ + sprintf(subdir, "%s%cconfbak", cs_path, FILE_PATHSEP); + if( (t=create_instance_mkdir_p(subdir, NEWDIR_MODE)) ) + return(t); + chownfile (pw, subdir); + + /* create subdir /dsgw/context */ + sprintf(subdir, "%s%cclients", sroot, FILE_PATHSEP); + if (is_a_dir(subdir, "dsgw")) { /* only create dsgw stuff if we are installing it */ + sprintf(subdir, "%s%cclients%cdsgw%ccontext", sroot, FILE_PATHSEP,FILE_PATHSEP,FILE_PATHSEP); + if( (t = create_instance_mkdir_p(subdir, NEWDIR_MODE)) ) + return(t); + } + + /* create subdir /bin/slapd/authck */ + sprintf(subdir, "%s%cbin%cslapd%cauthck", sroot, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP); + if( (t = create_instance_mkdir_p(subdir, NEWDIR_MODE)) ) + return(t); +#if defined( SOLARIS ) + /* + * Solaris 9+ specific installation + */ + if (iDSISolaris) + logUninstallInfo(sroot, PRODUCT_NAME, PRODUCT_NAME, subdir); +#endif /* SOLARIS */ + + return (t); +} + +#define CREATE_LDIF2DB() \ + gen_perl_script_auto(mysroot, mycs_path, "ldif2db.pl", cf) + +#define CREATE_DB2INDEX() \ + gen_perl_script_auto(mysroot, mycs_path, "db2index.pl", cf) + +#define CREATE_DB2LDIF() \ + gen_perl_script_auto(mysroot, mycs_path, "db2ldif.pl", cf) + +#define CREATE_DB2BAK() \ + gen_perl_script_auto(mysroot, mycs_path, "db2bak.pl", cf) + +#define CREATE_BAK2DB() \ + gen_perl_script_auto(mysroot, mycs_path, "bak2db.pl", cf) + +#define CREATE_VERIFYDB() \ + gen_perl_script_auto(mysroot, mycs_path, "verify-db.pl", cf) + +#define CREATE_REPL_MONITOR_CGI() \ + gen_perl_script_auto(mysroot, cgics_path, "repl-monitor-cgi.pl", cf) + +#define CREATE_ACCOUNT_INACT(_commandName) \ + gen_perl_script_auto(mysroot, cs_path, _commandName, cf) + +#define CREATE_DSML() \ + gen_perl_script_auto(mysroot, mycs_path, "dsml-activate.pl", cf) + +#define CREATE_MIGRATETO5() \ + gen_perl_script_auto_for_migration(mysroot, mycs_path, "migrateTo5", cf) + +#define CREATE_MIGRATE50TO51() \ + gen_perl_script_auto_for_migration(mysroot, mycs_path, "migrate50to51", cf) + +#define CREATE_MIGRATEINSTANCE5() \ + gen_perl_script_auto_for_migration(mysroot, mycs_path, "migrateInstance5", cf) + +#define CREATE_MIGRATE5TO6() \ + gen_perl_script_auto_for_migration(mysroot, mycs_path, "migrate5to6", cf) + +#define CREATE_MIGRATEINSTANCE6() \ + gen_perl_script_auto_for_migration(mysroot, mycs_path, "migrateInstance6", cf) + +#define CREATE_MIGRATETO6() \ + gen_perl_script_auto_for_migration(mysroot, mycs_path, "migrateTo6", cf) + +#define CREATE_MIGRATE5TO7() \ + gen_perl_script_auto_for_migration(mysroot, mycs_path, "migrate5to7", cf) + +#define CREATE_MIGRATE6TO7() \ + gen_perl_script_auto_for_migration(mysroot, mycs_path, "migrate6to7", cf) + +#define CREATE_MIGRATEINSTANCE7() \ + gen_perl_script_auto_for_migration(mysroot, mycs_path, "migrateInstance7", cf) + +#define CREATE_MIGRATETO7() \ + gen_perl_script_auto_for_migration(mysroot, mycs_path, "migrateTo7", cf) + +#define CREATE_NEWPWPOLICY() \ + gen_perl_script_auto(mysroot, mycs_path, "ns-newpwpolicy.pl", cf) + +#ifdef XP_UNIX +char *ds_gen_scripts(char *sroot, server_config_s *cf, char *cs_path) +{ + char *t = NULL; + char server[PATH_SIZE], admin[PATH_SIZE], tools[PATH_SIZE]; + char cgics_path[PATH_SIZE]; + char *cl_scripts[7] = {"dsstop", "dsstart", "dsrestart", "dsrestore", "dsbackup", "dsimport", "dsexport"}; + char *cl_javafiles[7] = {"DSStop", "DSStart", "DSRestart", "DSRestore", "DSBackup", "DSImport", "DSExport"}; + int cls = 0; /*Index into commandline script names and java names - RJP*/ + char *mysroot, *mycs_path; + +#if defined( SOLARIS ) + /* + * Solaris 9+ specific installation + */ + char fn[PATH_SIZE]; +#endif /* SOLARIS */ + + mysroot = sroot; + mycs_path = cs_path; + + sprintf(server, "%s/bin/"PRODUCT_NAME"/server", sroot); + sprintf(admin, "%s/bin/"PRODUCT_NAME"/admin/bin", sroot); + sprintf(tools, "%s/shared/bin", sroot); + sprintf(cgics_path, "%s%cbin%cadmin%cadmin%cbin", sroot, + FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP); + + t = gen_script(cs_path, "monitor", + "if [ \"x$1\" != \"x\" ];\nthen MDN=\"$1\";\nelse MDN=\"cn=monitor\";\n fi\n" + + "cd %s\nPATH=%s:$PATH;export PATH\n" + "ldapsearch -p %s -b \"$MDN\" -s base \"objectClass=*\"\n", + tools, tools, cf->servport); + if(t) return t; + + t = gen_script(cs_path, "saveconfig", + "cd %s\n" + "echo saving configuration ...\n" + "conf_ldif=%s/confbak/`date +%%Y_%%m_%%d_%%H%%M%%S`.ldif\n" + "./ns-slapd db2ldif -N -D %s " + "-s \"%s\" -a $conf_ldif -n NetscapeRoot 2>&1\n" + "if [ \"$?\" -ge 1 ] \nthen\n" + " echo Error occurred while saving configuration\n" + " exit 1\n" + "fi\n" + "exit 0\n", + server, cs_path, cs_path, cf->netscaperoot); + if(t) return t; + + t = gen_script(cs_path, "restoreconfig", + "cd %s\n" + "conf_ldif=`ls -1t %s/confbak/*.ldif | head -1`\n" + "if [ -z \"$conf_ldif\" ]\n" + "then\n" + " echo No configuration to restore in %s/confbak ; exit 1\n" + "fi\n" + "echo Restoring $conf_ldif\n" + "./ns-slapd ldif2db -D %s" + " -i $conf_ldif -n NetscapeRoot 2>&1\n" + "exit $?\n", + server, cs_path, cs_path, cs_path); + if(t) return t; + + t = gen_script(cs_path, "ldif2db", + "cd %s\n" + "if [ $# -lt 4 ]\nthen\n" + "\techo \"Usage: ldif2db -n backend_instance | {-s includesuffix}* [{-x excludesuffix}*]\"\n" + "\techo \" {-i ldiffile}* [-O]\"\n" + "\techo \"Note: either \\\"-n backend_instance\\\" or \\\"-s includesuffix\\\" and \\\"-i ldiffile\\\" are required.\"\n" + "\texit 1\n" + "fi\n\n" + "echo importing data ...\n" + "./ns-slapd ldif2db -D %s \"$@\" 2>&1\n" + "exit $?\n", + server, cs_path); + if(t) return t; + +#if defined(UPGRADEDB) + t = gen_script(cs_path, "upgradedb", + "cd %s\n" + "if [ \"$#\" -eq 1 ]\nthen\n" + "\tbak_dir=$1\nelse\n" + "\tbak_dir=%s/bak/upgradedb_`date +%%Y_%%m_%%d_%%H_%%M_%%S`\nfi\n\n" + "echo upgrade index files ...\n" + "./ns-slapd upgradedb -D %s -a $bak_dir\n", + server, cs_path, cs_path); + if(t) return t; +#endif + + /* new code for dsml import */ + t = gen_script(cs_path, "dsml2db", + "cd %s\n" + "if [ $# -lt 4 ]\nthen\n" + "\techo \"Usage: dsml2db -n backend_instance | {-s includesuffix}* [{-x excludesuffix}*]\"\n" + "\techo \" {-i dsmlfile}\"\n" + "\techo \"Note: either \\\"-n backend_instance\\\" or \\\"-s includesuffix\\\" and \\\"-i dsmlfile\\\" are required.\"\n" + "\texit 1\n" + "fi\n\n" + "set_dsml=0\n" + "dsml_file=\"mydummy\"\n" + "space=\" \"\n" + "i=0\n" + "for arg in \"$@\"\ndo\n" + "\tif [ \"$arg\" = '-i' ];\n\tthen\n" + "\t\tset_dsml=1\n" + "\telif [ $set_dsml -eq 1 ];\n\tthen\n" + "\t\tdsml_file=$arg\n" + "\t\tset_dsml=2\n" + "\telse\n" + "\t\teval a$i=\\\"$arg\\\"\n" + "\t\ti=`expr $i + 1`\n" + "\tfi\n" + "done\n" + "max=$i; i=0;\n" + "shift $#\n" + "while [ $i -lt $max ]; do\n" + "\teval arg=\\$a$i\n" + "\tset -- \"$@\" \"$arg\"\n" + "\ti=`expr $i + 1`\n" + "done\n" + "\tif [ $dsml_file = \"mydummy\" ]\n\tthen\n\t" + "echo \"Need a DSML file as input\"" + "\n\t\t exit 1" + "\n\tfi\n" + "\tif [ -f $dsml_file ] && [ -r $dsml_file ]\n\tthen\n" + "\t\t%s/bin/base/jre/bin/java -Dverify=true -classpath %s/java/jars/crimson.jar:%s/java/ldapjdk.jar:%s/java/jars/xmltools.jar com.netscape.xmltools.DSML2LDIF $dsml_file\n" + "\t\tif [ $? = 0 ]; then\n" + "\t\techo importing data ...\n" + "\t\t%s/bin/base/jre/bin/java -classpath %s/java/jars/crimson.jar:%s/java/ldapjdk.jar:%s/java/jars/xmltools.jar com.netscape.xmltools.DSML2LDIF $dsml_file | ./ns-slapd ldif2db -D %s \"$@\" -i -\n" + "\t\texit $?\n" + "\t\tfi\n" + "\telse\n" + "\t\techo \"File $dsml_file invalid. Absolute path is required.\"\n\t\texit 1\n" + "\tfi\n", + server,sroot,sroot,sroot,sroot,sroot,sroot,sroot,sroot,cs_path); + if(t) return t; + + t = gen_script(cs_path, "ldif2ldap", + "cd %s\n" + "./ldapmodify -a -p %s -D \"$1\" -w \"$2\" -f $3\n", + tools, cf->servport); + if(t) return t; + + t = CREATE_LDIF2DB(); + if(t) return t; + + t = CREATE_DB2INDEX(); + if(t) return t; +/* + t = CREATE_MIGRATETO5(); + if(t) return t; + + t = CREATE_MIGRATE50TO51(); + if(t) return t; + + t = CREATE_MIGRATEINSTANCE5(); + if(t) return t; + + t = CREATE_MIGRATE5TO6(); + if(t) return t; + + t = CREATE_MIGRATEINSTANCE6(); + if(t) return t; + + t = CREATE_MIGRATETO6(); + if(t) return t; +*/ + + t = CREATE_MIGRATE5TO7(); + if(t) return t; + + t = CREATE_MIGRATE6TO7(); + if(t) return t; + + t = CREATE_MIGRATEINSTANCE7(); + if(t) return t; + + t = CREATE_MIGRATETO7(); + if(t) return t; + + t = gen_script(cs_path, "getpwenc", + "cd %s\n" + "PATH=%s:$PATH;export PATH\n" + "if [ $# -lt 2 ]\n" + "then\n" + "\techo \"Usage: getpwenc scheme passwd\"\n" + "\texit 1\n" + "fi\n\n" + "pwdhash -D %s -H -s \"$@\"\n", + server, server, cs_path); + if(t) return t; + + t = gen_script(cs_path, "db2ldif", + "cd %s\n" + "if [ \"$#\" -lt 2 ];\nthen\n" + "\techo \"Usage: db2ldif {-n backend_instance}* | {-s includesuffix}*\"\n" + "\techo \" [{-x excludesuffix}*] [-a outputfile]\"\n" + "\techo \" [-N] [-r] [-C] [-u] [-U] [-m] [-M] [-1]\"\n" + "\techo \"Note: either \\\"-n backend_instance\\\" or \\\"-s includesuffix\\\" is required.\"\n" + "\texit 1\n" + "fi\n\n" + "set_ldif=0\n" + "ldif_file=\"mydummy\"\n" + "for arg in \"$@\"\ndo\n" + "\tif [ \"$arg\" = '-a' ];\n\tthen\n" + "\t\tset_ldif=1\n" + "\telif [ $set_ldif -eq 1 ];\n\tthen\n" + "\t\tldif_file=$arg\n" + "\t\tset_ldif=2\n" + "\tfi\n" + "done\n" + "if [ $ldif_file = \"mydummy\" ]\nthen\n" + "\tldif_file=%s/ldif/`date +%%Y_%%m_%%d_%%H%%M%%S`.ldif\nfi\n" + "if [ $set_ldif -eq 2 ]\nthen\n" + "./ns-slapd db2ldif -D %s \"$@\"\nelse\n" + "./ns-slapd db2ldif -D %s -a $ldif_file \"$@\"\nfi\n", + server, cs_path, cs_path, cs_path); + if(t) return t; + + /* new code for dsml export */ + t = gen_script(cs_path, "db2dsml", + "cd %s\n" + "if [ \"$#\" -lt 2 ];\nthen\n" + "\techo \"Usage: db2dsml {-n backend_instance} | {-s includesuffix}*\"\n" + "\techo \" [{-x excludesuffix}*] [-a outputfile]\"\n" + "\techo \" [-u]\"\n" + "\techo \"Note: either \\\"-n backend_instance\\\" or \\\"-s includesuffix\\\" is required.\"\n" + "\texit 1\n" + "fi\n\n" + "set_dsml=0\n" + "dsml_file=\"mydummy\"\n" + "arg_list=\"\"\n" + "space=\" \"\n" + "for arg in \"$@\"\ndo\n" + "\tif [ \"$arg\" = '-a' ];\n\tthen\n" + "\t\tset_dsml=1\n" + "\telif [ $set_dsml -eq 1 ];\n\tthen\n" + "\t\tdsml_file=$arg\n" + "\t\tset_dsml=2\n" + "\telse\n" + "\t\targ_list=$arg_list$space$arg\n" + "\tfi\n" + "done\n" + "if [ $dsml_file = \"mydummy\" ]\nthen\n" + "\tdsml_file=%s/dsml/`date +%%Y_%%m_%%d_%%H%%M%%S`.dsml\n" + "\techo dsmlfile: $dsml_file\n" + "fi\n" + "%s/bin/base/jre/bin/java -Dverify=true -classpath %s/java/ldapjdk.jar:%s/java/jars/xmltools.jar com.netscape.xmltools.LDIF2DSML -s -o $dsml_file \n" + "if [ $? = 0 ]; then\n" + "\t./ns-slapd db2ldif -D %s \"$@\" -a - | %s/bin/base/jre/bin/java -classpath %s/java/ldapjdk.jar:%s/java/jars/xmltools.jar com.netscape.xmltools.LDIF2DSML -s -o $dsml_file \n" + "fi\n", + server, cs_path, sroot, sroot, sroot, cs_path, sroot, sroot, sroot); + if(t) return t; + + t = CREATE_DB2LDIF(); + if(t) return t; + +#if defined(UPGRADEDB) + t = gen_script(cs_path, "db2index", + "cd %s\n" + "if [ $# -eq 0 ]\n" + "then\n" + "\tbak_dir=%s/bak/reindex_`date +%%Y_%%m_%%d_%%H_%%M_%%S`\n" + "\t./ns-slapd upgradedb -D %s -f -a \"$bak_dir\"\n" + "elif [ $# -lt 4 ]\n" + "then\n" + "\techo \"Usage: db2index [-n backend_instance | {-s includesuffix}* -t attribute[:indextypes[:matchingrules]] -T vlvattribute]\"\n" + "\texit 1\n" + "else\n" + "\t./ns-slapd db2index -D %s \"$@\"\n" + "fi\n\n", + server, cs_path, cs_path, cs_path); + if(t) return t; +#endif + + t = gen_script(cs_path, "vlvindex", + "cd %s\n" + "if [ $# -lt 4 ]\n" + "then\n" + "\techo \"Usage: vlvindex -n backend_instance | {-s includesuffix}* -T attribute\"\n" + "\techo Note: either \\\"-n backend_instance\\\" or \\\"-s includesuffix\\\" are required.\n" + "\texit 1\n" + "fi\n\n" + "./ns-slapd db2index -D %s \"$@\"\n", + server, cs_path); + if(t) return t; + + t = gen_script(cs_path, "db2bak", + "cd %s\n" + "if [ \"$#\" -eq 1 ]\nthen\n" + "\tbak_dir=$1\nelse\n" + "\tbak_dir=%s/bak/`date +%%Y_%%m_%%d_%%H_%%M_%%S`\nfi\n\n" + "./ns-slapd db2archive -D %s -a $bak_dir\n", + server, cs_path, cs_path); + if(t) return t; + + t = CREATE_DB2BAK(); + if(t) return t; + + t = gen_script(cs_path, "bak2db", + "if [ \"$#\" -ne 1 ]\nthen\n" + " echo \"Usage: bak2db archivedir\"\n" + " exit 1\nfi\n\n" + "if [ 1 = `expr $1 : \"\\/\"` ]\nthen\n" + " archivedir=$1\n" + "else\n" + " # relative\n" + " cwd=`pwd`\n" + " archivedir=`echo $cwd/$1`\nfi\n\n" + "cd %s\n" + "./ns-slapd archive2db -D %s -a $archivedir\n", + server, cs_path); + if(t) return t; + + t = CREATE_BAK2DB(); + if(t) return t; + + t = CREATE_VERIFYDB(); + if(t) return t; + + t = CREATE_REPL_MONITOR_CGI(); + if(t) return t; + + t = CREATE_ACCOUNT_INACT("ns-inactivate.pl"); + if(t) return t; + + t = CREATE_ACCOUNT_INACT("ns-activate.pl"); + if(t) return t; + + t = CREATE_ACCOUNT_INACT("ns-accountstatus.pl"); + if(t) return t; + + t = CREATE_DSML(); + if(t) return t; + + t = CREATE_NEWPWPOLICY(); + if(t) return t; + + t = gen_script(cs_path, "suffix2instance", + "cd %s\n" + "if [ $# -lt 2 ]\n" + "then\n" + "\techo Usage: suffix2instance {-s includesuffix}*\n" + "\texit 1\n" + "fi\n\n" + "./ns-slapd suffix2instance -D %s \"$@\" 2>&1\n", + server, cs_path); + if(t) return t; + + /*Generate the java commandline tools in bin/slapd/server*/ + for (cls = 0; cls < 7; cls++) { + t = gen_script(server, cl_scripts[cls], + "cd %s\n\n" + "lang=${LANG:=en}\n" + "while [ $# -ge 1 ]\n" + "do\n" + " if [ $1 = '-l' ]\n" + " then\n" + " shift\n" + " lang=$1\n" + " else\n" + " arg=\"$arg $1\"\n" + " fi\n" + " shift\n" + "done\n" + "./bin/base/jre/bin/jre -classpath ./bin/base/jre/lib:" + "./bin/base/jre/lib/rt.jar:./bin/base/jre/lib/i18n.jar:" + "./java/base.jar:./java/jars/ds40.jar:./java/jars/ds40_${lang}.jar:" + "./java/swingall.jar:./java/ssl.zip:" + "./java/ldapjdk.jar:./java/mcc40.jar:./java/mcc40_${lang}.jar:" + "./java/nmclf40.jar:./java/nmclf40_${lang}.jar" + " com.netscape.admin.dirserv.cmdln.%s $arg\n", + sroot, cl_javafiles[cls]); + if(t) return t; +#if defined( SOLARIS ) + /* + * Solaris 9+ specific installation + */ + if (iDSISolaris) + { + sprintf(fn, "%s/%s", server, cl_scripts[cls]); + logUninstallInfo(sroot, PRODUCT_NAME, PRODUCT_NAME, fn); + } +#endif /* SOLARIS */ + + } + + + + return (t); +} +#else +char *ds_gen_scripts(char *sroot, server_config_s *cf, char *cs_path) +{ + char *t = NULL; + char server[PATH_SIZE], admin[PATH_SIZE], tools[PATH_SIZE]; + char cgics_path[PATH_SIZE]; + char *cl_scripts[7] = {"dsstop.bat", "dsstart.bat", "dsrestart.bat", "dsrestore.bat", "dsbackup.bat", "dsimport.bat", "dsexport.bat"}; + char *cl_javafiles[7] = {"DSStop", "DSStart", "DSRestart", "DSRestore", "DSBackup", "DSImport", "DSExport"}; + int cls = 0; /*Index into commandline script names and java names - RJP*/ + char *mysroot, *mycs_path; + + { + char *p, *q; + int n; + + for (n = 0, p = sroot; p = strchr(p, '/'); n++, p++) ; + for (p = sroot; p = strchr(p, '\\'); n++, p++) ; + mysroot = (char *)malloc(strlen(sroot) + n + 1); + for (p = sroot, q = mysroot; *p; p++, q++) { + if ('/' == *p || '\\' == *p) { + *q++ = '\\'; + *q = '\\'; + } else + *q = *p; + } + *q = '\0'; + + for (n = 0, p = cs_path; p = strchr(p, '/'); n++, p++) ; + for (p = cs_path; p = strchr(p, '\\'); n++, p++) ; + mycs_path = (char *)malloc(strlen(cs_path) + n + 1); + for (p = cs_path, q = mycs_path; *p; p++, q++) { + if ('/' == *p || '\\' == *p) { + *q++ = '\\'; + *q = '\\'; + } else + *q = *p; + } + *q = '\0'; + } + + sprintf(server, "%s/bin/"PRODUCT_NAME"/server", sroot); + sprintf(admin, "%s/bin/"PRODUCT_NAME"/admin/bin", sroot); + sprintf(tools, "%s/shared/bin", sroot); + sprintf(cgics_path, "%s/bin/admin/admin/bin", sroot); + + ds_unixtodospath( cs_path ); + ds_unixtodospath( server ); + ds_unixtodospath( admin ); + ds_unixtodospath( sroot ); + ds_unixtodospath( tools ); + ds_unixtodospath( cgics_path ); + + t = gen_script(cs_path, "monitor.bat", + "@echo off\n" + "setlocal\n" + "set rc=0\n" + "if %%1.==. goto noparam\n" + "\"%s\\ldapsearch\" -p %s -b %%1 " + "-s base \"objectClass=*\"\n" + "set rc=%%errorlevel%%\n" + "goto proceed\n" + ":noparam\n" + "\"%s\\ldapsearch\" -p %s -b \"cn=monitor\" " + "-s base \"objectClass=*\"\n" + "set rc=%%errorlevel%%\n" + ":proceed\n" + "if defined MKSARGS exit %%rc%%\n" + "exit /b %%rc%%\n", + tools, cf->servport, tools, cf->servport); + if(t) return t; + + t = gen_script(cs_path, "saveconfig.bat", + "@echo off\n" + "setlocal\n" + "set rc=0\n" + "PATH=\"%s\";%%PATH%%\n" + "namegen\n" + "call bstart\n" + "set config_ldif=%s\\confbak\\%%DATESTR%%.ldif\n" + "call bend\n" + "del bend.bat\n" + "slapd db2ldif -s \"%s\" -a \"%%config_ldif%%\" -N" + " -D \"%s\" -n NetscapeRoot 2>&1\n" + "set rc=%%errorlevel%%\n" + "if %%rc%%==0 goto done\n" + "echo Error occurred while saving configuration\n" + ":done\n" + "if defined MKSARGS exit %%rc%%\n" + "exit /b %%rc%%\n", + server, cs_path, cf->netscaperoot, cs_path); + if(t) return t; + + t = gen_script(cs_path, "restoreconfig.bat", + "@echo off\n" + "setlocal\n" + "set rc=0\n" + "PATH=\"%s\";%%PATH%%\n" + "set latestscript=%s\\latest_config.bat\n" + "if EXIST \"%%latestscript%%\" del \"%%latestscript%%\"\n" + "latest_file \"%s\\confbak\\*.ldif\" \"%%latestscript%%\"\n" + "if not EXIST \"%%latestscript%%\" goto noconfig\n" + "call \"%%latestscript%%\"\n" + "del \"%%latestscript%%\"\n" + "slapd ldif2db -D \"%s\" -i \"%%LATEST_FILE%%\"" + " -n NetscapeRoot 2>&1\n" + "set rc=%%errorlevel%%\n" + "if %%rc%%==0 goto done\n" + "echo Error occurred while saving configuration\n" + "goto done\n" + ":noconfig\n" + "set rc=0\n" /* no error */ + "echo No configuration to restore in %s\\confbak\n" + ":done\n" + "if defined MKSARGS exit %%rc%%\n" + "exit /b %%rc%%\n", + server, cs_path, cs_path, cs_path, cs_path); + if(t) return t; + + t = gen_script(cs_path, "ldif2db.bat", + "@if not \"%%echo%%\" == \"on\" echo off\n" + "setlocal\n" + "set rc=0\n" + "PATH=\"%s\";%%PATH%%\n\n" + "set noconfig=0\n" + "if [%%2] == [] goto incorrect\n" + "if [%%3] == [] goto incorrect\n" + "if [%%4] == [] goto incorrect\n\n" + "set args=\n" + ":getargs\n" + "if [%%1] == [] goto import\n" + "set args=%%args%% %%1\n" + "shift\n" + "goto getargs\n\n" + ":incorrect\n" + ":usage\n" + "echo \"Usage: ldif2db -n backend_instance | {-s \"includesuffix\"}* " + "{-i ldif-file}* [-O] [{-x \"excludesuffix\"}*]\"\n" + "set rc=1\n" + "goto done\n\n" + ":import\n" + "echo importing data ...\n" + "slapd ldif2db -D \"%s\" %%args%% 2>&1\n\n" + "set rc=%%errorlevel%%\n" + ":done\n" + "if defined MKSARGS exit %%rc%%\n" + "exit /b %%rc%%\n", + server, cs_path); + if(t) return t; + + /* new code for dsml import */ + t = gen_script(cs_path, "dsml2db.bat", + "@if not \"%%echo%%\" == \"on\" echo off\n" + "setlocal\n" + "set rc=0\n" + "PATH=\"%s\";%%PATH%%\n\n" + "set noconfig=0\n" + "if [%%2] == [] goto incorrect\n" + "if [%%3] == [] goto incorrect\n" + "if [%%4] == [] goto incorrect\n\n" + "set args=\n" + "goto getargs\n" + ":setdsml\n" + "set dsmlfile=\n" + "set dsmlfile=%%2\n" + "shift\n" + "shift\n" + "goto getargs\n" + ":getargs\n" + "if [%%1] == [] goto import\n" + "if [%%1] == [-i] goto setdsml\n" + "set args=%%args%% %%1\n" + "shift\n" + "goto getargs\n\n" + ":incorrect\n" + ":usage\n" + "echo \"Usage: dsml2db -n backend_instance | {-s \"includesuffix\"}* " + "{-i dsml-file} [{-x \"excludesuffix\"}*]\"\n" + "set rc=1\n" + "goto done\n\n" + ":import\n" + "%s\\bin\\base\\jre\\bin\\java -Dverify=true -classpath \".;%s\\java\\ldapjdk.jar;%s\\java\\jars\\crimson.jar;%s\\java\\jars\\xmltools.jar\" com.netscape.xmltools.DSML2LDIF %%dsmlfile%%\n" + "set rc=%%errorlevel%%\n" + "if %%rc%%==0 goto realimport else goto done\n" + ":realimport\n" + "echo importing data ...\n" + "%s\\bin\\base\\jre\\bin\\java -classpath \".;%s\\java\\ldapjdk.jar;%s\\java\\jars\\crimson.jar;%s\\java\\jars\\xmltools.jar\" com.netscape.xmltools.DSML2LDIF %%dsmlfile%% | slapd ldif2db -D \"%s\" -i - %%args%% 2>&1\n\n" + "set rc=%%errorlevel%%\n" + ":done\n" + "if defined MKSARGS exit %%rc%%\n" + "exit /b %%rc%%\n", + server, sroot, sroot, sroot, sroot, sroot, sroot, sroot, sroot, cs_path); + if(t) return t; + + t = gen_script(cs_path, "ldif2ldap.bat", + "@echo off\n" + "\"%s\\ldapmodify\" -a -p %s -D %%1 -w %%2 -f %%3\n", + tools, cf->servport); + if(t) return t; + + t = CREATE_LDIF2DB(); + if(t) return t; + + t = CREATE_DB2INDEX(); + if(t) return t; + +/* + t = CREATE_MIGRATETO5(); + if(t) return t; + + t = CREATE_MIGRATE50TO51(); + if(t) return t; + + t = CREATE_MIGRATEINSTANCE5(); + if(t) return t; + + t = CREATE_MIGRATETO6(); + if(t) return t; + + t = CREATE_MIGRATE5TO6(); + if(t) return t; + + t = CREATE_MIGRATEINSTANCE6(); + if(t) return t; +*/ + t = CREATE_MIGRATE5TO7(); + if(t) return t; + + t = CREATE_MIGRATE6TO7(); + if(t) return t; + + t = CREATE_MIGRATEINSTANCE7(); + if(t) return t; + + t = CREATE_MIGRATETO7(); + if(t) return t; + + t = gen_script(cs_path, "getpwenc.bat", + "@echo off\n" + "\"%s\\pwdhash\" -D \"%s\" -H -s %%1 %%2\n", + server, cs_path); + if(t) return t; + + t = gen_script(cs_path, "db2ldif.bat", + "@if not \"%%echo%%\" == \"on\" echo off\n\n" + "setlocal\n" + "set rc=0\n" + "PATH=\"%s\";%%PATH%%\n\n" + "if [%%2] == [] goto err\n\n" + "set arg=\n" + "set ldif_file=\n\n" + ":again\n" + "if \"%%1\" == \"\" goto next\n" + "if \"%%1\" == \"-n\" goto doubletag\n" + "if \"%%1\" == \"-s\" goto doubletag\n" + "if \"%%1\" == \"-x\" goto doubletag\n" + "if \"%%1\" == \"-a\" goto setldif\n" + "if \"%%1\" == \"-N\" goto singletag\n" + "if \"%%1\" == \"-r\" goto singletag\n" + "if \"%%1\" == \"-C\" goto singletag\n" + "if \"%%1\" == \"-u\" goto singletag\n" + "if \"%%1\" == \"-m\" goto singletag\n" + "if \"%%1\" == \"-o\" goto singletag\n" + "if \"%%1\" == \"-U\" goto singletag\n" + "if \"%%1\" == \"-M\" goto singletag\n" + "if \"%%1\" == \"-E\" goto singletag\n" + "goto next\n\n" + ":doubletag\n" + "set arg=%%1 %%2 %%arg%%\n" + "shift\n" + "shift\n" + "goto again\n\n" + ":singletag\n" + "set arg=%%1 %%arg%%\n" + "shift\n" + "goto again\n\n" + ":setldif\n" + "set ldif_file=%%2\n" + "shift\n" + "shift\n" + "goto again\n\n" + ":next\n" + "if not \"%%ldif_file%%\" == \"\" goto givenldif\n\n" + "namegen\n" + "call bstart\n" + "set ldif_file=\"%s\\ldif\\%%DATESTR%%.ldif\"\n" + "call bend\n" + "del bend.bat\n\n" + ":givenldif\n" + "\"%s\\slapd\" db2ldif -D \"%s\" -a %%ldif_file%% %%arg%%\n" + "set rc=%%errorlevel%%\n" + "goto done\n\n" + ":err\n" + "echo \"Usage: db2ldif -n backend_instance | " + "{-s \"includesuffix\"}* [{-x \"excludesuffix\"}*] [-N] [-r] [-C] " + "[-u] [-U] [-m] [-M] [-1] [-a outputfile]\"\n\n" + "set rc=1\n" + ":done\n" + "if defined MKSARGS exit %%rc%%\n" + "exit /b %%rc%%\n", + server, cs_path, server, cs_path); + if(t) return t; + + t = CREATE_DB2LDIF(); + if(t) return t; + + /* new code for dsml export */ + t = gen_script(cs_path, "db2dsml.bat", + "@if not \"%%echo%%\" == \"on\" echo off\n\n" + "setlocal\n" + "set rc=0\n" + "PATH=\"%s\";%%PATH%%\n\n" + "if [%%2] == [] goto err\n\n" + "set arg=\n" + "set dsml_file=\n\n" + ":again\n" + "if \"%%1\" == \"\" goto next\n" + "if \"%%1\" == \"-n\" goto doubletag\n" + "if \"%%1\" == \"-s\" goto doubletag\n" + "if \"%%1\" == \"-x\" goto doubletag\n" + "if \"%%1\" == \"-a\" goto setdsml\n" + "if \"%%1\" == \"-N\" goto singletag\n" + "if \"%%1\" == \"-r\" goto singletag\n" + "if \"%%1\" == \"-C\" goto singletag\n" + "if \"%%1\" == \"-u\" goto singletag\n" + "if \"%%1\" == \"-m\" goto singletag\n" + "if \"%%1\" == \"-o\" goto singletag\n" + "if \"%%1\" == \"-U\" goto singletag\n" + "if \"%%1\" == \"-M\" goto singletag\n" + "goto next\n\n" + ":doubletag\n" + "set arg=%%1 %%2 %%arg%%\n" + "shift\n" + "shift\n" + "goto again\n\n" + ":singletag\n" + "set arg=%%1 %%arg%%\n" + "shift\n" + "goto again\n\n" + ":setdsml\n" + "set dsml_file=%%2\n" + "shift\n" + "shift\n" + "goto again\n\n" + ":next\n" + "if not \"%%dsml_file%%\" == \"\" goto givendsml\n\n" + "namegen\n" + "call bstart\n" + "set dsml_file=\"%s\\dsml\\%%DATESTR%%.dsml\"\n" + "echo dsmlfile: %%dsml_file%%\n" + "call bend\n" + "del bend.bat\n\n" + ":givendsml\n" + "%s\\bin\\base\\jre\\bin\\java -Dverify=true -classpath \".;%s\\java\\ldapjdk.jar;%s\\java\\jars\\xmltools.jar\" com.netscape.xmltools.LDIF2DSML -s -o %%dsml_file%%\n" + "set rc=%%errorlevel%%\n" + "if %%rc%%==0 goto realimport else goto done\n\n" + ":realimport\n" + "\"%s\\slapd\" db2ldif -D \"%s\" -a - -1 %%arg%% | %s\\bin\\base\\jre\\bin\\java -classpath \".;%s\\java\\ldapjdk.jar;%s\\java\\jars\\xmltools.jar\" com.netscape.xmltools.LDIF2DSML -s -o %%dsml_file%%\n" + "set rc=%%errorlevel%%\n" + "goto done\n\n" + ":err\n" + "echo \"Usage: db2dsml -n backend_instance | " + "{-s \"includesuffix\"}* [{-x \"excludesuffix\"}*]" + "[-u] [-a outputfile]\"\n\n" + "set rc=1\n" + ":done\n" + "if defined MKSARGS exit %%rc%%\n" + "exit /b %%rc%%\n", + server, cs_path, sroot, sroot, sroot, server, cs_path, sroot, sroot, sroot); + if(t) return t; + + t = gen_script(cs_path, "db2bak.bat", + "@echo off\n" + "setlocal\n" + "set rc=0\n" + "PATH=\"%s\";%%PATH%%\n" + "if %%1.==. goto nobak\n" + "set bakdir=%%1\n" + "goto backup\n" + ":nobak\n" + "namegen\n" + "call bstart\n" + "set bakdir=\"%s\\bak\\%%DATESTR%%\"\n" + "call bend\n" + "del bend.bat\n" + ":backup\n" + "\"%s\\slapd\" db2archive -D \"%s\" -a %%bakdir%% " + "%%2 %%3 %%4 %%5 %%6 %%7 %%8\n" + "set rc=%%errorlevel%%\n" + ":done\n" + "if defined MKSARGS exit %%rc%%\n" + "exit /b %%rc%%\n", + server, cs_path, server, cs_path); + if(t) return t; + + t = CREATE_DB2BAK(); + if(t) return t; + +#if defined(UPGRADEDB) + t = gen_script(cs_path, "db2index.bat", + "@echo off\n" + "setlocal\n" + "set rc=0\n" + "PATH=\"%s\";%%PATH%%\n" + "if %%1.==. goto indexall\n\n" + "if %%2.==. goto err\n" + "if %%3.==. goto err\n\n" + "set bakdir=%%1\n" + "goto backup\n\n" + ":indexall\n" + "namegen\n" + "call bstart\n" + "set bakdir=\"%s\\bak\\%%DATESTR%%\"\n" + "call bend\n" + "del bend.bat\n" + "\"%s\\slapd\" upgradedb -D \"%s\" -f -a %%bakdir%%\n" + "set rc=%%errorlevel%%\n" + "goto done\n\n" + ":backup\n" + "\"%s\\slapd\" db2index -D \"%s\" " + "%%1 %%2 %%3 %%4 %%5 %%6 %%7 %%8\n" + "set rc=%%errorlevel%%\n" + "goto done\n\n" + ":err\n" + "echo \"Usage: db2index [-n backend_instance | {-s instancesuffix}* -t attribute[:indextypes[:matchingrules]] -T vlvattribute]\"\n\n" + "set rc=1\n" + ":done\n" + "if defined MKSARGS exit %%rc%%\n" + "exit /b %%rc%%\n", + server, cs_path, server, cs_path, server, cs_path); + if(t) return t; +#endif + + t = gen_script(cs_path, "vlvindex.bat", + "@echo off\n" + "setlocal\n" + "set rc=0\n" + "if [%%2] == [] goto usage\n" + "if [%%3] == [] goto usage\n" + "if [%%4] == [] goto usage\n\n" + "\"%s\\slapd\" db2index -D \"%s\" \"%%@\"\n" + "set rc=%%errorlevel%%\n" + "goto done\n\n" + ":usage\n" + "echo \"Usage: vlvindex -n backend_instance | {-s includesuffix}* {-T attribute}\"\n\n" + "set rc=1\n" + ":done\n" + "if defined MKSARGS exit %%rc%%\n" + "exit /b %%rc%%\n", + server, cs_path); + if(t) return t; + + t = gen_script(cs_path, "bak2db.bat", + "@echo off\n" + "setlocal\n\n" + "set rc=0\n" + "if [%%1] == [] goto usage\n\n" + "\"%s\\slapd\" archive2db -D \"%s\" -a %%1\n" + "set rc=%%errorlevel%%\n" + "goto done\n\n" + ":usage\n" + "echo \"Usage: bak2db -a archivedir\"\n\n" + "set rc=1\n" + ":done\n" + "if defined MKSARGS exit %%rc%%\n" + "exit /b %%rc%%\n", + server, cs_path); + if(t) return t; + +#if defined(UPGRADEDB) + t = gen_script(cs_path, "upgradedb.bat", + "@echo off\n" + "setlocal\n" + "set rc=0\n" + "PATH=\"%s\";%%PATH%%\n" + "if %%1.==. goto nobak\n" + "set bakdir=%%1\n" + "goto backup\n" + ":nobak\n" + "namegen\n" + "call bstart\n" + "set bakdir=\"%s\\bak\\upgradedb_%%DATESTR%%\"\n" + "call bend\n" + "del bend.bat\n" + ":backup\n" + "\"%s\\slapd\" upgradedb -D \"%s\" -a %%bakdir%% " + "%%2 %%3 %%4 %%5 %%6 %%7 %%8\n" + "set rc=%%errorlevel%%\n" + ":done\n" + "if defined MKSARGS exit %%rc%%\n" + "exit /b %%rc%%\n", + server, cs_path, server, cs_path); + if(t) return t; +#endif + + t = CREATE_BAK2DB(); + if(t) return t; + + t = CREATE_VERIFYDB(); + if(t) return t; + + t = CREATE_REPL_MONITOR_CGI(); + if(t) return t; + + t = gen_script(cs_path, "suffix2instance.bat", + "@if not \"%%echo%%\" == \"on\" echo off\n\n" + "setlocal\n" + "set rc=0\n" + "PATH=\"%s\";%%PATH%%\n\n" + "if [%%2] == [] goto err\n\n" + "set arg=\n\n" + ":again\n" + "if \"%%1\" == \"\" goto next\n" + "if \"%%1\" == \"-s\" goto doubletag\n" + "shift\n" + "goto again\n\n" + ":doubletag\n" + "set arg=%%1 %%2 %%arg%%\n" + "shift\n" + "shift\n" + "goto again\n\n" + ":next\n" + "\"%s\\slapd\" suffix2instance -D \"%s\" %%arg%%\n" + "set rc=%%errorlevel%%\n" + "goto done\n\n" + ":err\n" + "echo Usage: suffix2instance {-s \"suffix\"}*\n\n" + "set rc=1\n" + ":done\n" + "if defined MKSARGS exit %%rc%%\n" + "exit /b %%rc%%\n", + server, server, cs_path); + if(t) return t; + + t = CREATE_ACCOUNT_INACT("ns-inactivate.pl"); + if(t) return t; + + t = CREATE_ACCOUNT_INACT("ns-activate.pl"); + if(t) return t; + + t = CREATE_ACCOUNT_INACT("ns-accountstatus.pl"); + if(t) return t; + + t = CREATE_DSML(); + if(t) return t; + + t = gen_script(cs_path, "dsml-activate.bat", + "@echo off\n" + "setlocal\n" + "PATH=%s\\bin\\slapd\\admin\\bin;%%PATH%%\n" + "perl \"%s\\dsml-activate.pl\" %%*\n" + "set rc=%%errorlevel%%\n" + "if defined MKSARGS exit %%rc%%\n" + "exit /b %%rc%%\n", + sroot, cs_path); + if(t) return t; + + + + t = CREATE_NEWPWPOLICY(); + if(t) return t; + + t = gen_script(cs_path, "ns-newpwpolicy.cmd", + "@echo off\n" + "setlocal\n" + "PATH=%s\\bin\\slapd\\admin\\bin;%%PATH%%\n" + "perl \"%s\\ns-newpwpolicy.pl\" %%*\n" + "set rc=%%errorlevel%%\n" + "if defined MKSARGS exit %%rc%%\n" + "exit /b %%rc%%\n", + sroot, cs_path); + if(t) return t; + + free(mysroot); + free(mycs_path); + + /*Generate the java commandline tools in bin/slapd/server*/ + for (cls = 0; cls < 7; cls++) { + t = gen_script(server, cl_scripts[cls], + "@echo off\npushd \"%s\"\n\n" + "setlocal\n" + "set LANG=en\n" + "set arg=\n" + "set rc=0\n" + ":getarg\n" + "if %%1.==. goto start\n" + "if %%1==-l goto getlang\n" + "set arg=%%arg%% %%1\n" + "shift\n" + "goto getarg\n" + ":getlang\n" + "shift\n" + "set LANG=%%1\n" + "shift\n" + "goto getarg\n" + ":start\n" + ".\\bin\\base\\jre\\bin\\jre -classpath " + ".;.\\java;.\\bin\\base\\jre\\lib;" + ".\\bin\\base\\jre\\lib\\rt.jar;.\\bin\\base\\jre\\lib\\i18n.jar;" + ".\\java\\base.jar;.\\java\\jars\\ds40.jar;.\\java\\jars\\ds40_%%LANG%%.jar;" + ".\\java\\swingall.jar;.\\java\\ssl.zip;" + ".\\java\\ldapjdk.jar;.\\java\\mcc40.jar;.\\java\\mcc40_%%LANG%%.jar;" + ".\\java\\nmclf40.jar;.\\java\\nmclf40_%%LANG%%.jar " + "com.netscape.admin.dirserv.cmdln.%s %%arg%%\n" + "set rc=%%errorlevel%%\n" + "popd\n" + "if defined MKSARGS exit %%rc%%\n" + "exit /b %%rc%%\n", + sroot, cl_javafiles[cls]); + if(t) return t; + } + + + + return (t); +} +#endif + + +void +suffix_gen_conf(FILE* f, char * suffix, char *be_name) +{ + int l; + char* belowdn; + + fprintf(f, "dn: cn=%s,cn=ldbm database,cn=plugins,cn=config\n", be_name); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "objectclass: nsBackendInstance\n"); + fprintf(f, "nsslapd-cachesize: -1\n"); + fprintf(f, "nsslapd-cachememsize: 10485760\n"); + fprintf(f, "nsslapd-suffix: %s\n", suffix); + fprintf(f, "cn: %s\n", be_name); + fprintf(f, "\n"); + + fprintf(f, "dn: cn=monitor,cn=%s,cn=ldbm database,cn=plugins,cn=config\n", be_name); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "cn: monitor\n"); + fprintf(f, "\n"); + + fprintf(f, "dn: cn=\"%s\",cn=mapping tree,cn=config\n", suffix); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "objectclass: nsMappingTree\n"); + fprintf(f, "cn: \"%s\"\n", suffix); + fprintf(f, "nsslapd-state: backend\n"); + fprintf(f, "nsslapd-backend: %s\n", be_name); + fprintf(f, "\n"); + + /* Parent entry for attribute encryption config entries */ + + fprintf(f, "dn: cn=encrypted attributes,cn=%s,cn=ldbm database,cn=plugins,cn=config\n", be_name); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "cn: encrypted attributes\n"); + fprintf(f, "\n"); + + /* Parent entry for attribute encryption keys */ + + fprintf(f, "dn: cn=encrypted attribute keys,cn=%s,cn=ldbm database,cn=plugins,cn=config\n", be_name); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "cn: encrypted attributes keys\n"); + fprintf(f, "\n"); + + /* Indexes for the ldbm instance */ + + fprintf(f, "dn: cn=index,cn=%s,cn=ldbm database,cn=plugins,cn=config\n", be_name); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "cn: index\n"); + fprintf(f, "\n"); + + l = strlen("cn=index,cn=") + strlen(be_name) + strlen(",cn=ldbm database,cn=plugins,cn=config"); + belowdn = (char *)malloc(l + 1); + sprintf(belowdn, "cn=index,cn=%s,cn=ldbm database,cn=plugins,cn=config", be_name); + ds_gen_index(f, belowdn); + + /* done with ldbm entries */ +} + +#define MKSYNTAX(_name,_fn) do { \ + fprintf(f, "dn: cn=%s,cn=plugins,cn=config\n", (_name)); \ + fprintf(f, "objectclass: top\n"); \ + fprintf(f, "objectclass: nsSlapdPlugin\n"); \ + fprintf(f, "objectclass: extensibleObject\n"); \ + fprintf(f, "cn: %s\n",(_name)); \ + fprintf(f, "nsslapd-pluginpath: %s/lib/syntax-plugin%s\n", sroot, shared_lib); \ + fprintf(f, "nsslapd-plugininitfunc: %s\n", (_fn)); \ + fprintf(f, "nsslapd-plugintype: syntax\n"); \ + fprintf(f, "nsslapd-pluginenabled: on\n"); \ + fprintf(f, "\n"); \ + } while (0) + +char *ds_gen_confs(char *sroot, server_config_s *cf, + char *cs_path) +{ + char *pServerName = NULL; + char *schemaFile = NULL; + char* t = NULL; + char src[PATH_SIZE], dest[PATH_SIZE]; + char fn[PATH_SIZE], line[1024]; + FILE *f = 0, *f2 = 0, *srcf = 0; + int rootdse = 0; + char *shared_lib; + + sprintf(fn, "%s%cconfig%cdse.ldif", cs_path, FILE_PATHSEP, FILE_PATHSEP); + if(!(f = fopen(fn, "w"))) + return make_error("Can't write to %s (%s)", fn, ds_system_errmsg()); + +#if defined( XP_WIN32 ) + shared_lib = ".dll"; +#else +#ifdef HPUX + shared_lib = ".sl"; +#else +#ifdef AIX +#if OSVERSION >= 4200 + shared_lib = ".so"; +#else + shared_lib = "_shr.a"; +#endif +#else + shared_lib = ".so"; +#endif +#endif +#endif + + fprintf(f, "dn: cn=config\n"); + fprintf(f, "cn: config\n"); + fprintf(f, "objectclass:top\n"); + fprintf(f, "objectclass:extensibleObject\n"); + fprintf(f, "objectclass:nsslapdConfig\n"); + fprintf(f, "nsslapd-accesslog-logging-enabled: on\n"); + fprintf(f, "nsslapd-accesslog-maxlogsperdir: 10\n"); + fprintf(f, "nsslapd-accesslog-mode: 600\n"); + fprintf(f, "nsslapd-accesslog-maxlogsize: 100\n"); + fprintf(f, "nsslapd-accesslog-logrotationtime: 1\n"); + fprintf(f, "nsslapd-accesslog-logrotationtimeunit: day\n"); + fprintf(f, "nsslapd-accesslog-logrotationsync-enabled: off\n"); + fprintf(f, "nsslapd-accesslog-logrotationsynchour: 0\n"); + fprintf(f, "nsslapd-accesslog-logrotationsyncmin: 0\n"); + fprintf(f, "nsslapd-accesslog: %s/logs/access\n", cs_path); + fprintf(f, "nsslapd-enquote-sup-oc: off\n"); + fprintf(f, "nsslapd-localhost: %s\n", cf->servname); + fprintf(f, "nsslapd-schemacheck: %s\n", + (cf->disable_schema_checking && !strcmp(cf->disable_schema_checking, "1")) ? "off" : "on"); + fprintf(f, "nsslapd-rewrite-rfc1274: off\n"); + fprintf(f, "nsslapd-return-exact-case: on\n"); + fprintf(f, "nsslapd-ssl-check-hostname: on\n"); + fprintf(f, "nsslapd-port: %s\n", cf->servport); +#if !defined( XP_WIN32 ) + if (cf->servuser && *(cf->servuser)) { + fprintf(f, "nsslapd-localuser: %s\n", cf->servuser); + } +#endif + fprintf(f, "nsslapd-errorlog-logging-enabled: on\n"); + fprintf(f, "nsslapd-errorlog-mode: 600\n"); + fprintf(f, "nsslapd-errorlog-maxlogsperdir: 2\n"); + fprintf(f, "nsslapd-errorlog-maxlogsize: 100\n"); + fprintf(f, "nsslapd-errorlog-logrotationtime: 1\n"); + fprintf(f, "nsslapd-errorlog-logrotationtimeunit: week\n"); + fprintf(f, "nsslapd-errorlog-logrotationsync-enabled: off\n"); + fprintf(f, "nsslapd-errorlog-logrotationsynchour: 0\n"); + fprintf(f, "nsslapd-errorlog-logrotationsyncmin: 0\n"); + fprintf(f, "nsslapd-errorlog: %s/logs/errors\n", cs_path); + if (cf->loglevel) + fprintf(f, "nsslapd-errorlog-level: %s\n", cf->loglevel); + fprintf(f, "nsslapd-auditlog: %s/logs/audit\n", cs_path); + fprintf(f, "nsslapd-auditlog-mode: 600\n"); + fprintf(f, "nsslapd-auditlog-maxlogsize: 100\n"); + fprintf(f, "nsslapd-auditlog-logrotationtime: 1\n"); + fprintf(f, "nsslapd-auditlog-logrotationtimeunit: day\n"); + fprintf(f, "nsslapd-rootdn: %s\n", cf->rootdn); +#if !defined(_WIN32) && !defined(AIX) + { + unsigned int maxdescriptors = FD_SETSIZE; + struct rlimit rl; + if (getrlimit(RLIMIT_NOFILE, &rl) == 0) + maxdescriptors = (unsigned int)rl.rlim_max; + fprintf(f, "nsslapd-maxdescriptors: %d\n", maxdescriptors); + } +#endif + fprintf(f, "nsslapd-max-filter-nest-level: 40\n" ); + fprintf(f, "nsslapd-rootpw: %s\n", cf->roothashedpw); + if (getenv("DEBUG_SINGLE_THREADED")) + fprintf(f, "nsslapd-threadnumber: 1\n"); + fprintf(f, "\n"); + + fprintf(f, "dn: cn=plugins, cn=config\nobjectclass: top\nobjectclass: nsContainer\ncn: plugins\n"); + fprintf(f, "\n"); + + fprintf(f, "dn: cn=Password Storage Schemes,cn=plugins, cn=config\n"); + fprintf(f, "objectclass: top\nobjectclass: nsContainer\ncn: Password Storage Schemes\n"); + fprintf(f, "\n"); + + fprintf(f, "dn: cn=SSHA,cn=Password Storage Schemes,cn=plugins,cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: nsSlapdPlugin\n"); + fprintf(f, "cn: SSHA\n"); + fprintf(f, "nsslapd-pluginpath: %s/lib/pwdstorage-plugin%s\n", sroot, shared_lib); + fprintf(f, "nsslapd-plugininitfunc: ssha_pwd_storage_scheme_init\n"); + fprintf(f, "nsslapd-plugintype: pwdstoragescheme\n"); + fprintf(f, "nsslapd-pluginenabled: on\n"); + fprintf(f, "\n"); + + fprintf(f, "dn: cn=SHA,cn=Password Storage Schemes,cn=plugins,cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: nsSlapdPlugin\n"); + fprintf(f, "cn: SHA\n"); + fprintf(f, "nsslapd-pluginpath: %s/lib/pwdstorage-plugin%s\n", sroot, shared_lib); + fprintf(f, "nsslapd-plugininitfunc: sha_pwd_storage_scheme_init\n"); + fprintf(f, "nsslapd-plugintype: pwdstoragescheme\n"); + fprintf(f, "nsslapd-pluginenabled: on\n"); + fprintf(f, "\n"); + + fprintf(f, "dn: cn=CRYPT,cn=Password Storage Schemes,cn=plugins,cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: nsSlapdPlugin\n"); + fprintf(f, "cn: CRYPT\n"); + fprintf(f, "nsslapd-pluginpath: %s/lib/pwdstorage-plugin%s\n", sroot, shared_lib); + fprintf(f, "nsslapd-plugininitfunc: crypt_pwd_storage_scheme_init\n"); + fprintf(f, "nsslapd-plugintype: pwdstoragescheme\n"); + fprintf(f, "nsslapd-pluginenabled: on\n"); + fprintf(f, "\n"); + + fprintf(f, "dn: cn=CLEAR,cn=Password Storage Schemes,cn=plugins,cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: nsSlapdPlugin\n"); + fprintf(f, "cn: CLEAR\n"); + fprintf(f, "nsslapd-pluginpath: %s/lib/pwdstorage-plugin%s\n", sroot, shared_lib); + fprintf(f, "nsslapd-plugininitfunc: clear_pwd_storage_scheme_init\n"); + fprintf(f, "nsslapd-plugintype: pwdstoragescheme\n"); + fprintf(f, "nsslapd-pluginenabled: on\n"); + fprintf(f, "\n"); + + fprintf(f, "dn: cn=NS-MTA-MD5,cn=Password Storage Schemes,cn=plugins,cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: nsSlapdPlugin\n"); + fprintf(f, "cn: NS-MTA-MD5\n"); + fprintf(f, "nsslapd-pluginpath: %s/lib/pwdstorage-plugin%s\n", sroot, shared_lib); + fprintf(f, "nsslapd-plugininitfunc: ns_mta_md5_pwd_storage_scheme_init\n"); + fprintf(f, "nsslapd-plugintype: pwdstoragescheme\n"); + fprintf(f, "nsslapd-pluginenabled: on\n"); + fprintf(f, "\n"); + + fprintf(f, "dn: cn=DES,cn=Password Storage Schemes,cn=plugins,cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: nsSlapdPlugin\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "cn: DES\n"); + fprintf(f, "nsslapd-pluginpath: %s/lib/des-plugin%s\n", sroot, shared_lib); + fprintf(f, "nsslapd-plugininitfunc: des_init\n"); + fprintf(f, "nsslapd-plugintype: reverpwdstoragescheme\n"); + fprintf(f, "nsslapd-pluginenabled: on\n"); + fprintf(f, "nsslapd-pluginarg0: nsmultiplexorcredentials\n"); + fprintf(f, "nsslapd-pluginarg1: nsds5ReplicaCredentials\n"); + fprintf(f, "nsslapd-pluginid: des-storage-scheme\n"); + fprintf(f, "\n"); + + MKSYNTAX("Case Ignore String Syntax","cis_init"); + MKSYNTAX("Case Exact String Syntax","ces_init"); + MKSYNTAX("Space Insensitive String Syntax","sicis_init"); + MKSYNTAX("Binary Syntax","bin_init"); + MKSYNTAX("Octet String Syntax","octetstring_init"); + MKSYNTAX("Boolean Syntax","boolean_init"); + MKSYNTAX("Generalized Time Syntax","time_init"); + MKSYNTAX("Telephone Syntax","tel_init"); + MKSYNTAX("Integer Syntax","int_init"); + MKSYNTAX("Distinguished Name Syntax","dn_init"); + MKSYNTAX("OID Syntax","oid_init"); + MKSYNTAX("URI Syntax","uri_init"); + MKSYNTAX("JPEG Syntax","jpeg_init"); + MKSYNTAX("Country String Syntax","country_init"); + MKSYNTAX("Postal Address Syntax","postal_init"); + + fprintf(f, "dn: cn=State Change Plugin,cn=plugins,cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: nsSlapdPlugin\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "cn: State Change Plugin\n"); + fprintf(f, "nsslapd-pluginpath: %s/lib/statechange-plugin%s\n", sroot, shared_lib); + fprintf(f, "nsslapd-plugininitfunc: statechange_init\n"); + fprintf(f, "nsslapd-plugintype: postoperation\n"); + fprintf(f, "nsslapd-pluginenabled: on\n"); + fprintf(f, "\n"); + + fprintf(f, "dn: cn=Roles Plugin,cn=plugins,cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: nsSlapdPlugin\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "cn: Roles Plugin\n"); + fprintf(f, "nsslapd-pluginpath: %s/lib/roles-plugin%s\n", sroot, shared_lib); + fprintf(f, "nsslapd-plugininitfunc: roles_init\n"); + fprintf(f, "nsslapd-plugintype: postoperation\n"); + fprintf(f, "nsslapd-pluginenabled: on\n"); + fprintf(f, "nsslapd-plugin-depends-on-type: database\n"); + fprintf(f, "nsslapd-plugin-depends-on-named: State Change Plugin\n"); + fprintf(f, "nsslapd-plugin-depends-on-named: Views\n"); + fprintf(f, "\n"); + + fprintf(f, "dn: cn=ACL Plugin,cn=plugins,cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: nsSlapdPlugin\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "cn: ACL Plugin\n"); + fprintf(f, "nsslapd-pluginpath: %s/lib/acl-plugin%s\n", sroot, shared_lib); + fprintf(f, "nsslapd-plugininitfunc: acl_init\n"); + fprintf(f, "nsslapd-plugintype: accesscontrol\n"); + fprintf(f, "nsslapd-pluginenabled: on\n"); + fprintf(f, "nsslapd-plugin-depends-on-type: database\n"); + fprintf(f, "\n"); + + fprintf(f, "dn: cn=ACL preoperation,cn=plugins,cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: nsSlapdPlugin\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "cn: ACL preoperation\n"); + fprintf(f, "nsslapd-pluginpath: %s/lib/acl-plugin%s\n", sroot, shared_lib); + fprintf(f, "nsslapd-plugininitfunc: acl_preopInit\n"); + fprintf(f, "nsslapd-plugintype: preoperation\n"); + fprintf(f, "nsslapd-pluginenabled: on\n"); + fprintf(f, "nsslapd-plugin-depends-on-type: database\n"); + fprintf(f, "\n"); + + fprintf(f, "dn: cn=Legacy Replication Plugin,cn=plugins,cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: nsSlapdPlugin\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "cn: Legacy Replication Plugin\n"); + fprintf(f, "nsslapd-pluginpath: %s/lib/replication-plugin%s\n", sroot, shared_lib); + fprintf(f, "nsslapd-plugininitfunc: replication_legacy_plugin_init\n"); + fprintf(f, "nsslapd-plugintype: object\n"); + fprintf(f, "nsslapd-pluginenabled: on\n"); + fprintf(f, "nsslapd-plugin-depends-on-type: database\n"); + fprintf(f, "nsslapd-plugin-depends-on-named: Multimaster Replication Plugin\n"); + fprintf(f, "\n"); + + fprintf(f, "dn: cn=Multimaster Replication Plugin,cn=plugins,cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: nsSlapdPlugin\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "cn: Multimaster Replication Plugin\n"); + fprintf(f, "nsslapd-pluginpath: %s/lib/replication-plugin%s\n", sroot, shared_lib); + fprintf(f, "nsslapd-plugininitfunc: replication_multimaster_plugin_init\n"); + fprintf(f, "nsslapd-plugintype: object\n"); + fprintf(f, "nsslapd-pluginenabled: on\n"); + fprintf(f, "nsslapd-plugin-depends-on-named: ldbm database\n"); + fprintf(f, "nsslapd-plugin-depends-on-named: DES\n"); + fprintf(f, "\n"); + + fprintf(f, "dn: cn=Retro Changelog Plugin,cn=plugins,cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: nsSlapdPlugin\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "cn: Retro Changelog Plugin\n"); + fprintf(f, "nsslapd-pluginpath: %s/lib/retrocl-plugin%s\n", sroot, shared_lib); + fprintf(f, "nsslapd-plugininitfunc: retrocl_plugin_init\n"); + fprintf(f, "nsslapd-plugintype: object\n"); + fprintf(f, "nsslapd-pluginenabled: off\n"); + fprintf(f, "nsslapd-plugin-depends-on-type: database\n"); + fprintf(f, "\n"); + + + /* cos needs to be placed before other same type'ed plugins (postoperation) */ + fprintf(f, "dn: cn=Class of Service,cn=plugins,cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: nsSlapdPlugin\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "cn: Class of Service\n"); + fprintf(f, "nsslapd-pluginpath: %s/lib/cos-plugin%s\n", sroot, shared_lib); + fprintf(f, "nsslapd-plugininitfunc: cos_init\n"); + fprintf(f, "nsslapd-plugintype: postoperation\n"); + fprintf(f, "nsslapd-pluginenabled: on\n"); + fprintf(f, "nsslapd-plugin-depends-on-type: database\n"); + fprintf(f, "nsslapd-plugin-depends-on-named: State Change Plugin\n"); + fprintf(f, "nsslapd-plugin-depends-on-named: Views\n"); + fprintf(f, "\n"); + + fprintf(f, "dn: cn=Views,cn=plugins,cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: nsSlapdPlugin\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "cn: Views\n"); + fprintf(f, "nsslapd-pluginpath: %s/lib/views-plugin%s\n", sroot, shared_lib); + fprintf(f, "nsslapd-plugininitfunc: views_init\n"); + fprintf(f, "nsslapd-plugintype: object\n"); + fprintf(f, "nsslapd-pluginenabled: on\n"); + fprintf(f, "nsslapd-plugin-depends-on-type: database\n"); + fprintf(f, "nsslapd-plugin-depends-on-named: State Change Plugin\n"); + fprintf(f, "\n"); + + /* + * LP: Turn referential integrity plugin OFF by default + * defect 518862 + */ + fprintf(f, "dn: cn=referential integrity postoperation,cn=plugins,cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: nsSlapdPlugin\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "cn: referential integrity postoperation\n"); + fprintf(f, "nsslapd-pluginpath: %s/lib/referint-plugin%s\n", sroot, shared_lib); + fprintf(f, "nsslapd-plugininitfunc: referint_postop_init\n"); + fprintf(f, "nsslapd-plugintype: postoperation\n"); + fprintf(f, "nsslapd-pluginenabled: off\n"); + fprintf(f, "nsslapd-pluginArg0: %d\n", REFERINT_DELAY); + fprintf(f, "nsslapd-pluginArg1: %s/logs/referint\n", cs_path); + fprintf(f, "nsslapd-pluginArg2: %d\n", REFERINT_LOG_CHANGES); + fprintf(f, "nsslapd-pluginArg3: member\n"); + fprintf(f, "nsslapd-pluginArg4: uniquemember\n"); + fprintf(f, "nsslapd-pluginArg5: owner\n"); + fprintf(f, "nsslapd-pluginArg6: seeAlso\n"); + fprintf(f, "nsslapd-plugin-depends-on-type: database\n"); + fprintf(f, "\n"); +/* + NT synch is dead as of 5.0 + + fprintf(f, "dn: cn=ntSynchService preoperation,cn=plugins,cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: nsSlapdPlugin\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "cn: ntSynchService preoperation\n"); + fprintf(f, "nsslapd-pluginpath: %s/lib/ntsynch-plugin%s\n", sroot, shared_lib); + fprintf(f, "nsslapd-plugininitfunc: libntsynch_plugin_preop_init\n"); + fprintf(f, "nsslapd-plugintype: preoperation\n"); + fprintf(f, "nsslapd-pluginenabled: on\n"); + fprintf(f, "\n"); + + fprintf(f, "dn: cn=ntSynchService postoperation,cn=plugins,cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: nsSlapdPlugin\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "cn: ntSynchService postoperation\n"); + fprintf(f, "nsslapd-pluginpath: %s/lib/ntsynch-plugin%s\n", sroot, shared_lib); + fprintf(f, "nsslapd-plugininitfunc: libntsynch_plugin_postop_init\n"); + fprintf(f, "nsslapd-plugintype: postoperation\n"); + fprintf(f, "nsslapd-pluginenabled: on\n"); + fprintf(f, "\n"); +*/ + if (!cf->use_existing_user_ds) { + t = cf->suffix; + } else { + t = cf->netscaperoot; + } + + /* + * LP: Turn attribute uniqueness plugin OFF by default + * defect 518862 + */ + fprintf(f, "dn: cn=attribute uniqueness,cn=plugins,cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: nsSlapdPlugin\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "cn: attribute uniqueness\n"); + fprintf(f, "nsslapd-pluginpath: %s/lib/attr-unique-plugin%s\n", sroot, shared_lib); + fprintf(f, "nsslapd-plugininitfunc: NSUniqueAttr_Init\n"); + fprintf(f, "nsslapd-plugintype: preoperation\n"); + fprintf(f, "nsslapd-pluginenabled: off\n"); + fprintf(f, "nsslapd-pluginarg0: uid\n"); + fprintf(f, "nsslapd-pluginarg1: %s\n", t); + fprintf(f, "nsslapd-plugin-depends-on-type: database\n"); + fprintf(f, "\n"); + + fprintf(f, "dn: cn=7-bit check,cn=plugins,cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: nsSlapdPlugin\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "cn: 7-bit check\n"); + fprintf(f, "nsslapd-pluginpath: %s/lib/attr-unique-plugin%s\n", sroot, shared_lib); + fprintf(f, "nsslapd-plugininitfunc: NS7bitAttr_Init\n"); + fprintf(f, "nsslapd-plugintype: preoperation\n"); + fprintf(f, "nsslapd-pluginenabled: on\n"); + fprintf(f, "nsslapd-pluginarg0: uid\n"); + fprintf(f, "nsslapd-pluginarg1: mail\n"); + fprintf(f, "nsslapd-pluginarg2: userpassword\n"); + fprintf(f, "nsslapd-pluginarg3: ,\n"); + fprintf(f, "nsslapd-pluginarg4: %s\n", t); + fprintf(f, "nsslapd-plugin-depends-on-type: database\n"); + fprintf(f, "\n"); + + t = 0; + + fprintf(f, "dn: cn=Internationalization Plugin,cn=plugins,cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: nsSlapdPlugin\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "cn: Internationalization Plugin\n"); + fprintf(f, "nsslapd-pluginpath: %s/lib/liblcoll%s\n", sroot, shared_lib); + fprintf(f, "nsslapd-plugininitfunc: orderingRule_init\n"); + fprintf(f, "nsslapd-plugintype: matchingRule\n"); + fprintf(f, "nsslapd-pluginenabled: on\n"); + fprintf(f, "nsslapd-pluginarg0: %s/config/slapd-collations.conf\n", cs_path); + fprintf(f, "\n"); + + /* The HTTP client plugin */ + fprintf(f, "dn: cn=HTTP Client,cn=plugins,cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: nsSlapdPlugin\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "cn: HTTP Client\n"); + fprintf(f, "nsslapd-pluginpath: %s/lib/http-client-plugin%s\n", sroot, shared_lib); + fprintf(f, "nsslapd-plugininitfunc: http_client_init\n"); + fprintf(f, "nsslapd-plugintype: preoperation\n"); + fprintf(f, "nsslapd-pluginenabled: on\n"); + fprintf(f, "nsslapd-plugin-depends-on-type: database\n"); + fprintf(f, "\n"); + + /* The IM presence plugin root */ + fprintf(f, "dn: cn=Presence,cn=plugins,cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: nsSlapdPlugin\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "cn: Presence\n"); + fprintf(f, "nsslapd-pluginpath: %s/lib/presence-plugin%s\n", sroot, shared_lib); + fprintf(f, "nsslapd-plugininitfunc: presence_init\n"); + fprintf(f, "nsslapd-plugintype: preoperation\n"); + fprintf(f, "nsslapd-pluginenabled: on\n"); + fprintf(f, "nsslapd-plugin-depends-on-type: database\n"); + fprintf(f, "nsslapd-plugin-depends-on-named: HTTP Client\n"); + fprintf(f, "\n"); + + /* The AIM presence plugin */ + fprintf(f, "dn: cn=AIM Presence,cn=Presence,cn=plugins,cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "cn: AIM Presence\n"); + fprintf(f, "nsim-id: nsAIMid\n"); + fprintf(f, "nsim-urltext: http://big.oscar.aol.com/$nsaimid?on_url=http://online&off_url=http://offline\n"); + fprintf(f, "nsim-urlgraphic: http://big.oscar.aol.com/$nsaimid?on_url=http://online&off_url=http://offline\n"); + fprintf(f, "nsim-onvaluemaptext: http://online\n"); + fprintf(f, "nsim-offvaluemaptext: http://offline\n"); + fprintf(f, "nsim-urltextreturntype: TEXT\n"); + fprintf(f, "nsim-urlgraphicreturntype: TEXT\n"); + fprintf(f, "nsim-requestmethod: REDIRECT\n"); + fprintf(f, "nsim-statustext: nsAIMStatusText\n"); + fprintf(f, "nsim-statusgraphic: nsAIMStatusGraphic\n"); + fprintf(f, "\n"); + + /* The ICQ presence plugin */ + fprintf(f, "dn: cn=ICQ Presence,cn=Presence,cn=plugins,cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "cn: ICQ Presence\n"); + fprintf(f, "nsim-id: nsICQid\n"); + fprintf(f, "nsim-urltext: http://online.mirabilis.com/scripts/online.dll?icq=$nsicqid&img=5\n"); + fprintf(f, "nsim-urlgraphic: http://online.mirabilis.com/scripts/online.dll?icq=$nsicqid&img=5\n"); + fprintf(f, "nsim-onvaluemaptext: /lib/image/0,,4367,00.gif\n"); + fprintf(f, "nsim-offvaluemaptext: /lib/image/0,,4349,00.gif\n"); + fprintf(f, "nsim-urltextreturntype: TEXT\n"); + fprintf(f, "nsim-urlgraphicreturntype: TEXT\n"); + fprintf(f, "nsim-requestmethod: REDIRECT\n"); + fprintf(f, "nsim-statustext: nsICQStatusText\n"); + fprintf(f, "nsim-statusgraphic: nsICQStatusGraphic\n"); + fprintf(f, "\n"); + + /* The Yahoo presence plugin */ + fprintf(f, "dn: cn=Yahoo Presence,cn=Presence,cn=plugins,cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "cn: Yahoo Presence\n"); + fprintf(f, "nsim-id: nsYIMid\n"); + fprintf(f, "nsim-urltext: http://opi.yahoo.com/online?u=$nsyimid&m=t\n"); + fprintf(f, "nsim-urlgraphic: http://opi.yahoo.com/online?u=$nsyimid&m=g&t=0\n"); + fprintf(f, "nsim-onvaluemaptext: $nsyimid is ONLINE\n"); + fprintf(f, "nsim-offvaluemaptext: $nsyimid is NOT ONLINE\n"); + fprintf(f, "nsim-urltextreturntype: TEXT\n"); + fprintf(f, "nsim-urlgraphicreturntype: BINARY\n"); + fprintf(f, "nsim-requestmethod: GET\n"); + fprintf(f, "nsim-statustext: nsYIMStatusText\n"); + fprintf(f, "nsim-statusgraphic: nsYIMStatusGraphic\n"); + fprintf(f, "\n"); + + /* enable pass thru authentication */ + if (cf->use_existing_config_ds || cf->use_existing_user_ds) + { + LDAPURLDesc *desc = 0; + char *url = cf->use_existing_config_ds ? cf->config_ldap_url : + cf->user_ldap_url; + if (url && !ldap_url_parse(url, &desc) && desc) + { + char *suffix = desc->lud_dn; + char *service = !strncmp(url, "ldaps:", strlen("ldaps:")) ? + "ldaps" : "ldap"; + if (cf->use_existing_config_ds) + { + suffix = cf->netscaperoot; + } + + suffix = ds_URL_encode(suffix); + fprintf(f, "dn: cn=Pass Through Authentication,cn=plugins,cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: nsSlapdPlugin\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "cn: Pass Through Authentication\n"); + fprintf(f, "nsslapd-pluginpath: %s/lib/passthru-plugin%s\n", sroot, shared_lib); + fprintf(f, "nsslapd-plugininitfunc: passthruauth_init\n"); + fprintf(f, "nsslapd-plugintype: preoperation\n"); + fprintf(f, "nsslapd-pluginenabled: on\n"); + fprintf(f, "nsslapd-pluginarg0: %s://%s:%d/%s\n", service, desc->lud_host, desc->lud_port, + suffix); + fprintf(f, "nsslapd-plugin-depends-on-type: database\n"); + fprintf(f, "\n"); + free(suffix); + ldap_free_urldesc(desc); + } + } + + fprintf(f, "dn: cn=ldbm database,cn=plugins,cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: nsSlapdPlugin\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "cn: ldbm database\n"); + fprintf(f, "nsslapd-pluginpath: %s/lib/libback-ldbm%s\n", sroot, shared_lib); + fprintf(f, "nsslapd-plugininitfunc: ldbm_back_init\n"); + fprintf(f, "nsslapd-plugintype: database\n"); + fprintf(f, "nsslapd-pluginenabled: on\n"); + fprintf(f, "nsslapd-plugin-depends-on-type: Syntax\n"); + fprintf(f, "nsslapd-plugin-depends-on-type: matchingRule\n"); + fprintf(f, "\n"); + + if (strlen(cf->suffix) == 0){ + rootdse = 1; + } + + /* Entries for the ldbm plugin */ + fprintf(f, "dn: cn=config,cn=ldbm database,cn=plugins,cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "cn: config\n"); + fprintf(f, "nsslapd-lookthroughlimit: 5000\n"); + fprintf(f, "nsslapd-mode: 600\n"); + fprintf(f, "nsslapd-directory: %s/db\n", cs_path); + fprintf(f, "nsslapd-dbcachesize: 10485760\n"); + /* will be default from 6.2 or 6.11... */ + if (getenv("USE_OLD_IDL_SWITCH")) { + fprintf(f, "nsslapd-idl-switch: old\n"); + } + fprintf(f, "\n"); + + /* Placeholder for the default user-defined ldbm indexes */ + fprintf(f, "dn: cn=default indexes, cn=config,cn=ldbm database,cn=plugins,cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "cn: default indexes\n"); + fprintf(f, "\n"); + + /* default user-defined ldbm indexes */ + ds_gen_index(f, "cn=default indexes, cn=config,cn=ldbm database,cn=plugins,cn=config"); + + + + + fprintf(f, "dn: cn=monitor, cn=ldbm database, cn=plugins, cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "cn: monitor\n"); + fprintf(f, "\n"); + + fprintf(f, "dn: cn=database, cn=monitor, cn=ldbm database, cn=plugins, cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "cn: database\n"); + fprintf(f, "\n"); + + /* Entries for the chaining backend plugin */ + fprintf(f, "dn: cn=chaining database,cn=plugins,cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: nsSlapdPlugin\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "cn: chaining database\n"); + fprintf(f, "nsslapd-pluginpath: %s/lib/chainingdb-plugin%s\n", sroot, shared_lib); + fprintf(f, "nsslapd-plugininitfunc: chaining_back_init\n"); + fprintf(f, "nsslapd-plugintype: database\n"); + fprintf(f, "nsslapd-pluginenabled: on\n"); + fprintf(f, "\n"); + + fprintf(f, "dn: cn=config,cn=chaining database,cn=plugins,cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "cn: config\n"); + fprintf(f, "nsTransmittedControls: 2.16.840.1.113730.3.4.2\n"); + fprintf(f, "nsTransmittedControls: 2.16.840.1.113730.3.4.9\n"); + fprintf(f, "nsTransmittedControls: 1.2.840.113556.1.4.473\n"); + fprintf(f, "nsTransmittedControls: 1.3.6.1.4.1.1466.29539.12\n"); + fprintf(f, "nsPossibleChainingComponents: cn=resource limits,cn=components,cn=config\n"); + fprintf(f, "nsPossibleChainingComponents: cn=certificate-based authentication,cn=components,cn=config\n"); + fprintf(f, "nsPossibleChainingComponents: cn=ACL Plugin,cn=plugins,cn=config\n"); + fprintf(f, "nsPossibleChainingComponents: cn=old plugin,cn=plugins,cn=config\n"); + fprintf(f, "nsPossibleChainingComponents: cn=referential integrity postoperation,cn=plugins,cn=config\n"); + fprintf(f, "nsPossibleChainingComponents: cn=attribute uniqueness,cn=plugins,cn=config\n"); + fprintf(f, "\n"); + + free(t); + t = NULL; + + /* suffix for the mapping tree */ + fprintf(f, "dn: cn=mapping tree,cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "cn: mapping tree\n"); + fprintf(f, "\n"); + + fprintf(f, "dn: cn=tasks,cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "cn: tasks\n"); + fprintf(f, "\n"); + + /* Entries for the ldbm instances and mapping tree */ + if ( cf->netscaperoot && !cf->use_existing_config_ds) + { + suffix_gen_conf(f, cf->netscaperoot, "NetscapeRoot"); + } + + if (!cf->use_existing_user_ds) + { + suffix_gen_conf(f, cf->suffix, "userRoot"); + } + + if ( cf->samplesuffix && cf->suffix && PL_strcasecmp(cf->samplesuffix, cf->suffix)) + { + suffix_gen_conf(f, cf->samplesuffix, "sampleRoot"); + } + + if ( cf->testconfig && cf->suffix && PL_strcasecmp(cf->testconfig, cf->suffix)) + { + suffix_gen_conf(f, cf->testconfig, "testRoot"); + } + + + /* tasks */ + fprintf(f, "dn: cn=import,cn=tasks,cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "cn: import\n"); + fprintf(f, "\n"); + + fprintf(f, "dn: cn=export,cn=tasks,cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "cn: export\n"); + fprintf(f, "\n"); + + fprintf(f, "dn: cn=backup,cn=tasks,cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "cn: backup\n"); + fprintf(f, "\n"); + + fprintf(f, "dn: cn=restore,cn=tasks,cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "cn: restore\n"); + fprintf(f, "\n"); + +#if defined(UPGRADEDB) + fprintf(f, "dn: cn=upgradedb,cn=tasks,cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "cn: upgradedb\n"); + fprintf(f, "\n"); +#endif + /* END of tasks */ + + + fprintf(f, "dn: cn=replication,cn=config\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: extensibleObject\n"); + fprintf(f, "cn: replication\n"); + fprintf(f, "\n"); + + if( cf->replicationdn && *(cf->replicationdn) ) + { + fprintf(f, "dn: cn=replication4,cn=replication,cn=config\n"); + fprintf(f, "cn: replication4\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: nsConsumer4Config\n"); + fprintf(f, "nsslapd-updatedn: %s\n", cf->replicationdn); + fprintf(f, "nsslapd-updatepw: %s\n", cf->replicationhashedpw); + fprintf(f, "\n"); + } + + if(cf->changelogdir && *(cf->changelogdir) ) + { + fprintf(f, "dn: cn=changelog4,cn=config\n"); + fprintf(f, "cn: changelog4\n"); + fprintf(f, "objectclass: top\n"); + fprintf(f, "objectclass: nsChangelog4Config\n"); + fprintf(f, "nsslapd-changelogdir: %s\n", cf->changelogdir); + fprintf(f, "nsslapd-changelogsuffix: %s\n", cf->changelogsuffix); + fprintf(f, "nsslapd-changelogmaxage: 2d\n"); + fprintf(f, "\n"); + + /* create the changelog directory */ + if( (t = create_instance_mkdir_p(cf->changelogdir, NEWDIR_MODE)) ) + return(t); + } + + fclose (f); + + sprintf(src, "%s%cconfig%cdse.ldif", cs_path, FILE_PATHSEP, FILE_PATHSEP); + sprintf(fn, "%s%cconfig%cdse_original.ldif", cs_path, FILE_PATHSEP, FILE_PATHSEP); + create_instance_copy(src, fn, 0600); + + /* + * generate slapd-collations.conf + */ + sprintf(src, "%s%cbin%c"PRODUCT_NAME"%cinstall%cconfig%c%s-collations.conf", + sroot, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, + FILE_PATHSEP, PRODUCT_NAME); + sprintf(dest, "%s%cconfig%c%s-collations.conf", cs_path, FILE_PATHSEP, + FILE_PATHSEP, PRODUCT_NAME); + if (!(srcf = fopen(src, "r"))) { + return make_error("Can't read from %s (%s)", src, ds_system_errmsg()); + } + if (!(f = fopen(dest, "w"))) { + return make_error("Can't write to %s (%s)", dest, ds_system_errmsg()); + } + while (fgets(line, sizeof(line), srcf)) { + if ((line[0] != '\0') && (fputs(line, f) == EOF)) { + make_error("Error writing to file %s from copy of %s (%s)", + dest, src, ds_system_errmsg()); + } + } + if (!feof(srcf)) { + make_error("Error reading from file %s (%s)", src, ds_system_errmsg()); + } + fclose(srcf); + fclose(f); + + sprintf(src, "%s/bin/slapd/install/schema", sroot); + sprintf(dest, "%s/config/schema", cs_path); + if (t = ds_copy_group_files(src, dest, 0)) + return t; + + sprintf(src, "%s/bin/slapd/install/presence", sroot); + sprintf(dest, "%s/config/presence", cs_path); + if (t = ds_copy_group_files(src, dest, 0)) + return t; + + /* Generate the orgchart configuration */ + sprintf(src, "%s/clients", sroot); + if (is_a_dir(src, "orgchart")) { + if (t = ds_gen_orgchart_conf(sroot, cs_path, cf)) { + return t; + } + } + + /* Generate dsgw.conf */ + sprintf(src, "%s/clients", sroot); + if (is_a_dir(src, "dsgw")) { + if (t = ds_gen_gw_conf(sroot, cs_path, cf, GW_CONF)) { + return t; + } + + /* Generate pb.conf */ + if (t = ds_gen_gw_conf(sroot, cs_path, cf, PB_CONF)) { + return t; + } + } + + return NULL; /* Everything worked fine */ +} + +/* + * Function: ds_gen_gw_conf + * + * Returns: pointer to error message, or NULL if all went well + * + * Description: This generates the gateway configuration files + * for the regular gateway stuff and for the phonebook. + * + * Author: RJP + * + */ +static char * +ds_gen_gw_conf(char *sroot, char *cs_path, server_config_s *cf, int conf_type) +{ + char dest[PATH_SIZE]; + char src[PATH_SIZE]; + char line[1024]; + FILE *f = NULL; + FILE *srcf = NULL; + char *t = NULL; + const char *ctxt; + + if (conf_type == GW_CONF) { + ctxt = "dsgw"; + } else { + ctxt = "pb"; + } + /* + * generate .../dsgw/context/[dsgw|pb].conf by creating the file, placing + * install-specific config. file lines at the start of file, and then + * copying the rest from NS-HOME/dsgw/config/dsgw.tmpl + */ + + sprintf(dest, "%s%cclients%cdsgw%ccontext%c%s.conf", sroot, FILE_PATHSEP,FILE_PATHSEP, + FILE_PATHSEP, FILE_PATHSEP, ctxt); + + + /* If the config file already exists, just return success */ + if (create_instance_exists(dest)) { + return(NULL); + } + + /* Attempt to open that bad boy */ + if(!(f = fopen(dest, "w"))) { + return make_error("Can't write to %s (%s)", dest, ds_system_errmsg()); + } + + /* Write out the appropriate values */ + fprintf(f, "# Used by Netscape Directory Server Gateway\n"); + fprintf(f, "baseurl\t\"ldap://%s:%s/", cf->servname, cf->servport); + fputs_escaped(cf->suffix, f); + fputs("\"\n\n",f); + if (cf->rootdn && *(cf->rootdn)) { + t = ds_enquote_config_value(DS_ROOTDN, cf->rootdn); + fprintf(f, "dirmgr\t%s\n\n", t ); + if (t != cf->rootdn) free(t); + } + + t = ds_enquote_config_value(DS_SUFFIX, cf->suffix); + fprintf(f, "location-suffix\t%s\n\n", t); + if (t != cf->suffix) free(t); + + + fprintf(f, "securitypath\t\"%s%calias%c%s-cert.db\"\n\n", sroot, FILE_PATHSEP, FILE_PATHSEP, ctxt ); + + fprintf(f, "# The url base to the orgchart application.\n#No link from the DSGW to the orgchart will appear in the UI if this configuration line is commented out.\n"); + fprintf(f, "url-orgchart-base\thttp://%s:%s/clients/orgchart/bin/org?context=%s&data=\n\n", cf->servname, cf->adminport ? cf->adminport : "80", ctxt); + + /* copy in template */ + if (conf_type == GW_CONF) { + sprintf(src, "%s%cclients%cdsgw%cconfig%cdsgw.tmpl", + sroot, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP); + } else if (conf_type == PB_CONF) { + sprintf(src, "%s%cclients%cdsgw%cpbconfig%cpb.tmpl", + sroot, FILE_PATHSEP,FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP); + } else { + /*This should never, ever happen if this function is called correctly*/ + fclose(f); + return make_error("Unknown gateway config file requested"); + } + + + /* Try to open the dsgw.conf template file (dsgw.tmpl) */ + if(!(srcf = fopen(src, "r"))) { + fclose(f); + return make_error("Can't read %s (%s)", src, ds_system_errmsg()); + } + + while(fgets(line, sizeof(line), srcf)) { + fputs(line, f); + } + + fclose(srcf); + fclose(f); + + /* Generate default.conf */ + if (conf_type == GW_CONF) { + struct passwd* pw = NULL; + char defaultconf[PATH_SIZE]; + +#if !defined( XP_WIN32 ) + /* find the server's UID and GID */ + if (cf->servuser && *(cf->servuser)) { + if ((pw = getpwnam (cf->servuser)) == NULL) { + return make_error("Could not find UID and GID of user '%s'.", cf->servuser); + } else if (pw->pw_name == NULL) { + pw->pw_name = cf->servuser; + } + } +#endif + + sprintf(defaultconf, "%s%cclients%cdsgw%ccontext%cdefault.conf", sroot, + FILE_PATHSEP,FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP); + + create_instance_copy(dest, defaultconf, NEWFILE_MODE); + chownfile (pw, defaultconf); + } + unlink(src); + + return NULL; +} + + +/* + * Function: ds_gen_orgchart_conf + * + * Returns: pointer to error message, or NULL if all went well + * + * Description: This generates the orgchart configuration file + * + * Author: RJP + * + */ +static char * +ds_gen_orgchart_conf(char *sroot, char *cs_path, server_config_s *cf) +{ + char dest[PATH_SIZE]; + char src[PATH_SIZE]; + char line[1024]; + FILE *f = NULL; + FILE *srcf = NULL; + char *t = NULL; + + /* + * generate .../clients/orgchart/config.txt by creating the file, placing + * install-specific config. file lines at the start of file, and then + * copying the rest from NS-HOME/clients/orgchart/config.tmpl + */ + sprintf(dest, "%s%cclients%corgchart%cconfig.txt", sroot, FILE_PATHSEP, + FILE_PATHSEP, FILE_PATHSEP ); + sprintf(src, "%s%cclients%corgchart%cconfig.tmpl", sroot, FILE_PATHSEP, + FILE_PATHSEP, FILE_PATHSEP); + + /* If the config file already exists, just return success */ + if (create_instance_exists(dest)) { + return(NULL); + } + + /* Attempt to open that bad boy */ + if(!(f = fopen(dest, "w"))) { + return make_error("Cannot write to %s (%s)", dest, ds_system_errmsg()); + } + + /* Write out the appropriate values */ + fprintf(f, "#############\n#\n#\n"); + fprintf(f, "# Configuration file for Netscape Directory Server Org Chart\n"); + fprintf(f, "# ----------------------------------------------------------\n#\n#\n"); + fprintf(f, "#############\n\n\n#\n"); + fprintf(f, "# Blank lines in this file, as well as lines that\n"); + fprintf(f, "# start with at least one \"#\" character, are both ignored.\n"); + fprintf(f, "#\n#\n"); + fprintf(f, "# Name/Value pairs below are (and need to be) separated with\n"); + fprintf(f, "# one or more tabs (or spaces)\n"); + fprintf(f, "#\n"); + + fprintf(f, "ldap-host\t%s\n", cf->servname); + fprintf(f, "ldap-port\t%s\n", cf->servport); + fprintf(f, "ldap-search-base\t%s\n\n", cf->suffix); + + fprintf(f, "#\n# If you would like to have the phonebook icon visible, you must\n"); + fprintf(f, "# supply the partial phonebook URL below, which will have each\n"); + fprintf(f, "# given user's DN attribute value concatenated to the end.\n"); + fprintf(f, "#\n# For example, you could specify below something close to:\n"); + fprintf(f, "#\n# url-phonebook-base http://hostname.domain.com/dsgw/bin/dosearch?context=default&hp=localhost&dn=\n#\n\n"); + fprintf(f, "url-phonebook-base\thttp://%s:%s/clients/dsgw/bin/dosearch?context=pb&hp=%s:%s&dn=\n\n",cf->servname, cf->adminport ? cf->adminport : "80", cf->servname, cf->servport); + + /*fputs_escaped(cf->suffix, f);*/ + /*fprintf(f, "\n\n");*/ + /* + *t = ds_enquote_config_value(DS_SUFFIX, cf->suffix); + *fprintf(f, "location-suffix\t%s\n\n", t); + *if (t != cf->suffix) free(t); + */ + + /*if (cf->rootdn && *(cf->rootdn)) { + *t = ds_enquote_config_value(DS_ROOTDN, cf->rootdn); + *fprintf(f, "dirmgr\t%s\n\n", t ); + *if (t != cf->rootdn) free(t); + }*/ + + /* Try to open the config.txt template file (config.tmpl) */ + if(!(srcf = fopen(src, "r"))) { + fclose(f); + return make_error("Can't read %s (%s)", src, ds_system_errmsg()); + } + + while(fgets(line, sizeof(line), srcf)) { + fputs(line, f); + } + + fclose(srcf); + fclose(f); + + unlink(src); + return NULL; +} + +/* + * Function: gen_presence_init + * + * Description: Creates a script to initialize images for use in the IM + * Presence plugin. + */ +#define PRESENCE_LDIF "init_presence_images.ldif" +static char *gen_presence_init_script(char *sroot, server_config_s *cf, + char *cs_path) +{ + char fn[PATH_SIZE]; + char dir[PATH_SIZE]; + FILE *f; + + sprintf(dir, "%s%cconfig%cpresence", + cs_path, FILE_PATHSEP, FILE_PATHSEP); + sprintf(fn, "%s%c%s", + dir, FILE_PATHSEP, PRESENCE_LDIF); + + if(!(f = fopen(fn, "w"))) + return make_error("Could not write to %s (%s).", fn, ds_system_errmsg()); + + fprintf( f, + "dn:cn=ICQ Presence,cn=Presence,cn=plugins,cn=config\n" + "changeType:modify\n" + "replace:nsim-onvaluemapgraphic\n" + "nsim-onvaluemapgraphic: %s%cicq-online.gif\n" + "\n" + "dn:cn=ICQ Presence,cn=Presence,cn=plugins,cn=config\n" + "changeType:modify\n" + "replace:nsim-offvaluemapgraphic\n" + "nsim-offvaluemapgraphic: %s%cicq-offline.gif\n" + "\n" + "dn:cn=ICQ Presence,cn=Presence,cn=plugins,cn=config\n" + "changeType:modify\n" + "replace:nsim-disabledvaluemapgraphic\n" + "nsim-disabledvaluemapgraphic: %s%cicq-disabled.gif\n" + "\n" + "dn:cn=AIM Presence,cn=Presence,cn=plugins,cn=config\n" + "changeType:modify\n" + "replace:nsim-onvaluemapgraphic\n" + "nsim-onvaluemapgraphic: %s%caim-online.gif\n" + "\n" + "dn:cn=AIM Presence,cn=Presence,cn=plugins,cn=config\n" + "changeType:modify\n" + "replace:nsim-offvaluemapgraphic\n" + "nsim-offvaluemapgraphic: %s%caim-offline.gif\n" + "\n" + "dn:cn=AIM Presence,cn=Presence,cn=plugins,cn=config\n" + "changeType:modify\n" + "replace:nsim-disabledvaluemapgraphic\n" + "nsim-disabledvaluemapgraphic: %s%caim-offline.gif\n" + "\n" + "dn:cn=Yahoo Presence,cn=Presence,cn=plugins,cn=config\n" + "changeType:modify\n" + "replace:nsim-offvaluemapgraphic\n" + "nsim-offvaluemapgraphic: %s%cyahoo-offline.gif\n" + "\n" + "dn:cn=Yahoo Presence,cn=Presence,cn=plugins,cn=config\n" + "changeType:modify\n" + "replace:nsim-onvaluemapgraphic\n" + "nsim-onvaluemapgraphic: %s%cyahoo-online.gif\n" + "\n" + "dn:cn=Yahoo Presence,cn=Presence,cn=plugins,cn=config\n" + "changeType:modify\n" + "replace:nsim-disabledvaluemapgraphic\n" + "nsim-disabledvaluemapgraphic: %s%cyahoo-offline.gif\n", + dir, FILE_PATHSEP, + dir, FILE_PATHSEP, + dir, FILE_PATHSEP, + dir, FILE_PATHSEP, + dir, FILE_PATHSEP, + dir, FILE_PATHSEP, + dir, FILE_PATHSEP, + dir, FILE_PATHSEP, + dir, FILE_PATHSEP + ); + fclose(f); + return NULL; +} + +/* + * Function init_presence + * + * Description: Runs ldapmodify to initialize the images used by the + * IM presence plugin + */ +static int init_presence(char *sroot, server_config_s *cf, char *cs_path) +{ + char cmd[PATH_SIZE]; + char tools[PATH_SIZE]; + char precmd[PATH_SIZE]; + + precmd[0] = 0; + sprintf(tools, "%s%cshared%cbin", sroot, FILE_PATHSEP, FILE_PATHSEP); + +#ifdef XP_UNIX + sprintf(precmd, "cd %s;", tools); +#endif + + sprintf(cmd, "%s%s%cldapmodify -q -p %d -b -D \"%s\" -w \"%s\" " + "-f %s%s%cconfig%cpresence%c%s%s", + precmd, + tools, FILE_PATHSEP, + atoi(cf->servport), + cf->rootdn, + cf->rootpw, + ENQUOTE, cs_path, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, + PRESENCE_LDIF, ENQUOTE); + return ds_exec_and_report( cmd ); +} + +/* + * Function: ds_gen_index + * + * Description: This generates the default index list. + * This function is passed the parent entry below which the nsIndex + * entries must be created. This allows to use it when creating: + * - the default index list (ie belowdn = cn=default indexes,cn=config...) + * - the userRoot backend (ie belowdn = cn=index,cn=userRoot...) + * + */ +static void +ds_gen_index(FILE* f, char* belowdn) +{ +#define MKINDEX(_name, _inst, _sys, _type1, _type2, _type3) do { \ + fprintf(f, "dn: cn=%s,%s\n", (_name), (_inst)); \ + fprintf(f, "objectclass: top\n"); \ + fprintf(f, "objectclass: nsIndex\n"); \ + fprintf(f, "cn: %s\n", (_name)); \ + fprintf(f, "nssystemindex: %s\n", (_sys) ? "true" : "false"); \ + if (_type1) \ + fprintf(f, "nsindextype: %s\n", (_type1)); \ + if (_type2) \ + fprintf(f, "nsindextype: %s\n", (_type2)); \ + if (_type3) \ + fprintf(f, "nsindextype: %s\n", (_type3)); \ + fprintf(f, "\n"); \ +} while (0) + + MKINDEX("aci", belowdn, 1, "pres", NULL, NULL); + MKINDEX("cn", belowdn, 0, "pres", "eq", "sub"); + MKINDEX("entrydn", belowdn, 1, "eq", NULL, NULL); + MKINDEX("givenName", belowdn, 0, "pres", "eq", "sub"); + MKINDEX("mail", belowdn, 0, "pres", "eq", "sub"); + MKINDEX("mailAlternateAddress", belowdn, 0, "eq", NULL, NULL); + MKINDEX("mailHost", belowdn, 0, "eq", NULL, NULL); + MKINDEX("member", belowdn, 0, "eq", NULL, NULL); + MKINDEX("nsCalXItemId", belowdn, 0, "pres", "eq", "sub"); + MKINDEX("nsLIProfileName", belowdn, 0, "eq", NULL, NULL); + MKINDEX("nsUniqueId", belowdn, 1, "eq", NULL, NULL); + MKINDEX("nswcalCALID", belowdn, 0, "eq", NULL, NULL); + MKINDEX("numsubordinates", belowdn, 1, "pres", NULL, NULL); + MKINDEX("objectclass", belowdn, 1, "eq", NULL, NULL); + MKINDEX("owner", belowdn, 0, "eq", NULL, NULL); + MKINDEX("parentid", belowdn, 1, "eq", NULL, NULL); + MKINDEX("pipstatus", belowdn, 0, "eq", NULL, NULL); + MKINDEX("pipuid", belowdn, 0, "pres", NULL, NULL); + MKINDEX("seeAlso", belowdn, 0, "eq", NULL, NULL); + MKINDEX("sn", belowdn, 0, "pres", "eq", "sub"); + MKINDEX("telephoneNumber", belowdn, 0, "pres", "eq", "sub"); + MKINDEX("uid", belowdn, 0, "eq", NULL, NULL); + MKINDEX("uniquemember", belowdn, 0, "eq", NULL, NULL); +} + + + +static char *install_ds(char *sroot, server_config_s *cf, char *param_name) +{ + SLAPD_CONFIG slapd_conf; + QUERY_VARS query_vars; + char *t, src[PATH_SIZE], dest[PATH_SIZE], big_line[PATH_SIZE]; + char cs_path[PATH_SIZE]; + struct passwd* pw = NULL; + int isrunning; + int status = 0; +#ifdef XP_WIN32 + WSADATA wsadata; +#endif + +#if !defined( XP_WIN32 ) + /* find the server's UID and GID */ + if (cf->servuser && *(cf->servuser)) { + if ((pw = getpwnam (cf->servuser)) == NULL) { + strcpy(param_name, "servuser"); + return make_error("Could not find UID and GID of user '%s'.", + cf->servuser); + } else if (pw->pw_name == NULL) { + pw->pw_name = cf->servuser; + } + } +#endif + + sprintf(cs_path, "%s%c"PRODUCT_NAME"-%s", sroot, FILE_PATHSEP, cf->servid); + + /* create all / */ + if ( (t = ds_cre_subdirs(sroot, cf, cs_path, pw)) ) + return(t); + + /* Generate all scripts */ + if ( (t = ds_gen_scripts(sroot, cf, cs_path)) ) + return(t); + +#if defined( XP_WIN32 ) + ds_dostounixpath( sroot ); + ds_dostounixpath( cs_path ); +#endif + + /* Generate all conf files */ + if ( (t = ds_gen_confs(sroot, cf, cs_path)) ) + return(t); + + sprintf(src, "%s%cbin%c"PRODUCT_NAME"%cinstall%cldif%cExample.ldif", sroot, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, + FILE_PATHSEP); + sprintf(dest, "%s%cldif%cExample.ldif", cs_path, FILE_PATHSEP, FILE_PATHSEP); + create_instance_copy(src, dest, NEWFILE_MODE); + chownfile (pw, dest); + + sprintf(src, "%s%cbin%c"PRODUCT_NAME"%cinstall%cldif%cExample-roles.ldif", sroot, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, + FILE_PATHSEP); + sprintf(dest, "%s%cldif%cExample-roles.ldif", cs_path, FILE_PATHSEP, FILE_PATHSEP); + create_instance_copy(src, dest, NEWFILE_MODE); + chownfile (pw, dest); + + sprintf(src, "%s%cbin%c"PRODUCT_NAME"%cinstall%cldif%cExample-views.ldif", sroot, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, + FILE_PATHSEP); + sprintf(dest, "%s%cldif%cExample-views.ldif", cs_path, FILE_PATHSEP, FILE_PATHSEP); + create_instance_copy(src, dest, NEWFILE_MODE); + chownfile (pw, dest); + + sprintf(src, "%s%cbin%c"PRODUCT_NAME"%cinstall%cldif%cEuropean.ldif", sroot, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, + FILE_PATHSEP); + sprintf(dest, "%s%cldif%cEuropean.ldif", cs_path, FILE_PATHSEP, FILE_PATHSEP); + create_instance_copy(src, dest, NEWFILE_MODE); + chownfile (pw, dest); + + /* new code for dsml sample files */ + sprintf(src, "%s%cbin%c"PRODUCT_NAME"%cinstall%cdsml%cExample.dsml", sroot, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, + FILE_PATHSEP); + sprintf(dest, "%s%cdsml%cExample.dsml", cs_path, FILE_PATHSEP, FILE_PATHSEP); + create_instance_copy(src, dest, NEWFILE_MODE); + chownfile (pw, dest); + + sprintf(src, "%s%cbin%c"PRODUCT_NAME"%cinstall%cdsml%cExample-roles.dsml", sroot, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, + FILE_PATHSEP); + sprintf(dest, "%s%cdsml%cExample-roles.dsml", cs_path, FILE_PATHSEP, FILE_PATHSEP); + create_instance_copy(src, dest, NEWFILE_MODE); + chownfile (pw, dest); + + sprintf(src, "%s%cbin%c"PRODUCT_NAME"%cinstall%cdsml%cEuropean.dsml", sroot, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, + FILE_PATHSEP); + sprintf(dest, "%s%cdsml%cEuropean.dsml", cs_path, FILE_PATHSEP, FILE_PATHSEP); + create_instance_copy(src, dest, NEWFILE_MODE); + chownfile (pw, dest); + + /* + If the user has specified an LDIF file to use to initialize the database, + load it now + */ + if (cf->install_ldif_file && !access(cf->install_ldif_file, 0)) + { + char msg[2*PATH_SIZE] = {0}; + int status = ds_ldif2db_backend_subtree(cf->install_ldif_file, NULL, cf->suffix); + if (status) + sprintf(msg, "The file %s could not be loaded", + cf->install_ldif_file); + else + sprintf(msg, "The file %s was successfully loaded", + cf->install_ldif_file); + ds_show_message(msg); + free(cf->install_ldif_file); + cf->install_ldif_file = NULL; + } + + /* + All of the config files have been written, and the server should + be ready to go. Start the server if the user specified to start + it or if we are configuring the server to serve as the repository + for SuiteSpot (Mission Control) information + Only attempt to start the server if the port is not in use + */ + if(needToStartServer(cf) && + !(t = create_instance_checkport(cf->bindaddr, cf->servport))) + { + sprintf(big_line,"SERVER_NAMES=slapd-%s",cf->servid); + putenv(big_line); + + isrunning = ds_get_updown_status(); + + if (isrunning != DS_SERVER_UP) + { + int start_status = 0; + int verbose = 1; + char instance_dir[PATH_SIZE], errorlog[PATH_SIZE]; + + if (getenv("USE_DEBUGGER")) + verbose = 0; + /* slapd-nickname directory */ + sprintf(instance_dir, "%s%c"PRODUCT_NAME"-%s", sroot, FILE_PATHSEP, + cf->servid); + /* error log file */ + sprintf(errorlog, "%s%clogs%cerrors", instance_dir, FILE_PATHSEP, + FILE_PATHSEP); + start_status = ds_bring_up_server_install(verbose, instance_dir, errorlog); + + if (start_status != DS_SERVER_UP) + { + /* + If we were going to configure the server for SuiteSpot (Mission + Control), the server must be running. Therefore, it is a very + bad thing, and we want to exit with a non zero exit code so the + caller will know something went wrong. + Otherwise, if the user just wanted to start the server for some + reason, just exit with a zero and the messages printed will + let the user know the server wasn't started. + */ + char *msg; + if (start_status == DS_SERVER_PORT_IN_USE) + msg = "The server could not be started because the port is in use."; + else if (start_status == DS_SERVER_MAX_SEMAPHORES) + msg = "No more servers may be installed on this system.\nPlease refer to documentation for information about how to\nincrease the number of installed servers per system."; + else if (start_status == DS_SERVER_CORRUPTED_DB) + msg = "The server could not be started because the database is corrupted."; + else if (start_status == DS_SERVER_NO_RESOURCES) + msg = "The server could not be started because the operating system is out of resources (e.g. CPU memory)."; + else if (start_status == DS_SERVER_COULD_NOT_START) + msg = "The server could not be started due to invalid command syntax or operating system resource limits."; + else + msg = "The server could not be started."; + + if( cf->cfg_sspt && !strcmp(cf->cfg_sspt, "1") ) + { + ds_report_error(DS_SYSTEM_ERROR, "server", msg); + return msg; + } + else + { + ds_show_message(msg); + return 0; + } + } + else + { + ds_show_message("Your new directory server has been started."); + } + } + + /* write ldap.conf */ + write_ldap_info( sroot, cf ); + +#ifdef XP_UNIX + ds_become_localuser_name (cf->servuser); +#endif +#ifdef XP_WIN32 + if( errno = WSAStartup(0x0101, &wsadata ) != 0 ) + { + char szTmp[512]; + /*replaced errno > -1 && errno < sys_nerr ? sys_errlist[errno] : + "unknown" with strerror(errno)*/ + sprintf(szTmp, "Error: Windows Sockets initialization failed errno %d (%s)
                      \n", errno, + strerror(errno), 0 ); + + fprintf (stdout, szTmp); + return 0; + } +#endif /* XP_WIN32 */ + + memset( &query_vars, 0, sizeof(query_vars) ); + if (!cf->use_existing_user_ds) + query_vars.suffix = myStrdup( cf->suffix ); + query_vars.ssAdmID = myStrdup( cf->cfg_sspt_uid ); + query_vars.ssAdmPW1 = myStrdup( cf->cfg_sspt_uidpw ); + query_vars.ssAdmPW2 = myStrdup( cf->cfg_sspt_uidpw ); + query_vars.rootDN = myStrdup( cf->rootdn ); + query_vars.rootPW = myStrdup( cf->rootpw ); + query_vars.admin_domain = + myStrdup( cf->admin_domain ); + query_vars.netscaperoot = myStrdup( cf->netscaperoot ); + query_vars.testconfig = myStrdup( cf->testconfig ); + query_vars.consumerDN = myStrdup(cf->consumerdn); + query_vars.consumerPW = myStrdup(cf->consumerhashedpw); + if (cf->cfg_sspt && !strcmp(cf->cfg_sspt, "1")) + query_vars.cfg_sspt = 1; + else + query_vars.cfg_sspt = 0; + + if (cf->suitespot3x_uid) + query_vars.config_admin_uid = myStrdup(cf->suitespot3x_uid); + else + query_vars.config_admin_uid = myStrdup(cf->cfg_sspt_uid); + + memset(&slapd_conf, 0, sizeof(SLAPD_CONFIG)); + if (sroot) + strcpy(slapd_conf.slapd_server_root, sroot); + if (cf->servport) + slapd_conf.port = atoi(cf->servport); + if (cf->servname) + strcpy(slapd_conf.host, cf->servname); + + status = config_suitespot(&slapd_conf, &query_vars); + if (status == -1) /* invalid or null arguments or configuration */ + return "Invalid arguments for server configuration."; + } + else if (t) /* just notify the user about the port conflict */ + { + ds_show_message(t); + } + + /* Create script for initializing IM Presence images */ + if ((NULL == t) && (0 == status)) + { + if ( (t = gen_presence_init_script(sroot, cf, cs_path)) ) + return(t); + /* Initialize IM Presence images */ + status = init_presence(sroot, cf, cs_path); + if (status) + return make_error ("ds_exec_and_report() failed (%d).", status); + } + + if (status) + return make_error ("Could not configure server (%d).", status); + + return(NULL); +} + +/* write_ldap_info() : writes ldap.conf */ + +static int +write_ldap_info( char *slapd_server_root, server_config_s *cf) +{ + FILE* fp; + int ret = 0; + + char* fmt = "%s/shared/config/ldap.conf"; + char* infoFileName; + + if (!slapd_server_root) { + return -1; + } + + infoFileName = (char*)malloc(strlen(fmt) + strlen(slapd_server_root) + 1); + sprintf(infoFileName, fmt, slapd_server_root); + + if ((fp = fopen(infoFileName, "w")) == NULL) + { + ret = -1; + } + else + { + fprintf(fp, "url\tldap://%s:%d/", + cf->servname, atoi(cf->servport)); + + if (cf->suffix) + fprintf(fp, "%s", cf->suffix); + + fprintf(fp, "\n"); + + if (cf->cfg_sspt_uid) { + fprintf(fp, "admnm\t%s\n", cf->cfg_sspt_uid); + } + + fclose(fp); + } +#if defined( SOLARIS ) + /* + * Solaris 9+ specific installation + */ + if (iDSISolaris) + logUninstallInfo(slapd_server_root, PRODUCT_NAME, PRODUCT_NAME, infoFileName); + +#endif /* SOLARIS */ + free(infoFileName); + + return ret; +} + diff --git a/ldap/admin/src/create_instance.h b/ldap/admin/src/create_instance.h new file mode 100644 index 00000000..d1f7c5c3 --- /dev/null +++ b/ldap/admin/src/create_instance.h @@ -0,0 +1,112 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/* + * create_instance.h: create an instance of a directory server + * + * Rob McCool + */ + + +#ifndef _create_instance_h +#define _create_instance_h + +#ifdef __cplusplus +extern "C" { /* Assume C declarations for C++ */ +#endif /* __cplusplus */ + + +#ifdef XP_UNIX +#define PRODUCT_NAME "slapd" + +#define PRODUCT_BIN "ns-slapd" + +#endif + +typedef struct { + char *sroot; + + char *servname; + char *bindaddr; + char *servport; + char *suitespot3x_uid; + char *cfg_sspt; + char *cfg_sspt_uid; + char *cfg_sspt_uidpw; + char *secserv; + char *secservport; + char *ntsynch; + char *ntsynchssl; + char *ntsynchport; + char *rootdn; + char *rootpw; + char *roothashedpw; + char *replicationdn; + char *replicationpw; + char *replicationhashedpw; + char *consumerdn; + char *consumerpw; + char *consumerhashedpw; + char *changelogdir; + char *changelogsuffix; + char *suffix; + char *loglevel; + char *netscaperoot; + char *samplesuffix; + char *testconfig; + char *servid; +#ifdef XP_UNIX + char *servuser; + char *numprocs; +#endif + char *minthreads; + char *maxthreads; + int upgradingServer; + + char * start_server; + + char * admin_domain; + char * config_ldap_url; + char * user_ldap_url; + int use_existing_user_ds; + int use_existing_config_ds; + char * disable_schema_checking; + char * install_ldif_file; + char *adminport; +} server_config_s; + + +#ifdef NS_UNSECURE +#define DEFAULT_ID "unsecure" +#else +#define DEFAULT_ID "secure" +#endif + +/* + Initialize a server config structure with default values, using sroot + as the server root, and hn as the machine's full host name. + */ +void set_defaults(char *sroot, char *hn, server_config_s *conf); + +/* + Create a server using the given configuration structure. This affects + files and directories in the structure's server root. space for param_name + should be allocated by the caller e.g. char param_name[ENOUGH_ROOM]. + If there was a problem with one of the parameters passed in for instance + creation e.g. servport is out of range, the param_name parameter will be + filled in with "servport" and the error message returned will contain + additional detail + */ +char *create_server(server_config_s *cf, char *param_name); + +/* from script-gen.c */ +int generate_script(const char *inpath, const char *outpath, int mode, + const char *table[][2]); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif diff --git a/ldap/admin/src/ds_bak2db.c b/ldap/admin/src/ds_bak2db.c new file mode 100644 index 00000000..d4ce49e4 --- /dev/null +++ b/ldap/admin/src/ds_bak2db.c @@ -0,0 +1,71 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/* + * Restores a database. + * + * Anil Bhavnani + * Removed all HTML output for DS 4.0: Rob Weltman + */ + +#include +#include +#include "libadminutil/admutil.h" +#include "dsalib.h" +#include "init_ds_env.h" +#include + +int main(int argc, char *argv[]) +{ + int isrunning; + char *filename = NULL; + int status; + + fprintf(stdout, "Content-type: text/html\n\n"); + + if ( init_ds_env() ) + return 1; + + /* + * Get value of the "filename" variable. + */ + filename = ds_get_cgi_var("filename"); + if ( (NULL == filename) || (strlen(filename) < 1) ) { + fprintf(stdout, "Environment variable filename not defined.\n"); + rpt_err( DS_UNDEFINED_VARIABLE, "filename", NULL, NULL ); + return 1; + } + + /* Check if server is up */ + isrunning = ds_get_updown_status(); + + /* Stop it, if so */ + if (isrunning != DS_SERVER_DOWN) { + status = ds_bring_down_server(); + if(status != DS_SERVER_DOWN) { + rpt_err( DS_SERVER_MUST_BE_DOWN, filename, NULL, NULL ); + return 1; + } + } + + ds_send_status("restoring database ..."); + status = ds_bak2db(filename); + + if ( !status ) { + rpt_success("Success! The database has been restored."); + status = 0; + } else { + rpt_err( status, filename, NULL, NULL ); + status = 1; + } + + /* Restart the server if we brought it down */ + if (isrunning != DS_SERVER_DOWN) { + if(ds_bring_up_server(1) != DS_SERVER_UP) { + ds_send_status( "An error occurred during startup" ); + } + } + return status; +} diff --git a/ldap/admin/src/ds_db2bak.c b/ldap/admin/src/ds_db2bak.c new file mode 100644 index 00000000..bca6bce5 --- /dev/null +++ b/ldap/admin/src/ds_db2bak.c @@ -0,0 +1,77 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/* + * Backs up the database. + * + * Anil Bhavnani + * Removed all HTML output for DS 4.0: Rob Weltman + */ + +#include +#include +#include "libadminutil/admutil.h" +#include "dsalib.h" +#include "init_ds_env.h" +#include +#ifdef XP_UNIX +#include +#endif + +int main(int argc, char *argv[]) +{ + char *filename = NULL; + int status; + + fprintf(stdout, "Content-type: text/html\n\n"); + + if ( init_ds_env() ) + return 1; + + /* + * Get value of the "filename" variable. + */ + filename = ds_get_cgi_var("filename"); + if ( (NULL == filename) || (strlen(filename) < 1) ) { + rpt_err( DS_UNDEFINED_VARIABLE, "filename", NULL, NULL ); + return 1; + } + + ds_become_localuser (ds_get_config (DS_REAL_CONFIG)); + +#define NEWDIR_MODE 0755 + /* Attempt to detect up front if file cannot be written */ + status = -1; + /* Attempt to create the backup directory */ + if ( 0 == ds_mkdir_p(filename, NEWDIR_MODE) ) { + char foo[256]; + FILE *f; + /* Now attempt to create a file there (the directory might + already have existed */ + sprintf( foo, "%s%c%s", filename, FILE_PATHSEP, "foo" ); + f = fopen(foo, "w"); + if ( NULL != f ) { + status = 0; + fclose( f ); + unlink( foo ); + } + } + if ( status ) { + rpt_err( DS_CANNOT_CREATE_FILE, filename, NULL, NULL ); + return 1; + } + + ds_send_status("backing up database ..."); + + status = ds_db2bak( filename ); /* prints errors as needed */ + + if ( !status ) { + rpt_success("Success! The database has been backed up."); + return 0; + } else { + rpt_err( status, filename, NULL, NULL ); + return 1; + } +} diff --git a/ldap/admin/src/ds_db2ldif.c b/ldap/admin/src/ds_db2ldif.c new file mode 100644 index 00000000..42c755a4 --- /dev/null +++ b/ldap/admin/src/ds_db2ldif.c @@ -0,0 +1,78 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/* + * Converts the database into an ldif file. + * + * Anil Bhavnani + * Removed all HTML output for DS 4.0: Rob Weltman + */ + +#include +#include +#include "libadminutil/admutil.h" +#include "dsalib.h" +#include "init_ds_env.h" +#include +#ifdef XP_UNIX +#include +#endif + +int main(int argc, char *argv[]) +{ + char *filename = NULL; + char *subtree = NULL; + int status; + FILE *f; + + fprintf(stdout, "Content-type: text/html\n\n"); + + if ( init_ds_env() ) + return 1; + + /* + * Get value of the "filename" variable. + */ + filename = ds_get_cgi_var("filename"); + if ( (NULL == filename) || (strlen(filename) < 1) ) { + rpt_err( DS_UNDEFINED_VARIABLE, "filename", NULL, NULL ); + return 1; + } + + ds_become_localuser (ds_get_config (DS_REAL_CONFIG)); + + /* Attempt to detect up front if file cannot be written */ + f = fopen(filename, "w"); + if ( NULL != f ) { + fclose( f ); + unlink( filename ); + } else { + rpt_err( DS_CANNOT_CREATE_FILE, filename, NULL, NULL ); + return 1; + } + + /* + * Get value of the "subtree" variable. + */ + subtree = ds_get_cgi_var("subtree"); + + ds_send_status("creating LDIF file ..."); + + if ( (subtree != NULL) && (*subtree != 0) ) { + char *escaped = ds_escape_for_shell( subtree ); + status = ds_db2ldif_subtree(filename, escaped); + free( escaped ); + } else { + status = ds_db2ldif(filename); /* prints errors as needed */ + } + + if ( !status ) { + rpt_success("Success! The database has been exported."); + return 0; + } else { + rpt_err( status, filename, NULL, NULL ); + return 1; + } +} diff --git a/ldap/admin/src/ds_ldif2db.c b/ldap/admin/src/ds_ldif2db.c new file mode 100644 index 00000000..f98c47da --- /dev/null +++ b/ldap/admin/src/ds_ldif2db.c @@ -0,0 +1,103 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/* + * ds_ldif2db.c: Converts an ldif file into a database. + * + * Anil Bhavnani + * Removed all HTML output for DS 4.0: Rob Weltman + */ + +#include +#include +#include "libadminutil/admutil.h" +#include "dsalib.h" +#include "init_ds_env.h" +#include + +int main(int argc, char *argv[]) +{ + int isrunning; + char *filename = NULL; + char *saveconfig = NULL; + int preserve; + int status; + + setbuf(stdout, 0); +#ifdef DEBUG_CGI + freopen("\\tmp\\stderr.out", "w", stderr); +#else + dup2(fileno(stdout), fileno(stderr)); +#endif /* DEBUG_CGI */ + fprintf(stdout, "Content-type: text/html\n\n"); + + if ( init_ds_env() ) + return 1; + + /* + * Get value of the "filename" variable. + */ + filename = ds_get_cgi_var("filename"); + if ( (NULL == filename) || (strlen(filename) < 1) ) { + rpt_err( DS_UNDEFINED_VARIABLE, "filename", NULL, NULL ); + return 1; + } + +#ifdef DEBUG_CGI + fprintf(stderr, "filename=%s\n", filename); +#endif /* DEBUG_CGI */ + + /* + * Get value of the "saveconfig" variable. + */ + saveconfig = ds_get_cgi_var("saveconfig"); + preserve = ( (saveconfig == NULL) || !(strcmp(saveconfig,"true")) ); + +#ifdef DEBUG_CGI + fprintf(stderr, "preserve=%d\n", preserve); +#endif /* DEBUG_CGI */ + + /* Check if server is up */ + isrunning = ds_get_updown_status(); + +#ifdef DEBUG_CGI + fprintf(stderr, "isrunning=%d\n", isrunning); +#endif /* DEBUG_CGI */ + + /* Stop it, if so */ + if (isrunning != DS_SERVER_DOWN) { + status = ds_bring_down_server(); +#ifdef DEBUG_CGI + fprintf(stderr, "status=%d\n", status); +#endif /* DEBUG_CGI */ + if(status != DS_SERVER_DOWN) { + rpt_err( DS_SERVER_MUST_BE_DOWN, filename, NULL, NULL ); + return 1; + } + } + + ds_send_status("creating database ..."); + if ( preserve ) + status = ds_ldif2db_preserve(filename); /* prints errors as needed */ + else + status = ds_ldif2db(filename); /* prints errors as needed */ + + if ( !status ) { + rpt_success("Success! The database has been imported."); + status = 0; + } else { + rpt_err( status, filename, NULL, NULL ); + status = 1; + } + + /* Restart the server if we brought it down */ + if (isrunning != DS_SERVER_DOWN) { + int retval; + if((retval=ds_bring_up_server(1)) != DS_SERVER_UP) { + ds_send_status( "An error occurred during startup" ); + } + } + return status; +} diff --git a/ldap/admin/src/ds_listdb.c b/ldap/admin/src/ds_listdb.c new file mode 100644 index 00000000..5d0c06ad --- /dev/null +++ b/ldap/admin/src/ds_listdb.c @@ -0,0 +1,37 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/* + * List the database backup directories. + * No HTML - this is for DS 4.0. + * + * Rob Weltman + */ + +#include +#include +#include "dsalib.h" + +int main(int argc, char *argv[], char *envp[]) +{ + char **bak_dirs; + + ds_become_localuser (ds_get_config (DS_REAL_CONFIG)); + + /* Tell the receiver we are about to start sending data */ + fprintf(stdout, "\n"); + bak_dirs = ds_get_bak_dirs(); + if ( bak_dirs != NULL ) /* no error */ { + char **cur_file = bak_dirs; + while ( *cur_file != NULL ) { + fprintf(stdout, "%s\n", *cur_file); + cur_file++; + } + } + + ds_become_original(); + + return 0; +} diff --git a/ldap/admin/src/ds_remove.c b/ldap/admin/src/ds_remove.c new file mode 100644 index 00000000..c9fa8020 --- /dev/null +++ b/ldap/admin/src/ds_remove.c @@ -0,0 +1,234 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/* + * Remove the server + * + * Prasanta Behera + */ +#ifdef XP_WIN32 +#include +#include +#include "regparms.h" +extern BOOL DeleteServer(LPCSTR pszServiceId); +#endif + +#include +#include +#include +#include "libadminutil/admutil.h" +#ifdef XP_UNIX +#include +#include +#include +#include +#include +#include +#else +#endif /* WIN32? */ +#include + +#include "dsalib.h" +#include "init_ds_env.h" +#include "ds_remove_uninst.h" + + +#include "nspr.h" + +/* this will be set to 1 if we need to retry the + rm -rf of the instance directory again */ +static int try_rm_rf_again = 0; + +static int +rm_rf_err_func(const char *path, const char *op, void *arg) +{ + PRInt32 errcode = PR_GetError(); + char *msg; + const char *errtext; + + if (!errcode || (errcode == PR_UNKNOWN_ERROR)) { + errcode = PR_GetOSError(); + errtext = ds_system_errmsg(); + } else { + errtext = PR_ErrorToString(errcode, PR_LANGUAGE_I_DEFAULT); + } + + /* ignore "file or directory already removed" errors */ + if (errcode != PR_FILE_NOT_FOUND_ERROR) { + msg = PR_smprintf("%s %s: error code %d (%s)", op, path, errcode, errtext); + ds_send_error(msg, 0); + PR_smprintf_free(msg); + } + + /* On Windows and HPUX, if the file/directory to remove is opened by another + application, it cannot be removed and will generate a busy error + This usually happens when we attempt to stop slapd then remove the + instance directory, but for some reason the process still has some + open files + In this case, we need to wait for some period of time then attempt to + remove the instance directory again + */ + if (errcode == PR_FILE_IS_BUSY_ERROR) { + try_rm_rf_again = 1; + return 0; /* just abort the operation */ + } + +#ifdef XP_WIN32 + /* on windows, err 145 means dir not empty + 145 The directory is not empty. ERROR_DIR_NOT_EMPTY + If there was a busy file, it wasn't able to be + removed, so when we go to remove the directory, it + won't be empty + */ + if (errcode == ERROR_DIR_NOT_EMPTY) { + if (try_rm_rf_again) { + return 0; /* don't continue */ + } + } +#else /* unix */ + if (errcode == EEXIST) { /* not empty */ + if (try_rm_rf_again) { + return 0; /* don't continue */ + } + } +#endif + + return 1; /* just continue */ +} + +int main(int argc, char *argv[]) +{ + int status = -1; + char *servername; + char *installroot; + int isRunning; +#ifndef __LP64__ +#ifdef hpux + _main(); +#endif +#endif + +#ifdef XP_WIN32 + if ( getenv("DEBUG_DSINST") ) + DebugBreak(); +#endif + + /* case 1: being called as program -f inffile */ + if (argc > 2 && argv[1][0] == '-' && argv[1][1] == 'f') + { + FILE *infFile = fopen(argv[2], "r"); + if (!infFile) + { + ds_report_error (DS_INCORRECT_USAGE, argv[2], + "This file could not be opened. A valid file must be given."); + status = 1; + + return status; + } + else + fclose(infFile); + + ds_uninst_set_cgi_env(argv[2]); + } else if (getenv("REQUEST_METHOD")) { /* case 2: called as a CGI */ + fprintf(stdout, "Content-type: text/html\n\n"); + fflush(stdout); + } else { /* case 3: run from the command line */ + /* when being run from the command line, we require many command line arguments */ + /* we need to do 2 or three things: + 1 - stop the server and remove the server instance directory + 2 - remove the server's information from the config ds + 3 - On Windows, remove the registry information + We require the instance name as an argument. We also need the following: + For 1, we need the server root + For 2, we need the config ds host, port, admin domain, admin dn, admin password + For 3, just the instance name + + There are two other arguments that are optional. -force will ignore errors and just keep + going. On Windows, -allreg will clean up all known registry information for all instances + of DS on this machine + */ + } + + + if ( init_ds_env() ) { + return 1; + } + + /* + * Get the server pathto delete. + * serevrpath = /export/serevrs/dirserv/slapd-talac + */ + if (!(servername = ds_get_cgi_var("InstanceName"))) + servername = ds_get_server_name(); + + /* Check again if the serevr is down or not */ + if((isRunning = ds_get_updown_status()) == DS_SERVER_UP) { + if ((status = ds_bring_down_server()) != DS_SERVER_DOWN) { + char buf[1024]; + sprintf(buf, "Could not stop server: error %d", status); + ds_report_error (DS_GENERAL_FAILURE, servername, buf); + return 1; + } + } + + if (servername) { + char line[1024]; + int busy_retries = 3; /* if busy, retry this many times */ + installroot = ds_get_install_root(); + /* We may get busy errors if files are in use when we try + to remove them, so if that happens, sleep for 30 seconds + and try again */ + status = ds_rm_rf(installroot, rm_rf_err_func, NULL); + while (status && try_rm_rf_again && busy_retries) { + sprintf(line, "Some files or directories in %s are still in use. Will sleep for 30 seconds and try again.", + installroot); + ds_show_message(line); + PR_Sleep(PR_SecondsToInterval(30)); + try_rm_rf_again = 0; + --busy_retries; + status = ds_rm_rf(installroot, rm_rf_err_func, NULL); + } + if (status) { + sprintf(line, "Could not remove %s. Please check log messages and try again.", + installroot); + ds_send_error(line, 0); + } + } +#ifdef XP_WIN32 + if (servername) { + status += ds_remove_reg_key(HKEY_LOCAL_MACHINE, "%s\\%s\\%s\\%s", KEY_SOFTWARE_NETSCAPE, + DS_NAME_SHORT, DS_VERSION, servername); + + /* also try to remove version key in case this is the last instance */ + status += ds_remove_reg_key(HKEY_LOCAL_MACHINE, "%s\\%s\\%s", KEY_SOFTWARE_NETSCAPE, + DS_NAME_SHORT, DS_VERSION); + + /* also try to remove product key in case this is the last instance */ + status += ds_remove_reg_key(HKEY_LOCAL_MACHINE, "%s\\%s", KEY_SOFTWARE_NETSCAPE, + DS_NAME_SHORT); + + /* also need to remove service */ + if (!DeleteServer(servername)) { + status += 1; + } + + /* Remove Event Log Key */ + status += ds_remove_reg_key(HKEY_LOCAL_MACHINE, "%s\\%s\\%s", KEY_SERVICES, KEY_EVENTLOG_APP, servername); + } +#endif + + if (status == 0) { + char buf[1024]; + sprintf(buf, "Server %s was successfully removed", servername); + ds_show_message(buf); + rpt_success(""); + } else { + char buf[1024]; + sprintf(buf, "Could not remove server %s", servername); + ds_send_error(buf, 0); + } + + return status; +} diff --git a/ldap/admin/src/ds_remove_uninst.cpp b/ldap/admin/src/ds_remove_uninst.cpp new file mode 100644 index 00000000..d38de4fa --- /dev/null +++ b/ldap/admin/src/ds_remove_uninst.cpp @@ -0,0 +1,317 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +// ds_remove_uninst.cpp +// +// ds_remove routines that use c++ calls in adminsdk +// +#include +#include +#include /* printf, file I/O */ +#include /* strlen */ +#include +#ifdef XP_UNIX +#include +#include +#include +#include +#include +#include +#include +#endif +#include /* memset, rand stuff */ +#include +#include +#include +#include + +#include "ds_remove_uninst.h" + +#ifdef __cplusplus +extern "C" { +#endif +#include "dsalib.h" +#ifdef __cplusplus +} + +#include "prprf.h" + +#endif +#ifdef XP_UNIX +#include "ux-util.h" +#endif +#include "ldapu.h" +#include "install_keywords.h" +#include "global.h" +#include "setupapi.h" + +#define MAX_STR_SIZE 512 + +static InstallLog *installLog = NULL; + +static void +dsLogMessage(const char *level, const char *which, + const char *format, ...) +{ + char bigbuf[BIG_BUF*4]; + va_list ap; + va_start(ap, format); + PR_vsnprintf(bigbuf, BIG_BUF*4, format, ap); + va_end(ap); +#ifdef _WIN32 // always output to stdout (for CGIs), and always log + // if a log is available + fprintf(stdout, "%s %s %s\n", level, which, bigbuf); + fflush(stdout); + if (installLog) + installLog->logMessage(level, which, bigbuf); +#else // not Windows + if (installLog) + installLog->logMessage(level, which, bigbuf); + else + fprintf(stdout, "%s %s %s\n", level, which, bigbuf); + fflush(stdout); +#endif + + return; +} + +// replace \ in path with \\ for LDAP search filters +static char * +escapePath(const char *path) +{ + char *s = 0; + if (path) { + s = new char [(strlen(path)+1)*2]; // worst case + char *p = s; + const char *pp = path; + for (; *pp; ++pp, ++p) { + if (*pp == '\\') { + *p++ = *pp; + } + *p = *pp; + } + *p = 0; + } + + return s; +} + +static LdapErrorCode +localRemoveISIE(LdapEntry &isieEntry) +{ + /* stevross: for now explicitly delete ISIE because it's not getting + removed by removeSIE for some reason */ + LdapError err = isieEntry.dropAll(isieEntry.entryDN()); + if (err.errorCode()) + { + dsLogMessage(SETUP_LOG_FATAL, "Slapd", + "Error: could not remove ISIE entry %s: error = %d", + (const char *)isieEntry.entryDN(), (int)err.errorCode()); + } + + // OK to remove, recursively go up the tree and remove all + char *dn = new char [strlen(isieEntry.entryDN()) + 10]; + char **explodedDN = ldap_explode_dn(isieEntry.entryDN(), 0); + int i = 0; + + while (1) + { + dn[0] = 0; + char **s = &explodedDN[i]; + while (*s != NULL) + { + strcat(dn, *s); + strcat(dn, LDAP_PATHSEP); + s++; + } + + if (*s == NULL) + { + dn[strlen(dn)-strlen(LDAP_PATHSEP)] = 0; + } + + if (strcasecmp(dn, DEFAULT_ROOT_DN) == 0) + { + break; + } + + err = isieEntry.retrieve(OBJECT_CLASS_FILTER, LDAP_SCOPE_ONELEVEL, dn); + + if (err == NOT_FOUND) + { + isieEntry.drop(dn); + ++i; + } + else + { + break; + } + } + + delete [] dn; + ldap_value_free(explodedDN); + + return OKAY; +} + +////////////////////////////////////////////////////////////////////////////// +// removeInstanceLDAPEntries +// +// +// remove sie, isie of this instance +// +// +// +// + +int removeInstanceLDAPEntries(const char *pszLdapHost, + const char *pszPort, + const char *pszLdapSuffix, + const char *pszUser, + const char *pszPw, + const char *pszInstanceName, + const char *pszInstanceHost, + const char *pszServerRoot) +{ + LDAP *ld = NULL; + char szSearchBase[] = "o=NetscapeRoot"; + + /* open LDAP connection */ + LdapError ldapError = 0; + NSString newURL = NSString("ldap://") + pszLdapHost + ":" + + pszPort + "/" + pszLdapSuffix; + Ldap ldap(ldapError, newURL, pszUser, pszPw, 0, 0); + if (ldapError.errorCode()) + { + return 1; + } + + /* get SIE entry */ + char *sroot = escapePath(pszServerRoot); + LdapEntry sieEntry(&ldap); + NSString sieFilter = NSString("(&(serverhostname=") + pszInstanceHost + + ")(cn=" + pszInstanceName + ")(serverroot=" + + sroot + "))"; + ldapError = sieEntry.retrieve(sieFilter, LDAP_SCOPE_SUBTREE, szSearchBase); + if (ldapError.errorCode()) + { + dsLogMessage(SETUP_LOG_FATAL, "Slapd", + "Error: could not find the SIE entry using filter %s: error = %d", + (const char *)sieFilter, (int)ldapError.errorCode()); + delete [] sroot; + return 1; + } + + /* get ISIE entry */ + LdapEntry isieEntry(&ldap); + NSString isieFilter = + NSString("(&(objectclass=nsApplication)(uniquemember=") + + sieEntry.entryDN() + ")(nsinstalledlocation=" + + sroot + "))"; + ldapError = isieEntry.retrieve(isieFilter, LDAP_SCOPE_SUBTREE, szSearchBase); + if (ldapError.errorCode()) + { + dsLogMessage(SETUP_LOG_FATAL, "Slapd", + "Error: could not find the ISIE entry using filter %s: error = %d", + (const char *)isieFilter, (int)ldapError.errorCode()); + delete [] sroot; + return 1; + } + + /* delete the SIE and ISIE entry */ + LdapErrorCode code = removeSIE(&ldap, sieEntry.entryDN(), False); + if (code) + { + dsLogMessage(SETUP_LOG_FATAL, "Slapd", + "Error: could not remove SIE entry %s: error = %d", + (const char *)sieEntry.entryDN(), (int)code); + return code; + } + + code = localRemoveISIE(isieEntry); + + delete [] sroot; + return code; +} + + +int ds_uninst_set_cgi_env(char *pszInfoFileName) +{ + InstallInfo *uninstallInfo = NULL; + InstallInfo *instanceInfo = NULL; + static char szQueryString[512] = {0}; + static char szScriptName[512] = {0}; + static char szNetsiteRoot[512] = {0}; + const char *serverID = 0; + const char *tmp; + + uninstallInfo = new InstallInfo(pszInfoFileName); + + if (!uninstallInfo) + return 1; + + instanceInfo = uninstallInfo->getSection("uninstall"); + if (!instanceInfo) + instanceInfo = uninstallInfo; + + putenv("REQUEST_METHOD=GET"); + if (instanceInfo->get(SLAPD_KEY_SERVER_IDENTIFIER)) + serverID = instanceInfo->get(SLAPD_KEY_SERVER_IDENTIFIER); + else if (ds_get_server_name()) + serverID = ds_get_server_name(); + + if (serverID) + sprintf(szQueryString, "QUERY_STRING=InstanceName=%s", + serverID); + + putenv(szQueryString); + + if (instanceInfo->get(SLAPD_KEY_SERVER_ROOT)) + sprintf(szNetsiteRoot, "NETSITE_ROOT=%s", + instanceInfo->get(SLAPD_KEY_SERVER_ROOT)); + putenv(szNetsiteRoot); + + if (serverID) + sprintf(szScriptName, "SCRIPT_NAME=/%s/Tasks/Operation/Remove", + serverID); + putenv(szScriptName); + + // remove SIE entry + const char *host = instanceInfo->get(SLAPD_KEY_K_LDAP_HOST); + char port[20] = {0}; + if (instanceInfo->get(SLAPD_KEY_K_LDAP_PORT)) + strcpy(port, instanceInfo->get(SLAPD_KEY_K_LDAP_PORT)); + const char *suffix = instanceInfo->get(SLAPD_KEY_SUFFIX); + const char *ldapurl = instanceInfo->get(SLAPD_KEY_K_LDAP_URL); + LDAPURLDesc *desc = 0; + if (ldapurl && !ldap_url_parse((char *)ldapurl, &desc) && desc) { + if (!host) + host = desc->lud_host; + if (port[0] == 0) + sprintf(port, "%d", desc->lud_port); + if (!suffix) + suffix = desc->lud_dn; + } + + // get and set the log file + if (tmp = instanceInfo->get(SLAPD_INSTALL_LOG_FILE_NAME)) + { + static char s_logfile[PATH_MAX+32]; + PR_snprintf(s_logfile, PATH_MAX+32, "DEBUG_LOGFILE=%s", tmp); + putenv(s_logfile); + installLog = new InstallLog(tmp); + } + + removeInstanceLDAPEntries(host, port, suffix, + instanceInfo->get(SLAPD_KEY_SERVER_ADMIN_ID), + instanceInfo->get(SLAPD_KEY_SERVER_ADMIN_PWD), + serverID, + instanceInfo->get(SLAPD_KEY_FULL_MACHINE_NAME), + instanceInfo->get(SLAPD_KEY_SERVER_ROOT)); + + if (desc) + ldap_free_urldesc(desc); + return 0; +} diff --git a/ldap/admin/src/ds_remove_uninst.h b/ldap/admin/src/ds_remove_uninst.h new file mode 100644 index 00000000..15c28c59 --- /dev/null +++ b/ldap/admin/src/ds_remove_uninst.h @@ -0,0 +1,23 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/* ds_remove_uninst.h */ + + +#ifndef _DS_REMOVE_UNINST_H_ +#define _DS_REMOVE_UNINST_H_ + +#ifdef __cplusplus +extern "C" { +#endif + + +int ds_uninst_set_cgi_env(char *pszInfoFileName); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/ldap/admin/src/ds_rmdb.c b/ldap/admin/src/ds_rmdb.c new file mode 100644 index 00000000..08a1bb7c --- /dev/null +++ b/ldap/admin/src/ds_rmdb.c @@ -0,0 +1,73 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/* + * Delete backed-up database files. + * + * Anil Bhavnani + * Removed all HTML output for DS 4.0: Rob Weltman + */ + +#include +#include +#include "libadminutil/admutil.h" +#include "dsalib.h" +#include "portable.h" +#include "init_ds_env.h" +#include +#ifdef XP_UNIX +#include +#endif + +#ifndef MAXPATHLEN +#define MAXPATHLEN 1024 +#endif + +int main(int argc, char *argv[], char *envp[]) +{ + char *del_file = NULL; + char **bak_files; + int file_count = 0; + int err = 0; + + fprintf(stdout, "Content-type: text/html\n\n"); + + if ( init_ds_env() ) + return 1; + + ds_become_localuser (ds_get_config (DS_REAL_CONFIG)); + + /* + * Get value of the "deletefile" variable. + */ + del_file = ds_get_cgi_var("deletefile"); + if ( (NULL == del_file) || (strlen(del_file) < 1) ) { + rpt_err( DS_UNDEFINED_VARIABLE, "deletefile", NULL, NULL ); + return 1; + } + + bak_files = ds_get_file_list( del_file ); + if ( bak_files == NULL ) { + rpt_err( DS_NO_SUCH_FILE, del_file, NULL, NULL ); + return 1; + } else { + int j; + char buf[ MAXPATHLEN ]; + for ( j = 0; bak_files[ j ] != NULL; j++ ) { + sprintf( buf, "%s/%s", del_file, bak_files[ j ]); + if ( unlink(buf) != 0 ) { + rpt_err( DS_CANNOT_DELETE_FILE, buf, NULL, NULL ); + return 1; + } + } + if ( rmdir( del_file ) < 0 ) { + rpt_err( DS_CANNOT_DELETE_FILE, del_file, NULL, NULL ); + return 1; + } + } + rpt_success("Success! Deleted directory."); + + return 0; +} diff --git a/ldap/admin/src/ds_snmpctrl.c b/ldap/admin/src/ds_snmpctrl.c new file mode 100644 index 00000000..e2a40b6d --- /dev/null +++ b/ldap/admin/src/ds_snmpctrl.c @@ -0,0 +1,308 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/* + * snmpctrl.c - start/stop/restart LDAP-based SNMP subagent + * + * Steve Ross -- 08/12/97 + * + */ + +#include +#include +#include +#include "libadminutil/admutil.h" +#include "dsalib.h" +#include "init_ds_env.h" + +#if !defined(_WIN32) +#include +#include +#include +#include +#include +#include +#else +#include +#endif + +#define SUBAGT_PATH "bin/slapd/server" +#define SUBAGT_NAME "ns-ldapagt" + +#define START 1 +#define STOP 2 +#define RESTART 3 + +#define NSLDAPAGT_PID "NSLDAPAGT.LK" + +#ifdef __cplusplus +extern "C" { +#endif +int nsldapagt_is_running(void); +int nsldapagt_shutdown(void); +int nsldapagt_start(void); +int nsldapagt_restart(void); +#ifdef __cplusplus +} +#endif + +int main(int argc, char *argv[]) +{ + char *action_type = NULL; + int haderror=0; + int status = 1; + + fprintf(stdout, "Content-type: text/html\n\n"); + + if ( init_ds_env() ) + return 1; + + action_type = ds_a_get_cgi_var("ACTION", "Missing Command", + "Need to specify Start, Stop, or Restart"); + if (!action_type) + return 1; + + if (!strcmp(action_type, "START")) { + status = nsldapagt_start(); + } else if (!strcmp(action_type, "STOP")) { + status = nsldapagt_shutdown(); + } else if (!strcmp(action_type, "RESTART")) { + status = nsldapagt_restart(); + } else { + status = DS_UNKNOWN_SNMP_COMMAND; + } + + if ( !status ) { + rpt_success("Success!"); + return 0; + } else { + rpt_err( status, action_type, NULL, NULL ); + return 1; + } +} + +#if !defined(_WIN32) +int +get_nsldapagt_pid(pid_t *pid) +{ + char *SLAPD_ROOT; + char path[PATH_MAX]; + FILE *fp; + + *pid = -1; + + SLAPD_ROOT = ds_get_install_root(); + sprintf(path, "%s/logs/%s", SLAPD_ROOT, NSLDAPAGT_PID); + if (!ds_file_exists(path)) { + return(-1); + } + + if ((fp = fopen(path, "r")) != (FILE *) NULL) { + if ((fscanf(fp, "%d\n", (int *) pid)) != -1) { + (void) fclose(fp); + return(0); + } + } + + (void) fclose(fp); + return(-1); +} +#endif + +#if defined(_WIN32) +BOOL isServiceRunning(LPCTSTR szServiceId) +{ + BOOL bReturn = FALSE; + DWORD dwError = 0; + SC_HANDLE schService = NULL; + SC_HANDLE schSCManager = NULL; + SERVICE_STATUS lpss; + + if((schSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS))) + { + if((schService = OpenService(schSCManager, + szServiceId, + SERVICE_ALL_ACCESS))) + { + + bReturn = ControlService(schService, SERVICE_CONTROL_INTERROGATE , &lpss); + + if(SERVICE_RUNNING == lpss.dwCurrentState) + { + bReturn = TRUE; + } + + CloseServiceHandle(schService); + } + dwError = GetLastError(); + CloseServiceHandle(schSCManager); + } + return(bReturn); +} +#endif + +/* + * This routine returns: + * 0 if nsldapagt is NOT running + * 1 if nsldapagt is actually running + */ +int +nsldapagt_is_running() +{ + +#if defined(_WIN32) + if (FALSE == isServiceRunning("SNMP") ) + { + return(0); + } +#else + pid_t pid; + + if (get_nsldapagt_pid(&pid) != 0) { + return(0); + } + + if (kill(pid, 0) == -1) { + return(0); + } +#endif + return(1); +} + +#if !defined(_WIN32) +/* + * This routine returns: + * 0 if magt is NOT running + * 1 if magt is actually running + * + * The run state is determined whether one can successfully bind to the + * smux port. + * + * this is for UNIX only + */ +int +smux_master_is_running() +{ + struct servent *pse; + struct protoent *ppe; + struct sockaddr_in sin; + int s; + + sin.sin_family = AF_INET; + sin.sin_addr.s_addr = INADDR_ANY; + + if (pse = getservbyname("smux", "tcp")) { + sin.sin_port = ntohs(pse->s_port); + } else { + sin.sin_port = 199; + } + + if ((ppe = getprotobyname("tcp")) == 0) { + return(0); + } + + if ((s = socket(AF_INET, SOCK_STREAM, ppe->p_proto)) < 0) { + return(0); + } + + /* bind expects port number to be in network order + we should do this for all platforms, not just OSF. */ + sin.sin_port = htons(sin.sin_port); + if (bind(s, (struct sockaddr *)&sin, sizeof(sin)) < 0) { + close(s); + return(1); + } else { + } + + close(s); + return(0); +} +#endif + +int +nsldapagt_start() +{ + if (nsldapagt_is_running()) { + return(0); + } + +#if defined(_WIN32) +/* NT version -- just try to start the SNMP service */ +/* Bug 612322: redirecting the output to null device */ + system("net start SNMP > nul"); + +#else + + /* + * Check if smux master agent is running before firing off the subagent! + */ + if (!smux_master_is_running()) { + return(-1); + } else { + char *NETSITE_ROOT = getenv("NETSITE_ROOT"); + char *SLAPD_ROOT = ds_get_install_root(); + char command[1024]; + + sprintf(command, "cd %s/%s; ./%s -d %s", NETSITE_ROOT, SUBAGT_PATH, + SUBAGT_NAME, SLAPD_ROOT); + + (void) system(command); + sleep(2); + } +#endif + + if (!nsldapagt_is_running()) { + return(-1); + } + + return(0); +} + +int +nsldapagt_shutdown() +{ + if (!nsldapagt_is_running()) { + rpt_success("NOT_RUNNING"); + exit(0); + + } else { + int status = -1; + +#if defined(_WIN32) + /* NT version -- just try to stop the SNMP service */ + /* Bug 612322: redirecting the output to null device */ + status = system("net stop SNMP > nul"); + +#else + /* UNIX version */ + pid_t pid; + if (get_nsldapagt_pid(&pid) == 0) + { + if (kill(pid, SIGTERM) == 0) + { + sleep(2); + if (!nsldapagt_is_running()) + { + status = 0; + } + } + } +#endif + return(status); + } + return(0); +} + + +int +nsldapagt_restart() +{ + int status; + if ( (status = nsldapagt_shutdown()) != 0 ) + return status; + else + return nsldapagt_start(); +} + diff --git a/ldap/admin/src/ds_viewlog.pl b/ldap/admin/src/ds_viewlog.pl new file mode 100644 index 00000000..d5f171ef --- /dev/null +++ b/ldap/admin/src/ds_viewlog.pl @@ -0,0 +1,129 @@ +#!perl +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# + +# view the last N lines of the given file + +BEGIN { + # make stdout unbuffered for friendly CGI output + $| = 1; + # print CGI header + print "Content-type: text/plain\n\n"; + # add the current directory to the beginning of the module + # search path (for our CGI.pm) + unshift @INC, '.'; + +} + +my $dbfh; # debugging file handler +sub debug { + # comment out the return line to enable debugging + return; + + if (!$dbfh) { + $dbfh = 'mylog.txt'; + open $dbfh, ">$dbfh" or die "Error: could not write $dbfh: $!"; + } + print $dbfh "@_\n"; +} + +sub sigDieHandler { + &debug(@_, "\n"); + print @_, "\n"; + &debug("NMC_STATUS: ", $!+0, "\n"); + print "NMC_STATUS: ", $!+0, "\n"; + exit $!; +} + +sub rpt_err { + my ($code, $value) = @_; + $! = $code; + die "Error: value $value is invalid: code $code"; +} + +$SIG{__DIE__} = 'sigDieHandler'; +my $DEF_SIZE = 25; + +# constants from dsalib.h +my $DS_UNKNOWN_ERROR = -1; +my $DS_NO_SERVER_ROOT = -10; +my $DS_CANNOT_EXEC = -11; +my $DS_CANNOT_OPEN_STAT_FILE = -12; +my $DS_NULL_PARAMETER = -13; +my $DS_SERVER_MUST_BE_DOWN = -14; +my $DS_CANNOT_OPEN_BACKUP_FILE = -15; +my $DS_NOT_A_DIRECTORY = -16; +my $DS_CANNOT_CREATE_DIRECTORY = -17; +my $DS_CANNOT_OPEN_LDIF_FILE = -18; +my $DS_IS_A_DIRECTORY = -19; +my $DS_CANNOT_CREATE_FILE = -20; +my $DS_UNDEFINED_VARIABLE = -21; +my $DS_NO_SUCH_FILE = -22; +my $DS_CANNOT_DELETE_FILE = -23; +my $DS_UNKNOWN_SNMP_COMMAND = -24; +my $DS_NON_NUMERIC_VALUE = -25; +my $DS_NO_LOGFILE_NAME = -26; +my $DS_CANNOT_OPEN_LOG_FILE = -27; +my $DS_HAS_TOBE_READONLY_MODE = -28; +my $DS_INVALID_LDIF_FILE = -29; + +# process the CGI input +use Cgi; + +my $num = $cgiVars{num}; +my $str = $cgiVars{str}; +my $logfile = $cgiVars{logfile}; + +&debug("ENV:"); +foreach $item (keys %ENV) { + &debug("ENV $item = $ENV{$item}"); +} +&debug("query string = ", $Cgi::QUERY_STRING); +&debug("content = ", $CONTENT); +&debug("cgiVars = ", %cgiVars); +&debug("num = $num str = $str logfile = $logfile"); + +if (! $num) { + $num = $DEF_SIZE; +} + +if (! ($num =~ /\d+/)) { + &rpt_err( $DS_NON_NUMERIC_VALUE, $num ); + return 1; +} + +if (! $logfile) { + &rpt_err( $DS_NO_LOGFILE_NAME, "no logfile"); +} + +if (! -f $logfile) { + &rpt_err( $DS_CANNOT_OPEN_LOG_FILE, $logfile); +} + +open(INP, $logfile) or &rpt_err( $DS_CANNOT_OPEN_LOG_FILE, $logfile); + +my $ii = 0; +my @buf = (); +while () { + &debug("raw: $_"); + if (!$str || /$str/i) { + $ii++; + $buf[$ii%$num] = $_; + } +} +close INP; + +my @tail = (@buf[ ($ii%$num + 1) .. $#buf ], + @buf[ 0 .. $ii%$num ]); +&debug("tail size = ", scalar(@tail), " first line = $tail[0]"); +for (@tail) { + print if $_; # @tail may begin or end with undef + &debug($_) if $_; +} + +die "Finished"; diff --git a/ldap/admin/src/getConfigInfo b/ldap/admin/src/getConfigInfo new file mode 100644 index 00000000..5ba1d20d --- /dev/null +++ b/ldap/admin/src/getConfigInfo @@ -0,0 +1,134 @@ +#!perl +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# + +# Get some configuration information from an instance + +BEGIN { + $| = 1; + # print CGI header + print "Content-type: text/plain\n\n"; + + $isNT = -d '\\'; + $PATHSEP = $isNT ? "\\" : "/"; + # get the server root directory + $sroot = $ENV{'NETSITE_ROOT'}; + @INC = ( '.', '../../../admin/admin/bin' ); + grep { s@/@\\@g } @INC if $isNT; +} + +sub sigDieHandler { + print @_, "\n"; + print "NMC_STATUS: ", $!+0, "\n"; + exit $!; +} + +$SIG{__DIE__} = 'sigDieHandler'; + +# process the CGI input +use Cgi; + +$oldSlapdConf = $cgiVars{'oldServerRoot'} . $PATHSEP . 'slapd-' . + $cgiVars{'oldServerName'} . $PATHSEP . 'config' . $PATHSEP . + 'slapd.conf'; + +$foundLocalUser = 0; + +open(OLDSLAPDCONF, $oldSlapdConf) or + die "Error: could not open old config file $oldSlapdConf: $!"; +while ($line = ) { + chop $line; + foreach $key (keys %cgiVars) { + $param = $cgiVars{$key}; + if ($line =~ /^$param\s+/i) { + ($value = $') =~ s/^[\"]//; + # remove leading " + $value =~ s/[\"]$//; + # remove trailing " + print $key, ':', $value, "\n"; + if (lc($param) eq 'localuser') { + $foundLocalUser = 1; + } + } + } + if ($line =~ /^directory\s+/i) { $dbdir = $';} + # the user may have given us a network mounted old home directory, but in the + # old instance's config files, the root directory referred to is usually + # a local directory. For example, suppose there is an automounter map for + # hosts which maps onto /h e.g. /h/oldhost would contain all directories + # exported via NFS. Similarly, for NT, you could do \\oldhost\c to look + # at the C: drive on the old host. Or the user may have network mounted + # the old server root some other way. Anyway, we need to determine what + # the old server root was local to the original host because that is what + # will be referred to it the old config files. So, we look at the errorlog + # directive in slapd.conf and use whatever comes before the slapd-oldname + elsif ($line =~ /\werrorlog\s+(.*)slapd-$cgiVars{'oldServerName'}/i) { + $realOldDir = $1; + } + elsif ($line =~ /^security\s+/i) { + if (lc($') eq 'on') { + $security = 1; + } + } + elsif ($line =~ /^encryption-alias\s+/i) { + $encryptionalias = $'; + } +} +close(OLDSLAPDCONF); + +if (! $realOldDir) { + $realOldDir = $cgiVars{'oldServerRoot'}; +} + +# if security is enabled, see if there is a cert and key db +if ($security && $encryptionalias) { + $secDir = $cgiVars{'oldServerRoot'} . $PATHSEP . 'alias'; + opendir(SECDIR, $secDir) or + die "Error: could not open alias dir $secDir : $!"; + foreach (readdir(SECDIR)) { + if (! /[.][.]?/) { + if (/^$encryptionalias/i) { + print 'needSecPwd:true', "\n"; + last; + } + } + } + closedir(SECDIR); +} + +# the dbdir is stored as a local dir, but we may need a network dir +($networkDbDir = $dbdir) =~ s/^$realOldDir/$cgiVars{'oldServerRoot'}/ig; + +if (! $isNT && $cgiVars{'oldlocaluser'} && ! $foundLocalUser) { + # get the local user by doing a stat of the db directory + $olduid = (stat($networkDbDir))[4]; + # convert the numeric uid to string name + setpwent; + while (@ent = getpwent) { + if ($ent[2] == $olduid) { + print 'oldlocaluser:', $ent[0], "\n"; + last; + } + } + endpwent; +} + +if (! $isNT && $cgiVars{'newlocaluser'}) { + open(SSUSERS, "$sroot${PATHSEP}shared${PATHSEP}config${PATHSEP}ssusers.conf") or + die "Error: could not open $sroot${PATHSEP}shared${PATHSEP}config${PATHSEP}ssusers.conf: $!"; + while () { + chop; + if (/^SuiteSpotUser\s+/i) { + print 'newlocaluser:', $', "\n"; + } + } + close(SSUSERS); +} + +print "NMC_STATUS: 0\n"; +exit 0; diff --git a/ldap/admin/src/import2info b/ldap/admin/src/import2info new file mode 100755 index 00000000..5429d71d --- /dev/null +++ b/ldap/admin/src/import2info @@ -0,0 +1,58 @@ +#!perl +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# + +# Get information to import a 1.x Directory server's info + +BEGIN { @INC = ( '../../../admin/admin/bin' , '.' ); } + +$| = 1; +use Cgi; + +$isNT = -d '\\'; +$cgiVars{'server'} =~ /-/; +$root = $ENV{'NETSITE_ROOT'}; +$oldDir = $cgiVars{'dir'}; +$oldDir =~ s/\\/\//g; +$oldHome = "$oldDir/$cgiVars{'server'}"; +$snmpfile = "$oldHome/config/snmp.conf"; + +$ds30 = 0; +if ( -e $snmpfile) { + open ( SRC, $snmpfile) | "Can't open $snmpfile: $!\n"; + while ( ) { + if ($_=~/^Version/ ) { + $where = index ($_, "3.0"); + if ($where > -1 ) { + $ds30 =1; + } + } + } +} + +# QUERY_STRING still set from invocation + +print "Content-type: text/html\n\n"; +if ($ds30) { + print "Import 3.0 Directory Server Info\n"; + print "\n"; + print "

                      The server you are attempting to migrate is a 3.0 directory server. There is no need to migrate a 3.0 server to 3.1 server.

                      \n"; + print "\n"; +} else { + print "Import 1.x Directory Server Info\n"; + print "\n"; + print "

                      Import 1.x Directory Server Info

                      \n"; + print '', "\n"; + print "\n"; + print "\n"; + $cgiVars{'server'} =~ /-/; + print "Name: $`-

                      \n"; + print "

                      \n"; + print "\n\n"; +} + diff --git a/ldap/admin/src/init_ds_env.c b/ldap/admin/src/init_ds_env.c new file mode 100644 index 00000000..554f1cec --- /dev/null +++ b/ldap/admin/src/init_ds_env.c @@ -0,0 +1,57 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/* + * Set up environment for CGIs. + * + * Rob Weltman + */ + +#include +#include +#include +#include "libadminutil/admutil.h" +#include "libadminutil/distadm.h" +#include "init_ds_env.h" +#include "dsalib.h" + +int init_ds_env() +{ + char *m = getenv("REQUEST_METHOD"); + char *qs = NULL; + int proceed = 0; + int _ai = ADMUTIL_Init(); + + if ( m != NULL ) { + if( !strcmp(m, "GET") ) { + qs = GET_QUERY_STRING(); + if ( qs && *qs ) { + ds_get_begin(qs); + } + proceed = 1; + } else if(!strcmp(m, "POST")) { + if (ds_post_begin(stdin)) { + proceed = 0; + } else { + proceed = 1; + } + } + } + + if(!proceed) { + char msg[2000]; + sprintf(msg, "ErrorString: REQUEST_METHOD=%s," + "QUERY_STRING=%s\n", + (m == NULL) ? "" : m, + (qs == NULL) ? "" : qs); + rpt_err( GENERAL_FAILURE, + msg, + "", + "" ); + return 1; + } + + return 0; +} diff --git a/ldap/admin/src/init_ds_env.h b/ldap/admin/src/init_ds_env.h new file mode 100644 index 00000000..99dba832 --- /dev/null +++ b/ldap/admin/src/init_ds_env.h @@ -0,0 +1,11 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/* + * Set up environment for CGIs. + * + * Rob Weltman + */ +extern int init_ds_env(); diff --git a/ldap/admin/src/install_keywords.h b/ldap/admin/src/install_keywords.h new file mode 100644 index 00000000..b855db30 --- /dev/null +++ b/ldap/admin/src/install_keywords.h @@ -0,0 +1,111 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/********************************************************************* +** +** +** NAME: +** install_keywords.h +** +** DESCRIPTION: +** Miscellaneous stuffs used by ux-update or ux-config +** +** NOTES: +** +** +*/ + +#ifndef _INSTALL_KEYWORDS_H_ +#define _INSTALL_KEYWORDS_H_ + +#include "global.h" + + +#ifdef XP_UNIX +#define SLAPD_KEY_FULL_MACHINE_NAME MACHINE_NAME +#else +#define SLAPD_KEY_FULL_MACHINE_NAME "FullMachineName" +#endif +#define SLAPD_KEY_SERVER_ROOT "ServerRoot" +#define SLAPD_KEY_SERVER_PORT "ServerPort" +#define SLAPD_KEY_SECURITY_ON "SecurityOn" +#define SLAPD_KEY_SECURE_SERVER_PORT "SecureServerPort" +#define SLAPD_KEY_SLAPD_CONFIG_FOR_MC "SlapdConfigForMC" + +#ifdef XP_UNIX +#define SLAPD_KEY_SERVER_ADMIN_ID MC_ADMIN_ID +#define SLAPD_KEY_SERVER_ADMIN_PWD MC_ADMIN_PWD +#else +#define SLAPD_KEY_SERVER_ADMIN_ID "ConfigDirectoryAdminID" +#define SLAPD_KEY_SERVER_ADMIN_PWD "ConfigDirectoryAdminPwd" +#endif + +#define SLAPD_KEY_SERVER_IDENTIFIER "ServerIdentifier" +#define SLAPD_KEY_SUITESPOT_USERID SS_USER_ID +#define SLAPD_KEY_SUFFIX "Suffix" +#define SLAPD_KEY_ROOTDN "RootDN" +#define SLAPD_KEY_ROOTDNPWD "RootDNPwd" +#define SLAPD_KEY_ADMIN_SERVER_PORT "Port" +#define SLAPD_KEY_OLD_SERVER_ROOT "OldServerRoot" + +#ifdef XP_UNIX +#define SLAPD_KEY_K_LDAP_URL CONFIG_LDAP_URL +#else +#define SLAPD_KEY_K_LDAP_URL "ConfigDirectoryLdapURL" +#endif + +#define SLAPD_KEY_K_LDAP_HOST CONFIG_DS_HOST +#define SLAPD_KEY_K_LDAP_PORT CONFIG_DS_PORT +#define SLAPD_KEY_BASE_SUFFIX CONFIG_DS_SUFFIX +#define SLAPD_KEY_ADMIN_SERVER_ID "ServerAdminID" +#define SLAPD_KEY_ADMIN_SERVER_PWD "ServerAdminPwd" +#define SLAPD_KEY_ADD_SAMPLE_ENTRIES "AddSampleEntries" +#define SLAPD_KEY_ADD_ORG_ENTRIES "AddOrgEntries" +#define SLAPD_KEY_INSTALL_LDIF_FILE "InstallLdifFile" +#define SLAPD_KEY_ORG_SIZE "OrgSize" +#define SLAPD_KEY_SETUP_CONSUMER "SetupConsumer" +#define SLAPD_KEY_CIR_HOST "CIRHost" +#define SLAPD_KEY_CIR_PORT "CIRPort" +#define SLAPD_KEY_CIR_SUFFIX "CIRSuffix" +#define SLAPD_KEY_CIR_BINDDN "CIRBindDN" +#define SLAPD_KEY_CIR_BINDDNPWD "CIRBindDNPwd" +#define SLAPD_KEY_CIR_SECURITY_ON "CIRSecurityOn" +#define SLAPD_KEY_CIR_INTERVAL "CIRInterval" +#define SLAPD_KEY_CIR_DAYS "CIRDays" +#define SLAPD_KEY_CIR_TIMES "CIRTimes" +#define SLAPD_KEY_SETUP_SUPPLIER "SetupSupplier" +#define SLAPD_KEY_REPLICATIONDN "ReplicationDN" +#define SLAPD_KEY_REPLICATIONPWD "ReplicationPwd" +#define SLAPD_KEY_CHANGELOGDIR "ChangeLogDir" +#define SLAPD_KEY_CHANGELOGSUFFIX "ChangeLogSuffix" +#define SLAPD_KEY_USE_REPLICATION "UseReplication" +#define SLAPD_KEY_CONSUMERDN "ConsumerDN" +#define SLAPD_KEY_CONSUMERPWD "ConsumerPwd" +#define SLAPD_KEY_SIR_HOST "SIRHost" +#define SLAPD_KEY_SIR_PORT "SIRPort" +#define SLAPD_KEY_SIR_SUFFIX "SIRSuffix" +#define SLAPD_KEY_SIR_BINDDN "SIRBindDN" +#define SLAPD_KEY_SIR_BINDDNPWD "SIRBindDNPwd" +#define SLAPD_KEY_SIR_SECURITY_ON "SIRSecurityOn" +#define SLAPD_KEY_SIR_DAYS "SIRDays" +#define SLAPD_KEY_SIR_TIMES "SIRTimes" +#define SLAPD_KEY_USE_EXISTING_MC "UseExistingMC" +#define SLAPD_KEY_ADMIN_DOMAIN "AdminDomain" +#define SLAPD_KEY_DISABLE_SCHEMA_CHECKING "DisableSchemaChecking" +#define SLAPD_KEY_USE_EXISTING_UG "UseExistingUG" +#define SLAPD_KEY_USER_GROUP_LDAP_URL "UserDirectoryLdapURL" +#define SLAPD_KEY_UG_HOST "UGHost" +#define SLAPD_KEY_UG_PORT "UGPort" +#define SLAPD_KEY_UG_SUFFIX "UGSuffix" +#define SLAPD_KEY_USER_GROUP_ADMIN_ID "UserDirectoryAdminID" +#define SLAPD_KEY_USER_GROUP_ADMIN_PWD "UserDirectoryAdminPwd" +#define SLAPD_KEY_CONFIG_ADMIN_DN "ConfigAdminDN" +/* This is used to pass the name of the log file used in the main setup + program to the ds_create or ds_remove (for uninstall) so that + they can all use the same log file +*/ +#define SLAPD_INSTALL_LOG_FILE_NAME "LogFileName" + +#endif // _INSTALL_KEYWORDS_H_ diff --git a/ldap/admin/src/instindex.cpp b/ldap/admin/src/instindex.cpp new file mode 100644 index 00000000..ecde4fad --- /dev/null +++ b/ldap/admin/src/instindex.cpp @@ -0,0 +1,423 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/* + * index.c: Shows the first page you see on install + * + * Rob McCool + */ + +#include +#include + +#include "create_instance.h" +#include "configure_instance.h" + +#include "dsalib.h" +#include "ldap.h" + +#include +#include +#include + +#ifdef XP_WIN32 +#include "regparms.h" +#endif + +char *ds_salted_sha1_pw_enc(char* pwd); + + + +/* ----------- Create a new server from configuration variables ----------- */ + + +static int create_config(server_config_s *cf) +{ + char *t = NULL; + char error_param[BIG_LINE] = {0}; + + t = create_server(cf, error_param); + if(t) + { + char *msg; + if (error_param[0]) + { + msg = PR_smprintf("%s.error:could not create server %s - %s", + error_param, cf->servid, t); + } + else + { + msg = PR_smprintf("error:could not create server %s - %s", + cf->servid, t); + } + ds_show_message(msg); + PR_smprintf_free(msg); + } + else if (!t) + { + ds_show_message("Created new Directory Server"); + return 0; + } + + return 1; +} + + +/* ------ check passwords are same and satisfy minimum length policy------- */ +static int check_passwords(char *pw1, char *pw2) +{ + if (strcmp (pw1, pw2) != 0) { + ds_report_error (INCORRECT_USAGE, " different passwords", + "Enter the password again." + " The two passwords you entered are different."); + return 1; + } + + if ( ((int) strlen(pw1)) < 8 ) { + ds_report_error (INCORRECT_USAGE, " password too short", + "The password must be at least 8 characters long."); + return 1; + } + + return 0; +} + +/* ------ Parse the results of a form and create a server from them ------- */ + + +static int parse_form(server_config_s *cf) +{ + char *sroot=NULL, *servname=NULL; + char *rm = getenv("REQUEST_METHOD"); + char *qs = getenv("QUERY_STRING"); + char* cfg_sspt_uid_pw1; + char* cfg_sspt_uid_pw2; + int len = 0; + LDAPURLDesc *desc = 0; + char *temp = 0; + + cf->sroot = getenv("NETSITE_ROOT"); + + if (rm && qs && !strcmp(rm, "GET")) + { + ds_get_begin(qs); + } + else if (ds_post_begin(stdin)) + { + return 1; + } + + if (rm) + { + printf("Content-type: text/plain\n\n"); + } + /* else we are being called from server installation; no output */ + + if (!(cf->servname = ds_a_get_cgi_var("servname", "Server Name", + "Please give a hostname for your server."))) + { + return 1; + } + + cf->bindaddr = ds_a_get_cgi_var("bindaddr", NULL, NULL); + if (!(cf->servport = ds_a_get_cgi_var("servport", "Server Port", + "Please specify the TCP port number for this server."))) + { + return 1; + } + /* the suitespot 3x uid is the uid to use for setting up */ + /* a 4.x server to serve as a suitespot 3.x host */ + cf->suitespot3x_uid = ds_a_get_cgi_var("suitespot3x_uid", NULL, NULL); + cf->cfg_sspt = ds_a_get_cgi_var("cfg_sspt", NULL, NULL); + cf->cfg_sspt_uid = ds_a_get_cgi_var("cfg_sspt_uid", NULL, NULL); + if (cf->cfg_sspt_uid && *(cf->cfg_sspt_uid) && + !(cf->cfg_sspt_uidpw = ds_a_get_cgi_var("cfg_sspt_uid_pw", NULL, NULL))) + { + + if (!(cfg_sspt_uid_pw1 = ds_a_get_cgi_var("cfg_sspt_uid_pw1", "Password", + "Enter the password for the Mission Control Administrator's account."))) + { + return 1; + } + + if (!(cfg_sspt_uid_pw2 = ds_a_get_cgi_var("cfg_sspt_uid_pw2", "Password", + "Enter the password for the Mission Control Administrator account, " + "twice."))) + { + return 1; + } + + if (strcmp (cfg_sspt_uid_pw1, cfg_sspt_uid_pw2) != 0) + { + ds_report_error (INCORRECT_USAGE, " different passwords", + "Enter the Mission Control Administrator account password again." + " The two Mission Control Administrator account passwords " + "you entered are different."); + return 1; + } + if ( ((int) strlen(cfg_sspt_uid_pw1)) < 1 ) { + ds_report_error (INCORRECT_USAGE, " password too short", + "The password must be at least 1 character long."); + return 1; + } + cf->cfg_sspt_uidpw = cfg_sspt_uid_pw1; + } + + if (cf->cfg_sspt && *cf->cfg_sspt && !strcmp(cf->cfg_sspt, "1") && + !cf->cfg_sspt_uid) + { + ds_report_error (INCORRECT_USAGE, + " Userid not specified", + "A Userid for Mission Control Administrator must be specified."); + return 1; + } + cf->start_server = ds_a_get_cgi_var("start_server", NULL, NULL); + cf->secserv = ds_a_get_cgi_var("secserv", NULL, NULL); + if (cf->secserv && strcmp(cf->secserv, "off")) + cf->secservport = ds_a_get_cgi_var("secservport", NULL, NULL); + if (!(cf->servid = ds_a_get_cgi_var("servid", "Server Identifier", + "Please give your server a short identifier."))) + { + return 1; + } + +#ifdef XP_UNIX + cf->servuser = ds_a_get_cgi_var("servuser", NULL, NULL); +#endif + + /*cf->suffix = ds_a_get_cgi_var("suffix", "Subtree to store in this database",*/ + /*"Please specify the Subtree to store in this database");*/ + cf->suffix = NULL; + cf->suffix = dn_normalize_convert(ds_a_get_cgi_var("suffix", NULL, NULL)); + + if (cf->suffix == NULL) { + cf->suffix = ""; + } + + cf->rootdn = dn_normalize_convert(ds_a_get_cgi_var("rootdn", NULL, NULL)); + if (cf->rootdn && *(cf->rootdn)) { + if (!(cf->rootpw = ds_a_get_cgi_var("rootpw", NULL, NULL))) + { + char* pw1 = ds_a_get_cgi_var("rootpw1", "Password", + "Enter the password for the unrestricted user."); + char* pw2 = ds_a_get_cgi_var("rootpw2", "Password", + "Enter the password for the unrestricted user, twice."); + + if (!pw1 || !pw2 || check_passwords(pw1, pw2)) + { + return 1; + } + + cf->rootpw = pw1; + } + /* Encode the password in SSHA by default */ + cf->roothashedpw = (char *)ds_salted_sha1_pw_enc (cf->rootpw); + } + + cf->replicationdn = dn_normalize_convert(ds_a_get_cgi_var("replicationdn", NULL, NULL)); + if(cf->replicationdn && *(cf->replicationdn)) + { + if (!(cf->replicationpw = ds_a_get_cgi_var("replicationpw", NULL, NULL))) + { + char *replicationpw1 = ds_a_get_cgi_var("replicationpw1", "Password", + "Enter the password for the replication dn."); + char *replicationpw2 = ds_a_get_cgi_var("replicationpw2", "Password", + "Enter the password for the replication dn, twice."); + + if (!replicationpw1 || !replicationpw2 || check_passwords(replicationpw1, replicationpw2)) + { + return 1; + } + + cf->replicationpw = replicationpw1; + } + /* Encode the password in SSHA by default */ + cf->replicationhashedpw = (char *)ds_salted_sha1_pw_enc (cf->replicationpw); + } + + cf->consumerdn = dn_normalize_convert(ds_a_get_cgi_var("consumerdn", NULL, NULL)); + if(cf->consumerdn && *(cf->consumerdn)) + { + if (!(cf->consumerpw = ds_a_get_cgi_var("consumerpw", NULL, NULL))) + { + char *consumerpw1 = ds_a_get_cgi_var("consumerpw1", "Password", + "Enter the password for the consumer dn."); + char *consumerpw2 = ds_a_get_cgi_var("consumerpw2", "Password", + "Enter the password for the consumer dn, twice."); + + if (!consumerpw1 || !consumerpw2 || check_passwords(consumerpw1, consumerpw2)) + { + return 1; + } + + cf->consumerpw = consumerpw1; + } + /* Encode the password in SSHA by default */ + cf->consumerhashedpw = (char *)ds_salted_sha1_pw_enc (cf->consumerpw); + } + + cf->changelogdir = ds_a_get_cgi_var("changelogdir", NULL, NULL); + cf->changelogsuffix = dn_normalize_convert(ds_a_get_cgi_var("changelogsuffix", NULL, NULL)); + + cf->admin_domain = ds_a_get_cgi_var("admin_domain", NULL, NULL); + cf->use_existing_config_ds = 1; /* there must already be one */ + cf->use_existing_user_ds = 0; /* we are creating it */ + + temp = ds_a_get_cgi_var("ldap_url", NULL, NULL); + if (temp && !ldap_url_parse(temp, &desc) && desc) + { + char *suffix = dn_normalize_convert(strdup(cf->netscaperoot)); + /* the config ds connection may require SSL */ + int isSSL = !strncmp(temp, "ldaps:", strlen("ldaps:")); + len = strlen("ldap://") + 1 + strlen(desc->lud_host) + strlen(":") + + 6 + strlen("/") + strlen(suffix); + cf->config_ldap_url = (char *)calloc(len+1, 1); + sprintf(cf->config_ldap_url, "ldap%s://%s:%d/%s", + (isSSL ? "s" : ""), desc->lud_host, desc->lud_port, suffix); + ldap_free_urldesc(desc); + } + + /* if being called as a CGI, the user_ldap_url will be the directory + we're creating */ + len = strlen("ldap://") + strlen(cf->servname) + strlen(":") + + strlen(cf->servport) + strlen("/") + strlen(cf->suffix); + cf->user_ldap_url = (char *)calloc(len+1, 1); + /* this is the directory we're creating, and we cannot create an ssl + directory, so we don't have to worry about ldap vs ldaps here */ + + sprintf(cf->user_ldap_url, "ldap://%s:%s/%s", cf->servname, + cf->servport, cf->suffix); + + cf->samplesuffix = NULL; + + cf->disable_schema_checking = ds_a_get_cgi_var("disable_schema_checking", + NULL, NULL); + return 0; +} + + +/* --------------------------------- main --------------------------------- */ + +static void +printInfo(int argc, char *argv[], char *envp[], FILE* fp) +{ + int ii = 0; + if (!fp) + fp = stdout; + + fprintf(fp, "Program name = %s\n", argv[0]); + for (ii = 1; ii < argc; ++ii) + { + fprintf(fp, "argv[%d] = %s\n", ii, argv[ii]); + } + + for (ii = 0; envp[ii]; ++ii) + { + fprintf(fp, "%s\n", envp[ii]); + } + + fprintf(fp, "#####################################\n"); +} + +int main(int argc, char *argv[], char */*envp*/[]) +{ + char *rm = getenv("REQUEST_METHOD"); + int status = 0; + server_config_s cf; + char *infFileName = 0; + int reconfig = 0; + int ii = 0; + int cgi = 0; + int _ai = ADMUTIL_Init(); + + /* Initialize NSS to make ds_salted_sha1_pw_enc() happy */ + if (NSS_NoDB_Init(NULL) != SECSuccess) { + ds_report_error(DS_GENERAL_FAILURE, " initialization failure", + "Unable to initialize the NSS subcomponent."); + exit(1); + } + + /* make stdout unbuffered */ + setbuf(stdout, 0); + +#ifdef XP_WIN32 + if ( getenv("DEBUG_DSINST") ) + DebugBreak(); +#endif + + memset(&cf, 0, sizeof(cf)); + set_defaults(0, 0, &cf); + + /* scan cmd line arguments */ + for (ii = 0; ii < argc; ++ii) + { + if (!strcmp(argv[ii], "-f") && (ii + 1) < argc && + argv[ii+1]) + infFileName = argv[ii+1]; + else if (!strcmp(argv[ii], "-r")) + reconfig = 1; + } + + /* case 1: being called as program -f inffile */ + if (infFileName) + { + FILE *infFile = fopen(infFileName, "r"); + if (!infFile) + { + ds_report_error(INCORRECT_USAGE, infFileName, + "This file could not be opened. A valid file must be given."); + status = 1; + } + else + fclose(infFile); + + if (reconfig) + status = reconfigure_instance(argc, argv); + else + { + if (!status) + status = create_config_from_inf(&cf, argc, argv); + if (!status) + status = create_config(&cf); + if (!status) + status = configure_instance(); + } + } + /* case 2: being called as a CGI */ + else if (rm) + { + cgi = 1; + status = parse_form(&cf); + if (!status) + status = create_config(&cf); + if (!status) + status = configure_instance_with_config(&cf, 1, 0); + } + /* case 3: punt */ + else + { + ds_report_error ( + INCORRECT_USAGE, + "No request method specified", + "A REQUEST_METHOD must be specified (POST, GET) to run this CGI program."); + status = 1; + } + + if (cgi) + { + /* The line below is used by the console to detect + the end of the operation. See replyHandler() in + MigrateCreate.java */ + fprintf(stdout, "NMC_Status: %d\n", status); + /* In the past, we used to call rpt_success() or rpt_err() + according to status. However these functions are not designed + for our case: they print an HTTP header line "Content-type: text/html" */ + } + +#if defined( hpux ) + _exit(status); +#endif + return status; +} diff --git a/ldap/admin/src/java/com/netscape/xmltools/DSML2LDIF.java b/ldap/admin/src/java/com/netscape/xmltools/DSML2LDIF.java new file mode 100644 index 00000000..42eb02fb --- /dev/null +++ b/ldap/admin/src/java/com/netscape/xmltools/DSML2LDIF.java @@ -0,0 +1,234 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ + +package com.netscape.xmltools; + +import java.util.*; +import java.io.*; +import org.xml.sax.SAXException; +import netscape.ldap.*; +import netscape.ldap.util.*; + +/** + * Tool for converting DSML document to LDIF document + */ +public class DSML2LDIF { + + /** + * Default no argument constructor. + */ + public DSML2LDIF() { + } + + /** + * Parse the command line parameters and setup the options parameters + */ + static private GetOpt parseParameters( String[] args ) { + + GetOpt options = new GetOpt("H?so:", args); + + if (options.hasOption('H') || options.hasOption('?')) { + usage(); + System.exit(0); + } + + if (options.hasOption('v')) { + m_verbose = true; + } + + if (options.hasOption('o')) { + m_outfile = options.getOptionParam('o'); + if (m_outfile == null) { + System.err.println( "Missing argument for output filename" ); + usage(); + System.exit(0); + } + + try { + m_pw = null; + m_pw = new PrintWriter( new FileOutputStream(m_outfile), true ); + } catch (IOException e) { + System.err.println( "Can't open " + m_outfile ); + System.err.println( e.toString() ); + System.exit(1); + } + } + + Vector extras = options.getParameters(); + if (extras.size() == 1 ) { + m_infile = new String( (String)extras.get(0) ); + } else { + if ( options.hasOption('s') ) { + // Use standard input for input of dsml file + m_infile = null; + } else { + usage(); + System.exit(0); + } + + } + return options; + } + + + /** + * Print out usage of the tool + */ + static private void usage() { + System.err.println("Usage: java [-classpath CLASSPATH] DSML2LDIF infile.dsml -s [-o outfile.ldif]"); + System.err.println("options"); + System.err.println(" -s use standard input for input of dsml file" ); + System.err.println(" -o outfile filename for the output LDIF file" ); + System.err.println(" -H -? for usage" ); + // System.err.println(" -v for verbose mode" ); + } + + static void processEntry( LDAPEntry entry ) { + + long now = 0; + long later = 0; + long writeTime; + if ( m_doProfile ) { + now = System.currentTimeMillis(); + } + try { + if (entry != null) { + m_ldifWriter.printEntry( entry ); + // e = null; + } + if ( m_doProfile ) { + later = System.currentTimeMillis(); + writeTime = later - now; + m_lapWriteTime += writeTime; + now = later; + } + } catch (Exception e) { + ; + } + + if ( m_doProfile ) { + m_entryCount++; + if ( (m_entryCount % LAP_LENGTH) == 0 ) { + System.err.println( m_entryCount + " entries" ); + System.err.println( " " + m_lapWriteTime + + " ms to write" ); + m_lapWriteTime = 0; + System.err.println( " " + (now - m_lapTime) + + " ms total this lap" ); + m_lapTime = now; + } + } + } + + /** + * Temporary class to subclass from LDIFWriter + */ + static class MyLDIFWriter extends netscape.ldap.util.LDIFWriter { + public MyLDIFWriter( PrintWriter pw ) { + super( pw ); + } + + /** + * Print prologue to entry + * + * @param dn the DN of the entry + */ + protected void printEntryStart( String dn ) { + if ( dn == null ) { + dn = ""; + } else { + byte[] b = null; + try { + b = dn.getBytes( "UTF8" ); + } catch ( UnsupportedEncodingException ex ) { + } + if ( !LDIF.isPrintable(b) ) { + dn = getPrintableValue( b ); + printString( "dn" + "::" + " " + dn ); + return; + } + } + printString( "dn" + ":" + " " + dn ); + } + } + + /** + * Main routine for the tool. + */ + public static void main(String[] args) { + + m_verify = Boolean.getBoolean("verify"); + parseParameters( args ); + + DSMLReader reader = null; + + try { + if ( m_infile == null ) { + reader = new DSMLReader(); + } + else { + reader = new DSMLReader( m_infile ); + } + } catch (Exception e) { + System.err.println("Error encountered in input"); + System.err.println(e.toString()); + System.exit(1); + } + + m_ldifWriter = new MyLDIFWriter( m_pw ); + + if (m_verify) { + if (m_pw != null) { + m_pw.close(); + } + System.exit( 0 ); + } + + try { + if ( m_doProfile ) { + m_startTime = System.currentTimeMillis(); + m_lapTime = m_startTime; + } + reader.parseDocument(); + } catch( SAXException e ) { + System.err.println("Error encountered in parsing the DSML document"); + System.err.println(e.getMessage()); + e.printStackTrace(); + System.exit(1); + } catch( Exception e ) { + e.printStackTrace(); + } finally { + if (m_pw != null) { + m_pw.flush(); + m_pw.close(); + } + } + + if ( m_doProfile ) { + System.err.println( + (System.currentTimeMillis() - m_startTime) / 1000 + + " seconds total for " + m_entryCount + " entries" ); + } + + System.exit( 0 ); + } + + static private PrintWriter m_pw = new PrintWriter(System.out, true);; + static private boolean m_verbose = false; + static private String m_outfile = null; + static private String m_infile = null; + static private LDIFWriter m_ldifWriter = null; + static private boolean m_verify = false; + static boolean m_doProfile = Boolean.getBoolean("com.netscape.xmltools.doProfile"); + static long m_startTime; + static long m_toEntryTime = 0; + static long m_writeTime = 0; + static long m_lapTime; + static long m_lapToEntryTime = 0; + static long m_lapWriteTime = 0; + static long m_entryCount; + static final int LAP_LENGTH = 1000; +} diff --git a/ldap/admin/src/java/com/netscape/xmltools/DSMLReader.java b/ldap/admin/src/java/com/netscape/xmltools/DSMLReader.java new file mode 100644 index 00000000..f6080433 --- /dev/null +++ b/ldap/admin/src/java/com/netscape/xmltools/DSMLReader.java @@ -0,0 +1,47 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ + +package com.netscape.xmltools; + +import java.io.*; +import java.util.*; +import org.xml.sax.*; +import netscape.ldap.*; +import netscape.ldap.util.*; + +/** + * Class for reading a DSML document according to the DSML 1.0 spec. + */ +public class DSMLReader { + + /** + * Default no argument constructor + */ + public DSMLReader() throws IOException { + m_ds = new DataInputStream( System.in ); + } + + /** + * Constructor for a dsml reader based on a file + * + * @param filename system-dependent filename + */ + public DSMLReader( String filename ) throws IOException { + m_ds = new DataInputStream( new FileInputStream( filename ) ); + } + + /** + * Parses the input stream as a DSML document + * + * @throws SAXException on parsing errors + */ + public void parseDocument() throws SAXException { + DSMLSAXBuilder builder = new DSMLSAXBuilder(); + builder.parse( new InputSource( m_ds ) ); + } + + private DataInputStream m_ds = null; +} diff --git a/ldap/admin/src/java/com/netscape/xmltools/DSMLSAXBuilder.java b/ldap/admin/src/java/com/netscape/xmltools/DSMLSAXBuilder.java new file mode 100644 index 00000000..4f85d2db --- /dev/null +++ b/ldap/admin/src/java/com/netscape/xmltools/DSMLSAXBuilder.java @@ -0,0 +1,86 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +package com.netscape.xmltools; + +import javax.xml.parsers.*; +import org.xml.sax.*; +import org.xml.sax.helpers.*; + +/** + * A skeletal SAX driver, which doesn't create a document. Its content handler + * is a DSMLSAXHandler which creates and dispatches LDAP entries from a + * DSML document on the fly. + */ +public class DSMLSAXBuilder { + + /** + *

                      + * Creates a new DSMLSAXBuilder with parser that will not validate. + *

                      + */ + public DSMLSAXBuilder() { + } + + /** + *

                      + * Creates a new DSMLSAXBuilder which will validate + * according to the given parameter. + *

                      + * + * @param validate boolean indicating if + * validation should occur. + */ + public DSMLSAXBuilder(boolean validate) { + m_validate = validate; + } + + /** + * Processes the supplied input source + * + * @param in InputSource to read from + * @throws SAXException when errors occur in parsing + */ + public void parse(InputSource in) throws SAXException { + DSMLSAXHandler contentHandler = null; + + try { + // Create the parser + SAXParserFactory fac = SAXParserFactory.newInstance(); + fac.setValidating( m_validate ); + + XMLReader parser = fac.newSAXParser().getXMLReader(); + parser.setFeature( "http://xml.org/sax/features/namespaces", + true ); + parser.setFeature( "http://xml.org/sax/features/namespace-prefixes", + true ); + + // Create and configure the content handler + parser.setContentHandler( new DSMLSAXHandler() ); + + // Parse the document + parser.parse( in ); + } catch (Exception e) { + if (e instanceof SAXParseException) { + SAXParseException p = (SAXParseException)e; + String systemId = p.getSystemId(); + if (systemId != null) { + throw new SAXException("Error on line " + + p.getLineNumber() + " of document " + + systemId, e); + } else { + throw new SAXException("Error on line " + + p.getLineNumber(), e); + } + } else if (e instanceof SAXException) { + throw (SAXException)e; + } else { + throw new SAXException("Error in parsing", e); + } + } + } + + private boolean m_validate = false; +} diff --git a/ldap/admin/src/java/com/netscape/xmltools/DSMLSAXHandler.java b/ldap/admin/src/java/com/netscape/xmltools/DSMLSAXHandler.java new file mode 100644 index 00000000..73b067d7 --- /dev/null +++ b/ldap/admin/src/java/com/netscape/xmltools/DSMLSAXHandler.java @@ -0,0 +1,299 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +package com.netscape.xmltools; + +import java.util.*; + +import org.xml.sax.*; +import org.xml.sax.helpers.*; + +import netscape.ldap.*; +import netscape.ldap.util.*; + +/** + * Content handler which dispatches each LDAP entry composed from a dsml:entry + * element and its children. No document is built. + */ +public class DSMLSAXHandler extends DefaultHandler { + /** The DSML namespace */ + private static final String DSML_NS = "http://www.dsml.org/DSML"; + + /** Element stack */ + private Stack stack = new Stack(); + + /** Whether to ignore ignorable whitespace */ + private boolean ignoringWhite = true; + + /** Keeps track of name spaces */ + private NamespaceSupport namespaces = new NamespaceSupport(); + + /** + * Creates a new SAXHandler that listens to SAX + * events and dispatches LDAP entries as they are found + */ + public DSMLSAXHandler() { + } + + /** + * Returns the value of a particular attribute from an array of + * attributes + * + * @param atts Array of attributes to process + * @param name The name of the attribute to return + * @return The value of the matching attribute, or null if not there + */ + private String findAttribute( Attributes atts, String name ) { + for (int i = 0, len = atts.getLength(); i < len; i++) { + String attLocalName = atts.getLocalName(i); + String attQName = atts.getQName(i); + // Bypass any xmlns attributes which might appear, as we got + // them already in startPrefixMapping(). + + if (attQName.startsWith("xmlns:") || attQName.equals("xmlns")) { + continue; + } + + if ( name.equalsIgnoreCase( attLocalName ) ) { + return atts.getValue(i); + } + } + return null; + } + + /** + * Creates and returns an object corresponding to the element type + * + * @param prefix Namespace + * @param localName Element name without namespace + * @param atts Any attributes of the element + * @return An object corresponding to the element type + */ + private Object getObjectForElement( String prefix, + String localName, + Attributes atts ) { + // Should not assume the "dsml" prefix. Any prefix can + // be mapped to the DSML namespace URI. + String uri = namespaces.getURI( prefix ); + if ( (uri != null) && uri.equalsIgnoreCase( DSML_NS ) ) { + if ( "entry".equalsIgnoreCase( localName ) ) { + String dn = findAttribute( atts, "dn" ); + if ( dn != null ) { + LDAPEntry entry = new LDAPEntry( dn ); + return entry; + } else { + System.err.println( "No DN for entry" ); + } + } else if ( "attr".equalsIgnoreCase( localName ) ) { + String name = findAttribute( atts, "name" ); + if ( name != null ) { + LDAPAttribute attr = new LDAPAttribute( name ); + return attr; + } else { + System.err.println( "No name for attribute" ); + } + } else if ( "objectclass".equalsIgnoreCase( localName ) ) { + LDAPAttribute attr = new LDAPAttribute( "objectclass" ); + return attr; + } else if ( "oc-value".equalsIgnoreCase( localName ) ) { + return new StringAttrValue(); + } else if ( "value".equalsIgnoreCase( localName ) ) { + String enc = findAttribute( atts, "encoding" ); + if ( "Base64".equalsIgnoreCase( enc ) ) { + return new BinaryAttrValue(); + } else { + return new StringAttrValue(); + } + } + } + return null; + } + + + /** + * This reports the occurrence of an actual element. It will include + * the element's attributes, with the exception of XML vocabulary + * specific attributes, such as + * xmlns:[namespace prefix] and + * xsi:schemaLocation. + * + * @param namespaceURI String namespace URI this element + * is associated with, or an empty + * String + * @param localName String name of element (with no + * namespace prefix, if one is present) + * @param qName String XML 1.0 version of element name: + * [namespace prefix]:[localName] + * @param atts Attributes list for this element + * @throws SAXException when things go wrong + */ + public void startElement(String namespaceURI, String localName, + String qName, Attributes atts) + throws SAXException { + Object obj = null; + + int split = qName.indexOf(":"); + String prefix = (split > 0) ? qName.substring(0, split) : null; + if ( prefix != null ) { + // Save the prefix to URI mapping + if ((namespaceURI != null) && (!namespaceURI.equals(""))) { + namespaces.pushContext(); + if ( namespaces.getPrefix( namespaceURI ) == null ) { + namespaces.declarePrefix( prefix, namespaceURI ); + } + } + obj = getObjectForElement( prefix, localName, atts ); + if ( obj instanceof LDAPEntry ) { + m_entry = (LDAPEntry)obj; + } else if ( obj instanceof LDAPAttribute ) { + m_attr = (LDAPAttribute)obj; + } + } else { + // This should never happen + System.err.println( "No namespace for [" + qName + "]" ); + m_entry = null; + m_attr = null; + } + + if ( obj != null ) { + // Put the DSML object on the stack + stack.push(obj); + } + } + + /** + * This will report character data (within an element) + * + * @param ch char[] character array with character data + * @param start int index in array where data starts. + * @param length int length of data. + * @throws SAXException when things go wrong + */ + public void characters(char[] ch, int start, int length) + throws SAXException { + + // Ignore whitespace + boolean empty = true; + int maxOffset = start+length; + for( int i = start; i < maxOffset; i++ ) { + if ( (ch[i] != ' ') && (ch[i] != '\n') ) { + empty = false; + break; + } + } + if ( empty ) { + return; + } + + m_sb.append( ch, start, length ); + } + + /** + * Captures ignorable whitespace as text. If + * setIgnoringElementContentWhitespace(true) has been called then this + * method does nothing. + * + * @param ch [] - char array of ignorable whitespace + * @param start int - starting position within array + * @param length int - length of whitespace after start + * @throws SAXException when things go wrong + */ + public void ignorableWhitespace(char[] ch, int start, int length) + throws SAXException { + if (ignoringWhite) return; + + characters(ch, start, length); + } + + /** + * Takes any action appropriate for a particular object when it has + * been composed from an element and any children + * + * @param obj A DSML object + * @return The updated object + */ + private Object processElementByObject( Object obj ) { + if ( obj instanceof LDAPEntry ) { + // An entry is ready to be processed + LDAPEntry entry = (LDAPEntry)obj; + // Rather than a static method, this should be an object that + // implements an interface and is provided with a setEntryProcessor + // method + DSML2LDIF.processEntry( entry ); + } else if ( obj instanceof StringAttrValue ) { + if ( m_attr == null ) { + // This should never happen + System.err.println( "dsml:value or dsml:oc-value element " + + "not inside dsml:attr or " + + "dsml:objectclass" ); + } else { + String val = new String( m_sb ); + m_attr.addValue( val ); + } + m_sb.setLength( 0 ); + } else if ( obj instanceof BinaryAttrValue ) { + if ( m_attr == null ) { + System.err.println( "dsml:value element not inside dsml:attr" ); + } else { + ByteBuf inBuf = new ByteBuf( new String( m_sb ) ); + ByteBuf decodedBuf = new ByteBuf(); + // Decode base 64 into binary + m_decoder.translate( inBuf, decodedBuf ); + int nBytes = decodedBuf.length(); + if ( nBytes > 0 ) { + String decodedValue = new String(decodedBuf.toBytes(), 0, + nBytes); + m_attr.addValue( decodedValue); + } + } + m_sb.setLength( 0 ); + } else if ( obj instanceof LDAPAttribute ) { + if ( m_entry == null ) { + // This should never happen + System.err.println( "dsml:attr element not inside dsml:entry" ); + } else { + m_entry.getAttributeSet().add( (LDAPAttribute)obj ); + } + m_attr = null; + } + return obj; + } + + /** + * Indicates the end of an element + * (</[element name]>) is reached. Note that + * the parser does not distinguish between empty + * elements and non-empty elements, so this will occur uniformly. + * + * @param namespaceURI String URI of namespace this + * element is associated with + * @param localName String name of element without prefix + * @param qName String name of element in XML 1.0 form + * @throws SAXException when things go wrong + */ + public void endElement(String namespaceURI, String localName, + String qName) throws SAXException { + if ( !stack.empty() ) { + Object obj = stack.pop(); + + processElementByObject( obj ); + } + + if ((namespaceURI != null) && + (!namespaceURI.equals(""))) { + namespaces.popContext(); + } + } + + private LDAPEntry m_entry = null; + private LDAPAttribute m_attr = null; + private StringBuffer m_sb = new StringBuffer(1024); + static private MimeBase64Decoder m_decoder = new MimeBase64Decoder(); + + class StringAttrValue { + } + class BinaryAttrValue { + } +} diff --git a/ldap/admin/src/java/com/netscape/xmltools/DSMLWriter.java b/ldap/admin/src/java/com/netscape/xmltools/DSMLWriter.java new file mode 100644 index 00000000..82ebc3d0 --- /dev/null +++ b/ldap/admin/src/java/com/netscape/xmltools/DSMLWriter.java @@ -0,0 +1,315 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ + +package com.netscape.xmltools; + +import java.util.*; +import netscape.ldap.*; +import java.io.*; +import netscape.ldap.util.*; + +/** + * Class for outputting LDAP entries to a stream as DSML. + * + * @version 1.0 + */ +public class DSMLWriter extends LDAPWriter { + +// static final long serialVersionUID = -2710382547996750924L; + + /** + * Constructs a DSMLWriter object to output entries + * to a stream as DSML. + * + * @param pw output stream + */ + public DSMLWriter( PrintWriter pw ) { + super( pw ); + } + + /** + * Prints the schema from an entry containing subschema + * + * entry entry containing schema definitions + */ + public void printSchema( LDAPEntry entry ) { + LDAPSchema schema = new LDAPSchema( entry ); + printString( " " ); + printObjectClassSchema( schema ); + printAttributeSchema( schema ); + printString( " " ); + } + + + /** + * Prints the object class schema from a schema object + * + * schema schema elements + */ + protected void printObjectClassSchema( LDAPSchema schema ) { + Enumeration en = schema.getObjectClasses(); + while( en.hasMoreElements() ) { + LDAPObjectClassSchema s = (LDAPObjectClassSchema)en.nextElement(); + printString( " " ); + if ( s.isObsolete() ) { + printString( " obsolete=true" ); + } + printString( " " + s.getName() + "" ); + printString( " " + s.getDescription() + + "" ); + Enumeration attrs = s.getRequiredAttributes(); + while( attrs.hasMoreElements() ) { + printString( " " ); + } + attrs = s.getOptionalAttributes(); + while( attrs.hasMoreElements() ) { + printString( " " ); + } + printString( " " ); + } + } + + + /** + * Prints the attribute schema from a schema object + * + * schema schema elements + */ + protected void printAttributeSchema( LDAPSchema schema ) { + Enumeration en = schema.getAttributes(); + while( en.hasMoreElements() ) { + LDAPAttributeSchema s = (LDAPAttributeSchema)en.nextElement(); + printString( " 0) ) { + printString( " equality=" + vals[0] ); + } + vals = s.getQualifier( s.ORDERING ); + if ( (vals != null) && (vals.length > 0) ) { + printString( " ordering=" + vals[0] ); + } + vals = s.getQualifier( s.SUBSTR ); + if ( (vals != null) && (vals.length > 0) ) { + printString( " substring=" + vals[0] ); + } + printString( " " + s.getName() + "" ); + printString( " " + s.getDescription() + + "" ); + printString( " " + s.getSyntaxString() + + "" ); + printString( " " ); + } + } + + + /** + * Print an attribute of an entry + * + * @param attr the attribute to format to the output stream + */ + protected void printAttribute( LDAPAttribute attr ) { + String attrName = attr.getName(); + + // Object classes are treated differently in DSML. Also, they + // are always String-valued + if ( attrName.equalsIgnoreCase( "objectclass" ) ) { + Enumeration enumVals = attr.getStringValues(); + if ( enumVals != null ) { + printString( " " ); + while ( enumVals.hasMoreElements() ) { + String s = (String)enumVals.nextElement(); + printString( " " + s + + "" ); + } + printString( " " ); + } + return; + } + + printString( " " ); + + /* Loop on values for this attribute */ + Enumeration enumVals = attr.getByteValues(); + + if ( enumVals != null ) { + while ( enumVals.hasMoreElements() ) { + byte[] b = (byte[])enumVals.nextElement(); + String s; + if ( LDIF.isPrintable(b) ) { + try { + s = new String( b, "UTF8" ); + } catch ( UnsupportedEncodingException e ) { + s = ""; + } + printEscapedValue( " ", s, + "" ); + } else { + s = getPrintableValue( b ); + if ( s.length() > 0 ) { + printString( " " + + "" ); + printString( " " + s ); + printString( " " ); + } + } + } + } + printString( " " ); + } + + /** + * Print prologue to entry + * + * @param dn the DN of the entry + */ + protected void printEntryStart( String dn ) { + +/* + if ( dn == null ) { + dn = ""; + } else { + byte[] b = null; + try { + b = dn.getBytes( "UTF8" ); + } catch ( UnsupportedEncodingException ex ) { + } + + if ( !LDIF.isPrintable(b) ) { + dn = getPrintableValue( b ); + printString( " " ); + return; + } + + } + printString( " " ); +*/ + + + if ( dn == null ) { + dn = ""; + } + m_pw.print( " " ); + } + + /** + * Print epilogue to entry + * + * @param dn the DN of the entry + */ + protected void printEntryEnd( String dn ) { + printString( " " ); + } + + /** + * Print the element start, the value with escaping of special + * characters, and the element end + * + * @param prolog element start + * @param value value to be escaped + * @param epilog element end + */ + protected void printEscapedValue( String prolog, String value, + String epilog ) { + m_pw.print( prolog ); + int l = value.length(); + char[] text = new char[l]; + value.getChars( 0, l, text, 0 ); + for ( int i = 0; i < l; i++ ) { + char c = text[i]; + switch (c) { + case '<' : + m_pw.print( "<" ); + break; + case '&' : + m_pw.print( "&" ); + break; + default : + m_pw.print( c ); + } + } + // m_pw.print( epilog); + // m_pw.print( '\n' ); + m_pw.println( epilog ); + } + + /** + * Print the element attribute escaping of special + * characters + * + * @param attribute Attribute value to be escaped + */ + protected void printEscapedAttribute( String attribute ) { + + int l = attribute.length(); + char[] text = new char[l]; + attribute.getChars( 0, l, text, 0 ); + for ( int i = 0; i < l; i++ ) { + char c = text[i]; + switch (c) { + case '<' : + m_pw.print( "<" ); + break; + case '>': + m_pw.print( ">" ); + break; + case '&' : + m_pw.print( "&" ); + break; + case '"': + m_pw.print( """ ); + break; + case '\'': + m_pw.print( "'" ); + break; + default : + m_pw.print( c ); + } + } + } + + protected void printString( String value ) { + // m_pw.print( value ); + // m_pw.print( '\n' ); + m_pw.println( value ); + } +} diff --git a/ldap/admin/src/java/com/netscape/xmltools/GetOpt.java b/ldap/admin/src/java/com/netscape/xmltools/GetOpt.java new file mode 100644 index 00000000..91d17e18 --- /dev/null +++ b/ldap/admin/src/java/com/netscape/xmltools/GetOpt.java @@ -0,0 +1,222 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +package com.netscape.xmltools; +import java.util.*; + +/** + * This class is similar to the getopt() function in + * UNIX System V. You can use this class to parse command-line + * arguments. + *

                      + * + * When you create an object of this class, you specify a string + * containing the command-line options that you want to check for. + * The string should contain the letters of these options. If an + * option requires an argument (for example, "-h "), + * you should add a colon after the letter in this string. + *

                      + * + * For example, in the following string, the -h, + * -p, -D,, and -w options + * all require arguments. The -H option does not + * require any arguments. + *

                      + * "h:p:D:w:H"
                      + * 
                      + * + * You can use the hasOption method to determine if + * an option has been specified and the getOptionParam + * method to get the argument specified after a particular option. + *

                      + * + * If an option not specified in the string is passed in as an + * argument, the GetOpt object prints out an error + * message. Note that the object does not throw an exception or + * exit the application if an invalid option is specified. + *

                      + * + * Note that you are still responsible for verifying that any + * required arguments have been specified. + *

                      + * + * The following example parses the command-line arguments for + * the hostname, port number, DN, and password to use when + * connecting and authenticating to an LDAP server. + *

                      + * import netscape.ldap.*;
                      + * import netscape.ldap.controls.*;
                      + * import netscape.ldap.util.*;
                      + * import java.util.*;
                      + *
                      + * public class SearchDirectory {
                      + *
                      + *     public static void main( String[] args )
                      + *     {
                      + *
                      + *         String usage = "Usage: java SearchDirectory -h  -p  "
                      + *                      + "[-D ] [-w ]"
                      + *
                      + *         int portnumber = LDAPv2.DEFAULT_PORT;
                      + *
                      + *         // Check for these options. -H means to print out a usage message.
                      + *         GetOpt options = new GetOpt( "h:p:D:w:H", args );
                      + *
                      + *         // Get the arguments specified for each option.
                      + *         String hostname = options.getOptionParam( 'h' );
                      + *         String port = options.getOptionParam( 'p' );
                      + *         String bindDN = options.getOptionParam( 'D' );
                      + *         String bindPW = options.getOptionParam( 'w' );
                      + *
                      + *         // Check to see if the hostname (which is mandatory)
                      + *         // is not specified or if the user simply wants to
                      + *         // see the usage message (-H).
                      + *         if ( hostname == null || options.hasOption( 'H' ) ) {
                      + *             System.out.println( usage );
                      + *             System.exit( 1 );
                      + *         }
                      + *
                      + *         // If a port number was specified, convert the port value
                      + *         //  to an integer.
                      + *         if ( port != null ) {
                      + *             try {
                      + *                 portnumber = java.lang.Integer.parseInt( port );
                      + *             } catch ( java.lang.Exception e ) {
                      + *                 System.out.println( "Invalid port number: " + port );
                      + *                 System.out.println( usage );
                      + *                 System.exit( 1 );
                      + *             }
                      + *         }
                      + *
                      + *         // Create a new connection.
                      + *         LDAPConnection ld = new LDAPConnection();
                      + *
                      + *         try {
                      + *             // Connect and authenticate to server.
                      + *             ld.connect( 3, hostname, portnumber, bindDN, bindPW );
                      + *             ...
                      + *         } catch ( LDAPException e ) {
                      + *             System.out.println( "Error: " + e.toString() );
                      + *         }
                      + *         ...
                      + *     }
                      + * }
                      + * 
                      + * + * @version 1.0 + */ +public class GetOpt implements java.io.Serializable { + /** + * Internal variables + */ + private int m_pos; + private String optarg; + private String m_control; + private Vector m_option; + private Vector m_ParameterList; + private Hashtable m_optionHashTable; + private Hashtable m_optionParamHashTable; + static final long serialVersionUID = -2570196909939660248L; + + /** + * Constructs a GetOpt object. + * @param strControl a string specifying the letters of + * all available options. If an option requires an argument + * (for example, "-h "), use a colon after the + * letter for that option (for example, "h:p:D:w:H"). + * @param args an array of strings representing the list + * of arguments to parse (for example, the + * array passed into Main). + */ + public GetOpt(String strControl, String args[]) { + m_option = new Vector(); + m_control = strControl; + m_optionHashTable = new Hashtable(); + m_optionParamHashTable = new Hashtable(); + m_ParameterList = new Vector(); + + for (int i=0;i0) { + if (sOpt.charAt(0)=='-') { + if (sOpt.length()>1) { + int nIndex = m_control.indexOf(sOpt.charAt(1)); + if (nIndex == (-1)) { + System.err.println("Invalid usage. No option -" + + sOpt.charAt(1)); + } else { + char cOpt[]= new char[1]; + cOpt[0]= sOpt.charAt(1); + String sName = new String(cOpt); + m_optionHashTable.put(sName,"1"); + if ((m_control != null) && (m_control.length() > (nIndex+1))) { + if (m_control.charAt(nIndex+1)==':') { + i++; + if (i < args.length) + m_optionParamHashTable.put(sName,args[i]); + else + System.err.println("Missing argument for option "+ + sOpt); + } + } + } + } else { + System.err.println("Invalid usage."); + } + } else { + // probably parameters + m_ParameterList.addElement(args[i]); + } + } + } + } + + /** + * Determines if an option was specified. For example, + * hasOption( 'H' ) checks if the -H option + * was specified. + *

                      + * + * @param c letter of the option to check + * @return true if the option was specified. + */ + public boolean hasOption(char c) { + boolean fReturn = false; + char cOption[]=new char[1]; + cOption[0]=c; + String s = new String(cOption); + if (m_optionHashTable.get(s)=="1") { + fReturn = true; + } + return(fReturn); + } + + /** + * Gets the argument specified with an option. + * For example, getOptionParameter( 'h' ) + * gets the value of the argument specified with + * the -h option (such as "localhost" in "-h localhost"). + *

                      + * + * @param c the letter of the option to check + * @return the argument specified for this option. + */ + public String getOptionParam(char c) { + char cOption[] = new char[1]; + cOption[0]=c; + String s = new String(cOption); + String sReturn=(String)m_optionParamHashTable.get(s); + return(sReturn); + } + + /** + * Gets a list of any additional parameters specified + * (not including the arguments for any options). + * @return a list of the additional parameters. + */ + public Vector getParameters() { + return(m_ParameterList); + } +} diff --git a/ldap/admin/src/java/com/netscape/xmltools/LDIF2DSML.java b/ldap/admin/src/java/com/netscape/xmltools/LDIF2DSML.java new file mode 100644 index 00000000..ae4ada4f --- /dev/null +++ b/ldap/admin/src/java/com/netscape/xmltools/LDIF2DSML.java @@ -0,0 +1,214 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ + +package com.netscape.xmltools; + +import java.io.*; +import java.util.*; +import netscape.ldap.util.GetOpt; +import netscape.ldap.util.*; +import netscape.ldap.*; + +/** + * Tool for converting LDIF document to DSML document + */ +public class LDIF2DSML { + + /** + * Default no argument constructor. + */ + public LDIF2DSML() { + } + + /** + * Converter taking a filename argument for the input LDIF file + * + * @param filename system-dependent file name for the input LDIF file + */ + public LDIF2DSML( String filename ) throws IOException { + + DataInputStream ds = null; + + if( filename == null || filename.length() == 0 ) { + ds = new DataInputStream( System.in ); + } + else { + ds = new DataInputStream( new FileInputStream( filename) ); + } + + // set up the ldif parser with the input stream + // + m_ldifReader = new LDIF( ds ); + } + + /** + * Converts an LDIF record to an LDAPEntry. Only convert if the content + * of the LDIF record is of the type LDIFContent.ATTRIBUTE_CONTENT. + * + * @param rec An LDIFRecord to be converted + * @returns The converted LDAPEntry. null is returned for any ldif record not + * being recognized with attribute content + */ + public LDAPEntry toLDAPEntry( LDIFRecord rec ) { + + String dn = rec.getDN(); + LDIFContent content = rec.getContent(); + + if (content.getType() == LDIFContent.ATTRIBUTE_CONTENT) { + LDIFAttributeContent entry = (LDIFAttributeContent)content; + /* LDAPAttribute attrs[] = entry.getAttributes(); + for( int i = 0; i < attrs.length; i++ ) { + System.err.println( attrs[i].toString() ); + }*/ + return new LDAPEntry( dn, new LDAPAttributeSet( entry.getAttributes()) ); + } + return null; + } + + /** + * Conversion from ldif to dsml document. + */ + public void convert() { + DSMLWriter writer = new DSMLWriter( m_pw ); + int recCount = 0; + int rejectCount = 0; + + try { + + m_pw.println( ""); + m_pw.println( ""); + m_pw.println( " " ); + + for( LDIFRecord rec = m_ldifReader.nextRecord(); + rec != null; rec = m_ldifReader.nextRecord(), recCount++ ) { + LDAPEntry entry = toLDAPEntry( rec ); + if (entry != null) { + writer.printEntry( entry ); + entry = null; + } + } + + m_pw.println( " " ); + m_pw.println( "" ); + + } catch (IOException e) { + e.printStackTrace(); + } finally { + m_pw.flush(); + m_pw.close(); + } + } + + /** + * Parse the command line parameters and setup the options parameters + */ + static private GetOpt parseParameters( String[] args ) { + + GetOpt options = new GetOpt("H?so:", args); + + if (options.hasOption('H') || options.hasOption('?')) { + usage(); + System.exit(0); + } + + if (options.hasOption('v')) { + m_verbose = true; + } + + if (options.hasOption('o')) { + m_outfile = options.getOptionParam('o'); + if (m_outfile == null) { + System.err.println( "Missing argument for output filename" ); + usage(); + System.exit(0); + } + + try { + /* + m_pw = null; + m_pw = new PrintWriter( new FileOutputStream(m_outfile), true ); + */ + + m_pw = null; + // always write DSML document out in UTF8 encoding + // + OutputStreamWriter os = new OutputStreamWriter( new FileOutputStream(m_outfile), "UTF8" ); + m_pw = new PrintWriter( os, true ); + } catch (IOException e) { + System.err.println( "Can't open " + m_outfile ); + System.err.println( e.toString() ); + System.exit(1); + } + } + + Vector extras = options.getParameters(); + if (extras.size() == 1 ) { + m_infile = new String( (String)extras.get(0) ); + } else { + if ( options.hasOption('s') ) { + // System.err.println( "Use standard input for input of ldif file" ); + m_infile = null; + } else { + usage(); + System.exit(0); + } + } + return options; + } + + /** + * Print out usage of the tool + */ + static private void usage() { + System.err.println("Usage: java [-classpath $CLASSPATH] LDIF2DSML infile.ldif [-s] [-o outfile.dsml]"); + System.err.println("options"); + System.err.println(" -s use standard input for input of ldif file" ); + System.err.println(" -o outfile filename for the output DSML file" ); + System.err.println(" -H -? for usage" ); + // System.err.println(" -v for verbose mode" ); + + } + + /** + * Main routine for the tool. + */ + static public void main(String[] args){ + + m_verify = Boolean.getBoolean("verify"); + + parseParameters( args); + + LDIF2DSML converter = null; + + try { + if (m_infile== null) { + converter = new LDIF2DSML( null ); + } + else { + converter = new LDIF2DSML( m_infile ); + } + } catch( IOException e ) { + System.err.println( "Error encountered in input" ); + System.err.println( e.toString() ); + System.exit( 1 ); + } + + if (m_verify) { + System.exit( 0 ); + } + + converter.convert(); + System.exit( 0 ); + + } + + static private PrintWriter m_pw = new PrintWriter(System.out, true); + static private boolean m_verbose = false; + static private String m_outfile = null; + static private String m_infile = null; + static private LDIF m_ldifReader = null; + static private boolean m_verify = false; +} diff --git a/ldap/admin/src/java/com/netscape/xmltools/Makefile b/ldap/admin/src/java/com/netscape/xmltools/Makefile new file mode 100644 index 00000000..61b4b535 --- /dev/null +++ b/ldap/admin/src/java/com/netscape/xmltools/Makefile @@ -0,0 +1,67 @@ +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# Name: +# Platform: gmake +# -------------------------------------------------------------------------- +override BUILD_MODULE=HTTP_ADMIN + +NOSTDCLEAN=true +NO_BUILD_NUM=true +COMPONENT_DEPS=true + +MCOM_ROOT=../../../../../../../.. + +include ../../../../../../../nsconfig.mk +include ../../../../../../../ldap/javarules.mk +CLASS_DIR=$(JAVA_DEST_DIR)/xmltools +PACKAGE_DIR=$(ABS_ROOT)/dist/$(BUILD_DEBUG) +_PACKAGE_DIR=$(MCOM_ROOT)/dist/$(BUILD_DEBUG) +DEST_DIR=$(CLASS_DIR)/com/netscape/xmltools +JARS_DIR=lib +TOOLS_JARS=$(JARS_DIR)/crimson.jar$(PATH_SEP)$(JARS_DIR)/ldapjdk.jar +TOOLS_JAR_FILE=xmltools.jar +# +# programs list +# +source = \ + $(DEST_DIR)/DSML2LDIF.class \ + $(DEST_DIR)/LDIF2DSML.class \ + $(DEST_DIR)/DSMLReader.class \ + $(DEST_DIR)/DSMLWriter.class \ + $(DEST_DIR)/GetOpt.class \ + $(DEST_DIR)/DSMLSAXBuilder.class \ + $(DEST_DIR)/DSMLSAXHandler.class + + +package: all $(_PACKAGE_DIR) +# when zip finds nothing to do, it exits with code 12 which is not an error +# so we turn that 12 into a 0 which means success so make will continue + cd $(CLASS_DIR); zip -r -u $(PACKAGE_DIR)/$(TOOLS_JAR_FILE) com || if [ $$? -eq 12 ]; then exit 0 ; else exit $$? ; fi + +all: $(DEST_DIR) $(CRIMSONJAR_DEP) $(LDAPJDK_DEP) $(source) + +clean: + rm -f $(DEST_DIR)/*.class; rm -f $(PACKAGE_DIR)/$(TOOLS_JAR_FILE) + +fresh: $(clean) $(all) + + +jdoc: ./doc + $(JAVADOC) -classpath "$(CLASSPATH)$(PATH_SEP)$(CLASS_DIR)$(PATH_SEP)$(CRIMSONJAR_FILE)" -d ./doc com.netscape.xmltools + +jdoc.clean : + rm -rf ./doc + +$(_PACKAGE_DIR): + mkdir -p $(_PACKAGE_DIR) + +$(DEST_DIR)/%.class : %.java + $(JAVAC) -deprecation -classpath "$(CLASSPATH)$(PATH_SEP)$(CLASS_DIR)$(PATH_SEP)$(CRIMSONJAR_FILE)" -d $(CLASS_DIR) $< + +$(DEST_DIR) ./doc: + mkdir -p $@ diff --git a/ldap/admin/src/java/install b/ldap/admin/src/java/install new file mode 100755 index 00000000..e307f782 --- /dev/null +++ b/ldap/admin/src/java/install @@ -0,0 +1,17 @@ +#!/bin/sh +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +if [ $# -lt 1 ] +then + echo >&2 "Usage: $0 targetDirectory" + exit 2 +fi +mkdir -p $1 +mkdir -p $1/jars +cp -p `dirname $0`/mcc $1 +cp -p -r `dirname $0`/jars/* $1/jars diff --git a/ldap/admin/src/java/mcc b/ldap/admin/src/java/mcc new file mode 100755 index 00000000..080ffb98 --- /dev/null +++ b/ldap/admin/src/java/mcc @@ -0,0 +1,38 @@ +#!/bin/sh +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +if [ $# -lt 2 ] +then + echo >&2 "Usage: $0 host port [[user] [password]" + exit 2 +fi +MCC_HOST=$1 +MCC_PORT=$2 +# Has to be in the jars subdirectory +JARDIR=./jars +# +DS=${JARDIR}/ds40.jar +ADMIN=${JARDIR}/admserv.jar +KINGPIN=${JARDIR}/kingpin.jar +SWING=${JARDIR}/swingall.jar +LF=${JARDIR}/nmclf.jar +LAYOUT=${JARDIR}/layout.jar +LDAP=${JARDIR}/ldapjdk.jar +BASE=o=netscaperoot +CLASSPATH=${DS}:${KINGPIN}:${ADMIN}:${SWING}:${LAYOUT}:${LF}:${LDAP};export CLASSPATH +cd `dirname $0` +if [ $# -gt 3 ] +then + java com.netscape.management.client.console.Console -d ${MCC_HOST} -p ${MCC_PORT} -u "$3" -w "$4" -b ${BASE} +elif [ $# -gt 2 ] +then + java com.netscape.management.client.console.Console -d ${MCC_HOST} -p ${MCC_PORT} -u "$3" -b ${BASE} +else + java com.netscape.management.client.console.Console -d ${MCC_HOST} -p ${MCC_PORT} -b ${BASE} +fi + diff --git a/ldap/admin/src/java/mcc.bat b/ldap/admin/src/java/mcc.bat new file mode 100644 index 00000000..4caccf18 --- /dev/null +++ b/ldap/admin/src/java/mcc.bat @@ -0,0 +1,45 @@ +@rem // +@rem // BEGIN COPYRIGHT BLOCK +@rem // Copyright 2001 Sun Microsystems, Inc. +@rem // Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +@rem // All rights reserved. +@rem // END COPYRIGHT BLOCK +@rem // +@echo off +setlocal +set MCC_HOST=%1 +set MCC_PORT=%2 +if "%MCC_HOST%x"=="x" goto usage +if "%MCC_PORT%x"=="x" goto usage +rem +set MCC_USER= +if %3x==x goto nouser +set MCC_USER=-u %3 +echo MCC_USER = %MCC_USER% +:nouser +set MCC_PASSWORD= +if %4x==x goto nopass +set MCC_PASSWORD=-w %4 +:nopass +rem +set JARDIR=./jars +set JDK=%JARDIR%/classes.zip +set DS=%JARDIR%/ds40.jar +set ADMIN=%JARDIR%/admserv.jar +set KINGPIN=%JARDIR%/kingpin.jar +set SWING=%JARDIR%/swingall.jar +set LF=%JARDIR%/nmclf.jar +set LAYOUT=%JARDIR%/layout.jar +set LDAP=%JARDIR%/ldapjdk.jar +set BASE=o=netscaperoot +set CLASSPATH=%DS%;%KINGPIN%;%ADMIN%;%SWING%;%LAYOUT%;%LF%;%LDAP% +rem echo java com.netscape.management.client.console.Console -d %MCC_HOST% -p %MCC_PORT% %MCC_USER% %MCC_PASSWORD% -b %BASE% +java com.netscape.management.client.console.Console -d %MCC_HOST% -p %MCC_PORT% %MCC_USER% %MCC_PASSWORD% -b %BASE% +goto end + +:usage +echo Usage: mcc HOST PORT [[user] [password]] + +:end +endlocal + diff --git a/ldap/admin/src/key.rc b/ldap/admin/src/key.rc new file mode 100644 index 00000000..7568ac91 --- /dev/null +++ b/ldap/admin/src/key.rc @@ -0,0 +1,150 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +//Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_GETPATH DIALOG DISCARDABLE 0, 0, 293, 155 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "NETSCAPE KEY PAIR FILE GENERATION" +FONT 8, "MS Sans Serif" +BEGIN + EDITTEXT IDE_PATH,93,110,159,13,ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,39,130,50,14 + PUSHBUTTON "Cancel",IDCANCEL,193,129,50,14 + LTEXT "Welcome to the key pair file generator. With this program you can generate the public and private keys that your server uses for secure communications.Make sure that you enter the full pathname of the key file.", + IDC_STATIC,17,17,253,28 + LTEXT "First the server needs to know where to put the new key. You should NOT overwrite an existing key pair file ! Place the new key in a separate location. Make a note of the new key's location ! You will need it later when you request a certificate.", + IDC_STATIC,17,50,251,33 + LTEXT "Key File Location:",IDC_STATIC,17,113,63,8 + LTEXT "If you installed the server into the root c:\\Navgold, you can store the key file in c:\\Navgold\\Server\\\\ssl\\key.db", + IDC_STATIC,17,87,251,16 +END + +IDD_GETPASSWORD DIALOG DISCARDABLE 0, 0, 293, 144 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "NETSCAPE KEY PAIR FILE PASSWORD" +FONT 8, "MS Sans Serif" +BEGIN + EDITTEXT IDE_GETPASSWORD,98,104,159,13,ES_PASSWORD | + ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,45,125,50,14 + PUSHBUTTON "Cancel",IDCANCEL,190,123,50,14 + LTEXT "Finally, enter a password which will be used to encrypt the key pair file. You will use this password when starting up and shutting down your server.", + IDC_STATIC,18,24,253,20 + LTEXT "Note: Be sure to keep this password safe ! If you must write down the password, the physical safety of the recording is your responsibility.", + IDC_STATIC,18,50,251,19 + LTEXT "Password",IDC_STATIC,18,105,63,8 + LTEXT "The password must be at least 8 characters long, and must contain at least one non-alphabetic character in it. It should not be a word in any dictionary.", + IDC_STATIC,18,77,255,24 + LTEXT "A random seed has been successfully generated !!", + IDC_STATIC,18,4,246,15 +END + +IDD_GETPASSWORD2 DIALOG DISCARDABLE 0, 0, 265, 116 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "NETSCAPE KEY PAIR FILE PASSWORD" +FONT 8, "MS Sans Serif" +BEGIN + EDITTEXT IDE_GETPASSWORD2,67,50,159,13,ES_PASSWORD | + ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,67,78,50,14 + PUSHBUTTON "Cancel",IDCANCEL,176,78,50,14 + LTEXT "Password",-1,10,54,50,8 + LTEXT "Reenter the password for verification:",-1,10,18,255,24 +END + +IDD_GETCERT DIALOG DISCARDABLE 0, 0, 293, 115 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "NETSCAPE KEY CERTIFICATE GENERATION" +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "OK",IDOK,125,90,50,14 + LTEXT "Congratulations ! Your new key is in the file:", + IDC_STATIC,19,17,253,14 + LTEXT "The next step is to generate a certificate. Select the hyperlink ""Request or renew a certificate from the server manager.", + IDC_STATIC,19,60,251,22 + LTEXT "Static",IDC_KEYFILE,19,38,223,8 +END + +IDD_GETSEED DIALOG DISCARDABLE 0, 0, 301, 156 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "NETSCAPE RANDOM NUMBER SEED GENERATION" +FONT 8, "MS Sans Serif" +BEGIN + LTEXT "Next a random seed must be generated to complete the creation of your key pair file. You have to provide mouse input for this to happen. Move your mouse continuously and randomly on the desktop to provide this input.", + IDC_STATIC,15,12,250,29 + LTEXT "On NT3.51 systems a progress bar will appear to inform you how much more random mouse input the program needs to generate its random seed. When enough input has been obtained from you, another dialog box will notify you.", + IDC_STATIC,15,48,259,25 + LTEXT "As you move the mouse, the location of the cursor is sampled at random intervals and this is added to a sample of a high frequency counter to generate the random seed. Click OK to begin.", + IDC_STATIC,15,83,256,33 + PUSHBUTTON "OK",IDOK,125,137,50,14 + LTEXT "This process could take from 30 seconds to a minute of continuous mouse input.", + IDC_STATIC,15,119,281,8 +END + +IDD_UPDATE DIALOG DISCARDABLE 0, 0, 185, 74 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Collecting Random User Input ....." +FONT 8, "MS Sans Serif" +BEGIN + LTEXT "Static",IDC_UPDATE,13,8,150,59 +END + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +///////////////////////////////////////////////////////////////////////////// +#endif // APSTUDIO_INVOKED + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/ldap/admin/src/latest_file.c b/ldap/admin/src/latest_file.c new file mode 100644 index 00000000..5a6be701 --- /dev/null +++ b/ldap/admin/src/latest_file.c @@ -0,0 +1,95 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/*********************************************************************** +** +** NAME +** latest_file.c +** +** DESCRIPTION +** Creates a batch file which assigns the latest file matching a given +** pattern to the environment variable LATEST_FILE. For use in NT batch +** files. +** +** AUTHOR +** +** +***********************************************************************/ + +/*********************************************************************** +** Includes +***********************************************************************/ + + +/* + * Given a pattern to match, creates a batch file with the latest full + * file name to set to LATEST_FILE. No file is created if there are no + * matching files. + */ +#if defined( _WIN32 ) +#include +#include +#include +#include + + +int main (int argc, char **argv) +{ + char *szWildcardFileSpec; + char *szOutput; + char dir[1024]; + char latest[1024]; + char *dirEnd; + time_t latest_time = 0; + long hFile; + struct _finddata_t fileinfo; + FILE *fBatch; + + if ( argc < 3 ) { + fprintf( stderr, "Usage: %s PATTERN OUTPUTFILE\n", argv[0] ); + return 1; + } + + szWildcardFileSpec = argv[1]; + szOutput = argv[2]; + + /* Get directory part of path */ + strcpy( dir, szWildcardFileSpec ); + dirEnd = strrchr( dir, '\\' ); + if ( dirEnd != NULL ) { + *dirEnd = 0; + } + + /* Expand file specification */ + hFile = _findfirst( szWildcardFileSpec, &fileinfo); + if( hFile == -1 ) { + perror( "No matching files!" ); + return -1; + } + + sprintf( latest, "%s\\%s", dir, fileinfo.name ); + latest_time = fileinfo.time_create; + + while( _findnext( hFile, &fileinfo ) == 0 ) { + if ( fileinfo.time_create > latest_time ) { + sprintf( latest, "%s\\%s", dir, fileinfo.name ); + latest_time = fileinfo.time_create; + } + } + + _findclose( hFile ); + + /* create batch file */ + fBatch = fopen (szOutput, "w"); + if ( fBatch == NULL ) { + perror ("Unable to create batch file!"); + return 1; + } + fprintf( fBatch, "set LATEST_FILE=%s\n", latest ); + fclose (fBatch); + + return 0; +} +#endif /* ( XP_WIN32 ) */ diff --git a/ldap/admin/src/makemccvlvindexes b/ldap/admin/src/makemccvlvindexes new file mode 100644 index 00000000..a8e46efd --- /dev/null +++ b/ldap/admin/src/makemccvlvindexes @@ -0,0 +1,211 @@ +#!perl +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# + +# makemccvlvindexes + +sub usage_and_exit +{ + print "makemccvlvindexes usage\n"; + print "\n"; + print "This script analyses an LDAP directory in order to create VLV indices which\n"; + print "could be configured to improve the performance of one-level searches.\n"; + print "This is principally to be used to tune the directory browsing feature\n"; + print "of the Mission Control Console.\n"; + print "\n"; + print "An LDAP client can only take advantage of these indices if it is itself\n"; + print "VLV enabled. See the following specification for full details.\n"; + print "\n"; + print "ftp://ftp.ietf.org/internet-drafts/draft-ietf-ldapext-ldapv3-vlv-00.txt\n"; + print "\n"; + print "Command Line Arguments\n"; + print "-? - help\n"; + print "-D rootdn - Provide a root DN. Default= '$rootdn'\n"; + print "-w password - Provide a password for the root DN.\n"; + print "-h host - Provide a host name. Default= '$host'\n"; + print "-p port - Provide a port. Default= '$port'\n"; + print "-t threshold - Provide a container subordinate threshold. Default= $threshold\n"; + print "-f filter - Provide a search filter. Default= '$vlvfilter'\n"; + print "-s sort - Provide a sort specification. Default='$vlvsort'\n"; + print "-n - Do the work, but don't create the indices\n"; + exit; +} + +# Initialise some things +$vlvfilter= "(objectclass=*)"; +$vlvsort= "sn givenname cn ou o"; +$rootdn= "cn= Directory Manager"; +$host= "localhost"; +$port= "389"; +$threshold= 1000; +$really_do_it= "1"; + +# Process the command line arguments +while( $arg = shift) +{ + if($arg eq "-?") + { + usage_and_exit(); + } + elsif($arg eq "-D") + { + $rootdn= shift @ARGV; + } + elsif($arg eq "-w") + { + $rootpw= shift @ARGV; + } + elsif($arg eq "-h") + { + $host= shift @ARGV; + } + elsif($arg eq "-p") + { + $port= shift @ARGV; + } + elsif($arg eq "-t") + { + $threshold= shift @ARGV; + } + elsif($arg eq "-f") + { + $vlvfilter= shift @ARGV; + } + elsif($arg eq "-s") + { + $vlvsort= shift @ARGV; + } + elsif($arg eq "-n") + { + $really_do_it= "0"; + } + else + { + print "$arg: Unknown command line argument.\n"; + } +} + +$ldapsearch= "ldapsearch -h $host -p $port"; +$ldapmodify= "ldapmodify -h $host -p $port -D \"$rootdn\" -w $rootpw"; + +if( $vlvfilter eq "" || + $vlvsort eq "" || + $rootdn eq "" || + $host eq "" || + $port eq "" || + $threshold eq "") +{ + print "Error: Need command line information..\n"; + usage_and_exit(); +} + +if( $rootpw eq "" ) +{ + print "Warning: No root DN password provided. Won't be able to add VLV Search and Index entries.\n"; +} + +# Tell the user what we're up to. +print "Searching all naming contexts on '$host:$port' for containers with more than $threshold subordinate entries\n"; + +# Read the naming contexts from the root dse +@namingcontexts= `$ldapsearch -s base -b \"\" \"objectclass=*\" namingcontexts`; + +# Get rid of the first line 'dn:' +shift @namingcontexts; + +# Foreach naming context... +foreach $nc (@namingcontexts) +{ + # Extract the base from the naming context + @base= split ' ', $nc; + shift @base; + + # Find all the containers + print "Searching naming context '@base' for containers.\n"; + @containers= `$ldapsearch -s subtree -b \"@base\" \"numsubordinates=*\" numsubordinates`; + chop @containers; + + # Foreach container + + while(@containers) + { + # + $dn_line= shift @containers; + $count_line= shift @containers; + shift @containers; + + # Extract the count, and check it against the threshold + @count_array= split ' ', $count_line; + $count= @count_array[1]; + $dn= substr($dn_line,4); + print "Found container '$dn' with $count subordinates. "; + if($count > $threshold) + { + # We've found a container that should be indexed. + # Extract the DN and RDN of the container + $comma_position= (index $dn, ','); + if($comma_position== -1) + { + $rdn= $dn + } + else + { + $rdn= substr($dn, 0, $comma_position); + } + + # Tell the user what we're up to. + print "Adding VLV Search and Index entries.\n"; + + # Build the vlv search and index entries to be added. + $vlvsearch_name= "MCC $rdn"; + @vlvsearch= ( + "dn: cn=$vlvsearch_name, cn=config, cn=ldbm\n", + "objectclass: top\n", + "objectclass: vlvSearch\n", + "cn: $vlvsearch_name\n", + "vlvbase: $dn\n", + "vlvfilter: $vlvfilter\n", + "vlvscope: 1\n\n" ); + + $vlvindex_name= "SN $vlvsearch_name"; + @vlvindex= ( + "dn: cn=$vlvindex_name, cn=$vlvsearch_name, cn=config, cn=ldbm\n", + "objectclass: top\n", + "objectclass: vlvIndex\n", + "cn: $vlvindex_name\n", + "vlvsort: $vlvsort\n\n" ); + + @vlvnames = ( @vlvnames, "\"" . $vlvindex_name . "\""); + + if($really_do_it eq "1") + { + open(FD,"| $ldapmodify -a -c"); + print FD @vlvsearch; + print FD @vlvindex; + close(FD); + } + } + else + { + print "Too small.\n"; + } + } +} + +# Dump a script to actually create the indexes +if($really_do_it eq "1" && $#vlvnames > 0) +{ + print "\n"; + print "$#vlvnames VLV indices have been declared. Execute the following commands to build the index files.\n"; + print "\n"; + print "\\stop\n"; + print "slapd db2index -f \\config\\slapd.conf -V @vlvnames\n"; + print "\\start\n"; +} + + diff --git a/ldap/admin/src/makevlvindex b/ldap/admin/src/makevlvindex new file mode 100644 index 00000000..ef68798c --- /dev/null +++ b/ldap/admin/src/makevlvindex @@ -0,0 +1,109 @@ +#!perl +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# + +# makevlvindex + +sub usage_and_exit +{ + print "makevlvindex [options]\n"; + print "\n"; + print "Options:\n"; + print "-? - help\n"; + print "-D rootdn - Provide a root DN. Default= '$rootdn'\n"; + print "-w password - Provide a password for the root DN.\n"; + print "-h host - Provide a host name. Default= '$host'\n"; + print "-p port - Provide a port. Default= '$port'\n"; + print "-sn search_name - RDN of the vlvSearch parent entry.\n"; + print "-in index_name - RDN for the vlvIndex child entry.\n"; + print "-s sort - Provide a sort specification. Default='$vlvsort'\n"; + exit; +} + +# Initialise some things +$vlvsearch_name= ""; +$vlvindex_name= ""; +$vlvsort= "sn givenname cn ou o"; +$rootdn= "cn=Directory Manager"; +$host= "localhost"; +$port= "389"; + +# Process the command line arguments +while( $arg = shift) +{ + if($arg eq "-?") + { + usage_and_exit(); + } + elsif($arg eq "-D") + { + $rootdn= shift @ARGV; + } + elsif($arg eq "-w") + { + $rootpw= shift @ARGV; + } + elsif($arg eq "-h") + { + $host= shift @ARGV; + } + elsif($arg eq "-p") + { + $port= shift @ARGV; + } + elsif($arg eq "-sn") + { + $vlvsearch_name= shift @ARGV; + } + elsif($arg eq "-in") + { + $vlvindex_name= shift @ARGV; + } + elsif($arg eq "-s") + { + $vlvsort= shift @ARGV; + } + else + { + print "$arg: Unknown command line argument.\n"; + } +} + +$ldapmodify= "ldapmodify -h $host -p $port -D \"$rootdn\" -w $rootpw"; + +if( $vlvsearch_name eq "" || + $vlvindex_name eq "" || + $vlvsort eq "" || + $rootdn eq "" || + $host eq "" || + $port eq "") +{ + print "Error: Need command line information..\n"; + usage_and_exit(); +} + +if( $rootpw eq "" ) +{ + print "Warning: No root DN password provided. Won't be able to add VLV Search and Index entries.\n"; +} + +# Tell the user what we're up to. +print "Adding VLV Search entry.\n"; + +@vlvindex= ( + "dn: cn=$vlvindex_name, cn=$vlvsearch_name, cn=config, cn=ldbm\n", + "objectclass: top\n", + "objectclass: vlvIndex\n", + "cn: $vlvindex_name\n", + "vlvsort: $vlvsort\n\n" ); + +open(FD,"| $ldapmodify -a -c"); +print FD @vlvindex; +close(FD); + + diff --git a/ldap/admin/src/makevlvsearch b/ldap/admin/src/makevlvsearch new file mode 100644 index 00000000..45616e02 --- /dev/null +++ b/ldap/admin/src/makevlvsearch @@ -0,0 +1,138 @@ +#!perl +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# + +# makevlvsearch + +sub usage_and_exit +{ + print "makevlvsearch [options]\n"; + print "\n"; + print "May be used to create just a vlvSearch entry, or to create\n"; + print "both a vlvSearch and vlvIndex entry.\n"; + print "\n"; + print "Options:\n"; + print "-? - help\n"; + print "-D rootdn - Provide a root DN. Default= '$rootdn'\n"; + print "-w password - Provide a password for the root DN.\n"; + print "-h host - Provide a host name. Default= '$host'\n"; + print "-p port - Provide a port. Default= '$port'\n"; + print "-b scope - Provide a scope. 1 or 2. Default= '$vlvscope'\n"; + print "-f filter - Provide a search filter. Default= '$vlvfilter'\n"; + print "-sn search_name - RDN of the vlvSearch parent entry.\n"; + print "-in index_name - RDN for the vlvIndex child entry.\n"; + print "-s sort - Provide a sort specification. Default='$vlvsort'\n"; + exit; +} + +# Initialise some things +$vlvsearch_name= ""; +$vlvindex_name= ""; +$vlvscope= "2"; +$vlvfilter= "(objectclass=*)"; +$vlvsort= ""; +$rootdn= "cn=Directory Manager"; +$host= "localhost"; +$port= "389"; + +# Process the command line arguments +while( $arg = shift) +{ + if($arg eq "-?") + { + usage_and_exit(); + } + elsif($arg eq "-D") + { + $rootdn= shift @ARGV; + } + elsif($arg eq "-w") + { + $rootpw= shift @ARGV; + } + elsif($arg eq "-h") + { + $host= shift @ARGV; + } + elsif($arg eq "-p") + { + $port= shift @ARGV; + } + elsif($arg eq "-b") + { + $vlvscope= shift @ARGV; + } + elsif($arg eq "-f") + { + $vlvfilter= shift @ARGV; + } + elsif($arg eq "-s") + { + $vlvsort= shift @ARGV; + } + elsif($arg eq "-sn") + { + $vlvsearch_name= shift @ARGV; + } + elsif($arg eq "-in") + { + $vlvindex_name= shift @ARGV; + } + else + { + print "$arg: Unknown command line argument.\n"; + } +} + +$ldapmodify= "ldapmodify -h $host -p $port -D \"$rootdn\" -w $rootpw"; + +if( $vlvfilter eq "" || + $vlvscope eq "" || + $vlvsearch_name eq "" || + $rootdn eq "" || + $host eq "" || + $port eq "") +{ + print "Error: Need command line information..\n"; + usage_and_exit(); +} + +if( $rootpw eq "" ) +{ + print "Warning: No root DN password provided. Won't be able to add VLV Search and Index entries.\n"; +} + +# Tell the user what we're up to. +print "Adding VLV Search and Index entries.\n"; + +# Build the vlv search and index entries to be added. +@vlvsearch= ( + "dn: cn=$vlvsearch_name, cn=config, cn=ldbm\n", + "objectclass: top\n", + "objectclass: vlvSearch\n", + "cn: $vlvsearch_name\n", + "vlvbase: $dn\n", + "vlvfilter: $vlvfilter\n", + "vlvscope: $vlvscope\n\n" ); + +@vlvindex= ( + "dn: cn=$vlvindex_name, cn=$vlvsearch_name, cn=config, cn=ldbm\n", + "objectclass: top\n", + "objectclass: vlvIndex\n", + "cn: $vlvindex_name\n", + "vlvsort: $vlvsort\n\n" ); + +open(FD,"| $ldapmodify -a -c"); +print FD @vlvsearch; +if( not($vlvindex_name eq "" || $vlvsort eq "")) +{ + print FD @vlvindex; +} +close(FD); + + diff --git a/ldap/admin/src/migrateInstance b/ldap/admin/src/migrateInstance new file mode 100644 index 00000000..0480ec47 --- /dev/null +++ b/ldap/admin/src/migrateInstance @@ -0,0 +1,549 @@ +#!perl +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# + +# migrate an old server instance to a new server instance + +BEGIN { + $| = 1; + # print CGI header + print "Content-type: text/plain\n\n"; + require 'uname.lib'; + + $isNT = -d '\\'; + $PATHSEP = $isNT ? "\\" : "/"; + # get the server root directory + $sroot = $ENV{'NETSITE_ROOT'}; + $exitCode = 0; + @INC = ( '.', '../../../admin/admin/bin' ); + grep { s@/@\\@g } @INC if $isNT; + $script_suffix = $isNT ? ".bat" : ""; + $exe_suffix = $isNT ? ".exe" : ""; + $slapdExecName = $isNT ? 'slapd.exe' : 'ns-slapd'; + $nullFile = $isNT ? 'nul' : '/dev/null'; + # NT needs quotes around some things unix doesn't + $quote = $isNT ? "\"" : ""; + if ($isNT) { + # we have to pass batch files directly to the NT command interpreter + $com_spec = $ENV{ComSpec}; + if (!$com_spec) { + $com_spec = $ENV{COMSPEC}; + } + if (!$com_spec || ! -f $com_spec) { + # find the first available command interpreter + foreach $drive (c..z) { + $com_spec = "$drive:\\winnt\\system32\\cmd.exe"; + last if (-f $com_spec); + $com_spec = undef; + } + if (! $com_spec) { + # punt and pray + $com_spec = 'c:\winnt\system32\cmd.exe'; + } + } + $os = "WINNT"; + } else { + $os = &uname("-s"); + } + + if ( ($os eq "AIX") || ($os eq "HP-UX") ) { + $sigChildHandler = 'sigChildHandler'; + } +} + +sub mySystem { + my $cmd = $_[0]; + # the system {$cmd} avoids some NT shell quoting problems if the $cmd + # needs to be quoted e.g. contains spaces; the map puts double quotes + # around the arguments on NT which are stripped by the command + # interpreter cmd.exe; but don't quote things which are already quoted + my @fixargs = map { /^[\"].*[\"]$/ ? $_ : $quote . $_ . $quote } @_; + my $rc = 0; + if ($cmd =~ /[.](bat|cmd)$/) { + # we have to pass batch files directly to the NT command interpreter + $cmd = $com_spec; +# print "system $cmd /c \"@fixargs\"\n"; + $rc = system {$cmd} '/c', "\"@fixargs\""; + } else { +# print "system $cmd \"@fixargs\"\n"; + $rc = system {$cmd} @fixargs; + } + + return $rc; +} + +sub getNextEntry { + my $fh = shift; + my @entry = (); # an array of strings, each string is 1 attr/value pair + my $line = ""; + while (($line = <$fh>) && !($line =~ /^$/)) { # entry is terminated by EOF or empty line34 + chop $line; + if ($line =~ /^\s/) { # line begins with a single space char + $entry[@entry-1] .= $'; # add continuation to line + } else { + push @entry, $line; + } + } + return @entry; +} + +sub runAndIgnoreOutput { + my $cmd = shift; + print "\n."; + open(RUNCMD, "${quote}$cmd${quote} 2>&1 |") or die "Error: could not run $cmd: $!"; + print "\n." ; + sleep(1); # allow pipe to fill with data + print "\n." ; + while () { +# print; + } + my $code = close(RUNCMD); +# print "runAndIgnore: code=$code status=$?\n"; + return $?; +} + +sub printEntry { + my $fh = shift; + foreach (@_) { + print $fh $_, "\n"; + } + print $fh "\n"; +} + +sub reportAndExit { + my $now_time = gmtime; + print "END migration at ", $now_time, " GMT\n"; + print "Exit status is ", $exitCode, "\n"; + if ($? == 0 && $exitCode == 0) { + print "NMC_STATUS: 0\n"; + } else { + # not necessary to show this + print '$?=', $?+0, ' $!=', $!+0, ' $exitCode=', $exitCode, "\n"; + print shift, "\n"; + print "NMC_STATUS: $exitCode\n"; + } + + print "###MIGRATION FINISHED###\n"; + + exit($exitCode); +} + +# put stderr on stdout +open(STDERR, ">&STDOUT" ); +# use unbuffered output +select(STDERR); +$| = 1; +select(STDOUT); +$| = 1; +$TRACELEVEL = 0 ; + +sub sigChildHandler { +# print "in sig child handler\n"; +# print "args = @_\n"; +} + +$SIG{__DIE__} = 'exit'; +$SIG{'QUIT'} = 'exit'; +$SIG{'INT'} = 'exit'; +$SIG{'TERM'} = 'exit'; +# AIX needs a SIGCHILD handler for pipes +if (defined($sigChildHandler)) { + $SIG{'CHLD'} = $sigChildHandler; + $SIG{'CLD'} = $sigChildHandler; +} + +# the atexit handler +END { + $! = 0; + $? = $exitCode; + if ($exitCode == 0) { + # just give a report if the operation was successfull + &reportAndExit; } +} + +# process the CGI input +use Cgi; + +if (($sroot =~ m#/$#) || ($sroot =~ m#\\$#)) { + chop $sroot; +} + +if (($cgiVars{'oldServerRoot'} =~ m#/$#) || ($cgiVars{'oldServerRoot'} =~ m#\\$#)) { + chop $cgiVars{'oldServerRoot'}; +} + +$instanceDir = $sroot . $PATHSEP . 'slapd-' . $cgiVars{'servid'}; + +######################################################################################### +# get the Directory Server version +# For the moment the migration works only from 4.x version to 5.0 version +# As for as previous versions are concerned we don't migrate neither 1.x nor 3.x +######################################################################################### + +($oldVersion, $oldMinor) = &getVersion($cgiVars{'oldServerRoot'}); +print "\n\noldVersion: $oldVersion, oldMinor: $oldMinor" ; + + +if ($oldVersion < 4) { + # migration of version under 4 is not supported + # abort the use of the migration script up to 5.1 + $exitCode = 1 ; + die "\n\n\n\n\n\n\nThe migration of a $oldVersion.x directory instance is not available." . + "\n\nINFORMATION" . + "\nYou can also migrate a 4.x directory server." . + "\nIt must be executed manually through a command line." . + "\nPlease refer to the product documentation to get usage and prerequisites\n"; +} +else { + # print begin message + $now_time = gmtime; + print "BEGIN migration at: ", $now_time, " GMT\n"; + $oldSlapdConf = $cgiVars{'oldServerRoot'} . $PATHSEP . 'slapd-' . + $cgiVars{'oldServerName'} . $PATHSEP . 'config' . $PATHSEP . + 'slapd.conf'; + + open(OLDSLAPDCONF, $oldSlapdConf) or + die "Error: could not open old config file $oldSlapdConf: $!"; + while() { + chop; + if (/^port\s+/i) { + if (! $cgiVars{'servport'}) { + $cgiVars{'servport'} = $'; + $old_port = $' ; + $Cgi::CONTENT .= '&servport=' . $'; + if ($ENV{'QUERY_STRING'}) { + $ENV{'QUERY_STRING'} .= '&servport=' . $'; + } + } + } elsif (/^rootdn\s+/i) { + if (! $cgiVars{'rootdn'}) { + ($value = $') =~ s/^[\"]//; + # remove leading " + $value =~ s/[\"]$//; + # remove trailing " + $cgiVars{'rootdn'} = $value; + $Cgi::CONTENT .= '&rootdn=' . $value; + if ($ENV{'QUERY_STRING'}) { + $ENV{'QUERY_STRING'} .= '&rootdn=' . $value; + } + } + } + } + close(OLDSLAPDCONF); + + $testDir = $instanceDir . $PATHSEP . 'config'; + + # check if it's necessary or not to stop the old server + if (-d $testDir) { + printTrace("\ninstance already exists \n",3) ; + # the instance already exists + $DSEldif = $instanceDir. $PATHSEP . 'config' . $PATHSEP . 'dse.ldif'; + open(DSELDIF, $DSEldif) or + die "Error: could not open old config file $DSEldif: $!"; + while() { + chop; + if (/^nsslapd-port:\s+/i) { + $cgiVars{'servport'} = $'; + $Cgi::CONTENT .= '&servport=' . $'; + if ($ENV{'QUERY_STRING'}) { + $ENV{'QUERY_STRING'} .= '&servport=' . $'; + } + } elsif (/^nsslapd-rootdn:\s+/i) { + ($value = $') =~ s/^[\"]//; + # remove leading " + $value =~ s/[\"]$//; + # remove trailing " + $cgiVars{'rootdn'} = $value; + $Cgi::CONTENT .= '&rootdn=' . $value; + if ($ENV{'QUERY_STRING'}) { + $ENV{'QUERY_STRING'} .= '&rootdn=' . $value; + } + } + } + close(DSELDIF); + if ($old_port eq $cgiVars{'servport'}) { + # need to stop the old instance + if ($cgiVars{'shutdown_old_server'}) { + &stopServer($cgiVars{'oldServerRoot'}, 'slapd-' . $cgiVars{'oldServerName'}); + } + } + &startServer(); + } + else { + # need to stop the old instance + if ($cgiVars{'shutdown_old_server'}) { + &stopServer($cgiVars{'oldServerRoot'}, 'slapd-' . $cgiVars{'oldServerName'}); + } + } + + @cgi = keys(%cgiVars); + printTrace("\ncgi: @cgi",3); + printTrace("\npwd: $cgiVars{'rootpw'}, rootdn: $cgiVars{'rootdn'}, port: $cgiVars{'servport'}, + old_instance -o: $cgiVars{'oldServerRoot'}$PATHSEPslapd-$cgiVars{'oldServerName'}, + new_instance -n: $sroot$PATHSEPslapd-$cgiVars{'servid'}",3) ; + + # if the instance does not exist, create it + if (! -d $testDir) { + print "Creating the new instance . . .\n"; + printTrace("\nbefore instance creation\n",3) ; + # call the instance creation program; we should already be in the same + # directory; if we are being called as a CGI, index will parse the CGI + # parameters, otherwise, it will use the command line parameters + if ($isNT) { + $myprog = "ds_create.exe"; + } else { + $myprog = "./ds_create"; + } + printTrace("\nafter instance creation\n",3) ; + + # since we already parsed stdin, we need to pass it to the instance creation + # CGI somehow; fortunately, we saved the old contents of stdin in the + # $Cgi::CONTENT, so just pipe that into our CGI + # print "executing $myprog @ARGV\n"; + open(INDEX, "|$myprog @ARGV") or die "Error: system($myprog, @ARGV): $!"; + sleep(1); # allow prog to init stdin read buffers + print INDEX $Cgi::CONTENT, "\n"; + close INDEX; + + $exitCode = $?; + if ($exitCode != 0) { + die "Error: could not create new instance: $!"; + } + + + } else { + } + + + printTrace("\nBefore instance created test\n",3) ; + + chdir("$sroot${PATHSEP}bin${PATHSEP}slapd${PATHSEP}admin${PATHSEP}bin"); + + # Now that the new instance is created, merge in the old configuration data + # $cgiVars{'oldServerRoot'} will contain the full path of the old server + # root directory + # $cgiVars{'oldServerName'} will contain the old instance name + $myscript = "migrateInstance5"; + # print "executing $myscript $sroot $cgiVars{'oldServerRoot'} $cgiVars{'servid'} $cgiVars{'oldServerName'} $savedLdif\n"; + + @args = ($, $myscript, '-p', $cgiVars{'servport'}, '-D', $cgiVars{'rootdn'}, '-w', $cgiVars{'rootpw'}, '-o', + $cgiVars{'oldServerRoot'} . $PATHSEP . 'slapd-' . $cgiVars{'oldServerName'}, '-n', + $sroot . $PATHSEP . 'slapd-' . $cgiVars{'servid'}, '-noinput'); + $exitCode = &mySystem(@args); + die "Error: @args: $!" if ($exitCode != 0); + } + + +sub startServer { + my $errLog = $instanceDir . $PATHSEP . 'logs' . $PATHSEP . 'errors'; + # emulate tail -f + # if the last line we see does not contain "slapd started", try again + my $done = 0; + my $started = 0; + my $code = 0; + my $lastLine = ""; + my $timeout = time + 60; # 1 minute + my $startCmd = $instanceDir . $PATHSEP . 'start' . $script_suffix; + if (! -f $startCmd) { + $startCmd = $instanceDir . $PATHSEP . 'start-slapd' . $script_suffix; + } + $code = &mySystem($startCmd); + open(IN, $errLog) or die "Could not open error log $errLog: $!"; + my $pos = tell(IN); + while (($done == 0) && (time < $timeout)) { + for (; ($done == 0) && ($_ = ); $pos = tell(IN)) { + $lastLine = $_; +# print; + # the server has already been started and shutdown once . . . + if (/slapd started\./) { + $started++; + if ($started == 2) { + $done = 1; + } + # sometimes the server will fail to come up; in that case, restart it + } elsif (/Initialization Failed/) { +# print "Server failed to start: $_"; + $code = &mySystem($startCmd); + # sometimes the server will fail to come up; in that case, restart it + } elsif (/exiting\./) { +# print "Server failed to start: $_"; + $code = &mySystem($startCmd); + } + } + if ($lastLine =~ /PR_Bind/) { + # server port conflicts with another one, just report and punt + print $lastLine; + print "This server cannot be started until the other server on this\n"; + print "port is shutdown.\n"; + $done = 1; + } + if ($done == 0) { + # rest a bit, then . . . + sleep(2); + # . . . reset the EOF status of the file desc + seek(IN, $pos, 0); + } + } + close(IN); + + if ($started < 2) { + $! = $code; +# $now = time; +# if ($now > $timeout) { +# print "Possible timeout: timeout=$timeout now=$now\n"; +# } + die "Error: could not start server: $!"; + } + + return 0; +} + +sub stopServer { + my $root = shift; + my $name = shift; + $maxStopIterations = 60; + print "Shutting down server $name . . .\n"; + $stopCmd = $quote . $root . $PATHSEP . $name . $PATHSEP . 'stop' . $script_suffix . $quote; + if (! -f $stopCmd) { + $stopCmd = $quote . $root . $PATHSEP . $name . $PATHSEP . 'stop-slapd' . $script_suffix . $quote; + } + + if (! -f $stopCmd) { + # no stop command, probably a 1.X system; for NT, we'll try net stop + # for unix, we'll get the pid and kill it + if ($isNT) { + $stopCmd = 'net stop ' . $name; + } else { + # see if there is a pid file + $pidfile = $root . $PATHSEP . $name . $PATHSEP . 'logs' . + $PATHSEP . 'pid'; + if (open(PIDFILE, $pidfile)) { + chomp($pid = ); + close(PIDFILE); + while ($maxStopIterations-- && !$exitCode) { + $exitCode = kill(15, $pid); + } + $stopCmd = undef; + } + } + } + + # keep looping until the stop cmd returns an error code, which usually + # means that what ever we want to stop is stopped, or some other error + # occurred e.g. permission, or no such service + $exitCode = &runAndIgnoreOutput($stopCmd); +# print "stopServer: exitCode=$exitCode\n"; + while ($stopCmd && $maxStopIterations-- && !$exitCode) { + $exitCode = &runAndIgnoreOutput($stopCmd); +# print "stopServer: exitCode=$exitCode\n"; + } + + if (!$maxStopIterations) { + print "Warning: could not shutdown the old server: $!\n"; + } + + sleep(10) if ($isNT); + + $exitCode = 0; +} + +############################################################################# +# print message error to the user standard output. + +sub printTrace { + + my $Msg = shift ; + my $level = shift ; + if ($level <= $TRACELEVEL) { + print($Msg); + } + +} + +############################################################################# + +sub getVersion { + my $rootDir = shift; + my $version = 0; + my $minor = 0; + my $progDir = "${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${PATHSEP}"; + my $progDir2 = "${PATHSEP}bin${PATHSEP}slapd${PATHSEP}"; + # get the current directory so we can go back to it + my $curdir = &getCwd; + + # find the slapd executable + $prog = $rootDir . $progDir . $slapdExecName; + if (! -f $prog) { + $prog = $rootDir . $progDir2 . $slapdExecName; + if (-f $prog && $isNT) { + # if slapd is in bin/slapd and we're on NT, just assume version 1; + # apparently, slapd.exe doesn't like the -v argument . . . + return ( '1', $minor ); + } + } + + # read the old version from the old slapd program + chdir($rootDir . $progDir) or + die "Could not chdir to $rootDir${progDir}: $!: "; + open(F, "${quote}${quote}$prog${quote} -v${quote} 2>&1 |") or + die "Could not run slapd program $prog: $!"; + sleep(1); # allow some data to accumulate in the pipe +# print "Output from $prog -v:\n"; + while () { + print; + if (/^Netscape-Directory\/(\d+)\.(\d+)/) { + $version = $1; + $minor = $2; + last; + } + elsif (/^Netscape-Directory\(restriced-mode\)\/(\d+)\.(\d+)/) { + $version = $1; + $minor = $2; + last; + } + } + $code = close(F); +# print "$prog returned code=$code status=$?\n"; + + # done determining versions; go back to orig directory + chdir($curdir) or die "Could not chdir to $curdir: $!: "; + + $version == 0 and + die "Could not determine version of the directory server in $rootDir: "; + + return ( $version, $minor ); +} + + +############################################################################# + +sub getCwd { + my $command = $isNT ? "cd" : "/bin/pwd"; + open(PWDCMD, "$command 2>&1 |") or + die "Error: could not execute $command: $!"; + # without the following sleep, reading from the pipe will + # return nothing; I guess it gives the pwd command time + # to get some data to read . . . + sleep(1); + my $curdir; + while () { + if (!$curdir) { + chomp($curdir = $_); + } + } + my $code = close(PWDCMD); +# if ($code || $?) { +# print "$command returned code=$code status=$? dir=$curdir\n"; +# } +# print "getCwd curdir=\[$curdir\]\n"; + return $curdir; +} + +############################################################################# +############################################################################# +############################################################################# diff --git a/ldap/admin/src/migrateLocalDB b/ldap/admin/src/migrateLocalDB new file mode 100644 index 00000000..3dfeb106 --- /dev/null +++ b/ldap/admin/src/migrateLocalDB @@ -0,0 +1,265 @@ +#!perl +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# + +# Migrate a SuiteSpot 2.X or 3.X localdb to a 4.0 directory server + +BEGIN { + $isNT = -d '\\'; + $PATHSEP = $isNT ? "\\" : "/"; + @INC = ( '.', '../../../admin/admin/bin' ); + grep { s@/@\\@g } @INC if $isNT; + $script_suffix = $isNT ? ".bat" : ""; + $exe_suffix = $isNT ? ".exe" : ""; + # NT needs quotes around some things unix doesn't + $quote = $isNT ? "\"" : ""; +} + +sub getNextEntry { + my $fh = shift; + my @entry = (); # an array of strings, each string is 1 attr/value pair + my $line = ""; + while (($line = <$fh>) && !($line =~ /^$/)) { # entry is terminated by EOF or empty line34 + chop $line; + if ($line =~ /^\s/) { # line begins with a single space char + $entry[@entry-1] .= $'; # add continuation to line + } else { + push @entry, $line; + } + } + return @entry; +} + +# given a string of the form string:value, return everything to the left of the : +sub getAttrName { + my $s = shift; + $s =~ s/[:].*$//; + return $s; +} + +sub printEntry { + my $fh = shift; + foreach (@_) { + print $fh $_, "\n"; + } + print $fh "\n"; +} + +sub usage { + print 'Usage: perl migrateLocalDb []', "\n"; + print "\t", ' - full path to the userdb directory to migrate', "\n"; + print "\t", ' e.g. /usr/netscape/suitespot3/userdb', "\n"; + print "\t", ' - new suffix e.g. dc=example,dc=com; may be empty', "\n"; + print "\t", ' - full path to the destination instance', "\n"; + print "\t", ' e.g. /usr/netscape/server4/slapd-foo', "\n"; + print "The new instance is optional. If not given, the local db will\n"; + print "be converted to the LDIF file userdb/localdb.ldif, but\n"; + print "it will not be added to the database of the new instance.\n"; +} + +sub sigDieHandler { + print @_, "\n"; + print "\n"; + &usage(); + print "\n"; + print "NMC_STATUS: ", 0+$!, "\n"; + exit $!; +} + +$SIG{__DIE__} = 'sigDieHandler'; + +# check for command line arguments +if (@ARGV > 0) { + $localDBPath = $ARGV[0]; + $newSuffix = $ARGV[1]; + $instanceDir = $ARGV[2]; + $bindDN = $ARGV[3]; + $bindPwd = $ARGV[4]; + # the perl executable should be in server root/install/ + $relPath = '/install/'; + $relPath =~ s#/#\\#g if ($isNT); + ($sroot = $) =~ s#$relPath.*$##; +} elsif ($ENV{'REQUEST_METHOD'}) { + $| = 1; + # print CGI header + print "Content-type: text/plain\n\n"; + + # process the CGI input + use Cgi; + + # get the server root directory + $sroot = $ENV{'NETSITE_ROOT'}; + + $localDBPath = $cgiVars{'localDBPath'}; + $newSuffix = $cgiVars{'newSuffix'}; + $instanceDir = $cgiVars{'instanceDir'}; + $bindDN = $cgiVars{'bindDN'}; + $bindPwd = $cgiVars{'bindPwd'}; +} else { + die ""; +} + +# this is a table of attributes which have DN syntax +%dnAttrs = ( + 'aliasedobjectname', "\n", + 'member', "\n", + 'owner', "\n", + 'roleoccupant', "\n", + 'seealso', "\n", + 'dn', "\n", + 'uniquemember', "\n", + 'creatorsname', "\n", + 'modifiersname', "\n", + 'manager', "\n", + 'documentauthor', "\n", + 'secretary', "\n", + 'associatedname', "\n", + 'ditredirect', "\n", + 'targetdn', "\n", + 'newrdn', "\n", + 'newsuperior', "\n", + 'lastmodifiedby', "\n", + 'replicaroot', "\n", + 'replicabinddn', "\n", + 'cirreplicaroot', "\n", + 'cirbinddn', "\n", + 'vlvbase', "\n", + 'netscapemdsuffix', "\n", + 'changelog', "\n", + 'obsoletedbydocument', "\n", + 'obsoletesdocument', "\n", + 'reciprocalnaminglink', "\n", + 'updatedbydocument', "\n", + 'updatesdocument', "\n" +); + +print "Begin local db migration\n"; + +# see if the parameters are valid +# check localdb path +die "Error: could not find the local db $localDBPath" if (! -d $localDBPath); +# check suffix? + +# get the old server root directory +# step 1: convert the local db to an ldif file +# lookup the old suffix from the lcache.conf +$lcache = $localDBPath . $PATHSEP . 'ldap' . $PATHSEP . 'config' . $PATHSEP . + 'lcache.conf'; +open(LCACHE, "$lcache") or die "Error: could not open config file $lcache"; +while () { + chop; + if (/^suffix\s+/i) { + $oldSuffix = $'; + $oldSuffix =~ s/^[\"]//; + # trim leading " + $oldSuffix =~ s/[\"]$//; + # trim trailing " + print "The old suffix is $oldSuffix\n"; + } +} +close(LCACHE); + +print "Converting the local db to LDIF . . .\n"; +# run the ldapsearch -C command +$cmddir = $localDBPath . $PATHSEP . 'ldap' . $PATHSEP . 'tools'; +@cmd = ($quote . $cmddir . $PATHSEP . 'ldapsearch' . $quote, '-C', + "${quote}$lcache${quote}", + '-s', 'sub', '-b', "\"$oldSuffix\"", '"objectclass=*"'); +chdir($cmddir) or die "Error: could not change to directory $cmddir"; +open(READCMD, "${quote}@cmd${quote}|") or die "Error: could not execute @cmd"; +if ($instanceDir) { + $outputFile = $instanceDir . $PATHSEP . 'ldif' . $PATHSEP . 'localdb.ldif'; +} else { + $outputFile = $localDBPath . $PATHSEP . 'localdb.ldif'; +} + +open(OUT, ">$outputFile") or die "Error: could not write file $outputFile"; +while (@entry = getNextEntry(\*READCMD)) { + # for each entry, replace the old suffix with the new one; if there + # was no old suffix, just append the new one to the DN value attrs + if ($newSuffix && $newSuffix ne '""') { + if ($oldSuffix && $oldSuffix ne '""') { + grep { s/$oldSuffix/$newSuffix/ig } @entry; + } else { + for ($ii = 0; $ii < @entry; ++$ii) { + $name = &getAttrName($entry[$ii]); + if ($dnAttrs{lc($name)}) { + $entry[$ii] .= ", $newSuffix"; + } + } + } + } + + printEntry(\*OUT, @entry); +} +close(READCMD); +close(OUT); + +if ($? != 0) { + die "Error: could not read local db from $localDBPath"; +} elsif (! -s $outputFile) { + die "Error: converted local db is empty"; +} + +# check instance dir + +if ($instanceDir) { + if (! -d $instanceDir) { + # use may have given relative path + $instanceDir = $sroot . $PATHSEP . $instanceDir; + die "Error: could not find the instance dir $instanceDir in server root $sroot" + if (! -d $instanceDir); + } + +# step 2: load the converted LDIF file into the target directory server +# if the bindDN and password were given, attempt to use ldif2ldap, otherwise, +# shutdown the server and use ldif2db + + if ($bindDN && $bindPwd) { + } else { + print "Shutting down the server . . .\n"; + # shutdown the server + $stopCmd = $quote . $instanceDir . $PATHSEP . 'stop-slapd' . $script_suffix . $quote; + system($stopCmd); + print "Warning: could not shutdown the server in $instanceDir.\nThe server may already be down." if ($? != 0); + sleep(10); # give the server time to shutdown + + # add the new suffix to the slapd.ldbm.conf + if ($newSuffix && $newSuffix ne '""') { + print "Adding suffix $newSuffix . . .\n"; + $slc = $instanceDir . $PATHSEP . 'config' . $PATHSEP . 'slapd.ldbm.conf'; + open(SLC, ">>$slc") or + print "Warning: could not add the suffix $newSuffix: import may fail.\n"; + print SLC "suffix\t\"$newSuffix\"\n"; + close(SLC); + } + + print "Importing the local db LDIF file . . .\n"; + # import the LDIF file + @impCmd = ($quote . $instanceDir . $PATHSEP . 'ldif2db' . $quote, + '-C', '-i', "${quote}$outputFile${quote}"); + system(@impCmd); + die "Error: could not import LDIF file $outputFile" if ($? != 0); + + print "Restarting the server . . .\n"; + # start the server + $startCmd = $quote . $instanceDir . $PATHSEP . 'start-slapd' . $script_suffix . $quote; + system($startCmd); + print "Warning: could not restart the server in $instanceDir" if ($? != 0); + } + + print "Finished. The local db has been imported to $instanceDir.\n"; +} else { + print "Finished. The local db has been written to $outputFile.\n"; +} + +if (%cgiVars) { + print "NMC_STATUS: 0\n"; +} + +exit 0; diff --git a/ldap/admin/src/migratePwdFile b/ldap/admin/src/migratePwdFile new file mode 100644 index 00000000..45b90629 --- /dev/null +++ b/ldap/admin/src/migratePwdFile @@ -0,0 +1,90 @@ +#!perl +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# +# Convert an old password.txt file into the new pin.txt format +# This script requires a single argument which is the directory and +# server instance prefix of the two files (e.g. /servers/alias/slapd-foo) +# +# ISSUES: +# This code sets the mode of the created file to 660 (allows suitespot +# group access. Should it also set the user and group values? Where +# should they come from? +# +BEGIN { + $isNT = -d "\\"; + $PS = $isNT ? "\\" : "/"; +} + +$sroot = $ARGV[0]; +$prefix = $ARGV[1]; + +# +# create the names for the old (password) and new (pin) files +# +$pwdfile = "${prefix}-password.txt"; +$pinfile = "${prefix}-pin.txt"; + +if (-f $pwdfile && ! -f $pinfile) { + open(PWDFILE, $pwdfile) || die "Cannot open password file: $pwdfile\n"; + + my $count = 0; + my $pin; + while() { + chomp; # trim new line + + if ($count == 0) { + $pin = $_; + } + + $count = $count+1; + } + close PWDFILE; + + if ($count == 0) { + die "No password found in password file\n"; + } elsif ($count != 1) { + print "Extra lines found in password file\n"; + } + + open(PINFILE, ">$pinfile") || die "Cannot create pin file: $pinfile\n"; + print PINFILE "Software (Internal) Token:$pin\n"; + close PINFILE; + chmod 0660, $pinfile; + + # set the ownership of the file; should be the same as the slapd user id + if (! $isNT) { + $confFile = "$sroot${PS}$prefix${PS}config${PS}slapd.conf"; + open(CONF, $confFile) or die "Error: cannot open $confFile: $!"; + while () { + if (/^localuser\s+/i) { + chomp($newuser = $'); + last; + } + } + close(CONF); + if (!$newuser) { + $confFile = "$sroot${PS}shared${PS}config${PS}ssusers.conf"; + open(SSUSERS, $confFile) or + die "Error: could not open $confFile: $!"; + while () { + chop; + if (/^SuiteSpotUser\s+/i) { + $newuser = $'; + last; + } + } + close(SSUSERS); + } + if ($newuser) { + chown $newuser, $pinfile; + } + } +} + +exit 0; diff --git a/ldap/admin/src/migrateTo4 b/ldap/admin/src/migrateTo4 new file mode 100644 index 00000000..862bfff2 --- /dev/null +++ b/ldap/admin/src/migrateTo4 @@ -0,0 +1,1581 @@ +#!perl +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# + +BEGIN { + require 'uname.lib'; + $isNT = -d '\\'; + @INC = ( '.', '../../../admin/admin/bin' ); + grep { s@/@\\@g } @INC if $isNT; + $PATHSEP = $isNT ? '\\' : '/'; + # NT needs quotes around some things unix doesn't + $quote = $isNT ? "\"" : ""; + + # If this variable is set, all file/directory creation will make sure the mode + # and ownership of the destination is the same as the source + $PRESERVE = 1 if (!$isNT); + $script_suffix = $isNT ? ".bat" : ""; + $exe_suffix = $isNT ? ".exe" : ""; + if ($isNT) { + $os = "WINNT"; + } else { + $os = &uname("-s"); + } + + if ($isNT) { + # we have to pass batch files directly to the NT command interpreter + $com_spec = $ENV{ComSpec}; + if (!$com_spec) { + $com_spec = $ENV{COMSPEC}; + } + if (!$com_spec || ! -f $com_spec) { + # find the first available command interpreter + foreach $drive (c..z) { + $com_spec = "$drive:\\winnt\\system32\\cmd.exe"; + last if (-f $com_spec); + $com_spec = undef; + } + if (! $com_spec) { + # punt and pray + $com_spec = 'c:\winnt\system32\cmd.exe'; + } + } + } + + # dll suffix for shared libraries in old instance; note that the dll suffix + # may have changed for the new instance e.g. AIX now uses .so + if ( $os eq "AIX" ) { + $dll_suffix = "_shr.a"; + } + elsif ( $os eq "HP-UX" ) { + $dll_suffix = ".sl"; + } + elsif ( $os eq "WINNT" ) { + $dll_suffix = ".dll"; + } + else { + $dll_suffix = ".so"; + } + $slapdExecName = $isNT ? 'slapd.exe' : 'ns-slapd'; + # if this flag is set, we will migrate the 3.0 and 3.1 databases + # by doing a db2ldif -> ldif2db; if this is not set, we will just + # copy the directories; right now, we cannot copy the directories, + # because the database format has changed for 4.0, and the new + # code does not recognize the old db format. It is hoped that it + # will by RTM . . . + $convertToLDIF = 1; + select STDERR; + $| = 1; + select STDOUT; + $| = 1; + + # if the old value for dbcachesize is less than this, make it this + $MIN_DBCACHESIZE = '500000'; +} + +sub getCwd { + my $command = $isNT ? "cd" : "/bin/pwd"; + open(PWDCMD, "$command 2>&1 |") or + die "Error: could not execute $command: $!"; + # without the following sleep, reading from the pipe will + # return nothing; I guess it gives the pwd command time + # to get some data to read . . . + sleep(1); + my $curdir; + while () { + if (!$curdir) { + chomp($curdir = $_); + } + } + my $code = close(PWDCMD); +# if ($code || $?) { +# print "$command returned code=$code status=$? dir=$curdir\n"; +# } +# print "getCwd curdir=\[$curdir\]\n"; + return $curdir; +} + +sub fixBinaryAttr { + my $foo = shift; + $foo =~ s/;binary//ig; + return $foo; +} + +$type = "slapd"; +$root = $ARGV[0]; +$oldDir = $ARGV[1]; +$newname = $ARGV[2]; +$oldname = $ARGV[3]; +$savedMDLdif = $ARGV[4]; +$savedLdif = $ARGV[5]; +$sieName = $ARGV[6]; +$secPwd = $ARGV[7]; + +if (($root =~ m#/$#) || ($root =~ m#\\$#)) { + chop $root; +} + +if (($oldDir =~ m#/$#) || ($oldDir =~ m#\\$#)) { + chop $oldDir; +} + +sub basename { + my @list = split(/[\\\/]/, $_[0]); + return $list[@list - 1]; +} + +# this is used to strip html formatting from output to user +sub localprint { + # arg 1 is string to print + # arg 2 is beginning html directive + # arg 3 is closing html directive + my ($str, $begin, $end) = @_; + print $str; +} + +# this is used to run the system() call, capture exit and signal codes, +# and die() upon badness; the first argument is a directory to change +# dir to, if any, and the rest are passed to system() +sub mySystem { + my $rc = &mySystemNoDie(@_); + my ($dir, @args) = @_; + if ($rc == 0) { +# success + } elsif ($rc == 0xff00) { + die "Error executing @args: error code $rc: $!"; + } elsif ($rc > 0x80) { + $rc >>= 8; + die "Error executing @args: error code $rc: $!"; + } else { + if ($rc & 0x80) { + $rc &= ~0x80; + } + die "Error executing @args: received signal $rc: $!"; + } + + # usually won't get return value + return $rc; +} + +# This version does not die but just returns the error code +sub mySystemNoDie { + my ($dir, @args) = @_; + if ($dir && ($dir ne "")) { + chdir($dir) or die "Could not change directory to $dir: $!"; + } + my $cmd = $args[0]; + # the system {$cmd} avoids some NT shell quoting problems if the $cmd + # needs to be quoted e.g. contains spaces; the map puts double quotes + # around the arguments on NT which are stripped by the command + # interpreter cmd.exe; but don't quote things which are already quoted + my @fixargs = map { /^[\"].*[\"]$/ ? $_ : $quote . $_ . $quote } @args; + my $rc = 0; + if ($cmd =~ /[.](bat|cmd)$/) { + # we have to pass batch files directly to the NT command interpreter + $cmd = $com_spec; +# print "system $cmd /c \"@fixargs\"\n"; + $rc = 0xffff & system {$cmd} '/c', "\"@fixargs\""; + } else { +# print "system $cmd @fixargs\n"; + $rc = 0xffff & system {$cmd} @fixargs; + } + return $rc; +} + +$serverHome = "$root${PATHSEP}$type-$newname"; + +$oldHome = "$oldDir${PATHSEP}slapd-$oldname"; + +# these are the default values used by the 4.0 installer +$DEFAULT_CHANGELOG_DIR = $serverHome . $PATHSEP . 'logs' . $PATHSEP . 'changelogdb'; +$DEFAULT_CHANGELOG_SUFFIX = "cn=changelog"; + +# get some information from the new slapd.conf file +open(INPUT, "$serverHome${PATHSEP}config${PATHSEP}slapd.conf") or + die "Could not open file $serverHome${PATHSEP}config${PATHSEP}slapd.conf"; +while () { + if (/^port\s+/i) { chomp($newport = $'); } + elsif (/^localhost\s+/i) { chomp($newlocalhost = $'); } + elsif (/^localuser\s+/i) { chomp($newuser = $'); } +} +close INPUT; + +# get some information from the new slapd.ldbm.conf file +open(INPUT, "$serverHome${PATHSEP}config${PATHSEP}slapd.ldbm.conf") or + die "Could not open file $serverHome${PATHSEP}config${PATHSEP}slapd.ldbm.conf"; +while () { + if (/^directory\s+[\"]?(.*?)[\"]?\s*$/i) { + # " + $newDbDir = $1; + # paths are stored in unix format in the config files . . . + $newDbDir =~ s#/#\\#g if ($isNT); + } +} +close INPUT; + +# get some information from the old slapd.conf file +open(INPUT, "$oldHome${PATHSEP}config${PATHSEP}slapd.conf") or + die "Could not open file $oldHome${PATHSEP}config${PATHSEP}slapd.conf"; +while () { + if (/^changelogdir\s+[\"]?(.*?)[\"]?\s*$/i) { + # " + $oldChangeLogDir = $1; + # paths are stored in unix format in the config files . . . + $oldChangeLogDir =~ s#/#\\#g if ($isNT); + } + elsif (/^changelogsuffix\s+[\"]?(.*?)[\"]?\s*$/i) { + # " + $oldChangeLogSuffix = $1; + } + elsif (/^directory\s+[\"]?(.*?)[\"]?\s*$/i) { + # " + $oldDbDir = $1; + # paths are stored in unix format in the config files . . . + $oldDbDir =~ s#/#\\#g if ($isNT); + } + elsif (/^localuser\s+/i) { chomp($olduser = $'); } + elsif (/^encryption-alias\s+/i) { chomp($encryption_alias = $'); } + # the user may have given us a network mounted old home directory, but in the + # old instance's config files, the root directory referred to is usually + # a local directory. For example, suppose there is an automounter map for + # hosts which maps onto /h e.g. /h/oldhost would contain all directories + # exported via NFS. Similarly, for NT, you could do \\oldhost\c to look + # at the C: drive on the old host. Or the user may have network mounted + # the old server root some other way. Anyway, we need to determine what + # the old server root was local to the original host because that is what + # will be referred to it the old config files. So, we look at the errorlog + # directive in slapd.conf and use whatever comes before the slapd-oldname + elsif (/^errorlog\s+[\"]?(.*)$type-$oldname/i) { + # there may be leading " + chop($realOldDir = $1); + } +} +close INPUT; + +if (! $realOldDir) { + $realOldDir = $oldDir; +} + +$realOldHome = $realOldDir . $PATHSEP . $type . '-' . $oldname; + +# the oldDbDir is stored as a local dir, but we may need a network dir +($networkDbDir = $oldDbDir) =~ s/^$realOldDir/$oldDir/ig; + +# list of standard plugins configured out of the box in version 3 +# all of these paths are in unix format . . . +$oldLibDir = lc("$realOldDir/lib/"); +$oldConfDir = lc("$realOldHome/config/"); +$oldLogsDir = lc("$realOldHome/logs/"); +$oldLibDir =~ s#\\#/#g if ($isNT); +$oldConfDir =~ s#\\#/#g if ($isNT); +$oldLogsDir =~ s#\\#/#g if ($isNT); + +# note that all of these should be lower case, since NT does not distinguish case +# and we don't really care about case for plugin directives anyway . . . +%stdPlugins = ( + "plugin syntax \"${oldLibDir}syntax-plugin${dll_suffix}\" cis_init", "\n", + "plugin syntax \"${oldLibDir}syntax-plugin${dll_suffix}\" ces_init", "\n", + "plugin syntax \"${oldLibDir}syntax-plugin${dll_suffix}\" bin_init", "\n", + "plugin syntax \"${oldLibDir}syntax-plugin${dll_suffix}\" tel_init", "\n", + "plugin syntax \"${oldLibDir}syntax-plugin${dll_suffix}\" int_init", "\n", + "plugin syntax \"${oldLibDir}syntax-plugin${dll_suffix}\" dn_init", "\n", + "plugin matchingrule \"${oldLibDir}liblcoll${dll_suffix}\" orderingrule_init ${quote}${oldConfDir}slapd-collations.conf$quote", "\n", + "plugin database \"${oldLibDir}libback-ldbm${dll_suffix}\" ldbm_back_init", "\n", + "plugin postoperation ${quote}${oldLibDir}referint-plugin${dll_suffix}${quote} referint_postop_init 0 ${quote}${oldLogsDir}referint${quote} member uniquemember owner seealso", "\n", + "plugin postoperation ${quote}${oldLibDir}referint-plugin${dll_suffix}${quote} referint_postop_init 0 ${quote}${oldLogsDir}referint${quote} 0 member uniquemember owner seealso", "\n", + "plugin preoperation ${quote}${oldLibDir}libntsynch${dll_suffix}${quote} libntsynch_plugin_preop_init", "\n", + "plugin postoperation ${quote}${oldLibDir}libntsynch${dll_suffix}${quote} libntsynch_plugin_postop_init", "\n" +); + +# list of standard indexes configured out of the box in version 3 +%stdIndex = ( + 'index aci pres', "\n", + 'index cn pres,eq,sub', "\n", + 'index sn pres,eq,sub', "\n", + 'index givenName pres,eq,sub', "\n", + 'index mail pres,eq,sub', "\n", + 'index telephoneNumber pres,eq,sub', "\n", + 'index ntUserDomainId pres,eq,sub', "\n", + 'index uid eq', "\n", + 'index changenumber eq', "\n", + 'index uniquemember eq', "\n", + 'index member eq', "\n", + 'index owner eq', "\n", + 'index seeAlso eq', "\n" +); + +# These are files included into slapd.conf, slapd.dynamic-ldbm.conf and +# slapd.ldbm.conf by default in earlier releases. We use this hash to +# determine if there are user defined files which have been included +# into the slapd.conf e.g. for user defined attributes, object classes, +# indexes, etc. +%stdIncludes = ( + "${oldConfDir}slapd.at.conf", "\n", + "${oldConfDir}slapd.oc.conf", "\n", + "${oldConfDir}ns-schema.conf", "\n", + "${oldConfDir}ns-globopt.conf", "\n", +); + + +# list of parameters that we don't care about; these are usually just parameters +# which hold paths relative to this instance and server root, which change anyway +%oldParametersToSkip = ( + 'userat', "\n", # use the new one + 'useroc', "\n", # use the new one + 'instancedir', "\n", # must be the new one + 'dynamicconf', "\n", # use the new one + 'directory', "\n", # use the new one + 'access', "\n", # obsolete + 'defaultaccess', "\n", # obsolete + 'security-path', "\n", # obsolete + 'localuser', "\n", # use the newly configured suitespot user + 'port', "\n", # the new port must already be set either as determined from + # the old config or because we are migrating into the MC + # instance and cannot change the port number + 'rootdn', "\n", # the new rootdn must already be set either as determined from + # the old config or because we are migrating into the MC + # instance and cannot change it + 'rootpw', "\n", # the new rootpw must already be set either as determined from + # the old config or because we are migrating into the MC + # instance and cannot change it +); + +# list of old ldbm specific parameters. These parameters may be present in the +# old slapd.conf, but have been moved to the new slapd.ldbm.conf +%oldLdbmParameters = ( + 'database', "\n", + 'lookthroughlimit', "\n", + 'mode', "\n", + 'cachesize', "\n", + 'dbcachesize', "\n", + 'allidsthreshold', "\n", + 'parentcheck', "\n", +); + +# list of old slapd.conf parameters which have been moved to the new dse.ldif +%oldDSEParameters = ( + 'encryption-alias', "\n", + 'sslclientauth', "\n" +); + +($oldversion,$oldminor) = &getVersion($oldDir); +($newversion,$newminor) = &getVersion($root); + +# if there was no old user specified +if (! $isNT && ! $olduser) { + # get the olduid and oldgid from doing a stat of the db directory + ($olduid, $oldgid) = (stat($networkDbDir))[4..5]; +} +# convert the user names to numeric uids +if ($PRESERVE) { + if (! $olduid && $olduser) { + ($login,$pass,$olduid,$oldgid) = getpwnam($olduser); + } + ($login,$pass,$newuid,$newgid) = getpwnam($newuser); +} + +# copy the old config files +©Dir("$oldHome${PATHSEP}config", "$serverHome${PATHSEP}migrate_config"); + +print "Migrating log files . . .\n"; +# copy the log files +$srcdir = "$oldHome${PATHSEP}logs"; +opendir(LOGDIR, $srcdir) or + die "Error: could not open log file dir $srcdir : $!"; +foreach (readdir(LOGDIR)) { + if (! /[.][.]?/ && -f "$srcdir${PATHSEP}$_") { + ©BinFile("$srcdir${PATHSEP}$_", + "$serverHome${PATHSEP}logs${PATHSEP}${_}.migrate"); + } +} +closedir(LOGDIR); + +# copy the ssl directory +©Dir("$oldHome${PATHSEP}ssl", "$serverHome${PATHSEP}ssl"); + +# copy the cert db and key files +if ( -d "$oldDir${PATHSEP}alias" && $encryption_alias ) { + $aliasDir = "$root${PATHSEP}alias"; + if (! -d $aliasDir) { + mkdir($aliasDir, 0750); + } + $adminDir = $root . $PATHSEP . 'bin' . $PATHSEP . 'admin' . $PATHSEP . + 'admin' . $PATHSEP . 'bin'; + print "Migrating the key and certificate databases . . .\n"; + mySystem($adminDir, $adminDir . $PATHSEP . 'sec-migrate', + $oldDir, $encryption_alias, $root, $sieName, $secPwd); + # copy the old password file + if (-f "$oldDir${PATHSEP}alias${PATHSEP}$encryption_alias-password.txt") { + ©BinFile( + "$oldDir${PATHSEP}alias${PATHSEP}$encryption_alias-password.txt", + "$aliasDir${PATHSEP}$type-$newname-password.txt" + ); + if ($newversion >= 4 && $newminor >= 1) { + # need to convert the old format to new pin format + print "Converting password file to new pin format . . .\n"; + $script = "$root${PATHSEP}bin${PATHSEP}slapd${PATHSEP}admin${PATHSEP}bin${PATHSEP}migratePwdFile"; + mySystem($aliasDir, $, $script, $root, "$type-$newname"); + } + } + + # get the new key/cert db filenames + opendir(CERTDIR, $aliasDir) or + die "Error: could not open cert dir $aliasDir: $!"; + foreach (readdir(CERTDIR)) { + if (/^$sieName/i) { + if (/[-]cert/) { + $newcertdb = $_; + } elsif (/[-]key/) { + $newkeydb = $_; + } + } + } + closedir(CERTDIR); +} + +$needAclUpg = 0; +if ($oldversion == 1) { + $needAclUpg = 1; + $convertToLDIF = 1; # always need this for conversion from 1.X db +} + +# Copy/Convert ldif files in ldif/ +print "Migrating old LDIF files . . .\n"; +©Ldif; + +if ($convertToLDIF) { + # Converting database + print "Migrating database to LDIF . . .\n"; + $oldLdif = "$oldHome${PATHSEP}ldif${PATHSEP}old.ldif"; + &db2ldif($networkDbDir, $oldLdif); + if ($needAclUpg) { + print "Converting ACLs in old data . . .\n"; + &mySystem("$root${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server", + "$root${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${PATHSEP}" . + "aclupg$exe_suffix", '-d', '-i', + $oldLdif, '-o', + "$oldHome${PATHSEP}ldif${PATHSEP}aclupg.ldif"); + unlink($oldLdif); + rename("$oldHome${PATHSEP}ldif${PATHSEP}aclupg.ldif", $oldLdif); + } + chown $newuid, $newgid, $oldLdif if (!$isNT); +# copy the changelogdb directory +# how to handle a 1.0 change log? +# ©Dir($changelogdir, "$serverHome${PATHSEP}changelogdb") if ($changelogdir); +} + +# Compare each configuration file against its default version. If it has changed, +# notify the user that the file has changed and will need to be checked by the +# user. This should be safe to do because there should be no path information +# stored in these conf files, which are just schema stuff. +print "Migrating configuration files . . .\n"; +$origFilePath = "$root${PATHSEP}bin${PATHSEP}slapd${PATHSEP}install${PATHSEP}version${oldversion}"; +$srcdir = "$serverHome${PATHSEP}migrate_config"; +opendir(CONFDIR, $srcdir) or + die "Error: could not open migrated config dir $srcdir: $!"; +foreach $file (readdir(CONFDIR)) { + $origFile = $origFilePath . $file; + if (-f $origFile) { + $diffs = &diff("$srcdir${PATHSEP}$file", $origFile); + if ($diffs) { + print "File $srcdir${PATHSEP}$file could not be migrated\n"; + print "because it is different than\n"; + print "the standard installed version. You will need to check this\n"; + print "file and make sure its changes are compatible with the new\n"; + print "directory server. Here are the differences:\n"; + print $diffs, "\n"; + } else { +# print "No changes to old config file $srcdir${PATHSEP}$file\n"; + } + } +} +closedir(CONFDIR); + +# make a backup of the current user_at and user_oc files, and copy the old ones +# into the config directory + +©BinFile("$serverHome${PATHSEP}config${PATHSEP}slapd.user_at.conf", + "$serverHome${PATHSEP}config${PATHSEP}slapd.user_at.conf.bak"); +©BinFile("$serverHome${PATHSEP}config${PATHSEP}slapd.user_oc.conf", + "$serverHome${PATHSEP}config${PATHSEP}slapd.user_oc.conf.bak"); + +if (-f "$serverHome${PATHSEP}migrate_config${PATHSEP}slapd.user_at.conf") { + ©AndEditTextFile( + "$serverHome${PATHSEP}migrate_config${PATHSEP}slapd.user_at.conf", + "$serverHome${PATHSEP}config${PATHSEP}slapd.user_at.conf", + \&fixBinaryAttr); +} + +if (-f "$serverHome${PATHSEP}migrate_config${PATHSEP}slapd.user_oc.conf") { + ©AndEditTextFile( + "$serverHome${PATHSEP}migrate_config${PATHSEP}slapd.user_oc.conf", + "$serverHome${PATHSEP}config${PATHSEP}slapd.user_oc.conf", + \&fixBinaryAttr); +} + +# parse the parameters from the old configuration files and put them into +# the new configuration files +&fixConf("$serverHome${PATHSEP}migrate_config${PATHSEP}slapd.conf", + "$serverHome${PATHSEP}migrate_config${PATHSEP}slapd.dynamic_ldbm.conf", + "$serverHome${PATHSEP}migrate_config${PATHSEP}dse.ldif", + "$serverHome${PATHSEP}config${PATHSEP}slapd.conf", + "$serverHome${PATHSEP}config${PATHSEP}slapd.ldbm.conf", + "$serverHome${PATHSEP}config${PATHSEP}dse.ldif"); + +# copy in old data and any data we wanted to save +if ($convertToLDIF) { + print "Migrating old database to new database . . .\n"; + &manyLdif2db($savedMDLdif, $oldLdif, $savedLdif); + unlink $savedMDLdif, $savedLdif; +} + +if ($oldChangeLogDir && -e $oldChangeLogDir) { + print "Migrating changelog database . . .\n"; + my $realDir = $oldChangeLogDir; + $realDir =~ s/^$realOldDir/$oldDir/ig; + if ($convertToLDIF) { + $srcDir = $realDir; + $destDir = $DEFAULT_CHANGELOG_DIR; + $srcLDIF = "$oldHome${PATHSEP}ldif${PATHSEP}changelog.ldif"; + $destLDIF = "$serverHome${PATHSEP}ldif${PATHSEP}changelog.ldif"; + mkdir( $destDir , 0755 ) if !( -e $destDir); + # Converting database + if ( !$isNT && $newuser ) { + chown($newuid, $newgid, $destDir); + } + &other_db2ldif($srcDir, $srcLDIF); + if ($needAclUpg) { + &mySystem("$root${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server", + "$root${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server" . + "${PATHSEP}aclupg$exe_suffix", '-d', '-i', + $srcLDIF, '-o', $destLDIF); + } else { + ©BinFile($srcLDIF, $destLDIF); + } + &other_ldif2db($destLDIF, $destDir, 'slapd.ldbm.conf', + "suffix \"$oldChangeLogSuffix\""); + } else { + # the dir is stored as a local dir, but we may need a network dir here + ©Dir($realDir, $DEFAULT_CHANGELOG_DIR, '\.share$'); + } +} + +if ($convertToLDIF) { + # Convert the db backup, bak/ + print "Migrating database backups . . .\n"; + ©Bak; +} else { + # just copy the directories over + ©Dir($networkDbDir, "$serverHome${PATHSEP}db", '\.share$'); + ©Dir("$oldHome${PATHSEP}bak", "$serverHome${PATHSEP}bak", '\.share$'); +} + +if (-f $oldLdif) { + unlink($oldLdif); +} + +exit(0); + +############# END OF PROCESSING; SUBROUTINES FOLLOW + +# This subroutine merges the old and new source files into the new destination file +sub fixConf { + my $oldsrc = shift; + my $oldldbmsrc = shift; + my $olddseldif = shift; + my $newsrc = shift; + my $newldbmsrc = shift; + my $newdseldif = shift; + + # read the old conf file into a hash table + open( OLDSRC, $oldsrc ) || + die "Can't open $oldsrc: $!: "; + LINE: while ( ) { + if (/^\s*#/) { # skip comments + next LINE; + } + if (/^\s*$/) { # skip blank lines + next LINE; + } elsif (/^plugin/i) { + chomp($_); + if (! &isAStandardPlugin($_)) { + push @badPlugins, $_; + } + } elsif (/^index/i) { + chomp($_); + if (! &isAStandardIndex($_)) { + push @newIndex, $_; + } + } elsif (/^include\s+[\"]?(.*?)[\"]?\s*$/i) { + # strip leading and trailing " + if (! &isAStandardInclude($1)) { + push @newInclude, $1; + } + } elsif (/^dbcachesize\s+[\"]?(.*?)[\"]?\s*$/i) { + # strip leading and trailing " + $param = 'dbcachesize'; + $value = $1; + if ($value < $MIN_DBCACHESIZE) { + $value = $MIN_DBCACHESIZE; + } + + if ($oldLdbmParameters{lc($param)}) { + $oldldbmhash{lc($param)} = $value; + } else { + $oldhash{lc($param)} = $value; + + } + } elsif (/^errorlog/i) { + $oldhash{'errorlog-logging-enabled'} = "on"; + } elsif (/^accesslog/i) { + $oldhash{'accesslog-logging-enabled'} = "on"; + } elsif (/^auditlog/i) { + $oldhash{'auditlog-logging-enabled'} = "on"; + } elsif (/^replogfile/i) { + # replogfile was only used in 1.X, and it had no suffix + $oldhash{'changelogdir'} = $DEFAULT_CHANGELOG_DIR; + $oldhash{'changelogsuffix'} = $DEFAULT_CHANGELOG_SUFFIX; + } elsif (/^changelogdir/i) { + # force use of default + $oldhash{'changelogdir'} = $DEFAULT_CHANGELOG_DIR; + } elsif (/^\s*(\S+)\s+[\"]?(.*?)[\"]?\s*$/i) { + # strip leading and trailing " + $param = $1; + $value = $2; + if ($oldParametersToSkip{lc($param)}) { + next LINE; + } elsif (lc($param) eq 'suffix') { + if (lc($value) cmp 'cn=schema') { + $oldsuffix{lc($value)} = $value; + } + } else { + if ($oldLdbmParameters{lc($param)}) { + $oldldbmhash{lc($param)} = $value; + } elsif ($oldDSEParameters{lc($param)}) { + if (lc($param) eq 'encryption-alias') { + if ($newcertdb) { + $olddsehash{'nscertfile'} = "alias/$newcertdb"; + } else { + $olddsehash{'nscertfile'} = "alias/$type-$newname-cert.db"; + } + if ($newkeydb) { + $olddsehash{'nskeyfile'} = "alias/$newkeydb"; + } else { + $olddsehash{'nskeyfile'} = "alias/$type-$newname-key.db"; + } + } elsif (lc($param) eq 'sslclientauth') { + $olddsehash{'nssslclientauth'} = $value; + } else { + $olddsehash{lc($param)} = $value; + } + } elsif (($param eq 'passwdhash') && + ((! $value) || ($value eq ""))) { + # 3.X used "" as an alias for "clear" + $oldhash{lc($param)} = 'clear'; + } else { + $oldhash{lc($param)} = $value; + } + } + } + } + close(OLDSRC); + + $oldhash{'errorlog-logging-enabled'} = "off" + if (! $oldhash{'errorlog-logging-enabled'}); + $oldhash{'accesslog-logging-enabled'} = "off" + if (! $oldhash{'accesslog-logging-enabled'}); + $oldhash{'auditlog-logging-enabled'} = "off" + if (! $oldhash{'auditlog-logging-enabled'}); + + # read the old ldbm conf file into a hash table; note that there may not be + # one, so don't complain + open( OLDSRC, $oldldbmsrc ); + LINE2: while ( ) { + if (/^\s*#/) { # skip comments + next LINE2; + } + if (/^\s*$/) { # skip blank lines + next LINE2; + } + if (/^index/i) { + chomp($_); + if (! &isAStandardIndex($_)) { + push @newIndex, $_; + } + next LINE2; + } + if (/^plugin/i) { + chomp($_); + if (! &isAStandardPlugin($_)) { + push @badLdbmPlugins, $_; + } + next LINE2; + } + if (/^include\s+/i) { + chomp($inc = $'); + $inc =~ s/\"//g; + # strip " characters + if (! &isAStandardInclude($inc)) { + push @newLdbmInclude, $inc; + } + next LINE2; + } + if (/^dbcachesize\s+[\"]?(.*?)[\"]?\s*$/i) { + # strip leading and trailing " + $param = 'dbcachesize'; + $value = $1; + if ($value < $MIN_DBCACHESIZE) { + $value = $MIN_DBCACHESIZE; + } + + $oldldbmhash{lc($param)} = $value; + next LINE2; + } + + if (/^\s*(\S+)\s+[\"]?(.*?)[\"]?\s*$/) { + # strip leading and trailing " + $param = $1; + $value = $2; + if ($oldParametersToSkip{lc($param)}) { + next LINE2; + } elsif (lc($param) eq 'suffix') { + if (lc($value) cmp 'cn=schema') { + $oldsuffix{lc($value)} = $value; + } + } else { + $oldldbmhash{lc($param)} = $value; + } + } + } + close(OLDSRC); + + # read the old dse.ldif file into a hash table; note that there may not be + # one, so don't complain + open(OLDSRC, $olddseldif); + while ( ) { + chomp($_); + if ( /^passwordchange:\s*/i ) { + if ($' eq "must") { + $oldhash{'pw_change'} = "on"; + $oldhash{'pw_must_change'} = "on"; + } elsif ($' eq "may") { + $oldhash{'pw_change'} = "on"; + $oldhash{'pw_must_change'} = "off"; + } else { + $oldhash{'pw_change'} = "off"; + $oldhash{'pw_must_change'} = "off"; + } + } elsif ( /^passwordchecksyntax:\s*/i ) { + if ($' > 0) { + $oldhash{'pw_syntax'} = "on"; + } else { + $oldhash{'pw_syntax'} = "off"; + } + } elsif ( /^passwordminlength:\s*/i ) { + $oldhash{'pw_minlength'} = $'; + } elsif ( /^passwordexp:\s*/i ) { + if ($' > 0) { + $oldhash{'pw_exp'} = "on"; + } else { + $oldhash{'pw_exp'} = "off"; + } + } elsif ( /^passwordmaxage:\s*/i ) { + $oldhash{'pw_maxage'} = $'; + } elsif ( /^passwordwarning:\s*/i ) { + $oldhash{'pw_warning'} = $'; + } elsif ( /^passwordkeephistory:\s*/i ) { + if ($' > 0) { + $oldhash{'pw_history'} = "on"; + } else { + $oldhash{'pw_history'} = "off"; + } + } elsif ( /^passwordinhistory:\s*/i ) { + $oldhash{'pw_inhistory'} = $'; + } elsif ( /^passwordlockoutduration:\s*/i ) { + $oldhash{'pw_lockduration'} = $'; + } elsif ( /^passwordlockout:\s*/i ) { + if ($' > 0) { + $oldhash{'pw_lockout'} = "on"; + } else { + $oldhash{'pw_lockout'} = "off"; + } + } elsif ( /^passwordmaxfailure:\s*/i ) { + $oldhash{'pw_maxfailure'} = $'; + } elsif ( /^passwordunlock:\s*/i ) { + if ($' > 0) { + $oldhash{'pw_unlock'} = "on"; + } else { + $oldhash{'pw_unlock'} = "off"; + } + } elsif ( /^passwordresetduration:\s*/i ) { + $oldhash{'pw_resetfailurecount'} = $'; + } + } + close(OLDSRC); + + open(NEWSRC, $newsrc ) || die "Can't open $newsrc: $!: "; + open(NEWDEST, ">$newsrc.tmp" ) || die "Can't create $newsrc.tmp: $!: "; + while ( ) { + # make sure the dynamicconf parameter is the last one in the file + if (/^dynamicconf/i) { + # print the parameters which exist in the old file but do not + # exist in the new file; these are the parameters we have not + # deleted from oldhash + print NEWDEST "#These additional parameters have been migrated\n"; + foreach $param (sort keys %oldhash) { + if (lc($param) eq 'passwdhash') { + $pwhash = $oldhash{lc($param)}; + # if the old value was not set, don't set the new value either + # just have the server use the default value + if ($pwhash && $pwhash ne "" && $pwhash ne '""') { + print NEWDEST 'pw_storagescheme', "\t", $pwhash, "\n"; + } + } elsif (lc($param) eq 'ntsynchusessl') { + print NEWDEST 'NTSynchUseSSL', "\t", $oldhash{lc($param)}, "\n"; + } else { + print NEWDEST $param, "\t", "\"$oldhash{lc($param)}\"", + "\n"; + } + } + print NEWDEST "#End of additional migrated parameters\n\n"; + # use the temp one for now until we have the real one in place, then + # we will change this back + print NEWDEST "dynamicconf\t\"$newldbmsrc.tmp\"\n"; + } elsif (/^\s*#/) { + print NEWDEST $_; + } elsif (/^include/ && @newInclude) { + my $newConfDir = $serverHome . '/' . 'config' . '/'; + $newConfDir =~ s#\\#/#g if ($isNT); + print NEWDEST "# These non standard includes were migrated:\n"; + print "These non standard includes were migrated:\n"; + while (@newInclude) { + my $oldPath = shift @newInclude; + # oldPath is a local path; we need a network path here because + # we will be copying the file + $oldPath =~ s/^$realOldDir/$oldDir/ig; + my $base = &basename($oldPath); + my $newone = $newConfDir . $base; + # convert to new path + print NEWDEST "include ", $quote, $newone, $quote, "\n"; + print $newone, "\n"; + # now, change path separators back to the correct ones for + # the os + $oldPath =~ s#/#\\#g if ($isNT); + $newone =~ s#/#\\#g if ($isNT); + ©AndEditTextFile($oldPath, $newone, \&fixBinaryAttr); + } + print NEWDEST "# end of migrated includes\n"; + print "Be sure to check the new slapd.conf file to make sure the order\n"; + print "is correct and there are no conflicts with new config files,\n"; + print "object classes, attributes, etc.\n"; + print NEWDEST $_; + } elsif (/^\s*(\S+)\s+[\"]?(.*?)[\"]?\s*$/) { + $param = $1; + $value = $2; + # see if the parameter is set in the old config file + if ($oldhash{lc($param)}) { + # only set the parameter if the old value is different than + # the new value + if ($value cmp $oldhash{lc($param)}) { + print NEWDEST "#This parameter was migrated: the original value was $value\n"; + print NEWDEST $param, "\t", "\"$oldhash{lc($param)}\"", "\n"; + } else { + print NEWDEST $_; + } + delete $oldhash{lc($param)}; + } else { + # just print the parameter + print NEWDEST $_; + } + } else { + print NEWDEST $_; + } + } + close (NEWSRC); + + # print the bad plugins, commented out, at the end of the file + if (@badPlugins) { + print NEWDEST "#The following non standard plugins were detected:\n"; + print "The following non standard plugins were detected:\n"; + foreach (@badPlugins) { + print NEWDEST "#", $_, "\n"; + print $_, "\n"; + } + print NEWDEST "#These plugins will probably need to be recompiled for this release\n"; + print "These plugins will probably need to be recompiled for this release\n"; + print NEWDEST "#of directory server, or at the very least, reconfigured.\n"; + print "of directory server, or at the very least, reconfigured.\n"; + } + + close( NEWDEST ); + + open(NEWSRC, $newldbmsrc ) || die "Can't open $newldbmsrc: $!: "; + open(NEWDEST, ">$newldbmsrc.tmp" ) || die "Can't create $newldbmsrc.tmp: $!: "; + while ( ) { + if (/^\s*#/) { + print NEWDEST $_; + } elsif (/^include/ && @newLdbmInclude) { + my $newConfDir = $serverHome . '/' . 'config' . '/'; + $newConfDir =~ s#\\#/#g if ($isNT); + print NEWDEST "# These non standard ldbm includes were migrated:\n"; + print "These non standard includes were migrated:\n"; + while (@newLdbmInclude) { + my $oldPath = shift @newInclude; + # oldPath is a local path; we need a network path here because + # we will be copying the file + $oldPath =~ s/^$realOldDir/$oldDir/ig; + my $base = &basename($oldPath); + my $newone = $newConfDir . $base; + # convert to new path + print NEWDEST "include ", $quote, $newone, $quote, "\n"; + print $newone, "\n"; + # now, change path separators back to the correct ones for + # the os + $oldPath =~ s#/#\\#g if ($isNT); + $newone =~ s#/#\\#g if ($isNT); + ©BinFile($oldPath, $newone); + } + print NEWDEST "# end of migrated includes\n"; + print "Be sure to check the new slapd.ldbm.conf file to make sure the order\n"; + print "is correct and there are no conflicts with new config files,\n"; + print "object classes, attributes, etc.\n"; + print NEWDEST $_; + } elsif (/^\s*(\S+)\s+[\"]?(.*?)[\"]?\s*$/) { + # strip " characters + $param = $1; + $value = $2; + if (lc($param) eq 'suffix') { + if ($oldsuffix{lc($value)}) { + delete $oldsuffix{lc($value)}; + } + print NEWDEST $_; + } elsif ($oldhash{lc($param)}) { + # only set the parameter if the old value is different than + # the new value + if ($value cmp $oldhash{lc($param)}) { + print NEWDEST "#This parameter was migrated: the original value was $value\n"; + print NEWDEST $param, "\t", "\"$oldhash{lc($param)}\"", "\n"; + } else { + print NEWDEST $_; + } + delete $oldhash{lc($param)}; + } elsif ($oldldbmhash{lc($param)}) { + # only set the parameter if the old value is different than + # the new value + if ($value cmp $oldldbmhash{lc($param)}) { + print NEWDEST "#This parameter was migrated: the original value was $value\n"; + print NEWDEST $param, "\t", "\"$oldldbmhash{lc($param)}\"", "\n"; + } else { + print NEWDEST $_; + } + delete $oldldbmhash{lc($param)}; + } else { + # just print the parameter + print NEWDEST $_; + } + } else { + print NEWDEST $_; + } + } + close (NEWSRC); + + # add the suffixes we didn't already have + if (%oldsuffix) { + print NEWDEST "#These suffixes were migrated\n"; + foreach (values %oldsuffix) { + print NEWDEST 'suffix', "\t", "\"$_\"", "\n"; + } + } + + # add the user defined indexes + if (@newIndex) { + print NEWDEST "#These indexes were migrated\n"; + while (@newIndex) { + print NEWDEST shift(@newIndex), "\n"; + } + } + + # print the bad plugins, commented out, at the end of the file + if (@badLdbmPlugins) { + print NEWDEST "#The following non standard plugins were detected:\n"; + print "The following non standard ldbm plugins were detected:\n"; + foreach (@badLdbmPlugins) { + print NEWDEST "#", $_, "\n"; + print $_, "\n"; + } + print NEWDEST "#These plugins will probably need to be recompiled for this release\n"; + print "These plugins will probably need to be recompiled for this release\n"; + print NEWDEST "#of directory server, or at the very least, reconfigured.\n"; + print "of directory server, or at the very least, reconfigured.\n"; + } + + close( NEWDEST ); + + open(NEWSRC, $newdseldif ) || die "Can't open $newdseldif: $!: "; + open(NEWDEST, ">$newdseldif.tmp" ) || die "Can't create $newdseldif.tmp: $!: "; + $inEncryptionConfig = 0; + while ( ) { + if (/^\s*#/) { + print NEWDEST $_; + } elsif (/^\s*$/) { + if ($inEncryptionConfig) { # end of entry + $inEncryptionConfig = 0; + # if attributes were present in the old config but not + # in the new one, add them to the end of the entry + foreach $key (keys %olddsehash) { + print NEWDEST $key, ': ', $olddsehash{$key}, "\n"; + } + } + print NEWDEST $_; + } elsif (/cn=encryption\s*,\s*cn=config/) { + $inEncryptionConfig = 1; + print NEWDEST $_; + } elsif (/^\s*(\S+):\s*(.*)$/) { + $param = $1; + $value = $2; + if ($olddsehash{lc($param)}) { + # only set the parameter if the old value is different than + # the new value + if ($value cmp $olddsehash{lc($param)}) { + print NEWDEST $param, "\t", $olddsehash{lc($param)}, "\n"; + } else { + print NEWDEST $_; + } + delete $olddsehash{lc($param)}; + } else { + # just print the parameter + print NEWDEST $_; + } + } else { + print NEWDEST $_; + } + } + close (NEWSRC); + close( NEWDEST ); + + # final step: use the slapd_config program to check the new config file + my $rc = &mySystemNoDie("$root${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server", + "$root${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server" . + "${PATHSEP}slapd_config${exe_suffix}", + '-c', '-f', "$newsrc.tmp"); + + # if the check failed, run slapd_config again in verbose mode to provide + # more information to the user; this will die and abort processing + if ($rc) { + print "The following problems were found with the new configuration:\n"; + &mySystem("$root${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server", + "$root${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server" . + "${PATHSEP}slapd_config${exe_suffix}", + '-f', "$newsrc.tmp"); + } + + # if we got here, the files were good + # save a copy of the old config files + ©BinFile("$newsrc", "$newsrc.save"); + ©BinFile("$newldbmsrc", "$newldbmsrc.save"); + + # replace the temporary dynamicconf directive with the real one + open(NEWSRC, "$newsrc.tmp") or die "Could not open file $newsrc.tmp: $!"; + open(NEWDEST, ">$newsrc") or die "Could not write file $newsrc: $!"; + while() { + if (/^dynamicconf/i) { + print NEWDEST "dynamicconf\t\"$newldbmsrc\"\n"; + } else { + print NEWDEST; + } + } + close NEWSRC; + close NEWDEST; + + ©BinFile("$newldbmsrc.tmp", "$newldbmsrc"); + ©BinFile("$newdseldif.tmp", "$newdseldif"); +} + +sub copyDir { + my $src = shift; + my $dest = shift; + my $exclude = shift; + + opendir( SRC, $src ) or die "Can't open directory $src: $!: "; + my $mode; + my $uid; + my $gid; + mkdir ( $dest , 0755 ) if !( -e $dest ); + if ($PRESERVE) { + $mode = (stat($src))[2]; + ($uid, $gid) = (stat(_))[4..5]; + # Make sure files owned by the old user are owned by the + # new user + if ($uid == $olduid) { + $uid = $newuid; + $gid = $newgid; + } + chown $uid, $gid, $dest; + chmod $mode, $dest; + } + local ( @files ) = readdir ( SRC ); + closedir( SRC ); + for ( @files ) { + if ( $_ eq "." || $_ eq ".." ) { + next; + } elsif ( $exclude && /$exclude/ ) { + next; + } elsif( -d "$src${PATHSEP}$_") { + ©Dir ( "$src${PATHSEP}$_", "$dest${PATHSEP}$_" ); + } else { + ©BinFile ( "$src${PATHSEP}$_", "$dest${PATHSEP}$_"); + } + } +} + +sub copyBinFile { + my $src = shift; + my $dest = shift; + my $buf = ""; + my $bufsize = 8192; + + open( SRC, $src ) || die "Can't open $src: $!\n"; + # if we are given a directory destination instead of a file, extract the + # filename portion of the source to use as the destination filename + if (-d $dest) { + $dest = $dest . $PATHSEP . &basename($src); + } + open( DEST, ">$dest" ) || die "Can't create $dest: $!\n"; + binmode SRC; + binmode DEST; + if ($PRESERVE) { + $mode = (stat($src))[2]; + ($uid, $gid) = (stat(_))[4..5]; + # Make sure files owned by the old user are owned by the + # new user + if ($uid == $olduid) { + $uid = $newuid; + $gid = $newgid; + } + chown $uid, $gid, $dest; + chmod $mode, $dest; + } + while (read(SRC, $buf, $bufsize)) { + print DEST $buf; + } + close( SRC ); + close( DEST ); +} + +sub isAStandardPlugin { + my $line = shift; + + chomp($line); + return $stdPlugins{lc($line)}; +} + +sub isAStandardIndex { + my $line = shift; + + chomp($line); + return $stdIndex{$line}; +} + +sub isAStandardInclude { + my $line = shift; + + chomp($line); + return $stdIncludes{lc($line)}; +} + +# Do a file copy, but convert path names as the file gets copied +# Don't convert paths that don't point anywere, except for log files +# push non-converted paths to the results list +# If you are xlating paths that contain one another, the long paths must come +# first +sub xlatePath { + my $src = shift; + my $dest = shift; + + open( SRC, $src ) || die "Can't open $src: $!: "; + open( DEST, ">$dest" ) || die "Can't create $dest: $!: "; + if ($PRESERVE) { + $mode = (stat($src))[2]; + ($uid, $gid) = (stat(_))[4..5]; + # Make sure files owned by the old user are owned by the + # new user + if ($uid == $olduid) { + $uid = $newuid; + $gid = $newgid; + } + chown $uid, $gid, $dest; + chmod $mode, $dest; + } + while ( ) { + print DEST &xlatePaths( $_, @_ ); + } + close( SRC ); + close( DEST ); +} + +# translate paths in the string +sub xlatePaths { + my $line = shift; + my @otherParams = @_; + my $numXs = shift; + my @srcPaths = splice( @_, 0, $numXs ); + my @destPaths = splice( @_, 0, $numXs ); + my @allowedEmpty = @_; + my @pathLengths = map { length( $_ ) } @srcPaths; + my $i; + my $pre; + my $post; + my $allowed; + my $path; + my $destPath; + + # replace the src paths with the dest paths + # NOTE: this algorithm will only work if the longest paths + # are replaced first e.g. strlen(srcPath[N]) > strlen(srcPath[N+1]) + # and none of the destpaths match any of the srcpaths + for ( $i = 0 ; $i < $numXs ; ++$i ) { + if ($srcPaths[$i] ne $destPaths[$i]) { + $line =~ s/$srcPaths[$i]/$destPaths[$i]/g; + } + } + + return $line; +} + +sub copyBak { + opendir( OLDBAK, "$oldHome${PATHSEP}bak" ) || + die "Can't open directory $oldHome${PATHSEP}bak: $!: "; + local ( @dirs ) = readdir( OLDBAK ); + closedir ( OLDBAK ); + for ( @dirs ) { + if ( $_ eq "." || $_ eq ".." ) { + next; + } elsif ( -d "$oldHome${PATHSEP}bak${PATHSEP}$_" ) { + $srcDir = "$oldHome${PATHSEP}bak${PATHSEP}$_"; + $destDir = "$serverHome${PATHSEP}bak${PATHSEP}$_"; + $srcLDIF = "$oldHome${PATHSEP}ldif${PATHSEP}bak.ldif"; + $destLDIF = "$serverHome${PATHSEP}ldif${PATHSEP}bak.ldif"; + mkdir( $destDir , 0755 ) if !( -e $destDir); + # Converting database + if ( !$isNT && $newuser ) { + chown($newuid, $newgid, + "$serverHome${PATHSEP}bak", $destDir); + } + &other_db2ldif($srcDir, $srcLDIF); + if ($needAclUpg) { + &mySystem("$root${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server", + "$root${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server" . + "${PATHSEP}aclupg$exe_suffix", '-d', '-i', + $srcLDIF, '-o', $destLDIF); + } else { + ©BinFile($srcLDIF, $destLDIF); + } + &other_ldif2db($destLDIF, $destDir); + } + } +} + +sub other_db2ldif { + my $srcDbDir = shift; + my $ldif = shift; + + if ($oldversion == 1) { + &db2ldif($srcDbDir, $ldif); + } else { + # make a dummy version of the current slapd.conf and tell it that + # the db directory is really the back up directory so that we can + # trick ns-slapd db2ldif to do the right thing; Oh how I wish there + # were a simple ldbmcat utility for 3.X and 4.0 . . . + &xlatePath("$oldHome${PATHSEP}config${PATHSEP}slapd.conf", + "$oldHome${PATHSEP}config${PATHSEP}slapd.conf.bak", + 3, + "$realOldHome", + "$oldDbDir", + "slapd.dynamic_ldbm.conf", + "$oldHome", + "$srcDbDir", + "slapd.dynamic_ldbm.conf.bak", + '/logs/'); + &xlatePath("$oldHome${PATHSEP}config${PATHSEP}slapd.dynamic_ldbm.conf", + "$oldHome${PATHSEP}config${PATHSEP}slapd.dynamic_ldbm.conf.bak", + 2, + "$realOldHome", + "$oldDbDir", + "$oldHome", + "$srcDbDir", + '/logs/'); + # now do the ldif2db with our munged conf files . . . + &db2ldif($srcDbDir, $ldif, + "$oldHome${PATHSEP}config${PATHSEP}slapd.conf.bak"); + unlink("$oldHome${PATHSEP}config${PATHSEP}slapd.conf.bak"); + unlink("$oldHome${PATHSEP}config${PATHSEP}slapd.dynamic_ldbm.conf.bak"); + } +} + +sub other_ldif2db { + my $ldif = shift; + my $destDbDir = shift; + my $confFile = shift; + my $directiveToAdd = shift; + + # make a dummy version of the current slapd.conf and slapd.ldbm.conf + # to point to the database directory we want to populate instead of + # the standard + &xlatePath("$serverHome${PATHSEP}config${PATHSEP}slapd.conf", + "$serverHome${PATHSEP}config${PATHSEP}slapd.conf.bak", + 3, + "$newDbDir", + "slapd.ldbm.conf", + "slapd.dynamic_ldbm.conf", + "$destDbDir", + "slapd.ldbm.conf.bak", + "slapd.ldbm.conf.bak", + '/logs/'); + &xlatePath("$serverHome${PATHSEP}config${PATHSEP}slapd.ldbm.conf", + "$serverHome${PATHSEP}config${PATHSEP}slapd.ldbm.conf.bak", + 1, + "$newDbDir", + "$destDbDir", + '/logs/'); + + # we may need to add something to a config file e.g. when migrating the change + # log, we need to add suffix $changeLogSuffix to slapd.ldbm.conf in order to + # ldif2db it without error + if ($confFile && $directiveToAdd) { + open(CONFADD, ">>$serverHome${PATHSEP}config${PATHSEP}${confFile}.bak") or + die "Could not append to $serverHome${PATHSEP}config${PATHSEP}${confFile}.bak: $!"; + print CONFADD $directiveToAdd, "\n"; + close(CONFADD); + } + + &mySystem("$root${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server", + "$root${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server" . + "${PATHSEP}$slapdExecName", + "ldif2db", '-C', '-f', + "$serverHome${PATHSEP}config${PATHSEP}slapd.conf.bak", '-i', + "$ldif"); + unlink("$serverHome${PATHSEP}config${PATHSEP}slapd.conf.bak"); + unlink("$serverHome${PATHSEP}config${PATHSEP}slapd.ldbm.conf.bak"); + unlink($ldif); +} + +sub manyLdif2db { + my @args = (); + while (@_) { + push @args, '-i', shift(@_); + } + &mySystem("$root${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server", + "$root${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server" . + "${PATHSEP}$slapdExecName", "ldif2db", '-C', '-f', + "$serverHome${PATHSEP}config${PATHSEP}slapd.conf", @args); +} + +sub copyLdif { + opendir (LDIFDIR, "$oldHome${PATHSEP}ldif" ); + local ( @files ) = readdir ( LDIFDIR ); + closedir(LDIFDIR); + for ( @files ) { + if ( $_ eq "." || $_ eq ".." || $_ eq "demo.ldif" ) { + next; + } + + if ($needAclUpg) { + &mySystem("$root${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server", + "$root${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${PATHSEP}" . + "aclupg$exe_suffix", '-d', '-i', + "$oldHome${PATHSEP}ldif${PATHSEP}$_", '-o', + "$serverHome${PATHSEP}ldif${PATHSEP}$_"); + } else { + ©BinFile("$oldHome${PATHSEP}ldif${PATHSEP}$_", + "$serverHome${PATHSEP}ldif${PATHSEP}$_"); + } + } +} + +sub genAcl { + my $filename = "$root${PATHSEP}httpacl${PATHSEP}generated.$type-$newname.acl"; + + open( S, ">$filename" ) || die "Can't create file $filename: $!: "; + print S "version $newversion.0;\n"; + print S "acl agents;\n"; + print S "authenticate (user, group) {\n"; + print S " prompt = \"Agent Service\";\n"; + print S "};\n"; + print S "deny absolute (all) (user != all);\n"; + print S "allow absolute (all) (user = all);\n"; + print S "\n"; + print S "acl \"default\";\n"; + print S "allow (read, list, execute,info) user = \"anyone\";\n"; + print S "allow (write, delete) user = \"all\";\n"; + close( S ); +} + +sub getVersion { + my $rootDir = shift; + my $version = 0; + my $minor = 0; + my $progDir = "${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${PATHSEP}"; + my $progDir2 = "${PATHSEP}bin${PATHSEP}slapd${PATHSEP}"; + # get the current directory so we can go back to it + my $curdir = &getCwd; + + # find the slapd executable + $prog = $rootDir . $progDir . $slapdExecName; + if (! -f $prog) { + $prog = $rootDir . $progDir2 . $slapdExecName; + if (-f $prog && $isNT) { + # if slapd is in bin/slapd and we're on NT, just assume version 1; + # apparently, slapd.exe doesn't like the -v argument . . . + return ( '1', $minor ); + } + } + + # read the old version from the old slapd program + chdir($rootDir . $progDir) or + die "Could not chdir to $rootDir${progDir}: $!: "; + open(F, "${quote}${quote}$prog${quote} -v${quote} 2>&1 |") or + die "Could not run slapd program $prog: $!"; + sleep(1); # allow some data to accumulate in the pipe +# print "Output from $prog -v:\n"; + while () { +# print; + if (/^Netscape-Directory\/(\d+)\.(\d+)/) { + $version = $1; + $minor = $2; + last; + } + } + $code = close(F); +# print "$prog returned code=$code status=$?\n"; + + # done determining versions; go back to orig directory + chdir($curdir) or die "Could not chdir to $curdir: $!: "; + + $version == 0 and + die "Could not determine version of the directory server in $rootDir: "; + + return ( $version, $minor ); +} + +# this subroutine implements a very stupid version of diff +sub diff { + my $f1 = shift; + my $f2 = shift; + my $retval = ""; + + open(F1, "$f1") or die "Could not open file $f1"; + open(F2, "$f2") or close(F1), die "Could not open file $f2"; + + while (defined($l1 = ) && defined($l2 = )) { + if (!($l1 eq $l2)) { + # ignore comments + if (($l1 =~ /^#/) && ($l2 =~ /^#/)) { + next; + } + # ignore whitespace + $l1 =~ s/\s//g; + $l2 =~ s/\s//g; + + if (!($l1 eq $l2)) { + $retval .= "< ${l1}> $l2"; + } + } + } + + close(F1); + close(F2); + + if ($retval eq "") { + return undef; + } + + return $retval; +} + +# unfortunately, we can't use the shell script/batch file because it may +# not have been updated if the user changed the database directory +sub db2ldif { + my ($srcDbDir, $ldif, $conf) = @_; + + if ($oldversion == 1) { + my $dir = "$oldDir${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server"; + chdir($dir) or die "Error: could not change directory to $dir: $!"; + my @cmd = ("${quote}$dir${PATHSEP}ldbmcat${exe_suffix}${quote}", '-n', + "${quote}$srcDbDir${PATHSEP}id2entry.dbb${quote}"); + open(LDBMCAT, "${quote}@cmd${quote}|") or + die "Error: could not execute @cmd: $!"; + open(OUTLDIF, "> $ldif") or + die "Error: could not write to $ldif: $!"; + sleep(1); # allow pipe to fill with data + $ii = 0; # counter + while () { + print OUTLDIF; + ++$ii; + if (($ii % 250) == 0) { + print " Processed ", $ii, " lines\n"; + } + } + close(LDBMCAT); + close(OUTLDIF); + } else { + if (!$conf) { + $conf = "$oldHome${PATHSEP}config${PATHSEP}slapd.conf"; + } + my $baseldif = &basename($ldif); + if ($baseldif eq $ldif) { + $ldif = "$oldHome${PATHSEP}ldif${PATHSEP}$ldif"; + } + my $dir = "$oldDir${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server"; + chdir($dir) or + die "Error: could not change directory to $dir: $!"; + + my @cmd = + ( "${quote}$oldDir${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server" . + "${PATHSEP}$slapdExecName${quote}", "db2ldif", '-n', '-f', + "${quote}$conf${quote}", '-a', "${quote}$ldif${quote}", + '-d', '1' ); + open(DB2LDIF, "${quote}@cmd${quote} 2>&1|") or + die "Error: could not execute @cmd: $!"; + sleep(1); # allow pipe to fill with data + $ii = 0; # counter + while () { + ++$ii; + if (($ii % 250) == 0) { + print " Processing...\n"; + } + } + close(DB2LDIF); + } + print " Done.\n"; +} + +# this subroutine works like sed in that it will create another version +# of the input file with some editing done +# the file should be a text file +sub copyAndEditTextFile { + my $srcFile = shift; + my $destFile = shift; + my $sub = shift; + + open(SRCFILE, "$srcFile") or die "Error: could not open file $srcFile: $!"; + open(DESTFILE, ">$destFile") or die "Error: could not write file $destFile: +$!"; + + while () { + my $newline = &$sub($_); + if ($newline cmp $_) { + print "The line: $_"; + print "Was converted to: $newline"; + print "File: $srcFile\n"; + } + print DESTFILE $newline; + } + + close(SRCFILE); + close(DESTFILE); +} diff --git a/ldap/admin/src/migratedsgw b/ldap/admin/src/migratedsgw new file mode 100755 index 00000000..8874c02d --- /dev/null +++ b/ldap/admin/src/migratedsgw @@ -0,0 +1,445 @@ +#!perl +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# + +# print begin message +$now_time = gmtime; +print "BEGIN DSGW migration at ", $now_time, " GMT\n"; + +# get the commandline options +if (!getopts('s:d:h:') || !$opt_s || !$opt_d || !$opt_h ) { + print "usage: dsgwmig options\n"; + print "\noptions:\n"; + print " -s directory\tdirectory containing the 3.0 Gateway\n"; + print " -d directory\tdirectory containing the 4.1 Gateway\n"; + print " -h host[:port]\tthe host and port of the directory server\n"; + print " \t\t\tto which the migrated gateway will query\n"; + print "\nexample:\n dsgwmig -s /usr/tmp/ds30/slapd-host/dsgw -d /usr/tmp/ds40/dsgw -h gargoyle:1974\n"; + + exit; +} + +sub reportAndExit { + my $now_time = gmtime; + print "END DSGW migration at ", $now_time, " GMT\n"; + print "DSGW Exit status is ", $exitCode, "\n"; + if ($? == 0 && $exitCode == 0) { + print "NMC_STATUS: 0\n"; + } else { + print '$?=', $?+0, ' $!=', $!+0, ' $exitCode=', $exitCode, "\n"; + print shift, "\n"; + print "NMC_STATUS: $exitCode\n"; + } + + print "###DSGW MIGRATION FINISHED###\n"; + + exit($exitCode); +} + +$SIG{__DIE__} = 'exit'; +$SIG{'QUIT'} = 'exit'; +$SIG{'INT'} = 'exit'; +$SIG{'TERM'} = 'exit'; + +# the atexit handler +END { + $! = 0; + $? = $exitCode; + &reportAndExit; +} + +# setup the path separator +$isNT = -d '\\'; +$PS = $isNT ? "\\" : "/"; + +#make sure that the target directory exists +if (! -e $opt_d) { + print "$opt_d does not exist\n"; + exit; +} + +print "Migrating the config directory...\n"; +# First migrate the config directory +migrate_html("config"); + +print "Migrating the html directory...\n"; +# Then migrate the html directory +migrate_html("html"); + +print "Migrating the dsgw.conf...\n"; +# Then migrate dsgw.conf +migrate_config(); + +# Then copy over certain files like alert.html, confirm.html and emptyFrame from +# the regular *4.1* DSGW to the newly migrated *4.1* gateway. +if (! -e "$opt_d"."$PS"."html-30"."$PS"."alert.html") { + print "copy ", "$opt_d"."$PS"."html"."$PS"."alert.html", " $opt_d"."$PS"."html-30"."$PS"."alert.html", "\n"; + copyFile("$opt_d"."$PS"."html"."$PS"."alert.html", "$opt_d"."$PS"."html-30"."$PS"."alert.html"); +} + +if (! -e "$opt_d"."$PS"."html-30"."$PS"."confirm.html") { + print "copy ", "$opt_d"."$PS"."html"."$PS"."confirm.html", " $opt_d"."$PS"."html-30"."$PS"."confirm.html", "\n"; + copyFile("$opt_d"."$PS"."html"."$PS"."confirm.html", "$opt_d"."$PS"."html-30"."$PS"."confirm.html"); +} + +if (! -e "$opt_d"."$PS"."html-30"."$PS"."confirm.gif") { + copyFile("$opt_d"."$PS"."html"."$PS"."confirm.gif", "$opt_d"."$PS"."html-30"."$PS"."confirm.gif"); +} + +if (! -e "$opt_d"."$PS"."html-30"."$PS"."alert.gif") { + copyFile("$opt_d"."$PS"."html"."$PS"."alert.gif", "$opt_d"."$PS"."html-30"."$PS"."alert.gif"); +} + +if (! -e "$opt_d"."$PS"."html-30"."$PS"."emptyFrame.html") { + copyFile("$opt_d"."$PS"."html"."$PS"."emptyFrame.html", "$opt_d"."$PS"."html-30"."$PS"."emptyFrame.html"); +} + +print "end of migratedsgw\n"; +$exitCode = 0; +exit $exitCode; + +sub migrate_html +{ + my $target_dir = shift(@_); + my $orig_target = "$target_dir"; + my $full_target_dir; + my @subdirlist; + my @dsgwfiles; + +# cd into the source directory + chdir "$opt_s"."$PS"."$target_dir" or die "Unable to cd to $opt_s$PS$target_dir: $!\n"; + +# read the files + opendir DSGW_OLD, "." or die "$!"; + @dsgwfiles = grep !/^\.\.?$/, readdir DSGW_OLD; + closedir DSGW_OLD; + +# Before we go on, we need to make the directory +# in the 4.1 space. If we're working on the config +# or html directory, then we have to rename them. + $target_dir =~ s/^(config|html)/$1\-30/; + $full_target_dir = "$opt_d". "$PS". "$target_dir"; + if (! -d $full_target_dir) { + mkdir $full_target_dir, 0755 or + die "can't create $opt_d$PS$target_dir. $!\n"; + } + +# foreach file in the current directory, +# either skip it (if it's a subdir) +# copy it to the new directory +# copy and modify it to the new directory + foreach $file (@dsgwfiles){ # + #Skip directories + if (-d $file) { +# print "Skipping Directory $file\n"; + push @subdirlist, $file; + next; + } + + if ($file =~ m/.*?\.html/) { +# open the old file + open(OLDFILE, "$file") or die "Cannot read $file. $!\n"; + +# open the new file + open(NEWFILE, ">"."$full_target_dir"."$PS"."$file") or die "Cannot write $full_target_dir$PS$file. $!\n"; + + for ($line=; $line ; $line=) { + +# replace all ACTION=/ds/cgi with ACTION=/dsgw/bin/cgi + $line =~ s:(?i)(action\s*=\s*("){0,1}\s*(http(s){0,1}\://.*?){0,1})/ds/(\w*):$1/dsgw/bin/$5:g; #")) + +# Langify the gifs, but not those that are already langified. Look for ="blah.gif" + $line =~ s:(?i)=\s*("){0,1}\s*([\w|\-|_]*)\.(gif|jpg|jpeg):=$1/dsgw/bin/lang?\ + 5 + + + + wsdl + text/xml + + + + + xsd + text/xml + + + + index.html + index.jsp + index.jws + + + + +EOF + + + close WEB; + } + + foreach $file (@FILES) { + + if ($opt_u) { + # restore from backups + print STDOUT "${file}.bak -> ${file}\n"; + rename("${SERVERROOT}${PATH}${file}.bak","${SERVERROOT}${PATH}${file}"); + } + if ($opt_i) { + # make backups + print STDOUT "${file} -> ${file}.bak\n"; + cp("${SERVERROOT}${PATH}${file}","${SERVERROOT}${PATH}${file}.bak"); + + if ( $file eq "server.xml") { + open SERVER, "${SERVERROOT}${PATH}${file}" || die("Could not open file!"); + @raw_data=; + close SERVER; + + $i=0; + + while ($line = $raw_data[$i++]) { + #if ($line =~ /CONNECTIONGROUP.*servername=\"([\w.?]+)\"/ ){ + #$SERVERNAME = $1; + #} + + if ($line =~ /\<\/LS/ ) { + splice @raw_data, $i++,0, + (" \n", + " \n" ); + $i+=2; + } + + if ($line =~ /\<\/VSCLASS/ ) { + splice @raw_data, $i, 0, + (" \n" . + "\n" . + " \n" . + " \n \n \n"); + $i++; + } + + + } + open SERVER, "> ${SERVERROOT}${PATH}${file}" || die("Could not open file!"); + select SERVER; + print @raw_data; + close SERVER; + } + + if ( $file eq "web-apps.xml" ) { + open WEBAPPS, "> ${SERVERROOT}${PATH}${file}"; + select WEBAPPS; + print STDERR "adding necessary entry to $file.\n"; + print < + + + + + +EOF + + close WEBAPPS; + + } + + if ( $file eq "obj.conf" ) { + open OBJ, ">> ${SERVERROOT}${PATH}${file}"; + select OBJ; + print STDERR "adding necessary entry to $file.\n"; + print < +ObjectType fn=type-by-extension +ObjectType fn=force-type type=text/plain +Service fn="NSServletService" type="magnus-internal/servlet" +Service method=(GET|HEAD|POST) type=*~magnus-internal/* fn=send-file +Error fn="admin-error" reason="server error" +AddLog fn="admin40_flex_log" name="access" +NameTrans fn="NSServletNameTrans" name="servlet" +PathCheck fn=find-pathinfo +PathCheck fn=find-index index-names="index.html,home.html" +Service type="magnus-internal/jsp" fn="NSServletService" + + +EOF + + close OBJ; + + + } + + if ( $file eq "jvm12.conf" ) { + open JVM, ">> ${SERVERROOT}${PATH}${file}"; + select JVM; + print STDERR "adding necessary entry to $file.\n"; + print "jvm.option=-Duser.home=${SERVERROOT}{{SEP}}clients{{SEP}}dsmlgw"; + close JVM; + } + } + } +} diff --git a/ldap/admin/src/scripts/template-ldif2db.pl b/ldap/admin/src/scripts/template-ldif2db.pl new file mode 100644 index 00000000..c552af69 --- /dev/null +++ b/ldap/admin/src/scripts/template-ldif2db.pl @@ -0,0 +1,193 @@ +#{{PERL-EXEC}} +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2004 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# + +sub usage { + print(STDERR "Usage: $0 [-v] -D rootdn { -w password | -w - | -j filename } \n"); + print(STDERR " -n instance | {-s include}* [{-x exclude}*] [-O] [-c]\n"); + print(STDERR " [-g [string]] [-G namespace_id] {-i filename}*\n"); + print(STDERR " Opts: -D rootdn - Directory Manager\n"); + print(STDERR " : -w password - Directory Manager's password\n"); + print(STDERR " : -w - - Prompt for Directory Manager's password\n"); + print(STDERR " : -j filename - Read Directory Manager's password from file\n"); + print(STDERR " : -n instance - instance to be imported to\n"); + print(STDERR " : -i filename - input ldif file(s)\n"); + print(STDERR " : -s include - included suffix\n"); + print(STDERR " : -x exclude - excluded suffix(es)\n"); + print(STDERR " : -O - only create core db, no attr indexes\n"); + print(STDERR " : -c size - merge chunk size\n"); + print(STDERR " : -g [string] - string is \"none\" or \"deterministic\"\n"); + print(STDERR " : none - unique id is not generated\n"); + print(STDERR " : deterministic - generate name based unique id (-G name)\n"); + print(STDERR " : by default - generate time based unique id\n"); + print(STDERR " : -G name - namespace id for name based uniqueid (-g deterministic)\n"); + print(STDERR " : -E - Encrypt data when importing\n"); + print(STDERR " : -v - verbose\n"); +} + +@ldiffiles = ( + "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", + "" +); +@included = ( + "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", + "" +); +@excluded = ( + "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", + "" +); +$maxidx = 50; +$instance = ""; +$noattrindexes = 0; +$mergechunksiz = 0; +$genuniqid = "time"; +$uniqidname = ""; +$taskname = ""; +$dsroot = "{{DS-ROOT}}"; +$mydsroot = "{{MY-DS-ROOT}}"; +$verbose = 0; +$rootdn = ""; +$passwd = ""; +$passwdfile = ""; +$i = 0; +$ldifi = 0; +$incli = 0; +$excli = 0; +$encrypt_on_import = 0; +while ($i <= $#ARGV) { + if ( "$ARGV[$i]" eq "-i" ) { # ldiffiles + $i++; + if ($ldifi < $maxidx) { + $ldiffiles[$ldifi] = $ARGV[$i]; $ldifi++; + } else { + &usage; exit(1); + } + } elsif ("$ARGV[$i]" eq "-s") { # included suffix + $i++; + if ($incli < $maxidx) { + $included[$incli] = $ARGV[$i]; $incli++; + } else { + &usage; exit(1); + } + } elsif ("$ARGV[$i]" eq "-x") { # excluded suffix + $i++; + if ($excli < $maxidx) { + $excluded[$excli] = $ARGV[$i]; $excli++; + } else { + &usage; exit(1); + } + } elsif ("$ARGV[$i]" eq "-n") { # instance + $i++; $instance = $ARGV[$i]; + } elsif ("$ARGV[$i]" eq "-D") { # Directory Manager + $i++; $rootdn = $ARGV[$i]; + } elsif ("$ARGV[$i]" eq "-w") { # Directory Manager's password + $i++; $passwd = $ARGV[$i]; + } elsif ("$ARGV[$i]" eq "-j") { # Read Directory Manager's password from a file + $i++; $passwdfile = $ARGV[$i]; + } elsif ("$ARGV[$i]" eq "-O") { # no attr indexes + $noattrindexes = 1; + } elsif ("$ARGV[$i]" eq "-c") { # merge chunk size + $i++; $mergechunksiz = $ARGV[$i]; + } elsif ("$ARGV[$i]" eq "-g") { # generate uniqueid + if (("$ARGV[$i+1]" ne "") && !("$ARGV[$i+1]" =~ /^-/)) { + $i++; + if ("$ARGV[$i]" eq "none") { + $genuniqid = $ARGV[$i]; + } elsif ("$ARGV[$i]" eq "deterministic") { + $genuniqid = $ARGV[$i]; + } + } + } elsif ("$ARGV[$i]" eq "-G") { # namespace id + $i++; $uniqidname = $ARGV[$i]; + } elsif ("$ARGV[$i]" eq "-v") { # verbose + $verbose = 1; + } elsif ("$ARGV[$i]" eq "-E") { # encrypt on import + $encrypt_on_import = 1; + } else { + &usage; exit(1); + } + $i++; +} +if ($passwdfile ne ""){ +# Open file and get the password + unless (open (RPASS, $passwdfile)) { + die "Error, cannot open password file $passwdfile\n"; + } + $passwd = ; + chomp($passwd); + close(RPASS); +} elsif ($passwd eq "-"){ +# Read the password from terminal + die "The '-w -' option requires an extension library (Term::ReadKey) which is not\n", + "part of the standard perl distribution. If you want to use it, you must\n", + "download and install the module. You can find it at\n", + "http://www.perl.com/CPAN/CPAN.html\n"; +# Remove the previous line and uncomment the following 6 lines once you have installed Term::ReadKey module. +# use Term::ReadKey; +# print "Bind Password: "; +# ReadMode('noecho'); +# $passwd = ReadLine(0); +# chomp($passwd); +# ReadMode('normal'); +} +if (($instance eq "" && $included[0] eq "") || $ldiffiles[0] eq "" || $rootdn eq "" || $passwd eq "") { &usage; exit(1); } +($s, $m, $h, $dy, $mn, $yr, $wdy, $ydy, $r) = localtime(time); +$mn++; $yr += 1900; +$taskname = "import_${yr}_${mn}_${dy}_${h}_${m}_${s}"; +$dn = "dn: cn=$taskname, cn=import, cn=tasks, cn=config\n"; +$misc = "changetype: add\nobjectclass: top\nobjectclass: extensibleObject\n"; +$cn = "cn: $taskname\n"; +if ($instance ne "") { + $nsinstance = "nsInstance: ${instance}\n"; +} +$i = 0; +$nsldiffiles = ""; +while ("" ne "$ldiffiles[$i]") { + $nsldiffiles = "${nsldiffiles}nsFilename: $ldiffiles[$i]\n"; + $i++; +} +$i = 0; +$nsincluded = ""; +while ("" ne "$included[$i]") { + $nsincluded = "${nsincluded}nsIncludeSuffix: $included[$i]\n"; + $i++; +} +$i = 0; +$nsexcluded = ""; +while ("" ne "$excluded[$i]") { + $nsexcluded = "${nsexcluded}nsExcludeSuffix: $excluded[$i]\n"; + $i++; +} +$nsnoattrindexes = ""; +if ($noattrindexes != 0) { $nsnoattrindexes = "nsImportIndexAttrs: false\n"; } +$nsimportencrypt = ""; +if ($encrypt_on_import != 0) { $nsimportencrypt = "nsImportEncrypt: true\n"; } +$nsmergechunksiz = "nsImportChunkSize: ${mergechunksiz}\n"; +$nsgenuniqid = "nsUniqueIdGenerator: ${genuniqid}\n"; +$nsuniqidname = ""; +if ($uniqidname ne "") { $nsuniqidname = "nsUniqueIdGeneratorNamespace: ${uniqidname}\n"; } +$entry = "${dn}${misc}${cn}${nsinstance}${nsincluded}${nsexcluded}${nsldiffiles}${nsnoattrindexes}${nsimportencrypt}${nsmergechunksiz}${nsgenuniqid}${nsuniqidname}"; +$vstr = ""; +if ($verbose != 0) { $vstr = "-v"; } +chdir("$dsroot{{SEP}}shared{{SEP}}bin"); +open(FOO, "| $dsroot{{SEP}}shared{{SEP}}bin{{SEP}}ldapmodify $vstr -h {{SERVER-NAME}} -p {{SERVER-PORT}} -D \"$rootdn\" -w \"$passwd\" -a" ); +print(FOO "$entry"); +close(FOO); diff --git a/ldap/admin/src/scripts/template-migrate50to51 b/ldap/admin/src/scripts/template-migrate50to51 new file mode 100644 index 00000000..c9c32276 --- /dev/null +++ b/ldap/admin/src/scripts/template-migrate50to51 @@ -0,0 +1,2778 @@ +#{{PERL-EXEC}} +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2004 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# + +# Migrate a 5.0 directory server to a 5.1 directory server + +####################################################################################################### +# enable the use of Perldap functions +require DynaLoader; + +use Getopt::Std; +use Mozilla::LDAP::Conn; +use Mozilla::LDAP::Entry; +use Mozilla::LDAP::LDIF; +use Mozilla::LDAP::Utils qw(:all); +use Mozilla::LDAP::API qw(:api :ssl :apiv3 :constant); # Direct access to C API +use Time::localtime; +use File::Basename; +use Class::Struct ; + +####################################################################################################### + +sub usage { + print(STDERR "\nUsage: $0 -D rootdn { -w password | -w - | -j filename } -p port \n"); + print(STDERR " -o oldInstancePath -n newInstancePath [-t tracelevel] [-L logfile]\n"); + print(STDERR "************** parameters in brackets are optionals, others are required **************\n"); + print(STDERR " Opts: -D rootdn - new 5.x Directory Manager\n"); + print(STDERR " : -w password - new 5.x Directory Manager's password\n"); + print(STDERR " : -w - - Prompt for new 5.x Directory Manager's password\n"); + print(STDERR " : -j filename - Read new 5.x Directory Manager's password from file\n"); + print(STDERR " : -p port - new 5.x Directory Server port\n"); + print(STDERR " : -o oldInstancePath - Path of the old instance to migrate \n"); + print(STDERR " : -n newInstancePath - Path of the new 5.x instance\n"); + print(STDERR " : [-t tracelevel] - specify the level of trace (0..3)\n"); + print(STDERR " : [-L logfile] - specify the file to log the migration report \n"); + } +######################################################################################################## + +BEGIN { + + require 'uname.lib' ; + $isNT = -d '\\'; + $PATHSEP = $isNT ? "\\" : "/"; + ${SEP} = $isNT ? ";" : ":" ; + @INC = ( '.', '../../../admin/admin/bin'); + grep { s@/@\\@g } @INC if $isNT; + $script_suffix = $isNT ? ".bat" : ""; + $exe_suffix = $isNT ? ".exe" : ""; + # NT needs quotes around some things unix doesn't + $quote = $isNT ? "\"" : ""; + + # If this variable is set, all file/directory creation will make sure the mode + # and ownership of the destination is the same as the source + $PRESERVE = 1 if (!$isNT); + $script_suffix = $isNT ? ".bat" : ""; + $exe_suffix = $isNT ? ".exe" : ""; + if ($isNT) { + $os = "WINNT"; + } else { + $os = &uname("-s"); + } + if ($isNT) { + # we have to pass batch files directly to the NT command interpreter + $com_spec = $ENV{ComSpec}; + if (!$com_spec) { + $com_spec = $ENV{COMSPEC}; + } + if (!$com_spec || ! -f $com_spec) { + # find the first available command interpreter + foreach $drive (c..z) { + $com_spec = "$drive:\\winnt\\system32\\cmd.exe"; + last if (-f $com_spec); + $com_spec = undef; + } + if (! $com_spec) { + # punt and pray + $com_spec = 'c:\winnt\system32\cmd.exe'; + } + } + } + if ( $os eq "AIX" ) { + $dll_suffix = "_shr.a"; + } + elsif ( $os eq "HP-UX" ) { + $dll_suffix = ".sl"; + } + elsif ( $os eq "WINNT" ) { + $dll_suffix = ".dll"; + } + else { + $dll_suffix = ".so"; + } + $slapdExecName = $isNT ? 'slapd.exe' : 'ns-slapd'; + select STDERR; + $| = 1; + select STDOUT; + $| = 1; +} + +SWITCH: { + if ($os eq "AIX") { + $LIB_PATH = "LIBPATH" ; + last SWITCH ; + } + if ($os eq "HP-UX") { + $LIB_PATH = "SHLIB_PATH" ; + last SWITCH ; + } + if ($isNT) { + $LIB_PATH = "PATH" ; + last SWITCH ; + } + else { + $LIB_PATH = "LD_LIBRARY_PATH" ; + last SWITCH ; + } + } + + # old parameters + ${oldDir} = "" ; + ${oldname} = "" ; + ${oldHome} = "" ; + ${oldConfDir} = "" ; + ${oldlocaluser} ; + ${olduid} ; + ${oldgid} ; + + # new parameters + ${root} = "{{DS-ROOT}}" ; + ${type} = "" ; + ${newname} = "" ; + ${newport} = "" ; + ${rootDN} = "" ; + ${rootpwd} = "" ; + ${localhost} = "" ; + ${LogFileReport} = "" ; + ${newuid} ; + ${localuser} ; + ${newgid} ; + $NO_INPUT_USER = 0 ; # by default user can give inputs during the migration process + ${curdir} = getCwd(); + ${slapdExecDir} = "${root}${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${PATHSEP}"; + # in 5.1 the replica Id is setup to a static value + $replicaIdvalue = 65535; + + # specify the level of trace + $TRACELEVEL=1; + + $LDAP_SERVER_UNREACHABLE = 81; + + # get input users + &getParameters() ; + ${oldDir} = &normalizeDir("${oldDir}"); + ${oldHome} = "${oldDir}${PATHSEP}$type-$oldname" ; + ${oldConfDir} = "${oldHome}${PATHSEP}config${PATHSEP}" ; + ${oldSchemaDir} = "${oldConfDir}schema${PATHSEP}"; + ${oldDSEldif} = "${oldConfDir}dse.ldif"; + ${serverHome} = "${root}${PATHSEP}$type-$newname" ; + ${schemaDir} = "$serverHome${PATHSEP}config${PATHSEP}schema${PATHSEP}"; + ${DSEldif} = "$serverHome${PATHSEP}config${PATHSEP}dse.ldif"; + ${ldif_rep} = "${oldConfDir}${PATHSEP}ldif${PATHSEP}" ; + ${oldSlapdExecDir} = "${oldDir}${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${PATHSEP}"; + + open(LOGFILE, ">> $LogFileReport"); + + printTrace("\noldDir: $oldDir, oldHome: $oldHome, \noldConfDir: $oldConfDir, \nldif_rep: $ldif_rep, \nrootDN: $rootDN, \nPort: $newport, \nNewname: $newname\n",3); + printTrace("\nLIB_PATH: $LIB_PATH",4); + + if (!(-d $serverHome)) { + printMsg("\n$serverHome doesn't exist\n"); + exit(1); + } + if (!(-d $oldHome)) { + printMsg("\n$oldHome doesn't exist\n"); + exit(1); + } + + +%HashParametersName = (); + +# The following hash displays only general server parameters to migrate under cn=config +%GeneralSrvParamToMigrate = ( + 'nsslapd-accesscontrol'=> '\n', + 'nsslapd-errorlog-logging-enabled'=> '\n', + 'nsslapd-accesslog-logging-enabled'=> '\n', + 'nsslapd-auditlog-logging-enabled'=> '\n', + 'nsslapd-accesslog-level'=> '\n', + 'nsslapd-accesslog-logbuffering'=> '\n', + 'nsslapd-accesslog-logexpirationtime'=> '\n', + 'nsslapd-accesslog-logexpirationtimeunit'=> '\n', + 'nsslapd-accesslog-logmaxdiskspace'=> '\n', + 'nsslapd-accesslog-logminfreediskspace'=> '\n', + 'nsslapd-accesslog-logrotationtime'=> '\n', + 'nsslapd-accesslog-logrotationtimeunit'=> '\n', + 'nsslapd-accesslog-maxlogsize'=> '\n', + 'nsslapd-accesslog-maxLogsPerDir'=> '\n', + 'nsslapd-attribute-name-exceptions'=> '\n', + 'nsslapd-auditlog-logexpirationtime'=> '\n', + 'nsslapd-auditlog-logexpirationtimeunit'=> '\n', + 'nsslapd-auditlog-logmaxdiskspace'=> '\n', + 'nsslapd-auditlog-logminfreediskspace'=> '\n', + 'nsslapd-auditlog-logrotationtime'=> '\n', + 'nsslapd-auditlog-logrotationtimeunit'=> '\n', + 'nsslapd-auditlog-maxlogsize'=> '\n', + 'nsslapd-auditlog-maxLogsPerDir'=> '\n', + 'nsslapd-certmap-basedn'=> '\n', + 'nsslapd-ds4-compatible-schema'=> '\n', + 'nsslapd-enquote-sup-oc'=> '\n', + 'nsslapd-errorlog-level'=> '\n', + 'nsslapd-errorlog-logexpirationtime'=> '\n', + 'nsslapd-errorlog-logexpirationtimeunit'=> '\n', + 'nsslapd-errorlog-logmaxdiskspace'=> '\n', + 'nsslapd-errorlog-logminfreediskspace'=> '\n', + 'nsslapd-errorlog-logrotationtime'=> '\n', + 'nsslapd-errorlog-logrotationtimeunit'=> '\n', + 'nsslapd-errorlog-maxlogsize'=> '\n', + 'nsslapd-errorlog-maxlogsperdir'=> '\n', + 'nsslapd-groupevalnestlevel'=> '\n', + 'nsslapd-idletimeout'=> '\n', + 'nsslapd-ioblocktimeout'=> '\n', + 'nsslapd-lastmod'=> '\n', + 'nsslapd-listenhost'=> '\n', + 'nsslapd-maxdescriptors'=> '\n', + 'nsslapd-nagle'=> '\n', + 'nsslapd-readonly'=> '\n', + 'nsslapd-referralmode'=> '\n', + 'nsslapd-plugin-depends-on-name'=> '\n', + 'nsslapd-plugin-depends-on-type'=> '\n', + 'nsslapd-referral'=> '\n', + 'nsslapd-reservedescriptors'=> '\n', + 'nsslapd-rootpwstoragescheme'=> '\n', + 'nsslapd-schemacheck'=> '\n', + 'nsslapd-secureport'=> '\n', + 'nsslapd-security'=> '\n', + 'nsslapd-sizelimit'=> '\n', + 'nsslapd-ssl3ciphers'=> '\n', + 'nsslapd-timelimit'=> '\n', + 'passwordchange'=> '\n', + 'passwordchecksyntax'=> '\n', + 'passwordexp'=> '\n', + 'passwordhistory'=> '\n', + 'passwordinhistory'=> '\n', + 'passwordlockout'=> '\n', + 'passwordlockoutduration'=> '\n', + 'passwordmaxage'=> '\n', + 'passwordmaxfailure'=> '\n', + 'passwordminage'=> '\n', + 'passwordminlength'=> '\n', + 'passwordmustchange'=> '\n', + 'passwordresetfailurecount' => '\n', + 'passwordstoragescheme' => '\n', + 'passwordunlock' => '\n', + 'passwordwarning' => '\n' +); + +# the following hash displays global parameters related to database stored under cn=config,cn=ldbm database,cn=plugins,cn=config +%GlobalConfigLDBMparamToMigrate = ( + 'nsslapd-allidsthreshold' => '\n', + 'nsslapd-lookthroughlimit' => '\n', + 'nsslapd-mode' => '\n', + 'nsslapd-dbcachesize' => '\n', + 'nsslapd-cache-autosize' => '\n', + 'nsslapd-cache-autosize-split' => '\n', + 'nsslapd-db-transaction-logging' => '\n', + 'nsslapd-import-cachesize' => '\n' +); + +# the following hash displays specific parameters to each backends and stored under cn=DBname,cn=ldbm database,cn=plugins,cn=config +%LDBMparamToMigrate = ( + 'nsslapd-cachesize' => '\n', + 'nsslapd-cachememsize' => '\n', + 'nsslapd-readonly' => '\n', + 'nsslapd-require-index' => '\n' +); + + +%ChainingConfigParams = ( + 'nsactivechainingcomponents' => '\n', + 'nstransmittedcontrols' => '\n' + ); + +%ChainingDefaultInstanceConfigParams = ( + 'nsabandonedsearchcheckinterval' => '\n', + 'nsbindconnectionslimit' => '\n', + 'nsbindtimeout' => '\n', + 'nsbindretrylimit' => '\n', + 'nshoplimit' => '\n', + 'nsmaxresponsedelay' => '\n', + 'nsmaxtestresponsedelay' => '\n', + 'nschecklocalaci' => '\n', + 'nsconcurrentbindlimit' => '\n', + 'nsconcurrentoperationslimit' => '\n', + 'nsconnectionlife' => '\n', + 'nsoperationconnectionslimit' => '\n', + 'nsproxiedauthorization' => '\n', + 'nsreferralonscopedsearch' => '\n', + 'nsslapd-sizelimit' => '\n', + 'nsslapd-timelimit' => '\n' +); + +%changelog5params = ( + 'nsslapd-changelogmaxage' => '\n', + 'nsslapd-changelogmaxentries' => '\n' + ); + +@SNMPparams = ( + 'nssnmpenabled', + 'nssnmporganization', + 'nssnmplocation', + 'nssnmpcontact', + 'nssnmpdescription', + 'nssnmpmasterhost', + 'nssnmpmasterport', + 'nssnmpenabled', + 'aci' + ); + +%stdIncludes = ( + "." => "\n", + ".." => "\n", + "30ns-common.ldif " => "\n", + "50ns-mail.ldif " => "\n", + "50ns-news.ldif" => "\n", + "50iplanet-servicemgt.ldif"=> "\n", + "50ns-mcd-browser.ldif" => "\n", + "50ns-proxy.ldif" => "\n", + "00core.ldif" => "\n", + "50ns-admin.ldif" => "\n", + "50ns-mcd-config.ldif " => "\n", + "50ns-value.ldif" => "\n", + "05rfc2247.ldif" => "\n", + "50ns-calendar.ldif" => "\n", + "50ns-mcd-li.ldif" => "\n", + "50ns-wcal.ldif" => "\n", + "05rfc2927.ldif" => "\n", + "50ns-certificate.ldif" => "\n", + "50ns-mcd-mail.ldif" => "\n", + "50ns-web.ldif" => "\n", + "10rfc2307.ldif" => "\n", + "50ns-compass.ldif" => "\n", + "50ns-media.ldif" => "\n", + "20subscriber.ldif" => "\n", + "50ns-delegated-admin.ldif"=> "\n", + "50ns-mlm.ldif" => "\n", + "25java-object.ldif" => "\n", + "50ns-directory.ldif" => "\n", + "50ns-msg.ldif" => "\n", + "28pilot.ldif" => "\n", + "50ns-legacy.ldif" => "\n", + "50ns-netshare.ldif" => "\n" +); + + +# Backends migrated (Backend CN attribute value) +@BACKENDS = () ; +# All pairs of suffix-backend are registered in this hashtable +%oldBackends = () ; + +#store the backend instances to migrate +@LDBM_backend_instances = (); + +#store the mapping tree +@Mapping_tree_entries = (); + +#store the suffix and the associated chaining backend +%oldChainingBackends = (); + +#store the multiplexor bind entries to migrate +%MultiplexorBindDNEntriesToMigrate = (); + +#store the Replica bind DN entries to migrate +%ReplicaBindDNEntriesToMigrate = (); + +# list of standard plugin's in version 4 +%stdPlugins = ( + "7-bit check" => "\n", + "acl plugin" => "\n", + "acl preoperation" => "\n", + "binary syntax" => "\n", + "case exact string syntax" => "\n", + "case ignore string syntax" => "\n", + "chaining database" => "\n", + "class of service" => "\n", + "country string syntax" => "\n", + "distinguished name syntax" => "\n", + "generalized time syntax" => "\n", + "integer syntax" => "\n", + "internationalization plugin" => "\n", + "ldbm database" => "\n", + "legacy replication plugin" => "\n", + "multimaster replication plugin" => "\n", + "octet string syntax" => "\n", + "clear" => "\n", + "crypt" => "\n", + "ns-mta-md5" => "\n", + "sha" => "\n", + "ssha" => "\n", + "postal address syntax" => "\n", + "referential integrity postoperation" => "\n", + "retro changelog plugin" => "\n", + "roles plugin" => "\n", + "telephone syntax" => "\n", + "uid uniqueness" => "\n", + "uri syntax" => "\n" + ); + +# list of indexes that have disappeared from the 5.1 schema compared to 5.0 +%deniedIndexes = ( + 'dncomp' => "\n" +); + +@default_indexes = (); +@indexes = (); + +# list of user added Plugin's. In 5.x, they 'll need to be recompiled +@badPlugins = () ; + +@pluginAttrs = ( + "objectclass", + "cn", + "nsslapd-pluginpath", + "nsslapd-plugininitfunc", + "nsslapd-plugintype", + "nsslapd-pluginenabled", + "nsslapd-plugin-depends-on-type", + "nsslapd-pluginid", + "nsslapd-pluginversion", + "nsslapd-pluginvendor" + ); + +@nsds5replicaAttrs = ( + 'objectclass', + 'nsDS5ReplicaRoot', + 'nsDS5ReplicaType', + 'nsDS5ReplicaLegacyConsumer', + 'nsDS5flags', + 'nsDS5ReplicaId', + 'nsDS5ReplicaPurgeDelay', + 'nsDS5ReplicaBinddn', + 'cn', + 'nsDS5ReplicaReferral' + ); + +# array of replicas to migrate +@new51replicas = (); + +# array of replication agreements to migrate +@replicationAgreements = (); + +# Shutdown the legacy Directory instance +printTrace("\nShutdown the legacy Directory Server instance: ${oldHome}",0); +&stopServer($oldDir, 'slapd-'.$oldname); + +# compare LDIF standard config files with standard ones +CompareStdConfigFiles() ; +die "\n\n The version of product you want to migrate is not a 5.x iPlanet Directory Server\n" unless ($oldVersion == 5) ; + +# get the hostname of the new LDAP server +my $LDAPservername = &getLDAPservername(); + +# get the uid and gid of the 5.1 slapd user +($localuser, $newuid, $newgid) = getuid_gid(); +# get the uid and gid of the 5.0 slapd user +($oldlocaluser, $olduid, $oldgid) = getolduid_gid(); +printTrace("\n5.1 localuser: $localuser, uid: $newuid, gid: $newgid",2); +printTrace("\n5.0 localuser: $oldlocaluser, uid: $olduid, gid: $oldgid",2); + +# backup 5.1 configuration files in /slapd-instancename/config +printTrace("\nBackup $serverHome${PATHSEP}config on $serverHome${PATHSEP}config_backup ...",0); +&backupConfigFiles(); + +# migrate the schema (need to stop and start the 5.1 server) +printTrace("\nMigrate the schema...",0); +MigrateSchema(); + +# start the server unless it is already started +&startServer() unless (isDirectoryAlive()); + +############### Connect to the 5.1 LDAP Directory Server ###################### +$ENV{"$LIB_PATH"} = "$root${PATHSEP}lib${SEP}".$ENV{"$LIB_PATH"} ; + +die "\n Migration aborted. Check your 5.0 and 5.1 iPlanet Directory Server are installed on the same machine \n" if ( $LDAPservername == -1 ); +$conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Unable to contact the $Version.$Minor LDAP server: $LDAPservername\n"; + +# Cconnection to 5.1 LDAP server is successful ! +printTrace("\nConnected to $Version.$Minor LDAP server",0) ; + +# Parse the main configuration file: dse.ldif +printTrace("\n\nParse the old DSE ldif file: $oldDSEldif *****",0, 1); +printTrace("\nThis may take a while ...\n",0); +&MigrateDSEldif(); + +#migrate LDBM backend instances +printTrace("\n\nMigrate LDBM backend instances...",0,1); +&migrateLDBM_backend_instances(); + +#migrate mapping tree entries +printTrace("\n\nMigrate mapping tree...",0,1); +&migrateMappingTree(); + +#migrate default indexes +printTrace("\n\nMigrate default indexes...",0,1); +migrateDefaultIndexes(); + +#migrate indexes +printTrace("\n\nMigrate indexes...",0,1); +migrateIndexes(); + +#migrate replicas +printTrace("\n\nMigrate replicas...",0,1); +&MigrateNSDS5_replica(); + +#migrate replication agreements +printTrace("\n\nMigrate replication agreements...",0,1); +&MigrateNSDS_replication_agreement(); + +#migrate key/cert databases +printTrace("\n\nMigrate key/cert databases...",0,1); +&MigrateSSL(); + +# migrate certmap.conf +printTrace("\n\nMigrate Certmap.conf...",0,1); +&MigrateCertmap() ; + +################## Close the connection to 5.1 LDAP Server ##################### +printTrace("\n\n***** Close the LDAP connection to the 5.1 Directory Server instance ***** ",0); +$conn->close; + + +################## stop the 5.x instance and Export/Import the data, restart the server ################## +if (@BACKENDS) { + &stopServer($root,'slapd-'.$newname); + printTrace("\nData processing...\n",0,1) ; + # migrate data for each backend: 5.0 -> LDIF files + &manydb2Ldif($ldif_rep); + + # migrate LDIF data to the 5.1 database: LDIF -> 5.1 + &manyLdif2db($ldif_rep); + printTrace("\n***** Migrate ReplicaBindDN entries...\n",0,1); + &importReplicaBindDNEntries(); + printTrace("\n***** Migrate MultiplexorBindDN entries...\n",0,1); + &importMultiplexorBindDNEntries(); + &startServer() unless (isDirectoryAlive()); +} +else { + printTrace("\nINFORMATION - There are no 5.0 non-standard or non-already existing suffixes to migrate\n",0); + printTrace("\n***** Migrate ReplicaBindDN entries...\n",0,1); + &importReplicaBindDNEntries(); + printTrace("\n***** Migrate MultiplexorBindDN entries...\n",0,1); + &importMultiplexorBindDNEntries(); +} + +printMsg("\n\n ****** End of migration ******\n\n"); + +close(LOGFILE); + + +########################################################################################### +# get input users +sub getParameters { + my $exit = 0 ; + my $i = 0; + my $pwdfile= ""; + + while ($i <= $#ARGV) { + if ( "$ARGV[$i]" eq "-D" ) { # directory manager + if (! $rootDN) { + $rootDN = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-w") { # password + if (! $rootpwd) { + $rootpwd = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-j") { # password file + if (! $pwdfile) { + $pwdfile = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-o") { # 4.x instance path + if (! $oldHome ) { + $oldHome = $ARGV[++$i] ; + grep { s@\\@/@g } $oldHome if $isNT ; + if ($oldHome =~ /[\"]?(.*)?[\"]?/) { $oldHome = $1 ; } + if ($oldHome =~ m@^(.*)/([^-/]*)-([^/]*)[/]?$@) { + $oldDir = $1 ; + $type = $2 ; + $oldname = $3 ; + if ($isNT) { + $oldDir = lc($oldDir) ; + $type = lc($type) ; + $oldname = lc($oldname) ; + $oldHome = lc($oldHome) ; + grep { s@/@\\@g } $oldDir ; + grep { s@/@\\@g } $oldHome ; + } + } + else { + print("\nThe old instance path is not correct. It must be like slapd-instancename"); + &usage(); + exit(1); + } + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-n") { # 5.x instance path + if (! $serverHome ) { + $serverHome = $ARGV[++$i] ; + grep { s@\\@/@g } $root if $isNT ; + grep { s@\\@/@g } $serverHome if $isNT ; + if ($serverHome =~ /[\"]?(.*)?[\"]?/) { $serverHome = $1 ; } + if ($serverHome =~ m@^(.*?)/?([^/-]*)-([^/]*)[/]?$@) { + $root = $1 if ($1); + $type = $2 ; + $newname = $3 ; + if ($isNT) { + $root = lc($root) ; + $type = lc($type) ; + $newname = lc($newname) ; + $serverHome = lc($serverHome) ; + grep { s@/@\\@g } $root ; + grep { s@/@\\@g } $serverHome ; + } + } + else { + print("\nThe 5.x instance path is not correct. It must be like slapd-instancename"); + &usage(); + exit(1); + } + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-p") { # 5.x DS port + if (! $newport ) { + $newport = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-t") { # TRACELEVEL + my $value = $ARGV[++$i] ; + if ($value =~ /[0-3]/) { + $TRACELEVEL = $value ; + } + else { + print("\nThe tracelevel must belong to 0..3 interval"); + &usage(); + exit(); + } + } elsif ("$ARGV[$i]" eq "-noinput") { # no user interventions during processing + $NO_INPUT_USER = 1 ; + } elsif ("$ARGV[$i]" eq "-L") { # migration logfile + $LogFileReport = $ARGV[++$i] ; + } + else { + print("\nThe option $ARGV[$i] is not recognized"); + &usage() ; + exit(1); + } + $i++; + } + if (! $rootDN) { + print("\nThe rootDN is missing"); + $exit = 1; + } + if ($pwdfile ne "") { + # Open file and get the password + unless (open (RPASS, $pwfile)) { + die "Error, cannot open password file $passwdfile\n"; + } + $rootpwd = ; + chomp($rootpwd); + close(RPASS); + } elsif ($rootpwd eq "-"){ + # Read the password from terminal + die "The '-w -' option requires an extension library (Term::ReadKey) which is not\n", + "part of the standard perl distribution. If you want to use it, you must\n", + "download and install the module. You can find it at\n", + "http://www.perl.com/CPAN/CPAN.html\n"; + # Remove the previous line and uncomment the following 6 lines once you have installed Term::ReadKey module. +# use Term::ReadKey; +# print "Bind Password: "; +# ReadMode('noecho'); +# $rootpwd = ReadLine(0); +# chomp($rootpwd); +# ReadMode('normal'); + } + if (! $rootpwd) { + print("\nThe rootpwd is missing"); + $exit = 1 ; + } + if (! $newport) { + print("\nThe port is missing"); + $exit = 1; + } + if (! $serverHome) { + print("\nThe new instance path is missing"); + $exit = 1; + } + if (! $oldHome) { + print("\nThe old instance path is missing"); + $exit = 1; + } + if ((! $LogFileReport) && $serverHome) { + ($sec, $min, $hour, $dd, $mm, $yy) = &GetTime(); + $LogFileReport = "${serverHome}${PATHSEP}logs${PATHSEP}Migration_${dd}${mm}${yy}_${hour}${min}${sec}.log"; + } + if ($exit) { + &usage() ; + exit(1); + } + +} + +################################################################################################### + +sub MigrateSchema{ + my $FilesChanged = ""; + my $AllDiffs = ""; + my $NoChanges = "" ; + my $lineToBegin = 0 ; + opendir(SCHEMADIR, $oldSchemaDir) or + die "Error: could not open migrated config dir $oldSchemaDir: $!"; + + foreach $file (readdir(SCHEMADIR)) { + if (! exists($stdIncludes{lc($file)})) { + my $new51file = $schemaDir . $file; + if (-f $new51file ) { + # The ldif file already exists. Make a diff and warn the user if different. + if (diff($new51file, $oldSchemaDir.$file)) { + &stopServer($root,'slapd-'.$newname) if (isDirectoryAlive()); + $AllDiffs .= "\n$file"; + copyBinFile("$oldSchemaDir$file", $new51file); + } + } + else { + &stopServer($root,'slapd-'.$newname) if (isDirectoryAlive()); + $AllDiffs .= "\n$file"; + copyBinFile("$oldSchemaDir$file", $new51file); + } + } + } + closedir(SCHEMADIR); + if ($AllDiffs) { + printMsg("\n\n***********************************************************************"); + printMsg("\nThe following LDIF files have been migrated:"); + printMsg("$AllDiffs"); + printMsg("\n*************************************************************************\n\n"); + } + &startServer() if (! isDirectoryAlive()); +} + + +################################################################################################### +# This subroutine is used to parse the dse.ldif file and call specific routines to act with entries +sub MigrateDSEldif { + printTrace("\nMigrate DSE entries...",1); + my $tempoAlreadyDone = 0; + open( DSELDIF, "< $oldDSEldif" ) || die "Can't open $oldDSEldif: $!: "; + my $in = new Mozilla::LDAP::LDIF(*DSELDIF) ; + while ($entry = readOneEntry $in) { + $typeOfEntry = getTypeOfEntry($entry); + SWITCH: { + if ($typeOfEntry eq "LDBM_BACKEND_INSTANCE"){ + parseLDBM_backend_instance($entry); + last SWITCH; + } + if ($typeOfEntry eq "MAPPING_TREE"){ + parseMapping_tree($entry); + last SWITCH; + } + if ($typeOfEntry eq "DEFAULT_INDEX"){ + parseDefaultIndex($entry); + last SWITCH; + } + if ($typeOfEntry eq "INDEX"){ + parseIndex($entry); + last SWITCH; + } + if ($typeOfEntry eq "STANDARD_PLUGIN"){ + migrateStdPlugin($entry); + last SWITCH; + } + if ($typeOfEntry eq "CONFIG_NODE"){ + migrateConfig_Node($entry); + last SWITCH; + } + if ($typeOfEntry eq "CONFIG_LDBM_DATABASE"){ + migrateConfig_LDBM_database($entry); + last SWITCH; + } + if ($typeOfEntry eq "CHAINING_BACKEND_CONFIG"){ + migrateChainingBE_config($entry); + last SWITCH; + } + if ($typeOfEntry eq "CHAINING_BACKEND_INSTANCE"){ + migrateChainingBE_instance($entry); + last SWITCH; + } + if ($typeOfEntry eq "NSDS5_REPLICA"){ + parseNSDS5_replica($entry); + last SWITCH; + } + if ($typeOfEntry eq "NSDS_REPLICATION_AGREEMENT"){ + parseNSDS_replication_agreement($entry); + last SWITCH; + } + if ($typeOfEntry eq "CHANGELOG5"){ + migrateChangelog5($entry); + last SWITCH; + } + if ($typeOfEntry eq "REPLICATION"){ + migrateReplication($entry); + last SWITCH; + } + if ($typeOfEntry eq "SECURITY"){ + migrateSecurity($entry); + last SWITCH; + } + if ($typeOfEntry eq "SNMP"){ + migrateSNMP($entry); + last SWITCH; + } + } + + } + close(DSELDIF); +} + +############################################################################# +# returns the "type of an entry". If the entry is not to be migrated its type is "NOT_MIGRATED_TYPE" + +sub getTypeOfEntry{ + my $entry = shift; + my $DN = $entry->getDN(1) ; # 1 is to normalize the returned DN + if (($DN =~ /cn=ldbm database,cn=plugins,cn=config$/i) && (isObjectclass($entry,"nsBackendInstance"))) { + return "LDBM_BACKEND_INSTANCE"; + } + if (($DN =~ /cn=mapping tree,cn=config$/i) && (isObjectclass($entry,"nsMappingTree"))) { + return "MAPPING_TREE"; + } + if (($DN =~ /cn=default indexes,cn=config,cn=ldbm database,cn=plugins,cn=config$/i) && (isObjectclass($entry,"nsIndex"))) { + return "DEFAULT_INDEX"; + } + if (isObjectclass($entry,"nsIndex")) { + return "INDEX"; + } + if ((isObjectclass($entry,"nsSlapdPlugin")) && (isStdPlugin($entry))) { + return "STANDARD_PLUGIN"; + } + if ($DN =~ /^cn=config$/i) { + return "CONFIG_NODE"; + } + if ($DN =~ /^cn=config,cn=ldbm database,cn=plugins,cn=config$/i) { + return "CONFIG_LDBM_DATABASE"; + } + if (($DN =~ /^cn=config,cn=chaining database,cn=plugins,cn=config$/i) || ($DN =~ /^cn=default instance config,cn=chaining database,cn=plugins,cn=config$/i)){ + return "CHAINING_BACKEND_CONFIG"; + } + if (($DN =~ /cn=chaining database,cn=plugins,cn=config$/i) && (isObjectclass($entry,"nsBackendInstance"))) { + return "CHAINING_BACKEND_INSTANCE"; + } + if (isObjectclass($entry,"nsDS5Replica")) { + return "NSDS5_REPLICA"; + } + if (isObjectclass($entry,"nsDS5ReplicationAgreement")) { + return "NSDS_REPLICATION_AGREEMENT"; + } + if ($DN =~ /^cn=changelog5,cn=config$/i) { + return "CHANGELOG5"; + } + if (($DN =~ /cn=replication,cn=config$/i) && ($DN !~ /^cn=replication,cn=config$/i)) { + return "REPLICATION"; + } + if ($DN =~ /cn=encryption,cn=config$/i) { + return "SECURITY"; + } + if ($DN =~ /^cn=SNMP,cn=config$/i) { + return "SNMP"; + } + return "NOT_MIGRATED_TYPE"; +} + +############################################################################# + + + +############################################################################# +# returns 1 if the objectclass given in parameter is present in the objectclasses values of the entry +# given in parameter, 0 else + +sub isObjectclass { + my $entry = shift; + my $objectclass = shift; + return ($entry->hasValue("objectclass",$objectclass,1)); +} + +############################################################################# + +sub isStdPlugin { + my $entry = shift; + my $CN = $entry->{cn}[0]; + if (isObjectclass($entry,"nsSlapdPlugin")) { + return 1 if ($stdPlugins{lc($CN)}); + } + return 0; +} + + +############################################################################# + +sub alreadyExistsIn51{ + my $entry = shift; + my $mustExist = shift; + my $DN = $entry->getDN(1); # 1 to normalize the DN + return searchEntry($DN, $mustExist); +} + +############################################################################# +sub searchEntry { + my $DN = shift; + my $mustExist = shift; + my $res = $conn->search($DN, "base", "objectclass=*"); + my $cpt = 5; + if ($res) { + return $res; + } + else { + my $errorCode = $conn->getErrorCode(); + while (($errorCode eq $LDAP_SERVER_UNREACHABLE) && cpt && (! $res)) { + printMsg("\ntry to reconnect to search $DN"); + $conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Unable to contact the $Version.$Minor LDAP server: $LDAPservername\n"; + $res = $conn->search($DN, "base", "objectclass=*"); + $errorCode = $conn->getErrorCode(); + $cpt--; + } + if ($res){ + return $res ; + } + elsif (($errorCode eq $LDAP_SERVER_UNREACHABLE) || ($mustExist)) { + my $msg = $conn->getErrorString(); + printMsg("\n\n*** Failed to search: $DN"); + printMsg("\n*** Error Msg: $msg, Error code: $errorCode"); + } + return 0; + } +} + + +############################################################################# + +sub addEntryTo51{ + my $entry = shift; + my $typeOfEntry = shift; + my $trace = shift; + my $res = $conn->add($entry); + my $DN = $entry->getDN(1); + my $cpt = 5; + if ($res) { + printTrace("\n$typeOfEntry - Add successfull: $DN",$trace); + return 1; + } + else { + my $errorCode = $conn->getErrorCode(); + while (($errorCode eq $LDAP_SERVER_UNREACHABLE) && cpt && (! $res)) { + printMsg("\ntry to reconnect to add $DN"); + $conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Unable to contact the $Version.$Minor LDAP server: $LDAPservername\n"; + $res = $conn->add($entry); + $errorCode = $conn->getErrorCode(); + $cpt--; + } + if ($res){ + printTrace("\n$typeOfEntry - Add successfull: $DN",$trace); + return 1; + } + else { + my $msg = $conn->getErrorString(); + printMsg("\n\n*** $typeOfEntry: Add Failed: $DN"); + printMsg("\n*** Error Msg: $msg, Error code: $errorCode"); + return 0; + } + } +} + +############################################################################# + +sub updateEntry{ + my $entry = shift; + my $typeOfEntry = shift; + my $CHECK = shift; + my $trace = shift; + my $cpt = 5; + if ($CHECK) { + if (! hasChanged($entry, $typeOfEntry)) { + return 1; + } + } + my $res = $conn->update($entry); + my $DN = $entry->getDN(1); + if ($res) { + printTrace("\n$typeOfEntry - Update successfull: $DN",$trace); + return 1 ; + } + else { + my $errorCode = $conn->getErrorCode(); + while (($errorCode eq $LDAP_SERVER_UNREACHABLE) && cpt && (! $res)) { + printMsg("\ntry to reconnect to update $DN"); + $conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Unable to contact the $Version.$Minor LDAP server: $LDAPservername\n"; + $res = $conn->update($entry); + $errorCode = $conn->getErrorCode(); + $cpt--; + } + if ($res){ + printTrace("\n$typeOfEntry - Update successfull: $DN",$trace); + return 1; + } + else { + my $msg = $conn->getErrorString(); + printMsg("\n\n*** $typeOfEntry - Update Failed: $DN"); + printMsg("\n*** Error Msg: $msg, Error code: $errorCode"); + return 0; + } + } +} + + +############################################################################# +# returns 1 if the entry to migrate and the current entry are different one another + +sub hasChanged { + my $entry = shift; + my $typeOfEntry = shift; + my $DN = $entry->getDN(1); + my $new51entry = searchEntry($DN,1); + return 1 if (! $new51entry); # we shoudn't be in that case ... + # do the stuff to check wether the entry has changed or not given its type + if (($typeOfEntry eq "DEFAULT_INDEX") || ($typeOfEntry eq "INDEX")){ + my @indexTypes = $entry->getValues("nsIndexType"); + my @new51indexTypes = $new51entry->getValues("nsIndexType"); + my @nsmatchingrules = $entry->getValues("nsmatchingrule"); + my @new51nsmatchingrules = $new51entry->getValues("nsmatchingrule"); + return 1 if (Diffs(\@indexTypes, \@new51indexTypes)); + return 1 if (Diffs(\@nsmatchingrules,\@new51nsmatchingrules)); + return 0; + } + if ($typeOfEntry eq "CHANGELOG5"){ + printTrace("\nCheck wether changelog has changed or not",3); + my @params = keys(%changelog5params); + foreach $param (@params){ + my @values = $entry->getValues($param); + my @new51values = $new51entry->getValues($param); + return 1 if (Diffs(\@values,\@new51values)); + } + return 0; + } + if ($typeOfEntry eq "SNMP"){ + foreach $param (@SNMPparams){ + my @values = $entry->getValues($param); + my @new51values = $new51entry->getValues($param); + return 1 if (Diffs(\@values,\@new51values)); + } + return 0; + } + # we don't know how to compare such type of entry => just return 1 + return 1 ; +} + +sub isAsystemIndex { + my $index = shift; + return ($index->hasValue("nsSystemIndex","true",1)); +} + + +sub updatePathInPluginArgs { + my $plugin = shift; + my $argNum = 0; + my $argPrefix = "nsslapd-pluginarg"; + my $cont = 1; + my $Unix_oldDir = ${oldDir} ; + my $Unix_root = ${root} ; + grep { s@\\@/@g } $Unix_oldDir if $isNT; + grep { s@\\@/@g } $Unix_root if $isNT; + while ($cont) { + my $arg = $argPrefix . $argNum ; + if ($plugin->exists($arg)) { + $_ = $plugin->{$arg}[0] ; + s@$Unix_oldDir@$Unix_root@ig ; + s/$type-$oldname/$type-$newname/ig ; + $plugin->setValues($arg, $_) ; + } + else { + $cont = 0 ; + } + $argNum++; + } + return $plugin; +} + + +sub Diffs { + my $valuesToMigrate = shift; + my $currentValues = shift; + return 1 if (getDiff(\@{$valuesToMigrate},\@{$currentValues})); + return 1 if (getDiff(\@{$currentValues},\@{$valuesToMigrate})); + return 0 ; +} + +sub getDiff { + # we get references to arrays + my $elements = shift ; + my $existing_elements = shift ; + my %count = () ; + my %countEE = () ; + @diff = () ; + foreach $e (@{$elements}, @{$existing_elements}) { $count{$e}++ ;} + foreach $e (@{existing_elements}) { $countEE{$e}++ ;} + foreach $e (@{$elements}) { + # if $e is only present in @$elements, we push it to the diff array + if (($count{$e} == 1) && ($countEE{$e} == 0)) { + push @diff, $e ; + } + } + return @diff ; +} + +sub registerSuffix_Backend { + my $ldbmDatabase = shift; + my $CN = $ldbmDatabase->{cn}[0]; + my $suffixArg = "nsslapd-suffix"; + my $suffix = $ldbmDatabase->{$suffixArg}[0]; + $oldBackends{$suffix} = $CN; +} + + +############################################################################# +# # +# # +# # +############################################################################# +sub migrateLDBM_backend_instances { + foreach $entry (@LDBM_backend_instances) { + my $DN = $entry->getDN(1); # 1 is to normalize the DN + my $CN = $entry->{cn}[0]; + if ($DN =~/cn=netscaperoot,cn=ldbm database/i){ + printTrace("\n\n*** INFORMATION - NetscapeRoot is NOT migrated",0); + } + else { + if(alreadyExistsIn51($entry)){ + printMsg("\n\n*** LDBM_BACKEND_INSTANCE - $DN already exists"); + printMsg("\n*** Migration will not update it"); + } + else { + printTrace("\nWe should add the backend instance $DN",3); + my $suffixarg = "nsslapd-suffix" ; + my $suffixname= $entry->{$suffixarg}[0] ; + my $new51entry = $conn->newEntry() ; + $new51entry->setDN($DN); + $new51entry->setValues("objectclass", "top", "extensibleObject", "nsBackendInstance" ); + $new51entry->setValues("cn", $CN ); + $new51entry->setValues($suffixarg, $suffixname); + my @params = keys(%LDBMparamToMigrate); + foreach $param (@params) { + my @values = $entry->getValues($param); + $new51entry->setValues($param, @values) if (@values); + } + if (addEntryTo51($new51entry, "LDBM_BACKEND_INSTANCE",1)) { + push @BACKENDS, $CN; + } + } + } + } +} + +sub parseLDBM_backend_instance { + my $entry = shift; + ®isterSuffix_Backend($entry); + push @LDBM_backend_instances, $entry; +} + +############################################################################# +sub migrateMappingTree { + foreach $entry (@Mapping_tree_entries) { + my $DN = $entry->getDN(1); # 1 si to normalize the DN + if ($DN =~/cn=\"o=netscaperoot\",cn=mapping tree,cn=config/i){ + # DO NOTHING + } + else { + if(alreadyExistsIn51($entry)){ + printMsg("\n\n*** MAPPING_TREE - $DN already exists"); + printMsg("\n*** Migration will not update it"); + } + else { + addEntryTo51($entry, "MAPPING_TREE",1); + } + } + } +} + + +sub parseMapping_tree{ + my $entry = shift; + push @Mapping_tree_entries, $entry; +} + +############################################################################# +sub migrateDefaultIndexes { + foreach $index (@default_indexes) { + my $CN = $index->{cn}[0]; + my $new51index ; + if ((! isAsystemIndex($index)) && (! $deniedIndexes{lc($CN)})) { + if ($new51index = alreadyExistsIn51($index)) { + if (! isAsystemIndex($new51index)) { + updateEntry($index, "DEFAULT_INDEX", 1, 2); + } + } + else { + addEntryTo51($index, "DEFAULT_INDEX", 2); + } + } + } +} + + +sub parseDefaultIndex{ + my $index = shift; + push @default_indexes, $index; +} + +############################################################################# + +sub migrateIndexes { + foreach $index (@indexes) { + my $CN = $index->{cn}[0]; + my $new51index; + if ((! isAsystemIndex($index)) && (! $deniedIndexes{lc($CN)}) && (DN !~ /cn=netscaperoot,cn=index/i)){ + if ($new51index = alreadyExistsIn51($index)) { + if (! isAsystemIndex($new51index)) { + updateEntry($index, "INDEX", 1, 2); + } + } + else { + addEntryTo51($index, "INDEX", 2); + } + } + } +} + +sub parseIndex{ + my $index = shift; + push @indexes, $index; +} + +############################################################################# + +sub newLDIFplugin { + my $current51plugin = shift; + my $DN = $current51plugin->getDN(1); + my $new51plugin = $conn->newEntry() ; + $new51plugin->setDN($DN); + foreach $Attr (@pluginAttrs) { + my @values = $current51plugin->getValues($Attr); + $new51plugin->setValues($Attr, @values) if (@values); + } + return $new51plugin; +} + +sub migrateStdPlugin{ + my $plugin = shift; + my $DN = $plugin->getDN(1); + my $pluginEnable = "nsslapd-pluginEnabled"; + my $argNum = 0; + my $argPrefix = "nsslapd-pluginarg"; + my $current51plugin ; + if ($current51plugin = alreadyExistsIn51($plugin, 1)) { + $plugin = updatePathInPluginArgs($plugin); + my $pluginEnableValue = $plugin->{$pluginEnable}[0]; + my $cont = 1; + my $pluginHasChanged = 0; + my $new51plugin = &newLDIFplugin($current51plugin); + if (! $current51plugin->hasValue($pluginEnable,$pluginEnableValue,1)){ + $new51plugin->setValues($pluginEnable, $pluginEnableValue); + $pluginHasChanged = 1 unless ($pluginHasChanged); + } + while($cont){ + my $arg = $argPrefix . $argNum ; + if ($plugin->exists($arg)) { + my @values = $plugin->getValues($arg); + my $value = $values[0] ; + $new51plugin->setValues($arg, $value) if (@values); + if ($current51plugin->exists($arg)) { + if (! $current51plugin->hasValue($arg,$value,1)) { + $pluginHasChanged = 1 unless ($pluginHasChanged); + } + } + else { + $pluginHasChanged = 1 unless ($pluginHasChanged); + } + } + else { + if ($current51plugin->exists($arg)) { + # Just Warn the user. Do nothing. + printTrace("\nCompared to 5.0, the current 5.1 plugin $DN belongs this attribute: $arg",2); + } + else { + $cont = 0 ; + } + } + $argNum++; + } + updateEntry($new51plugin, "STANDARD_PLUGIN", 0, 1) if ($pluginHasChanged); + } +} + +############################################################################# + +sub migrateConfig_Node{ + my $config_node = shift; + my @params = keys(%GeneralSrvParamToMigrate); + my $hasChanged = 0; + my $new51config_node; + if ($new51config_node = alreadyExistsIn51($config_node, 1)){ + foreach $param (@params) { + if ($config_node->exists($param)){ + my @valuesToMigrate = $config_node->getValues($param); + if (@valuesToMigrate){ + if ($new51config_node->exists($param)){ + my @currentValues = $new51config_node->getValues($param); + if (Diffs(\@valuesToMigrate, \@currentValues)) { + $new51config_node->setValues($param, @valuesToMigrate); + $hasChanged = 1 unless ($hasChanged); + printTrace("\nParam to update: $param with value @valuesToMigrate",3); + } + } + else { + $new51config_node->setValues($param, @valuesToMigrate); + $hasChanged = 1 unless ($hasChanged); + printTrace("\nParam to update: $param with value @valuesToMigrate",3); + } + } + } + } + updateEntry($new51config_node, "CONFIG_NODE", 0, 1) if ($hasChanged); + } +} + +############################################################################# + +sub migrateConfig_LDBM_database{ + my $config_ldbm = shift; + my @params = keys(%GlobalConfigLDBMparamToMigrate); + my $hasChanged = 0; + my $new51config_ldbm ; + if ($new51config_ldbm = alreadyExistsIn51($config_ldbm, 1)) { + foreach $param (@params) { + if ($config_ldbm->exists($param)){ + my @valuesToMigrate = $config_ldbm->getValues($param); + if (@valuesToMigrate){ + if ($new51config_ldbm->exists($param)){ + my @currentValues = $new51config_ldbm->getValues($param); + if (Diffs(\@valuesToMigrate, \@currentValues)) { + $new51config_ldbm->setValues($param, @valuesToMigrate); + $hasChanged = 1 unless ($hasChanged); + } + } + else { + $new51config_ldbm->setValues($param, @valuesToMigrate); + $hasChanged = 1 unless ($hasChanged); + } + } + } + } + updateEntry($new51config_ldbm, "CONFIG_LDBM_DATABASE", 0, 1) if ($hasChanged); + } +} + +############################################################################# + +sub migrateChainingBE_config{ + my $chaining_config = shift; + my $DN = $chaining_config->getDN(1); + my @params = (); + my $hasChanged = 0; + my $new51chaining_config; + if ($DN =~ /^cn=config,cn=chaining database,cn=plugins,cn=config$/i){ + $new51chaining_config = searchEntry("cn=config,cn=chaining database,cn=plugins,cn=config"); + @params = keys(%ChainingConfigParams); + } + if ($DN =~ /^cn=default instance config,cn=chaining database,cn=plugins,cn=config$/i){ + $new51chaining_config = searchEntry("cn=default instance config,cn=chaining database,cn=plugins,cn=config"); + @params = keys(%ChainingDefaultInstanceConfigParams); + } + foreach $param (@params) { + if ($chaining_config->exists($param)){ + my @valuesToMigrate = $chaining_config->getValues($param); + if (@valuesToMigrate){ + printTrace("\nParam: $param values To migrate: @valuesToMigrate",3); + if ($new51chaining_config->exists($param)){ + my @currentValues = $new51chaining_config->getValues($param); + printTrace("\nParam: $param 51 current values: @currentValues",3); + if (Diffs(\@valuesToMigrate, \@currentValues)) { + $new51chaining_config->setValues($param, @valuesToMigrate); + $hasChanged = 1 unless ($hasChanged); + } + } + else { + $new51chaining_config->setValues($param, @valuesToMigrate); + $hasChanged = 1 unless ($hasChanged); + } + } + } + } + updateEntry($new51chaining_config, "CHAINING_BACKEND_CONFIG", 0, 1) if ($hasChanged); +} + +############################################################################# + +sub registerSuffix_ChainingBE { + my $ldbmDatabase = shift; + my $CN = $ldbmDatabase->{cn}[0]; + my $suffixArg = "nsslapd-suffix"; + my $suffix = $ldbmDatabase->{$suffixArg}[0]; + $oldChainingBackends{$suffix} = $CN; +} + +sub storeMultiplexorBindDN { + my $chaining_instance = shift; + my $DN = $chaining_instance->getDN(1); + if ($chaining_instance->exists("nsMultiplexorBindDN")){ + my $bindDN = $chaining_instance->{nsMultiplexorBindDN}[0]; + my $new51bindDN = searchEntry($bindDN); + if (! $new51bindDN){ + # the bindDN entry doesn't yet exist in 5.1 => it will have to be migrated + $MultiplexorBindDNEntriesToMigrate{$bindDN}="\n" ; + printTrace("\nThe bindDN: $bindDN need to be migrated",3); + } + else { + # do nothing as the entry already exists in 5.1 + } + } + +} + +sub importMultiplexorBindDNEntries { + # import all entries present in @MultiplexorBindDNEntriesToMigrate in 5.1 + my @MultiplexorBindDNs = keys (%MultiplexorBindDNEntriesToMigrate); + my $ldif_dir = $ldif_rep; + foreach $bindDN (@MultiplexorBindDNs) { + printTrace("\nimportMultiplexorBindDNEntries: bindDN to migrate: $bindDN",3); + # get the backend in which is stored the bind DN entry + my $backendtoExportFrom = getBackendtoExportFrom($bindDN); + printTrace("\nbackendtoExportFrom is: $backendtoExportFrom",3); + # check wether the backend has been imported in 5.1 or not + if (! alreadyMigrated($backendtoExportFrom)) { + if ($backendtoExportFrom ne $NULL) { + # if not imported => we need to import the binf DN entry + &startServer() unless (isDirectoryAlive()); + $conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Unable to contact the $Version.$Minor LDAP server: $LDAPservername\n"; + &ExportAndAddEntry($bindDN, $backendtoExportFrom, $ldif_dir); + } + else { + # do nothing + } + } + } + # remove the empty ldif directory + rmdir($ldif_dir) if (-d $ldif_dir); + # close the LDAP connection to 5.1 + $conn->close if ($conn); +} + +sub migrateChainingBE_instance{ + my $chaining_instance = shift; + my $DN = $chaining_instance->getDN(1); + ®isterSuffix_ChainingBE($chaining_instance); + if (alreadyExistsIn51($chaining_instance)) { + # already exists + printMsg("\n\n*** CHAINING_BACKEND_INSTANCE - $DN already exists"); + printMsg("\n*** Migration will not update it"); + } + else { + &migrate_credential($chaining_instance, "nsmultiplexorcredentials"); + addEntryTo51($chaining_instance, "CHAINING_BACKEND_INSTANCE", 1); + storeMultiplexorBindDN($chaining_instance); + } +} + +############################################################################# + +# create a new LDIF representation of a 5.1 replica consumer +sub newLDIFreplica { + my $replica = shift; + my $DN = $replica->getDN(1); + my $new51replica = $conn->newEntry() ; + my $MASTER_OR_MULTIMASTER = "3" ; + $new51replica->setDN($DN); + foreach $Attr (@nsds5replicaAttrs) { + my @values = $replica->getValues($Attr); + $new51replica->setValues($Attr, @values) if (@values); + } + my $replicaType = $replica->{nsDS5ReplicaType}[0]; + if ($replicaType eq $MASTER_OR_MULTIMASTER) { + my @nsState = $replica->getValues("nsState"); + $new51replica->setValues("nsState", @nsState); + } + else { + $new51replica->setValues("nsDS5ReplicaId", $replicaIdvalue); + } + return $new51replica; +} + +sub MigrateNSDS5_replica{ + foreach $replica (@new51replicas) { + my $DN = $replica->getDN(1); + my $new51replica; + if (alreadyExistsIn51($replica)) { + # replica already exists + printMsg("\n\n*** NSDS5_REPLICA - $DN already exists"); + printMsg("\n*** Migration will not update it"); + } + else { + $new51replica = &newLDIFreplica($replica); + addEntryTo51($new51replica, "NSDS5_REPLICA", 1); + storeReplicaBindDN($replica); + } + } +} + +sub parseNSDS5_replica{ + my $replica = shift; + push @new51replicas, $replica; +} + +sub storeReplicaBindDN { + my $replica = shift; + my $DN = $replica->getDN(1); + if ($replica->exists("nsDS5ReplicaBindDN")){ + my $bindDN = $replica->{nsDS5ReplicaBindDN}[0]; + my $new51bindDN = searchEntry($bindDN); + if (! $new51bindDN){ + # the bindDN entry doesn't yet exist in 5.1 => it will have to be migrated + $ReplicaBindDNEntriesToMigrate{$bindDN}="\n" ; + printTrace("\nThe bindDN: $bindDN need to be migrated",3); + } + else { + # do nothing as the entry already exists in 5.1 + } + } +} + + +sub importReplicaBindDNEntries { + # import all entries present in @ReplicaBindDNEntriesToMigrate in 5.1 + my @ReplicaBindDNs = keys (%ReplicaBindDNEntriesToMigrate); + my $ldif_dir = $ldif_rep; + foreach $bindDN (@ReplicaBindDNs) { + printTrace("\nimportReplicaBindDNEntries: bindDN to migrate: $bindDN",3); + # get the backend in which is stored the bind DN entry + my $backendtoExportFrom = getBackendtoExportFrom($bindDN); + printTrace("\nbackendtoExportFrom is: $backendtoExportFrom",3); + # check wether the backend has been imported in 5.1 or not + if (! alreadyMigrated($backendtoExportFrom)) { + if ($backendtoExportFrom ne $NULL) { + # if not imported => we need to import the binf DN entry + &startServer() unless (isDirectoryAlive()); + $conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Unable to contact the $Version.$Minor LDAP server: $LDAPservername\n"; + &ExportAndAddEntry($bindDN, $backendtoExportFrom, $ldif_dir); + } + else { + # do nothing + } + } + } + # remove the empty ldif directory + rmdir($ldif_dir) if (-d $ldif_dir); + # close the LDAP connection to 5.1 + $conn->close if ($conn); +} + +sub alreadyMigrated { + my $backendToCheck = shift; + foreach $backend (@BACKENDS) { + return 1 if ($backend eq $backendToCheck); + } + return 0 ; +} + +sub belongsSuffix { + my $suffix = shift; + my $bindDN = shift; + return ($bindDN =~ /$suffix\s*$/i); +} + +sub length { + my $suffix = shift; + my $count = 0; + while ($suffix =~ /./g) { + $count++; + } + return $count ; +} + +sub getBackendtoExportFrom { + my $bindDN = shift ; + my $sizeOfSuffix = 0 ; + my $NULL = ""; + my @oldSuffixes = keys(%oldBackends); + my @oldChainingSuffixes = keys(%oldChainingBackends); + my $bindDN_backend = $NULL; + foreach $suffix (@oldSuffixes){ + printTrace("\ngetBackendtoExportFrom: suffix to compare with is: $suffix",3); + if ((belongsSuffix($suffix,$bindDN)) && (length($suffix) > $sizeOfSuffix)) { + $sizeOfSuffix = length($suffix); + $bindDN_backend = $oldBackends{$suffix}; + printTrace("\ngetBackendtoExportFrom: bindDN_backend: $bindDN_backend, sizeOfSuffix: $sizeOfSuffix",3); + } + } + foreach $suffix (@oldChainingSuffixes){ + printTrace("\ngetBackendtoExportFrom: suffix to compare with is a chained suffix: $suffix",3); + if ((belongsSuffix($suffix,$bindDN)) && (length($suffix) > $sizeOfSuffix)) { + printMsg("\n\n*** Entry stored on a remote backend - $bindDN"); + printMsg("\n*** We don't migrate it"); + return $NULL; + } + } + return $bindDN_backend ; +} + + +sub getBackendtoImportTo { + my $bindDN = shift; + my $sizeOfSuffix = 0; + my $NULL = ""; + my $suffixArg = "nsslapd-suffix"; + my $bindDN_backend = $NULL; + open( DSELDIF, "< $DSEldif" ) || die "Can't open $DSEldif: $!: "; + my $in = new Mozilla::LDAP::LDIF(*DSELDIF) ; + while ($entry = readOneEntry $in) { + $typeOfEntry = getTypeOfEntry($entry); + if ($typeOfEntry eq "LDBM_BACKEND_INSTANCE"){ + my $suffix = $entry->{$suffixArg}[0]; + if ((belongsSuffix($suffix,$bindDN)) && (length($suffix) > $sizeOfSuffix)) { + $sizeOfSuffix = length($suffix); + $bindDN_backend = $entry->{cn}[0]; + } + } + } + close(DSELDIF); + return $bindDN_backend ; +} + + +sub ExportAndAddEntry { + my $DN = shift; + my $backendtoExportFrom = shift; + my $ldif_dir = shift; + my $ldif = "$ldif_dir${PATHSEP}$backendtoExportFrom.ldif" ; + # first: export entry pointed out by the $DN to $ldif file + $ENV{"$LIB_PATH"}="$oldDir${PATHSEP}lib${SEP}".$ENV{"$LIB_PATH"}; + if (! $ldif_dir) { $ldif_dir = $ldif_rep ;} + if (!(-d $ldif_dir)) { + mkdir($ldif_dir,0777) or die "\ncan't create $ldif_dir to store temporary ldif files\n"; + } + chdir($oldSlapdExecDir) or die "\nCould not change directory to $oldSlapdExecDir: $!\n"; + &db2Ldif($ldif, $backendtoExportFrom, $DN); + chdir($curdir) or die "\nCould not change directory to $curdir: $!\n"; + + # then: Add it to 5.1 + if (! $conn) { + $conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Unable to contact the $Version.$Minor LDAP server: $LDAPservername\n"; + } + open( BINDDNLDIF, "< $ldif" ) || die "\nCan't open $ldif: $!: \n"; + my $in = new Mozilla::LDAP::LDIF(*BINDDNLDIF) ; + while ($entry = readOneEntry $in) { + my $entryDN = $entry->getDN(1); + if ($DN eq $entryDN) { + addEntryTo51($entry, "nsds5ReplicaBindDN", 0); + } + } + close(BINDDNLDIF); + # remove the ldif file after the import + unlink($ldif) ; +} + +############################################################################# +sub MigrateNSDS_replication_agreement { + foreach $replicationAgreement (@replicationAgreements) { + my $DN = $replicationAgreement->getDN(1); + if (alreadyExistsIn51($replicationAgreement)){ + # replication agreement already exists + printMsg("\n\n*** NSDS_REPLICATION_AGREEMENT - $DN already exists"); + printMsg("\n*** Migration will not update it"); + } + else { + &migrate_credential($replicationAgreement, "nsDS5ReplicaCredentials"); + addEntryTo51($replicationAgreement, "NSDS_REPLICATION_AGREEMENT", 1); + } + } +} + + +sub parseNSDS_replication_agreement{ + my $replicationAgreement = shift; + push @replicationAgreements, $replicationAgreement ; +} + +############################################################################# + +sub migrateChangelog5{ + my $changelog = shift; + my $DN = $changelog->getDN(1); + my $changelogdir = "nsslapd-changelogdir"; + if (alreadyExistsIn51($changelog)){ + # cn=changelog5,cn=config already exists in 5.1 + my $new51changelog = searchEntry($DN); + my @new51changelodir = $new51changelog->getValues($changelogdir); + $changelog->setValues($changelogdir, @new51changelogdir); + updateEntry($changelog, "CHANGELOG5", 0, 1); + } + else { + # cn=changelog5,cn=config need to be created in 5.1. + # the changelogdir value must be setup to /slapd-instance/changelogdb + $changelog->setValues($changelogdir,"${serverHome}${PATHSEP}changelogdb"); + addEntryTo51($changelog, "CHANGELOG5", 1); + } +} + +############################################################################# + +sub migrateReplication{ + my $replication = shift; + my $DN = $replication->getDN(1); + if (alreadyExistsIn51($replication)){ + # replication agreement already exists + printMsg("\n\n*** $DN already exists"); + printMsg("\n*** Migration will not update it"); + } + else { + addEntryTo51($replication, "REPLICATION", 1); + } +} + +############################################################################# + +sub migrateSecurity{ + my $security = shift; + if (alreadyExistsIn51($security)){ + # already exists in 5.1 + updateEntry($security, "SECURITY", 0, 1); + } + else { + addEntryTo51($security, "SECURITY", 1); + } +} + +############################################################################# + +sub migrateSNMP{ + my $snmp = shift; + if (alreadyExistsIn51($snmp)){ + # already exists in 5.1 + updateEntry($snmp, "SNMP", 0, 1); + } + else { + addEntryTo51($snmp, "SNMP", 1); + } +} + +############################################################################# +# printMsg print message to the user standard output. + +sub printMsg { + + my $TypeMsg = shift ; + my $Msg = shift ; + my $LineNb = shift ; + if ($LineNb) { + printTrace("Line: $LineNb, $TypeMsg, $Msg"); + } + else { + printTrace("$TypeMsg $Msg"); + } +} + +############################################################################# +# print message error to the user standard output. + +sub printTrace { + + my $Msg = shift ; + my $level = shift ; + my $sep = shift ; + + if ($sep) { + print "\n-------------------------------------------------------------------------"; + print LOGFILE "\n-------------------------------------------------------------------------"; + } + + if ($level <= $TRACELEVEL) { + print($Msg); + print LOGFILE $Msg ; + } +} + +############################################################################# +# this subroutine implements a very stupid version of diff + +sub diff { + my $f1 = shift; + my $f2 = shift; + my $lineToBeginWith = shift; + my $NULL = "" ; + my $diff_f1 = $NULL ; + my $diff_f2 = $NULL ; + my $retval = $NULL ; + my $ret; + open(F1, "$f1") or die "Could not open file $f1"; + open(F2, "$f2") or close(F1), die "Could not open file $f2"; + + while (defined($l1 = )) { + if ($lineToBeginWith){ + $lineToBeginWith -- ; + next ; + } + next if ($l1 =~ /^\#/); + $ret = defined($l2 = ); + if ($ret) { + $ret = defined($l2 = ) while ($ret && ($l2 =~ /^\#/)) ; + if ($ret) { + if (!($l1 eq $l2)) { + + # ignore whitespace + $l1_clean = $l1 ; + $l2_clean = $l2 ; + $l1_clean =~ s/\s//g; + $l2_clean =~ s/\s//g; + + if (!($l1_clean eq $l2_clean)) { + $diff_f1 .= "${l1}" unless ($l1_clean eq $NULL); + $diff_f2 .= "${l2}" unless ($l2_clean eq $NULL); + } + } + } + else { + next if ($l1 =~ /^\s*$/) ; + $diff_f1 .= "${l1}"; + } + } + else { + next if ($l1 =~ /^\s*$/) ; + $diff_f1 .= "${l1}"; + } + } + + while (defined($l2 = )) { + if (($l2 =~ /^\#/) || ($l2 =~ /^\s*$/)) { + next ; + } + else { + $diff_f2 .= "${l2}" ; + } + } + + close(F1); + close(F2); + + $retval .= "- differences present in your config file but not in standard file:\n\n". "$diff_f1\n" if ($diff_f1) ; + $retval .= "- differences present in standard file but not in your config file:\n\n" . "$diff_f2" if ($diff_f2) ; + return $retval ; +} + +sub CompareStdConfigFiles { + # Compare each configuration file against its default version. If it has changed, + # notify the user that the file has changed and will need to be checked by the + # user. This should be safe to do because there should be no path information + # stored in these conf files, which are just schema stuff. + # printTrace("\nCheck if standard configuration files have changed",3); + + # get the version of the DS to migrate + ($oldVersion, $oldMinor) = &getVersion($oldDir); + # get the version of the new DS + ($Version, $Minor) = &getVersion($root); + + my $origFilePath = "$oldDir${PATHSEP}bin${PATHSEP}slapd${PATHSEP}install${PATHSEP}schema${PATHSEP}" ; + my $FilesChanged = ""; + my $AllDiffs = "***********************************************************************"; + my $NoChanges = "" ; + my $lineToBegin = 0 ; + opendir(CONFDIR, $oldSchemaDir) or + die "Error: could not open migrated config dir $oldConfDir: $!"; + + foreach $file (readdir(CONFDIR)) { + $origFile = $origFilePath . $file ; + $configFile = $oldSchemaDir . $file ; + if (( exists($stdIncludes{lc($file)})) && (-f $origFile)) { + $diffs = &diff($configFile, $origFile, $lineToBegin); + $lineToBegin = 0 if $lineToBegin ; + if ($diffs) { + $FilesChanged .= "\n$configFile"; + $AllDiffs .= "\n$configFile is different than the standard configuration file" ; + $AllDiffs .= "\nYou will need to check this file and make sure its changes are compatible "; + $AllDiffs .= "with the new directory server\nHere are the differences:\n"; + $AllDiffs .= "$diffs \n\n"; + $AllDiffs .= "***********************************************************************"; + } + else { + $NoChanges .= "\n$configFile"; + } + } + } + closedir(CONFDIR); + +if ($FilesChanged) { + printTrace("\nNo changes to old configuration files:$NoChanges",3) ; + printTrace("\n***********************************************************************",3) ; + printMsg("\nThe following standard files have been modified: $FilesChanged"); + if ($NO_INPUT_USER) { + # do nothing + } + else { + printMsg("\nDo you want to see the differences Yes/No [No] ?") ; + my $answer = ; + if ($answer =~ /y|yes/i) { + printMsg("$AllDiffs"); + } + printMsg("\nDo you want to continue the migration Yes/No [No] ?"); + $answer = ; + if (! ($answer =~ /y|yes/i)) { + exit(1); + } + } + } +} + + + +############################################################################# + +# this is used to run the system() call, capture exit and signal codes, +# and die() upon badness; the first argument is a directory to change +# dir to, if any, and the rest are passed to system() +sub mySystem { + my $rc = &mySystemNoDie(@_); + my ($dir, @args) = @_; + if ($rc == 0) { +# success + } elsif ($rc == 0xff00) { + die "Error executing @args: error code $rc: $!"; + } elsif ($rc > 0x80) { + $rc >>= 8; + die "Error executing @args: error code $rc: $!"; + } else { + if ($rc & 0x80) { + $rc &= ~0x80; + } + die "Error executing @args: received signal $rc: $!"; + } + + # usually won't get return value + return $rc; +} + +# This version does not die but just returns the error code +sub mySystemNoDie { + my ($dir, @args) = @_; + if ($dir && ($dir ne "")) { + chdir($dir) or die "Could not change directory to $dir: $!"; + } + my $cmd = $args[0]; + # the system {$cmd} avoids some NT shell quoting problems if the $cmd + # needs to be quoted e.g. contains spaces; the map puts double quotes + # around the arguments on NT which are stripped by the command + # interpreter cmd.exe; but don't quote things which are already quoted + my @fixargs = map { /^[\"].*[\"]$/ ? $_ : $quote . $_ . $quote } @args; + my $rc = 0; + if ($cmd =~ /[.](bat|cmd)$/) { + # we have to pass batch files directly to the NT command interpreter + $cmd = $com_spec; +# print "system $cmd /c \"@fixargs\"\n"; + $rc = 0xffff & system {$cmd} '/c', "\"@fixargs\""; + } else { +# print "system $cmd @fixargs\n"; + $rc = 0xffff & system {$cmd} @fixargs; + } + chdir(${curdir}) or die "Could not change directory to $curdir: $!"; + return $rc; +} + +########################################################################################### +# # +# Export/Import of the backends in @BACKENDS # +# # +########################################################################################### + +sub manydb2Ldif { + my $ldif_dir = shift; + $ENV{"$LIB_PATH"}="$oldDir${PATHSEP}lib${SEP}".$ENV{"$LIB_PATH"}; + if (! $ldif_dir) { $ldif_dir = $ldif_rep ;} + if (!(-d $ldif_dir)) { + mkdir($ldif_dir,0777) or die "can't create $ldif_dir to store temporary ldif files"; + } + chdir($oldSlapdExecDir) or die "Could not change directory to $oldSlapdExecDir: $!"; + foreach $backend (@BACKENDS) { + my $ldif = "${ldif_dir}$backend.ldif" ; + &db2Ldif($ldif, $backend); + } + print " Done.\n"; + chdir($curdir) or die "Could not change directory to $curdir: $!"; +} + +sub db2Ldif { + my $ldif = shift ; + my $backend = shift ; + my $include_suffix = shift ; + my $db2ldif_param ; + if ($include_suffix) { + $db2ldif_param = "db2ldif -D $oldHome -n $backend -a $ldif -s \"$include_suffix\""; + } + else { + $db2ldif_param = "db2ldif -D $oldHome -n $backend -a $ldif"; + } + open(DB2LDIF, "${quote}${quote}$slapdExecName${quote} $db2ldif_param${quote} 2>&1 |") or die "Could not run ns-slapd program $ldif2db_exe\n"; + sleep(1); # allow some data to accumulate in the pipe + my $ii = 0; + while () { + ++$ii; + if (($ii % 250) == 0) { + printMsg(" Processing...\n"); + } + printMsg($_); + } + close(DB2LDIF); + # set the ownership of the ldif file; should be the same as the 5.x slapd user id + if ((! $isNt) && ($oldlocaluser ne $localuser)) { + if (-f $ldif) { + chown( $newuid, $newgid, $ldif) or printMsg("\nUnable to change the ownership of $ldif to $localuser") ; + } + } +} + +sub manyLdif2db { + my $ldif_dir = shift; + $ENV{"$LIB_PATH"}="$root${PATHSEP}lib${SEP}".$ENV{"$LIB_PATH"}; + chdir($slapdExecDir) or die "Could not change directory to $slapdExecDir: $!"; + foreach $backend (@BACKENDS) { + my $ldif = "${ldif_dir}$backend.ldif" ; + &Ldif2db($ldif, $backend); + } + # remove the empty ldif directory + rmdir($ldif_dir); + chdir($curdir) or die "Could not change directory to $curdir: $!"; +} + + +sub Ldif2db { + my $ldif = shift ; + my $backend = shift ; + my $ldif2db_param = "ldif2db -D $serverHome -n $backend -i $ldif"; + open(LDIF2DB, "${quote}${quote}$slapdExecName${quote} $ldif2db_param${quote} 2>&1 |") or die "Could not run ns-slapd program $ldif2db_exe\n"; + sleep(1); # allow some data to accumulate in the pipe + while () { + printMsg($_); + } + close(LDIF2DB); + # remove the ldif file after the import + unlink($ldif) ; +} + + +########################################################################################### +# # +# Running/Stopping the Server # +# # +########################################################################################### + + + +sub isDirectoryAlive { + die "\n Migration aborted. Check your 5.0 and 5.1 iPlanet Directory Server are installed on the same machine \n" if ( $LDAPservername == -1 ); + my $test_conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd); + if ($test_conn) { + $test_conn->close(); + return 1; + } + else { + return 0 ; + } +} + + +sub startServer { + my $instanceDir = ${serverHome} ; + my $errLog = $instanceDir . $PATHSEP . 'logs' . $PATHSEP . 'errors'; + # emulate tail -f + # if the last line we see does not contain "slapd started", try again + my $done = 0; + my $started = 0; + my $code = 0; + my $lastLine = ""; + my $timeout = time + 240; # 4 minutes + $ENV{"$LIB_PATH"}="${root}${PATHSEP}lib${SEP}".$ENV{"$LIB_PATH"}; + + my $startCmd = $instanceDir . $PATHSEP . 'start' . $script_suffix; + if (! -f $startCmd) { + $startCmd = $instanceDir . $PATHSEP . 'start-slapd' . $script_suffix; + } + $code = &mySystem($instanceDir,$startCmd); + open(IN, $errLog) or die "Could not open error log $errLog: $!"; + my $pos = tell(IN); + while (($done == 0) && (time < $timeout)) { + for (; ($done == 0) && ($_ = ); $pos = tell(IN)) { + $lastLine = $_; + # print; + # the server has already been started and shutdown once . . . + if (/slapd started\./) { + $started++; + if ($started == 2) { + $done = 1; + } + # sometimes the server will fail to come up; in that case, restart it + } elsif (/Initialization Failed/) { + # print "Server failed to start: $_"; + $code = &mySystem($instanceDir, $startCmd); + # sometimes the server will fail to come up; in that case, restart it + } elsif (/exiting\./) { + # print "Server failed to start: $_"; + #$code = &mySystem($startCmd); + $code = &mySystem($instanceDir, $startCmd); + } + } + if ($lastLine =~ /PR_Bind/) { + # server port conflicts with another one, just report and punt + print $lastLine; + print "This server cannot be started until the other server on this\n"; + print "port is shutdown.\n"; + $done = 1; + } + if ($done == 0) { + # rest a bit, then . . . + sleep(2); + # . . . reset the EOF status of the file desc + seek(IN, $pos, 0); + } + } + close(IN); + + sleep(5); + die "\nUnable to start the $Version.$Minor iPlanet Directory Server\n" unless (isDirectoryAlive()); + + return 0; +} + +sub stopServer { + my $root = shift; + my $name = shift; + $maxStopIterations = 5; + print "\nShutting down server $name . . .\n"; + $ENV{"$LIB_PATH"}="$root${PATHSEP}lib${SEP}".$ENV{"$LIB_PATH"}; + $stopCmd = $quote . $root . $PATHSEP . $name . $PATHSEP . 'stop' . $script_suffix . $quote; + if (! -f $stopCmd) { + $stopCmd = $quote . $root . $PATHSEP . $name . $PATHSEP . 'stop-slapd' . $script_suffix . $quote; + } + + if (! -f $stopCmd) { + # no stop command, probably a 1.X system; for NT, we'll try net stop + # for unix, we'll get the pid and kill it + if ($isNT) { + $stopCmd = 'net stop ' . $name; + } else { + # see if there is a pid file + $pidfile = $root . $PATHSEP . $name . $PATHSEP . 'logs' . + $PATHSEP . 'pid'; + if (open(PIDFILE, $pidfile)) { + chomp($pid = ); + close(PIDFILE); + while ($maxStopIterations-- && !$exitCode) { + $exitCode = kill(15, $pid); + } + $stopCmd = undef; + } + } + } + + # keep looping until the stop cmd returns an error code, which usually + # means that what ever we want to stop is stopped, or some other error + # occurred e.g. permission, or no such service + $exitCode = &runAndIgnoreOutput($stopCmd); +# print "stopServer: exitCode=$exitCode\n"; + while ($stopCmd && $maxStopIterations-- && $exitCode) { + $exitCode = &runAndIgnoreOutput($stopCmd); +# print "stopServer: exitCode=$exitCode\n"; + } + + if (!$maxStopIterations) { + print "Warning: could not shutdown the server: $!\n"; + } + sleep(10) ; + $exitCode = 0; +} + + +sub runAndIgnoreOutput { + my $cmd = shift; + printMsg("."); + open(RUNCMD, "${quote}$cmd${quote} 2>&1 |") or die "Error: could not run $cmd: $!"; + printMsg("."); + sleep(1); # allow pipe to fill with data + printMsg("."); + while () { +# print; + } + my $code = close(RUNCMD); +# print "runAndIgnore: code=$code status=$?\n"; + return $?; +} + +############################################################################# +# migrate SSL info + +sub MigrateSSL { + my $secPwd = 'bidon' ; + # copy the SSL directory + ©Dir("$oldHome${PATHSEP}ssl","$serverHome${PATHSEP}ssl") if (-d "$oldHome${PATHSEP}ssl"); + # copy the cert db and key files + if ( -d "$oldDir${PATHSEP}alias") { + $aliasDir = "$root${PATHSEP}alias"; + if (! -d $aliasDir) { + mkdir($aliasDir, 0750); + } + my $keydb = "$aliasDir${PATHSEP}slapd-$newname-key3.db" ; + my $certdb = "$aliasDir${PATHSEP}slapd-$newname-cert7.db" ; + my $old_keydb = "$oldDir${PATHSEP}alias${PATHSEP}slapd-$oldname-key3.db" ; + my $old_certdb = "$oldDir${PATHSEP}alias${PATHSEP}slapd-$oldname-cert7.db"; + my $keydb_backup = "$aliasDir${PATHSEP}slapd-$newname-key3.db_backup" ; + my $certdb_backup = "$aliasDir${PATHSEP}slapd-$newname-cert7.db_backup" ; + if (-f $old_keydb) { + if (-f $keydb) { + if ($NO_INPUT_USER) { + printMsg("\n$keydb already exists. backup in $keydb_backup ..."); + ©BinFile($keydb,$keydb_backup); + ©BinFile($old_keydb,$keydb); + } + else { + print("\n\n$keydb already exists. Do you want to overwrite it ? [no]: "); + my $answer = ; + if ($answer =~ /^y|yes$/i) { + ©BinFile($old_keydb,$keydb); + } + } + } + else { + ©BinFile($old_keydb,$keydb); + } + } + if (-f $old_certdb) { + if (-f $certdb) { + if ($NO_INPUT_USER) { + printMsg("\n$certdb already exists. backup in $certdb_backup ..."); + ©BinFile($certdb,$certdb_backup); + ©BinFile($old_certdb,$certdb); + } + else { + print("\n\n$certdb already exists. Do you want to overwrite it ? [no]: "); + my $answer = ; + if ($answer =~ /^y|yes$/i) { + ©BinFile($old_certdb,$certdb); + } + } + } + else { + ©BinFile($old_certdb,$certdb); + } + } + # copy the old password file + if (-f "$oldDir${PATHSEP}alias${PATHSEP}$type-$oldname-pin.txt") { + ©BinFile( + "$oldDir${PATHSEP}alias${PATHSEP}$type-$oldname-pin.txt", + "$aliasDir${PATHSEP}$type-$newname-pin.txt" + ); + } + } + +} + +sub DisableSSL { + my $entry = $conn->search("cn=config","base","objectclass=*"); + my $LDAPparam = "nsslapd-security" ; + my $Value = "off" ; + if ($entry->{$LDAPparam}[0] ne $Value) { + printTrace("\nDisable SSL...",1); + $entry->setValues($LDAPparam, $Value); + } + my $res = $conn->update($entry); + if ($res) { + printTrace("\nSSL disabled",2); + } + else { + printMsg("\nCan't disabled SSL. The server may have problems to start"); + } +} + +# enable the migration of client authentication informations +sub MigrateCertmap { + # backup the old certmap.conf and replace it with the new one + my $oldCertmap = "$oldDir${PATHSEP}shared${PATHSEP}config${PATHSEP}certmap.conf"; + my $newCertmap = "$root${PATHSEP}shared${PATHSEP}config${PATHSEP}certmap.conf" ; + my $backupCertmap = "$root${PATHSEP}shared${PATHSEP}config${PATHSEP}certmap.conf_backup" ; + if (-f $oldCertmap) { + if ($NO_INPUT_USER) { + printMsg("\n$newCertmap has been backup in $backupCertmap"); + ©BinFile($newCertmap,$backupCertmap); + ©BinFile($oldCertmap,$newCertmap); + } + else { + my $Ask = 1 ; + while ($Ask) { + printMsg("\n\nWhere do you want to back up the file $newCertmap [$backupCertmap] ?") ; + my $Answer = ; + $backupCertmap = $Answer if ($Answer ne "\n"); + chomp($backupCertmap); + printTrace("\nDest: .$backupCertmap.",4); + if (-e $backupCertmap) { + printMsg("\n\n$backupCertmap already exists. Do you want to overwrite it Yes/No [No] ?") ; + if ( =~ /yes|y/i) { + $Ask = 0 ; + } + else { + $backupCertmap = "$root${PATHSEP}shared${PATHSEP}config${PATHSEP}certmap.conf_backup" ; + } + } + else { + $Ask = 0 ; + } + } + printTrace("\nBackup file: $newCertmap in $backupCertmap",4); + ©BinFile($newCertmap,$backupCertmap); + ©BinFile($oldCertmap,$newCertmap); + } + } + else { + } +} + +sub hasChangedoldCertmap { + my $certmapfile = shift ; + my @reference = ("certmap default default", + "default:DNComps", + "default:FilterComps e") ; + my $cpt = 0 ; + printTrace("\nhasChangedoldCertmap",3); + open(CERTMAP,"< $certmapfile"); + while () { + if ((! /^\s*#/) && (! /^\s*$/)) { + my $ref = $reference[$cpt] ; + printTrace("\nValue: $_, ref: $ref",4); + if (! /^\s*$ref\s*$/) { + return 1 ; + } + else { + $cpt++ ; + } + } + } + close (CERTMAP); + printTrace("\ncpt: $cpt",4); + if ($cpt < $#reference) { + return 1 ; + } + else { + return 0 ; + } +} + + +########################################################################################### +# # +# Copy directory and files functions # +# # +########################################################################################### + + +sub copyDir { + my $src = shift; + my $dest = shift; + my $exclude = shift; + + opendir( SRC, $src ) or die "Can't open directory $src: $!: "; + my $mode; + my $uid; + my $gid; + mkdir ( $dest , 0755 ) or die "\nCan't create directory $dest. \nPlease check you have enough rights to create it and/or check that your parent directory exists.\n" if !( -e $dest ); + if ($PRESERVE) { + $mode = (stat($src))[2]; + ($uid, $gid) = (stat(_))[4..5]; + # Make sure files owned by the old user are owned by the + # new user + if ($uid == $olduid) { + $uid = $newuid; + $gid = $newgid; + } + chown $uid, $gid, $dest; + chmod $mode, $dest; + } + local ( @files ) = readdir ( SRC ); + closedir( SRC ); + for ( @files ) { + if ( $_ eq "." || $_ eq ".." ) { + next; + } elsif ( $exclude && /$exclude/ ) { + next; + } elsif( -d "$src${PATHSEP}$_") { + ©Dir ( "$src${PATHSEP}$_", "$dest${PATHSEP}$_" ); + } else { + ©BinFile ( "$src${PATHSEP}$_", "$dest${PATHSEP}$_"); + } + } +} + +sub copyBinFile { + my $src = shift; + my $dest = shift; + my $buf = ""; + my $bufsize = 8192; + + open( SRC, $src ) || die "Can't open $src: $!\n"; + # if we are given a directory destination instead of a file, extract the + # filename portion of the source to use as the destination filename + if (-d $dest) { + $dest = $dest . $PATHSEP . &basename($src); + } + open( DEST, ">$dest" ) || die "Can't create $dest: $!\n"; + binmode SRC; + binmode DEST; + if ($PRESERVE) { + $mode = (stat($src))[2]; + ($uid, $gid) = (stat(_))[4..5]; + # Make sure files owned by the old user are owned by the + # new user + if ($uid == $olduid) { + $uid = $newuid; + $gid = $newgid; + } + chown $uid, $gid, $dest; + chmod $mode, $dest; + } + while (read(SRC, $buf, $bufsize)) { + print DEST $buf; + } + close( SRC ); + close( DEST ); +} + +############################################################################################################# +# backup 5.x configuration files # +# backup the directory /slapd-instance/config dans /slapd-instance/BackupConfig # # +# # +############################################################################################################# + + +sub backupConfigFiles { + # backup the 5.x config files + my $src = "$serverHome${PATHSEP}config" ; + my $dest = "$serverHome${PATHSEP}config_backup" ; + if ($NO_INPUT_USER) { + printMsg("\n$src has been backup in $dest"); + ©Dir($src,$dest); + } + else { + my $Ask = 1 ; + while ($Ask) { + printMsg("\n\nWhere do you want to back up your configuration directory [$dest] ?") ; + my $Answer = ; + $dest = $Answer if ($Answer ne "\n"); + chomp($dest); + printTrace("\nDest: .$dest.",4); + if (-e $dest) { + printMsg("\n\n$dest already exists. Do you want to overwrite it Yes/No [No] ?") ; + if ( =~ /yes|y/i) { + $Ask = 0 ; + } + else { + $dest = "$serverHome${PATHSEP}config_backup" ; + } + } + else { + $Ask = 0 ; + } + } + printTrace("\nBackup Directory: $src in $dest",4); + ©Dir($src,$dest); + } +} +############################################################################# + +sub getLDAPservername { + my $oldLDAPservername; + my $LDAPservername; + my $localhost = "nsslapd-localhost"; + open(OLDDSELDIF, "< $oldDSEldif") or die "\nError: could not open old config file $oldDSEldif \n"; + my $in = new Mozilla::LDAP::LDIF(*OLDDSELDIF) ; + while ($entry = readOneEntry $in) { + my $DN = $entry->getDN(1) ; + if ($DN =~ /^cn=config$/i) { + my @values = $entry->getValues($localhost); + if ($entry->size($localhost)) { + $oldLDAPservername = $values[0]; + printTrace("\nName of the old LDAP server: $oldLDAPservername",3); + } + break; + } + } + close(OLDSELDIF); + + open( DSELDIF, "< $DSEldif" ) || die "\nCan't open $DSEldif \n"; + my $in = new Mozilla::LDAP::LDIF(*DSELDIF) ; + while ($entry = readOneEntry $in) { + my $DN = $entry->getDN(1) ; + if ($DN =~ /^cn=config$/i) { + my @values = $entry->getValues($localhost); + if ($entry->size($localhost)) { + $LDAPservername = $values[0]; + printTrace("\nName of the new LDAP server: $LDAPservername",3); + } + break; + } + } + close(DSELDIF); + # check ol and new Directory Instance are installed on the same physical machine. + if (lc($oldLDAPservername) ne lc($LDAPservername)) { + # warn the user he tries to migrate a 4.x server installed on a different machine from the 5.x one + printMsg("\n\nYour old instance is on $oldLDAPservername, whereas your new instance is on $LDAPservername. Migration on different machines is not supported. Do you want to continue ? Yes/No [No]:") ; + if (! ( =~ /yes|y/i)) { + return -1; + } + } + return $LDAPservername ; +} + +############################################################################# + +sub getVersion { + my $dir = shift; + my $version = 0; + my $minor = 0; + my $buildNumber = 0; + my $progDir = "${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${PATHSEP}"; + my $progDir2 = "${PATHSEP}bin${PATHSEP}slapd${PATHSEP}"; + + # find the slapd executable + $prog = $dir . $progDir . $slapdExecName; + if (! -f $prog) { + $prog = $dir . $progDir2 . $slapdExecName; + if (-f $prog && $isNT) { + # if slapd is in bin/slapd and we're on NT, just assume version 1; + # apparently, slapd.exe doesn't like the -v argument . . . + return ( '1', $minor ); + } + else{ + die "Could not run slapd program $prog: $!"; + } + } + else { + chdir($dir . $progDir) or die "Could not change directory to $dir$progDir: $!";; + } + $ENV{"$LIB_PATH"}="$dir${PATHSEP}lib${SEP}".$ENV{"$LIB_PATH"}; + # read the old version from the old slapd program + + open(F, "${quote}${quote}$prog${quote} -v${quote} 2>&1 |") or + die "Could not run slapd program $prog: $!"; + sleep(1); # allow some data to accumulate in the pipe +# print "Output from $prog -v:\n"; + while () { + #print; + if (/^Netscape-Directory\/(\d+)\.(\d+)\s+(\S+)/) { + $version = $1; + $minor = $2; + $buildNumber = $3; + last; + } + elsif (/^Netscape-Directory\(restrict?ed-mode\)\/(\d+)\.(\d+)\s+(\S+)/) { # we can have restricted-mode or restriced-mode ... + $version = $1; + $minor = $2; + $buildNumber = $3; + last; + } + elsif (/^iPlanet-Directory\/(\d+)\.(\d+)\s+(\S+)/i) { + $version = $1; + $minor = $2; + $buildNumber = $3; + last; + } + } + $code = close(F); +# print "$prog returned code=$code status=$?\n"; + $ENV{"$LIB_PATH"}="$root${PATHSEP}lib${SEP}".$ENV{"$LIB_PATH"}; + + if ($version == 0) { + die "\nCould not determine version of the directory server in $dir: \n"; + } + + # distinguish the 4.1 and the 4.11 thanks to the buildNumber + if (($version == 4) && ($minor == 1)){ + if (! ($buildNumber =~ /^B99\.16/)) { + # it's not a 4.1 Netscape Directory Server => it's a 4.11 + $minor = 11 ; + } + } + chdir($curdir) or die "Could not change directory to $curdir: $!" ; + return ( $version, $minor ); +} + + +############################################################################################### +sub normalizeDir { + my $dir = shift ; + my $dir_prec = "" ; + while ($dir_prec ne $dir) { + $dir_prec = $dir ; + if ($isNT) { + grep { s@\\\\@\\@g } $dir ; + } + else { + grep { s@//@/@g } $dir ; + } + } + return $dir ; +} + + +############################################################################################### + +sub GetTime { + my $tm = localtime; + (my $sec, my $min, my $hour, my $dd, my $mm, my $yy) = ($tm->sec, $tm->min, $tm->hour, $tm->mday, ($tm->mon)+1, ($tm->year)+1900); + $sec = "0$sec" unless $sec > 9 ; + $min = "0$min" unless $min > 9 ; + $hour = "0$hour" unless $hour > 9 ; + $dd = "0$dd" unless $dd > 9 ; + $mm = "0$mm" unless $mm > 9 ; + return ($sec, $min, $hour, $dd, $mm, $yy); +} + +############################################################################################### +# get uid and group id of the 5.x slapd server. +# The uid is done through the nsslapd-localuser attribute + +sub getuid_gid { + my $newuid ; + my $newgid ; + my $localuser ; + my $localuser_attr = "nsslapd-localuser" ; + if (! $isNT) { + &startServer() unless (isDirectoryAlive()); + my $conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Can't contact the $Version.$Minor LDAP server: $LDAPservername\n"; + my $entry = $conn->search("cn=config ", "base","objectclass=*", 0, ($localuser_attr)) ; + # Tests wether we succeed to get the entry cn=config + die "\nCan't get the entry cn=config \n" unless ($entry); + my @values = $entry->getValues($localuser_attr); + $conn->close(); + if ($#values == -1 || ($values[0] eq "") ) { # tests wether the nsslapd-localuser attribute has a value + printMsg("\nNo localuser has been found in the configuration of the directory. "); + if ($NO_INPUT_USER) { + printMsg("\nWe considered nobody as the localuser"); + $localuser = "nobody" ; + } + else { + my $Ask = 1 ; + while ($Ask) { + printMsg("\nUnder what user does your $Version.$Minor directory server run [nobody] ? ") ; + $localuser = ; + chomp($localuser); + $localuser = "nobody" if ($localuser eq ""); + ($newuid, $newgid) = (getpwnam("$localuser"))[2..3] ; + if ($newuid) { + $Ask = 0 ; + } + else { + printMsg("\nError: $localuser is unknown from the system "); + } + } + } + } + else { + $localuser = $values[0]; # returns the first value (we should only have one localuser) + my $size = $#values ; + } + ($newuid, $newgid) = (getpwnam("$localuser"))[2..3] ; + return ($localuser, $newuid, $newgid) ; + } + else { + return () ; + } +} + +sub getolduid_gid { + my $oldlocaluser ; + my $localuserAttr = "nsslapd-localuser"; + my $entry ; + if (! $isNT) { + open( DSELDIF, "< $oldDSEldif" ) || die "Can't open $oldDSEldif: $!: "; + my $in = new Mozilla::LDAP::LDIF(*DSELDIF) ; + while ($entry = readOneEntry $in) { + $typeOfEntry = getTypeOfEntry($entry); + if ($typeOfEntry eq "CONFIG_NODE") { + $oldlocaluser = $entry->{$localuserAttr}[0] if ($entry->exists($localuserAttr)); + break ; + } + } + close(DSE); + ($olduid, $oldgid) = (getpwnam("$oldlocaluser"))[2..3] ; + return ($oldlocaluser, $olduid, $oldgid) ; + } + else { + return (); + } +} +############################################################################################### +# get current directory + +sub getCwd { + my $command = $isNT ? "cd" : "/bin/pwd"; + open(PWDCMD, "$command 2>&1 |") or + die "Error: could not execute $command: $!"; + # without the following sleep, reading from the pipe will + # return nothing; I guess it gives the pwd command time + # to get some data to read . . . + sleep(1); + my $currentdir; + while () { + if (!$currentdir) { + chomp($currentdir = $_); + } + } + my $code = close(PWDCMD); +# if ($code || $?) { +# print "$command returned code=$code status=$? dir=$curdir\n"; +# } +# print "getCwd curdir=\[$curdir\]\n"; + return $currentdir; +} + +################################ +# Need to migrate the credential. +# If the credential can not be migrated, leave it at it is +################################ +sub migrate_credential{ + my $entry_to_modify = shift; + my $credentials_attr = shift; + my @old_value = $entry_to_modify->getValues($credentials_attr); + my $migratecredExecName = 'migratecred'; + + my @new_cred = `${quote}${quote}$root${PATHSEP}bin${PATHSEP}slapd${PATHSEP}admin${PATHSEP}bin${PATHSEP}$migratecredExecName${quote} -o $oldHome -n $serverHome -c @old_value`; + + if ( $? == 0 ) + { + $entry_to_modify->setValues($credentials_attr, @new_cred); + } +} + diff --git a/ldap/admin/src/scripts/template-migrate5to6 b/ldap/admin/src/scripts/template-migrate5to6 new file mode 100644 index 00000000..3cc5bd58 --- /dev/null +++ b/ldap/admin/src/scripts/template-migrate5to6 @@ -0,0 +1,3043 @@ +#{{PERL-EXEC}} +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2004 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# + +# Migrate a 5.x directory server to a 6.2 directory server + +####################################################################################################### +# enable the use of Perldap functions +require DynaLoader; + +use Getopt::Std; +use Mozilla::LDAP::Conn; +use Mozilla::LDAP::Entry; +use Mozilla::LDAP::LDIF; +use Mozilla::LDAP::Utils qw(:all); +use Mozilla::LDAP::API qw(:api :ssl :apiv3 :constant); # Direct access to C API +use Time::localtime; +use File::Basename; +use Class::Struct ; + +####################################################################################################### + +sub usage { + print(STDERR "\nUsage: $0 -D rootdn { -w password | -w - | -j filename } -p port \n"); + print(STDERR " -o oldInstancePath -n newInstancePath [-t tracelevel] [-L logfile]\n"); + print(STDERR "************** parameters in brackets are optionals, others are required **************\n"); + print(STDERR " Opts: -D rootdn - new 6.2 Directory Manager\n"); + print(STDERR " : -w password - new 6.2 Directory Manager's password\n"); + print(STDERR " : -w - - Prompt for new 6.2 Directory Manager's password\n"); + print(STDERR " : -j filename - Read new 6.2 Directory Manager's password from file\n"); + print(STDERR " : -p port - new 6.2 Directory Server port\n"); + print(STDERR " : -o oldInstancePath - Path of the old instance to migrate \n"); + print(STDERR " : -n newInstancePath - Path of the new 6.2 instance\n"); + print(STDERR " : [-d dataPath] - Path to directory containing data files to import into new instance\n"); + print(STDERR " : [-v oldVersion] - Version of old instance (obtained by running $slapdExecName -v\n"); + print(STDERR " : [-t tracelevel] - (optional) specify the level of trace (0..3)\n"); + print(STDERR " : [-L logfile] - (optional) specify the file to log the migration report \n"); + } +######################################################################################################## + +BEGIN { + + require 'uname.lib' ; + $isNT = -d '\\'; + $PATHSEP = $isNT ? "\\" : "/"; + ${SEP} = $isNT ? ";" : ":" ; + @INC = ( '.', '../../../admin/admin/bin'); + grep { s@/@\\@g } @INC if $isNT; + $script_suffix = $isNT ? ".bat" : ""; + $exe_suffix = $isNT ? ".exe" : ""; + # NT needs quotes around some things unix doesn't + $quote = $isNT ? "\"" : ""; + + # If this variable is set, all file/directory creation will make sure the mode + # and ownership of the destination is the same as the source + $PRESERVE = 1 if (!$isNT); + $script_suffix = $isNT ? ".bat" : ""; + $exe_suffix = $isNT ? ".exe" : ""; + if ($isNT) { + $os = "WINNT"; + } else { + $os = &uname("-s"); + } + if ($isNT) { + # we have to pass batch files directly to the NT command interpreter + $com_spec = $ENV{ComSpec}; + if (!$com_spec) { + $com_spec = $ENV{COMSPEC}; + } + if (!$com_spec || ! -f $com_spec) { + # find the first available command interpreter + foreach $drive (c..z) { + $com_spec = "$drive:\\winnt\\system32\\cmd.exe"; + last if (-f $com_spec); + $com_spec = undef; + } + if (! $com_spec) { + # punt and pray + $com_spec = 'c:\winnt\system32\cmd.exe'; + } + } + } + if ( $os eq "AIX" ) { + $dll_suffix = "_shr.a"; + } + elsif ( $os eq "HP-UX" ) { + $dll_suffix = ".sl"; + } + elsif ( $os eq "WINNT" ) { + $dll_suffix = ".dll"; + } + else { + $dll_suffix = ".so"; + } + $slapdExecName = $isNT ? 'slapd.exe' : './ns-slapd'; + select STDERR; + $| = 1; + select STDOUT; + $| = 1; +} + +SWITCH: { + if ($os eq "AIX") { + $LIB_PATH = "LIBPATH" ; + last SWITCH ; + } + if ($os eq "HP-UX") { + $LIB_PATH = "SHLIB_PATH" ; + last SWITCH ; + } + if ($isNT) { + $LIB_PATH = "PATH" ; + last SWITCH ; + } + else { + $LIB_PATH = "LD_LIBRARY_PATH" ; + last SWITCH ; + } + } + + # old parameters + ${oldDir} = "" ; + ${oldname} = "" ; + ${oldHome} = "" ; + ${oldConfDir} = "" ; + ${oldlocaluser} ; + ${olduid} ; + ${oldgid} ; + + # new parameters + ${root} = "{{DS-ROOT}}" ; + ${type} = "" ; + ${newname} = "" ; + ${newport} = "" ; + ${rootDN} = "" ; + ${rootpwd} = "" ; + ${localhost} = "" ; + ${LogFileReport} = "" ; + ${newuid} ; + ${localuser} ; + ${newgid} ; + $NO_INPUT_USER = 0 ; # by default user can give inputs during the migration process + ${curdir} = getCwd(); + ${slapdExecDir} = "${root}${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${PATHSEP}"; + # in 6.2 the replica Id is setup to a static value + $replicaIdvalue = 65535; + + # specify the level of trace + $TRACELEVEL=1; + + $LDAP_SERVER_UNREACHABLE = 81; + + # get input users + &getParameters() ; + ${oldDir} = &normalizeDir("${oldDir}"); + ${oldHome} = "${oldDir}${PATHSEP}$type-$oldname" ; + ${oldConfDir} = "${oldHome}${PATHSEP}config${PATHSEP}" ; + ${oldSchemaDir} = "${oldConfDir}schema${PATHSEP}"; + ${oldDSEldif} = "${oldConfDir}dse.ldif"; + ${serverHome} = "${root}${PATHSEP}$type-$newname" ; + ${schemaDir} = "$serverHome${PATHSEP}config${PATHSEP}schema${PATHSEP}"; + ${DSEldif} = "$serverHome${PATHSEP}config${PATHSEP}dse.ldif"; + ${ldif_rep} = "${oldConfDir}ldif${PATHSEP}" ; + ${oldSlapdExecDir} = "${oldDir}${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${PATHSEP}"; + + open(LOGFILE, ">> $LogFileReport"); + + printTrace("\noldDir: $oldDir, oldHome: $oldHome, \noldConfDir: $oldConfDir, \nldif_rep: $ldif_rep, \nrootDN: $rootDN, \nPort: $newport, \nNewname: $newname\n",3); + printTrace("\nLIB_PATH: $LIB_PATH",4); + + if (!(-d $serverHome)) { + printMsg("\n$serverHome doesn't exist\n"); + exit(1); + } + if (!(-d $oldHome)) { + printMsg("\n$oldHome doesn't exist\n"); + exit(1); + } + + if ($olddatadir && !(-d $olddatadir)) { + print("\n$olddatadir doesn't exist\n"); + exit(1); + } + + +%HashParametersName = (); + +# The following hash displays only general server parameters to migrate under cn=config +%GeneralSrvParamToMigrate = ( + 'nsslapd-accesscontrol'=> '\n', + 'nsslapd-errorlog-logging-enabled'=> '\n', + 'nsslapd-accesslog-logging-enabled'=> '\n', + 'nsslapd-auditlog-logging-enabled'=> '\n', + 'nsslapd-accesslog-level'=> '\n', + 'nsslapd-accesslog-logbuffering'=> '\n', + 'nsslapd-accesslog-logexpirationtime'=> '\n', + 'nsslapd-accesslog-logexpirationtimeunit'=> '\n', + 'nsslapd-accesslog-logmaxdiskspace'=> '\n', + 'nsslapd-accesslog-logminfreediskspace'=> '\n', + 'nsslapd-accesslog-logrotationtime'=> '\n', + 'nsslapd-accesslog-logrotationtimeunit'=> '\n', + 'nsslapd-accesslog-maxlogsize'=> '\n', + 'nsslapd-accesslog-maxLogsPerDir'=> '\n', + 'nsslapd-attribute-name-exceptions'=> '\n', + 'nsslapd-auditlog-logexpirationtime'=> '\n', + 'nsslapd-auditlog-logexpirationtimeunit'=> '\n', + 'nsslapd-auditlog-logmaxdiskspace'=> '\n', + 'nsslapd-auditlog-logminfreediskspace'=> '\n', + 'nsslapd-auditlog-logrotationtime'=> '\n', + 'nsslapd-auditlog-logrotationtimeunit'=> '\n', + 'nsslapd-auditlog-maxlogsize'=> '\n', + 'nsslapd-auditlog-maxLogsPerDir'=> '\n', + 'nsslapd-certmap-basedn'=> '\n', + 'nsslapd-ds4-compatible-schema'=> '\n', + 'nsslapd-enquote-sup-oc'=> '\n', + 'nsslapd-errorlog-level'=> '\n', + 'nsslapd-errorlog-logexpirationtime'=> '\n', + 'nsslapd-errorlog-logexpirationtimeunit'=> '\n', + 'nsslapd-errorlog-logmaxdiskspace'=> '\n', + 'nsslapd-errorlog-logminfreediskspace'=> '\n', + 'nsslapd-errorlog-logrotationtime'=> '\n', + 'nsslapd-errorlog-logrotationtimeunit'=> '\n', + 'nsslapd-errorlog-maxlogsize'=> '\n', + 'nsslapd-errorlog-maxlogsperdir'=> '\n', + 'nsslapd-groupevalnestlevel'=> '\n', + 'nsslapd-idletimeout'=> '\n', + 'nsslapd-ioblocktimeout'=> '\n', + 'nsslapd-lastmod'=> '\n', + 'nsslapd-listenhost'=> '\n', + 'nsslapd-maxdescriptors'=> '\n', + 'nsslapd-nagle'=> '\n', + 'nsslapd-readonly'=> '\n', + 'nsslapd-referralmode'=> '\n', + 'nsslapd-plugin-depends-on-name'=> '\n', + 'nsslapd-plugin-depends-on-type'=> '\n', + 'nsslapd-referral'=> '\n', + 'nsslapd-reservedescriptors'=> '\n', + 'nsslapd-rootpwstoragescheme'=> '\n', + 'nsslapd-schemacheck'=> '\n', + 'nsslapd-secureport'=> '\n', + 'nsslapd-security'=> '\n', + 'nsslapd-sizelimit'=> '\n', + 'nsslapd-ssl3ciphers'=> '\n', + 'nsslapd-timelimit'=> '\n', + 'passwordchange'=> '\n', + 'passwordchecksyntax'=> '\n', + 'passwordexp'=> '\n', + 'passwordhistory'=> '\n', + 'passwordinhistory'=> '\n', + 'passwordlockout'=> '\n', + 'passwordlockoutduration'=> '\n', + 'passwordmaxage'=> '\n', + 'passwordmaxfailure'=> '\n', + 'passwordminage'=> '\n', + 'passwordminlength'=> '\n', + 'passwordmustchange'=> '\n', + 'passwordresetfailurecount' => '\n', + 'passwordstoragescheme' => '\n', + 'passwordunlock' => '\n', + 'passwordwarning' => '\n' +); + +# the following hash displays global parameters related to database stored under cn=config,cn=ldbm database,cn=plugins,cn=config +%GlobalConfigLDBMparamToMigrate = ( + 'nsslapd-allidsthreshold' => '\n', + 'nsslapd-lookthroughlimit' => '\n', + 'nsslapd-mode' => '\n', + 'nsslapd-dbcachesize' => '\n', + 'nsslapd-cache-autosize' => '\n', + 'nsslapd-cache-autosize-split' => '\n', + 'nsslapd-db-transaction-logging' => '\n', + 'nsslapd-import-cachesize' => '\n' +); + +# the following hash displays specific parameters to each backends and stored under cn=DBname,cn=ldbm database,cn=plugins,cn=config +%LDBMparamToMigrate = ( + 'nsslapd-cachesize' => '\n', + 'nsslapd-cachememsize' => '\n', + 'nsslapd-readonly' => '\n', + 'nsslapd-require-index' => '\n' +); + + +%ChainingConfigParams = ( + 'nsactivechainingcomponents' => '\n', + 'nstransmittedcontrols' => '\n' + ); + +%ChainingDefaultInstanceConfigParams = ( + 'nsabandonedsearchcheckinterval' => '\n', + 'nsbindconnectionslimit' => '\n', + 'nsbindtimeout' => '\n', + 'nsbindretrylimit' => '\n', + 'nshoplimit' => '\n', + 'nsmaxresponsedelay' => '\n', + 'nsmaxtestresponsedelay' => '\n', + 'nschecklocalaci' => '\n', + 'nsconcurrentbindlimit' => '\n', + 'nsconcurrentoperationslimit' => '\n', + 'nsconnectionlife' => '\n', + 'nsoperationconnectionslimit' => '\n', + 'nsproxiedauthorization' => '\n', + 'nsreferralonscopedsearch' => '\n', + 'nsslapd-sizelimit' => '\n', + 'nsslapd-timelimit' => '\n' +); + +%changelog5params = ( + 'nsslapd-changelogmaxage' => '\n', + 'nsslapd-changelogmaxentries' => '\n' + ); + +@SNMPparams = ( + 'nssnmpenabled', + 'nssnmporganization', + 'nssnmplocation', + 'nssnmpcontact', + 'nssnmpdescription', + 'nssnmpmasterhost', + 'nssnmpmasterport', + 'nssnmpenabled', + 'aci' + ); + +%stdIncludes = ( + "." => "\n", + ".." => "\n", + "30ns-common.ldif " => "\n", + "50ns-mail.ldif " => "\n", + "50ns-news.ldif" => "\n", + "50iplanet-servicemgt.ldif"=> "\n", + "50netscape-servicemgt.ldif"=> "\n", + "50ns-mcd-browser.ldif" => "\n", + "50ns-proxy.ldif" => "\n", + "00core.ldif" => "\n", + "50ns-admin.ldif" => "\n", + "50ns-mcd-config.ldif " => "\n", + "50ns-value.ldif" => "\n", + "05rfc2247.ldif" => "\n", + "50ns-calendar.ldif" => "\n", + "50ns-mcd-li.ldif" => "\n", + "50ns-wcal.ldif" => "\n", + "05rfc2927.ldif" => "\n", + "50ns-certificate.ldif" => "\n", + "50ns-mcd-mail.ldif" => "\n", + "50ns-web.ldif" => "\n", + "10rfc2307.ldif" => "\n", + "50ns-compass.ldif" => "\n", + "50ns-media.ldif" => "\n", + "20subscriber.ldif" => "\n", + "50ns-delegated-admin.ldif"=> "\n", + "50ns-mlm.ldif" => "\n", + "25java-object.ldif" => "\n", + "50ns-directory.ldif" => "\n", + "50ns-msg.ldif" => "\n", + "28pilot.ldif" => "\n", + "50ns-legacy.ldif" => "\n", + "50ns-netshare.ldif" => "\n" +); + + +# Backends migrated (Backend CN attribute value) +@BACKENDS = () ; +# All pairs of suffix-backend are registered in this hashtable +%oldBackends = () ; + +#store the backend instances to migrate +@LDBM_backend_instances = (); + +#store the mapping tree +@Mapping_tree_entries = (); + +#store the suffix and the associated chaining backend +%oldChainingBackends = (); + +#store the multiplexor bind entries to migrate +%MultiplexorBindDNEntriesToMigrate = (); + +#store the Replica bind DN entries to migrate +%ReplicaBindDNEntriesToMigrate = (); + +# list of standard plugins +%stdPlugins = ( + "7-bit check" => "\n", + "acl plugin" => "\n", + "acl preoperation" => "\n", + "binary syntax" => "\n", + "case exact string syntax" => "\n", + "case ignore string syntax" => "\n", + "chaining database" => "\n", + "class of service" => "\n", + "country string syntax" => "\n", + "distinguished name syntax" => "\n", + "generalized time syntax" => "\n", + "integer syntax" => "\n", + "internationalization plugin" => "\n", + "ldbm database" => "\n", + "legacy replication plugin" => "\n", + "multimaster replication plugin" => "\n", + "octet string syntax" => "\n", + "clear" => "\n", + "crypt" => "\n", + "ns-mta-md5" => "\n", + "sha" => "\n", + "ssha" => "\n", + "postal address syntax" => "\n", + "referential integrity postoperation" => "\n", + "retro changelog plugin" => "\n", + "roles plugin" => "\n", + "telephone syntax" => "\n", + "uid uniqueness" => "\n", + "uri syntax" => "\n" + ); + +# list of indexes that have disappeared from the new schema compared to 5.0 +%deniedIndexes = ( + 'dncomp' => "\n" +); + +@default_indexes = (); +@indexes = (); + +# list of user added Plugin's. In 6.2, they 'll need to be recompiled +@badPlugins = () ; + +@pluginAttrs = ( + "objectclass", + "cn", + "nsslapd-pluginpath", + "nsslapd-plugininitfunc", + "nsslapd-plugintype", + "nsslapd-pluginenabled", + "nsslapd-plugin-depends-on-type", + "nsslapd-pluginid", + "nsslapd-pluginversion", + "nsslapd-pluginvendor" + ); + +@nsds5replicaAttrs = ( + 'objectclass', + 'nsDS5ReplicaRoot', + 'nsDS5ReplicaType', + 'nsDS5ReplicaLegacyConsumer', + 'nsDS5flags', + 'nsDS5ReplicaId', + 'nsDS5ReplicaPurgeDelay', + 'nsDS5ReplicaBinddn', + 'cn', + 'nsDS5ReplicaReferral' + ); + +# array of replicas to migrate +@new6replicas = (); + +# array of replication agreements to migrate +@replicationAgreements = (); + +# compare LDIF standard config files with standard ones +CompareStdConfigFiles() ; +die "\n\n The version of product you want to migrate is not a 5.x Directory Server\n" unless ($oldVersion == 5) ; + +# Shutdown the legacy Directory instance +printTrace("\nShutdown the legacy Directory Server instance: ${oldHome}",0); +&stopServer($oldDir, 'slapd-'.$oldname); + +# get the hostname of the new LDAP server +my $LDAPservername = &getLDAPservername(); + +# get the uid and gid of the 6.2 slapd user +($localuser, $newuid, $newgid) = getuid_gid(); +# get the uid and gid of the 5.x slapd user +($oldlocaluser, $olduid, $oldgid) = getolduid_gid(); +printTrace("\n6.2 localuser: $localuser, uid: $newuid, gid: $newgid",2); +printTrace("\n5.x localuser: $oldlocaluser, uid: $olduid, gid: $oldgid",2); + +# backup 6.2 configuration files in <6server_root>/slapd-instancename/config +printTrace("\nBackup $serverHome${PATHSEP}config on $serverHome${PATHSEP}config_backup ...",0); +&backupConfigFiles(); + +# migrate the schema (need to stop and start the 6.2 server) +printTrace("\nMigrate the schema...",0); +MigrateSchema(); + +# start the server unless it is already started +&startServer() unless (isDirectoryAlive()); + +############### Connect to the 6.2 LDAP Directory Server ###################### +$ENV{"$LIB_PATH"} = $new_libpath; + +die "\n Migration aborted. Make sure your old and new Directory Server are installed on the same machine \n" if ( $LDAPservername == -1 ); +$conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Unable to contact the $Version.$Minor LDAP server: $LDAPservername\n"; + +# Cconnection to 6.2 LDAP server is successful ! +printTrace("\nConnected to $Version.$Minor LDAP server",0) ; + +# Parse the main configuration file: dse.ldif +printTrace("\n\nParse the old DSE ldif file: $oldDSEldif *****",0, 1); +printTrace("\nThis may take a while ...\n",0); +&MigrateDSEldif(); + +#migrate LDBM backend instances +printTrace("\n\nMigrate LDBM backend instances...",0,1); +&migrateLDBM_backend_instances(); + +#migrate mapping tree entries +printTrace("\n\nMigrate mapping tree...",0,1); +&migrateMappingTree(); + +#migrate default indexes +printTrace("\n\nMigrate default indexes...",0,1); +migrateDefaultIndexes(); + +#migrate indexes +printTrace("\n\nMigrate indexes...",0,1); +migrateIndexes(); + +#migrate replicas +printTrace("\n\nMigrate replicas...",0,1); +&MigrateNSDS5_replica(); + +#migrate replication agreements +printTrace("\n\nMigrate replication agreements...",0,1); +&MigrateNSDS_replication_agreement(); + +#migrate key/cert databases +printTrace("\n\nMigrate key/cert databases...",0,1); +&MigrateSSL(); + +# migrate certmap.conf +printTrace("\n\nMigrate Certmap.conf...",0,1); +&MigrateCertmap() ; + +################## Close the connection to 6.2 LDAP Server ##################### +printTrace("\n\n***** Close the LDAP connection to the new Directory Server instance ***** ",0); +$conn->close; + + +################## stop the new instance and Export/Import the data, restart the server ################## +if (@BACKENDS) { + &stopServer($root,'slapd-'.$newname); + if ($olddatadir) { + printTrace("\nData already contained in $olddatadir...\n",0,1) ; + $ldif_rep = "$olddatadir${PATHSEP}"; + } else { + printTrace("\nData processing...\n",0,1) ; + # migrate data for each backend: 5.x -> LDIF files + &manydb2Ldif($ldif_rep); + } + + # migrate LDIF data to the new database: LDIF -> New + &manyLdif2db($ldif_rep); + &migrateChangelog(); + printTrace("\n***** Migrate ReplicaBindDN entries...\n",0,1); + &importReplicaBindDNEntries(); + printTrace("\n***** Migrate MultiplexorBindDN entries...\n",0,1); + &importMultiplexorBindDNEntries(); + &startServer() unless (isDirectoryAlive()); +} +else { + printTrace("\nINFORMATION - There are no non-standard or non-already existing suffixes to migrate\n",0); + &migrateChangelog(); + printTrace("\n***** Migrate ReplicaBindDN entries...\n",0,1); + &importReplicaBindDNEntries(); + printTrace("\n***** Migrate MultiplexorBindDN entries...\n",0,1); + &importMultiplexorBindDNEntries(); +} + +printMsg("\n\n ****** End of migration ******\n\n"); + +close(LOGFILE); + + +########################################################################################### +# get input users +sub getParameters { + my $exit = 0 ; + my $i = 0; + my $pwdfile= ""; + + while ($i <= $#ARGV) { + if ( "$ARGV[$i]" eq "-D" ) { # directory manager + if (! $rootDN) { + $rootDN = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-w") { # password + if (! $rootpwd) { + $rootpwd = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-j") { # password file + if (! $pwdfile) { + $pwdfile = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-o") { # old instance path + if (! $oldHome ) { + $oldHome = $ARGV[++$i] ; + grep { s@\\@/@g } $oldHome if $isNT ; + if ($oldHome =~ /[\"]?(.*)?[\"]?/) { $oldHome = $1 ; } + if ($oldHome =~ m@^(.*)/([^-/]*)-([^/]*)[/]?$@) { + $oldDir = $1 ; + $type = $2 ; + $oldname = $3 ; + if ($isNT) { + $oldDir = lc($oldDir) ; + $type = lc($type) ; + $oldname = lc($oldname) ; + $oldHome = lc($oldHome) ; + grep { s@/@\\@g } $oldDir ; + grep { s@/@\\@g } $oldHome ; + } + } + else { + print("\nThe old instance path is not correct. It must be like slapd-instancename"); + &usage(); + exit(1); + } + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-n") { # new instance path + if (! $serverHome ) { + $serverHome = $ARGV[++$i] ; + grep { s@\\@/@g } $root if $isNT ; + grep { s@\\@/@g } $serverHome if $isNT ; + if ($serverHome =~ /[\"]?(.*)?[\"]?/) { $serverHome = $1 ; } + if ($serverHome =~ m@^(.*?)/?([^/-]*)-([^/]*)[/]?$@) { + $root = $1 if ($1); + $type = $2 ; + $newname = $3 ; + if ($isNT) { + $root = lc($root) ; + $type = lc($type) ; + $newname = lc($newname) ; + $serverHome = lc($serverHome) ; + grep { s@/@\\@g } $root ; + grep { s@/@\\@g } $serverHome ; + } + } + else { + print("\nThe new instance path is not correct. It must be like slapd-instancename"); + &usage(); + exit(1); + } + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-p") { # new DS port + if (! $newport ) { + $newport = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-d") { # old instance LDIF data dir + if (! $olddatadir ) { + $olddatadir = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-v") { # old version + if (! $oldversionstr ) { + $oldversionstr = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-t") { # TRACELEVEL + my $value = $ARGV[++$i] ; + if ($value =~ /[0-3]/) { + $TRACELEVEL = $value ; + } + else { + print("\nThe tracelevel must belong to 0..3 interval"); + &usage(); + exit(); + } + } elsif ("$ARGV[$i]" eq "-noinput") { # no user interventions during processing + $NO_INPUT_USER = 1 ; + } elsif ("$ARGV[$i]" eq "-L") { # migration logfile + $LogFileReport = $ARGV[++$i] ; + } + else { + print("\nThe option $ARGV[$i] is not recognized"); + &usage() ; + exit(1); + } + $i++; + } + if (! $rootDN) { + print("\nThe rootDN is missing"); + $exit = 1; + } + if ($pwdfile ne "") { + # Open file and get the password + unless (open (RPASS, $pwfile)) { + die "Error, cannot open password file $passwdfile\n"; + } + $rootpwd = ; + chomp($rootpwd); + close(RPASS); + } elsif ($rootpwd eq "-"){ + # Read the password from terminal + die "The '-w -' option requires an extension library (Term::ReadKey) which is not\n", + "part of the standard perl distribution. If you want to use it, you must\n", + "download and install the module. You can find it at\n", + "http://www.perl.com/CPAN/CPAN.html\n"; + # Remove the previous line and uncomment the following 6 lines once you have installed Term::ReadKey module. +# use Term::ReadKey; +# print "Bind Password: "; +# ReadMode('noecho'); +# $rootpwd = ReadLine(0); +# chomp($rootpwd); +# ReadMode('normal'); + } + if (! $rootpwd) { + print("\nThe rootpwd is missing"); + $exit = 1 ; + } + if (! $newport) { + print("\nThe port is missing"); + $exit = 1; + } + if (! $serverHome) { + print("\nThe new instance path is missing"); + $exit = 1; + } + if (! $oldHome) { + print("\nThe old instance path is missing"); + $exit = 1; + } + if ((! $LogFileReport) && $serverHome) { + ($sec, $min, $hour, $dd, $mm, $yy) = &GetTime(); + $LogFileReport = "${serverHome}${PATHSEP}logs${PATHSEP}Migration_${dd}${mm}${yy}_${hour}${min}${sec}.log"; + } + if ($exit) { + &usage() ; + exit(1); + } + +} + +################################################################################################### + +sub MigrateSchema{ + my $FilesChanged = ""; + my $AllDiffs = ""; + my $NoChanges = "" ; + my $lineToBegin = 0 ; + opendir(SCHEMADIR, $oldSchemaDir) or + die "Error: could not open migrated config dir $oldSchemaDir: $!"; + + foreach $file (readdir(SCHEMADIR)) { + if (! exists($stdIncludes{lc($file)})) { + my $newSchemaFile = $schemaDir . $file; + if (-f $newSchemaFile ) { + # The ldif file already exists. Make a diff and warn the user if different. + if (diff($newSchemaFile, $oldSchemaDir.$file)) { + &stopServer($root,'slapd-'.$newname) if (isDirectoryAlive()); + $AllDiffs .= "\n$file"; + copyBinFile("$oldSchemaDir$file", $newSchemaFile); + } + } + else { + &stopServer($root,'slapd-'.$newname) if (isDirectoryAlive()); + $AllDiffs .= "\n$file"; + copyBinFile("$oldSchemaDir$file", $newSchemaFile); + } + } + } + closedir(SCHEMADIR); + if ($AllDiffs) { + printMsg("\n\n***********************************************************************"); + printMsg("\nThe following LDIF files have been migrated:"); + printMsg("$AllDiffs"); + printMsg("\n*************************************************************************\n\n"); + } + &startServer() if (! isDirectoryAlive()); +} + + +################################################################################################### +# This subroutine is used to parse the dse.ldif file and call specific routines to act with entries +sub MigrateDSEldif { + printTrace("\nMigrate DSE entries...",1); + my $tempoAlreadyDone = 0; + open( DSELDIF, "< $oldDSEldif" ) || die "Can't open $oldDSEldif: $!: "; + my $in = new Mozilla::LDAP::LDIF(*DSELDIF) ; + while ($entry = readOneEntry $in) { + $typeOfEntry = getTypeOfEntry($entry); + SWITCH: { + if ($typeOfEntry eq "LDBM_BACKEND_INSTANCE"){ + parseLDBM_backend_instance($entry); + last SWITCH; + } + if ($typeOfEntry eq "MAPPING_TREE"){ + parseMapping_tree($entry); + last SWITCH; + } + if ($typeOfEntry eq "DEFAULT_INDEX"){ + parseDefaultIndex($entry); + last SWITCH; + } + if ($typeOfEntry eq "INDEX"){ + parseIndex($entry); + last SWITCH; + } + if ($typeOfEntry eq "STANDARD_PLUGIN"){ + migrateStdPlugin($entry); + last SWITCH; + } + if ($typeOfEntry eq "CONFIG_NODE"){ + migrateConfig_Node($entry); + last SWITCH; + } + if ($typeOfEntry eq "CONFIG_LDBM_DATABASE"){ + migrateConfig_LDBM_database($entry); + last SWITCH; + } + if ($typeOfEntry eq "CHAINING_BACKEND_CONFIG"){ + migrateChainingBE_config($entry); + last SWITCH; + } + if ($typeOfEntry eq "CHAINING_BACKEND_INSTANCE"){ + migrateChainingBE_instance($entry); + last SWITCH; + } + if ($typeOfEntry eq "NSDS5_REPLICA"){ + parseNSDS5_replica($entry); + last SWITCH; + } + if ($typeOfEntry eq "NSDS_REPLICATION_AGREEMENT"){ + parseNSDS_replication_agreement($entry); + last SWITCH; + } + if ($typeOfEntry eq "CHANGELOG5"){ + migrateChangelog5($entry); + last SWITCH; + } + if ($typeOfEntry eq "REPLICATION"){ + migrateReplication($entry); + last SWITCH; + } + if ($typeOfEntry eq "SECURITY"){ + migrateSecurity($entry); + last SWITCH; + } + if ($typeOfEntry eq "SNMP"){ + migrateSNMP($entry); + last SWITCH; + } + } + + } + close(DSELDIF); +} + +############################################################################# +# returns the "type of an entry". If the entry is not to be migrated its type is "NOT_MIGRATED_TYPE" + +sub getTypeOfEntry{ + my $entry = shift; + my $DN = $entry->getDN(1) ; # 1 is to normalize the returned DN + if (($DN =~ /cn=ldbm database,cn=plugins,cn=config$/i) && (isObjectclass($entry,"nsBackendInstance"))) { + return "LDBM_BACKEND_INSTANCE"; + } + if (($DN =~ /cn=mapping tree,cn=config$/i) && (isObjectclass($entry,"nsMappingTree"))) { + return "MAPPING_TREE"; + } + if (($DN =~ /cn=default indexes,cn=config,cn=ldbm database,cn=plugins,cn=config$/i) && (isObjectclass($entry,"nsIndex"))) { + return "DEFAULT_INDEX"; + } + if (isObjectclass($entry,"nsIndex")) { + return "INDEX"; + } + if ((isObjectclass($entry,"nsSlapdPlugin")) && (isStdPlugin($entry))) { + return "STANDARD_PLUGIN"; + } + if ($DN =~ /^cn=config$/i) { + return "CONFIG_NODE"; + } + if ($DN =~ /^cn=config,cn=ldbm database,cn=plugins,cn=config$/i) { + return "CONFIG_LDBM_DATABASE"; + } + if (($DN =~ /^cn=config,cn=chaining database,cn=plugins,cn=config$/i) || ($DN =~ /^cn=default instance config,cn=chaining database,cn=plugins,cn=config$/i)){ + return "CHAINING_BACKEND_CONFIG"; + } + if (($DN =~ /cn=chaining database,cn=plugins,cn=config$/i) && (isObjectclass($entry,"nsBackendInstance"))) { + return "CHAINING_BACKEND_INSTANCE"; + } + if (isObjectclass($entry,"nsDS5Replica")) { + return "NSDS5_REPLICA"; + } + if (isObjectclass($entry,"nsDS5ReplicationAgreement")) { + return "NSDS_REPLICATION_AGREEMENT"; + } + if ($DN =~ /^cn=changelog5,cn=config$/i) { + return "CHANGELOG5"; + } + if (($DN =~ /cn=replication,cn=config$/i) && ($DN !~ /^cn=replication,cn=config$/i)) { + return "REPLICATION"; + } + if ($DN =~ /cn=encryption,cn=config$/i) { + return "SECURITY"; + } + if ($DN =~ /^cn=SNMP,cn=config$/i) { + return "SNMP"; + } + return "NOT_MIGRATED_TYPE"; +} + +############################################################################# + + + +############################################################################# +# returns 1 if the objectclass given in parameter is present in the objectclasses values of the entry +# given in parameter, 0 else + +sub isObjectclass { + my $entry = shift; + my $objectclass = shift; + return ($entry->hasValue("objectclass",$objectclass,1)); +} + +############################################################################# + +sub isStdPlugin { + my $entry = shift; + my $CN = $entry->{cn}[0]; + if (isObjectclass($entry,"nsSlapdPlugin")) { + return 1 if ($stdPlugins{lc($CN)}); + } + return 0; +} + + +############################################################################# + +sub alreadyExistsInNew{ + my $entry = shift; + my $mustExist = shift; + my $DN = $entry->getDN(1); # 1 to normalize the DN + # We have a name change of "uid uniqueness" plugin in DS6.x + # to "attribute uniqueness" + $DN =~ s/uid\ uniqueness/attribute\ uniqueness/ if ($DN =~ /uid\ uniqueness/); + return searchEntry($DN, $mustExist); +} + +############################################################################# +sub searchEntry { + my $DN = shift; + my $mustExist = shift; + my $res = $conn->search($DN, "base", "objectclass=*"); + my $cpt = 5; + if ($res) { + return $res; + } + else { + my $errorCode = $conn->getErrorCode(); + while (($errorCode eq $LDAP_SERVER_UNREACHABLE) && cpt && (! $res)) { + printMsg("\ntry to reconnect to search $DN"); + $conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Unable to contact the $Version.$Minor LDAP server: $LDAPservername\n"; + $res = $conn->search($DN, "base", "objectclass=*"); + $errorCode = $conn->getErrorCode(); + $cpt--; + } + if ($res){ + return $res ; + } + elsif (($errorCode eq $LDAP_SERVER_UNREACHABLE) || ($mustExist)) { + my $msg = $conn->getErrorString(); + printMsg("\n\n*** Failed to search: $DN"); + printMsg("\n*** Error Msg: $msg, Error code: $errorCode"); + } + return 0; + } +} + + +############################################################################# + +sub addEntryToNew{ + my $entry = shift; + my $typeOfEntry = shift; + my $trace = shift; + my $res = $conn->add($entry); + my $DN = $entry->getDN(1); + my $cpt = 5; + if ($res) { + printTrace("\n$typeOfEntry - Add successfull: $DN",$trace); + return 1; + } + else { + my $errorCode = $conn->getErrorCode(); + while (($errorCode eq $LDAP_SERVER_UNREACHABLE) && cpt && (! $res)) { + printMsg("\ntry to reconnect to add $DN"); + $conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Unable to contact the $Version.$Minor LDAP server: $LDAPservername\n"; + $res = $conn->add($entry); + $errorCode = $conn->getErrorCode(); + $cpt--; + } + if ($res){ + printTrace("\n$typeOfEntry - Add successfull: $DN",$trace); + return 1; + } + else { + my $msg = $conn->getErrorString(); + printMsg("\n\n*** $typeOfEntry: Add Failed: $DN"); + printMsg("\n*** Error Msg: $msg, Error code: $errorCode"); + return 0; + } + } +} + +############################################################################# + +sub updateEntry{ + my $entry = shift; + my $typeOfEntry = shift; + my $CHECK = shift; + my $trace = shift; + my $cpt = 5; + if ($CHECK) { + if (! hasChanged($entry, $typeOfEntry)) { + return 1; + } + } + my $res = $conn->update($entry); + my $DN = $entry->getDN(1); + if ($res) { + printTrace("\n$typeOfEntry - Update successfull: $DN",$trace); + return 1 ; + } + else { + my $errorCode = $conn->getErrorCode(); + while (($errorCode eq $LDAP_SERVER_UNREACHABLE) && cpt && (! $res)) { + printMsg("\ntry to reconnect to update $DN"); + $conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Unable to contact the $Version.$Minor LDAP server: $LDAPservername\n"; + $res = $conn->update($entry); + $errorCode = $conn->getErrorCode(); + $cpt--; + } + if ($res){ + printTrace("\n$typeOfEntry - Update successfull: $DN",$trace); + return 1; + } + else { + my $msg = $conn->getErrorString(); + printMsg("\n\n*** $typeOfEntry - Update Failed: $DN"); + printMsg("\n*** Error Msg: $msg, Error code: $errorCode"); + return 0; + } + } +} + + +############################################################################# +# returns 1 if the entry to migrate and the current entry are different one another + +sub hasChanged { + my $entry = shift; + my $typeOfEntry = shift; + my $DN = $entry->getDN(1); + my $newEntry = searchEntry($DN,1); + return 1 if (! $newEntry); # we shoudn't be in that case ... + # do the stuff to check wether the entry has changed or not given its type + if (($typeOfEntry eq "DEFAULT_INDEX") || ($typeOfEntry eq "INDEX")){ + my @indexTypes = $entry->getValues("nsIndexType"); + my @newIndexTypes = $newEntry->getValues("nsIndexType"); + my @nsmatchingrules = $entry->getValues("nsmatchingrule"); + my @newMatchingRules = $newEntry->getValues("nsmatchingrule"); + return 1 if (Diffs(\@indexTypes, \@newIndexTypes)); + return 1 if (Diffs(\@nsmatchingrules,\@newMatchingRules)); + return 0; + } + if ($typeOfEntry eq "CHANGELOG5"){ + printTrace("\nCheck wether changelog has changed or not",3); + my @params = keys(%changelog5params); + foreach $param (@params){ + my @values = $entry->getValues($param); + my @newValues = $newEntry->getValues($param); + return 1 if (Diffs(\@values,\@newValues)); + } + return 0; + } + if ($typeOfEntry eq "SNMP"){ + foreach $param (@SNMPparams){ + my @values = $entry->getValues($param); + my @newValues = $newEntry->getValues($param); + return 1 if (Diffs(\@values,\@newValues)); + } + return 0; + } + # we don't know how to compare such type of entry => just return 1 + return 1 ; +} + +sub isAsystemIndex { + my $index = shift; + return ($index->hasValue("nsSystemIndex","true",1)); +} + + +sub updatePathInPluginArgs { + my $plugin = shift; + my $argNum = 0; + my $argPrefix = "nsslapd-pluginarg"; + my $cont = 1; + my $Unix_oldDir = ${oldDir} ; + my $Unix_root = ${root} ; + grep { s@\\@/@g } $Unix_oldDir if $isNT; + grep { s@\\@/@g } $Unix_root if $isNT; + while ($cont) { + my $arg = $argPrefix . $argNum ; + if ($plugin->exists($arg)) { + $_ = $plugin->{$arg}[0] ; + s@$Unix_oldDir@$Unix_root@ig ; + s/$type-$oldname/$type-$newname/ig ; + $plugin->setValues($arg, $_) ; + } + else { + $cont = 0 ; + } + $argNum++; + } + return $plugin; +} + + +sub Diffs { + my $valuesToMigrate = shift; + my $currentValues = shift; + return 1 if (getDiff(\@{$valuesToMigrate},\@{$currentValues})); + return 1 if (getDiff(\@{$currentValues},\@{$valuesToMigrate})); + return 0 ; +} + +sub getDiff { + # we get references to arrays + my $elements = shift ; + my $existing_elements = shift ; + my %count = () ; + my %countEE = () ; + @diff = () ; + foreach $e (@{$elements}, @{$existing_elements}) { $count{$e}++ ;} + foreach $e (@{existing_elements}) { $countEE{$e}++ ;} + foreach $e (@{$elements}) { + # if $e is only present in @$elements, we push it to the diff array + if (($count{$e} == 1) && ($countEE{$e} == 0)) { + push @diff, $e ; + } + } + return @diff ; +} + +sub registerSuffix_Backend { + my $ldbmDatabase = shift; + my $CN = $ldbmDatabase->{cn}[0]; + my $suffixArg = "nsslapd-suffix"; + my $suffix = $ldbmDatabase->{$suffixArg}[0]; + $oldBackends{$suffix} = $CN; +} + + +############################################################################# +# # +# # +# # +############################################################################# +sub migrateLDBM_backend_instances { + foreach $entry (@LDBM_backend_instances) { + my $DN = $entry->getDN(1); # 1 is to normalize the DN + my $CN = $entry->{cn}[0]; + my $expLdif; + my $confirm = "No"; + my $dest = "$serverHome${PATHSEP}db_backup" ; + my $newSlapdExecDir = "$root${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server"; + + if ($DN =~/cn=netscaperoot,cn=ldbm database/i){ + printTrace("\n\n*** INFORMATION - NetscapeRoot is NOT migrated",0); + } + else { + if(alreadyExistsInNew($entry)){ + printMsg("\n\n*** LDBM_BACKEND_INSTANCE - $DN already exists"); + printMsg("\n*** Migration will overwrite existing database"); + printMsg("\nDo you want to continue Yes/No [No] ?") ; + my $answer = ; + if ($answer =~ /y|yes/i) { + printMsg("Do you want to export the existing data Yes/No [Yes] ?"); + my $answer = ; + if (!($answer =~ /n|no/i)) { + mkdir $dest, 0700 unless (-d $dest); + $expLdif = "$dest${PATHSEP}$CN.ldif"; + while (!($confirm =~ /y|yes/i)) { + printMsg("\nEnter the full pathname of the file [$expLdif]:") ; + $answer = ; + chomp($expLdif = $answer) unless ($answer eq "\n"); + printMsg("\nExisting data will be exported under $expLdif"); + printMsg("\nContinue Yes/No [No] ?"); + $confirm = ; + } + $ENV{"$LIB_PATH"}=$new_libpath; + chdir($newSlapdExecDir) or die "\nCould not change directory to $newSlapdExecDir: $!\n"; + printTrace("\nNow backing up database $CN in $expLdif\n",0); + &stopServer($root,'slapd-'.$newname); + &db2Ldif($expLdif, $CN, $serverHome); + &startServer() unless (isDirectoryAlive()); + } + push @BACKENDS, $CN; + } else { + printMsg("\n*** Migration will not update it"); + break; + } + } else { + printTrace("\nWe should add the backend instance $DN",3); + my $suffixarg = "nsslapd-suffix" ; + my $suffixname= $entry->{$suffixarg}[0] ; + my $newEntry = $conn->newEntry() ; + $newEntry->setDN($DN); + $newEntry->setValues("objectclass", "top", "extensibleObject", "nsBackendInstance" ); + $newEntry->setValues("cn", $CN ); + $newEntry->setValues($suffixarg, $suffixname); + my @params = keys(%LDBMparamToMigrate); + foreach $param (@params) { + my @values = $entry->getValues($param); + $newEntry->setValues($param, @values) if (@values); + } + if (addEntryToNew($newEntry, "LDBM_BACKEND_INSTANCE",1)) { + push @BACKENDS, $CN; + } + } + } + } +} + +sub parseLDBM_backend_instance { + my $entry = shift; + ®isterSuffix_Backend($entry); + push @LDBM_backend_instances, $entry; +} + +############################################################################# +sub migrateMappingTree { + foreach $entry (@Mapping_tree_entries) { + my $DN = $entry->getDN(1); # 1 si to normalize the DN + if ($DN =~/cn=\"o=netscaperoot\",cn=mapping tree,cn=config/i){ + # DO NOTHING + } + else { + if(alreadyExistsInNew($entry)){ + printMsg("\n\n*** MAPPING_TREE - $DN already exists"); + printMsg("\n*** Migration will not add the suffix"); + } + else { + addEntryToNew($entry, "MAPPING_TREE",1); + } + } + } +} + + +sub parseMapping_tree{ + my $entry = shift; + push @Mapping_tree_entries, $entry; +} + +############################################################################# +sub migrateDefaultIndexes { + foreach $index (@default_indexes) { + my $CN = $index->{cn}[0]; + my $newIndex ; + if ((! isAsystemIndex($index)) && (! $deniedIndexes{lc($CN)})) { + if ($newIndex = alreadyExistsInNew($index)) { + if (! isAsystemIndex($newIndex)) { + updateEntry($index, "DEFAULT_INDEX", 1, 2); + } + } + else { + addEntryToNew($index, "DEFAULT_INDEX", 2); + } + } + } +} + + +sub parseDefaultIndex{ + my $index = shift; + push @default_indexes, $index; +} + +############################################################################# + +sub migrateIndexes { + foreach $index (@indexes) { + my $CN = $index->{cn}[0]; + my $newIndex; + if ((! isAsystemIndex($index)) && (! $deniedIndexes{lc($CN)}) && (DN !~ /cn=netscaperoot,cn=index/i)){ + if ($newIndex = alreadyExistsInNew($index)) { + if (! isAsystemIndex($newIndex)) { + updateEntry($index, "INDEX", 1, 2); + } + } + else { + addEntryToNew($index, "INDEX", 2); + } + } + } +} + +sub parseIndex{ + my $index = shift; + push @indexes, $index; +} + +############################################################################# + +sub newLDIFplugin { + my $currentPlugin = shift; + my $DN = $currentPlugin->getDN(1); + my $newPlugin = $conn->newEntry() ; + $newPlugin->setDN($DN); + foreach $Attr (@pluginAttrs) { + my @values = $currentPlugin->getValues($Attr); + $newPlugin->setValues($Attr, @values) if (@values); + } + return $newPlugin; +} + +sub migrateStdPlugin{ + my $plugin = shift; + my $DN = $plugin->getDN(1); + my $pluginEnable = "nsslapd-pluginEnabled"; + my $argNum = 0; + my $argPrefix = "nsslapd-pluginarg"; + my $currentPlugin ; + if ($currentPlugin = alreadyExistsInNew($plugin, 1)) { + $plugin = updatePathInPluginArgs($plugin); + my $pluginEnableValue = $plugin->{$pluginEnable}[0]; + my $cont = 1; + my $pluginHasChanged = 0; + my $newPlugin = &newLDIFplugin($currentPlugin); + if (! $currentPlugin->hasValue($pluginEnable,$pluginEnableValue,1)){ + $newPlugin->setValues($pluginEnable, $pluginEnableValue); + $pluginHasChanged = 1 unless ($pluginHasChanged); + } + while($cont){ + my $arg = $argPrefix . $argNum ; + if ($plugin->exists($arg)) { + my @values = $plugin->getValues($arg); + my $value = $values[0] ; + $newPlugin->setValues($arg, $value) if (@values); + if ($currentPlugin->exists($arg)) { + if (! $currentPlugin->hasValue($arg,$value,1)) { + $pluginHasChanged = 1 unless ($pluginHasChanged); + } + } + else { + $pluginHasChanged = 1 unless ($pluginHasChanged); + } + } + else { + if ($currentPlugin->exists($arg)) { + # Just Warn the user. Do nothing. + printTrace("\nCompared to the old instance, the current new plugin $DN belongs this attribute: $arg",2); + } + else { + $cont = 0 ; + } + } + $argNum++; + } + updateEntry($newPlugin, "STANDARD_PLUGIN", 0, 1) if ($pluginHasChanged); + } +} + +############################################################################# + +sub migrateConfig_Node{ + my $config_node = shift; + my @params = keys(%GeneralSrvParamToMigrate); + my $hasChanged = 0; + my $newConfigNode; + if ($newConfigNode = alreadyExistsInNew($config_node, 1)){ + foreach $param (@params) { + if ($config_node->exists($param)){ + my @valuesToMigrate = $config_node->getValues($param); + if (@valuesToMigrate){ + if ($newConfigNode->exists($param)){ + my @currentValues = $newConfigNode->getValues($param); + if (Diffs(\@valuesToMigrate, \@currentValues)) { + $newConfigNode->setValues($param, @valuesToMigrate); + $hasChanged = 1 unless ($hasChanged); + printTrace("\nParam to update: $param with value @valuesToMigrate",3); + } + } + else { + $newConfigNode->setValues($param, @valuesToMigrate); + $hasChanged = 1 unless ($hasChanged); + printTrace("\nParam to update: $param with value @valuesToMigrate",3); + } + } + } + } + updateEntry($newConfigNode, "CONFIG_NODE", 0, 1) if ($hasChanged); + } +} + +############################################################################# + +sub migrateConfig_LDBM_database{ + my $config_ldbm = shift; + my @params = keys(%GlobalConfigLDBMparamToMigrate); + my $hasChanged = 0; + my $newConfigLdbm ; + if ($newConfigLdbm = alreadyExistsInNew($config_ldbm, 1)) { + foreach $param (@params) { + if ($config_ldbm->exists($param)){ + my @valuesToMigrate = $config_ldbm->getValues($param); + if (@valuesToMigrate){ + if ($newConfigLdbm->exists($param)){ + my @currentValues = $newConfigLdbm->getValues($param); + if (Diffs(\@valuesToMigrate, \@currentValues)) { + $newConfigLdbm->setValues($param, @valuesToMigrate); + $hasChanged = 1 unless ($hasChanged); + } + } + else { + $newConfigLdbm->setValues($param, @valuesToMigrate); + $hasChanged = 1 unless ($hasChanged); + } + } + } + } + updateEntry($newConfigLdbm, "CONFIG_LDBM_DATABASE", 0, 1) if ($hasChanged); + } +} + +############################################################################# + +sub migrateChainingBE_config{ + my $chaining_config = shift; + my $DN = $chaining_config->getDN(1); + my @params = (); + my $hasChanged = 0; + my $newChainingConfig; + if ($DN =~ /^cn=config,cn=chaining database,cn=plugins,cn=config$/i){ + $newChainingConfig = searchEntry("cn=config,cn=chaining database,cn=plugins,cn=config"); + @params = keys(%ChainingConfigParams); + } + if ($DN =~ /^cn=default instance config,cn=chaining database,cn=plugins,cn=config$/i){ + $newChainingConfig = searchEntry("cn=default instance config,cn=chaining database,cn=plugins,cn=config"); + @params = keys(%ChainingDefaultInstanceConfigParams); + } + foreach $param (@params) { + if ($chaining_config->exists($param)){ + my @valuesToMigrate = $chaining_config->getValues($param); + if (@valuesToMigrate){ + printTrace("\nParam: $param values To migrate: @valuesToMigrate",3); + if ($newChainingConfig->exists($param)){ + my @currentValues = $newChainingConfig->getValues($param); + printTrace("\nParam: $param new current values: @currentValues",3); + if (Diffs(\@valuesToMigrate, \@currentValues)) { + $newChainingConfig->setValues($param, @valuesToMigrate); + $hasChanged = 1 unless ($hasChanged); + } + } + else { + $newChainingConfig->setValues($param, @valuesToMigrate); + $hasChanged = 1 unless ($hasChanged); + } + } + } + } + updateEntry($newChainingConfig, "CHAINING_BACKEND_CONFIG", 0, 1) if ($hasChanged); +} + +############################################################################# + +sub registerSuffix_ChainingBE { + my $ldbmDatabase = shift; + my $CN = $ldbmDatabase->{cn}[0]; + my $suffixArg = "nsslapd-suffix"; + my $suffix = $ldbmDatabase->{$suffixArg}[0]; + $oldChainingBackends{$suffix} = $CN; +} + +sub storeMultiplexorBindDN { + my $chaining_instance = shift; + my $DN = $chaining_instance->getDN(1); + if ($chaining_instance->exists("nsMultiplexorBindDN")){ + my $bindDN = $chaining_instance->{nsMultiplexorBindDN}[0]; + my $newBindDN = searchEntry($bindDN); + if (! $newBindDN){ + # the bindDN entry doesn't yet exist in new => it will have to be migrated + $MultiplexorBindDNEntriesToMigrate{$bindDN}="\n" ; + printTrace("\nThe bindDN: $bindDN need to be migrated",3); + } + else { + # do nothing as the entry already exists in new + } + } + +} + +sub importMultiplexorBindDNEntries { + # import all entries present in @MultiplexorBindDNEntriesToMigrate in new + my @MultiplexorBindDNs = keys (%MultiplexorBindDNEntriesToMigrate); + my $ldif_dir = $ldif_rep; + foreach $bindDN (@MultiplexorBindDNs) { + printTrace("\nimportMultiplexorBindDNEntries: bindDN to migrate: $bindDN",3); + # get the backend in which is stored the bind DN entry + my $backendtoExportFrom = getBackendtoExportFrom($bindDN); + printTrace("\nbackendtoExportFrom is: $backendtoExportFrom",3); + # check wether the backend has been imported in new or not + if (! alreadyMigrated($backendtoExportFrom)) { + if ($backendtoExportFrom ne $NULL) { + # if not imported => we need to import the binf DN entry + &startServer() unless (isDirectoryAlive()); + $conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Unable to contact the $Version.$Minor LDAP server: $LDAPservername\n"; + &ExportAndAddEntry($bindDN, $backendtoExportFrom, $ldif_dir); + } + else { + # do nothing + } + } + } + # remove the empty ldif directory + rmdir($ldif_dir) if (-d $ldif_dir); + # close the LDAP connection to new + $conn->close if ($conn); +} + +sub migrateChainingBE_instance{ + my $chaining_instance = shift; + my $DN = $chaining_instance->getDN(1); + ®isterSuffix_ChainingBE($chaining_instance); + if (alreadyExistsInNew($chaining_instance)) { + # already exists + printMsg("\n\n*** CHAINING_BACKEND_INSTANCE - $DN already exists"); + printMsg("\n*** Migration will not update it"); + } + else { + &migrate_credential($chaining_instance, "nsmultiplexorcredentials"); + addEntryToNew($chaining_instance, "CHAINING_BACKEND_INSTANCE", 1); + storeMultiplexorBindDN($chaining_instance); + } +} + +############################################################################# + +# create a new LDIF representation of a new replica consumer +sub newLDIFreplica { + my $replica = shift; + my $DN = $replica->getDN(1); + my $newReplica = $conn->newEntry() ; + my $MASTER_OR_MULTIMASTER = "3" ; + $newReplica->setDN($DN); + foreach $Attr (@nsds5replicaAttrs) { + my @values = $replica->getValues($Attr); + $newReplica->setValues($Attr, @values) if (@values); + } + my $replicaType = $replica->{nsDS5ReplicaType}[0]; + if ($replicaType eq $MASTER_OR_MULTIMASTER) { + my @nsState = $replica->getValues("nsState"); + $newReplica->setValues("nsState", @nsState); + } + else { + $newReplica->setValues("nsDS5ReplicaId", $replicaIdvalue); + } + return $newReplica; +} + +sub MigrateNSDS5_replica{ + foreach $replica (@new6replicas) { + my $DN = $replica->getDN(1); + my $newReplica; + my @removeAttrs = qw(nsstate nsds5replicaname nsds5replicachangecount); + for (@removeAttrs) { + $replica->remove($_); + } + if (alreadyExistsInNew($replica)) { + # replica already exists + printMsg("\n\n*** NSDS5_REPLICA - $DN already exists"); + printMsg("\n*** Migration will not update it"); + } + else { + $newReplica = &newLDIFreplica($replica); + addEntryToNew($newReplica, "NSDS5_REPLICA", 1); + } + storeReplicaBindDN($replica); + } +} + +sub parseNSDS5_replica{ + my $replica = shift; + push @new6replicas, $replica; +} + +sub storeReplicaBindDN { + my $replica = shift; + my $DN = $replica->getDN(1); + if ($replica->exists("nsDS5ReplicaBindDN")){ + my $bindDN = $replica->{nsDS5ReplicaBindDN}[0]; + my $newBindDN = searchEntry($bindDN); + if (! $newBindDN){ + # the bindDN entry doesn't yet exist in new => it will have to be migrated + $ReplicaBindDNEntriesToMigrate{$bindDN}="\n" ; + printTrace("\nThe bindDN: $bindDN need to be migrated",3); + } + else { + # do nothing as the entry already exists in new + } + } +} + + +sub importReplicaBindDNEntries { + # import all entries present in @ReplicaBindDNEntriesToMigrate in new + my @ReplicaBindDNs = keys (%ReplicaBindDNEntriesToMigrate); + my $ldif_dir = $ldif_rep; + my $replBind_entry = ""; + my @bindDN_elements = ""; + my $bindDN_parent = ""; + my $parentBind_entry = ""; + foreach $bindDN (@ReplicaBindDNs) { + printTrace("\nimportReplicaBindDNEntries: bindDN to migrate: $bindDN",3); + # get the backend in which is stored the bind DN entry + my $backendtoExportFrom = getBackendtoExportFrom($bindDN); + printTrace("\nbackendtoExportFrom is: $backendtoExportFrom",3); + # If backend is from config, read the entry from dse.ldif and add to new - NGK + if ($backendtoExportFrom eq "cn=config") { + my $norm_bindDN = normalizeDN($bindDN); + @bindDN_elements = ldap_explode_dn($norm_bindDN, 0); +# @bindDN_elements = split(/,/,$norm_bindDN); + my $junk = shift(@bindDN_elements); + if ($#bindDN_elements >= 1) { + $bindDN_parent = normalizeDN(join(",", @bindDN_elements)); + } + printTrace("\nOpening DSE.ldif",3); + open( DSELDIF, "< $oldDSEldif" ) || die "Can't open $oldDSEldif: $!: "; + my $in = new Mozilla::LDAP::LDIF(*DSELDIF); + while ($entry = readOneEntry $in) { + my $DN = $entry->getDN(1); + if ($DN eq $norm_bindDN) { + $replBind_entry = $entry; + } + if ($bindDN_parent ne "") { + if ($DN eq $bindDN_parent) { + $parentBind_entry = $entry; + } + } + } + close(DSELDIF); + &startServer() unless (isDirectoryAlive()); + $conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Unable to contact the $Version.$Minor LDAP server: $LDAPservername\n"; + if ($bindDN_parent ne "") { + addEntryToNew($parentBind_entry, BINDDN_PARENT, 0); + } + printTrace("\nAdding BindDN with addEntryToNew",3); + addEntryToNew($replBind_entry, BINDDN, 0); + } else { + # check wether the backend has been imported in new or not + if (! alreadyMigrated($backendtoExportFrom)) { + if ($backendtoExportFrom ne $NULL) { + # if not imported => we need to import the bind DN entry + &startServer() unless (isDirectoryAlive()); + $conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Unable to contact the $Version.$Minor LDAP server: $LDAPservername\n"; + &ExportAndAddEntry($bindDN, $backendtoExportFrom, $ldif_dir); + } + else { + # do nothing + } + } + } + } + # remove the empty ldif directory + rmdir($ldif_dir) if (-d $ldif_dir); + # close the LDAP connection to new + $conn->close if ($conn); +} + +sub alreadyMigrated { + my $backendToCheck = shift; + foreach $backend (@BACKENDS) { + return 1 if ($backend eq $backendToCheck); + } + return 0 ; +} + +sub belongsSuffix { + my $suffix = shift; + my $bindDN = shift; + return ($bindDN =~ /$suffix\s*$/i); +} + +sub length { + my $suffix = shift; + my $count = 0; + while ($suffix =~ /./g) { + $count++; + } + return $count ; +} + +sub getBackendtoExportFrom { + my $bindDN = shift ; + my $sizeOfSuffix = 0 ; + my $NULL = ""; + my @oldSuffixes = keys(%oldBackends); + my @oldChainingSuffixes = keys(%oldChainingBackends); + my $bindDN_backend = $NULL; + my $config = "cn=config"; + + my $norm_bindDN = normalizeDN($bindDN); + # Check if bindDN exists in cn=config - NGK + if (belongsSuffix($config,$norm_bindDN)) { + $bindDN_backend = $config; + printTrace("\ngetBackendtoExportFrom: bindDN_backend: $bindDN_backend",3); + } else { + foreach $suffix (@oldSuffixes){ + printTrace("\ngetBackendtoExportFrom: suffix to compare with is: $suffix",3); + if ((belongsSuffix($suffix,$norm_bindDN)) && (length($suffix) > $sizeOfSuffix)) { + $sizeOfSuffix = length($suffix); + $bindDN_backend = $oldBackends{$suffix}; + printTrace("\ngetBackendtoExportFrom: bindDN_backend: $bindDN_backend, sizeOfSuffix: $sizeOfSuffix",3); + } + } + foreach $suffix (@oldChainingSuffixes){ + printTrace("\ngetBackendtoExportFrom: suffix to compare with is a chained suffix: $suffix",3); + if ((belongsSuffix($suffix,$norm_bindDN)) && (length($suffix) > $sizeOfSuffix)) { + printMsg("\n\n*** Entry stored on a remote backend - $norm_bindDN"); + printMsg("\n*** We don't migrate it"); + return $NULL; + } + } + } + return $bindDN_backend; +} + + +sub getBackendtoImportTo { + my $bindDN = shift; + my $sizeOfSuffix = 0; + my $NULL = ""; + my $suffixArg = "nsslapd-suffix"; + my $bindDN_backend = $NULL; + open( DSELDIF, "< $DSEldif" ) || die "Can't open $DSEldif: $!: "; + my $in = new Mozilla::LDAP::LDIF(*DSELDIF) ; + while ($entry = readOneEntry $in) { + $typeOfEntry = getTypeOfEntry($entry); + if ($typeOfEntry eq "LDBM_BACKEND_INSTANCE"){ + my $suffix = $entry->{$suffixArg}[0]; + if ((belongsSuffix($suffix,$bindDN)) && (length($suffix) > $sizeOfSuffix)) { + $sizeOfSuffix = length($suffix); + $bindDN_backend = $entry->{cn}[0]; + } + } + } + close(DSELDIF); + return $bindDN_backend ; +} + + +sub ExportAndAddEntry { + my $DN = shift; + my $backendtoExportFrom = shift; + my $ldif_dir = shift; + my $ldif = "$ldif_dir${PATHSEP}$backendtoExportFrom.ldif" ; + # first: export entry pointed out by the $DN to $ldif file + $ENV{"$LIB_PATH"}=$old_libpath; + if (! $ldif_dir) { $ldif_dir = $ldif_rep ;} + if (!(-d $ldif_dir)) { + mkdir($ldif_dir,0777) or die "\ncan't create $ldif_dir to store temporary ldif files\n"; + } + chdir($oldSlapdExecDir) or die "\nCould not change directory to $oldSlapdExecDir: $!\n"; + &db2Ldif($ldif, $backendtoExportFrom, $oldHome, $DN); + chdir($curdir) or die "\nCould not change directory to $curdir: $!\n"; + + # then: Add it to new + if (! $conn) { + $conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Unable to contact the $Version.$Minor LDAP server: $LDAPservername\n"; + } + open( BINDDNLDIF, "< $ldif" ) || die "\nCan't open $ldif: $!: \n"; + my $in = new Mozilla::LDAP::LDIF(*BINDDNLDIF) ; + while ($entry = readOneEntry $in) { + my $entryDN = $entry->getDN(1); + if ($DN eq $entryDN) { + addEntryToNew($entry, "nsds5ReplicaBindDN", 0); + } + } + close(BINDDNLDIF); + # remove the ldif file after the import + unlink($ldif) ; +} + +############################################################################# +sub MigrateNSDS_replication_agreement { + foreach $replicationAgreement (@replicationAgreements) { + my $DN = $replicationAgreement->getDN(1); + if (alreadyExistsInNew($replicationAgreement)){ + # replication agreement already exists + printMsg("\n\n*** NSDS_REPLICATION_AGREEMENT - $DN already exists"); + printMsg("\n*** Migration will not update it"); + } + else { + &migrate_credential($replicationAgreement, "nsDS5ReplicaCredentials"); + addEntryToNew($replicationAgreement, "NSDS_REPLICATION_AGREEMENT", 1); + } + } +} + + +sub parseNSDS_replication_agreement{ + my $replicationAgreement = shift; + push @replicationAgreements, $replicationAgreement ; +} + +############################################################################# + +sub migrateChangelog5{ + my $changelog = shift; + my $DN = $changelog->getDN(1); + my $changelogdir = "nsslapd-changelogdir"; + if (alreadyExistsInNew($changelog)){ + # cn=changelog5,cn=config already exists in new + my $newChangelog = searchEntry($DN); + my @newChangelogdir = $newChangelog->getValues($changelogdir); + $changelog->setValues($changelogdir, @newChangelogdir); + updateEntry($changelog, "CHANGELOG5", 0, 1); + } + else { + # cn=changelog5,cn=config need to be created in new. + # the changelogdir value must be setup to /slapd-instance/changelogdb + $changelog->setValues($changelogdir,"${serverHome}${PATHSEP}changelogdb"); + addEntryToNew($changelog, "CHANGELOG5", 1); + } +} + + +sub migrateChangelog { + my $oldchangelogdir = ""; + my $newchangelogdir = ""; + my $changelogdir = "nsslapd-changelogdir"; + my $CL5DN = "cn=changelog5,cn=config"; + printTrace("\n\n***** Migrate Changelog...",0,1); + open( DSELDIF, "< $oldDSEldif" ) || die "Can't open $oldDSEldif: $!: "; + my $in = new Mozilla::LDAP::LDIF(*DSELDIF); + while ($entry = readOneEntry $in) { + $typeOfEntry = getTypeOfEntry($entry); + if ($typeOfEntry eq "CHANGELOG5"){ + $oldchangelogdir = ($entry->getValues($changelogdir))[0]; + } + } + close(DSELDIF); + if ($oldchangelogdir) { + # If using olddatadir to migrate from, the path of the changelogdb + # from the dse.ldif may not match the path where the old server + # root was archived. We may need to modify oldchangelogdir so the + # copy of the changelog files succeeds. + unless(-e $oldchangelogdir) { + if($olddatadir) { + my @cldbpath = split(/\//,$oldchangelogdir); + until($cldbpath[0] =~/^slapd-/) { + shift(@cldbpath); + } + my $tmpcldbpath = join(${PATHSEP}, @cldbpath); + $oldchangelogdir = "$oldDir${PATHSEP}$tmpcldbpath"; + } + # If oldchangelogdir still looks to be wrong, prompt for the + # location instead of just failing on the copydir operation + # and bombing out of the migration. + unless(-e $oldchangelogdir) { + print("\n\nThe old changelog directory \"$oldchangelogdir\" doesn't exist. Please enter the correct path: "); + $oldchangelogdir = ; + } + } + &startServer() unless (isDirectoryAlive()); + $conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Unable to contact the $Version.$Minor LDAP server: $LDAPservername\n"; + my $newChangelog = searchEntry($CL5DN); + $newchangelogdir = ($newChangelog->getValues($changelogdir))[0]; + stopServer($root,'slapd-'.$newname); + printTrace("\ncopying $oldchangelogdir${PATHSEP}* to $newchangelogdir",3); + copyDir("$oldchangelogdir","$newchangelogdir"); + + # We need to modify the DBVERSION file for a new verision of the db + open(DBVERSION,">$newchangelogdir${PATHSEP}DBVERSION") || die "Can't overwrite $newchangelogdir${PATHSEP}DBVERSION: $! "; + print DBVERSION "Changelog5/NSMMReplicationPlugin/3.0"; + close(DBVERSION); + + &startServer() unless (isDirectoryAlive()); + } +} + +############################################################################# + +sub migrateReplication{ + my $replication = shift; + my $DN = $replication->getDN(1); + if (alreadyExistsInNew($replication)){ + # replication agreement already exists + printMsg("\n\n*** $DN already exists"); + printMsg("\n*** Migration will not update it"); + } + else { + addEntryToNew($replication, "REPLICATION", 1); + } +} + +############################################################################# + +sub migrateSecurity{ + my $security = shift; + if ($entry->hasValue("objectClass", "nsEncryptionConfig")) { + my $certfile = "alias/slapd-" . $newname . "-cert8.db"; + my $keyfile = "alias/slapd-" . $newname. "-key3.db"; + $entry->setValues("nsCertfile",$certfile) if ! $entry->hasValue("nsCertfile",$certfile); + $entry->setValues("nsKeyfile",$keyfile) if ! $entry->hasValue("nsKeyfile",$keyfile); + } + if (alreadyExistsInNew($security)){ + # already exists in new + updateEntry($security, "SECURITY", 0, 1); + } + else { + addEntryToNew($security, "SECURITY", 1); + } +} + +############################################################################# + +sub migrateSNMP{ + my $snmp = shift; + if (alreadyExistsInNew($snmp)){ + # already exists in new + updateEntry($snmp, "SNMP", 0, 1); + } + else { + addEntryToNew($snmp, "SNMP", 1); + } +} + +############################################################################# +# printMsg print message to the user standard output. + +sub printMsg { + + my $TypeMsg = shift ; + my $Msg = shift ; + my $LineNb = shift ; + if ($LineNb) { + printTrace("Line: $LineNb, $TypeMsg, $Msg"); + } + else { + printTrace("$TypeMsg $Msg"); + } +} + +############################################################################# +# print message error to the user standard output. + +sub printTrace { + + my $Msg = shift ; + my $level = shift ; + my $sep = shift ; + + if ($sep) { + print "\n-------------------------------------------------------------------------"; + print LOGFILE "\n-------------------------------------------------------------------------"; + } + + if ($level <= $TRACELEVEL) { + print($Msg); + print LOGFILE $Msg ; + } +} + +############################################################################# +# this subroutine implements a very stupid version of diff + +sub diff { + my $f1 = shift; + my $f2 = shift; + my $lineToBeginWith = shift; + my $NULL = "" ; + my $diff_f1 = $NULL ; + my $diff_f2 = $NULL ; + my $retval = $NULL ; + my $ret; + open(F1, "$f1") or die "Could not open file $f1"; + open(F2, "$f2") or close(F1), die "Could not open file $f2"; + + while (defined($l1 = )) { + if ($lineToBeginWith){ + $lineToBeginWith -- ; + next ; + } + next if ($l1 =~ /^\#/); + $ret = defined($l2 = ); + if ($ret) { + $ret = defined($l2 = ) while ($ret && ($l2 =~ /^\#/)) ; + if ($ret) { + if (!($l1 eq $l2)) { + + # ignore whitespace + $l1_clean = $l1 ; + $l2_clean = $l2 ; + $l1_clean =~ s/\s//g; + $l2_clean =~ s/\s//g; + + if (!($l1_clean eq $l2_clean)) { + $diff_f1 .= "${l1}" unless ($l1_clean eq $NULL); + $diff_f2 .= "${l2}" unless ($l2_clean eq $NULL); + } + } + } + else { + next if ($l1 =~ /^\s*$/) ; + $diff_f1 .= "${l1}"; + } + } + else { + next if ($l1 =~ /^\s*$/) ; + $diff_f1 .= "${l1}"; + } + } + + while (defined($l2 = )) { + if (($l2 =~ /^\#/) || ($l2 =~ /^\s*$/)) { + next ; + } + else { + $diff_f2 .= "${l2}" ; + } + } + + close(F1); + close(F2); + + $retval .= "- differences present in your config file but not in standard file:\n\n". "$diff_f1\n" if ($diff_f1) ; + $retval .= "- differences present in standard file but not in your config file:\n\n" . "$diff_f2" if ($diff_f2) ; + return $retval ; +} + +sub CompareStdConfigFiles { + # Compare each configuration file against its default version. If it has changed, + # notify the user that the file has changed and will need to be checked by the + # user. This should be safe to do because there should be no path information + # stored in these conf files, which are just schema stuff. + # printTrace("\nCheck if standard configuration files have changed",3); + + # get the version of the DS to migrate + ($oldVersion, $oldMinor) = &getVersion($oldDir, $oldversionstr); + # get the version of the new DS + ($Version, $Minor) = &getVersion($root); + + # get old LIB_PATH + $old_libpath = &getLibPath($oldDir, $oldVersion, $oldMinor); + # get new LIB_PATH + $new_libpath = &getLibPath($root, $Version, $Minor); + + my $origFilePath = "$oldDir${PATHSEP}bin${PATHSEP}slapd${PATHSEP}install${PATHSEP}schema${PATHSEP}" ; + my $FilesChanged = ""; + my $AllDiffs = "***********************************************************************"; + my $NoChanges = "" ; + my $lineToBegin = 0 ; + opendir(CONFDIR, $oldSchemaDir) or + die "Error: could not open migrated config dir $oldConfDir: $!"; + + foreach $file (readdir(CONFDIR)) { + $origFile = $origFilePath . $file ; + $configFile = $oldSchemaDir . $file ; + if (( exists($stdIncludes{lc($file)})) && (-f $origFile)) { + $diffs = &diff($configFile, $origFile, $lineToBegin); + $lineToBegin = 0 if $lineToBegin ; + if ($diffs) { + $FilesChanged .= "\n$configFile"; + $AllDiffs .= "\n$configFile is different than the standard configuration file" ; + $AllDiffs .= "\nYou will need to check this file and make sure its changes are compatible "; + $AllDiffs .= "with the new directory server\nHere are the differences:\n"; + $AllDiffs .= "$diffs \n\n"; + $AllDiffs .= "***********************************************************************"; + } + else { + $NoChanges .= "\n$configFile"; + } + } + } + closedir(CONFDIR); + +if ($FilesChanged) { + printTrace("\nNo changes to old configuration files:$NoChanges",3) ; + printTrace("\n***********************************************************************",3) ; + printMsg("\nThe following standard files have been modified: $FilesChanged"); + if ($NO_INPUT_USER) { + # do nothing + } + else { + printMsg("\nDo you want to see the differences Yes/No [No] ?") ; + my $answer = ; + if ($answer =~ /y|yes/i) { + printMsg("$AllDiffs"); + } + printMsg("\nDo you want to continue the migration Yes/No [No] ?"); + $answer = ; + if (! ($answer =~ /y|yes/i)) { + exit(1); + } + } + } +} + + + +############################################################################# + +# this is used to run the system() call, capture exit and signal codes, +# and die() upon badness; the first argument is a directory to change +# dir to, if any, and the rest are passed to system() +sub mySystem { + my $rc = &mySystemNoDie(@_); + my ($dir, @args) = @_; + if ($rc == 0) { +# success + } elsif ($rc == 0xff00) { + die "Error executing @args: error code $rc: $!"; + } elsif ($rc > 0x80) { + $rc >>= 8; + die "Error executing @args: error code $rc: $!"; + } else { + if ($rc & 0x80) { + $rc &= ~0x80; + } + die "Error executing @args: received signal $rc: $!"; + } + + # usually won't get return value + return $rc; +} + +# This version does not die but just returns the error code +sub mySystemNoDie { + my ($dir, @args) = @_; + if ($dir && ($dir ne "")) { + chdir($dir) or die "Could not change directory to $dir: $!"; + } + my $cmd = $args[0]; + # the system {$cmd} avoids some NT shell quoting problems if the $cmd + # needs to be quoted e.g. contains spaces; the map puts double quotes + # around the arguments on NT which are stripped by the command + # interpreter cmd.exe; but don't quote things which are already quoted + my @fixargs = map { /^[\"].*[\"]$/ ? $_ : $quote . $_ . $quote } @args; + my $rc = 0; + if ($cmd =~ /[.](bat|cmd)$/) { + # we have to pass batch files directly to the NT command interpreter + $cmd = $com_spec; +# print "system $cmd /c \"@fixargs\"\n"; + $rc = 0xffff & system {$cmd} '/c', "\"@fixargs\""; + } else { +# print "system $cmd @fixargs\n"; + $rc = 0xffff & system {$cmd} @fixargs; + } + chdir(${curdir}) or die "Could not change directory to $curdir: $!"; + return $rc; +} + +########################################################################################### +# # +# Export/Import of the backends in @BACKENDS # +# # +########################################################################################### + +sub manydb2Ldif { + my $ldif_dir = shift; + $ENV{"$LIB_PATH"}=$old_libpath; + if (! $ldif_dir) { $ldif_dir = $ldif_rep ;} + if (!(-d $ldif_dir)) { + mkdir($ldif_dir,0777) or die "can't create $ldif_dir to store temporary ldif files"; + } + chdir($oldSlapdExecDir) or die "Could not change directory to $oldSlapdExecDir: $!"; + foreach $backend (@BACKENDS) { + my $ldif = "${ldif_dir}$backend.ldif" ; + &db2Ldif($ldif, $backend, $oldHome); + } + print " Done.\n"; + chdir($curdir) or die "Could not change directory to $curdir: $!"; +} + +sub db2Ldif { + my $ldif = shift ; + my $backend = shift ; + my $home = shift ; + my $include_suffix = shift ; + my $db2ldif_param ; + if ($include_suffix) { + $db2ldif_param = "db2ldif -r -D $home -n $backend -a $ldif -s \"$include_suffix\""; + } + else { + $db2ldif_param = "db2ldif -r -D $home -n $backend -a $ldif"; + } + open(DB2LDIF, "${quote}${quote}$slapdExecName${quote} $db2ldif_param${quote} 2>&1 |") or die "Could not run ns-slapd program $ldif2db_exe\n"; + sleep(1); # allow some data to accumulate in the pipe + my $ii = 0; + while () { + ++$ii; + if (($ii % 250) == 0) { + printMsg(" Processing...\n"); + } + printMsg($_); + } + close(DB2LDIF); + # set the ownership of the ldif file; should be the same as the 5.x slapd user id + if ((! $isNt) && ($oldlocaluser ne $localuser)) { + if (-f $ldif) { + chown( $newuid, $newgid, $ldif) or printMsg("\nUnable to change the ownership of $ldif to $localuser") ; + } + } +} + +sub manyLdif2db { + my $ldif_dir = shift; + $ENV{"$LIB_PATH"}=$new_libpath; + chdir($slapdExecDir) or die "Could not change directory to $slapdExecDir: $!"; + foreach $backend (@BACKENDS) { + my $ldif = "${ldif_dir}$backend.ldif" ; + &Ldif2db($ldif, $backend); + } + # remove the empty ldif directory + # but not if using the data dir + if (!$olddatadir) { + rmdir($ldif_dir); + } + chdir($curdir) or die "Could not change directory to $curdir: $!"; +} + + +sub Ldif2db { + my $ldif = shift ; + my $backend = shift ; + my $ldif2db_param = "ldif2db -D $serverHome -n $backend -i $ldif"; + open(LDIF2DB, "${quote}${quote}$slapdExecName${quote} $ldif2db_param${quote} 2>&1 |") or die "Could not run ns-slapd program $ldif2db_exe\n"; + sleep(1); # allow some data to accumulate in the pipe + while () { + printMsg($_); + } + close(LDIF2DB); + # remove the ldif file after the import + # but not if using the data dir + if (!$olddatadir) { + unlink($ldif) ; + } +} + + +########################################################################################### +# # +# Running/Stopping the Server # +# # +########################################################################################### + + + +sub isDirectoryAlive { + die "\n Migration aborted. Make sure your old and new Directory Servers are installed on the same machine \n" if ( $LDAPservername == -1 ); + my $test_conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd); + if ($test_conn) { + $test_conn->close(); + return 1; + } + else { + return 0 ; + } +} + + +sub startServer { + my $instanceDir = ${serverHome} ; + my $errLog = $instanceDir . $PATHSEP . 'logs' . $PATHSEP . 'errors'; + # emulate tail -f + # if the last line we see does not contain "slapd started", try again + my $done = 0; + my $started = 0; + my $code = 0; + my $lastLine = ""; + my $timeout = time + 240; # 4 minutes + $ENV{"$LIB_PATH"}=$new_libpath; + + my $startCmd = $instanceDir . $PATHSEP . 'start' . $script_suffix; + if (! -f $startCmd) { + $startCmd = $instanceDir . $PATHSEP . 'start-slapd' . $script_suffix; + } + $code = &mySystem($instanceDir,$startCmd); + open(IN, $errLog) or die "Could not open error log $errLog: $!"; + my $pos = tell(IN); + while (($done == 0) && (time < $timeout)) { + for (; ($done == 0) && ($_ = ); $pos = tell(IN)) { + $lastLine = $_; + # print; + # the server has already been started and shutdown once . . . + if (/slapd started\./) { + $started++; + if ($started == 2) { + $done = 1; + } + # sometimes the server will fail to come up; in that case, restart it + } elsif (/Initialization Failed/) { + # print "Server failed to start: $_"; + $code = &mySystem($instanceDir, $startCmd); + # sometimes the server will fail to come up; in that case, restart it + } elsif (/exiting\./) { + # print "Server failed to start: $_"; + #$code = &mySystem($startCmd); + $code = &mySystem($instanceDir, $startCmd); + } + } + if ($lastLine =~ /PR_Bind/) { + # server port conflicts with another one, just report and punt + print $lastLine; + print "This server cannot be started until the other server on this\n"; + print "port is shutdown.\n"; + $done = 1; + } + if ($done == 0) { + # rest a bit, then . . . + sleep(2); + # . . . reset the EOF status of the file desc + seek(IN, $pos, 0); + } + } + close(IN); + + sleep(5); + die "\nUnable to start the $Version.$Minor Directory Server\n" unless (isDirectoryAlive()); + + return 0; +} + +sub stopServer { + my $root = shift; + my $name = shift; + $maxStopIterations = 5; + print "\nShutting down server $name . . .\n"; + $ENV{"$LIB_PATH"}=$new_libpath; + $stopCmd = $quote . $root . $PATHSEP . $name . $PATHSEP . 'stop' . $script_suffix . $quote; + if (! -f $stopCmd) { + $stopCmd = $quote . $root . $PATHSEP . $name . $PATHSEP . 'stop-slapd' . $script_suffix . $quote; + } + + if (! -f $stopCmd) { + # no stop command, probably a 1.X system; for NT, we'll try net stop + # for unix, we'll get the pid and kill it + if ($isNT) { + $stopCmd = 'net stop ' . $name; + } else { + # see if there is a pid file + $pidfile = $root . $PATHSEP . $name . $PATHSEP . 'logs' . + $PATHSEP . 'pid'; + if (open(PIDFILE, $pidfile)) { + chomp($pid = ); + close(PIDFILE); + while ($maxStopIterations-- && !$exitCode) { + $exitCode = kill(15, $pid); + } + $stopCmd = undef; + } + } + } + + # keep looping until the stop cmd returns an error code, which usually + # means that what ever we want to stop is stopped, or some other error + # occurred e.g. permission, or no such service + $exitCode = &runAndIgnoreOutput($stopCmd); +# print "stopServer: exitCode=$exitCode\n"; + while ($stopCmd && $maxStopIterations-- && $exitCode) { + $exitCode = &runAndIgnoreOutput($stopCmd); +# print "stopServer: exitCode=$exitCode\n"; + } + + if (!$maxStopIterations) { + print "Warning: could not shutdown the server: $!\n"; + } + sleep(10) ; + $exitCode = 0; +} + + +sub runAndIgnoreOutput { + my $cmd = shift; + printMsg("."); + open(RUNCMD, "${quote}$cmd${quote} 2>&1 |") or die "Error: could not run $cmd: $!"; + printMsg("."); + sleep(1); # allow pipe to fill with data + printMsg("."); + while () { +# print; + } + my $code = close(RUNCMD); +# print "runAndIgnore: code=$code status=$?\n"; + return $?; +} + +############################################################################# +# migrate SSL info + +sub MigrateSSL { + my $secPwd = 'bidon' ; + # copy the SSL directory + ©Dir("$oldHome${PATHSEP}ssl","$serverHome${PATHSEP}ssl") if (-d "$oldHome${PATHSEP}ssl"); + # copy the cert db and key files + if ( -d "$oldDir${PATHSEP}alias") { + $aliasDir = "$root${PATHSEP}alias"; + if (! -d $aliasDir) { + mkdir($aliasDir, 0750); + } + &stopServer($root,'slapd-'.$newname); + my $keydb = "$aliasDir${PATHSEP}slapd-$newname-key3.db" ; + my $certdb = "$aliasDir${PATHSEP}slapd-$newname-cert8.db" ; + my $certdb7 = "$aliasDir${PATHSEP}slapd-$newname-cert7.db" ; + my $old_keydb = "$oldDir${PATHSEP}alias${PATHSEP}slapd-$oldname-key3.db" ; + my $old_certdb = "$oldDir${PATHSEP}alias${PATHSEP}slapd-$oldname-cert7.db"; + my $keydb_backup = "$aliasDir${PATHSEP}slapd-$newname-key3.db_backup" ; + my $certdb_backup = "$aliasDir${PATHSEP}slapd-$newname-cert7.db_backup" ; + if (-f $old_keydb) { + if (-f $keydb) { + if ($NO_INPUT_USER) { + printMsg("\n$keydb already exists. backup in $keydb_backup ..."); + ©BinFile($keydb,$keydb_backup); + ©BinFile($old_keydb,$keydb); + } + else { + print("\n\n$keydb already exists. Do you want to overwrite it ? [no]: "); + my $answer = ; + if ($answer =~ /^y|yes$/i) { + ©BinFile($old_keydb,$keydb); + } + } + } + else { + ©BinFile($old_keydb,$keydb); + } + } + if (-f $old_certdb) { + $mode = (stat($old_certdb))[2] if $PRESERVE; + if (-f $certdb) { + if ($NO_INPUT_USER) { + printMsg("\n$certdb already exists. backup in $certdb_backup ..."); + ©BinFile($certdb,$certdb_backup); + unlink($certdb) || print "Couldn't delete $certdb : $!\n"; + ©BinFile($old_certdb,$certdb7); + } + else { + print("\n\n$certdb already exists. Do you want to overwrite it ? [no]: "); + my $answer = ; + if ($answer =~ /^y|yes$/i) { + unlink($certdb) || print "Couldn't delete $certdb : $!\n"; + ©BinFile($old_certdb,$certdb7); + } + } + } + else { + ©BinFile($old_certdb,$certdb7); + } + } + # copy the old password file + if (-f "$oldDir${PATHSEP}alias${PATHSEP}$type-$oldname-pin.txt") { + ©BinFile( + "$oldDir${PATHSEP}alias${PATHSEP}$type-$oldname-pin.txt", + "$aliasDir${PATHSEP}$type-$newname-pin.txt" + ); + } + &startServer(); + if ($PRESERVE) { + chown($newuid,$newgid,$certdb) || print "Failed to set uid $newuid gid $newgid on $certdb : $!\n"; + chmod($mode,$certdb) || print "Failed to set mode $mode on $certdb : $!\n"; + } + } + +} + +sub DisableSSL { + my $entry = $conn->search("cn=config","base","objectclass=*"); + my $LDAPparam = "nsslapd-security" ; + my $Value = "off" ; + if ($entry->{$LDAPparam}[0] ne $Value) { + printTrace("\nDisable SSL...",1); + $entry->setValues($LDAPparam, $Value); + } + my $res = $conn->update($entry); + if ($res) { + printTrace("\nSSL disabled",2); + } + else { + printMsg("\nCan't disabled SSL. The server may have problems to start"); + } +} + +# enable the migration of client authentication informations +sub MigrateCertmap { + # backup the old certmap.conf and replace it with the new one + my $oldCertmap = "$oldDir${PATHSEP}shared${PATHSEP}config${PATHSEP}certmap.conf"; + my $newCertmap = "$root${PATHSEP}shared${PATHSEP}config${PATHSEP}certmap.conf" ; + my $backupCertmap = "$root${PATHSEP}shared${PATHSEP}config${PATHSEP}certmap.conf_backup" ; + if (-f $oldCertmap) { + if ($NO_INPUT_USER) { + printMsg("\n$newCertmap has been backup in $backupCertmap"); + ©BinFile($newCertmap,$backupCertmap); + ©BinFile($oldCertmap,$newCertmap); + } + else { + my $Ask = 1 ; + while ($Ask) { + printMsg("\n\nWhere do you want to back up the file $newCertmap [$backupCertmap] ?") ; + my $Answer = ; + $backupCertmap = $Answer if ($Answer ne "\n"); + chomp($backupCertmap); + printTrace("\nDest: .$backupCertmap.",4); + if (-e $backupCertmap) { + printMsg("\n\n$backupCertmap already exists. Do you want to overwrite it Yes/No [No] ?") ; + if ( =~ /yes|y/i) { + $Ask = 0 ; + } + else { + $backupCertmap = "$root${PATHSEP}shared${PATHSEP}config${PATHSEP}certmap.conf_backup" ; + } + } + else { + $Ask = 0 ; + } + } + printTrace("\nBackup file: $newCertmap in $backupCertmap",4); + ©BinFile($newCertmap,$backupCertmap); + ©BinFile($oldCertmap,$newCertmap); + } + } + else { + } +} + +sub hasChangedoldCertmap { + my $certmapfile = shift ; + my @reference = ("certmap default default", + "default:DNComps", + "default:FilterComps e") ; + my $cpt = 0 ; + printTrace("\nhasChangedoldCertmap",3); + open(CERTMAP,"< $certmapfile"); + while () { + if ((! /^\s*#/) && (! /^\s*$/)) { + my $ref = $reference[$cpt] ; + printTrace("\nValue: $_, ref: $ref",4); + if (! /^\s*$ref\s*$/) { + return 1 ; + } + else { + $cpt++ ; + } + } + } + close (CERTMAP); + printTrace("\ncpt: $cpt",4); + if ($cpt < $#reference) { + return 1 ; + } + else { + return 0 ; + } +} + + +########################################################################################### +# # +# Copy directory and files functions # +# # +########################################################################################### + + +sub copyDir { + my $src = shift; + my $dest = shift; + my $exclude = shift; + + opendir( SRC, $src ) or die "Can't open directory $src: $!: "; + my $mode; + my $uid; + my $gid; + mkdir ( $dest , 0755 ) or die "\nCan't create directory $dest. \nPlease check you have enough rights to create it and/or check that your parent directory exists.\n" if !( -e $dest ); + if ($PRESERVE) { + $mode = (stat($src))[2]; + ($uid, $gid) = (stat(_))[4..5]; + # Make sure files owned by the old user are owned by the + # new user + if ($uid == $olduid) { + $uid = $newuid; + $gid = $newgid; + } + chown $uid, $gid, $dest; + chmod $mode, $dest; + } + local ( @files ) = readdir ( SRC ); + closedir( SRC ); + for ( @files ) { + if ( $_ eq "." || $_ eq ".." ) { + next; + } elsif ( $exclude && /$exclude/ ) { + next; + } elsif( -d "$src${PATHSEP}$_") { + ©Dir ( "$src${PATHSEP}$_", "$dest${PATHSEP}$_" ); + } else { + ©BinFile ( "$src${PATHSEP}$_", "$dest${PATHSEP}$_"); + } + } +} + +sub copyBinFile { + my $src = shift; + my $dest = shift; + my $buf = ""; + my $bufsize = 8192; + + open( SRC, $src ) || die "Can't open $src: $!\n"; + # if we are given a directory destination instead of a file, extract the + # filename portion of the source to use as the destination filename + if (-d $dest) { + $dest = $dest . $PATHSEP . &basename($src); + } + open( DEST, ">$dest" ) || die "Can't create $dest: $!\n"; + binmode SRC; + binmode DEST; + if ($PRESERVE) { + $mode = (stat($src))[2]; + ($uid, $gid) = (stat(_))[4..5]; + # Make sure files owned by the old user are owned by the + # new user + if ($uid == $olduid) { + $uid = $newuid; + $gid = $newgid; + } + chown $uid, $gid, $dest; + chmod $mode, $dest; + } + while (read(SRC, $buf, $bufsize)) { + print DEST $buf; + } + close( SRC ); + close( DEST ); +} + +############################################################################################################# +# backup 5.x configuration files # +# backup the directory /slapd-instance/config dans /slapd-instance/BackupConfig # # +# # +############################################################################################################# + + +sub backupConfigFiles { + # backup the 5.x config files + my $src = "$serverHome${PATHSEP}config" ; + my $dest = "$serverHome${PATHSEP}config_backup" ; + if ($NO_INPUT_USER) { + printMsg("\n$src has been backup in $dest"); + ©Dir($src,$dest); + } + else { + my $Ask = 1 ; + while ($Ask) { + printMsg("\n\nWhere do you want to back up your configuration directory [$dest] ?") ; + my $Answer = ; + $dest = $Answer if ($Answer ne "\n"); + chomp($dest); + printTrace("\nDest: .$dest.",4); + if (-e $dest) { + printMsg("\n\n$dest already exists. Do you want to overwrite it Yes/No [No] ?") ; + if ( =~ /yes|y/i) { + $Ask = 0 ; + } + else { + $dest = "$serverHome${PATHSEP}config_backup" ; + } + } + else { + $Ask = 0 ; + } + } + printTrace("\nBackup Directory: $src in $dest",4); + ©Dir($src,$dest); + } +} +############################################################################# + +sub getLDAPservername { + my $oldLDAPservername; + my $LDAPservername; + my $localhost = "nsslapd-localhost"; + open(OLDDSELDIF, "< $oldDSEldif") or die "\nError: could not open old config file $oldDSEldif \n"; + my $in = new Mozilla::LDAP::LDIF(*OLDDSELDIF) ; + while ($entry = readOneEntry $in) { + my $DN = $entry->getDN(1) ; + if ($DN =~ /^cn=config$/i) { + my @values = $entry->getValues($localhost); + if ($entry->size($localhost)) { + $oldLDAPservername = $values[0]; + printTrace("\nName of the old LDAP server: $oldLDAPservername",3); + } + break; + } + } + close(OLDSELDIF); + + open( DSELDIF, "< $DSEldif" ) || die "\nCan't open $DSEldif \n"; + my $in = new Mozilla::LDAP::LDIF(*DSELDIF) ; + while ($entry = readOneEntry $in) { + my $DN = $entry->getDN(1) ; + if ($DN =~ /^cn=config$/i) { + my @values = $entry->getValues($localhost); + if ($entry->size($localhost)) { + $LDAPservername = $values[0]; + printTrace("\nName of the new LDAP server: $LDAPservername",3); + } + break; + } + } + close(DSELDIF); + # check ol and new Directory Instance are installed on the same physical machine. + if (lc($oldLDAPservername) ne lc($LDAPservername)) { + # warn the user he tries to migrate a 4.x server installed on a different machine from the 5.x one + printMsg("\n\nYour old instance is on $oldLDAPservername, whereas your new instance is on $LDAPservername. Migration on different machines is not supported. Do you want to continue ? Yes/No [No]:") ; + if (! ( =~ /yes|y/i)) { + return -1; + } + } + return $LDAPservername ; +} + +############################################################################# + +sub getLibPath { + my $myDir = shift; + my $myVersion = shift; + my $myMinor = shift; + + if ($isNT) { + return $ENV{"$LIB_PATH"}; + } + if (($myVersion >= 6) && ($myMinor >= 2)) { + return + "$myDir${PATHSEP}bin${PATHSEP}slapd${PATHSEP}lib${SEP}". + "$myDir${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${SEP}". + $ENV{"$LIB_PATH"}; + } else { + return "$myDir${PATHSEP}lib${SEP}".$ENV{"$LIB_PATH"}; + } +} + +############################################################################# + +sub getVersion { + my $dir = shift; + my $versionstr = shift; + my $version = 0; + my $minor = 0; + my $buildNumber = 0; + my $progDir = "${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${PATHSEP}"; + my $progDir2 = "${PATHSEP}bin${PATHSEP}slapd${PATHSEP}"; + + # find the slapd executable + if (!$versionstr) { # version not specified on cmd line - find it + $prog = $dir . $progDir . $slapdExecName; + if (! -f $prog) { + $prog = $dir . $progDir2 . $slapdExecName; + if (-f $prog && $isNT) { + # if slapd is in bin/slapd and we're on NT, just assume version 1; + # apparently, slapd.exe doesn't like the -v argument . . . + return ( '1', $minor ); + } + else{ + die "Could not run slapd program $prog: $!"; + } + } + else { + chdir($dir . $progDir); + } + $cur_libpath=$ENV{"$LIB_PATH"}; + $ENV{"$LIB_PATH"}= + "$dir${PATHSEP}lib${SEP}". + "$dir${PATHSEP}bin${PATHSEP}slapd${PATHSEP}lib${SEP}". + "$dir${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${SEP}". + $ENV{"$LIB_PATH"}; + # read the old version from the old slapd program + + open(F, "${quote}${quote}$prog${quote} -v${quote} 2>&1 |") or + die "Could not run slapd program $prog: $!"; + sleep(1); # allow some data to accumulate in the pipe +# print "Output from $prog -v:\n"; + while () { + if (/^Netscape-Directory/ || /^iPlanet-Directory/i) { + $versionstr = $_; + last; + } + } + $code = close(F); + # print "$prog returned code=$code status=$?\n"; + $ENV{"$LIB_PATH"}=$cur_libpath; + } + + if ($versionstr =~ /^Netscape-Directory\/(\d+)\.(\d+)(?:b\d)*\s+(\S+)/) { + $version = $1; + $minor = $2; + $buildNumber = $3; + } + elsif ($versionstr =~ /^Netscape-Directory\(restrict?ed-mode\)\/(\d+)\.(\d+)\s+(\S+)/) { # we can have restricted-mode or restriced-mode ... + $version = $1; + $minor = $2; + $buildNumber = $3; + } + elsif ($versionstr =~ /^iPlanet-Directory\/(\d+)\.(\d+)\s+(\S+)/i) { + $version = $1; + $minor = $2; + $buildNumber = $3; + } elsif ($versionstr =~ /(\d+)\.(\d+)/) { + $version = $1; + $minor = $2; + } + + if ($version == 0) { + die "\nCould not determine version of the directory server in $dir: \n"; + } + + # distinguish the 4.1 and the 4.11 thanks to the buildNumber + if (($version == 4) && ($minor == 1)){ + if (! ($buildNumber =~ /^B99\.16/)) { + # it's not a 4.1 Netscape Directory Server => it's a 4.11 + $minor = 11 ; + } + } + chdir($curdir) or die "Could not change directory to $curdir: $!" ; + return ( $version, $minor ); +} + +############################################################################################### +sub normalizeDir { + my $dir = shift ; + my $dir_prec = "" ; + while ($dir_prec ne $dir) { + $dir_prec = $dir ; + if ($isNT) { + grep { s@\\\\@\\@g } $dir ; + } + else { + grep { s@//@/@g } $dir ; + } + } + return $dir ; +} + + +############################################################################################### + +sub GetTime { + my $tm = localtime; + (my $sec, my $min, my $hour, my $dd, my $mm, my $yy) = ($tm->sec, $tm->min, $tm->hour, $tm->mday, ($tm->mon)+1, ($tm->year)+1900); + $sec = "0$sec" unless $sec > 9 ; + $min = "0$min" unless $min > 9 ; + $hour = "0$hour" unless $hour > 9 ; + $dd = "0$dd" unless $dd > 9 ; + $mm = "0$mm" unless $mm > 9 ; + return ($sec, $min, $hour, $dd, $mm, $yy); +} + +############################################################################################### +# get uid and group id of the 5.x slapd server. +# The uid is done through the nsslapd-localuser attribute + +sub getuid_gid { + my $newuid ; + my $newgid ; + my $localuser ; + my $localuser_attr = "nsslapd-localuser" ; + if (! $isNT) { + &startServer() unless (isDirectoryAlive()); + my $conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Can't contact the $Version.$Minor LDAP server: $LDAPservername\n"; + my $entry = $conn->search("cn=config ", "base","objectclass=*", 0, ($localuser_attr)) ; + # Tests wether we succeed to get the entry cn=config + die "\nCan't get the entry cn=config \n" unless ($entry); + my @values = $entry->getValues($localuser_attr); + $conn->close(); + if ($#values == -1 || ($values[0] eq "") ) { # tests wether the nsslapd-localuser attribute has a value + printMsg("\nNo localuser has been found in the configuration of the directory. "); + if ($NO_INPUT_USER) { + printMsg("\nWe considered nobody as the localuser"); + $localuser = "nobody" ; + } + else { + my $Ask = 1 ; + while ($Ask) { + printMsg("\nUnder what user does your $Version.$Minor directory server run [nobody] ? ") ; + $localuser = ; + chomp($localuser); + $localuser = "nobody" if ($localuser eq ""); + ($newuid, $newgid) = (getpwnam("$localuser"))[2..3] ; + if ($newuid) { + $Ask = 0 ; + } + else { + printMsg("\nError: $localuser is unknown from the system "); + } + } + } + } + else { + $localuser = $values[0]; # returns the first value (we should only have one localuser) + my $size = $#values ; + } + ($newuid, $newgid) = (getpwnam("$localuser"))[2..3] ; + return ($localuser, $newuid, $newgid) ; + } + else { + return () ; + } +} + +sub getolduid_gid { + my $oldlocaluser ; + my $localuserAttr = "nsslapd-localuser"; + my $entry ; + if (! $isNT) { + open( DSELDIF, "< $oldDSEldif" ) || die "Can't open $oldDSEldif: $!: "; + my $in = new Mozilla::LDAP::LDIF(*DSELDIF) ; + while ($entry = readOneEntry $in) { + $typeOfEntry = getTypeOfEntry($entry); + if ($typeOfEntry eq "CONFIG_NODE") { + $oldlocaluser = $entry->{$localuserAttr}[0] if ($entry->exists($localuserAttr)); + break ; + } + } + close(DSE); + ($olduid, $oldgid) = (getpwnam("$oldlocaluser"))[2..3] ; + return ($oldlocaluser, $olduid, $oldgid) ; + } + else { + return (); + } +} +############################################################################################### +# get current directory + +sub getCwd { + my $command = $isNT ? "cd" : "/bin/pwd"; + open(PWDCMD, "$command 2>&1 |") or + die "Error: could not execute $command: $!"; + # without the following sleep, reading from the pipe will + # return nothing; I guess it gives the pwd command time + # to get some data to read . . . + sleep(1); + my $currentdir; + while () { + if (!$currentdir) { + chomp($currentdir = $_); + } + } + my $code = close(PWDCMD); +# if ($code || $?) { +# print "$command returned code=$code status=$? dir=$curdir\n"; +# } +# print "getCwd curdir=\[$curdir\]\n"; + return $currentdir; +} + +################################ +# Need to migrate the credential. +# If the credential can not be migrated, leave it at it is +################################ +sub migrate_credential{ + my $entry_to_modify = shift; + my $credentials_attr = shift; + my @old_value = $entry_to_modify->getValues($credentials_attr); + my $migratecredExecName = 'migratecred'; + my $credOldHome = $oldHome; + my $credServerHome = $serverHome; + + if ($isNT) { + # oldHome may be pointing to the archived copy of the + # instance dir which may be different than the path that + # the instance was originally installed as on Windows. If + # this path is not the original install path, then the + # credential will not be migrated correctly. We should + # prompt the user on Windows for the correct path. + + print "\n\nThe old instance path must be the same as where it was"; + print "\ninitially installed, not where it was archived in order"; + print "\nfor this step to succeed. Please verify that the path"; + print "\nis correct. Note that case sensitivity is important here."; + print "\n\nOld Instance Directory: $credOldHome"; + print "\nIs this correct? (y/n): "; + chomp(my $answer = ); + if (!($answer =~ /y|yes/i)) { + print "\nPlease enter the correct path for the old instance directory: "; + chomp($credOldHome = ); + } + + print "\n\nThe new instance path must also be correct for this step"; + print "\nto succeed. Please verify that the path is correct. Note"; + print "\nthat case sensitivity is important here."; + print "\n\nNew Instance Directory: $credServerHome"; + print "\nIs this correct? (y/n): "; + chomp(my $answer = ); + if (!($answer =~ /y|yes/i)) { + print "\nPlease enter the correct path for the new instance directory: "; + chomp($credServerHome = ); + } + } +# print "\nMigratecred command is: ${quote}$root${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${PATHSEP}$migratecredExecName${quote} -o $credOldHome -n $credServerHome -c @old_value\n"; + + my @new_cred = `${quote}$root${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${PATHSEP}$migratecredExecName${quote} -o $credOldHome -n $credServerHome -c @old_value`; + + if ( $? == 0 ) + { + $entry_to_modify->setValues($credentials_attr, @new_cred); + } +} + diff --git a/ldap/admin/src/scripts/template-migrate5to7 b/ldap/admin/src/scripts/template-migrate5to7 new file mode 100644 index 00000000..50aead79 --- /dev/null +++ b/ldap/admin/src/scripts/template-migrate5to7 @@ -0,0 +1,3043 @@ +#{{PERL-EXEC}} +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2004 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# + +# Migrate a 5.x directory server to a 7.0 directory server + +####################################################################################################### +# enable the use of Perldap functions +require DynaLoader; + +use Getopt::Std; +use Mozilla::LDAP::Conn; +use Mozilla::LDAP::Entry; +use Mozilla::LDAP::LDIF; +use Mozilla::LDAP::Utils qw(:all); +use Mozilla::LDAP::API qw(:api :ssl :apiv3 :constant); # Direct access to C API +use Time::localtime; +use File::Basename; +use Class::Struct ; + +####################################################################################################### + +sub usage { + print(STDERR "\nUsage: $0 -D rootdn { -w password | -w - | -j filename } -p port \n"); + print(STDERR " -o oldInstancePath -n newInstancePath [-t tracelevel] [-L logfile]\n"); + print(STDERR "************** parameters in brackets are optionals, others are required **************\n"); + print(STDERR " Opts: -D rootdn - new 7.0 Directory Manager\n"); + print(STDERR " : -w password - new 7.0 Directory Manager's password\n"); + print(STDERR " : -w - - Prompt for new 7.0 Directory Manager's password\n"); + print(STDERR " : -j filename - Read new 7.0 Directory Manager's password from file\n"); + print(STDERR " : -p port - new 7.0 Directory Server port\n"); + print(STDERR " : -o oldInstancePath - Path of the old instance to migrate \n"); + print(STDERR " : -n newInstancePath - Path of the new 7.0 instance\n"); + print(STDERR " : [-d dataPath] - Path to directory containing data files to import into new instance\n"); + print(STDERR " : [-v oldVersion] - Version of old instance (obtained by running $slapdExecName -v\n"); + print(STDERR " : [-t tracelevel] - (optional) specify the level of trace (0..3)\n"); + print(STDERR " : [-L logfile] - (optional) specify the file to log the migration report \n"); + } +######################################################################################################## + +BEGIN { + + require 'uname.lib' ; + $isNT = -d '\\'; + $PATHSEP = $isNT ? "\\" : "/"; + ${SEP} = $isNT ? ";" : ":" ; + @INC = ( '.', '../../../admin/admin/bin'); + grep { s@/@\\@g } @INC if $isNT; + $script_suffix = $isNT ? ".bat" : ""; + $exe_suffix = $isNT ? ".exe" : ""; + # NT needs quotes around some things unix doesn't + $quote = $isNT ? "\"" : ""; + + # If this variable is set, all file/directory creation will make sure the mode + # and ownership of the destination is the same as the source + $PRESERVE = 1 if (!$isNT); + $script_suffix = $isNT ? ".bat" : ""; + $exe_suffix = $isNT ? ".exe" : ""; + if ($isNT) { + $os = "WINNT"; + } else { + $os = &uname("-s"); + } + if ($isNT) { + # we have to pass batch files directly to the NT command interpreter + $com_spec = $ENV{ComSpec}; + if (!$com_spec) { + $com_spec = $ENV{COMSPEC}; + } + if (!$com_spec || ! -f $com_spec) { + # find the first available command interpreter + foreach $drive (c..z) { + $com_spec = "$drive:\\winnt\\system32\\cmd.exe"; + last if (-f $com_spec); + $com_spec = undef; + } + if (! $com_spec) { + # punt and pray + $com_spec = 'c:\winnt\system32\cmd.exe'; + } + } + } + if ( $os eq "AIX" ) { + $dll_suffix = "_shr.a"; + } + elsif ( $os eq "HP-UX" ) { + $dll_suffix = ".sl"; + } + elsif ( $os eq "WINNT" ) { + $dll_suffix = ".dll"; + } + else { + $dll_suffix = ".so"; + } + $slapdExecName = $isNT ? 'slapd.exe' : './ns-slapd'; + select STDERR; + $| = 1; + select STDOUT; + $| = 1; +} + +SWITCH: { + if ($os eq "AIX") { + $LIB_PATH = "LIBPATH" ; + last SWITCH ; + } + if ($os eq "HP-UX") { + $LIB_PATH = "SHLIB_PATH" ; + last SWITCH ; + } + if ($isNT) { + $LIB_PATH = "PATH" ; + last SWITCH ; + } + else { + $LIB_PATH = "LD_LIBRARY_PATH" ; + last SWITCH ; + } + } + + # old parameters + ${oldDir} = "" ; + ${oldname} = "" ; + ${oldHome} = "" ; + ${oldConfDir} = "" ; + ${oldlocaluser} ; + ${olduid} ; + ${oldgid} ; + + # new parameters + ${root} = "{{DS-ROOT}}" ; + ${type} = "" ; + ${newname} = "" ; + ${newport} = "" ; + ${rootDN} = "" ; + ${rootpwd} = "" ; + ${localhost} = "" ; + ${LogFileReport} = "" ; + ${newuid} ; + ${localuser} ; + ${newgid} ; + $NO_INPUT_USER = 0 ; # by default user can give inputs during the migration process + ${curdir} = getCwd(); + ${slapdExecDir} = "${root}${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${PATHSEP}"; + # in 7.0 the replica Id is setup to a static value + $replicaIdvalue = 65535; + + # specify the level of trace + $TRACELEVEL=1; + + $LDAP_SERVER_UNREACHABLE = 81; + + # get input users + &getParameters() ; + ${oldDir} = &normalizeDir("${oldDir}"); + ${oldHome} = "${oldDir}${PATHSEP}$type-$oldname" ; + ${oldConfDir} = "${oldHome}${PATHSEP}config${PATHSEP}" ; + ${oldSchemaDir} = "${oldConfDir}schema${PATHSEP}"; + ${oldDSEldif} = "${oldConfDir}dse.ldif"; + ${serverHome} = "${root}${PATHSEP}$type-$newname" ; + ${schemaDir} = "$serverHome${PATHSEP}config${PATHSEP}schema${PATHSEP}"; + ${DSEldif} = "$serverHome${PATHSEP}config${PATHSEP}dse.ldif"; + ${ldif_rep} = "${oldConfDir}ldif${PATHSEP}" ; + ${oldSlapdExecDir} = "${oldDir}${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${PATHSEP}"; + + open(LOGFILE, ">> $LogFileReport"); + + printTrace("\noldDir: $oldDir, oldHome: $oldHome, \noldConfDir: $oldConfDir, \nldif_rep: $ldif_rep, \nrootDN: $rootDN, \nPort: $newport, \nNewname: $newname\n",3); + printTrace("\nLIB_PATH: $LIB_PATH",4); + + if (!(-d $serverHome)) { + printMsg("\n$serverHome doesn't exist\n"); + exit(1); + } + if (!(-d $oldHome)) { + printMsg("\n$oldHome doesn't exist\n"); + exit(1); + } + + if ($olddatadir && !(-d $olddatadir)) { + print("\n$olddatadir doesn't exist\n"); + exit(1); + } + + +%HashParametersName = (); + +# The following hash displays only general server parameters to migrate under cn=config +%GeneralSrvParamToMigrate = ( + 'nsslapd-accesscontrol'=> '\n', + 'nsslapd-errorlog-logging-enabled'=> '\n', + 'nsslapd-accesslog-logging-enabled'=> '\n', + 'nsslapd-auditlog-logging-enabled'=> '\n', + 'nsslapd-accesslog-level'=> '\n', + 'nsslapd-accesslog-logbuffering'=> '\n', + 'nsslapd-accesslog-logexpirationtime'=> '\n', + 'nsslapd-accesslog-logexpirationtimeunit'=> '\n', + 'nsslapd-accesslog-logmaxdiskspace'=> '\n', + 'nsslapd-accesslog-logminfreediskspace'=> '\n', + 'nsslapd-accesslog-logrotationtime'=> '\n', + 'nsslapd-accesslog-logrotationtimeunit'=> '\n', + 'nsslapd-accesslog-maxlogsize'=> '\n', + 'nsslapd-accesslog-maxLogsPerDir'=> '\n', + 'nsslapd-attribute-name-exceptions'=> '\n', + 'nsslapd-auditlog-logexpirationtime'=> '\n', + 'nsslapd-auditlog-logexpirationtimeunit'=> '\n', + 'nsslapd-auditlog-logmaxdiskspace'=> '\n', + 'nsslapd-auditlog-logminfreediskspace'=> '\n', + 'nsslapd-auditlog-logrotationtime'=> '\n', + 'nsslapd-auditlog-logrotationtimeunit'=> '\n', + 'nsslapd-auditlog-maxlogsize'=> '\n', + 'nsslapd-auditlog-maxLogsPerDir'=> '\n', + 'nsslapd-certmap-basedn'=> '\n', + 'nsslapd-ds4-compatible-schema'=> '\n', + 'nsslapd-enquote-sup-oc'=> '\n', + 'nsslapd-errorlog-level'=> '\n', + 'nsslapd-errorlog-logexpirationtime'=> '\n', + 'nsslapd-errorlog-logexpirationtimeunit'=> '\n', + 'nsslapd-errorlog-logmaxdiskspace'=> '\n', + 'nsslapd-errorlog-logminfreediskspace'=> '\n', + 'nsslapd-errorlog-logrotationtime'=> '\n', + 'nsslapd-errorlog-logrotationtimeunit'=> '\n', + 'nsslapd-errorlog-maxlogsize'=> '\n', + 'nsslapd-errorlog-maxlogsperdir'=> '\n', + 'nsslapd-groupevalnestlevel'=> '\n', + 'nsslapd-idletimeout'=> '\n', + 'nsslapd-ioblocktimeout'=> '\n', + 'nsslapd-lastmod'=> '\n', + 'nsslapd-listenhost'=> '\n', + 'nsslapd-maxdescriptors'=> '\n', + 'nsslapd-nagle'=> '\n', + 'nsslapd-readonly'=> '\n', + 'nsslapd-referralmode'=> '\n', + 'nsslapd-plugin-depends-on-name'=> '\n', + 'nsslapd-plugin-depends-on-type'=> '\n', + 'nsslapd-referral'=> '\n', + 'nsslapd-reservedescriptors'=> '\n', + 'nsslapd-rootpwstoragescheme'=> '\n', + 'nsslapd-schemacheck'=> '\n', + 'nsslapd-secureport'=> '\n', + 'nsslapd-security'=> '\n', + 'nsslapd-sizelimit'=> '\n', + 'nsslapd-ssl3ciphers'=> '\n', + 'nsslapd-timelimit'=> '\n', + 'passwordchange'=> '\n', + 'passwordchecksyntax'=> '\n', + 'passwordexp'=> '\n', + 'passwordhistory'=> '\n', + 'passwordinhistory'=> '\n', + 'passwordlockout'=> '\n', + 'passwordlockoutduration'=> '\n', + 'passwordmaxage'=> '\n', + 'passwordmaxfailure'=> '\n', + 'passwordminage'=> '\n', + 'passwordminlength'=> '\n', + 'passwordmustchange'=> '\n', + 'passwordresetfailurecount' => '\n', + 'passwordstoragescheme' => '\n', + 'passwordunlock' => '\n', + 'passwordwarning' => '\n' +); + +# the following hash displays global parameters related to database stored under cn=config,cn=ldbm database,cn=plugins,cn=config +%GlobalConfigLDBMparamToMigrate = ( + 'nsslapd-allidsthreshold' => '\n', + 'nsslapd-lookthroughlimit' => '\n', + 'nsslapd-mode' => '\n', + 'nsslapd-dbcachesize' => '\n', + 'nsslapd-cache-autosize' => '\n', + 'nsslapd-cache-autosize-split' => '\n', + 'nsslapd-db-transaction-logging' => '\n', + 'nsslapd-import-cachesize' => '\n' +); + +# the following hash displays specific parameters to each backends and stored under cn=DBname,cn=ldbm database,cn=plugins,cn=config +%LDBMparamToMigrate = ( + 'nsslapd-cachesize' => '\n', + 'nsslapd-cachememsize' => '\n', + 'nsslapd-readonly' => '\n', + 'nsslapd-require-index' => '\n' +); + + +%ChainingConfigParams = ( + 'nsactivechainingcomponents' => '\n', + 'nstransmittedcontrols' => '\n' + ); + +%ChainingDefaultInstanceConfigParams = ( + 'nsabandonedsearchcheckinterval' => '\n', + 'nsbindconnectionslimit' => '\n', + 'nsbindtimeout' => '\n', + 'nsbindretrylimit' => '\n', + 'nshoplimit' => '\n', + 'nsmaxresponsedelay' => '\n', + 'nsmaxtestresponsedelay' => '\n', + 'nschecklocalaci' => '\n', + 'nsconcurrentbindlimit' => '\n', + 'nsconcurrentoperationslimit' => '\n', + 'nsconnectionlife' => '\n', + 'nsoperationconnectionslimit' => '\n', + 'nsproxiedauthorization' => '\n', + 'nsreferralonscopedsearch' => '\n', + 'nsslapd-sizelimit' => '\n', + 'nsslapd-timelimit' => '\n' +); + +%changelog5params = ( + 'nsslapd-changelogmaxage' => '\n', + 'nsslapd-changelogmaxentries' => '\n' + ); + +@SNMPparams = ( + 'nssnmpenabled', + 'nssnmporganization', + 'nssnmplocation', + 'nssnmpcontact', + 'nssnmpdescription', + 'nssnmpmasterhost', + 'nssnmpmasterport', + 'nssnmpenabled', + 'aci' + ); + +%stdIncludes = ( + "." => "\n", + ".." => "\n", + "30ns-common.ldif " => "\n", + "50ns-mail.ldif " => "\n", + "50ns-news.ldif" => "\n", + "50iplanet-servicemgt.ldif"=> "\n", + "50netscape-servicemgt.ldif"=> "\n", + "50ns-mcd-browser.ldif" => "\n", + "50ns-proxy.ldif" => "\n", + "00core.ldif" => "\n", + "50ns-admin.ldif" => "\n", + "50ns-mcd-config.ldif " => "\n", + "50ns-value.ldif" => "\n", + "05rfc2247.ldif" => "\n", + "50ns-calendar.ldif" => "\n", + "50ns-mcd-li.ldif" => "\n", + "50ns-wcal.ldif" => "\n", + "05rfc2927.ldif" => "\n", + "50ns-certificate.ldif" => "\n", + "50ns-mcd-mail.ldif" => "\n", + "50ns-web.ldif" => "\n", + "10rfc2307.ldif" => "\n", + "50ns-compass.ldif" => "\n", + "50ns-media.ldif" => "\n", + "20subscriber.ldif" => "\n", + "50ns-delegated-admin.ldif"=> "\n", + "50ns-mlm.ldif" => "\n", + "25java-object.ldif" => "\n", + "50ns-directory.ldif" => "\n", + "50ns-msg.ldif" => "\n", + "28pilot.ldif" => "\n", + "50ns-legacy.ldif" => "\n", + "50ns-netshare.ldif" => "\n" +); + + +# Backends migrated (Backend CN attribute value) +@BACKENDS = () ; +# All pairs of suffix-backend are registered in this hashtable +%oldBackends = () ; + +#store the backend instances to migrate +@LDBM_backend_instances = (); + +#store the mapping tree +@Mapping_tree_entries = (); + +#store the suffix and the associated chaining backend +%oldChainingBackends = (); + +#store the multiplexor bind entries to migrate +%MultiplexorBindDNEntriesToMigrate = (); + +#store the Replica bind DN entries to migrate +%ReplicaBindDNEntriesToMigrate = (); + +# list of standard plugins +%stdPlugins = ( + "7-bit check" => "\n", + "acl plugin" => "\n", + "acl preoperation" => "\n", + "binary syntax" => "\n", + "case exact string syntax" => "\n", + "case ignore string syntax" => "\n", + "chaining database" => "\n", + "class of service" => "\n", + "country string syntax" => "\n", + "distinguished name syntax" => "\n", + "generalized time syntax" => "\n", + "integer syntax" => "\n", + "internationalization plugin" => "\n", + "ldbm database" => "\n", + "legacy replication plugin" => "\n", + "multimaster replication plugin" => "\n", + "octet string syntax" => "\n", + "clear" => "\n", + "crypt" => "\n", + "ns-mta-md5" => "\n", + "sha" => "\n", + "ssha" => "\n", + "postal address syntax" => "\n", + "referential integrity postoperation" => "\n", + "retro changelog plugin" => "\n", + "roles plugin" => "\n", + "telephone syntax" => "\n", + "uid uniqueness" => "\n", + "uri syntax" => "\n" + ); + +# list of indexes that have disappeared from the new schema compared to 5.0 +%deniedIndexes = ( + 'dncomp' => "\n" +); + +@default_indexes = (); +@indexes = (); + +# list of user added Plugin's. In 7.0, they 'll need to be recompiled +@badPlugins = () ; + +@pluginAttrs = ( + "objectclass", + "cn", + "nsslapd-pluginpath", + "nsslapd-plugininitfunc", + "nsslapd-plugintype", + "nsslapd-pluginenabled", + "nsslapd-plugin-depends-on-type", + "nsslapd-pluginid", + "nsslapd-pluginversion", + "nsslapd-pluginvendor" + ); + +@nsds5replicaAttrs = ( + 'objectclass', + 'nsDS5ReplicaRoot', + 'nsDS5ReplicaType', + 'nsDS5ReplicaLegacyConsumer', + 'nsDS5flags', + 'nsDS5ReplicaId', + 'nsDS5ReplicaPurgeDelay', + 'nsDS5ReplicaBinddn', + 'cn', + 'nsDS5ReplicaReferral' + ); + +# array of replicas to migrate +@new6replicas = (); + +# array of replication agreements to migrate +@replicationAgreements = (); + +# compare LDIF standard config files with standard ones +CompareStdConfigFiles() ; +die "\n\n The version of product you want to migrate is not a 5.x Directory Server\n" unless ($oldVersion == 5) ; + +# Shutdown the legacy Directory instance +printTrace("\nShutdown the legacy Directory Server instance: ${oldHome}",0); +&stopServer($oldDir, 'slapd-'.$oldname); + +# get the hostname of the new LDAP server +my $LDAPservername = &getLDAPservername(); + +# get the uid and gid of the 7.0 slapd user +($localuser, $newuid, $newgid) = getuid_gid(); +# get the uid and gid of the 5.x slapd user +($oldlocaluser, $olduid, $oldgid) = getolduid_gid(); +printTrace("\n7.0 localuser: $localuser, uid: $newuid, gid: $newgid",2); +printTrace("\n5.x localuser: $oldlocaluser, uid: $olduid, gid: $oldgid",2); + +# backup 7.0 configuration files in <6server_root>/slapd-instancename/config +printTrace("\nBackup $serverHome${PATHSEP}config on $serverHome${PATHSEP}config_backup ...",0); +&backupConfigFiles(); + +# migrate the schema (need to stop and start the 7.0 server) +printTrace("\nMigrate the schema...",0); +MigrateSchema(); + +# start the server unless it is already started +&startServer() unless (isDirectoryAlive()); + +############### Connect to the 7.0 LDAP Directory Server ###################### +$ENV{"$LIB_PATH"} = $new_libpath; + +die "\n Migration aborted. Make sure your old and new Directory Server are installed on the same machine \n" if ( $LDAPservername == -1 ); +$conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Unable to contact the $Version.$Minor LDAP server: $LDAPservername\n"; + +# Cconnection to 7.0 LDAP server is successful ! +printTrace("\nConnected to $Version.$Minor LDAP server",0) ; + +# Parse the main configuration file: dse.ldif +printTrace("\n\nParse the old DSE ldif file: $oldDSEldif *****",0, 1); +printTrace("\nThis may take a while ...\n",0); +&MigrateDSEldif(); + +#migrate LDBM backend instances +printTrace("\n\nMigrate LDBM backend instances...",0,1); +&migrateLDBM_backend_instances(); + +#migrate mapping tree entries +printTrace("\n\nMigrate mapping tree...",0,1); +&migrateMappingTree(); + +#migrate default indexes +printTrace("\n\nMigrate default indexes...",0,1); +migrateDefaultIndexes(); + +#migrate indexes +printTrace("\n\nMigrate indexes...",0,1); +migrateIndexes(); + +#migrate replicas +printTrace("\n\nMigrate replicas...",0,1); +&MigrateNSDS5_replica(); + +#migrate replication agreements +printTrace("\n\nMigrate replication agreements...",0,1); +&MigrateNSDS_replication_agreement(); + +#migrate key/cert databases +printTrace("\n\nMigrate key/cert databases...",0,1); +&MigrateSSL(); + +# migrate certmap.conf +printTrace("\n\nMigrate Certmap.conf...",0,1); +&MigrateCertmap() ; + +################## Close the connection to 7.0 LDAP Server ##################### +printTrace("\n\n***** Close the LDAP connection to the new Directory Server instance ***** ",0); +$conn->close; + + +################## stop the new instance and Export/Import the data, restart the server ################## +if (@BACKENDS) { + &stopServer($root,'slapd-'.$newname); + if ($olddatadir) { + printTrace("\nData already contained in $olddatadir...\n",0,1) ; + $ldif_rep = "$olddatadir${PATHSEP}"; + } else { + printTrace("\nData processing...\n",0,1) ; + # migrate data for each backend: 5.x -> LDIF files + &manydb2Ldif($ldif_rep); + } + + # migrate LDIF data to the new database: LDIF -> New + &manyLdif2db($ldif_rep); + &migrateChangelog(); + printTrace("\n***** Migrate ReplicaBindDN entries...\n",0,1); + &importReplicaBindDNEntries(); + printTrace("\n***** Migrate MultiplexorBindDN entries...\n",0,1); + &importMultiplexorBindDNEntries(); + &startServer() unless (isDirectoryAlive()); +} +else { + printTrace("\nINFORMATION - There are no non-standard or non-already existing suffixes to migrate\n",0); + &migrateChangelog(); + printTrace("\n***** Migrate ReplicaBindDN entries...\n",0,1); + &importReplicaBindDNEntries(); + printTrace("\n***** Migrate MultiplexorBindDN entries...\n",0,1); + &importMultiplexorBindDNEntries(); +} + +printMsg("\n\n ****** End of migration ******\n\n"); + +close(LOGFILE); + + +########################################################################################### +# get input users +sub getParameters { + my $exit = 0 ; + my $i = 0; + my $pwdfile= ""; + + while ($i <= $#ARGV) { + if ( "$ARGV[$i]" eq "-D" ) { # directory manager + if (! $rootDN) { + $rootDN = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-w") { # password + if (! $rootpwd) { + $rootpwd = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-j") { # password file + if (! $pwdfile) { + $pwdfile = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-o") { # old instance path + if (! $oldHome ) { + $oldHome = $ARGV[++$i] ; + grep { s@\\@/@g } $oldHome if $isNT ; + if ($oldHome =~ /[\"]?(.*)?[\"]?/) { $oldHome = $1 ; } + if ($oldHome =~ m@^(.*)/([^-/]*)-([^/]*)[/]?$@) { + $oldDir = $1 ; + $type = $2 ; + $oldname = $3 ; + if ($isNT) { + $oldDir = lc($oldDir) ; + $type = lc($type) ; + $oldname = lc($oldname) ; + $oldHome = lc($oldHome) ; + grep { s@/@\\@g } $oldDir ; + grep { s@/@\\@g } $oldHome ; + } + } + else { + print("\nThe old instance path is not correct. It must be like slapd-instancename"); + &usage(); + exit(1); + } + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-n") { # new instance path + if (! $serverHome ) { + $serverHome = $ARGV[++$i] ; + grep { s@\\@/@g } $root if $isNT ; + grep { s@\\@/@g } $serverHome if $isNT ; + if ($serverHome =~ /[\"]?(.*)?[\"]?/) { $serverHome = $1 ; } + if ($serverHome =~ m@^(.*?)/?([^/-]*)-([^/]*)[/]?$@) { + $root = $1 if ($1); + $type = $2 ; + $newname = $3 ; + if ($isNT) { + $root = lc($root) ; + $type = lc($type) ; + $newname = lc($newname) ; + $serverHome = lc($serverHome) ; + grep { s@/@\\@g } $root ; + grep { s@/@\\@g } $serverHome ; + } + } + else { + print("\nThe new instance path is not correct. It must be like slapd-instancename"); + &usage(); + exit(1); + } + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-p") { # new DS port + if (! $newport ) { + $newport = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-d") { # old instance LDIF data dir + if (! $olddatadir ) { + $olddatadir = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-v") { # old version + if (! $oldversionstr ) { + $oldversionstr = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-t") { # TRACELEVEL + my $value = $ARGV[++$i] ; + if ($value =~ /[0-3]/) { + $TRACELEVEL = $value ; + } + else { + print("\nThe tracelevel must belong to 0..3 interval"); + &usage(); + exit(); + } + } elsif ("$ARGV[$i]" eq "-noinput") { # no user interventions during processing + $NO_INPUT_USER = 1 ; + } elsif ("$ARGV[$i]" eq "-L") { # migration logfile + $LogFileReport = $ARGV[++$i] ; + } + else { + print("\nThe option $ARGV[$i] is not recognized"); + &usage() ; + exit(1); + } + $i++; + } + if (! $rootDN) { + print("\nThe rootDN is missing"); + $exit = 1; + } + if ($pwdfile ne "") { + # Open file and get the password + unless (open (RPASS, $pwfile)) { + die "Error, cannot open password file $passwdfile\n"; + } + $rootpwd = ; + chomp($rootpwd); + close(RPASS); + } elsif ($rootpwd eq "-"){ + # Read the password from terminal + die "The '-w -' option requires an extension library (Term::ReadKey) which is not\n", + "part of the standard perl distribution. If you want to use it, you must\n", + "download and install the module. You can find it at\n", + "http://www.perl.com/CPAN/CPAN.html\n"; + # Remove the previous line and uncomment the following 6 lines once you have installed Term::ReadKey module. +# use Term::ReadKey; +# print "Bind Password: "; +# ReadMode('noecho'); +# $rootpwd = ReadLine(0); +# chomp($rootpwd); +# ReadMode('normal'); + } + if (! $rootpwd) { + print("\nThe rootpwd is missing"); + $exit = 1 ; + } + if (! $newport) { + print("\nThe port is missing"); + $exit = 1; + } + if (! $serverHome) { + print("\nThe new instance path is missing"); + $exit = 1; + } + if (! $oldHome) { + print("\nThe old instance path is missing"); + $exit = 1; + } + if ((! $LogFileReport) && $serverHome) { + ($sec, $min, $hour, $dd, $mm, $yy) = &GetTime(); + $LogFileReport = "${serverHome}${PATHSEP}logs${PATHSEP}Migration_${dd}${mm}${yy}_${hour}${min}${sec}.log"; + } + if ($exit) { + &usage() ; + exit(1); + } + +} + +################################################################################################### + +sub MigrateSchema{ + my $FilesChanged = ""; + my $AllDiffs = ""; + my $NoChanges = "" ; + my $lineToBegin = 0 ; + opendir(SCHEMADIR, $oldSchemaDir) or + die "Error: could not open migrated config dir $oldSchemaDir: $!"; + + foreach $file (readdir(SCHEMADIR)) { + if (! exists($stdIncludes{lc($file)})) { + my $newSchemaFile = $schemaDir . $file; + if (-f $newSchemaFile ) { + # The ldif file already exists. Make a diff and warn the user if different. + if (diff($newSchemaFile, $oldSchemaDir.$file)) { + &stopServer($root,'slapd-'.$newname) if (isDirectoryAlive()); + $AllDiffs .= "\n$file"; + copyBinFile("$oldSchemaDir$file", $newSchemaFile); + } + } + else { + &stopServer($root,'slapd-'.$newname) if (isDirectoryAlive()); + $AllDiffs .= "\n$file"; + copyBinFile("$oldSchemaDir$file", $newSchemaFile); + } + } + } + closedir(SCHEMADIR); + if ($AllDiffs) { + printMsg("\n\n***********************************************************************"); + printMsg("\nThe following LDIF files have been migrated:"); + printMsg("$AllDiffs"); + printMsg("\n*************************************************************************\n\n"); + } + &startServer() if (! isDirectoryAlive()); +} + + +################################################################################################### +# This subroutine is used to parse the dse.ldif file and call specific routines to act with entries +sub MigrateDSEldif { + printTrace("\nMigrate DSE entries...",1); + my $tempoAlreadyDone = 0; + open( DSELDIF, "< $oldDSEldif" ) || die "Can't open $oldDSEldif: $!: "; + my $in = new Mozilla::LDAP::LDIF(*DSELDIF) ; + while ($entry = readOneEntry $in) { + $typeOfEntry = getTypeOfEntry($entry); + SWITCH: { + if ($typeOfEntry eq "LDBM_BACKEND_INSTANCE"){ + parseLDBM_backend_instance($entry); + last SWITCH; + } + if ($typeOfEntry eq "MAPPING_TREE"){ + parseMapping_tree($entry); + last SWITCH; + } + if ($typeOfEntry eq "DEFAULT_INDEX"){ + parseDefaultIndex($entry); + last SWITCH; + } + if ($typeOfEntry eq "INDEX"){ + parseIndex($entry); + last SWITCH; + } + if ($typeOfEntry eq "STANDARD_PLUGIN"){ + migrateStdPlugin($entry); + last SWITCH; + } + if ($typeOfEntry eq "CONFIG_NODE"){ + migrateConfig_Node($entry); + last SWITCH; + } + if ($typeOfEntry eq "CONFIG_LDBM_DATABASE"){ + migrateConfig_LDBM_database($entry); + last SWITCH; + } + if ($typeOfEntry eq "CHAINING_BACKEND_CONFIG"){ + migrateChainingBE_config($entry); + last SWITCH; + } + if ($typeOfEntry eq "CHAINING_BACKEND_INSTANCE"){ + migrateChainingBE_instance($entry); + last SWITCH; + } + if ($typeOfEntry eq "NSDS5_REPLICA"){ + parseNSDS5_replica($entry); + last SWITCH; + } + if ($typeOfEntry eq "NSDS_REPLICATION_AGREEMENT"){ + parseNSDS_replication_agreement($entry); + last SWITCH; + } + if ($typeOfEntry eq "CHANGELOG5"){ + migrateChangelog5($entry); + last SWITCH; + } + if ($typeOfEntry eq "REPLICATION"){ + migrateReplication($entry); + last SWITCH; + } + if ($typeOfEntry eq "SECURITY"){ + migrateSecurity($entry); + last SWITCH; + } + if ($typeOfEntry eq "SNMP"){ + migrateSNMP($entry); + last SWITCH; + } + } + + } + close(DSELDIF); +} + +############################################################################# +# returns the "type of an entry". If the entry is not to be migrated its type is "NOT_MIGRATED_TYPE" + +sub getTypeOfEntry{ + my $entry = shift; + my $DN = $entry->getDN(1) ; # 1 is to normalize the returned DN + if (($DN =~ /cn=ldbm database,cn=plugins,cn=config$/i) && (isObjectclass($entry,"nsBackendInstance"))) { + return "LDBM_BACKEND_INSTANCE"; + } + if (($DN =~ /cn=mapping tree,cn=config$/i) && (isObjectclass($entry,"nsMappingTree"))) { + return "MAPPING_TREE"; + } + if (($DN =~ /cn=default indexes,cn=config,cn=ldbm database,cn=plugins,cn=config$/i) && (isObjectclass($entry,"nsIndex"))) { + return "DEFAULT_INDEX"; + } + if (isObjectclass($entry,"nsIndex")) { + return "INDEX"; + } + if ((isObjectclass($entry,"nsSlapdPlugin")) && (isStdPlugin($entry))) { + return "STANDARD_PLUGIN"; + } + if ($DN =~ /^cn=config$/i) { + return "CONFIG_NODE"; + } + if ($DN =~ /^cn=config,cn=ldbm database,cn=plugins,cn=config$/i) { + return "CONFIG_LDBM_DATABASE"; + } + if (($DN =~ /^cn=config,cn=chaining database,cn=plugins,cn=config$/i) || ($DN =~ /^cn=default instance config,cn=chaining database,cn=plugins,cn=config$/i)){ + return "CHAINING_BACKEND_CONFIG"; + } + if (($DN =~ /cn=chaining database,cn=plugins,cn=config$/i) && (isObjectclass($entry,"nsBackendInstance"))) { + return "CHAINING_BACKEND_INSTANCE"; + } + if (isObjectclass($entry,"nsDS5Replica")) { + return "NSDS5_REPLICA"; + } + if (isObjectclass($entry,"nsDS5ReplicationAgreement")) { + return "NSDS_REPLICATION_AGREEMENT"; + } + if ($DN =~ /^cn=changelog5,cn=config$/i) { + return "CHANGELOG5"; + } + if (($DN =~ /cn=replication,cn=config$/i) && ($DN !~ /^cn=replication,cn=config$/i)) { + return "REPLICATION"; + } + if ($DN =~ /cn=encryption,cn=config$/i) { + return "SECURITY"; + } + if ($DN =~ /^cn=SNMP,cn=config$/i) { + return "SNMP"; + } + return "NOT_MIGRATED_TYPE"; +} + +############################################################################# + + + +############################################################################# +# returns 1 if the objectclass given in parameter is present in the objectclasses values of the entry +# given in parameter, 0 else + +sub isObjectclass { + my $entry = shift; + my $objectclass = shift; + return ($entry->hasValue("objectclass",$objectclass,1)); +} + +############################################################################# + +sub isStdPlugin { + my $entry = shift; + my $CN = $entry->{cn}[0]; + if (isObjectclass($entry,"nsSlapdPlugin")) { + return 1 if ($stdPlugins{lc($CN)}); + } + return 0; +} + + +############################################################################# + +sub alreadyExistsInNew{ + my $entry = shift; + my $mustExist = shift; + my $DN = $entry->getDN(1); # 1 to normalize the DN + # We have a name change of "uid uniqueness" plugin in DS6.x + # to "attribute uniqueness" + $DN =~ s/uid\ uniqueness/attribute\ uniqueness/ if ($DN =~ /uid\ uniqueness/); + return searchEntry($DN, $mustExist); +} + +############################################################################# +sub searchEntry { + my $DN = shift; + my $mustExist = shift; + my $res = $conn->search($DN, "base", "objectclass=*"); + my $cpt = 5; + if ($res) { + return $res; + } + else { + my $errorCode = $conn->getErrorCode(); + while (($errorCode eq $LDAP_SERVER_UNREACHABLE) && cpt && (! $res)) { + printMsg("\ntry to reconnect to search $DN"); + $conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Unable to contact the $Version.$Minor LDAP server: $LDAPservername\n"; + $res = $conn->search($DN, "base", "objectclass=*"); + $errorCode = $conn->getErrorCode(); + $cpt--; + } + if ($res){ + return $res ; + } + elsif (($errorCode eq $LDAP_SERVER_UNREACHABLE) || ($mustExist)) { + my $msg = $conn->getErrorString(); + printMsg("\n\n*** Failed to search: $DN"); + printMsg("\n*** Error Msg: $msg, Error code: $errorCode"); + } + return 0; + } +} + + +############################################################################# + +sub addEntryToNew{ + my $entry = shift; + my $typeOfEntry = shift; + my $trace = shift; + my $res = $conn->add($entry); + my $DN = $entry->getDN(1); + my $cpt = 5; + if ($res) { + printTrace("\n$typeOfEntry - Add successfull: $DN",$trace); + return 1; + } + else { + my $errorCode = $conn->getErrorCode(); + while (($errorCode eq $LDAP_SERVER_UNREACHABLE) && cpt && (! $res)) { + printMsg("\ntry to reconnect to add $DN"); + $conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Unable to contact the $Version.$Minor LDAP server: $LDAPservername\n"; + $res = $conn->add($entry); + $errorCode = $conn->getErrorCode(); + $cpt--; + } + if ($res){ + printTrace("\n$typeOfEntry - Add successfull: $DN",$trace); + return 1; + } + else { + my $msg = $conn->getErrorString(); + printMsg("\n\n*** $typeOfEntry: Add Failed: $DN"); + printMsg("\n*** Error Msg: $msg, Error code: $errorCode"); + return 0; + } + } +} + +############################################################################# + +sub updateEntry{ + my $entry = shift; + my $typeOfEntry = shift; + my $CHECK = shift; + my $trace = shift; + my $cpt = 5; + if ($CHECK) { + if (! hasChanged($entry, $typeOfEntry)) { + return 1; + } + } + my $res = $conn->update($entry); + my $DN = $entry->getDN(1); + if ($res) { + printTrace("\n$typeOfEntry - Update successfull: $DN",$trace); + return 1 ; + } + else { + my $errorCode = $conn->getErrorCode(); + while (($errorCode eq $LDAP_SERVER_UNREACHABLE) && cpt && (! $res)) { + printMsg("\ntry to reconnect to update $DN"); + $conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Unable to contact the $Version.$Minor LDAP server: $LDAPservername\n"; + $res = $conn->update($entry); + $errorCode = $conn->getErrorCode(); + $cpt--; + } + if ($res){ + printTrace("\n$typeOfEntry - Update successfull: $DN",$trace); + return 1; + } + else { + my $msg = $conn->getErrorString(); + printMsg("\n\n*** $typeOfEntry - Update Failed: $DN"); + printMsg("\n*** Error Msg: $msg, Error code: $errorCode"); + return 0; + } + } +} + + +############################################################################# +# returns 1 if the entry to migrate and the current entry are different one another + +sub hasChanged { + my $entry = shift; + my $typeOfEntry = shift; + my $DN = $entry->getDN(1); + my $newEntry = searchEntry($DN,1); + return 1 if (! $newEntry); # we shoudn't be in that case ... + # do the stuff to check wether the entry has changed or not given its type + if (($typeOfEntry eq "DEFAULT_INDEX") || ($typeOfEntry eq "INDEX")){ + my @indexTypes = $entry->getValues("nsIndexType"); + my @newIndexTypes = $newEntry->getValues("nsIndexType"); + my @nsmatchingrules = $entry->getValues("nsmatchingrule"); + my @newMatchingRules = $newEntry->getValues("nsmatchingrule"); + return 1 if (Diffs(\@indexTypes, \@newIndexTypes)); + return 1 if (Diffs(\@nsmatchingrules,\@newMatchingRules)); + return 0; + } + if ($typeOfEntry eq "CHANGELOG5"){ + printTrace("\nCheck wether changelog has changed or not",3); + my @params = keys(%changelog5params); + foreach $param (@params){ + my @values = $entry->getValues($param); + my @newValues = $newEntry->getValues($param); + return 1 if (Diffs(\@values,\@newValues)); + } + return 0; + } + if ($typeOfEntry eq "SNMP"){ + foreach $param (@SNMPparams){ + my @values = $entry->getValues($param); + my @newValues = $newEntry->getValues($param); + return 1 if (Diffs(\@values,\@newValues)); + } + return 0; + } + # we don't know how to compare such type of entry => just return 1 + return 1 ; +} + +sub isAsystemIndex { + my $index = shift; + return ($index->hasValue("nsSystemIndex","true",1)); +} + + +sub updatePathInPluginArgs { + my $plugin = shift; + my $argNum = 0; + my $argPrefix = "nsslapd-pluginarg"; + my $cont = 1; + my $Unix_oldDir = ${oldDir} ; + my $Unix_root = ${root} ; + grep { s@\\@/@g } $Unix_oldDir if $isNT; + grep { s@\\@/@g } $Unix_root if $isNT; + while ($cont) { + my $arg = $argPrefix . $argNum ; + if ($plugin->exists($arg)) { + $_ = $plugin->{$arg}[0] ; + s@$Unix_oldDir@$Unix_root@ig ; + s/$type-$oldname/$type-$newname/ig ; + $plugin->setValues($arg, $_) ; + } + else { + $cont = 0 ; + } + $argNum++; + } + return $plugin; +} + + +sub Diffs { + my $valuesToMigrate = shift; + my $currentValues = shift; + return 1 if (getDiff(\@{$valuesToMigrate},\@{$currentValues})); + return 1 if (getDiff(\@{$currentValues},\@{$valuesToMigrate})); + return 0 ; +} + +sub getDiff { + # we get references to arrays + my $elements = shift ; + my $existing_elements = shift ; + my %count = () ; + my %countEE = () ; + @diff = () ; + foreach $e (@{$elements}, @{$existing_elements}) { $count{$e}++ ;} + foreach $e (@{existing_elements}) { $countEE{$e}++ ;} + foreach $e (@{$elements}) { + # if $e is only present in @$elements, we push it to the diff array + if (($count{$e} == 1) && ($countEE{$e} == 0)) { + push @diff, $e ; + } + } + return @diff ; +} + +sub registerSuffix_Backend { + my $ldbmDatabase = shift; + my $CN = $ldbmDatabase->{cn}[0]; + my $suffixArg = "nsslapd-suffix"; + my $suffix = $ldbmDatabase->{$suffixArg}[0]; + $oldBackends{$suffix} = $CN; +} + + +############################################################################# +# # +# # +# # +############################################################################# +sub migrateLDBM_backend_instances { + foreach $entry (@LDBM_backend_instances) { + my $DN = $entry->getDN(1); # 1 is to normalize the DN + my $CN = $entry->{cn}[0]; + my $expLdif; + my $confirm = "No"; + my $dest = "$serverHome${PATHSEP}db_backup" ; + my $newSlapdExecDir = "$root${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server"; + + if ($DN =~/cn=netscaperoot,cn=ldbm database/i){ + printTrace("\n\n*** INFORMATION - NetscapeRoot is NOT migrated",0); + } + else { + if(alreadyExistsInNew($entry)){ + printMsg("\n\n*** LDBM_BACKEND_INSTANCE - $DN already exists"); + printMsg("\n*** Migration will overwrite existing database"); + printMsg("\nDo you want to continue Yes/No [No] ?") ; + my $answer = ; + if ($answer =~ /y|yes/i) { + printMsg("Do you want to export the existing data Yes/No [Yes] ?"); + my $answer = ; + if (!($answer =~ /n|no/i)) { + mkdir $dest, 0700 unless (-d $dest); + $expLdif = "$dest${PATHSEP}$CN.ldif"; + while (!($confirm =~ /y|yes/i)) { + printMsg("\nEnter the full pathname of the file [$expLdif]:") ; + $answer = ; + chomp($expLdif = $answer) unless ($answer eq "\n"); + printMsg("\nExisting data will be exported under $expLdif"); + printMsg("\nContinue Yes/No [No] ?"); + $confirm = ; + } + $ENV{"$LIB_PATH"}=$new_libpath; + chdir($newSlapdExecDir) or die "\nCould not change directory to $newSlapdExecDir: $!\n"; + printTrace("\nNow backing up database $CN in $expLdif\n",0); + &stopServer($root,'slapd-'.$newname); + &db2Ldif($expLdif, $CN, $serverHome); + &startServer() unless (isDirectoryAlive()); + } + push @BACKENDS, $CN; + } else { + printMsg("\n*** Migration will not update it"); + break; + } + } else { + printTrace("\nWe should add the backend instance $DN",3); + my $suffixarg = "nsslapd-suffix" ; + my $suffixname= $entry->{$suffixarg}[0] ; + my $newEntry = $conn->newEntry() ; + $newEntry->setDN($DN); + $newEntry->setValues("objectclass", "top", "extensibleObject", "nsBackendInstance" ); + $newEntry->setValues("cn", $CN ); + $newEntry->setValues($suffixarg, $suffixname); + my @params = keys(%LDBMparamToMigrate); + foreach $param (@params) { + my @values = $entry->getValues($param); + $newEntry->setValues($param, @values) if (@values); + } + if (addEntryToNew($newEntry, "LDBM_BACKEND_INSTANCE",1)) { + push @BACKENDS, $CN; + } + } + } + } +} + +sub parseLDBM_backend_instance { + my $entry = shift; + ®isterSuffix_Backend($entry); + push @LDBM_backend_instances, $entry; +} + +############################################################################# +sub migrateMappingTree { + foreach $entry (@Mapping_tree_entries) { + my $DN = $entry->getDN(1); # 1 si to normalize the DN + if ($DN =~/cn=\"o=netscaperoot\",cn=mapping tree,cn=config/i){ + # DO NOTHING + } + else { + if(alreadyExistsInNew($entry)){ + printMsg("\n\n*** MAPPING_TREE - $DN already exists"); + printMsg("\n*** Migration will not add the suffix"); + } + else { + addEntryToNew($entry, "MAPPING_TREE",1); + } + } + } +} + + +sub parseMapping_tree{ + my $entry = shift; + push @Mapping_tree_entries, $entry; +} + +############################################################################# +sub migrateDefaultIndexes { + foreach $index (@default_indexes) { + my $CN = $index->{cn}[0]; + my $newIndex ; + if ((! isAsystemIndex($index)) && (! $deniedIndexes{lc($CN)})) { + if ($newIndex = alreadyExistsInNew($index)) { + if (! isAsystemIndex($newIndex)) { + updateEntry($index, "DEFAULT_INDEX", 1, 2); + } + } + else { + addEntryToNew($index, "DEFAULT_INDEX", 2); + } + } + } +} + + +sub parseDefaultIndex{ + my $index = shift; + push @default_indexes, $index; +} + +############################################################################# + +sub migrateIndexes { + foreach $index (@indexes) { + my $CN = $index->{cn}[0]; + my $newIndex; + if ((! isAsystemIndex($index)) && (! $deniedIndexes{lc($CN)}) && (DN !~ /cn=netscaperoot,cn=index/i)){ + if ($newIndex = alreadyExistsInNew($index)) { + if (! isAsystemIndex($newIndex)) { + updateEntry($index, "INDEX", 1, 2); + } + } + else { + addEntryToNew($index, "INDEX", 2); + } + } + } +} + +sub parseIndex{ + my $index = shift; + push @indexes, $index; +} + +############################################################################# + +sub newLDIFplugin { + my $currentPlugin = shift; + my $DN = $currentPlugin->getDN(1); + my $newPlugin = $conn->newEntry() ; + $newPlugin->setDN($DN); + foreach $Attr (@pluginAttrs) { + my @values = $currentPlugin->getValues($Attr); + $newPlugin->setValues($Attr, @values) if (@values); + } + return $newPlugin; +} + +sub migrateStdPlugin{ + my $plugin = shift; + my $DN = $plugin->getDN(1); + my $pluginEnable = "nsslapd-pluginEnabled"; + my $argNum = 0; + my $argPrefix = "nsslapd-pluginarg"; + my $currentPlugin ; + if ($currentPlugin = alreadyExistsInNew($plugin, 1)) { + $plugin = updatePathInPluginArgs($plugin); + my $pluginEnableValue = $plugin->{$pluginEnable}[0]; + my $cont = 1; + my $pluginHasChanged = 0; + my $newPlugin = &newLDIFplugin($currentPlugin); + if (! $currentPlugin->hasValue($pluginEnable,$pluginEnableValue,1)){ + $newPlugin->setValues($pluginEnable, $pluginEnableValue); + $pluginHasChanged = 1 unless ($pluginHasChanged); + } + while($cont){ + my $arg = $argPrefix . $argNum ; + if ($plugin->exists($arg)) { + my @values = $plugin->getValues($arg); + my $value = $values[0] ; + $newPlugin->setValues($arg, $value) if (@values); + if ($currentPlugin->exists($arg)) { + if (! $currentPlugin->hasValue($arg,$value,1)) { + $pluginHasChanged = 1 unless ($pluginHasChanged); + } + } + else { + $pluginHasChanged = 1 unless ($pluginHasChanged); + } + } + else { + if ($currentPlugin->exists($arg)) { + # Just Warn the user. Do nothing. + printTrace("\nCompared to the old instance, the current new plugin $DN belongs this attribute: $arg",2); + } + else { + $cont = 0 ; + } + } + $argNum++; + } + updateEntry($newPlugin, "STANDARD_PLUGIN", 0, 1) if ($pluginHasChanged); + } +} + +############################################################################# + +sub migrateConfig_Node{ + my $config_node = shift; + my @params = keys(%GeneralSrvParamToMigrate); + my $hasChanged = 0; + my $newConfigNode; + if ($newConfigNode = alreadyExistsInNew($config_node, 1)){ + foreach $param (@params) { + if ($config_node->exists($param)){ + my @valuesToMigrate = $config_node->getValues($param); + if (@valuesToMigrate){ + if ($newConfigNode->exists($param)){ + my @currentValues = $newConfigNode->getValues($param); + if (Diffs(\@valuesToMigrate, \@currentValues)) { + $newConfigNode->setValues($param, @valuesToMigrate); + $hasChanged = 1 unless ($hasChanged); + printTrace("\nParam to update: $param with value @valuesToMigrate",3); + } + } + else { + $newConfigNode->setValues($param, @valuesToMigrate); + $hasChanged = 1 unless ($hasChanged); + printTrace("\nParam to update: $param with value @valuesToMigrate",3); + } + } + } + } + updateEntry($newConfigNode, "CONFIG_NODE", 0, 1) if ($hasChanged); + } +} + +############################################################################# + +sub migrateConfig_LDBM_database{ + my $config_ldbm = shift; + my @params = keys(%GlobalConfigLDBMparamToMigrate); + my $hasChanged = 0; + my $newConfigLdbm ; + if ($newConfigLdbm = alreadyExistsInNew($config_ldbm, 1)) { + foreach $param (@params) { + if ($config_ldbm->exists($param)){ + my @valuesToMigrate = $config_ldbm->getValues($param); + if (@valuesToMigrate){ + if ($newConfigLdbm->exists($param)){ + my @currentValues = $newConfigLdbm->getValues($param); + if (Diffs(\@valuesToMigrate, \@currentValues)) { + $newConfigLdbm->setValues($param, @valuesToMigrate); + $hasChanged = 1 unless ($hasChanged); + } + } + else { + $newConfigLdbm->setValues($param, @valuesToMigrate); + $hasChanged = 1 unless ($hasChanged); + } + } + } + } + updateEntry($newConfigLdbm, "CONFIG_LDBM_DATABASE", 0, 1) if ($hasChanged); + } +} + +############################################################################# + +sub migrateChainingBE_config{ + my $chaining_config = shift; + my $DN = $chaining_config->getDN(1); + my @params = (); + my $hasChanged = 0; + my $newChainingConfig; + if ($DN =~ /^cn=config,cn=chaining database,cn=plugins,cn=config$/i){ + $newChainingConfig = searchEntry("cn=config,cn=chaining database,cn=plugins,cn=config"); + @params = keys(%ChainingConfigParams); + } + if ($DN =~ /^cn=default instance config,cn=chaining database,cn=plugins,cn=config$/i){ + $newChainingConfig = searchEntry("cn=default instance config,cn=chaining database,cn=plugins,cn=config"); + @params = keys(%ChainingDefaultInstanceConfigParams); + } + foreach $param (@params) { + if ($chaining_config->exists($param)){ + my @valuesToMigrate = $chaining_config->getValues($param); + if (@valuesToMigrate){ + printTrace("\nParam: $param values To migrate: @valuesToMigrate",3); + if ($newChainingConfig->exists($param)){ + my @currentValues = $newChainingConfig->getValues($param); + printTrace("\nParam: $param new current values: @currentValues",3); + if (Diffs(\@valuesToMigrate, \@currentValues)) { + $newChainingConfig->setValues($param, @valuesToMigrate); + $hasChanged = 1 unless ($hasChanged); + } + } + else { + $newChainingConfig->setValues($param, @valuesToMigrate); + $hasChanged = 1 unless ($hasChanged); + } + } + } + } + updateEntry($newChainingConfig, "CHAINING_BACKEND_CONFIG", 0, 1) if ($hasChanged); +} + +############################################################################# + +sub registerSuffix_ChainingBE { + my $ldbmDatabase = shift; + my $CN = $ldbmDatabase->{cn}[0]; + my $suffixArg = "nsslapd-suffix"; + my $suffix = $ldbmDatabase->{$suffixArg}[0]; + $oldChainingBackends{$suffix} = $CN; +} + +sub storeMultiplexorBindDN { + my $chaining_instance = shift; + my $DN = $chaining_instance->getDN(1); + if ($chaining_instance->exists("nsMultiplexorBindDN")){ + my $bindDN = $chaining_instance->{nsMultiplexorBindDN}[0]; + my $newBindDN = searchEntry($bindDN); + if (! $newBindDN){ + # the bindDN entry doesn't yet exist in new => it will have to be migrated + $MultiplexorBindDNEntriesToMigrate{$bindDN}="\n" ; + printTrace("\nThe bindDN: $bindDN need to be migrated",3); + } + else { + # do nothing as the entry already exists in new + } + } + +} + +sub importMultiplexorBindDNEntries { + # import all entries present in @MultiplexorBindDNEntriesToMigrate in new + my @MultiplexorBindDNs = keys (%MultiplexorBindDNEntriesToMigrate); + my $ldif_dir = $ldif_rep; + foreach $bindDN (@MultiplexorBindDNs) { + printTrace("\nimportMultiplexorBindDNEntries: bindDN to migrate: $bindDN",3); + # get the backend in which is stored the bind DN entry + my $backendtoExportFrom = getBackendtoExportFrom($bindDN); + printTrace("\nbackendtoExportFrom is: $backendtoExportFrom",3); + # check wether the backend has been imported in new or not + if (! alreadyMigrated($backendtoExportFrom)) { + if ($backendtoExportFrom ne $NULL) { + # if not imported => we need to import the binf DN entry + &startServer() unless (isDirectoryAlive()); + $conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Unable to contact the $Version.$Minor LDAP server: $LDAPservername\n"; + &ExportAndAddEntry($bindDN, $backendtoExportFrom, $ldif_dir); + } + else { + # do nothing + } + } + } + # remove the empty ldif directory + rmdir($ldif_dir) if (-d $ldif_dir); + # close the LDAP connection to new + $conn->close if ($conn); +} + +sub migrateChainingBE_instance{ + my $chaining_instance = shift; + my $DN = $chaining_instance->getDN(1); + ®isterSuffix_ChainingBE($chaining_instance); + if (alreadyExistsInNew($chaining_instance)) { + # already exists + printMsg("\n\n*** CHAINING_BACKEND_INSTANCE - $DN already exists"); + printMsg("\n*** Migration will not update it"); + } + else { + &migrate_credential($chaining_instance, "nsmultiplexorcredentials"); + addEntryToNew($chaining_instance, "CHAINING_BACKEND_INSTANCE", 1); + storeMultiplexorBindDN($chaining_instance); + } +} + +############################################################################# + +# create a new LDIF representation of a new replica consumer +sub newLDIFreplica { + my $replica = shift; + my $DN = $replica->getDN(1); + my $newReplica = $conn->newEntry() ; + my $MASTER_OR_MULTIMASTER = "3" ; + $newReplica->setDN($DN); + foreach $Attr (@nsds5replicaAttrs) { + my @values = $replica->getValues($Attr); + $newReplica->setValues($Attr, @values) if (@values); + } + my $replicaType = $replica->{nsDS5ReplicaType}[0]; + if ($replicaType eq $MASTER_OR_MULTIMASTER) { + my @nsState = $replica->getValues("nsState"); + $newReplica->setValues("nsState", @nsState); + } + else { + $newReplica->setValues("nsDS5ReplicaId", $replicaIdvalue); + } + return $newReplica; +} + +sub MigrateNSDS5_replica{ + foreach $replica (@new6replicas) { + my $DN = $replica->getDN(1); + my $newReplica; + my @removeAttrs = qw(nsstate nsds5replicaname nsds5replicachangecount); + for (@removeAttrs) { + $replica->remove($_); + } + if (alreadyExistsInNew($replica)) { + # replica already exists + printMsg("\n\n*** NSDS5_REPLICA - $DN already exists"); + printMsg("\n*** Migration will not update it"); + } + else { + $newReplica = &newLDIFreplica($replica); + addEntryToNew($newReplica, "NSDS5_REPLICA", 1); + } + storeReplicaBindDN($replica); + } +} + +sub parseNSDS5_replica{ + my $replica = shift; + push @new6replicas, $replica; +} + +sub storeReplicaBindDN { + my $replica = shift; + my $DN = $replica->getDN(1); + if ($replica->exists("nsDS5ReplicaBindDN")){ + my $bindDN = $replica->{nsDS5ReplicaBindDN}[0]; + my $newBindDN = searchEntry($bindDN); + if (! $newBindDN){ + # the bindDN entry doesn't yet exist in new => it will have to be migrated + $ReplicaBindDNEntriesToMigrate{$bindDN}="\n" ; + printTrace("\nThe bindDN: $bindDN need to be migrated",3); + } + else { + # do nothing as the entry already exists in new + } + } +} + + +sub importReplicaBindDNEntries { + # import all entries present in @ReplicaBindDNEntriesToMigrate in new + my @ReplicaBindDNs = keys (%ReplicaBindDNEntriesToMigrate); + my $ldif_dir = $ldif_rep; + my $replBind_entry = ""; + my @bindDN_elements = ""; + my $bindDN_parent = ""; + my $parentBind_entry = ""; + foreach $bindDN (@ReplicaBindDNs) { + printTrace("\nimportReplicaBindDNEntries: bindDN to migrate: $bindDN",3); + # get the backend in which is stored the bind DN entry + my $backendtoExportFrom = getBackendtoExportFrom($bindDN); + printTrace("\nbackendtoExportFrom is: $backendtoExportFrom",3); + # If backend is from config, read the entry from dse.ldif and add to new - NGK + if ($backendtoExportFrom eq "cn=config") { + my $norm_bindDN = normalizeDN($bindDN); + @bindDN_elements = ldap_explode_dn($norm_bindDN, 0); +# @bindDN_elements = split(/,/,$norm_bindDN); + my $junk = shift(@bindDN_elements); + if ($#bindDN_elements >= 1) { + $bindDN_parent = normalizeDN(join(",", @bindDN_elements)); + } + printTrace("\nOpening DSE.ldif",3); + open( DSELDIF, "< $oldDSEldif" ) || die "Can't open $oldDSEldif: $!: "; + my $in = new Mozilla::LDAP::LDIF(*DSELDIF); + while ($entry = readOneEntry $in) { + my $DN = $entry->getDN(1); + if ($DN eq $norm_bindDN) { + $replBind_entry = $entry; + } + if ($bindDN_parent ne "") { + if ($DN eq $bindDN_parent) { + $parentBind_entry = $entry; + } + } + } + close(DSELDIF); + &startServer() unless (isDirectoryAlive()); + $conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Unable to contact the $Version.$Minor LDAP server: $LDAPservername\n"; + if ($bindDN_parent ne "") { + addEntryToNew($parentBind_entry, BINDDN_PARENT, 0); + } + printTrace("\nAdding BindDN with addEntryToNew",3); + addEntryToNew($replBind_entry, BINDDN, 0); + } else { + # check wether the backend has been imported in new or not + if (! alreadyMigrated($backendtoExportFrom)) { + if ($backendtoExportFrom ne $NULL) { + # if not imported => we need to import the bind DN entry + &startServer() unless (isDirectoryAlive()); + $conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Unable to contact the $Version.$Minor LDAP server: $LDAPservername\n"; + &ExportAndAddEntry($bindDN, $backendtoExportFrom, $ldif_dir); + } + else { + # do nothing + } + } + } + } + # remove the empty ldif directory + rmdir($ldif_dir) if (-d $ldif_dir); + # close the LDAP connection to new + $conn->close if ($conn); +} + +sub alreadyMigrated { + my $backendToCheck = shift; + foreach $backend (@BACKENDS) { + return 1 if ($backend eq $backendToCheck); + } + return 0 ; +} + +sub belongsSuffix { + my $suffix = shift; + my $bindDN = shift; + return ($bindDN =~ /$suffix\s*$/i); +} + +sub length { + my $suffix = shift; + my $count = 0; + while ($suffix =~ /./g) { + $count++; + } + return $count ; +} + +sub getBackendtoExportFrom { + my $bindDN = shift ; + my $sizeOfSuffix = 0 ; + my $NULL = ""; + my @oldSuffixes = keys(%oldBackends); + my @oldChainingSuffixes = keys(%oldChainingBackends); + my $bindDN_backend = $NULL; + my $config = "cn=config"; + + my $norm_bindDN = normalizeDN($bindDN); + # Check if bindDN exists in cn=config - NGK + if (belongsSuffix($config,$norm_bindDN)) { + $bindDN_backend = $config; + printTrace("\ngetBackendtoExportFrom: bindDN_backend: $bindDN_backend",3); + } else { + foreach $suffix (@oldSuffixes){ + printTrace("\ngetBackendtoExportFrom: suffix to compare with is: $suffix",3); + if ((belongsSuffix($suffix,$norm_bindDN)) && (length($suffix) > $sizeOfSuffix)) { + $sizeOfSuffix = length($suffix); + $bindDN_backend = $oldBackends{$suffix}; + printTrace("\ngetBackendtoExportFrom: bindDN_backend: $bindDN_backend, sizeOfSuffix: $sizeOfSuffix",3); + } + } + foreach $suffix (@oldChainingSuffixes){ + printTrace("\ngetBackendtoExportFrom: suffix to compare with is a chained suffix: $suffix",3); + if ((belongsSuffix($suffix,$norm_bindDN)) && (length($suffix) > $sizeOfSuffix)) { + printMsg("\n\n*** Entry stored on a remote backend - $norm_bindDN"); + printMsg("\n*** We don't migrate it"); + return $NULL; + } + } + } + return $bindDN_backend; +} + + +sub getBackendtoImportTo { + my $bindDN = shift; + my $sizeOfSuffix = 0; + my $NULL = ""; + my $suffixArg = "nsslapd-suffix"; + my $bindDN_backend = $NULL; + open( DSELDIF, "< $DSEldif" ) || die "Can't open $DSEldif: $!: "; + my $in = new Mozilla::LDAP::LDIF(*DSELDIF) ; + while ($entry = readOneEntry $in) { + $typeOfEntry = getTypeOfEntry($entry); + if ($typeOfEntry eq "LDBM_BACKEND_INSTANCE"){ + my $suffix = $entry->{$suffixArg}[0]; + if ((belongsSuffix($suffix,$bindDN)) && (length($suffix) > $sizeOfSuffix)) { + $sizeOfSuffix = length($suffix); + $bindDN_backend = $entry->{cn}[0]; + } + } + } + close(DSELDIF); + return $bindDN_backend ; +} + + +sub ExportAndAddEntry { + my $DN = shift; + my $backendtoExportFrom = shift; + my $ldif_dir = shift; + my $ldif = "$ldif_dir${PATHSEP}$backendtoExportFrom.ldif" ; + # first: export entry pointed out by the $DN to $ldif file + $ENV{"$LIB_PATH"}=$old_libpath; + if (! $ldif_dir) { $ldif_dir = $ldif_rep ;} + if (!(-d $ldif_dir)) { + mkdir($ldif_dir,0777) or die "\ncan't create $ldif_dir to store temporary ldif files\n"; + } + chdir($oldSlapdExecDir) or die "\nCould not change directory to $oldSlapdExecDir: $!\n"; + &db2Ldif($ldif, $backendtoExportFrom, $oldHome, $DN); + chdir($curdir) or die "\nCould not change directory to $curdir: $!\n"; + + # then: Add it to new + if (! $conn) { + $conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Unable to contact the $Version.$Minor LDAP server: $LDAPservername\n"; + } + open( BINDDNLDIF, "< $ldif" ) || die "\nCan't open $ldif: $!: \n"; + my $in = new Mozilla::LDAP::LDIF(*BINDDNLDIF) ; + while ($entry = readOneEntry $in) { + my $entryDN = $entry->getDN(1); + if ($DN eq $entryDN) { + addEntryToNew($entry, "nsds5ReplicaBindDN", 0); + } + } + close(BINDDNLDIF); + # remove the ldif file after the import + unlink($ldif) ; +} + +############################################################################# +sub MigrateNSDS_replication_agreement { + foreach $replicationAgreement (@replicationAgreements) { + my $DN = $replicationAgreement->getDN(1); + if (alreadyExistsInNew($replicationAgreement)){ + # replication agreement already exists + printMsg("\n\n*** NSDS_REPLICATION_AGREEMENT - $DN already exists"); + printMsg("\n*** Migration will not update it"); + } + else { + &migrate_credential($replicationAgreement, "nsDS5ReplicaCredentials"); + addEntryToNew($replicationAgreement, "NSDS_REPLICATION_AGREEMENT", 1); + } + } +} + + +sub parseNSDS_replication_agreement{ + my $replicationAgreement = shift; + push @replicationAgreements, $replicationAgreement ; +} + +############################################################################# + +sub migrateChangelog5{ + my $changelog = shift; + my $DN = $changelog->getDN(1); + my $changelogdir = "nsslapd-changelogdir"; + if (alreadyExistsInNew($changelog)){ + # cn=changelog5,cn=config already exists in new + my $newChangelog = searchEntry($DN); + my @newChangelogdir = $newChangelog->getValues($changelogdir); + $changelog->setValues($changelogdir, @newChangelogdir); + updateEntry($changelog, "CHANGELOG5", 0, 1); + } + else { + # cn=changelog5,cn=config need to be created in new. + # the changelogdir value must be setup to /slapd-instance/changelogdb + $changelog->setValues($changelogdir,"${serverHome}${PATHSEP}changelogdb"); + addEntryToNew($changelog, "CHANGELOG5", 1); + } +} + + +sub migrateChangelog { + my $oldchangelogdir = ""; + my $newchangelogdir = ""; + my $changelogdir = "nsslapd-changelogdir"; + my $CL5DN = "cn=changelog5,cn=config"; + printTrace("\n\n***** Migrate Changelog...",0,1); + open( DSELDIF, "< $oldDSEldif" ) || die "Can't open $oldDSEldif: $!: "; + my $in = new Mozilla::LDAP::LDIF(*DSELDIF); + while ($entry = readOneEntry $in) { + $typeOfEntry = getTypeOfEntry($entry); + if ($typeOfEntry eq "CHANGELOG5"){ + $oldchangelogdir = ($entry->getValues($changelogdir))[0]; + } + } + close(DSELDIF); + if ($oldchangelogdir) { + # If using olddatadir to migrate from, the path of the changelogdb + # from the dse.ldif may not match the path where the old server + # root was archived. We may need to modify oldchangelogdir so the + # copy of the changelog files succeeds. + unless(-e $oldchangelogdir) { + if($olddatadir) { + my @cldbpath = split(/\//,$oldchangelogdir); + until($cldbpath[0] =~/^slapd-/) { + shift(@cldbpath); + } + my $tmpcldbpath = join(${PATHSEP}, @cldbpath); + $oldchangelogdir = "$oldDir${PATHSEP}$tmpcldbpath"; + } + # If oldchangelogdir still looks to be wrong, prompt for the + # location instead of just failing on the copydir operation + # and bombing out of the migration. + unless(-e $oldchangelogdir) { + print("\n\nThe old changelog directory \"$oldchangelogdir\" doesn't exist. Please enter the correct path: "); + $oldchangelogdir = ; + } + } + &startServer() unless (isDirectoryAlive()); + $conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Unable to contact the $Version.$Minor LDAP server: $LDAPservername\n"; + my $newChangelog = searchEntry($CL5DN); + $newchangelogdir = ($newChangelog->getValues($changelogdir))[0]; + stopServer($root,'slapd-'.$newname); + printTrace("\ncopying $oldchangelogdir${PATHSEP}* to $newchangelogdir",3); + copyDir("$oldchangelogdir","$newchangelogdir"); + + # We need to modify the DBVERSION file for a new verision of the db + open(DBVERSION,">$newchangelogdir${PATHSEP}DBVERSION") || die "Can't overwrite $newchangelogdir${PATHSEP}DBVERSION: $! "; + print DBVERSION "Changelog5/NSMMReplicationPlugin/3.0"; + close(DBVERSION); + + &startServer() unless (isDirectoryAlive()); + } +} + +############################################################################# + +sub migrateReplication{ + my $replication = shift; + my $DN = $replication->getDN(1); + if (alreadyExistsInNew($replication)){ + # replication agreement already exists + printMsg("\n\n*** $DN already exists"); + printMsg("\n*** Migration will not update it"); + } + else { + addEntryToNew($replication, "REPLICATION", 1); + } +} + +############################################################################# + +sub migrateSecurity{ + my $security = shift; + if ($entry->hasValue("objectClass", "nsEncryptionConfig")) { + my $certfile = "alias/slapd-" . $newname . "-cert8.db"; + my $keyfile = "alias/slapd-" . $newname. "-key3.db"; + $entry->setValues("nsCertfile",$certfile) if ! $entry->hasValue("nsCertfile",$certfile); + $entry->setValues("nsKeyfile",$keyfile) if ! $entry->hasValue("nsKeyfile",$keyfile); + } + if (alreadyExistsInNew($security)){ + # already exists in new + updateEntry($security, "SECURITY", 0, 1); + } + else { + addEntryToNew($security, "SECURITY", 1); + } +} + +############################################################################# + +sub migrateSNMP{ + my $snmp = shift; + if (alreadyExistsInNew($snmp)){ + # already exists in new + updateEntry($snmp, "SNMP", 0, 1); + } + else { + addEntryToNew($snmp, "SNMP", 1); + } +} + +############################################################################# +# printMsg print message to the user standard output. + +sub printMsg { + + my $TypeMsg = shift ; + my $Msg = shift ; + my $LineNb = shift ; + if ($LineNb) { + printTrace("Line: $LineNb, $TypeMsg, $Msg"); + } + else { + printTrace("$TypeMsg $Msg"); + } +} + +############################################################################# +# print message error to the user standard output. + +sub printTrace { + + my $Msg = shift ; + my $level = shift ; + my $sep = shift ; + + if ($sep) { + print "\n-------------------------------------------------------------------------"; + print LOGFILE "\n-------------------------------------------------------------------------"; + } + + if ($level <= $TRACELEVEL) { + print($Msg); + print LOGFILE $Msg ; + } +} + +############################################################################# +# this subroutine implements a very stupid version of diff + +sub diff { + my $f1 = shift; + my $f2 = shift; + my $lineToBeginWith = shift; + my $NULL = "" ; + my $diff_f1 = $NULL ; + my $diff_f2 = $NULL ; + my $retval = $NULL ; + my $ret; + open(F1, "$f1") or die "Could not open file $f1"; + open(F2, "$f2") or close(F1), die "Could not open file $f2"; + + while (defined($l1 = )) { + if ($lineToBeginWith){ + $lineToBeginWith -- ; + next ; + } + next if ($l1 =~ /^\#/); + $ret = defined($l2 = ); + if ($ret) { + $ret = defined($l2 = ) while ($ret && ($l2 =~ /^\#/)) ; + if ($ret) { + if (!($l1 eq $l2)) { + + # ignore whitespace + $l1_clean = $l1 ; + $l2_clean = $l2 ; + $l1_clean =~ s/\s//g; + $l2_clean =~ s/\s//g; + + if (!($l1_clean eq $l2_clean)) { + $diff_f1 .= "${l1}" unless ($l1_clean eq $NULL); + $diff_f2 .= "${l2}" unless ($l2_clean eq $NULL); + } + } + } + else { + next if ($l1 =~ /^\s*$/) ; + $diff_f1 .= "${l1}"; + } + } + else { + next if ($l1 =~ /^\s*$/) ; + $diff_f1 .= "${l1}"; + } + } + + while (defined($l2 = )) { + if (($l2 =~ /^\#/) || ($l2 =~ /^\s*$/)) { + next ; + } + else { + $diff_f2 .= "${l2}" ; + } + } + + close(F1); + close(F2); + + $retval .= "- differences present in your config file but not in standard file:\n\n". "$diff_f1\n" if ($diff_f1) ; + $retval .= "- differences present in standard file but not in your config file:\n\n" . "$diff_f2" if ($diff_f2) ; + return $retval ; +} + +sub CompareStdConfigFiles { + # Compare each configuration file against its default version. If it has changed, + # notify the user that the file has changed and will need to be checked by the + # user. This should be safe to do because there should be no path information + # stored in these conf files, which are just schema stuff. + # printTrace("\nCheck if standard configuration files have changed",3); + + # get the version of the DS to migrate + ($oldVersion, $oldMinor) = &getVersion($oldDir, $oldversionstr); + # get the version of the new DS + ($Version, $Minor) = &getVersion($root); + + # get old LIB_PATH + $old_libpath = &getLibPath($oldDir, $oldVersion, $oldMinor); + # get new LIB_PATH + $new_libpath = &getLibPath($root, $Version, $Minor); + + my $origFilePath = "$oldDir${PATHSEP}bin${PATHSEP}slapd${PATHSEP}install${PATHSEP}schema${PATHSEP}" ; + my $FilesChanged = ""; + my $AllDiffs = "***********************************************************************"; + my $NoChanges = "" ; + my $lineToBegin = 0 ; + opendir(CONFDIR, $oldSchemaDir) or + die "Error: could not open migrated config dir $oldConfDir: $!"; + + foreach $file (readdir(CONFDIR)) { + $origFile = $origFilePath . $file ; + $configFile = $oldSchemaDir . $file ; + if (( exists($stdIncludes{lc($file)})) && (-f $origFile)) { + $diffs = &diff($configFile, $origFile, $lineToBegin); + $lineToBegin = 0 if $lineToBegin ; + if ($diffs) { + $FilesChanged .= "\n$configFile"; + $AllDiffs .= "\n$configFile is different than the standard configuration file" ; + $AllDiffs .= "\nYou will need to check this file and make sure its changes are compatible "; + $AllDiffs .= "with the new directory server\nHere are the differences:\n"; + $AllDiffs .= "$diffs \n\n"; + $AllDiffs .= "***********************************************************************"; + } + else { + $NoChanges .= "\n$configFile"; + } + } + } + closedir(CONFDIR); + +if ($FilesChanged) { + printTrace("\nNo changes to old configuration files:$NoChanges",3) ; + printTrace("\n***********************************************************************",3) ; + printMsg("\nThe following standard files have been modified: $FilesChanged"); + if ($NO_INPUT_USER) { + # do nothing + } + else { + printMsg("\nDo you want to see the differences Yes/No [No] ?") ; + my $answer = ; + if ($answer =~ /y|yes/i) { + printMsg("$AllDiffs"); + } + printMsg("\nDo you want to continue the migration Yes/No [No] ?"); + $answer = ; + if (! ($answer =~ /y|yes/i)) { + exit(1); + } + } + } +} + + + +############################################################################# + +# this is used to run the system() call, capture exit and signal codes, +# and die() upon badness; the first argument is a directory to change +# dir to, if any, and the rest are passed to system() +sub mySystem { + my $rc = &mySystemNoDie(@_); + my ($dir, @args) = @_; + if ($rc == 0) { +# success + } elsif ($rc == 0xff00) { + die "Error executing @args: error code $rc: $!"; + } elsif ($rc > 0x80) { + $rc >>= 8; + die "Error executing @args: error code $rc: $!"; + } else { + if ($rc & 0x80) { + $rc &= ~0x80; + } + die "Error executing @args: received signal $rc: $!"; + } + + # usually won't get return value + return $rc; +} + +# This version does not die but just returns the error code +sub mySystemNoDie { + my ($dir, @args) = @_; + if ($dir && ($dir ne "")) { + chdir($dir) or die "Could not change directory to $dir: $!"; + } + my $cmd = $args[0]; + # the system {$cmd} avoids some NT shell quoting problems if the $cmd + # needs to be quoted e.g. contains spaces; the map puts double quotes + # around the arguments on NT which are stripped by the command + # interpreter cmd.exe; but don't quote things which are already quoted + my @fixargs = map { /^[\"].*[\"]$/ ? $_ : $quote . $_ . $quote } @args; + my $rc = 0; + if ($cmd =~ /[.](bat|cmd)$/) { + # we have to pass batch files directly to the NT command interpreter + $cmd = $com_spec; +# print "system $cmd /c \"@fixargs\"\n"; + $rc = 0xffff & system {$cmd} '/c', "\"@fixargs\""; + } else { +# print "system $cmd @fixargs\n"; + $rc = 0xffff & system {$cmd} @fixargs; + } + chdir(${curdir}) or die "Could not change directory to $curdir: $!"; + return $rc; +} + +########################################################################################### +# # +# Export/Import of the backends in @BACKENDS # +# # +########################################################################################### + +sub manydb2Ldif { + my $ldif_dir = shift; + $ENV{"$LIB_PATH"}=$old_libpath; + if (! $ldif_dir) { $ldif_dir = $ldif_rep ;} + if (!(-d $ldif_dir)) { + mkdir($ldif_dir,0777) or die "can't create $ldif_dir to store temporary ldif files"; + } + chdir($oldSlapdExecDir) or die "Could not change directory to $oldSlapdExecDir: $!"; + foreach $backend (@BACKENDS) { + my $ldif = "${ldif_dir}$backend.ldif" ; + &db2Ldif($ldif, $backend, $oldHome); + } + print " Done.\n"; + chdir($curdir) or die "Could not change directory to $curdir: $!"; +} + +sub db2Ldif { + my $ldif = shift ; + my $backend = shift ; + my $home = shift ; + my $include_suffix = shift ; + my $db2ldif_param ; + if ($include_suffix) { + $db2ldif_param = "db2ldif -r -D $home -n $backend -a $ldif -s \"$include_suffix\""; + } + else { + $db2ldif_param = "db2ldif -r -D $home -n $backend -a $ldif"; + } + open(DB2LDIF, "${quote}${quote}$slapdExecName${quote} $db2ldif_param${quote} 2>&1 |") or die "Could not run ns-slapd program $ldif2db_exe\n"; + sleep(1); # allow some data to accumulate in the pipe + my $ii = 0; + while () { + ++$ii; + if (($ii % 250) == 0) { + printMsg(" Processing...\n"); + } + printMsg($_); + } + close(DB2LDIF); + # set the ownership of the ldif file; should be the same as the 5.x slapd user id + if ((! $isNt) && ($oldlocaluser ne $localuser)) { + if (-f $ldif) { + chown( $newuid, $newgid, $ldif) or printMsg("\nUnable to change the ownership of $ldif to $localuser") ; + } + } +} + +sub manyLdif2db { + my $ldif_dir = shift; + $ENV{"$LIB_PATH"}=$new_libpath; + chdir($slapdExecDir) or die "Could not change directory to $slapdExecDir: $!"; + foreach $backend (@BACKENDS) { + my $ldif = "${ldif_dir}$backend.ldif" ; + &Ldif2db($ldif, $backend); + } + # remove the empty ldif directory + # but not if using the data dir + if (!$olddatadir) { + rmdir($ldif_dir); + } + chdir($curdir) or die "Could not change directory to $curdir: $!"; +} + + +sub Ldif2db { + my $ldif = shift ; + my $backend = shift ; + my $ldif2db_param = "ldif2db -D $serverHome -n $backend -i $ldif"; + open(LDIF2DB, "${quote}${quote}$slapdExecName${quote} $ldif2db_param${quote} 2>&1 |") or die "Could not run ns-slapd program $ldif2db_exe\n"; + sleep(1); # allow some data to accumulate in the pipe + while () { + printMsg($_); + } + close(LDIF2DB); + # remove the ldif file after the import + # but not if using the data dir + if (!$olddatadir) { + unlink($ldif) ; + } +} + + +########################################################################################### +# # +# Running/Stopping the Server # +# # +########################################################################################### + + + +sub isDirectoryAlive { + die "\n Migration aborted. Make sure your old and new Directory Servers are installed on the same machine \n" if ( $LDAPservername == -1 ); + my $test_conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd); + if ($test_conn) { + $test_conn->close(); + return 1; + } + else { + return 0 ; + } +} + + +sub startServer { + my $instanceDir = ${serverHome} ; + my $errLog = $instanceDir . $PATHSEP . 'logs' . $PATHSEP . 'errors'; + # emulate tail -f + # if the last line we see does not contain "slapd started", try again + my $done = 0; + my $started = 0; + my $code = 0; + my $lastLine = ""; + my $timeout = time + 240; # 4 minutes + $ENV{"$LIB_PATH"}=$new_libpath; + + my $startCmd = $instanceDir . $PATHSEP . 'start' . $script_suffix; + if (! -f $startCmd) { + $startCmd = $instanceDir . $PATHSEP . 'start-slapd' . $script_suffix; + } + $code = &mySystem($instanceDir,$startCmd); + open(IN, $errLog) or die "Could not open error log $errLog: $!"; + my $pos = tell(IN); + while (($done == 0) && (time < $timeout)) { + for (; ($done == 0) && ($_ = ); $pos = tell(IN)) { + $lastLine = $_; + # print; + # the server has already been started and shutdown once . . . + if (/slapd started\./) { + $started++; + if ($started == 2) { + $done = 1; + } + # sometimes the server will fail to come up; in that case, restart it + } elsif (/Initialization Failed/) { + # print "Server failed to start: $_"; + $code = &mySystem($instanceDir, $startCmd); + # sometimes the server will fail to come up; in that case, restart it + } elsif (/exiting\./) { + # print "Server failed to start: $_"; + #$code = &mySystem($startCmd); + $code = &mySystem($instanceDir, $startCmd); + } + } + if ($lastLine =~ /PR_Bind/) { + # server port conflicts with another one, just report and punt + print $lastLine; + print "This server cannot be started until the other server on this\n"; + print "port is shutdown.\n"; + $done = 1; + } + if ($done == 0) { + # rest a bit, then . . . + sleep(2); + # . . . reset the EOF status of the file desc + seek(IN, $pos, 0); + } + } + close(IN); + + sleep(5); + die "\nUnable to start the $Version.$Minor Directory Server\n" unless (isDirectoryAlive()); + + return 0; +} + +sub stopServer { + my $root = shift; + my $name = shift; + $maxStopIterations = 5; + print "\nShutting down server $name . . .\n"; + $ENV{"$LIB_PATH"}=$new_libpath; + $stopCmd = $quote . $root . $PATHSEP . $name . $PATHSEP . 'stop' . $script_suffix . $quote; + if (! -f $stopCmd) { + $stopCmd = $quote . $root . $PATHSEP . $name . $PATHSEP . 'stop-slapd' . $script_suffix . $quote; + } + + if (! -f $stopCmd) { + # no stop command, probably a 1.X system; for NT, we'll try net stop + # for unix, we'll get the pid and kill it + if ($isNT) { + $stopCmd = 'net stop ' . $name; + } else { + # see if there is a pid file + $pidfile = $root . $PATHSEP . $name . $PATHSEP . 'logs' . + $PATHSEP . 'pid'; + if (open(PIDFILE, $pidfile)) { + chomp($pid = ); + close(PIDFILE); + while ($maxStopIterations-- && !$exitCode) { + $exitCode = kill(15, $pid); + } + $stopCmd = undef; + } + } + } + + # keep looping until the stop cmd returns an error code, which usually + # means that what ever we want to stop is stopped, or some other error + # occurred e.g. permission, or no such service + $exitCode = &runAndIgnoreOutput($stopCmd); +# print "stopServer: exitCode=$exitCode\n"; + while ($stopCmd && $maxStopIterations-- && $exitCode) { + $exitCode = &runAndIgnoreOutput($stopCmd); +# print "stopServer: exitCode=$exitCode\n"; + } + + if (!$maxStopIterations) { + print "Warning: could not shutdown the server: $!\n"; + } + sleep(10) ; + $exitCode = 0; +} + + +sub runAndIgnoreOutput { + my $cmd = shift; + printMsg("."); + open(RUNCMD, "${quote}$cmd${quote} 2>&1 |") or die "Error: could not run $cmd: $!"; + printMsg("."); + sleep(1); # allow pipe to fill with data + printMsg("."); + while () { +# print; + } + my $code = close(RUNCMD); +# print "runAndIgnore: code=$code status=$?\n"; + return $?; +} + +############################################################################# +# migrate SSL info + +sub MigrateSSL { + my $secPwd = 'bidon' ; + # copy the SSL directory + ©Dir("$oldHome${PATHSEP}ssl","$serverHome${PATHSEP}ssl") if (-d "$oldHome${PATHSEP}ssl"); + # copy the cert db and key files + if ( -d "$oldDir${PATHSEP}alias") { + $aliasDir = "$root${PATHSEP}alias"; + if (! -d $aliasDir) { + mkdir($aliasDir, 0750); + } + &stopServer($root,'slapd-'.$newname); + my $keydb = "$aliasDir${PATHSEP}slapd-$newname-key3.db" ; + my $certdb = "$aliasDir${PATHSEP}slapd-$newname-cert8.db" ; + my $certdb7 = "$aliasDir${PATHSEP}slapd-$newname-cert7.db" ; + my $old_keydb = "$oldDir${PATHSEP}alias${PATHSEP}slapd-$oldname-key3.db" ; + my $old_certdb = "$oldDir${PATHSEP}alias${PATHSEP}slapd-$oldname-cert7.db"; + my $keydb_backup = "$aliasDir${PATHSEP}slapd-$newname-key3.db_backup" ; + my $certdb_backup = "$aliasDir${PATHSEP}slapd-$newname-cert7.db_backup" ; + if (-f $old_keydb) { + if (-f $keydb) { + if ($NO_INPUT_USER) { + printMsg("\n$keydb already exists. backup in $keydb_backup ..."); + ©BinFile($keydb,$keydb_backup); + ©BinFile($old_keydb,$keydb); + } + else { + print("\n\n$keydb already exists. Do you want to overwrite it ? [no]: "); + my $answer = ; + if ($answer =~ /^y|yes$/i) { + ©BinFile($old_keydb,$keydb); + } + } + } + else { + ©BinFile($old_keydb,$keydb); + } + } + if (-f $old_certdb) { + $mode = (stat($old_certdb))[2] if $PRESERVE; + if (-f $certdb) { + if ($NO_INPUT_USER) { + printMsg("\n$certdb already exists. backup in $certdb_backup ..."); + ©BinFile($certdb,$certdb_backup); + unlink($certdb) || print "Couldn't delete $certdb : $!\n"; + ©BinFile($old_certdb,$certdb7); + } + else { + print("\n\n$certdb already exists. Do you want to overwrite it ? [no]: "); + my $answer = ; + if ($answer =~ /^y|yes$/i) { + unlink($certdb) || print "Couldn't delete $certdb : $!\n"; + ©BinFile($old_certdb,$certdb7); + } + } + } + else { + ©BinFile($old_certdb,$certdb7); + } + } + # copy the old password file + if (-f "$oldDir${PATHSEP}alias${PATHSEP}$type-$oldname-pin.txt") { + ©BinFile( + "$oldDir${PATHSEP}alias${PATHSEP}$type-$oldname-pin.txt", + "$aliasDir${PATHSEP}$type-$newname-pin.txt" + ); + } + &startServer(); + if ($PRESERVE) { + chown($newuid,$newgid,$certdb) || print "Failed to set uid $newuid gid $newgid on $certdb : $!\n"; + chmod($mode,$certdb) || print "Failed to set mode $mode on $certdb : $!\n"; + } + } + +} + +sub DisableSSL { + my $entry = $conn->search("cn=config","base","objectclass=*"); + my $LDAPparam = "nsslapd-security" ; + my $Value = "off" ; + if ($entry->{$LDAPparam}[0] ne $Value) { + printTrace("\nDisable SSL...",1); + $entry->setValues($LDAPparam, $Value); + } + my $res = $conn->update($entry); + if ($res) { + printTrace("\nSSL disabled",2); + } + else { + printMsg("\nCan't disabled SSL. The server may have problems to start"); + } +} + +# enable the migration of client authentication informations +sub MigrateCertmap { + # backup the old certmap.conf and replace it with the new one + my $oldCertmap = "$oldDir${PATHSEP}shared${PATHSEP}config${PATHSEP}certmap.conf"; + my $newCertmap = "$root${PATHSEP}shared${PATHSEP}config${PATHSEP}certmap.conf" ; + my $backupCertmap = "$root${PATHSEP}shared${PATHSEP}config${PATHSEP}certmap.conf_backup" ; + if (-f $oldCertmap) { + if ($NO_INPUT_USER) { + printMsg("\n$newCertmap has been backup in $backupCertmap"); + ©BinFile($newCertmap,$backupCertmap); + ©BinFile($oldCertmap,$newCertmap); + } + else { + my $Ask = 1 ; + while ($Ask) { + printMsg("\n\nWhere do you want to back up the file $newCertmap [$backupCertmap] ?") ; + my $Answer = ; + $backupCertmap = $Answer if ($Answer ne "\n"); + chomp($backupCertmap); + printTrace("\nDest: .$backupCertmap.",4); + if (-e $backupCertmap) { + printMsg("\n\n$backupCertmap already exists. Do you want to overwrite it Yes/No [No] ?") ; + if ( =~ /yes|y/i) { + $Ask = 0 ; + } + else { + $backupCertmap = "$root${PATHSEP}shared${PATHSEP}config${PATHSEP}certmap.conf_backup" ; + } + } + else { + $Ask = 0 ; + } + } + printTrace("\nBackup file: $newCertmap in $backupCertmap",4); + ©BinFile($newCertmap,$backupCertmap); + ©BinFile($oldCertmap,$newCertmap); + } + } + else { + } +} + +sub hasChangedoldCertmap { + my $certmapfile = shift ; + my @reference = ("certmap default default", + "default:DNComps", + "default:FilterComps e") ; + my $cpt = 0 ; + printTrace("\nhasChangedoldCertmap",3); + open(CERTMAP,"< $certmapfile"); + while () { + if ((! /^\s*#/) && (! /^\s*$/)) { + my $ref = $reference[$cpt] ; + printTrace("\nValue: $_, ref: $ref",4); + if (! /^\s*$ref\s*$/) { + return 1 ; + } + else { + $cpt++ ; + } + } + } + close (CERTMAP); + printTrace("\ncpt: $cpt",4); + if ($cpt < $#reference) { + return 1 ; + } + else { + return 0 ; + } +} + + +########################################################################################### +# # +# Copy directory and files functions # +# # +########################################################################################### + + +sub copyDir { + my $src = shift; + my $dest = shift; + my $exclude = shift; + + opendir( SRC, $src ) or die "Can't open directory $src: $!: "; + my $mode; + my $uid; + my $gid; + mkdir ( $dest , 0755 ) or die "\nCan't create directory $dest. \nPlease check you have enough rights to create it and/or check that your parent directory exists.\n" if !( -e $dest ); + if ($PRESERVE) { + $mode = (stat($src))[2]; + ($uid, $gid) = (stat(_))[4..5]; + # Make sure files owned by the old user are owned by the + # new user + if ($uid == $olduid) { + $uid = $newuid; + $gid = $newgid; + } + chown $uid, $gid, $dest; + chmod $mode, $dest; + } + local ( @files ) = readdir ( SRC ); + closedir( SRC ); + for ( @files ) { + if ( $_ eq "." || $_ eq ".." ) { + next; + } elsif ( $exclude && /$exclude/ ) { + next; + } elsif( -d "$src${PATHSEP}$_") { + ©Dir ( "$src${PATHSEP}$_", "$dest${PATHSEP}$_" ); + } else { + ©BinFile ( "$src${PATHSEP}$_", "$dest${PATHSEP}$_"); + } + } +} + +sub copyBinFile { + my $src = shift; + my $dest = shift; + my $buf = ""; + my $bufsize = 8192; + + open( SRC, $src ) || die "Can't open $src: $!\n"; + # if we are given a directory destination instead of a file, extract the + # filename portion of the source to use as the destination filename + if (-d $dest) { + $dest = $dest . $PATHSEP . &basename($src); + } + open( DEST, ">$dest" ) || die "Can't create $dest: $!\n"; + binmode SRC; + binmode DEST; + if ($PRESERVE) { + $mode = (stat($src))[2]; + ($uid, $gid) = (stat(_))[4..5]; + # Make sure files owned by the old user are owned by the + # new user + if ($uid == $olduid) { + $uid = $newuid; + $gid = $newgid; + } + chown $uid, $gid, $dest; + chmod $mode, $dest; + } + while (read(SRC, $buf, $bufsize)) { + print DEST $buf; + } + close( SRC ); + close( DEST ); +} + +############################################################################################################# +# backup 5.x configuration files # +# backup the directory /slapd-instance/config dans /slapd-instance/BackupConfig # # +# # +############################################################################################################# + + +sub backupConfigFiles { + # backup the 5.x config files + my $src = "$serverHome${PATHSEP}config" ; + my $dest = "$serverHome${PATHSEP}config_backup" ; + if ($NO_INPUT_USER) { + printMsg("\n$src has been backup in $dest"); + ©Dir($src,$dest); + } + else { + my $Ask = 1 ; + while ($Ask) { + printMsg("\n\nWhere do you want to back up your configuration directory [$dest] ?") ; + my $Answer = ; + $dest = $Answer if ($Answer ne "\n"); + chomp($dest); + printTrace("\nDest: .$dest.",4); + if (-e $dest) { + printMsg("\n\n$dest already exists. Do you want to overwrite it Yes/No [No] ?") ; + if ( =~ /yes|y/i) { + $Ask = 0 ; + } + else { + $dest = "$serverHome${PATHSEP}config_backup" ; + } + } + else { + $Ask = 0 ; + } + } + printTrace("\nBackup Directory: $src in $dest",4); + ©Dir($src,$dest); + } +} +############################################################################# + +sub getLDAPservername { + my $oldLDAPservername; + my $LDAPservername; + my $localhost = "nsslapd-localhost"; + open(OLDDSELDIF, "< $oldDSEldif") or die "\nError: could not open old config file $oldDSEldif \n"; + my $in = new Mozilla::LDAP::LDIF(*OLDDSELDIF) ; + while ($entry = readOneEntry $in) { + my $DN = $entry->getDN(1) ; + if ($DN =~ /^cn=config$/i) { + my @values = $entry->getValues($localhost); + if ($entry->size($localhost)) { + $oldLDAPservername = $values[0]; + printTrace("\nName of the old LDAP server: $oldLDAPservername",3); + } + break; + } + } + close(OLDSELDIF); + + open( DSELDIF, "< $DSEldif" ) || die "\nCan't open $DSEldif \n"; + my $in = new Mozilla::LDAP::LDIF(*DSELDIF) ; + while ($entry = readOneEntry $in) { + my $DN = $entry->getDN(1) ; + if ($DN =~ /^cn=config$/i) { + my @values = $entry->getValues($localhost); + if ($entry->size($localhost)) { + $LDAPservername = $values[0]; + printTrace("\nName of the new LDAP server: $LDAPservername",3); + } + break; + } + } + close(DSELDIF); + # check ol and new Directory Instance are installed on the same physical machine. + if (lc($oldLDAPservername) ne lc($LDAPservername)) { + # warn the user he tries to migrate a 4.x server installed on a different machine from the 5.x one + printMsg("\n\nYour old instance is on $oldLDAPservername, whereas your new instance is on $LDAPservername. Migration on different machines is not supported. Do you want to continue ? Yes/No [No]:") ; + if (! ( =~ /yes|y/i)) { + return -1; + } + } + return $LDAPservername ; +} + +############################################################################# + +sub getLibPath { + my $myDir = shift; + my $myVersion = shift; + my $myMinor = shift; + + if ($isNT) { + return $ENV{"$LIB_PATH"}; + } + if (($myVersion >= 6) && ($myMinor >= 2)) { + return + "$myDir${PATHSEP}bin${PATHSEP}slapd${PATHSEP}lib${SEP}". + "$myDir${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${SEP}". + $ENV{"$LIB_PATH"}; + } else { + return "$myDir${PATHSEP}lib${SEP}".$ENV{"$LIB_PATH"}; + } +} + +############################################################################# + +sub getVersion { + my $dir = shift; + my $versionstr = shift; + my $version = 0; + my $minor = 0; + my $buildNumber = 0; + my $progDir = "${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${PATHSEP}"; + my $progDir2 = "${PATHSEP}bin${PATHSEP}slapd${PATHSEP}"; + + # find the slapd executable + if (!$versionstr) { # version not specified on cmd line - find it + $prog = $dir . $progDir . $slapdExecName; + if (! -f $prog) { + $prog = $dir . $progDir2 . $slapdExecName; + if (-f $prog && $isNT) { + # if slapd is in bin/slapd and we're on NT, just assume version 1; + # apparently, slapd.exe doesn't like the -v argument . . . + return ( '1', $minor ); + } + else{ + die "Could not run slapd program $prog: $!"; + } + } + else { + chdir($dir . $progDir); + } + $cur_libpath=$ENV{"$LIB_PATH"}; + $ENV{"$LIB_PATH"}= + "$dir${PATHSEP}lib${SEP}". + "$dir${PATHSEP}bin${PATHSEP}slapd${PATHSEP}lib${SEP}". + "$dir${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${SEP}". + $ENV{"$LIB_PATH"}; + # read the old version from the old slapd program + + open(F, "${quote}${quote}$prog${quote} -v${quote} 2>&1 |") or + die "Could not run slapd program $prog: $!"; + sleep(1); # allow some data to accumulate in the pipe +# print "Output from $prog -v:\n"; + while () { + if (/^Netscape-Directory/ || /^iPlanet-Directory/i) { + $versionstr = $_; + last; + } + } + $code = close(F); + # print "$prog returned code=$code status=$?\n"; + $ENV{"$LIB_PATH"}=$cur_libpath; + } + + if ($versionstr =~ /^Netscape-Directory\/(\d+)\.(\d+)(?:b\d)*\s+(\S+)/) { + $version = $1; + $minor = $2; + $buildNumber = $3; + } + elsif ($versionstr =~ /^Netscape-Directory\(restrict?ed-mode\)\/(\d+)\.(\d+)\s+(\S+)/) { # we can have restricted-mode or restriced-mode ... + $version = $1; + $minor = $2; + $buildNumber = $3; + } + elsif ($versionstr =~ /^iPlanet-Directory\/(\d+)\.(\d+)\s+(\S+)/i) { + $version = $1; + $minor = $2; + $buildNumber = $3; + } elsif ($versionstr =~ /(\d+)\.(\d+)/) { + $version = $1; + $minor = $2; + } + + if ($version == 0) { + die "\nCould not determine version of the directory server in $dir: \n"; + } + + # distinguish the 4.1 and the 4.11 thanks to the buildNumber + if (($version == 4) && ($minor == 1)){ + if (! ($buildNumber =~ /^B99\.16/)) { + # it's not a 4.1 Netscape Directory Server => it's a 4.11 + $minor = 11 ; + } + } + chdir($curdir) or die "Could not change directory to $curdir: $!" ; + return ( $version, $minor ); +} + +############################################################################################### +sub normalizeDir { + my $dir = shift ; + my $dir_prec = "" ; + while ($dir_prec ne $dir) { + $dir_prec = $dir ; + if ($isNT) { + grep { s@\\\\@\\@g } $dir ; + } + else { + grep { s@//@/@g } $dir ; + } + } + return $dir ; +} + + +############################################################################################### + +sub GetTime { + my $tm = localtime; + (my $sec, my $min, my $hour, my $dd, my $mm, my $yy) = ($tm->sec, $tm->min, $tm->hour, $tm->mday, ($tm->mon)+1, ($tm->year)+1900); + $sec = "0$sec" unless $sec > 9 ; + $min = "0$min" unless $min > 9 ; + $hour = "0$hour" unless $hour > 9 ; + $dd = "0$dd" unless $dd > 9 ; + $mm = "0$mm" unless $mm > 9 ; + return ($sec, $min, $hour, $dd, $mm, $yy); +} + +############################################################################################### +# get uid and group id of the 5.x slapd server. +# The uid is done through the nsslapd-localuser attribute + +sub getuid_gid { + my $newuid ; + my $newgid ; + my $localuser ; + my $localuser_attr = "nsslapd-localuser" ; + if (! $isNT) { + &startServer() unless (isDirectoryAlive()); + my $conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Can't contact the $Version.$Minor LDAP server: $LDAPservername\n"; + my $entry = $conn->search("cn=config ", "base","objectclass=*", 0, ($localuser_attr)) ; + # Tests wether we succeed to get the entry cn=config + die "\nCan't get the entry cn=config \n" unless ($entry); + my @values = $entry->getValues($localuser_attr); + $conn->close(); + if ($#values == -1 || ($values[0] eq "") ) { # tests wether the nsslapd-localuser attribute has a value + printMsg("\nNo localuser has been found in the configuration of the directory. "); + if ($NO_INPUT_USER) { + printMsg("\nWe considered nobody as the localuser"); + $localuser = "nobody" ; + } + else { + my $Ask = 1 ; + while ($Ask) { + printMsg("\nUnder what user does your $Version.$Minor directory server run [nobody] ? ") ; + $localuser = ; + chomp($localuser); + $localuser = "nobody" if ($localuser eq ""); + ($newuid, $newgid) = (getpwnam("$localuser"))[2..3] ; + if ($newuid) { + $Ask = 0 ; + } + else { + printMsg("\nError: $localuser is unknown from the system "); + } + } + } + } + else { + $localuser = $values[0]; # returns the first value (we should only have one localuser) + my $size = $#values ; + } + ($newuid, $newgid) = (getpwnam("$localuser"))[2..3] ; + return ($localuser, $newuid, $newgid) ; + } + else { + return () ; + } +} + +sub getolduid_gid { + my $oldlocaluser ; + my $localuserAttr = "nsslapd-localuser"; + my $entry ; + if (! $isNT) { + open( DSELDIF, "< $oldDSEldif" ) || die "Can't open $oldDSEldif: $!: "; + my $in = new Mozilla::LDAP::LDIF(*DSELDIF) ; + while ($entry = readOneEntry $in) { + $typeOfEntry = getTypeOfEntry($entry); + if ($typeOfEntry eq "CONFIG_NODE") { + $oldlocaluser = $entry->{$localuserAttr}[0] if ($entry->exists($localuserAttr)); + break ; + } + } + close(DSE); + ($olduid, $oldgid) = (getpwnam("$oldlocaluser"))[2..3] ; + return ($oldlocaluser, $olduid, $oldgid) ; + } + else { + return (); + } +} +############################################################################################### +# get current directory + +sub getCwd { + my $command = $isNT ? "cd" : "/bin/pwd"; + open(PWDCMD, "$command 2>&1 |") or + die "Error: could not execute $command: $!"; + # without the following sleep, reading from the pipe will + # return nothing; I guess it gives the pwd command time + # to get some data to read . . . + sleep(1); + my $currentdir; + while () { + if (!$currentdir) { + chomp($currentdir = $_); + } + } + my $code = close(PWDCMD); +# if ($code || $?) { +# print "$command returned code=$code status=$? dir=$curdir\n"; +# } +# print "getCwd curdir=\[$curdir\]\n"; + return $currentdir; +} + +################################ +# Need to migrate the credential. +# If the credential can not be migrated, leave it at it is +################################ +sub migrate_credential{ + my $entry_to_modify = shift; + my $credentials_attr = shift; + my @old_value = $entry_to_modify->getValues($credentials_attr); + my $migratecredExecName = 'migratecred'; + my $credOldHome = $oldHome; + my $credServerHome = $serverHome; + + if ($isNT) { + # oldHome may be pointing to the archived copy of the + # instance dir which may be different than the path that + # the instance was originally installed as on Windows. If + # this path is not the original install path, then the + # credential will not be migrated correctly. We should + # prompt the user on Windows for the correct path. + + print "\n\nThe old instance path must be the same as where it was"; + print "\ninitially installed, not where it was archived in order"; + print "\nfor this step to succeed. Please verify that the path"; + print "\nis correct. Note that case sensitivity is important here."; + print "\n\nOld Instance Directory: $credOldHome"; + print "\nIs this correct? (y/n): "; + chomp(my $answer = ); + if (!($answer =~ /y|yes/i)) { + print "\nPlease enter the correct path for the old instance directory: "; + chomp($credOldHome = ); + } + + print "\n\nThe new instance path must also be correct for this step"; + print "\nto succeed. Please verify that the path is correct. Note"; + print "\nthat case sensitivity is important here."; + print "\n\nNew Instance Directory: $credServerHome"; + print "\nIs this correct? (y/n): "; + chomp(my $answer = ); + if (!($answer =~ /y|yes/i)) { + print "\nPlease enter the correct path for the new instance directory: "; + chomp($credServerHome = ); + } + } +# print "\nMigratecred command is: ${quote}$root${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${PATHSEP}$migratecredExecName${quote} -o $credOldHome -n $credServerHome -c @old_value\n"; + + my @new_cred = `${quote}$root${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${PATHSEP}$migratecredExecName${quote} -o $credOldHome -n $credServerHome -c @old_value`; + + if ( $? == 0 ) + { + $entry_to_modify->setValues($credentials_attr, @new_cred); + } +} + diff --git a/ldap/admin/src/scripts/template-migrate6to7 b/ldap/admin/src/scripts/template-migrate6to7 new file mode 100644 index 00000000..26f117b6 --- /dev/null +++ b/ldap/admin/src/scripts/template-migrate6to7 @@ -0,0 +1,3049 @@ +#{{PERL-EXEC}} +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2004 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# + +# Migrate a 6.x directory server to a 7.0 directory server + +####################################################################################################### +# enable the use of Perldap functions +require DynaLoader; + +use Getopt::Std; +use Mozilla::LDAP::Conn; +use Mozilla::LDAP::Entry; +use Mozilla::LDAP::LDIF; +use Mozilla::LDAP::Utils qw(:all); +use Mozilla::LDAP::API qw(:api :ssl :apiv3 :constant); # Direct access to C API +use Time::localtime; +use File::Basename; +use Class::Struct ; + +####################################################################################################### + +sub usage { + print(STDERR "\nUsage: $0 -D rootdn { -w password | -w - | -j filename } -p port \n"); + print(STDERR " -o oldInstancePath -n newInstancePath [-t tracelevel] [-L logfile]\n"); + print(STDERR "************** parameters in brackets are optionals, others are required **************\n"); + print(STDERR " Opts: -D rootdn - new 7.0 Directory Manager\n"); + print(STDERR " : -w password - new 7.0 Directory Manager's password\n"); + print(STDERR " : -w - - Prompt for new 7.0 Directory Manager's password\n"); + print(STDERR " : -j filename - Read new 7.0 Directory Manager's password from file\n"); + print(STDERR " : -p port - new 7.0 Directory Server port\n"); + print(STDERR " : -o oldInstancePath - Path of the old instance to migrate \n"); + print(STDERR " : -n newInstancePath - Path of the new 7.0 instance\n"); + print(STDERR " : [-d dataPath] - Path to directory containing data files to import into new instance\n"); + print(STDERR " : [-v oldVersion] - Version of old instance (obtained by running $slapdExecName -v\n"); + print(STDERR " : [-t tracelevel] - (optional) specify the level of trace (0..3)\n"); + print(STDERR " : [-L logfile] - (optional) specify the file to log the migration report \n"); + } +######################################################################################################## + +BEGIN { + + require 'uname.lib' ; + $isNT = -d '\\'; + $PATHSEP = $isNT ? "\\" : "/"; + ${SEP} = $isNT ? ";" : ":" ; + @INC = ( '.', '../../../admin/admin/bin'); + grep { s@/@\\@g } @INC if $isNT; + $script_suffix = $isNT ? ".bat" : ""; + $exe_suffix = $isNT ? ".exe" : ""; + # NT needs quotes around some things unix doesn't + $quote = $isNT ? "\"" : ""; + + # If this variable is set, all file/directory creation will make sure the mode + # and ownership of the destination is the same as the source + $PRESERVE = 1 if (!$isNT); + $script_suffix = $isNT ? ".bat" : ""; + $exe_suffix = $isNT ? ".exe" : ""; + if ($isNT) { + $os = "WINNT"; + } else { + $os = &uname("-s"); + } + if ($isNT) { + # we have to pass batch files directly to the NT command interpreter + $com_spec = $ENV{ComSpec}; + if (!$com_spec) { + $com_spec = $ENV{COMSPEC}; + } + if (!$com_spec || ! -f $com_spec) { + # find the first available command interpreter + foreach $drive (c..z) { + $com_spec = "$drive:\\winnt\\system32\\cmd.exe"; + last if (-f $com_spec); + $com_spec = undef; + } + if (! $com_spec) { + # punt and pray + $com_spec = 'c:\winnt\system32\cmd.exe'; + } + } + } + if ( $os eq "AIX" ) { + $dll_suffix = "_shr.a"; + } + elsif ( $os eq "HP-UX" ) { + $dll_suffix = ".sl"; + } + elsif ( $os eq "WINNT" ) { + $dll_suffix = ".dll"; + } + else { + $dll_suffix = ".so"; + } + $slapdExecName = $isNT ? 'slapd.exe' : './ns-slapd'; + select STDERR; + $| = 1; + select STDOUT; + $| = 1; +} + +SWITCH: { + if ($os eq "AIX") { + $LIB_PATH = "LIBPATH" ; + last SWITCH ; + } + if ($os eq "HP-UX") { + $LIB_PATH = "SHLIB_PATH" ; + last SWITCH ; + } + if ($isNT) { + $LIB_PATH = "PATH" ; + last SWITCH ; + } + else { + $LIB_PATH = "LD_LIBRARY_PATH" ; + last SWITCH ; + } + } + + # old parameters + ${oldDir} = "" ; + ${oldname} = "" ; + ${oldHome} = "" ; + ${oldConfDir} = "" ; + ${oldlocaluser} ; + ${olduid} ; + ${oldgid} ; + + # new parameters + ${root} = "{{DS-ROOT}}" ; + ${type} = "" ; + ${newname} = "" ; + ${newport} = "" ; + ${rootDN} = "" ; + ${rootpwd} = "" ; + ${localhost} = "" ; + ${LogFileReport} = "" ; + ${newuid} ; + ${localuser} ; + ${newgid} ; + $NO_INPUT_USER = 0 ; # by default user can give inputs during the migration process + ${curdir} = getCwd(); + ${slapdExecDir} = "${root}${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${PATHSEP}"; + # in 7.0 the replica Id is setup to a static value + $replicaIdvalue = 65535; + + # specify the level of trace + $TRACELEVEL=1; + + $LDAP_SERVER_UNREACHABLE = 81; + + # get input users + &getParameters() ; + ${oldDir} = &normalizeDir("${oldDir}"); + ${oldHome} = "${oldDir}${PATHSEP}$type-$oldname" ; + ${oldConfDir} = "${oldHome}${PATHSEP}config${PATHSEP}" ; + ${oldSchemaDir} = "${oldConfDir}schema${PATHSEP}"; + ${oldDSEldif} = "${oldConfDir}dse.ldif"; + ${serverHome} = "${root}${PATHSEP}$type-$newname" ; + ${schemaDir} = "$serverHome${PATHSEP}config${PATHSEP}schema${PATHSEP}"; + ${DSEldif} = "$serverHome${PATHSEP}config${PATHSEP}dse.ldif"; + ${ldif_rep} = "${oldConfDir}ldif${PATHSEP}" ; + ${oldSlapdExecDir} = "${oldDir}${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${PATHSEP}"; + + open(LOGFILE, ">> $LogFileReport"); + + printTrace("\noldDir: $oldDir, oldHome: $oldHome, \noldConfDir: $oldConfDir, \nldif_rep: $ldif_rep, \nrootDN: $rootDN, \nPort: $newport, \nNewname: $newname\n",3); + printTrace("\nLIB_PATH: $LIB_PATH",4); + + if (!(-d $serverHome)) { + printMsg("\n$serverHome doesn't exist\n"); + exit(1); + } + if (!(-d $oldHome)) { + printMsg("\n$oldHome doesn't exist\n"); + exit(1); + } + + if ($olddatadir && !(-d $olddatadir)) { + print("\n$olddatadir doesn't exist\n"); + exit(1); + } + + +%HashParametersName = (); + +# The following hash displays only general server parameters to migrate under cn=config +%GeneralSrvParamToMigrate = ( + 'nsslapd-accesscontrol'=> '\n', + 'nsslapd-errorlog-logging-enabled'=> '\n', + 'nsslapd-accesslog-logging-enabled'=> '\n', + 'nsslapd-auditlog-logging-enabled'=> '\n', + 'nsslapd-accesslog-level'=> '\n', + 'nsslapd-accesslog-logbuffering'=> '\n', + 'nsslapd-accesslog-logexpirationtime'=> '\n', + 'nsslapd-accesslog-logexpirationtimeunit'=> '\n', + 'nsslapd-accesslog-logmaxdiskspace'=> '\n', + 'nsslapd-accesslog-logminfreediskspace'=> '\n', + 'nsslapd-accesslog-logrotationtime'=> '\n', + 'nsslapd-accesslog-logrotationtimeunit'=> '\n', + 'nsslapd-accesslog-maxlogsize'=> '\n', + 'nsslapd-accesslog-maxLogsPerDir'=> '\n', + 'nsslapd-attribute-name-exceptions'=> '\n', + 'nsslapd-auditlog-logexpirationtime'=> '\n', + 'nsslapd-auditlog-logexpirationtimeunit'=> '\n', + 'nsslapd-auditlog-logmaxdiskspace'=> '\n', + 'nsslapd-auditlog-logminfreediskspace'=> '\n', + 'nsslapd-auditlog-logrotationtime'=> '\n', + 'nsslapd-auditlog-logrotationtimeunit'=> '\n', + 'nsslapd-auditlog-maxlogsize'=> '\n', + 'nsslapd-auditlog-maxLogsPerDir'=> '\n', + 'nsslapd-certmap-basedn'=> '\n', + 'nsslapd-ds4-compatible-schema'=> '\n', + 'nsslapd-enquote-sup-oc'=> '\n', + 'nsslapd-errorlog-level'=> '\n', + 'nsslapd-errorlog-logexpirationtime'=> '\n', + 'nsslapd-errorlog-logexpirationtimeunit'=> '\n', + 'nsslapd-errorlog-logmaxdiskspace'=> '\n', + 'nsslapd-errorlog-logminfreediskspace'=> '\n', + 'nsslapd-errorlog-logrotationtime'=> '\n', + 'nsslapd-errorlog-logrotationtimeunit'=> '\n', + 'nsslapd-errorlog-maxlogsize'=> '\n', + 'nsslapd-errorlog-maxlogsperdir'=> '\n', + 'nsslapd-groupevalnestlevel'=> '\n', + 'nsslapd-idletimeout'=> '\n', + 'nsslapd-ioblocktimeout'=> '\n', + 'nsslapd-lastmod'=> '\n', + 'nsslapd-listenhost'=> '\n', + 'nsslapd-maxdescriptors'=> '\n', + 'nsslapd-nagle'=> '\n', + 'nsslapd-readonly'=> '\n', + 'nsslapd-referralmode'=> '\n', + 'nsslapd-plugin-depends-on-name'=> '\n', + 'nsslapd-plugin-depends-on-type'=> '\n', + 'nsslapd-referral'=> '\n', + 'nsslapd-reservedescriptors'=> '\n', + 'nsslapd-rootpwstoragescheme'=> '\n', + 'nsslapd-schemacheck'=> '\n', + 'nsslapd-secureport'=> '\n', + 'nsslapd-security'=> '\n', + 'nsslapd-sizelimit'=> '\n', + 'nsslapd-ssl3ciphers'=> '\n', + 'nsslapd-timelimit'=> '\n', + 'passwordchange'=> '\n', + 'passwordchecksyntax'=> '\n', + 'passwordexp'=> '\n', + 'passwordhistory'=> '\n', + 'passwordinhistory'=> '\n', + 'passwordlockout'=> '\n', + 'passwordlockoutduration'=> '\n', + 'passwordmaxage'=> '\n', + 'passwordmaxfailure'=> '\n', + 'passwordminage'=> '\n', + 'passwordminlength'=> '\n', + 'passwordmustchange'=> '\n', + 'passwordresetfailurecount' => '\n', + 'passwordstoragescheme' => '\n', + 'passwordunlock' => '\n', + 'passwordwarning' => '\n' +); + +# the following hash displays global parameters related to database stored under cn=config,cn=ldbm database,cn=plugins,cn=config +%GlobalConfigLDBMparamToMigrate = ( + 'nsslapd-allidsthreshold' => '\n', + 'nsslapd-lookthroughlimit' => '\n', + 'nsslapd-mode' => '\n', + 'nsslapd-dbcachesize' => '\n', + 'nsslapd-cache-autosize' => '\n', + 'nsslapd-cache-autosize-split' => '\n', + 'nsslapd-db-transaction-logging' => '\n', + 'nsslapd-import-cachesize' => '\n' +); + +# the following hash displays specific parameters to each backends and stored under cn=DBname,cn=ldbm database,cn=plugins,cn=config +%LDBMparamToMigrate = ( + 'nsslapd-cachesize' => '\n', + 'nsslapd-cachememsize' => '\n', + 'nsslapd-readonly' => '\n', + 'nsslapd-require-index' => '\n' +); + + +%ChainingConfigParams = ( + 'nsactivechainingcomponents' => '\n', + 'nstransmittedcontrols' => '\n' + ); + +%ChainingDefaultInstanceConfigParams = ( + 'nsabandonedsearchcheckinterval' => '\n', + 'nsbindconnectionslimit' => '\n', + 'nsbindtimeout' => '\n', + 'nsbindretrylimit' => '\n', + 'nshoplimit' => '\n', + 'nsmaxresponsedelay' => '\n', + 'nsmaxtestresponsedelay' => '\n', + 'nschecklocalaci' => '\n', + 'nsconcurrentbindlimit' => '\n', + 'nsconcurrentoperationslimit' => '\n', + 'nsconnectionlife' => '\n', + 'nsoperationconnectionslimit' => '\n', + 'nsproxiedauthorization' => '\n', + 'nsreferralonscopedsearch' => '\n', + 'nsslapd-sizelimit' => '\n', + 'nsslapd-timelimit' => '\n' +); + +%changelog5params = ( + 'nsslapd-changelogmaxage' => '\n', + 'nsslapd-changelogmaxentries' => '\n' + ); + +@SNMPparams = ( + 'nssnmpenabled', + 'nssnmporganization', + 'nssnmplocation', + 'nssnmpcontact', + 'nssnmpdescription', + 'nssnmpmasterhost', + 'nssnmpmasterport', + 'nssnmpenabled', + 'aci' + ); + +%stdIncludes = ( + "." => "\n", + ".." => "\n", + "30ns-common.ldif " => "\n", + "50ns-mail.ldif " => "\n", + "50ns-news.ldif" => "\n", + "50iplanet-servicemgt.ldif"=> "\n", + "50netscape-servicemgt.ldif"=> "\n", + "50ns-mcd-browser.ldif" => "\n", + "50ns-proxy.ldif" => "\n", + "00core.ldif" => "\n", + "50ns-admin.ldif" => "\n", + "50ns-mcd-config.ldif " => "\n", + "50ns-value.ldif" => "\n", + "05rfc2247.ldif" => "\n", + "50ns-calendar.ldif" => "\n", + "50ns-mcd-li.ldif" => "\n", + "50ns-wcal.ldif" => "\n", + "05rfc2927.ldif" => "\n", + "50ns-certificate.ldif" => "\n", + "50ns-mcd-mail.ldif" => "\n", + "50ns-web.ldif" => "\n", + "10rfc2307.ldif" => "\n", + "50ns-compass.ldif" => "\n", + "50ns-media.ldif" => "\n", + "20subscriber.ldif" => "\n", + "50ns-delegated-admin.ldif"=> "\n", + "50ns-mlm.ldif" => "\n", + "25java-object.ldif" => "\n", + "50ns-directory.ldif" => "\n", + "50ns-msg.ldif" => "\n", + "28pilot.ldif" => "\n", + "50ns-legacy.ldif" => "\n", + "50ns-netshare.ldif" => "\n" +); + + +# Backends migrated (Backend CN attribute value) +@BACKENDS = () ; +# All pairs of suffix-backend are registered in this hashtable +%oldBackends = () ; + +#store the backend instances to migrate +@LDBM_backend_instances = (); + +#store the mapping tree +@Mapping_tree_entries = (); + +#store the suffix and the associated chaining backend +%oldChainingBackends = (); + +#store the multiplexor bind entries to migrate +%MultiplexorBindDNEntriesToMigrate = (); + +#store the Replica bind DN entries to migrate +%ReplicaBindDNEntriesToMigrate = (); + +# list of standard plugins +%stdPlugins = ( + "7-bit check" => "\n", + "acl plugin" => "\n", + "acl preoperation" => "\n", + "binary syntax" => "\n", + "case exact string syntax" => "\n", + "case ignore string syntax" => "\n", + "chaining database" => "\n", + "class of service" => "\n", + "country string syntax" => "\n", + "distinguished name syntax" => "\n", + "generalized time syntax" => "\n", + "integer syntax" => "\n", + "internationalization plugin" => "\n", + "ldbm database" => "\n", + "legacy replication plugin" => "\n", + "multimaster replication plugin" => "\n", + "octet string syntax" => "\n", + "clear" => "\n", + "crypt" => "\n", + "ns-mta-md5" => "\n", + "sha" => "\n", + "ssha" => "\n", + "postal address syntax" => "\n", + "referential integrity postoperation" => "\n", + "retro changelog plugin" => "\n", + "roles plugin" => "\n", + "telephone syntax" => "\n", + "uid uniqueness" => "\n", + "uri syntax" => "\n" + ); + +# list of indexes that have disappeared from the new schema compared to 6.x +%deniedIndexes = ( + 'dncomp' => "\n" +); + +@default_indexes = (); +@indexes = (); + +# list of user added Plugin's. In 7.0, they 'll need to be recompiled +@badPlugins = () ; + +@pluginAttrs = ( + "objectclass", + "cn", + "nsslapd-pluginpath", + "nsslapd-plugininitfunc", + "nsslapd-plugintype", + "nsslapd-pluginenabled", + "nsslapd-plugin-depends-on-type", + "nsslapd-pluginid", + "nsslapd-pluginversion", + "nsslapd-pluginvendor" + ); + +@nsds5replicaAttrs = ( + 'objectclass', + 'nsDS5ReplicaRoot', + 'nsDS5ReplicaType', + 'nsDS5ReplicaLegacyConsumer', + 'nsDS5flags', + 'nsDS5ReplicaId', + 'nsDS5ReplicaPurgeDelay', + 'nsDS5ReplicaBinddn', + 'cn', + 'nsDS5ReplicaReferral' + ); + +# array of replicas to migrate +@new6replicas = (); + +# array of replication agreements to migrate +@replicationAgreements = (); + +# compare LDIF standard config files with standard ones +CompareStdConfigFiles() ; +die "\n\n The version of product you want to migrate is not a 6.x Directory Server\n" unless ($oldVersion == 6) ; + +# Shutdown the legacy Directory instance +printTrace("\nShutdown the legacy Directory Server instance: ${oldHome}",0); +&stopServer($oldDir, 'slapd-'.$oldname); + +# get the hostname of the new LDAP server +my $LDAPservername = &getLDAPservername(); + +# get the uid and gid of the 7.0 slapd user +($localuser, $newuid, $newgid) = getuid_gid(); +# get the uid and gid of the 6.x slapd user +($oldlocaluser, $olduid, $oldgid) = getolduid_gid(); +printTrace("\n7.0 localuser: $localuser, uid: $newuid, gid: $newgid",2); +printTrace("\n6.x localuser: $oldlocaluser, uid: $olduid, gid: $oldgid",2); + +# backup 7.0 configuration files in <6server_root>/slapd-instancename/config +printTrace("\nBackup $serverHome${PATHSEP}config on $serverHome${PATHSEP}config_backup ...",0); +&backupConfigFiles(); + +# migrate the schema (need to stop and start the 7.0 server) +printTrace("\nMigrate the schema...",0); +MigrateSchema(); + +# start the server unless it is already started +&startServer() unless (isDirectoryAlive()); + +############### Connect to the 7.0 LDAP Directory Server ###################### +$ENV{"$LIB_PATH"} = $new_libpath; + +die "\n Migration aborted. Make sure your old and new Directory Server are installed on the same machine \n" if ( $LDAPservername == -1 ); +$conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Unable to contact the $Version.$Minor LDAP server: $LDAPservername\n"; + +# Cconnection to 7.0 LDAP server is successful ! +printTrace("\nConnected to $Version.$Minor LDAP server",0) ; + +# Parse the main configuration file: dse.ldif +printTrace("\n\nParse the old DSE ldif file: $oldDSEldif *****",0, 1); +printTrace("\nThis may take a while ...\n",0); +&MigrateDSEldif(); + +#migrate LDBM backend instances +printTrace("\n\nMigrate LDBM backend instances...",0,1); +&migrateLDBM_backend_instances(); + +#migrate mapping tree entries +printTrace("\n\nMigrate mapping tree...",0,1); +&migrateMappingTree(); + +#migrate default indexes +printTrace("\n\nMigrate default indexes...",0,1); +migrateDefaultIndexes(); + +#migrate indexes +printTrace("\n\nMigrate indexes...",0,1); +migrateIndexes(); + +#migrate replicas +printTrace("\n\nMigrate replicas...",0,1); +&MigrateNSDS5_replica(); + +#migrate replication agreements +printTrace("\n\nMigrate replication agreements...",0,1); +&MigrateNSDS_replication_agreement(); + +#migrate key/cert databases +printTrace("\n\nMigrate key/cert databases...",0,1); +&MigrateSSL(); + +# migrate certmap.conf +printTrace("\n\nMigrate Certmap.conf...",0,1); +&MigrateCertmap() ; + +################## Close the connection to 7.0 LDAP Server ##################### +printTrace("\n\n***** Close the LDAP connection to the new Directory Server instance ***** ",0); +$conn->close; + + +################## stop the new instance and Export/Import the data, restart the server ################## +if (@BACKENDS) { + &stopServer($root,'slapd-'.$newname); + if ($olddatadir) { + printTrace("\nData already contained in $olddatadir...\n",0,1) ; + $ldif_rep = "$olddatadir${PATHSEP}"; + } else { + printTrace("\nData processing...\n",0,1) ; + # migrate data for each backend: 6.x -> LDIF files + &manydb2Ldif($ldif_rep); + } + + # migrate LDIF data to the new database: LDIF -> New + &manyLdif2db($ldif_rep); + &migrateChangelog(); + printTrace("\n***** Migrate ReplicaBindDN entries...\n",0,1); + &importReplicaBindDNEntries(); + printTrace("\n***** Migrate MultiplexorBindDN entries...\n",0,1); + &importMultiplexorBindDNEntries(); + &startServer() unless (isDirectoryAlive()); +} +else { + printTrace("\nINFORMATION - There are no non-standard or non-already existing suffixes to migrate\n",0); + &migrateChangelog(); + printTrace("\n***** Migrate ReplicaBindDN entries...\n",0,1); + &importReplicaBindDNEntries(); + printTrace("\n***** Migrate MultiplexorBindDN entries...\n",0,1); + &importMultiplexorBindDNEntries(); +} + +printMsg("\n\n ****** End of migration ******\n\n"); + +close(LOGFILE); + + +########################################################################################### +# get input users +sub getParameters { + my $exit = 0 ; + my $i = 0; + my $pwdfile= ""; + + while ($i <= $#ARGV) { + if ( "$ARGV[$i]" eq "-D" ) { # directory manager + if (! $rootDN) { + $rootDN = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-w") { # password + if (! $rootpwd) { + $rootpwd = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-j") { # password file + if (! $pwdfile) { + $pwdfile = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-o") { # old instance path + if (! $oldHome ) { + $oldHome = $ARGV[++$i] ; + grep { s@\\@/@g } $oldHome if $isNT ; + if ($oldHome =~ /[\"]?(.*)?[\"]?/) { $oldHome = $1 ; } + if ($oldHome =~ m@^(.*)/([^-/]*)-([^/]*)[/]?$@) { + $oldDir = $1 ; + $type = $2 ; + $oldname = $3 ; + if ($isNT) { + $oldDir = lc($oldDir) ; + $type = lc($type) ; + $oldname = lc($oldname) ; + $oldHome = lc($oldHome) ; + grep { s@/@\\@g } $oldDir ; + grep { s@/@\\@g } $oldHome ; + } + } + else { + print("\nThe old instance path is not correct. It must be like slapd-instancename"); + &usage(); + exit(1); + } + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-n") { # new instance path + if (! $serverHome ) { + $serverHome = $ARGV[++$i] ; + grep { s@\\@/@g } $root if $isNT ; + grep { s@\\@/@g } $serverHome if $isNT ; + if ($serverHome =~ /[\"]?(.*)?[\"]?/) { $serverHome = $1 ; } + if ($serverHome =~ m@^(.*?)/?([^/-]*)-([^/]*)[/]?$@) { + $root = $1 if ($1); + $type = $2 ; + $newname = $3 ; + if ($isNT) { + $root = lc($root) ; + $type = lc($type) ; + $newname = lc($newname) ; + $serverHome = lc($serverHome) ; + grep { s@/@\\@g } $root ; + grep { s@/@\\@g } $serverHome ; + } + } + else { + print("\nThe new instance path is not correct. It must be like slapd-instancename"); + &usage(); + exit(1); + } + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-p") { # new DS port + if (! $newport ) { + $newport = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-d") { # old instance LDIF data dir + if (! $olddatadir ) { + $olddatadir = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-v") { # old version + if (! $oldversionstr ) { + $oldversionstr = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-t") { # TRACELEVEL + my $value = $ARGV[++$i] ; + if ($value =~ /[0-3]/) { + $TRACELEVEL = $value ; + } + else { + print("\nThe tracelevel must belong to 0..3 interval"); + &usage(); + exit(); + } + } elsif ("$ARGV[$i]" eq "-noinput") { # no user interventions during processing + $NO_INPUT_USER = 1 ; + } elsif ("$ARGV[$i]" eq "-L") { # migration logfile + $LogFileReport = $ARGV[++$i] ; + } + else { + print("\nThe option $ARGV[$i] is not recognized"); + &usage() ; + exit(1); + } + $i++; + } + if (! $rootDN) { + print("\nThe rootDN is missing"); + $exit = 1; + } + if ($pwdfile ne "") { + # Open file and get the password + unless (open (RPASS, $pwfile)) { + die "Error, cannot open password file $passwdfile\n"; + } + $rootpwd = ; + chomp($rootpwd); + close(RPASS); + } elsif ($rootpwd eq "-"){ + # Read the password from terminal + die "The '-w -' option requires an extension library (Term::ReadKey) which is not\n", + "part of the standard perl distribution. If you want to use it, you must\n", + "download and install the module. You can find it at\n", + "http://www.perl.com/CPAN/CPAN.html\n"; + # Remove the previous line and uncomment the following 6 lines once you have installed Term::ReadKey module. +# use Term::ReadKey; +# print "Bind Password: "; +# ReadMode('noecho'); +# $rootpwd = ReadLine(0); +# chomp($rootpwd); +# ReadMode('normal'); + } + if (! $rootpwd) { + print("\nThe rootpwd is missing"); + $exit = 1 ; + } + if (! $newport) { + print("\nThe port is missing"); + $exit = 1; + } + if (! $serverHome) { + print("\nThe new instance path is missing"); + $exit = 1; + } + if (! $oldHome) { + print("\nThe old instance path is missing"); + $exit = 1; + } + if ((! $LogFileReport) && $serverHome) { + ($sec, $min, $hour, $dd, $mm, $yy) = &GetTime(); + $LogFileReport = "${serverHome}${PATHSEP}logs${PATHSEP}Migration_${dd}${mm}${yy}_${hour}${min}${sec}.log"; + } + if ($exit) { + &usage() ; + exit(1); + } + +} + +################################################################################################### + +sub MigrateSchema{ + my $FilesChanged = ""; + my $AllDiffs = ""; + my $NoChanges = "" ; + my $lineToBegin = 0 ; + opendir(SCHEMADIR, $oldSchemaDir) or + die "Error: could not open migrated config dir $oldSchemaDir: $!"; + + foreach $file (readdir(SCHEMADIR)) { + if (! exists($stdIncludes{lc($file)})) { + my $newSchemaFile = $schemaDir . $file; + if (-f $newSchemaFile ) { + # The ldif file already exists. Make a diff and warn the user if different. + if (diff($newSchemaFile, $oldSchemaDir.$file)) { + &stopServer($root,'slapd-'.$newname) if (isDirectoryAlive()); + $AllDiffs .= "\n$file"; + copyBinFile("$oldSchemaDir$file", $newSchemaFile); + } + } + else { + &stopServer($root,'slapd-'.$newname) if (isDirectoryAlive()); + $AllDiffs .= "\n$file"; + copyBinFile("$oldSchemaDir$file", $newSchemaFile); + } + } + } + closedir(SCHEMADIR); + if ($AllDiffs) { + printMsg("\n\n***********************************************************************"); + printMsg("\nThe following LDIF files have been migrated:"); + printMsg("$AllDiffs"); + printMsg("\n*************************************************************************\n\n"); + } + &startServer() if (! isDirectoryAlive()); +} + + +################################################################################################### +# This subroutine is used to parse the dse.ldif file and call specific routines to act with entries +sub MigrateDSEldif { + printTrace("\nMigrate DSE entries...",1); + my $tempoAlreadyDone = 0; + open( DSELDIF, "< $oldDSEldif" ) || die "Can't open $oldDSEldif: $!: "; + my $in = new Mozilla::LDAP::LDIF(*DSELDIF) ; + while ($entry = readOneEntry $in) { + $typeOfEntry = getTypeOfEntry($entry); + SWITCH: { + if ($typeOfEntry eq "LDBM_BACKEND_INSTANCE"){ + parseLDBM_backend_instance($entry); + last SWITCH; + } + if ($typeOfEntry eq "MAPPING_TREE"){ + parseMapping_tree($entry); + last SWITCH; + } + if ($typeOfEntry eq "DEFAULT_INDEX"){ + parseDefaultIndex($entry); + last SWITCH; + } + if ($typeOfEntry eq "INDEX"){ + parseIndex($entry); + last SWITCH; + } + if ($typeOfEntry eq "STANDARD_PLUGIN"){ + migrateStdPlugin($entry); + last SWITCH; + } + if ($typeOfEntry eq "CONFIG_NODE"){ + migrateConfig_Node($entry); + last SWITCH; + } + if ($typeOfEntry eq "CONFIG_LDBM_DATABASE"){ + migrateConfig_LDBM_database($entry); + last SWITCH; + } + if ($typeOfEntry eq "CHAINING_BACKEND_CONFIG"){ + migrateChainingBE_config($entry); + last SWITCH; + } + if ($typeOfEntry eq "CHAINING_BACKEND_INSTANCE"){ + migrateChainingBE_instance($entry); + last SWITCH; + } + if ($typeOfEntry eq "NSDS5_REPLICA"){ + parseNSDS5_replica($entry); + last SWITCH; + } + if ($typeOfEntry eq "NSDS_REPLICATION_AGREEMENT"){ + parseNSDS_replication_agreement($entry); + last SWITCH; + } + if ($typeOfEntry eq "CHANGELOG5"){ + migrateChangelog5($entry); + last SWITCH; + } + if ($typeOfEntry eq "REPLICATION"){ + migrateReplication($entry); + last SWITCH; + } + if ($typeOfEntry eq "SECURITY"){ + migrateSecurity($entry); + last SWITCH; + } + if ($typeOfEntry eq "SNMP"){ + migrateSNMP($entry); + last SWITCH; + } + } + + } + close(DSELDIF); +} + +############################################################################# +# returns the "type of an entry". If the entry is not to be migrated its type is "NOT_MIGRATED_TYPE" + +sub getTypeOfEntry{ + my $entry = shift; + my $DN = $entry->getDN(1) ; # 1 is to normalize the returned DN + if (($DN =~ /cn=ldbm database,cn=plugins,cn=config$/i) && (isObjectclass($entry,"nsBackendInstance"))) { + return "LDBM_BACKEND_INSTANCE"; + } + if (($DN =~ /cn=mapping tree,cn=config$/i) && (isObjectclass($entry,"nsMappingTree"))) { + return "MAPPING_TREE"; + } + if (($DN =~ /cn=default indexes,cn=config,cn=ldbm database,cn=plugins,cn=config$/i) && (isObjectclass($entry,"nsIndex"))) { + return "DEFAULT_INDEX"; + } + if (isObjectclass($entry,"nsIndex")) { + return "INDEX"; + } + if ((isObjectclass($entry,"nsSlapdPlugin")) && (isStdPlugin($entry))) { + return "STANDARD_PLUGIN"; + } + if ($DN =~ /^cn=config$/i) { + return "CONFIG_NODE"; + } + if ($DN =~ /^cn=config,cn=ldbm database,cn=plugins,cn=config$/i) { + return "CONFIG_LDBM_DATABASE"; + } + if (($DN =~ /^cn=config,cn=chaining database,cn=plugins,cn=config$/i) || ($DN =~ /^cn=default instance config,cn=chaining database,cn=plugins,cn=config$/i)){ + return "CHAINING_BACKEND_CONFIG"; + } + if (($DN =~ /cn=chaining database,cn=plugins,cn=config$/i) && (isObjectclass($entry,"nsBackendInstance"))) { + return "CHAINING_BACKEND_INSTANCE"; + } + if (isObjectclass($entry,"nsDS5Replica")) { + return "NSDS5_REPLICA"; + } + if (isObjectclass($entry,"nsDS5ReplicationAgreement")) { + return "NSDS_REPLICATION_AGREEMENT"; + } + if ($DN =~ /^cn=changelog5,cn=config$/i) { + return "CHANGELOG5"; + } + if (($DN =~ /cn=replication,cn=config$/i) && ($DN !~ /^cn=replication,cn=config$/i)) { + return "REPLICATION"; + } + if ($DN =~ /cn=encryption,cn=config$/i) { + return "SECURITY"; + } + if ($DN =~ /^cn=SNMP,cn=config$/i) { + return "SNMP"; + } + return "NOT_MIGRATED_TYPE"; +} + +############################################################################# + + + +############################################################################# +# returns 1 if the objectclass given in parameter is present in the objectclasses values of the entry +# given in parameter, 0 else + +sub isObjectclass { + my $entry = shift; + my $objectclass = shift; + return ($entry->hasValue("objectclass",$objectclass,1)); +} + +############################################################################# + +sub isStdPlugin { + my $entry = shift; + my $CN = $entry->{cn}[0]; + if (isObjectclass($entry,"nsSlapdPlugin")) { + return 1 if ($stdPlugins{lc($CN)}); + } + return 0; +} + + +############################################################################# + +sub alreadyExistsInNew{ + my $entry = shift; + my $mustExist = shift; + my $DN = $entry->getDN(1); # 1 to normalize the DN + # We have a name change of "uid uniqueness" plugin in DS6.x + # to "attribute uniqueness" + $DN =~ s/uid\ uniqueness/attribute\ uniqueness/ if ($DN =~ /uid\ uniqueness/); + return searchEntry($DN, $mustExist); +} + +############################################################################# +sub searchEntry { + my $DN = shift; + my $mustExist = shift; + my $res = $conn->search($DN, "base", "objectclass=*"); + my $cpt = 5; + if ($res) { + return $res; + } + else { + my $errorCode = $conn->getErrorCode(); + while (($errorCode eq $LDAP_SERVER_UNREACHABLE) && cpt && (! $res)) { + printMsg("\ntry to reconnect to search $DN"); + $conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Unable to contact the $Version.$Minor LDAP server: $LDAPservername\n"; + $res = $conn->search($DN, "base", "objectclass=*"); + $errorCode = $conn->getErrorCode(); + $cpt--; + } + if ($res){ + return $res ; + } + elsif (($errorCode eq $LDAP_SERVER_UNREACHABLE) || ($mustExist)) { + my $msg = $conn->getErrorString(); + printMsg("\n\n*** Failed to search: $DN"); + printMsg("\n*** Error Msg: $msg, Error code: $errorCode"); + } + return 0; + } +} + + +############################################################################# + +sub addEntryToNew{ + my $entry = shift; + my $typeOfEntry = shift; + my $trace = shift; + my $res = $conn->add($entry); + my $DN = $entry->getDN(1); + my $cpt = 5; + if ($res) { + printTrace("\n$typeOfEntry - Add successfull: $DN",$trace); + return 1; + } + else { + my $errorCode = $conn->getErrorCode(); + while (($errorCode eq $LDAP_SERVER_UNREACHABLE) && cpt && (! $res)) { + printMsg("\ntry to reconnect to add $DN"); + $conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Unable to contact the $Version.$Minor LDAP server: $LDAPservername\n"; + $res = $conn->add($entry); + $errorCode = $conn->getErrorCode(); + $cpt--; + } + if ($res){ + printTrace("\n$typeOfEntry - Add successfull: $DN",$trace); + return 1; + } + else { + my $msg = $conn->getErrorString(); + printMsg("\n\n*** $typeOfEntry: Add Failed: $DN"); + printMsg("\n*** Error Msg: $msg, Error code: $errorCode"); + return 0; + } + } +} + +############################################################################# + +sub updateEntry{ + my $entry = shift; + my $typeOfEntry = shift; + my $CHECK = shift; + my $trace = shift; + my $cpt = 5; + if ($CHECK) { + if (! hasChanged($entry, $typeOfEntry)) { + return 1; + } + } + my $res = $conn->update($entry); + my $DN = $entry->getDN(1); + if ($res) { + printTrace("\n$typeOfEntry - Update successfull: $DN",$trace); + return 1 ; + } + else { + my $errorCode = $conn->getErrorCode(); + while (($errorCode eq $LDAP_SERVER_UNREACHABLE) && cpt && (! $res)) { + printMsg("\ntry to reconnect to update $DN"); + $conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Unable to contact the $Version.$Minor LDAP server: $LDAPservername\n"; + $res = $conn->update($entry); + $errorCode = $conn->getErrorCode(); + $cpt--; + } + if ($res){ + printTrace("\n$typeOfEntry - Update successfull: $DN",$trace); + return 1; + } + else { + my $msg = $conn->getErrorString(); + printMsg("\n\n*** $typeOfEntry - Update Failed: $DN"); + printMsg("\n*** Error Msg: $msg, Error code: $errorCode"); + return 0; + } + } +} + + +############################################################################# +# returns 1 if the entry to migrate and the current entry are different one another + +sub hasChanged { + my $entry = shift; + my $typeOfEntry = shift; + my $DN = $entry->getDN(1); + my $newEntry = searchEntry($DN,1); + return 1 if (! $newEntry); # we shoudn't be in that case ... + # do the stuff to check wether the entry has changed or not given its type + if (($typeOfEntry eq "DEFAULT_INDEX") || ($typeOfEntry eq "INDEX")){ + my @indexTypes = $entry->getValues("nsIndexType"); + my @newIndexTypes = $newEntry->getValues("nsIndexType"); + my @nsmatchingrules = $entry->getValues("nsmatchingrule"); + my @newMatchingRules = $newEntry->getValues("nsmatchingrule"); + return 1 if (Diffs(\@indexTypes, \@newIndexTypes)); + return 1 if (Diffs(\@nsmatchingrules,\@newMatchingRules)); + return 0; + } + if ($typeOfEntry eq "CHANGELOG5"){ + printTrace("\nCheck wether changelog has changed or not",3); + my @params = keys(%changelog5params); + foreach $param (@params){ + my @values = $entry->getValues($param); + my @newValues = $newEntry->getValues($param); + return 1 if (Diffs(\@values,\@newValues)); + } + return 0; + } + if ($typeOfEntry eq "SNMP"){ + foreach $param (@SNMPparams){ + my @values = $entry->getValues($param); + my @newValues = $newEntry->getValues($param); + return 1 if (Diffs(\@values,\@newValues)); + } + return 0; + } + # we don't know how to compare such type of entry => just return 1 + return 1 ; +} + +sub isAsystemIndex { + my $index = shift; + return ($index->hasValue("nsSystemIndex","true",1)); +} + + +sub updatePathInPluginArgs { + my $plugin = shift; + my $argNum = 0; + my $argPrefix = "nsslapd-pluginarg"; + my $cont = 1; + my $Unix_oldDir = ${oldDir} ; + my $Unix_root = ${root} ; + grep { s@\\@/@g } $Unix_oldDir if $isNT; + grep { s@\\@/@g } $Unix_root if $isNT; + while ($cont) { + my $arg = $argPrefix . $argNum ; + if ($plugin->exists($arg)) { + $_ = $plugin->{$arg}[0] ; + s@$Unix_oldDir@$Unix_root@ig ; + s/$type-$oldname/$type-$newname/ig ; + $plugin->setValues($arg, $_) ; + } + else { + $cont = 0 ; + } + $argNum++; + } + return $plugin; +} + + +sub Diffs { + my $valuesToMigrate = shift; + my $currentValues = shift; + return 1 if (getDiff(\@{$valuesToMigrate},\@{$currentValues})); + return 1 if (getDiff(\@{$currentValues},\@{$valuesToMigrate})); + return 0 ; +} + +sub getDiff { + # we get references to arrays + my $elements = shift ; + my $existing_elements = shift ; + my %count = () ; + my %countEE = () ; + @diff = () ; + foreach $e (@{$elements}, @{$existing_elements}) { $count{$e}++ ;} + foreach $e (@{existing_elements}) { $countEE{$e}++ ;} + foreach $e (@{$elements}) { + # if $e is only present in @$elements, we push it to the diff array + if (($count{$e} == 1) && ($countEE{$e} == 0)) { + push @diff, $e ; + } + } + return @diff ; +} + +sub registerSuffix_Backend { + my $ldbmDatabase = shift; + my $CN = $ldbmDatabase->{cn}[0]; + my $suffixArg = "nsslapd-suffix"; + my $suffix = $ldbmDatabase->{$suffixArg}[0]; + $oldBackends{$suffix} = $CN; +} + + +############################################################################# +# # +# # +# # +############################################################################# +sub migrateLDBM_backend_instances { + foreach $entry (@LDBM_backend_instances) { + my $DN = $entry->getDN(1); # 1 is to normalize the DN + my $CN = $entry->{cn}[0]; + my $expLdif; + my $confirm = "No"; + my $dest = "$serverHome${PATHSEP}db_backup" ; + my $newSlapdExecDir = "$root${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server"; + + if ($DN =~/cn=netscaperoot,cn=ldbm database/i){ + printTrace("\n\n*** INFORMATION - NetscapeRoot is NOT migrated",0); + } + else { + if(alreadyExistsInNew($entry)){ + printMsg("\n\n*** LDBM_BACKEND_INSTANCE - $DN already exists"); + printMsg("\n*** Migration will overwrite existing database"); + printMsg("\nDo you want to continue Yes/No [No] ?") ; + my $answer = ; + if ($answer =~ /y|yes/i) { + printMsg("Do you want to export the existing data Yes/No [Yes] ?"); + my $answer = ; + if (!($answer =~ /n|no/i)) { + mkdir $dest, 0700 unless (-d $dest); + $expLdif = "$dest${PATHSEP}$CN.ldif"; + while (!($confirm =~ /y|yes/i)) { + printMsg("\nEnter the full pathname of the file [$expLdif]:") ; + $answer = ; + chomp($expLdif = $answer) unless ($answer eq "\n"); + printMsg("\nExisting data will be exported under $expLdif"); + printMsg("\nContinue Yes/No [No] ?"); + $confirm = ; + } + $ENV{"$LIB_PATH"}=$new_libpath; + chdir($newSlapdExecDir) or die "\nCould not change directory to $newSlapdExecDir: $!\n"; + printTrace("\nNow backing up database $CN in $expLdif\n",0); + &stopServer($root,'slapd-'.$newname); + &db2Ldif($expLdif, $CN, $serverHome); + &startServer() unless (isDirectoryAlive()); + } + push @BACKENDS, $CN; + } else { + printMsg("\n*** Migration will not update it"); + break; + } + } else { + printTrace("\nWe should add the backend instance $DN",3); + my $suffixarg = "nsslapd-suffix" ; + my $suffixname= $entry->{$suffixarg}[0] ; + my $newEntry = $conn->newEntry() ; + $newEntry->setDN($DN); + $newEntry->setValues("objectclass", "top", "extensibleObject", "nsBackendInstance" ); + $newEntry->setValues("cn", $CN ); + $newEntry->setValues($suffixarg, $suffixname); + my @params = keys(%LDBMparamToMigrate); + foreach $param (@params) { + my @values = $entry->getValues($param); + $newEntry->setValues($param, @values) if (@values); + } + if (addEntryToNew($newEntry, "LDBM_BACKEND_INSTANCE",1)) { + push @BACKENDS, $CN; + } + } + } + } +} + +sub parseLDBM_backend_instance { + my $entry = shift; + ®isterSuffix_Backend($entry); + push @LDBM_backend_instances, $entry; +} + +############################################################################# +sub migrateMappingTree { + foreach $entry (@Mapping_tree_entries) { + my $DN = $entry->getDN(1); # 1 si to normalize the DN + if ($DN =~/cn=\"o=netscaperoot\",cn=mapping tree,cn=config/i){ + # DO NOTHING + } + else { + if(alreadyExistsInNew($entry)){ + printMsg("\n\n*** MAPPING_TREE - $DN already exists"); + printMsg("\n*** Migration will not add the suffix"); + } + else { + addEntryToNew($entry, "MAPPING_TREE",1); + } + } + } +} + + +sub parseMapping_tree{ + my $entry = shift; + push @Mapping_tree_entries, $entry; +} + +############################################################################# +sub migrateDefaultIndexes { + foreach $index (@default_indexes) { + my $CN = $index->{cn}[0]; + my $newIndex ; + if ((! isAsystemIndex($index)) && (! $deniedIndexes{lc($CN)})) { + if ($newIndex = alreadyExistsInNew($index)) { + if (! isAsystemIndex($newIndex)) { + updateEntry($index, "DEFAULT_INDEX", 1, 2); + } + } + else { + addEntryToNew($index, "DEFAULT_INDEX", 2); + } + } + } +} + + +sub parseDefaultIndex{ + my $index = shift; + push @default_indexes, $index; +} + +############################################################################# + +sub migrateIndexes { + foreach $index (@indexes) { + my $CN = $index->{cn}[0]; + my $newIndex; + if ((! isAsystemIndex($index)) && (! $deniedIndexes{lc($CN)}) && (DN !~ /cn=netscaperoot,cn=index/i)){ + if ($newIndex = alreadyExistsInNew($index)) { + if (! isAsystemIndex($newIndex)) { + updateEntry($index, "INDEX", 1, 2); + } + } + else { + addEntryToNew($index, "INDEX", 2); + } + } + } +} + +sub parseIndex{ + my $index = shift; + push @indexes, $index; +} + +############################################################################# + +sub newLDIFplugin { + my $currentPlugin = shift; + my $DN = $currentPlugin->getDN(1); + my $newPlugin = $conn->newEntry() ; + $newPlugin->setDN($DN); + foreach $Attr (@pluginAttrs) { + my @values = $currentPlugin->getValues($Attr); + $newPlugin->setValues($Attr, @values) if (@values); + } + return $newPlugin; +} + +sub migrateStdPlugin{ + my $plugin = shift; + my $DN = $plugin->getDN(1); + my $pluginEnable = "nsslapd-pluginEnabled"; + my $argNum = 0; + my $argPrefix = "nsslapd-pluginarg"; + my $currentPlugin ; + if ($currentPlugin = alreadyExistsInNew($plugin, 1)) { + $plugin = updatePathInPluginArgs($plugin); + my $pluginEnableValue = $plugin->{$pluginEnable}[0]; + my $cont = 1; + my $pluginHasChanged = 0; + my $newPlugin = &newLDIFplugin($currentPlugin); + if (! $currentPlugin->hasValue($pluginEnable,$pluginEnableValue,1)){ + $newPlugin->setValues($pluginEnable, $pluginEnableValue); + $pluginHasChanged = 1 unless ($pluginHasChanged); + } + while($cont){ + my $arg = $argPrefix . $argNum ; + if ($plugin->exists($arg)) { + my @values = $plugin->getValues($arg); + my $value = $values[0] ; + $newPlugin->setValues($arg, $value) if (@values); + if ($currentPlugin->exists($arg)) { + if (! $currentPlugin->hasValue($arg,$value,1)) { + $pluginHasChanged = 1 unless ($pluginHasChanged); + } + } + else { + $pluginHasChanged = 1 unless ($pluginHasChanged); + } + } + else { + if ($currentPlugin->exists($arg)) { + # Just Warn the user. Do nothing. + printTrace("\nCompared to the old instance, the current new plugin $DN belongs this attribute: $arg",2); + } + else { + $cont = 0 ; + } + } + $argNum++; + } + updateEntry($newPlugin, "STANDARD_PLUGIN", 0, 1) if ($pluginHasChanged); + } +} + +############################################################################# + +sub migrateConfig_Node{ + my $config_node = shift; + my @params = keys(%GeneralSrvParamToMigrate); + my $hasChanged = 0; + my $newConfigNode; + if ($newConfigNode = alreadyExistsInNew($config_node, 1)){ + foreach $param (@params) { + if ($config_node->exists($param)){ + my @valuesToMigrate = $config_node->getValues($param); + if (@valuesToMigrate){ + if ($newConfigNode->exists($param)){ + my @currentValues = $newConfigNode->getValues($param); + if (Diffs(\@valuesToMigrate, \@currentValues)) { + $newConfigNode->setValues($param, @valuesToMigrate); + $hasChanged = 1 unless ($hasChanged); + printTrace("\nParam to update: $param with value @valuesToMigrate",3); + } + } + else { + $newConfigNode->setValues($param, @valuesToMigrate); + $hasChanged = 1 unless ($hasChanged); + printTrace("\nParam to update: $param with value @valuesToMigrate",3); + } + } + } + } + updateEntry($newConfigNode, "CONFIG_NODE", 0, 1) if ($hasChanged); + } +} + +############################################################################# + +sub migrateConfig_LDBM_database{ + my $config_ldbm = shift; + my @params = keys(%GlobalConfigLDBMparamToMigrate); + my $hasChanged = 0; + my $newConfigLdbm ; + if ($newConfigLdbm = alreadyExistsInNew($config_ldbm, 1)) { + foreach $param (@params) { + if ($config_ldbm->exists($param)){ + my @valuesToMigrate = $config_ldbm->getValues($param); + if (@valuesToMigrate){ + if ($newConfigLdbm->exists($param)){ + my @currentValues = $newConfigLdbm->getValues($param); + if (Diffs(\@valuesToMigrate, \@currentValues)) { + $newConfigLdbm->setValues($param, @valuesToMigrate); + $hasChanged = 1 unless ($hasChanged); + } + } + else { + $newConfigLdbm->setValues($param, @valuesToMigrate); + $hasChanged = 1 unless ($hasChanged); + } + } + } + } + updateEntry($newConfigLdbm, "CONFIG_LDBM_DATABASE", 0, 1) if ($hasChanged); + } +} + +############################################################################# + +sub migrateChainingBE_config{ + my $chaining_config = shift; + my $DN = $chaining_config->getDN(1); + my @params = (); + my $hasChanged = 0; + my $newChainingConfig; + if ($DN =~ /^cn=config,cn=chaining database,cn=plugins,cn=config$/i){ + $newChainingConfig = searchEntry("cn=config,cn=chaining database,cn=plugins,cn=config"); + @params = keys(%ChainingConfigParams); + } + if ($DN =~ /^cn=default instance config,cn=chaining database,cn=plugins,cn=config$/i){ + $newChainingConfig = searchEntry("cn=default instance config,cn=chaining database,cn=plugins,cn=config"); + @params = keys(%ChainingDefaultInstanceConfigParams); + } + foreach $param (@params) { + if ($chaining_config->exists($param)){ + my @valuesToMigrate = $chaining_config->getValues($param); + if (@valuesToMigrate){ + printTrace("\nParam: $param values To migrate: @valuesToMigrate",3); + if ($newChainingConfig->exists($param)){ + my @currentValues = $newChainingConfig->getValues($param); + printTrace("\nParam: $param new current values: @currentValues",3); + if (Diffs(\@valuesToMigrate, \@currentValues)) { + $newChainingConfig->setValues($param, @valuesToMigrate); + $hasChanged = 1 unless ($hasChanged); + } + } + else { + $newChainingConfig->setValues($param, @valuesToMigrate); + $hasChanged = 1 unless ($hasChanged); + } + } + } + } + updateEntry($newChainingConfig, "CHAINING_BACKEND_CONFIG", 0, 1) if ($hasChanged); +} + +############################################################################# + +sub registerSuffix_ChainingBE { + my $ldbmDatabase = shift; + my $CN = $ldbmDatabase->{cn}[0]; + my $suffixArg = "nsslapd-suffix"; + my $suffix = $ldbmDatabase->{$suffixArg}[0]; + $oldChainingBackends{$suffix} = $CN; +} + +sub storeMultiplexorBindDN { + my $chaining_instance = shift; + my $DN = $chaining_instance->getDN(1); + if ($chaining_instance->exists("nsMultiplexorBindDN")){ + my $bindDN = $chaining_instance->{nsMultiplexorBindDN}[0]; + my $newBindDN = searchEntry($bindDN); + if (! $newBindDN){ + # the bindDN entry doesn't yet exist in new => it will have to be migrated + $MultiplexorBindDNEntriesToMigrate{$bindDN}="\n" ; + printTrace("\nThe bindDN: $bindDN need to be migrated",3); + } + else { + # do nothing as the entry already exists in new + } + } + +} + +sub importMultiplexorBindDNEntries { + # import all entries present in @MultiplexorBindDNEntriesToMigrate in new + my @MultiplexorBindDNs = keys (%MultiplexorBindDNEntriesToMigrate); + my $ldif_dir = $ldif_rep; + foreach $bindDN (@MultiplexorBindDNs) { + printTrace("\nimportMultiplexorBindDNEntries: bindDN to migrate: $bindDN",3); + # get the backend in which is stored the bind DN entry + my $backendtoExportFrom = getBackendtoExportFrom($bindDN); + printTrace("\nbackendtoExportFrom is: $backendtoExportFrom",3); + # check wether the backend has been imported in new or not + if (! alreadyMigrated($backendtoExportFrom)) { + if ($backendtoExportFrom ne $NULL) { + # if not imported => we need to import the binf DN entry + &startServer() unless (isDirectoryAlive()); + $conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Unable to contact the $Version.$Minor LDAP server: $LDAPservername\n"; + &ExportAndAddEntry($bindDN, $backendtoExportFrom, $ldif_dir); + } + else { + # do nothing + } + } + } + # remove the empty ldif directory + rmdir($ldif_dir) if (-d $ldif_dir); + # close the LDAP connection to new + $conn->close if ($conn); +} + +sub migrateChainingBE_instance{ + my $chaining_instance = shift; + my $DN = $chaining_instance->getDN(1); + ®isterSuffix_ChainingBE($chaining_instance); + if (alreadyExistsInNew($chaining_instance)) { + # already exists + printMsg("\n\n*** CHAINING_BACKEND_INSTANCE - $DN already exists"); + printMsg("\n*** Migration will not update it"); + } + else { + &migrate_credential($chaining_instance, "nsmultiplexorcredentials"); + addEntryToNew($chaining_instance, "CHAINING_BACKEND_INSTANCE", 1); + storeMultiplexorBindDN($chaining_instance); + } +} + +############################################################################# + +# create a new LDIF representation of a new replica consumer +sub newLDIFreplica { + my $replica = shift; + my $DN = $replica->getDN(1); + my $newReplica = $conn->newEntry() ; + my $MASTER_OR_MULTIMASTER = "3" ; + $newReplica->setDN($DN); + foreach $Attr (@nsds5replicaAttrs) { + my @values = $replica->getValues($Attr); + $newReplica->setValues($Attr, @values) if (@values); + } + my $replicaType = $replica->{nsDS5ReplicaType}[0]; + if ($replicaType eq $MASTER_OR_MULTIMASTER) { + my @nsState = $replica->getValues("nsState"); + # nsState omitted because it is incomatible between 32 and 64 bit + # servers. Bug 624441 + # $newReplica->setValues("nsState", @nsState); + } + else { + $newReplica->setValues("nsDS5ReplicaId", $replicaIdvalue); + } + return $newReplica; +} + +sub MigrateNSDS5_replica{ + foreach $replica (@new6replicas) { + my $DN = $replica->getDN(1); + my $newReplica; + my @removeAttrs = qw(nsstate nsds5replicaname nsds5replicachangecount); + for (@removeAttrs) { + $replica->remove($_); + } + if (alreadyExistsInNew($replica)) { + # replica already exists + printMsg("\n\n*** NSDS5_REPLICA - $DN already exists"); + printMsg("\n*** Migration will not update it"); + } + else { + $newReplica = &newLDIFreplica($replica); + addEntryToNew($newReplica, "NSDS5_REPLICA", 1); + } + storeReplicaBindDN($replica); + } +} + +sub parseNSDS5_replica{ + my $replica = shift; + push @new6replicas, $replica; +} + +sub storeReplicaBindDN { + my $replica = shift; + my $DN = $replica->getDN(1); + if ($replica->exists("nsDS5ReplicaBindDN")){ + my $bindDN = $replica->{nsDS5ReplicaBindDN}[0]; + my $newBindDN = searchEntry($bindDN); + if (! $newBindDN){ + # the bindDN entry doesn't yet exist in new => it will have to be migrated + $ReplicaBindDNEntriesToMigrate{$bindDN}="\n" ; + printTrace("\nThe bindDN: $bindDN need to be migrated",3); + } + else { + # do nothing as the entry already exists in new + } + } +} + + +sub importReplicaBindDNEntries { + # import all entries present in @ReplicaBindDNEntriesToMigrate in new + my @ReplicaBindDNs = keys (%ReplicaBindDNEntriesToMigrate); + my $ldif_dir = $ldif_rep; + my $replBind_entry = ""; + my @bindDN_elements = ""; + my $bindDN_parent = ""; + my $parentBind_entry = ""; + foreach $bindDN (@ReplicaBindDNs) { + printTrace("\nimportReplicaBindDNEntries: bindDN to migrate: $bindDN",3); + # get the backend in which is stored the bind DN entry + my $backendtoExportFrom = getBackendtoExportFrom($bindDN); + printTrace("\nbackendtoExportFrom is: $backendtoExportFrom",3); + # If backend is from config, read the entry from dse.ldif and add to new - NGK + if ($backendtoExportFrom eq "cn=config") { + my $norm_bindDN = normalizeDN($bindDN); + @bindDN_elements = ldap_explode_dn($norm_bindDN, 0); +# @bindDN_elements = split(/,/,$norm_bindDN); + my $junk = shift(@bindDN_elements); + if ($#bindDN_elements >= 1) { + $bindDN_parent = normalizeDN(join(",", @bindDN_elements)); + } + printTrace("\nOpening DSE.ldif",3); + open( DSELDIF, "< $oldDSEldif" ) || die "Can't open $oldDSEldif: $!: "; + my $in = new Mozilla::LDAP::LDIF(*DSELDIF); + while ($entry = readOneEntry $in) { + my $DN = $entry->getDN(1); + if ($DN eq $norm_bindDN) { + $replBind_entry = $entry; + } + if ($bindDN_parent ne "") { + if ($DN eq $bindDN_parent) { + $parentBind_entry = $entry; + } + } + } + close(DSELDIF); + &startServer() unless (isDirectoryAlive()); + $conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Unable to contact the $Version.$Minor LDAP server: $LDAPservername\n"; + if ($bindDN_parent ne "") { + addEntryToNew($parentBind_entry, BINDDN_PARENT, 0); + } + printTrace("\nAdding BindDN with addEntryToNew",3); + addEntryToNew($replBind_entry, BINDDN, 0); + } else { + # check wether the backend has been imported in new or not + if (! alreadyMigrated($backendtoExportFrom)) { + if ($backendtoExportFrom ne $NULL) { + # if not imported => we need to import the bind DN entry + &startServer() unless (isDirectoryAlive()); + $conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Unable to contact the $Version.$Minor LDAP server: $LDAPservername\n"; + &ExportAndAddEntry($bindDN, $backendtoExportFrom, $ldif_dir); + } + else { + # do nothing + } + } + } + } + # remove the empty ldif directory + rmdir($ldif_dir) if (-d $ldif_dir); + # close the LDAP connection to new + $conn->close if ($conn); +} + +sub alreadyMigrated { + my $backendToCheck = shift; + foreach $backend (@BACKENDS) { + return 1 if ($backend eq $backendToCheck); + } + return 0 ; +} + +sub belongsSuffix { + my $suffix = shift; + my $bindDN = shift; + return ($bindDN =~ /$suffix\s*$/i); +} + +sub length { + my $suffix = shift; + my $count = 0; + while ($suffix =~ /./g) { + $count++; + } + return $count ; +} + +sub getBackendtoExportFrom { + my $bindDN = shift ; + my $sizeOfSuffix = 0 ; + my $NULL = ""; + my @oldSuffixes = keys(%oldBackends); + my @oldChainingSuffixes = keys(%oldChainingBackends); + my $bindDN_backend = $NULL; + my $config = "cn=config"; + + my $norm_bindDN = normalizeDN($bindDN); + # Check if bindDN exists in cn=config - NGK + if (belongsSuffix($config,$norm_bindDN)) { + $bindDN_backend = $config; + printTrace("\ngetBackendtoExportFrom: bindDN_backend: $bindDN_backend",3); + } else { + foreach $suffix (@oldSuffixes){ + printTrace("\ngetBackendtoExportFrom: suffix to compare with is: $suffix",3); + if ((belongsSuffix($suffix,$norm_bindDN)) && (length($suffix) > $sizeOfSuffix)) { + $sizeOfSuffix = length($suffix); + $bindDN_backend = $oldBackends{$suffix}; + printTrace("\ngetBackendtoExportFrom: bindDN_backend: $bindDN_backend, sizeOfSuffix: $sizeOfSuffix",3); + } + } + foreach $suffix (@oldChainingSuffixes){ + printTrace("\ngetBackendtoExportFrom: suffix to compare with is a chained suffix: $suffix",3); + if ((belongsSuffix($suffix,$norm_bindDN)) && (length($suffix) > $sizeOfSuffix)) { + printMsg("\n\n*** Entry stored on a remote backend - $norm_bindDN"); + printMsg("\n*** We don't migrate it"); + return $NULL; + } + } + } + return $bindDN_backend; +} + + +sub getBackendtoImportTo { + my $bindDN = shift; + my $sizeOfSuffix = 0; + my $NULL = ""; + my $suffixArg = "nsslapd-suffix"; + my $bindDN_backend = $NULL; + open( DSELDIF, "< $DSEldif" ) || die "Can't open $DSEldif: $!: "; + my $in = new Mozilla::LDAP::LDIF(*DSELDIF) ; + while ($entry = readOneEntry $in) { + $typeOfEntry = getTypeOfEntry($entry); + if ($typeOfEntry eq "LDBM_BACKEND_INSTANCE"){ + my $suffix = $entry->{$suffixArg}[0]; + if ((belongsSuffix($suffix,$bindDN)) && (length($suffix) > $sizeOfSuffix)) { + $sizeOfSuffix = length($suffix); + $bindDN_backend = $entry->{cn}[0]; + } + } + } + close(DSELDIF); + return $bindDN_backend ; +} + + +sub ExportAndAddEntry { + my $DN = shift; + my $backendtoExportFrom = shift; + my $ldif_dir = shift; + my $ldif = "$ldif_dir${PATHSEP}$backendtoExportFrom.ldif" ; + # first: export entry pointed out by the $DN to $ldif file + $ENV{"$LIB_PATH"}=$old_libpath; + if (! $ldif_dir) { $ldif_dir = $ldif_rep ;} + if (!(-d $ldif_dir)) { + mkdir($ldif_dir,0777) or die "\ncan't create $ldif_dir to store temporary ldif files\n"; + } + chdir($oldSlapdExecDir) or die "\nCould not change directory to $oldSlapdExecDir: $!\n"; + &db2Ldif($ldif, $backendtoExportFrom, $oldHome, $DN); + chdir($curdir) or die "\nCould not change directory to $curdir: $!\n"; + + # then: Add it to new + if (! $conn) { + $conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Unable to contact the $Version.$Minor LDAP server: $LDAPservername\n"; + } + open( BINDDNLDIF, "< $ldif" ) || die "\nCan't open $ldif: $!: \n"; + my $in = new Mozilla::LDAP::LDIF(*BINDDNLDIF) ; + while ($entry = readOneEntry $in) { + my $entryDN = $entry->getDN(1); + if ($DN eq $entryDN) { + addEntryToNew($entry, "nsds5ReplicaBindDN", 0); + } + } + close(BINDDNLDIF); + # remove the ldif file after the import + unlink($ldif) ; +} + +############################################################################# +sub MigrateNSDS_replication_agreement { + foreach $replicationAgreement (@replicationAgreements) { + my $DN = $replicationAgreement->getDN(1); + if (alreadyExistsInNew($replicationAgreement)){ + # replication agreement already exists + printMsg("\n\n*** NSDS_REPLICATION_AGREEMENT - $DN already exists"); + printMsg("\n*** Migration will not update it"); + } + else { + &migrate_credential($replicationAgreement, "nsDS5ReplicaCredentials"); + addEntryToNew($replicationAgreement, "NSDS_REPLICATION_AGREEMENT", 1); + } + } +} + + +sub parseNSDS_replication_agreement{ + my $replicationAgreement = shift; + push @replicationAgreements, $replicationAgreement ; +} + +############################################################################# + +sub migrateChangelog5{ + my $changelog = shift; + my $DN = $changelog->getDN(1); + my $changelogdir = "nsslapd-changelogdir"; + if (alreadyExistsInNew($changelog)){ + # cn=changelog5,cn=config already exists in new + my $newChangelog = searchEntry($DN); + my @newChangelogdir = $newChangelog->getValues($changelogdir); + $changelog->setValues($changelogdir, @newChangelogdir); + updateEntry($changelog, "CHANGELOG5", 0, 1); + } + else { + # cn=changelog5,cn=config need to be created in new. + # the changelogdir value must be setup to /slapd-instance/changelogdb + $changelog->setValues($changelogdir,"${serverHome}${PATHSEP}changelogdb"); + addEntryToNew($changelog, "CHANGELOG5", 1); + } +} + + +sub migrateChangelog { + my $oldchangelogdir = ""; + my $newchangelogdir = ""; + my $changelogdir = "nsslapd-changelogdir"; + my $CL5DN = "cn=changelog5,cn=config"; + printTrace("\n\n***** Migrate Changelog...",0,1); + open( DSELDIF, "< $oldDSEldif" ) || die "Can't open $oldDSEldif: $!: "; + my $in = new Mozilla::LDAP::LDIF(*DSELDIF); + while ($entry = readOneEntry $in) { + $typeOfEntry = getTypeOfEntry($entry); + if ($typeOfEntry eq "CHANGELOG5"){ + $oldchangelogdir = ($entry->getValues($changelogdir))[0]; + } + } + close(DSELDIF); + if ($oldchangelogdir) { + # If using olddatadir to migrate from, the path of the changelogdb + # from the dse.ldif may not match the path where the old server + # root was archived. We may need to modify oldchangelogdir so the + # copy of the changelog files succeeds. + unless(-e $oldchangelogdir) { + if($olddatadir) { + my @cldbpath = split(/\//,$oldchangelogdir); + until($cldbpath[0] =~/^slapd-/) { + shift(@cldbpath); + } + my $tmpcldbpath = join(${PATHSEP}, @cldbpath); + $oldchangelogdir = "$oldDir${PATHSEP}$tmpcldbpath"; + } + # If oldchangelogdir still looks to be wrong, prompt for the + # location instead of just failing on the copydir operation + # and bombing out of the migration. + unless(-e $oldchangelogdir) { + print("\n\nThe old changelog directory \"$oldchangelogdir\" doesn't exist. Please enter the correct path: "); + $oldchangelogdir = ; + } + } + &startServer() unless (isDirectoryAlive()); + $conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Unable to contact the $Version.$Minor LDAP server: $LDAPservername\n"; + my $newChangelog = searchEntry($CL5DN); + $newchangelogdir = ($newChangelog->getValues($changelogdir))[0]; + stopServer($root,'slapd-'.$newname); + printTrace("\ncopying $oldchangelogdir${PATHSEP}* to $newchangelogdir",3); + copyDir("$oldchangelogdir","$newchangelogdir"); + + # We need to modify the DBVERSION file for a new verision of the db + open(DBVERSION,">$newchangelogdir${PATHSEP}DBVERSION") || die "Can't overwrite $newchangelogdir${PATHSEP}DBVERSION: $! "; + print DBVERSION "Changelog5/NSMMReplicationPlugin/3.0"; + close(DBVERSION); + + &startServer() unless (isDirectoryAlive()); + } +} + +############################################################################# + +sub migrateReplication{ + my $replication = shift; + my $DN = $replication->getDN(1); + if (alreadyExistsInNew($replication)){ + # replication agreement already exists + printMsg("\n\n*** $DN already exists"); + printMsg("\n*** Migration will not update it"); + } + else { + addEntryToNew($replication, "REPLICATION", 1); + } +} + +############################################################################# + +sub migrateSecurity{ + my $security = shift; + if ($entry->hasValue("objectClass", "nsEncryptionConfig")) { + my $certfile = "alias/slapd-" . $newname . "-cert8.db"; + my $keyfile = "alias/slapd-" . $newname. "-key3.db"; + $entry->setValues("nsCertfile",$certfile) if ! $entry->hasValue("nsCertfile",$certfile); + $entry->setValues("nsKeyfile",$keyfile) if ! $entry->hasValue("nsKeyfile",$keyfile); + } + if (alreadyExistsInNew($security)){ + # already exists in new + updateEntry($security, "SECURITY", 0, 1); + } + else { + addEntryToNew($security, "SECURITY", 1); + } +} + +############################################################################# + +sub migrateSNMP{ + my $snmp = shift; + if (alreadyExistsInNew($snmp)){ + # already exists in new + updateEntry($snmp, "SNMP", 0, 1); + } + else { + addEntryToNew($snmp, "SNMP", 1); + } +} + +############################################################################# +# printMsg print message to the user standard output. + +sub printMsg { + + my $TypeMsg = shift ; + my $Msg = shift ; + my $LineNb = shift ; + if ($LineNb) { + printTrace("Line: $LineNb, $TypeMsg, $Msg"); + } + else { + printTrace("$TypeMsg $Msg"); + } +} + +############################################################################# +# print message error to the user standard output. + +sub printTrace { + + my $Msg = shift ; + my $level = shift ; + my $sep = shift ; + + if ($sep) { + print "\n-------------------------------------------------------------------------"; + print LOGFILE "\n-------------------------------------------------------------------------"; + } + + if ($level <= $TRACELEVEL) { + print($Msg); + print LOGFILE $Msg ; + } +} + +############################################################################# +# this subroutine implements a very stupid version of diff + +sub diff { + my $f1 = shift; + my $f2 = shift; + my $lineToBeginWith = shift; + my $NULL = "" ; + my $diff_f1 = $NULL ; + my $diff_f2 = $NULL ; + my $retval = $NULL ; + my $ret; + open(F1, "$f1") or die "Could not open file $f1"; + open(F2, "$f2") or close(F1), die "Could not open file $f2"; + + while (defined($l1 = )) { + if ($lineToBeginWith){ + $lineToBeginWith -- ; + next ; + } + next if ($l1 =~ /^\#/); + $ret = defined($l2 = ); + if ($ret) { + $ret = defined($l2 = ) while ($ret && ($l2 =~ /^\#/)) ; + if ($ret) { + if (!($l1 eq $l2)) { + + # ignore whitespace + $l1_clean = $l1 ; + $l2_clean = $l2 ; + $l1_clean =~ s/\s//g; + $l2_clean =~ s/\s//g; + + if (!($l1_clean eq $l2_clean)) { + $diff_f1 .= "${l1}" unless ($l1_clean eq $NULL); + $diff_f2 .= "${l2}" unless ($l2_clean eq $NULL); + } + } + } + else { + next if ($l1 =~ /^\s*$/) ; + $diff_f1 .= "${l1}"; + } + } + else { + next if ($l1 =~ /^\s*$/) ; + $diff_f1 .= "${l1}"; + } + } + + while (defined($l2 = )) { + if (($l2 =~ /^\#/) || ($l2 =~ /^\s*$/)) { + next ; + } + else { + $diff_f2 .= "${l2}" ; + } + } + + close(F1); + close(F2); + + $retval .= "- differences present in your config file but not in standard file:\n\n". "$diff_f1\n" if ($diff_f1) ; + $retval .= "- differences present in standard file but not in your config file:\n\n" . "$diff_f2" if ($diff_f2) ; + return $retval ; +} + +sub CompareStdConfigFiles { + # Compare each configuration file against its default version. If it has changed, + # notify the user that the file has changed and will need to be checked by the + # user. This should be safe to do because there should be no path information + # stored in these conf files, which are just schema stuff. + # printTrace("\nCheck if standard configuration files have changed",3); + + # get the version of the DS to migrate + ($oldVersion, $oldMinor) = &getVersion($oldDir, $oldversionstr); + # get the version of the new DS + ($Version, $Minor) = &getVersion($root); + + # get old LIB_PATH + $old_libpath = &getLibPath($oldDir, $oldVersion, $oldMinor); + # get new LIB_PATH + $new_libpath = &getLibPath($root, $Version, $Minor); + + my $origFilePath = "$oldDir${PATHSEP}bin${PATHSEP}slapd${PATHSEP}install${PATHSEP}schema${PATHSEP}" ; + my $FilesChanged = ""; + my $AllDiffs = "***********************************************************************"; + my $NoChanges = "" ; + my $lineToBegin = 0 ; + opendir(CONFDIR, $oldSchemaDir) or + die "Error: could not open migrated config dir $oldConfDir: $!"; + + foreach $file (readdir(CONFDIR)) { + $origFile = $origFilePath . $file ; + $configFile = $oldSchemaDir . $file ; + if (( exists($stdIncludes{lc($file)})) && (-f $origFile)) { + $diffs = &diff($configFile, $origFile, $lineToBegin); + $lineToBegin = 0 if $lineToBegin ; + if ($diffs) { + $FilesChanged .= "\n$configFile"; + $AllDiffs .= "\n$configFile is different than the standard configuration file" ; + $AllDiffs .= "\nYou will need to check this file and make sure its changes are compatible "; + $AllDiffs .= "with the new directory server\nHere are the differences:\n"; + $AllDiffs .= "$diffs \n\n"; + $AllDiffs .= "***********************************************************************"; + } + else { + $NoChanges .= "\n$configFile"; + } + } + } + closedir(CONFDIR); + +if ($FilesChanged) { + printTrace("\nNo changes to old configuration files:$NoChanges",3) ; + printTrace("\n***********************************************************************",3) ; + printMsg("\nThe following standard files have been modified: $FilesChanged"); + if ($NO_INPUT_USER) { + # do nothing + } + else { + printMsg("\nDo you want to see the differences Yes/No [No] ?") ; + my $answer = ; + if ($answer =~ /y|yes/i) { + printMsg("$AllDiffs"); + } + printMsg("\nDo you want to continue the migration Yes/No [No] ?"); + $answer = ; + if (! ($answer =~ /y|yes/i)) { + exit(1); + } + } + } +} + + + +############################################################################# + +# this is used to run the system() call, capture exit and signal codes, +# and die() upon badness; the first argument is a directory to change +# dir to, if any, and the rest are passed to system() +sub mySystem { + my $rc = &mySystemNoDie(@_); + my ($dir, @args) = @_; + if ($rc == 0) { +# success + } elsif ($rc == 0xff00) { + die "Error executing @args: error code $rc: $!"; + } elsif ($rc > 0x80) { + $rc >>= 8; + die "Error executing @args: error code $rc: $!"; + } else { + if ($rc & 0x80) { + $rc &= ~0x80; + } + die "Error executing @args: received signal $rc: $!"; + } + + # usually won't get return value + return $rc; +} + +# This version does not die but just returns the error code +sub mySystemNoDie { + my ($dir, @args) = @_; + if ($dir && ($dir ne "")) { + chdir($dir) or die "Could not change directory to $dir: $!"; + } + my $cmd = $args[0]; + # the system {$cmd} avoids some NT shell quoting problems if the $cmd + # needs to be quoted e.g. contains spaces; the map puts double quotes + # around the arguments on NT which are stripped by the command + # interpreter cmd.exe; but don't quote things which are already quoted + my @fixargs = map { /^[\"].*[\"]$/ ? $_ : $quote . $_ . $quote } @args; + my $rc = 0; + if ($cmd =~ /[.](bat|cmd)$/) { + # we have to pass batch files directly to the NT command interpreter + $cmd = $com_spec; +# print "system $cmd /c \"@fixargs\"\n"; + $rc = 0xffff & system {$cmd} '/c', "\"@fixargs\""; + } else { +# print "system $cmd @fixargs\n"; + $rc = 0xffff & system {$cmd} @fixargs; + } + chdir(${curdir}) or die "Could not change directory to $curdir: $!"; + return $rc; +} + +########################################################################################### +# # +# Export/Import of the backends in @BACKENDS # +# # +########################################################################################### + +sub manydb2Ldif { + my $ldif_dir = shift; + $ENV{"$LIB_PATH"}=$old_libpath; + if (! $ldif_dir) { $ldif_dir = $ldif_rep ;} + if (!(-d $ldif_dir)) { + mkdir($ldif_dir,0777) or die "can't create $ldif_dir to store temporary ldif files"; + } + chdir($oldSlapdExecDir) or die "Could not change directory to $oldSlapdExecDir: $!"; + foreach $backend (@BACKENDS) { + my $ldif = "${ldif_dir}$backend.ldif" ; + &db2Ldif($ldif, $backend, $oldHome); + } + print " Done.\n"; + chdir($curdir) or die "Could not change directory to $curdir: $!"; +} + +sub db2Ldif { + my $ldif = shift ; + my $backend = shift ; + my $home = shift ; + my $include_suffix = shift ; + my $db2ldif_param ; + if ($include_suffix) { + $db2ldif_param = "db2ldif -r -D $home -n $backend -a $ldif -s \"$include_suffix\""; + } + else { + $db2ldif_param = "db2ldif -r -D $home -n $backend -a $ldif"; + } + open(DB2LDIF, "${quote}${quote}$slapdExecName${quote} $db2ldif_param${quote} 2>&1 |") or die "Could not run ns-slapd program $ldif2db_exe\n"; + sleep(1); # allow some data to accumulate in the pipe + my $ii = 0; + while () { + ++$ii; + if (($ii % 250) == 0) { + printMsg(" Processing...\n"); + } + printMsg($_); + } + close(DB2LDIF); + # set the ownership of the ldif file; should be the same as the 6.x slapd user id + if ((! $isNt) && ($oldlocaluser ne $localuser)) { + if (-f $ldif) { + chown( $newuid, $newgid, $ldif) or printMsg("\nUnable to change the ownership of $ldif to $localuser") ; + } + } +} + +sub manyLdif2db { + my $ldif_dir = shift; + $ENV{"$LIB_PATH"}=$new_libpath; + chdir($slapdExecDir) or die "Could not change directory to $slapdExecDir: $!"; + foreach $backend (@BACKENDS) { + my $ldif = "${ldif_dir}$backend.ldif" ; + &Ldif2db($ldif, $backend); + } + # remove the empty ldif directory + # but not if using the data dir + if (!$olddatadir) { + rmdir($ldif_dir); + } + chdir($curdir) or die "Could not change directory to $curdir: $!"; +} + + +sub Ldif2db { + my $ldif = shift ; + my $backend = shift ; + my $ldif2db_param = "ldif2db -D $serverHome -n $backend -i $ldif"; + open(LDIF2DB, "${quote}${quote}$slapdExecName${quote} $ldif2db_param${quote} 2>&1 |") or die "Could not run ns-slapd program $ldif2db_exe\n"; + sleep(1); # allow some data to accumulate in the pipe + while () { + printMsg($_); + } + close(LDIF2DB); + # remove the ldif file after the import + # but not if using the data dir + if (!$olddatadir) { + unlink($ldif) ; + } +} + + +########################################################################################### +# # +# Running/Stopping the Server # +# # +########################################################################################### + + + +sub isDirectoryAlive { + die "\n Migration aborted. Make sure your old and new Directory Servers are installed on the same machine \n" if ( $LDAPservername == -1 ); + my $test_conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd); + if ($test_conn) { + $test_conn->close(); + return 1; + } + else { + return 0 ; + } +} + + +sub startServer { + my $instanceDir = ${serverHome} ; + my $errLog = $instanceDir . $PATHSEP . 'logs' . $PATHSEP . 'errors'; + # emulate tail -f + # if the last line we see does not contain "slapd started", try again + my $done = 0; + my $started = 0; + my $code = 0; + my $lastLine = ""; + my $timeout = time + 240; # 4 minutes + $ENV{"$LIB_PATH"}=$new_libpath; + + my $startCmd = $instanceDir . $PATHSEP . 'start' . $script_suffix; + if (! -f $startCmd) { + $startCmd = $instanceDir . $PATHSEP . 'start-slapd' . $script_suffix; + } + $code = &mySystem($instanceDir,$startCmd); + open(IN, $errLog) or die "Could not open error log $errLog: $!"; + my $pos = tell(IN); + while (($done == 0) && (time < $timeout)) { + for (; ($done == 0) && ($_ = ); $pos = tell(IN)) { + $lastLine = $_; + # print; + # the server has already been started and shutdown once . . . + if (/slapd started\./) { + $started++; + if ($started == 2) { + $done = 1; + } + # sometimes the server will fail to come up; in that case, restart it + } elsif (/Initialization Failed/) { + # print "Server failed to start: $_"; + $code = &mySystem($instanceDir, $startCmd); + # sometimes the server will fail to come up; in that case, restart it + } elsif (/exiting\./) { + # print "Server failed to start: $_"; + #$code = &mySystem($startCmd); + $code = &mySystem($instanceDir, $startCmd); + } + } + if ($lastLine =~ /PR_Bind/) { + # server port conflicts with another one, just report and punt + print $lastLine; + print "This server cannot be started until the other server on this\n"; + print "port is shutdown.\n"; + $done = 1; + } + if ($done == 0) { + # rest a bit, then . . . + sleep(2); + # . . . reset the EOF status of the file desc + seek(IN, $pos, 0); + } + } + close(IN); + + sleep(5); + die "\nUnable to start the $Version.$Minor Directory Server\n" unless (isDirectoryAlive()); + + return 0; +} + +sub stopServer { + my $root = shift; + my $name = shift; + $maxStopIterations = 5; + print "\nShutting down server $name . . .\n"; + $ENV{"$LIB_PATH"}=$new_libpath; + $stopCmd = $quote . $root . $PATHSEP . $name . $PATHSEP . 'stop' . $script_suffix . $quote; + if (! -f $stopCmd) { + $stopCmd = $quote . $root . $PATHSEP . $name . $PATHSEP . 'stop-slapd' . $script_suffix . $quote; + } + + if (! -f $stopCmd) { + # no stop command, probably a 1.X system; for NT, we'll try net stop + # for unix, we'll get the pid and kill it + if ($isNT) { + $stopCmd = 'net stop ' . $name; + } else { + # see if there is a pid file + $pidfile = $root . $PATHSEP . $name . $PATHSEP . 'logs' . + $PATHSEP . 'pid'; + if (open(PIDFILE, $pidfile)) { + chomp($pid = ); + close(PIDFILE); + while ($maxStopIterations-- && !$exitCode) { + $exitCode = kill(15, $pid); + } + $stopCmd = undef; + } + } + } + + # keep looping until the stop cmd returns an error code, which usually + # means that what ever we want to stop is stopped, or some other error + # occurred e.g. permission, or no such service + $exitCode = &runAndIgnoreOutput($stopCmd); +# print "stopServer: exitCode=$exitCode\n"; + while ($stopCmd && $maxStopIterations-- && $exitCode) { + $exitCode = &runAndIgnoreOutput($stopCmd); +# print "stopServer: exitCode=$exitCode\n"; + } + + if (!$maxStopIterations) { + print "Warning: could not shutdown the server: $!\n"; + } + sleep(10) ; + $exitCode = 0; +} + + +sub runAndIgnoreOutput { + my $cmd = shift; + printMsg("."); + open(RUNCMD, "${quote}$cmd${quote} 2>&1 |") or die "Error: could not run $cmd: $!"; + printMsg("."); + sleep(1); # allow pipe to fill with data + printMsg("."); + while () { +# print; + } + my $code = close(RUNCMD); +# print "runAndIgnore: code=$code status=$?\n"; + return $?; +} + +############################################################################# +# migrate SSL info + +sub MigrateSSL { + my $secPwd = 'bidon' ; + # copy the SSL directory + ©Dir("$oldHome${PATHSEP}ssl","$serverHome${PATHSEP}ssl") if (-d "$oldHome${PATHSEP}ssl"); + # copy the cert db and key files + if ( -d "$oldDir${PATHSEP}alias") { + $aliasDir = "$root${PATHSEP}alias"; + if (! -d $aliasDir) { + mkdir($aliasDir, 0750); + } + &stopServer($root,'slapd-'.$newname); + my $keydb = "$aliasDir${PATHSEP}slapd-$newname-key3.db" ; + my $certdb = "$aliasDir${PATHSEP}slapd-$newname-cert8.db" ; + my $certdb7 = "$aliasDir${PATHSEP}slapd-$newname-cert7.db" ; + my $old_keydb = "$oldDir${PATHSEP}alias${PATHSEP}slapd-$oldname-key3.db" ; + my $old_certdb = "$oldDir${PATHSEP}alias${PATHSEP}slapd-$oldname-cert7.db"; + my $keydb_backup = "$aliasDir${PATHSEP}slapd-$newname-key3.db_backup" ; + my $certdb_backup = "$aliasDir${PATHSEP}slapd-$newname-cert7.db_backup" ; + if (-f $old_keydb) { + if (-f $keydb) { + if ($NO_INPUT_USER) { + printMsg("\n$keydb already exists. backup in $keydb_backup ..."); + ©BinFile($keydb,$keydb_backup); + ©BinFile($old_keydb,$keydb); + } + else { + print("\n\n$keydb already exists. Do you want to overwrite it ? [no]: "); + my $answer = ; + if ($answer =~ /^y|yes$/i) { + ©BinFile($old_keydb,$keydb); + } + } + } + else { + ©BinFile($old_keydb,$keydb); + } + } + if (-f $old_certdb) { + $mode = (stat($old_certdb))[2] if $PRESERVE; + if (-f $certdb) { + if ($NO_INPUT_USER) { + printMsg("\n$certdb already exists. backup in $certdb_backup ..."); + ©BinFile($certdb,$certdb_backup); + unlink($certdb) || print "Couldn't delete $certdb : $!\n"; + ©BinFile($old_certdb,$certdb7); + } + else { + print("\n\n$certdb already exists. Do you want to overwrite it ? [no]: "); + my $answer = ; + if ($answer =~ /^y|yes$/i) { + unlink($certdb) || print "Couldn't delete $certdb : $!\n"; + ©BinFile($old_certdb,$certdb7); + } + } + } + else { + ©BinFile($old_certdb,$certdb7); + } + } + # copy the old password file + if (-f "$oldDir${PATHSEP}alias${PATHSEP}$type-$oldname-pin.txt") { + ©BinFile( + "$oldDir${PATHSEP}alias${PATHSEP}$type-$oldname-pin.txt", + "$aliasDir${PATHSEP}$type-$newname-pin.txt" + ); + } + &startServer(); + if ($PRESERVE) { + chown($newuid,$newgid,$certdb) || print "Failed to set uid $newuid gid $newgid on $certdb : $!\n"; + chmod($mode,$certdb) || print "Failed to set mode $mode on $certdb : $!\n"; + } + } + +} + +sub DisableSSL { + my $entry = $conn->search("cn=config","base","objectclass=*"); + my $LDAPparam = "nsslapd-security" ; + my $Value = "off" ; + if ($entry->{$LDAPparam}[0] ne $Value) { + printTrace("\nDisable SSL...",1); + $entry->setValues($LDAPparam, $Value); + } + my $res = $conn->update($entry); + if ($res) { + printTrace("\nSSL disabled",2); + } + else { + printMsg("\nCan't disabled SSL. The server may have problems to start"); + } +} + +# enable the migration of client authentication informations +sub MigrateCertmap { + # backup the old certmap.conf and replace it with the new one + my $oldCertmap = "$oldDir${PATHSEP}shared${PATHSEP}config${PATHSEP}certmap.conf"; + my $newCertmap = "$root${PATHSEP}shared${PATHSEP}config${PATHSEP}certmap.conf" ; + my $backupCertmap = "$root${PATHSEP}shared${PATHSEP}config${PATHSEP}certmap.conf_backup" ; + if (-f $oldCertmap) { + if ($NO_INPUT_USER) { + printMsg("\n$newCertmap has been backup in $backupCertmap"); + ©BinFile($newCertmap,$backupCertmap); + ©BinFile($oldCertmap,$newCertmap); + } + else { + my $Ask = 1 ; + while ($Ask) { + printMsg("\n\nWhere do you want to back up the file $newCertmap [$backupCertmap] ?") ; + my $Answer = ; + $backupCertmap = $Answer if ($Answer ne "\n"); + chomp($backupCertmap); + printTrace("\nDest: .$backupCertmap.",4); + if (-e $backupCertmap) { + printMsg("\n\n$backupCertmap already exists. Do you want to overwrite it Yes/No [No] ?") ; + if ( =~ /yes|y/i) { + $Ask = 0 ; + } + else { + $backupCertmap = "$root${PATHSEP}shared${PATHSEP}config${PATHSEP}certmap.conf_backup" ; + } + } + else { + $Ask = 0 ; + } + } + printTrace("\nBackup file: $newCertmap in $backupCertmap",4); + ©BinFile($newCertmap,$backupCertmap); + ©BinFile($oldCertmap,$newCertmap); + } + } + else { + } +} + +sub hasChangedoldCertmap { + my $certmapfile = shift ; + my @reference = ("certmap default default", + "default:DNComps", + "default:FilterComps e") ; + my $cpt = 0 ; + printTrace("\nhasChangedoldCertmap",3); + open(CERTMAP,"< $certmapfile"); + while () { + if ((! /^\s*#/) && (! /^\s*$/)) { + my $ref = $reference[$cpt] ; + printTrace("\nValue: $_, ref: $ref",4); + if (! /^\s*$ref\s*$/) { + return 1 ; + } + else { + $cpt++ ; + } + } + } + close (CERTMAP); + printTrace("\ncpt: $cpt",4); + if ($cpt < $#reference) { + return 1 ; + } + else { + return 0 ; + } +} + + +########################################################################################### +# # +# Copy directory and files functions # +# # +########################################################################################### + + +sub copyDir { + my $src = shift; + my $dest = shift; + my $exclude = shift; + + opendir( SRC, $src ) or die "Can't open directory $src: $!: "; + my $mode; + my $uid; + my $gid; + mkdir ( $dest , 0755 ) or die "\nCan't create directory $dest. \nPlease check you have enough rights to create it and/or check that your parent directory exists.\n" if !( -e $dest ); + if ($PRESERVE) { + $mode = (stat($src))[2]; + ($uid, $gid) = (stat(_))[4..5]; + # Make sure files owned by the old user are owned by the + # new user + if ($uid == $olduid) { + $uid = $newuid; + $gid = $newgid; + } + chown $uid, $gid, $dest; + chmod $mode, $dest; + } + local ( @files ) = readdir ( SRC ); + closedir( SRC ); + for ( @files ) { + if ( $_ eq "." || $_ eq ".." ) { + next; + } elsif ( $exclude && /$exclude/ ) { + next; + } elsif ( $_ =~ /^__/ ) { + # region files are incompatible between 32 + # and 64 bit servers + next; + } elsif( -d "$src${PATHSEP}$_") { + ©Dir ( "$src${PATHSEP}$_", "$dest${PATHSEP}$_" ); + } else { + ©BinFile ( "$src${PATHSEP}$_", "$dest${PATHSEP}$_"); + } + } +} + +sub copyBinFile { + my $src = shift; + my $dest = shift; + my $buf = ""; + my $bufsize = 8192; + + open( SRC, $src ) || die "Can't open $src: $!\n"; + # if we are given a directory destination instead of a file, extract the + # filename portion of the source to use as the destination filename + if (-d $dest) { + $dest = $dest . $PATHSEP . &basename($src); + } + open( DEST, ">$dest" ) || die "Can't create $dest: $!\n"; + binmode SRC; + binmode DEST; + if ($PRESERVE) { + $mode = (stat($src))[2]; + ($uid, $gid) = (stat(_))[4..5]; + # Make sure files owned by the old user are owned by the + # new user + if ($uid == $olduid) { + $uid = $newuid; + $gid = $newgid; + } + chown $uid, $gid, $dest; + chmod $mode, $dest; + } + while (read(SRC, $buf, $bufsize)) { + print DEST $buf; + } + close( SRC ); + close( DEST ); +} + +############################################################################################################# +# backup 6.x configuration files # +# backup the directory /slapd-instance/config dans /slapd-instance/BackupConfig # # +# # +############################################################################################################# + + +sub backupConfigFiles { + # backup the 6.x config files + my $src = "$serverHome${PATHSEP}config" ; + my $dest = "$serverHome${PATHSEP}config_backup" ; + if ($NO_INPUT_USER) { + printMsg("\n$src has been backup in $dest"); + ©Dir($src,$dest); + } + else { + my $Ask = 1 ; + while ($Ask) { + printMsg("\n\nWhere do you want to back up your configuration directory [$dest] ?") ; + my $Answer = ; + $dest = $Answer if ($Answer ne "\n"); + chomp($dest); + printTrace("\nDest: .$dest.",4); + if (-e $dest) { + printMsg("\n\n$dest already exists. Do you want to overwrite it Yes/No [No] ?") ; + if ( =~ /yes|y/i) { + $Ask = 0 ; + } + else { + $dest = "$serverHome${PATHSEP}config_backup" ; + } + } + else { + $Ask = 0 ; + } + } + printTrace("\nBackup Directory: $src in $dest",4); + ©Dir($src,$dest); + } +} +############################################################################# + +sub getLDAPservername { + my $oldLDAPservername; + my $LDAPservername; + my $localhost = "nsslapd-localhost"; + open(OLDDSELDIF, "< $oldDSEldif") or die "\nError: could not open old config file $oldDSEldif \n"; + my $in = new Mozilla::LDAP::LDIF(*OLDDSELDIF) ; + while ($entry = readOneEntry $in) { + my $DN = $entry->getDN(1) ; + if ($DN =~ /^cn=config$/i) { + my @values = $entry->getValues($localhost); + if ($entry->size($localhost)) { + $oldLDAPservername = $values[0]; + printTrace("\nName of the old LDAP server: $oldLDAPservername",3); + } + break; + } + } + close(OLDSELDIF); + + open( DSELDIF, "< $DSEldif" ) || die "\nCan't open $DSEldif \n"; + my $in = new Mozilla::LDAP::LDIF(*DSELDIF) ; + while ($entry = readOneEntry $in) { + my $DN = $entry->getDN(1) ; + if ($DN =~ /^cn=config$/i) { + my @values = $entry->getValues($localhost); + if ($entry->size($localhost)) { + $LDAPservername = $values[0]; + printTrace("\nName of the new LDAP server: $LDAPservername",3); + } + break; + } + } + close(DSELDIF); + # check ol and new Directory Instance are installed on the same physical machine. + if (lc($oldLDAPservername) ne lc($LDAPservername)) { + # warn the user he tries to migrate a 4.x server installed on a different machine from the 6.x one + printMsg("\n\nYour old instance is on $oldLDAPservername, whereas your new instance is on $LDAPservername. Migration on different machines is not supported. Do you want to continue ? Yes/No [No]:") ; + if (! ( =~ /yes|y/i)) { + return -1; + } + } + return $LDAPservername ; +} + +############################################################################# + +sub getLibPath { + my $myDir = shift; + my $myVersion = shift; + my $myMinor = shift; + + if ($isNT) { + return $ENV{"$LIB_PATH"}; + } + if (($myVersion >= 6) && ($myMinor >= 2)) { + return + "$myDir${PATHSEP}bin${PATHSEP}slapd${PATHSEP}lib${SEP}". + "$myDir${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${SEP}". + $ENV{"$LIB_PATH"}; + } else { + return "$myDir${PATHSEP}lib${SEP}".$ENV{"$LIB_PATH"}; + } +} + +############################################################################# + +sub getVersion { + my $dir = shift; + my $versionstr = shift; + my $version = 0; + my $minor = 0; + my $buildNumber = 0; + my $progDir = "${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${PATHSEP}"; + my $progDir2 = "${PATHSEP}bin${PATHSEP}slapd${PATHSEP}"; + + # find the slapd executable + if (!$versionstr) { # version not specified on cmd line - find it + $prog = $dir . $progDir . $slapdExecName; + if (! -f $prog) { + $prog = $dir . $progDir2 . $slapdExecName; + if (-f $prog && $isNT) { + # if slapd is in bin/slapd and we're on NT, just assume version 1; + # apparently, slapd.exe doesn't like the -v argument . . . + return ( '1', $minor ); + } + else{ + die "Could not run slapd program $prog: $!"; + } + } + else { + chdir($dir . $progDir); + } + $cur_libpath=$ENV{"$LIB_PATH"}; + $ENV{"$LIB_PATH"}= + "$dir${PATHSEP}lib${SEP}". + "$dir${PATHSEP}bin${PATHSEP}slapd${PATHSEP}lib${SEP}". + "$dir${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${SEP}". + $ENV{"$LIB_PATH"}; + # read the old version from the old slapd program + + open(F, "${quote}${quote}$prog${quote} -v${quote} 2>&1 |") or + die "Could not run slapd program $prog: $!"; + sleep(1); # allow some data to accumulate in the pipe +# print "Output from $prog -v:\n"; + while () { + if (/^Netscape-Directory/ || /^iPlanet-Directory/i) { + $versionstr = $_; + last; + } + } + $code = close(F); + # print "$prog returned code=$code status=$?\n"; + $ENV{"$LIB_PATH"}=$cur_libpath; + } + + if ($versionstr =~ /^Netscape-Directory\/(\d+)\.(\d+)(?:b\d)*\s+(\S+)/) { + $version = $1; + $minor = $2; + $buildNumber = $3; + } + elsif ($versionstr =~ /^Netscape-Directory\(restrict?ed-mode\)\/(\d+)\.(\d+)\s+(\S+)/) { # we can have restricted-mode or restriced-mode ... + $version = $1; + $minor = $2; + $buildNumber = $3; + } + elsif ($versionstr =~ /^iPlanet-Directory\/(\d+)\.(\d+)\s+(\S+)/i) { + $version = $1; + $minor = $2; + $buildNumber = $3; + } elsif ($versionstr =~ /(\d+)\.(\d+)/) { + $version = $1; + $minor = $2; + } + + if ($version == 0) { + die "\nCould not determine version of the directory server in $dir: \n"; + } + + # distinguish the 4.1 and the 4.11 thanks to the buildNumber + if (($version == 4) && ($minor == 1)){ + if (! ($buildNumber =~ /^B99\.16/)) { + # it's not a 4.1 Netscape Directory Server => it's a 4.11 + $minor = 11 ; + } + } + chdir($curdir) or die "Could not change directory to $curdir: $!" ; + return ( $version, $minor ); +} + +############################################################################################### +sub normalizeDir { + my $dir = shift ; + my $dir_prec = "" ; + while ($dir_prec ne $dir) { + $dir_prec = $dir ; + if ($isNT) { + grep { s@\\\\@\\@g } $dir ; + } + else { + grep { s@//@/@g } $dir ; + } + } + return $dir ; +} + + +############################################################################################### + +sub GetTime { + my $tm = localtime; + (my $sec, my $min, my $hour, my $dd, my $mm, my $yy) = ($tm->sec, $tm->min, $tm->hour, $tm->mday, ($tm->mon)+1, ($tm->year)+1900); + $sec = "0$sec" unless $sec > 9 ; + $min = "0$min" unless $min > 9 ; + $hour = "0$hour" unless $hour > 9 ; + $dd = "0$dd" unless $dd > 9 ; + $mm = "0$mm" unless $mm > 9 ; + return ($sec, $min, $hour, $dd, $mm, $yy); +} + +############################################################################################### +# get uid and group id of the 6.x slapd server. +# The uid is done through the nsslapd-localuser attribute + +sub getuid_gid { + my $newuid ; + my $newgid ; + my $localuser ; + my $localuser_attr = "nsslapd-localuser" ; + if (! $isNT) { + &startServer() unless (isDirectoryAlive()); + my $conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Can't contact the $Version.$Minor LDAP server: $LDAPservername\n"; + my $entry = $conn->search("cn=config ", "base","objectclass=*", 0, ($localuser_attr)) ; + # Tests wether we succeed to get the entry cn=config + die "\nCan't get the entry cn=config \n" unless ($entry); + my @values = $entry->getValues($localuser_attr); + $conn->close(); + if ($#values == -1 || ($values[0] eq "") ) { # tests wether the nsslapd-localuser attribute has a value + printMsg("\nNo localuser has been found in the configuration of the directory. "); + if ($NO_INPUT_USER) { + printMsg("\nWe considered nobody as the localuser"); + $localuser = "nobody" ; + } + else { + my $Ask = 1 ; + while ($Ask) { + printMsg("\nUnder what user does your $Version.$Minor directory server run [nobody] ? ") ; + $localuser = ; + chomp($localuser); + $localuser = "nobody" if ($localuser eq ""); + ($newuid, $newgid) = (getpwnam("$localuser"))[2..3] ; + if ($newuid) { + $Ask = 0 ; + } + else { + printMsg("\nError: $localuser is unknown from the system "); + } + } + } + } + else { + $localuser = $values[0]; # returns the first value (we should only have one localuser) + my $size = $#values ; + } + ($newuid, $newgid) = (getpwnam("$localuser"))[2..3] ; + return ($localuser, $newuid, $newgid) ; + } + else { + return () ; + } +} + +sub getolduid_gid { + my $oldlocaluser ; + my $localuserAttr = "nsslapd-localuser"; + my $entry ; + if (! $isNT) { + open( DSELDIF, "< $oldDSEldif" ) || die "Can't open $oldDSEldif: $!: "; + my $in = new Mozilla::LDAP::LDIF(*DSELDIF) ; + while ($entry = readOneEntry $in) { + $typeOfEntry = getTypeOfEntry($entry); + if ($typeOfEntry eq "CONFIG_NODE") { + $oldlocaluser = $entry->{$localuserAttr}[0] if ($entry->exists($localuserAttr)); + break ; + } + } + close(DSE); + ($olduid, $oldgid) = (getpwnam("$oldlocaluser"))[2..3] ; + return ($oldlocaluser, $olduid, $oldgid) ; + } + else { + return (); + } +} +############################################################################################### +# get current directory + +sub getCwd { + my $command = $isNT ? "cd" : "/bin/pwd"; + open(PWDCMD, "$command 2>&1 |") or + die "Error: could not execute $command: $!"; + # without the following sleep, reading from the pipe will + # return nothing; I guess it gives the pwd command time + # to get some data to read . . . + sleep(1); + my $currentdir; + while () { + if (!$currentdir) { + chomp($currentdir = $_); + } + } + my $code = close(PWDCMD); +# if ($code || $?) { +# print "$command returned code=$code status=$? dir=$curdir\n"; +# } +# print "getCwd curdir=\[$curdir\]\n"; + return $currentdir; +} + +################################ +# Need to migrate the credential. +# If the credential can not be migrated, leave it at it is +################################ +sub migrate_credential{ + my $entry_to_modify = shift; + my $credentials_attr = shift; + my @old_value = $entry_to_modify->getValues($credentials_attr); + my $migratecredExecName = 'migratecred'; + my $credOldHome = $oldHome; + my $credServerHome = $serverHome; + + if ($isNT) { + # oldHome may be pointing to the archived copy of the + # instance dir which may be different than the path that + # the instance was originally installed as on Windows. If + # this path is not the original install path, then the + # credential will not be migrated correctly. We should + # prompt the user on Windows for the correct path. + + print "\n\nThe old instance path must be the same as where it was"; + print "\ninitially installed, not where it was archived in order"; + print "\nfor this step to succeed. Please verify that the path"; + print "\nis correct. Note that case sensitivity is important here."; + print "\n\nOld Instance Directory: $credOldHome"; + print "\nIs this correct? (y/n): "; + chomp(my $answer = ); + if (!($answer =~ /y|yes/i)) { + print "\nPlease enter the correct path for the old instance directory: "; + chomp($credOldHome = ); + } + + print "\n\nThe new instance path must also be correct for this step"; + print "\nto succeed. Please verify that the path is correct. Note"; + print "\nthat case sensitivity is important here."; + print "\n\nNew Instance Directory: $credServerHome"; + print "\nIs this correct? (y/n): "; + chomp(my $answer = ); + if (!($answer =~ /y|yes/i)) { + print "\nPlease enter the correct path for the new instance directory: "; + chomp($credServerHome = ); + } + } +# print "\nMigratecred command is: ${quote}$root${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${PATHSEP}$migratecredExecName${quote} -o $credOldHome -n $credServerHome -c @old_value\n"; + + my @new_cred = `${quote}$root${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${PATHSEP}$migratecredExecName${quote} -o $credOldHome -n $credServerHome -c @old_value`; + + if ( $? == 0 ) + { + $entry_to_modify->setValues($credentials_attr, @new_cred); + } +} + diff --git a/ldap/admin/src/scripts/template-migrateInstance5 b/ldap/admin/src/scripts/template-migrateInstance5 new file mode 100644 index 00000000..3d3396c2 --- /dev/null +++ b/ldap/admin/src/scripts/template-migrateInstance5 @@ -0,0 +1,518 @@ +#{{PERL-EXEC}} +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2004 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +use Time::localtime; + +BEGIN { + require 'uname.lib'; + $| = 1; + $isNT = -d '\\'; + $PATHSEP = $isNT ? "\\" : "/"; + $SEP = $isNT ? ";" : ":" ; + $exitCode = 0; + @INC = ( '.', '../../../admin/admin/bin'); + grep { s@/@\\@g } @INC if $isNT; + $script_suffix = $isNT ? ".bat" : ""; + $exe_suffix = $isNT ? ".exe" : ""; + # NT needs quotes around some things unix doesn't + $quote = $isNT ? "\"" : ""; + if ($isNT) { + # we have to pass batch files directly to the NT command interpreter + $com_spec = $ENV{ComSpec}; + if (!$com_spec) { + $com_spec = $ENV{COMSPEC}; + } + if (!$com_spec || ! -f $com_spec) { + # find the first available command interpreter + foreach $drive (c..z) { + $com_spec = "$drive:\\winnt\\system32\\cmd.exe"; + last if (-f $com_spec); + $com_spec = undef; + } + if (! $com_spec) { + # punt and pray + $com_spec = 'c:\winnt\system32\cmd.exe'; + } + } + $os = "WINNT"; + } else { + $os = &uname("-s"); + if ($os eq "SunOS") { + $isSolaris9 = ( &uname("-r") eq "5.9" ); + } + } + + if ( ($os eq "AIX") || ($os eq "HP-UX") ) { + $sigChildHandler = 'sigChildHandler'; + } + SWITCH: { + if ($os eq "AIX") { + $LIB_PATH = "LIBPATH" ; + last SWITCH ; + } + if ($os eq "HP-UX") { + $LIB_PATH = "SHLIB_PATH" ; + last SWITCH ; + } + if ($isNT) { + $LIB_PATH = "PATH" ; + last SWITCH ; + } + else { + $LIB_PATH = "LD_LIBRARY_PATH" ; + last SWITCH ; + } + } + $slapdExecName = $isNT ? 'slapd.exe' : 'ns-slapd'; + select STDERR; + $| = 1; + select STDOUT; + $| = 1; +} + + + +$TRACELEVEL = 0; +${root} = "{{DS-ROOT}}" ; +${type} = "" ; +${newname} = "" ; +${newport} = "" ; +${rootDN} = "" ; +${rootpwd} = "" ; +${localhost} = "" ; +${LogFileReport} = "" ; + +# get input users +&getParameters() ; + + +${oldHome} = "${oldDir}${PATHSEP}$type-$oldname" ; +${oldConfDir} = "${oldHome}${PATHSEP}config${PATHSEP}" ; +${oldSlapdConf} = "${oldConfDir}slapd.conf" ; +${serverHome} = "${root}${PATHSEP}$type-$newname" ; +${ldif_rep} = "${oldConfDir}${PATHSEP}ldif${PATHSEP}" ; +${curdir} = getCwd(); + + +if (!(-d $serverHome)) { + print("\n$serverHome doesn't exist\n"); + exit(1); + } + if (!(-d $oldHome)) { + print("\n$oldHome doesn't exist\n"); + exit(1); + } +$ENV{"$LIB_PATH"} = "$root${PATHSEP}lib${SEP}".$ENV{"$LIB_PATH"} ; +if ($isSolaris9) { + $ENV{"$LIB_PATH"} = "$root${PATHSEP}lib${PATHSEP}nsPerl5.005_03${PATHSEP}lib${PATHSEP}sun4-solaris${PATHSEP}CORE${SEP}".$ENV{"$LIB_PATH"} ; +} + +if ($isNT) { + $ENV{"PERL5LIB"} = "$root${PATHSEP}lib${PATHSEP}nsPerl5.005_03${PATHSEP}site${PATHSEP}lib${SEP}".$ENV{"PERL5LIB"} ; +} +else { + $ENV{"PERL5LIB"} = "$root${PATHSEP}lib${PATHSEP}nsPerl5.005_03${PATHSEP}lib${PATHSEP}site${SEP}".$ENV{"PERL5LIB"} ; +} + +# get the version of the DS to migrate +($oldVersion, $oldMinor) = &getVersion($oldDir); +# get the version of the new DS +($Version, $Minor) = &getVersion($root); + +if ($Version >= 5) { + if ($oldVersion == 4) { + $myscript = "migrateTo5" ; + printMsg("\n******* Migration from $oldVersion.$oldMinor Netscape Directory Server to $Version.$Minor iPlanet Directory Server *********\n"); + } + elsif ($oldVersion == 5 ) { + printMsg("\nWarning. You may experiment some problems considering the version of directory server you want to migrate is not a 5.0") if ($oldMinor != 0); + if ($oldMinor > $Minor) { + die "The migration from a version to an oldest one is not supported\nMigration aborted\n"; + } + $myscript = "migrate50to51" ; + printMsg("\n******* Migration from $oldVersion.$oldMinor to $Version.$Minor iPlanet Directory Server *********\n"); + } + else { + die "We don't support the version of directory server you want to migrate"; + } +} +else { + die "\n\nThe version of directory you want to upgrade is not a 5.x product\nMigration aborted\n"; +} + + + +my $start_time = gmtime ; +@args = ($, $myscript, @ARGV, '-L', $LogFileReport); +$exitCode = &mySystem(@args); +#die "Error: @args: $!" if ($exitCode != 0); + +open(LOGFILE,">> $LogFileReport") or die "\nCan't write to $LogFileReport\n$!\n"; +if (! $exitCode) { + my $end_time = gmtime ; + printMsg("-> Migration started at $start_time\n"); + printMsg("-> Migration ended at $end_time\n\n"); +} +printMsg("***********************************************\n\n"); +print("-> The migration report file is available at: $LogFileReport\n\n"); + +close(LOGFILE); + +####################################################################################################################### +sub usage { + print(STDERR "\nUsage: $0 -D rootdn { -w password | -w - | -j filename } -p port \n"); + print(STDERR " -o oldInstancePath -n newInstancePath [-t tracelevel] \n"); + print(STDERR " [-L logfile] [-noinput]\n"); + print(STDERR "************** parameters in brackets are optionals, others are required **************\n"); + print(STDERR " Opts: -D rootdn - new 5.x Directory Manager\n"); + print(STDERR " : -w password - new 5.x Directory Manager's password\n"); + print(STDERR " : -w - - Prompt for new 5.x Directory Manager's password\n"); + print(STDERR " : -j filename - Read new 5.x Directory Manager's password from file\n"); + print(STDERR " : -p port - new 5.x Directory Server port\n"); + print(STDERR " : -o oldInstancePath - Path of the old instance to migrate \n"); + print(STDERR " : -n newInstancePath - Path of the new 5.x instance\n"); + print(STDERR " : [-t tracelevel] - specify the level of trace (0..3) by default setup to 1\n"); + print(STDERR " : [-L logfile] - specify the file to log the migration report \n"); + print(STDERR " : [-noinput] - no user interventions during migration processing to solve conflicts\n"); + + } + + +####################################################################################################################### +# get input users + +sub getParameters { + my $exit = 0 ; + my $i = 0; + my $pwdfile= ""; + + while ($i <= $#ARGV) { + if ( "$ARGV[$i]" eq "-D" ) { # directory manager + if (! $rootDN) { + $rootDN = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-w") { # password + if (! $rootpwd) { + $rootpwd = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-j") { # password file + if (! $pwdfile) { + $pwdfile = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-o") { # old instance path + if (! $oldHome ) { + $oldHome = $ARGV[++$i] ; + grep { s@\\@/@g } $oldHome if $isNT ; + if ($oldHome =~ /[\"]?(.*)?[\"]?/) { $oldHome = $1 ; } + if ($oldHome =~ m@^(.*)/([^-/]*)-([^/]*)[/]?$@) { + $oldDir = $1 ; + $type = $2 ; + $oldname = $3 ; + if ($isNT) { + $oldDir = lc($oldDir) ; + $type = lc($type) ; + $oldname = lc($oldname) ; + $oldHome = lc($oldHome) ; + grep { s@/@\\@g } $oldDir ; + grep { s@/@\\@g } $oldHome ; + } + } + else { + print("\nThe old instance path is not correct. It must be like slapd-instancename"); + &usage(); + exit(1); + } + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-n") { # 5.x instance path + if (! $serverHome ) { + $serverHome = $ARGV[++$i] ; + grep { s@\\@/@g } $root if $isNT ; + grep { s@\\@/@g } $serverHome if $isNT ; + if ($serverHome =~ /[\"]?(.*)?[\"]?/) { $serverHome = $1 ; } + if ($serverHome =~ m@^(.*?)/?([^/-]*)-([^/]*)[/]?$@) { + $root = $1 if ($1); + $type = $2 ; + $newname = $3 ; + if ($isNT) { + $root = lc($root) ; + $type = lc($type) ; + $newname = lc($newname) ; + $serverHome = lc($serverHome) ; + grep { s@/@\\@g } $root ; + grep { s@/@\\@g } $serverHome ; + } + } + else { + print("\nThe 5.x instance path is not correct. It must be like slapd-instancename"); + &usage(); + exit(1); + } + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-p") { # 5.x DS port + if (! $newport ) { + $newport = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-t") { # TRACELEVEL + my $value = $ARGV[++$i] ; + if ($value =~ /[0-3]/) { + $TRACELEVEL = $value ; + } + else { + print("\nThe tracelevel must belong to 0..3 interval"); + &usage(); + exit(); + } + } elsif ("$ARGV[$i]" eq "-noinput") { # no user interventions during processing + } elsif ("$ARGV[$i]" eq "-L") { # user defined logfile for the migration + $LogFileReport = $ARGV[++$i]; + } + else { + &usage() ; + exit(1); + } + $i++; + } + + if (! $rootDN) { + print("\nThe rootDN is missing"); + $exit = 1; + } + if ($pwdfile ne "") { + # Open file and get the password + unless (open (RPASS, $pwfile)) { + die "Error, cannot open password file $passwdfile\n"; + } + $rootpwd = ; + chomp($rootpwd); + close(RPASS); + } elsif ($rootpwd eq "-"){ + # Read the password from terminal + die "The '-w -' option requires an extension library (Term::ReadKey) which is not\n", + "part of the standard perl distribution. If you want to use it, you must\n", + "download and install the module. You can find it at\n", + "http://www.perl.com/CPAN/CPAN.html\n"; + # Remove the previous line and uncomment the following 6 lines once you have installed Term::ReadKey module. +# use Term::ReadKey; +# print "Bind Password: "; +# ReadMode('noecho'); +# $rootpwd = ReadLine(0); +# chomp($rootpwd); +# ReadMode('normal'); + } + if (! $rootpwd) { + print("\nThe rootpwd is missing"); + $exit = 1 ; + } + if (! $newport) { + print("\nThe port is missing"); + $exit = 1; + } + if (! $serverHome) { + print("\nThe new instance path is missing"); + $exit = 1; + } + if (! $oldHome) { + print("\nThe old instance path is missing"); + $exit = 1; + } + if ((! $LogFileReport) && $serverHome) { + ($sec, $min, $hour, $dd, $mm, $yy) = &GetTime(); + $LogFileReport = "${serverHome}${PATHSEP}logs${PATHSEP}Migration_${dd}${mm}${yy}_${hour}${min}${sec}.log"; + } + if ($exit) { + &usage() ; + exit(1); + } + +} + +############################################################################# +# printMsg print message to the user standard output. + +sub printMsg { + + my $TypeMsg = shift ; + my $Msg = shift ; + my $LineNb = shift ; + if ($LineNb) { + printTrace("Line: $LineNb, $TypeMsg, $Msg"); + } + else { + printTrace("$TypeMsg $Msg"); + } +} + +############################################################################# +# print message error to the user standard output. + +sub printTrace { + + my $Msg = shift ; + my $level = shift ; + if ($level <= $TRACELEVEL) { + print($Msg); + print LOGFILE $Msg; + } + +} + +############################################################################# +sub mySystem { + my $cmd = $_[0]; + # the system {$cmd} avoids some NT shell quoting problems if the $cmd + # needs to be quoted e.g. contains spaces; the map puts double quotes + # around the arguments on NT which are stripped by the command + # interpreter cmd.exe; but don't quote things which are already quoted + my @fixargs = map { /^[\"].*[\"]$/ ? $_ : $quote . $_ . $quote } @_; + my $rc = 0; + if ($cmd =~ /[.](bat|cmd)$/) { + # we have to pass batch files directly to the NT command interpreter + $cmd = $com_spec; +# print "system $cmd /c \"@fixargs\"\n"; + $rc = system {$cmd} '/c', "\"@fixargs\""; + } else { +# print "system $cmd \"@fixargs\"\n"; + $rc = system {$cmd} @fixargs; + } + + return $rc; +} + +############################################################################# + +sub GetTime { + my $tm = localtime; + (my $sec, my $min, my $hour, my $dd, my $mm, my $yy) = ($tm->sec, $tm->min, $tm->hour, $tm->mday, ($tm->mon)+1, ($tm->year)+1900); + $sec = "0$sec" unless $sec > 9 ; + $min = "0$min" unless $min > 9 ; + $hour = "0$hour" unless $hour > 9 ; + $dd = "0$dd" unless $dd > 9 ; + $mm = "0$mm" unless $mm > 9 ; + return ($sec, $min, $hour, $dd, $mm, $yy); +} + +############################################################################# + +sub getVersion { + my $dir = shift; + my $version = 0; + my $minor = 0; + my $buildNumber = 0; + my $progDir = "${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${PATHSEP}"; + my $progDir2 = "${PATHSEP}bin${PATHSEP}slapd${PATHSEP}"; + + # find the slapd executable + $prog = $dir . $progDir . $slapdExecName; + if (! -f $prog) { + $prog = $dir . $progDir2 . $slapdExecName; + if (-f $prog && $isNT) { + # if slapd is in bin/slapd and we're on NT, just assume version 1; + # apparently, slapd.exe doesn't like the -v argument . . . + return ( '1', $minor ); + } + else{ + die "Could not run slapd program $prog: $!"; + } + } + else { + chdir($dir . $progDir); + } + $ENV{"$LIB_PATH"}="$dir${PATHSEP}lib${SEP}".$ENV{"$LIB_PATH"}; + # read the old version from the old slapd program + + open(F, "${quote}${quote}$prog${quote} -v${quote} 2>&1 |") or + die "Could not run slapd program $prog: $!"; + sleep(1); # allow some data to accumulate in the pipe +# print "Output from $prog -v:\n"; + while () { + if (/^Netscape-Directory\/(\d+)\.(\d+)\s+(\S+)/) { + $version = $1; + $minor = $2; + $buildNumber = $3; + last; + } + elsif (/^Netscape-Directory\(restrict?ed-mode\)\/(\d+)\.(\d+)\s+(\S+)/) { # we can have restricted-mode or restriced-mode ... + $version = $1; + $minor = $2; + $buildNumber = $3; + last; + } + elsif (/^iPlanet-Directory\/(\d+)\.(\d+)\s+(\S+)/i) { + $version = $1; + $minor = $2; + $buildNumber = $3; + last; + } + } + $code = close(F); +# print "$prog returned code=$code status=$?\n"; + $ENV{"$LIB_PATH"}="$root${PATHSEP}lib${SEP}".$ENV{"$LIB_PATH"}; + + if ($version == 0) { + die "\nCould not determine version of the directory server in $dir: \n"; + } + + # distinguish the 4.1 and the 4.11 thanks to the buildNumber + if (($version == 4) && ($minor == 1)){ + if (! ($buildNumber =~ /^B99\.16/)) { + # it's not a 4.1 Netscape Directory Server => it's a 4.11 + $minor = 11 ; + } + } + chdir($curdir) or die "Could not change directory to $curdir: $!" ; + return ( $version, $minor ); +} + +############################################################################################### +# get current directory + +sub getCwd { + my $command = $isNT ? "cd" : "/bin/pwd"; + open(PWDCMD, "$command 2>&1 |") or + die "Error: could not execute $command: $!"; + # without the following sleep, reading from the pipe will + # return nothing; I guess it gives the pwd command time + # to get some data to read . . . + sleep(1); + my $currentdir; + while () { + if (!$currentdir) { + chomp($currentdir = $_); + } + } + my $code = close(PWDCMD); +# if ($code || $?) { +# print "$command returned code=$code status=$? dir=$curdir\n"; +# } +# print "getCwd curdir=\[$curdir\]\n"; + return $currentdir; +} diff --git a/ldap/admin/src/scripts/template-migrateInstance6 b/ldap/admin/src/scripts/template-migrateInstance6 new file mode 100644 index 00000000..faaf6363 --- /dev/null +++ b/ldap/admin/src/scripts/template-migrateInstance6 @@ -0,0 +1,550 @@ +#{{PERL-EXEC}} +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2004 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +use Time::localtime; + +BEGIN { + require 'uname.lib'; + $| = 1; + $isNT = -d '\\'; + $PATHSEP = $isNT ? "\\" : "/"; + $SEP = $isNT ? ";" : ":" ; + $exitCode = 0; + @INC = ( '.', '../../../admin/admin/bin'); + grep { s@/@\\@g } @INC if $isNT; + $script_suffix = $isNT ? ".bat" : ""; + $exe_suffix = $isNT ? ".exe" : ""; + # NT needs quotes around some things unix doesn't + $quote = $isNT ? "\"" : ""; + if ($isNT) { + # we have to pass batch files directly to the NT command interpreter + $com_spec = $ENV{ComSpec}; + if (!$com_spec) { + $com_spec = $ENV{COMSPEC}; + } + if (!$com_spec || ! -f $com_spec) { + # find the first available command interpreter + foreach $drive (c..z) { + $com_spec = "$drive:\\winnt\\system32\\cmd.exe"; + last if (-f $com_spec); + $com_spec = undef; + } + if (! $com_spec) { + # punt and pray + $com_spec = 'c:\winnt\system32\cmd.exe'; + } + } + $os = "WINNT"; + } else { + $os = &uname("-s"); + if ($os eq "SunOS") { + $isSolaris9 = ( &uname("-r") eq "5.9" ); + } + } + + if ( ($os eq "AIX") || ($os eq "HP-UX") ) { + $sigChildHandler = 'sigChildHandler'; + } + SWITCH: { + if ($os eq "AIX") { + $LIB_PATH = "LIBPATH" ; + last SWITCH ; + } + if ($os eq "HP-UX") { + $LIB_PATH = "SHLIB_PATH" ; + last SWITCH ; + } + if ($isNT) { + $LIB_PATH = "PATH" ; + last SWITCH ; + } + else { + $LIB_PATH = "LD_LIBRARY_PATH" ; + last SWITCH ; + } + } + $slapdExecName = $isNT ? 'slapd.exe' : 'ns-slapd'; + select STDERR; + $| = 1; + select STDOUT; + $| = 1; +} + + + +$TRACELEVEL = 0; +${root} = "{{DS-ROOT}}" ; +${type} = "" ; +${newname} = "" ; +${newport} = "" ; +${rootDN} = "" ; +${rootpwd} = "" ; +${localhost} = "" ; +${LogFileReport} = "" ; + +# get input users +&getParameters() ; + + +${oldHome} = "${oldDir}${PATHSEP}$type-$oldname" ; +${oldConfDir} = "${oldHome}${PATHSEP}config${PATHSEP}" ; +${oldSlapdConf} = "${oldConfDir}slapd.conf" ; +${serverHome} = "${root}${PATHSEP}$type-$newname" ; +${ldif_rep} = "${oldConfDir}ldif${PATHSEP}" ; +${curdir} = getCwd(); + + +if (!(-d $serverHome)) { + print("\n$serverHome doesn't exist\n"); + exit(1); + } + if (!(-d $oldHome)) { + print("\n$oldHome doesn't exist\n"); + exit(1); + } +if ($olddatadir && !(-d $olddatadir)) { + print("\n$olddatadir doesn't exist\n"); + exit(1); + } +$ENV{"$LIB_PATH"} = "$root${PATHSEP}lib${SEP}".$ENV{"$LIB_PATH"} ; +if ($isSolaris9) { + $ENV{"$LIB_PATH"} = "$root${PATHSEP}lib${PATHSEP}nsPerl5.6.1${PATHSEP}lib${PATHSEP}sun4-solaris${PATHSEP}CORE${SEP}".$ENV{"$LIB_PATH"} ; +} + +if ($isNT) { + $ENV{"PERL5LIB"} = "$root${PATHSEP}lib${PATHSEP}nsPerl5.6.1${PATHSEP}site${PATHSEP}lib${SEP}".$ENV{"PERL5LIB"} ; +} +else { + $ENV{"PERL5LIB"} = "$root${PATHSEP}lib${PATHSEP}nsPerl5.6.1${PATHSEP}lib${PATHSEP}site${SEP}".$ENV{"PERL5LIB"} ; +} + +# get the version of the DS to migrate +($oldVersion, $oldMinor) = &getVersion($oldDir, $oldversionstr); +# get the version of the new DS +($Version, $Minor) = &getVersion($root); + +if ($Version >= 6) { + if ($oldVersion == 4) { + $myscript = "migrateTo6" ; + printMsg("\n******* Migration from $oldVersion.$oldMinor to $Version.$Minor Directory Server *********\n"); + } + elsif ($oldVersion == 5 ) { + printMsg("\nWarning. You may experience some problems if the version of directory server you want to migrate is not a 5.0 or 5.1") if ($oldMinor > 1); + $myscript = "migrate5to6" ; + printMsg("\n******* Migration from $oldVersion.$oldMinor to $Version.$Minor Directory Server *********\n"); + } else { + die "We don't support the version of directory server you want to migrate"; + } +} +else { + die "\n\nThe version of directory you want to upgrade is not a 6.x product\nMigration aborted\n"; +} + +my $start_time = gmtime ; +@args = ($^X, $myscript, @ARGV, '-L', $LogFileReport); +$exitCode = &mySystem(@args); +#die "Error: @args: $!" if ($exitCode != 0); + +open(LOGFILE,">> $LogFileReport") or die "\nCan't write to $LogFileReport\n$!\n"; +if (! $exitCode) { + my $end_time = gmtime ; + printMsg("-> Migration started at $start_time\n"); + printMsg("-> Migration ended at $end_time\n\n"); +} +printMsg("***********************************************\n\n"); +print("-> The migration report file is available at: $LogFileReport\n\n"); + +close(LOGFILE); + +####################################################################################################################### +sub usage { + print(STDERR "\nUsage: $0 -D rootdn { -w password | -w - | -j filename } -p port \n"); + print(STDERR " -o oldInstancePath -n newInstancePath [-t tracelevel] \n"); + print(STDERR " [-L logfile] [-noinput]\n"); + print(STDERR "************** parameters in brackets are optionals, others are required **************\n"); + print(STDERR " Opts: -D rootdn - new Directory Manager\n"); + print(STDERR " : -w password - new Directory Manager's password\n"); + print(STDERR " : -w - - Prompt for new Directory Manager's password\n"); + print(STDERR " : -j filename - Read new Directory Manager's password from file\n"); + print(STDERR " : -p port - new Directory Server port\n"); + print(STDERR " : -o oldInstancePath - Path of the old instance to migrate \n"); + print(STDERR " : -n newInstancePath - Path of the new instance\n"); + print(STDERR " : [-d dataPath] - Path to directory containing data files to import into new instance\n"); + print(STDERR " : [-v oldVersion] - Version of old instance (obtained by running $slapdExecName -v\n"); + print(STDERR " : [-t tracelevel] - specify the level of trace (0..3) by default setup to 1\n"); + print(STDERR " : [-L logfile] - specify the file to log the migration report \n"); + print(STDERR " : [-noinput] - no user interventions during migration processing to solve conflicts\n"); + + } + + +####################################################################################################################### +# get input users + +sub getParameters { + my $exit = 0 ; + my $i = 0; + my $pwdfile= ""; + + while ($i <= $#ARGV) { + if ( "$ARGV[$i]" eq "-D" ) { # directory manager + if (! $rootDN) { + $rootDN = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-w") { # password + if (! $rootpwd) { + $rootpwd = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-j") { # password file + if (! $pwdfile) { + $pwdfile = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-o") { # old instance path + if (! $oldHome ) { + $oldHome = $ARGV[++$i] ; + grep { s@\\@/@g } $oldHome if $isNT ; + if ($oldHome =~ /[\"]?(.*)?[\"]?/) { $oldHome = $1 ; } + if ($oldHome =~ m@^(.*)/([^-/]*)-([^/]*)[/]?$@) { + $oldDir = $1 ; + $type = $2 ; + $oldname = $3 ; + if ($isNT) { + $oldDir = lc($oldDir) ; + $type = lc($type) ; + $oldname = lc($oldname) ; + $oldHome = lc($oldHome) ; + grep { s@/@\\@g } $oldDir ; + grep { s@/@\\@g } $oldHome ; + } + } + else { + print("\nThe old instance path is not correct. It must be like slapd-instancename"); + &usage(); + exit(1); + } + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-n") { # 5.x instance path + if (! $serverHome ) { + $serverHome = $ARGV[++$i] ; + grep { s@\\@/@g } $root if $isNT ; + grep { s@\\@/@g } $serverHome if $isNT ; + if ($serverHome =~ /[\"]?(.*)?[\"]?/) { $serverHome = $1 ; } + if ($serverHome =~ m@^(.*?)/?([^/-]*)-([^/]*)[/]?$@) { + $root = $1 if ($1); + $type = $2 ; + $newname = $3 ; + if ($isNT) { + $root = lc($root) ; + $type = lc($type) ; + $newname = lc($newname) ; + $serverHome = lc($serverHome) ; + grep { s@/@\\@g } $root ; + grep { s@/@\\@g } $serverHome ; + } + } + else { + print("\nThe new instance path is not correct. It must be like slapd-instancename"); + &usage(); + exit(1); + } + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-p") { # 5.x DS port + if (! $newport ) { + $newport = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-d") { # old instance LDIF data dir + if (! $olddatadir ) { + $olddatadir = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-v") { # old version + if (! $oldversionstr ) { + $oldversionstr = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-t") { # TRACELEVEL + my $value = $ARGV[++$i] ; + if ($value =~ /[0-3]/) { + $TRACELEVEL = $value ; + } + else { + print("\nThe tracelevel must belong to 0..3 interval"); + &usage(); + exit(); + } + } elsif ("$ARGV[$i]" eq "-noinput") { # no user interventions during processing + } elsif ("$ARGV[$i]" eq "-L") { # user defined logfile for the migration + $LogFileReport = $ARGV[++$i]; + } + else { + &usage() ; + exit(1); + } + $i++; + } + + if (! $rootDN) { + print("\nThe rootDN is missing"); + $exit = 1; + } + if ($pwdfile ne "") { + # Open file and get the password + unless (open (RPASS, $pwfile)) { + die "Error, cannot open password file $passwdfile\n"; + } + $rootpwd = ; + chomp($rootpwd); + close(RPASS); + } elsif ($rootpwd eq "-"){ + # Read the password from terminal + die "The '-w -' option requires an extension library (Term::ReadKey) which is not\n", + "part of the standard perl distribution. If you want to use it, you must\n", + "download and install the module. You can find it at\n", + "http://www.perl.com/CPAN/CPAN.html\n"; + # Remove the previous line and uncomment the following 6 lines once you have installed Term::ReadKey module. +# use Term::ReadKey; +# print "Bind Password: "; +# ReadMode('noecho'); +# $rootpwd = ReadLine(0); +# chomp($rootpwd); +# ReadMode('normal'); + } + if (! $rootpwd) { + print("\nThe rootpwd is missing"); + $exit = 1 ; + } + if (! $newport) { + print("\nThe port is missing"); + $exit = 1; + } + if (! $serverHome) { + print("\nThe new instance path is missing"); + $exit = 1; + } + if (! $oldHome) { + print("\nThe old instance path is missing"); + $exit = 1; + } + if ((! $LogFileReport) && $serverHome) { + ($sec, $min, $hour, $dd, $mm, $yy) = &GetTime(); + $LogFileReport = "${serverHome}${PATHSEP}logs${PATHSEP}Migration_${dd}${mm}${yy}_${hour}${min}${sec}.log"; + } + if ($exit) { + &usage() ; + exit(1); + } + +} + +############################################################################# +# printMsg print message to the user standard output. + +sub printMsg { + + my $TypeMsg = shift ; + my $Msg = shift ; + my $LineNb = shift ; + if ($LineNb) { + printTrace("Line: $LineNb, $TypeMsg, $Msg"); + } + else { + printTrace("$TypeMsg $Msg"); + } +} + +############################################################################# +# print message error to the user standard output. + +sub printTrace { + + my $Msg = shift ; + my $level = shift ; + if ($level <= $TRACELEVEL) { + print($Msg); + print LOGFILE $Msg; + } + +} + +############################################################################# +sub mySystem { + my $cmd = $_[0]; + # the system {$cmd} avoids some NT shell quoting problems if the $cmd + # needs to be quoted e.g. contains spaces; the map puts double quotes + # around the arguments on NT which are stripped by the command + # interpreter cmd.exe; but don't quote things which are already quoted + my @fixargs = map { /^[\"].*[\"]$/ ? $_ : $quote . $_ . $quote } @_; + my $rc = 0; + if ($cmd =~ /[.](bat|cmd)$/) { + # we have to pass batch files directly to the NT command interpreter + $cmd = $com_spec; +# print "system $cmd /c \"@fixargs\"\n"; + $rc = system {$cmd} '/c', "\"@fixargs\""; + } else { +# print "system $cmd \"@fixargs\"\n"; + if($isNT) { + $rc = system "\"@fixargs\""; + } else { + $rc = system @fixargs; + } + } + + return $rc; +} + +############################################################################# + +sub GetTime { + my $tm = localtime; + (my $sec, my $min, my $hour, my $dd, my $mm, my $yy) = ($tm->sec, $tm->min, $tm->hour, $tm->mday, ($tm->mon)+1, ($tm->year)+1900); + $sec = "0$sec" unless $sec > 9 ; + $min = "0$min" unless $min > 9 ; + $hour = "0$hour" unless $hour > 9 ; + $dd = "0$dd" unless $dd > 9 ; + $mm = "0$mm" unless $mm > 9 ; + return ($sec, $min, $hour, $dd, $mm, $yy); +} + +############################################################################# + +sub getVersion { + my $dir = shift; + my $versionstr = shift; + my $version = 0; + my $minor = 0; + my $buildNumber = 0; + my $progDir = "${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${PATHSEP}"; + my $progDir2 = "${PATHSEP}bin${PATHSEP}slapd${PATHSEP}"; + + # find the slapd executable + if (!$versionstr) { # version not specified on cmd line - find it + $prog = $dir . $progDir . $slapdExecName; + if (! -f $prog) { + $prog = $dir . $progDir2 . $slapdExecName; + if (-f $prog && $isNT) { + # if slapd is in bin/slapd and we're on NT, just assume version 1; + # apparently, slapd.exe doesn't like the -v argument . . . + return ( '1', $minor ); + } + else{ + die "Could not run slapd program $prog: $!"; + } + } + else { + chdir($dir . $progDir); + } + $ENV{"$LIB_PATH"}= + "$dir${PATHSEP}lib${SEP}". + "$dir${PATHSEP}bin${PATHSEP}slapd${PATHSEP}lib${SEP}". + "$dir${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${SEP}". + $ENV{"$LIB_PATH"}; + # read the old version from the old slapd program + + open(F, "${quote}${quote}$prog${quote} -v${quote} 2>&1 |") or + die "Could not run slapd program $prog: $!"; + sleep(1); # allow some data to accumulate in the pipe +# print "Output from $prog -v:\n"; + while () { + if (/^Netscape-Directory/ || /^iPlanet-Directory/i) { + $versionstr = $_; + last; + } + } + $code = close(F); + # print "$prog returned code=$code status=$?\n"; + $ENV{"$LIB_PATH"}="$root${PATHSEP}lib${SEP}".$ENV{"$LIB_PATH"}; + } + + if ($versionstr =~ /^Netscape-Directory\/(\d+)\.(\d+)(?:b\d)*\s+(\S+)/) { + $version = $1; + $minor = $2; + $buildNumber = $3; + } + elsif ($versionstr =~ /^Netscape-Directory\(restrict?ed-mode\)\/(\d+)\.(\d+)\s+(\S+)/) { # we can have restricted-mode or restriced-mode ... + $version = $1; + $minor = $2; + $buildNumber = $3; + } + elsif ($versionstr =~ /^iPlanet-Directory\/(\d+)\.(\d+)\s+(\S+)/i) { + $version = $1; + $minor = $2; + $buildNumber = $3; + } elsif ($versionstr =~ /(\d+)\.(\d+)/) { + $version = $1; + $minor = $2; + } + + if ($version == 0) { + die "\nCould not determine version of the directory server in $dir: \n"; + } + + # distinguish the 4.1 and the 4.11 thanks to the buildNumber + if (($version == 4) && ($minor == 1)){ + if (! ($buildNumber =~ /^B99\.16/)) { + # it's not a 4.1 Netscape Directory Server => it's a 4.11 + $minor = 11 ; + } + } + chdir($curdir) or die "Could not change directory to $curdir: $!" ; + return ( $version, $minor ); +} + +############################################################################################### +# get current directory + +sub getCwd { + my $command = $isNT ? "cd" : "/bin/pwd"; + open(PWDCMD, "$command 2>&1 |") or + die "Error: could not execute $command: $!"; + # without the following sleep, reading from the pipe will + # return nothing; I guess it gives the pwd command time + # to get some data to read . . . + sleep(1); + my $currentdir; + while () { + if (!$currentdir) { + chomp($currentdir = $_); + } + } + my $code = close(PWDCMD); +# if ($code || $?) { +# print "$command returned code=$code status=$? dir=$curdir\n"; +# } +# print "getCwd curdir=\[$curdir\]\n"; + return $currentdir; +} diff --git a/ldap/admin/src/scripts/template-migrateInstance7 b/ldap/admin/src/scripts/template-migrateInstance7 new file mode 100644 index 00000000..2a754b10 --- /dev/null +++ b/ldap/admin/src/scripts/template-migrateInstance7 @@ -0,0 +1,559 @@ +#{{PERL-EXEC}} +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2004 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +use Time::localtime; + +BEGIN { + require 'uname.lib'; + $| = 1; + $isNT = -d '\\'; + $PATHSEP = $isNT ? "\\" : "/"; + $SEP = $isNT ? ";" : ":" ; + $exitCode = 0; + @INC = ( '.', '../../../admin/admin/bin'); + grep { s@/@\\@g } @INC if $isNT; + $script_suffix = $isNT ? ".bat" : ""; + $exe_suffix = $isNT ? ".exe" : ""; + # NT needs quotes around some things unix doesn't + $quote = $isNT ? "\"" : ""; + if ($isNT) { + # we have to pass batch files directly to the NT command interpreter + $com_spec = $ENV{ComSpec}; + if (!$com_spec) { + $com_spec = $ENV{COMSPEC}; + } + if (!$com_spec || ! -f $com_spec) { + # find the first available command interpreter + foreach $drive (c..z) { + $com_spec = "$drive:\\winnt\\system32\\cmd.exe"; + last if (-f $com_spec); + $com_spec = undef; + } + if (! $com_spec) { + # punt and pray + $com_spec = 'c:\winnt\system32\cmd.exe'; + } + } + $os = "WINNT"; + } else { + $os = &uname("-s"); + if ($os eq "SunOS") { + $isSolaris9 = ( &uname("-r") eq "5.9" ); + } + } + + if ( ($os eq "AIX") || ($os eq "HP-UX") ) { + $sigChildHandler = 'sigChildHandler'; + } + SWITCH: { + if ($os eq "AIX") { + $LIB_PATH = "LIBPATH" ; + last SWITCH ; + } + if ($os eq "HP-UX") { + $LIB_PATH = "SHLIB_PATH" ; + last SWITCH ; + } + if ($isNT) { + $LIB_PATH = "PATH" ; + last SWITCH ; + } + else { + $LIB_PATH = "LD_LIBRARY_PATH" ; + last SWITCH ; + } + } + $slapdExecName = $isNT ? 'slapd.exe' : 'ns-slapd'; + select STDERR; + $| = 1; + select STDOUT; + $| = 1; +} + + + +$TRACELEVEL = 0; +${root} = "{{DS-ROOT}}" ; +${type} = "" ; +${newname} = "" ; +${newport} = "" ; +${rootDN} = "" ; +${rootpwd} = "" ; +${localhost} = "" ; +${LogFileReport} = "" ; + +# get input users +&getParameters() ; + + +${oldHome} = "${oldDir}${PATHSEP}$type-$oldname" ; +${oldConfDir} = "${oldHome}${PATHSEP}config${PATHSEP}" ; +${oldSlapdConf} = "${oldConfDir}slapd.conf" ; +${serverHome} = "${root}${PATHSEP}$type-$newname" ; +${ldif_rep} = "${oldConfDir}ldif${PATHSEP}" ; +${curdir} = getCwd(); + + +if (!(-d $serverHome)) { + print("\n$serverHome doesn't exist\n"); + exit(1); + } + if (!(-d $oldHome)) { + print("\n$oldHome doesn't exist\n"); + exit(1); + } +if ($olddatadir && !(-d $olddatadir)) { + print("\n$olddatadir doesn't exist\n"); + exit(1); + } +$ENV{"$LIB_PATH"} = "$root${PATHSEP}lib${SEP}".$ENV{"$LIB_PATH"} ; +if ($isSolaris9) { + $ENV{"$LIB_PATH"} = "$root${PATHSEP}lib${PATHSEP}nsPerl5.6.1${PATHSEP}lib${PATHSEP}sun4-solaris${PATHSEP}CORE${SEP}".$ENV{"$LIB_PATH"} ; +} + +if ($isNT) { + $ENV{"PERL5LIB"} = "$root${PATHSEP}lib${PATHSEP}nsPerl5.6.1${PATHSEP}site${PATHSEP}lib${SEP}".$ENV{"PERL5LIB"} ; +} +else { + $ENV{"PERL5LIB"} = "$root${PATHSEP}lib${PATHSEP}nsPerl5.6.1${PATHSEP}lib${PATHSEP}site${SEP}".$ENV{"PERL5LIB"} ; +} + +# get the version of the DS to migrate +($oldVersion, $oldMinor) = &getVersion($oldDir, $oldversionstr); +# get the version of the new DS +($Version, $Minor) = &getVersion($root); + +if ($Version >= 7) { + if ($oldVersion == 4) { + $myscript = "migrateTo7" ; + printMsg("\n******* Migration from $oldVersion.$oldMinor to $Version.$Minor Directory Server *********\n"); + } + elsif ($oldVersion == 5 ) { + printMsg("\nWarning. You may experience some problems if the version of directory server you want to migrate is not a 5.0 or 5.1") if ($oldMinor > 1); + $myscript = "migrate5to7" ; + printMsg("\n******* Migration from $oldVersion.$oldMinor to $Version.$Minor Directory Server *********\n"); + } + elsif ($oldVersion == 6 ) { + $myscript = "migrate6to7" ; + printMsg("\n******* Migration from $oldVersion.$oldMinor to $Version.$Minor Directory Server *********\n"); + } + else { + + die "We don't support the version of directory server you want to migrate"; + } +} +else { + die "\n\nThe version of directory you want to upgrade is not a 7.x product\nMigration aborted\n"; +} + +my $start_time = gmtime ; +@args = ($^X, $myscript, @ARGV, '-L', $LogFileReport); +$exitCode = &mySystem(@args); +#die "Error: @args: $!" if ($exitCode != 0); + +open(LOGFILE,">> $LogFileReport") or die "\nCan't write to $LogFileReport\n$!\n"; +if (! $exitCode) { + my $end_time = gmtime ; + printMsg("-> Migration started at $start_time\n"); + printMsg("-> Migration ended at $end_time\n\n"); +} +printMsg("***********************************************\n\n"); +print("-> The migration report file is available at: $LogFileReport\n\n"); + +close(LOGFILE); + +####################################################################################################################### +sub usage { + print(STDERR "\nUsage: $0 -D rootdn { -w password | -w - | -j filename } -p port \n"); + print(STDERR " -o oldInstancePath -n newInstancePath [-t tracelevel] \n"); + print(STDERR " [-L logfile] [-noinput]\n"); + print(STDERR "************** parameters in brackets are optionals, others are required **************\n"); + print(STDERR " Opts: -D rootdn - new Directory Manager\n"); + print(STDERR " : -w password - new Directory Manager's password\n"); + print(STDERR " : -w - - Prompt for new Directory Manager's password\n"); + print(STDERR " : -j filename - Read new Directory Manager's password from file\n"); + print(STDERR " : -p port - new Directory Server port\n"); + print(STDERR " : -o oldInstancePath - Path of the old instance to migrate \n"); + print(STDERR " : -n newInstancePath - Path of the new instance\n"); + print(STDERR " : [-d dataPath] - Path to directory containing data files to import into new instance\n"); + print(STDERR " : [-v oldVersion] - Version of old instance (obtained by running $slapdExecName -v\n"); + print(STDERR " : [-t tracelevel] - specify the level of trace (0..3) by default setup to 1\n"); + print(STDERR " : [-L logfile] - specify the file to log the migration report \n"); + print(STDERR " : [-noinput] - no user interventions during migration processing to solve conflicts\n"); + + } + + +####################################################################################################################### +# get input users + +sub getParameters { + my $exit = 0 ; + my $i = 0; + my $pwdfile= ""; + + while ($i <= $#ARGV) { + if ( "$ARGV[$i]" eq "-D" ) { # directory manager + if (! $rootDN) { + $rootDN = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-w") { # password + if (! $rootpwd) { + $rootpwd = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-j") { # password file + if (! $pwdfile) { + $pwdfile = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-o") { # old instance path + if (! $oldHome ) { + $oldHome = $ARGV[++$i] ; + grep { s@\\@/@g } $oldHome if $isNT ; + if ($oldHome =~ /[\"]?(.*)?[\"]?/) { $oldHome = $1 ; } + if ($oldHome =~ m@^(.*)/([^-/]*)-([^/]*)[/]?$@) { + $oldDir = $1 ; + $type = $2 ; + $oldname = $3 ; + if ($isNT) { + $oldDir = lc($oldDir) ; + $type = lc($type) ; + $oldname = lc($oldname) ; + $oldHome = lc($oldHome) ; + grep { s@/@\\@g } $oldDir ; + grep { s@/@\\@g } $oldHome ; + } + } + else { + print("\nThe old instance path is not correct. It must be like slapd-instancename"); + &usage(); + exit(1); + } + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-n") { # 5.x instance path + if (! $serverHome ) { + $serverHome = $ARGV[++$i] ; + grep { s@\\@/@g } $root if $isNT ; + grep { s@\\@/@g } $serverHome if $isNT ; + if ($serverHome =~ /[\"]?(.*)?[\"]?/) { $serverHome = $1 ; } + if ($serverHome =~ m@^(.*?)/?([^/-]*)-([^/]*)[/]?$@) { + $root = $1 if ($1); + $type = $2 ; + $newname = $3 ; + if ($isNT) { + $root = lc($root) ; + $type = lc($type) ; + $newname = lc($newname) ; + $serverHome = lc($serverHome) ; + grep { s@/@\\@g } $root ; + grep { s@/@\\@g } $serverHome ; + } + } + else { + print("\nThe new instance path is not correct. It must be like slapd-instancename"); + &usage(); + exit(1); + } + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-p") { # 5.x DS port + if (! $newport ) { + $newport = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-d") { # old instance LDIF data dir + if (! $olddatadir ) { + $olddatadir = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-v") { # old version + if (! $oldversionstr ) { + $oldversionstr = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-t") { # TRACELEVEL + my $value = $ARGV[++$i] ; + if ($value =~ /[0-3]/) { + $TRACELEVEL = $value ; + } + else { + print("\nThe tracelevel must belong to 0..3 interval"); + &usage(); + exit(); + } + } elsif ("$ARGV[$i]" eq "-noinput") { # no user interventions during processing + } elsif ("$ARGV[$i]" eq "-L") { # user defined logfile for the migration + $LogFileReport = $ARGV[++$i]; + } + else { + &usage() ; + exit(1); + } + $i++; + } + + if (! $rootDN) { + print("\nThe rootDN is missing"); + $exit = 1; + } + if ($pwdfile ne "") { + # Open file and get the password + unless (open (RPASS, $pwfile)) { + die "Error, cannot open password file $passwdfile\n"; + } + $rootpwd = ; + chomp($rootpwd); + close(RPASS); + } elsif ($rootpwd eq "-"){ + # Read the password from terminal + die "The '-w -' option requires an extension library (Term::ReadKey) which is not\n", + "part of the standard perl distribution. If you want to use it, you must\n", + "download and install the module. You can find it at\n", + "http://www.perl.com/CPAN/CPAN.html\n"; + # Remove the previous line and uncomment the following 6 lines once you have installed Term::ReadKey module. +# use Term::ReadKey; +# print "Bind Password: "; +# ReadMode('noecho'); +# $rootpwd = ReadLine(0); +# chomp($rootpwd); +# ReadMode('normal'); + } + if (! $rootpwd) { + print("\nThe rootpwd is missing"); + $exit = 1 ; + } + if (! $newport) { + print("\nThe port is missing"); + $exit = 1; + } + if (! $serverHome) { + print("\nThe new instance path is missing"); + $exit = 1; + } + if (! $oldHome) { + print("\nThe old instance path is missing"); + $exit = 1; + } + if ((! $LogFileReport) && $serverHome) { + ($sec, $min, $hour, $dd, $mm, $yy) = &GetTime(); + $LogFileReport = "${serverHome}${PATHSEP}logs${PATHSEP}Migration_${dd}${mm}${yy}_${hour}${min}${sec}.log"; + } + if ($exit) { + &usage() ; + exit(1); + } + +} + +############################################################################# +# printMsg print message to the user standard output. + +sub printMsg { + + my $TypeMsg = shift ; + my $Msg = shift ; + my $LineNb = shift ; + if ($LineNb) { + printTrace("Line: $LineNb, $TypeMsg, $Msg"); + } + else { + printTrace("$TypeMsg $Msg"); + } +} + +############################################################################# +# print message error to the user standard output. + +sub printTrace { + + my $Msg = shift ; + my $level = shift ; + if ($level <= $TRACELEVEL) { + print($Msg); + print LOGFILE $Msg; + } + +} + +############################################################################# +sub mySystem { + my $cmd = $_[0]; + # the system {$cmd} avoids some NT shell quoting problems if the $cmd + # needs to be quoted e.g. contains spaces; the map puts double quotes + # around the arguments on NT which are stripped by the command + # interpreter cmd.exe; but don't quote things which are already quoted + my @fixargs = map { /^[\"].*[\"]$/ ? $_ : $quote . $_ . $quote } @_; + my $rc = 0; + if ($cmd =~ /[.](bat|cmd)$/) { + # we have to pass batch files directly to the NT command interpreter + $cmd = $com_spec; +# print "system $cmd /c \"@fixargs\"\n"; + $rc = system {$cmd} '/c', "\"@fixargs\""; + } else { +# print "system $cmd \"@fixargs\"\n"; + if($isNT) { + $rc = system "\"@fixargs\""; + } else { + $rc = system @fixargs; + } + } + + return $rc; +} + +############################################################################# + +sub GetTime { + my $tm = localtime; + (my $sec, my $min, my $hour, my $dd, my $mm, my $yy) = ($tm->sec, $tm->min, $tm->hour, $tm->mday, ($tm->mon)+1, ($tm->year)+1900); + $sec = "0$sec" unless $sec > 9 ; + $min = "0$min" unless $min > 9 ; + $hour = "0$hour" unless $hour > 9 ; + $dd = "0$dd" unless $dd > 9 ; + $mm = "0$mm" unless $mm > 9 ; + return ($sec, $min, $hour, $dd, $mm, $yy); +} + +############################################################################# + +sub getVersion { + my $dir = shift; + my $versionstr = shift; + my $version = 0; + my $minor = 0; + my $buildNumber = 0; + my $progDir = "${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${PATHSEP}"; + my $progDir2 = "${PATHSEP}bin${PATHSEP}slapd${PATHSEP}"; + + # find the slapd executable + if (!$versionstr) { # version not specified on cmd line - find it + $prog = $dir . $progDir . $slapdExecName; + if (! -f $prog) { + $prog = $dir . $progDir2 . $slapdExecName; + if (-f $prog && $isNT) { + # if slapd is in bin/slapd and we're on NT, just assume version 1; + # apparently, slapd.exe doesn't like the -v argument . . . + return ( '1', $minor ); + } + else{ + die "Could not run slapd program $prog: $!"; + } + } + else { + chdir($dir . $progDir); + } + $preserve_lib_path = $ENV{"$LIB_PATH"}; + $ENV{"$LIB_PATH"}= + "$dir${PATHSEP}lib${SEP}". + "$dir${PATHSEP}bin${PATHSEP}slapd${PATHSEP}lib${SEP}". + "$dir${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${SEP}". + $ENV{"$LIB_PATH"}; + # read the old version from the old slapd program + + open(F, "${quote}${quote}$prog${quote} -v${quote} 2>&1 |") or + die "Could not run slapd program $prog: $!"; + sleep(1); # allow some data to accumulate in the pipe +# print "Output from $prog -v:\n"; + while () { + if (/^Netscape-Directory/ || /^iPlanet-Directory/i) { + $versionstr = $_; + last; + } + } + $code = close(F); + # print "$prog returned code=$code status=$?\n"; + $ENV{"$LIB_PATH"}="$root${PATHSEP}lib${SEP}".$ENV{"$LIB_PATH"}; + } + + if ($versionstr =~ /^Netscape-Directory\/(\d+)\.(\d+)(?:b\d)*\s+(\S+)/) { + $version = $1; + $minor = $2; + $buildNumber = $3; + } + elsif ($versionstr =~ /^Netscape-Directory\(restrict?ed-mode\)\/(\d+)\.(\d+)\s+(\S+)/) { # we can have restricted-mode or restriced-mode ... + $version = $1; + $minor = $2; + $buildNumber = $3; + } + elsif ($versionstr =~ /^iPlanet-Directory\/(\d+)\.(\d+)\s+(\S+)/i) { + $version = $1; + $minor = $2; + $buildNumber = $3; + } elsif ($versionstr =~ /(\d+)\.(\d+)/) { + $version = $1; + $minor = $2; + } + + if ($version == 0) { + die "\nCould not determine version of the directory server in $dir: \n"; + } + + # distinguish the 4.1 and the 4.11 thanks to the buildNumber + if (($version == 4) && ($minor == 1)){ + if (! ($buildNumber =~ /^B99\.16/)) { + # it's not a 4.1 Netscape Directory Server => it's a 4.11 + $minor = 11 ; + } + } + # Restore the original library path + $ENV{"$LIB_PATH"} = $preserve_lib_path; + chdir($curdir) or die "Could not change directory to $curdir: $!" ; + return ( $version, $minor ); +} + +############################################################################################### +# get current directory + +sub getCwd { + my $command = $isNT ? "cd" : "/bin/pwd"; + open(PWDCMD, "$command 2>&1 |") or + die "Error: could not execute $command: $!"; + # without the following sleep, reading from the pipe will + # return nothing; I guess it gives the pwd command time + # to get some data to read . . . + sleep(1); + my $currentdir; + while () { + if (!$currentdir) { + chomp($currentdir = $_); + } + } + my $code = close(PWDCMD); +# if ($code || $?) { +# print "$command returned code=$code status=$? dir=$curdir\n"; +# } +# print "getCwd curdir=\[$curdir\]\n"; + return $currentdir; +} diff --git a/ldap/admin/src/scripts/template-migrateTo5 b/ldap/admin/src/scripts/template-migrateTo5 new file mode 100755 index 00000000..f02a6279 --- /dev/null +++ b/ldap/admin/src/scripts/template-migrateTo5 @@ -0,0 +1,3094 @@ +#{{PERL-EXEC}} +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2004 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# + +# Migrate a 4.0 directory server to a 5.x directory server + +######################################################################################################## +# enable the use of Perldap functions +require DynaLoader; + +use Getopt::Std; +use Mozilla::LDAP::Conn; +use Mozilla::LDAP::Entry; +use Mozilla::LDAP::LDIF; +use Mozilla::LDAP::Utils qw(:all); +use Mozilla::LDAP::API qw(:api :ssl :apiv3 :constant); # Direct access to C API +use Time::localtime; + +######################################################################################################## +use Class::Struct ; # load struct-building module + +struct S_index => { + names => '@' , + types => '@' , + oids => '@' , + specific => '$' + }; + + +struct S_plugin => { + name => '$' , + type => '$' , + enable => '$' , + args => '@' + }; +##################################################################################################### + +sub usage { + print(STDERR "\nUsage: $0 -D rootdn { -w password | -w - | -j filename } -p port \n"); + print(STDERR " -o 4.xInstancePath -n 5.xInstancePath [-t tracelevel] [-L logfile]\n"); + print(STDERR "************** parameters in brackets are optionals, others are required **************\n"); + print(STDERR " Opts: -D rootdn - 5.x Directory Manager\n"); + print(STDERR " : -w password - 5.x Directory Manager's password\n"); + print(STDERR " : -w - - Prompt for 5.x Directory Manager's password\n"); + print(STDERR " : -j filename - Read 5.x Directory Manager's password from file\n"); + print(STDERR " : -p port - 5.x Directory Server port\n"); + print(STDERR " : -o 4.xInstancePath - Path of the 4.x instance to migrate \n"); + print(STDERR " : -n 5.xInstancePath - Path of the new 5.x instance\n"); + print(STDERR " : [-t tracelevel] - specify the level of trace (0..3)\n"); + print(STDERR " : [-L logfile] - specify the file to log the migration report \n"); + + + } + + + +############# +BEGIN { + + require 'uname.lib' ; + $isNT = -d '\\'; + $PATHSEP = $isNT ? "\\" : "/"; + ${SEP} = $isNT ? ";" : ":" ; + @INC = ( '.', '../../../admin/admin/bin'); + grep { s@/@\\@g } @INC if $isNT; + $script_suffix = $isNT ? ".bat" : ""; + $exe_suffix = $isNT ? ".exe" : ""; + # NT needs quotes around some things unix doesn't + $quote = $isNT ? "\"" : ""; + + # If this variable is set, all file/directory creation will make sure the mode + # and ownership of the destination is the same as the source + $PRESERVE = 1 if (!$isNT); + $script_suffix = $isNT ? ".bat" : ""; + $exe_suffix = $isNT ? ".exe" : ""; + if ($isNT) { + $os = "WINNT"; + } else { + $os = &uname("-s"); + } + if ($isNT) { + # we have to pass batch files directly to the NT command interpreter + $com_spec = $ENV{ComSpec}; + if (!$com_spec) { + $com_spec = $ENV{COMSPEC}; + } + if (!$com_spec || ! -f $com_spec) { + # find the first available command interpreter + foreach $drive (c..z) { + $com_spec = "$drive:\\winnt\\system32\\cmd.exe"; + last if (-f $com_spec); + $com_spec = undef; + } + if (! $com_spec) { + # punt and pray + $com_spec = 'c:\winnt\system32\cmd.exe'; + } + } + } + if ( $os eq "AIX" ) { + $dll_suffix = "_shr.a"; + } + elsif ( $os eq "HP-UX" ) { + $dll_suffix = ".sl"; + } + elsif ( $os eq "WINNT" ) { + $dll_suffix = ".dll"; + } + else { + $dll_suffix = ".so"; + } + $slapdExecName = $isNT ? 'slapd.exe' : 'ns-slapd'; + # if this flag is set, we will migrate the 4.x database + # by doing a db2ldif -> ldif2db; + $convertToLDIF = 1; + select STDERR; + $| = 1; + select STDOUT; + $| = 1; + # if the old value for dbcachesize is less than this, make it this + $MIN_DBCACHESIZE = '500000'; +} + +SWITCH: { + if ($os eq "AIX") { + $LIB_PATH = "LIBPATH" ; + last SWITCH ; + } + if ($os eq "HP-UX") { + $LIB_PATH = "SHLIB_PATH" ; + last SWITCH ; + } + if ($isNT) { + $LIB_PATH = "PATH" ; + last SWITCH ; + } + else { + $LIB_PATH = "LD_LIBRARY_PATH" ; + last SWITCH ; + } + } + + # 4.x parameters + ${oldDir} = "" ; + ${oldname} = "" ; + ${oldHome} = "" ; + ${oldConfDir} = "" ; + ${oldlocaluser} ; + ${olduid} ; + ${oldgid} ; + + # 5.x parameters + ${root} = "{{DS-ROOT}}" ; + ${type} = "" ; + ${newname} = "" ; + ${newport} = "" ; + ${rootDN} = "" ; + ${rootpwd} = "" ; + ${localhost} = "" ; + ${LogFileReport} = "" ; + ${newuid} ; + ${localuser} ; + ${newgid} ; + $NO_INPUT_USER = 0 ; # by default user can give inputs during the migration process + ${curdir} = getCwd(); + ${slapdExecDir} = "${root}${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${PATHSEP}"; + + # specify the level of trace + $TRACELEVEL=1; + + # get input users + &getParameters() ; + ${oldDir} = &normalizeDir("${oldDir}"); + ${oldHome} = "${oldDir}${PATHSEP}$type-$oldname" ; + ${oldConfDir} = "${oldHome}${PATHSEP}config${PATHSEP}" ; + ${oldSlapdConf} = "${oldConfDir}slapd.conf" ; + ${oldDSEldif} = "${oldConfDir}dse.ldif" ; + ${serverHome} = "${root}${PATHSEP}$type-$newname" ; + ${DSEldif} = "$serverHome${PATHSEP}config${PATHSEP}dse.ldif"; + ${ldif_rep} = "${oldConfDir}${PATHSEP}ldif${PATHSEP}" ; + ${oldSlapdExecDir} = "${oldDir}${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${PATHSEP}"; + + + + + open(LOGFILE, ">> $LogFileReport"); + + printTrace("\noldDir: $oldDir, oldHome: $oldHome, \noldConfDir: $oldConfDir, \noldSlapdConf: $oldSlapdConf, \nldif_rep: $ldif_rep, \nrootDN: $rootDN, \nPwd: ******, \nPort: $newport, \nNewname: $newname\n",3); + printTrace("\nLIB_PATH: $LIB_PATH",4); + + if (!(-d $serverHome)) { + printMsg("\n$serverHome doesn't exist\n"); + exit(1); + } + if (!(-d $oldHome)) { + printMsg("\n$oldHome doesn't exist\n"); + exit(1); + } + +#define CONFIG_DATABASE_DIRECTIVE "database" +#define CONFIG_DATABASE_ATTRIBUTE "nsslapd-database" +#define CONFIG_PLUGIN_DIRECTIVE "plugin" +#define CONFIG_PLUGIN_ATTRIBUTE "nsslapd-plugin" +#define CONFIG_SIZELIMIT_DIRECTIVE "sizelimit" +#define CONFIG_SIZELIMIT_ATTRIBUTE "nsslapd-sizelimit" +#define CONFIG_ORCAUTO_DIRECTIVE "orcauto" +#define CONFIG_ORCAUTO_ATTRIBUTE "nsslapd-orcauto" +#define CONFIG_TIMELIMIT_DIRECTIVE "timelimit" +#define CONFIG_TIMELIMIT_ATTRIBUTE "nsslapd-timelimit" +#define CONFIG_SUFFIX_DIRECTIVE "suffix" +#define CONFIG_SUFFIX_ATTRIBUTE "nsslapd-suffix" +#define CONFIG_READONLY_DIRECTIVE "readonly" +#define CONFIG_READONLY_ATTRIBUTE "nsslapd-readonly" +#define CONFIG_REFERRAL_DIRECTIVE "referral" +#define CONFIG_REFERRAL_ATTRIBUTE "nsslapd-referral" +#define CONFIG_OBJECTCLASS_DIRECTIVE "objectclass" +#define CONFIG_OBJECTCLASS_ATTRIBUTE "nsslapd-objectclass" +#define CONFIG_ATTRIBUTE_DIRECTIVE "attribute" +#define CONFIG_ATTRIBUTE_ATTRIBUTE "nsslapd-attribute" +#define CONFIG_SCHEMACHECK_DIRECTIVE "schemacheck" +#define CONFIG_SCHEMACHECK_ATTRIBUTE "nsslapd-schemacheck" +#define CONFIG_LOGLEVEL_DIRECTIVE "loglevel" +#define CONFIG_LOGLEVEL_ATTRIBUTE "nsslapd-errorlog-level" +#define CONFIG_ACCESSLOGLEVEL_DIRECTIVE "accessloglevel" +#define CONFIG_ACCESSLOGLEVEL_ATTRIBUTE "nsslapd-accesslog-level" +#define CONFIG_ACCESSLOG_MAXNUMOFLOGSPERDIR_DIRECTIVE "accesslog-maxNumOfLogsPerDir" +#define CONFIG_ACCESSLOG_MAXNUMOFLOGSPERDIR_ATTRIBUTE "nsslapd-accesslog-maxlogsperdir" +#define CONFIG_ERRORLOG_MAXNUMOFLOGSPERDIR_DIRECTIVE "errorlog-maxNumOfLogsPerDir" +#define CONFIG_ERRORLOG_MAXNUMOFLOGSPERDIR_ATTRIBUTE "nsslapd-errorlog-maxlogsperdir" +#define CONFIG_AUDITLOG_MAXNUMOFLOGSPERDIR_DIRECTIVE "auditlog-maxNumOfLogsPerDir" +#define CONFIG_AUDITLOG_MAXNUMOFLOGSPERDIR_ATTRIBUTE "nsslapd-auditlog-maxlogsperdir" +#define CONFIG_ACCESSLOG_MAXLOGSIZE_DIRECTIVE "accesslog-maxlogsize" +#define CONFIG_ACCESSLOG_MAXLOGSIZE_ATTRIBUTE "nsslapd-accesslog-maxlogsize" +#define CONFIG_ERRORLOG_MAXLOGSIZE_DIRECTIVE "errorlog-maxlogsize" +#define CONFIG_ERRORLOG_MAXLOGSIZE_ATTRIBUTE "nsslapd-errorlog-maxlogsize" +#define CONFIG_AUDITLOG_MAXLOGSIZE_DIRECTIVE "auditlog-maxlogsize" +#define CONFIG_AUDITLOG_MAXLOGSIZE_ATTRIBUTE "nsslapd-auditlog-maxlogsize" +#define CONFIG_ACCESSLOG_LOGROTATIONTIME_DIRECTIVE "accesslog-logrotationtime" +#define CONFIG_ACCESSLOG_LOGROTATIONTIME_ATTRIBUTE "nsslapd-accesslog-logrotationtime" +#define CONFIG_ERRORLOG_LOGROTATIONTIME_DIRECTIVE "errorlog-logrotationtime" +#define CONFIG_ERRORLOG_LOGROTATIONTIME_ATTRIBUTE "nsslapd-errorlog-logrotationtime" +#define CONFIG_AUDITLOG_LOGROTATIONTIME_DIRECTIVE "auditlog-logrotationtime" +#define CONFIG_AUDITLOG_LOGROTATIONTIME_ATTRIBUTE "nsslapd-auditlog-logrotationtime" +#define CONFIG_ACCESSLOG_LOGROTATIONTIMEUNIT_DIRECTIVE "accesslog-logrotationtimeunit" +#define CONFIG_ACCESSLOG_LOGROTATIONTIMEUNIT_ATTRIBUTE "nsslapd-accesslog-logrotationtimeunit" +#define CONFIG_ERRORLOG_LOGROTATIONTIMEUNIT_DIRECTIVE "errorlog-logrotationtimeunit" +#define CONFIG_ERRORLOG_LOGROTATIONTIMEUNIT_ATTRIBUTE "nsslapd-errorlog-logrotationtimeunit" +#define CONFIG_AUDITLOG_LOGROTATIONTIMEUNIT_DIRECTIVE "auditlog-logrotationtimeunit" +#define CONFIG_AUDITLOG_LOGROTATIONTIMEUNIT_ATTRIBUTE "nsslapd-auditlog-logrotationtimeunit" +#define CONFIG_ACCESSLOG_MAXLOGDISKSPACE_DIRECTIVE "accesslog-maxlogdiskspace" +#define CONFIG_ACCESSLOG_MAXLOGDISKSPACE_ATTRIBUTE "nsslapd-accesslog-logmaxdiskspace" +#define CONFIG_ERRORLOG_MAXLOGDISKSPACE_DIRECTIVE "errorlog-maxlogdiskspace" +#define CONFIG_ERRORLOG_MAXLOGDISKSPACE_ATTRIBUTE "nsslapd-errorlog-logmaxdiskspace" +#define CONFIG_AUDITLOG_MAXLOGDISKSPACE_DIRECTIVE "auditlog-maxlogdiskspace" +#define CONFIG_AUDITLOG_MAXLOGDISKSPACE_ATTRIBUTE "nsslapd-auditlog-logmaxdiskspace" +#define CONFIG_ACCESSLOG_MINFREEDISKSPACE_DIRECTIVE "accesslog-minfreediskspace" +#define CONFIG_ACCESSLOG_MINFREEDISKSPACE_ATTRIBUTE "nsslapd-accesslog-logminfreediskspace" +#define CONFIG_ERRORLOG_MINFREEDISKSPACE_DIRECTIVE "errorlog-minfreediskspace" +#define CONFIG_ERRORLOG_MINFREEDISKSPACE_ATTRIBUTE "nsslapd-errorlog-logminfreediskspace" +#define CONFIG_AUDITLOG_MINFREEDISKSPACE_DIRECTIVE "auditlog-minfreediskspace" +#define CONFIG_AUDITLOG_MINFREEDISKSPACE_ATTRIBUTE "nsslapd-auditlog-logminfreediskspace" +#define CONFIG_ACCESSLOG_LOGEXPIRATIONTIME_DIRECTIVE "accesslog-logexpirationtime" +#define CONFIG_ACCESSLOG_LOGEXPIRATIONTIME_ATTRIBUTE "nsslapd-accesslog-logexpirationtime" +#define CONFIG_ERRORLOG_LOGEXPIRATIONTIME_DIRECTIVE "errorlog-logexpirationtime" +#define CONFIG_ERRORLOG_LOGEXPIRATIONTIME_ATTRIBUTE "nsslapd-errorlog-logexpirationtime" +#define CONFIG_AUDITLOG_LOGEXPIRATIONTIME_DIRECTIVE "auditlog-logexpirationtime" +#define CONFIG_AUDITLOG_LOGEXPIRATIONTIME_ATTRIBUTE "nsslapd-auditlog-logexpirationtime" +#define CONFIG_ACCESSLOG_LOGEXPIRATIONTIMEUNIT_DIRECTIVE "accesslog-logexpirationtimeunit" +#define CONFIG_ACCESSLOG_LOGEXPIRATIONTIMEUNIT_ATTRIBUTE "nsslapd-accesslog-logexpirationtimeunit" +#define CONFIG_ERRORLOG_LOGEXPIRATIONTIMEUNIT_DIRECTIVE "errorlog-logexpirationtimeunit" +#define CONFIG_ERRORLOG_LOGEXPIRATIONTIMEUNIT_ATTRIBUTE "nsslapd-errorlog-logexpirationtimeunit" +#define CONFIG_AUDITLOG_LOGEXPIRATIONTIMEUNIT_DIRECTIVE "auditlog-logexpirationtimeunit" +#define CONFIG_AUDITLOG_LOGEXPIRATIONTIMEUNIT_ATTRIBUTE "nsslapd-auditlog-logexpirationtimeunit" +#define CONFIG_ACCESSLOG_LOGGING_ENABLED_DIRECTIVE "accesslog-logging-enabled" +#define CONFIG_ACCESSLOG_LOGGING_ENABLED_ATTRIBUTE "nsslapd-accesslog-logging-enabled" +#define CONFIG_ERRORLOG_LOGGING_ENABLED_DIRECTIVE "errorlog-logging-enabled" +#define CONFIG_ERRORLOG_LOGGING_ENABLED_ATTRIBUTE "nsslapd-errorlog-logging-enabled" +#define CONFIG_AUDITLOG_LOGGING_ENABLED_DIRECTIVE "auditlog-logging-enabled" +#define CONFIG_AUDITLOG_LOGGING_ENABLED_ATTRIBUTE "nsslapd-auditlog-logging-enabled" +#define CONFIG_ROOTDN_DIRECTIVE "rootdn" +#define CONFIG_ROOTDN_ATTRIBUTE "nsslapd-rootdn" +#define CONFIG_ROOTPW_DIRECTIVE "rootpw" +#define CONFIG_ROOTPW_ATTRIBUTE "nsslapd-rootpw" +#define CONFIG_ROOTPWSTORAGESCHEME_DIRECTIVE "rootpwstoragescheme" +#define CONFIG_ROOTPWSTORAGESCHEME_ATTRIBUTE "nsslapd-rootpwstoragescheme" +#define CONFIG_UPDATEDN_DIRECTIVE "updatedn" +#define CONFIG_UPDATEDN_ATTRIBUTE "nsslapd-updatedn" +#define CONFIG_UPDATEPW_DIRECTIVE "updatepw" +#define CONFIG_UPDATEPW_ATTRIBUTE "nsslapd-updatepw" +#define CONFIG_UPDATESSLCLIENT_DIRECTIVE "updateSSLclient" +#define CONFIG_UPDATESSLCLIENT_ATTRIBUTE "nsslapd-updateSSLclient" +#define CONFIG_AUDITFILE_DIRECTIVE "auditfile" +#define CONFIG_AUDITFILE_ATTRIBUTE "nsslapd-auditlog" +#define CONFIG_LASTMOD_DIRECTIVE "lastmod" +#define CONFIG_LASTMOD_ATTRIBUTE "nsslapd-lastmod" +#define CONFIG_INCLUDE_DIRECTIVE "include" +#define CONFIG_INCLUDE_ATTRIBUTE "nsslapd-include" +#define CONFIG_DYNAMICCONF_DIRECTIVE "dynamicconf" +#define CONFIG_DYNAMICCONF_ATTRIBUTE "nsslapd-dynamicconf" +#define CONFIG_USEROC_DIRECTIVE "useroc" +#define CONFIG_USEROC_ATTRIBUTE "nsslapd-useroc" +#define CONFIG_USERAT_DIRECTIVE "userat" +#define CONFIG_USERAT_ATTRIBUTE "nsslapd-userat" +#define CONFIG_SVRTAB_DIRECTIVE "svrtab" +#define CONFIG_SVRTAB_ATTRIBUTE "nsslapd-svrtab" +#ifndef _WIN32 +#define CONFIG_LOCALUSER_DIRECTIVE "localuser" +#define CONFIG_LOCALUSER_ATTRIBUTE "nsslapd-localuser" +#endif /* !_WIN32 */ +#define CONFIG_LOCALHOST_DIRECTIVE "localhost" +#define CONFIG_LOCALHOST_ATTRIBUTE "nsslapd-localhost" +#define CONFIG_PORT_DIRECTIVE "port" +#define CONFIG_PORT_ATTRIBUTE "nsslapd-port" +#define CONFIG_LISTENHOST_DIRECTIVE "listenhost" +#define CONFIG_LISTENHOST_ATTRIBUTE "nsslapd-listenhost" +#define CONFIG_SECURITY_DIRECTIVE "security" +#define CONFIG_SECURITY_ATTRIBUTE "nsslapd-security" +#define CONFIG_SSL3CIPHERS_DIRECTIVE "SSL3ciphers" +#define CONFIG_SSL3CIPHERS_ATTRIBUTE "nsslapd-SSL3ciphers" +#define CONFIG_ACCESSLOG_DIRECTIVE "accesslog" +#define CONFIG_ACCESSLOG_ATTRIBUTE "nsslapd-accesslog" +#define CONFIG_ERRORLOG_DIRECTIVE "errorlog" +#define CONFIG_ERRORLOG_ATTRIBUTE "nsslapd-errorlog" +#define CONFIG_INSTANCEDIR_DIRECTIVE "instancedir" +#define CONFIG_INSTANCEDIR_ATTRIBUTE "nsslapd-instancedir" +#define CONFIG_SECUREPORT_DIRECTIVE "secure-port" +#define CONFIG_SECUREPORT_ATTRIBUTE "nsslapd-securePort" +#define CONFIG_SECURELISTENHOST_DIRECTIVE "secure-listenhost" +#define CONFIG_SECURELISTENHOST_ATTRIBUTE "nsslapd-securelistenhost" +#define CONFIG_THREADNUMBER_DIRECTIVE "threadnumber" +#define CONFIG_THREADNUMBER_ATTRIBUTE "nsslapd-threadnumber" +#define CONFIG_MAXTHREADSPERCONN_DIRECTIVE "maxthreadsperconn" +#define CONFIG_MAXTHREADSPERCONN_ATTRIBUTE "nsslapd-maxthreadsperconn" +#if !defined(_WIN32) && !defined(AIX) +#define CONFIG_MAXDESCRIPTORS_DIRECTIVE "maxdescriptors" +#define CONFIG_MAXDESCRIPTORS_ATTRIBUTE "nsslapd-maxdescriptors" +#endif /* !_WIN32 && ! AIX */ +#define CONFIG_RESERVEDESCRIPTORS_DIRECTIVE "reservedescriptors" +#define CONFIG_RESERVEDESCRIPTORS_ATTRIBUTE "nsslapd-reservedescriptors" +#define CONFIG_IDLETIMEOUT_DIRECTIVE "idletimeout" +#define CONFIG_IDLETIMEOUT_ATTRIBUTE "nsslapd-idletimeout" +#define CONFIG_IOBLOCKTIMEOUT_DIRECTIVE "ioblocktimeout" +#define CONFIG_IOBLOCKTIMEOUT_ATTRIBUTE "nsslapd-ioblocktimeout" +#define CONFIG_NTSYNCH_DIRECTIVE "ntsynch" +#define CONFIG_NTSYNCH_ATTRIBUTE "nsslapd-NTSynch" +#define CONFIG_NTSYNCHUSESSL_DIRECTIVE "ntsynchusessl" +#define CONFIG_NTSYNCHUSESSL_ATTRIBUTE "nsslapd-NTSynch-SSL" +#define CONFIG_NTSYNCHPORT_DIRECTIVE "ntsynch-port" +#define CONFIG_NTSYNCHPORT_ATTRIBUTE "nsslapd-NTSynch-port" +#define CONFIG_ACCESSCONTROL_DIRECTIVE "accesscontrol" +#define CONFIG_ACCESSCONTROL_ATTRIBUTE "nsslapd-accesscontrol" +#define CONFIG_GROUPEVALNESTLEVEL_DIRECTIVE "groupevalnestlevel" +#define CONFIG_GROUPEVALNESTLEVEL_ATTRIBUTE "nsslapd-groupevalnestlevel" +#define CONFIG_NAGLE_DIRECTIVE "nagle" +#define CONFIG_NAGLE_ATTRIBUTE "nsslapd-nagle" +#define CONFIG_PW_CHANGE_DIRECTIVE "pw_change" +#define CONFIG_PW_CHANGE_ATTRIBUTE "passwordChange" +#define CONFIG_PW_MUSTCHANGE_DIRECTIVE "pw_must_change" +#define CONFIG_PW_MUSTCHANGE_ATTRIBUTE "passwordMustChange" +#define CONFIG_PW_SYNTAX_DIRECTIVE "pw_syntax" +#define CONFIG_PW_SYNTAX_ATTRIBUTE "passwordCheckSyntax" +#define CONFIG_PW_MINLENGTH_DIRECTIVE "pw_minlength" +#define CONFIG_PW_MINLENGTH_ATTRIBUTE "passwordMinLength" +#define CONFIG_PW_EXP_DIRECTIVE "pw_exp" +#define CONFIG_PW_EXP_ATTRIBUTE "passwordExp" +#define CONFIG_PW_MAXAGE_DIRECTIVE "pw_maxage" +#define CONFIG_PW_MAXAGE_ATTRIBUTE "passwordMaxAge" +#define CONFIG_PW_MINAGE_DIRECTIVE "pw_minage" +#define CONFIG_PW_MINAGE_ATTRIBUTE "passwordMinAge" +#define CONFIG_PW_WARNING_DIRECTIVE "pw_warning" +#define CONFIG_PW_WARNING_ATTRIBUTE "passwordWarning" +#define CONFIG_PW_HISTORY_DIRECTIVE "pw_history" +#define CONFIG_PW_HISTORY_ATTRIBUTE "passwordHistory" +#define CONFIG_PW_INHISTORY_DIRECTIVE "pw_inhistory" +#define CONFIG_PW_INHISTORY_ATTRIBUTE "passwordInHistory" +#define CONFIG_PW_LOCKOUT_DIRECTIVE "pw_lockout" +#define CONFIG_PW_LOCKOUT_ATTRIBUTE "passwordLockout" +#define CONFIG_PW_STORAGESCHEME_DIRECTIVE "pw_storagescheme" +#define CONFIG_PW_STORAGESCHEME_ATTRIBUTE "passwordStorageScheme" +#define CONFIG_PW_MAXFAILURE_DIRECTIVE "pw_maxfailure" +#define CONFIG_PW_MAXFAILURE_ATTRIBUTE "passwordMaxFailure" +#define CONFIG_PW_UNLOCK_DIRECTIVE "pw_unlock" +#define CONFIG_PW_UNLOCK_ATTRIBUTE "passwordUnlock" +#define CONFIG_PW_LOCKDURATION_DIRECTIVE "pw_lockduration" +#define CONFIG_PW_LOCKDURATION_ATTRIBUTE "passwordLockoutDuration" +#define CONFIG_PW_RESETFAILURECOUNT_DIRECTIVE "pw_resetfailurecount" +#define CONFIG_PW_RESETFAILURECOUNT_ATTRIBUTE "passwordResetFailureCount" +#define CONFIG_ACCESSLOG_BUFFERING_DIRECTIVE "logbuffering" +#define CONFIG_ACCESSLOG_BUFFERING_ATTRIBUTE "nsslapd-accesslog-logbuffering" +#define CONFIG_CHANGELOG_DIR_DIRECTIVE "changelogdir" +#define CONFIG_CHANGELOG_DIR_ATTRIBUTE "nsslapd-changelogdir" +#define CONFIG_CHANGELOG_SUFFIX_DIRECTIVE "changelogsuffix" +#define CONFIG_CHANGELOG_SUFFIX_ATTRIBUTE "nsslapd-changelogsuffix" +#define CONFIG_CHANGELOG_MAXENTRIES_DIRECTIVE "changelogmaxextries" +#define CONFIG_CHANGELOG_MAXENTRIES_ATTRIBUTE "nsslapd-changelogmaxentries" +#define CONFIG_CHANGELOG_MAXAGE_DIRECTIVE "changelogmaxage" +#define CONFIG_CHANGELOG_MAXAGE_ATTRIBUTE "nsslapd-changelogmaxage" +#define CONFIG_RETURN_EXACT_CASE_DIRECTIVE "return_exact_case" +#define CONFIG_RESULT_TWEAK_DIRECTIVE "result_tweak" +#define CONFIG_REFERRAL_MODE_DIRECTIVE "referralmode" +#define CONFIG_ATTRIBUTE_NAME_EXCEPTION_DIRECTIVE "attribute_name_exceptions" +#define CONFIG_MAXBERSIZE_DIRECTIVE "maxbersize" +#define CONFIG_VERSIONSTRING_DIRECTIVE "versionstring" +#define CONFIG_ENQUOTE_SUP_OC_DIRECTIVE "enquote_sup_oc" +#define CONFIG_ENQUOTE_SUP_OC_ATTRIBUTE "nsslapd-enquote_sup_oc" +#define CONFIG_BASEDN_DIRECTIVE "certmap-basedn" +#define CONFIG_BASEDN_ATTRIBUTE "nsslapd-certmap-basedn" + +%HashParametersName = (); + +# The following hash displays only general server parameters to migrate under cn=config +%GeneralSrvParamToMigrate = ( + 'accesscontrol' => 'nsslapd-accesscontrol', + 'errorlog-logging-enabled' => 'nsslapd-errorlog-logging-enabled', + 'accesslog-logging-enabled' => 'nsslapd-accesslog-logging-enabled', + 'auditlog-logging-enabled' => 'nsslapd-auditlog-logging-enabled', + 'logbuffering' => 'nsslapd-accesslog-logbuffering', + 'accesslog-logexpirationtime' => 'nsslapd-accesslog-logexpirationtime', + 'accesslog-logexpirationtimeunit' => 'nsslapd-accesslog-logexpirationtimeunit', + 'accesslog-maxlogdiskspace' => 'nsslapd-accesslog-logmaxdiskspace', + 'accesslog-minfreediskspace' => 'nsslapd-accesslog-logminfreediskspace', + 'accesslog-logrotationtime' => 'nsslapd-accesslog-logrotationtime', + 'accesslog-logrotationtimeunit' => 'nsslapd-accesslog-logrotationtimeunit', + 'accesslog-maxlogsize' => 'nsslapd-accesslog-maxlogsize', + 'accesslog-maxnumoflogsperdir' => 'nsslapd-accesslog-maxLogsPerDir', + 'auditlog-logexpirationtime' => 'nsslapd-auditlog-logexpirationtime', + 'auditlog-logexpirationtimeunit' => 'nsslapd-auditlog-logexpirationtimeunit', + 'auditlog-maxlogdiskspace' => 'nsslapd-auditlog-logmaxdiskspace', + 'auditlog-minfreediskspace' => 'nsslapd-auditlog-logminfreediskspace', + 'auditlog-logrotationtime' => 'nsslapd-auditlog-logrotationtime', + 'auditlog-logrotationtimeunit' => 'nsslapd-auditlog-logrotationtimeunit', + 'auditlog-maxlogsize' => 'nsslapd-auditlog-maxlogsize', + 'auditlog-maxnumoflogsperdir' => 'nsslapd-auditlog-maxLogsPerDir', + 'certmap-basedn' => 'nsslapd-certmap-basedn', + 'enquote_sup_oc' => 'nsslapd-enquote-sup-oc', + 'loglevel' => 'nsslapd-errorlog-level', + 'errorlog-logexpirationtime' => 'nsslapd-errorlog-logexpirationtime', + 'errorlog-logexpirationtimeunit' => 'nsslapd-errorlog-logexpirationtimeunit', + 'errorlog-maxlogdiskspace' => 'nsslapd-errorlog-logmaxdiskspace', + 'errorlog-minfreediskspace' => 'nsslapd-errorlog-logminfreediskspace', + 'errorlog-logrotationtime' => 'nsslapd-errorlog-logrotationtime', + 'errorlog-logrotationtimeunit' => 'nsslapd-errorlog-logrotationtimeunit', + 'errorlog-maxlogsize' => 'nsslapd-errorlog-maxlogsize', + 'errorlog-maxnumoflogsperdir' => 'nsslapd-errorlog-maxlogsperdir', + 'idletimeout' => 'nsslapd-idletimeout', + 'ioblocktimeout' => 'nsslapd-ioblocktimeout', + 'lastmod' => 'nsslapd-lastmod', + 'listenhost' => 'nsslapd-listenhost', + 'maxdescriptors' => 'nsslapd-maxdescriptors', + 'referral' => 'nsslapd-referral', + 'reservedescriptors' => 'nsslapd-reservedescriptors', + 'rootpwstoragescheme' => 'nsslapd-rootpwstoragescheme', + 'schemacheck' => 'nsslapd-schemacheck', + 'secure-port' => 'nsslapd-securePort', + 'security' => 'nsslapd-security', + 'sizelimit' => 'nsslapd-sizelimit', + 'SSL3ciphers' => 'nsslapd-SSL3ciphers', + 'timelimit' => 'nsslapd-timelimit', + 'pw_change' => 'passwordChange', + 'pw_syntax' => 'passwordCheckSyntax', + 'pw_exp' => 'passwordExp', + 'pw_history' => 'passwordHistory', + 'pw_inhistory' => 'passwordInHistory', + 'pw_lockout' => 'passwordLockout', + 'pw_lockduration' => 'passwordLockoutDuration', + 'pw_maxage' => 'passwordMaxAge', + 'pw_maxfailure' => 'passwordMaxFailure', + 'pw_minage' => 'passwordMinAge', + 'pw_minlength' => 'passwordMinLength', + 'pw_must_change' => 'passwordMustChange', + 'pw_resetfailurecount' => 'passwordResetFailureCount', + 'pw_storagescheme' => 'passwordStorageScheme', + 'pw_unlock' => 'passwordUnlock', + 'pw_warning' => 'passwordWarning' +); + +# the following hash displays global parameters related to database stored under cn=config,cn=ldbm database,cn=plugins,cn=config +%GlobalConfigLDBMparamToMigrate = ( + 'allidsthreshold' => 'nsslapd-allidsthreshold', + 'lookthroughlimit' => 'nsslapd-lookthroughlimit', + 'mode' => 'nsslapd-mode', + 'dbcachesize' => 'nsslapd-dbcachesize' +); + +# the following hash displays specific parameters to each backends and stored under cn=DBname,cn=ldbm database,cn=plugins,cn=config +%LDBMparamToMigrate = ( + 'cachesize' => 'nsslapd-cachesize', + 'readonly' => 'nsslapd-readonly' +); + +%stdIncludes = ( + "${oldConfDir}slapd.at.conf", "\n", + "${oldConfDir}slapd.oc.conf", "\n", + "${oldConfDir}java-object-schema.conf", "\n", + "${oldConfDir}ns-admin-schema.conf", "\n", + "${oldConfDir}ns-calendar-schema.conf", "\n", + "${oldConfDir}ns-certificate-schema.conf", "\n", + "${oldConfDir}ns-common-schema.conf", "\n", + "${oldConfDir}ns-compass-schema.conf", "\n", + "${oldConfDir}ns-delegated-admin-schema.conf", "\n", + "${oldConfDir}ns-directory-schema.conf", "\n", + "${oldConfDir}ns-legacy-schema.conf", "\n", + "${oldConfDir}ns-mail-schema.conf", "\n", + "${oldConfDir}ns-mcd-browser-schema.conf", "\n", + "${oldConfDir}ns-mcd-config-schema.conf", "\n", + "${oldConfDir}ns-mcd-li-schema.conf", "\n", + "${oldConfDir}ns-mcd-mail-schema.conf", "\n", + "${oldConfDir}ns-media-schema.conf", "\n", + "${oldConfDir}ns-mlm-schema.conf", "\n", + "${oldConfDir}ns-msg-schema.conf", "\n", + "${oldConfDir}ns-netshare-schema.conf", "\n", + "${oldConfDir}ns-news-schema.conf", "\n", + "${oldConfDir}ns-proxy-schema.conf", "\n", + "${oldConfDir}ns-value-schema.conf", "\n", + "${oldConfDir}ns-wcal-schema.conf", "\n", + "${oldConfDir}ns-cos-schema.conf", "\n", + "${oldConfDir}ns-web-schema.conf", "\n" +); + +%userDefinedConfigFiles = ( + "slapd.conf", "\n", + "slapd.ldbm.conf", "\n", + "slapd.user_at.conf", "\n", + "slapd.user_oc.conf", "\n", + "ns-schema.conf", "\n" + ); + +$CIS_SYNTAX_OID = "1.3.6.1.4.1.1466.115.121.1.15" ; +$TELEPHONE_SYNTAX_OID = "1.3.6.1.4.1.1466.115.121.1.50" ; +$DN_SYNTAX_OID = "1.3.6.1.4.1.1466.115.121.1.12" ; +$CES_SYNTAX_OID = "1.3.6.1.4.1.1466.115.121.1.26" ; +$INT_SYNTAX_OID = "1.3.6.1.4.1.1466.115.121.1.27" ; +$BIN_SYNTAX_OID = "1.3.6.1.4.1.1466.115.121.1.5" ; + +%allowedPlugins = ( + "cis", $CIS_SYNTAX_OID, + "tel", $TELEPHONE_SYNTAX_OID, + "dn", $DN_SYNTAX_OID, + "ces", $CES_SYNTAX_OID, + "int", $INT_SYNTAX_OID, + "bin", $BIN_SYNTAX_OID + ); + +%allowedModifiers = ( + "single", "SINGLE-VALUE" + ); +# "override" is not supported anymore and "operational" cannot be used in user defined attribute. + +@oldSuffixes = () ; # array of 4.x suffixes (with "o=netscaperoot" if presents) + +# link beetwen the name of the suffix and its associated DBname +%DBNAMES = () ; +%DBDirectory = () ; + +%oldhash = () ; + +# list of standard plugin's in version 4 +%stdPlugins = ( + "7-bit check" => "\n", + "binary syntax" => "\n", + "case exact string syntax" => "\n", + "case ignore string syntax" => "\n", + "distinguished name syntax" => "\n", + "integer syntax" => "\n", + "internationalization plugin" => "\n", + "referential integrity postoperation" => "\n", + "telephone syntax" => "\n", + "uid uniqueness" => "\n" + + ); + +# list of standard indexes configured out of the box in version 4 +%stdIndex = ( + 'aci', "\n", + 'changenumber', "\n", + 'copiedfrom', "\n", + 'dncomp', "\n", + 'entrydn', "\n", + 'numsubordinates', "\n", + 'objectclass', "\n", + 'parentid', "\n" +); + +# list of user added Plugin's. In 5.x, they 'll need to be recompiled +@badPlugins = () ; + +%newIndex = () ; + +%User_oc = () ; +# push objectnames as they are encountered in config files. +@User_oc_names = () ; + +%User_at = () ; + + + +#Usage parameters +$USER_OC_FILE_MODIFIED = 0 ; # 0 if user don't want to modify LDIF objectclasses before processing, 1 else +$USER_AT_FILE_MODIFIED = 0 ; +$INDEX_FILE_MODIFIED = 0 ; + +# Shutdown the legacy Directory instance +printTrace("\nShutdown the legacy Directory Server instance: ${oldHome}",0); +&stopServer($oldDir, 'slapd-'.$oldname); + +# compare configuration files with the standard ones +CompareStdConfigFiles() ; +die "\n\n The version of the product you want to migrate is not a 4.x Netscape Directory Server\n" unless ($oldVersion == 4) ; + +FillHashParametersName() ; + +############### Connect to the 5.x LDAP Directory Server ###################### +$ENV{"$LIB_PATH"} = "$root${PATHSEP}lib${SEP}".$ENV{"$LIB_PATH"} ; +my $LDAPservername = &getLDAPservername(); +die "\n Migration aborted. Check your 4.x and 5.x Netscape Directory Server are installed on the same machine \n" if ( $LDAPservername == -1 ); +$conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Can't contact the $Version.$Minor LDAP server: $LDAPservername\n"; + +# continue if the connection to 5.x LDAP server is successful ! +printTrace("\nConnected to $Version.$Minor LDAP server\n",0) ; + +# get the uid and gid of the 5.x slapd user +($localuser, $newuid, $newgid) = getuid_gid(); +# get the uid and gid of the 4.x slapd user +($oldlocaluser, $olduid, $oldgid) = getolduid_gid(); + +# backup 5.x configuration files in /slapd-instancename/config +printTrace("\nBackup $serverHome${PATHSEP}config on $serverHome${PATHSEP}config_backup ...",0); +&backupConfigFiles(); + +# Parse the main configuration file: slapd.conf +printTrace("\nParse the configuration file: $oldSlapdConf...",0); +ParseSlapdConf("< ${oldSlapdConf}"); + +#migrate key/cert databases +printTrace("\nMigrate key/cert databases...",0); +&MigrateSSL(); + +# Update parameters : general server parameters, global LDBM parameter, specific backend parameters +printTrace("\nUpdate general server parameters...",0); +AddGeneralParameters(); +printTrace("\nUpdate global LDBM parameters...",0); +AddGeneralLDBMParameters(); +printTrace("\nUpdate specific backend parameters...",0); +AddSpecificLDBMParameters(); + +##### FOR TESTING PURPOSE ONLY ######## +# +#testIndexUpdating(); +# +####################################### + +# Migrate some entries contained in the old dse.ldif, and migrate certmap.conf +&MigrateDSE() ; +&MigrateCertmap() ; + +# update 5.x attribute definitions +LDAPmodify_User_at(); + +# update 5.x object classes definitions +LDAPmodify_User_oc(); + +# add new indexes to each backends +LDAPmodify_Indexes(); + +# migrate Plug'ins parameters (enable attribute, and arguments) +LDAPmodify_stdPlugin(); + +################## Close the connection to 5.x LDAP Server ##################### +$conn->close; + + +################## stop the 5.x instance and Export/Import the data, restart the server ################## +if (%DBNAMES) { + &stopServer($root,'slapd-'.$newname); + printTrace("\ndata processing...",0) ; + # migrate data for each suffix: 4.x -> LDIF files + &db2ldif($oldSlapdConf); + + # migrate LDIF data to the 5.x database: LDIF -> 5.x + &manyLdif2db(); + &startServer(); +} +else { + printTrace("\nThere no 4.x non-standard suffixes to migrate",0); +} + +printMsg("\n\n ****** End of migration ******\n\n"); + +close(LOGFILE); + + +########################################################################################### +# get input users +sub getParameters { + my $exit = 0 ; + my $i = 0; + my $pwdfile= ""; + while ($i <= $#ARGV) { + if ( "$ARGV[$i]" eq "-D" ) { # directory manager + if (! $rootDN) { + $rootDN = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-w") { # password + if (! $rootpwd) { + $rootpwd = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-j") { # password file + if (! $pwdfile) { + $pwdfile = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-o") { # 4.x instance path + if (! $oldHome ) { + $oldHome = $ARGV[++$i] ; + grep { s@\\@/@g } $oldHome if $isNT ; + if ($oldHome =~ /[\"]?(.*)?[\"]?/) { $oldHome = $1 ; } + if ($oldHome =~ m@^(.*)/([^-/]*)-([^/]*)[/]?$@) { + $oldDir = $1 ; + $type = $2 ; + $oldname = $3 ; + if ($isNT) { + $oldDir = lc($oldDir) ; + $type = lc($type) ; + $oldname = lc($oldname) ; + $oldHome = lc($oldHome) ; + grep { s@/@\\@g } $oldDir ; + grep { s@/@\\@g } $oldHome ; + } + } + else { + print("\nThe 4.x instance path is not correct. It must be like slapd-instancename"); + &usage(); + exit(1); + } + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-n") { # 5.x instance path + if (! $serverHome ) { + $serverHome = $ARGV[++$i] ; + grep { s@\\@/@g } $root if $isNT ; + grep { s@\\@/@g } $serverHome if $isNT ; + if ($serverHome =~ /[\"]?(.*)?[\"]?/) { $serverHome = $1 ; } + if ($serverHome =~ m@^(.*?)/?([^/-]*)-([^/]*)[/]?$@) { + $root = $1 if ($1); + $type = $2 ; + $newname = $3 ; + if ($isNT) { + $root = lc($root) ; + $type = lc($type) ; + $newname = lc($newname) ; + $serverHome = lc($serverHome) ; + grep { s@/@\\@g } $root ; + grep { s@/@\\@g } $serverHome ; + } + } + else { + print("\nThe 5.x instance path is not correct. It must be like slapd-instancename"); + &usage(); + exit(1); + } + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-p") { # 5.x DS port + if (! $newport ) { + $newport = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-t") { # TRACELEVEL + my $value = $ARGV[++$i] ; + if ($value =~ /[0-3]/) { + $TRACELEVEL = $value ; + } + else { + print("\nThe tracelevel must belong to 0..3 interval"); + &usage(); + exit(); + } + } elsif ("$ARGV[$i]" eq "-noinput") { # no user interventions during processing + $NO_INPUT_USER = 1 ; + } elsif ("$ARGV[$i]" eq "-L") { # migration logfile + $LogFileReport = $ARGV[++$i] ; + } + else { + print("\nThe option $ARGV[$i] is not recognized"); + &usage() ; + exit(1); + } + $i++; + } + if (! $rootDN) { + print("\nThe rootDN is missing"); + $exit = 1; + } + if ($pwdfile ne "") { + # Open file and get the password + unless (open (RPASS, $pwfile)) { + die "Error, cannot open password file $passwdfile\n"; + } + $rootpwd = ; + chomp($rootpwd); + close(RPASS); + } elsif ($rootpwd eq "-"){ + # Read the password from terminal + die "The '-w -' option requires an extension library (Term::ReadKey) which is not\n", + "part of the standard perl distribution. If you want to use it, you must\n", + "download and install the module. You can find it at\n", + "http://www.perl.com/CPAN/CPAN.html\n"; + # Remove the previous line and uncomment the following 6 lines once you have installed Term::ReadKey module. +# use Term::ReadKey; +# print "Bind Password: "; +# ReadMode('noecho'); +# $rootpwd = ReadLine(0); +# chomp($rootpwd); +# ReadMode('normal'); + } + if (! $rootpwd) { + print("\nThe rootpwd is missing"); + $exit = 1 ; + } + if (! $newport) { + print("\nThe port is missing"); + $exit = 1; + } + if (! $serverHome) { + print("\nThe 5.x instance path is missing"); + $exit = 1; + } + if (! $oldHome) { + print("\nThe 4.x instance path is missing"); + $exit = 1; + } + if ((! $LogFileReport) && $serverHome) { + ($sec, $min, $hour, $dd, $mm, $yy) = &GetTime(); + $LogFileReport = "${serverHome}${PATHSEP}logs${PATHSEP}Migration_${dd}${mm}${yy}_${hour}${min}${sec}.log"; + } + + if ($exit) { + &usage() ; + exit(1); + } + +} + + +############################################################################### +# This subroutine is used to parse the slapd.conf configuration file and migrate specific parameters contained in it + + +sub ParseSlapdConf { + my $oldsrc = shift; + my $NumLine = 0 ; + # read the old conf file into a hash table + open( OLDSRC, $oldsrc ) || die "Can't open $oldsrc: $!: "; + LINE: while ( ) { + $NumLine++ ; + printTrace("\nLine: $_",4) ; + if (/^\s*\#/) { # skip comments + printTrace("\n# ",4) ; + next LINE; + } + if (/^\s*$/) { # skip blank lines + printTrace("\nBLANK LINE",4); + next LINE; + } elsif (/^suffix\s+/i) { + chomp($_) ; + CheckSuffix($_); + } elsif (/^plugin/i) { + printTrace("\nPLUGIN",4); + chomp($_); + if (! &isAStandardPlugin($_)) { + push @badPlugins, $_; + } + else { + my $Plugin = $_ ; + if (! &ParsePlugin($_,$NumLine)) { + printMsg("\nLine $NumLine, syntax error of the plugin:\n$Plugin"); + } + } + } elsif (/^include\s+[\"]?(.*?)[\"]?\s*$/i) { + # strip leading and trailing " + my $include_file = $1 ; + grep { s@/@\\@g } $include_file if $isNT; + if (! &isAStandardInclude($include_file)) { + printTrace("\nFILE: $1 NOT STANDARD",4) ; + &ParseConfigurationFile($include_file); + printTrace("\nEXIT ParseConfigurationFile: $include_file",4) ; + } + } elsif (/^userat\s+[\"]?(.*?)[\"]?\s*$/i) { + printTrace("\nuserat: $1",4); + my $at_file = $1 ; + grep { s@/@\\@g } $at_file if $isNT; + # Parse user defined attributes + &ParseAttributesFile($at_file); + } elsif (/^useroc\s+[\"]?(.*?)[\"]?\s*$/i) { + printTrace("\nuseroc: $1",4); + my $oc_file = $1 ; + grep { s@/@\\@g } $oc_file if $isNT; + # Parse user defined object classes + &ParseObjectClassesFile($oc_file); + } elsif (/^dynamicconf\s+[\"]?(.*?)[\"]?\s*$/i){ + printTrace("\ndynamicconf: $1",4); + my $dynamiconf_file = $1 ; + grep { s@/@\\@g } $dynamiconf_file if $isNT; + # Parse dynamic configuration file (e-g slapd.ldbm.conf) + &ParseConfigurationFile($dynamiconf_file); + } elsif (/^\s*(\S+)\s+[\"]?(.*?)[\"]?\s*$/) { + printTrace("\nParseParameters: $1",4); + # Parse parameters and record the associated value in %oldhash + &ParseParameters($1,$2,$NumLine); + } else { + printTrace("\nUnknown format of configuration data: $_",0); } + } + close(OLDSRC); + + } + + + +############################################################################# +# return 1 if the suffix already exists, 0 else +sub existSuffix { + my $suffixname = shift ; + my $entry = $conn->search("cn=\"$suffixname\",cn=mapping tree,cn=config ", "base","objectclass=*") ; + return 1 if ($entry) ; + return 0 ; +} + +# return the name of the backend if it has been successfully created, 0 else +sub createBackend { + my $suffixname = shift ; + my $backend = "MigratedDB_0" ; + my $NbRetry = 1 ; + my $entry = $conn->search("cn=$backend,cn=ldbm database,cn=plugins,cn=config ", "base","objectclass=*") ; + while ($entry) { + # try to find another name for the backend + $backend = "MigratedDB_$NbRetry" ; + $entry = $conn->search("cn=$backend,cn=ldbm database,cn=plugins,cn=config ", "base","objectclass=*") ; + $NbRetry++; + } + # normally I should have a unique name for the backend + my $suffixarg = "nsslapd-suffix" ; + $entry = $conn->newEntry() ; + $entry->setDN("cn=$backend,cn=ldbm database,cn=plugins,cn=config"); + $entry->setValues("objectclass", "top", "extensibleObject", "nsBackendInstance" ); + $entry->setValues("cn", $backend ); + $entry->setValues($suffixarg, $suffixname ); + my $res = $conn->add($entry) ; + if ($res) { + return $backend ; + } + else { + return 0 ; + } +} + +# return 1, if add the new entry in the mapping tree, else 0 +sub AddEntryInMappingTree { + my $backend = shift ; + my $entry = $conn->search("cn=$backend,cn=ldbm database,cn=plugins,cn=config ", "base","objectclass=*") ; + if ($entry) { + printTrace("\nAddEntry in progress ...",4) ; + my $suffixarg = "nsslapd-suffix" ; + my $statearg = "nsslapd-state" ; + my $backendarg= "nsslapd-backend"; + my $suffixname = $entry->{$suffixarg}[0]; + $entry = $conn->newEntry() ; + $entry->setDN("cn=\"$suffixname\",cn=mapping tree,cn=config") ; + $entry->setValues("objectclass", "top", "extensibleObject", "nsMappingTree" ); + $entry->setValues("cn", "\"$suffixname\""); + $entry->setValues($statearg, "backend"); + $entry->setValues($backendarg, $backend); + return $conn->add($entry); + } + else { + printTrace("\nNo AddEntry processed for $backend",4); + return 0 ; + } +} + + +# Treat the case where the suffix is "o=NetscapeRoot" +sub CheckSuffix { + my $suffix = shift ; + my $suffixname ; + if (!(/^suffix\s+\"?(.*?)\"?\s*$/i)) { + printMsg("Syntax error of the suffix: $suffix"); + return 0 ; + } + else { + $suffixname = $1 ; + } + if (/^suffix\s+\"?\s*o=netscaperoot\s*\"?\s*$/i) { + printTrace("\nFor the suffix o=NetscapeRoot, we do nothing",1); + # treat the case where the suffix is "o=NetscapeRoot" + } + else { + push @oldSuffixes, $_; + # check if the suffix already exists in the 5.x DS target + if (! existSuffix($suffixname)) { + printTrace("\nSuffix $suffixname doesn't exist",1) ; + # create a new backend with the name of the suffix preceded by MigratedDB_ + my $backend = createBackend($suffixname) ; + if ($backend) { + printTrace("\nBackend: $backend has been created !!!",1); + # if the creation of the backend is ok, we add a new entry in the mapping tree + if (AddEntryInMappingTree($backend)) { + # We add the association dbname->suffix in the hash %DBNAMES + $DBNAMES{$suffixname} = $backend ; + # get the db filename + $entry = $conn->search("cn=$backend,cn=ldbm database,cn=plugins,cn=config ", "base","objectclass=*") ; + my $dirarg = "nsslapd-directory"; + $DBDirectory{$backend} = $entry->{$dirarg}[0]; + printTrace("\nThe relation $backend->$suffixname has been added to the mapping tree",2); + } + else { + printMsg("\nCOULD NOT ADD ENTRY: $backend->$suffixname IN MAPPINGTREE"); + } + } + else { + printMsg("\nCOULD NOT CREATE BACKEND: $backend"); + } + } + else { + printTrace("\nSuffix: $suffixname already exists",1); + # the suffix already exists in the 5.x DS + } + } + return 1 ; +} + +############################################################################# +# Usefull to know the standard configuration +sub isAStandardPlugin { + my $line = shift; + chomp($line); + printTrace("\nStdPlugin?: $line",4); + if ($line =~ /^plugin\s+(database|extendop|preoperation|postoperation|matchingrule|syntax)\s+(on|off)\s+\"(.*?)\"\s+\"(.*?)\"\s+(\S+)(.*)$/i) { + # $1 = , $2 = , $3 = , $4 = , $5 = , $6 = []* + printTrace("\nName: $3, pathname: $4, init_function: $5",4); + + my $LC_line = lc($3); + my $Value = $stdPlugins{$LC_line} ; + if ($Value) { + printTrace("\nIS A STANDARD PLUGIN",4); + } + else { + printTrace("\nNOT A STANDARD PLUGIN",4); + } + return $stdPlugins{$LC_line} ; + } + else { + printTrace("\nSYNTAX ERROR PLUGIN",4); + return 0 ; + } +} + +sub isAStandardIndex { + my $line = shift ; + chomp($line); + if ($line =~ /^index\s+(\S+).*/i) { + my $LC_line = lc($1); + my $Value = $stdIndex{$LC_line} ; + printTrace("\nInclude: $LC_line \nValue: $Value", 4); + return $stdIndex{$LC_line}; + } + else { + return 0 ; + } +} + + +sub isAStandardInclude { + my $line = shift; + + chomp($line); + if ($isNT){ + return $stdIncludes{lc($line)}; + } + else { + return $stdIncludes{$line} ; + } +} + +############################################################################# +# +# Execute a Perldap command to update plugins definition in the 5.x schema + +sub LDAPmodify_stdPlugin { + my $Filename = shift ; + my @pluginames = keys(%stdPlugins); + if (! $STDPLUGINS_FILE_MODIFIED) { + printTrace("\nLDAPmodify_plugin",4); + printTrace("\nMigrate plugin's...",1); + foreach $pluginame ( @pluginames ) { + my $update_plugin = 0 ; + my $ref_plugin = $stdPlugins{$pluginame}; + if ($ref_plugin ne "\n") { + my $name = $ref_plugin->name ; + my $entry = $conn->search("cn=$name,cn=plugins,cn=config", "base","objectclass=nsSlapdPlugin") ; + if ($entry) { + my $pluginenabled="nsslapd-pluginenabled" ; + if (($entry->{$pluginenabled}[0]) ne $ref_plugin->enable) { + $update_plugin = 1 ; + my $enable = $ref_plugin->enable ; + printTrace("\n$pluginame, plugin-enable: $enable",3) ; + $entry->setValues($pluginenabled, $enable ); + } + my $ArgNum = 0 ; + foreach $ArgValue (@{$ref_plugin->args}) { + my $Arg="nsslapd-pluginarg$ArgNum"; + printTrace("\n$Arg: $ArgValue",3) ; + if ($entry->{$Arg}[0] ne $ArgValue) { + printTrace("\n$pluginame, $Arg: $ArgValue",3) ; + $update_plugin = 1 ; + $entry->setValues($Arg, $ArgValue) ; + } + $ArgNum++ ; + } + if ($update_plugin) { + printTrace("\n$pluginame is being updated...",2); + my $res = $conn->update($entry) ; + if ($res) { + printTrace("\nupdated !",2); + } + else { + printMsg("\nError during update of plugin: $pluginame") ; + $MigrationErrors .= "\nError during update of plugin: $pluginame"; + } + } + else { + printTrace("\n$pluginame has not changed",4); + } + } + else { + printMsg("\ncan't access the plugin: cn=$name,cn=plugins,cn=config"); + } + } + else { + printTrace("\nPLUGIN NOT RECORDED: $pluginame",4) ; + } + } + } + else { + # treat the case where the user wants to look at these plugins before processing + } +} + +############################################################################# +# Execute Perldap command to add new indexes to the migrated instances + +sub LDAPmodify_Indexes { + my $Filename = shift ; + my @indexnames = keys(%newIndex); + my @suffixnames = keys(%DBNAMES); + if ((! $INDEX_FILE_MODIFIED) && (%DBNAMES)) { + # we update indexes only if there is at least one backend to migrate + printTrace("\nLDAPmodify_indexes",4); + printTrace("\nMigrate indexes...",1); + foreach $indexname ( @indexnames ) { + printTrace("\nIndexName: $indexname",4); + printTrace("\nIndexTypes: .@{$newIndex{$indexname}->types}.", 4) ; + printTrace("\nIndexOIDS: .@{$newIndex{$indexname}->oids}.", 4) ; + foreach $suffixname ( @suffixnames ) { + # check if the index already exists ! + printTrace("\nsearch for cn=$indexname,cn=index,cn=$DBNAMES{$suffixname},cn=ldbm database,cn=plugins,cn=config...", 3); + my $entry = $conn->search("cn=$indexname,cn=index,cn=$DBNAMES{$suffixname},cn=ldbm database,cn=plugins,cn=config","base","objectclass=nsIndex"); + if (! $entry) { + # create a new index + printTrace("index $indexname is being created under cn=index,cn=$DBNAMES{$suffixname},cn=ldbm database,cn=plugins,cn=config...",2); + my $entry = $conn->newEntry(); + $entry->setDN("cn=$indexname,cn=index,cn=$DBNAMES{$suffixname},cn=ldbm database,cn=plugins,cn=config"); + $entry->setValues("objectclass", "top", "nsIndex" ) ; + $entry->setValues("cn", $indexname) ; + $entry->setValues("nssystemindex", "false") ; + my @types = @{$newIndex{$indexname}->types} ; + my @oids = @{$newIndex{$indexname}->oids} ; + $entry->setValues("nsindextype", @types) if (@types) ; + $entry->setValues("nsmatchingrule", @oids ) if (@oids); + my $res = $conn->add($entry) ; + if ($res) { + printTrace("\nAdd index successfully: $indexname for backend: $DBNAMES{$suffixname}",2); + } + else { + printMsg("\n Failed to add the index: $indexname to backend: $DBNAMES{$suffixname}"); + $MigrationErrors .= "\n Failed to add the index: $indexname to backend: $DBNAMES{$suffixname}" ; + } + } + elsif ($entry->{nssystemindex}[0] eq "false") { + # if the index is not a system index, we update it + printTrace("\nindex $indexname is being processed under cn=index,cn=$DBNAMES{$suffixname},cn=ldbm database,cn=plugins,cn=config...",2); + my @types = @{$newIndex{$indexname}->types} ; printTrace("\ntypes: .@types.",2) ; + my @oids = @{$newIndex{$indexname}->oids} ; printTrace("\noids: .@oids.",2) ; + my @existing_types = $entry->getValues("nsindextype"); + my @existing_oids = $entry->getValues("nsmatchingrule"); + # get the elements present in @types and not present in @existing_types + my @typesToAdd = &getDiff(\@types, \@existing_types); + # same for matchingrules + my @oidsToAdd = &getDiff(\@oids, \@existing_oids); + foreach $newtype (@typesToAdd) { + $entry->addValue("nsindextype", $newtype); printTrace("\nnewtype: $newtype",2); + } + foreach $newoid (@oidsToAdd) { + $entry->addValue("nsmatchingrule", $newoid); + } + if (@typesToAdd || @oidsToAdd) { + my $res = $conn->update($entry) ; + if ($res) { + printTrace("\nUpdate index successfully: $indexname for backend: $DBNAMES{$suffixname}",2); + } + else { + printMsg("\n Failed to update the index: $indexname to backend: $DBNAMES{$suffixname}"); + $MigrationErrors .= "\n Failed to update the index: $indexname to backend: $DBNAMES{$suffixname}" ; + } + } + else { + printTrace("\nNothing to update",2); + } + } + else { + printTrace("\nThe index: $indexname is a system index. It can't be updated",2); + } + } + } + + } + else { + # treat the case where the user wants to look at these indexes before processing + } + +} + +############################################################################# +# +# Execute a Perldap command to add all user defined object classes in the 5.x schema + +sub LDAPmodify_User_oc { + my $Filename = shift ; + if (! $USER_OC_FILE_MODIFIED) { + printTrace("\nLDAPmodify_User_oc",4); + printTrace("\nMigrate objectclasses...",1); + foreach $objectname ( @User_oc_names ) { + my $entry = $conn->search("cn=schema", "base","objectclass=*") ; + die "\ncan't connect to object: cn=schema\n" unless ($entry); + printTrace("\nObjectName: $objectname\nValue: $User_oc{$objectname}",3); + next if ($entry->hasValue("objectclasses",$User_oc{$objectname},1)) ; + $entry->addValue("objectclasses",$User_oc{$objectname},"1") ; + my $res = $conn->update($entry) ; + if (! $res) { + printMsg("\nCan\'t add objectclass to the schema: $User_oc{$objectname}"); + my $msg = $conn->getErrorString(); + printMsg("\nMsg: $msg"); + $MigrationErrors .= "\nCan\'t add objectclass to the schema: $User_oc{$objectname}" ; + } + else { + printTrace("\nobjectclass: $User_oc{$objectname} added",2); + } + } + } + else { + # treat the case where the user wants to look at these objectclasses before processing + } +} + +############################################################################# +# +# Execute a Perldap command to add all user defined attributes in the 5.x schema + +sub LDAPmodify_User_at { + my $Filename = shift ; + my @attributenames = keys(%User_at); + if (! $USER_AT_FILE_MODIFIED) { + + printTrace("\nLDAPmodify_User_at",4); + printTrace("\nMigrate attributes...",1); + foreach $attributename ( @attributenames ) { + my $entry = $conn->search("cn=schema", "base","objectclass=*") ; + printTrace("\nAtributeName: $attributename, Value: $User_at{$attributename}",3); + die "\nentry not found cn=schema\n" unless $entry ; + next if ($entry->hasValue("attributetypes",$User_at{$attributename},1) ) ; + my $res = $entry->addValue("attributetypes",$User_at{$attributename},"1") ; + if (! $res) { + printMsg("\nCan\'t add attribute to the schema: $User_at{$attributename}"); + $MigrationErrors .= "\nCan\'t add attribute to the schema: $User_at{$attributename}" ; + } + my $res = $conn->update($entry) ; + if ($res) { + printTrace("\nattribute: $attributename added",2); + } + else { + printMsg("\nCan\'t add attribute to the schema: $User_at{$attributename}"); + my $msg = $conn->getErrorString(); + printMsg("\nMsg: $msg"); + $MigrationErrors .= "\nCan\'t add attribute to the schema: $User_at{$attributename}" ; + } + } + } + else { + # treat the case where the user wants to look at these attributes before processing + } +} + +############################################################################# +# Add an object class to the user_oc hash and reset the object !!! +sub AddObjectClass { + my $ObjectClass = shift ; + my $ObjectName = $ObjectClass->{'ObjectName'} ; + my $Object_oid = $ObjectClass->{'Object_oid'} ; + my $Object_superior = $ObjectClass->{'Object_superior'} ; + my $Object_requires = $ObjectClass->{'Object_requires'} ; + my $Object_allows = $ObjectClass->{'Object_allows'} ; + my $ObjectClassDef = "( $Object_oid NAME \'$ObjectName\' DESC \'\' SUP $Object_superior STRUCTURAL MUST ($Object_requires) MAY ($Object_allows) X-ORIGIN \'user defined\' )"; + if ( (!($ObjectName =~ /^top$/i)) && ( ! $User_oc{$ObjectName} )) { + $User_oc{$ObjectName} = $ObjectClassDef ; + push @User_oc_names, $ObjectName ; + printTrace("ObjectName: $ObjectName \nObject_oid: $Object_oid \nObject_superior:$Object_superior \nObject_requires: $Object_requires \nObject_allows: $Object_allows \nObjectClassDefinition: $User_oc{$ObjectName}\n",4); + } + elsif ( ($User_oc{$ObjectName}) && ($User_oc{$ObjectName} ne $ObjectClassDef) ) { + printMsg("\nAttempt to redifine the objectclass: $ObjectName previously defined in your configuration file. Operation not allowed "); + } + else { + printMsg("\nAttempt to redifine the objectclass: top. Operation not allowed"); + } + resetObjectClass($ObjectClass); +} + +############################################################################# +# Build an LDIF attribute and add it to the user_at hash +sub AddAttribute { + my $Attr = shift ; + my $AttributeName = $Attr->{'AttributeName'}; + my $Attribute_oid = $Attr->{'Attribute_oid'}; + my $Attribute_aliases = $Attr->{'Attribute_aliases'}; + my $Attribute_syntax = $Attr->{'Attribute_syntax'}; + my $Attribute_single = $Attr->{'Attribute_single'}; + my $AttributeDef = "( $Attribute_oid NAME ( \'$AttributeName\' $Attribute_aliases) DESC \'User Defined Attribute\' SYNTAX $Attribute_syntax $Attribute_single X-ORIGIN 'user defined' )" ; + printTrace("\nAttributeDef: $AttributeDef",4); + $User_at{$AttributeName} = $AttributeDef ; +} +############################################################################# +# add the index structure to the newIndex hash +sub AddIndex { + my $ref_index = shift ; + my $state = shift ; + printTrace("\nAddIndex, last state: $state",4) ; + if ($state == 1) { + $ref_index->specific("ALL") ; + return 1 ; + } + elsif ($state == 6) { + $ref_index->specific("NONE") ; + return 1 ; + } + if (($state == 1) || ($state == 3) || ($state == 5) || ($state == 6)) { + foreach $name (@{$ref_index->names}) { + $newIndex{$name} = $ref_index ; # record the ref to the index struct in the newIndex hash + } + return 1 ; + } + else { + return 0 ; + } +} + +############################################################################# +# add the plugin structure to the stdPlugin hash + +sub AddPlugin { + my $ref_plugin = shift ; + printTrace("\nAddPlugin",4) ; + $stdPlugins{lc($ref_plugin->name)} = $ref_plugin ; + my $name = $ref_plugin->name ; + my $type = $ref_plugin->type ; + my $enable = $ref_plugin->enable ; + + printTrace("\nPluginName: $name",4); + printTrace("\nPluginType: $type",4); + printTrace("\nPluginEnable: $enable",4); + printTrace("\nPluginArgs: @{$ref_plugin->args}",4); + return 1 ; +} + + +############################################################################# +# parse a plugin definition and call the addindex + +sub ParsePlugin { + my $Plugin = shift ; + my $NumLine = shift ; + my $state = 0 ; + my $ErrorMsg = "Syntax error of a plugin definition. \n line parsed:"; + my $ref_plugin = S_plugin->new(); + printTrace("\nParsePlugin: $_",4); + if (/^plugin\s+(database|extendop|preoperation|postoperation|matchingrule|syntax)\s+(on|off)\s+\"(.*?)\"\s+\"(.*?)\"\s+(\S+)(.*)$/i) { + # $1 = , $2 = , $3 = , $4 = , $5 = , $6 = []* + $ref_plugin->name($3); + $ref_plugin->type($1); + $ref_plugin->enable($2); + $_ = $6 ; + my $ArgNb = 0 ; + my $prec ; + my $arg ; + my $Unix_oldDir = $oldDir ; + my $Unix_root = $root ; + grep { s@\\@/@g } $Unix_oldDir if $isNT; + grep { s@\\@/@g } $Unix_root if $isNT; + while (!(/^\s*$/)) { + if (/^\s*\".*?\"/) { + s/^\s*\"(.*?)\"(.*)/$2/i ; + $arg = $1 ; + } + elsif (/^\s*[^\"\s]+/) { + s/^\s*([^\"\s]+)(.*)/$2/i ; + $arg = $1 ; + } + $prec = $_ ; + $_ = $arg ; + + s@$Unix_oldDir@$Unix_root@ig ; + s/$type-$oldname/$type-$newname/ig ; + @{$ref_plugin->args}[$ArgNb++] = $_ ; + $_ = $prec ; + } + if (/^\s*$/) { + return AddPlugin($ref_plugin); + } + else { + return 0 ; + } + } + return 0 ; +} + +############################################################################# +# parse an index definition and call the addindex + +sub ParseIndex { + my $index = shift ; + my $NumLine = shift ; + my $ref_index = S_index->new() ; + my $Value ; + my $state = 0 ; + my $ErrorMsg = "Syntax error of an index definition.\nline parsed:"; + printTrace("\nParseIndex: $_",4) ; + s/,/, /g ; + s/\s+,/,/g ; + s/^index\s+//i ; # substitute the token index + while (!(/^\s*$/)) { + s/^\s*(\S+)(.*)$/$2/ ; + $Value = $1 ; + printTrace("\nValue: $Value",4); + printTrace("\nState: $state",4) ; + SWITCH: { + if ($state == 0) { + if ($Value =~ /[^\.]/) { + if ($Value =~ /(\S+),$/) { + push @{$ref_index->names}, $1 ; + } + else { + $state = 1 ; + push @{$ref_index->names}, $Value ; + } + } + else { + return 0 ; + } + last SWITCH ; + } + if ($state == 1) { + if ($Value =~ /^none$/i) { + $state = 6 ; # end of the index definition + } + elsif ($Value =~ /^\"\"$/) { + $state = 4 ; # we expect to have at least one OID + } + elsif ($Value =~ /(\S+),$/) { + $state = 2 ; + push @{$ref_index->types}, $1 ; + } + else { + $state = 3 ; + push @{$ref_index->types}, $Value ; + } + last SWITCH ; + } + if ($state == 2) { + if ($Value =~ /(\S+),$/) { + push @{$ref_index->types}, $1 ; + } + else { + $state = 3 ; + push @{$ref_index->types}, $Value ; + } + last SWITCH ; + } + if ($state == 3) { + if ($Value =~ /(\S+),$/) { + $state = 4 ; + push @{$ref_index->oids}, $1 ; + } + else { + $state = 5 ; + push @{$ref_index->oids}, $Value ; + } + last SWITCH ; + } + if ($state == 4) { + if ($Value =~ /(\S+),$/) { + push @{$ref_index->oids}, $1 ; + } + else { + $state = 5 ; + push @{$ref_index->oids}, $Value ; + } + last SWITCH ; + } + } + } +return AddIndex($ref_index,$state) ; + +} + +############################################################################# + +sub ParseAttribute { + + + my $Attr = shift ; + my $NumLine = shift ; + my $state = 1 ; + my $ErrorMsg = "Syntax error of an attribute definition.\nline parsed:"; + my %Attribute = ( + 'AttributeName' => "", + 'Attribute_oid' => "", + 'Attribute_aliases' => "", + 'Attribute_syntax' => "", + 'Attribute_single' => "" + ); + my $AttributeName = " "; + printTrace("\nParseAttribute",4); + while (!(/^\s*$/)) { + s/^(.*?)(\S+)\s*$/$1/ ; + printTrace("\nValue: $2",4); + printTrace("\nState: $state",4) ; + my $Value = $2 ; + SWITCH: { + if ($state == 1) { + if (isAllowedModifier($Value)) { + $state = 1 ; + $modifier = lc($Value); + $AttrVar = 'Attribute_' . $modifier ; + $Attribute{$AttrVar} = &getModifierValue($Value) ; + } + elsif (&isAllowedPlugin($Value)) { + $state = 2 ; + $Attribute{'Attribute_syntax'} = &getSyntaxOid($Value) ; + } + else { + return 0 ; + } + last SWITCH ; + } + if ($state == 2) { + if ($Value =~ /[\.]|-oid$/) { + $Attribute{'Attribute_oid'} = "$Value" ; + printTrace("\nAttribute-oid: $Attribute{'Attribute_oid'}",3); + $state = 3 ; + } + elsif ($Value =~ /[^\.]/) { + $AttributeName = $Attribute{'AttributeName'} ; + if ($AttributeName) { $Attribute{'Attribute_aliases'} .= "\'$AttributeName\' " ;} + $Attribute{'AttributeName'} = $Value ; + $state = 4 ; + } + else { + return 0 ; + } + last SWITCH ; + } + if ($state == 3) { + if ($Value =~ /[^\.]/) { + $AttributeName = $Attribute{'AttributeName'} ; + if ($AttributeName) { $Attribute{'Attribute_aliases'} .= "\'$AttributeName\' " ;} + $Attribute{'AttributeName'} = $Value ; + $state = 4 ; } + else { + return 0 ; + } + last SWITCH ; + } + if ($state == 4) { + if ($Value =~/^attribute$/i){ + $state = 5; + } + elsif ($Value =~/[^\.]/i) { + $AttributeName = $Attribute{'AttributeName'} ; + if ($AttributeName) { $Attribute{'Attribute_aliases'} .= "\'$AttributeName\' " ;} + $Attribute{'AttributeName'} = $Value ; + } + else { + return 0 ; + } + last SWITCH ; + } + if ($state == 5) { + return 0 ; + last SWITCH ; + } + } + } + $Attribute{'Attribute_oid'} = $Attribute{'AttributeName'} . '-oid' unless ($Attribute{'Attribute_oid'}) ; + return AddAttribute(\%Attribute) ; +} + + +############################################################################# +# fill in the hash HashParametersName + +sub FillHashParametersName { + my @paramnames = ( keys(%GeneralSrvParamToMigrate), keys(%GlobalConfigLDBMparamToMigrate), keys(%LDBMparamToMigrate)); + foreach $param (@paramnames) { + $HashParametersName{$param} = '\n'; + } +} + + +# Parse parameters +sub ParseParameters { + my $param = shift ; + my $value = shift ; + my $NumLine = shift ; + my $ErrorMsg = "parameter unknown, or not to be migrated: "; + if ($HashParametersName{lc($param)} && ($value !~ /^\s*$/)) { + $HashParametersName{lc($param)} = $value ; + printTrace("\nParam: $param is present",4); + } + else { + printTrace("\n$NumLine, $ErrorMsg,$param",4); + } + +} + +# add general server parameters +sub AddGeneralParameters { + my @paramnames = keys(%GeneralSrvParamToMigrate); + my $entry = $conn->search("cn=config","base","objectclass=*"); + die "\ncan't access to object: cn=config. \nMigration stopped\n" unless ($entry); + printTrace("\nAddGeneralParameters",4); + foreach $param (@paramnames) { + my $LDAPparam = $GeneralSrvParamToMigrate{$param} ; + my $Value = $HashParametersName{$param} ; + if (($Value ne '\n') && ($entry->{$LDAPparam}[0] ne $Value)) { + printTrace("\nLDAPparam: $LDAPparam, Value: $Value",4); + $entry->setValues($LDAPparam, $Value); + my $res = $conn->update($entry); + if ($res) { + printTrace("\nUpdate successfully $LDAPparam ",0); + } + else { + printMsg("\nCan't update parameter: $LDAPparam"); + } + } + } +} + + +# add general LDBM parameters +sub AddGeneralLDBMParameters { + my @paramnames = keys(%GlobalConfigLDBMparamToMigrate); + my $entry = $conn->search("cn=config,cn=ldbm database,cn=plugins,cn=config","base","objectclass=*"); + die "\ncan't access to object: cn=config,cn=ldbm database,cn=plugins,cn=config. \nMigration stopped\n" unless ($entry); + printTrace("\nAddGeneralLDBMParameters",4); + foreach $param (@paramnames) { + my $LDAPparam = $GlobalConfigLDBMparamToMigrate{$param} ; + my $Value = $HashParametersName{$param} ; + if (($Value ne '\n') && ($entry->{$LDAPparam}[0] ne $Value)) { + printTrace("\nLDAPparam: $LDAPparam, Value: $Value",4); + $entry->setValues($LDAPparam, $Value); + my $res = $conn->update($entry); + if ($res) { + printTrace("\nUpdate successfully $LDAPparam ",0); + } + else { + printMsg("\nCan't update parameter: $LDAPparam"); + } + } + } +} + +# add specific LDBM parameters +sub AddSpecificLDBMParameters { + my @paramnames = keys(%LDBMparamToMigrate); + my %REV_DBNAMES = reverse %DBNAMES ; + my @dbnames = keys(%REV_DBNAMES); + printTrace("\nAddSpecificLDBMParameters",4); + foreach $dbname (@dbnames) { + my $entry = $conn->search("cn=$dbname,cn=ldbm database,cn=plugins,cn=config","base","objectclass=*"); + die "\ncan't access to object: cn=$dbname,cn=ldbm database,cn=plugins,cn=config. \nMigration stopped\n" unless ($entry); + foreach $param (@paramnames) { + my $LDAPparam = $LDBMparamToMigrate{$param} ; + my $Value = $HashParametersName{$param} ; + if (($Value ne '\n') && ($entry->{$LDAPparam}[0] ne $Value)) { + printTrace("\nLDAPparam: $LDAPparam, Value: $Value",4); + $entry->setValues($LDAPparam, $Value); + my $res = $conn->update($entry); + if ($res) { + printTrace("\nUpdate successfully $LDAPparam",2); + } + else { + printMsg("\nCan't update parameter: $LDAPparam"); + } + } + } + } +} + +############################################################################# +# Parse a configuration file potentialy tuned by the user (different from slapd.user_oc.conf and slapd.user_at.conf) + +sub ParseConfigurationFile { + + my $FileToParse = shift; + my $NumLine = 0; + my $PARSE_OBJECTCLASSES = 0 ; # 1 if there are objectclass definitions in the file + printTrace("\nParseConfigurationFile: $FileToParse",4) ; + printTrace("\nParse $FileToParse",2); + # read each line of the configuration file + my $CONFIGFILE = "CONFIGFILE.$FileToParse" ; + open( $CONFIGFILE, $FileToParse ) || die "Can't open $FileToParsec: $!: "; + LINE: while ( <$CONFIGFILE> ) { + $NumLine++ ; + if (/^\s*\#/) { # skip comments + next LINE; + } + if (/^\s*$/) { # skip blank lines + next LINE; + } elsif (/^suffix\s+/i) { + chomp($_) ; + CheckSuffix($_) ; + } elsif (/^plugin/i) { + chomp($_); + if (! &isAStandardPlugin($_)) { + push @badPlugins, $_; + } + else { + my $Plugin = $_ ; + if (! &ParsePlugin($_,$NumLine)) { + printMsg("\nLine $NumLine, syntax error of the plugin:\n$Plugin"); + } + } + } elsif (/^index/i) { + chomp($_); + if (! &isAStandardIndex($_)) { + my $Index = $_ ; + if (! &ParseIndex($_,$NumLine)) { + printMsg("\nLine $NumLine, syntax error of index:\n$Index"); + } + } + } elsif (/^include\s+[\"]?(.*?)[\"]?\s*$/i) { + # strip leading and trailing " + my $include_file = $1 ; + grep { s@/@\\@g } $include_file if $isNT; + if (! &isAStandardInclude($include_file)) { + &ParseConfigurationFile($include_file); + } + } elsif (/^attribute\s+\S+/i) { + chomp($_); + my $Attrib = $_ ; + if (! &ParseAttribute($_,$NumLine)) { + printMsg("\nLine $NumLine, syntax error of attribute:\n$Attrib"); + } + } elsif (/^objectclass\s+(\S+)\s*$/i) { + # At least one objectclass is present in the file + $PARSE_OBJECTCLASSES = 1; + } elsif (/^\s*(\S+)\s+[\"]?(.*?)[\"]?\s*$/) { + # Parse parameters and record the associated value in %Oldhash + &ParseParameters($1,$2,$NumLine); + } + } + close($CONFIGFILE); + ParseObjectClassesFile($FileToParse) if ($PARSE_OBJECTCLASSES); # parse objectclass definition + +} + +############################################################################# +# Parse the file specified in the userat attribute + +sub ParseAttributesFile { + my $userat_file=shift ; + my $NumLine = 0; + printTrace("\nParseAttributesFile: $userat_file",4); + printTrace("\nParse user defined attributes file: $userat_file",2); + # read each line of the configuration file + open( ATTRFILE, $userat_file ) || die "Can't open $FileToParsec: $!: "; + LINE: while ( ) { + $NumLine++ ; + if (/^\s*\#/) { # skip comments + next LINE; + } + if (/^\s*$/) { # skip blank lines + next LINE; + } elsif (/^attribute\s+\S+/i) { + chomp($_); + my $Attrib = $_ ; + if (! &ParseAttribute($_, $NumLine)) { + printMsg("\nLine $NumLine, syntax error of attribute:\n$Attrib"); + } + } + } + close(ATTRFILE); +} + +############################################################################# +# Parse the file specified in the useroc token + +sub ParseObjectClassesFile { + my $useroc_file = shift ; + my %ObjectClass = ( + 'ObjectName' => " ", + 'Object_oid' => " ", + 'Object_superior' => "top", + 'Object_requires' => " ", + 'Object_allows' => " " + ); + + my $state = 0; + my $ErrorMsg = "Syntax error of an object class definition.\nline parsed:"; + my $LineNb = 0 ; # Number of the current line parsed in the file + printTrace("ParseObjectClassesFile: $useroc_file\n",4) ; + # read each line of the configuration file + open( OBJCLASSFILE, $useroc_file ) || die "Can't open $FileToParsec: $!: "; + printTrace("Begin the parsing of the file: $useroc_file",4); + LINE: while ( ) { + printTrace("Current Line: $_",4); + $LineNb++ ; + if (/^\s*\#/) { # skip comments + next LINE; + } + if (/^\s*$/) { # skip blank lines + next LINE; + } + SWITCH: { + if ($state == 0) { resetObjectClass(\%ObjectClass); + if (/^objectclass\s+(\S+)\s*$/i) { + $ObjectClass{'ObjectName'} = $1; + $state = 1 ;} + else {} # printMsg($ErrorMsg,$_,$LineNb);} + last SWITCH;} + if ($state == 1) {if (/^\s+oid\s+(\S+)\s*$/i) { + $ObjectClass{'Object_oid'} = $1; + $state = 2 ;} + elsif (/^\s+superior\s+(\S+)\s*$/i) { + $ObjectClass{'Object_superior'} = $1; + $state = 3 ; + } + elsif (/^\s+requires\s*$/i) { + $state = 4; + } + elsif (/^\s+allows\s*$/i) { + $state = 5; + } + else {$state=0; printMsg($ErrorMsg,$_,$LineNb);} + last SWITCH;} + if ($state == 2) {if (/^\s+superior\s+(\S+)\s*$/i) { + $ObjectClass{'Object_superior'} = $1; + $state = 3 ;} + elsif (/^\s+requires\s*$/i) { + $state = 4; + } + elsif (/^\s+allows\s*$/i) { + $state = 5; + } + else { $state=0; printMsg($ErrorMsg,$_,$LineNb);} + last SWITCH;} + if ($state == 3) {if (/^\s+requires\s*$/i) + { $state = 4; } + elsif (/^objectclass\s+(\S+)\s*$/i) { + # run an ldap add before to continue + &AddObjectClass(\%ObjectClass); + $ObjectClass{'ObjectName'} = $1; + $state = 1 ;} + elsif (/^\s+allows\s*$/i) + { $state = 5; } + else {$state = 0; printMsg($ErrorMsg,$_,$LineNb);} + last SWITCH;} + if ($state == 4) {if (/^\s+([^,\s]+),\s*$/i) { + $ObjectClass{'Object_requires'}.=$1." \$ "; } + elsif (/^\s+([^,\s]+)\s*$/i) { + $ObjectClass{'Object_requires'}.=$1." "; + $state = 6; } + else {$state = 0;printMsg($ErrorMsg,$_,$LineNb);} + last SWITCH;} + if ($state == 5) {if (/^\s+([^,\s]+),\s*$/i) { + $ObjectClass{'Object_allows'}.=$1." \$ "; } + elsif (/^\s+([^,\s]+)\s*$/i) { + $ObjectClass{'Object_allows'}.=$1." "; + # run an ldap add before to continue + &AddObjectClass(\%ObjectClass); + $state = 0; } + else {$state = 0; printMsg($ErrorMsg,$_,$LineNb);} + last SWITCH;} + if ($state == 6) {if (/^objectclass\s+(\S+)\s*$/i) { + # run an ldap add before to continue + &AddObjectClass(\%ObjectClass); + $ObjectClass{'ObjectName'} = $1; + $state = 1 ;} + elsif (/^\s+allows\s*$/i) { + $state = 5;} + else {$state = 0; printMsg($ErrorMsg,$_,$LineNb);} + last SWITCH;} + } + } + close(OBJCLASSFILE); + if (($state == 3) || ($state == 4) || ($state == 5) || ($state == 6)) { + &AddObjectClass(\%ObjectClass); + } + printTrace("state: $state",4); +} + +############################################################################# +# printMsg print message to the user standard output. + +sub printMsg { + + my $TypeMsg = shift ; + my $Msg = shift ; + my $LineNb = shift ; + if ($LineNb) { + printTrace("Line: $LineNb, $TypeMsg, $Msg"); + } + else { + printTrace("$TypeMsg $Msg"); + } +} + +############################################################################# +# print message error to the user standard output. + +sub printTrace { + + my $Msg = shift ; + my $level = shift ; + if ($level <= $TRACELEVEL) { + print($Msg); + print LOGFILE $Msg ; + } +} + +############################################################################# +# reset an objectclass structure + +sub resetObjectClass { + my $ObjectClass = shift; + $ObjectClass->{'ObjectName'} = " " ; + $ObjectClass->{'Object_oid'} = " " ; + $ObjectClass->{'Object_superior'} = "top" ; + $ObjectClass->{'Object_requires'} = " " ; + $ObjectClass->{'Object_allows'} = " " ; +} + +############################################################################# +# this subroutine implements a very stupid version of diff + +sub diff { + my $f1 = shift; + my $f2 = shift; + my $lineToBeginWith = shift; + my $NULL = "" ; + my $diff_f1 = $NULL ; + my $diff_f2 = $NULL ; + my $retval = $NULL ; + my $ret; + open(F1, "$f1") or die "Could not open file $f1"; + open(F2, "$f2") or close(F1), die "Could not open file $f2"; + + while (defined($l1 = )) { + if ($lineToBeginWith){ + $lineToBeginWith -- ; + next ; + } + next if ($l1 =~ /^\#/); + $ret = defined($l2 = ); + if ($ret) { + $ret = defined($l2 = ) while ($ret && ($l2 =~ /^\#/)) ; + if ($ret) { + if (!($l1 eq $l2)) { + + # ignore whitespace + $l1_clean = $l1 ; + $l2_clean = $l2 ; + $l1_clean =~ s/\s//g; + $l2_clean =~ s/\s//g; + + if (!($l1_clean eq $l2_clean)) { + $diff_f1 .= "${l1}" unless ($l1_clean eq $NULL); + $diff_f2 .= "${l2}" unless ($l2_clean eq $NULL); + } + } + } + else { + next if ($l1 =~ /^\s*$/) ; + $diff_f1 .= "${l1}"; + } + } + else { + next if ($l1 =~ /^\s*$/) ; + $diff_f1 .= "${l1}"; + } + } + + while (defined($l2 = )) { + if (($l2 =~ /^\#/) || ($l2 =~ /^\s*$/)) { + next ; + } + else { + $diff_f2 .= "${l2}" ; + } + } + + close(F1); + close(F2); + + $retval .= "- differences present in your config file but not in standard file:\n\n". "$diff_f1\n" if ($diff_f1) ; + $retval .= "- differences present in standard file but not in your config file:\n\n" . "$diff_f2" if ($diff_f2) ; + return $retval ; +} + +sub CompareStdConfigFiles { + # Compare each configuration file against its default version. If it has changed, + # notify the user that the file has changed and will need to be checked by the + # user. This should be safe to do because there should be no path information + # stored in these conf files, which are just schema stuff. + # printTrace("\nCheck if standard configuration files have changed",3); + + # get the version of the DS to migrate + ($oldVersion, $oldMinor) = &getVersion($oldDir); + # get the version of the new DS + ($Version, $Minor) = &getVersion($root); + + my $origFilePath = "$oldDir${PATHSEP}bin${PATHSEP}slapd${PATHSEP}install${PATHSEP}config${PATHSEP}" ; + my $FilesChanged = ""; + my $AllDiffs = "***********************************************************************"; + my $NoChanges = "" ; + my $lineToBegin = 0 ; + printTrace("\nVersion of the old directory server: $oldVersion.$oldMinor",0); + opendir(CONFDIR, $oldConfDir) or + die "Error: could not open migrated config dir $oldConfDir: $!"; + + foreach $file (readdir(CONFDIR)) { + $origFile = $origFilePath . $file ; + $configFile = $oldConfDir . $file ; + if ((! exists($userDefinedConfigFiles{lc($file)})) && (-f $origFile)) { + my $lineToBegin = 1 if (lc($file) eq "slapd-collations.conf"); # we ignore the first line of slapd-collations + $diffs = &diff($configFile, $origFile, $lineToBegin); + $lineToBegin = 0 if $lineToBegin ; + if ($diffs) { + $FilesChanged .= "\n$configFile"; + $AllDiffs .= "\n$configFile is different than the standard configuration file" ; + $AllDiffs .= "\nYou will need to check this file and make sure its changes are compatible "; + $AllDiffs .= "with the new directory server\nHere are the differences:\n"; + $AllDiffs .= "$diffs \n\n"; + $AllDiffs .= "***********************************************************************"; + } + else { + $NoChanges .= "\n$configFile"; + } + } + } + closedir(CONFDIR); + +if ($FilesChanged) { + printTrace("\nNo changes to old configuration files:$NoChanges",3) ; + printTrace("\n***********************************************************************",3) ; + printMsg("\nThe following standard files have been modified: $FilesChanged"); + if ($NO_INPUT_USER) { + # do nothing + } + else { + printMsg("\nDo you want to see the differences Yes/No [No] ?") ; + my $answer = ; + if ($answer =~ /y|yes/i) { + printMsg("$AllDiffs"); + } + printMsg("\nDo you want to continue the migration Yes/No [No] ?"); + $answer = ; + if (! ($answer =~ /y|yes/i)) { + exit(1); + } + } + } +} + + +############################################################################# + +sub db2ldif { + my ($conf, $ldif_dir) = @_; + $ENV{"$LIB_PATH"}="$oldDir${PATHSEP}lib${SEP}".$ENV{"$LIB_PATH"}; + if (!$conf) { + $conf = "$oldHome${PATHSEP}config${PATHSEP}slapd.conf"; + } + if (! $ldif_dir) { $ldif_dir = $ldif_rep ;} + if (!(-d $ldif_dir)) { + mkdir($ldif_dir,0777) or die "can't create $ldif_rep to store temporary ldif files"; + } + my $dir = "$oldDir${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server"; + chdir($dir) or + die "Error: could not change directory to $dir: $!"; + my @suffixnames = keys(%DBNAMES) ; + foreach $suffixname (@suffixnames) { + my $ldif_file = $ldif_dir.$DBNAMES{$suffixname}.".ldif" ; + # If we are on NT, ${quote} is setup to "\"", else it's setup to "" + # As the suffix can contain some space characters, I write the suffix parameter: "\"$suffixname\"" rather than "${quote}$suffixname${quote}" + my @cmd = + ( "${quote}$oldDir${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server" . + "${PATHSEP}$slapdExecName${quote}", "db2ldif", '-n', '-f', + "${quote}$conf${quote}", '-a', "${quote}$ldif_file${quote}", + '-d', '1','-s',"\"$suffixname\"" ); + open(DB2LDIF, "${quote}@cmd${quote} 2>&1|") or + die "Error: could not execute @cmd: $!"; + sleep(1); # allow pipe to fill with data + $ii = 0; # counter + while () { + ++$ii; + if (($ii % 250) == 0) { + printMsg(" Processing...\n"); + } + } + close(DB2LDIF); + # set the ownership of the ldif file; should be the same as the 5.x slapd user id + if ((! $isNt) && ($oldlocaluser ne $localuser)) { + if (-f $ldif_file) { + chown( $newuid, $newgid, $ldif_file) or printMsg("\nUnable to change the ownership of $ldif_file to $localuser") ; + } + } + } + print " Done.\n"; + chdir($curdir) or die "Could not change directory to $curdir: $!"; +} + +############################################################################# + +# this is used to run the system() call, capture exit and signal codes, +# and die() upon badness; the first argument is a directory to change +# dir to, if any, and the rest are passed to system() +sub mySystem { + my $rc = &mySystemNoDie(@_); + my ($dir, @args) = @_; + if ($rc == 0) { +# success + } elsif ($rc == 0xff00) { + die "Error executing @args: error code $rc: $!"; + } elsif ($rc > 0x80) { + $rc >>= 8; + die "Error executing @args: error code $rc: $!"; + } else { + if ($rc & 0x80) { + $rc &= ~0x80; + } + die "Error executing @args: received signal $rc: $!"; + } + + # usually won't get return value + return $rc; +} + +# This version does not die but just returns the error code +sub mySystemNoDie { + my ($dir, @args) = @_; + if ($dir && ($dir ne "")) { + chdir($dir) or die "Could not change directory to $dir: $!"; + } + my $cmd = $args[0]; + # the system {$cmd} avoids some NT shell quoting problems if the $cmd + # needs to be quoted e.g. contains spaces; the map puts double quotes + # around the arguments on NT which are stripped by the command + # interpreter cmd.exe; but don't quote things which are already quoted + my @fixargs = map { /^[\"].*[\"]$/ ? $_ : $quote . $_ . $quote } @args; + my $rc = 0; + if ($cmd =~ /[.](bat|cmd)$/) { + # we have to pass batch files directly to the NT command interpreter + $cmd = $com_spec; +# print "system $cmd /c \"@fixargs\"\n"; + $rc = 0xffff & system {$cmd} '/c', "\"@fixargs\""; + } else { +# print "system $cmd @fixargs\n"; + $rc = 0xffff & system {$cmd} @fixargs; + } + chdir(${curdir}) or die "Could not change directory to $curdir: $!"; + return $rc; +} + +############################################################################# +sub manyLdif2db { + my %rev_dbnames = reverse(%DBNAMES); + @backends = keys(%rev_dbnames); + $ENV{"$LIB_PATH"}="$root${PATHSEP}lib${SEP}".$ENV{"$LIB_PATH"}; + chdir($slapdExecDir) or die "Could not change directory to $slapdExecDir: $!"; + foreach $backend (@backends) { + my $ldif = "${ldif_rep}$backend.ldif" ; + &Ldif2db($ldif, $backend); + } + # remove the empty ldif directory + rmdir($ldif_rep); + chdir($curdir) or die "Could not change directory to $curdir: $!"; +} + + +sub Ldif2db { + my $ldif = shift ; + my $backend = shift ; + my $ldif2db_param = "ldif2db -D $serverHome -n $backend -i $ldif"; + open(LDIF2DB, "${quote}${quote}$slapdExecName${quote} $ldif2db_param${quote} 2>&1 |") or die "Could not run ns-slapd program $ldif2db_exe\n"; + sleep(1); # allow some data to accumulate in the pipe + while () { + printMsg($_); + } + close(LDIF2DB); + # remove the ldif file after the import + unlink($ldif) ; +} + +############################################################################# + +#sub copyBak { +# opendir( OLDBAK, "$oldHome${PATHSEP}bak" ) || +# die "Can't open directory $oldHome${PATHSEP}bak: $!: "; +# local ( @dirs ) = readdir( OLDBAK ); +# closedir ( OLDBAK ); +# for ( @dirs ) { +# if ( $_ eq "." || $_ eq ".." ) { +# next; +# } elsif ( -d "$oldHome${PATHSEP}bak${PATHSEP}$_" ) { +# $srcDir = "$oldHome${PATHSEP}bak${PATHSEP}$_"; +# $destDir = "$serverHome${PATHSEP}bak${PATHSEP}$_"; +# $srcLDIF = "$oldHome${PATHSEP}ldif${PATHSEP}bak.ldif"; +# $destLDIF = "$serverHome${PATHSEP}ldif${PATHSEP}bak.ldif"; +# mkdir( $destDir , 0755 ) if !( -e $destDir); +# # Converting database +# if ( !$isNT && $newuser ) { +# chown($newuid, $newgid, +# "$serverHome${PATHSEP}bak", $destDir); +# } +# &other_db2ldif($srcDir, $srcLDIF); +# if ($needAclUpg) { +# &mySystem("$root${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server", +# "$root${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server" . +# "${PATHSEP}aclupg$exe_suffix", '-d', '-i', +# $srcLDIF, '-o', $destLDIF); +# } else { +# ©BinFile($srcLDIF, $destLDIF); +# } +# &other_ldif2db($destLDIF, $destDir); +# } +# } +#} +############################################################################# + +sub startServer { + my $instanceDir = ${serverHome} ; + my $errLog = $instanceDir . $PATHSEP . 'logs' . $PATHSEP . 'errors'; + # emulate tail -f + # if the last line we see does not contain "slapd started", try again + my $done = 0; + my $started = 0; + my $code = 0; + my $lastLine = ""; + my $timeout = time + 240; # 4 minutes + $ENV{"$LIB_PATH"}="${root}${PATHSEP}lib${SEP}".$ENV{"$LIB_PATH"}; + + my $startCmd = $instanceDir . $PATHSEP . 'start' . $script_suffix; + if (! -f $startCmd) { + $startCmd = $instanceDir . $PATHSEP . 'start-slapd' . $script_suffix; + } + printTrace("\nInstanceDir: $instanceDir\n",4); + $code = &mySystem($instanceDir,$startCmd); + open(IN, $errLog) or die "Could not open error log $errLog: $!"; + my $pos = tell(IN); + while (($done == 0) && (time < $timeout)) { + for (; ($done == 0) && ($_ = ); $pos = tell(IN)) { + $lastLine = $_; + # print; + # the server has already been started and shutdown once . . . + if (/slapd started\./) { + $started++; + if ($started == 2) { + $done = 1; + } + # sometimes the server will fail to come up; in that case, restart it + } elsif (/Initialization Failed/) { + # print "Server failed to start: $_"; + $code = &mySystem($instanceDir, $startCmd); + # sometimes the server will fail to come up; in that case, restart it + } elsif (/exiting\./) { + # print "Server failed to start: $_"; + #$code = &mySystem($startCmd); + + $code = &mySystem($instanceDir, $startCmd); + } + } + if ($lastLine =~ /PR_Bind/) { + # server port conflicts with another one, just report and punt + print $lastLine; + print "This server cannot be started until the other server on this\n"; + print "port is shutdown.\n"; + $done = 1; + } + if ($done == 0) { + # rest a bit, then . . . + sleep(2); + # . . . reset the EOF status of the file desc + seek(IN, $pos, 0); + } + } + close(IN); + + if ($started < 2) { + $! = $code; + # $now = time; + # if ($now > $timeout) { + # print "Possible timeout: timeout=$timeout now=$now\n"; + # } + die "Error: could not start server: $!"; + } + + return 0; +} + +sub stopServer { + my $root = shift; + my $name = shift; + $maxStopIterations = 5; + print "\nShutting down server $name . . .\n"; + + $ENV{"$LIB_PATH"}="$root${PATHSEP}lib${SEP}".$ENV{"$LIB_PATH"}; + $stopCmd = $quote . $root . $PATHSEP . $name . $PATHSEP . 'stop' . $script_suffix . $quote; + if (! -f $stopCmd) { + $stopCmd = $quote . $root . $PATHSEP . $name . $PATHSEP . 'stop-slapd' . $script_suffix . $quote; + } + + if (! -f $stopCmd) { + # no stop command, probably a 1.X system; for NT, we'll try net stop + # for unix, we'll get the pid and kill it + if ($isNT) { + $stopCmd = 'net stop ' . $name; + } else { + # see if there is a pid file + $pidfile = $root . $PATHSEP . $name . $PATHSEP . 'logs' . + $PATHSEP . 'pid'; + if (open(PIDFILE, $pidfile)) { + chomp($pid = ); + close(PIDFILE); + while ($maxStopIterations-- && !$exitCode) { + $exitCode = kill(15, $pid); + } + $stopCmd = undef; + } + } + } + + # keep looping until the stop cmd returns an error code, which usually + # means that what ever we want to stop is stopped, or some other error + # occurred e.g. permission, or no such service + $exitCode = &runAndIgnoreOutput($stopCmd); +# print "stopServer: exitCode=$exitCode\n"; + while ($stopCmd && $maxStopIterations-- && $exitCode) { + $exitCode = &runAndIgnoreOutput($stopCmd); +# print "stopServer: exitCode=$exitCode\n"; + } + + if (!$maxStopIterations) { + print "Warning: could not shutdown the server: $!\n"; + } + + sleep(10) ; + + $exitCode = 0; + +} + + +sub runAndIgnoreOutput { + my $cmd = shift; + printMsg("."); + open(RUNCMD, "${quote}$cmd${quote} 2>&1 |") or die "Error: could not run $cmd: $!"; + printMsg("."); + sleep(1); # allow pipe to fill with data + printMsg("."); + while () { +# print; + } + my $code = close(RUNCMD); +# print "runAndIgnore: code=$code status=$?\n"; + return $?; +} +############################################################################# +# migrate some of entries present in the old DSE.ldif like +# cn=snmp,cn=config +# cn=encryption,cn=config +# all the aci's + +sub MigrateDSE { + printTrace("\nMigrate DSE entries...",1); + open( DSELDIF, "< $oldDSEldif" ) || die "Can't open $oldDSEldif: $!: "; + my $in = new Mozilla::LDAP::LDIF(*DSELDIF) ; + while ($old_entry = readOneEntry $in) { + my $DN = $old_entry->getDN() ; + SWITCH: { + # migrate the entrie: cn=snmp,cn=config + if ($DN =~ /^cn=SNMP,cn=config$/i) { + my $entry = $conn->search("$DN","base","objectclass=nsSNMP"); + if ($entry) { + my $res = $conn->update($old_entry); + if ($res) { + printTrace("\n$DN updated !",2); + } + else { + printMsg("\nFailed to update $DN"); + } + } + else { + printMsg("\nUnable to get info under $DN"); + } + last SWITCH; + } + # migrate the entrie: cn=encryption,cn=config + if ($DN =~ /cn=encryption,cn=config$/i) { + if ($conn->search("$DN","base","objectclass=*")) { + my $res = $conn->update($old_entry); + if ($res) { + printTrace("\n$DN updated !",2); + } + else { + printMsg("\nFailed to update $DN"); + } + } + else { + my $res = $conn->add($old_entry); + if ($res) { + printTrace("\n$DN added !",2); + } + else { + printMsg("\nFailed to add $DN"); + } + } + last SWITCH; + } + if (@{$old_entry->{aci}} && (! ($DN =~ /^cn=monitor$/i)) && (! ($DN =~ /^cn=schema$/i))) { + # migrate aci's + my $entry = $conn->search("$DN","base","objectclass=*"); + if ($entry) { + my $res = $conn->update($old_entry); + if ($res) { + printTrace("\n$DN updated !",2); + } + else { + printMsg("\nFailed to update $DN"); + } + } + else { + my $res = $conn->add($old_entry); + if ($res) { + printTrace("\n$DN added !",2); + } + else { + printMsg("\nFailed to add $DN"); + } + } + last SWITCH; + } + } + } + close(DSELDIF); +} +############################################################################# +# migrate SSL info + +sub MigrateSSL { + my $secPwd = 'bidon' ; + # copy the SSL directory + ©Dir("$oldHome${PATHSEP}ssl","$serverHome${PATHSEP}ssl"); + # copy the cert db and key files + if ( -d "$oldDir${PATHSEP}alias") { + $aliasDir = "$root${PATHSEP}alias"; + if (! -d $aliasDir) { + mkdir($aliasDir, 0750); + } + my $keydb = "$aliasDir${PATHSEP}slapd-$newname-key3.db" ; + my $certdb = "$aliasDir${PATHSEP}slapd-$newname-cert7.db" ; + my $old_keydb = "$oldDir${PATHSEP}alias${PATHSEP}slapd-$oldname-key3.db" ; + my $old_certdb = "$oldDir${PATHSEP}alias${PATHSEP}slapd-$oldname-cert7.db"; + my $keydb_backup = "$aliasDir${PATHSEP}slapd-$newname-key3.db_backup" ; + my $certdb_backup = "$aliasDir${PATHSEP}slapd-$newname-cert7.db_backup" ; + if (-f $old_keydb) { + if (-f $keydb) { + if ($NO_INPUT_USER) { + printMsg("\n$keydb already exists. backup in $keydb_backup ..."); + ©BinFile($keydb,$keydb_backup); + ©BinFile($old_keydb,$keydb); + } + else { + print("\n\n$keydb already exists. Do you want to overwrite it ? [no]: "); + my $answer = ; + if ($answer =~ /^y|yes$/i) { + ©BinFile($old_keydb,$keydb); + } + } + } + else { + ©BinFile($old_keydb,$keydb); + } + } + if (-f $old_certdb) { + if (-f $certdb) { + if ($NO_INPUT_USER) { + printMsg("\n$certdb already exists. backup in $certdb_backup ..."); + ©BinFile($certdb,$certdb_backup); + ©BinFile($old_certdb,$certdb); + } + else { + print("\n\n$certdb already exists. Do you want to overwrite it ? [no]: "); + my $answer = ; + if ($answer =~ /^y|yes$/i) { + ©BinFile($old_certdb,$certdb); + } + } + } + else { + ©BinFile($old_certdb,$certdb); + } + } + # copy the old password file + if (-f "$oldDir${PATHSEP}alias${PATHSEP}$type-$oldname-pin.txt") { + ©BinFile( + "$oldDir${PATHSEP}alias${PATHSEP}$type-$oldname-pin.txt", + "$aliasDir${PATHSEP}$type-$newname-pin.txt" + ); + } + } + +} + +sub DisableSSL { + my $entry = $conn->search("cn=config","base","objectclass=*"); + my $LDAPparam = "nsslapd-security" ; + my $Value = "off" ; + if ($entry->{$LDAPparam}[0] ne $Value) { + printTrace("\nDisable SSL...",1); + $entry->setValues($LDAPparam, $Value); + } + my $res = $conn->update($entry); + if ($res) { + printTrace("\nSSL disabled",2); + } + else { + printMsg("\nCan't disabled SSL. The server may have problems to start"); + } +} + +# enable the migration of client authentication informations +sub MigrateCertmap { + # backup the old 5.x certmap.conf and replace it with the 4.x certmap.conf file + my $oldCertmap = "$oldDir${PATHSEP}shared${PATHSEP}config${PATHSEP}certmap.conf"; + my $newCertmap = "$root${PATHSEP}shared${PATHSEP}config${PATHSEP}certmap.conf" ; + my $backupCertmap = "$root${PATHSEP}shared${PATHSEP}config${PATHSEP}certmap.conf_backup" ; + if (&hasChangedoldCertmap($oldCertmap)) { + if ($NO_INPUT_USER) { + printMsg("\n$newCertmap has been backup in $backupCertmap"); + ©BinFile($newCertmap,$backupCertmap); + ©BinFile($oldCertmap,$newCertmap); + } + else { + my $Ask = 1 ; + while ($Ask) { + printMsg("\n\nWhere do you want to back up the file $newCertmap [$backupCertmap] ?") ; + my $Answer = ; + $backupCertmap = $Answer if ($Answer ne "\n"); + chomp($backupCertmap); + printTrace("\nDest: .$backupCertmap.",4); + if (-e $backupCertmap) { + printMsg("\n\n$backupCertmap already exists. Do you want to overwrite it Yes/No [No] ?") ; + if ( =~ /yes|y/i) { + $Ask = 0 ; + } + else { + $backupCertmap = "$root${PATHSEP}shared${PATHSEP}config${PATHSEP}certmap.conf_backup" ; + } + } + else { + $Ask = 0 ; + } + } + printTrace("\nBackup file: $newCertmap in $backupCertmap",4); + ©BinFile($newCertmap,$backupCertmap); + ©BinFile($oldCertmap,$newCertmap); + } + } + else { + } +} + +sub hasChangedoldCertmap { + my $certmapfile = shift ; + my @reference = ("certmap default default", + "default:DNComps", + "default:FilterComps e") ; + my $cpt = 0 ; + printTrace("\nhasChangedoldCertmap",3); + open(CERTMAP,"< $certmapfile"); + while () { + if ((! /^\s*#/) && (! /^\s*$/)) { + my $ref = $reference[$cpt] ; + printTrace("\nValue: $_, ref: $ref",4); + if (! /^\s*$ref\s*$/) { + return 1 ; + } + else { + $cpt++ ; + } + } + } + close (CERTMAP); + printTrace("\ncpt: $cpt",4); + if ($cpt < $#reference) { + return 1 ; + } + else { + return 0 ; + } +} +############################################################################# +# copy a directory to another + +sub copyDir { + my $src = shift; + my $dest = shift; + my $exclude = shift; + + opendir( SRC, $src ) or die "Can't open directory $src: $!: "; + my $mode; + my $uid; + my $gid; + mkdir ( $dest , 0755 ) or die "\nCan't create directory $dest. \nPlease check you have enough rights to create it and/or check that your parent directory exists.\n" if !( -e $dest ); + if ($PRESERVE) { + $mode = (stat($src))[2]; + ($uid, $gid) = (stat(_))[4..5]; + # Make sure files owned by the old user are owned by the + # new user + if ($uid == $olduid) { + $uid = $newuid; + $gid = $newgid; + } + chown $uid, $gid, $dest; + chmod $mode, $dest; + } + local ( @files ) = readdir ( SRC ); + closedir( SRC ); + for ( @files ) { + if ( $_ eq "." || $_ eq ".." ) { + next; + } elsif ( $exclude && /$exclude/ ) { + next; + } elsif( -d "$src${PATHSEP}$_") { + ©Dir ( "$src${PATHSEP}$_", "$dest${PATHSEP}$_" ); + } else { + ©BinFile ( "$src${PATHSEP}$_", "$dest${PATHSEP}$_"); + } + } +} + +sub copyBinFile { + my $src = shift; + my $dest = shift; + my $buf = ""; + my $bufsize = 8192; + + open( SRC, $src ) || die "Can't open $src: $!\n"; + # if we are given a directory destination instead of a file, extract the + # filename portion of the source to use as the destination filename + if (-d $dest) { + $dest = $dest . $PATHSEP . &basename($src); + } + open( DEST, ">$dest" ) || die "Can't create $dest: $!\n"; + binmode SRC; + binmode DEST; + if ($PRESERVE) { + $mode = (stat($src))[2]; + ($uid, $gid) = (stat(_))[4..5]; + # Make sure files owned by the old user are owned by the + # new user + if ($uid == $olduid) { + $uid = $newuid; + $gid = $newgid; + } + chown $uid, $gid, $dest; + chmod $mode, $dest; + } + while (read(SRC, $buf, $bufsize)) { + print DEST $buf; + } + close( SRC ); + close( DEST ); +} +############################################################################# +# backup 5.x configuration files +# backup the directory /slapd-instance/config dans /slapd-instance/BackupConfig + +sub backupConfigFiles { + # backup the 5.x config files + my $src = "$serverHome${PATHSEP}config" ; + my $dest = "$serverHome${PATHSEP}config_backup" ; + if ($NO_INPUT_USER) { + printMsg("\n$src has been backup in $dest"); + ©Dir($src,$dest); + } + else { + my $Ask = 1 ; + while ($Ask) { + printMsg("\n\nWhere do you want to back up your configuration directory [$dest] ?") ; + my $Answer = ; + $dest = $Answer if ($Answer ne "\n"); + chomp($dest); + printTrace("\nDest: .$dest.",4); + if (-e $dest) { + printMsg("\n\n$dest already exists. Do you want to overwrite it Yes/No [No] ?") ; + if ( =~ /yes|y/i) { + $Ask = 0 ; + } + else { + $dest = "$serverHome${PATHSEP}config_backup" ; + } + } + else { + $Ask = 0 ; + } + } + printTrace("\nBackup Directory: $src in $dest",4); + ©Dir($src,$dest); + } +} +############################################################################# + +sub getLDAPservername { + my $oldLDAPservername; + my $LDAPservername; + open(OLDSLAPDCONF, $oldSlapdConf) or + die "\nError: could not open old config file $oldSlapdConf \n"; + while() { + chop; + if (/^localhost\s+/i) { + ($oldLDAPservername = $') =~ s/^[\"]//;; + $oldLDAPservername =~ s/[\"]$//; + printTrace("\nName of the old LDAP server: $oldLDAPservername",3); + } + } + close(OLDSLAPDCONF); + + open( DSELDIF, "< $DSEldif" ) || die "\nCan't open $DSEldif \n"; + my $in = new Mozilla::LDAP::LDIF(*DSELDIF) ; + while ($entry = readOneEntry $in) { + my $DN = $entry->getDN() ; + if ($DN =~ /^cn=config$/i) { + my $localhost = "nsslapd-localhost"; + my @values = $entry->getValues($localhost); + if ($#values != -1) { + $LDAPservername = $values[0]; + } + break; + } + } + close(DSELDIF); + # check 4.x and 5.x are installed on the same physical machine. + if (lc($oldLDAPservername) ne lc($LDAPservername)) { + # warn the user he tries to migrate a 4.x server installed on a different machine from the 5.x one + printMsg("\n\nYour 4.x server is on $oldLDAPservername, and your 5.x server is on $LDAPservername. We don't support migration on different machines. Do you want to continue ? Yes/No [No]:") ; + if (! ( =~ /yes|y/i)) { + return -1; + } + } + return $LDAPservername ; +} + +############################################################################# + +sub getVersion { + my $dir = shift; + my $version = 0; + my $minor = 0; + my $buildNumber = 0; + my $progDir = "${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${PATHSEP}"; + my $progDir2 = "${PATHSEP}bin${PATHSEP}slapd${PATHSEP}"; + + # find the slapd executable + $prog = $dir . $progDir . $slapdExecName; + if (! -f $prog) { + $prog = $dir . $progDir2 . $slapdExecName; + if (-f $prog && $isNT) { + # if slapd is in bin/slapd and we're on NT, just assume version 1; + # apparently, slapd.exe doesn't like the -v argument . . . + return ( '1', $minor ); + } + else{ + die "Could not run slapd program $prog: $!"; + } + } + else { + chdir($dir . $progDir); + } + $ENV{"$LIB_PATH"}="$dir${PATHSEP}lib${SEP}".$ENV{"$LIB_PATH"}; + # read the old version from the old slapd program + + open(F, "${quote}${quote}$prog${quote} -v${quote} 2>&1 |") or + die "Could not run slapd program $prog: $!"; + sleep(1); # allow some data to accumulate in the pipe +# print "Output from $prog -v:\n"; + while () { + print; + if (/^Netscape-Directory\/(\d+)\.(\d+)\s+(\S+)/) { + $version = $1; + $minor = $2; + $buildNumber = $3; + last; + } + elsif (/^Netscape-Directory\(restrict?ed-mode\)\/(\d+)\.(\d+)\s+(\S+)/) { # we can have restricted-mode or restriced-mode ... + $version = $1; + $minor = $2; + $buildNumber = $3; + last; + } + elsif (/^iPlanet-Directory\/(\d+)\.(\d+)\s+(\S+)/i) { + $version = $1; + $minor = $2; + $buildNumber = $3; + last; + } + } + $code = close(F); +# print "$prog returned code=$code status=$?\n"; + $ENV{"$LIB_PATH"}="$root${PATHSEP}lib${SEP}".$ENV{"$LIB_PATH"}; + + if ($version == 0) { + printMsg("\nCould not determine version of the directory server in $dir: "); + printMsg("\nBe careful, this script is designed to migrate only from 4.x Netscape Directory Server to 5.x. Do you want to continue ? [no]: "); + my $answer = ; + if (! ($answer =~ /y|yes/i)) { + exit(1); + } + $version = 4 ; # setup to 4 and pray ... + } + + # distinguish the 4.1 and the 4.11 thanks to the buildNumber + if (($version == 4) && ($minor == 1)){ + if (! ($buildNumber =~ /^B99\.16/)) { + # it's not a 4.1 Netscape Directory Server => it's a 4.11 + $minor = 11 ; + } + } + return ( $version, $minor ); +} + +############################################################################# + +sub getDiff { + # we get references to arrays + my $elements = shift ; + my $existing_elements = shift ; + my %count = () ; + my %countEE = () ; + @diff = () ; + foreach $e (@{$elements}, @{$existing_elements}) { $count{$e}++ ;} + foreach $e (@{existing_elements}) { $countEE{$e}++ ;} + foreach $e (@{$elements}) { + # if $e is only present in @$elements, we push it to the diff array + if (($count{$e} == 1) && ($countEE{$e} == 0)) { + push @diff, $e ; + } + } + return @diff ; +} + +############################################################################################### +sub testIndexUpdating { + #my $entry = $conn->newEntry(); + #$entry->setDN("cn=djeattribute,cn=index,cn=MigratedDB_5,cn=ldbm database,cn=plugins,cn=config"); + my $entry = $conn->search("cn=mail,cn=index,cn=MigratedDB_2,cn=ldbm database,cn=plugins,cn=config","base","objectclass=nsIndex"); + my @types = ("pres", "sub", "eq") ; + my @existing_types = $entry->getValues("nsindextype"); + my @typesToAdd = &getDiff(\@types, \@existing_types); + foreach $newtype (@typesToAdd) { + $entry->addValue("nsindextype", $newtype); printTrace("\nnewtype: $newtype",2); + } + my $res = $conn->update($entry) ; + if ($res) {print("\nUpdate index mail\n");} + else { print("\ncan't update index mail");} + + $entry = $conn->search("cn=givenName,cn=index,cn=MigratedDB_2,cn=ldbm database,cn=plugins,cn=config","base","objectclass=nsIndex"); + @types = ("pres", "sub", "eq") ; + @existing_types = $entry->getValues("nsindextype"); print("\ngivenName, existing_types: @existing_types"); + @typesToAdd = &getDiff(\@types, \@existing_types); print("\nTypesToAdd: @typesToAdd"); + foreach $newtype (@typesToAdd) { + $entry->addValue("nsindextype", $newtype); printTrace("\nnewtype: $newtype",2); + } + my $res = $conn->update($entry) ; + if ($res) {print("\nUpdate index givenName\n");} + else { print("\ncan't update index givenName");} + } + + +############################################################################################### +sub normalizeDir { + my $dir = shift ; + my $dir_prec = "" ; + while ($dir_prec ne $dir) { + $dir_prec = $dir ; + if ($isNT) { + grep { s@\\\\@\\@g } $dir ; + } + else { + grep { s@//@/@g } $dir ; + } + } + return $dir ; +} + + +############################################################################################### +# return 1 if the value parameters is +sub isAllowedPlugin { + my $Value = lc(shift) ; + if ($allowedPlugins{$Value}) { + return 1 ; + } + else { + return 0 ; + } + +} + + +sub getSyntaxOid { + my $Value = lc(shift) ; + return $allowedPlugins{$Value} ; +} + +############################################################################################### +# return 1 if the value given in parameters is an allowed modifier +sub isAllowedModifier { + my $Value = lc(shift) ; + if ($allowedModifiers{$Value}) { + return 1 ; + } + else { + return 0 ; + } +} + +sub getModifierValue { + my $Value = lc(shift) ; + return $allowedModifiers{$Value} ; +} + +############################################################################################### + +sub GetTime { + my $tm = localtime; + (my $sec, my $min, my $hour, my $dd, my $mm, my $yy) = ($tm->sec, $tm->min, $tm->hour, $tm->mday, ($tm->mon)+1, ($tm->year)+1900); + $sec = "0$sec" unless $sec > 9 ; + $min = "0$min" unless $min > 9 ; + $hour = "0$hour" unless $hour > 9 ; + $dd = "0$dd" unless $dd > 9 ; + $mm = "0$mm" unless $mm > 9 ; + return ($sec, $min, $hour, $dd, $mm, $yy); +} + +############################################################################################### +# get uid and group id of the 5.x slapd server. +# The uid is done through the nsslapd-localuser attribute + +sub getuid_gid { + my $newuid ; + my $newgid ; + my $localuser ; + my $localuser_attr = "nsslapd-localuser" ; + if (! $isNT) { + my $entry = $conn->search("cn=config ", "base","objectclass=*", 0, ($localuser_attr)) ; + # Tests wether we succeed to get the entry cn=config + die "\nCan't get the entry cn=config \n" unless ($entry); + my @values = $entry->getValues($localuser_attr); + if ($#values == -1 || ($values[0] eq "") ) { # tests wether the nsslapd-localuser attribute has a value + printMsg("\nNo localuser has been found in the configuration of the directory. "); + if ($NO_INPUT_USER) { + printMsg("\nWe considered nobody as the localuser"); + $localuser = "nobody" ; + } + else { + my $Ask = 1 ; + while ($Ask) { + printMsg("\nUnder what user does your $Version.$Minor directory server run [nobody] ? ") ; + $localuser = ; + chomp($localuser); + $localuser = "nobody" if ($localuser eq ""); + ($newuid, $newgid) = (getpwnam("$localuser"))[2..3] ; + if ($newuid) { + $Ask = 0 ; + } + else { + printMsg("\nError: $localuser is unknown from the system "); + } + } + } + } + else { + $localuser = $values[0]; # returns the first value (we should only have one localuser) + my $size = $#values ; + } + ($newuid, $newgid) = (getpwnam("$localuser"))[2..3] ; + return ($localuser, $newuid, $newgid) ; + } + else { + return () ; + } +} + + +############################################################################################### +# get uid and group id of the 4.x slapd server. + +sub getolduid_gid { + my $oldlocaluser ; + if (! $isNT) { + open(CONF, $oldSlapdConf) or die "\nError: cannot open $oldSlapdConf: $!\n"; + while () { + if (/^localuser\s+/i) { + chomp($oldlocaluser = $'); + last; + } + } + close(CONF); + ($olduid, $oldgid) = (getpwnam("$oldlocaluser"))[2..3] ; + return ($oldlocaluser, $olduid, $oldgid) ; + } + else { + return (); + } +} + +############################################################################################### +# get current directory + +sub getCwd { + my $command = $isNT ? "cd" : "/bin/pwd"; + open(PWDCMD, "$command 2>&1 |") or + die "Error: could not execute $command: $!"; + # without the following sleep, reading from the pipe will + # return nothing; I guess it gives the pwd command time + # to get some data to read . . . + sleep(1); + my $currentdir; + while () { + if (!$currentdir) { + chomp($currentdir = $_); + } + } + my $code = close(PWDCMD); +# if ($code || $?) { +# print "$command returned code=$code status=$? dir=$curdir\n"; +# } +# print "getCwd curdir=\[$curdir\]\n"; + return $currentdir; +} diff --git a/ldap/admin/src/scripts/template-migrateTo6 b/ldap/admin/src/scripts/template-migrateTo6 new file mode 100644 index 00000000..91174b41 --- /dev/null +++ b/ldap/admin/src/scripts/template-migrateTo6 @@ -0,0 +1,3268 @@ +#{{PERL-EXEC}} +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2004 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# + +# Migrate a old directory server to a 6.2 directory server + +######################################################################################################## +# enable the use of Perldap functions +require DynaLoader; + +use Getopt::Std; +use Mozilla::LDAP::Conn; +use Mozilla::LDAP::Entry; +use Mozilla::LDAP::LDIF; +use Mozilla::LDAP::Utils qw(:all); +use Mozilla::LDAP::API qw(:api :ssl :apiv3 :constant); # Direct access to C API +use Time::localtime; + +######################################################################################################## +use Class::Struct ; # load struct-building module + +struct S_index => { + names => '@' , + types => '@' , + oids => '@' , + specific => '$' + }; + + +struct S_plugin => { + name => '$' , + type => '$' , + enable => '$' , + args => '@' + }; +##################################################################################################### + +sub usage { + print(STDERR "\nUsage: $0 -D rootdn { -w password | -w - | -j filename } -p port \n"); + print(STDERR " -o OldInstancePath -n NewInstancePath [-t tracelevel] [-L logfile]\n"); + print(STDERR "************** parameters in brackets are optionals, others are required **************\n"); + print(STDERR " Opts: -D rootdn - New Directory Manager\n"); + print(STDERR " : -w password - New Directory Manager's password\n"); + print(STDERR " : -w - - Prompt for New Directory Manager's password\n"); + print(STDERR " : -j filename - Read New Directory Manager's password from file\n"); + print(STDERR " : -p port - New Directory Server port\n"); + print(STDERR " : -o OldInstancePath - Path of the Old instance to migrate \n"); + print(STDERR " : -n NewInstancePath - Path of the new instance\n"); + print(STDERR " : [-d dataPath] - Path to directory containing data files to import into new instance\n"); + print(STDERR " : [-v oldVersion] - Old version (obtained by running $slapdExecName -v\n"); + print(STDERR " : [-t tracelevel] - specify the level of trace (0..3)\n"); + print(STDERR " : [-L logfile] - specify the file to log the migration report \n"); + + + } + + + +############# +BEGIN { + + require 'uname.lib' ; + $isNT = -d '\\'; + $PATHSEP = $isNT ? "\\" : "/"; + ${SEP} = $isNT ? ";" : ":" ; + @INC = ( '.', '../../../admin/admin/bin'); + grep { s@/@\\@g } @INC if $isNT; + $script_suffix = $isNT ? ".bat" : ""; + $exe_suffix = $isNT ? ".exe" : ""; + # NT needs quotes around some things unix doesn't + $quote = $isNT ? "\"" : ""; + + # If this variable is set, all file/directory creation will make sure the mode + # and ownership of the destination is the same as the source + $PRESERVE = 1 if (!$isNT); + $script_suffix = $isNT ? ".bat" : ""; + $exe_suffix = $isNT ? ".exe" : ""; + if ($isNT) { + $os = "WINNT"; + } else { + $os = &uname("-s"); + } + if ($isNT) { + # we have to pass batch files directly to the NT command interpreter + $com_spec = $ENV{ComSpec}; + if (!$com_spec) { + $com_spec = $ENV{COMSPEC}; + } + if (!$com_spec || ! -f $com_spec) { + # find the first available command interpreter + foreach $drive (c..z) { + $com_spec = "$drive:\\winnt\\system32\\cmd.exe"; + last if (-f $com_spec); + $com_spec = undef; + } + if (! $com_spec) { + # punt and pray + $com_spec = 'c:\winnt\system32\cmd.exe'; + } + } + } + if ( $os eq "AIX" ) { + $dll_suffix = "_shr.a"; + } + elsif ( $os eq "HP-UX" ) { + $dll_suffix = ".sl"; + } + elsif ( $os eq "WINNT" ) { + $dll_suffix = ".dll"; + } + else { + $dll_suffix = ".so"; + } + $slapdExecName = $isNT ? 'slapd.exe' : './ns-slapd'; + # if this flag is set, we will migrate the old database + # by doing a db2ldif -> ldif2db; + $convertToLDIF = 1; + select STDERR; + $| = 1; + select STDOUT; + $| = 1; + # if the old value for dbcachesize is less than this, make it this + $MIN_DBCACHESIZE = '500000'; +} + +SWITCH: { + if ($os eq "AIX") { + $LIB_PATH = "LIBPATH" ; + last SWITCH ; + } + if ($os eq "HP-UX") { + $LIB_PATH = "SHLIB_PATH" ; + last SWITCH ; + } + if ($isNT) { + $LIB_PATH = "PATH" ; + last SWITCH ; + } + else { + $LIB_PATH = "LD_LIBRARY_PATH" ; + last SWITCH ; + } + } + + # Old parameters + ${oldDir} = "" ; + ${oldname} = "" ; + ${oldHome} = "" ; + ${oldConfDir} = "" ; + ${oldlocaluser} ; + ${olduid} ; + ${oldgid} ; + + # New parameters + ${root} = "{{DS-ROOT}}" ; + ${type} = "" ; + ${newname} = "" ; + ${newport} = "" ; + ${rootDN} = "" ; + ${rootpwd} = "" ; + ${localhost} = "" ; + ${LogFileReport} = "" ; + ${newuid} ; + ${localuser} ; + ${newgid} ; + $NO_INPUT_USER = 0 ; # by default user can give inputs during the migration process + ${curdir} = getCwd(); + ${slapdExecDir} = "${root}${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${PATHSEP}"; + + # specify the level of trace + $TRACELEVEL=1; + + $LDAP_SERVER_UNREACHABLE = 81; + + # get input users + &getParameters() ; + ${oldDir} = &normalizeDir("${oldDir}"); + ${oldHome} = "${oldDir}${PATHSEP}$type-$oldname" ; + ${oldConfDir} = "${oldHome}${PATHSEP}config${PATHSEP}" ; + ${oldSlapdConf} = "${oldConfDir}slapd.conf" ; + ${oldDSEldif} = "${oldConfDir}dse.ldif" ; + ${serverHome} = "${root}${PATHSEP}$type-$newname" ; + ${DSEldif} = "$serverHome${PATHSEP}config${PATHSEP}dse.ldif"; + ${ldif_rep} = "${oldConfDir}${PATHSEP}ldif${PATHSEP}" ; + ${oldSlapdExecDir} = "${oldDir}${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${PATHSEP}"; + + + + + open(LOGFILE, ">> $LogFileReport"); + + printTrace("\noldDir: $oldDir, oldHome: $oldHome, \noldConfDir: $oldConfDir, \noldSlapdConf: $oldSlapdConf, \nldif_rep: $ldif_rep, \nrootDN: $rootDN, \nPwd: ******, \nPort: $newport, \nNewname: $newname\n",3); + printTrace("\nLIB_PATH: $LIB_PATH",4); + + if (!(-d $serverHome)) { + printMsg("\n$serverHome doesn't exist\n"); + exit(1); + } + if (!(-d $oldHome)) { + printMsg("\n$oldHome doesn't exist\n"); + exit(1); + } + + if ($olddatadir && !(-d $olddatadir)) { + print("\n$olddatadir doesn't exist\n"); + exit(1); + } + +#define CONFIG_DATABASE_DIRECTIVE "database" +#define CONFIG_DATABASE_ATTRIBUTE "nsslapd-database" +#define CONFIG_PLUGIN_DIRECTIVE "plugin" +#define CONFIG_PLUGIN_ATTRIBUTE "nsslapd-plugin" +#define CONFIG_SIZELIMIT_DIRECTIVE "sizelimit" +#define CONFIG_SIZELIMIT_ATTRIBUTE "nsslapd-sizelimit" +#define CONFIG_ORCAUTO_DIRECTIVE "orcauto" +#define CONFIG_ORCAUTO_ATTRIBUTE "nsslapd-orcauto" +#define CONFIG_TIMELIMIT_DIRECTIVE "timelimit" +#define CONFIG_TIMELIMIT_ATTRIBUTE "nsslapd-timelimit" +#define CONFIG_SUFFIX_DIRECTIVE "suffix" +#define CONFIG_SUFFIX_ATTRIBUTE "nsslapd-suffix" +#define CONFIG_READONLY_DIRECTIVE "readonly" +#define CONFIG_READONLY_ATTRIBUTE "nsslapd-readonly" +#define CONFIG_REFERRAL_DIRECTIVE "referral" +#define CONFIG_REFERRAL_ATTRIBUTE "nsslapd-referral" +#define CONFIG_OBJECTCLASS_DIRECTIVE "objectclass" +#define CONFIG_OBJECTCLASS_ATTRIBUTE "nsslapd-objectclass" +#define CONFIG_ATTRIBUTE_DIRECTIVE "attribute" +#define CONFIG_ATTRIBUTE_ATTRIBUTE "nsslapd-attribute" +#define CONFIG_SCHEMACHECK_DIRECTIVE "schemacheck" +#define CONFIG_SCHEMACHECK_ATTRIBUTE "nsslapd-schemacheck" +#define CONFIG_LOGLEVEL_DIRECTIVE "loglevel" +#define CONFIG_LOGLEVEL_ATTRIBUTE "nsslapd-errorlog-level" +#define CONFIG_ACCESSLOGLEVEL_DIRECTIVE "accessloglevel" +#define CONFIG_ACCESSLOGLEVEL_ATTRIBUTE "nsslapd-accesslog-level" +#define CONFIG_ACCESSLOG_MAXNUMOFLOGSPERDIR_DIRECTIVE "accesslog-maxNumOfLogsPerDir" +#define CONFIG_ACCESSLOG_MAXNUMOFLOGSPERDIR_ATTRIBUTE "nsslapd-accesslog-maxlogsperdir" +#define CONFIG_ERRORLOG_MAXNUMOFLOGSPERDIR_DIRECTIVE "errorlog-maxNumOfLogsPerDir" +#define CONFIG_ERRORLOG_MAXNUMOFLOGSPERDIR_ATTRIBUTE "nsslapd-errorlog-maxlogsperdir" +#define CONFIG_AUDITLOG_MAXNUMOFLOGSPERDIR_DIRECTIVE "auditlog-maxNumOfLogsPerDir" +#define CONFIG_AUDITLOG_MAXNUMOFLOGSPERDIR_ATTRIBUTE "nsslapd-auditlog-maxlogsperdir" +#define CONFIG_ACCESSLOG_MAXLOGSIZE_DIRECTIVE "accesslog-maxlogsize" +#define CONFIG_ACCESSLOG_MAXLOGSIZE_ATTRIBUTE "nsslapd-accesslog-maxlogsize" +#define CONFIG_ERRORLOG_MAXLOGSIZE_DIRECTIVE "errorlog-maxlogsize" +#define CONFIG_ERRORLOG_MAXLOGSIZE_ATTRIBUTE "nsslapd-errorlog-maxlogsize" +#define CONFIG_AUDITLOG_MAXLOGSIZE_DIRECTIVE "auditlog-maxlogsize" +#define CONFIG_AUDITLOG_MAXLOGSIZE_ATTRIBUTE "nsslapd-auditlog-maxlogsize" +#define CONFIG_ACCESSLOG_LOGROTATIONTIME_DIRECTIVE "accesslog-logrotationtime" +#define CONFIG_ACCESSLOG_LOGROTATIONTIME_ATTRIBUTE "nsslapd-accesslog-logrotationtime" +#define CONFIG_ERRORLOG_LOGROTATIONTIME_DIRECTIVE "errorlog-logrotationtime" +#define CONFIG_ERRORLOG_LOGROTATIONTIME_ATTRIBUTE "nsslapd-errorlog-logrotationtime" +#define CONFIG_AUDITLOG_LOGROTATIONTIME_DIRECTIVE "auditlog-logrotationtime" +#define CONFIG_AUDITLOG_LOGROTATIONTIME_ATTRIBUTE "nsslapd-auditlog-logrotationtime" +#define CONFIG_ACCESSLOG_LOGROTATIONTIMEUNIT_DIRECTIVE "accesslog-logrotationtimeunit" +#define CONFIG_ACCESSLOG_LOGROTATIONTIMEUNIT_ATTRIBUTE "nsslapd-accesslog-logrotationtimeunit" +#define CONFIG_ERRORLOG_LOGROTATIONTIMEUNIT_DIRECTIVE "errorlog-logrotationtimeunit" +#define CONFIG_ERRORLOG_LOGROTATIONTIMEUNIT_ATTRIBUTE "nsslapd-errorlog-logrotationtimeunit" +#define CONFIG_AUDITLOG_LOGROTATIONTIMEUNIT_DIRECTIVE "auditlog-logrotationtimeunit" +#define CONFIG_AUDITLOG_LOGROTATIONTIMEUNIT_ATTRIBUTE "nsslapd-auditlog-logrotationtimeunit" +#define CONFIG_ACCESSLOG_MAXLOGDISKSPACE_DIRECTIVE "accesslog-maxlogdiskspace" +#define CONFIG_ACCESSLOG_MAXLOGDISKSPACE_ATTRIBUTE "nsslapd-accesslog-logmaxdiskspace" +#define CONFIG_ERRORLOG_MAXLOGDISKSPACE_DIRECTIVE "errorlog-maxlogdiskspace" +#define CONFIG_ERRORLOG_MAXLOGDISKSPACE_ATTRIBUTE "nsslapd-errorlog-logmaxdiskspace" +#define CONFIG_AUDITLOG_MAXLOGDISKSPACE_DIRECTIVE "auditlog-maxlogdiskspace" +#define CONFIG_AUDITLOG_MAXLOGDISKSPACE_ATTRIBUTE "nsslapd-auditlog-logmaxdiskspace" +#define CONFIG_ACCESSLOG_MINFREEDISKSPACE_DIRECTIVE "accesslog-minfreediskspace" +#define CONFIG_ACCESSLOG_MINFREEDISKSPACE_ATTRIBUTE "nsslapd-accesslog-logminfreediskspace" +#define CONFIG_ERRORLOG_MINFREEDISKSPACE_DIRECTIVE "errorlog-minfreediskspace" +#define CONFIG_ERRORLOG_MINFREEDISKSPACE_ATTRIBUTE "nsslapd-errorlog-logminfreediskspace" +#define CONFIG_AUDITLOG_MINFREEDISKSPACE_DIRECTIVE "auditlog-minfreediskspace" +#define CONFIG_AUDITLOG_MINFREEDISKSPACE_ATTRIBUTE "nsslapd-auditlog-logminfreediskspace" +#define CONFIG_ACCESSLOG_LOGEXPIRATIONTIME_DIRECTIVE "accesslog-logexpirationtime" +#define CONFIG_ACCESSLOG_LOGEXPIRATIONTIME_ATTRIBUTE "nsslapd-accesslog-logexpirationtime" +#define CONFIG_ERRORLOG_LOGEXPIRATIONTIME_DIRECTIVE "errorlog-logexpirationtime" +#define CONFIG_ERRORLOG_LOGEXPIRATIONTIME_ATTRIBUTE "nsslapd-errorlog-logexpirationtime" +#define CONFIG_AUDITLOG_LOGEXPIRATIONTIME_DIRECTIVE "auditlog-logexpirationtime" +#define CONFIG_AUDITLOG_LOGEXPIRATIONTIME_ATTRIBUTE "nsslapd-auditlog-logexpirationtime" +#define CONFIG_ACCESSLOG_LOGEXPIRATIONTIMEUNIT_DIRECTIVE "accesslog-logexpirationtimeunit" +#define CONFIG_ACCESSLOG_LOGEXPIRATIONTIMEUNIT_ATTRIBUTE "nsslapd-accesslog-logexpirationtimeunit" +#define CONFIG_ERRORLOG_LOGEXPIRATIONTIMEUNIT_DIRECTIVE "errorlog-logexpirationtimeunit" +#define CONFIG_ERRORLOG_LOGEXPIRATIONTIMEUNIT_ATTRIBUTE "nsslapd-errorlog-logexpirationtimeunit" +#define CONFIG_AUDITLOG_LOGEXPIRATIONTIMEUNIT_DIRECTIVE "auditlog-logexpirationtimeunit" +#define CONFIG_AUDITLOG_LOGEXPIRATIONTIMEUNIT_ATTRIBUTE "nsslapd-auditlog-logexpirationtimeunit" +#define CONFIG_ACCESSLOG_LOGGING_ENABLED_DIRECTIVE "accesslog-logging-enabled" +#define CONFIG_ACCESSLOG_LOGGING_ENABLED_ATTRIBUTE "nsslapd-accesslog-logging-enabled" +#define CONFIG_ERRORLOG_LOGGING_ENABLED_DIRECTIVE "errorlog-logging-enabled" +#define CONFIG_ERRORLOG_LOGGING_ENABLED_ATTRIBUTE "nsslapd-errorlog-logging-enabled" +#define CONFIG_AUDITLOG_LOGGING_ENABLED_DIRECTIVE "auditlog-logging-enabled" +#define CONFIG_AUDITLOG_LOGGING_ENABLED_ATTRIBUTE "nsslapd-auditlog-logging-enabled" +#define CONFIG_ROOTDN_DIRECTIVE "rootdn" +#define CONFIG_ROOTDN_ATTRIBUTE "nsslapd-rootdn" +#define CONFIG_ROOTPW_DIRECTIVE "rootpw" +#define CONFIG_ROOTPW_ATTRIBUTE "nsslapd-rootpw" +#define CONFIG_ROOTPWSTORAGESCHEME_DIRECTIVE "rootpwstoragescheme" +#define CONFIG_ROOTPWSTORAGESCHEME_ATTRIBUTE "nsslapd-rootpwstoragescheme" +#define CONFIG_UPDATEDN_DIRECTIVE "updatedn" +#define CONFIG_UPDATEDN_ATTRIBUTE "nsslapd-updatedn" +#define CONFIG_UPDATEPW_DIRECTIVE "updatepw" +#define CONFIG_UPDATEPW_ATTRIBUTE "nsslapd-updatepw" +#define CONFIG_UPDATESSLCLIENT_DIRECTIVE "updateSSLclient" +#define CONFIG_UPDATESSLCLIENT_ATTRIBUTE "nsslapd-updateSSLclient" +#define CONFIG_AUDITFILE_DIRECTIVE "auditfile" +#define CONFIG_AUDITFILE_ATTRIBUTE "nsslapd-auditlog" +#define CONFIG_LASTMOD_DIRECTIVE "lastmod" +#define CONFIG_LASTMOD_ATTRIBUTE "nsslapd-lastmod" +#define CONFIG_INCLUDE_DIRECTIVE "include" +#define CONFIG_INCLUDE_ATTRIBUTE "nsslapd-include" +#define CONFIG_DYNAMICCONF_DIRECTIVE "dynamicconf" +#define CONFIG_DYNAMICCONF_ATTRIBUTE "nsslapd-dynamicconf" +#define CONFIG_USEROC_DIRECTIVE "useroc" +#define CONFIG_USEROC_ATTRIBUTE "nsslapd-useroc" +#define CONFIG_USERAT_DIRECTIVE "userat" +#define CONFIG_USERAT_ATTRIBUTE "nsslapd-userat" +#define CONFIG_SVRTAB_DIRECTIVE "svrtab" +#define CONFIG_SVRTAB_ATTRIBUTE "nsslapd-svrtab" +#ifndef _WIN32 +#define CONFIG_LOCALUSER_DIRECTIVE "localuser" +#define CONFIG_LOCALUSER_ATTRIBUTE "nsslapd-localuser" +#endif /* !_WIN32 */ +#define CONFIG_LOCALHOST_DIRECTIVE "localhost" +#define CONFIG_LOCALHOST_ATTRIBUTE "nsslapd-localhost" +#define CONFIG_PORT_DIRECTIVE "port" +#define CONFIG_PORT_ATTRIBUTE "nsslapd-port" +#define CONFIG_LISTENHOST_DIRECTIVE "listenhost" +#define CONFIG_LISTENHOST_ATTRIBUTE "nsslapd-listenhost" +#define CONFIG_SECURITY_DIRECTIVE "security" +#define CONFIG_SECURITY_ATTRIBUTE "nsslapd-security" +#define CONFIG_SSL3CIPHERS_DIRECTIVE "SSL3ciphers" +#define CONFIG_SSL3CIPHERS_ATTRIBUTE "nsslapd-SSL3ciphers" +#define CONFIG_ACCESSLOG_DIRECTIVE "accesslog" +#define CONFIG_ACCESSLOG_ATTRIBUTE "nsslapd-accesslog" +#define CONFIG_ERRORLOG_DIRECTIVE "errorlog" +#define CONFIG_ERRORLOG_ATTRIBUTE "nsslapd-errorlog" +#define CONFIG_INSTANCEDIR_DIRECTIVE "instancedir" +#define CONFIG_INSTANCEDIR_ATTRIBUTE "nsslapd-instancedir" +#define CONFIG_SECUREPORT_DIRECTIVE "secure-port" +#define CONFIG_SECUREPORT_ATTRIBUTE "nsslapd-securePort" +#define CONFIG_SECURELISTENHOST_DIRECTIVE "secure-listenhost" +#define CONFIG_SECURELISTENHOST_ATTRIBUTE "nsslapd-securelistenhost" +#define CONFIG_THREADNUMBER_DIRECTIVE "threadnumber" +#define CONFIG_THREADNUMBER_ATTRIBUTE "nsslapd-threadnumber" +#define CONFIG_MAXTHREADSPERCONN_DIRECTIVE "maxthreadsperconn" +#define CONFIG_MAXTHREADSPERCONN_ATTRIBUTE "nsslapd-maxthreadsperconn" +#if !defined(_WIN32) && !defined(AIX) +#define CONFIG_MAXDESCRIPTORS_DIRECTIVE "maxdescriptors" +#define CONFIG_MAXDESCRIPTORS_ATTRIBUTE "nsslapd-maxdescriptors" +#endif /* !_WIN32 && ! AIX */ +#define CONFIG_RESERVEDESCRIPTORS_DIRECTIVE "reservedescriptors" +#define CONFIG_RESERVEDESCRIPTORS_ATTRIBUTE "nsslapd-reservedescriptors" +#define CONFIG_IDLETIMEOUT_DIRECTIVE "idletimeout" +#define CONFIG_IDLETIMEOUT_ATTRIBUTE "nsslapd-idletimeout" +#define CONFIG_IOBLOCKTIMEOUT_DIRECTIVE "ioblocktimeout" +#define CONFIG_IOBLOCKTIMEOUT_ATTRIBUTE "nsslapd-ioblocktimeout" +#define CONFIG_NTSYNCH_DIRECTIVE "ntsynch" +#define CONFIG_NTSYNCH_ATTRIBUTE "nsslapd-NTSynch" +#define CONFIG_NTSYNCHUSESSL_DIRECTIVE "ntsynchusessl" +#define CONFIG_NTSYNCHUSESSL_ATTRIBUTE "nsslapd-NTSynch-SSL" +#define CONFIG_NTSYNCHPORT_DIRECTIVE "ntsynch-port" +#define CONFIG_NTSYNCHPORT_ATTRIBUTE "nsslapd-NTSynch-port" +#define CONFIG_ACCESSCONTROL_DIRECTIVE "accesscontrol" +#define CONFIG_ACCESSCONTROL_ATTRIBUTE "nsslapd-accesscontrol" +#define CONFIG_GROUPEVALNESTLEVEL_DIRECTIVE "groupevalnestlevel" +#define CONFIG_GROUPEVALNESTLEVEL_ATTRIBUTE "nsslapd-groupevalnestlevel" +#define CONFIG_NAGLE_DIRECTIVE "nagle" +#define CONFIG_NAGLE_ATTRIBUTE "nsslapd-nagle" +#define CONFIG_PW_CHANGE_DIRECTIVE "pw_change" +#define CONFIG_PW_CHANGE_ATTRIBUTE "passwordChange" +#define CONFIG_PW_MUSTCHANGE_DIRECTIVE "pw_must_change" +#define CONFIG_PW_MUSTCHANGE_ATTRIBUTE "passwordMustChange" +#define CONFIG_PW_SYNTAX_DIRECTIVE "pw_syntax" +#define CONFIG_PW_SYNTAX_ATTRIBUTE "passwordCheckSyntax" +#define CONFIG_PW_MINLENGTH_DIRECTIVE "pw_minlength" +#define CONFIG_PW_MINLENGTH_ATTRIBUTE "passwordMinLength" +#define CONFIG_PW_EXP_DIRECTIVE "pw_exp" +#define CONFIG_PW_EXP_ATTRIBUTE "passwordExp" +#define CONFIG_PW_MAXAGE_DIRECTIVE "pw_maxage" +#define CONFIG_PW_MAXAGE_ATTRIBUTE "passwordMaxAge" +#define CONFIG_PW_MINAGE_DIRECTIVE "pw_minage" +#define CONFIG_PW_MINAGE_ATTRIBUTE "passwordMinAge" +#define CONFIG_PW_WARNING_DIRECTIVE "pw_warning" +#define CONFIG_PW_WARNING_ATTRIBUTE "passwordWarning" +#define CONFIG_PW_HISTORY_DIRECTIVE "pw_history" +#define CONFIG_PW_HISTORY_ATTRIBUTE "passwordHistory" +#define CONFIG_PW_INHISTORY_DIRECTIVE "pw_inhistory" +#define CONFIG_PW_INHISTORY_ATTRIBUTE "passwordInHistory" +#define CONFIG_PW_LOCKOUT_DIRECTIVE "pw_lockout" +#define CONFIG_PW_LOCKOUT_ATTRIBUTE "passwordLockout" +#define CONFIG_PW_STORAGESCHEME_DIRECTIVE "pw_storagescheme" +#define CONFIG_PW_STORAGESCHEME_ATTRIBUTE "passwordStorageScheme" +#define CONFIG_PW_MAXFAILURE_DIRECTIVE "pw_maxfailure" +#define CONFIG_PW_MAXFAILURE_ATTRIBUTE "passwordMaxFailure" +#define CONFIG_PW_UNLOCK_DIRECTIVE "pw_unlock" +#define CONFIG_PW_UNLOCK_ATTRIBUTE "passwordUnlock" +#define CONFIG_PW_LOCKDURATION_DIRECTIVE "pw_lockduration" +#define CONFIG_PW_LOCKDURATION_ATTRIBUTE "passwordLockoutDuration" +#define CONFIG_PW_RESETFAILURECOUNT_DIRECTIVE "pw_resetfailurecount" +#define CONFIG_PW_RESETFAILURECOUNT_ATTRIBUTE "passwordResetFailureCount" +#define CONFIG_ACCESSLOG_BUFFERING_DIRECTIVE "logbuffering" +#define CONFIG_ACCESSLOG_BUFFERING_ATTRIBUTE "nsslapd-accesslog-logbuffering" +#define CONFIG_CHANGELOG_DIR_DIRECTIVE "changelogdir" +#define CONFIG_CHANGELOG_DIR_ATTRIBUTE "nsslapd-changelogdir" +#define CONFIG_CHANGELOG_SUFFIX_DIRECTIVE "changelogsuffix" +#define CONFIG_CHANGELOG_SUFFIX_ATTRIBUTE "nsslapd-changelogsuffix" +#define CONFIG_CHANGELOG_MAXENTRIES_DIRECTIVE "changelogmaxextries" +#define CONFIG_CHANGELOG_MAXENTRIES_ATTRIBUTE "nsslapd-changelogmaxentries" +#define CONFIG_CHANGELOG_MAXAGE_DIRECTIVE "changelogmaxage" +#define CONFIG_CHANGELOG_MAXAGE_ATTRIBUTE "nsslapd-changelogmaxage" +#define CONFIG_RETURN_EXACT_CASE_DIRECTIVE "return_exact_case" +#define CONFIG_RESULT_TWEAK_DIRECTIVE "result_tweak" +#define CONFIG_REFERRAL_MODE_DIRECTIVE "referralmode" +#define CONFIG_ATTRIBUTE_NAME_EXCEPTION_DIRECTIVE "attribute_name_exceptions" +#define CONFIG_MAXBERSIZE_DIRECTIVE "maxbersize" +#define CONFIG_VERSIONSTRING_DIRECTIVE "versionstring" +#define CONFIG_ENQUOTE_SUP_OC_DIRECTIVE "enquote_sup_oc" +#define CONFIG_ENQUOTE_SUP_OC_ATTRIBUTE "nsslapd-enquote_sup_oc" +#define CONFIG_BASEDN_DIRECTIVE "certmap-basedn" +#define CONFIG_BASEDN_ATTRIBUTE "nsslapd-certmap-basedn" + +%HashParametersName = (); + +# The following hash displays only general server parameters to migrate under cn=config +%GeneralSrvParamToMigrate = ( + 'accesscontrol' => 'nsslapd-accesscontrol', + 'errorlog-logging-enabled' => 'nsslapd-errorlog-logging-enabled', + 'accesslog-logging-enabled' => 'nsslapd-accesslog-logging-enabled', + 'auditlog-logging-enabled' => 'nsslapd-auditlog-logging-enabled', + 'logbuffering' => 'nsslapd-accesslog-logbuffering', + 'accesslog-logexpirationtime' => 'nsslapd-accesslog-logexpirationtime', + 'accesslog-logexpirationtimeunit' => 'nsslapd-accesslog-logexpirationtimeunit', + 'accesslog-maxlogdiskspace' => 'nsslapd-accesslog-logmaxdiskspace', + 'accesslog-minfreediskspace' => 'nsslapd-accesslog-logminfreediskspace', + 'accesslog-logrotationtime' => 'nsslapd-accesslog-logrotationtime', + 'accesslog-logrotationtimeunit' => 'nsslapd-accesslog-logrotationtimeunit', + 'accesslog-maxlogsize' => 'nsslapd-accesslog-maxlogsize', + 'accesslog-maxnumoflogsperdir' => 'nsslapd-accesslog-maxLogsPerDir', + 'auditlog-logexpirationtime' => 'nsslapd-auditlog-logexpirationtime', + 'auditlog-logexpirationtimeunit' => 'nsslapd-auditlog-logexpirationtimeunit', + 'auditlog-maxlogdiskspace' => 'nsslapd-auditlog-logmaxdiskspace', + 'auditlog-minfreediskspace' => 'nsslapd-auditlog-logminfreediskspace', + 'auditlog-logrotationtime' => 'nsslapd-auditlog-logrotationtime', + 'auditlog-logrotationtimeunit' => 'nsslapd-auditlog-logrotationtimeunit', + 'auditlog-maxlogsize' => 'nsslapd-auditlog-maxlogsize', + 'auditlog-maxnumoflogsperdir' => 'nsslapd-auditlog-maxLogsPerDir', + 'certmap-basedn' => 'nsslapd-certmap-basedn', + 'enquote_sup_oc' => 'nsslapd-enquote-sup-oc', + 'loglevel' => 'nsslapd-errorlog-level', + 'errorlog-logexpirationtime' => 'nsslapd-errorlog-logexpirationtime', + 'errorlog-logexpirationtimeunit' => 'nsslapd-errorlog-logexpirationtimeunit', + 'errorlog-maxlogdiskspace' => 'nsslapd-errorlog-logmaxdiskspace', + 'errorlog-minfreediskspace' => 'nsslapd-errorlog-logminfreediskspace', + 'errorlog-logrotationtime' => 'nsslapd-errorlog-logrotationtime', + 'errorlog-logrotationtimeunit' => 'nsslapd-errorlog-logrotationtimeunit', + 'errorlog-maxlogsize' => 'nsslapd-errorlog-maxlogsize', + 'errorlog-maxnumoflogsperdir' => 'nsslapd-errorlog-maxlogsperdir', + 'idletimeout' => 'nsslapd-idletimeout', + 'ioblocktimeout' => 'nsslapd-ioblocktimeout', + 'lastmod' => 'nsslapd-lastmod', + 'listenhost' => 'nsslapd-listenhost', + 'maxdescriptors' => 'nsslapd-maxdescriptors', + 'referral' => 'nsslapd-referral', + 'reservedescriptors' => 'nsslapd-reservedescriptors', + 'rootpwstoragescheme' => 'nsslapd-rootpwstoragescheme', + 'schemacheck' => 'nsslapd-schemacheck', + 'secure-port' => 'nsslapd-securePort', + 'security' => 'nsslapd-security', + 'sizelimit' => 'nsslapd-sizelimit', + 'SSL3ciphers' => 'nsslapd-SSL3ciphers', + 'timelimit' => 'nsslapd-timelimit', + 'pw_change' => 'passwordChange', + 'pw_syntax' => 'passwordCheckSyntax', + 'pw_exp' => 'passwordExp', + 'pw_history' => 'passwordHistory', + 'pw_inhistory' => 'passwordInHistory', + 'pw_lockout' => 'passwordLockout', + 'pw_lockduration' => 'passwordLockoutDuration', + 'pw_maxage' => 'passwordMaxAge', + 'pw_maxfailure' => 'passwordMaxFailure', + 'pw_minage' => 'passwordMinAge', + 'pw_minlength' => 'passwordMinLength', + 'pw_must_change' => 'passwordMustChange', + 'pw_resetfailurecount' => 'passwordResetFailureCount', + 'pw_storagescheme' => 'passwordStorageScheme', + 'pw_unlock' => 'passwordUnlock', + 'pw_warning' => 'passwordWarning' +); + +# the following hash displays global parameters related to database stored under cn=config,cn=ldbm database,cn=plugins,cn=config +%GlobalConfigLDBMparamToMigrate = ( + 'allidsthreshold' => 'nsslapd-allidsthreshold', + 'lookthroughlimit' => 'nsslapd-lookthroughlimit', + 'mode' => 'nsslapd-mode', + 'dbcachesize' => 'nsslapd-dbcachesize' +); + +# the following hash displays specific parameters to each backends and stored under cn=DBname,cn=ldbm database,cn=plugins,cn=config +%LDBMparamToMigrate = ( + 'cachesize' => 'nsslapd-cachesize', + 'readonly' => 'nsslapd-readonly' +); + +%stdIncludes = ( + "${oldConfDir}slapd.at.conf", "\n", + "${oldConfDir}slapd.oc.conf", "\n", + "${oldConfDir}java-object-schema.conf", "\n", + "${oldConfDir}ns-admin-schema.conf", "\n", + "${oldConfDir}ns-calendar-schema.conf", "\n", + "${oldConfDir}ns-certificate-schema.conf", "\n", + "${oldConfDir}ns-common-schema.conf", "\n", + "${oldConfDir}ns-compass-schema.conf", "\n", + "${oldConfDir}ns-delegated-admin-schema.conf", "\n", + "${oldConfDir}ns-directory-schema.conf", "\n", + "${oldConfDir}ns-legacy-schema.conf", "\n", + "${oldConfDir}ns-mail-schema.conf", "\n", + "${oldConfDir}ns-mcd-browser-schema.conf", "\n", + "${oldConfDir}ns-mcd-config-schema.conf", "\n", + "${oldConfDir}ns-mcd-li-schema.conf", "\n", + "${oldConfDir}ns-mcd-mail-schema.conf", "\n", + "${oldConfDir}ns-media-schema.conf", "\n", + "${oldConfDir}ns-mlm-schema.conf", "\n", + "${oldConfDir}ns-msg-schema.conf", "\n", + "${oldConfDir}ns-netshare-schema.conf", "\n", + "${oldConfDir}ns-news-schema.conf", "\n", + "${oldConfDir}ns-proxy-schema.conf", "\n", + "${oldConfDir}ns-value-schema.conf", "\n", + "${oldConfDir}ns-wcal-schema.conf", "\n", + "${oldConfDir}ns-cos-schema.conf", "\n", + "${oldConfDir}ns-web-schema.conf", "\n" +); + +%userDefinedConfigFiles = ( + "slapd.conf", "\n", + "slapd.ldbm.conf", "\n", + "slapd.user_at.conf", "\n", + "slapd.user_oc.conf", "\n", + "ns-schema.conf", "\n" + ); + +$CIS_SYNTAX_OID = "1.3.6.1.4.1.1466.115.121.1.15" ; +$TELEPHONE_SYNTAX_OID = "1.3.6.1.4.1.1466.115.121.1.50" ; +$DN_SYNTAX_OID = "1.3.6.1.4.1.1466.115.121.1.12" ; +$CES_SYNTAX_OID = "1.3.6.1.4.1.1466.115.121.1.26" ; +$INT_SYNTAX_OID = "1.3.6.1.4.1.1466.115.121.1.27" ; +$BIN_SYNTAX_OID = "1.3.6.1.4.1.1466.115.121.1.5" ; + +%allowedPlugins = ( + "cis", $CIS_SYNTAX_OID, + "tel", $TELEPHONE_SYNTAX_OID, + "dn", $DN_SYNTAX_OID, + "ces", $CES_SYNTAX_OID, + "int", $INT_SYNTAX_OID, + "bin", $BIN_SYNTAX_OID + ); + +%allowedModifiers = ( + "single", "SINGLE-VALUE" + ); +# "override" is not supported anymore and "operational" cannot be used in user defined attribute. + +@oldSuffixes = () ; # array of old suffixes (with "o=netscaperoot" if presents) + +# link beetwen the name of the suffix and its associated DBname +%DBNAMES = () ; +%DBDirectory = () ; + +%oldhash = () ; + +# list of standard plugin's in version 4 +%stdPlugins = ( + "7-bit check" => "\n", + "binary syntax" => "\n", + "case exact string syntax" => "\n", + "case ignore string syntax" => "\n", + "distinguished name syntax" => "\n", + "integer syntax" => "\n", + "internationalization plugin" => "\n", + "referential integrity postoperation" => "\n", + "telephone syntax" => "\n", + "uid uniqueness" => "\n" + + ); + +# list of standard indexes configured out of the box in version 4 +%stdIndex = ( + 'aci', "\n", + 'changenumber', "\n", + 'copiedfrom', "\n", + 'dncomp', "\n", + 'entrydn', "\n", + 'numsubordinates', "\n", + 'objectclass', "\n", + 'parentid', "\n" +); + +# list of user added Plugin's. In the new version, they 'll need to be recompiled +@badPlugins = () ; + +%newIndex = () ; + +%User_oc = () ; +# push objectnames as they are encountered in config files. +@User_oc_names = () ; + +%User_at = () ; + + + +#Usage parameters +$USER_OC_FILE_MODIFIED = 0 ; # 0 if user don't want to modify LDIF objectclasses before processing, 1 else +$USER_AT_FILE_MODIFIED = 0 ; +$INDEX_FILE_MODIFIED = 0 ; + +# get the version of the DS to migrate +($oldVersion, $oldMinor) = &getVersion($oldDir, $oldversionstr); +# get the version of the new DS +($Version, $Minor) = &getVersion($root); + +# get old LIB_PATH +$old_libpath = &getLibPath($oldDir, $oldVersion, $oldMinor); +# get new LIB_PATH +$new_libpath = &getLibPath($root, $Version, $Minor); + +# Shutdown the legacy Directory instance +printTrace("\nShutdown the legacy Directory Server instance: ${oldHome}",0); +&stopServer($oldDir, 'slapd-'.$oldname); + +# compare configuration files with the standard ones +CompareStdConfigFiles() ; +die "\n\n The version of the product you want to migrate is not a 4.x Netscape Directory Server\n" unless ($oldVersion == 4) ; + +FillHashParametersName() ; + +############### Connect to the New LDAP Directory Server ###################### +$ENV{"$LIB_PATH"} = $new_libpath; +my $LDAPservername = &getLDAPservername(); +die "\n Migration aborted. Make sure your Old and New Directory Servers are installed on the same machine \n" if ( $LDAPservername == -1 ); +$conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Can't contact the $Version.$Minor LDAP server: $LDAPservername\n"; + +# continue if the connection to new LDAP server is successful ! +printTrace("\nConnected to $Version.$Minor LDAP server\n",0) ; + +# get the uid and gid of the new slapd user +($localuser, $newuid, $newgid) = getuid_gid(); +# get the uid and gid of the old slapd user +($oldlocaluser, $olduid, $oldgid) = getolduid_gid(); + +# backup new configuration files in /slapd-instancename/config +printTrace("\nBackup $serverHome${PATHSEP}config on $serverHome${PATHSEP}config_backup ...",0); +&backupConfigFiles(); + +# Parse the main configuration file: slapd.conf +printTrace("\nParse the configuration file: $oldSlapdConf...",0); +ParseSlapdConf("< ${oldSlapdConf}"); + +#migrate key/cert databases +printTrace("\nMigrate key/cert databases...",0); +&MigrateSSL(); + +# Update parameters : general server parameters, global LDBM parameter, specific backend parameters +printTrace("\nUpdate general server parameters...",0); +$conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Can't contact the $Version.$Minor LDAP server: $LDAPservername\n"; +AddGeneralParameters(); +printTrace("\nUpdate global LDBM parameters...",0); +AddGeneralLDBMParameters(); +printTrace("\nUpdate specific backend parameters...",0); +AddSpecificLDBMParameters(); + +##### FOR TESTING PURPOSE ONLY ######## +# +#testIndexUpdating(); +# +####################################### + +# Migrate some entries contained in the old dse.ldif, and migrate certmap.conf +&MigrateDSE() ; +&MigrateCertmap() ; + +# update new attribute definitions +LDAPmodify_User_at(); + +# update new object classes definitions +LDAPmodify_User_oc(); + +# add new indexes to each backends +LDAPmodify_Indexes(); + +# migrate Plug'ins parameters (enable attribute, and arguments) +LDAPmodify_stdPlugin(); + +################## Close the connection to new LDAP Server ##################### +$conn->close; + + +################## stop the new instance and Export/Import the data, restart the server ################## +if (%DBNAMES) { + &stopServer($root,'slapd-'.$newname); + if ($olddatadir) { + printTrace("\nold data directory $olddatadir...",0) ; + $ldif_rep = "$olddatadir${PATHSEP}"; + } else { + printTrace("\ndata processing...",0) ; + # migrate data for each suffix: old -> LDIF files + &db2ldif($oldSlapdConf); + } + + # migrate LDIF data to the new database: LDIF -> new + &manyLdif2db(); + &startServer(); +} +else { + printTrace("\nThere no old non-standard suffixes to migrate",0); +} + +printMsg("\n\n ****** End of migration ******\n\n"); + +close(LOGFILE); + + +########################################################################################### +# get input users +sub getParameters { + my $exit = 0 ; + my $i = 0; + my $pwdfile= ""; + while ($i <= $#ARGV) { + if ( "$ARGV[$i]" eq "-D" ) { # directory manager + if (! $rootDN) { + $rootDN = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-w") { # password + if (! $rootpwd) { + $rootpwd = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-j") { # password file + if (! $pwdfile) { + $pwdfile = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-o") { # old instance path + if (! $oldHome ) { + $oldHome = $ARGV[++$i] ; + grep { s@\\@/@g } $oldHome if $isNT ; + if ($oldHome =~ /[\"]?(.*)?[\"]?/) { $oldHome = $1 ; } + if ($oldHome =~ m@^(.*)/([^-/]*)-([^/]*)[/]?$@) { + $oldDir = $1 ; + $type = $2 ; + $oldname = $3 ; + if ($isNT) { + $oldDir = lc($oldDir) ; + $type = lc($type) ; + $oldname = lc($oldname) ; + $oldHome = lc($oldHome) ; + grep { s@/@\\@g } $oldDir ; + grep { s@/@\\@g } $oldHome ; + } + } + else { + print("\nThe old instance path is not correct. It must be like slapd-instancename"); + &usage(); + exit(1); + } + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-n") { # new instance path + if (! $serverHome ) { + $serverHome = $ARGV[++$i] ; + grep { s@\\@/@g } $root if $isNT ; + grep { s@\\@/@g } $serverHome if $isNT ; + if ($serverHome =~ /[\"]?(.*)?[\"]?/) { $serverHome = $1 ; } + if ($serverHome =~ m@^(.*?)/?([^/-]*)-([^/]*)[/]?$@) { + $root = $1 if ($1); + $type = $2 ; + $newname = $3 ; + if ($isNT) { + $root = lc($root) ; + $type = lc($type) ; + $newname = lc($newname) ; + $serverHome = lc($serverHome) ; + grep { s@/@\\@g } $root ; + grep { s@/@\\@g } $serverHome ; + } + } + else { + print("\nThe new instance path is not correct. It must be like slapd-instancename"); + &usage(); + exit(1); + } + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-p") { # new DS port + if (! $newport ) { + $newport = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-d") { # old instance LDIF data dir + if (! $olddatadir ) { + $olddatadir = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-v") { # old version + if (! $oldversionstr ) { + $oldversionstr = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-t") { # TRACELEVEL + my $value = $ARGV[++$i] ; + if ($value =~ /[0-3]/) { + $TRACELEVEL = $value ; + } + else { + print("\nThe tracelevel must belong to 0..3 interval"); + &usage(); + exit(); + } + } elsif ("$ARGV[$i]" eq "-noinput") { # no user interventions during processing + $NO_INPUT_USER = 1 ; + } elsif ("$ARGV[$i]" eq "-L") { # migration logfile + $LogFileReport = $ARGV[++$i] ; + } + else { + print("\nThe option $ARGV[$i] is not recognized"); + &usage() ; + exit(1); + } + $i++; + } + if (! $rootDN) { + print("\nThe rootDN is missing"); + $exit = 1; + } + if ($pwdfile ne "") { + # Open file and get the password + unless (open (RPASS, $pwfile)) { + die "Error, cannot open password file $passwdfile\n"; + } + $rootpwd = ; + chomp($rootpwd); + close(RPASS); + } elsif ($rootpwd eq "-"){ + # Read the password from terminal + die "The '-w -' option requires an extension library (Term::ReadKey) which is not\n", + "part of the standard perl distribution. If you want to use it, you must\n", + "download and install the module. You can find it at\n", + "http://www.perl.com/CPAN/CPAN.html\n"; + # Remove the previous line and uncomment the following 6 lines once you have installed Term::ReadKey module. +# use Term::ReadKey; +# print "Bind Password: "; +# ReadMode('noecho'); +# $rootpwd = ReadLine(0); +# chomp($rootpwd); +# ReadMode('normal'); + } + if (! $rootpwd) { + print("\nThe rootpwd is missing"); + $exit = 1 ; + } + if (! $newport) { + print("\nThe port is missing"); + $exit = 1; + } + if (! $serverHome) { + print("\nThe new instance path is missing"); + $exit = 1; + } + if (! $oldHome) { + print("\nThe old instance path is missing"); + $exit = 1; + } + if ((! $LogFileReport) && $serverHome) { + ($sec, $min, $hour, $dd, $mm, $yy) = &GetTime(); + $LogFileReport = "${serverHome}${PATHSEP}logs${PATHSEP}Migration_${dd}${mm}${yy}_${hour}${min}${sec}.log"; + } + + if ($exit) { + &usage() ; + exit(1); + } + +} + + +############################################################################### +# This subroutine is used to parse the slapd.conf configuration file and migrate specific parameters contained in it + + +sub ParseSlapdConf { + my $oldsrc = shift; + my $NumLine = 0 ; + # read the old conf file into a hash table + open( OLDSRC, $oldsrc ) || die "Can't open $oldsrc: $!: "; + LINE: while ( ) { + $NumLine++ ; + printTrace("\nLine: $_",4) ; + if (/^\s*\#/) { # skip comments + printTrace("\n# ",4) ; + next LINE; + } + if (/^\s*$/) { # skip blank lines + printTrace("\nBLANK LINE",4); + next LINE; + } elsif (/^suffix\s+/i) { + chomp($_) ; + CheckSuffix($_); + } elsif (/^plugin/i) { + printTrace("\nPLUGIN",4); + chomp($_); + if (! &isAStandardPlugin($_)) { + push @badPlugins, $_; + } + else { + my $Plugin = $_ ; + if (! &ParsePlugin($_,$NumLine)) { + printMsg("\nLine $NumLine, syntax error of the plugin:\n$Plugin"); + } + } + } elsif (/^include\s+[\"]?(.*?)[\"]?\s*$/i) { + # strip leading and trailing " + my $include_file = $1 ; + grep { s@/@\\@g } $include_file if $isNT; + if (! &isAStandardInclude($include_file)) { + printTrace("\nFILE: $1 NOT STANDARD",4) ; + &ParseConfigurationFile($include_file); + printTrace("\nEXIT ParseConfigurationFile: $include_file",4) ; + } + } elsif (/^userat\s+[\"]?(.*?)[\"]?\s*$/i) { + printTrace("\nuserat: $1",4); + my $at_file = $1 ; + grep { s@/@\\@g } $at_file if $isNT; + # Parse user defined attributes + &ParseAttributesFile($at_file); + } elsif (/^useroc\s+[\"]?(.*?)[\"]?\s*$/i) { + printTrace("\nuseroc: $1",4); + my $oc_file = $1 ; + grep { s@/@\\@g } $oc_file if $isNT; + # Parse user defined object classes + &ParseObjectClassesFile($oc_file); + } elsif (/^dynamicconf\s+[\"]?(.*?)[\"]?\s*$/i){ + printTrace("\ndynamicconf: $1",4); + my $dynamiconf_file = $1 ; + grep { s@/@\\@g } $dynamiconf_file if $isNT; + # Parse dynamic configuration file (e-g slapd.ldbm.conf) + &ParseConfigurationFile($dynamiconf_file); + } elsif (/^\s*(\S+)\s+[\"]?(.*?)[\"]?\s*$/) { + printTrace("\nParseParameters: $1",4); + # Parse parameters and record the associated value in %oldhash + &ParseParameters($1,$2,$NumLine); + } else { + printTrace("\nUnknown format of configuration data: $_",0); } + } + close(OLDSRC); + + } + + + +############################################################################# +# return 1 if the suffix already exists, 0 else +sub existSuffix { + my $suffixname = shift ; + my $nsuffix = normalizeDN($suffixname); + my $entry = $conn->search("cn=mapping tree,cn=config", "one", "(|(cn=\"$suffixname\")(cn=\"$nsuffix\"))"); + return 1 if ($entry) ; + my $cpt = 5; + my $errorCode = $conn->getErrorCode(); + while (($errorCode eq $LDAP_SERVER_UNREACHABLE) && $cpt && (! $entry)) { + printTrace("\ntry to reconnect to search cn=\"$suffixname\",cn=mapping tree,cn=config", 1); + $conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Unable to contact the $Version.$Minor LDAP server: $LDAPservername\n"; + $entry = $conn->search("cn=mapping tree,cn=config", "one", "(|(cn=\"$suffixname\")(cn=\"$nsuffix\"))"); + $errorCode = $conn->getErrorCode(); + $cpt--; + } + return 1 if ($entry) ; + return 0 ; +} + +# return the name of the backend if it has been successfully created, 0 else +sub createBackend { + my $suffixname = shift ; + my $backend = "MigratedDB_0" ; + my $NbRetry = 1 ; + my $entry = $conn->search("cn=$backend,cn=ldbm database,cn=plugins,cn=config ", "base","objectclass=*") ; + while ($entry) { + # try to find another name for the backend + $backend = "MigratedDB_$NbRetry" ; + $entry = $conn->search("cn=$backend,cn=ldbm database,cn=plugins,cn=config ", "base","objectclass=*") ; + $NbRetry++; + } + # normally I should have a unique name for the backend + my $suffixarg = "nsslapd-suffix" ; + $entry = $conn->newEntry() ; + $entry->setDN("cn=$backend,cn=ldbm database,cn=plugins,cn=config"); + $entry->setValues("objectclass", "top", "extensibleObject", "nsBackendInstance" ); + $entry->setValues("cn", $backend ); + $entry->setValues($suffixarg, $suffixname ); + my $res = $conn->add($entry) ; + if ($res) { + return $backend ; + } + else { + return 0 ; + } +} + +# return 1, if add the new entry in the mapping tree, else 0 +sub AddEntryInMappingTree { + my $backend = shift ; + my $entry = $conn->search("cn=$backend,cn=ldbm database,cn=plugins,cn=config ", "base","objectclass=*") ; + if ($entry) { + printTrace("\nAddEntry in progress ...",4) ; + my $suffixarg = "nsslapd-suffix" ; + my $statearg = "nsslapd-state" ; + my $backendarg= "nsslapd-backend"; + my $suffixname = $entry->{$suffixarg}[0]; + $entry = $conn->newEntry() ; + $entry->setDN("cn=\"$suffixname\",cn=mapping tree,cn=config") ; + $entry->setValues("objectclass", "top", "extensibleObject", "nsMappingTree" ); + $entry->setValues("cn", "\"$suffixname\""); + $entry->setValues($statearg, "backend"); + $entry->setValues($backendarg, $backend); + return $conn->add($entry); + } + else { + printTrace("\nNo AddEntry processed for $backend",4); + return 0 ; + } +} + + +# Treat the case where the suffix is "o=NetscapeRoot" +sub CheckSuffix { + my $suffix = shift ; + my $suffixname ; + my $expLdif; + my $confirm = "No"; + my $dest = "$serverHome${PATHSEP}db_backup" ; + my $newSlapdExecDir = "$root${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server"; + + if (!(/^suffix\s+\"?(.*?)\"?\s*$/i)) { + printMsg("Syntax error of the suffix: $suffix"); + return 0 ; + } + else { + $suffixname = $1 ; + } + if (/^suffix\s+\"?\s*o=netscaperoot\s*\"?\s*$/i) { + printTrace("\nFor the suffix o=NetscapeRoot, we do nothing",1); + # treat the case where the suffix is "o=NetscapeRoot" + } + else { + push @oldSuffixes, $_; + # check if the suffix already exists in the new DS target + if (! existSuffix($suffixname)) { + printTrace("\n\nSuffix $suffixname doesn't exist",1) ; + # create a new backend with the name of the suffix preceded by MigratedDB_ + my $backend = createBackend($suffixname) ; + if ($backend) { + printTrace("\nBackend: $backend has been created !!!",1); + # if the creation of the backend is ok, we add a new entry in the mapping tree + if (AddEntryInMappingTree($backend)) { + # We add the association dbname->suffix in the hash %DBNAMES + $DBNAMES{$suffixname} = $backend ; + # get the db filename + $entry = $conn->search("cn=$backend,cn=ldbm database,cn=plugins,cn=config ", "base","objectclass=*") ; + my $dirarg = "nsslapd-directory"; + $DBDirectory{$backend} = $entry->{$dirarg}[0]; + printTrace("\nThe relation $backend->$suffixname has been added to the mapping tree",2); + } + else { + printMsg("\nCOULD NOT ADD ENTRY: $backend->$suffixname IN MAPPINGTREE"); + } + } + else { + printMsg("\nCOULD NOT CREATE BACKEND: $backend"); + } + } + else { + printMsg("\n\nSuffix: $suffixname already exists"); + # the suffix already exists in the new DS + printMsg("\nMigration will overwrite existing database"); + printMsg("\nDo you want to continue Yes/No [No] ?") ; + my $answer = ; + if ($answer =~ /y|yes/i) { + my $nsuffix = normalizeDN($suffixname); + my $my_entry = $conn->search("cn=mapping tree,cn=config", "one", "(|(cn=\"$suffixname\")(cn=\"$nsuffix\"))"); + my $backend = $my_entry->{"nsslapd-backend"}[0]; + my $backend_entry = $conn->search("cn=$backend,cn=ldbm database,cn=plugins,cn=config ", "base","objectclass=*") ; + printMsg("Do you want to export the existing data Yes/No [Yes] ?"); + my $answer = ; + if (!($answer =~ /n|no/i)) { + mkdir $dest, 0700 unless (-d $dest); + $expLdif = "$dest${PATHSEP}$backend.ldif"; + while (!($confirm =~ /y|yes/i)) { + printMsg("\nEnter the full pathname of the file [$expLdif]:") ; + $answer = ; + chomp($expLdif = $answer) unless ($answer eq "\n"); + printMsg("\nExisting data will be exported under $expLdif"); + printMsg("\nContinue Yes/No [No] ?"); + $confirm = ; + } + $ENV{"$LIB_PATH"}=$new_libpath; + chdir($newSlapdExecDir) or die "\nCould not change directory to $newSlapdExecDir: $!\n"; + printTrace("\nNow backing up database $CN in $expLdif\n",0); + &stopServer($root,'slapd-'.$newname); + &newinst_db2ldif($expLdif, $suffixname, $serverHome); + &startServer(); + } + # We add the association dbname->suffix in the hash %DBNAMES + $DBNAMES{$suffixname} = $backend ; + my $dirarg = "nsslapd-directory"; + $DBDirectory{$backend} = $backend_entry->{$dirarg}[0]; + printTrace("\nThe relation $backend->$suffixname has been added to the mapping tree",2); + } + } + return 1 ; +} +} + +############################################################################# +# Usefull to know the standard configuration +sub isAStandardPlugin { + my $line = shift; + chomp($line); + printTrace("\nStdPlugin?: $line",4); + if ($line =~ /^plugin\s+(database|extendop|preoperation|postoperation|matchingrule|syntax)\s+(on|off)\s+\"(.*?)\"\s+\"(.*?)\"\s+(\S+)(.*)$/i) { + # $1 = , $2 = , $3 = , $4 = , $5 = , $6 = []* + printTrace("\nName: $3, pathname: $4, init_function: $5",4); + + my $LC_line = lc($3); + my $Value = $stdPlugins{$LC_line} ; + if ($Value) { + printTrace("\nIS A STANDARD PLUGIN",4); + } + else { + printTrace("\nNOT A STANDARD PLUGIN",4); + } + return $stdPlugins{$LC_line} ; + } + else { + printTrace("\nSYNTAX ERROR PLUGIN",4); + return 0 ; + } +} + +sub isAStandardIndex { + my $line = shift ; + chomp($line); + if ($line =~ /^index\s+(\S+).*/i) { + my $LC_line = lc($1); + my $Value = $stdIndex{$LC_line} ; + printTrace("\nInclude: $LC_line \nValue: $Value", 4); + return $stdIndex{$LC_line}; + } + else { + return 0 ; + } +} + + +sub isAStandardInclude { + my $line = shift; + + chomp($line); + if ($isNT){ + return $stdIncludes{lc($line)}; + } + else { + return $stdIncludes{$line} ; + } +} + +############################################################################# +# +# Execute a Perldap command to update plugins definition in the new schema + +sub LDAPmodify_stdPlugin { + my $Filename = shift ; + my @pluginames = keys(%stdPlugins); + if (! $STDPLUGINS_FILE_MODIFIED) { + printTrace("\nLDAPmodify_plugin",4); + printTrace("\nMigrate plugin's...",1); + foreach $pluginame ( @pluginames ) { + my $update_plugin = 0 ; + my $ref_plugin = $stdPlugins{$pluginame}; + if ($ref_plugin ne "\n") { + my $name = $ref_plugin->name ; + # We have a name change of "uid uniqueness plugin" in DS6.x + # to "attribute uniqueness" + $name = "attribute uniqueness" if ($name eq "uid uniqueness"); + my $entry = $conn->search("cn=$name,cn=plugins,cn=config", "base","objectclass=nsSlapdPlugin") ; + if ($entry) { + my $pluginenabled="nsslapd-pluginenabled" ; + if (($entry->{$pluginenabled}[0]) ne $ref_plugin->enable) { + $update_plugin = 1 ; + my $enable = $ref_plugin->enable ; + printTrace("\n$pluginame, plugin-enable: $enable",3) ; + $entry->setValues($pluginenabled, $enable ); + } + my $ArgNum = 0 ; + foreach $ArgValue (@{$ref_plugin->args}) { + my $Arg="nsslapd-pluginarg$ArgNum"; + printTrace("\n$Arg: $ArgValue",3) ; + if ($entry->{$Arg}[0] ne $ArgValue) { + printTrace("\n$pluginame, $Arg: $ArgValue",3) ; + $update_plugin = 1 ; + $entry->setValues($Arg, $ArgValue) ; + } + $ArgNum++ ; + } + if ($update_plugin) { + printTrace("\n$pluginame is being updated...",2); + my $res = $conn->update($entry) ; + if ($res) { + printTrace("\nupdated !",2); + } + else { + printMsg("\nError during update of plugin: $pluginame") ; + $MigrationErrors .= "\nError during update of plugin: $pluginame"; + } + } + else { + printTrace("\n$pluginame has not changed",4); + } + } + else { + printMsg("\ncan't access the plugin: cn=$name,cn=plugins,cn=config"); + } + } + else { + printTrace("\nPLUGIN NOT RECORDED: $pluginame",4) ; + } + } + } + else { + # treat the case where the user wants to look at these plugins before processing + } +} + +############################################################################# +# Execute Perldap command to add new indexes to the migrated instances + +sub LDAPmodify_Indexes { + my $Filename = shift ; + my @indexnames = keys(%newIndex); + my @suffixnames = keys(%DBNAMES); + if ((! $INDEX_FILE_MODIFIED) && (%DBNAMES)) { + # we update indexes only if there is at least one backend to migrate + printTrace("\nLDAPmodify_indexes",4); + printTrace("\nMigrate indexes...",1); + foreach $indexname ( @indexnames ) { + printTrace("\nIndexName: $indexname",4); + printTrace("\nIndexTypes: .@{$newIndex{$indexname}->types}.", 4) ; + printTrace("\nIndexOIDS: .@{$newIndex{$indexname}->oids}.", 4) ; + foreach $suffixname ( @suffixnames ) { + # check if the index already exists ! + printTrace("\nsearch for cn=$indexname,cn=index,cn=$DBNAMES{$suffixname},cn=ldbm database,cn=plugins,cn=config...", 3); + my $entry = $conn->search("cn=$indexname,cn=index,cn=$DBNAMES{$suffixname},cn=ldbm database,cn=plugins,cn=config","base","objectclass=nsIndex"); + if (! $entry) { + # create a new index + printTrace("index $indexname is being created under cn=index,cn=$DBNAMES{$suffixname},cn=ldbm database,cn=plugins,cn=config...",2); + my $entry = $conn->newEntry(); + $entry->setDN("cn=$indexname,cn=index,cn=$DBNAMES{$suffixname},cn=ldbm database,cn=plugins,cn=config"); + $entry->setValues("objectclass", "top", "nsIndex" ) ; + $entry->setValues("cn", $indexname) ; + $entry->setValues("nssystemindex", "false") ; + my @types = @{$newIndex{$indexname}->types} ; + my @oids = @{$newIndex{$indexname}->oids} ; + $entry->setValues("nsindextype", @types) if (@types) ; + $entry->setValues("nsmatchingrule", @oids ) if (@oids); + my $res = $conn->add($entry) ; + if ($res) { + printTrace("\nAdd index successfully: $indexname for backend: $DBNAMES{$suffixname}",2); + } + else { + printMsg("\n Failed to add the index: $indexname to backend: $DBNAMES{$suffixname}"); + $MigrationErrors .= "\n Failed to add the index: $indexname to backend: $DBNAMES{$suffixname}" ; + } + } + elsif ($entry->{nssystemindex}[0] eq "false") { + # if the index is not a system index, we update it + printTrace("\nindex $indexname is being processed under cn=index,cn=$DBNAMES{$suffixname},cn=ldbm database,cn=plugins,cn=config...",2); + my @types = @{$newIndex{$indexname}->types} ; printTrace("\ntypes: .@types.",2) ; + my @oids = @{$newIndex{$indexname}->oids} ; printTrace("\noids: .@oids.",2) ; + my @existing_types = $entry->getValues("nsindextype"); + my @existing_oids = $entry->getValues("nsmatchingrule"); + # get the elements present in @types and not present in @existing_types + my @typesToAdd = &getDiff(\@types, \@existing_types); + # same for matchingrules + my @oidsToAdd = &getDiff(\@oids, \@existing_oids); + foreach $newtype (@typesToAdd) { + $entry->addValue("nsindextype", $newtype); printTrace("\nnewtype: $newtype",2); + } + foreach $newoid (@oidsToAdd) { + $entry->addValue("nsmatchingrule", $newoid); + } + if (@typesToAdd || @oidsToAdd) { + my $res = $conn->update($entry) ; + if ($res) { + printTrace("\nUpdate index successfully: $indexname for backend: $DBNAMES{$suffixname}",2); + } + else { + printMsg("\n Failed to update the index: $indexname to backend: $DBNAMES{$suffixname}"); + $MigrationErrors .= "\n Failed to update the index: $indexname to backend: $DBNAMES{$suffixname}" ; + } + } + else { + printTrace("\nNothing to update",2); + } + } + else { + printTrace("\nThe index: $indexname is a system index. It can't be updated",2); + } + } + } + + } + else { + # treat the case where the user wants to look at these indexes before processing + } + +} + +############################################################################# +# +# Execute a Perldap command to add all user defined object classes in the new schema + +sub LDAPmodify_User_oc { + my $Filename = shift ; + if (! $USER_OC_FILE_MODIFIED) { + printTrace("\nLDAPmodify_User_oc",4); + printTrace("\nMigrate objectclasses...",1); + foreach $objectname ( @User_oc_names ) { + my $entry = $conn->search("cn=schema", "base","objectclass=*") ; + die "\ncan't connect to object: cn=schema\n" unless ($entry); + printTrace("\nObjectName: $objectname\nValue: $User_oc{$objectname}",3); + next if ($entry->hasValue("objectclasses",$User_oc{$objectname},1)) ; + $entry->addValue("objectclasses",$User_oc{$objectname},"1") ; + my $res = $conn->update($entry) ; + my $err = $conn->getErrorCode(); + if ($res) { + printTrace("\nobjectclass: $User_oc{$objectname} added",2); + } elsif ($err == 20) { # already exists + printTrace("\nobjectclass: $User_oc{$objectname} already exists",1); + } else { + printMsg("\nCan\'t add objectclass to the schema: $User_oc{$objectname}"); + my $msg = $conn->getErrorString(); + printMsg("\nMsg: $msg"); + $MigrationErrors .= "\nCan\'t add objectclass to the schema: $User_oc{$objectname}" ; + } + } + } + else { + # treat the case where the user wants to look at these objectclasses before processing + } +} + +############################################################################# +# +# Execute a Perldap command to add all user defined attributes in the new schema + +sub LDAPmodify_User_at { + my $Filename = shift ; + my @attributenames = keys(%User_at); + if (! $USER_AT_FILE_MODIFIED) { + + printTrace("\nLDAPmodify_User_at",4); + printTrace("\nMigrate attributes...",1); + foreach $attributename ( @attributenames ) { + my $entry = $conn->search("cn=schema", "base","objectclass=*") ; + printTrace("\nAtributeName: $attributename, Value: $User_at{$attributename}",3); + die "\nentry not found cn=schema\n" unless $entry ; + next if ($entry->hasValue("attributetypes",$User_at{$attributename},1) ) ; + my $res = $entry->addValue("attributetypes",$User_at{$attributename},"1") ; + if (! $res) { + printMsg("\nCan\'t add attribute to the schema: $User_at{$attributename}"); + $MigrationErrors .= "\nCan\'t add attribute to the schema: $User_at{$attributename}" ; + } + my $res = $conn->update($entry) ; + my $err = $conn->getErrorCode(); + if ($res) { + printTrace("\nattribute: $attributename added",2); + } elsif ($err == 20) { # already exists + printTrace("\nattribute: $attributename already exists",1); + } + else { + printMsg("\nCan\'t add attribute to the schema: $User_at{$attributename}"); + my $msg = $conn->getErrorString(); + printMsg("\nMsg: $msg"); + $MigrationErrors .= "\nCan\'t add attribute to the schema: $User_at{$attributename}" ; + } + } + } + else { + # treat the case where the user wants to look at these attributes before processing + } +} + +############################################################################# +# Add an object class to the user_oc hash and reset the object !!! +sub AddObjectClass { + my $ObjectClass = shift ; + my $ObjectName = $ObjectClass->{'ObjectName'} ; + my $Object_oid = $ObjectClass->{'Object_oid'} ; + my $Object_superior = $ObjectClass->{'Object_superior'} ; + my $Object_requires = $ObjectClass->{'Object_requires'} ; + my $Object_allows = $ObjectClass->{'Object_allows'} ; + my $ObjectClassDef = "( $Object_oid NAME \'$ObjectName\' DESC \'\' SUP $Object_superior STRUCTURAL MUST ($Object_requires) MAY ($Object_allows) X-ORIGIN \'user defined\' )"; + if ( (!($ObjectName =~ /^top$/i)) && ( ! $User_oc{$ObjectName} )) { + $User_oc{$ObjectName} = $ObjectClassDef ; + push @User_oc_names, $ObjectName ; + printTrace("ObjectName: $ObjectName \nObject_oid: $Object_oid \nObject_superior:$Object_superior \nObject_requires: $Object_requires \nObject_allows: $Object_allows \nObjectClassDefinition: $User_oc{$ObjectName}\n",4); + } + elsif ( ($User_oc{$ObjectName}) && ($User_oc{$ObjectName} ne $ObjectClassDef) ) { + printMsg("\nAttempt to redifine the objectclass: $ObjectName previously defined in your configuration file. Operation not allowed "); + } + else { + printMsg("\nAttempt to redifine the objectclass: top. Operation not allowed"); + } + resetObjectClass($ObjectClass); +} + +############################################################################# +# Build an LDIF attribute and add it to the user_at hash +sub AddAttribute { + my $Attr = shift ; + my $AttributeName = $Attr->{'AttributeName'}; + my $Attribute_oid = $Attr->{'Attribute_oid'}; + my $Attribute_aliases = $Attr->{'Attribute_aliases'}; + my $Attribute_syntax = $Attr->{'Attribute_syntax'}; + my $Attribute_single = $Attr->{'Attribute_single'}; + my $AttributeDef = "( $Attribute_oid NAME ( \'$AttributeName\' $Attribute_aliases) DESC \'User Defined Attribute\' SYNTAX $Attribute_syntax $Attribute_single X-ORIGIN 'user defined' )" ; + printTrace("\nAttributeDef: $AttributeDef",4); + $User_at{$AttributeName} = $AttributeDef ; +} +############################################################################# +# add the index structure to the newIndex hash +sub AddIndex { + my $ref_index = shift ; + my $state = shift ; + printTrace("\nAddIndex, last state: $state",4) ; + if ($state == 1) { + $ref_index->specific("ALL") ; + return 1 ; + } + elsif ($state == 6) { + $ref_index->specific("NONE") ; + return 1 ; + } + if (($state == 1) || ($state == 3) || ($state == 5) || ($state == 6)) { + foreach $name (@{$ref_index->names}) { + $newIndex{$name} = $ref_index ; # record the ref to the index struct in the newIndex hash + } + return 1 ; + } + else { + return 0 ; + } +} + +############################################################################# +# add the plugin structure to the stdPlugin hash + +sub AddPlugin { + my $ref_plugin = shift ; + printTrace("\nAddPlugin",4) ; + $stdPlugins{lc($ref_plugin->name)} = $ref_plugin ; + my $name = $ref_plugin->name ; + my $type = $ref_plugin->type ; + my $enable = $ref_plugin->enable ; + + printTrace("\nPluginName: $name",4); + printTrace("\nPluginType: $type",4); + printTrace("\nPluginEnable: $enable",4); + printTrace("\nPluginArgs: @{$ref_plugin->args}",4); + return 1 ; +} + + +############################################################################# +# parse a plugin definition and call the addindex + +sub ParsePlugin { + my $Plugin = shift ; + my $NumLine = shift ; + my $state = 0 ; + my $ErrorMsg = "Syntax error of a plugin definition. \n line parsed:"; + my $ref_plugin = S_plugin->new(); + printTrace("\nParsePlugin: $_",4); + if (/^plugin\s+(database|extendop|preoperation|postoperation|matchingrule|syntax)\s+(on|off)\s+\"(.*?)\"\s+\"(.*?)\"\s+(\S+)(.*)$/i) { + # $1 = , $2 = , $3 = , $4 = , $5 = , $6 = []* + $ref_plugin->name($3); + $ref_plugin->type($1); + $ref_plugin->enable($2); + $_ = $6 ; + my $ArgNb = 0 ; + my $prec ; + my $arg ; + my $Unix_oldDir = $oldDir ; + my $Unix_root = $root ; + grep { s@\\@/@g } $Unix_oldDir if $isNT; + grep { s@\\@/@g } $Unix_root if $isNT; + while (!(/^\s*$/)) { + if (/^\s*\".*?\"/) { + s/^\s*\"(.*?)\"(.*)/$2/i ; + $arg = $1 ; + } + elsif (/^\s*[^\"\s]+/) { + s/^\s*([^\"\s]+)(.*)/$2/i ; + $arg = $1 ; + } + $prec = $_ ; + $_ = $arg ; + + s@$Unix_oldDir@$Unix_root@ig ; + s/$type-$oldname/$type-$newname/ig ; + @{$ref_plugin->args}[$ArgNb++] = $_ ; + $_ = $prec ; + } + if (/^\s*$/) { + return AddPlugin($ref_plugin); + } + else { + return 0 ; + } + } + return 0 ; +} + +############################################################################# +# parse an index definition and call the addindex + +sub ParseIndex { + my $index = shift ; + my $NumLine = shift ; + my $ref_index = S_index->new() ; + my $Value ; + my $state = 0 ; + my $ErrorMsg = "Syntax error of an index definition.\nline parsed:"; + printTrace("\nParseIndex: $_",4) ; + s/,/, /g ; + s/\s+,/,/g ; + s/^index\s+//i ; # substitute the token index + while (!(/^\s*$/)) { + s/^\s*(\S+)(.*)$/$2/ ; + $Value = $1 ; + printTrace("\nValue: $Value",4); + printTrace("\nState: $state",4) ; + SWITCH: { + if ($state == 0) { + if ($Value =~ /[^\.]/) { + if ($Value =~ /(\S+),$/) { + push @{$ref_index->names}, $1 ; + } + else { + $state = 1 ; + push @{$ref_index->names}, $Value ; + } + } + else { + return 0 ; + } + last SWITCH ; + } + if ($state == 1) { + if ($Value =~ /^none$/i) { + $state = 6 ; # end of the index definition + } + elsif ($Value =~ /^\"\"$/) { + $state = 4 ; # we expect to have at least one OID + } + elsif ($Value =~ /(\S+),$/) { + $state = 2 ; + push @{$ref_index->types}, $1 ; + } + else { + $state = 3 ; + push @{$ref_index->types}, $Value ; + } + last SWITCH ; + } + if ($state == 2) { + if ($Value =~ /(\S+),$/) { + push @{$ref_index->types}, $1 ; + } + else { + $state = 3 ; + push @{$ref_index->types}, $Value ; + } + last SWITCH ; + } + if ($state == 3) { + if ($Value =~ /(\S+),$/) { + $state = 4 ; + push @{$ref_index->oids}, $1 ; + } + else { + $state = 5 ; + push @{$ref_index->oids}, $Value ; + } + last SWITCH ; + } + if ($state == 4) { + if ($Value =~ /(\S+),$/) { + push @{$ref_index->oids}, $1 ; + } + else { + $state = 5 ; + push @{$ref_index->oids}, $Value ; + } + last SWITCH ; + } + } + } +return AddIndex($ref_index,$state) ; + +} + +############################################################################# + +sub ParseAttribute { + + + my $Attr = shift ; + my $NumLine = shift ; + my $state = 1 ; + my $ErrorMsg = "Syntax error of an attribute definition.\nline parsed:"; + my %Attribute = ( + 'AttributeName' => "", + 'Attribute_oid' => "", + 'Attribute_aliases' => "", + 'Attribute_syntax' => "", + 'Attribute_single' => "" + ); + my $AttributeName = " "; + printTrace("\nParseAttribute",4); + while (!(/^\s*$/)) { + s/^(.*?)(\S+)\s*$/$1/ ; + printTrace("\nValue: $2",4); + printTrace("\nState: $state",4) ; + my $Value = $2 ; + SWITCH: { + if ($state == 1) { + if (isAllowedModifier($Value)) { + $state = 1 ; + $modifier = lc($Value); + $AttrVar = 'Attribute_' . $modifier ; + $Attribute{$AttrVar} = &getModifierValue($Value) ; + } + elsif (&isAllowedPlugin($Value)) { + $state = 2 ; + $Attribute{'Attribute_syntax'} = &getSyntaxOid($Value) ; + } + else { + return 0 ; + } + last SWITCH ; + } + if ($state == 2) { + if ($Value =~ /[\.]|-oid$/) { + $Attribute{'Attribute_oid'} = "$Value" ; + printTrace("\nAttribute-oid: $Attribute{'Attribute_oid'}",3); + $state = 3 ; + } + elsif ($Value =~ /[^\.]/) { + $AttributeName = $Attribute{'AttributeName'} ; + if ($AttributeName) { $Attribute{'Attribute_aliases'} .= "\'$AttributeName\' " ;} + $Attribute{'AttributeName'} = $Value ; + $state = 4 ; + } + else { + return 0 ; + } + last SWITCH ; + } + if ($state == 3) { + if ($Value =~ /[^\.]/) { + $AttributeName = $Attribute{'AttributeName'} ; + if ($AttributeName) { $Attribute{'Attribute_aliases'} .= "\'$AttributeName\' " ;} + $Attribute{'AttributeName'} = $Value ; + $state = 4 ; } + else { + return 0 ; + } + last SWITCH ; + } + if ($state == 4) { + if ($Value =~/^attribute$/i){ + $state = 5; + } + elsif ($Value =~/[^\.]/i) { + $AttributeName = $Attribute{'AttributeName'} ; + if ($AttributeName) { $Attribute{'Attribute_aliases'} .= "\'$AttributeName\' " ;} + $Attribute{'AttributeName'} = $Value ; + } + else { + return 0 ; + } + last SWITCH ; + } + if ($state == 5) { + return 0 ; + last SWITCH ; + } + } + } + $Attribute{'Attribute_oid'} = $Attribute{'AttributeName'} . '-oid' unless ($Attribute{'Attribute_oid'}) ; + return AddAttribute(\%Attribute) ; +} + + +############################################################################# +# fill in the hash HashParametersName + +sub FillHashParametersName { + my @paramnames = ( keys(%GeneralSrvParamToMigrate), keys(%GlobalConfigLDBMparamToMigrate), keys(%LDBMparamToMigrate)); + foreach $param (@paramnames) { + $HashParametersName{$param} = '\n'; + } +} + + +# Parse parameters +sub ParseParameters { + my $param = shift ; + my $value = shift ; + my $NumLine = shift ; + my $ErrorMsg = "parameter unknown, or not to be migrated: "; + if ($HashParametersName{lc($param)} && ($value !~ /^\s*$/)) { + $HashParametersName{lc($param)} = $value ; + printTrace("\nParam: $param is present",4); + } + else { + printTrace("\n$NumLine, $ErrorMsg,$param",4); + } + +} + +# add general server parameters +sub AddGeneralParameters { + my @paramnames = keys(%GeneralSrvParamToMigrate); + my $entry = $conn->search("cn=config","base","objectclass=*"); + die "\ncan't access to object: cn=config. \nMigration stopped\n" unless ($entry); + printTrace("\nAddGeneralParameters",4); + foreach $param (@paramnames) { + my $LDAPparam = $GeneralSrvParamToMigrate{$param} ; + my $Value = $HashParametersName{$param} ; + if (($Value ne '\n') && ($entry->{$LDAPparam}[0] ne $Value)) { + printTrace("\nLDAPparam: $LDAPparam, Value: $Value",4); + $entry->setValues($LDAPparam, $Value); + my $res = $conn->update($entry); + if ($res) { + printTrace("\nUpdate successfully $LDAPparam ",0); + } + else { + printMsg("\nCan't update parameter: $LDAPparam"); + } + } + } +} + + +# add general LDBM parameters +sub AddGeneralLDBMParameters { + my @paramnames = keys(%GlobalConfigLDBMparamToMigrate); + my $entry = $conn->search("cn=config,cn=ldbm database,cn=plugins,cn=config","base","objectclass=*"); + die "\ncan't access to object: cn=config,cn=ldbm database,cn=plugins,cn=config. \nMigration stopped\n" unless ($entry); + printTrace("\nAddGeneralLDBMParameters",4); + foreach $param (@paramnames) { + my $LDAPparam = $GlobalConfigLDBMparamToMigrate{$param} ; + my $Value = $HashParametersName{$param} ; + if (($Value ne '\n') && ($entry->{$LDAPparam}[0] ne $Value)) { + printTrace("\nLDAPparam: $LDAPparam, Value: $Value",4); + $entry->setValues($LDAPparam, $Value); + my $res = $conn->update($entry); + if ($res) { + printTrace("\nUpdate successfully $LDAPparam ",0); + } + else { + printMsg("\nCan't update parameter: $LDAPparam"); + } + } + } +} + +# add specific LDBM parameters +sub AddSpecificLDBMParameters { + my @paramnames = keys(%LDBMparamToMigrate); + my %REV_DBNAMES = reverse %DBNAMES ; + my @dbnames = keys(%REV_DBNAMES); + printTrace("\nAddSpecificLDBMParameters",4); + foreach $dbname (@dbnames) { + my $entry = $conn->search("cn=$dbname,cn=ldbm database,cn=plugins,cn=config","base","objectclass=*"); + die "\ncan't access to object: cn=$dbname,cn=ldbm database,cn=plugins,cn=config. \nMigration stopped\n" unless ($entry); + foreach $param (@paramnames) { + my $LDAPparam = $LDBMparamToMigrate{$param} ; + my $Value = $HashParametersName{$param} ; + if (($Value ne '\n') && ($entry->{$LDAPparam}[0] ne $Value)) { + printTrace("\nLDAPparam: $LDAPparam, Value: $Value",4); + $entry->setValues($LDAPparam, $Value); + my $res = $conn->update($entry); + if ($res) { + printTrace("\nUpdate successfully $LDAPparam",2); + } + else { + printMsg("\nCan't update parameter: $LDAPparam"); + } + } + } + } +} + +############################################################################# +# Parse a configuration file potentialy tuned by the user (different from slapd.user_oc.conf and slapd.user_at.conf) + +sub ParseConfigurationFile { + + my $FileToParse = shift; + my $NumLine = 0; + my $PARSE_OBJECTCLASSES = 0 ; # 1 if there are objectclass definitions in the file + printTrace("\nParseConfigurationFile: $FileToParse",4) ; + printTrace("\nParse $FileToParse",2); + # read each line of the configuration file + my $CONFIGFILE = "CONFIGFILE.$FileToParse" ; + open( $CONFIGFILE, $FileToParse ) || die "Can't open $FileToParsec: $!: "; + LINE: while ( <$CONFIGFILE> ) { + $NumLine++ ; + if (/^\s*\#/) { # skip comments + next LINE; + } + if (/^\s*$/) { # skip blank lines + next LINE; + } elsif (/^suffix\s+/i) { + chomp($_) ; + CheckSuffix($_) ; + } elsif (/^plugin/i) { + chomp($_); + if (! &isAStandardPlugin($_)) { + push @badPlugins, $_; + } + else { + my $Plugin = $_ ; + if (! &ParsePlugin($_,$NumLine)) { + printMsg("\nLine $NumLine, syntax error of the plugin:\n$Plugin"); + } + } + } elsif (/^index/i) { + chomp($_); + if (! &isAStandardIndex($_)) { + my $Index = $_ ; + if (! &ParseIndex($_,$NumLine)) { + printMsg("\nLine $NumLine, syntax error of index:\n$Index"); + } + } + } elsif (/^include\s+[\"]?(.*?)[\"]?\s*$/i) { + # strip leading and trailing " + my $include_file = $1 ; + grep { s@/@\\@g } $include_file if $isNT; + if (! &isAStandardInclude($include_file)) { + &ParseConfigurationFile($include_file); + } + } elsif (/^attribute\s+\S+/i) { + chomp($_); + my $Attrib = $_ ; + if (! &ParseAttribute($_,$NumLine)) { + printMsg("\nLine $NumLine, syntax error of attribute:\n$Attrib"); + } + } elsif (/^objectclass\s+(\S+)\s*$/i) { + # At least one objectclass is present in the file + $PARSE_OBJECTCLASSES = 1; + } elsif (/^\s*(\S+)\s+[\"]?(.*?)[\"]?\s*$/) { + # Parse parameters and record the associated value in %Oldhash + &ParseParameters($1,$2,$NumLine); + } + } + close($CONFIGFILE); + ParseObjectClassesFile($FileToParse) if ($PARSE_OBJECTCLASSES); # parse objectclass definition + +} + +############################################################################# +# Parse the file specified in the userat attribute + +sub ParseAttributesFile { + my $userat_file=shift ; + my $NumLine = 0; + printTrace("\nParseAttributesFile: $userat_file",4); + printTrace("\nParse user defined attributes file: $userat_file",2); + # read each line of the configuration file + open( ATTRFILE, $userat_file ) || die "Can't open $FileToParsec: $!: "; + LINE: while ( ) { + $NumLine++ ; + if (/^\s*\#/) { # skip comments + next LINE; + } + if (/^\s*$/) { # skip blank lines + next LINE; + } elsif (/^attribute\s+\S+/i) { + chomp($_); + my $Attrib = $_ ; + if (! &ParseAttribute($_, $NumLine)) { + printMsg("\nLine $NumLine, syntax error of attribute:\n$Attrib"); + } + } + } + close(ATTRFILE); +} + +############################################################################# +# Parse the file specified in the useroc token + +sub ParseObjectClassesFile { + my $useroc_file = shift ; + my %ObjectClass = ( + 'ObjectName' => " ", + 'Object_oid' => " ", + 'Object_superior' => "top", + 'Object_requires' => " ", + 'Object_allows' => " " + ); + + my $state = 0; + my $ErrorMsg = "Syntax error of an object class definition.\nline parsed:"; + my $LineNb = 0 ; # Number of the current line parsed in the file + printTrace("ParseObjectClassesFile: $useroc_file\n",4) ; + # read each line of the configuration file + open( OBJCLASSFILE, $useroc_file ) || die "Can't open $FileToParsec: $!: "; + printTrace("Begin the parsing of the file: $useroc_file",4); + LINE: while ( ) { + printTrace("Current Line: $_",4); + $LineNb++ ; + if (/^\s*\#/) { # skip comments + next LINE; + } + if (/^\s*$/) { # skip blank lines + next LINE; + } + SWITCH: { + if ($state == 0) { resetObjectClass(\%ObjectClass); + if (/^objectclass\s+(\S+)\s*$/i) { + $ObjectClass{'ObjectName'} = $1; + $state = 1 ;} + else {} # printMsg($ErrorMsg,$_,$LineNb);} + last SWITCH;} + if ($state == 1) {if (/^\s+oid\s+(\S+)\s*$/i) { + $ObjectClass{'Object_oid'} = $1; + $state = 2 ;} + elsif (/^\s+superior\s+(\S+)\s*$/i) { + $ObjectClass{'Object_superior'} = $1; + $state = 3 ; + } + elsif (/^\s+requires\s*$/i) { + $state = 4; + } + elsif (/^\s+allows\s*$/i) { + $state = 5; + } + else {$state=0; printMsg($ErrorMsg,$_,$LineNb);} + last SWITCH;} + if ($state == 2) {if (/^\s+superior\s+(\S+)\s*$/i) { + $ObjectClass{'Object_superior'} = $1; + $state = 3 ;} + elsif (/^\s+requires\s*$/i) { + $state = 4; + } + elsif (/^\s+allows\s*$/i) { + $state = 5; + } + else { $state=0; printMsg($ErrorMsg,$_,$LineNb);} + last SWITCH;} + if ($state == 3) {if (/^\s+requires\s*$/i) + { $state = 4; } + elsif (/^objectclass\s+(\S+)\s*$/i) { + # run an ldap add before to continue + &AddObjectClass(\%ObjectClass); + $ObjectClass{'ObjectName'} = $1; + $state = 1 ;} + elsif (/^\s+allows\s*$/i) + { $state = 5; } + else {$state = 0; printMsg($ErrorMsg,$_,$LineNb);} + last SWITCH;} + if ($state == 4) {if (/^\s+([^,\s]+),\s*$/i) { + $ObjectClass{'Object_requires'}.=$1." \$ "; } + elsif (/^\s+([^,\s]+)\s*$/i) { + $ObjectClass{'Object_requires'}.=$1." "; + $state = 6; } + else {$state = 0;printMsg($ErrorMsg,$_,$LineNb);} + last SWITCH;} + if ($state == 5) {if (/^\s+([^,\s]+),\s*$/i) { + $ObjectClass{'Object_allows'}.=$1." \$ "; } + elsif (/^\s+([^,\s]+)\s*$/i) { + $ObjectClass{'Object_allows'}.=$1." "; + # run an ldap add before to continue + &AddObjectClass(\%ObjectClass); + $state = 0; } + else {$state = 0; printMsg($ErrorMsg,$_,$LineNb);} + last SWITCH;} + if ($state == 6) {if (/^objectclass\s+(\S+)\s*$/i) { + # run an ldap add before to continue + &AddObjectClass(\%ObjectClass); + $ObjectClass{'ObjectName'} = $1; + $state = 1 ;} + elsif (/^\s+allows\s*$/i) { + $state = 5;} + else {$state = 0; printMsg($ErrorMsg,$_,$LineNb);} + last SWITCH;} + } + } + close(OBJCLASSFILE); + if (($state == 3) || ($state == 4) || ($state == 5) || ($state == 6)) { + &AddObjectClass(\%ObjectClass); + } + printTrace("state: $state",4); +} + +############################################################################# +# printMsg print message to the user standard output. + +sub printMsg { + + my $TypeMsg = shift ; + my $Msg = shift ; + my $LineNb = shift ; + if ($LineNb) { + printTrace("Line: $LineNb, $TypeMsg, $Msg"); + } + else { + printTrace("$TypeMsg $Msg"); + } +} + +############################################################################# +# print message error to the user standard output. + +sub printTrace { + + my $Msg = shift ; + my $level = shift ; + if ($level <= $TRACELEVEL) { + print($Msg); + print LOGFILE $Msg ; + } +} + +############################################################################# +# reset an objectclass structure + +sub resetObjectClass { + my $ObjectClass = shift; + $ObjectClass->{'ObjectName'} = " " ; + $ObjectClass->{'Object_oid'} = " " ; + $ObjectClass->{'Object_superior'} = "top" ; + $ObjectClass->{'Object_requires'} = " " ; + $ObjectClass->{'Object_allows'} = " " ; +} + +############################################################################# +# this subroutine implements a very stupid version of diff + +sub diff { + my $f1 = shift; + my $f2 = shift; + my $lineToBeginWith = shift; + my $NULL = "" ; + my $diff_f1 = $NULL ; + my $diff_f2 = $NULL ; + my $retval = $NULL ; + my $ret; + open(F1, "$f1") or die "Could not open file $f1"; + open(F2, "$f2") or close(F1), die "Could not open file $f2"; + + while (defined($l1 = )) { + if ($lineToBeginWith){ + $lineToBeginWith -- ; + next ; + } + next if ($l1 =~ /^\#/); + $ret = defined($l2 = ); + if ($ret) { + $ret = defined($l2 = ) while ($ret && ($l2 =~ /^\#/)) ; + if ($ret) { + if (!($l1 eq $l2)) { + + # ignore whitespace + $l1_clean = $l1 ; + $l2_clean = $l2 ; + $l1_clean =~ s/\s//g; + $l2_clean =~ s/\s//g; + + if (!($l1_clean eq $l2_clean)) { + $diff_f1 .= "${l1}" unless ($l1_clean eq $NULL); + $diff_f2 .= "${l2}" unless ($l2_clean eq $NULL); + } + } + } + else { + next if ($l1 =~ /^\s*$/) ; + $diff_f1 .= "${l1}"; + } + } + else { + next if ($l1 =~ /^\s*$/) ; + $diff_f1 .= "${l1}"; + } + } + + while (defined($l2 = )) { + if (($l2 =~ /^\#/) || ($l2 =~ /^\s*$/)) { + next ; + } + else { + $diff_f2 .= "${l2}" ; + } + } + + close(F1); + close(F2); + + $retval .= "- differences present in your config file but not in standard file:\n\n". "$diff_f1\n" if ($diff_f1) ; + $retval .= "- differences present in standard file but not in your config file:\n\n" . "$diff_f2" if ($diff_f2) ; + return $retval ; +} + +sub CompareStdConfigFiles { + # Compare each configuration file against its default version. If it has changed, + # notify the user that the file has changed and will need to be checked by the + # user. This should be safe to do because there should be no path information + # stored in these conf files, which are just schema stuff. + # printTrace("\nCheck if standard configuration files have changed",3); + + my $origFilePath = "$oldDir${PATHSEP}bin${PATHSEP}slapd${PATHSEP}install${PATHSEP}config${PATHSEP}" ; + my $FilesChanged = ""; + my $AllDiffs = "***********************************************************************"; + my $NoChanges = "" ; + my $lineToBegin = 0 ; + printTrace("\nVersion of the old directory server: $oldVersion.$oldMinor",0); + opendir(CONFDIR, $oldConfDir) or + die "Error: could not open migrated config dir $oldConfDir: $!"; + + foreach $file (readdir(CONFDIR)) { + $origFile = $origFilePath . $file ; + $configFile = $oldConfDir . $file ; + if ((! exists($userDefinedConfigFiles{lc($file)})) && (-f $origFile)) { + my $lineToBegin = 1 if (lc($file) eq "slapd-collations.conf"); # we ignore the first line of slapd-collations + $diffs = &diff($configFile, $origFile, $lineToBegin); + $lineToBegin = 0 if $lineToBegin ; + if ($diffs) { + $FilesChanged .= "\n$configFile"; + $AllDiffs .= "\n$configFile is different than the standard configuration file" ; + $AllDiffs .= "\nYou will need to check this file and make sure its changes are compatible "; + $AllDiffs .= "with the new directory server\nHere are the differences:\n"; + $AllDiffs .= "$diffs \n\n"; + $AllDiffs .= "***********************************************************************"; + } + else { + $NoChanges .= "\n$configFile"; + } + } + } + closedir(CONFDIR); + +if ($FilesChanged) { + printTrace("\nNo changes to old configuration files:$NoChanges",3) ; + printTrace("\n***********************************************************************",3) ; + printMsg("\nThe following standard files have been modified: $FilesChanged"); + if ($NO_INPUT_USER) { + # do nothing + } + else { + printMsg("\nDo you want to see the differences Yes/No [No] ?") ; + my $answer = ; + if ($answer =~ /y|yes/i) { + printMsg("$AllDiffs"); + } + printMsg("\nDo you want to continue the migration Yes/No [No] ?"); + $answer = ; + if (! ($answer =~ /y|yes/i)) { + exit(1); + } + } + } +} + + +############################################################################# + +sub db2ldif { + my ($conf, $ldif_dir) = @_; + $ENV{"$LIB_PATH"}=$old_libpath; + if (!$conf) { + $conf = "$oldHome${PATHSEP}config${PATHSEP}slapd.conf"; + } + if (! $ldif_dir) { $ldif_dir = $ldif_rep ;} + if (!(-d $ldif_dir)) { + mkdir($ldif_dir,0777) or die "can't create $ldif_rep to store temporary ldif files"; + } + my $dir = "$oldDir${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server"; + chdir($dir) or + die "Error: could not change directory to $dir: $!"; + my @suffixnames = keys(%DBNAMES) ; + foreach $suffixname (@suffixnames) { + my $ldif_file = $ldif_dir.$DBNAMES{$suffixname}.".ldif" ; + # If we are on NT, ${quote} is setup to "\"", else it's setup to "" + # As the suffix can contain some space characters, I write the suffix parameter: "\"$suffixname\"" rather than "${quote}$suffixname${quote}" + my @cmd = + ( "${quote}$oldDir${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server" . + "${PATHSEP}$slapdExecName${quote}", "db2ldif", '-n', '-f', + "${quote}$conf${quote}", '-a', "${quote}$ldif_file${quote}", + '-d', '1','-s',"\"$suffixname\"" ); + open(DB2LDIF, "${quote}@cmd${quote} 2>&1|") or + die "Error: could not execute @cmd: $!"; + sleep(1); # allow pipe to fill with data + $ii = 0; # counter + while () { + ++$ii; + if (($ii % 250) == 0) { + printMsg(" Processing...\n"); + } + } + close(DB2LDIF); + # set the ownership of the ldif file; should be the same as the new slapd user id + if ((! $isNt) && ($oldlocaluser ne $localuser)) { + if (-f $ldif_file) { + chown( $newuid, $newgid, $ldif_file) or printMsg("\nUnable to change the ownership of $ldif_file to $localuser") ; + } + } + } + print " Done.\n"; + chdir($curdir) or die "Could not change directory to $curdir: $!"; +} + +############################################################################# +# This db2ldif is used to export database of the new instance + +sub newinst_db2ldif { + my $ldif = shift ; + my $include_suffix = shift ; + my $home = shift ; + my $db2ldif_param = "db2ldif -r -D $home -a $ldif -s \"$include_suffix\""; + + open(DB2LDIF, "${quote}${quote}$slapdExecName${quote} $db2ldif_param${quote} 2>&1 |") or die "Could not run ns-slapd program $ldif2db_exe\n"; + sleep(1); # allow some data to accumulate in the pipe + my $ii = 0; + while () { + ++$ii; + if (($ii % 250) == 0) { + printMsg(" Processing...\n"); + } + printMsg($_); + } + close(DB2LDIF); + # set the ownership of the ldif file; should be the same as the 5.x slapd user id + if ((! $isNt) && ($oldlocaluser ne $localuser)) { + if (-f $ldif) { + chown( $newuid, $newgid, $ldif) or printMsg("\nUnable to change the ownership of $ldif to $localuser") ; + } + } +} + +############################################################################# + +# this is used to run the system() call, capture exit and signal codes, +# and die() upon badness; the first argument is a directory to change +# dir to, if any, and the rest are passed to system() +sub mySystem { + my $rc = &mySystemNoDie(@_); + my ($dir, @args) = @_; + if ($rc == 0) { +# success + } elsif ($rc == 0xff00) { + die "Error executing @args: error code $rc: $!"; + } elsif ($rc > 0x80) { + $rc >>= 8; + die "Error executing @args: error code $rc: $!"; + } else { + if ($rc & 0x80) { + $rc &= ~0x80; + } + die "Error executing @args: received signal $rc: $!"; + } + + # usually won't get return value + return $rc; +} + +# This version does not die but just returns the error code +sub mySystemNoDie { + my ($dir, @args) = @_; + if ($dir && ($dir ne "")) { + chdir($dir) or die "Could not change directory to $dir: $!"; + } + my $cmd = $args[0]; + # the system {$cmd} avoids some NT shell quoting problems if the $cmd + # needs to be quoted e.g. contains spaces; the map puts double quotes + # around the arguments on NT which are stripped by the command + # interpreter cmd.exe; but don't quote things which are already quoted + my @fixargs = map { /^[\"].*[\"]$/ ? $_ : $quote . $_ . $quote } @args; + my $rc = 0; + if ($cmd =~ /[.](bat|cmd)$/) { + # we have to pass batch files directly to the NT command interpreter + $cmd = $com_spec; +# print "system $cmd /c \"@fixargs\"\n"; + $rc = 0xffff & system {$cmd} '/c', "\"@fixargs\""; + } else { +# print "system $cmd @fixargs\n"; + $rc = 0xffff & system {$cmd} @fixargs; + } + chdir(${curdir}) or die "Could not change directory to $curdir: $!"; + return $rc; +} + +############################################################################# +sub manyLdif2db { + my %rev_dbnames = reverse(%DBNAMES); + @backends = keys(%rev_dbnames); + $ENV{"$LIB_PATH"}=$new_libpath; + chdir($slapdExecDir) or die "Could not change directory to $slapdExecDir: $!"; + foreach $backend (@backends) { + my $ldif = "${ldif_rep}$backend.ldif" ; + if (! -f $ldif) { + $ldif = ${ldif_rep}."data.ldif"; + } + &Ldif2db($ldif, $backend); + } + # remove the empty ldif directory + # but not if using the data dir + if (!$olddatadir) { + rmdir($ldif_rep); + } + chdir($curdir) or die "Could not change directory to $curdir: $!"; +} + + +sub Ldif2db { + my $ldif = shift ; + my $backend = shift ; + my $ldif2db_param = "ldif2db -D $serverHome -n $backend -i $ldif"; + open(LDIF2DB, "${quote}${quote}$slapdExecName${quote} $ldif2db_param${quote} 2>&1 |") or die "Could not run ns-slapd program $ldif2db_exe\n"; + sleep(1); # allow some data to accumulate in the pipe + while () { + printMsg($_); + } + close(LDIF2DB); + # remove the ldif file after the import + # but not if using the data dir + if (!$olddatadir) { + unlink($ldif) ; + } +} + +############################################################################# + +#sub copyBak { +# opendir( OLDBAK, "$oldHome${PATHSEP}bak" ) || +# die "Can't open directory $oldHome${PATHSEP}bak: $!: "; +# local ( @dirs ) = readdir( OLDBAK ); +# closedir ( OLDBAK ); +# for ( @dirs ) { +# if ( $_ eq "." || $_ eq ".." ) { +# next; +# } elsif ( -d "$oldHome${PATHSEP}bak${PATHSEP}$_" ) { +# $srcDir = "$oldHome${PATHSEP}bak${PATHSEP}$_"; +# $destDir = "$serverHome${PATHSEP}bak${PATHSEP}$_"; +# $srcLDIF = "$oldHome${PATHSEP}ldif${PATHSEP}bak.ldif"; +# $destLDIF = "$serverHome${PATHSEP}ldif${PATHSEP}bak.ldif"; +# mkdir( $destDir , 0755 ) if !( -e $destDir); +# # Converting database +# if ( !$isNT && $newuser ) { +# chown($newuid, $newgid, +# "$serverHome${PATHSEP}bak", $destDir); +# } +# &other_db2ldif($srcDir, $srcLDIF); +# if ($needAclUpg) { +# &mySystem("$root${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server", +# "$root${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server" . +# "${PATHSEP}aclupg$exe_suffix", '-d', '-i', +# $srcLDIF, '-o', $destLDIF); +# } else { +# ©BinFile($srcLDIF, $destLDIF); +# } +# &other_ldif2db($destLDIF, $destDir); +# } +# } +#} +############################################################################# + +sub startServer { + my $instanceDir = ${serverHome} ; + my $errLog = $instanceDir . $PATHSEP . 'logs' . $PATHSEP . 'errors'; + # emulate tail -f + # if the last line we see does not contain "slapd started", try again + my $done = 0; + my $started = 0; + my $code = 0; + my $lastLine = ""; + my $timeout = time + 240; # 4 minutes + $ENV{"$LIB_PATH"}=$new_libpath; + + my $startCmd = $instanceDir . $PATHSEP . 'start' . $script_suffix; + if (! -f $startCmd) { + $startCmd = $instanceDir . $PATHSEP . 'start-slapd' . $script_suffix; + } + printTrace("\nInstanceDir: $instanceDir\n",4); + $code = &mySystem($instanceDir,$startCmd); + open(IN, $errLog) or die "Could not open error log $errLog: $!"; + my $pos = tell(IN); + while (($done == 0) && (time < $timeout)) { + for (; ($done == 0) && ($_ = ); $pos = tell(IN)) { + $lastLine = $_; + # print; + # the server has already been started and shutdown once . . . + if (/slapd started\./) { + $started++; + if ($started == 2) { + $done = 1; + } + # sometimes the server will fail to come up; in that case, restart it + } elsif (/Initialization Failed/) { + # print "Server failed to start: $_"; + $code = &mySystem($instanceDir, $startCmd); + # sometimes the server will fail to come up; in that case, restart it + } elsif (/exiting\./) { + # print "Server failed to start: $_"; + #$code = &mySystem($startCmd); + + $code = &mySystem($instanceDir, $startCmd); + } + } + if ($lastLine =~ /PR_Bind/) { + # server port conflicts with another one, just report and punt + print $lastLine; + print "This server cannot be started until the other server on this\n"; + print "port is shutdown.\n"; + $done = 1; + } + if ($done == 0) { + # rest a bit, then . . . + sleep(2); + # . . . reset the EOF status of the file desc + seek(IN, $pos, 0); + } + } + close(IN); + + if ($started < 2) { + $! = $code; + # $now = time; + # if ($now > $timeout) { + # print "Possible timeout: timeout=$timeout now=$now\n"; + # } + die "Error: could not start server: $!"; + } + + return 0; +} + +sub stopServer { + my $root = shift; + my $name = shift; + $maxStopIterations = 5; + print "\nShutting down server $name . . .\n"; + + $ENV{"$LIB_PATH"}=$new_libpath; + $stopCmd = $quote . $root . $PATHSEP . $name . $PATHSEP . 'stop' . $script_suffix . $quote; + if (! -f $stopCmd) { + $stopCmd = $quote . $root . $PATHSEP . $name . $PATHSEP . 'stop-slapd' . $script_suffix . $quote; + } + + if (! -f $stopCmd) { + # no stop command, probably a 1.X system; for NT, we'll try net stop + # for unix, we'll get the pid and kill it + if ($isNT) { + $stopCmd = 'net stop ' . $name; + } else { + # see if there is a pid file + $pidfile = $root . $PATHSEP . $name . $PATHSEP . 'logs' . + $PATHSEP . 'pid'; + if (open(PIDFILE, $pidfile)) { + chomp($pid = ); + close(PIDFILE); + while ($maxStopIterations-- && !$exitCode) { + $exitCode = kill(15, $pid); + } + $stopCmd = undef; + } + } + } + + # keep looping until the stop cmd returns an error code, which usually + # means that what ever we want to stop is stopped, or some other error + # occurred e.g. permission, or no such service + $exitCode = &runAndIgnoreOutput($stopCmd); +# print "stopServer: exitCode=$exitCode\n"; + while ($stopCmd && $maxStopIterations-- && $exitCode) { + $exitCode = &runAndIgnoreOutput($stopCmd); +# print "stopServer: exitCode=$exitCode\n"; + } + + if (!$maxStopIterations) { + print "Warning: could not shutdown the server: $!\n"; + } + + sleep(10) ; + + $exitCode = 0; + +} + + +sub runAndIgnoreOutput { + my $cmd = shift; + printMsg("."); + open(RUNCMD, "${quote}$cmd${quote} 2>&1 |") or die "Error: could not run $cmd: $!"; + printMsg("."); + sleep(1); # allow pipe to fill with data + printMsg("."); + while () { +# print; + } + my $code = close(RUNCMD); +# print "runAndIgnore: code=$code status=$?\n"; + return $?; +} +############################################################################# +# migrate some of entries present in the old DSE.ldif like +# cn=snmp,cn=config +# cn=encryption,cn=config +# all the aci's + +sub MigrateDSE { + printTrace("\nMigrate DSE entries...",1); + open( DSELDIF, "< $oldDSEldif" ) || die "Can't open $oldDSEldif: $!: "; + my $in = new Mozilla::LDAP::LDIF(*DSELDIF) ; + while ($old_entry = readOneEntry $in) { + my $DN = $old_entry->getDN() ; + SWITCH: { + # migrate the entrie: cn=snmp,cn=config + if ($DN =~ /^cn=SNMP,cn=config$/i) { + my $entry = $conn->search("$DN","base","objectclass=nsSNMP"); + if ($entry) { + my $res = $conn->update($old_entry); + if ($res) { + printTrace("\n$DN updated !",2); + } + else { + printMsg("\nFailed to update $DN"); + } + } + else { + printMsg("\nUnable to get info under $DN"); + } + last SWITCH; + } + # migrate the entrie: cn=encryption,cn=config + if ($DN =~ /cn=encryption,cn=config$/i) { + if ($conn->search("$DN","base","objectclass=*")) { + if ($old_entry->hasValue("objectClass", "nsEncryptionConfig")) { + my $certfile = "alias/slapd-" . $newname . "-cert8.db"; + my $keyfile = "alias/slapd-" . $newname. "-key3.db"; + $old_entry->setValues("nsCertfile",$certfile) if ! $old_entry->hasValue("nsCertfile",$certfile); + $old_entry->setValues("nsKeyfile",$keyfile) if ! $old_entry->hasValue("nsKeyfile",$keyfile); + } + my $res = $conn->update($old_entry); + if ($res) { + printTrace("\n$DN updated !",2); + } + else { + printMsg("\nFailed to update $DN"); + } + } + else { + my $res = $conn->add($old_entry); + if ($res) { + printTrace("\n$DN added !",2); + } + else { + printMsg("\nFailed to add $DN"); + } + } + last SWITCH; + } + if (@{$old_entry->{aci}} && (! ($DN =~ /^cn=monitor$/i)) && (! ($DN =~ /^cn=schema$/i))) { + # migrate aci's + my $entry = $conn->search("$DN","base","objectclass=*"); + if ($entry) { + my $res = $conn->update($old_entry); + if ($res) { + printTrace("\n$DN updated !",2); + } + else { + printMsg("\nFailed to update $DN"); + } + } + else { + my $res = $conn->add($old_entry); + if ($res) { + printTrace("\n$DN added !",2); + } + else { + printMsg("\nFailed to add $DN"); + } + } + last SWITCH; + } + } + } + close(DSELDIF); +} +############################################################################# +# migrate SSL info + +sub MigrateSSL { + my $secPwd = 'bidon' ; + # copy the SSL directory + ©Dir("$oldHome${PATHSEP}ssl","$serverHome${PATHSEP}ssl"); + # copy the cert db and key files + if ( -d "$oldDir${PATHSEP}alias") { + $aliasDir = "$root${PATHSEP}alias"; + if (! -d $aliasDir) { + mkdir($aliasDir, 0750); + } + &stopServer($root,'slapd-'.$newname); + my $keydb = "$aliasDir${PATHSEP}slapd-$newname-key3.db" ; + my $certdb = "$aliasDir${PATHSEP}slapd-$newname-cert8.db" ; + my $certdb7 = "$aliasDir${PATHSEP}slapd-$newname-cert7.db" ; + my $old_keydb = "$oldDir${PATHSEP}alias${PATHSEP}slapd-$oldname-key3.db" ; + my $old_certdb = "$oldDir${PATHSEP}alias${PATHSEP}slapd-$oldname-cert7.db"; + my $keydb_backup = "$aliasDir${PATHSEP}slapd-$newname-key3.db_backup" ; + my $certdb_backup = "$aliasDir${PATHSEP}slapd-$newname-cert7.db_backup" ; + if (-f $old_keydb) { + if (-f $keydb) { + if ($NO_INPUT_USER) { + printMsg("\n$keydb already exists. backup in $keydb_backup ..."); + ©BinFile($keydb,$keydb_backup); + ©BinFile($old_keydb,$keydb); + } + else { + print("\n\n$keydb already exists. Do you want to overwrite it ? [no]: "); + my $answer = ; + if ($answer =~ /^y|yes$/i) { + ©BinFile($old_keydb,$keydb); + } + } + } + else { + ©BinFile($old_keydb,$keydb); + } + } + if (-f $old_certdb) { + $mode = (stat($old_certdb))[2] if $PRESERVE; + if (-f $certdb) { + if ($NO_INPUT_USER) { + printMsg("\n$certdb already exists. backup in $certdb_backup ..."); + ©BinFile($certdb,$certdb_backup); + unlink($certdb) || print "Couldn't delete $certdb : $!\n"; + ©BinFile($old_certdb,$certdb7); + } + else { + print("\n\n$certdb already exists. Do you want to overwrite it ? [no]: "); + my $answer = ; + if ($answer =~ /^y|yes$/i) { + unlink($certdb) || print "Couldn't delete $certdb : $!\n"; + ©BinFile($old_certdb,$certdb7); + } + } + } + else { + ©BinFile($old_certdb,$certdb7); + } + } + # copy the old password file + if (-f "$oldDir${PATHSEP}alias${PATHSEP}$type-$oldname-pin.txt") { + ©BinFile( + "$oldDir${PATHSEP}alias${PATHSEP}$type-$oldname-pin.txt", + "$aliasDir${PATHSEP}$type-$newname-pin.txt" + ); + } + &startServer(); + if ($PRESERVE) { + chown($newuid,$newgid,$certdb) || print "Failed to set uid $newuid gid $newgid on $certdb : $!\n"; + chmod($mode,$certdb) || print "Failed to set mode $mode on $certdb : $!\n"; + } + } + +} + +sub DisableSSL { + my $entry = $conn->search("cn=config","base","objectclass=*"); + my $LDAPparam = "nsslapd-security" ; + my $Value = "off" ; + if ($entry->{$LDAPparam}[0] ne $Value) { + printTrace("\nDisable SSL...",1); + $entry->setValues($LDAPparam, $Value); + } + my $res = $conn->update($entry); + if ($res) { + printTrace("\nSSL disabled",2); + } + else { + printMsg("\nCan't disable SSL, the server may have problems starting"); + } +} + +# enable the migration of client authentication informations +sub MigrateCertmap { + # backup the old new certmap.conf and replace it with the old certmap.conf file + my $oldCertmap = "$oldDir${PATHSEP}shared${PATHSEP}config${PATHSEP}certmap.conf"; + my $newCertmap = "$root${PATHSEP}shared${PATHSEP}config${PATHSEP}certmap.conf" ; + my $backupCertmap = "$root${PATHSEP}shared${PATHSEP}config${PATHSEP}certmap.conf_backup" ; + if (&hasChangedoldCertmap($oldCertmap)) { + if ($NO_INPUT_USER) { + printMsg("\n$newCertmap has been backup in $backupCertmap"); + ©BinFile($newCertmap,$backupCertmap); + ©BinFile($oldCertmap,$newCertmap); + } + else { + my $Ask = 1 ; + while ($Ask) { + printMsg("\n\nWhere do you want to back up the file $newCertmap [$backupCertmap] ?") ; + my $Answer = ; + $backupCertmap = $Answer if ($Answer ne "\n"); + chomp($backupCertmap); + printTrace("\nDest: .$backupCertmap.",4); + if (-e $backupCertmap) { + printMsg("\n\n$backupCertmap already exists. Do you want to overwrite it Yes/No [No] ?") ; + if ( =~ /yes|y/i) { + $Ask = 0 ; + } + else { + $backupCertmap = "$root${PATHSEP}shared${PATHSEP}config${PATHSEP}certmap.conf_backup" ; + } + } + else { + $Ask = 0 ; + } + } + printTrace("\nBackup file: $newCertmap in $backupCertmap",4); + ©BinFile($newCertmap,$backupCertmap); + ©BinFile($oldCertmap,$newCertmap); + } + } + else { + } +} + +sub hasChangedoldCertmap { + my $certmapfile = shift ; + my @reference = ("certmap default default", + "default:DNComps", + "default:FilterComps e") ; + my $cpt = 0 ; + printTrace("\nhasChangedoldCertmap",3); + open(CERTMAP,"< $certmapfile"); + while () { + if ((! /^\s*#/) && (! /^\s*$/)) { + my $ref = $reference[$cpt] ; + printTrace("\nValue: $_, ref: $ref",4); + if (! /^\s*$ref\s*$/) { + return 1 ; + } + else { + $cpt++ ; + } + } + } + close (CERTMAP); + printTrace("\ncpt: $cpt",4); + if ($cpt < $#reference) { + return 1 ; + } + else { + return 0 ; + } +} +############################################################################# +# copy a directory to another + +sub copyDir { + my $src = shift; + my $dest = shift; + my $exclude = shift; + + opendir( SRC, $src ) or die "Can't open directory $src: $!: "; + my $mode; + my $uid; + my $gid; + mkdir ( $dest , 0755 ) or die "\nCan't create directory $dest. \nPlease check you have enough rights to create it and/or check that your parent directory exists.\n" if !( -e $dest ); + if ($PRESERVE) { + $mode = (stat($src))[2]; + ($uid, $gid) = (stat(_))[4..5]; + # Make sure files owned by the old user are owned by the + # new user + if ($uid == $olduid) { + $uid = $newuid; + $gid = $newgid; + } + chown $uid, $gid, $dest; + chmod $mode, $dest; + } + local ( @files ) = readdir ( SRC ); + closedir( SRC ); + for ( @files ) { + if ( $_ eq "." || $_ eq ".." ) { + next; + } elsif ( $exclude && /$exclude/ ) { + next; + } elsif( -d "$src${PATHSEP}$_") { + ©Dir ( "$src${PATHSEP}$_", "$dest${PATHSEP}$_" ); + } else { + ©BinFile ( "$src${PATHSEP}$_", "$dest${PATHSEP}$_"); + } + } +} + +sub copyBinFile { + my $src = shift; + my $dest = shift; + my $buf = ""; + my $bufsize = 8192; + + open( SRC, $src ) || die "Can't open $src: $!\n"; + # if we are given a directory destination instead of a file, extract the + # filename portion of the source to use as the destination filename + if (-d $dest) { + $dest = $dest . $PATHSEP . &basename($src); + } + open( DEST, ">$dest" ) || die "Can't create $dest: $!\n"; + binmode SRC; + binmode DEST; + if ($PRESERVE) { + $mode = (stat($src))[2]; + ($uid, $gid) = (stat(_))[4..5]; + # Make sure files owned by the old user are owned by the + # new user + if ($uid == $olduid) { + $uid = $newuid; + $gid = $newgid; + } + chown $uid, $gid, $dest; + chmod $mode, $dest; + } + while (read(SRC, $buf, $bufsize)) { + print DEST $buf; + } + close( SRC ); + close( DEST ); +} +############################################################################# +# backup new configuration files +# backup the directory /slapd-instance/config in /slapd-instance/BackupConfig + +sub backupConfigFiles { + # backup the new config files + my $src = "$serverHome${PATHSEP}config" ; + my $dest = "$serverHome${PATHSEP}config_backup" ; + if ($NO_INPUT_USER) { + printMsg("\n$src has been backup in $dest"); + ©Dir($src,$dest); + } + else { + my $Ask = 1 ; + while ($Ask) { + printMsg("\n\nWhere do you want to back up your configuration directory [$dest] ?") ; + my $Answer = ; + $dest = $Answer if ($Answer ne "\n"); + chomp($dest); + printTrace("\nDest: .$dest.",4); + if (-e $dest) { + printMsg("\n\n$dest already exists. Do you want to overwrite it Yes/No [No] ?") ; + if ( =~ /yes|y/i) { + $Ask = 0 ; + } + else { + $dest = "$serverHome${PATHSEP}config_backup" ; + } + } + else { + $Ask = 0 ; + } + } + printTrace("\nBackup Directory: $src in $dest",4); + ©Dir($src,$dest); + } +} +############################################################################# + +sub getLDAPservername { + my $oldLDAPservername; + my $LDAPservername; + open(OLDSLAPDCONF, $oldSlapdConf) or + die "\nError: could not open old config file $oldSlapdConf \n"; + while() { + chop; + if (/^localhost\s+/i) { + ($oldLDAPservername = $') =~ s/^[\"]//;; + $oldLDAPservername =~ s/[\"]$//; + printTrace("\nName of the old LDAP server: $oldLDAPservername",3); + } + } + close(OLDSLAPDCONF); + + open( DSELDIF, "< $DSEldif" ) || die "\nCan't open $DSEldif \n"; + my $in = new Mozilla::LDAP::LDIF(*DSELDIF) ; + while ($entry = readOneEntry $in) { + my $DN = $entry->getDN() ; + if ($DN =~ /^cn=config$/i) { + my $localhost = "nsslapd-localhost"; + my @values = $entry->getValues($localhost); + if ($#values != -1) { + $LDAPservername = $values[0]; + } + break; + } + } + close(DSELDIF); + # check old and new are installed on the same physical machine. + if (lc($oldLDAPservername) ne lc($LDAPservername)) { + # warn the user he tries to migrate a old server installed on a different machine from the new one + printMsg("\n\nYour old server is on $oldLDAPservername, and your new server is on $LDAPservername. We don't support migration on different machines. Do you want to continue ? Yes/No [No]:") ; + if (! ( =~ /yes|y/i)) { + return -1; + } + } + return $LDAPservername ; +} + +############################################################################# + +sub getLibPath { + my $myDir = shift; + my $myVersion = shift; + my $myMinor = shift; + + if ($isNT) { + return $ENV{"$LIB_PATH"}; + } + if (($myVersion >= 6) && ($myMinor >= 2)) { + return + "$myDir${PATHSEP}bin${PATHSEP}slapd${PATHSEP}lib${SEP}". + "$myDir${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${SEP}". + $ENV{"$LIB_PATH"}; + } else { + return "$myDir${PATHSEP}lib${SEP}".$ENV{"$LIB_PATH"}; + } +} + +############################################################################# + +sub getVersion { + my $dir = shift; + my $versionstr = shift; + my $version = 0; + my $minor = 0; + my $buildNumber = 0; + my $progDir = "${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${PATHSEP}"; + my $progDir2 = "${PATHSEP}bin${PATHSEP}slapd${PATHSEP}"; + + # find the slapd executable + if (!$versionstr) { # version not specified on cmd line - find it + $prog = $dir . $progDir . $slapdExecName; + if (! -f $prog) { + $prog = $dir . $progDir2 . $slapdExecName; + if (-f $prog && $isNT) { + # if slapd is in bin/slapd and we're on NT, just assume version 1; + # apparently, slapd.exe doesn't like the -v argument . . . + return ( '1', $minor ); + } + else{ + die "Could not run slapd program $prog: $!"; + } + } + else { + chdir($dir . $progDir); + } + $cur_libpath=$ENV{"$LIB_PATH"}; + $ENV{"$LIB_PATH"}= + "$dir${PATHSEP}lib${SEP}". + "$dir${PATHSEP}bin${PATHSEP}slapd${PATHSEP}lib${SEP}". + "$dir${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${SEP}". + $ENV{"$LIB_PATH"}; + # read the old version from the old slapd program + + open(F, "${quote}${quote}$prog${quote} -v${quote} 2>&1 |") or + die "Could not run slapd program $prog: $!"; + sleep(1); # allow some data to accumulate in the pipe +# print "Output from $prog -v:\n"; + while () { + if (/^Netscape-Directory/ || /^iPlanet-Directory/i) { + $versionstr = $_; + last; + } + } + $code = close(F); + # print "$prog returned code=$code status=$?\n"; + $ENV{"$LIB_PATH"}=$cur_libpath; + } + + if ($versionstr =~ /^Netscape-Directory\/(\d+)\.(\d+)(?:b\d)*\s+(\S+)/) { + $version = $1; + $minor = $2; + $buildNumber = $3; + } + elsif ($versionstr =~ /^Netscape-Directory\(restrict?ed-mode\)\/(\d+)\.(\d+)\s+(\S+)/) { # we can have restricted-mode or restriced-mode ... + $version = $1; + $minor = $2; + $buildNumber = $3; + } + elsif ($versionstr =~ /^iPlanet-Directory\/(\d+)\.(\d+)\s+(\S+)/i) { + $version = $1; + $minor = $2; + $buildNumber = $3; + } elsif ($versionstr =~ /(\d+)\.(\d+)/) { + $version = $1; + $minor = $2; + } + + if ($version == 0) { + die "\nCould not determine version of the directory server in $dir: \n"; + } + + # distinguish the 4.1 and the 4.11 thanks to the buildNumber + if (($version == 4) && ($minor == 1)){ + if (! ($buildNumber =~ /^B99\.16/)) { + # it's not a 4.1 Netscape Directory Server => it's a 4.11 + $minor = 11 ; + } + } + chdir($curdir) or die "Could not change directory to $curdir: $!" ; + return ( $version, $minor ); +} + +############################################################################# + +sub getDiff { + # we get references to arrays + my $elements = shift ; + my $existing_elements = shift ; + my %count = () ; + my %countEE = () ; + @diff = () ; + foreach $e (@{$elements}, @{$existing_elements}) { $count{$e}++ ;} + foreach $e (@{existing_elements}) { $countEE{$e}++ ;} + foreach $e (@{$elements}) { + # if $e is only present in @$elements, we push it to the diff array + if (($count{$e} == 1) && ($countEE{$e} == 0)) { + push @diff, $e ; + } + } + return @diff ; +} + +############################################################################################### +sub testIndexUpdating { + #my $entry = $conn->newEntry(); + #$entry->setDN("cn=djeattribute,cn=index,cn=MigratedDB_5,cn=ldbm database,cn=plugins,cn=config"); + my $entry = $conn->search("cn=mail,cn=index,cn=MigratedDB_2,cn=ldbm database,cn=plugins,cn=config","base","objectclass=nsIndex"); + my @types = ("pres", "sub", "eq") ; + my @existing_types = $entry->getValues("nsindextype"); + my @typesToAdd = &getDiff(\@types, \@existing_types); + foreach $newtype (@typesToAdd) { + $entry->addValue("nsindextype", $newtype); printTrace("\nnewtype: $newtype",2); + } + my $res = $conn->update($entry) ; + if ($res) {print("\nUpdate index mail\n");} + else { print("\ncan't update index mail");} + + $entry = $conn->search("cn=givenName,cn=index,cn=MigratedDB_2,cn=ldbm database,cn=plugins,cn=config","base","objectclass=nsIndex"); + @types = ("pres", "sub", "eq") ; + @existing_types = $entry->getValues("nsindextype"); print("\ngivenName, existing_types: @existing_types"); + @typesToAdd = &getDiff(\@types, \@existing_types); print("\nTypesToAdd: @typesToAdd"); + foreach $newtype (@typesToAdd) { + $entry->addValue("nsindextype", $newtype); printTrace("\nnewtype: $newtype",2); + } + my $res = $conn->update($entry) ; + if ($res) {print("\nUpdate index givenName\n");} + else { print("\ncan't update index givenName");} + } + + +############################################################################################### +sub normalizeDir { + my $dir = shift ; + my $dir_prec = "" ; + while ($dir_prec ne $dir) { + $dir_prec = $dir ; + if ($isNT) { + grep { s@\\\\@\\@g } $dir ; + } + else { + grep { s@//@/@g } $dir ; + } + } + return $dir ; +} + + +############################################################################################### +# return 1 if the value parameters is +sub isAllowedPlugin { + my $Value = lc(shift) ; + if ($allowedPlugins{$Value}) { + return 1 ; + } + else { + return 0 ; + } + +} + + +sub getSyntaxOid { + my $Value = lc(shift) ; + return $allowedPlugins{$Value} ; +} + +############################################################################################### +# return 1 if the value given in parameters is an allowed modifier +sub isAllowedModifier { + my $Value = lc(shift) ; + if ($allowedModifiers{$Value}) { + return 1 ; + } + else { + return 0 ; + } +} + +sub getModifierValue { + my $Value = lc(shift) ; + return $allowedModifiers{$Value} ; +} + +############################################################################################### + +sub GetTime { + my $tm = localtime; + (my $sec, my $min, my $hour, my $dd, my $mm, my $yy) = ($tm->sec, $tm->min, $tm->hour, $tm->mday, ($tm->mon)+1, ($tm->year)+1900); + $sec = "0$sec" unless $sec > 9 ; + $min = "0$min" unless $min > 9 ; + $hour = "0$hour" unless $hour > 9 ; + $dd = "0$dd" unless $dd > 9 ; + $mm = "0$mm" unless $mm > 9 ; + return ($sec, $min, $hour, $dd, $mm, $yy); +} + +############################################################################################### +# get uid and group id of the new slapd server. +# The uid is done through the nsslapd-localuser attribute + +sub getuid_gid { + my $newuid ; + my $newgid ; + my $localuser ; + my $localuser_attr = "nsslapd-localuser" ; + if (! $isNT) { + my $entry = $conn->search("cn=config ", "base","objectclass=*", 0, ($localuser_attr)) ; + # Tests wether we succeed to get the entry cn=config + die "\nCan't get the entry cn=config \n" unless ($entry); + my @values = $entry->getValues($localuser_attr); + if ($#values == -1 || ($values[0] eq "") ) { # tests wether the nsslapd-localuser attribute has a value + printMsg("\nNo localuser has been found in the configuration of the directory. "); + if ($NO_INPUT_USER) { + printMsg("\nWe considered nobody as the localuser"); + $localuser = "nobody" ; + } + else { + my $Ask = 1 ; + while ($Ask) { + printMsg("\nUnder what user does your $Version.$Minor directory server run [nobody] ? ") ; + $localuser = ; + chomp($localuser); + $localuser = "nobody" if ($localuser eq ""); + ($newuid, $newgid) = (getpwnam("$localuser"))[2..3] ; + if ($newuid) { + $Ask = 0 ; + } + else { + printMsg("\nError: $localuser is unknown from the system "); + } + } + } + } + else { + $localuser = $values[0]; # returns the first value (we should only have one localuser) + my $size = $#values ; + } + ($newuid, $newgid) = (getpwnam("$localuser"))[2..3] ; + return ($localuser, $newuid, $newgid) ; + } + else { + return () ; + } +} + + +############################################################################################### +# get uid and group id of the old slapd server. + +sub getolduid_gid { + my $oldlocaluser ; + if (! $isNT) { + open(CONF, $oldSlapdConf) or die "\nError: cannot open $oldSlapdConf: $!\n"; + while () { + if (/^localuser\s+/i) { + chomp($oldlocaluser = $'); + last; + } + } + close(CONF); + ($olduid, $oldgid) = (getpwnam("$oldlocaluser"))[2..3] ; + return ($oldlocaluser, $olduid, $oldgid) ; + } + else { + return (); + } +} + +############################################################################################### +# get current directory + +sub getCwd { + my $command = $isNT ? "cd" : "/bin/pwd"; + open(PWDCMD, "$command 2>&1 |") or + die "Error: could not execute $command: $!"; + # without the following sleep, reading from the pipe will + # return nothing; I guess it gives the pwd command time + # to get some data to read . . . + sleep(1); + my $currentdir; + while () { + if (!$currentdir) { + chomp($currentdir = $_); + } + } + my $code = close(PWDCMD); +# if ($code || $?) { +# print "$command returned code=$code status=$? dir=$curdir\n"; +# } +# print "getCwd curdir=\[$curdir\]\n"; + return $currentdir; +} diff --git a/ldap/admin/src/scripts/template-migrateTo7 b/ldap/admin/src/scripts/template-migrateTo7 new file mode 100644 index 00000000..73f71ab9 --- /dev/null +++ b/ldap/admin/src/scripts/template-migrateTo7 @@ -0,0 +1,3268 @@ +#{{PERL-EXEC}} +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2004 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# + +# Migrate a old directory server to a 7.0 directory server + +######################################################################################################## +# enable the use of Perldap functions +require DynaLoader; + +use Getopt::Std; +use Mozilla::LDAP::Conn; +use Mozilla::LDAP::Entry; +use Mozilla::LDAP::LDIF; +use Mozilla::LDAP::Utils qw(:all); +use Mozilla::LDAP::API qw(:api :ssl :apiv3 :constant); # Direct access to C API +use Time::localtime; + +######################################################################################################## +use Class::Struct ; # load struct-building module + +struct S_index => { + names => '@' , + types => '@' , + oids => '@' , + specific => '$' + }; + + +struct S_plugin => { + name => '$' , + type => '$' , + enable => '$' , + args => '@' + }; +##################################################################################################### + +sub usage { + print(STDERR "\nUsage: $0 -D rootdn { -w password | -w - | -j filename } -p port \n"); + print(STDERR " -o OldInstancePath -n NewInstancePath [-t tracelevel] [-L logfile]\n"); + print(STDERR "************** parameters in brackets are optionals, others are required **************\n"); + print(STDERR " Opts: -D rootdn - New Directory Manager\n"); + print(STDERR " : -w password - New Directory Manager's password\n"); + print(STDERR " : -w - - Prompt for New Directory Manager's password\n"); + print(STDERR " : -j filename - Read New Directory Manager's password from file\n"); + print(STDERR " : -p port - New Directory Server port\n"); + print(STDERR " : -o OldInstancePath - Path of the Old instance to migrate \n"); + print(STDERR " : -n NewInstancePath - Path of the new instance\n"); + print(STDERR " : [-d dataPath] - Path to directory containing data files to import into new instance\n"); + print(STDERR " : [-v oldVersion] - Old version (obtained by running $slapdExecName -v\n"); + print(STDERR " : [-t tracelevel] - specify the level of trace (0..3)\n"); + print(STDERR " : [-L logfile] - specify the file to log the migration report \n"); + + + } + + + +############# +BEGIN { + + require 'uname.lib' ; + $isNT = -d '\\'; + $PATHSEP = $isNT ? "\\" : "/"; + ${SEP} = $isNT ? ";" : ":" ; + @INC = ( '.', '../../../admin/admin/bin'); + grep { s@/@\\@g } @INC if $isNT; + $script_suffix = $isNT ? ".bat" : ""; + $exe_suffix = $isNT ? ".exe" : ""; + # NT needs quotes around some things unix doesn't + $quote = $isNT ? "\"" : ""; + + # If this variable is set, all file/directory creation will make sure the mode + # and ownership of the destination is the same as the source + $PRESERVE = 1 if (!$isNT); + $script_suffix = $isNT ? ".bat" : ""; + $exe_suffix = $isNT ? ".exe" : ""; + if ($isNT) { + $os = "WINNT"; + } else { + $os = &uname("-s"); + } + if ($isNT) { + # we have to pass batch files directly to the NT command interpreter + $com_spec = $ENV{ComSpec}; + if (!$com_spec) { + $com_spec = $ENV{COMSPEC}; + } + if (!$com_spec || ! -f $com_spec) { + # find the first available command interpreter + foreach $drive (c..z) { + $com_spec = "$drive:\\winnt\\system32\\cmd.exe"; + last if (-f $com_spec); + $com_spec = undef; + } + if (! $com_spec) { + # punt and pray + $com_spec = 'c:\winnt\system32\cmd.exe'; + } + } + } + if ( $os eq "AIX" ) { + $dll_suffix = "_shr.a"; + } + elsif ( $os eq "HP-UX" ) { + $dll_suffix = ".sl"; + } + elsif ( $os eq "WINNT" ) { + $dll_suffix = ".dll"; + } + else { + $dll_suffix = ".so"; + } + $slapdExecName = $isNT ? 'slapd.exe' : './ns-slapd'; + # if this flag is set, we will migrate the old database + # by doing a db2ldif -> ldif2db; + $convertToLDIF = 1; + select STDERR; + $| = 1; + select STDOUT; + $| = 1; + # if the old value for dbcachesize is less than this, make it this + $MIN_DBCACHESIZE = '500000'; +} + +SWITCH: { + if ($os eq "AIX") { + $LIB_PATH = "LIBPATH" ; + last SWITCH ; + } + if ($os eq "HP-UX") { + $LIB_PATH = "SHLIB_PATH" ; + last SWITCH ; + } + if ($isNT) { + $LIB_PATH = "PATH" ; + last SWITCH ; + } + else { + $LIB_PATH = "LD_LIBRARY_PATH" ; + last SWITCH ; + } + } + + # Old parameters + ${oldDir} = "" ; + ${oldname} = "" ; + ${oldHome} = "" ; + ${oldConfDir} = "" ; + ${oldlocaluser} ; + ${olduid} ; + ${oldgid} ; + + # New parameters + ${root} = "{{DS-ROOT}}" ; + ${type} = "" ; + ${newname} = "" ; + ${newport} = "" ; + ${rootDN} = "" ; + ${rootpwd} = "" ; + ${localhost} = "" ; + ${LogFileReport} = "" ; + ${newuid} ; + ${localuser} ; + ${newgid} ; + $NO_INPUT_USER = 0 ; # by default user can give inputs during the migration process + ${curdir} = getCwd(); + ${slapdExecDir} = "${root}${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${PATHSEP}"; + + # specify the level of trace + $TRACELEVEL=1; + + $LDAP_SERVER_UNREACHABLE = 81; + + # get input users + &getParameters() ; + ${oldDir} = &normalizeDir("${oldDir}"); + ${oldHome} = "${oldDir}${PATHSEP}$type-$oldname" ; + ${oldConfDir} = "${oldHome}${PATHSEP}config${PATHSEP}" ; + ${oldSlapdConf} = "${oldConfDir}slapd.conf" ; + ${oldDSEldif} = "${oldConfDir}dse.ldif" ; + ${serverHome} = "${root}${PATHSEP}$type-$newname" ; + ${DSEldif} = "$serverHome${PATHSEP}config${PATHSEP}dse.ldif"; + ${ldif_rep} = "${oldConfDir}${PATHSEP}ldif${PATHSEP}" ; + ${oldSlapdExecDir} = "${oldDir}${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${PATHSEP}"; + + + + + open(LOGFILE, ">> $LogFileReport"); + + printTrace("\noldDir: $oldDir, oldHome: $oldHome, \noldConfDir: $oldConfDir, \noldSlapdConf: $oldSlapdConf, \nldif_rep: $ldif_rep, \nrootDN: $rootDN, \nPwd: ******, \nPort: $newport, \nNewname: $newname\n",3); + printTrace("\nLIB_PATH: $LIB_PATH",4); + + if (!(-d $serverHome)) { + printMsg("\n$serverHome doesn't exist\n"); + exit(1); + } + if (!(-d $oldHome)) { + printMsg("\n$oldHome doesn't exist\n"); + exit(1); + } + + if ($olddatadir && !(-d $olddatadir)) { + print("\n$olddatadir doesn't exist\n"); + exit(1); + } + +#define CONFIG_DATABASE_DIRECTIVE "database" +#define CONFIG_DATABASE_ATTRIBUTE "nsslapd-database" +#define CONFIG_PLUGIN_DIRECTIVE "plugin" +#define CONFIG_PLUGIN_ATTRIBUTE "nsslapd-plugin" +#define CONFIG_SIZELIMIT_DIRECTIVE "sizelimit" +#define CONFIG_SIZELIMIT_ATTRIBUTE "nsslapd-sizelimit" +#define CONFIG_ORCAUTO_DIRECTIVE "orcauto" +#define CONFIG_ORCAUTO_ATTRIBUTE "nsslapd-orcauto" +#define CONFIG_TIMELIMIT_DIRECTIVE "timelimit" +#define CONFIG_TIMELIMIT_ATTRIBUTE "nsslapd-timelimit" +#define CONFIG_SUFFIX_DIRECTIVE "suffix" +#define CONFIG_SUFFIX_ATTRIBUTE "nsslapd-suffix" +#define CONFIG_READONLY_DIRECTIVE "readonly" +#define CONFIG_READONLY_ATTRIBUTE "nsslapd-readonly" +#define CONFIG_REFERRAL_DIRECTIVE "referral" +#define CONFIG_REFERRAL_ATTRIBUTE "nsslapd-referral" +#define CONFIG_OBJECTCLASS_DIRECTIVE "objectclass" +#define CONFIG_OBJECTCLASS_ATTRIBUTE "nsslapd-objectclass" +#define CONFIG_ATTRIBUTE_DIRECTIVE "attribute" +#define CONFIG_ATTRIBUTE_ATTRIBUTE "nsslapd-attribute" +#define CONFIG_SCHEMACHECK_DIRECTIVE "schemacheck" +#define CONFIG_SCHEMACHECK_ATTRIBUTE "nsslapd-schemacheck" +#define CONFIG_LOGLEVEL_DIRECTIVE "loglevel" +#define CONFIG_LOGLEVEL_ATTRIBUTE "nsslapd-errorlog-level" +#define CONFIG_ACCESSLOGLEVEL_DIRECTIVE "accessloglevel" +#define CONFIG_ACCESSLOGLEVEL_ATTRIBUTE "nsslapd-accesslog-level" +#define CONFIG_ACCESSLOG_MAXNUMOFLOGSPERDIR_DIRECTIVE "accesslog-maxNumOfLogsPerDir" +#define CONFIG_ACCESSLOG_MAXNUMOFLOGSPERDIR_ATTRIBUTE "nsslapd-accesslog-maxlogsperdir" +#define CONFIG_ERRORLOG_MAXNUMOFLOGSPERDIR_DIRECTIVE "errorlog-maxNumOfLogsPerDir" +#define CONFIG_ERRORLOG_MAXNUMOFLOGSPERDIR_ATTRIBUTE "nsslapd-errorlog-maxlogsperdir" +#define CONFIG_AUDITLOG_MAXNUMOFLOGSPERDIR_DIRECTIVE "auditlog-maxNumOfLogsPerDir" +#define CONFIG_AUDITLOG_MAXNUMOFLOGSPERDIR_ATTRIBUTE "nsslapd-auditlog-maxlogsperdir" +#define CONFIG_ACCESSLOG_MAXLOGSIZE_DIRECTIVE "accesslog-maxlogsize" +#define CONFIG_ACCESSLOG_MAXLOGSIZE_ATTRIBUTE "nsslapd-accesslog-maxlogsize" +#define CONFIG_ERRORLOG_MAXLOGSIZE_DIRECTIVE "errorlog-maxlogsize" +#define CONFIG_ERRORLOG_MAXLOGSIZE_ATTRIBUTE "nsslapd-errorlog-maxlogsize" +#define CONFIG_AUDITLOG_MAXLOGSIZE_DIRECTIVE "auditlog-maxlogsize" +#define CONFIG_AUDITLOG_MAXLOGSIZE_ATTRIBUTE "nsslapd-auditlog-maxlogsize" +#define CONFIG_ACCESSLOG_LOGROTATIONTIME_DIRECTIVE "accesslog-logrotationtime" +#define CONFIG_ACCESSLOG_LOGROTATIONTIME_ATTRIBUTE "nsslapd-accesslog-logrotationtime" +#define CONFIG_ERRORLOG_LOGROTATIONTIME_DIRECTIVE "errorlog-logrotationtime" +#define CONFIG_ERRORLOG_LOGROTATIONTIME_ATTRIBUTE "nsslapd-errorlog-logrotationtime" +#define CONFIG_AUDITLOG_LOGROTATIONTIME_DIRECTIVE "auditlog-logrotationtime" +#define CONFIG_AUDITLOG_LOGROTATIONTIME_ATTRIBUTE "nsslapd-auditlog-logrotationtime" +#define CONFIG_ACCESSLOG_LOGROTATIONTIMEUNIT_DIRECTIVE "accesslog-logrotationtimeunit" +#define CONFIG_ACCESSLOG_LOGROTATIONTIMEUNIT_ATTRIBUTE "nsslapd-accesslog-logrotationtimeunit" +#define CONFIG_ERRORLOG_LOGROTATIONTIMEUNIT_DIRECTIVE "errorlog-logrotationtimeunit" +#define CONFIG_ERRORLOG_LOGROTATIONTIMEUNIT_ATTRIBUTE "nsslapd-errorlog-logrotationtimeunit" +#define CONFIG_AUDITLOG_LOGROTATIONTIMEUNIT_DIRECTIVE "auditlog-logrotationtimeunit" +#define CONFIG_AUDITLOG_LOGROTATIONTIMEUNIT_ATTRIBUTE "nsslapd-auditlog-logrotationtimeunit" +#define CONFIG_ACCESSLOG_MAXLOGDISKSPACE_DIRECTIVE "accesslog-maxlogdiskspace" +#define CONFIG_ACCESSLOG_MAXLOGDISKSPACE_ATTRIBUTE "nsslapd-accesslog-logmaxdiskspace" +#define CONFIG_ERRORLOG_MAXLOGDISKSPACE_DIRECTIVE "errorlog-maxlogdiskspace" +#define CONFIG_ERRORLOG_MAXLOGDISKSPACE_ATTRIBUTE "nsslapd-errorlog-logmaxdiskspace" +#define CONFIG_AUDITLOG_MAXLOGDISKSPACE_DIRECTIVE "auditlog-maxlogdiskspace" +#define CONFIG_AUDITLOG_MAXLOGDISKSPACE_ATTRIBUTE "nsslapd-auditlog-logmaxdiskspace" +#define CONFIG_ACCESSLOG_MINFREEDISKSPACE_DIRECTIVE "accesslog-minfreediskspace" +#define CONFIG_ACCESSLOG_MINFREEDISKSPACE_ATTRIBUTE "nsslapd-accesslog-logminfreediskspace" +#define CONFIG_ERRORLOG_MINFREEDISKSPACE_DIRECTIVE "errorlog-minfreediskspace" +#define CONFIG_ERRORLOG_MINFREEDISKSPACE_ATTRIBUTE "nsslapd-errorlog-logminfreediskspace" +#define CONFIG_AUDITLOG_MINFREEDISKSPACE_DIRECTIVE "auditlog-minfreediskspace" +#define CONFIG_AUDITLOG_MINFREEDISKSPACE_ATTRIBUTE "nsslapd-auditlog-logminfreediskspace" +#define CONFIG_ACCESSLOG_LOGEXPIRATIONTIME_DIRECTIVE "accesslog-logexpirationtime" +#define CONFIG_ACCESSLOG_LOGEXPIRATIONTIME_ATTRIBUTE "nsslapd-accesslog-logexpirationtime" +#define CONFIG_ERRORLOG_LOGEXPIRATIONTIME_DIRECTIVE "errorlog-logexpirationtime" +#define CONFIG_ERRORLOG_LOGEXPIRATIONTIME_ATTRIBUTE "nsslapd-errorlog-logexpirationtime" +#define CONFIG_AUDITLOG_LOGEXPIRATIONTIME_DIRECTIVE "auditlog-logexpirationtime" +#define CONFIG_AUDITLOG_LOGEXPIRATIONTIME_ATTRIBUTE "nsslapd-auditlog-logexpirationtime" +#define CONFIG_ACCESSLOG_LOGEXPIRATIONTIMEUNIT_DIRECTIVE "accesslog-logexpirationtimeunit" +#define CONFIG_ACCESSLOG_LOGEXPIRATIONTIMEUNIT_ATTRIBUTE "nsslapd-accesslog-logexpirationtimeunit" +#define CONFIG_ERRORLOG_LOGEXPIRATIONTIMEUNIT_DIRECTIVE "errorlog-logexpirationtimeunit" +#define CONFIG_ERRORLOG_LOGEXPIRATIONTIMEUNIT_ATTRIBUTE "nsslapd-errorlog-logexpirationtimeunit" +#define CONFIG_AUDITLOG_LOGEXPIRATIONTIMEUNIT_DIRECTIVE "auditlog-logexpirationtimeunit" +#define CONFIG_AUDITLOG_LOGEXPIRATIONTIMEUNIT_ATTRIBUTE "nsslapd-auditlog-logexpirationtimeunit" +#define CONFIG_ACCESSLOG_LOGGING_ENABLED_DIRECTIVE "accesslog-logging-enabled" +#define CONFIG_ACCESSLOG_LOGGING_ENABLED_ATTRIBUTE "nsslapd-accesslog-logging-enabled" +#define CONFIG_ERRORLOG_LOGGING_ENABLED_DIRECTIVE "errorlog-logging-enabled" +#define CONFIG_ERRORLOG_LOGGING_ENABLED_ATTRIBUTE "nsslapd-errorlog-logging-enabled" +#define CONFIG_AUDITLOG_LOGGING_ENABLED_DIRECTIVE "auditlog-logging-enabled" +#define CONFIG_AUDITLOG_LOGGING_ENABLED_ATTRIBUTE "nsslapd-auditlog-logging-enabled" +#define CONFIG_ROOTDN_DIRECTIVE "rootdn" +#define CONFIG_ROOTDN_ATTRIBUTE "nsslapd-rootdn" +#define CONFIG_ROOTPW_DIRECTIVE "rootpw" +#define CONFIG_ROOTPW_ATTRIBUTE "nsslapd-rootpw" +#define CONFIG_ROOTPWSTORAGESCHEME_DIRECTIVE "rootpwstoragescheme" +#define CONFIG_ROOTPWSTORAGESCHEME_ATTRIBUTE "nsslapd-rootpwstoragescheme" +#define CONFIG_UPDATEDN_DIRECTIVE "updatedn" +#define CONFIG_UPDATEDN_ATTRIBUTE "nsslapd-updatedn" +#define CONFIG_UPDATEPW_DIRECTIVE "updatepw" +#define CONFIG_UPDATEPW_ATTRIBUTE "nsslapd-updatepw" +#define CONFIG_UPDATESSLCLIENT_DIRECTIVE "updateSSLclient" +#define CONFIG_UPDATESSLCLIENT_ATTRIBUTE "nsslapd-updateSSLclient" +#define CONFIG_AUDITFILE_DIRECTIVE "auditfile" +#define CONFIG_AUDITFILE_ATTRIBUTE "nsslapd-auditlog" +#define CONFIG_LASTMOD_DIRECTIVE "lastmod" +#define CONFIG_LASTMOD_ATTRIBUTE "nsslapd-lastmod" +#define CONFIG_INCLUDE_DIRECTIVE "include" +#define CONFIG_INCLUDE_ATTRIBUTE "nsslapd-include" +#define CONFIG_DYNAMICCONF_DIRECTIVE "dynamicconf" +#define CONFIG_DYNAMICCONF_ATTRIBUTE "nsslapd-dynamicconf" +#define CONFIG_USEROC_DIRECTIVE "useroc" +#define CONFIG_USEROC_ATTRIBUTE "nsslapd-useroc" +#define CONFIG_USERAT_DIRECTIVE "userat" +#define CONFIG_USERAT_ATTRIBUTE "nsslapd-userat" +#define CONFIG_SVRTAB_DIRECTIVE "svrtab" +#define CONFIG_SVRTAB_ATTRIBUTE "nsslapd-svrtab" +#ifndef _WIN32 +#define CONFIG_LOCALUSER_DIRECTIVE "localuser" +#define CONFIG_LOCALUSER_ATTRIBUTE "nsslapd-localuser" +#endif /* !_WIN32 */ +#define CONFIG_LOCALHOST_DIRECTIVE "localhost" +#define CONFIG_LOCALHOST_ATTRIBUTE "nsslapd-localhost" +#define CONFIG_PORT_DIRECTIVE "port" +#define CONFIG_PORT_ATTRIBUTE "nsslapd-port" +#define CONFIG_LISTENHOST_DIRECTIVE "listenhost" +#define CONFIG_LISTENHOST_ATTRIBUTE "nsslapd-listenhost" +#define CONFIG_SECURITY_DIRECTIVE "security" +#define CONFIG_SECURITY_ATTRIBUTE "nsslapd-security" +#define CONFIG_SSL3CIPHERS_DIRECTIVE "SSL3ciphers" +#define CONFIG_SSL3CIPHERS_ATTRIBUTE "nsslapd-SSL3ciphers" +#define CONFIG_ACCESSLOG_DIRECTIVE "accesslog" +#define CONFIG_ACCESSLOG_ATTRIBUTE "nsslapd-accesslog" +#define CONFIG_ERRORLOG_DIRECTIVE "errorlog" +#define CONFIG_ERRORLOG_ATTRIBUTE "nsslapd-errorlog" +#define CONFIG_INSTANCEDIR_DIRECTIVE "instancedir" +#define CONFIG_INSTANCEDIR_ATTRIBUTE "nsslapd-instancedir" +#define CONFIG_SECUREPORT_DIRECTIVE "secure-port" +#define CONFIG_SECUREPORT_ATTRIBUTE "nsslapd-securePort" +#define CONFIG_SECURELISTENHOST_DIRECTIVE "secure-listenhost" +#define CONFIG_SECURELISTENHOST_ATTRIBUTE "nsslapd-securelistenhost" +#define CONFIG_THREADNUMBER_DIRECTIVE "threadnumber" +#define CONFIG_THREADNUMBER_ATTRIBUTE "nsslapd-threadnumber" +#define CONFIG_MAXTHREADSPERCONN_DIRECTIVE "maxthreadsperconn" +#define CONFIG_MAXTHREADSPERCONN_ATTRIBUTE "nsslapd-maxthreadsperconn" +#if !defined(_WIN32) && !defined(AIX) +#define CONFIG_MAXDESCRIPTORS_DIRECTIVE "maxdescriptors" +#define CONFIG_MAXDESCRIPTORS_ATTRIBUTE "nsslapd-maxdescriptors" +#endif /* !_WIN32 && ! AIX */ +#define CONFIG_RESERVEDESCRIPTORS_DIRECTIVE "reservedescriptors" +#define CONFIG_RESERVEDESCRIPTORS_ATTRIBUTE "nsslapd-reservedescriptors" +#define CONFIG_IDLETIMEOUT_DIRECTIVE "idletimeout" +#define CONFIG_IDLETIMEOUT_ATTRIBUTE "nsslapd-idletimeout" +#define CONFIG_IOBLOCKTIMEOUT_DIRECTIVE "ioblocktimeout" +#define CONFIG_IOBLOCKTIMEOUT_ATTRIBUTE "nsslapd-ioblocktimeout" +#define CONFIG_NTSYNCH_DIRECTIVE "ntsynch" +#define CONFIG_NTSYNCH_ATTRIBUTE "nsslapd-NTSynch" +#define CONFIG_NTSYNCHUSESSL_DIRECTIVE "ntsynchusessl" +#define CONFIG_NTSYNCHUSESSL_ATTRIBUTE "nsslapd-NTSynch-SSL" +#define CONFIG_NTSYNCHPORT_DIRECTIVE "ntsynch-port" +#define CONFIG_NTSYNCHPORT_ATTRIBUTE "nsslapd-NTSynch-port" +#define CONFIG_ACCESSCONTROL_DIRECTIVE "accesscontrol" +#define CONFIG_ACCESSCONTROL_ATTRIBUTE "nsslapd-accesscontrol" +#define CONFIG_GROUPEVALNESTLEVEL_DIRECTIVE "groupevalnestlevel" +#define CONFIG_GROUPEVALNESTLEVEL_ATTRIBUTE "nsslapd-groupevalnestlevel" +#define CONFIG_NAGLE_DIRECTIVE "nagle" +#define CONFIG_NAGLE_ATTRIBUTE "nsslapd-nagle" +#define CONFIG_PW_CHANGE_DIRECTIVE "pw_change" +#define CONFIG_PW_CHANGE_ATTRIBUTE "passwordChange" +#define CONFIG_PW_MUSTCHANGE_DIRECTIVE "pw_must_change" +#define CONFIG_PW_MUSTCHANGE_ATTRIBUTE "passwordMustChange" +#define CONFIG_PW_SYNTAX_DIRECTIVE "pw_syntax" +#define CONFIG_PW_SYNTAX_ATTRIBUTE "passwordCheckSyntax" +#define CONFIG_PW_MINLENGTH_DIRECTIVE "pw_minlength" +#define CONFIG_PW_MINLENGTH_ATTRIBUTE "passwordMinLength" +#define CONFIG_PW_EXP_DIRECTIVE "pw_exp" +#define CONFIG_PW_EXP_ATTRIBUTE "passwordExp" +#define CONFIG_PW_MAXAGE_DIRECTIVE "pw_maxage" +#define CONFIG_PW_MAXAGE_ATTRIBUTE "passwordMaxAge" +#define CONFIG_PW_MINAGE_DIRECTIVE "pw_minage" +#define CONFIG_PW_MINAGE_ATTRIBUTE "passwordMinAge" +#define CONFIG_PW_WARNING_DIRECTIVE "pw_warning" +#define CONFIG_PW_WARNING_ATTRIBUTE "passwordWarning" +#define CONFIG_PW_HISTORY_DIRECTIVE "pw_history" +#define CONFIG_PW_HISTORY_ATTRIBUTE "passwordHistory" +#define CONFIG_PW_INHISTORY_DIRECTIVE "pw_inhistory" +#define CONFIG_PW_INHISTORY_ATTRIBUTE "passwordInHistory" +#define CONFIG_PW_LOCKOUT_DIRECTIVE "pw_lockout" +#define CONFIG_PW_LOCKOUT_ATTRIBUTE "passwordLockout" +#define CONFIG_PW_STORAGESCHEME_DIRECTIVE "pw_storagescheme" +#define CONFIG_PW_STORAGESCHEME_ATTRIBUTE "passwordStorageScheme" +#define CONFIG_PW_MAXFAILURE_DIRECTIVE "pw_maxfailure" +#define CONFIG_PW_MAXFAILURE_ATTRIBUTE "passwordMaxFailure" +#define CONFIG_PW_UNLOCK_DIRECTIVE "pw_unlock" +#define CONFIG_PW_UNLOCK_ATTRIBUTE "passwordUnlock" +#define CONFIG_PW_LOCKDURATION_DIRECTIVE "pw_lockduration" +#define CONFIG_PW_LOCKDURATION_ATTRIBUTE "passwordLockoutDuration" +#define CONFIG_PW_RESETFAILURECOUNT_DIRECTIVE "pw_resetfailurecount" +#define CONFIG_PW_RESETFAILURECOUNT_ATTRIBUTE "passwordResetFailureCount" +#define CONFIG_ACCESSLOG_BUFFERING_DIRECTIVE "logbuffering" +#define CONFIG_ACCESSLOG_BUFFERING_ATTRIBUTE "nsslapd-accesslog-logbuffering" +#define CONFIG_CHANGELOG_DIR_DIRECTIVE "changelogdir" +#define CONFIG_CHANGELOG_DIR_ATTRIBUTE "nsslapd-changelogdir" +#define CONFIG_CHANGELOG_SUFFIX_DIRECTIVE "changelogsuffix" +#define CONFIG_CHANGELOG_SUFFIX_ATTRIBUTE "nsslapd-changelogsuffix" +#define CONFIG_CHANGELOG_MAXENTRIES_DIRECTIVE "changelogmaxextries" +#define CONFIG_CHANGELOG_MAXENTRIES_ATTRIBUTE "nsslapd-changelogmaxentries" +#define CONFIG_CHANGELOG_MAXAGE_DIRECTIVE "changelogmaxage" +#define CONFIG_CHANGELOG_MAXAGE_ATTRIBUTE "nsslapd-changelogmaxage" +#define CONFIG_RETURN_EXACT_CASE_DIRECTIVE "return_exact_case" +#define CONFIG_RESULT_TWEAK_DIRECTIVE "result_tweak" +#define CONFIG_REFERRAL_MODE_DIRECTIVE "referralmode" +#define CONFIG_ATTRIBUTE_NAME_EXCEPTION_DIRECTIVE "attribute_name_exceptions" +#define CONFIG_MAXBERSIZE_DIRECTIVE "maxbersize" +#define CONFIG_VERSIONSTRING_DIRECTIVE "versionstring" +#define CONFIG_ENQUOTE_SUP_OC_DIRECTIVE "enquote_sup_oc" +#define CONFIG_ENQUOTE_SUP_OC_ATTRIBUTE "nsslapd-enquote_sup_oc" +#define CONFIG_BASEDN_DIRECTIVE "certmap-basedn" +#define CONFIG_BASEDN_ATTRIBUTE "nsslapd-certmap-basedn" + +%HashParametersName = (); + +# The following hash displays only general server parameters to migrate under cn=config +%GeneralSrvParamToMigrate = ( + 'accesscontrol' => 'nsslapd-accesscontrol', + 'errorlog-logging-enabled' => 'nsslapd-errorlog-logging-enabled', + 'accesslog-logging-enabled' => 'nsslapd-accesslog-logging-enabled', + 'auditlog-logging-enabled' => 'nsslapd-auditlog-logging-enabled', + 'logbuffering' => 'nsslapd-accesslog-logbuffering', + 'accesslog-logexpirationtime' => 'nsslapd-accesslog-logexpirationtime', + 'accesslog-logexpirationtimeunit' => 'nsslapd-accesslog-logexpirationtimeunit', + 'accesslog-maxlogdiskspace' => 'nsslapd-accesslog-logmaxdiskspace', + 'accesslog-minfreediskspace' => 'nsslapd-accesslog-logminfreediskspace', + 'accesslog-logrotationtime' => 'nsslapd-accesslog-logrotationtime', + 'accesslog-logrotationtimeunit' => 'nsslapd-accesslog-logrotationtimeunit', + 'accesslog-maxlogsize' => 'nsslapd-accesslog-maxlogsize', + 'accesslog-maxnumoflogsperdir' => 'nsslapd-accesslog-maxLogsPerDir', + 'auditlog-logexpirationtime' => 'nsslapd-auditlog-logexpirationtime', + 'auditlog-logexpirationtimeunit' => 'nsslapd-auditlog-logexpirationtimeunit', + 'auditlog-maxlogdiskspace' => 'nsslapd-auditlog-logmaxdiskspace', + 'auditlog-minfreediskspace' => 'nsslapd-auditlog-logminfreediskspace', + 'auditlog-logrotationtime' => 'nsslapd-auditlog-logrotationtime', + 'auditlog-logrotationtimeunit' => 'nsslapd-auditlog-logrotationtimeunit', + 'auditlog-maxlogsize' => 'nsslapd-auditlog-maxlogsize', + 'auditlog-maxnumoflogsperdir' => 'nsslapd-auditlog-maxLogsPerDir', + 'certmap-basedn' => 'nsslapd-certmap-basedn', + 'enquote_sup_oc' => 'nsslapd-enquote-sup-oc', + 'loglevel' => 'nsslapd-errorlog-level', + 'errorlog-logexpirationtime' => 'nsslapd-errorlog-logexpirationtime', + 'errorlog-logexpirationtimeunit' => 'nsslapd-errorlog-logexpirationtimeunit', + 'errorlog-maxlogdiskspace' => 'nsslapd-errorlog-logmaxdiskspace', + 'errorlog-minfreediskspace' => 'nsslapd-errorlog-logminfreediskspace', + 'errorlog-logrotationtime' => 'nsslapd-errorlog-logrotationtime', + 'errorlog-logrotationtimeunit' => 'nsslapd-errorlog-logrotationtimeunit', + 'errorlog-maxlogsize' => 'nsslapd-errorlog-maxlogsize', + 'errorlog-maxnumoflogsperdir' => 'nsslapd-errorlog-maxlogsperdir', + 'idletimeout' => 'nsslapd-idletimeout', + 'ioblocktimeout' => 'nsslapd-ioblocktimeout', + 'lastmod' => 'nsslapd-lastmod', + 'listenhost' => 'nsslapd-listenhost', + 'maxdescriptors' => 'nsslapd-maxdescriptors', + 'referral' => 'nsslapd-referral', + 'reservedescriptors' => 'nsslapd-reservedescriptors', + 'rootpwstoragescheme' => 'nsslapd-rootpwstoragescheme', + 'schemacheck' => 'nsslapd-schemacheck', + 'secure-port' => 'nsslapd-securePort', + 'security' => 'nsslapd-security', + 'sizelimit' => 'nsslapd-sizelimit', + 'SSL3ciphers' => 'nsslapd-SSL3ciphers', + 'timelimit' => 'nsslapd-timelimit', + 'pw_change' => 'passwordChange', + 'pw_syntax' => 'passwordCheckSyntax', + 'pw_exp' => 'passwordExp', + 'pw_history' => 'passwordHistory', + 'pw_inhistory' => 'passwordInHistory', + 'pw_lockout' => 'passwordLockout', + 'pw_lockduration' => 'passwordLockoutDuration', + 'pw_maxage' => 'passwordMaxAge', + 'pw_maxfailure' => 'passwordMaxFailure', + 'pw_minage' => 'passwordMinAge', + 'pw_minlength' => 'passwordMinLength', + 'pw_must_change' => 'passwordMustChange', + 'pw_resetfailurecount' => 'passwordResetFailureCount', + 'pw_storagescheme' => 'passwordStorageScheme', + 'pw_unlock' => 'passwordUnlock', + 'pw_warning' => 'passwordWarning' +); + +# the following hash displays global parameters related to database stored under cn=config,cn=ldbm database,cn=plugins,cn=config +%GlobalConfigLDBMparamToMigrate = ( + 'allidsthreshold' => 'nsslapd-allidsthreshold', + 'lookthroughlimit' => 'nsslapd-lookthroughlimit', + 'mode' => 'nsslapd-mode', + 'dbcachesize' => 'nsslapd-dbcachesize' +); + +# the following hash displays specific parameters to each backends and stored under cn=DBname,cn=ldbm database,cn=plugins,cn=config +%LDBMparamToMigrate = ( + 'cachesize' => 'nsslapd-cachesize', + 'readonly' => 'nsslapd-readonly' +); + +%stdIncludes = ( + "${oldConfDir}slapd.at.conf", "\n", + "${oldConfDir}slapd.oc.conf", "\n", + "${oldConfDir}java-object-schema.conf", "\n", + "${oldConfDir}ns-admin-schema.conf", "\n", + "${oldConfDir}ns-calendar-schema.conf", "\n", + "${oldConfDir}ns-certificate-schema.conf", "\n", + "${oldConfDir}ns-common-schema.conf", "\n", + "${oldConfDir}ns-compass-schema.conf", "\n", + "${oldConfDir}ns-delegated-admin-schema.conf", "\n", + "${oldConfDir}ns-directory-schema.conf", "\n", + "${oldConfDir}ns-legacy-schema.conf", "\n", + "${oldConfDir}ns-mail-schema.conf", "\n", + "${oldConfDir}ns-mcd-browser-schema.conf", "\n", + "${oldConfDir}ns-mcd-config-schema.conf", "\n", + "${oldConfDir}ns-mcd-li-schema.conf", "\n", + "${oldConfDir}ns-mcd-mail-schema.conf", "\n", + "${oldConfDir}ns-media-schema.conf", "\n", + "${oldConfDir}ns-mlm-schema.conf", "\n", + "${oldConfDir}ns-msg-schema.conf", "\n", + "${oldConfDir}ns-netshare-schema.conf", "\n", + "${oldConfDir}ns-news-schema.conf", "\n", + "${oldConfDir}ns-proxy-schema.conf", "\n", + "${oldConfDir}ns-value-schema.conf", "\n", + "${oldConfDir}ns-wcal-schema.conf", "\n", + "${oldConfDir}ns-cos-schema.conf", "\n", + "${oldConfDir}ns-web-schema.conf", "\n" +); + +%userDefinedConfigFiles = ( + "slapd.conf", "\n", + "slapd.ldbm.conf", "\n", + "slapd.user_at.conf", "\n", + "slapd.user_oc.conf", "\n", + "ns-schema.conf", "\n" + ); + +$CIS_SYNTAX_OID = "1.3.6.1.4.1.1466.115.121.1.15" ; +$TELEPHONE_SYNTAX_OID = "1.3.6.1.4.1.1466.115.121.1.50" ; +$DN_SYNTAX_OID = "1.3.6.1.4.1.1466.115.121.1.12" ; +$CES_SYNTAX_OID = "1.3.6.1.4.1.1466.115.121.1.26" ; +$INT_SYNTAX_OID = "1.3.6.1.4.1.1466.115.121.1.27" ; +$BIN_SYNTAX_OID = "1.3.6.1.4.1.1466.115.121.1.5" ; + +%allowedPlugins = ( + "cis", $CIS_SYNTAX_OID, + "tel", $TELEPHONE_SYNTAX_OID, + "dn", $DN_SYNTAX_OID, + "ces", $CES_SYNTAX_OID, + "int", $INT_SYNTAX_OID, + "bin", $BIN_SYNTAX_OID + ); + +%allowedModifiers = ( + "single", "SINGLE-VALUE" + ); +# "override" is not supported anymore and "operational" cannot be used in user defined attribute. + +@oldSuffixes = () ; # array of old suffixes (with "o=netscaperoot" if presents) + +# link beetwen the name of the suffix and its associated DBname +%DBNAMES = () ; +%DBDirectory = () ; + +%oldhash = () ; + +# list of standard plugin's in version 4 +%stdPlugins = ( + "7-bit check" => "\n", + "binary syntax" => "\n", + "case exact string syntax" => "\n", + "case ignore string syntax" => "\n", + "distinguished name syntax" => "\n", + "integer syntax" => "\n", + "internationalization plugin" => "\n", + "referential integrity postoperation" => "\n", + "telephone syntax" => "\n", + "uid uniqueness" => "\n" + + ); + +# list of standard indexes configured out of the box in version 4 +%stdIndex = ( + 'aci', "\n", + 'changenumber', "\n", + 'copiedfrom', "\n", + 'dncomp', "\n", + 'entrydn', "\n", + 'numsubordinates', "\n", + 'objectclass', "\n", + 'parentid', "\n" +); + +# list of user added Plugin's. In the new version, they 'll need to be recompiled +@badPlugins = () ; + +%newIndex = () ; + +%User_oc = () ; +# push objectnames as they are encountered in config files. +@User_oc_names = () ; + +%User_at = () ; + + + +#Usage parameters +$USER_OC_FILE_MODIFIED = 0 ; # 0 if user don't want to modify LDIF objectclasses before processing, 1 else +$USER_AT_FILE_MODIFIED = 0 ; +$INDEX_FILE_MODIFIED = 0 ; + +# get the version of the DS to migrate +($oldVersion, $oldMinor) = &getVersion($oldDir, $oldversionstr); +# get the version of the new DS +($Version, $Minor) = &getVersion($root); + +# get old LIB_PATH +$old_libpath = &getLibPath($oldDir, $oldVersion, $oldMinor); +# get new LIB_PATH +$new_libpath = &getLibPath($root, $Version, $Minor); + +# Shutdown the legacy Directory instance +printTrace("\nShutdown the legacy Directory Server instance: ${oldHome}",0); +&stopServer($oldDir, 'slapd-'.$oldname); + +# compare configuration files with the standard ones +CompareStdConfigFiles() ; +die "\n\n The version of the product you want to migrate is not a 4.x Netscape Directory Server\n" unless ($oldVersion == 4) ; + +FillHashParametersName() ; + +############### Connect to the New LDAP Directory Server ###################### +$ENV{"$LIB_PATH"} = $new_libpath; +my $LDAPservername = &getLDAPservername(); +die "\n Migration aborted. Make sure your Old and New Directory Servers are installed on the same machine \n" if ( $LDAPservername == -1 ); +$conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Can't contact the $Version.$Minor LDAP server: $LDAPservername\n"; + +# continue if the connection to new LDAP server is successful ! +printTrace("\nConnected to $Version.$Minor LDAP server\n",0) ; + +# get the uid and gid of the new slapd user +($localuser, $newuid, $newgid) = getuid_gid(); +# get the uid and gid of the old slapd user +($oldlocaluser, $olduid, $oldgid) = getolduid_gid(); + +# backup new configuration files in /slapd-instancename/config +printTrace("\nBackup $serverHome${PATHSEP}config on $serverHome${PATHSEP}config_backup ...",0); +&backupConfigFiles(); + +# Parse the main configuration file: slapd.conf +printTrace("\nParse the configuration file: $oldSlapdConf...",0); +ParseSlapdConf("< ${oldSlapdConf}"); + +#migrate key/cert databases +printTrace("\nMigrate key/cert databases...",0); +&MigrateSSL(); + +# Update parameters : general server parameters, global LDBM parameter, specific backend parameters +printTrace("\nUpdate general server parameters...",0); +$conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Can't contact the $Version.$Minor LDAP server: $LDAPservername\n"; +AddGeneralParameters(); +printTrace("\nUpdate global LDBM parameters...",0); +AddGeneralLDBMParameters(); +printTrace("\nUpdate specific backend parameters...",0); +AddSpecificLDBMParameters(); + +##### FOR TESTING PURPOSE ONLY ######## +# +#testIndexUpdating(); +# +####################################### + +# Migrate some entries contained in the old dse.ldif, and migrate certmap.conf +&MigrateDSE() ; +&MigrateCertmap() ; + +# update new attribute definitions +LDAPmodify_User_at(); + +# update new object classes definitions +LDAPmodify_User_oc(); + +# add new indexes to each backends +LDAPmodify_Indexes(); + +# migrate Plug'ins parameters (enable attribute, and arguments) +LDAPmodify_stdPlugin(); + +################## Close the connection to new LDAP Server ##################### +$conn->close; + + +################## stop the new instance and Export/Import the data, restart the server ################## +if (%DBNAMES) { + &stopServer($root,'slapd-'.$newname); + if ($olddatadir) { + printTrace("\nold data directory $olddatadir...",0) ; + $ldif_rep = "$olddatadir${PATHSEP}"; + } else { + printTrace("\ndata processing...",0) ; + # migrate data for each suffix: old -> LDIF files + &db2ldif($oldSlapdConf); + } + + # migrate LDIF data to the new database: LDIF -> new + &manyLdif2db(); + &startServer(); +} +else { + printTrace("\nThere no old non-standard suffixes to migrate",0); +} + +printMsg("\n\n ****** End of migration ******\n\n"); + +close(LOGFILE); + + +########################################################################################### +# get input users +sub getParameters { + my $exit = 0 ; + my $i = 0; + my $pwdfile= ""; + while ($i <= $#ARGV) { + if ( "$ARGV[$i]" eq "-D" ) { # directory manager + if (! $rootDN) { + $rootDN = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-w") { # password + if (! $rootpwd) { + $rootpwd = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-j") { # password file + if (! $pwdfile) { + $pwdfile = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-o") { # old instance path + if (! $oldHome ) { + $oldHome = $ARGV[++$i] ; + grep { s@\\@/@g } $oldHome if $isNT ; + if ($oldHome =~ /[\"]?(.*)?[\"]?/) { $oldHome = $1 ; } + if ($oldHome =~ m@^(.*)/([^-/]*)-([^/]*)[/]?$@) { + $oldDir = $1 ; + $type = $2 ; + $oldname = $3 ; + if ($isNT) { + $oldDir = lc($oldDir) ; + $type = lc($type) ; + $oldname = lc($oldname) ; + $oldHome = lc($oldHome) ; + grep { s@/@\\@g } $oldDir ; + grep { s@/@\\@g } $oldHome ; + } + } + else { + print("\nThe old instance path is not correct. It must be like slapd-instancename"); + &usage(); + exit(1); + } + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-n") { # new instance path + if (! $serverHome ) { + $serverHome = $ARGV[++$i] ; + grep { s@\\@/@g } $root if $isNT ; + grep { s@\\@/@g } $serverHome if $isNT ; + if ($serverHome =~ /[\"]?(.*)?[\"]?/) { $serverHome = $1 ; } + if ($serverHome =~ m@^(.*?)/?([^/-]*)-([^/]*)[/]?$@) { + $root = $1 if ($1); + $type = $2 ; + $newname = $3 ; + if ($isNT) { + $root = lc($root) ; + $type = lc($type) ; + $newname = lc($newname) ; + $serverHome = lc($serverHome) ; + grep { s@/@\\@g } $root ; + grep { s@/@\\@g } $serverHome ; + } + } + else { + print("\nThe new instance path is not correct. It must be like slapd-instancename"); + &usage(); + exit(1); + } + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-p") { # new DS port + if (! $newport ) { + $newport = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-d") { # old instance LDIF data dir + if (! $olddatadir ) { + $olddatadir = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-v") { # old version + if (! $oldversionstr ) { + $oldversionstr = $ARGV[++$i] ; + } + else { + &usage() ; + exit(1); + } + } elsif ("$ARGV[$i]" eq "-t") { # TRACELEVEL + my $value = $ARGV[++$i] ; + if ($value =~ /[0-3]/) { + $TRACELEVEL = $value ; + } + else { + print("\nThe tracelevel must belong to 0..3 interval"); + &usage(); + exit(); + } + } elsif ("$ARGV[$i]" eq "-noinput") { # no user interventions during processing + $NO_INPUT_USER = 1 ; + } elsif ("$ARGV[$i]" eq "-L") { # migration logfile + $LogFileReport = $ARGV[++$i] ; + } + else { + print("\nThe option $ARGV[$i] is not recognized"); + &usage() ; + exit(1); + } + $i++; + } + if (! $rootDN) { + print("\nThe rootDN is missing"); + $exit = 1; + } + if ($pwdfile ne "") { + # Open file and get the password + unless (open (RPASS, $pwfile)) { + die "Error, cannot open password file $passwdfile\n"; + } + $rootpwd = ; + chomp($rootpwd); + close(RPASS); + } elsif ($rootpwd eq "-"){ + # Read the password from terminal + die "The '-w -' option requires an extension library (Term::ReadKey) which is not\n", + "part of the standard perl distribution. If you want to use it, you must\n", + "download and install the module. You can find it at\n", + "http://www.perl.com/CPAN/CPAN.html\n"; + # Remove the previous line and uncomment the following 6 lines once you have installed Term::ReadKey module. +# use Term::ReadKey; +# print "Bind Password: "; +# ReadMode('noecho'); +# $rootpwd = ReadLine(0); +# chomp($rootpwd); +# ReadMode('normal'); + } + if (! $rootpwd) { + print("\nThe rootpwd is missing"); + $exit = 1 ; + } + if (! $newport) { + print("\nThe port is missing"); + $exit = 1; + } + if (! $serverHome) { + print("\nThe new instance path is missing"); + $exit = 1; + } + if (! $oldHome) { + print("\nThe old instance path is missing"); + $exit = 1; + } + if ((! $LogFileReport) && $serverHome) { + ($sec, $min, $hour, $dd, $mm, $yy) = &GetTime(); + $LogFileReport = "${serverHome}${PATHSEP}logs${PATHSEP}Migration_${dd}${mm}${yy}_${hour}${min}${sec}.log"; + } + + if ($exit) { + &usage() ; + exit(1); + } + +} + + +############################################################################### +# This subroutine is used to parse the slapd.conf configuration file and migrate specific parameters contained in it + + +sub ParseSlapdConf { + my $oldsrc = shift; + my $NumLine = 0 ; + # read the old conf file into a hash table + open( OLDSRC, $oldsrc ) || die "Can't open $oldsrc: $!: "; + LINE: while ( ) { + $NumLine++ ; + printTrace("\nLine: $_",4) ; + if (/^\s*\#/) { # skip comments + printTrace("\n# ",4) ; + next LINE; + } + if (/^\s*$/) { # skip blank lines + printTrace("\nBLANK LINE",4); + next LINE; + } elsif (/^suffix\s+/i) { + chomp($_) ; + CheckSuffix($_); + } elsif (/^plugin/i) { + printTrace("\nPLUGIN",4); + chomp($_); + if (! &isAStandardPlugin($_)) { + push @badPlugins, $_; + } + else { + my $Plugin = $_ ; + if (! &ParsePlugin($_,$NumLine)) { + printMsg("\nLine $NumLine, syntax error of the plugin:\n$Plugin"); + } + } + } elsif (/^include\s+[\"]?(.*?)[\"]?\s*$/i) { + # strip leading and trailing " + my $include_file = $1 ; + grep { s@/@\\@g } $include_file if $isNT; + if (! &isAStandardInclude($include_file)) { + printTrace("\nFILE: $1 NOT STANDARD",4) ; + &ParseConfigurationFile($include_file); + printTrace("\nEXIT ParseConfigurationFile: $include_file",4) ; + } + } elsif (/^userat\s+[\"]?(.*?)[\"]?\s*$/i) { + printTrace("\nuserat: $1",4); + my $at_file = $1 ; + grep { s@/@\\@g } $at_file if $isNT; + # Parse user defined attributes + &ParseAttributesFile($at_file); + } elsif (/^useroc\s+[\"]?(.*?)[\"]?\s*$/i) { + printTrace("\nuseroc: $1",4); + my $oc_file = $1 ; + grep { s@/@\\@g } $oc_file if $isNT; + # Parse user defined object classes + &ParseObjectClassesFile($oc_file); + } elsif (/^dynamicconf\s+[\"]?(.*?)[\"]?\s*$/i){ + printTrace("\ndynamicconf: $1",4); + my $dynamiconf_file = $1 ; + grep { s@/@\\@g } $dynamiconf_file if $isNT; + # Parse dynamic configuration file (e-g slapd.ldbm.conf) + &ParseConfigurationFile($dynamiconf_file); + } elsif (/^\s*(\S+)\s+[\"]?(.*?)[\"]?\s*$/) { + printTrace("\nParseParameters: $1",4); + # Parse parameters and record the associated value in %oldhash + &ParseParameters($1,$2,$NumLine); + } else { + printTrace("\nUnknown format of configuration data: $_",0); } + } + close(OLDSRC); + + } + + + +############################################################################# +# return 1 if the suffix already exists, 0 else +sub existSuffix { + my $suffixname = shift ; + my $nsuffix = normalizeDN($suffixname); + my $entry = $conn->search("cn=mapping tree,cn=config", "one", "(|(cn=\"$suffixname\")(cn=\"$nsuffix\"))"); + return 1 if ($entry) ; + my $cpt = 5; + my $errorCode = $conn->getErrorCode(); + while (($errorCode eq $LDAP_SERVER_UNREACHABLE) && $cpt && (! $entry)) { + printTrace("\ntry to reconnect to search cn=\"$suffixname\",cn=mapping tree,cn=config", 1); + $conn = new Mozilla::LDAP::Conn($LDAPservername,$newport,$rootDN,$rootpwd) or die "\n Unable to contact the $Version.$Minor LDAP server: $LDAPservername\n"; + $entry = $conn->search("cn=mapping tree,cn=config", "one", "(|(cn=\"$suffixname\")(cn=\"$nsuffix\"))"); + $errorCode = $conn->getErrorCode(); + $cpt--; + } + return 1 if ($entry) ; + return 0 ; +} + +# return the name of the backend if it has been successfully created, 0 else +sub createBackend { + my $suffixname = shift ; + my $backend = "MigratedDB_0" ; + my $NbRetry = 1 ; + my $entry = $conn->search("cn=$backend,cn=ldbm database,cn=plugins,cn=config ", "base","objectclass=*") ; + while ($entry) { + # try to find another name for the backend + $backend = "MigratedDB_$NbRetry" ; + $entry = $conn->search("cn=$backend,cn=ldbm database,cn=plugins,cn=config ", "base","objectclass=*") ; + $NbRetry++; + } + # normally I should have a unique name for the backend + my $suffixarg = "nsslapd-suffix" ; + $entry = $conn->newEntry() ; + $entry->setDN("cn=$backend,cn=ldbm database,cn=plugins,cn=config"); + $entry->setValues("objectclass", "top", "extensibleObject", "nsBackendInstance" ); + $entry->setValues("cn", $backend ); + $entry->setValues($suffixarg, $suffixname ); + my $res = $conn->add($entry) ; + if ($res) { + return $backend ; + } + else { + return 0 ; + } +} + +# return 1, if add the new entry in the mapping tree, else 0 +sub AddEntryInMappingTree { + my $backend = shift ; + my $entry = $conn->search("cn=$backend,cn=ldbm database,cn=plugins,cn=config ", "base","objectclass=*") ; + if ($entry) { + printTrace("\nAddEntry in progress ...",4) ; + my $suffixarg = "nsslapd-suffix" ; + my $statearg = "nsslapd-state" ; + my $backendarg= "nsslapd-backend"; + my $suffixname = $entry->{$suffixarg}[0]; + $entry = $conn->newEntry() ; + $entry->setDN("cn=\"$suffixname\",cn=mapping tree,cn=config") ; + $entry->setValues("objectclass", "top", "extensibleObject", "nsMappingTree" ); + $entry->setValues("cn", "\"$suffixname\""); + $entry->setValues($statearg, "backend"); + $entry->setValues($backendarg, $backend); + return $conn->add($entry); + } + else { + printTrace("\nNo AddEntry processed for $backend",4); + return 0 ; + } +} + + +# Treat the case where the suffix is "o=NetscapeRoot" +sub CheckSuffix { + my $suffix = shift ; + my $suffixname ; + my $expLdif; + my $confirm = "No"; + my $dest = "$serverHome${PATHSEP}db_backup" ; + my $newSlapdExecDir = "$root${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server"; + + if (!(/^suffix\s+\"?(.*?)\"?\s*$/i)) { + printMsg("Syntax error of the suffix: $suffix"); + return 0 ; + } + else { + $suffixname = $1 ; + } + if (/^suffix\s+\"?\s*o=netscaperoot\s*\"?\s*$/i) { + printTrace("\nFor the suffix o=NetscapeRoot, we do nothing",1); + # treat the case where the suffix is "o=NetscapeRoot" + } + else { + push @oldSuffixes, $_; + # check if the suffix already exists in the new DS target + if (! existSuffix($suffixname)) { + printTrace("\n\nSuffix $suffixname doesn't exist",1) ; + # create a new backend with the name of the suffix preceded by MigratedDB_ + my $backend = createBackend($suffixname) ; + if ($backend) { + printTrace("\nBackend: $backend has been created !!!",1); + # if the creation of the backend is ok, we add a new entry in the mapping tree + if (AddEntryInMappingTree($backend)) { + # We add the association dbname->suffix in the hash %DBNAMES + $DBNAMES{$suffixname} = $backend ; + # get the db filename + $entry = $conn->search("cn=$backend,cn=ldbm database,cn=plugins,cn=config ", "base","objectclass=*") ; + my $dirarg = "nsslapd-directory"; + $DBDirectory{$backend} = $entry->{$dirarg}[0]; + printTrace("\nThe relation $backend->$suffixname has been added to the mapping tree",2); + } + else { + printMsg("\nCOULD NOT ADD ENTRY: $backend->$suffixname IN MAPPINGTREE"); + } + } + else { + printMsg("\nCOULD NOT CREATE BACKEND: $backend"); + } + } + else { + printMsg("\n\nSuffix: $suffixname already exists"); + # the suffix already exists in the new DS + printMsg("\nMigration will overwrite existing database"); + printMsg("\nDo you want to continue Yes/No [No] ?") ; + my $answer = ; + if ($answer =~ /y|yes/i) { + my $nsuffix = normalizeDN($suffixname); + my $my_entry = $conn->search("cn=mapping tree,cn=config", "one", "(|(cn=\"$suffixname\")(cn=\"$nsuffix\"))"); + my $backend = $my_entry->{"nsslapd-backend"}[0]; + my $backend_entry = $conn->search("cn=$backend,cn=ldbm database,cn=plugins,cn=config ", "base","objectclass=*") ; + printMsg("Do you want to export the existing data Yes/No [Yes] ?"); + my $answer = ; + if (!($answer =~ /n|no/i)) { + mkdir $dest, 0700 unless (-d $dest); + $expLdif = "$dest${PATHSEP}$backend.ldif"; + while (!($confirm =~ /y|yes/i)) { + printMsg("\nEnter the full pathname of the file [$expLdif]:") ; + $answer = ; + chomp($expLdif = $answer) unless ($answer eq "\n"); + printMsg("\nExisting data will be exported under $expLdif"); + printMsg("\nContinue Yes/No [No] ?"); + $confirm = ; + } + $ENV{"$LIB_PATH"}=$new_libpath; + chdir($newSlapdExecDir) or die "\nCould not change directory to $newSlapdExecDir: $!\n"; + printTrace("\nNow backing up database $CN in $expLdif\n",0); + &stopServer($root,'slapd-'.$newname); + &newinst_db2ldif($expLdif, $suffixname, $serverHome); + &startServer(); + } + # We add the association dbname->suffix in the hash %DBNAMES + $DBNAMES{$suffixname} = $backend ; + my $dirarg = "nsslapd-directory"; + $DBDirectory{$backend} = $backend_entry->{$dirarg}[0]; + printTrace("\nThe relation $backend->$suffixname has been added to the mapping tree",2); + } + } + return 1 ; +} +} + +############################################################################# +# Usefull to know the standard configuration +sub isAStandardPlugin { + my $line = shift; + chomp($line); + printTrace("\nStdPlugin?: $line",4); + if ($line =~ /^plugin\s+(database|extendop|preoperation|postoperation|matchingrule|syntax)\s+(on|off)\s+\"(.*?)\"\s+\"(.*?)\"\s+(\S+)(.*)$/i) { + # $1 = , $2 = , $3 = , $4 = , $5 = , $6 = []* + printTrace("\nName: $3, pathname: $4, init_function: $5",4); + + my $LC_line = lc($3); + my $Value = $stdPlugins{$LC_line} ; + if ($Value) { + printTrace("\nIS A STANDARD PLUGIN",4); + } + else { + printTrace("\nNOT A STANDARD PLUGIN",4); + } + return $stdPlugins{$LC_line} ; + } + else { + printTrace("\nSYNTAX ERROR PLUGIN",4); + return 0 ; + } +} + +sub isAStandardIndex { + my $line = shift ; + chomp($line); + if ($line =~ /^index\s+(\S+).*/i) { + my $LC_line = lc($1); + my $Value = $stdIndex{$LC_line} ; + printTrace("\nInclude: $LC_line \nValue: $Value", 4); + return $stdIndex{$LC_line}; + } + else { + return 0 ; + } +} + + +sub isAStandardInclude { + my $line = shift; + + chomp($line); + if ($isNT){ + return $stdIncludes{lc($line)}; + } + else { + return $stdIncludes{$line} ; + } +} + +############################################################################# +# +# Execute a Perldap command to update plugins definition in the new schema + +sub LDAPmodify_stdPlugin { + my $Filename = shift ; + my @pluginames = keys(%stdPlugins); + if (! $STDPLUGINS_FILE_MODIFIED) { + printTrace("\nLDAPmodify_plugin",4); + printTrace("\nMigrate plugin's...",1); + foreach $pluginame ( @pluginames ) { + my $update_plugin = 0 ; + my $ref_plugin = $stdPlugins{$pluginame}; + if ($ref_plugin ne "\n") { + my $name = $ref_plugin->name ; + # We have a name change of "uid uniqueness plugin" in DS7.0 + # to "attribute uniqueness" + $name = "attribute uniqueness" if ($name eq "uid uniqueness"); + my $entry = $conn->search("cn=$name,cn=plugins,cn=config", "base","objectclass=nsSlapdPlugin") ; + if ($entry) { + my $pluginenabled="nsslapd-pluginenabled" ; + if (($entry->{$pluginenabled}[0]) ne $ref_plugin->enable) { + $update_plugin = 1 ; + my $enable = $ref_plugin->enable ; + printTrace("\n$pluginame, plugin-enable: $enable",3) ; + $entry->setValues($pluginenabled, $enable ); + } + my $ArgNum = 0 ; + foreach $ArgValue (@{$ref_plugin->args}) { + my $Arg="nsslapd-pluginarg$ArgNum"; + printTrace("\n$Arg: $ArgValue",3) ; + if ($entry->{$Arg}[0] ne $ArgValue) { + printTrace("\n$pluginame, $Arg: $ArgValue",3) ; + $update_plugin = 1 ; + $entry->setValues($Arg, $ArgValue) ; + } + $ArgNum++ ; + } + if ($update_plugin) { + printTrace("\n$pluginame is being updated...",2); + my $res = $conn->update($entry) ; + if ($res) { + printTrace("\nupdated !",2); + } + else { + printMsg("\nError during update of plugin: $pluginame") ; + $MigrationErrors .= "\nError during update of plugin: $pluginame"; + } + } + else { + printTrace("\n$pluginame has not changed",4); + } + } + else { + printMsg("\ncan't access the plugin: cn=$name,cn=plugins,cn=config"); + } + } + else { + printTrace("\nPLUGIN NOT RECORDED: $pluginame",4) ; + } + } + } + else { + # treat the case where the user wants to look at these plugins before processing + } +} + +############################################################################# +# Execute Perldap command to add new indexes to the migrated instances + +sub LDAPmodify_Indexes { + my $Filename = shift ; + my @indexnames = keys(%newIndex); + my @suffixnames = keys(%DBNAMES); + if ((! $INDEX_FILE_MODIFIED) && (%DBNAMES)) { + # we update indexes only if there is at least one backend to migrate + printTrace("\nLDAPmodify_indexes",4); + printTrace("\nMigrate indexes...",1); + foreach $indexname ( @indexnames ) { + printTrace("\nIndexName: $indexname",4); + printTrace("\nIndexTypes: .@{$newIndex{$indexname}->types}.", 4) ; + printTrace("\nIndexOIDS: .@{$newIndex{$indexname}->oids}.", 4) ; + foreach $suffixname ( @suffixnames ) { + # check if the index already exists ! + printTrace("\nsearch for cn=$indexname,cn=index,cn=$DBNAMES{$suffixname},cn=ldbm database,cn=plugins,cn=config...", 3); + my $entry = $conn->search("cn=$indexname,cn=index,cn=$DBNAMES{$suffixname},cn=ldbm database,cn=plugins,cn=config","base","objectclass=nsIndex"); + if (! $entry) { + # create a new index + printTrace("index $indexname is being created under cn=index,cn=$DBNAMES{$suffixname},cn=ldbm database,cn=plugins,cn=config...",2); + my $entry = $conn->newEntry(); + $entry->setDN("cn=$indexname,cn=index,cn=$DBNAMES{$suffixname},cn=ldbm database,cn=plugins,cn=config"); + $entry->setValues("objectclass", "top", "nsIndex" ) ; + $entry->setValues("cn", $indexname) ; + $entry->setValues("nssystemindex", "false") ; + my @types = @{$newIndex{$indexname}->types} ; + my @oids = @{$newIndex{$indexname}->oids} ; + $entry->setValues("nsindextype", @types) if (@types) ; + $entry->setValues("nsmatchingrule", @oids ) if (@oids); + my $res = $conn->add($entry) ; + if ($res) { + printTrace("\nAdd index successfully: $indexname for backend: $DBNAMES{$suffixname}",2); + } + else { + printMsg("\n Failed to add the index: $indexname to backend: $DBNAMES{$suffixname}"); + $MigrationErrors .= "\n Failed to add the index: $indexname to backend: $DBNAMES{$suffixname}" ; + } + } + elsif ($entry->{nssystemindex}[0] eq "false") { + # if the index is not a system index, we update it + printTrace("\nindex $indexname is being processed under cn=index,cn=$DBNAMES{$suffixname},cn=ldbm database,cn=plugins,cn=config...",2); + my @types = @{$newIndex{$indexname}->types} ; printTrace("\ntypes: .@types.",2) ; + my @oids = @{$newIndex{$indexname}->oids} ; printTrace("\noids: .@oids.",2) ; + my @existing_types = $entry->getValues("nsindextype"); + my @existing_oids = $entry->getValues("nsmatchingrule"); + # get the elements present in @types and not present in @existing_types + my @typesToAdd = &getDiff(\@types, \@existing_types); + # same for matchingrules + my @oidsToAdd = &getDiff(\@oids, \@existing_oids); + foreach $newtype (@typesToAdd) { + $entry->addValue("nsindextype", $newtype); printTrace("\nnewtype: $newtype",2); + } + foreach $newoid (@oidsToAdd) { + $entry->addValue("nsmatchingrule", $newoid); + } + if (@typesToAdd || @oidsToAdd) { + my $res = $conn->update($entry) ; + if ($res) { + printTrace("\nUpdate index successfully: $indexname for backend: $DBNAMES{$suffixname}",2); + } + else { + printMsg("\n Failed to update the index: $indexname to backend: $DBNAMES{$suffixname}"); + $MigrationErrors .= "\n Failed to update the index: $indexname to backend: $DBNAMES{$suffixname}" ; + } + } + else { + printTrace("\nNothing to update",2); + } + } + else { + printTrace("\nThe index: $indexname is a system index. It can't be updated",2); + } + } + } + + } + else { + # treat the case where the user wants to look at these indexes before processing + } + +} + +############################################################################# +# +# Execute a Perldap command to add all user defined object classes in the new schema + +sub LDAPmodify_User_oc { + my $Filename = shift ; + if (! $USER_OC_FILE_MODIFIED) { + printTrace("\nLDAPmodify_User_oc",4); + printTrace("\nMigrate objectclasses...",1); + foreach $objectname ( @User_oc_names ) { + my $entry = $conn->search("cn=schema", "base","objectclass=*") ; + die "\ncan't connect to object: cn=schema\n" unless ($entry); + printTrace("\nObjectName: $objectname\nValue: $User_oc{$objectname}",3); + next if ($entry->hasValue("objectclasses",$User_oc{$objectname},1)) ; + $entry->addValue("objectclasses",$User_oc{$objectname},"1") ; + my $res = $conn->update($entry) ; + my $err = $conn->getErrorCode(); + if ($res) { + printTrace("\nobjectclass: $User_oc{$objectname} added",2); + } elsif ($err == 20) { # already exists + printTrace("\nobjectclass: $User_oc{$objectname} already exists",1); + } else { + printMsg("\nCan\'t add objectclass to the schema: $User_oc{$objectname}"); + my $msg = $conn->getErrorString(); + printMsg("\nMsg: $msg"); + $MigrationErrors .= "\nCan\'t add objectclass to the schema: $User_oc{$objectname}" ; + } + } + } + else { + # treat the case where the user wants to look at these objectclasses before processing + } +} + +############################################################################# +# +# Execute a Perldap command to add all user defined attributes in the new schema + +sub LDAPmodify_User_at { + my $Filename = shift ; + my @attributenames = keys(%User_at); + if (! $USER_AT_FILE_MODIFIED) { + + printTrace("\nLDAPmodify_User_at",4); + printTrace("\nMigrate attributes...",1); + foreach $attributename ( @attributenames ) { + my $entry = $conn->search("cn=schema", "base","objectclass=*") ; + printTrace("\nAtributeName: $attributename, Value: $User_at{$attributename}",3); + die "\nentry not found cn=schema\n" unless $entry ; + next if ($entry->hasValue("attributetypes",$User_at{$attributename},1) ) ; + my $res = $entry->addValue("attributetypes",$User_at{$attributename},"1") ; + if (! $res) { + printMsg("\nCan\'t add attribute to the schema: $User_at{$attributename}"); + $MigrationErrors .= "\nCan\'t add attribute to the schema: $User_at{$attributename}" ; + } + my $res = $conn->update($entry) ; + my $err = $conn->getErrorCode(); + if ($res) { + printTrace("\nattribute: $attributename added",2); + } elsif ($err == 20) { # already exists + printTrace("\nattribute: $attributename already exists",1); + } + else { + printMsg("\nCan\'t add attribute to the schema: $User_at{$attributename}"); + my $msg = $conn->getErrorString(); + printMsg("\nMsg: $msg"); + $MigrationErrors .= "\nCan\'t add attribute to the schema: $User_at{$attributename}" ; + } + } + } + else { + # treat the case where the user wants to look at these attributes before processing + } +} + +############################################################################# +# Add an object class to the user_oc hash and reset the object !!! +sub AddObjectClass { + my $ObjectClass = shift ; + my $ObjectName = $ObjectClass->{'ObjectName'} ; + my $Object_oid = $ObjectClass->{'Object_oid'} ; + my $Object_superior = $ObjectClass->{'Object_superior'} ; + my $Object_requires = $ObjectClass->{'Object_requires'} ; + my $Object_allows = $ObjectClass->{'Object_allows'} ; + my $ObjectClassDef = "( $Object_oid NAME \'$ObjectName\' DESC \'\' SUP $Object_superior STRUCTURAL MUST ($Object_requires) MAY ($Object_allows) X-ORIGIN \'user defined\' )"; + if ( (!($ObjectName =~ /^top$/i)) && ( ! $User_oc{$ObjectName} )) { + $User_oc{$ObjectName} = $ObjectClassDef ; + push @User_oc_names, $ObjectName ; + printTrace("ObjectName: $ObjectName \nObject_oid: $Object_oid \nObject_superior:$Object_superior \nObject_requires: $Object_requires \nObject_allows: $Object_allows \nObjectClassDefinition: $User_oc{$ObjectName}\n",4); + } + elsif ( ($User_oc{$ObjectName}) && ($User_oc{$ObjectName} ne $ObjectClassDef) ) { + printMsg("\nAttempt to redifine the objectclass: $ObjectName previously defined in your configuration file. Operation not allowed "); + } + else { + printMsg("\nAttempt to redifine the objectclass: top. Operation not allowed"); + } + resetObjectClass($ObjectClass); +} + +############################################################################# +# Build an LDIF attribute and add it to the user_at hash +sub AddAttribute { + my $Attr = shift ; + my $AttributeName = $Attr->{'AttributeName'}; + my $Attribute_oid = $Attr->{'Attribute_oid'}; + my $Attribute_aliases = $Attr->{'Attribute_aliases'}; + my $Attribute_syntax = $Attr->{'Attribute_syntax'}; + my $Attribute_single = $Attr->{'Attribute_single'}; + my $AttributeDef = "( $Attribute_oid NAME ( \'$AttributeName\' $Attribute_aliases) DESC \'User Defined Attribute\' SYNTAX $Attribute_syntax $Attribute_single X-ORIGIN 'user defined' )" ; + printTrace("\nAttributeDef: $AttributeDef",4); + $User_at{$AttributeName} = $AttributeDef ; +} +############################################################################# +# add the index structure to the newIndex hash +sub AddIndex { + my $ref_index = shift ; + my $state = shift ; + printTrace("\nAddIndex, last state: $state",4) ; + if ($state == 1) { + $ref_index->specific("ALL") ; + return 1 ; + } + elsif ($state == 6) { + $ref_index->specific("NONE") ; + return 1 ; + } + if (($state == 1) || ($state == 3) || ($state == 5) || ($state == 6)) { + foreach $name (@{$ref_index->names}) { + $newIndex{$name} = $ref_index ; # record the ref to the index struct in the newIndex hash + } + return 1 ; + } + else { + return 0 ; + } +} + +############################################################################# +# add the plugin structure to the stdPlugin hash + +sub AddPlugin { + my $ref_plugin = shift ; + printTrace("\nAddPlugin",4) ; + $stdPlugins{lc($ref_plugin->name)} = $ref_plugin ; + my $name = $ref_plugin->name ; + my $type = $ref_plugin->type ; + my $enable = $ref_plugin->enable ; + + printTrace("\nPluginName: $name",4); + printTrace("\nPluginType: $type",4); + printTrace("\nPluginEnable: $enable",4); + printTrace("\nPluginArgs: @{$ref_plugin->args}",4); + return 1 ; +} + + +############################################################################# +# parse a plugin definition and call the addindex + +sub ParsePlugin { + my $Plugin = shift ; + my $NumLine = shift ; + my $state = 0 ; + my $ErrorMsg = "Syntax error of a plugin definition. \n line parsed:"; + my $ref_plugin = S_plugin->new(); + printTrace("\nParsePlugin: $_",4); + if (/^plugin\s+(database|extendop|preoperation|postoperation|matchingrule|syntax)\s+(on|off)\s+\"(.*?)\"\s+\"(.*?)\"\s+(\S+)(.*)$/i) { + # $1 = , $2 = , $3 = , $4 = , $5 = , $6 = []* + $ref_plugin->name($3); + $ref_plugin->type($1); + $ref_plugin->enable($2); + $_ = $6 ; + my $ArgNb = 0 ; + my $prec ; + my $arg ; + my $Unix_oldDir = $oldDir ; + my $Unix_root = $root ; + grep { s@\\@/@g } $Unix_oldDir if $isNT; + grep { s@\\@/@g } $Unix_root if $isNT; + while (!(/^\s*$/)) { + if (/^\s*\".*?\"/) { + s/^\s*\"(.*?)\"(.*)/$2/i ; + $arg = $1 ; + } + elsif (/^\s*[^\"\s]+/) { + s/^\s*([^\"\s]+)(.*)/$2/i ; + $arg = $1 ; + } + $prec = $_ ; + $_ = $arg ; + + s@$Unix_oldDir@$Unix_root@ig ; + s/$type-$oldname/$type-$newname/ig ; + @{$ref_plugin->args}[$ArgNb++] = $_ ; + $_ = $prec ; + } + if (/^\s*$/) { + return AddPlugin($ref_plugin); + } + else { + return 0 ; + } + } + return 0 ; +} + +############################################################################# +# parse an index definition and call the addindex + +sub ParseIndex { + my $index = shift ; + my $NumLine = shift ; + my $ref_index = S_index->new() ; + my $Value ; + my $state = 0 ; + my $ErrorMsg = "Syntax error of an index definition.\nline parsed:"; + printTrace("\nParseIndex: $_",4) ; + s/,/, /g ; + s/\s+,/,/g ; + s/^index\s+//i ; # substitute the token index + while (!(/^\s*$/)) { + s/^\s*(\S+)(.*)$/$2/ ; + $Value = $1 ; + printTrace("\nValue: $Value",4); + printTrace("\nState: $state",4) ; + SWITCH: { + if ($state == 0) { + if ($Value =~ /[^\.]/) { + if ($Value =~ /(\S+),$/) { + push @{$ref_index->names}, $1 ; + } + else { + $state = 1 ; + push @{$ref_index->names}, $Value ; + } + } + else { + return 0 ; + } + last SWITCH ; + } + if ($state == 1) { + if ($Value =~ /^none$/i) { + $state = 6 ; # end of the index definition + } + elsif ($Value =~ /^\"\"$/) { + $state = 4 ; # we expect to have at least one OID + } + elsif ($Value =~ /(\S+),$/) { + $state = 2 ; + push @{$ref_index->types}, $1 ; + } + else { + $state = 3 ; + push @{$ref_index->types}, $Value ; + } + last SWITCH ; + } + if ($state == 2) { + if ($Value =~ /(\S+),$/) { + push @{$ref_index->types}, $1 ; + } + else { + $state = 3 ; + push @{$ref_index->types}, $Value ; + } + last SWITCH ; + } + if ($state == 3) { + if ($Value =~ /(\S+),$/) { + $state = 4 ; + push @{$ref_index->oids}, $1 ; + } + else { + $state = 5 ; + push @{$ref_index->oids}, $Value ; + } + last SWITCH ; + } + if ($state == 4) { + if ($Value =~ /(\S+),$/) { + push @{$ref_index->oids}, $1 ; + } + else { + $state = 5 ; + push @{$ref_index->oids}, $Value ; + } + last SWITCH ; + } + } + } +return AddIndex($ref_index,$state) ; + +} + +############################################################################# + +sub ParseAttribute { + + + my $Attr = shift ; + my $NumLine = shift ; + my $state = 1 ; + my $ErrorMsg = "Syntax error of an attribute definition.\nline parsed:"; + my %Attribute = ( + 'AttributeName' => "", + 'Attribute_oid' => "", + 'Attribute_aliases' => "", + 'Attribute_syntax' => "", + 'Attribute_single' => "" + ); + my $AttributeName = " "; + printTrace("\nParseAttribute",4); + while (!(/^\s*$/)) { + s/^(.*?)(\S+)\s*$/$1/ ; + printTrace("\nValue: $2",4); + printTrace("\nState: $state",4) ; + my $Value = $2 ; + SWITCH: { + if ($state == 1) { + if (isAllowedModifier($Value)) { + $state = 1 ; + $modifier = lc($Value); + $AttrVar = 'Attribute_' . $modifier ; + $Attribute{$AttrVar} = &getModifierValue($Value) ; + } + elsif (&isAllowedPlugin($Value)) { + $state = 2 ; + $Attribute{'Attribute_syntax'} = &getSyntaxOid($Value) ; + } + else { + return 0 ; + } + last SWITCH ; + } + if ($state == 2) { + if ($Value =~ /[\.]|-oid$/) { + $Attribute{'Attribute_oid'} = "$Value" ; + printTrace("\nAttribute-oid: $Attribute{'Attribute_oid'}",3); + $state = 3 ; + } + elsif ($Value =~ /[^\.]/) { + $AttributeName = $Attribute{'AttributeName'} ; + if ($AttributeName) { $Attribute{'Attribute_aliases'} .= "\'$AttributeName\' " ;} + $Attribute{'AttributeName'} = $Value ; + $state = 4 ; + } + else { + return 0 ; + } + last SWITCH ; + } + if ($state == 3) { + if ($Value =~ /[^\.]/) { + $AttributeName = $Attribute{'AttributeName'} ; + if ($AttributeName) { $Attribute{'Attribute_aliases'} .= "\'$AttributeName\' " ;} + $Attribute{'AttributeName'} = $Value ; + $state = 4 ; } + else { + return 0 ; + } + last SWITCH ; + } + if ($state == 4) { + if ($Value =~/^attribute$/i){ + $state = 5; + } + elsif ($Value =~/[^\.]/i) { + $AttributeName = $Attribute{'AttributeName'} ; + if ($AttributeName) { $Attribute{'Attribute_aliases'} .= "\'$AttributeName\' " ;} + $Attribute{'AttributeName'} = $Value ; + } + else { + return 0 ; + } + last SWITCH ; + } + if ($state == 5) { + return 0 ; + last SWITCH ; + } + } + } + $Attribute{'Attribute_oid'} = $Attribute{'AttributeName'} . '-oid' unless ($Attribute{'Attribute_oid'}) ; + return AddAttribute(\%Attribute) ; +} + + +############################################################################# +# fill in the hash HashParametersName + +sub FillHashParametersName { + my @paramnames = ( keys(%GeneralSrvParamToMigrate), keys(%GlobalConfigLDBMparamToMigrate), keys(%LDBMparamToMigrate)); + foreach $param (@paramnames) { + $HashParametersName{$param} = '\n'; + } +} + + +# Parse parameters +sub ParseParameters { + my $param = shift ; + my $value = shift ; + my $NumLine = shift ; + my $ErrorMsg = "parameter unknown, or not to be migrated: "; + if ($HashParametersName{lc($param)} && ($value !~ /^\s*$/)) { + $HashParametersName{lc($param)} = $value ; + printTrace("\nParam: $param is present",4); + } + else { + printTrace("\n$NumLine, $ErrorMsg,$param",4); + } + +} + +# add general server parameters +sub AddGeneralParameters { + my @paramnames = keys(%GeneralSrvParamToMigrate); + my $entry = $conn->search("cn=config","base","objectclass=*"); + die "\ncan't access to object: cn=config. \nMigration stopped\n" unless ($entry); + printTrace("\nAddGeneralParameters",4); + foreach $param (@paramnames) { + my $LDAPparam = $GeneralSrvParamToMigrate{$param} ; + my $Value = $HashParametersName{$param} ; + if (($Value ne '\n') && ($entry->{$LDAPparam}[0] ne $Value)) { + printTrace("\nLDAPparam: $LDAPparam, Value: $Value",4); + $entry->setValues($LDAPparam, $Value); + my $res = $conn->update($entry); + if ($res) { + printTrace("\nUpdate successfully $LDAPparam ",0); + } + else { + printMsg("\nCan't update parameter: $LDAPparam"); + } + } + } +} + + +# add general LDBM parameters +sub AddGeneralLDBMParameters { + my @paramnames = keys(%GlobalConfigLDBMparamToMigrate); + my $entry = $conn->search("cn=config,cn=ldbm database,cn=plugins,cn=config","base","objectclass=*"); + die "\ncan't access to object: cn=config,cn=ldbm database,cn=plugins,cn=config. \nMigration stopped\n" unless ($entry); + printTrace("\nAddGeneralLDBMParameters",4); + foreach $param (@paramnames) { + my $LDAPparam = $GlobalConfigLDBMparamToMigrate{$param} ; + my $Value = $HashParametersName{$param} ; + if (($Value ne '\n') && ($entry->{$LDAPparam}[0] ne $Value)) { + printTrace("\nLDAPparam: $LDAPparam, Value: $Value",4); + $entry->setValues($LDAPparam, $Value); + my $res = $conn->update($entry); + if ($res) { + printTrace("\nUpdate successfully $LDAPparam ",0); + } + else { + printMsg("\nCan't update parameter: $LDAPparam"); + } + } + } +} + +# add specific LDBM parameters +sub AddSpecificLDBMParameters { + my @paramnames = keys(%LDBMparamToMigrate); + my %REV_DBNAMES = reverse %DBNAMES ; + my @dbnames = keys(%REV_DBNAMES); + printTrace("\nAddSpecificLDBMParameters",4); + foreach $dbname (@dbnames) { + my $entry = $conn->search("cn=$dbname,cn=ldbm database,cn=plugins,cn=config","base","objectclass=*"); + die "\ncan't access to object: cn=$dbname,cn=ldbm database,cn=plugins,cn=config. \nMigration stopped\n" unless ($entry); + foreach $param (@paramnames) { + my $LDAPparam = $LDBMparamToMigrate{$param} ; + my $Value = $HashParametersName{$param} ; + if (($Value ne '\n') && ($entry->{$LDAPparam}[0] ne $Value)) { + printTrace("\nLDAPparam: $LDAPparam, Value: $Value",4); + $entry->setValues($LDAPparam, $Value); + my $res = $conn->update($entry); + if ($res) { + printTrace("\nUpdate successfully $LDAPparam",2); + } + else { + printMsg("\nCan't update parameter: $LDAPparam"); + } + } + } + } +} + +############################################################################# +# Parse a configuration file potentialy tuned by the user (different from slapd.user_oc.conf and slapd.user_at.conf) + +sub ParseConfigurationFile { + + my $FileToParse = shift; + my $NumLine = 0; + my $PARSE_OBJECTCLASSES = 0 ; # 1 if there are objectclass definitions in the file + printTrace("\nParseConfigurationFile: $FileToParse",4) ; + printTrace("\nParse $FileToParse",2); + # read each line of the configuration file + my $CONFIGFILE = "CONFIGFILE.$FileToParse" ; + open( $CONFIGFILE, $FileToParse ) || die "Can't open $FileToParsec: $!: "; + LINE: while ( <$CONFIGFILE> ) { + $NumLine++ ; + if (/^\s*\#/) { # skip comments + next LINE; + } + if (/^\s*$/) { # skip blank lines + next LINE; + } elsif (/^suffix\s+/i) { + chomp($_) ; + CheckSuffix($_) ; + } elsif (/^plugin/i) { + chomp($_); + if (! &isAStandardPlugin($_)) { + push @badPlugins, $_; + } + else { + my $Plugin = $_ ; + if (! &ParsePlugin($_,$NumLine)) { + printMsg("\nLine $NumLine, syntax error of the plugin:\n$Plugin"); + } + } + } elsif (/^index/i) { + chomp($_); + if (! &isAStandardIndex($_)) { + my $Index = $_ ; + if (! &ParseIndex($_,$NumLine)) { + printMsg("\nLine $NumLine, syntax error of index:\n$Index"); + } + } + } elsif (/^include\s+[\"]?(.*?)[\"]?\s*$/i) { + # strip leading and trailing " + my $include_file = $1 ; + grep { s@/@\\@g } $include_file if $isNT; + if (! &isAStandardInclude($include_file)) { + &ParseConfigurationFile($include_file); + } + } elsif (/^attribute\s+\S+/i) { + chomp($_); + my $Attrib = $_ ; + if (! &ParseAttribute($_,$NumLine)) { + printMsg("\nLine $NumLine, syntax error of attribute:\n$Attrib"); + } + } elsif (/^objectclass\s+(\S+)\s*$/i) { + # At least one objectclass is present in the file + $PARSE_OBJECTCLASSES = 1; + } elsif (/^\s*(\S+)\s+[\"]?(.*?)[\"]?\s*$/) { + # Parse parameters and record the associated value in %Oldhash + &ParseParameters($1,$2,$NumLine); + } + } + close($CONFIGFILE); + ParseObjectClassesFile($FileToParse) if ($PARSE_OBJECTCLASSES); # parse objectclass definition + +} + +############################################################################# +# Parse the file specified in the userat attribute + +sub ParseAttributesFile { + my $userat_file=shift ; + my $NumLine = 0; + printTrace("\nParseAttributesFile: $userat_file",4); + printTrace("\nParse user defined attributes file: $userat_file",2); + # read each line of the configuration file + open( ATTRFILE, $userat_file ) || die "Can't open $FileToParsec: $!: "; + LINE: while ( ) { + $NumLine++ ; + if (/^\s*\#/) { # skip comments + next LINE; + } + if (/^\s*$/) { # skip blank lines + next LINE; + } elsif (/^attribute\s+\S+/i) { + chomp($_); + my $Attrib = $_ ; + if (! &ParseAttribute($_, $NumLine)) { + printMsg("\nLine $NumLine, syntax error of attribute:\n$Attrib"); + } + } + } + close(ATTRFILE); +} + +############################################################################# +# Parse the file specified in the useroc token + +sub ParseObjectClassesFile { + my $useroc_file = shift ; + my %ObjectClass = ( + 'ObjectName' => " ", + 'Object_oid' => " ", + 'Object_superior' => "top", + 'Object_requires' => " ", + 'Object_allows' => " " + ); + + my $state = 0; + my $ErrorMsg = "Syntax error of an object class definition.\nline parsed:"; + my $LineNb = 0 ; # Number of the current line parsed in the file + printTrace("ParseObjectClassesFile: $useroc_file\n",4) ; + # read each line of the configuration file + open( OBJCLASSFILE, $useroc_file ) || die "Can't open $FileToParsec: $!: "; + printTrace("Begin the parsing of the file: $useroc_file",4); + LINE: while ( ) { + printTrace("Current Line: $_",4); + $LineNb++ ; + if (/^\s*\#/) { # skip comments + next LINE; + } + if (/^\s*$/) { # skip blank lines + next LINE; + } + SWITCH: { + if ($state == 0) { resetObjectClass(\%ObjectClass); + if (/^objectclass\s+(\S+)\s*$/i) { + $ObjectClass{'ObjectName'} = $1; + $state = 1 ;} + else {} # printMsg($ErrorMsg,$_,$LineNb);} + last SWITCH;} + if ($state == 1) {if (/^\s+oid\s+(\S+)\s*$/i) { + $ObjectClass{'Object_oid'} = $1; + $state = 2 ;} + elsif (/^\s+superior\s+(\S+)\s*$/i) { + $ObjectClass{'Object_superior'} = $1; + $state = 3 ; + } + elsif (/^\s+requires\s*$/i) { + $state = 4; + } + elsif (/^\s+allows\s*$/i) { + $state = 5; + } + else {$state=0; printMsg($ErrorMsg,$_,$LineNb);} + last SWITCH;} + if ($state == 2) {if (/^\s+superior\s+(\S+)\s*$/i) { + $ObjectClass{'Object_superior'} = $1; + $state = 3 ;} + elsif (/^\s+requires\s*$/i) { + $state = 4; + } + elsif (/^\s+allows\s*$/i) { + $state = 5; + } + else { $state=0; printMsg($ErrorMsg,$_,$LineNb);} + last SWITCH;} + if ($state == 3) {if (/^\s+requires\s*$/i) + { $state = 4; } + elsif (/^objectclass\s+(\S+)\s*$/i) { + # run an ldap add before to continue + &AddObjectClass(\%ObjectClass); + $ObjectClass{'ObjectName'} = $1; + $state = 1 ;} + elsif (/^\s+allows\s*$/i) + { $state = 5; } + else {$state = 0; printMsg($ErrorMsg,$_,$LineNb);} + last SWITCH;} + if ($state == 4) {if (/^\s+([^,\s]+),\s*$/i) { + $ObjectClass{'Object_requires'}.=$1." \$ "; } + elsif (/^\s+([^,\s]+)\s*$/i) { + $ObjectClass{'Object_requires'}.=$1." "; + $state = 6; } + else {$state = 0;printMsg($ErrorMsg,$_,$LineNb);} + last SWITCH;} + if ($state == 5) {if (/^\s+([^,\s]+),\s*$/i) { + $ObjectClass{'Object_allows'}.=$1." \$ "; } + elsif (/^\s+([^,\s]+)\s*$/i) { + $ObjectClass{'Object_allows'}.=$1." "; + # run an ldap add before to continue + &AddObjectClass(\%ObjectClass); + $state = 0; } + else {$state = 0; printMsg($ErrorMsg,$_,$LineNb);} + last SWITCH;} + if ($state == 6) {if (/^objectclass\s+(\S+)\s*$/i) { + # run an ldap add before to continue + &AddObjectClass(\%ObjectClass); + $ObjectClass{'ObjectName'} = $1; + $state = 1 ;} + elsif (/^\s+allows\s*$/i) { + $state = 5;} + else {$state = 0; printMsg($ErrorMsg,$_,$LineNb);} + last SWITCH;} + } + } + close(OBJCLASSFILE); + if (($state == 3) || ($state == 4) || ($state == 5) || ($state == 6)) { + &AddObjectClass(\%ObjectClass); + } + printTrace("state: $state",4); +} + +############################################################################# +# printMsg print message to the user standard output. + +sub printMsg { + + my $TypeMsg = shift ; + my $Msg = shift ; + my $LineNb = shift ; + if ($LineNb) { + printTrace("Line: $LineNb, $TypeMsg, $Msg"); + } + else { + printTrace("$TypeMsg $Msg"); + } +} + +############################################################################# +# print message error to the user standard output. + +sub printTrace { + + my $Msg = shift ; + my $level = shift ; + if ($level <= $TRACELEVEL) { + print($Msg); + print LOGFILE $Msg ; + } +} + +############################################################################# +# reset an objectclass structure + +sub resetObjectClass { + my $ObjectClass = shift; + $ObjectClass->{'ObjectName'} = " " ; + $ObjectClass->{'Object_oid'} = " " ; + $ObjectClass->{'Object_superior'} = "top" ; + $ObjectClass->{'Object_requires'} = " " ; + $ObjectClass->{'Object_allows'} = " " ; +} + +############################################################################# +# this subroutine implements a very stupid version of diff + +sub diff { + my $f1 = shift; + my $f2 = shift; + my $lineToBeginWith = shift; + my $NULL = "" ; + my $diff_f1 = $NULL ; + my $diff_f2 = $NULL ; + my $retval = $NULL ; + my $ret; + open(F1, "$f1") or die "Could not open file $f1"; + open(F2, "$f2") or close(F1), die "Could not open file $f2"; + + while (defined($l1 = )) { + if ($lineToBeginWith){ + $lineToBeginWith -- ; + next ; + } + next if ($l1 =~ /^\#/); + $ret = defined($l2 = ); + if ($ret) { + $ret = defined($l2 = ) while ($ret && ($l2 =~ /^\#/)) ; + if ($ret) { + if (!($l1 eq $l2)) { + + # ignore whitespace + $l1_clean = $l1 ; + $l2_clean = $l2 ; + $l1_clean =~ s/\s//g; + $l2_clean =~ s/\s//g; + + if (!($l1_clean eq $l2_clean)) { + $diff_f1 .= "${l1}" unless ($l1_clean eq $NULL); + $diff_f2 .= "${l2}" unless ($l2_clean eq $NULL); + } + } + } + else { + next if ($l1 =~ /^\s*$/) ; + $diff_f1 .= "${l1}"; + } + } + else { + next if ($l1 =~ /^\s*$/) ; + $diff_f1 .= "${l1}"; + } + } + + while (defined($l2 = )) { + if (($l2 =~ /^\#/) || ($l2 =~ /^\s*$/)) { + next ; + } + else { + $diff_f2 .= "${l2}" ; + } + } + + close(F1); + close(F2); + + $retval .= "- differences present in your config file but not in standard file:\n\n". "$diff_f1\n" if ($diff_f1) ; + $retval .= "- differences present in standard file but not in your config file:\n\n" . "$diff_f2" if ($diff_f2) ; + return $retval ; +} + +sub CompareStdConfigFiles { + # Compare each configuration file against its default version. If it has changed, + # notify the user that the file has changed and will need to be checked by the + # user. This should be safe to do because there should be no path information + # stored in these conf files, which are just schema stuff. + # printTrace("\nCheck if standard configuration files have changed",3); + + my $origFilePath = "$oldDir${PATHSEP}bin${PATHSEP}slapd${PATHSEP}install${PATHSEP}config${PATHSEP}" ; + my $FilesChanged = ""; + my $AllDiffs = "***********************************************************************"; + my $NoChanges = "" ; + my $lineToBegin = 0 ; + printTrace("\nVersion of the old directory server: $oldVersion.$oldMinor",0); + opendir(CONFDIR, $oldConfDir) or + die "Error: could not open migrated config dir $oldConfDir: $!"; + + foreach $file (readdir(CONFDIR)) { + $origFile = $origFilePath . $file ; + $configFile = $oldConfDir . $file ; + if ((! exists($userDefinedConfigFiles{lc($file)})) && (-f $origFile)) { + my $lineToBegin = 1 if (lc($file) eq "slapd-collations.conf"); # we ignore the first line of slapd-collations + $diffs = &diff($configFile, $origFile, $lineToBegin); + $lineToBegin = 0 if $lineToBegin ; + if ($diffs) { + $FilesChanged .= "\n$configFile"; + $AllDiffs .= "\n$configFile is different than the standard configuration file" ; + $AllDiffs .= "\nYou will need to check this file and make sure its changes are compatible "; + $AllDiffs .= "with the new directory server\nHere are the differences:\n"; + $AllDiffs .= "$diffs \n\n"; + $AllDiffs .= "***********************************************************************"; + } + else { + $NoChanges .= "\n$configFile"; + } + } + } + closedir(CONFDIR); + +if ($FilesChanged) { + printTrace("\nNo changes to old configuration files:$NoChanges",3) ; + printTrace("\n***********************************************************************",3) ; + printMsg("\nThe following standard files have been modified: $FilesChanged"); + if ($NO_INPUT_USER) { + # do nothing + } + else { + printMsg("\nDo you want to see the differences Yes/No [No] ?") ; + my $answer = ; + if ($answer =~ /y|yes/i) { + printMsg("$AllDiffs"); + } + printMsg("\nDo you want to continue the migration Yes/No [No] ?"); + $answer = ; + if (! ($answer =~ /y|yes/i)) { + exit(1); + } + } + } +} + + +############################################################################# + +sub db2ldif { + my ($conf, $ldif_dir) = @_; + $ENV{"$LIB_PATH"}=$old_libpath; + if (!$conf) { + $conf = "$oldHome${PATHSEP}config${PATHSEP}slapd.conf"; + } + if (! $ldif_dir) { $ldif_dir = $ldif_rep ;} + if (!(-d $ldif_dir)) { + mkdir($ldif_dir,0777) or die "can't create $ldif_rep to store temporary ldif files"; + } + my $dir = "$oldDir${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server"; + chdir($dir) or + die "Error: could not change directory to $dir: $!"; + my @suffixnames = keys(%DBNAMES) ; + foreach $suffixname (@suffixnames) { + my $ldif_file = $ldif_dir.$DBNAMES{$suffixname}.".ldif" ; + # If we are on NT, ${quote} is setup to "\"", else it's setup to "" + # As the suffix can contain some space characters, I write the suffix parameter: "\"$suffixname\"" rather than "${quote}$suffixname${quote}" + my @cmd = + ( "${quote}$oldDir${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server" . + "${PATHSEP}$slapdExecName${quote}", "db2ldif", '-n', '-f', + "${quote}$conf${quote}", '-a', "${quote}$ldif_file${quote}", + '-d', '1','-s',"\"$suffixname\"" ); + open(DB2LDIF, "${quote}@cmd${quote} 2>&1|") or + die "Error: could not execute @cmd: $!"; + sleep(1); # allow pipe to fill with data + $ii = 0; # counter + while () { + ++$ii; + if (($ii % 250) == 0) { + printMsg(" Processing...\n"); + } + } + close(DB2LDIF); + # set the ownership of the ldif file; should be the same as the new slapd user id + if ((! $isNt) && ($oldlocaluser ne $localuser)) { + if (-f $ldif_file) { + chown( $newuid, $newgid, $ldif_file) or printMsg("\nUnable to change the ownership of $ldif_file to $localuser") ; + } + } + } + print " Done.\n"; + chdir($curdir) or die "Could not change directory to $curdir: $!"; +} + +############################################################################# +# This db2ldif is used to export database of the new instance + +sub newinst_db2ldif { + my $ldif = shift ; + my $include_suffix = shift ; + my $home = shift ; + my $db2ldif_param = "db2ldif -r -D $home -a $ldif -s \"$include_suffix\""; + + open(DB2LDIF, "${quote}${quote}$slapdExecName${quote} $db2ldif_param${quote} 2>&1 |") or die "Could not run ns-slapd program $ldif2db_exe\n"; + sleep(1); # allow some data to accumulate in the pipe + my $ii = 0; + while () { + ++$ii; + if (($ii % 250) == 0) { + printMsg(" Processing...\n"); + } + printMsg($_); + } + close(DB2LDIF); + # set the ownership of the ldif file; should be the same as the 5.x slapd user id + if ((! $isNt) && ($oldlocaluser ne $localuser)) { + if (-f $ldif) { + chown( $newuid, $newgid, $ldif) or printMsg("\nUnable to change the ownership of $ldif to $localuser") ; + } + } +} + +############################################################################# + +# this is used to run the system() call, capture exit and signal codes, +# and die() upon badness; the first argument is a directory to change +# dir to, if any, and the rest are passed to system() +sub mySystem { + my $rc = &mySystemNoDie(@_); + my ($dir, @args) = @_; + if ($rc == 0) { +# success + } elsif ($rc == 0xff00) { + die "Error executing @args: error code $rc: $!"; + } elsif ($rc > 0x80) { + $rc >>= 8; + die "Error executing @args: error code $rc: $!"; + } else { + if ($rc & 0x80) { + $rc &= ~0x80; + } + die "Error executing @args: received signal $rc: $!"; + } + + # usually won't get return value + return $rc; +} + +# This version does not die but just returns the error code +sub mySystemNoDie { + my ($dir, @args) = @_; + if ($dir && ($dir ne "")) { + chdir($dir) or die "Could not change directory to $dir: $!"; + } + my $cmd = $args[0]; + # the system {$cmd} avoids some NT shell quoting problems if the $cmd + # needs to be quoted e.g. contains spaces; the map puts double quotes + # around the arguments on NT which are stripped by the command + # interpreter cmd.exe; but don't quote things which are already quoted + my @fixargs = map { /^[\"].*[\"]$/ ? $_ : $quote . $_ . $quote } @args; + my $rc = 0; + if ($cmd =~ /[.](bat|cmd)$/) { + # we have to pass batch files directly to the NT command interpreter + $cmd = $com_spec; +# print "system $cmd /c \"@fixargs\"\n"; + $rc = 0xffff & system {$cmd} '/c', "\"@fixargs\""; + } else { +# print "system $cmd @fixargs\n"; + $rc = 0xffff & system {$cmd} @fixargs; + } + chdir(${curdir}) or die "Could not change directory to $curdir: $!"; + return $rc; +} + +############################################################################# +sub manyLdif2db { + my %rev_dbnames = reverse(%DBNAMES); + @backends = keys(%rev_dbnames); + $ENV{"$LIB_PATH"}=$new_libpath; + chdir($slapdExecDir) or die "Could not change directory to $slapdExecDir: $!"; + foreach $backend (@backends) { + my $ldif = "${ldif_rep}$backend.ldif" ; + if (! -f $ldif) { + $ldif = ${ldif_rep}."data.ldif"; + } + &Ldif2db($ldif, $backend); + } + # remove the empty ldif directory + # but not if using the data dir + if (!$olddatadir) { + rmdir($ldif_rep); + } + chdir($curdir) or die "Could not change directory to $curdir: $!"; +} + + +sub Ldif2db { + my $ldif = shift ; + my $backend = shift ; + my $ldif2db_param = "ldif2db -D $serverHome -n $backend -i $ldif"; + open(LDIF2DB, "${quote}${quote}$slapdExecName${quote} $ldif2db_param${quote} 2>&1 |") or die "Could not run ns-slapd program $ldif2db_exe\n"; + sleep(1); # allow some data to accumulate in the pipe + while () { + printMsg($_); + } + close(LDIF2DB); + # remove the ldif file after the import + # but not if using the data dir + if (!$olddatadir) { + unlink($ldif) ; + } +} + +############################################################################# + +#sub copyBak { +# opendir( OLDBAK, "$oldHome${PATHSEP}bak" ) || +# die "Can't open directory $oldHome${PATHSEP}bak: $!: "; +# local ( @dirs ) = readdir( OLDBAK ); +# closedir ( OLDBAK ); +# for ( @dirs ) { +# if ( $_ eq "." || $_ eq ".." ) { +# next; +# } elsif ( -d "$oldHome${PATHSEP}bak${PATHSEP}$_" ) { +# $srcDir = "$oldHome${PATHSEP}bak${PATHSEP}$_"; +# $destDir = "$serverHome${PATHSEP}bak${PATHSEP}$_"; +# $srcLDIF = "$oldHome${PATHSEP}ldif${PATHSEP}bak.ldif"; +# $destLDIF = "$serverHome${PATHSEP}ldif${PATHSEP}bak.ldif"; +# mkdir( $destDir , 0755 ) if !( -e $destDir); +# # Converting database +# if ( !$isNT && $newuser ) { +# chown($newuid, $newgid, +# "$serverHome${PATHSEP}bak", $destDir); +# } +# &other_db2ldif($srcDir, $srcLDIF); +# if ($needAclUpg) { +# &mySystem("$root${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server", +# "$root${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server" . +# "${PATHSEP}aclupg$exe_suffix", '-d', '-i', +# $srcLDIF, '-o', $destLDIF); +# } else { +# ©BinFile($srcLDIF, $destLDIF); +# } +# &other_ldif2db($destLDIF, $destDir); +# } +# } +#} +############################################################################# + +sub startServer { + my $instanceDir = ${serverHome} ; + my $errLog = $instanceDir . $PATHSEP . 'logs' . $PATHSEP . 'errors'; + # emulate tail -f + # if the last line we see does not contain "slapd started", try again + my $done = 0; + my $started = 0; + my $code = 0; + my $lastLine = ""; + my $timeout = time + 240; # 4 minutes + $ENV{"$LIB_PATH"}=$new_libpath; + + my $startCmd = $instanceDir . $PATHSEP . 'start' . $script_suffix; + if (! -f $startCmd) { + $startCmd = $instanceDir . $PATHSEP . 'start-slapd' . $script_suffix; + } + printTrace("\nInstanceDir: $instanceDir\n",4); + $code = &mySystem($instanceDir,$startCmd); + open(IN, $errLog) or die "Could not open error log $errLog: $!"; + my $pos = tell(IN); + while (($done == 0) && (time < $timeout)) { + for (; ($done == 0) && ($_ = ); $pos = tell(IN)) { + $lastLine = $_; + # print; + # the server has already been started and shutdown once . . . + if (/slapd started\./) { + $started++; + if ($started == 2) { + $done = 1; + } + # sometimes the server will fail to come up; in that case, restart it + } elsif (/Initialization Failed/) { + # print "Server failed to start: $_"; + $code = &mySystem($instanceDir, $startCmd); + # sometimes the server will fail to come up; in that case, restart it + } elsif (/exiting\./) { + # print "Server failed to start: $_"; + #$code = &mySystem($startCmd); + + $code = &mySystem($instanceDir, $startCmd); + } + } + if ($lastLine =~ /PR_Bind/) { + # server port conflicts with another one, just report and punt + print $lastLine; + print "This server cannot be started until the other server on this\n"; + print "port is shutdown.\n"; + $done = 1; + } + if ($done == 0) { + # rest a bit, then . . . + sleep(2); + # . . . reset the EOF status of the file desc + seek(IN, $pos, 0); + } + } + close(IN); + + if ($started < 2) { + $! = $code; + # $now = time; + # if ($now > $timeout) { + # print "Possible timeout: timeout=$timeout now=$now\n"; + # } + die "Error: could not start server: $!"; + } + + return 0; +} + +sub stopServer { + my $root = shift; + my $name = shift; + $maxStopIterations = 5; + print "\nShutting down server $name . . .\n"; + + $ENV{"$LIB_PATH"}=$new_libpath; + $stopCmd = $quote . $root . $PATHSEP . $name . $PATHSEP . 'stop' . $script_suffix . $quote; + if (! -f $stopCmd) { + $stopCmd = $quote . $root . $PATHSEP . $name . $PATHSEP . 'stop-slapd' . $script_suffix . $quote; + } + + if (! -f $stopCmd) { + # no stop command, probably a 1.X system; for NT, we'll try net stop + # for unix, we'll get the pid and kill it + if ($isNT) { + $stopCmd = 'net stop ' . $name; + } else { + # see if there is a pid file + $pidfile = $root . $PATHSEP . $name . $PATHSEP . 'logs' . + $PATHSEP . 'pid'; + if (open(PIDFILE, $pidfile)) { + chomp($pid = ); + close(PIDFILE); + while ($maxStopIterations-- && !$exitCode) { + $exitCode = kill(15, $pid); + } + $stopCmd = undef; + } + } + } + + # keep looping until the stop cmd returns an error code, which usually + # means that what ever we want to stop is stopped, or some other error + # occurred e.g. permission, or no such service + $exitCode = &runAndIgnoreOutput($stopCmd); +# print "stopServer: exitCode=$exitCode\n"; + while ($stopCmd && $maxStopIterations-- && $exitCode) { + $exitCode = &runAndIgnoreOutput($stopCmd); +# print "stopServer: exitCode=$exitCode\n"; + } + + if (!$maxStopIterations) { + print "Warning: could not shutdown the server: $!\n"; + } + + sleep(10) ; + + $exitCode = 0; + +} + + +sub runAndIgnoreOutput { + my $cmd = shift; + printMsg("."); + open(RUNCMD, "${quote}$cmd${quote} 2>&1 |") or die "Error: could not run $cmd: $!"; + printMsg("."); + sleep(1); # allow pipe to fill with data + printMsg("."); + while () { +# print; + } + my $code = close(RUNCMD); +# print "runAndIgnore: code=$code status=$?\n"; + return $?; +} +############################################################################# +# migrate some of entries present in the old DSE.ldif like +# cn=snmp,cn=config +# cn=encryption,cn=config +# all the aci's + +sub MigrateDSE { + printTrace("\nMigrate DSE entries...",1); + open( DSELDIF, "< $oldDSEldif" ) || die "Can't open $oldDSEldif: $!: "; + my $in = new Mozilla::LDAP::LDIF(*DSELDIF) ; + while ($old_entry = readOneEntry $in) { + my $DN = $old_entry->getDN() ; + SWITCH: { + # migrate the entrie: cn=snmp,cn=config + if ($DN =~ /^cn=SNMP,cn=config$/i) { + my $entry = $conn->search("$DN","base","objectclass=nsSNMP"); + if ($entry) { + my $res = $conn->update($old_entry); + if ($res) { + printTrace("\n$DN updated !",2); + } + else { + printMsg("\nFailed to update $DN"); + } + } + else { + printMsg("\nUnable to get info under $DN"); + } + last SWITCH; + } + # migrate the entrie: cn=encryption,cn=config + if ($DN =~ /cn=encryption,cn=config$/i) { + if ($conn->search("$DN","base","objectclass=*")) { + if ($old_entry->hasValue("objectClass", "nsEncryptionConfig")) { + my $certfile = "alias/slapd-" . $newname . "-cert8.db"; + my $keyfile = "alias/slapd-" . $newname. "-key3.db"; + $old_entry->setValues("nsCertfile",$certfile) if ! $old_entry->hasValue("nsCertfile",$certfile); + $old_entry->setValues("nsKeyfile",$keyfile) if ! $old_entry->hasValue("nsKeyfile",$keyfile); + } + my $res = $conn->update($old_entry); + if ($res) { + printTrace("\n$DN updated !",2); + } + else { + printMsg("\nFailed to update $DN"); + } + } + else { + my $res = $conn->add($old_entry); + if ($res) { + printTrace("\n$DN added !",2); + } + else { + printMsg("\nFailed to add $DN"); + } + } + last SWITCH; + } + if (@{$old_entry->{aci}} && (! ($DN =~ /^cn=monitor$/i)) && (! ($DN =~ /^cn=schema$/i))) { + # migrate aci's + my $entry = $conn->search("$DN","base","objectclass=*"); + if ($entry) { + my $res = $conn->update($old_entry); + if ($res) { + printTrace("\n$DN updated !",2); + } + else { + printMsg("\nFailed to update $DN"); + } + } + else { + my $res = $conn->add($old_entry); + if ($res) { + printTrace("\n$DN added !",2); + } + else { + printMsg("\nFailed to add $DN"); + } + } + last SWITCH; + } + } + } + close(DSELDIF); +} +############################################################################# +# migrate SSL info + +sub MigrateSSL { + my $secPwd = 'bidon' ; + # copy the SSL directory + ©Dir("$oldHome${PATHSEP}ssl","$serverHome${PATHSEP}ssl"); + # copy the cert db and key files + if ( -d "$oldDir${PATHSEP}alias") { + $aliasDir = "$root${PATHSEP}alias"; + if (! -d $aliasDir) { + mkdir($aliasDir, 0750); + } + &stopServer($root,'slapd-'.$newname); + my $keydb = "$aliasDir${PATHSEP}slapd-$newname-key3.db" ; + my $certdb = "$aliasDir${PATHSEP}slapd-$newname-cert8.db" ; + my $certdb7 = "$aliasDir${PATHSEP}slapd-$newname-cert7.db" ; + my $old_keydb = "$oldDir${PATHSEP}alias${PATHSEP}slapd-$oldname-key3.db" ; + my $old_certdb = "$oldDir${PATHSEP}alias${PATHSEP}slapd-$oldname-cert7.db"; + my $keydb_backup = "$aliasDir${PATHSEP}slapd-$newname-key3.db_backup" ; + my $certdb_backup = "$aliasDir${PATHSEP}slapd-$newname-cert7.db_backup" ; + if (-f $old_keydb) { + if (-f $keydb) { + if ($NO_INPUT_USER) { + printMsg("\n$keydb already exists. backup in $keydb_backup ..."); + ©BinFile($keydb,$keydb_backup); + ©BinFile($old_keydb,$keydb); + } + else { + print("\n\n$keydb already exists. Do you want to overwrite it ? [no]: "); + my $answer = ; + if ($answer =~ /^y|yes$/i) { + ©BinFile($old_keydb,$keydb); + } + } + } + else { + ©BinFile($old_keydb,$keydb); + } + } + if (-f $old_certdb) { + $mode = (stat($old_certdb))[2] if $PRESERVE; + if (-f $certdb) { + if ($NO_INPUT_USER) { + printMsg("\n$certdb already exists. backup in $certdb_backup ..."); + ©BinFile($certdb,$certdb_backup); + unlink($certdb) || print "Couldn't delete $certdb : $!\n"; + ©BinFile($old_certdb,$certdb7); + } + else { + print("\n\n$certdb already exists. Do you want to overwrite it ? [no]: "); + my $answer = ; + if ($answer =~ /^y|yes$/i) { + unlink($certdb) || print "Couldn't delete $certdb : $!\n"; + ©BinFile($old_certdb,$certdb7); + } + } + } + else { + ©BinFile($old_certdb,$certdb7); + } + } + # copy the old password file + if (-f "$oldDir${PATHSEP}alias${PATHSEP}$type-$oldname-pin.txt") { + ©BinFile( + "$oldDir${PATHSEP}alias${PATHSEP}$type-$oldname-pin.txt", + "$aliasDir${PATHSEP}$type-$newname-pin.txt" + ); + } + &startServer(); + if ($PRESERVE) { + chown($newuid,$newgid,$certdb) || print "Failed to set uid $newuid gid $newgid on $certdb : $!\n"; + chmod($mode,$certdb) || print "Failed to set mode $mode on $certdb : $!\n"; + } + } + +} + +sub DisableSSL { + my $entry = $conn->search("cn=config","base","objectclass=*"); + my $LDAPparam = "nsslapd-security" ; + my $Value = "off" ; + if ($entry->{$LDAPparam}[0] ne $Value) { + printTrace("\nDisable SSL...",1); + $entry->setValues($LDAPparam, $Value); + } + my $res = $conn->update($entry); + if ($res) { + printTrace("\nSSL disabled",2); + } + else { + printMsg("\nCan't disable SSL, the server may have problems starting"); + } +} + +# enable the migration of client authentication informations +sub MigrateCertmap { + # backup the old new certmap.conf and replace it with the old certmap.conf file + my $oldCertmap = "$oldDir${PATHSEP}shared${PATHSEP}config${PATHSEP}certmap.conf"; + my $newCertmap = "$root${PATHSEP}shared${PATHSEP}config${PATHSEP}certmap.conf" ; + my $backupCertmap = "$root${PATHSEP}shared${PATHSEP}config${PATHSEP}certmap.conf_backup" ; + if (&hasChangedoldCertmap($oldCertmap)) { + if ($NO_INPUT_USER) { + printMsg("\n$newCertmap has been backup in $backupCertmap"); + ©BinFile($newCertmap,$backupCertmap); + ©BinFile($oldCertmap,$newCertmap); + } + else { + my $Ask = 1 ; + while ($Ask) { + printMsg("\n\nWhere do you want to back up the file $newCertmap [$backupCertmap] ?") ; + my $Answer = ; + $backupCertmap = $Answer if ($Answer ne "\n"); + chomp($backupCertmap); + printTrace("\nDest: .$backupCertmap.",4); + if (-e $backupCertmap) { + printMsg("\n\n$backupCertmap already exists. Do you want to overwrite it Yes/No [No] ?") ; + if ( =~ /yes|y/i) { + $Ask = 0 ; + } + else { + $backupCertmap = "$root${PATHSEP}shared${PATHSEP}config${PATHSEP}certmap.conf_backup" ; + } + } + else { + $Ask = 0 ; + } + } + printTrace("\nBackup file: $newCertmap in $backupCertmap",4); + ©BinFile($newCertmap,$backupCertmap); + ©BinFile($oldCertmap,$newCertmap); + } + } + else { + } +} + +sub hasChangedoldCertmap { + my $certmapfile = shift ; + my @reference = ("certmap default default", + "default:DNComps", + "default:FilterComps e") ; + my $cpt = 0 ; + printTrace("\nhasChangedoldCertmap",3); + open(CERTMAP,"< $certmapfile"); + while () { + if ((! /^\s*#/) && (! /^\s*$/)) { + my $ref = $reference[$cpt] ; + printTrace("\nValue: $_, ref: $ref",4); + if (! /^\s*$ref\s*$/) { + return 1 ; + } + else { + $cpt++ ; + } + } + } + close (CERTMAP); + printTrace("\ncpt: $cpt",4); + if ($cpt < $#reference) { + return 1 ; + } + else { + return 0 ; + } +} +############################################################################# +# copy a directory to another + +sub copyDir { + my $src = shift; + my $dest = shift; + my $exclude = shift; + + opendir( SRC, $src ) or die "Can't open directory $src: $!: "; + my $mode; + my $uid; + my $gid; + mkdir ( $dest , 0755 ) or die "\nCan't create directory $dest. \nPlease check you have enough rights to create it and/or check that your parent directory exists.\n" if !( -e $dest ); + if ($PRESERVE) { + $mode = (stat($src))[2]; + ($uid, $gid) = (stat(_))[4..5]; + # Make sure files owned by the old user are owned by the + # new user + if ($uid == $olduid) { + $uid = $newuid; + $gid = $newgid; + } + chown $uid, $gid, $dest; + chmod $mode, $dest; + } + local ( @files ) = readdir ( SRC ); + closedir( SRC ); + for ( @files ) { + if ( $_ eq "." || $_ eq ".." ) { + next; + } elsif ( $exclude && /$exclude/ ) { + next; + } elsif( -d "$src${PATHSEP}$_") { + ©Dir ( "$src${PATHSEP}$_", "$dest${PATHSEP}$_" ); + } else { + ©BinFile ( "$src${PATHSEP}$_", "$dest${PATHSEP}$_"); + } + } +} + +sub copyBinFile { + my $src = shift; + my $dest = shift; + my $buf = ""; + my $bufsize = 8192; + + open( SRC, $src ) || die "Can't open $src: $!\n"; + # if we are given a directory destination instead of a file, extract the + # filename portion of the source to use as the destination filename + if (-d $dest) { + $dest = $dest . $PATHSEP . &basename($src); + } + open( DEST, ">$dest" ) || die "Can't create $dest: $!\n"; + binmode SRC; + binmode DEST; + if ($PRESERVE) { + $mode = (stat($src))[2]; + ($uid, $gid) = (stat(_))[4..5]; + # Make sure files owned by the old user are owned by the + # new user + if ($uid == $olduid) { + $uid = $newuid; + $gid = $newgid; + } + chown $uid, $gid, $dest; + chmod $mode, $dest; + } + while (read(SRC, $buf, $bufsize)) { + print DEST $buf; + } + close( SRC ); + close( DEST ); +} +############################################################################# +# backup new configuration files +# backup the directory /slapd-instance/config in /slapd-instance/BackupConfig + +sub backupConfigFiles { + # backup the new config files + my $src = "$serverHome${PATHSEP}config" ; + my $dest = "$serverHome${PATHSEP}config_backup" ; + if ($NO_INPUT_USER) { + printMsg("\n$src has been backup in $dest"); + ©Dir($src,$dest); + } + else { + my $Ask = 1 ; + while ($Ask) { + printMsg("\n\nWhere do you want to back up your configuration directory [$dest] ?") ; + my $Answer = ; + $dest = $Answer if ($Answer ne "\n"); + chomp($dest); + printTrace("\nDest: .$dest.",4); + if (-e $dest) { + printMsg("\n\n$dest already exists. Do you want to overwrite it Yes/No [No] ?") ; + if ( =~ /yes|y/i) { + $Ask = 0 ; + } + else { + $dest = "$serverHome${PATHSEP}config_backup" ; + } + } + else { + $Ask = 0 ; + } + } + printTrace("\nBackup Directory: $src in $dest",4); + ©Dir($src,$dest); + } +} +############################################################################# + +sub getLDAPservername { + my $oldLDAPservername; + my $LDAPservername; + open(OLDSLAPDCONF, $oldSlapdConf) or + die "\nError: could not open old config file $oldSlapdConf \n"; + while() { + chop; + if (/^localhost\s+/i) { + ($oldLDAPservername = $') =~ s/^[\"]//;; + $oldLDAPservername =~ s/[\"]$//; + printTrace("\nName of the old LDAP server: $oldLDAPservername",3); + } + } + close(OLDSLAPDCONF); + + open( DSELDIF, "< $DSEldif" ) || die "\nCan't open $DSEldif \n"; + my $in = new Mozilla::LDAP::LDIF(*DSELDIF) ; + while ($entry = readOneEntry $in) { + my $DN = $entry->getDN() ; + if ($DN =~ /^cn=config$/i) { + my $localhost = "nsslapd-localhost"; + my @values = $entry->getValues($localhost); + if ($#values != -1) { + $LDAPservername = $values[0]; + } + break; + } + } + close(DSELDIF); + # check old and new are installed on the same physical machine. + if (lc($oldLDAPservername) ne lc($LDAPservername)) { + # warn the user he tries to migrate a old server installed on a different machine from the new one + printMsg("\n\nYour old server is on $oldLDAPservername, and your new server is on $LDAPservername. We don't support migration on different machines. Do you want to continue ? Yes/No [No]:") ; + if (! ( =~ /yes|y/i)) { + return -1; + } + } + return $LDAPservername ; +} + +############################################################################# + +sub getLibPath { + my $myDir = shift; + my $myVersion = shift; + my $myMinor = shift; + + if ($isNT) { + return $ENV{"$LIB_PATH"}; + } + if (($myVersion >= 6) && ($myMinor >= 2)) { + return + "$myDir${PATHSEP}bin${PATHSEP}slapd${PATHSEP}lib${SEP}". + "$myDir${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${SEP}". + $ENV{"$LIB_PATH"}; + } else { + return "$myDir${PATHSEP}lib${SEP}".$ENV{"$LIB_PATH"}; + } +} + +############################################################################# + +sub getVersion { + my $dir = shift; + my $versionstr = shift; + my $version = 0; + my $minor = 0; + my $buildNumber = 0; + my $progDir = "${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${PATHSEP}"; + my $progDir2 = "${PATHSEP}bin${PATHSEP}slapd${PATHSEP}"; + + # find the slapd executable + if (!$versionstr) { # version not specified on cmd line - find it + $prog = $dir . $progDir . $slapdExecName; + if (! -f $prog) { + $prog = $dir . $progDir2 . $slapdExecName; + if (-f $prog && $isNT) { + # if slapd is in bin/slapd and we're on NT, just assume version 1; + # apparently, slapd.exe doesn't like the -v argument . . . + return ( '1', $minor ); + } + else{ + die "Could not run slapd program $prog: $!"; + } + } + else { + chdir($dir . $progDir); + } + $cur_libpath=$ENV{"$LIB_PATH"}; + $ENV{"$LIB_PATH"}= + "$dir${PATHSEP}lib${SEP}". + "$dir${PATHSEP}bin${PATHSEP}slapd${PATHSEP}lib${SEP}". + "$dir${PATHSEP}bin${PATHSEP}slapd${PATHSEP}server${SEP}". + $ENV{"$LIB_PATH"}; + # read the old version from the old slapd program + + open(F, "${quote}${quote}$prog${quote} -v${quote} 2>&1 |") or + die "Could not run slapd program $prog: $!"; + sleep(1); # allow some data to accumulate in the pipe +# print "Output from $prog -v:\n"; + while () { + if (/^Netscape-Directory/ || /^iPlanet-Directory/i) { + $versionstr = $_; + last; + } + } + $code = close(F); + # print "$prog returned code=$code status=$?\n"; + $ENV{"$LIB_PATH"}=$cur_libpath; + } + + if ($versionstr =~ /^Netscape-Directory\/(\d+)\.(\d+)(?:b\d)*\s+(\S+)/) { + $version = $1; + $minor = $2; + $buildNumber = $3; + } + elsif ($versionstr =~ /^Netscape-Directory\(restrict?ed-mode\)\/(\d+)\.(\d+)\s+(\S+)/) { # we can have restricted-mode or restriced-mode ... + $version = $1; + $minor = $2; + $buildNumber = $3; + } + elsif ($versionstr =~ /^iPlanet-Directory\/(\d+)\.(\d+)\s+(\S+)/i) { + $version = $1; + $minor = $2; + $buildNumber = $3; + } elsif ($versionstr =~ /(\d+)\.(\d+)/) { + $version = $1; + $minor = $2; + } + + if ($version == 0) { + die "\nCould not determine version of the directory server in $dir: \n"; + } + + # distinguish the 4.1 and the 4.11 thanks to the buildNumber + if (($version == 4) && ($minor == 1)){ + if (! ($buildNumber =~ /^B99\.16/)) { + # it's not a 4.1 Netscape Directory Server => it's a 4.11 + $minor = 11 ; + } + } + chdir($curdir) or die "Could not change directory to $curdir: $!" ; + return ( $version, $minor ); +} + +############################################################################# + +sub getDiff { + # we get references to arrays + my $elements = shift ; + my $existing_elements = shift ; + my %count = () ; + my %countEE = () ; + @diff = () ; + foreach $e (@{$elements}, @{$existing_elements}) { $count{$e}++ ;} + foreach $e (@{existing_elements}) { $countEE{$e}++ ;} + foreach $e (@{$elements}) { + # if $e is only present in @$elements, we push it to the diff array + if (($count{$e} == 1) && ($countEE{$e} == 0)) { + push @diff, $e ; + } + } + return @diff ; +} + +############################################################################################### +sub testIndexUpdating { + #my $entry = $conn->newEntry(); + #$entry->setDN("cn=djeattribute,cn=index,cn=MigratedDB_5,cn=ldbm database,cn=plugins,cn=config"); + my $entry = $conn->search("cn=mail,cn=index,cn=MigratedDB_2,cn=ldbm database,cn=plugins,cn=config","base","objectclass=nsIndex"); + my @types = ("pres", "sub", "eq") ; + my @existing_types = $entry->getValues("nsindextype"); + my @typesToAdd = &getDiff(\@types, \@existing_types); + foreach $newtype (@typesToAdd) { + $entry->addValue("nsindextype", $newtype); printTrace("\nnewtype: $newtype",2); + } + my $res = $conn->update($entry) ; + if ($res) {print("\nUpdate index mail\n");} + else { print("\ncan't update index mail");} + + $entry = $conn->search("cn=givenName,cn=index,cn=MigratedDB_2,cn=ldbm database,cn=plugins,cn=config","base","objectclass=nsIndex"); + @types = ("pres", "sub", "eq") ; + @existing_types = $entry->getValues("nsindextype"); print("\ngivenName, existing_types: @existing_types"); + @typesToAdd = &getDiff(\@types, \@existing_types); print("\nTypesToAdd: @typesToAdd"); + foreach $newtype (@typesToAdd) { + $entry->addValue("nsindextype", $newtype); printTrace("\nnewtype: $newtype",2); + } + my $res = $conn->update($entry) ; + if ($res) {print("\nUpdate index givenName\n");} + else { print("\ncan't update index givenName");} + } + + +############################################################################################### +sub normalizeDir { + my $dir = shift ; + my $dir_prec = "" ; + while ($dir_prec ne $dir) { + $dir_prec = $dir ; + if ($isNT) { + grep { s@\\\\@\\@g } $dir ; + } + else { + grep { s@//@/@g } $dir ; + } + } + return $dir ; +} + + +############################################################################################### +# return 1 if the value parameters is +sub isAllowedPlugin { + my $Value = lc(shift) ; + if ($allowedPlugins{$Value}) { + return 1 ; + } + else { + return 0 ; + } + +} + + +sub getSyntaxOid { + my $Value = lc(shift) ; + return $allowedPlugins{$Value} ; +} + +############################################################################################### +# return 1 if the value given in parameters is an allowed modifier +sub isAllowedModifier { + my $Value = lc(shift) ; + if ($allowedModifiers{$Value}) { + return 1 ; + } + else { + return 0 ; + } +} + +sub getModifierValue { + my $Value = lc(shift) ; + return $allowedModifiers{$Value} ; +} + +############################################################################################### + +sub GetTime { + my $tm = localtime; + (my $sec, my $min, my $hour, my $dd, my $mm, my $yy) = ($tm->sec, $tm->min, $tm->hour, $tm->mday, ($tm->mon)+1, ($tm->year)+1900); + $sec = "0$sec" unless $sec > 9 ; + $min = "0$min" unless $min > 9 ; + $hour = "0$hour" unless $hour > 9 ; + $dd = "0$dd" unless $dd > 9 ; + $mm = "0$mm" unless $mm > 9 ; + return ($sec, $min, $hour, $dd, $mm, $yy); +} + +############################################################################################### +# get uid and group id of the new slapd server. +# The uid is done through the nsslapd-localuser attribute + +sub getuid_gid { + my $newuid ; + my $newgid ; + my $localuser ; + my $localuser_attr = "nsslapd-localuser" ; + if (! $isNT) { + my $entry = $conn->search("cn=config ", "base","objectclass=*", 0, ($localuser_attr)) ; + # Tests wether we succeed to get the entry cn=config + die "\nCan't get the entry cn=config \n" unless ($entry); + my @values = $entry->getValues($localuser_attr); + if ($#values == -1 || ($values[0] eq "") ) { # tests wether the nsslapd-localuser attribute has a value + printMsg("\nNo localuser has been found in the configuration of the directory. "); + if ($NO_INPUT_USER) { + printMsg("\nWe considered nobody as the localuser"); + $localuser = "nobody" ; + } + else { + my $Ask = 1 ; + while ($Ask) { + printMsg("\nUnder what user does your $Version.$Minor directory server run [nobody] ? ") ; + $localuser = ; + chomp($localuser); + $localuser = "nobody" if ($localuser eq ""); + ($newuid, $newgid) = (getpwnam("$localuser"))[2..3] ; + if ($newuid) { + $Ask = 0 ; + } + else { + printMsg("\nError: $localuser is unknown from the system "); + } + } + } + } + else { + $localuser = $values[0]; # returns the first value (we should only have one localuser) + my $size = $#values ; + } + ($newuid, $newgid) = (getpwnam("$localuser"))[2..3] ; + return ($localuser, $newuid, $newgid) ; + } + else { + return () ; + } +} + + +############################################################################################### +# get uid and group id of the old slapd server. + +sub getolduid_gid { + my $oldlocaluser ; + if (! $isNT) { + open(CONF, $oldSlapdConf) or die "\nError: cannot open $oldSlapdConf: $!\n"; + while () { + if (/^localuser\s+/i) { + chomp($oldlocaluser = $'); + last; + } + } + close(CONF); + ($olduid, $oldgid) = (getpwnam("$oldlocaluser"))[2..3] ; + return ($oldlocaluser, $olduid, $oldgid) ; + } + else { + return (); + } +} + +############################################################################################### +# get current directory + +sub getCwd { + my $command = $isNT ? "cd" : "/bin/pwd"; + open(PWDCMD, "$command 2>&1 |") or + die "Error: could not execute $command: $!"; + # without the following sleep, reading from the pipe will + # return nothing; I guess it gives the pwd command time + # to get some data to read . . . + sleep(1); + my $currentdir; + while () { + if (!$currentdir) { + chomp($currentdir = $_); + } + } + my $code = close(PWDCMD); +# if ($code || $?) { +# print "$command returned code=$code status=$? dir=$curdir\n"; +# } +# print "getCwd curdir=\[$curdir\]\n"; + return $currentdir; +} diff --git a/ldap/admin/src/scripts/template-ns-accountstatus.pl b/ldap/admin/src/scripts/template-ns-accountstatus.pl new file mode 100644 index 00000000..5913f7ad --- /dev/null +++ b/ldap/admin/src/scripts/template-ns-accountstatus.pl @@ -0,0 +1,813 @@ +#{{PERL-EXEC}} +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2004 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# + +############################### +# SUB-ROUTINES +############################### + +sub usage_and_exit +{ + print (STDERR "$cmd [-D rootdn] { -w password | -w - | -j filename } \n"); + print (STDERR " [-p port] [-h host] -I DN-to-$operation\n\n"); + print (STDERR "May be used to $operation a user or a domain of users\n\n"); + print (STDERR "Arguments:\n"); + print (STDERR " -? - help\n"); + print (STDERR " -D rootdn - Provide a Directory Manager DN. Default= '$defrootdn'\n"); + print (STDERR " -w password - Provide a password for the Directory Manager DN\n"); + print (STDERR " -w - - Prompt for the Directory Manager's password\n"); + print (STDERR " -j filename - Read the Directory Manager's password from file\n"); + print (STDERR " -p port - Provide a port. Default= '$defport'\n"); + print (STDERR " -h host - Provide a host name. Default= '$defhost'\n"); + print (STDERR " -I DN-to-$operation - Single entry DN or role DN to $operation\n"); + exit 100; +} + +sub debug +{ +# print " ==> @_"; +} + +sub out +{ + print "@_"; +} + +# -------------------------- +# Check if the entry is part of a locked role: +# i.e.: for each role member (nsroledn) of nsdisabledrole, check if +# * it is the same as the entry +# * the entry is member of role (==has nsroledn attributes), compare each of +# them with the nsroledn of nsdisabledrole +# * if nsroledn of nsdisabledrole are complex, go through each of them +# argv[0] is the local file handler +# argv[1] is the entry (may be a single entry DN or a role DN) +# argv[2] is the base for the search +# -------------------------- + +$throughRole=""; + +sub indirectLock +{ + # For recursivity, file handler must be local + my $L_filehandle=$_[0]; + $L_filehandle++; + + my $L_entry=$_[1]; + # Remove useless space + my @L_intern=split /([,])/,$L_entry; + my $L_result=""; + foreach $L_part (@L_intern) + { + $L_part=~s/^ +//; + $L_part=~ tr/A-Z/a-z/; + $L_result="$L_result$L_part"; + } + $L_entry=$L_result; + + my $L_base=$_[2]; + + my $L_search; + my $L_currentrole; + my $L_retCode; + + my $L_local; + +`$ldapsearch -p $port -h $host -D \"$rootdn\" -w \"$rootpw\" -s base -b \"$L_base\" \"(|(objectclass=*)(objectclass=ldapsubentry))\" nsroledn >> {{DEV-NULL}} 2>&1 `; +$retCode=$?; +if ( $retCode != 0 ) +{ + $retCode=$?>>8; + return 1; +} + + # Check if the role is a nested role + @L_Nested="$ldapsearch -p $port -h $host -D \"$rootdn\" -w \"$rootpw\" -s base -b \"$L_base\" \"(|(objectclass=nsNestedRoleDefinition)(objectclass=ldapsubentry))\" "; + # L_isNested == 1 means that we are going through a nested role, so for each member of that + # nested role, check that the member is below the scope of the nested + $L_isNested=@L_Nested; + + # Not Direct Lock, Go through roles if any + $L_search="$ldapsearch -p $port -h $host -D \"$rootdn\" -w \"$rootpw\" -s base -b \"$L_base\" \"(|(objectclass=*)(objectclass=ldapsubentry))\" nsroledn "; + + debug("\t-->indirectLock: check if $L_entry is part of a locked role from base $L_base\n\n"); + + unless (open ($L_filehandle, "$L_search |")) + { + out("Can't open file $L_filehandle\n"); + exit; + } + while (<$L_filehandle>) { + + s/\n //g; + if (/^nsroledn: (.*)\n/) { + $L_currentrole = $1; + + # Remove useless space + my @L_intern=split /([,])/,$L_currentrole; + my $L_result=""; + foreach $L_part (@L_intern) + { + $L_part=~s/^ +//; + $L_part=~ tr/A-Z/a-z/; + $L_result="$L_result$L_part"; + } + $L_currentrole=$L_result; + + debug("\t-- indirectLock loop: current nsroledn $L_currentrole of base $L_base\n"); + if ( $L_isNested == 1 ) + { + if ( checkScope($L_currentrole, $L_base) == 0 ) + { + # Scope problem probably a bad conf, skip the currentrole + next; + } + } + + if ( $L_currentrole eq $L_entry ) + { + # the entry is a role that is directly locked + # i.e, nsroledn of nsdisabledrole contains the entry + $throughRole=$L_base; + $throughRole=~ tr/A-Z/a-z/; + + # skipDisabled means that we've just found that the entry (which is a role) + # is locked directly (==its DN is part of nsroledn attributes) + # we just want to know now, if it is locked through another role + # at least, one + if ( $skipDisabled == 1 ) + { + # direct inactivation + $directLocked=1; + # just go through that test once + $skipDisabled=0; + next; + } + debug("\t-- 1 indirectLock: $L_currentrole locked throughRole == $throughRole\n"); + return 0; + } + + $L_retCode=memberOf($L_currentrole, $L_entry); + if ( $L_retCode == 0 && $single == 1 ) + { + $throughRole=$L_currentrole; + $throughRole=~ tr/A-Z/a-z/; + if ( $skipManaged == 1 ) + { + if ( $L_currentrole eq $nsManagedDisabledRole) + { + # Try next nsroledn + $directLocked=1; + $skipManaged=0; + next; + } + } + debug("\t-- 2 indirectLock: $L_currentrole locked throughRole == $throughRole\n"); + return 0; + } + + # Only for the first iteration + # the first iteration is with nsdisabledrole as base, other + # loops are deeper + $L_local=$skipDisabled; + $skipDisabled=0; + + # the current nsroledn may be a complex role, just go through + # its won nsroledn + $L_retCode=indirectLock($L_filehandle,$L_entry, $L_currentrole); + + # Because of recursivity, to keep the initial value for the first level + $skipDisabled=$L_local; + + if ( $L_retCode == 0 ) + { + $throughRole=$L_currentrole; + $throughRole=~ tr/A-Z/a-z/; + debug("\t-- 3 indirectLock: $L_entry locked throughRole == $throughRole\n"); + return 0; + } + } + } + + close($L_filehandle); + + debug("\t<--indirectLock: no more nsroledn to process\n"); + return 1; +} + +# -------------------------- +# Check if nsroledn is part of the entry attributes +# argv[0] is a role DN (nsroledn attribute) +# argv[1] is the entry +# -------------------------- +sub memberOf +{ + my $L_nsroledn=$_[0]; + $L_nsroledn=~ tr/A-Z/a-z/; + + my $L_entry=$_[1]; + + my $L_search; + my $L_currentrole; + + $L_search="$ldapsearch -p $port -h $host -D \"$rootdn\" -w \"$rootpw\" -s base -b \"$L_entry\" \"(|(objectclass=*)(objectclass=ldapsubentry))\" nsrole"; + + debug("\t\t-->memberOf: $L_search: check if $L_entry has $L_nsroledn as nsroledn attribute\n"); + + open (LDAP2, "$L_search |"); + while () { + s/\n //g; + if (/^nsrole: (.*)\n/) { + $L_currentrole = $1; + $L_currentrole=~ tr/A-Z/a-z/; + if ( $L_currentrole eq $L_nsroledn ) + { + # the parm is part of the $L_entry nsroledn + debug("\t\t<--memberOf: $L_entry locked through $L_nsroledn\n"); + return 0; + } + } + } + close(LDAP2); + + # the parm is not part of the $L_entry nsroledn + debug("\t\t<--memberOf: $L_entry not locked through $L_nsroledn\n"); + return 1; +} + + +# -------------------------- +# Remove the rdn of a DN +# argv[0] is a DN +# -------------------------- +sub removeRdn +{ + $L_entry=$_[0]; + + @L_entryToTest=split /([,])/,$L_entry; + debug("removeRdn: entry to split: $L_entry**@L_entryToTest\n"); + + $newDN=""; + $removeRDN=1; + foreach $part (@L_entryToTest) + { + $part=~ s/^ +//; + $part=~ tr/A-Z/a-z/; + if ( $removeRDN <= 2 ) + { + $removeRDN=$removeRDN+1; + } + else + { + $newDN="$newDN$part"; + } + } + + debug("removeRdn: new DN **$newDN**\n"); +} + +# -------------------------- +# Check if L_current is below the scope of +# L_nestedRole +# argv[0] is a role +# argv[1] is the nested role +# -------------------------- +sub checkScope +{ + $L_current=$_[0]; + $L_nestedRole=$_[1]; + + debug("checkScope: check if $L_current is below $L_nestedRole\n"); + + removeRdn($L_nestedRole); + $L_nestedRoleSuffix=$newDN; + debug("checkScope: nested role based: $L_nestedRoleSuffix\n"); + + $cont=1; + while ( ($cont == 1) && ($L_current ne "") ) + { + removeRdn($L_current); + $currentDn=$newDN; + debug("checkScope: current DN to check: $currentDn\n"); + + if ( $currentDn eq $L_nestedRoleSuffix ) + { + debug("checkScope: DN match!!!\n"); + $cont = 0; + } + else + { + $L_current=$currentDn; + } + } + + if ( $cont == 1 ) + { + debug("checkScope: $_[0] and $_[1] are not compatible\n"); + return 0; + } + else + { + debug("checkScope: $_[0] and $_[1] are compatible\n"); + return 1; + } +} + + +############################### +# MAIN ROUTINE +############################### + +# Generated variable +$dsroot="{{DS-ROOT}}"; + +# Determine which command we are running +if ( $0 =~ /ns-inactivate(.pl)?$/ ) +{ + $cmd="ns-inactivate.pl"; + $operation="inactivate"; + $state="inactivated"; + $modrole="add"; + $already="already"; +} +elsif ( $0 =~ /ns-activate(.pl)?$/ ) +{ + $cmd="ns-activate.pl"; + $operation="activate"; + $state="activated"; + $modrole="delete"; + $already="already"; +} +elsif ( $0 =~ /ns-accountstatus(.pl)?$/ ) +{ + $cmd="ns-accountstatus.pl"; + $operation="get status of"; + $state="activated"; + # no need for $modrole as no operation is performed + $already=""; + +} +else +{ + out("$0: unknown command\n"); + exit 100; +} + +debug("Running ** $cmd ** $operation\n"); + +$dsbinroot="$dsroot{{SEP}}shared{{SEP}}bin"; +$ldapsearch="$dsbinroot{{SEP}}ldapsearch -1"; +$ldapmodify="$dsbinroot{{SEP}}ldapmodify"; + +# Default values +$defrootdn= "{{ROOT-DN}}"; +$defhost= "{{SERVER-NAME}}"; +$defport= "{{SERVER-PORT}}"; + +# User values +$rootdn= "{{ROOT-DN}}"; +$rootpw= ""; +$pwfile= ""; +$host= "{{SERVER-NAME}}"; +$port= "{{SERVER-PORT}}"; +$entry= ""; + +$single=0; +$role=0; + +chdir("$dsbinroot"); + +# Process the command line arguments +while( $arg = shift) +{ + if($arg eq "-?") + { + usage_and_exit(); + } + elsif($arg eq "-D") + { + $rootdn= shift @ARGV; + } + elsif($arg eq "-w") + { + $rootpw= shift @ARGV; + } + elsif($arg eq "-j") + { + $pwfile= shift @ARGV; + } + elsif($arg eq "-p") + { + $port= shift @ARGV; + } + elsif($arg eq "-h") + { + $host= shift @ARGV; + } + elsif($arg eq "-I") + { + $entry= shift @ARGV; + } + else + { + print "$arg: Unknown command line argument.\n"; + usage_and_exit(); + } +} + +if ($pwfile ne ""){ +# Open file and get the password + unless (open (RPASS, $pwfile)) { + die "Error, cannot open password file $passwdfile\n"; + } + $rootpw = ; + chomp($rootpw); + close(RPASS); +} elsif ($rootpw eq "-"){ +# Read the password from terminal + die "The '-w -' option requires an extension library (Term::ReadKey) which is not\n", + "part of the standard perl distribution. If you want to use it, you must\n", + "download and install the module. You can find it at\n", + "http://www.perl.com/CPAN/CPAN.html\n"; +# Remove the previous line and uncomment the following 6 lines once you have installed Term::ReadKey module. +# use Term::ReadKey; +# print "Bind Password: "; +# ReadMode('noecho'); +# $rootpw = ReadLine(0); +# chomp($rootpw); +# ReadMode('normal'); +} + +if( $rootpw eq "" ) +{ + usage_and_exit(); +} + +if( $entry eq "" ) +{ + usage_and_exit(); +} + +# +# Check the actual existence of the entry to inactivate/activate +# and at the same time, validate the various parm: port, host, rootdn, rootpw +# +@exist=`$ldapsearch -p $port -h $host -D \"$rootdn\" -w \"$rootpw\" -s base -b \"$entry\" \"(objectclass=*)\" dn`; +$retCode1=$?; +if ( $retCode1 != 0 ) +{ + $retCode1=$?>>8; + exit $retCode1; +} + +@isRole=`$ldapsearch -p $port -h $host -D \"$rootdn\" -w \"$rootpw\" -s base -b \"$entry\" \"(&(objectclass=LDAPsubentry)(objectclass=nsRoleDefinition))\" dn`; +$nbLineRole=@isRole; +$retCode2=$?; +if ( $retCode2 != 0 ) +{ + $retCode2=$?>>8; + exit $retCode2; +} + +if ( $nbLineRole == 1 ) +{ + debug("Groups of users\n"); + $role=1; +} +else +{ + debug("Single user\n"); + $single=1; +} + +# +# First of all, check the existence of the nsaccountlock attribute in the entry +# +$isLocked=0; +if ( $single == 1 ) +{ + $searchAccountLock="$ldapsearch -p $port -h $host -D \"$rootdn\" -w \"$rootpw\" -s base -b \"$entry\" \"(objectclass=*)\" nsaccountlock"; + open (LDAP1, "$searchAccountLock |"); + while () { + s/\n //g; + if (/^nsaccountlock: (.*)\n/) { + $L_currentvalue = $1; + $L_currentvalue=~ tr/A-Z/a-z/; + if ( $L_currentvalue eq "true") + { + $isLocked=1; + } + elsif ( $L_currentvalue eq "false" ) + { + $isLocked=0; + } + } + } + close(LDAP1); +} +debug("Is the entry already locked? ==> $isLocked\n"); + +# +# Get the suffix name of that entry +# + +# Remove the space at the beginning (just in case...) +# -I "uid=jvedder , ou=People , o=sun.com" +@suffix=split /([,])/,$entry; +$result=""; +foreach $part (@suffix) +{ + $part=~s/^ +//; + $part=~ tr/A-Z/a-z/; + $result="$result$part"; +} +@suffixN=$result; + +debug("Entry to $operation: #@suffix#\n"); +debug("Entry to $operation: #@suffixN#\n"); + +# Get the suffix +$cont=0; +while ($cont == 0) +{ + # Look if suffix is the suffix of the entry + # ldapsearch -s one -b "cn=mapping tree,cn=config" "cn=\"uid=jvedder,ou=People,o=sun.com\"" + # + debug("\tSuffix from the entry: #@suffixN#\n"); + @mapping=`$ldapsearch -p $port -h $host -D \"$rootdn\" -w \"$rootpw\" -s one -b \"cn=mapping tree, cn=config\" \"cn=\\"@suffixN\\"\" cn `; + + $retCode=$?; + if ( $retCode != 0 ) + { + $retCode=$?>>8; + exit $retCode; + } + + # If we get a result, remove the dn: + # dn: cn="o=sun.com",cn=mapping tree,cn=config + # cn: "o=sun.com" + # + shift @mapping; + + foreach $res (@mapping) + { + # Break the string cn: "o=sun.com" into pieces + @cn= split(/ /,$res); + + # And remove the cn: part + shift @cn; + + # Now compare the suffix we extract from the mapping tree + # with the suffix derived from the entry + debug("\tSuffix from mapping tree: #@cn#\n"); + if ( @cn eq @suffixN ) { + debug("Found matching suffix\n"); + $cont=1; + } + } + + if ( $cont == 0 ) + { + # Remove the current rdn to try another suffix + shift @suffix; + + $result=""; + foreach $part (@suffix) + { + $part=~ s/^ +//; + $part=~ tr/A-Z/a-z/; + $result="$result$part"; + } + @suffixN=$result; + + debug("\t\tNothing found => go up one level in rdn #@suffix#\n"); + $len=@suffix; + if ( $len == 0 ) + { + debug("Can not find suffix. Problem\n"); + $cont=2; + } + } +} +if ( $cont == 2) +{ + out("Can not find suffix for entry $entry\n"); + exit 100; +} + +if ( $operation eq "inactivate" ) +{ + # + # Now that we have the suffix and we know if we deal with a single entry or + # a role, just try to create the COS and roles associated. + # + @base=( + "cn=nsManagedDisabledRole,@suffixN", + "cn=nsDisabledRole,@suffixN", + "cn=nsAccountInactivationTmp,@suffixN", + "\'cn=\"cn=nsDisabledRole,@suffixN\",cn=nsAccountInactivationTmp,@suffixN\'", + "cn=nsAccountInactivation_cos,@suffixN" ); + + $addrolescos="$ldapmodify -p $port -h $host -D \"$rootdn\" -w \"$rootpw\" -c -a >> {{DEV-NULL}} 2>&1 "; + @role1=( + "dn: cn=nsManagedDisabledRole,@suffixN\n", + "objectclass: LDAPsubentry\n", + "objectclass: nsRoleDefinition\n", + "objectclass: nsSimpleRoleDefinition\n", + "objectclass: nsManagedRoleDefinition\n", + "cn: nsManagedDisabledRole\n\n" ); + @role2=( + "dn: cn=nsDisabledRole,@suffixN\n", + "objectclass: top\n", + "objectclass: LDAPsubentry\n", + "objectclass: nsRoleDefinition\n", + "objectclass: nsComplexRoleDefinition\n", + "objectclass: nsNestedRoleDefinition\n", + "nsRoleDN: cn=nsManagedDisabledRole,@suffixN\n", + "cn: nsDisabledRole\n\n" ); + @cos1=( + "dn: cn=nsAccountInactivationTmp,@suffixN\n", + "objectclass: top\n", + "objectclass: nsContainer\n\n" ); + @cos2=( + "dn: cn=\"cn=nsDisabledRole,@suffixN\",cn=nsAccountInactivationTmp,@suffixN\n", + "objectclass: top\n", + "objectclass: extensibleObject\n", + "objectclass: costemplate\n", + "objectclass: ldapsubentry\n", + "cosPriority: 1\n", + "nsAccountLock: true\n\n" ); + @cos3=( + "dn: cn=nsAccountInactivation_cos,@suffixN\n", + "objectclass: top\n", + "objectclass: LDAPsubentry\n", + "objectclass: cosSuperDefinition\n", + "objectclass: cosClassicDefinition\n", + "cosTemplateDn: cn=nsAccountInactivationTmp,@suffixN\n", + "cosSpecifier: nsRole\n", + "cosAttribute: nsAccountLock operational\n\n" ); + + @all=(\@role1, \@role2, \@cos1, \@cos2, \@cos3); + + $i=0; + + foreach $current (@base) + { + debug("Creating $current ??\n"); + open(FD,"| $addrolescos "); + print FD @{$all[$i]}; + close(FD); + if ( $? != 0 ) + { + $retCode=$?>>8; + if ( $retCode == 68 ) + { + debug("Entry $current already exists, ignore error\n"); + } + else + { + # Probably a more serious problem. + # Exit with LDAP error + exit $retCode; + } + } + else + { + debug("Entry $current created\n"); + } + $i=$i+1; + } +} + +$skipManaged=0; +$skipDisabled=0; +$directLocked=0; + +$nsDisabledRole="cn=nsDisabledRole,@suffixN"; +$nsDisabledRole=~ tr/A-Z/a-z/; + +$nsManagedDisabledRole="cn=nsManagedDisabledRole,@suffixN"; +$nsManagedDisabledRole=~ tr/A-Z/a-z/; + +if ( $operation eq "inactivate" ) +{ + # Go through all the roles part of nsdisabledrole to check if the entry + # is a member of one of those roles + $ret=indirectLock("LDAP00", $entry, $nsDisabledRole); + if ( $ret == 0 ) + { + if ( $throughRole ne $nsDisabledRole && $throughRole ne $nsManagedDisabledRole ) + { + # indirect lock + out("$entry already $state through $throughRole.\n"); + } + else + { + # direct lock + out("$entry already $state.\n"); + } + exit 100; + } + elsif ( $isLocked == 1 ) + { + # the entry is not locked through a role, may be nsaccountlock is "hardcoded" ? + out("$entry already $state (probably directly).\n"); + exit 103; + } +} +elsif ( $operation eq "activate" || $operation eq "get status of" ) +{ + $skipManaged=$single; + $skipDisabled=$role; + + $ret=indirectLock("LDAP00",$entry, $nsDisabledRole); + + if ( $ret == 0 ) + { + # undirectly locked + if ( $throughRole ne $nsDisabledRole && $throughRole ne $nsManagedDisabledRole ) + { + if ( $operation eq "activate" ) + { + out("$entry inactivated through $throughRole. Can not activate it individually.\n"); + exit 100; + } + else + { + out("$entry inactivated through $throughRole.\n"); + exit 104; + } + } + debug("$entry locked individually\n"); + + if ( $operation ne "activate" ) + { + out("$entry inactivated.\n"); + exit 103; + } + } + elsif ( $directLocked == 0 ) + { + if ( $operation eq "activate" && $isLocked != 1 ) + { + out("$entry $already $state.\n"); + exit 100; + } + elsif ( $isLocked != 1 ) + { + out("$entry $already $state.\n"); + exit 102; + } + else + { + # not locked using our schema, but nsaccountlock is probably present + out("$entry inactivated (probably directly).\n"); + exit 103; + } + } + elsif ( $operation ne "activate" ) + { + out("$entry inactivated.\n"); + exit 103; + } + # else Locked directly, juste unlock it! + debug("$entry locked individually\n"); +} + +# +# Inactivate/activate the entry +# +$action="$ldapmodify -p $port -h $host -D \"$rootdn\" -w \"$rootpw\" -c >> {{DEV-NULL}} 2>&1"; +if ( $single == 1 ) +{ + @record=( + "dn: $entry\n", + "changetype: modify\n", + "$modrole: nsRoleDN\n", + "nsRoleDN: cn=nsManagedDisabledRole,@suffixN\n\n" ); +} +else +{ + @record=( + "dn: cn=nsDisabledRole,@suffixN\n", + "changetype: modify\n", + "$modrole: nsRoleDN\n", + "nsRoleDN: $entry\n\n" ); +} +open(FD,"| $action "); +print FD @record; +close(FD); +if ( $? != 0 ) +{ +debug("$modrole, $entry\n"); + $retCode=$?>>8; + exit $retCode; +} + +out("$entry $state.\n"); +exit 0; diff --git a/ldap/admin/src/scripts/template-ns-activate.pl b/ldap/admin/src/scripts/template-ns-activate.pl new file mode 100644 index 00000000..5913f7ad --- /dev/null +++ b/ldap/admin/src/scripts/template-ns-activate.pl @@ -0,0 +1,813 @@ +#{{PERL-EXEC}} +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2004 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# + +############################### +# SUB-ROUTINES +############################### + +sub usage_and_exit +{ + print (STDERR "$cmd [-D rootdn] { -w password | -w - | -j filename } \n"); + print (STDERR " [-p port] [-h host] -I DN-to-$operation\n\n"); + print (STDERR "May be used to $operation a user or a domain of users\n\n"); + print (STDERR "Arguments:\n"); + print (STDERR " -? - help\n"); + print (STDERR " -D rootdn - Provide a Directory Manager DN. Default= '$defrootdn'\n"); + print (STDERR " -w password - Provide a password for the Directory Manager DN\n"); + print (STDERR " -w - - Prompt for the Directory Manager's password\n"); + print (STDERR " -j filename - Read the Directory Manager's password from file\n"); + print (STDERR " -p port - Provide a port. Default= '$defport'\n"); + print (STDERR " -h host - Provide a host name. Default= '$defhost'\n"); + print (STDERR " -I DN-to-$operation - Single entry DN or role DN to $operation\n"); + exit 100; +} + +sub debug +{ +# print " ==> @_"; +} + +sub out +{ + print "@_"; +} + +# -------------------------- +# Check if the entry is part of a locked role: +# i.e.: for each role member (nsroledn) of nsdisabledrole, check if +# * it is the same as the entry +# * the entry is member of role (==has nsroledn attributes), compare each of +# them with the nsroledn of nsdisabledrole +# * if nsroledn of nsdisabledrole are complex, go through each of them +# argv[0] is the local file handler +# argv[1] is the entry (may be a single entry DN or a role DN) +# argv[2] is the base for the search +# -------------------------- + +$throughRole=""; + +sub indirectLock +{ + # For recursivity, file handler must be local + my $L_filehandle=$_[0]; + $L_filehandle++; + + my $L_entry=$_[1]; + # Remove useless space + my @L_intern=split /([,])/,$L_entry; + my $L_result=""; + foreach $L_part (@L_intern) + { + $L_part=~s/^ +//; + $L_part=~ tr/A-Z/a-z/; + $L_result="$L_result$L_part"; + } + $L_entry=$L_result; + + my $L_base=$_[2]; + + my $L_search; + my $L_currentrole; + my $L_retCode; + + my $L_local; + +`$ldapsearch -p $port -h $host -D \"$rootdn\" -w \"$rootpw\" -s base -b \"$L_base\" \"(|(objectclass=*)(objectclass=ldapsubentry))\" nsroledn >> {{DEV-NULL}} 2>&1 `; +$retCode=$?; +if ( $retCode != 0 ) +{ + $retCode=$?>>8; + return 1; +} + + # Check if the role is a nested role + @L_Nested="$ldapsearch -p $port -h $host -D \"$rootdn\" -w \"$rootpw\" -s base -b \"$L_base\" \"(|(objectclass=nsNestedRoleDefinition)(objectclass=ldapsubentry))\" "; + # L_isNested == 1 means that we are going through a nested role, so for each member of that + # nested role, check that the member is below the scope of the nested + $L_isNested=@L_Nested; + + # Not Direct Lock, Go through roles if any + $L_search="$ldapsearch -p $port -h $host -D \"$rootdn\" -w \"$rootpw\" -s base -b \"$L_base\" \"(|(objectclass=*)(objectclass=ldapsubentry))\" nsroledn "; + + debug("\t-->indirectLock: check if $L_entry is part of a locked role from base $L_base\n\n"); + + unless (open ($L_filehandle, "$L_search |")) + { + out("Can't open file $L_filehandle\n"); + exit; + } + while (<$L_filehandle>) { + + s/\n //g; + if (/^nsroledn: (.*)\n/) { + $L_currentrole = $1; + + # Remove useless space + my @L_intern=split /([,])/,$L_currentrole; + my $L_result=""; + foreach $L_part (@L_intern) + { + $L_part=~s/^ +//; + $L_part=~ tr/A-Z/a-z/; + $L_result="$L_result$L_part"; + } + $L_currentrole=$L_result; + + debug("\t-- indirectLock loop: current nsroledn $L_currentrole of base $L_base\n"); + if ( $L_isNested == 1 ) + { + if ( checkScope($L_currentrole, $L_base) == 0 ) + { + # Scope problem probably a bad conf, skip the currentrole + next; + } + } + + if ( $L_currentrole eq $L_entry ) + { + # the entry is a role that is directly locked + # i.e, nsroledn of nsdisabledrole contains the entry + $throughRole=$L_base; + $throughRole=~ tr/A-Z/a-z/; + + # skipDisabled means that we've just found that the entry (which is a role) + # is locked directly (==its DN is part of nsroledn attributes) + # we just want to know now, if it is locked through another role + # at least, one + if ( $skipDisabled == 1 ) + { + # direct inactivation + $directLocked=1; + # just go through that test once + $skipDisabled=0; + next; + } + debug("\t-- 1 indirectLock: $L_currentrole locked throughRole == $throughRole\n"); + return 0; + } + + $L_retCode=memberOf($L_currentrole, $L_entry); + if ( $L_retCode == 0 && $single == 1 ) + { + $throughRole=$L_currentrole; + $throughRole=~ tr/A-Z/a-z/; + if ( $skipManaged == 1 ) + { + if ( $L_currentrole eq $nsManagedDisabledRole) + { + # Try next nsroledn + $directLocked=1; + $skipManaged=0; + next; + } + } + debug("\t-- 2 indirectLock: $L_currentrole locked throughRole == $throughRole\n"); + return 0; + } + + # Only for the first iteration + # the first iteration is with nsdisabledrole as base, other + # loops are deeper + $L_local=$skipDisabled; + $skipDisabled=0; + + # the current nsroledn may be a complex role, just go through + # its won nsroledn + $L_retCode=indirectLock($L_filehandle,$L_entry, $L_currentrole); + + # Because of recursivity, to keep the initial value for the first level + $skipDisabled=$L_local; + + if ( $L_retCode == 0 ) + { + $throughRole=$L_currentrole; + $throughRole=~ tr/A-Z/a-z/; + debug("\t-- 3 indirectLock: $L_entry locked throughRole == $throughRole\n"); + return 0; + } + } + } + + close($L_filehandle); + + debug("\t<--indirectLock: no more nsroledn to process\n"); + return 1; +} + +# -------------------------- +# Check if nsroledn is part of the entry attributes +# argv[0] is a role DN (nsroledn attribute) +# argv[1] is the entry +# -------------------------- +sub memberOf +{ + my $L_nsroledn=$_[0]; + $L_nsroledn=~ tr/A-Z/a-z/; + + my $L_entry=$_[1]; + + my $L_search; + my $L_currentrole; + + $L_search="$ldapsearch -p $port -h $host -D \"$rootdn\" -w \"$rootpw\" -s base -b \"$L_entry\" \"(|(objectclass=*)(objectclass=ldapsubentry))\" nsrole"; + + debug("\t\t-->memberOf: $L_search: check if $L_entry has $L_nsroledn as nsroledn attribute\n"); + + open (LDAP2, "$L_search |"); + while () { + s/\n //g; + if (/^nsrole: (.*)\n/) { + $L_currentrole = $1; + $L_currentrole=~ tr/A-Z/a-z/; + if ( $L_currentrole eq $L_nsroledn ) + { + # the parm is part of the $L_entry nsroledn + debug("\t\t<--memberOf: $L_entry locked through $L_nsroledn\n"); + return 0; + } + } + } + close(LDAP2); + + # the parm is not part of the $L_entry nsroledn + debug("\t\t<--memberOf: $L_entry not locked through $L_nsroledn\n"); + return 1; +} + + +# -------------------------- +# Remove the rdn of a DN +# argv[0] is a DN +# -------------------------- +sub removeRdn +{ + $L_entry=$_[0]; + + @L_entryToTest=split /([,])/,$L_entry; + debug("removeRdn: entry to split: $L_entry**@L_entryToTest\n"); + + $newDN=""; + $removeRDN=1; + foreach $part (@L_entryToTest) + { + $part=~ s/^ +//; + $part=~ tr/A-Z/a-z/; + if ( $removeRDN <= 2 ) + { + $removeRDN=$removeRDN+1; + } + else + { + $newDN="$newDN$part"; + } + } + + debug("removeRdn: new DN **$newDN**\n"); +} + +# -------------------------- +# Check if L_current is below the scope of +# L_nestedRole +# argv[0] is a role +# argv[1] is the nested role +# -------------------------- +sub checkScope +{ + $L_current=$_[0]; + $L_nestedRole=$_[1]; + + debug("checkScope: check if $L_current is below $L_nestedRole\n"); + + removeRdn($L_nestedRole); + $L_nestedRoleSuffix=$newDN; + debug("checkScope: nested role based: $L_nestedRoleSuffix\n"); + + $cont=1; + while ( ($cont == 1) && ($L_current ne "") ) + { + removeRdn($L_current); + $currentDn=$newDN; + debug("checkScope: current DN to check: $currentDn\n"); + + if ( $currentDn eq $L_nestedRoleSuffix ) + { + debug("checkScope: DN match!!!\n"); + $cont = 0; + } + else + { + $L_current=$currentDn; + } + } + + if ( $cont == 1 ) + { + debug("checkScope: $_[0] and $_[1] are not compatible\n"); + return 0; + } + else + { + debug("checkScope: $_[0] and $_[1] are compatible\n"); + return 1; + } +} + + +############################### +# MAIN ROUTINE +############################### + +# Generated variable +$dsroot="{{DS-ROOT}}"; + +# Determine which command we are running +if ( $0 =~ /ns-inactivate(.pl)?$/ ) +{ + $cmd="ns-inactivate.pl"; + $operation="inactivate"; + $state="inactivated"; + $modrole="add"; + $already="already"; +} +elsif ( $0 =~ /ns-activate(.pl)?$/ ) +{ + $cmd="ns-activate.pl"; + $operation="activate"; + $state="activated"; + $modrole="delete"; + $already="already"; +} +elsif ( $0 =~ /ns-accountstatus(.pl)?$/ ) +{ + $cmd="ns-accountstatus.pl"; + $operation="get status of"; + $state="activated"; + # no need for $modrole as no operation is performed + $already=""; + +} +else +{ + out("$0: unknown command\n"); + exit 100; +} + +debug("Running ** $cmd ** $operation\n"); + +$dsbinroot="$dsroot{{SEP}}shared{{SEP}}bin"; +$ldapsearch="$dsbinroot{{SEP}}ldapsearch -1"; +$ldapmodify="$dsbinroot{{SEP}}ldapmodify"; + +# Default values +$defrootdn= "{{ROOT-DN}}"; +$defhost= "{{SERVER-NAME}}"; +$defport= "{{SERVER-PORT}}"; + +# User values +$rootdn= "{{ROOT-DN}}"; +$rootpw= ""; +$pwfile= ""; +$host= "{{SERVER-NAME}}"; +$port= "{{SERVER-PORT}}"; +$entry= ""; + +$single=0; +$role=0; + +chdir("$dsbinroot"); + +# Process the command line arguments +while( $arg = shift) +{ + if($arg eq "-?") + { + usage_and_exit(); + } + elsif($arg eq "-D") + { + $rootdn= shift @ARGV; + } + elsif($arg eq "-w") + { + $rootpw= shift @ARGV; + } + elsif($arg eq "-j") + { + $pwfile= shift @ARGV; + } + elsif($arg eq "-p") + { + $port= shift @ARGV; + } + elsif($arg eq "-h") + { + $host= shift @ARGV; + } + elsif($arg eq "-I") + { + $entry= shift @ARGV; + } + else + { + print "$arg: Unknown command line argument.\n"; + usage_and_exit(); + } +} + +if ($pwfile ne ""){ +# Open file and get the password + unless (open (RPASS, $pwfile)) { + die "Error, cannot open password file $passwdfile\n"; + } + $rootpw = ; + chomp($rootpw); + close(RPASS); +} elsif ($rootpw eq "-"){ +# Read the password from terminal + die "The '-w -' option requires an extension library (Term::ReadKey) which is not\n", + "part of the standard perl distribution. If you want to use it, you must\n", + "download and install the module. You can find it at\n", + "http://www.perl.com/CPAN/CPAN.html\n"; +# Remove the previous line and uncomment the following 6 lines once you have installed Term::ReadKey module. +# use Term::ReadKey; +# print "Bind Password: "; +# ReadMode('noecho'); +# $rootpw = ReadLine(0); +# chomp($rootpw); +# ReadMode('normal'); +} + +if( $rootpw eq "" ) +{ + usage_and_exit(); +} + +if( $entry eq "" ) +{ + usage_and_exit(); +} + +# +# Check the actual existence of the entry to inactivate/activate +# and at the same time, validate the various parm: port, host, rootdn, rootpw +# +@exist=`$ldapsearch -p $port -h $host -D \"$rootdn\" -w \"$rootpw\" -s base -b \"$entry\" \"(objectclass=*)\" dn`; +$retCode1=$?; +if ( $retCode1 != 0 ) +{ + $retCode1=$?>>8; + exit $retCode1; +} + +@isRole=`$ldapsearch -p $port -h $host -D \"$rootdn\" -w \"$rootpw\" -s base -b \"$entry\" \"(&(objectclass=LDAPsubentry)(objectclass=nsRoleDefinition))\" dn`; +$nbLineRole=@isRole; +$retCode2=$?; +if ( $retCode2 != 0 ) +{ + $retCode2=$?>>8; + exit $retCode2; +} + +if ( $nbLineRole == 1 ) +{ + debug("Groups of users\n"); + $role=1; +} +else +{ + debug("Single user\n"); + $single=1; +} + +# +# First of all, check the existence of the nsaccountlock attribute in the entry +# +$isLocked=0; +if ( $single == 1 ) +{ + $searchAccountLock="$ldapsearch -p $port -h $host -D \"$rootdn\" -w \"$rootpw\" -s base -b \"$entry\" \"(objectclass=*)\" nsaccountlock"; + open (LDAP1, "$searchAccountLock |"); + while () { + s/\n //g; + if (/^nsaccountlock: (.*)\n/) { + $L_currentvalue = $1; + $L_currentvalue=~ tr/A-Z/a-z/; + if ( $L_currentvalue eq "true") + { + $isLocked=1; + } + elsif ( $L_currentvalue eq "false" ) + { + $isLocked=0; + } + } + } + close(LDAP1); +} +debug("Is the entry already locked? ==> $isLocked\n"); + +# +# Get the suffix name of that entry +# + +# Remove the space at the beginning (just in case...) +# -I "uid=jvedder , ou=People , o=sun.com" +@suffix=split /([,])/,$entry; +$result=""; +foreach $part (@suffix) +{ + $part=~s/^ +//; + $part=~ tr/A-Z/a-z/; + $result="$result$part"; +} +@suffixN=$result; + +debug("Entry to $operation: #@suffix#\n"); +debug("Entry to $operation: #@suffixN#\n"); + +# Get the suffix +$cont=0; +while ($cont == 0) +{ + # Look if suffix is the suffix of the entry + # ldapsearch -s one -b "cn=mapping tree,cn=config" "cn=\"uid=jvedder,ou=People,o=sun.com\"" + # + debug("\tSuffix from the entry: #@suffixN#\n"); + @mapping=`$ldapsearch -p $port -h $host -D \"$rootdn\" -w \"$rootpw\" -s one -b \"cn=mapping tree, cn=config\" \"cn=\\"@suffixN\\"\" cn `; + + $retCode=$?; + if ( $retCode != 0 ) + { + $retCode=$?>>8; + exit $retCode; + } + + # If we get a result, remove the dn: + # dn: cn="o=sun.com",cn=mapping tree,cn=config + # cn: "o=sun.com" + # + shift @mapping; + + foreach $res (@mapping) + { + # Break the string cn: "o=sun.com" into pieces + @cn= split(/ /,$res); + + # And remove the cn: part + shift @cn; + + # Now compare the suffix we extract from the mapping tree + # with the suffix derived from the entry + debug("\tSuffix from mapping tree: #@cn#\n"); + if ( @cn eq @suffixN ) { + debug("Found matching suffix\n"); + $cont=1; + } + } + + if ( $cont == 0 ) + { + # Remove the current rdn to try another suffix + shift @suffix; + + $result=""; + foreach $part (@suffix) + { + $part=~ s/^ +//; + $part=~ tr/A-Z/a-z/; + $result="$result$part"; + } + @suffixN=$result; + + debug("\t\tNothing found => go up one level in rdn #@suffix#\n"); + $len=@suffix; + if ( $len == 0 ) + { + debug("Can not find suffix. Problem\n"); + $cont=2; + } + } +} +if ( $cont == 2) +{ + out("Can not find suffix for entry $entry\n"); + exit 100; +} + +if ( $operation eq "inactivate" ) +{ + # + # Now that we have the suffix and we know if we deal with a single entry or + # a role, just try to create the COS and roles associated. + # + @base=( + "cn=nsManagedDisabledRole,@suffixN", + "cn=nsDisabledRole,@suffixN", + "cn=nsAccountInactivationTmp,@suffixN", + "\'cn=\"cn=nsDisabledRole,@suffixN\",cn=nsAccountInactivationTmp,@suffixN\'", + "cn=nsAccountInactivation_cos,@suffixN" ); + + $addrolescos="$ldapmodify -p $port -h $host -D \"$rootdn\" -w \"$rootpw\" -c -a >> {{DEV-NULL}} 2>&1 "; + @role1=( + "dn: cn=nsManagedDisabledRole,@suffixN\n", + "objectclass: LDAPsubentry\n", + "objectclass: nsRoleDefinition\n", + "objectclass: nsSimpleRoleDefinition\n", + "objectclass: nsManagedRoleDefinition\n", + "cn: nsManagedDisabledRole\n\n" ); + @role2=( + "dn: cn=nsDisabledRole,@suffixN\n", + "objectclass: top\n", + "objectclass: LDAPsubentry\n", + "objectclass: nsRoleDefinition\n", + "objectclass: nsComplexRoleDefinition\n", + "objectclass: nsNestedRoleDefinition\n", + "nsRoleDN: cn=nsManagedDisabledRole,@suffixN\n", + "cn: nsDisabledRole\n\n" ); + @cos1=( + "dn: cn=nsAccountInactivationTmp,@suffixN\n", + "objectclass: top\n", + "objectclass: nsContainer\n\n" ); + @cos2=( + "dn: cn=\"cn=nsDisabledRole,@suffixN\",cn=nsAccountInactivationTmp,@suffixN\n", + "objectclass: top\n", + "objectclass: extensibleObject\n", + "objectclass: costemplate\n", + "objectclass: ldapsubentry\n", + "cosPriority: 1\n", + "nsAccountLock: true\n\n" ); + @cos3=( + "dn: cn=nsAccountInactivation_cos,@suffixN\n", + "objectclass: top\n", + "objectclass: LDAPsubentry\n", + "objectclass: cosSuperDefinition\n", + "objectclass: cosClassicDefinition\n", + "cosTemplateDn: cn=nsAccountInactivationTmp,@suffixN\n", + "cosSpecifier: nsRole\n", + "cosAttribute: nsAccountLock operational\n\n" ); + + @all=(\@role1, \@role2, \@cos1, \@cos2, \@cos3); + + $i=0; + + foreach $current (@base) + { + debug("Creating $current ??\n"); + open(FD,"| $addrolescos "); + print FD @{$all[$i]}; + close(FD); + if ( $? != 0 ) + { + $retCode=$?>>8; + if ( $retCode == 68 ) + { + debug("Entry $current already exists, ignore error\n"); + } + else + { + # Probably a more serious problem. + # Exit with LDAP error + exit $retCode; + } + } + else + { + debug("Entry $current created\n"); + } + $i=$i+1; + } +} + +$skipManaged=0; +$skipDisabled=0; +$directLocked=0; + +$nsDisabledRole="cn=nsDisabledRole,@suffixN"; +$nsDisabledRole=~ tr/A-Z/a-z/; + +$nsManagedDisabledRole="cn=nsManagedDisabledRole,@suffixN"; +$nsManagedDisabledRole=~ tr/A-Z/a-z/; + +if ( $operation eq "inactivate" ) +{ + # Go through all the roles part of nsdisabledrole to check if the entry + # is a member of one of those roles + $ret=indirectLock("LDAP00", $entry, $nsDisabledRole); + if ( $ret == 0 ) + { + if ( $throughRole ne $nsDisabledRole && $throughRole ne $nsManagedDisabledRole ) + { + # indirect lock + out("$entry already $state through $throughRole.\n"); + } + else + { + # direct lock + out("$entry already $state.\n"); + } + exit 100; + } + elsif ( $isLocked == 1 ) + { + # the entry is not locked through a role, may be nsaccountlock is "hardcoded" ? + out("$entry already $state (probably directly).\n"); + exit 103; + } +} +elsif ( $operation eq "activate" || $operation eq "get status of" ) +{ + $skipManaged=$single; + $skipDisabled=$role; + + $ret=indirectLock("LDAP00",$entry, $nsDisabledRole); + + if ( $ret == 0 ) + { + # undirectly locked + if ( $throughRole ne $nsDisabledRole && $throughRole ne $nsManagedDisabledRole ) + { + if ( $operation eq "activate" ) + { + out("$entry inactivated through $throughRole. Can not activate it individually.\n"); + exit 100; + } + else + { + out("$entry inactivated through $throughRole.\n"); + exit 104; + } + } + debug("$entry locked individually\n"); + + if ( $operation ne "activate" ) + { + out("$entry inactivated.\n"); + exit 103; + } + } + elsif ( $directLocked == 0 ) + { + if ( $operation eq "activate" && $isLocked != 1 ) + { + out("$entry $already $state.\n"); + exit 100; + } + elsif ( $isLocked != 1 ) + { + out("$entry $already $state.\n"); + exit 102; + } + else + { + # not locked using our schema, but nsaccountlock is probably present + out("$entry inactivated (probably directly).\n"); + exit 103; + } + } + elsif ( $operation ne "activate" ) + { + out("$entry inactivated.\n"); + exit 103; + } + # else Locked directly, juste unlock it! + debug("$entry locked individually\n"); +} + +# +# Inactivate/activate the entry +# +$action="$ldapmodify -p $port -h $host -D \"$rootdn\" -w \"$rootpw\" -c >> {{DEV-NULL}} 2>&1"; +if ( $single == 1 ) +{ + @record=( + "dn: $entry\n", + "changetype: modify\n", + "$modrole: nsRoleDN\n", + "nsRoleDN: cn=nsManagedDisabledRole,@suffixN\n\n" ); +} +else +{ + @record=( + "dn: cn=nsDisabledRole,@suffixN\n", + "changetype: modify\n", + "$modrole: nsRoleDN\n", + "nsRoleDN: $entry\n\n" ); +} +open(FD,"| $action "); +print FD @record; +close(FD); +if ( $? != 0 ) +{ +debug("$modrole, $entry\n"); + $retCode=$?>>8; + exit $retCode; +} + +out("$entry $state.\n"); +exit 0; diff --git a/ldap/admin/src/scripts/template-ns-inactivate.pl b/ldap/admin/src/scripts/template-ns-inactivate.pl new file mode 100644 index 00000000..5913f7ad --- /dev/null +++ b/ldap/admin/src/scripts/template-ns-inactivate.pl @@ -0,0 +1,813 @@ +#{{PERL-EXEC}} +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2004 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# + +############################### +# SUB-ROUTINES +############################### + +sub usage_and_exit +{ + print (STDERR "$cmd [-D rootdn] { -w password | -w - | -j filename } \n"); + print (STDERR " [-p port] [-h host] -I DN-to-$operation\n\n"); + print (STDERR "May be used to $operation a user or a domain of users\n\n"); + print (STDERR "Arguments:\n"); + print (STDERR " -? - help\n"); + print (STDERR " -D rootdn - Provide a Directory Manager DN. Default= '$defrootdn'\n"); + print (STDERR " -w password - Provide a password for the Directory Manager DN\n"); + print (STDERR " -w - - Prompt for the Directory Manager's password\n"); + print (STDERR " -j filename - Read the Directory Manager's password from file\n"); + print (STDERR " -p port - Provide a port. Default= '$defport'\n"); + print (STDERR " -h host - Provide a host name. Default= '$defhost'\n"); + print (STDERR " -I DN-to-$operation - Single entry DN or role DN to $operation\n"); + exit 100; +} + +sub debug +{ +# print " ==> @_"; +} + +sub out +{ + print "@_"; +} + +# -------------------------- +# Check if the entry is part of a locked role: +# i.e.: for each role member (nsroledn) of nsdisabledrole, check if +# * it is the same as the entry +# * the entry is member of role (==has nsroledn attributes), compare each of +# them with the nsroledn of nsdisabledrole +# * if nsroledn of nsdisabledrole are complex, go through each of them +# argv[0] is the local file handler +# argv[1] is the entry (may be a single entry DN or a role DN) +# argv[2] is the base for the search +# -------------------------- + +$throughRole=""; + +sub indirectLock +{ + # For recursivity, file handler must be local + my $L_filehandle=$_[0]; + $L_filehandle++; + + my $L_entry=$_[1]; + # Remove useless space + my @L_intern=split /([,])/,$L_entry; + my $L_result=""; + foreach $L_part (@L_intern) + { + $L_part=~s/^ +//; + $L_part=~ tr/A-Z/a-z/; + $L_result="$L_result$L_part"; + } + $L_entry=$L_result; + + my $L_base=$_[2]; + + my $L_search; + my $L_currentrole; + my $L_retCode; + + my $L_local; + +`$ldapsearch -p $port -h $host -D \"$rootdn\" -w \"$rootpw\" -s base -b \"$L_base\" \"(|(objectclass=*)(objectclass=ldapsubentry))\" nsroledn >> {{DEV-NULL}} 2>&1 `; +$retCode=$?; +if ( $retCode != 0 ) +{ + $retCode=$?>>8; + return 1; +} + + # Check if the role is a nested role + @L_Nested="$ldapsearch -p $port -h $host -D \"$rootdn\" -w \"$rootpw\" -s base -b \"$L_base\" \"(|(objectclass=nsNestedRoleDefinition)(objectclass=ldapsubentry))\" "; + # L_isNested == 1 means that we are going through a nested role, so for each member of that + # nested role, check that the member is below the scope of the nested + $L_isNested=@L_Nested; + + # Not Direct Lock, Go through roles if any + $L_search="$ldapsearch -p $port -h $host -D \"$rootdn\" -w \"$rootpw\" -s base -b \"$L_base\" \"(|(objectclass=*)(objectclass=ldapsubentry))\" nsroledn "; + + debug("\t-->indirectLock: check if $L_entry is part of a locked role from base $L_base\n\n"); + + unless (open ($L_filehandle, "$L_search |")) + { + out("Can't open file $L_filehandle\n"); + exit; + } + while (<$L_filehandle>) { + + s/\n //g; + if (/^nsroledn: (.*)\n/) { + $L_currentrole = $1; + + # Remove useless space + my @L_intern=split /([,])/,$L_currentrole; + my $L_result=""; + foreach $L_part (@L_intern) + { + $L_part=~s/^ +//; + $L_part=~ tr/A-Z/a-z/; + $L_result="$L_result$L_part"; + } + $L_currentrole=$L_result; + + debug("\t-- indirectLock loop: current nsroledn $L_currentrole of base $L_base\n"); + if ( $L_isNested == 1 ) + { + if ( checkScope($L_currentrole, $L_base) == 0 ) + { + # Scope problem probably a bad conf, skip the currentrole + next; + } + } + + if ( $L_currentrole eq $L_entry ) + { + # the entry is a role that is directly locked + # i.e, nsroledn of nsdisabledrole contains the entry + $throughRole=$L_base; + $throughRole=~ tr/A-Z/a-z/; + + # skipDisabled means that we've just found that the entry (which is a role) + # is locked directly (==its DN is part of nsroledn attributes) + # we just want to know now, if it is locked through another role + # at least, one + if ( $skipDisabled == 1 ) + { + # direct inactivation + $directLocked=1; + # just go through that test once + $skipDisabled=0; + next; + } + debug("\t-- 1 indirectLock: $L_currentrole locked throughRole == $throughRole\n"); + return 0; + } + + $L_retCode=memberOf($L_currentrole, $L_entry); + if ( $L_retCode == 0 && $single == 1 ) + { + $throughRole=$L_currentrole; + $throughRole=~ tr/A-Z/a-z/; + if ( $skipManaged == 1 ) + { + if ( $L_currentrole eq $nsManagedDisabledRole) + { + # Try next nsroledn + $directLocked=1; + $skipManaged=0; + next; + } + } + debug("\t-- 2 indirectLock: $L_currentrole locked throughRole == $throughRole\n"); + return 0; + } + + # Only for the first iteration + # the first iteration is with nsdisabledrole as base, other + # loops are deeper + $L_local=$skipDisabled; + $skipDisabled=0; + + # the current nsroledn may be a complex role, just go through + # its won nsroledn + $L_retCode=indirectLock($L_filehandle,$L_entry, $L_currentrole); + + # Because of recursivity, to keep the initial value for the first level + $skipDisabled=$L_local; + + if ( $L_retCode == 0 ) + { + $throughRole=$L_currentrole; + $throughRole=~ tr/A-Z/a-z/; + debug("\t-- 3 indirectLock: $L_entry locked throughRole == $throughRole\n"); + return 0; + } + } + } + + close($L_filehandle); + + debug("\t<--indirectLock: no more nsroledn to process\n"); + return 1; +} + +# -------------------------- +# Check if nsroledn is part of the entry attributes +# argv[0] is a role DN (nsroledn attribute) +# argv[1] is the entry +# -------------------------- +sub memberOf +{ + my $L_nsroledn=$_[0]; + $L_nsroledn=~ tr/A-Z/a-z/; + + my $L_entry=$_[1]; + + my $L_search; + my $L_currentrole; + + $L_search="$ldapsearch -p $port -h $host -D \"$rootdn\" -w \"$rootpw\" -s base -b \"$L_entry\" \"(|(objectclass=*)(objectclass=ldapsubentry))\" nsrole"; + + debug("\t\t-->memberOf: $L_search: check if $L_entry has $L_nsroledn as nsroledn attribute\n"); + + open (LDAP2, "$L_search |"); + while () { + s/\n //g; + if (/^nsrole: (.*)\n/) { + $L_currentrole = $1; + $L_currentrole=~ tr/A-Z/a-z/; + if ( $L_currentrole eq $L_nsroledn ) + { + # the parm is part of the $L_entry nsroledn + debug("\t\t<--memberOf: $L_entry locked through $L_nsroledn\n"); + return 0; + } + } + } + close(LDAP2); + + # the parm is not part of the $L_entry nsroledn + debug("\t\t<--memberOf: $L_entry not locked through $L_nsroledn\n"); + return 1; +} + + +# -------------------------- +# Remove the rdn of a DN +# argv[0] is a DN +# -------------------------- +sub removeRdn +{ + $L_entry=$_[0]; + + @L_entryToTest=split /([,])/,$L_entry; + debug("removeRdn: entry to split: $L_entry**@L_entryToTest\n"); + + $newDN=""; + $removeRDN=1; + foreach $part (@L_entryToTest) + { + $part=~ s/^ +//; + $part=~ tr/A-Z/a-z/; + if ( $removeRDN <= 2 ) + { + $removeRDN=$removeRDN+1; + } + else + { + $newDN="$newDN$part"; + } + } + + debug("removeRdn: new DN **$newDN**\n"); +} + +# -------------------------- +# Check if L_current is below the scope of +# L_nestedRole +# argv[0] is a role +# argv[1] is the nested role +# -------------------------- +sub checkScope +{ + $L_current=$_[0]; + $L_nestedRole=$_[1]; + + debug("checkScope: check if $L_current is below $L_nestedRole\n"); + + removeRdn($L_nestedRole); + $L_nestedRoleSuffix=$newDN; + debug("checkScope: nested role based: $L_nestedRoleSuffix\n"); + + $cont=1; + while ( ($cont == 1) && ($L_current ne "") ) + { + removeRdn($L_current); + $currentDn=$newDN; + debug("checkScope: current DN to check: $currentDn\n"); + + if ( $currentDn eq $L_nestedRoleSuffix ) + { + debug("checkScope: DN match!!!\n"); + $cont = 0; + } + else + { + $L_current=$currentDn; + } + } + + if ( $cont == 1 ) + { + debug("checkScope: $_[0] and $_[1] are not compatible\n"); + return 0; + } + else + { + debug("checkScope: $_[0] and $_[1] are compatible\n"); + return 1; + } +} + + +############################### +# MAIN ROUTINE +############################### + +# Generated variable +$dsroot="{{DS-ROOT}}"; + +# Determine which command we are running +if ( $0 =~ /ns-inactivate(.pl)?$/ ) +{ + $cmd="ns-inactivate.pl"; + $operation="inactivate"; + $state="inactivated"; + $modrole="add"; + $already="already"; +} +elsif ( $0 =~ /ns-activate(.pl)?$/ ) +{ + $cmd="ns-activate.pl"; + $operation="activate"; + $state="activated"; + $modrole="delete"; + $already="already"; +} +elsif ( $0 =~ /ns-accountstatus(.pl)?$/ ) +{ + $cmd="ns-accountstatus.pl"; + $operation="get status of"; + $state="activated"; + # no need for $modrole as no operation is performed + $already=""; + +} +else +{ + out("$0: unknown command\n"); + exit 100; +} + +debug("Running ** $cmd ** $operation\n"); + +$dsbinroot="$dsroot{{SEP}}shared{{SEP}}bin"; +$ldapsearch="$dsbinroot{{SEP}}ldapsearch -1"; +$ldapmodify="$dsbinroot{{SEP}}ldapmodify"; + +# Default values +$defrootdn= "{{ROOT-DN}}"; +$defhost= "{{SERVER-NAME}}"; +$defport= "{{SERVER-PORT}}"; + +# User values +$rootdn= "{{ROOT-DN}}"; +$rootpw= ""; +$pwfile= ""; +$host= "{{SERVER-NAME}}"; +$port= "{{SERVER-PORT}}"; +$entry= ""; + +$single=0; +$role=0; + +chdir("$dsbinroot"); + +# Process the command line arguments +while( $arg = shift) +{ + if($arg eq "-?") + { + usage_and_exit(); + } + elsif($arg eq "-D") + { + $rootdn= shift @ARGV; + } + elsif($arg eq "-w") + { + $rootpw= shift @ARGV; + } + elsif($arg eq "-j") + { + $pwfile= shift @ARGV; + } + elsif($arg eq "-p") + { + $port= shift @ARGV; + } + elsif($arg eq "-h") + { + $host= shift @ARGV; + } + elsif($arg eq "-I") + { + $entry= shift @ARGV; + } + else + { + print "$arg: Unknown command line argument.\n"; + usage_and_exit(); + } +} + +if ($pwfile ne ""){ +# Open file and get the password + unless (open (RPASS, $pwfile)) { + die "Error, cannot open password file $passwdfile\n"; + } + $rootpw = ; + chomp($rootpw); + close(RPASS); +} elsif ($rootpw eq "-"){ +# Read the password from terminal + die "The '-w -' option requires an extension library (Term::ReadKey) which is not\n", + "part of the standard perl distribution. If you want to use it, you must\n", + "download and install the module. You can find it at\n", + "http://www.perl.com/CPAN/CPAN.html\n"; +# Remove the previous line and uncomment the following 6 lines once you have installed Term::ReadKey module. +# use Term::ReadKey; +# print "Bind Password: "; +# ReadMode('noecho'); +# $rootpw = ReadLine(0); +# chomp($rootpw); +# ReadMode('normal'); +} + +if( $rootpw eq "" ) +{ + usage_and_exit(); +} + +if( $entry eq "" ) +{ + usage_and_exit(); +} + +# +# Check the actual existence of the entry to inactivate/activate +# and at the same time, validate the various parm: port, host, rootdn, rootpw +# +@exist=`$ldapsearch -p $port -h $host -D \"$rootdn\" -w \"$rootpw\" -s base -b \"$entry\" \"(objectclass=*)\" dn`; +$retCode1=$?; +if ( $retCode1 != 0 ) +{ + $retCode1=$?>>8; + exit $retCode1; +} + +@isRole=`$ldapsearch -p $port -h $host -D \"$rootdn\" -w \"$rootpw\" -s base -b \"$entry\" \"(&(objectclass=LDAPsubentry)(objectclass=nsRoleDefinition))\" dn`; +$nbLineRole=@isRole; +$retCode2=$?; +if ( $retCode2 != 0 ) +{ + $retCode2=$?>>8; + exit $retCode2; +} + +if ( $nbLineRole == 1 ) +{ + debug("Groups of users\n"); + $role=1; +} +else +{ + debug("Single user\n"); + $single=1; +} + +# +# First of all, check the existence of the nsaccountlock attribute in the entry +# +$isLocked=0; +if ( $single == 1 ) +{ + $searchAccountLock="$ldapsearch -p $port -h $host -D \"$rootdn\" -w \"$rootpw\" -s base -b \"$entry\" \"(objectclass=*)\" nsaccountlock"; + open (LDAP1, "$searchAccountLock |"); + while () { + s/\n //g; + if (/^nsaccountlock: (.*)\n/) { + $L_currentvalue = $1; + $L_currentvalue=~ tr/A-Z/a-z/; + if ( $L_currentvalue eq "true") + { + $isLocked=1; + } + elsif ( $L_currentvalue eq "false" ) + { + $isLocked=0; + } + } + } + close(LDAP1); +} +debug("Is the entry already locked? ==> $isLocked\n"); + +# +# Get the suffix name of that entry +# + +# Remove the space at the beginning (just in case...) +# -I "uid=jvedder , ou=People , o=sun.com" +@suffix=split /([,])/,$entry; +$result=""; +foreach $part (@suffix) +{ + $part=~s/^ +//; + $part=~ tr/A-Z/a-z/; + $result="$result$part"; +} +@suffixN=$result; + +debug("Entry to $operation: #@suffix#\n"); +debug("Entry to $operation: #@suffixN#\n"); + +# Get the suffix +$cont=0; +while ($cont == 0) +{ + # Look if suffix is the suffix of the entry + # ldapsearch -s one -b "cn=mapping tree,cn=config" "cn=\"uid=jvedder,ou=People,o=sun.com\"" + # + debug("\tSuffix from the entry: #@suffixN#\n"); + @mapping=`$ldapsearch -p $port -h $host -D \"$rootdn\" -w \"$rootpw\" -s one -b \"cn=mapping tree, cn=config\" \"cn=\\"@suffixN\\"\" cn `; + + $retCode=$?; + if ( $retCode != 0 ) + { + $retCode=$?>>8; + exit $retCode; + } + + # If we get a result, remove the dn: + # dn: cn="o=sun.com",cn=mapping tree,cn=config + # cn: "o=sun.com" + # + shift @mapping; + + foreach $res (@mapping) + { + # Break the string cn: "o=sun.com" into pieces + @cn= split(/ /,$res); + + # And remove the cn: part + shift @cn; + + # Now compare the suffix we extract from the mapping tree + # with the suffix derived from the entry + debug("\tSuffix from mapping tree: #@cn#\n"); + if ( @cn eq @suffixN ) { + debug("Found matching suffix\n"); + $cont=1; + } + } + + if ( $cont == 0 ) + { + # Remove the current rdn to try another suffix + shift @suffix; + + $result=""; + foreach $part (@suffix) + { + $part=~ s/^ +//; + $part=~ tr/A-Z/a-z/; + $result="$result$part"; + } + @suffixN=$result; + + debug("\t\tNothing found => go up one level in rdn #@suffix#\n"); + $len=@suffix; + if ( $len == 0 ) + { + debug("Can not find suffix. Problem\n"); + $cont=2; + } + } +} +if ( $cont == 2) +{ + out("Can not find suffix for entry $entry\n"); + exit 100; +} + +if ( $operation eq "inactivate" ) +{ + # + # Now that we have the suffix and we know if we deal with a single entry or + # a role, just try to create the COS and roles associated. + # + @base=( + "cn=nsManagedDisabledRole,@suffixN", + "cn=nsDisabledRole,@suffixN", + "cn=nsAccountInactivationTmp,@suffixN", + "\'cn=\"cn=nsDisabledRole,@suffixN\",cn=nsAccountInactivationTmp,@suffixN\'", + "cn=nsAccountInactivation_cos,@suffixN" ); + + $addrolescos="$ldapmodify -p $port -h $host -D \"$rootdn\" -w \"$rootpw\" -c -a >> {{DEV-NULL}} 2>&1 "; + @role1=( + "dn: cn=nsManagedDisabledRole,@suffixN\n", + "objectclass: LDAPsubentry\n", + "objectclass: nsRoleDefinition\n", + "objectclass: nsSimpleRoleDefinition\n", + "objectclass: nsManagedRoleDefinition\n", + "cn: nsManagedDisabledRole\n\n" ); + @role2=( + "dn: cn=nsDisabledRole,@suffixN\n", + "objectclass: top\n", + "objectclass: LDAPsubentry\n", + "objectclass: nsRoleDefinition\n", + "objectclass: nsComplexRoleDefinition\n", + "objectclass: nsNestedRoleDefinition\n", + "nsRoleDN: cn=nsManagedDisabledRole,@suffixN\n", + "cn: nsDisabledRole\n\n" ); + @cos1=( + "dn: cn=nsAccountInactivationTmp,@suffixN\n", + "objectclass: top\n", + "objectclass: nsContainer\n\n" ); + @cos2=( + "dn: cn=\"cn=nsDisabledRole,@suffixN\",cn=nsAccountInactivationTmp,@suffixN\n", + "objectclass: top\n", + "objectclass: extensibleObject\n", + "objectclass: costemplate\n", + "objectclass: ldapsubentry\n", + "cosPriority: 1\n", + "nsAccountLock: true\n\n" ); + @cos3=( + "dn: cn=nsAccountInactivation_cos,@suffixN\n", + "objectclass: top\n", + "objectclass: LDAPsubentry\n", + "objectclass: cosSuperDefinition\n", + "objectclass: cosClassicDefinition\n", + "cosTemplateDn: cn=nsAccountInactivationTmp,@suffixN\n", + "cosSpecifier: nsRole\n", + "cosAttribute: nsAccountLock operational\n\n" ); + + @all=(\@role1, \@role2, \@cos1, \@cos2, \@cos3); + + $i=0; + + foreach $current (@base) + { + debug("Creating $current ??\n"); + open(FD,"| $addrolescos "); + print FD @{$all[$i]}; + close(FD); + if ( $? != 0 ) + { + $retCode=$?>>8; + if ( $retCode == 68 ) + { + debug("Entry $current already exists, ignore error\n"); + } + else + { + # Probably a more serious problem. + # Exit with LDAP error + exit $retCode; + } + } + else + { + debug("Entry $current created\n"); + } + $i=$i+1; + } +} + +$skipManaged=0; +$skipDisabled=0; +$directLocked=0; + +$nsDisabledRole="cn=nsDisabledRole,@suffixN"; +$nsDisabledRole=~ tr/A-Z/a-z/; + +$nsManagedDisabledRole="cn=nsManagedDisabledRole,@suffixN"; +$nsManagedDisabledRole=~ tr/A-Z/a-z/; + +if ( $operation eq "inactivate" ) +{ + # Go through all the roles part of nsdisabledrole to check if the entry + # is a member of one of those roles + $ret=indirectLock("LDAP00", $entry, $nsDisabledRole); + if ( $ret == 0 ) + { + if ( $throughRole ne $nsDisabledRole && $throughRole ne $nsManagedDisabledRole ) + { + # indirect lock + out("$entry already $state through $throughRole.\n"); + } + else + { + # direct lock + out("$entry already $state.\n"); + } + exit 100; + } + elsif ( $isLocked == 1 ) + { + # the entry is not locked through a role, may be nsaccountlock is "hardcoded" ? + out("$entry already $state (probably directly).\n"); + exit 103; + } +} +elsif ( $operation eq "activate" || $operation eq "get status of" ) +{ + $skipManaged=$single; + $skipDisabled=$role; + + $ret=indirectLock("LDAP00",$entry, $nsDisabledRole); + + if ( $ret == 0 ) + { + # undirectly locked + if ( $throughRole ne $nsDisabledRole && $throughRole ne $nsManagedDisabledRole ) + { + if ( $operation eq "activate" ) + { + out("$entry inactivated through $throughRole. Can not activate it individually.\n"); + exit 100; + } + else + { + out("$entry inactivated through $throughRole.\n"); + exit 104; + } + } + debug("$entry locked individually\n"); + + if ( $operation ne "activate" ) + { + out("$entry inactivated.\n"); + exit 103; + } + } + elsif ( $directLocked == 0 ) + { + if ( $operation eq "activate" && $isLocked != 1 ) + { + out("$entry $already $state.\n"); + exit 100; + } + elsif ( $isLocked != 1 ) + { + out("$entry $already $state.\n"); + exit 102; + } + else + { + # not locked using our schema, but nsaccountlock is probably present + out("$entry inactivated (probably directly).\n"); + exit 103; + } + } + elsif ( $operation ne "activate" ) + { + out("$entry inactivated.\n"); + exit 103; + } + # else Locked directly, juste unlock it! + debug("$entry locked individually\n"); +} + +# +# Inactivate/activate the entry +# +$action="$ldapmodify -p $port -h $host -D \"$rootdn\" -w \"$rootpw\" -c >> {{DEV-NULL}} 2>&1"; +if ( $single == 1 ) +{ + @record=( + "dn: $entry\n", + "changetype: modify\n", + "$modrole: nsRoleDN\n", + "nsRoleDN: cn=nsManagedDisabledRole,@suffixN\n\n" ); +} +else +{ + @record=( + "dn: cn=nsDisabledRole,@suffixN\n", + "changetype: modify\n", + "$modrole: nsRoleDN\n", + "nsRoleDN: $entry\n\n" ); +} +open(FD,"| $action "); +print FD @record; +close(FD); +if ( $? != 0 ) +{ +debug("$modrole, $entry\n"); + $retCode=$?>>8; + exit $retCode; +} + +out("$entry $state.\n"); +exit 0; diff --git a/ldap/admin/src/scripts/template-ns-newpwpolicy.pl b/ldap/admin/src/scripts/template-ns-newpwpolicy.pl new file mode 100755 index 00000000..dd57c944 --- /dev/null +++ b/ldap/admin/src/scripts/template-ns-newpwpolicy.pl @@ -0,0 +1,241 @@ +#{{PERL-EXEC}} +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2004 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# + +# Add new password policy specific entries + +############################################################################# +# enable the use of Perldap functions +require DynaLoader; + +use Getopt::Std; +use Mozilla::LDAP::Conn; +use Mozilla::LDAP::Utils qw(:all); +use Mozilla::LDAP::API qw(:api :ssl :apiv3 :constant); # Direct access to C API + +############################################################################# +# Default values of the variables + +$opt_D = "{{ROOT-DN}}"; +$opt_p = "{{SERVER-PORT}}"; +$opt_h = "{{SERVER-NAME}}"; +$opt_v = 0; + +# Variables +$ldapsearch="{{DS-ROOT}}{{SEP}}shared{{SEP}}bin{{SEP}}ldapsearch"; +$ldapmodify="{{DS-ROOT}}{{SEP}}shared{{SEP}}bin{{SEP}}ldapmodify"; + +chdir("{{DS-ROOT}}{{SEP}}shared{{SEP}}bin"); + +############################################################################# + +sub usage { + print (STDERR "ns-newpwpolicy.pl [-v] [-D rootdn] { -w password | -j filename } \n"); + print (STDERR " [-p port] [-h host] -U UserDN -S SuffixDN\n\n"); + + print (STDERR "Arguments:\n"); + print (STDERR " -? - help\n"); + print (STDERR " -v - verbose output\n"); + print (STDERR " -D rootdn - Directory Manager DN. Default= '$opt_D'\n"); + print (STDERR " -w rootpw - password for the Directory Manager DN\n"); + print (STDERR " -j filename - Read the Directory Manager's password from file\n"); + print (STDERR " -p port - port. Default= $opt_p\n"); + print (STDERR " -h host - host name. Default= '$opt_h'\n"); + print (STDERR " -U userDN - User entry DN\n"); + print (STDERR " -S suffixDN - Suffix entry DN\n"); + exit 100; +} + +# Process the command line arguments +{ + usage() if (!getopts('vD:w:j:p:h:U:S:')); + + if ($opt_j ne ""){ + die "Error, cannot open password file $opt_j\n" unless (open (RPASS, $opt_j)); + $opt_w = ; + chomp($opt_w); + close(RPASS); + } + + usage() if( $opt_w eq "" ); + if ($opt_U eq "" && $opt_S eq "") { + print (STDERR "Please provide at least -S or -U option.\n\n"); + } + + # Now, check if the user/group exists + + if ($opt_S) { + print (STDERR "host = $opt_h, port = $opt_p, suffixDN = \"$opt_S\"\n\n") if $opt_v; + @base=( + "cn=nsPwPolicyContainer,$opt_S", + "cn=\"cn=nsPwPolicyEntry,$opt_S\",cn=nsPwPolicyContainer,$opt_S", + "cn=\"cn=nsPwTemplateEntry,$opt_S\",cn=nsPwPolicyContainer,$opt_S", + "cn=nsPwPolicy_cos,$opt_S" + ); + + $ldapadd="$ldapmodify -p $opt_p -h $opt_h -D \"$opt_D\" -w \"$opt_w\" -c -a 2>&1"; + $modifyCfg="$ldapmodify -p $opt_p -h $opt_h -D \"$opt_D\" -w \"$opt_w\" -c 2>&1"; + + @container=( + "dn: cn=nsPwPolicyContainer,$opt_S\n", + "objectclass: top\n", + "objectclass: nsContainer\n\n" ); + @pwpolicy=( + "dn: cn=\"cn=nsPwPolicyEntry,$opt_S\",cn=nsPwPolicyContainer,$opt_S\n", + "objectclass: top\n", + "objectclass: ldapsubentry\n", + "objectclass: passwordpolicy\n\n" ); + @template=( + "dn: cn=\"cn=nsPwTemplateEntry,$opt_S\",cn=nsPwPolicyContainer,$opt_S\n", + "objectclass: top\n", + "objectclass: extensibleObject\n", + "objectclass: costemplate\n", + "objectclass: ldapsubentry\n", + "cosPriority: 1\n", + "pwdpolicysubentry: cn=\"cn=nsPwPolicyEntry,$opt_S\",cn=nsPwPolicyContainer,$opt_S\n\n" ); + @cos=( + "dn: cn=nsPwPolicy_cos,$opt_S\n", + "objectclass: top\n", + "objectclass: LDAPsubentry\n", + "objectclass: cosSuperDefinition\n", + "objectclass: cosPointerDefinition\n", + "cosTemplateDn: cn=\"cn=nsPwTemplateEntry,$opt_S\",cn=nsPwPolicyContainer,$opt_S\n", + "cosAttribute: pwdpolicysubentry default operational-default\n\n" ); + + @all=(\@container, \@pwpolicy, \@template, \@cos); + + $i=0; + + foreach $current (@base) + { + open(FD,"| $ldapadd"); + print FD @{$all[$i]}; + close(FD); + if ( $? != 0 ) { + $retCode=$?>>8; + if ( $retCode == 68 ) { + print( STDERR "Entry \"$current\" already exists. Please ignore the error\n\n"); + } + else { + # Probably a more serious problem. + # Exit with LDAP error + print(STDERR "Error $retcode while adding \"$current\". Exiting.\n"); + exit $retCode; + } + } + else { + print( STDERR "Entry \"$current\" created\n\n") if $opt_v; + } + $i=$i+1; + } + + $modConfig = "dn:cn=config\nchangetype: modify\nreplace:nsslapd-pwpolicy-local\nnsslapd-pwpolicy-local: on\n\n"; + open(FD,"| $modifyCfg "); + print(FD $modConfig); + close(FD); + $retcode = $?; + if ( $retcode != 0 ) { + print( STDERR "Error $retcode while modifing \"cn=config\". Exiting.\n" ); + exit ($retcode); + } + else { + print( STDERR "Entry \"cn=config\" modified\n\n") if $opt_v; + } + } # end of $opt_S + + if ($opt_U) { + my $norm_opt_U = normalizeDN($opt_U); + print (STDERR "host = $opt_h, port = $opt_p, userDN = \"$norm_opt_U\"\n\n") if $opt_v; + $retcode = `$ldapsearch -h $opt_h -p $opt_p -b \"$norm_opt_U\" -s base \"\"`; + if ($retcode != 0 ) { + print( STDERR "the user entry $norm_opt_U does not exist. Exiting.\n"); + exit ($retcode); + } + + print( STDERR "the user entry $norm_opt_U found..\n\n") if $opt_v; + + # Now, get the parentDN + @rdns = ldap_explode_dn($norm_opt_U, 0); + shift @rdns; + $parentDN = join(',', @rdns); + + print (STDERR "parentDN is $parentDN\n\n") if $opt_v; + + @base=( + "cn=nsPwPolicyContainer,$parentDN", + "cn=\"cn=nsPwPolicyEntry,$norm_opt_U\",cn=nsPwPolicyContainer,$parentDN" + ); + + $ldapadd="$ldapmodify -p $opt_p -h $opt_h -D \"$opt_D\" -w \"$opt_w\" -c -a 2>&1"; + $modifyCfg="$ldapmodify -p $opt_p -h $opt_h -D \"$opt_D\" -w \"$opt_w\" -c 2>&1"; + + @container=( + "dn: cn=nsPwPolicyContainer,$parentDN\n", + "objectclass: top\n", + "objectclass: nsContainer\n\n" ); + @pwpolicy=( + "dn: cn=\"cn=nsPwPolicyEntry,$norm_opt_U\",cn=nsPwPolicyContainer,$parentDN\n", + "objectclass: top\n", + "objectclass: ldapsubentry\n", + "objectclass: passwordpolicy\n\n" ); + + @all=(\@container, \@pwpolicy); + + $i=0; + + foreach $current (@base) + { + open(FD,"| $ldapadd "); + print FD @{$all[$i]}; + close(FD); + if ( $? != 0 ) { + $retCode=$?>>8; + if ( $retCode == 68 ) { + print( STDERR "Entry $current already exists. Please ignore the error\n\n"); + } + else { + # Probably a more serious problem. + # Exit with LDAP error + print(STDERR "Error $retcode while adding \"$current\". Exiting.\n"); + exit $retCode; + } + } + else { + print( STDERR "Entry $current created\n\n") if $opt_v; + } + $i=$i+1; + } + + $target = "cn=\"cn=nsPwPolicyEntry,$norm_opt_U\",cn=nsPwPolicyContainer,$parentDN"; + $modConfig = "dn: $norm_opt_U\nchangetype: modify\nreplace:pwdpolicysubentry\npwdpolicysubentry: $target\n\n"; + open(FD,"| $modifyCfg "); + print(FD $modConfig); + close(FD); + $retcode = $?; + if ( $retcode != 0 ) { + print( STDERR "Error $retcode while modifing $norm_opt_U. Exiting.\n" ); + exit ($retcode); + } + else { + print( STDERR "Entry \"$norm_opt_U\" modified\n\n") if $opt_v; + } + + $modConfig = "dn:cn=config\nchangetype: modify\nreplace:nsslapd-pwpolicy-local\nnsslapd-pwpolicy-local: on\n\n"; + open(FD,"| $modifyCfg "); + print(FD $modConfig); + close(FD); + $retcode = $?; + if ( $retcode != 0 ) { + print( STDERR "Error $retcode while modifing \"cn=config\". Exiting.\n" ); + exit ($retcode); + } + else { + print( STDERR "Entry \"cn=config\" modified\n\n") if $opt_v; + } + } # end of $opt_U +} diff --git a/ldap/admin/src/scripts/template-repl-monitor-cgi.pl b/ldap/admin/src/scripts/template-repl-monitor-cgi.pl new file mode 100755 index 00000000..b9494d0d --- /dev/null +++ b/ldap/admin/src/scripts/template-repl-monitor-cgi.pl @@ -0,0 +1,40 @@ +#{{PERL-EXEC}} +# +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2002-2004 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# + +use Cgi; + +$params = ""; +$params .= " -h $cgiVars{'servhost'}" if $cgiVars{'servhost'}; +$params .= " -p $cgiVars{'servport'}" if $cgiVars{'servport'}; +$params .= " -f $cgiVars{'configfile'}" if $cgiVars{'configfile'}; +$params .= " -t $cgiVars{'refreshinterval'}" if $cgiVars{'refreshinterval'}; +if ($cgiVars{'admurl'}) { + $admurl = "$cgiVars{'admurl'}"; + if ( $ENV{'QUERY_STRING'} ) { + $admurl .= "?$ENV{'QUERY_STRING'}"; + } + elsif ( $ENV{'CONTENT_LENGTH'} ) { + $admurl .= "?$Cgi::CONTENT"; + } + $params .= " -u \"$admurl\""; +} +$siteroot = $cgiVars{'siteroot'}; +$perl = "$siteroot/bin/slapd/admin/bin/perl"; +$ENV{'LD_LIBRARY_PATH'} = "$siteroot/lib:$siteroot/lib/nsPerl5.005_03/lib"; + +# Save user-specified parameters as cookies in monreplication.properties. +# Sync up with the property file so that monreplication2 is interval, and +# monreplication3 the config file pathname. +$propertyfile = "$siteroot/bin/admin/admin/bin/property/monreplication.properties"; +$edit1 = "s#monreplication2=.*#monreplication2=$cgiVars{'refreshinterval'}#;"; +$edit2 = "s#^monreplication3=.*#monreplication3=$cgiVars{'configfile'}#;"; +system("$perl -p -i.bak -e \"$edit1\" -e \"$edit2\" $propertyfile"); + +# Now the real work +$replmon = "$siteroot/bin/slapd/admin/scripts/template-repl-monitor.pl"; +system("$perl $replmon $params"); diff --git a/ldap/admin/src/scripts/template-repl-monitor.pl b/ldap/admin/src/scripts/template-repl-monitor.pl new file mode 100755 index 00000000..78e3aa85 --- /dev/null +++ b/ldap/admin/src/scripts/template-repl-monitor.pl @@ -0,0 +1,956 @@ +#{{PERL-EXEC}} + +############################################################################## +# +# Copyright (C) 2002-2004 Netscape Communications Corporation. +# All Rights Reserved. +# +# FILE: repl-monitor.pl +# +# SYNOPSIS: +# repl-monitor.pl -f configuration-file [-h host] [-p port] [-r] \ +# [-u refresh-url] [-t refresh-interval] +# +# repl-monitor.pl -v +# +# DESCRIPTION: +# Given an LDAP replication "supplier" server, crawl over all the ldap +# servers via direct or indirect replication agreements. +# For each master replica discovered, display the maxcsn of the master +# and the replication status of all its lower level replicas. +# All output is in HTML. +# +# OPTIONS: +# +# -f configuration-file +# The configuration file contains the sections for the connection +# parameters, the server alias, and the thresholds for different colors +# when display the time lags between consumers and master. +# If the Admin Server is running on Windows, the configuration-file +# name may have format "D:/Netscape/replmon.conf". +# +# The connection parameter section consists of the section name +# followed by one of more connection parameter entries: +# +# [connection] +# host:port:binddn:bindpwd:bindcert +# host:port=shadowport:binddn:bindpwd:bindcert +# ... +# +# where host:port default (*:*) to that in a replication agreement, +# binddn default (*) to "cn=Directory Manager", and bindcert is the +# pathname of cert db if you want the script to connect to the server +# via SSL. If bindcert is omitted, the connection will be simple +# bind. +# "port=shadowport" means to use shadowport instead of port if port +# is specified in the replication agreement. This is useful when +# for example, ssl port is specified in a replication agreement, +# but you can't access the cert db from the machine where this +# script is running. So you could let the script to map the ssl +# port to a non-ssl port and use the simple bind. +# +# A server may have a dedicated or a share entry in the connection +# section. The script will find out the most matched entry for a given +# server. For example, if all the ldap servers except host1 share the +# same binddn and bindpassword, the connection section then just need +# two entries: +# +# [connection] +# *:*:binddn:bindpassword: +# host1:*:binddn:bindpassword: +# +# If a host:port is assigned an alias, then the alias instead of +# host:port will be displayed in The output file. Each host:port +# can have only one alias. But each alias may be used by more than +# one host:port. +# +# [alias] +# alias = host:port +# ... +# +# CSN time lags between masters and consumers might be displayed in +# different colors based on their range. The thresholds for different +# colors may be specified in color section: +# +# [color] +# lowmark (in minutes) = color +# ... +# If the color section or color entry is missing, the default color +# set is: green for [0-5) minutes lag, yellow [5-60), and red 60 and more. +# +# -h host +# Initial replication supplier's host. Default to the current host. +# +# -p port +# Initial replication supplier's port. Default to 389. +# +# -r If specified, -r causes the routine to be entered without printing +# HTML header information. This is suitable when making multiple calls +# to this routine (e.g. when specifying multiple, different, "unrelated" +# supplier servers) and expecting a single HTML output. +# +# -t refresh-interval +# Specify the refresh interval in seconds. This option has to be +# jointly used with option -u. +# +# -u refresh-url +# The output HTML file may invoke a CGI program periodically. If +# this CGI program in turn calls this script, the effect is that +# the output HTML file would automatically refresh itself. This +# is useful for continuing monitoring. See also option -t. +# +# -v Print out the version of this script +# +# DIAGNOSTICS: +# There are several ways to invoke this script if you got error +# "Can't locate Mozilla/LDAP/Conn.pm in @INC", or +# "usage: Undefined variable": +# +# 1. Set the first line of the script to #!/bin/slapd/admin/bin/perl +# and run this script directly. +# +# 2. Run +# /bin/slapd/admin/bin/perl repl-monitor.pl +# +# 3. Set environment variable PERL5LIB to your Perl lib dirs where +# Mozilla::LDAP module can be located. +# +# 4. Invoke the script as follows if /lib/site contains +# Mozilla/LDAP: +# /bin/perl -I /lib/site repl-monitor.pl +# +# If you get error "Can't load ...", try to set environment variable +# for library path to /lib:/lib/nsPerl5.005_03/lib +# +############################################################################# +$usage = "\nusage: $0 -f configuration-file [-h host] [-p port] [-r] [-u refresh-url] [-t refresh-interval]\n\nor : $0 -v\n"; + +use Getopt::Std; # parse command line arguments +use Mozilla::LDAP::Conn; # LDAP module for Perl +use Mozilla::LDAP::Utils qw(normalizeDN); # LULU, utilities. +use Mozilla::LDAP::API qw(:api :ssl :apiv3 :constant); # Direct access to C API +use Time::Local; # to convert GMT Z strings to localtime + +# +# Global variables +# +$product = "Netscape Directory Server Replication Monitor"; +$version = "Version 1.0"; +# +# ldap servers given or discovered from the replication agreements: +# @servers = (host:port=shadowport:binddn:password:cert_db) +# +# entries read from the connection section of the configuration file: +# @allconnections = (host:port=shadowport:binddn:password:cert_db) +# +# aliases of ldap servers read from the configuration file: +# %allaliases{$host:$port}= (alias) +# +# replicas discovered on all ldap servers +# @allreplicas = (server#:replicaroot:replicatype:serverid:replicadn) +# +# ruvs retrieved from all replicas +# @allruvs{replica#:masterid} = (rawcsn:decimalcsn;mon/day/year hh:mi:ss) +# +# agreements discovered on all ldap supplier servers: +# @allagreements = (supplier_replica#:consumer#:conntype:schedule:status) +# the array may take another format after the consumer replicas are located: +# @allagreements = (supplier_replica#:consumer_replica#:conntype:schedule:status) +# + +#main +{ + # turn off buffered I/O + $| = 1; + + # Check for legal options + if (!getopts('h:p:f:ru:t:v')) { + print $usage; + exit -1; + } + + if ($opt_v) { + print "$product - $version\n"; + exit; + } + + $interval = $opt_t; + $interval = 300 if ( !$interval || $interval <= 0 ); + + # Get current date/time + $nowraw = localtime(); + ($wday, $mm, $dd, $tt, $yy) = split(/ /, $nowraw); + $now = "$wday $mm $dd $yy $tt"; + + # if no -r (Reenter and skip html header), print html header + if (!$opt_r) { + # print the HTML header + &print_html_header; + } else { + # print separator for new replication set + print "



                      \n"; + } + + exit -1 if &validateArgs < 0; + exit if &read_cfg_file ($opt_f) < 0; + + # Start with the given host and port + # The index names in %ld are defined in Mozilla::LDAP::Utils::ldapArgs() + &add_server ("$ld{host}:$ld{port}:$ld{bind}:$ld{pswd}:$ld{cert}"); + + $serveridx = 0; + while ($serveridx <= $#servers) { + if (&get_replicas ($serveridx) != 0 && $serveridx == 0) { + my ($host, $port, $binddn) = split (/:/, $servers[0]); + print("Login to $host:$port as \"$binddn\" failed\n"); + exit; + } + $serveridx++; + } + + &find_consumer_replicas; + &process_suppliers; + + # All done! - well, for the current invokation only + # print "\n"; + exit; +} + +sub validateArgs +{ + my ($rc) = 0; + + %ld = Mozilla::LDAP::Utils::ldapArgs(); + + if (!$opt_v && !$opt_f) { + print "

                      Error: Missing configuration file.\n"; + print "

                      If you need help on the configuration file, Please go back and click the Help button.\n"; + #print $usage; # Don't show usage in CGI + $rc = -1; + } + elsif (!$opt_h) { + chop ($ld{"host"} = `hostname`); + } + + return $rc; +} + +sub read_cfg_file +{ + my ($fn) = @_; + unless (open(CFGFILEHANDLE, $fn)) { + print "

                      Error: Can't open \"$fn\": $!.\n"; + print "

                      If you need help on the configuration file, Please go back and click the Help button.\n"; + return -1; + } + $section = 0; + while () { + next if (/^\s*\#/ || /^\s*$/); + chop ($_); + if (m/^\[(.*)\]/) { + $section = $1; + } + else { + if ( $section =~ /conn/i ) { + push (@allconnections, $_); + } + elsif ( $section =~ /alias/i ) { + m/^\s*(\S.*)\s*=\s*(\S+)/; + $allaliases {$2} = $1; + } + elsif ( $section =~ /color/i ) { + m/^\s*(-?\d+)\s*=\s*(\S+)/; + $allcolors {$1} = $2; + } + } + } + if ( ! keys (%allcolors) ) { + $allcolors {0} = "#ccffcc"; #apple green + $allcolors {5} = "#ffffcc"; #cream yellow + $allcolors {60} = "#ffcccc"; #pale pink + } + @colorkeys = sort (keys (%allcolors)); + close (CFGFILEHANDLE); + return 0; +} + +sub get_replicas +{ + my ($serveridx) = @_; + my ($conn, $host, $port, $shadowport, $binddn, $bindpwd, $bindcert); + my ($others); + my ($replica, $replicadn); + my ($ruv, $replicaroot, $replicatype, $serverid, $masterid, $maxcsn); + my ($type, $flag, $i); + my ($myridx, $ridx, $cidx); + + # + # Bind to the server + # + ($host, $port, $binddn, $bindpwd, $bindcert) = split (/:/, "$servers[$serveridx]", 5); + + ($port, $shadowport) = split (/=/, $port); + $shadowport = $port if !$shadowport; + + $conn = new Mozilla::LDAP::Conn ($host, $shadowport, "$binddn", $bindpwd, $bindcert); + + return -1 if (!$conn); + + # + # Get all the replica on the server + # + $myridx = $#allreplicas + 1; + $replica = $conn->search ("cn=mapping tree,cn=config", + "sub", + "(objectClass=nsDS5Replica)", 0, + qw(nsDS5ReplicaRoot nsDS5ReplicaType nsDS5Flags nsDS5ReplicaId)); + while ($replica) { + $replicadn = $replica->getDN; + $replicaroot = normalizeDN ($replica->{nsDS5ReplicaRoot}[0]); + $type = $replica->{nsDS5ReplicaType}[0]; + $flag = $replica->{nsDS5Flags}[0]; + $serverid = $replica->{nsDS5ReplicaId}[0]; + + # flag = 0: change log is not created + # type = 2: read only replica + # type = 3: updatable replica + $replicatype = $flag == 0 ? "consumer" : ($type == 2 ? "hub" : "master"); + + push (@allreplicas, "$serveridx:$replicaroot:$replicatype:$serverid:$replicadn"); + + $replica = $conn->nextEntry (); + } + + # + # Get ruv for each replica + # + for ($ridx = $myridx; $ridx <= $#allreplicas; $ridx++) { + + $replicaroot = $1 if ($allreplicas[$ridx] =~ /^\d+:([^:]*)/); + # do a one level search with nsuniqueid in the filter - this will force the use of the + # nsuniqueid index instead of the entry dn index, which seems to be unreliable in + # heavily loaded servers + $ruv = $conn->search($replicaroot, "one", + "(&(nsuniqueid=ffffffff-ffffffff-ffffffff-ffffffff)(objectClass=nsTombstone))", + 0, qw(nsds50ruv nsruvReplicaLastModified)); + next if !$ruv; # this should be an error case . . . + + for ($ruv->getValues('nsds50ruv')) { + if (m/\{replica\s+(\d+).+?\}\s*\S+\s*(\S+)/i) { + $masterid = $1; + $maxcsn = &to_decimal_csn ($2); + $allruvs {"$ridx:$masterid"} = "$2:$maxcsn"; + } + } + + for ($ruv->getValues('nsruvReplicaLastModified')) { + if (m/\{replica\s+(\d+).+?\}\s*(\S+)/i) { + $masterid = $1; + $lastmodifiedat = hex($2); + my ($sec, $min, $hour, $mday, $mon, $year) = localtime ($lastmodifiedat); + $mon++; + $year += 1900; + $hour = "0".$hour if ($hour < 10); + $min = "0".$min if ($min < 10); + $sec = "0".$sec if ($sec < 10); + $allruvs {"$ridx:$masterid"} .= ";$mon/$mday/$year $hour:$min:$sec"; + } + } + } + + # + # Get all agreements for each supplier replica + # + for ($ridx = $myridx; $ridx <= $#allreplicas; $ridx++) { + $_ = $allreplicas[$ridx]; + + # Skip consumers + next if m/:consumer:/i; + + m/:([^:]*)$/; + $replicadn = $1; + my @attrlist = qw(cn nsds5BeginReplicaRefresh nsds5replicaUpdateInProgress + nsds5ReplicaLastInitStatus nsds5ReplicaLastInitStart + nsds5ReplicaLastInitEnd nsds5replicaReapActive + nsds5replicaLastUpdateStart nsds5replicaLastUpdateEnd + nsds5replicaChangesSentSinceStartup nsds5replicaLastUpdateStatus + nsds5ReplicaHost + nsds5ReplicaPort nsDS5ReplicaBindMethod nsds5ReplicaUpdateSchedule); + $agreement = $conn->search("$replicadn", "sub", "(objectClass=nsDS5ReplicationAgreement)", + 0, @attrlist); + while ($agreement) { + + my %agmt = (); + # Push consumer to server stack if we have not already + $host = ($agreement->getValues('nsDS5ReplicaHost'))[0]; + $port = ($agreement->getValues('nsDS5ReplicaPort'))[0]; + $cidx = &add_server ("$host:$port"); + + for (@attrlist) { + $agmt{$_} = ($agreement->getValues($_))[0]; + } + if ($agmt{nsDS5ReplicaBindMethod} =~ /simple/i) { + $agmt{nsDS5ReplicaBindMethod} = 'n'; + } + if (!$agmt{nsds5ReplicaUpdateSchedule} || + ($agmt{nsds5ReplicaUpdateSchedule} eq '0000-2359 0123456') || + ($agmt{nsds5ReplicaUpdateSchedule} eq '*') || + ($agmt{nsds5ReplicaUpdateSchedule} eq '* *')) { + $agmt{nsds5ReplicaUpdateSchedule} = 'always in sync'; + } + + $agmt{ridx} = $ridx; + $agmt{cidx} = $cidx; + push @allagreements, \%agmt; + + $agreement = $conn->nextEntry (); + } + } + + $conn->close; +} + +# +# Initially, the agreements have consumer host:port info instead of +# replica info. This routine will find the consumer replica info +# +sub find_consumer_replicas +{ + my ($m_ridx); # index of master's replica + my ($s_ridx); # index of supplier's replica + my ($c_ridx); # index of consumer's replica + my ($c_sidx); # index of consumer server + my ($remainder); # + my ($s_replicaroot); # supplier replica root + my ($c_replicaroot); # consumer replica root + my ($j, $val); + + # + # Loop through every agreement defined on the current supplier replica + # + foreach (@allagreements) { + $s_ridx = $_->{ridx}; + $c_sidx = $_->{cidx}; + $s_replicaroot = $1 if ($allreplicas[$s_ridx] =~ /^\d+:([^:]*)/); + $c_replicaroot = ""; + + # $c_ridx will be assigned to -$c_sidx + # if the condumer is not accessible + # $c_sidx will not be zero since it's + # not the first server. + $c_ridx = -$c_sidx; # $c_sidx will not be zero + + # Loop through consumer's replicas and find + # the counter part for the current supplier + # replica + for ($j = 0; $j <= $#allreplicas; $j++) { + + # Get a replica on consumer + # I'm not sure what's going on here, but possibly could be made + # much simpler with normalizeDN and/or ldap_explode_dn + if ($allreplicas[$j] =~ /^$c_sidx:([^:]*)/) { + $val = $1; + + # We need to find out the consumer + # replica that matches the supplier + # replicaroot most. + if ($s_replicaroot =~ /^.*$val$/i && + length ($val) >= length ($c_replicaroot)) { + $c_ridx = $j; + + # Avoid case-sensitive comparison + last if (length($s_replicaroot) == length($val)); + $c_replicaroot = $val; + } + } + } + $_->{ridx} = $s_ridx; + $_->{cidx} = $c_ridx; + } +} + +sub process_suppliers +{ + my ($ridx, $mid, $maxcsn); + + $mid = ""; + + $last_sidx = -1; # global variable for print html page + + for ($ridx = 0; $ridx <= $#allreplicas; $ridx++) { + + # Skip consumers and hubs + next if $allreplicas[$ridx] !~ /:master:(\d+):/i; + $mid = $1; + + # Skip replicas without agreements defined yet + next if (! grep {$_->{ridx} == $ridx} @allagreements); + + $maxcsn = &print_master_header ($ridx, $mid); + if ( "$maxcsn" != "none" ) { + &print_consumer_header (); + &print_consumers ($ridx, $mid); + } + &print_supplier_end; + } + + if ($mid eq "") { + print "

                      The server is not a master or it has no replication agreement\n"; + } +} + +sub print_master_header +{ + my ($ridx, $mid) = @_; + my ($myruv) = $allruvs {"$ridx:$mid"}; + my ($maxcsnval) = split ( /;/, "$myruv" ); + my ($maxcsn) = &to_string_csn ($maxcsnval); + my ($sidx, $replicaroot, $replicatype, $serverid) = split (/:/, $allreplicas[$ridx]); + + # Print the master name + if ( $last_sidx != $sidx ) { + my ($ldapurl) = &get_ldap_url ($sidx, $sidx); + &print_legend if ( $last_sidx < 0); + print "


                      \n"; + print "\n

                      \n"; + print "Master:  $ldapurl
                      \n"; + $last_sidx = $sidx; + } + + # Print the current replica info onthe master + print "\n

                      Bucket ¥¢¥É¥ì¥¹ ¥­¡¼ ¥¢¥¯¥»¥¹²ó¿ô ºï½ü ¼¡¤Ø LRU MRU ¥Ç¡¼¥¿
                      \n"; + + print "\n\n"; + print "\n"; + print "\n"; + print "\n"; + print "\n"; + print "\n"; + print "\n"; + print "\n"; + print "\n"; + print "\n"; + print "\n"; + print "\n"; + print "\n"; +} + +sub print_consumers +{ + my ($m_ridx, $mid) = @_; + my ($ignore, $m_replicaroot) = split (/:/, $allreplicas[$m_ridx]); + my (@consumers, @ouragreements, @myagreements); + my ($s_ridx, $c_ridx, $conntype, $schedule, $status); + my ($c_maxcsn_str, $lag, $markcolor); + my ($c_replicaroot, $c_replicatype); + my ($first_entry); + my ($nrows); + my ($found); + + undef @ouragreements; + + # Collect all the consumer replicas for the current master replica + push (@consumers, $m_ridx); + foreach (@consumers) { + $s_ridx = $_; + for (@allagreements) { + next if ($_->{ridx} != $s_ridx); + $c_ridx = $_->{cidx}; + next if $c_ridx == $m_ridx; + push @ouragreements, $_; + $found = 0; + foreach (@consumers) { + if ($_ == $c_ridx) { + $found = 1; + last; + } + } + push (@consumers, $c_ridx) if !$found; + } + } + + # Print each consumer replica + my ($myruv) = $allruvs {"$m_ridx:$mid"}; + my ($m_maxcsn) = split ( /;/, "$myruv" ); + foreach (@consumers) { + $c_ridx = $_; + next if $c_ridx == $m_ridx; + + if ($c_ridx >= 0) { + $myruv = $allruvs {"$c_ridx:$mid"}; + ($c_maxcsn, $c_lastmodified) = split ( /;/, "$myruv" ); + ($c_maxcsn_str, $lag, $markcolor) = &cacl_time_lag ($m_maxcsn, $c_maxcsn); + $c_maxcsn_str =~ s/ /\/; + ($c_sidx, $c_replicaroot, $c_replicatype) = split (/:/, $allreplicas[$c_ridx]); + $c_replicaroot = "same as master" if $m_replicaroot eq $c_replicaroot; + } + else { + # $c_ridx is actually -$c_sidx when c is not available + $c_sidx = -$c_ridx; + $c_maxcsn_str = "_"; + $lag = "n/a"; + $markcolor = red; + $c_replicaroot = "_"; + $c_replicatype = "_"; + } + + $nrows = 0; + foreach (@ouragreements) { + next if ($_->{cidx} != $c_ridx); + $nrows++; + } + + $first_entry = 1; + foreach (@ouragreements) { + next if ($_->{cidx} != $c_ridx); + $s_ridx = $_->{ridx}; + $conntype = $_->{nsDS5ReplicaBindMethod}; + $status = $_->{nsds5replicaLastUpdateStatus}; + $schedule = $_->{nsds5ReplicaUpdateSchedule}; + $s_sidx = $1 if $allreplicas [$s_ridx] =~ /^(\d+):/; + $s_ldapurl = &get_ldap_url ($s_sidx, "n/a"); + + # Print out the consumer's replica and ruvs + print "\n\n"; + if ($first_entry) { + $first_entry = 0; + $c_ldapurl = &get_ldap_url ($c_sidx, $conntype); + print "\n"; + print "\n"; + print "\n"; + print "\n"; + } + print "\n"; + my $changecount = $_->{nsds5replicaChangesSentSinceStartup}; + if ( $changecount =~ /^$mid:(\d+)\/(\d+) / || $changecount =~ / $mid:(\d+)\/(\d+) / ) { + $changecount = "$1 / $2"; + } + elsif ( $changecount =~ /^(\d+)$/ ) { + $changecount = $changecount . " / " . "$_->{nsds5replicaChangesSkippedSinceStartup}"; + } + else { + $changecount = "0 / 0"; + } + print "\n"; + my $redfontstart = ""; + my $redfontend = ""; + if ($status =~ /error/i) { + $redfontstart = ""; + $redfontend = ""; + } + elsif ($status =~ /^(\d+) /) { + if ( $1 != 0 ) { + # warning + $redfontstart = ""; + $redfontend = ""; + } + } + print "\n"; + print "\n"; + print "\n"; + if ( $schedule =~ /always/i ) { + print "\n"; + } + else { + my ($ndays, @days); + $schedule =~ /(\d\d)(\d\d)-(\d\d)(\d\d) (\d+)/; + print "\n"; + $ndays = $5; + $ndays =~ s/(\d)/$1,/g; + @days = (Sun,Mon,Tue,Wed,Thu,Fri,Sat)[eval $ndays]; + print "\n"; + } + print "\n"; + } + } +} + +sub cacl_time_lag +{ + my ($s_maxcsn, $c_maxcsn) = @_; + my ($markcolor); + my ($csn_str); + my ($s_tm, $c_tm, $lag_tm, $lag_str, $hours, $minute); + + $csn_str = &to_string_csn ($c_maxcsn); + + if ($s_maxcsn && !$c_maxcsn) { + $lag_str = "- ?:??:??"; + $markcolor = &get_color (36000); # assume consumer has big latency + } + elsif (!$s_maxcsn && $c_maxcsn) { + $lag_str = "+ ?:??:??"; + $markcolor = &get_color (1); # consumer is ahead of supplier + } + elsif ($s_maxcsn le $c_maxcsn) { + $lag_str = "0:00:00"; + $markcolor = &get_color (0); + } + else { + my ($rawcsn, $decimalcsn) = split (/:/, $s_maxcsn); + ($s_tm) = split(/ /, $decimalcsn); + + ($rawcsn, $decimalcsn) = split (/:/, $c_maxcsn); + ($c_tm) = split(/ /, $decimalcsn); + if ($s_tm > $c_tm) { + $lag_tm = $s_tm - $c_tm; + $lag_str = "- "; + $markcolor = &get_color ($lag_tm); + } + else { + $lag_tm = $c_tm - $s_tm; + $lag_str = "+ "; + $markcolor = $allcolors{ $colorkeys[0] }; # no delay + } + $hours = int ($lag_tm / 3600); + $lag_str .= "$hours:"; + + $lag_tm = $lag_tm % 3600; + $minutes = int ($lag_tm / 60); + $minutes = "0".$minutes if ($minutes < 10); + $lag_str .= "$minutes:"; + + $lag_tm = $lag_tm % 60; + $lag_tm = "0".$lag_tm if ($lag_tm < 10); + $lag_str .= "$lag_tm"; + } + return ($csn_str, $lag_str, $markcolor); +} + +# +# The subroutine would append a new entry to the end of +# @servers if the host and port are new to @servers. +# +sub add_server +{ + my ($host, $port, $binddn, $bindpwd, $bindcert) = split (/:/, "@_"); + my ($shadowport) = $port; + my ($domainpattern) = '\.[^:]+'; + my ($i); + + # Remove the domain name from the host name + my ($hostnode) = $host; + $hostnode = $1 if $host =~ /^(\w+)\./; + + # new host:port + if ($binddn eq "" || $bindpwd eq "" && $bindcert eq "") { + # + # Look up connection parameter in the order of + # host:port + # host:* + # *:port + # *:* + # + my (@myconfig, $h, $p, $d, $w, $c); + (@myconfig = grep (/^$hostnode($domainpattern)*:$port\D/i, @allconnections)) || + (@myconfig = grep (/^$hostnode($domainpattern)*:\*:/i, @allconnections)) || + (@myconfig = grep (/^\*:$port\D/, @allconnections)) || + (@myconfig = grep (/^\*:\*\D/, @allconnections)); + if ($#myconfig >= 0) { + ($h, $p, $d, $w, $c) = split (/:/, $myconfig[0]); + ($p, $shadowport) = split (/=/, $p); + $p = "" if $p eq "*"; + $c = "" if $c eq "*"; + } + if ($binddn eq "" || $binddn eq "*") { + if ($d eq "" || $d eq "*") { + $binddn = "cn=Directory Manager"; + } + else { + $binddn = $d; + } + } + $bindpwd = $w if ($bindpwd eq "" || $bindpwd eq "*"); + $bindcert = $c if ($bindcert eq "" || $bindcert eq "*"); + } + + for ($i = 0; $i <= $#servers; $i++) { + return $i if ($servers[$i] =~ /$hostnode($domainpattern)*:\d*=$shadowport\D/i); + } + + push (@servers, "$host:$port=$shadowport:$binddn:$bindpwd:$bindcert"); + return $i; +} + +sub get_ldap_url +{ + my ($sidx, $conntype) = @_; + my ($host, $port) = split(/:/, $servers[$sidx]); + my ($shadowport); + ($port, $shadowport) = split (/=/, $port); + my ($protocol, $ldapurl); + + if ($port eq 636 && $conntype eq "0" || $conntype =~ /SSL/i) { + $protocol = ldaps; + } + else { + $protocol = ldap; + } + my ($instance) = $allaliases { "$host:$port" }; + $instance = "$host:$port" if !$instance; + if ($conntype eq "n/a") { + $ldapurl = $instance; + } + else { + $ldapurl = "$instance"; + } + return $ldapurl; +} + +sub to_decimal_csn +{ + my ($maxcsn) = @_; + if (!$maxcsn || $maxcsn eq "") { + return "none"; + } + + my ($tm, $seq, $masterid, $subseq) = unpack("a8 a4 a4 a4", $maxcsn); + + $tm = hex($tm); + $seq = hex($seq); + $masterid = hex($masterid); + $subseq = hex($subseq); + + return "$tm $seq $masterid $subseq"; +} + +sub to_string_csn +{ + my ($rawcsn, $decimalcsn) = split(/:/, "@_"); + if (!$rawcsn || $rawcsn eq "") { + return "none"; + } + my ($tm, $seq, $masterid, $subseq) = split(/ /, $decimalcsn); + my ($sec, $min, $hour, $mday, $mon, $year) = localtime($tm); + $mon++; + $year += 1900; + foreach ($sec, $min, $hour, $mday, $mon) { + $_ = "0".$_ if ($_ < 10); + } + my ($csnstr) = "$mon/$mday/$year $hour:$min:$sec"; + $csnstr .= " $seq $subseq" if ( $seq != 0 || $subseq != 0 ); + return "$rawcsn ($csnstr)"; +} + +sub get_color +{ + my ($lag_minute) = @_; + $lag_minute /= 60; + my ($color) = $allcolors { $colorkeys[0] }; + foreach (@colorkeys) { + last if ($lag_minute < $_); + $color = $allcolors {$_}; + } + return $color; +} + +# subroutine to remove escaped encoding + +sub unescape +{ + #my ($_) = @_; + tr/+/ /; + s/%(..)/pack("c",hex($1))/ge; + $_; +} + +sub print_html_header +{ + # print the HTML header + + print "Content-type: text/html\n\n"; + print "\n"; + print "Replication Status\n"; + # print "\n"; + print "\n\n"; + + if ($opt_u) { + print "\n"; + } + + print "
                      \n"; + print "Replica ID: "; + print "$serverid\n"; + + print "Replica Root: "; + print "$replicaroot\n"; + + print "Max CSN: "; + print "$maxcsn\n"; + + return $maxcsn; +} + +sub print_consumer_header +{ + #Print the header of consumer + print "\n
                      ReceiverTime LagMax CSNLast Modify TimeSupplierSent/SkippedUpdate StatusUpdate StartedUpdate EndedScheduleSSL?
                      $c_ldapurl
                      Type: $c_replicatype
                      $lag
                      $c_maxcsn_str$c_lastmodified
                      $s_ldapurl
                      $changecount$redfontstart$status$redfontend", &format_z_time($_->{nsds5replicaLastUpdateStart}), "", &format_z_time($_->{nsds5replicaLastUpdateEnd}), "$schedule$1:$2-$3:$4@days$conntype
                      \n"; + print "\n"; + print "
                      $now"; + print "Netscape Directory Server Replication Status\n"; + + if ($opt_u) { + print "
                      (This page updates every $interval seconds)\n"; + } + + print "
                      $version"; + print "
                      \n"; +} + +sub print_legend +{ + my ($nlegends) = $#colorkeys + 1; + print "\n

                      Time Lag Legend:

                      \n"; + print "\n\n"; + my ($i, $j); + for ($i = 0; $i < $nlegends - 1; $i++) { + $j = $colorkeys[$i]; + print "\n\n"; + } + $j = $colorkeys[$i]; + print "\n\n"; + print "\n\n"; + print "
                      within $colorkeys[$i+1] min
                      over $colorkeys[$i] min
                      server n/a

                      \n"; +} + +sub print_supplier_end +{ + print "\n"; +} + +# given a string in generalized time format, convert to ascii time +sub format_z_time +{ + my $zstr = shift; + return "n/a" if (! $zstr); + my ($year, $mon, $day, $hour, $min, $sec) = + ($zstr =~ /(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/); + my $time = timegm($sec, $min, $hour, $day, ($mon-1), $year); + ($sec, $min, $hour, $day, $mon, $year) = localtime($time); + $mon++; + $year += 1900; + foreach ($sec, $min, $hour, $day, $mon) { + $_ = "0".$_ if ($_ < 10); + } + + return "$mon/$day/$year $hour:$min:$sec"; +} diff --git a/ldap/admin/src/scripts/template-verify-db.pl b/ldap/admin/src/scripts/template-verify-db.pl new file mode 100644 index 00000000..a6cd98ca --- /dev/null +++ b/ldap/admin/src/scripts/template-verify-db.pl @@ -0,0 +1,196 @@ +#{{PERL-EXEC}} +# +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2003-2004 AOL, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK +# + +sub getDbDir +{ + (my $here) = @_; + my @dbdirs = (); + + opendir(DIR, $here) or die "can't opendir $here : $!"; + while (defined($dir = readdir(DIR))) + { + my $thisdir; + if ("$here" eq ".") + { + $thisdir = $dir; + } + else + { + $thisdir = $here . "{{SEP}}" . $dir; + } + if (-d $thisdir) + { + if (!($thisdir =~ /\./)) + { + opendir(SUBDIR, "$thisdir") or die "can't opendir $thisdir : $!"; + while (defined($file = readdir(SUBDIR))) + { + if ($file eq "DBVERSION") + { + $#dbdirs++; + $dbdirs[$#dbdirs] = $thisdir; + } + } + closedir(SUBDIR); + } + } + } + closedir(DIR); + + return \@dbdirs; +} + +sub getLastLogfile +{ + (my $here) = @_; + my $logfile = ""; + + opendir(DIR, $here) or die "can't opendir $here : $!"; + while (defined($file = readdir(DIR))) + { + if ($file =~ /log./) + { + $logfile = $file; + } + } + closedir(DIR); + + return \$logfile; +} + +print("*****************************************************************\n"); +print("verify-db: This tool should only be run if recovery start fails\n" . + "and the server is down. If you run this tool while the server is\n" . + "running, you may get false reports of corrupted files or other\n" . + "false errors.\n"); +print("*****************************************************************\n"); + +# get dirs having DBVERSION +my $dbdirs = getDbDir("."); + +for (my $i = 0; $i < @$dbdirs; $i++) +{ + # run ../bin/slapd/server/db_printlog -h for each + print "Verify log files in $$dbdirs[$i] ... "; + open(PRINTLOG, "..{{SEP}}bin{{SEP}}slapd{{SEP}}server{{SEP}}db_printlog -h $$dbdirs[$i] 2>&1 1> nul |"); + sleep 1; + my $haserr = 0; + while ($l = ) + { + if ("$l" ne "") + { + if ($haserr == 0) + { + print "\n"; + } + print "LOG ERROR: $l"; + $haserr++; + } + } + close(PRINTLOG); + if ($haserr == 0 && $? == 0) + { + print "Good\n"; + } + else + { + my $logfile = getLastLogfile($$dbdirs[$i]); + print "Log file(s) in $$dbdirs[$i] could be corrupted.\n"; + print "Please delete a log file $$logfile, and try restarting the server.\n"; + } +} + +for (my $i = 0; $i < @$dbdirs; $i++) +{ + # changelog + opendir(DB, $$dbdirs[$i]) or die "can't opendir $$dbdirs[$i] : $!"; + while (defined($db = readdir(DB))) + { + if ($db =~ /\.db/) + { + my $thisdb = $$dbdirs[$i] . "{{SEP}}" . $db; + print "Verify $thisdb ... "; + open(DBVERIFY, "..{{SEP}}bin{{SEP}}slapd{{SEP}}server{{SEP}}db_verify $thisdb 2>&1 1> nul |"); + sleep 1; + my $haserr = 0; + while ($l = ) + { + if ($haserr == 0) + { + print "\n"; + } + if ("$l" ne "") + { + $haserr++; + print "DB ERROR: $l"; + } + } + close(DBVERIFY); + if ($haserr == 0 && $? == 0) + { + print "Good\n"; + } + else + { + print "changelog file $db in $$dbdirs[$i] is corrupted.\n"; + print "Please restore your backup and recover the database.\n"; + } + } + } + closedir(DB); + + # backend: get instance dirs under + my $instdirs = getDbDir($$dbdirs[$i]); + + for (my $j = 0; $j < @$instdirs; $j++) + { + opendir(DIR, $$instdirs[$j]) or die "can't opendir $here : $!"; + while (defined($db = readdir(DIR))) + { + if ($db =~ /\.db/) + { + my $thisdb = $$instdirs[$j] . "{{SEP}}" . $db; + print "Verify $thisdb ... "; + open(DBVERIFY, "..{{SEP}}bin{{SEP}}slapd{{SEP}}server{{SEP}}db_verify $thisdb 2>&1 1> null |"); + sleep 1; + my $haserr = 0; + while ($l = ) + { + if ($haserr == 0) + { + print "\n"; + } + if ("$l" ne "") + { + $haserr++; + print "DB ERROR: $l"; + } + } + close(DBVERIFY); + if ($haserr == 0 && $? == 0) + { + print "Good\n"; + } + else + { + if ("$db" =~ /id2entry.db/) + { + print "Primary db file $db in $$instdirs[$j] is corrupted.\n"; + print "Please restore your backup and recover the database.\n"; + } + else + { + print "Secondary index file $db in $$instdirs[$j] is corrupted.\n"; + print "Please run db2index(.pl) for reindexing.\n"; + } + } + } + } + closedir(DIR); + } +} diff --git a/ldap/admin/src/shutdown.c b/ldap/admin/src/shutdown.c new file mode 100644 index 00000000..0ed55c1c --- /dev/null +++ b/ldap/admin/src/shutdown.c @@ -0,0 +1,39 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/* + * shutdown.c: Kills the server. + * + * DS changes: Anil Bhavnani + * Removed all HTML output for DS 4.0: Rob Weltman + * Mike McCool + */ + +#include +#include +#include +#include "libadminutil/admutil.h" +#include "dsalib.h" +#include "init_ds_env.h" + +int main(int argc, char *argv[]) +{ + int status = -1; + + fprintf(stdout, "Content-type: text/html\n\n"); + + if ( init_ds_env() ) + return 1; + + status = ds_bring_down_server(); + if(status == DS_SERVER_DOWN) { + rpt_success("Success! The server has been shut down."); + return 0; + } else { + rpt_err( status, "", NULL, NULL ); + return 1; + } +} + diff --git a/ldap/admin/src/start.c b/ldap/admin/src/start.c new file mode 100644 index 00000000..8a0e4289 --- /dev/null +++ b/ldap/admin/src/start.c @@ -0,0 +1,42 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/* + * start.c: Starts up the server. + * + * DS changes: Anil Bhavnani + * Removed all HTML output for DS 4.0: Rob Weltman + * Mike McCool + */ + +#include +#include +#include +#include "libadminutil/admutil.h" +#include "dsalib.h" +#include "init_ds_env.h" + + +static char buf[1024]; + +int main(int argc, char *argv[]) +{ + int status = -1; + char *instanceName = 0; + + fprintf(stdout, "Content-type: text/html\n\n"); + + if ( init_ds_env() ) + return 0; + + status = ds_bring_up_server(1); + if(status == DS_SERVER_UP) { + rpt_success("Success! The server has been started."); + return 0; + } else { + rpt_err( status, "", NULL, NULL ); + return 1; + } +} diff --git a/ldap/admin/src/uname.lib b/ldap/admin/src/uname.lib new file mode 100644 index 00000000..f3269e65 --- /dev/null +++ b/ldap/admin/src/uname.lib @@ -0,0 +1,169 @@ +#!perl +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# + +sub uname +{ + local (@CommandLine) = @_; + + local($getall) = 0; + local($getproc) = 0; + local($getosrel) = 0; + local($getosname) = 0; + local($getosver) = 0; + + while ($_ = @CommandLine[0]) { + PARSE_SWITCH: { + if (/^-a\b/i) {# show all information + $getall=1; + shift(@CommandLine); + last PARSE_SWITCH + } + if (/^-n\b/i) {# show node name + $getnodename=1; + shift(@CommandLine); + last PARSE_SWITCH + } + if (/^-p\b/i) {# show processor + $getproc=1; + shift(@CommandLine); + last PARSE_SWITCH + } + if (/^-r\b/i) {# show os release + $getosrel=1; + shift(@CommandLine); + last PARSE_SWITCH + } + if (/^-s\b/i) {# show os name + $getosname=1; + shift(@CommandLine); + last PARSE_SWITCH + } + if (/^-v\b/i) {# show os version + $getosver=1; + shift(@CommandLine); + last PARSE_SWITCH + } + print " ERROR: Unknown parameter: $_\n"; + shift(@CommandLine); + } + } + +chomp(local($os) = `uname -s`); +local($nodename) = ""; +local($proc) = ""; +local($osrel) = ""; +local($osname) = ""; +local($osver) = ""; +local($osrel1) = ""; +local($osrel2) = ""; +local($nodename1) = ""; +local($retval) = ""; +local($ret) = ""; + +if ($os eq "Windows_NT") +{ + chomp($nodename = `uname -n`); + chomp($proc = `uname -m`); lc($proc); + if ($proc =~ /^[0-9]86.*/) + { + $proc = "i386"; + } + else + { + $proc = "?"; + } + chomp($osrel1 = `uname -r`); + chomp($osrel2 = `uname -v`); + $osrel = $osrel1.".".$osrel2; + $osname = "WINNT"; + $osver = "???"; +} +if ($os eq "WINNT") +{ + chomp($nodename = `uname -n`); + chomp($proc = `uname -p`); lc($proc); + chomp($osrel = `uname -r`); + $osname = "WINNT"; + chomp($osver = `uname -v`); +} + +if ($os eq "SunOS") +{ + chomp($nodename = `uname -n`); + chomp($proc = `uname -p`); + chomp($osrel = `uname -r`); + $osname = $os; + chomp($osver = `uname -v`); +} +if ($os eq "IRIX" || $os eq "IRIX64") +{ + chomp($nodename = `uname -n`); + chomp($proc = `uname -p`); + chomp($osrel = `uname -r`); + $osname = "IRIX"; + chomp($osver = `uname -v`); +} + +if ($os eq "HP-UX") +{ + chomp($nodename = `uname -n`); +# $proc = "hppa1.1"; + chomp($proc = `uname -m`); + chomp($osrel = `uname -r`); + $osname = $os; + chomp($osver = `uname -v`); +} + +if ($os eq "OSF1") +{ + chomp($nodename1 = `uname -n`); + ($nodename) = ($nodename1 =~ /(\w+)\..*/); + chomp($proc = `uname -m`); + chomp($osrel = `uname -r`); + $osname = $os; + chomp($osver = `uname -v`); +} + +if ($os eq "AIX") +{ + chomp($nodename = `uname -n`); + $proc = "rs6000"; + chomp($osrel1 = `uname -v`); + chomp($osrel2 = `uname -r`); + $osrel = $osrel1.".".$osrel2; + $osname = $os; + $osver = "???"; +} + +if ($getall) +{ + $getosname = 1; + $getnodename = 1; + $getosrel = 1; + $getosver = 1; + $getproc = 1; +} + +$retval = ""; +$retval = $retval.($getosname ? $osname : ""); +$retval = $retval.($getnodename ? " ".$nodename : ""); +$retval = $retval.($getosrel ? " ".$osrel : ""); +$retval = $retval.($getosver ? " ".$osver : ""); +$retval = $retval.($getproc ? " ".$proc : ""); + +if ($retval eq "") +{ + $retval = $nodename; +} + +($ret) = ($retval =~ /\s*(.*)/); + +return "$ret"; +} +1 diff --git a/ldap/admin/src/updatedsgw b/ldap/admin/src/updatedsgw new file mode 100755 index 00000000..e09c59ac --- /dev/null +++ b/ldap/admin/src/updatedsgw @@ -0,0 +1,331 @@ +#!perl +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# + +$nshome = $ENV{'NETSITE_ROOT'}; + +# If there is no nshome, then assume that we're running +# as a commandline script. +if (!$nshome ) { + $script_mode = 1; + +# get the commandline options + if (!getopts('h:i:d:e:s:t:n:') || !$opt_n || !$opt_h ) { + print "usage: " . $0 . " -n nshome -h current_slapd_host:current_slapd_port [options]\n"; + print "\nrequired:\n"; + print " -n directory\tthe directory where 7.0 is installed (NS-HOME)\n"; + print " -h host[:port]\tthe current host and port of the directory server\n"; + print " \tto which the gateway connects.\n"; + print "\noptions:\n"; + print " -i host[:port]\tthe new host and port of the directory server\n"; + print " -s suffix\t\tthe old suffix of the directory server\n"; + print " -t suffix\t\tthe new ESCAPED suffix of the directory server\n"; + print " -d dirmgrdn\t\tthe old manager dn of the directory server\n"; + print " -e dirmgrdn\t\tthe new manager dn of the directory server\n"; + print "\nexample:\n " . $0 . " -n /home/servers/ds70/ -h gargoyle:1974 -i brooklyn -s \"dc=example,dc=com\" -t \"o%3Dmcom.com\" -d \"cn=directory manager\" -e \"cn=directory guru\"\n"; + + exit; + } + + # Parse the commandline options + handle_script_input(); + +} else { +# output cgi header + print "Content-type: text/plain\n\n"; + +# print "Done\n"; +# parse the input + while ( <> ) { + &parse_input( $_ ); + } + + if ( !$vars{'old_host'}) { + rpt_err( -13, "host"); +# -13 = null parameter. +# print "Invalid input for DSGW changer CGI\n\n"; + exit; + } + +# print "$nshome $vars{'old_host'} $vars{'old_port'}\n"; +} + +# setup the path separator +$isNT = -d '\\'; +$PS = $isNT ? "\\" : "/"; + +$contextdir = "$nshome"."$PS"."dsgw"."$PS"."context"; + +#make sure that the target directory exists +if (! -e "$contextdir") { + rpt_err( -16 ,"$contextdir"); +# -16 = not a directory +# print "$contextdir does not exist\n"; + exit; +} + + +# cd into NS-HOME/dsgw/context directory +chdir "$contextdir" or die "Unable to cd to $contextdir: $!\n"; + +# read the files + opendir DSGW_CONTEXT, "." or die "$!"; + @dsgwconfs = grep !/^\.\.?$/, readdir DSGW_CONTEXT; + closedir DSGW_CONTEXT; + + +# unescape the new and old suffixes +if ($vars{'old_suffix'} && $vars{'new_suffix'}) { + $escaped_suffix = $vars{'new_suffix'}; + $vars{'new_suffix'} =~ s/%(\w\w)/chr(hex($1))/eg; + $unescaped_suffix = $vars{'new_suffix'}; +# print "Normal new suffix: $unescaped_suffix\n"; +# print "Escaped new suffix: $escaped_suffix\n"; + $unescaped_oldsuffix = $vars{'old_suffix'}; + $unescaped_oldsuffix =~ s/%(\w\w)/chr(hex($1))/eg; +} + +#unescape the digmrs +if ($vars{'new_dirmgr'}){ + $vars{'new_dirmgr'} =~ s/%(\w\w)/chr(hex($1))/eg; +} + +if ($vars{'old_dirmgr'}){ + $vars{'old_dirmgr'} =~ s/%(\w\w)/chr(hex($1))/eg; +} + + + # + $changed = ""; + foreach $file (@dsgwconfs){ + +# print "working on $file\n"; + + # If it's not a .conf file, skip it. + if ( $file !~ m/.*?\.conf$/ ) { +# print "skipping $file\n\n\n\n"; + next; + } + + $relevant_conf = 0; + $relevant_suffix = 0; + + # open the old file + open(OLDFILE, "$file") or die "Cannot read $file. $!\n"; # + + # Need to test to see if this conf file has a baseurl that + # matches the old host and port + for ($line=; $line ; $line=) { # + + # If we find the matching baseurl, then set a flag and break out of the loop. + if ($line =~ m:^baseurl\s*("){0,1}\s*ldap(s){0,1}\://$vars{'old_host'}(\:$vars{'old_port'}){0,1}/:) { #") + # Also check for a matching suffix. + if ($vars{'old_suffix'} && $vars{'new_suffix'}) { + @baseurl = split("/", $line); + $curr_suff = $baseurl[3]; + + # Get rid of any double quotes. + @baseurl = split("\"", $curr_suff); + $curr_suff = $baseurl[0]; + + $unescaped_currsuffix = $curr_suff; + $unescaped_currsuffix =~ s/%(\w\w)/chr(hex($1))/eg; + +# print "curr Suffix: $curr_suff\n"; +# print "old Suffix: $vars{'old_suffix'}\n"; +# print "unescaped curr Suffix: $unescaped_currsuffix\n"; +# print "unescaped old Suffix: $unescaped_oldsuffix\n"; + + if ($unescaped_currsuffix eq $unescaped_oldsuffix) { + $relevant_suffix = 1; +# print "suffix match for $file\n"; + } + + } + # set a flag + $relevant_conf = 1; +# print "host:port match for $file\n"; + last; + } + + + } + + # If there was no match, then go on to the next file. + if (! $relevant_conf) { + close(OLDFILE); +# print "no match for $file\n"; + next; + } + + # Else, there is a match start over at the beginning of the file + seek OLDFILE, 0, 0; + if ($changed eq "") { + $changed = $file; + } + + # open the new file + open(NEWFILE, ">"."tmpcp_"."$file"."1") or die "Cannot write $contextdir$PStmpcp_$file1. $!\n"; + + # Go through each line, replacing the relevant information + for ($line=; $line ; $line=) { # + + # If there is a new host + if ($vars{'new_host'}) { + $line =~ s:^baseurl\s*("){0,1}\s*ldap(s){0,1}\://.*?(\:\d*){0,1}/:baseurl\t$1ldap$2\://$vars{'new_host'}$3/:og; #") +# print "new host for $file\n"; + + } + + # a new port + if ($vars{'new_port'}) { + $line =~ s:^baseurl\s*("){0,1}\s*ldap(s){0,1}\://(.*?)(\:\d*){0,1}/:baseurl\t$1ldap$2\://$3\:$vars{'new_port'}/:og; #") +# print "new port for $file\n"; + } + + # new dirmgr + if ($vars{'new_dirmgr'} && $vars{'old_dirmgr'}) { + $line =~ s:(?i)^dirmgr\s*("){0,1}$vars{'old_dirmgr'}("){0,1}:dirmgr\t"$vars{'new_dirmgr'}":g; +# print "new dirmgr for $file\n"; + } + + # new suffix + if ($relevant_suffix) { + $line =~ s:(^baseurl\s*("){0,1}\s*ldap(s){0,1}\://.*?(\:\d*){0,1}/)((.*?("))|(.*?)):$1$escaped_suffix$7:og; # + $line =~ s:^location-suffix.*:location-suffix\t"$unescaped_suffix":og; +# print "new suffix for $file\n"; + } + + + print NEWFILE $line; + + } + # + close(OLDFILE); + close(NEWFILE); + + rename "tmpcp_" . "$file"."1", "$file"; + + } +rpt_err(0, $changed); + + +sub parse_input +{ + local( $line ) = @_; + local($var, $value, $assign ); + + + foreach $assign ( split( /&/, $line ) ) { + ( $var, $value ) = split( /=/, $assign ); + $value =~ s/\+/ /g; + $value =~ s/ /%20/g; +# $value =~ s/%(\w\w)/chr(hex($1))/eg; + $var =~ s/\+/ /g; +# $var =~ s/%(\w\w)/chr(hex($1))/eg; + + + $vars{$var} = $value; + } +} + + +sub handle_script_input +{ + + if ($opt_h) { + @temp_array = split(":", $opt_h); + + $vars{'old_host'} = $temp_array[0]; + $vars{'old_port'} = $temp_array[1]; + +# print "host: $vars{'old_port'}\n"; +# print "port: $vars{'old_host'}\n"; + } + + if ($opt_i) { + @temp_array = split(":", $opt_i); + + $vars{'new_host'} = $temp_array[0]; + $vars{'new_port'} = $temp_array[1]; + +# print " $vars{'new_port'}\n"; +# print " $vars{'new_host'}\n"; + } + if ($opt_d) { + $vars{'old_dirmgr'} = $opt_d; + } + if ($opt_e) { + $vars{'new_dirmgr'} = $opt_e; + } + if ($opt_s) { + $vars{'old_suffix'} = $opt_s; + } + if ($opt_t) { + $vars{'new_suffix'} = $opt_t; + } + if ($opt_n) { + $nshome = $opt_n; + } + +} + + +sub rpt_err +{ + my $code = shift; + my $err_string = shift; + + print "NMC_ErrInfo: " . "$err_string" . "\n"; + print "NMC_STATUS: " . "$code"."\n"; + +} + +sub getopts { + local($argumentative) = @_; + local(@args,$_,$first,$rest); + local($errs) = 0; + local($[) = 0; + + @args = split( / */, $argumentative ); + while(@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) { + ($first,$rest) = ($1,$2); + $pos = index($argumentative,$first); + if($pos >= $[) { + if($args[$pos+1] eq ':') { + shift(@ARGV); + if($rest eq '') { + ++$errs unless @ARGV; + $rest = shift(@ARGV); + } + eval "\$opt_$first = \$rest;"; + } + else { + eval "\$opt_$first = 1"; + if($rest eq '') { + shift(@ARGV); + } + else { + $ARGV[0] = "-$rest"; + } + } + } + else { + print STDERR "Unknown option: $first\n"; + ++$errs; + if($rest ne '') { + $ARGV[0] = "-$rest"; + } + else { + shift(@ARGV); + } + } + } + $errs == 0; +} + diff --git a/ldap/admin/src/upgradeServer b/ldap/admin/src/upgradeServer new file mode 100755 index 00000000..d6bec4a7 --- /dev/null +++ b/ldap/admin/src/upgradeServer @@ -0,0 +1,442 @@ +#!perl +# +# BEGIN COPYRIGHT BLOCK +# Copyright 2001 Sun Microsystems, Inc. +# Portions copyright 1999, 2001-2003 Netscape Communications Corporation. +# All rights reserved. +# END COPYRIGHT BLOCK +# +# This script is used to copy over files from 'install' directory +# to the server instance. + +BEGIN { + $isNT = -d "\\"; + $PS = $isNT ? "\\" : "/"; + $SEP = $isNT ? ";" : ":" ; + $slapdExecName = $isNT ? "slapd.exe" : "ns-slapd"; + # NT needs quotes around some things unix doesn't + $quote = $isNT ? "\"" : ""; +} + +$sroot = $ARGV[0]; +$prefix = $ARGV[1]; +$installDir = sprintf("%s%s%s%s%s%s%s", $sroot, ${PS}, "bin", ${PS}, "slapd", ${PS}, "install"); + +push @INC, "$sroot/bin/slapd/admin/bin"; +require 'uname.lib'; + +my $os = &uname("-s"); +my $shlibsuf; +SWITCH: { + if ($os eq "AIX") { + $LIB_PATH = "LIBPATH" ; + $shlibsuf = ".so"; + last SWITCH ; + } + if ($os eq "HP-UX") { + $LIB_PATH = "SHLIB_PATH" ; + $shlibsuf = ".sl"; + last SWITCH ; + } + if ($isNT) { + $LIB_PATH = "PATH" ; + $shlibsuf = ".dll"; + last SWITCH ; + } + else { + $LIB_PATH = "LD_LIBRARY_PATH" ; + $shlibsuf = ".so"; + last SWITCH ; + } +} + +# This subroutine takes source directory and destination directory +# as the arguments. + +sub copy_files +{ + my $destDir = pop(@_); + my $srcDir = pop(@_); + my $buf = ""; + my $bufsize = 8192; + + opendir(SRCDIR, $srcDir) || die "Can not open source directory $src_dir\n"; + my @srcfiles = readdir(SRCDIR); + closedir(SRCDIR); + + my $count = 0; + while ($count <= $#srcfiles) { + if ($srcfiles[$count] eq "." || $srcfiles[$count] eq ".." + || $srcfiles[$count] eq "99user.ldif" ) { + $count++; + next; + } + my $fullpath_srcfile = sprintf("%s%s%s", $srcDir, ${PS}, $srcfiles[$count]); + my $fullpath_destfile = sprintf("%s%s%s", $destDir, ${PS}, $srcfiles[$count]); + + open( SRC, $fullpath_srcfile ) || die "Can't open $fullpath_srcfile: $!\n"; + open( DEST, ">$fullpath_destfile" ) || die "Can't create $fullpath_destfile: $!\n"; + while (read(SRC, $buf, $bufsize)) { + print DEST $buf; + } + close( SRC ); + close( DEST ); + + $count++; + } +} + +# Copy schema ldiffiles from /bin/slapd/install/schema to +# //config/schema + +sub copy_schema_files +{ + my $schema_bakdir = sprintf("%s%s%s%s%s%s%s", $sroot, ${PS}, ${prefix}, ${PS}, "config", ${PS}, "schema-bak"); + my $schema_srcdir = sprintf("%s%s%s", $installDir, ${PS}, "schema"); + my $schema_destdir = sprintf("%s%s%s%s%s%s%s", $sroot, ${PS}, ${prefix}, ${PS}, "config", ${PS}, "schema"); + + # First, back up the original schema ldiffiles under schema-bak directory + unless (-d $schema_bakdir) { + mkdir ($schema_bakdir, 0755) || + die "Cannot create directory $schema_bakdir: $!\n"; + } + copy_files( $schema_destdir, $schema_bakdir ); + + # Now, copy the latest schema ldiffiles + copy_files( $schema_srcdir, $schema_destdir ); +} + +sub modify_dse_ldif +{ + my $dse_ldiffile = sprintf("%s%s%s%s%s%s%s", $sroot, ${PS}, ${prefix}, ${PS}, "config", ${PS}, "dse.ldif"); + my $isOID = 0; + my $isJPEG = 0; + my $isSpInSt = 0; + my $reqNameChange = 0; + + open( DSE, "$dse_ldiffile" ) || die "Can't open $dse_ldiffile: $!\n"; + my $new_filename = "$dse_ldiffile"."_new"; + open( OUTFILE, "> $new_filename" ); + while($line = ) { + $isOID = 1 if ( $line =~ /^dn:\s*cn=OID Syntax,\s*cn=plugins,\s*cn=config/i); + $isJPEG = 1 if ( $line =~ /^dn:\s*cn=JPEG Syntax,\s*cn=plugins,\s*cn=config/i); + $isSpInSt = 1 if ( $line =~ /^dn:\s*cn=Space Insensitive String Syntax,\s*cn=plugins,\s*cn=config/i); + if( ($line =~ s/uid uniqueness/attribute uniqueness/) || + ($line =~ s/uid-plugin/attr-unique-plugin/) ){ + # the plugin name has changed + $reqNameChange = 1; + print OUTFILE $line; + } else { + print OUTFILE $line; + } + + } + close( DSE ); + close(OUTFILE); + + if ($isOID && $isJPEG && $isSpInSt && !$reqNameChange) { + # nothing to be done - just return + unlink($new_filename); + return; + } + + if($reqNameChange){ + # if the name change is required copy the contents of the edited dse.ldif_new to the dse.ldif + open( DSE, ">$dse_ldiffile" ) || die "Can't open $dse_ldiffile: $!\n"; + open( OUTFILE, "$new_filename" ) || die "Can't open $new_filename: $!\n"; + while($line = ) { + print DSE $line; + } + close( DSE ); + close(OUTFILE); + } + unlink($new_filename) or die "Cannot unlink $new_filename \n"; + + + open( DSE, ">>$dse_ldiffile" ) || die "Can't open $dse_ldiffile: $!\n"; + + unless ($isOID) { + # Add OID Syntax entry + print DSE "dn: cn=OID Syntax,cn=plugins,cn=config\n"; + print DSE "objectClass: top\n"; + print DSE "objectClass: nsSlapdPlugin\n"; + print DSE "objectClass: extensibleObject\n"; + print DSE "cn: OID Syntax\n"; + print DSE "nsslapd-pluginPath: $sroot/lib/syntax-plugin$shlibsuf\n"; + print DSE "nsslapd-pluginInitfunc: oid_init\n"; + print DSE "nsslapd-pluginType: syntax\n"; + print DSE "nsslapd-pluginEnabled: on\n"; + print DSE "nsslapd-pluginId: oid-syntax\n"; + print DSE "nsslapd-pluginVersion: 6.2.1\n"; + print DSE "nsslapd-pluginVendor: Netscape Communications Corp.\n"; + print DSE "nsslapd-pluginDescription: OID attribute syntax plugin\n"; + print DSE "\n"; + } + + unless ($isJPEG) { + # Add JPEG Syntax entry + print DSE "dn: cn=JPEG Syntax,cn=plugins,cn=config\n"; + print DSE "objectClass: top\n"; + print DSE "objectClass: nsSlapdPlugin\n"; + print DSE "objectClass: extensibleObject\n"; + print DSE "cn: JPEG Syntax\n"; + print DSE "nsslapd-pluginPath: $sroot/lib/syntax-plugin$shlibsuf\n"; + print DSE "nsslapd-pluginInitfunc: jpeg_init\n"; + print DSE "nsslapd-pluginType: syntax\n"; + print DSE "nsslapd-pluginEnabled: on\n"; + print DSE "nsslapd-pluginId: jpeg-syntax\n"; + print DSE "nsslapd-pluginVersion: 6.2.1\n"; + print DSE "nsslapd-pluginVendor: Netscape Communications Corp.\n"; + print DSE "nsslapd-pluginDescription: JPEG attribute syntax plugin\n"; + print DSE "\n"; + } + + unless ($isSpInSt) { + # Add Space Insensitive String Syntax entry + print DSE "dn: cn=Space Insensitive String Syntax,cn=plugins,cn=config\n"; + print DSE "objectClass: top\n"; + print DSE "objectClass: nsSlapdPlugin\n"; + print DSE "objectClass: extensibleObject\n"; + print DSE "cn: Space Insensitive String Syntax\n"; + print DSE "nsslapd-pluginPath: $sroot/lib/syntax-plugin$shlibsuf\n"; + print DSE "nsslapd-pluginInitfunc: sicis_init\n"; + print DSE "nsslapd-pluginType: syntax\n"; + print DSE "nsslapd-pluginEnabled: on\n"; + print DSE "nsslapd-pluginId: spaceinsensitivestring-syntax\n"; + print DSE "nsslapd-pluginVersion: 6.2.1\n"; + print DSE "nsslapd-pluginVendor: Netscape Communications Corp.\n"; + print DSE "nsslapd-pluginDescription: space insensitive string attribute syntax plugin\n"; + print DSE "\n"; + } + + close( DSE ); +} + +sub get_changelog_dir { + my $dse_ldiffile = sprintf("%s%s%s%s%s%s%s", $sroot, ${PS}, ${prefix}, ${PS}, "config", ${PS}, "dse.ldif"); + my $inClEntry = 0; + my $clDir; + + # first find the changelog dir, if any + open( DSE, "$dse_ldiffile" ) || die "Can't open $dse_ldiffile: $!\n"; + while() { + if (/^dn:\s*cn=changelog5,\s*cn=config/i) { + $inClEntry = 1; + next; + } + if (/^\s*$/ && $inClEntry) { + $inClEntry = 0; + last; # not found, just abort + } + if ($inClEntry && /^nsslapd-changelogdir:\s*/i) { + $clDir = $'; + chomp($clDir); + last; + } + } + close( DSE ); + return $clDir; +} + +sub fix_changelog { + my $clDir = shift; + my $newver = shift; + + # look for the region files and remove them - they are the files + # that start with "__" - like __db.001 + opendir CLDIR, $clDir || die "Error: can't open changelog db dir $clDir: $!"; + while (my $ff = readdir CLDIR) { + unlink $clDir."/".$ff if ($ff =~ /^__/); + } + closedir CLDIR; + + # change the dbversion + my $dbverfile = $clDir . "/DBVERSION"; + my $tmpverfile = $clDir . "/DBVERSION.tmp"; + open DBVER, $dbverfile or die "Error: could not read file $dbverfile: $!"; + open TMPVER, ">$tmpverfile" or die "Error: could not write file $tmpverfile: $!"; + while () { + s/\d+\.\d+$/$newver/; + print TMPVER; + } + close TMPVER; + close DBVER; + unlink $dbverfile; + rename $tmpverfile, $dbverfile; +} + +# get the new (current) version from slapd itself +# not currently used +sub getSlapdVersion { + my $dir = shift; + my $version = 0; # major version of e.g. 6.1 == 6 + my $minor = 0; # minor version of e.g. 6.1 == 1 + my $subminor = 0; # subminor version of e.g. 6.1.2 == 2 + my $buildNumber = 0; + my $progDir = "${PS}bin${PS}slapd${PS}server${PS}"; + + # find the slapd executable + $prog = $dir . $progDir . $slapdExecName; + if (! -f $prog) { + die "Could not run slapd program $prog: $!"; + } + else { + chdir($dir . $progDir); + } + + open(F, "${quote}${quote}$prog${quote} -v${quote} 2>&1 |") or + die "Could not run slapd program $prog: $!"; + sleep(1); # allow some data to accumulate in the pipe +# print "Output from $prog -v:\n"; + while () { + if (/^Netscape-Directory\/(\d+)\.(\d+)(?:\.(\d+))?(?:b\d)*\s+(\S+)/) { + $version = $1; + $minor = $2; + if ($4) { + $subminor = $3; + $buildNumber = $4; + } else { + $buildNumber = $3; + } + last; + } + elsif (/^Netscape-Directory\(restrict?ed-mode\)\/(\d+)\.(\d+)(?:\.(\d+))?\s+(\S+)/) { # we can have restricted-mode or restriced-mode ... + # version could be X.Y or X.Y.Z + $version = $1; + $minor = $2; + if ($4) { + $subminor = $3; + $buildNumber = $4; + } else { + $buildNumber = $3; + } + last; + } + elsif (/^iPlanet-Directory\/(\d+)\.(\d+)\s+(\S+)/i) { + $version = $1; + $minor = $2; + $buildNumber = $3; + last; + } + } + my $code = close(F); + + if ($version == 0) { + die "\nCould not determine version of the directory server in $dir: \n"; + } + + # distinguish the 4.1 and the 4.11 thanks to the buildNumber + if (($version == 4) && ($minor == 1)){ + if (! ($buildNumber =~ /^B99\.16/)) { + # it's not a 4.1 Netscape Directory Server => it's a 4.11 + $minor = 11 ; + } + } + return ( $version, $minor, $subminor ); +} + +# get the old version from the $sroot/setup/slapd/slapd.inf file +# not currently used +sub getInfVersion { + my $inffile = "$sroot/setup/slapd/slapd.inf"; + open INF, $inffile || die "Error: could not read file $inffile: $!"; + my $inslapdsection = 0; + while () { + if (/^\[slapd\]/) { + $inslapdsection = 1; + } elsif ($inslapdsection && /^\[/) { + $inslapdsection = 0; + last; + } elsif ($inslapdsection && /^\s*Version\s*=\s*(\d+)\.(\d+)(?:\.(\d+))?/) { + close INF; + return ($1, $2, $3); + } + } + close INF; + return ('0', '0'); +} + +sub getChangelogVersion { + my $cldir = shift; + my $versionfile = $cldir . "/DBVERSION"; + my $version = "0.0"; + open DBVER, $versionfile or return '0.0'; + while () { + if (/(\d+\.\d+)$/) { + $version = $1; + } + } + close DBVER; + return $version; +} + +# +# Some scripts generated by create_instance may not +# get generated during in-place upgrade. This function +# is to fix it during postinstall. +# A new template can be directly added to array @newtemplates +# if it follows the naming convertion of "template-", +# and its target is $prefix/. Otherwise +# modify the script to include any new need. +# +sub instantiate_new_scripts { + + @newtemplates = ( + "$sroot/bin/slapd/admin/scripts/template-ns-newpwpolicy.pl" + ); + + $host = localhost; + $port = 389; + $rootdn = "cn=Directory Manager"; + if ( open ( dse, "$sroot/$prefix/config/dse.ldif" )) { + while ( ) { + $host = $1 if /^nsslapd-localhost:\s*(\S+)\s*$/; + $port = $1 if /^nsslapd-port:\s*(\d+)\D*$/; + $rootdn = $1 if /^nsslapd-rootdn:\s*(\S.+)\s*$/; + } + } + + foreach $src ( @newtemplates ) { + $dest = "$sroot/$prefix/$1" if $src =~ /.*template-(.*)$/; + next if -f $dest; + unless ( open ( template, $src )) { + print "Can't open $src: $!\n"; + next; + } + unless ( open ( target, ">$dest" )) { + print "Can't open $dest: $!\n"; + next; + } + while (