summaryrefslogtreecommitdiffstats
path: root/ldap/admin/src
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2005-03-25 19:05:37 +0000
committerRich Megginson <rmeggins@redhat.com>2005-03-25 19:05:37 +0000
commit103a9559a8eb01a9240490fdabd53002e0367eec (patch)
tree19613a16bd6c1fd37278b592c13f6d53ed066ae2 /ldap/admin/src
parent362bedccdc6e27683e033798d8b0bbbba88d3228 (diff)
1) remove fortezza stuff
2) make sure the .chk files are there 3) fix secmod.db on 64 bit platforms to have the 32 bit nssckbi in there
Diffstat (limited to 'ldap/admin/src')
-rw-r--r--ldap/admin/src/Makefile7
-rwxr-xr-xldap/admin/src/fix_secmod_db_6473
2 files changed, 79 insertions, 1 deletions
diff --git a/ldap/admin/src/Makefile b/ldap/admin/src/Makefile
index 0bde63e7..3fb8c671 100644
--- a/ldap/admin/src/Makefile
+++ b/ldap/admin/src/Makefile
@@ -209,6 +209,10 @@ INST_INCLUDES = $(OBJDIR)/install_keywords.h
TEMPLATE_SCRIPTS_SRC = $(wildcard scripts/template-*)
TEMPLATE_SCRIPTS_DEST = $(subst scripts/,$(SCRIPTSDIR)/,$(TEMPLATE_SCRIPTS_SRC))
+ifeq ($(USE_64), 1)
+ FIX_SECMOD_DEP = $(BINDIR)/fix_secmod_db_64
+endif
+
# 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
@@ -217,7 +221,8 @@ TEMPLATE_SCRIPTS_DEST = $(subst scripts/,$(SCRIPTSDIR)/,$(TEMPLATE_SCRIPTS_SRC))
#.PRECIOUS: $(OBJDEST)/ds_db2bak.o
all: $(BINDIR) $(OBJDEST) $(INST_INCLUDES) $(ALLOBJS) $(BINS) \
- installPerlFiles $(SCRIPTSDIR) $(TEMPLATE_SCRIPTS_DEST)
+ installPerlFiles $(SCRIPTSDIR) $(TEMPLATE_SCRIPTS_DEST) \
+ $(FIX_SECMOD_DEP)
$(SCRIPTSDIR):
$(MKDIR) $@
diff --git a/ldap/admin/src/fix_secmod_db_64 b/ldap/admin/src/fix_secmod_db_64
new file mode 100755
index 00000000..d2c530e4
--- /dev/null
+++ b/ldap/admin/src/fix_secmod_db_64
@@ -0,0 +1,73 @@
+#!/bin/sh
+#
+# BEGIN COPYRIGHT BLOCK
+# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
+# Copyright (C) 2005 Red Hat, Inc.
+# All rights reserved.
+# END COPYRIGHT BLOCK
+#
+
+# We still have 32 bit applications shipped with the 64 bit DS
+# that need to access secmod.db and the root certs file
+# nssckbi shared library. However, 32 bit apps cannot load
+# the 64 bit version of this shared library. This script
+# changes secmod.db to have both the 32 bit and 64 bit versions
+# of nssckbi.
+
+# The first argument is the name of the directory where secmod.db
+# and the nssckbi shared libraries (64 bit and 32 bit) are. If
+# secmod.db does not exist an error will occur.
+
+# The second argument is the path of the modutil
+# command. If the path is omitted then PATH will be used.
+
+usage()
+{
+ echo Error: $1
+ echo The first argument is the name of the directory where secmod.db
+ echo and the nssckbi shared libraries '(64 bit and 32 bit)' are. If
+ echo secmod.db does not exist an error will occur.
+ echo The second argument is the path where the modutil command
+ echo is found.
+}
+
+dir="$1"
+shift
+modutildir="$1"
+modutil=$modutildir/modutil
+LD_LIBRARY_PATH=$modutildir/../lib:$LD_LIBRARY_PATH
+SHLIB_PATH=$modutildir/../lib:$SHLIB_PATH
+export LD_LIBRARY_PATH SHLIB_PATH
+
+# see if correct argument was given
+if test \! \( "$dir" -a -d "$dir" \) ; then
+ usage "Invalid directory $dir"
+ exit 1
+fi
+
+# see if the files are there
+
+lib64=$dir/*nssckbi.*
+lib32=$dir/*nssckbi32.*
+
+if test \! \( -f $lib64 -a -f $lib32 \) ; then
+ usage "Files $lib64 and/or $lib32 do not exist in dir $dir"
+ exit 2
+fi
+
+if test \! -f $dir/secmod.db ; then
+ usage "$dir/secmod.db does not exist"
+ exit 3
+fi
+
+modname="Root Certs 32 bit"
+
+# see if the module already exists
+exists=0
+$modutil -force -nocertdb -dbdir $dir -list | grep "$modname" > /dev/null 2>&1 && exists=1
+
+if test $exists -ne 1 ; then
+ $modutil -force -nocertdb -dbdir $dir -add "$modname" -libfile $lib32 || usage "Could not add $modname to $dir/secmod.db: $?"
+else
+ echo "Module $modname already added to secmod.db"
+fi