Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 154361 Details for
Bug 239494
setuputil: use adm.conf instead of dbswitch.conf, ldap.conf, etc
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
diffs
cvsdiffs (text/plain), 38.73 KB, created by
Rich Megginson
on 2007-05-08 20:58:19 UTC
(
hide
)
Description:
diffs
Filename:
MIME Type:
Creator:
Rich Megginson
Created:
2007-05-08 20:58:19 UTC
Size:
38.73 KB
patch
obsolete
>Index: setuputil/installer/include/global.h >=================================================================== >RCS file: /cvs/dirsec/setuputil/installer/include/global.h,v >retrieving revision 1.1.1.1 >diff -u -8 -r1.1.1.1 global.h >--- setuputil/installer/include/global.h 29 Jul 2005 22:16:28 -0000 1.1.1.1 >+++ setuputil/installer/include/global.h 8 May 2007 20:46:24 -0000 >@@ -256,21 +256,19 @@ > typedef enum {Express=1, Typical, Custom} InstallType; > > /* > ************************************************************************ > * Default installation values > *********************************************************************** > */ > #ifndef XP_WIN32 >-extern const char *DEFAULT_LDAPSWITCH; /* dbswitch.conf */ > extern const char *DEFAULT_ADMINUSER; /* Local Admin */ > extern const char *DEFAULT_ADMINPWD; /* Local Admin Password */ >-extern const char *DEFAULT_SSUSERCONF; /* ssusers.conf */ >-extern const char *DEFAULT_ADMINCONF; /* ns-admin.conf */ >+extern const char *DEFAULT_ADMINCONF; /* adm.conf */ > extern const char *DEFAULT_SSUSER; /* nobody */ > extern const char *DEFAULT_SSGROUP; /* nobody */ > extern const char *DEFAULT_SROOT; /* /usr/netscape/suitespot4 */ > extern const char *DEFAULT_CLIENTROOT; /* /usr/netscape/mcc40 */ > > extern const char *DEFAULT_SOURCE; /* TBD, default source respository*/ > extern const char *DEFAULT_INSTALL_TYPE; /* 1: Express, 2: Typical, 3: Custom */ > >Index: setuputil/installer/include/nsutils.h >=================================================================== >RCS file: /cvs/dirsec/setuputil/installer/include/nsutils.h,v >retrieving revision 1.1.1.1 >diff -u -8 -r1.1.1.1 nsutils.h >--- setuputil/installer/include/nsutils.h 29 Jul 2005 22:16:28 -0000 1.1.1.1 >+++ setuputil/installer/include/nsutils.h 8 May 2007 20:46:24 -0000 >@@ -71,17 +71,17 @@ > > #ifdef __cplusplus > extern "C" { > #endif > > NSAPI_EXTERN char * formAdminDomainDN(const char *domain); > NSAPI_EXTERN char * stripAdminDomainDN(const char *domainDN); > >-NSAPI_EXTERN void getDefaultLdapInfo (const char *sroot,char **ldapURL,char **ldapUser,char **adminDomain); >+NSAPI_EXTERN void getDefaultLdapInfo (const char *configdir,char **ldapURL,char **ldapUser,char **adminDomain); > NSAPI_EXTERN char *formConfigLdapURL(const char *ldapURL); > NSAPI_EXTERN char * stripConfigLdapURL(const char *configURL); > NSAPI_EXTERN int IsValidLdapServer(const char* pszHost, int nPort, const char* pszSuffix, > const char* pszUserDN, const char* pszPassword); > NSAPI_EXTERN int IsValidLdapUser(const char* pszHost, int nPort, const char* pszSuffix, > char** pszUser, const char* pszPassword, int bReturnDN); > NSAPI_EXTERN int ParseLdapUrl(char * szldapURL, char ** szldapDomain, unsigned int *uldapPort, char ** szldapDN); > NSAPI_EXTERN void nsSetupFree(char *src); >Index: setuputil/installer/include/setupapi.h >=================================================================== >RCS file: /cvs/dirsec/setuputil/installer/include/setupapi.h,v >retrieving revision 1.1.1.1 >diff -u -8 -r1.1.1.1 setupapi.h >--- setuputil/installer/include/setupapi.h 29 Jul 2005 22:16:28 -0000 1.1.1.1 >+++ setuputil/installer/include/setupapi.h 8 May 2007 20:46:24 -0000 >@@ -143,17 +143,17 @@ > NSAPI_EXTERN int setupBase64_Encode( unsigned char *src, char *dst, int srclen, int lenused ); > NSAPI_EXTERN char *setupUTF8ToLocal(const char *utf8); > NSAPI_EXTERN char *setupLocalToUtf8(const char *src); > NSAPI_EXTERN int setupIsAsciiBuffer(const char *buf); > > > /* Memory allocation and free */ > NSAPI_EXTERN void * setupMalloc(unsigned int size); >-NSAPI_EXTERN char * setupStrdup(char *src); >+NSAPI_EXTERN char * setupStrdup(const char *src); > NSAPI_EXTERN void setupFree(char *src); > > /* Directory server access */ > NSAPI_EXTERN void setupGetDefaultLdapInfo (const char *sroot,char **ldapURL,char **ldapUser,char **adminDomain); > NSAPI_EXTERN void setupSetDefaultLdapInfo(const char *sroot, char * ldapURL, char * ldapUser, char *adminDomain); > NSAPI_EXTERN char *setupFormConfigLdapURL(const char *ldapURL); > NSAPI_EXTERN char *setupStripConfigLdapURL(const char *configURL); > NSAPI_EXTERN int setupIsValidLdapServer(const char* pszHost, int nPort, const char* pszSuffix, >@@ -229,17 +229,16 @@ > > /* Platform */ > NSAPI_EXTERN int setupIsWindowsNT(void); > > NSAPI_EXTERN unsigned int setupExecProgram(const char *program, const char *where); > NSAPI_EXTERN void setupGetGmtime(char *buf, int buflen); > > NSAPI_EXTERN unsigned long setupGetDiskFreeSpace(const char *path); >-NSAPI_EXTERN int setupFileUpdateLines(char *oldLines[], char *newLines[], char *filename); > > > #ifdef __cplusplus > } > #endif > > /* > ************************************************************************ >Index: setuputil/installer/include/setupdefs.h >=================================================================== >RCS file: /cvs/dirsec/setuputil/installer/include/setupdefs.h,v >retrieving revision 1.3 >diff -u -8 -r1.3 setupdefs.h >--- setuputil/installer/include/setupdefs.h 27 Mar 2006 21:18:34 -0000 1.3 >+++ setuputil/installer/include/setupdefs.h 8 May 2007 20:46:25 -0000 >@@ -176,21 +176,17 @@ > #define SETUP_PATCH_INSTALL 6 > #define SETUP_UPDATE_INSTALL 7 > /* Setup wizard page defines*/ > #define SETUP_WIZERROR -1 > #define SETUP_WIZCANCEL 0 > #define SETUP_WIZBACK 1 > #define SETUP_WIZNEXT 2 > /* Setup common files */ >-#define SETUP_DEFAULT_LDAPSWITCH "shared/config/dbswitch.conf" >-#define SETUP_DS_CONF "shared/config/ds.conf" >-#define SETUP_ADM_CONF "admin-serv/config/adm.conf" >-#define SETUP_LDAP_CONF "shared/config/ldap.conf" >-#define SETUP_LDAP_INFO "ldap.info" >+#define SETUP_ADM_CONF "adm.conf" > /* Setup sie define */ > #define SETUP_ADMIN_DOMAIN "ou=%s, o=NetscapeRoot" > #define SETUP_DEFAULT_ROOT "NetscapeRoot" > #define SETUP_DOMAIN_ROOT "o=NetscapeRoot" > /* Setup security defines */ > #define SETUP_SECURITY_DOMESTIC "DOMESTIC" > #define SETUP_SECURITY_EXPORT "EXPORT" > #define SETUP_SECURITY_NONE "NONE" >Index: setuputil/installer/lib/global.cpp >=================================================================== >RCS file: /cvs/dirsec/setuputil/installer/lib/global.cpp,v >retrieving revision 1.1.1.1 >diff -u -8 -r1.1.1.1 global.cpp >--- setuputil/installer/lib/global.cpp 29 Jul 2005 22:16:28 -0000 1.1.1.1 >+++ setuputil/installer/lib/global.cpp 8 May 2007 20:46:25 -0000 >@@ -197,21 +197,19 @@ > > #include "setupdefs.h" > > #ifdef __cplusplus > extern "C" { > #endif > > #ifndef XP_WIN32 >-const char *DEFAULT_LDAPSWITCH = SETUP_DEFAULT_LDAPSWITCH; > const char *DEFAULT_ADMINUSER = "admin"; > const char *DEFAULT_ADMINPWD = "admin"; >-const char *DEFAULT_SSUSERCONF = "shared/config/ssusers.conf"; >-const char *DEFAULT_ADMINCONF = "admin-serv/config/ns-admin.conf"; >+const char *DEFAULT_ADMINCONF = SETUP_ADM_CONF; > const char *DEFAULT_SSUSER = "nobody"; > const char *DEFAULT_SSGROUP = "nobody"; > const char *DEFAULT_SROOT = "/opt/fedora"; > const char *DEFAULT_CLIENTROOT = "/opt/fedora/mcc"; > const char *DEFAULT_INSTALL_TYPE = "2"; > > const char *DEFAULT_SOURCE = "/tmp/svr4download"; > >Index: setuputil/installer/lib/ldapu.cpp >=================================================================== >RCS file: /cvs/dirsec/setuputil/installer/lib/ldapu.cpp,v >retrieving revision 1.2 >diff -u -8 -r1.2 ldapu.cpp >--- setuputil/installer/lib/ldapu.cpp 27 Mar 2006 21:18:35 -0000 1.2 >+++ setuputil/installer/lib/ldapu.cpp 8 May 2007 20:46:25 -0000 >@@ -1678,17 +1678,17 @@ > > p = strchr(buf, ':'); > if (p == NULL) > { > continue; > } > else > { >- *p++ = NULL; >+ *p++ = '\0'; > gotEntry = True; > stripBlank(buf, True); > stripBlank(p, False); > name = buf; > value = p; > } > } > } >Index: setuputil/installer/lib/setupapi.cpp >=================================================================== >RCS file: /cvs/dirsec/setuputil/installer/lib/setupapi.cpp,v >retrieving revision 1.2 >diff -u -8 -r1.2 setupapi.cpp >--- setuputil/installer/lib/setupapi.cpp 23 Mar 2006 15:59:10 -0000 1.2 >+++ setuputil/installer/lib/setupapi.cpp 8 May 2007 20:46:26 -0000 >@@ -567,161 +567,111 @@ > ** replaced: getDefaultLdapInfo > ** DESCRIPTION: > ** Tries to determine an existing ldap url to be used by the > ** to be installed server. The routine looks into the current > ** server root to see whether ldap information is already stored > ** there. > ** > ** INPUTS: >-** sroot - server root >+** configdir - directory containing the config file DEFAULT_ADMINCONF > ** ldapURL - ldap url to be returned > ** ldapUser - optional bind user id to be returned >+** adminDomain - admin domain > ** >-** OUTPUTS: ldapURL, ldapUser, bindDN, bindPwd >+** OUTPUTS: ldapURL, ldapUser, adminDomain > ** RETURN: none > ** SIDE EFFECTS: > ** none > ** RESTRICTIONS: > ** None > ** MEMORY: > ** Returned memory is allocated for char ** parameters > ********************************************************************** > */ > > > NSAPI_EXTERN void > setupGetDefaultLdapInfo(const char *sroot, char ** ldapURL, char ** ldapUser, > char **adminDomain) > { > char tstr[BIG_BUF]; >- snprintf(tstr, sizeof(tstr), "%s/%s", sroot, SETUP_LDAP_CONF); >+ snprintf(tstr, sizeof(tstr), "%s/%s", sroot, DEFAULT_ADMINCONF); > if (!memchr(tstr, 0, sizeof(tstr))) return; /*overflow*/ >+ >+ NVPair admConf; >+ >+ admConf.setFormat(2); >+ admConf.read(tstr); >+ > if (ldapURL) > { >- *ldapURL = setupGetFileString("ConfigURL", " ", tstr); >- if (*ldapURL == NULL) >- { >- char dbswith[BIG_BUF]; >- snprintf(dbswith, sizeof(dbswith), "%s/%s", sroot, SETUP_DEFAULT_LDAPSWITCH); >- if (!memchr(dbswith, 0, sizeof(dbswith))) return; /*overflow*/ >- *ldapURL = setupGetFileString("directory default", " ", dbswith); >- } >- >+ *ldapURL = setupStrdup(admConf.get("ldapurl")); > if (*ldapURL && ldap_is_ldap_url(*ldapURL)) > { > unescape_ldap_basedn(*ldapURL); > } > } > > if (ldapUser) > { >- *ldapUser = setupGetFileString("admnm", " ", tstr); >+ *ldapUser = setupStrdup(admConf.get("userdn")); > } > > if (adminDomain) > { >- *adminDomain = setupGetFileString(DS_ADMIN_DOMAIN, ":", tstr); >- if (*adminDomain == NULL) >- { >- char *s = NULL; >- snprintf(tstr, sizeof(tstr), "%s/%s", sroot, SETUP_DS_CONF); >- if (!memchr(tstr, 0, sizeof(tstr))) return; /*overflow*/ >- s = setupGetFileString(DS_ADMIN_DOMAIN, ":", tstr); >- if (s) >- { >- *adminDomain = setupStripAdminDomainDN(s); >- setupFree(s); >- } >- } >+ *adminDomain = setupStrdup(admConf.get(DS_ADMIN_DOMAIN)); > } > > return; > } > > /********************************************************************* > ** > ** FUNCTION: setupSetDefaultLdapInfo > ** replaced: getDefaultLdapInfo > ** DESCRIPTION: >-** Set Config Ldap information to ldap.conf. Caller needs to fill the >+** Set Config Ldap information to adm.conf. Caller needs to fill the > ** value to each argument. NULL means not to change the existing value. > ** > ** INPUTS: > ** sroot - server root > ** ldapURL - config LDAP URL > ** ldapUser - admin user to access ldapURL > ** adminDoamin - local admin domain > ** > ** OUTPUTS: none > ** RETURN: none > ** SIDE EFFECTS: > ** none > ** RESTRICTIONS: > ** None > ** MEMORY: >-** Returned memory is allocated for char ** parameters >+** none > ********************************************************************** > */ > > > NSAPI_EXTERN void > setupSetDefaultLdapInfo(const char *sroot, char * ldapURL, char * ldapUser, > char *adminDomain) > { > char tstr[BIG_BUF]; >- char *oldLines[2]; >- char *newLines[2]; >- char buffer[100]; >- >- if (ldapURL) >- { >- >- snprintf(tstr, sizeof(tstr), "%s/%s", sroot, SETUP_DEFAULT_LDAPSWITCH); >- if (!memchr(tstr, 0, sizeof(tstr))) return; /*overflow*/ > >- oldLines[1] = NULL; >- newLines[1] = NULL; >- snprintf(buffer, sizeof(buffer), "directory default %s", ldapURL); >- if (!memchr(buffer, 0, sizeof(buffer))) return; /*overflow*/ >- >- oldLines[0] = (char *)"directory default "; >- newLines[0] = buffer; >- setupFileUpdateLines(oldLines, newLines, tstr); >- } >- >- if (ldapUser) >- { >- snprintf(tstr, sizeof(tstr), "%s/%s", sroot, SETUP_LDAP_CONF); >- if (!memchr(tstr, 0, sizeof(tstr))) return; /*overflow*/ >- >- oldLines[1] = NULL; >- newLines[1] = NULL; >- snprintf(buffer, sizeof(buffer), "admnm %s", ldapUser); >- if (!memchr(buffer, 0, sizeof(buffer))) return; /*overflow*/ >- >- oldLines[0] = (char *)"admnm"; >- newLines[0] = buffer; >- setupFileUpdateLines(oldLines, newLines, tstr); >- } >+ snprintf(tstr, sizeof(tstr), "%s/%s", sroot, DEFAULT_ADMINCONF); >+ if (!memchr(tstr, 0, sizeof(tstr))) return; /*overflow*/ > >- if (adminDomain) >- { >- snprintf(tstr, sizeof(tstr), "%s/%s", sroot, SETUP_DS_CONF); >- if (!memchr(tstr, 0, sizeof(tstr))) return; /*overflow*/ >+ NVPair admConf; > >- oldLines[1] = NULL; >- newLines[1] = NULL; >- snprintf(buffer, sizeof(buffer), "%s:%s", DS_ADMIN_DOMAIN, adminDomain); >- if (!memchr(buffer, 0, sizeof(buffer))) return; /*overflow*/ >- >- oldLines[0] = (char *) DS_ADMIN_DOMAIN; >- newLines[0] = buffer; >- setupFileUpdateLines(oldLines, newLines, tstr); >- } >+ admConf.setFormat(2); >+ admConf.read(tstr); >+ admConf.set("ldapurl", ldapURL); >+ admConf.set("userdn", ldapUser); >+ admConf.set(DS_ADMIN_DOMAIN, adminDomain); >+ admConf.write(); > > return; > } > > > > > /********************************************************************* >@@ -1133,17 +1083,17 @@ > } > > NSAPI_EXTERN void * > setupMalloc(unsigned int size) > { > return malloc(size); > } > NSAPI_EXTERN char * >- setupStrdup(char *src) >+ setupStrdup(const char *src) > { > if (!(src)) > { > return NULL; > } > return strdup(src); > } > >@@ -2907,152 +2857,8 @@ > statvfs(path, &buf); > > if (buf.f_frsize == 0) > return (unsigned long)(((unsigned long long)buf.f_bavail / 1024.0) * buf.f_bsize); > else > return (unsigned long)(((unsigned long long)buf.f_bavail / 1024.0) * buf.f_frsize); > #endif > } >- >-/********************************************************************* >-** >-** FUNCTION: setupFileUpdateLines >-** DESCRIPTION: replace multiple lines to new lines in existing text file. >-** >-** INPUTS: >-** oldLines -- existing lines to match. >-** newLines -- replacement lines for each oldLines >-** OUTPUTS: >-** if successful, the file will be replaced with new one. >-** RETURN: >-** 0 -- success >-** 1 -- file can't open for read >-** 2 -- can't write the file. >-** 3 -- out of memory >-** Note: >-** setupReplaceLines does case insensitive match between each line from file >-** and oldLines. When matching, string length is based on oldLines. >-** Thus caller can pass "partial" line as oldLines and replaced it with >-** newLines. oldLines and newLines should be in sync. Last item in oldLines >-** should be set to NULL. >-********************************************************************** >-*/ >- >- >-int setupFileUpdateLines(char *oldLines[], char *newLines[], char *fileName) >-{ >- char line[1024]; >- struct stat statbuf; >- long size; >- FILE *fp; >- char *buffer; >- int origbuflen; >- int buflen; >- int *updateList; >- int n; >- int extraSize; >- int i; >- >- n = 0; >- extraSize = 0; >- while (newLines[n] != NULL) >- { >- extraSize += strlen(newLines[n]); >- n ++; >- } >- >- updateList = (int *) malloc(n); >- if (updateList == NULL) >- return 3; >- for (i = 0; i < n; i++) >- { >- updateList[i] = 0; >- } >- >- if (stat(fileName, &statbuf) != 0) >- { >- buflen = extraSize + 1; >- buffer = (char *) malloc(buflen); >- if (buffer == NULL) >- return 3; >- buffer[0] = '\0'; >- } >- else >- { >- size = statbuf.st_size; >- >- if ((fp = fopen(fileName, "r")) == NULL) >- return 1; >- >- /* >- * get replacement count >- */ >- >- origbuflen = buflen = size + extraSize + 1; >- buffer = (char *) malloc(buflen); >- if (buffer == NULL) >- return 3; >- >- buffer[0] = '\0'; >- >- /* >- * replace necessary lines and save them to memory >- */ >- while(fgets(line, sizeof(line), fp)) >- { >- for (i = 0; i < n; i ++) >- { >- if (strncasecmp(line, oldLines[i], strlen(oldLines[i])) == 0) >- { >- strncat(buffer, newLines[i], buflen); >- buflen -= strlen(newLines[i]); >- strncat(buffer, "\n", buflen); >- buflen -= 1; >- if (buflen <= 0) { >- buffer[origbuflen - 1] = '\0'; >- goto error_out; /* overflow: write at least what we have */ >- } >- updateList[i] = 1; >- } >- else >- { >- strncat(buffer, line, buflen); >- buflen -= strlen(line); >- strncat(buffer, "\n", buflen); >- buflen -= 1; >- if (buflen <= 0) { >- buffer[origbuflen - 1] = '\0'; >- goto error_out; /* overflow: write at least what we have */ >- } >- } >- } >- } >- fclose(fp); >- } >- >- for (i = 0; (i < n) && (updateList[i] == 0); i++) >- { >- strncat(buffer, newLines[i], buflen); >- buflen -= strlen(newLines[i]); >- strncat(buffer, "\n", buflen); >- buflen -= 1; >- if (buflen <= 0) { >- buffer[origbuflen - 1] = '\0'; >- goto error_out; /* overflow: write at least what we have */ >- } >- updateList[i] = 1; >- } >-error_out: >- /* >- * write from memory to file >- */ >- if ((fp = fopen(fileName, "w")) == NULL) >- return 2; >- >- fwrite(buffer, sizeof(char), strlen(buffer), fp); >- >- free(buffer); >- >- fclose(fp); >- >- return 0; >-} >Index: setuputil/installer/unix/installer.cc >=================================================================== >RCS file: /cvs/dirsec/setuputil/installer/unix/installer.cc,v >retrieving revision 1.6 >diff -u -8 -r1.6 installer.cc >--- setuputil/installer/unix/installer.cc 4 Apr 2007 22:29:46 -0000 1.6 >+++ setuputil/installer/unix/installer.cc 8 May 2007 20:46:27 -0000 >@@ -22,25 +22,16 @@ > ** > ** DESCRIPTION: > ** Installation Program for servers > ** > ** NOTES: > ** > ** HISTORY: > ** $Log: installer.cc,v $ >-** Revision 1.6 2007/04/04 22:29:46 nhosoi >-** Resolves: #234893 >-** Summary: Build SetupUtil with autotools (Comment #13, #15) >-** Changes: 1) resource file and inf file could be an absolute path, >-** or they could be located in the same dir as dssetup binary or >-** in $datadir/setuputil. >-** 2) dssetup does not issue "Notice: Your LD_LIBRARY_PATH variable is set to .." >-** since the library path is set in the wrapper script by the autotools. >-** > ** Revision 1.5 2006/03/27 21:18:35 nhosoi > ** [186642] Directory Server Makefile updates for Internal build > ** Changed the createSIE so that caller (Admin Server and Directory Server) passes > ** the brand to SetupUtil. > ** > ** Revision 1.4 2006/03/23 15:59:17 rmeggins > ** Bug(s) fixed: 186280 > ** Bug Description: Close potential security vulnerabilities in CGI code >@@ -796,52 +787,19 @@ > NVPair customResource; > const char *filename; > const char *p; > > filename = _newSuiteSpot.get("resource"); > > if (filename) > { >- /* >- * resource file can be specified in the [General] section of setup.inf >- * # All dialog strings can be defined in a resource file (optional). >- * Resource = setup.res >- * The value can be an absolute path. >- * If the value is a relative path or just a file name, >- * first the code checks if the value starting from the >- * setup binary location exists. >- * If it does not exist, then it checks in PROPERTYDIR, >- * which is defined at the build time. >- * If the resource value is set and the file does not exist, >- * it issues an warning and steps forward. >- */ >- NSString resourceFile = NULL; >- if ('/' == *filename) /* absolute path */ >- { >- resourceFile = filename; >- } >- else >- { >- resourceFile = _baseDir + "/" + filename; >- if (InstUtil::fileExists(resourceFile) == False) >- { >- /* the file is not in _baseDir (where dssetup is located) */ >- resourceFile = NSString(PROPERTYDIR) + "/" + filename; >- } >- } >- if (InstUtil::fileExists(resourceFile) == False) >- { >- setupLogMessage(WARN, "Setup", >- "Resource file %s does not exist.\n", resourceFile); >- } >- else >- { >- customResource.read(resourceFile); >- } >+ NSString resourceFile; >+ resourceFile = _baseDir + "/" + filename; >+ customResource.read(resourceFile); > } > > // Even without resource file defined, we still want to > // customize product and vendor name > if (p = _newSuiteSpot.get(SETUP_INF_VENDOR)) > customResource.set(SETUP_INF_VENDOR, p); > if (p = _newSuiteSpot.get(SETUP_INF_NAME)) > customResource.set(SETUP_INF_NAME, p); >@@ -966,16 +924,18 @@ > Installer::run() > { > int rc = 0; > const char *s; > > /* > * Start the first stage - common installer's questions > */ >+ >+ printNotice(); > prepreInstall(); > > if (_installMode == Silent) > { > setupLogMessage(INFO, "Setup", "Start silent installation..."); > rc = doSilentInstall(); > } > else if (_installMode == Interactive) >@@ -1465,54 +1425,30 @@ > return err; > } > > int > Installer::getNewProducts(const NSString & sourceDir, const char *infName) > { > NSString infFile; > >- /* >- * sourceDir: start point to look for inf file (infName) >- * infName: >- * The value can be an absolute path. >- * If the value is a relative path or just a file name, >- * first the code checks if the value starting from sourceDir. >- * If it does not exist, then it checks in PROPERTYDIR, >- * which is defined at the build time. >- */ >- if ('/' == *infName) /* absolute path */ >- { >- infFile = infName; >- } >- else >- { >- infFile = sourceDir + "/"; >- infFile = infFile + infName; >+ infFile = sourceDir + "/"; >+ infFile = infFile + infName; > >- if (InstUtil::fileExists(infFile) == False) >- { >- /* the file is not in sourceDir, try PROPERTYDIR */ >- infFile = NSString(PROPERTYDIR) + "/" + infName; >- } >- } >- /* >- * If the resource value is set and the file does not exist, it returns -1. >- */ > if (InstUtil::fileExists(infFile) == False) > { >- return -1; /* infFile does not exist */ >+ return -1; > } >- >+ > if (sourceDir == _sourceDir && _newSuiteSpot.numComponents()) > { > return 0; > } > >- if (_newSuiteSpot.retrieveSuiteSpot(sourceDir, infFile) == 0 && _newSuiteSpot.numComponents()) >+ if (_newSuiteSpot.retrieveSuiteSpot(sourceDir, infName) == 0 && _newSuiteSpot.numComponents()) > { > _newSuiteSpot.getComponents()->sortComponents(); > _newSuiteSpot.select(); > _newSuiteSpot.getAllComponents(*_newComponents); // Flatten the structure > _newComponents->sortComponents(); > _sourceDir = sourceDir; > return 0; > } >@@ -3348,8 +3284,55 @@ > } > } > > Bool > Installer::needDomainName() > { > return _checkDomainName; > } >+ >+ >+ >+void >+Installer::printNotice() >+{ >+ /* Bug 408242: Check if the LD_LIBRARY_PATH/SHLIB_PATH is set. >+ * If so, display a warning. Also, unset ENV variable. >+ */ >+ >+ char *lib_name = NULL, *lib_path = NULL, tmp[XSM_BUF], *env_path = NULL; >+ >+#if defined (HPUX) >+ lib_name = strdup("SHLIB_PATH"); >+#else >+ lib_name = strdup("LD_LIBRARY_PATH"); >+#endif >+ >+ memset(tmp, '\0', XSM_BUF); >+ if (lib_path = getenv(lib_name)) >+ { >+ DialogManager::disableWinMode(); >+ printf("\n%s %s %s\n\n", "Notice: Your", lib_name, "variable is set to:"); >+ printf("\t%s\n\n", lib_path); >+ printf("%s %s %s\n", "Please unset", lib_name, "or verify that the"); >+ printf("%s\n", "above setting is correct before continuing with"); >+ printf("%s\n", "the installation. An incorrect setting may cause"); >+ printf("%s\n", "problems during the installation such as the wrong"); >+ printf("%s\n\n", "copy of a shared library being used."); >+ if (_installMode != Silent) >+ { >+ printf("%s", "Continue [n]? "); >+ fflush(stdout); >+ fgets(tmp, sizeof(tmp), stdin); >+ if (tmp[0] == 'n' || tmp[0] == 'N' || tmp[0] == '\0' || (tmp[0] < 0x20)) >+ { >+ free(lib_name); >+ exit(0); >+ } >+ } >+ } >+ >+ free(lib_name); >+ >+ env_path = strdup("ENV="); >+ putenv(env_path); >+} >Index: setuputil/installer/unix/product.cc >=================================================================== >RCS file: /cvs/dirsec/setuputil/installer/unix/product.cc,v >retrieving revision 1.6 >diff -u -8 -r1.6 product.cc >--- setuputil/installer/unix/product.cc 4 Apr 2007 22:29:46 -0000 1.6 >+++ setuputil/installer/unix/product.cc 8 May 2007 20:46:28 -0000 >@@ -22,25 +22,16 @@ > ** > ** DESCRIPTION: > ** Definitions for Product class > ** > ** NOTES: > ** > ** HISTORY: > ** $Log: product.cc,v $ >-** Revision 1.6 2007/04/04 22:29:46 nhosoi >-** Resolves: #234893 >-** Summary: Build SetupUtil with autotools (Comment #13, #15) >-** Changes: 1) resource file and inf file could be an absolute path, >-** or they could be located in the same dir as dssetup binary or >-** in $datadir/setuputil. >-** 2) dssetup does not issue "Notice: Your LD_LIBRARY_PATH variable is set to .." >-** since the library path is set in the wrapper script by the autotools. >-** > ** Revision 1.5 2006/03/23 15:59:17 rmeggins > ** Bug(s) fixed: 186280 > ** Bug Description: Close potential security vulnerabilities in CGI code > ** Reviewed by: Nathan & Noriko (Thanks!) > ** Fix Description: Mostly cleaned up usage of sprintf. > ** Platforms tested: Fedora Core 5 > ** Flag Day: no > ** Doc impact: no >@@ -632,39 +623,17 @@ > char tstr[BIG_BUF]; > Product *prd = NULL; > const char *infoFile; > char **componentList = NULL; > > // This is top level master configuration file > init(); > >- /* >- * sourceDir: start point to look for inf file (infName) >- * infName: >- * The value can be an absolute path. >- * If the value is a relative path or just a file name, >- * first the code checks if the value starting from sourceDir. >- * If it does not exist, then it checks in PROPERTYDIR, >- * which is defined at the build time. >- */ >- if ('/' == *fileName) /* absolute path */ >- { >- snprintf(tstr, sizeof(tstr), "%s", fileName); >- } >- else >- { >- NSString setupFile = sourceDir + "/" + fileName; >- if (InstUtil::fileExists(setupFile) == False) >- { >- /* the file is not in sourceDir, try PROPERTYDIR */ >- setupFile = NSString(PROPERTYDIR) + "/" + fileName; >- } >- snprintf(tstr, sizeof(tstr), "%s", setupFile.data(), fileName); >- } >+ snprintf(tstr, sizeof(tstr), "%s/%s", sourceDir.data(), fileName); > tstr[sizeof(tstr)-1] = 0; > _packageInfo = new PackageInfo(tstr); > > if (_packageInfo->isEmpty() || (componentList = _packageInfo->getListItems(PKG_COMPONENTS)) == NULL || _packageInfo->numSections() == 0) > { > return -1; > } > >@@ -719,39 +688,17 @@ > int i; > NSString logFile; > NSString infFile; > NSString setupDir; > char **componentList = NULL; > > init(); > >- /* >- * sourceDir: start point to look for inf file (fileName) >- * fileame: >- * The value can be an absolute path. >- * If the value is a relative path or just a file name, >- * first the code checks if the value starting from sourceDir. >- * If it does not exist, then it checks in PROPERTYDIR, >- * which is defined at the build time. >- */ >- if ('/' == *fileName) /* absolute path */ >- { >- snprintf(tstr, sizeof(tstr), "%s", fileName); >- } >- else >- { >- NSString subFile = sourceDir + "/" + fileName; >- if (InstUtil::fileExists(subFile) == False) >- { >- /* the file is not in sourceDir, try PROPERTYDIR */ >- subFile = NSString(PROPERTYDIR) + "/" + fileName; >- } >- snprintf(tstr, sizeof(tstr), "%s", subFile.data(), fileName); >- } >+ snprintf(tstr, sizeof(tstr), "%s/%s", sourceDir.data(), fileName); > tstr[sizeof(tstr)-1] = 0; > > _packageInfo = new PackageInfo(tstr); > > if (_packageInfo->isEmpty()) > { > return -1; > } >Index: setuputil/installer/unix/lib/ux-util.cc >=================================================================== >RCS file: /cvs/dirsec/setuputil/installer/unix/lib/ux-util.cc,v >retrieving revision 1.2 >diff -u -8 -r1.2 ux-util.cc >--- setuputil/installer/unix/lib/ux-util.cc 23 Mar 2006 15:59:22 -0000 1.2 >+++ setuputil/installer/unix/lib/ux-util.cc 8 May 2007 20:46:29 -0000 >@@ -274,55 +274,16 @@ > #if !(defined(AIX4_3)) > void getdomainname(char *, int); > #endif > } > #endif > > /********************************************************************* > ** >-** FUNCTION: getDefaultHostname >-** DESCRIPTION: >-** Get the default hostname as previously configured. >-** >-** INPUTS: hn - input buffer >-** OUTPUTS: hn - host name, if found >-** RETURN: 0 (good), -1 (failure) >-** SIDE EFFECTS: >-** None >-** RESTRICTIONS: >-** None >-** MEMORY: >-** hn is expected to point to a valid memory location. >-********************************************************************** >-*/ >- >-NSString >-InstUtil::getDefaultHostName(const char *sroot) >-{ >- char tstr[BIG_BUF]; >- NSString hn; >- NVPair *admconf; >- >- snprintf(tstr, sizeof(tstr), "%s/%s", sroot, DEFAULT_ADMINCONF); >- tstr[sizeof(tstr)-1] = 0; >- >- admconf = new NVPair(tstr); >- >- if (admconf->isEmpty() == False) >- { >- hn = admconf->get("ServerName"); >- } >- >- delete admconf; >- return hn; >-} >- >-/********************************************************************* >-** > ** FUNCTION: getHostIpAddress > ** DESCRIPTION: > ** Get the IP address associated with a given host name > ** > ** INPUTS: const char *hostName. If NULL, default to current host. > ** OUTPUTS: None > ** RETURN: NULL, or IP address > ** SIDE EFFECTS: >@@ -359,128 +320,89 @@ > > /********************************************************************* > ** > ** FUNCTION: getDefaultUser > ** DESCRIPTION: > ** Tries to get the SuiteSpot User ID previously configured > ** for the existing installation. > ** >-** INPUTS: sroot - server root >+** INPUTS: CONFIGDIR - directory path containing the config file DEFAULT_ADMINCONF > ** OUTPUTS: > ** RETURN: ssUser > ** SIDE EFFECTS: > ** none > ** RESTRICTIONS: > ** None > ** MEMORY: >-** ssUser and ssGroup are expected to point to valid memory buf. >+** temp stack NSString is returned > ********************************************************************** > */ > > NSString >-InstUtil::getDefaultUser(const char *sroot) >+InstUtil::getDefaultUser(const char *configdir) > { > char tstr[BIG_BUF]; >- NVPair *ssconf; >+ NVPair admconf; > NSString ssUser; > >- snprintf(tstr, sizeof(tstr), "%s/%s", sroot, DEFAULT_SSUSERCONF); >+ snprintf(tstr, sizeof(tstr), "%s/%s", configdir, DEFAULT_ADMINCONF); > tstr[sizeof(tstr)-1] = 0; > >- ssconf = new NVPair(tstr); >+ admconf.setFormat(2); >+ admconf.read(tstr); > >- if (ssconf->isEmpty() == False) >+ if (admconf.isEmpty() == False) > { >- ssUser = ssconf->get("SuiteSpotUser"); >+ ssUser = admconf.get("sysuser"); > } > >- delete ssconf; >- > return ssUser; > > } > /********************************************************************* > ** > ** FUNCTION: getDefaultGroup > ** DESCRIPTION: > ** Tries to get the SuiteSpot User ID previously configured > ** for the existing installation. > ** >-** INPUTS: sroot - server root >+** INPUTS: CONFIGDIR - directory path containing the config file DEFAULT_ADMINCONF > ** OUTPUTS: > ** RETURN: default Group > ** SIDE EFFECTS: > ** none > ** RESTRICTIONS: > ** None > ** MEMORY: >-** >+** temp stack NSString is returned > ********************************************************************** > */ > > NSString >-InstUtil::getDefaultGroup(const char *sroot) >+InstUtil::getDefaultGroup(const char *configdir) > { > char tstr[BIG_BUF]; >- NVPair *ssconf; >+ NVPair admconf; > NSString ssGroup; > >- snprintf(tstr, sizeof(tstr), "%s/%s", sroot, DEFAULT_SSUSERCONF); >+ snprintf(tstr, sizeof(tstr), "%s/%s", configdir, DEFAULT_ADMINCONF); > tstr[sizeof(tstr)-1] = 0; > >- ssconf = new NVPair(tstr); >+ admconf.setFormat(2); >+ admconf.read(tstr); > >- if (ssconf->isEmpty() == False) >+ if (admconf.isEmpty() == False) > { >- ssGroup = ssconf->get("SuiteSpotGroup"); >+ ssGroup = admconf.get("sysgroup"); > } > >- delete ssconf; >- > return ssGroup; > } > >-/********************************************************************* >-** >-** FUNCTION: getAdmPwd >-** DESCRIPTION: >-** >-** >-** >-** INPUTS: >-** OUTPUTS: >-** RETURN: >-** SIDE EFFECTS: >-** none >-** RESTRICTIONS: >-** None >-** MEMORY: >-** >-********************************************************************** >-*/ >-NSString >-InstUtil::getAdmPwd(const char *serverRoot) >-{ >- char temp[BIG_BUF]; >- NVPair admpw; >- const char *pwd = NULL; >- >- snprintf(temp, sizeof(temp), "%s/admin-serv/config/adm.conf", serverRoot); >- temp[sizeof(temp)-1] = 0; >- admpw.setFormat(2); >- >- admpw.read(temp); >- pwd = admpw.get("siepid"); >- >- return pwd; >-} >- >- >- > > /********************************************************************* > ** > ** FUNCTION: getSysVersion > ** DESCRIPTION: > ** Get the system version in the form of <sysname><version> > ** per the output of uname -svr as appropriate. > ** >Index: setuputil/installer/unix/lib/ux-util.h >=================================================================== >RCS file: /cvs/dirsec/setuputil/installer/unix/lib/ux-util.h,v >retrieving revision 1.1.1.1 >diff -u -8 -r1.1.1.1 ux-util.h >--- setuputil/installer/unix/lib/ux-util.h 29 Jul 2005 22:16:33 -0000 1.1.1.1 >+++ setuputil/installer/unix/lib/ux-util.h 8 May 2007 20:46:29 -0000 >@@ -156,20 +156,20 @@ > #ifdef __cplusplus > extern "C" { > #endif > > /* > * Giving a server root, get the default Ldap information > */ > extern void getDefaultLdapInfo ( >- const char *sroot, >- char **ldapURL, >- char **ldapUser, >- char **installDN); >+ const char *configdir, /* dir containing DEFAULT_ADMINCONF */ >+ char **ldapURL, /* config DS url */ >+ char **ldapUser, /* uid of console/adminserver admin */ >+ char **admin_domain); /* admin domain */ > > void unescape_ldap_basedn(char *str); > > > #ifdef __cplusplus > } > #endif > >@@ -185,18 +185,18 @@ > > extern char *guessHostname(); > extern char *guessDomain(); > extern int guessPort(); > extern Bool portAvailable(int port); > extern int availUser(const char *user); > extern int availGroup(const char *user, const char *group); > extern char *getDefaultHostName(const char *sroot); >-extern char *getDefaultUser(const char *sroot); >-extern char *getDefaultGroup(const char *sroot); >+extern char *getDefaultUser(const char *configdir); >+extern char *getDefaultGroup(const char *configdir); > extern char *getSysVersion(); > extern char *getCurrentDir(void); > extern Bool dirWritable(const char *dirName); > extern int createDirectory(const char *dirName, int mode); > extern Bool fileExists(const char *fileName); > extern Bool dirExists(const char *dirName); > extern Bool isServerRoot(const char *directoryName); > extern Bool isLegacyServerRoot (const char *dirName); >@@ -348,38 +348,16 @@ > * > * MEMORY: > * > */ > static NSString getSysVersion(); > > /* > * MEMBER: >- * InstUtil::getDefaultHostName >- * DESCRIPTION: >- * Giving a server root, get the configured FQDN of my machine >- * >- * INPUTS: >- * >- * OUTPUTS: >- * >- * RETURN: >- * >- * EXCEPTION THROWN >- * >- * RESTRICTIONS: >- * >- * MEMORY: >- * >- */ >- >- static NSString getDefaultHostName(const char *sroot); >- >- /* >- * MEMBER: > * InstUtil::getHostIpAddress > * DESCRIPTION: > * Giving a host name, get the associated IP address. > * INPUTS: > * > * OUTPUTS: > * > * RETURN: >@@ -393,56 +371,34 @@ > */ > static NSString getHostIpAddress(const char *hostName); > > /* > * MEMBER: > * InstUtil::getDefaultUser > * InstUtil::getDefaultGroup > * DESCRIPTION: >- * Giving a server root, get the configured UNIX user ID/group >- * to run servers as. >+ * Giving the directory path containing the file DEFAULT_ADMINCONF >+ * get the configured UNIX user ID/group to run servers as. > * INPUTS: > * > * OUTPUTS: > * > * RETURN: > * > * EXCEPTION THROWN > * > * RESTRICTIONS: > * > * MEMORY: > * > */ > >- static NSString getDefaultUser(const char *sroot); >- static NSString getDefaultGroup (const char *sroot); >- >- /* >- * MEMBER: >- * InstUtil::getAdmPwd >- * DESCRIPTION: >- * Giving a server root, get the Admin's password that >- * could be used to authenticate with DS >- * INPUTS: >- * server root >- * OUTPUTS: >- * Admin's password >- * RETURN: >- * the admin's password (allocated) >- * EXCEPTION THROWN >- * >- * RESTRICTIONS: >- * >- * MEMORY: >- * >- */ >- >- static NSString getAdmPwd(const char *sroot); >+ static NSString getDefaultUser(const char *configdir); >+ static NSString getDefaultGroup (const char *configdir); > > /* > * MEMBER: > * InstUtil::isSelfRootUser() > * DESCRIPTION: > * Check if current login ID is root of the running process > * > * INPUTS: >Index: setuputil/installer/unix/lib/ux-wrapper.cc >=================================================================== >RCS file: /cvs/dirsec/setuputil/installer/unix/lib/ux-wrapper.cc,v >retrieving revision 1.3 >diff -u -8 -r1.3 ux-wrapper.cc >--- setuputil/installer/unix/lib/ux-wrapper.cc 30 Mar 2006 00:38:29 -0000 1.3 >+++ setuputil/installer/unix/lib/ux-wrapper.cc 8 May 2007 20:46:29 -0000 >@@ -116,31 +116,25 @@ > } > > char *getSysVersion() > { > NSString sysVersion = InstUtil::getSysVersion(); > return strdup(sysVersion.data()); > } > >-char *getDefaultHostName(const char *sroot) >+char *getDefaultUser(const char *configdir) > { >- NSString hn = InstUtil::getDefaultHostName(sroot); >- return strdup(hn.data()); >-} >- >-char *getDefaultUser(const char *sroot) >-{ >- NSString us = InstUtil::getDefaultUser(sroot); >+ NSString us = InstUtil::getDefaultUser(configdir); > return strdup(us.data()); > } > >-char *getDefaultGroup(const char *sroot) >+char *getDefaultGroup(const char *configdir) > { >- NSString ug = InstUtil::getDefaultGroup(sroot); >+ NSString ug = InstUtil::getDefaultGroup(configdir); > return strdup(ug.data()); > } > char *getCurrentDir(void) > { > NSString cd = InstUtil::getCurrentDir(); > return strdup(cd.data()); > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 239494
:
154360
| 154361 |
154372