[Fedora-directory-commits] fedora-idm-console/win Console.wxs, NONE, 1.1 FedoraLogo.ico, NONE, 1.1 Makefile, NONE, 1.1 fedora-idm-console.bat, NONE, 1.1
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/fedora-idm-console/win
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv18260
Added Files:
Console.wxs FedoraLogo.ico Makefile fedora-idm-console.bat
Log Message:
initial commit of Fedora Console for Windows - has no UI
--- NEW FILE Console.wxs ---
<?xml version='1.0' encoding='windows-1252'?>
<!-- BEGIN COPYRIGHT BLOCK
This Program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; version 2 of the License.
This Program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place, Suite 330, Boston, MA 02111-1307 USA.
In addition, as a special exception, Red Hat, Inc. gives You the additional
right to link the code of this Program with code not covered under the GNU
General Public License ("Non-GPL Code") and to distribute linked combinations
including the two, subject to the limitations in this paragraph. Non-GPL Code
permitted under this exception must only link to the code of this Program
through those well defined interfaces identified in the file named EXCEPTION
found in the source code files (the "Approved Interfaces"). The files of
Non-GPL Code may instantiate templates or use macros or inline functions from
the Approved Interfaces without causing the resulting work to be covered by
the GNU General Public License. Only Red Hat, Inc. may make changes or
additions to the list of Approved Interfaces. You must obey the GNU General
Public License in all respects for all of the Program code and other code used
in conjunction with the Program except the Non-GPL Code covered by this
exception. If you modify this file, you may extend this exception to your
version of the file, but you are not obligated to do so. If you do not wish to
provide this exception without modification, you must delete this exception
statement from your version and license this file solely under the GPL without
exception.
Copyright (C) 2007 Red Hat, Inc.
All rights reserved.
END COPYRIGHT BLOCK -->
<Wix xmlns='http://schemas.microsoft.com/wix/2003/01/wi'>
<Product Name='Fedora Identity Management Console' Id='5B5D4E30-55E2-49c1-84B3-10C1CE56907F'
Language='1033' Codepage='1252'
Version='1.1.0' Manufacturer='Fedora Project'>
<Package Id='????????-????-????-????-????????????' Keywords='Installer'
Description="Fedora Identity Management Console Installer"
Manufacturer='Fedora Project'
InstallerVersion='100' Languages='1033' Compressed='yes' SummaryCodepage='1252' />
<Media Id='1' Cabinet='Sample.cab' EmbedCab='yes' DiskPrompt="CD-ROM #1" />
<Property Id='DiskPrompt' Value="Console Installation [1]" />
<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='ProgramFilesFolder' Name='PFiles'>
<Directory Id='INSTALLDIR' Name='FIDMCON' LongName='Fedora Identity Management Console'>
<Component Id='NSPRLibrary' Guid='DE133754-3C99-49e7-8A71-0375AB348CDD'>
<File Id='NSPR' LongName='libnspr4.dll' Name='libnspr4.dll' DiskId='1' src='libnspr4.dll' Vital='yes' />
</Component>
<Component Id='NSPRpldsLibrary' Guid='7DCDBD30-DC5B-4c89-BD94-EE55E1D9D082'>
<File Id='NSPRPLDS' LongName='libplds4.dll' Name='libplds4.dll' DiskId='1' src='libplds4.dll' Vital='yes' />
</Component>
<Component Id='NSPRplcLibrary' Guid='4E707871-BA8E-41e2-982E-E3E79E85A599'>
<File Id='NSPRPLC' LongName='libplc4.dll' Name='libplc4.dll' DiskId='1' src='libplc4.dll' Vital='yes' />
</Component>
<Component Id='NSSLibrary' Guid='3196F339-901E-42c4-AAD3-704775DCF5F4'>
<File Id='NSS' LongName='nss3.dll' Name='nss3.dll' DiskId='1' src='nss3.dll' Vital='yes' />
</Component>
<Component Id='NSSsslLibrary' Guid='004E7F81-77E8-4681-810B-E97EC9BE49F2'>
<File Id='NSSSSL' LongName='ssl3.dll' Name='ssl3.dll' DiskId='1' src='ssl3.dll' Vital='yes' />
</Component>
<Component Id='NSSsoftoknLibrary' Guid='B20D5FB4-B985-4c44-B4AA-8657C74B8061'>
<File Id='NSSSOFTTOKN' LongName='softokn3.dll' Name='softokn3.dll' DiskId='1' src='softokn3.dll' Vital='yes' />
</Component>
<Component Id='NSSsmimeLibrary' Guid='84BD3153-5E80-4556-9B6C-C67B13B3BEA9'>
<File Id='NSSSMIME' LongName='smime3.dll' Name='smime3.dll' DiskId='1' src='smime3.dll' Vital='yes' />
</Component>
<Component Id='NSSfreeblLibrary' Guid='69D9F77F-27EA-4820-B931-07538AFC75FD'>
<File Id='NSSFREEBL' LongName='freebl3.dll' Name='freebl3.dll' DiskId='1' src='freebl3.dll' Vital='yes' />
</Component>
<Component Id='NSScertutil' Guid='7741A56D-3E96-4823-AC0F-0B81A696651F'>
<File Id='NSSCERTUTIL' LongName='certutil.exe' Name='certutil.exe' DiskId='1' src='certutil.exe' Vital='yes' />
</Component>
<Component Id='NSSpk12util' Guid='F10ABF8A-8C10-49f6-8150-45616EA4C360'>
<File Id='NSSPK12UTIL' LongName='pk12util.exe' Name='pk12util.exe' DiskId='1' src='pk12util.exe' Vital='yes' />
</Component>
<Component Id='JSSLibrary' Guid='844240DD-3EE8-444e-BA48-5C114648096B'>
<File Id='JSSLIB' LongName='jss4.dll' Name='jss4.dll' DiskId='1' src='jss4.dll' Vital='yes' />
</Component>
<Component Id='JSSJar' Guid='064A960B-4D7E-45cc-895B-19DE1D9AEF77'>
<File Id='JSSJAR' LongName='jss4.jar' Name='jss4.jar' DiskId='1' src='jss4.jar' Vital='yes' />
</Component>
<Component Id='LDAPJar' Guid='E6D5B3AE-11F5-427f-85D3-D7A6A6A0A55D'>
<File Id='LDAPJAR' LongName='ldapjdk.jar' Name='ldapjdk.jar' DiskId='1' src='ldapjdk.jar' Vital='yes' />
</Component>
<Component Id='IDMBaseJar' Guid='F45C344F-A3C2-4ffd-9CC6-22D36AA5E69E'>
<File Id='IDMBASEJAR' LongName='idm-console-base.jar' Name='idmbase.jar' DiskId='1' src='idm-console-base.jar' Vital='yes' />
</Component>
<Component Id='IDMMCCJar' Guid='1DB26BB6-56AF-4e7e-BD55-8F1364B7A55B'>
<File Id='IDMMCCJAR' LongName='idm-console-mcc.jar' Name='idmmcc.jar' DiskId='1' src='idm-console-mcc.jar' Vital='yes' />
</Component>
<Component Id='IDMMCCENJar' Guid='71FF3A08-C895-4648-A8CC-08F0CD2AD4D6'>
<File Id='IDMMCCENJAR' LongName='idm-console-mcc_en.jar' Name='idmmccen.jar' DiskId='1' src='idm-console-mcc_en.jar' Vital='yes' />
</Component>
<Component Id='IDMNMCLFJar' Guid='2F118B1B-3413-4740-A99A-1B22E79AB232'>
<File Id='IDMNMCLFJAR' LongName='idm-console-nmclf.jar' Name='idmnmclf.jar' DiskId='1' src='idm-console-nmclf.jar' Vital='yes' />
</Component>
<Component Id='IDMNMCLFENJar' Guid='EB4F2170-BFDC-4c5f-8A12-9812CAADB740'>
<File Id='IDMNMCLFENJAR' LongName='idm-console-nmclf_en.jar' Name='idmnmcen.jar' DiskId='1' src='idm-console-nmclf_en.jar' Vital='yes' />
</Component>
<Component Id='FedoraConsoleJar' Guid='BE426443-1A07-406e-97FA-103D518BE233'>
<File Id='FEDORACONSOLEJAR' LongName='fedora-idm-console_en.jar' Name='fconen.jar' DiskId='1' src='fedora-idm-console_en.jar' Vital='yes' />
</Component>
<Component Id='FedoraConsoleBat' Guid='00DEC033-5D77-49a2-9478-FA67E8D4EFEA'>
<File Id='FEDORACONSOLEBAT' LongName='fedora-idm-console.bat' Name='fdracon.bat' DiskId='1' src='fedora-idm-console.bat' Vital='yes' >
<Shortcut Id="startmenuFedoraConsole" Directory="ProgramMenuDir" Name="FIDMCON"
LongName="Fedora IDM Console" WorkingDirectory='INSTALLDIR'
Icon="FedoraLogo.ico" IconIndex="0" />
<Shortcut Id="desktopFedoraConsole" Directory="DesktopFolder" Name="FIDMCON"
LongName="Fedora IDM Console" WorkingDirectory='INSTALLDIR'
Icon="FedoraLogo.ico" IconIndex="0" />
</File>
</Component>
</Directory>
</Directory>
<Directory Id="ProgramMenuFolder" Name="PMenu" LongName="Programs">
<Directory Id="ProgramMenuDir" Name='FIDMCON' LongName="Fedora Identity Management Console" />
</Directory>
<Directory Id="DesktopFolder" Name="Desktop" />
</Directory>
<Feature Id='Complete' Title='Fedora Identity Management Console' Description='The complete package.'
TypicalDefault='install' Display='expand' Level='1'
ConfigurableDirectory='INSTALLDIR'>
<Feature Id='MainProgram' Title='Program' Description='The main executable.'
TypicalDefault='install' Level='1'>
<ComponentRef Id='NSPRLibrary' />
<ComponentRef Id='NSPRpldsLibrary' />
<ComponentRef Id='NSPRplcLibrary' />
<ComponentRef Id='NSSLibrary' />
<ComponentRef Id='NSSsslLibrary' />
<ComponentRef Id='NSSsoftoknLibrary' />
<ComponentRef Id='NSSsmimeLibrary' />
<ComponentRef Id='NSSfreeblLibrary' />
<ComponentRef Id='NSScertutil' />
<ComponentRef Id='NSSpk12util' />
<ComponentRef Id='JSSLibrary' />
<ComponentRef Id='JSSJar' />
<ComponentRef Id='LDAPJar' />
<ComponentRef Id='IDMBaseJar' />
<ComponentRef Id='IDMMCCJar' />
<ComponentRef Id='IDMMCCENJar' />
<ComponentRef Id='IDMNMCLFJar' />
<ComponentRef Id='IDMNMCLFENJar' />
<ComponentRef Id='FedoraConsoleJar' />
<ComponentRef Id='FedoraConsoleBat' />
</Feature>
</Feature>
<Icon Id="FedoraLogo.ico" SourceFile="FedoraLogo.ico" />
</Product>
</Wix>
--- NEW FILE FedoraLogo.ico ---
&11111111111111111111111111
--- NEW FILE Makefile ---
#
# BEGIN COPYRIGHT BLOCK
# This Program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; version 2 of the License.
#
# This Program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
# Place, Suite 330, Boston, MA 02111-1307 USA.
#
# In addition, as a special exception, Red Hat, Inc. gives You the additional
# right to link the code of this Program with code not covered under the GNU
# General Public License ("Non-GPL Code") and to distribute linked combinations
# including the two, subject to the limitations in this paragraph. Non-GPL Code
# permitted under this exception must only link to the code of this Program
# through those well defined interfaces identified in the file named EXCEPTION
# found in the source code files (the "Approved Interfaces"). The files of
# Non-GPL Code may instantiate templates or use macros or inline functions from
# the Approved Interfaces without causing the resulting work to be covered by
# the GNU General Public License. Only Red Hat, Inc. may make changes or
# additions to the list of Approved Interfaces. You must obey the GNU General
# Public License in all respects for all of the Program code and other code used
# in conjunction with the Program except the Non-GPL Code covered by this
# exception. If you modify this file, you may extend this exception to your
# version of the file, but you are not obligated to do so. If you do not wish to
# provide this exception without modification, you must delete this exception
# statement from your version and license this file solely under the GPL without
# exception.
#
#
# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
# Copyright (C) 2005 Red Hat, Inc.
# All rights reserved.
# END COPYRIGHT BLOCK
#
# Packaging nmake Makefile for Console.msi
PKGNAME=Console
PKGDIR=.
WXSDIR=.
BASEDIR=E:\cygwin\home\rich
# where to find nspr dlls
NSPRLIBDIR=$(BASEDIR)\nspr-4.6.7
# where to find nss dlls
NSSLIBDIR=$(BASEDIR)\nss-3.11.7
# where to find nss exes
NSSBINDIR=$(BASEDIR)\nss-3.11.7
# where to find jss jar and dll
JSSDIR=$(BASEDIR)\jss-4.2.4
# where to find the ldapjdk.jar
LDAPDIR=$(BASEDIR)\console
#LDAPDIR=$(BASEDIR)\ldapjdk-4.18
# where to find the idm-console-framework jars
IDMDIR=$(BASEDIR)\console
# where to find the fedora-idm-console jar and other files
FEDORACONSOLEDIR=.
WIXDIR=$(BASEDIR)\wix
CANDLE=$(WIXDIR)\candle
LIGHT=$(WIXDIR)\light
ALL : $(PKGNAME).msi
LAYOUT :
copy /Y $(NSPRLIBDIR)\*.dll $(PKGDIR)
copy /Y $(NSSLIBDIR)\*.dll $(PKGDIR)
copy /Y $(NSSBINDIR)\certutil.exe $(PKGDIR)
copy /Y $(NSSBINDIR)\pk12util.exe $(PKGDIR)
copy /Y $(JSSDIR)\jss4.jar $(PKGDIR)
copy /Y $(JSSDIR)\jss4.dll $(PKGDIR)
copy /Y $(LDAPDIR)\ldapjdk.jar $(PKGDIR)
copy /Y $(IDMDIR)\*.jar $(PKGDIR)
# copy /Y $(FEDORACONSOLEDIR)\*.jar $(PKGDIR)
# copy /Y $(FEDORACONSOLEDIR)\*.bat $(PKGDIR)
# copy /Y $(FEDORACONSOLEDIR)\*.ico $(PKGDIR)
$(PKGNAME).msi : LAYOUT
cd "$(PKGDIR)"
$(CANDLE) "$(WXSDIR)\$(PKGNAME).wxs"
$(LIGHT) $(PKGNAME).wixobj
--- NEW FILE fedora-idm-console.bat ---
echo off
rem BEGIN COPYRIGHT BLOCK
rem Copyright (C) 2005 Red Hat, Inc.
rem All rights reserved.
rem
rem This library is free software; you can redistribute it and/or
rem modify it under the terms of the GNU Lesser General Public
rem License as published by the Free Software Foundation version
rem 2.1 of the License.
rem
rem This library is distributed in the hope that it will be useful,
rem but WITHOUT ANY WARRANTY; without even the implied warranty of
rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
rem Lesser General Public License for more details.
rem
rem You should have received a copy of the GNU Lesser General Public
rem License along with this library; if not, write to the Free Software
rem Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
rem END COPYRIGHT BLOCK
rem set the JAVA to use here
rem set JAVA=C:\j2sdk1.4.2_15\bin\java
if not %JAVA%foo==foo goto launch
where java > nul 2>&1 || goto findjre
set JAVA=java
goto launch
:findjre
rem look for Java Runtime Environment in registry
reg QUERY "HKLM\SOFTWARE\JavaSoft\Java Runtime Environment" > nul 2>&1 || goto findjdk
rem can we grab the java location from the registry?
rem set JAVA=path\bin\java
rem apparently not, in a batch file
rem goto launch
echo The Java Runtime Environment is installed on this machine, but the
echo command java.exe is not in your PATH. You can either make sure java.exe
echo is in the PATH, or edit this script to set JAVA to the full path of
echo java.exe
pause
goto end
:findjdk
reg QUERY "HKLM\SOFTWARE\JavaSoft\Java Development Kit" > nul 2>&1 || goto nojava
rem can we grab the java location from the registry?
rem set JAVA=path\bin\java
rem goto launch
echo The Java Development Kit is installed on this machine, but the
echo command java.exe is not in your PATH. You can either make sure java.exe
echo is in the PATH, or edit this script to set JAVA to the full path of
echo java.exe
pause
goto end
:nojava
echo Java does not appear to be installed on this machine. Please download and install the Java Runtime Environment and make sure the java.exe command is in the PATH of this command.
pause
goto end
:launch
set BASEPATH=.
set FIDMCONSOLEJARDIR=%BASEPATH%
set CONSOLEJARDIR=%BASEPATH%
set JSSDIR=%BASEPATH%
set LDAPJARDIR=%BASEPATH%
set PATH=%BASEPATH%;%PATH%
rem
rem Launch the Console
rem
echo on
%JAVA% "-Djava.library.path=%JSSDIR%" -cp "%JSSDIR%/jss4.jar;%LDAPJARDIR%/ldapjdk.jar;%CONSOLEJARDIR%/idm-console-base.jar;%CONSOLEJARDIR%/idm-console-mcc.jar;%CONSOLEJARDIR%/idm-console-mcc_en.jar;%CONSOLEJARDIR%/idm-console-nmclf.jar;%CONSOLEJARDIR%/idm-console-nmclf_en.jar;%FIDMCONSOLEJARDIR%/fedora-idm-console_en.jar" -Djava.util.prefs.systemRoot=%HOME%/.fedora-idm-console -Djava.util.prefs.userRoot=%HOME%/.fedora-idm-console com.netscape.management.client.console.Console %*
:end
16 years, 1 month
[Fedora-directory-commits] adminserver/lib/libdsa dsalib_conf.c, 1.4, 1.5 dsalib_location.c, 1.4, 1.5 dsalib_util.c, 1.2, 1.3
by Doctor Conrad
Author: nkinder
Update of /cvs/dirsec/adminserver/lib/libdsa
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv17962/lib/libdsa
Modified Files:
dsalib_conf.c dsalib_location.c dsalib_util.c
Log Message:
Resolves: 258341
Summary: Fix rundir and instancedir location functions in dsalib.
Index: dsalib_conf.c
===================================================================
RCS file: /cvs/dirsec/adminserver/lib/libdsa/dsalib_conf.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- dsalib_conf.c 24 Jul 2007 20:10:18 -0000 1.4
+++ dsalib_conf.c 31 Aug 2007 17:01:38 -0000 1.5
@@ -104,6 +104,7 @@
{"nsslapd-localuser"},
{"nsslapd-bakdir"},
{"nsslapd-tmpdir"},
+{"nsslapd-instancedir"},
{0}
};
Index: dsalib_location.c
===================================================================
RCS file: /cvs/dirsec/adminserver/lib/libdsa/dsalib_location.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- dsalib_location.c 24 Jul 2007 20:10:18 -0000 1.4
+++ dsalib_location.c 31 Aug 2007 17:01:38 -0000 1.5
@@ -41,11 +41,11 @@
char *ds_name;
static char instance_dir[PATH_MAX];
- if ( (ds_name = ds_get_server_name()) == NULL )
+ if ( (ds_name = ds_get_server_name()) == NULL ) {
return(NULL);
-
- PR_snprintf(instance_dir, sizeof(instance_dir), "%s/%s", DSLIBDIR, ds_name);
- return(instance_dir);
+ } else {
+ return ds_get_config_value(DS_INSTDIR);
+ }
}
/*
@@ -90,12 +90,43 @@
DS_EXPORT_SYMBOL char *
ds_get_run_dir()
{
- char *rundir;
+ char *rundir_env = NULL;
+ static char rundir[PATH_MAX];
+ char *inst_dir = NULL;
+ char *start_script = NULL;
+ char *p = NULL;
+ char line[BIG_LINE];
+ FILE *fp = NULL;
- if (rundir = getenv("DS_RUN_DIR")) {
- return (rundir);
+ if (rundir_env = getenv("DS_RUN_DIR")) {
+ return (rundir_env);
} else {
- return (PIDDIR);;
+ /* Find the run dir from the start script */
+ inst_dir = ds_get_instance_dir();
+ start_script = PR_smprintf("%s%cstart-slapd", inst_dir, FILE_PATHSEP);
+ fp = fopen(start_script, "r");
+ if (fp) {
+ while(fgets(line, BIG_LINE, fp)) {
+ /* Find line starting with PIDFILE */
+ if (strncmp(line, "PIDFILE", 7) == 0) {
+ /* Chop off the pidfile name to get the run dir */
+ if (p = strrchr(line, '/')) {
+ *p = '\0';
+ PR_snprintf(rundir, sizeof(rundir), "%s", line + 8);
+ }
+ break;
+ }
+ }
+ fclose(fp);
+ }
+
+ PR_smprintf_free(start_script);
+
+ if (rundir[0] != '\0') {
+ return (rundir);
+ } else {
+ return NULL;
+ }
}
}
Index: dsalib_util.c
===================================================================
RCS file: /cvs/dirsec/adminserver/lib/libdsa/dsalib_util.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- dsalib_util.c 24 Jul 2007 20:10:18 -0000 1.2
+++ dsalib_util.c 31 Aug 2007 17:01:38 -0000 1.3
@@ -52,8 +52,6 @@
#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
*/
@@ -840,100 +838,6 @@
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 *bufp, *nextbufp;
- char *retp;
- int readit = 0;
-
- if (fp == NULL)
- {
- ds_rm_rf_err_func(fullpath, "opening the config file", 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);
-}
-
static char *
get_dir_from_startslapd(char *loc, char *keyword)
{
@@ -971,134 +875,6 @@
return dir;
}
-/* 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;
- 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 {
- /* FHS changes the directory structure.
- * Config dir is no longer in the instance dir.
- * The info should be found in start-slapd,
- * therefore get the path from the file here.
- */
- if (0 == strcmp(dirent->name, "start-slapd")) {
- char *config_dir = ds_get_config_dir();
- char *run_dir = ds_get_run_dir();
- if (NULL == config_dir || '\0' == *config_dir) {
- config_dir = get_dir_from_startslapd(fullpath, DS_CONFIG_DIR);
- }
- if (NULL == run_dir || '\0' == *run_dir) {
- char *ptr = NULL;
- run_dir = get_dir_from_startslapd(fullpath, PIDFILE);
- ptr = strrchr(run_dir, FILE_PATHSEP);
- if (NULL != ptr) {
- *ptr = '\0'; /* equiv to dirname */
- }
- }
- if (NULL != run_dir) {
- internal_rm_rf(run_dir, ds_rm_rf_err_func, NULL);
- free(run_dir);
- }
- if (NULL != config_dir) {
- char *lock_dir = get_dir_from_config(config_dir, DS_CONFIG_LOCKDIR);
- char *err_log = get_dir_from_config(config_dir, DS_CONFIG_ERRLOG);
-
- if (NULL != lock_dir) {
- internal_rm_rf(lock_dir, ds_rm_rf_err_func, NULL);
- free(lock_dir);
- }
- if (NULL != err_log) {
- char *ptr = strrchr(err_log, FILE_PATHSEP);
- if (NULL != ptr) {
- *ptr = '\0'; /* equiv to 'dirname' */
- internal_rm_rf(err_log, ds_rm_rf_err_func, NULL);
- }
- free(err_log);
- }
- /* removing db dirs */
- rm_db_dirs(config_dir, ds_rm_rf_err_func, arg);
-
- /* removing config dir */
- internal_rm_rf(config_dir, ds_rm_rf_err_func, NULL);
- }
- }
- /*
- * When the file is the config file,
- * check if db dir is in the instance dir or not.
- * If db dir exists in the instance dir, it's an old structure.
- * Let's clean the old db here, as well.
- */
- if (0 == strcmp(dirent->name, DS_CONFIG_FILE)) {
- 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)
{
@@ -1119,38 +895,6 @@
return 1; /* just continue */
}
-/* dir: instance dir, e.g., "$NETSITE_ROOT/slapd-<id>" */
-DS_EXPORT_SYMBOL int
-ds_rm_rf(const char *dir, DS_RM_RF_ERR_FUNC ds_rm_rf_err_func, void *arg)
-{
- 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, ...)
{
16 years, 1 month
[Fedora-directory-commits] adminserver/include/libdsa dsalib.h, 1.4, 1.5
by Doctor Conrad
Author: nkinder
Update of /cvs/dirsec/adminserver/include/libdsa
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv17962/include/libdsa
Modified Files:
dsalib.h
Log Message:
Resolves: 258341
Summary: Fix rundir and instancedir location functions in dsalib.
Index: dsalib.h
===================================================================
RCS file: /cvs/dirsec/adminserver/include/libdsa/dsalib.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- dsalib.h 24 Jul 2007 20:10:18 -0000 1.4
+++ dsalib.h 31 Aug 2007 17:01:38 -0000 1.5
@@ -260,7 +260,8 @@
#define DS_LOCALUSER 14
#define DS_BAKDIR 15
#define DS_TMPDIR 16
-#define DS_CFG_MAX 17 /* MUST be one greater than the last option */
+#define DS_INSTDIR 17
+#define DS_CFG_MAX 18 /* 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 */
@@ -446,11 +447,6 @@
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
*/
16 years, 1 month
[Fedora-directory-commits] adminserver/admserv/cgi-ds ds_remove.c, 1.3, NONE
by Doctor Conrad
Author: nkinder
Update of /cvs/dirsec/adminserver/admserv/cgi-ds
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv17962/admserv/cgi-ds
Removed Files:
ds_remove.c
Log Message:
Resolves: 258341
Summary: Fix rundir and instancedir location functions in dsalib.
--- ds_remove.c DELETED ---
16 years, 1 month
[Fedora-directory-commits] ldapserver/ldap/admin/src/scripts DSMigration.pm.in, 1.8, 1.9
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/admin/src/scripts
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv19147
Modified Files:
DSMigration.pm.in
Log Message:
Resolves: #260341
Summary: Migration script references a non-existing directory (comment #22)
Description: introduced ignoreOldEntries not to migrate obsolete config entries.
Index: DSMigration.pm.in
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/scripts/DSMigration.pm.in,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- DSMigration.pm.in 30 Aug 2007 00:06:51 -0000 1.8
+++ DSMigration.pm.in 30 Aug 2007 21:45:47 -0000 1.9
@@ -104,6 +104,16 @@
'nsslapd-ldapiautodnsuffix' => 'nsslapd-ldapiautodnsuffix'
);
+# these are the obsolete entries we do not migrate
+my %ignoreOldEntries =
+(
+ 'cn=presence,cn=plugins,cn=config' => 'cn=presence,cn=plugins,cn=config',
+ 'cn=aim presence,cn=presence,cn=plugins,cn=config' => 'cn=aim presence,cn=presence,cn=plugins,cn=config',
+ 'cn=icq presence,cn=presence,cn=plugins,cn=config' => 'cn=icq presence,cn=presence,cn=plugins,cn=config',
+ 'cn=yahoo presence,cn=presence,cn=plugins,cn=config' => 'cn=yahoo presence,cn=presence,cn=plugins,cn=config'
+);
+
+
# these are the attributes for which we will always use
# the old value
my %alwaysUseOld =
@@ -519,10 +529,12 @@
debug(1, "Cannot migrate the entry $dn - skipping\n");
next;
} elsif ($oldent && !$newent) {
- # may have to fix up some values in the old entry
- fixAttrsInEntry($oldent, $mig, $inst);
- $rc = $dest->add($oldent);
- $op = "add";
+ if (!$ignoreOldEntries{$dn}) { # make sure it's not obsolete
+ # may have to fix up some values in the old entry
+ fixAttrsInEntry($oldent, $mig, $inst);
+ $rc = $dest->add($oldent);
+ $op = "add";
+ }
} elsif (!$oldent && $newent) {
if ($dn =~ /o=deleteAfterMigration/i) {
$rc = $dest->delete($dn);
16 years, 1 month
[Fedora-directory-commits] ldapserver/ldap/servers/slapd attr.c, 1.8, 1.9 slapi-plugin.h, 1.15, 1.16
by Doctor Conrad
Author: nkinder
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv1718/servers/slapd
Modified Files:
attr.c slapi-plugin.h
Log Message:
Resolves: 212671
Summary: Handle syncing multi-valued street attribute to AD.
Index: attr.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/attr.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- attr.c 10 Nov 2006 23:45:40 -0000 1.8
+++ attr.c 30 Aug 2007 15:56:36 -0000 1.9
@@ -699,7 +699,20 @@
return 0;
}
-/* Make the valuset in SLapi_Attr be *vs--not a copy */
+int
+slapi_attr_set_type(Slapi_Attr *a, const char *type)
+{
+ int rc = 0;
+
+ if((NULL == a) || (NULL == type)) {
+ rc = -1;
+ } else {
+ a->a_type = slapi_ch_strdup(type);
+ }
+ return rc;
+}
+
+/* Make the valuset in Slapi_Attr be *vs--not a copy */
int
slapi_attr_set_valueset(Slapi_Attr *a, const Slapi_ValueSet *vs)
{
Index: slapi-plugin.h
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/slapi-plugin.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- slapi-plugin.h 27 Feb 2007 02:57:30 -0000 1.15
+++ slapi-plugin.h 30 Aug 2007 15:56:36 -0000 1.16
@@ -418,6 +418,7 @@
int slapi_attr_get_valueset(const Slapi_Attr *a, Slapi_ValueSet **vs);
/* Make the valuset in Slapi_Attr be *vs--not a copy */
int slapi_attr_set_valueset(Slapi_Attr *a, const Slapi_ValueSet *vs);
+int slapi_attr_set_type(Slapi_Attr *a, const char *type);
int slapi_attr_get_bervals_copy( Slapi_Attr *a, struct berval ***vals );
char * slapi_attr_syntax_normalize( const char *s );
void slapi_valueset_set_valueset(Slapi_ValueSet *vs1, const Slapi_ValueSet *vs2);
16 years, 1 month
[Fedora-directory-commits] ldapserver/ldap/servers/plugins/replication windows_protocol_util.c, 1.29, 1.30
by Doctor Conrad
Author: nkinder
Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/replication
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv1718/servers/plugins/replication
Modified Files:
windows_protocol_util.c
Log Message:
Resolves: 212671
Summary: Handle syncing multi-valued street attribute to AD.
Index: windows_protocol_util.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/windows_protocol_util.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- windows_protocol_util.c 27 Aug 2007 17:16:48 -0000 1.29
+++ windows_protocol_util.c 30 Aug 2007 15:56:35 -0000 1.30
@@ -1363,7 +1363,41 @@
}
} else
{
- slapi_entry_add_valueset(new_entry,new_type,vs);
+ Slapi_Attr *new_attr = NULL;
+
+ /* AD treats streetAddress as a single-valued attribute, while we define it
+ * as a multi-valued attribute as it's defined in rfc 4519. We only
+ * sync the first value to AD to avoid a constraint violation.
+ */
+ if (0 == slapi_attr_type_cmp(new_type, "streetAddress", SLAPI_TYPE_CMP_SUBTYPE)) {
+ if (slapi_valueset_count(vs) > 1) {
+ int i = 0;
+ const char *street_value = NULL;
+ Slapi_Value *value = NULL;
+ Slapi_Value *new_value = NULL;
+
+ i = slapi_valueset_first_value(vs,&value);
+ if (i >= 0) {
+ /* Dup the first value, trash the valueset, then copy
+ * in the dup'd value. */
+ new_value = slapi_value_dup(value);
+ slapi_valueset_done(vs);
+ /* The below hands off the memory to the valueset */
+ slapi_valueset_add_value_ext(vs, new_value, SLAPI_VALUE_FLAG_PASSIN);
+ }
+ }
+ }
+
+ slapi_entry_add_valueset(new_entry,type,vs);
+
+ /* Reset the type to new_type here. This is needed since
+ * slapi_entry_add_valueset will create the Slapi_Attrs using
+ * the schema definition, which can reset the type to something
+ * other than the type you pass into it. To be safe, we just
+ * create the attributes with the old type, then reset them. */
+ if (slapi_entry_attr_find(new_entry, type, &new_attr) == 0) {
+ slapi_attr_set_type(new_attr, new_type);
+ }
}
slapi_ch_free((void**)&new_type);
}
@@ -1574,6 +1608,29 @@
slapi_valueset_free(vs);
} else
{
+ /* AD treats streetAddress as a single-valued attribute, while we define it
+ * as a multi-valued attribute as it's defined in rfc 4519. We only
+ * sync the first value to AD to avoid a constraint violation.
+ */
+ if (0 == slapi_attr_type_cmp(mapped_type, "streetAddress", SLAPI_TYPE_CMP_SUBTYPE)) {
+ Slapi_Mod smod;
+ struct berval *new_bval = NULL;
+
+ slapi_mod_init_byref(&smod,mod);
+
+ /* Check if there is more than one value */
+ if (slapi_mod_get_num_values(&smod) > 1) {
+ new_bval = slapi_mod_get_first_value(&smod);
+ /* Remove all values except for the first */
+ while (slapi_mod_get_next_value(&smod)) {
+ /* This modifies the bvalues in the mod itself */
+ slapi_mod_remove_value(&smod);
+ }
+ }
+
+ slapi_mod_done(&smod);
+ }
+
slapi_mods_add_modbvps(&mapped_smods,mod->mod_op,mapped_type,mod->mod_bvalues);
}
slapi_ch_free((void**)&mapped_type);
@@ -1668,6 +1725,28 @@
return match;
}
+/* Returns non-zero if all of the values of attribute a are contained in attribute b. */
+static int
+attr_compare_present(Slapi_Attr *a, Slapi_Attr *b)
+{
+ int match = 1;
+ int i = 0;
+ Slapi_Value *va = NULL;
+
+ /* Iterate through values in attr a and search for each in attr b */
+ for (i = slapi_attr_first_value(a, &va); va && (i != -1);
+ i = slapi_attr_next_value(a, i, &va)) {
+ if (slapi_attr_value_find(b, slapi_value_get_berval(va)) != 0) {
+ /* This value wasn't found, so stop checking for values */
+ match = 0;
+ break;
+ }
+ }
+
+ return match;
+}
+
+
/* Helper functions for dirsync result processing */
/* Is this entry a tombstone ? */
@@ -2669,8 +2748,11 @@
/* AD has a legth contraint on the initials attribute,
* so treat is as a special case. */
- if (0 == slapi_attr_type_cmp(type,"initials",SLAPI_TYPE_CMP_SUBTYPE) && !to_windows) {
+ if (0 == slapi_attr_type_cmp(type, "initials", SLAPI_TYPE_CMP_SUBTYPE) && !to_windows) {
values_equal = attr_compare_equal(attr, local_attr, AD_INITIALS_LENGTH);
+ } else if (0 == slapi_attr_type_cmp(type, FAKE_STREET_ATTR_NAME, SLAPI_TYPE_CMP_SUBTYPE) && !to_windows) {
+ /* Need to check if attr is present in local_attr */
+ values_equal = attr_compare_present(attr, local_attr);
} else {
/* Compare the entire attribute values */
values_equal = attr_compare_equal(attr, local_attr, 0);
16 years, 1 month
[Fedora-directory-commits] ldapserver/ldap/servers/slapd uuid.c, 1.6, 1.7
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv11789
Modified Files:
uuid.c
Log Message:
Resolves: bug 262021
Bug Description: Migration script does not migrate nsDS5ReplicaCredentials correctly.
Reviewed by: nhosoi (Thanks!)
Fix Description: This was a big endian vs. little endian issue. We only use name based UUID generation with the reversible password code. This code was not doing the ntoh with the numeric values generated. I'm sure there is probably a compiler warning about this on some platform.
Platforms tested: RHEL5 x86_64, Solaris 9 64-bit
Flag Day: no
Doc impact: no
QA impact: should be covered by regular nightly and manual testing
New Tests integrated into TET: none
Index: uuid.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/uuid.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- uuid.c 10 Nov 2006 23:45:40 -0000 1.6
+++ uuid.c 30 Aug 2007 00:18:10 -0000 1.7
@@ -857,9 +857,9 @@
memcpy(uuid, hash, sizeof(guid_t));
/* convert UUID to local byte order */
- ntohl(uuid->time_low);
- ntohs(uuid->time_mid);
- ntohs(uuid->time_hi_and_version);
+ uuid->time_low = PR_ntohl(uuid->time_low);
+ uuid->time_mid = PR_ntohs(uuid->time_mid);
+ uuid->time_hi_and_version = PR_ntohs(uuid->time_hi_and_version);
/* put in the variant and version bits */
uuid->time_hi_and_version &= 0x0FFF;
16 years, 1 month
[Fedora-directory-commits] ldapserver/ldap/admin/src/scripts DSMigration.pm.in, 1.7, 1.8 migrate-ds.res, 1.4, 1.5
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/ldapserver/ldap/admin/src/scripts
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv11463/ldapserver/ldap/admin/src/scripts
Modified Files:
DSMigration.pm.in migrate-ds.res
Log Message:
Resolves: bug 260341
Bug Description: Migration script references a non-existing directory
Reviewed by: nhosoi (Thanks!)
Fix Description: This fixes a couple of problems.
1) Use the inst_dir from the directory server as the instance dir where the ldif2db script is found.
2) The password for migratecred should be quoted before being passed to the shell, in case there are shell meta chars in there
3) If using cross platform migration, and no LDIF files were found to migrate, this will cause an error message to be printed and migration will be aborted.
Platforms tested: RHEL4 i386, RHEL5 x86_64
Flag Day: no
Doc impact: no
QA impact: should be covered by regular nightly and manual testing
New Tests integrated into TET: none
Index: DSMigration.pm.in
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/scripts/DSMigration.pm.in,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- DSMigration.pm.in 29 Aug 2007 23:10:22 -0000 1.7
+++ DSMigration.pm.in 30 Aug 2007 00:06:51 -0000 1.8
@@ -152,8 +152,8 @@
sub migrateCredentials {
my ($ent, $attr, $mig, $inst) = @_;
my $oldval = $ent->getValues($attr);
- debug(3, "Executing @bindir@/migratecred -o $mig->{actualsroot}/$inst -n @instconfigdir@/$inst -c $oldval . . .\n");
- my $newval = `@bindir@/migratecred -o $mig->{actualsroot}/$inst -n @instconfigdir@/$inst -c $oldval`;
+ debug(3, "Executing @bindir@/migratecred -o $mig->{actualsroot}/$inst -n @instconfigdir@/$inst -c \'$oldval\' . . .\n");
+ my $newval = `@bindir@/migratecred -o $mig->{actualsroot}/$inst -n @instconfigdir@/$inst -c \'$oldval\'`;
debug(3, "Converted old value [$oldval] to new value [$newval] for attr $attr in entry ", $ent->getDN(), "\n");
return $newval;
}
@@ -235,18 +235,15 @@
my $olddefault = "$mig->{actualsroot}/$inst/db"; # old default db home directory
my @errs;
+ # the ldif2db command will be in nsslapd-instancedir
+ my $cfgent = $dest->search("cn=config", "base", "(objectclass=*)");
+ my $inst_dir = $cfgent->getValues('nsslapd-instancedir');
# first, look for an LDIF file in that directory with the same name as the
# database
my $foundldif;
for (glob("$mig->{oldsroot}/$inst/db/*.ldif")) {
my $dbname = basename($_, '.ldif');
- my $cmd = "";
- if ("@with_fhs_opt@") {
- $cmd = "/opt/@PACKAGE_NAME@/$inst/ldif2db -n \"$dbname\" -i \"$_\"";
- } else {
- $cmd = "@serverdir@/$inst/ldif2db -n \"$dbname\" -i \"$_\"";
- }
-
+ my $cmd = "$inst_dir/ldif2db -n \"$dbname\" -i \"$_\"";
debug(1, "migrateDatabases: executing command $cmd\n");
$? = 0; # clear error condition
my $output = `$cmd 2>&1`;
@@ -259,6 +256,8 @@
if ($foundldif) {
return (); # done - can do nothing else for cross-platform
+ } elsif ($mig->{crossplatform}) { # cross platform requires LDIF files
+ return ('ldif_required_for_cross_platform', "$mig->{oldsroot}/$inst/db");
}
# if no LDIF files, just copy over the database directories
Index: migrate-ds.res
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/scripts/migrate-ds.res,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- migrate-ds.res 15 Aug 2007 02:51:50 -0000 1.4
+++ migrate-ds.res 30 Aug 2007 00:06:51 -0000 1.5
@@ -17,3 +17,8 @@
error_copying_secmoddb = Could not copy the security module database file '%s' to '%s'. Error: %s\n
error_copying_pinfile = Could not copy the key database PIN file '%s' to '%s'. Error: %s\n
error_copying_certmap = Could not copy the client certificate mapping file '%s' to '%s'. Error: %s\n
+ldif_required_for_cross_platform = No LDIF files were found in %s.\n
+LDIF files are required in order to do cross platform migration. The\
+database files are not binary compatible, and the new databases must\
+be initialized from an LDIF export of the old databases. Please refer\
+to the migration instructions for help with how to do this.\n\n
16 years, 1 month