[Fedora-directory-commits] adminserver/admserv/newinst/src ux-config.cc, 1.10, 1.11 ux-config.h, 1.6, 1.7 ux-dialog.cc, 1.10, 1.11 ux-dialog.h, 1.4, 1.5 ux-remove.cc, 1.6, 1.7 ux-update.cc, 1.22, 1.23

Richard Allen Megginson (rmeggins) fedora-directory-commits at redhat.com
Wed May 9 00:26:35 UTC 2007


Author: rmeggins

Update of /cvs/dirsec/adminserver/admserv/newinst/src
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv32253/adminserver/admserv/newinst/src

Modified Files:
	ux-config.cc ux-config.h ux-dialog.cc ux-dialog.h ux-remove.cc 
	ux-update.cc 
Log Message:
Resolves: bug 239502, bug 186280
Description: adminserver: autotools, FHS, clean up CGI parameters
Fix Description: Too numerous to mention




Index: ux-config.cc
===================================================================
RCS file: /cvs/dirsec/adminserver/admserv/newinst/src/ux-config.cc,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- ux-config.cc	12 May 2006 00:41:35 -0000	1.10
+++ ux-config.cc	9 May 2007 00:26:33 -0000	1.11
@@ -39,12 +39,14 @@
 #include <signal.h>
 }
 
-#include "global.h"
-#include "dialog.h"
+#include "setuputil/global.h"
+#include "setuputil/dialog.h"
 #include "ux-config.h"
 #include "ux-dialog.h"
 
-extern const char *DEFAULT_SYSUSER = "root";
+#include "config.h"
+
+extern const char *DEFAULT_SYSUSER;
 
 /*********************************************************************
 **
@@ -58,8 +60,7 @@
 **       and can be executed from anywhere.
 **
 **     - The stand-alone configuration program used to re-configure
-**       the administration server. In this case, the program has
-**       to be executed from the serverroot.
+**       the administration server.
 **
 ** SIDE EFFECTS:
 **   None
@@ -144,7 +145,6 @@
    int err = 0;
 
    umask(022);
-   _serverRoot = InstUtil::getCurrentDir();
 
    if (installMode() == Interactive)
    {
@@ -153,18 +153,7 @@
 
       if (_infoFile == (char *) NULL)
       {
-         // Not executing from the shell, check if this is the
-         // server root
-         if (InstUtil::isServerRoot(_serverRoot) == False)
-         {
-            err = -1;
-            snprintf(errMsg, sizeof(errMsg), "ERROR: %s is not a server root\n",_serverRoot.data());
-            errMsg[sizeof(errMsg)-1] = 0;
-         }
-         else
-         {
-            _runFromShell = False;
-         }
+	 _runFromShell = False;
       }
       else if (InstUtil::fileExists(_infoFile) == False)
       {
@@ -187,7 +176,8 @@
       {
          if (_logFile == (char *) NULL)
          {
-            _logFile = _serverRoot + "/" + SETUP_DIR + "/" + INSTALL_LOG;
+	    NSString logdir(LOGDIR);
+            _logFile = logdir + "/" + INSTALL_LOG;
          }
          _installLog = new InstallLog (_logFile);
       }
@@ -218,7 +208,6 @@
          {
             _adminInfo = _installInfo->createSection("admin");
          }
-         _serverRoot = _installInfo->get(SERVER_ROOT);
       }
       else
       {
@@ -227,7 +216,6 @@
          // installation database.
          // PVO
          char buf[SML_BUF];
-//         _infoFile = _serverRoot + "/" + SETUP_DIR + "/" + INSTALL_INF; -- PVO
 	 _infoFile = tmpnam(buf);
          _installInfo = new InstallInfo();
          _adminInfo = _installInfo->createSection("admin");
@@ -264,20 +252,18 @@
    NVPair admConf;
    LdapError ldapError;
    char *ldapURL = NULL;
-   char *ldapUser = NULL;
-   char *installDN = NULL;
    NSString siePwd = NULL;
    NSString siePort = NULL;
    NSString hostName = InstUtil::guessHostname();
 
    /* First, determine whether Admin is already configured */
-   snprintf(tmp, sizeof(tmp), "%s/admin-serv/config/adm.conf", _serverRoot.data());
+   snprintf(tmp, sizeof(tmp), "%s/local.conf", CONFIGDIR);
    tmp[sizeof(tmp)-1] = 0;
 
    admConf.setFormat(2);
    admConf.read(tmp);
 
-   getDefaultLdapInfo(_serverRoot, &ldapURL, &ldapUser, &installDN );
+   getDefaultLdapInfo(CONFIGDIR, &ldapURL, NULL, NULL );
 
    if (admConf.isEmpty() == False)
    {
@@ -286,7 +272,7 @@
       /* Use admin id and admin pwd to access DS */
       sieDN = _installInfo->get(MC_ADMIN_ID); 
       siePwd = _installInfo->get(MC_ADMIN_PWD);
-      siePort = admConf.get("port");
+      siePort = admConf.get("nsServerPort");
 
       if (sieDN != (char *) NULL && siePwd != (char *) NULL && ldapURL != NULL)
       {
@@ -309,7 +295,7 @@
       }
    }
 
-   snprintf(tmp, sizeof(tmp), "%s/admin-serv/config/admpw", _serverRoot.data());
+   snprintf(tmp, sizeof(tmp), "%s/admpw", CONFIGDIR);
    tmp[sizeof(tmp)-1] = 0;
 
    admConf.read(tmp);
@@ -357,7 +343,6 @@
 
    if (_runFromShell == False)
    {
-      _installInfo->set(SERVER_ROOT, _serverRoot.data());
       _installInfo->set(MACHINE_NAME, hostName);
       _installInfo->set(INSTALL_TYPE, DEFAULT_INSTALL_TYPE);
       if (ldapURL)
@@ -369,13 +354,13 @@
          _installInfo->set(CONFIG_LDAP_URL, NSString("ldap://") +
             _installInfo->get(MACHINE_NAME) +
             ":389/" +
-            "o=" + InstUtil::guessDomain());
+            "o=NetscapeRoot");
 
          ldapURL = (char *) _installInfo->get(CONFIG_LDAP_URL);
       }
 
-      _installInfo->set(SS_USER_ID, InstUtil::getDefaultUser(_serverRoot));
-      _installInfo->set(SS_GROUP, InstUtil::getDefaultGroup(_serverRoot));
+      _installInfo->set(SS_USER_ID, InstUtil::getDefaultUser(CONFIGDIR));
+      _installInfo->set(SS_GROUP, InstUtil::getDefaultGroup(CONFIGDIR));
    }
 }
 
@@ -557,16 +542,8 @@
 
   if (installType() == Express)
   {
-#ifdef LINUX
-      NSString httpd = "/usr/sbin";
-#else
-#ifdef HPUX
-      NSString httpd = "/opt/hpws/apache/bin";
-#else 
-      NSString httpd = "/usr/local/apache2/bin";
-#endif
-#endif
-     _adminInfo->set("ApacheDir", httpd);
+     NSString httpd = HTTPD;
+     _adminInfo->set("Apache", httpd);
      goto SS8;
   }
   askApache.registerDialogNext(this);
@@ -759,14 +736,18 @@
    NSString errMsg;
    NSString sysUser;
 
-   snprintf(tmp, sizeof(tmp), "%s/bin/admin/ns-admin", _serverRoot.data());
+   snprintf(tmp, sizeof(tmp), "%s/local.conf", CONFIGDIR);
    tmp[sizeof(tmp)-1] = 0;
 
    if (stat(tmp, &fi) == 0)
    {
       sysUser = getpwuid(fi.st_uid)->pw_name;
    }
-   else
+   else if (InstUtil::isSelfRootUser())
+   {
+      sysUser = DEFAULT_HTTPDUSER;
+   }
+   else /* not root, just use process user id */
    {
       sysUser = InstUtil::getSelfUserID();
    }
@@ -788,12 +769,12 @@
    char stopProgram[BIG_BUF];
    struct stat fi;
 
-   snprintf(pid, sizeof(pid), "%s/admin-serv/logs/pid", _serverRoot.data());
+   snprintf(pid, sizeof(pid), "%s/%s", PIDDIR, PIDFILE);
    pid[sizeof(pid)-1] = 0;
 
    if (stat(pid, &fi) == 0)
    {
-       snprintf(stopProgram, sizeof(stopProgram), "%s/stop-admin", _serverRoot.data());
+       snprintf(stopProgram, sizeof(stopProgram), "%s/stop-admin", CMDBINDIR);
        stopProgram[sizeof(stopProgram)-1] = 0;
       if (stat (stopProgram, &fi) != 0)
       {
@@ -802,19 +783,6 @@
       }
       system(stopProgram);
    }
-
-   /* Stop SNMP Master Agent if running */
-   int magpid;
-   FILE* fhdl;
-   snprintf(pid, sizeof(pid), "%s/admin-serv/logs/pid_masteragt", _serverRoot.data());
-   pid[sizeof(pid)-1] = 0;
-   if ((fhdl = fopen(pid, "r")) != NULL)
-   {
-      fscanf(fhdl, "%d\n", &magpid);
-      fclose(fhdl);
-      kill(magpid, SIGKILL);
-      unlink(pid);
-   }
 }
 
 int
@@ -825,7 +793,7 @@
 
    disableWinMode();
 
-   snprintf(tmp, sizeof(tmp), "%s/bin/admin/ns-update -f %s", _serverRoot.data(), _infoFile.data());
+   snprintf(tmp, sizeof(tmp), "%s/ns-update -f %s", CMDBINDIR, _infoFile.data());
    tmp[sizeof(tmp)-1] = 0;
 
    err = system(tmp);
@@ -858,7 +826,7 @@
    }
 }
 
-static char *get_value(char * file, char * attr) {
+static char *get_value(const char * file, const char * attr) {
    char cmd[1024];
    char buf[1024];
    FILE *fp;
@@ -888,37 +856,32 @@
 }
 
 NSString
-AdminPreInstall::verifyApacheDir(const char *dir) const
+AdminPreInstall::verifyApache(const char *path) const
 {
-   char path[1024];
    char errMsg[SML_BUF];
+   NSString apacheRoot;
    struct stat st;
    char *v;
 
-   snprintf(path, sizeof(path), "%s/httpd.worker", dir);
-   path[sizeof(path)-1] = 0;
    if (stat(path, &st) != 0) {
-      snprintf(path, sizeof(path), "%s/httpd", dir);
-      path[sizeof(path)-1] = 0;
-      if (stat(path, &st) != 0) {
-         snprintf(errMsg, sizeof(errMsg), "Can't find Apache in %s", dir);
-         errMsg[sizeof(errMsg)-1] = 0;
-         return errMsg;
-      }
+      snprintf(errMsg, sizeof(errMsg), "Unable to locate Apache binary %s\n.", path);
+      errMsg[sizeof(errMsg)-1] = 0;
+      return errMsg;
    }
 
    v = get_value(path, "APACHE_MPM_DIR");
-   if (strcmp(v, "server/mpm/worker")) {
-      snprintf(errMsg, sizeof(errMsg), "The Admininistration Server requires an Apache web server that provides the worker model.");
+   if (!v || strcmp(v, "server/mpm/worker")) {
+      snprintf(errMsg, sizeof(errMsg),
+	       "The Admininistration Server requires an Apache web "
+	       "server that provides the worker (multi-threaded) model.\n%s was not "
+	       "built with this option.  See '%s -V' for more details", path, path);
       errMsg[sizeof(errMsg)-1] = 0;
       return errMsg;
    }
 
-   v = get_value(path, "HTTPD_ROOT");
-   snprintf(path, sizeof(path), "%s/modules", v);
-   path[sizeof(path)-1] = 0;
-   if (stat(path, &st) != 0) {
-      snprintf(errMsg, sizeof(errMsg), "Unable to locate Apache modules in %s\n.", path);
+   apacheRoot = getApacheRoot(path);
+   if (!apacheRoot.data() || !apacheRoot.length()) {
+      snprintf(errMsg, sizeof(errMsg), "Unable to locate Apache modules for %s\n.", path);
       errMsg[sizeof(errMsg)-1] = 0;
       return errMsg;
    }
@@ -929,27 +892,17 @@
 }
 
 NSString
-AdminPreInstall::getApacheRoot(const char *dir) const
+AdminPreInstall::getApacheRoot(const char *path) const
 {
-   char path[1024];
+   char mypath[1024];
    char errMsg[SML_BUF];
    struct stat st;
    char *v;
 
-   snprintf(path, sizeof(path), "%s/httpd.worker", dir);
-   path[sizeof(path)-1] = 0;
-   if (stat(path, &st) != 0) {
-      snprintf(path, sizeof(path), "%s/httpd", dir);
-      path[sizeof(path)-1] = 0;
-      if (stat(path, &st) != 0) {
-         return NULL;
-      }
-   }
-
    v = get_value(path, "HTTPD_ROOT");
-   snprintf(path, sizeof(path), "%s/modules", v);
-   path[sizeof(path)-1] = 0;
-   if (stat(path, &st) != 0) {
+   snprintf(mypath, sizeof(mypath), "%s/modules", v);
+   mypath[sizeof(mypath)-1] = 0;
+   if (stat(mypath, &st) != 0) {
       return NULL;
    }
 


Index: ux-config.h
===================================================================
RCS file: /cvs/dirsec/adminserver/admserv/newinst/src/ux-config.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ux-config.h	28 Oct 2005 22:44:18 -0000	1.6
+++ ux-config.h	9 May 2007 00:26:33 -0000	1.7
@@ -30,6 +30,11 @@
 **
 ** HISTORY:
 ** $Log$
+** Revision 1.7  2007/05/09 00:26:33  rmeggins
+** Resolves: bug 239502, bug 186280
+** Description: adminserver: autotools, FHS, clean up CGI parameters
+** Fix Description: Too numerous to mention
+**
 ** Revision 1.6  2005/10/28 22:44:18  nhosoi
 ** 171942 – Change Admin Server version to 1.0
 ** 1) changing Admin Server version to 1.0 including ou in the Global preferences
@@ -97,8 +102,8 @@
 **
 **
 *********************************************************************/
-#include "dialog.h"
-#include "ux-util.h"
+#include "setuputil/dialog.h"
+#include "setuputil/ux-util.h"
 extern const char *DEFAULT_SYSUSER;
 
 class AdminPreInstall:public DialogManager
@@ -125,8 +130,8 @@
     NSString verifyAdminPort(const char *port) const;
     NSString verifyAdminSysUser(const char *sysUser) const;
     NSString guessAdminSysUser() const;
-    NSString verifyApacheDir(const char*) const;
-    NSString getApacheRoot(const char *dir) const;
+    NSString verifyApache(const char*path) const;
+    NSString getApacheRoot(const char *path) const;
 
     void     setupServerAdmin();
     int  prepareUpgrade();
@@ -134,7 +139,6 @@
 private:
 
    Bool             _runFromShell;
-   NSString        _serverRoot;
 
    NSString        _infoFile;
    InstallInfo     *_installInfo;


Index: ux-dialog.cc
===================================================================
RCS file: /cvs/dirsec/adminserver/admserv/newinst/src/ux-dialog.cc,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- ux-dialog.cc	31 Mar 2006 22:58:20 -0000	1.10
+++ ux-dialog.cc	9 May 2007 00:26:33 -0000	1.11
@@ -26,12 +26,14 @@
 #include <string.h>
 }
 
-#include "utf8.h"
-#include "ux-util.h"
-#include "dialog.h"
+#include "setuputil/utf8.h"
+#include "setuputil/ux-util.h"
+#include "setuputil/dialog.h"
 #include "ux-dialog.h"
 #include "ux-config.h"
 
+#include "config.h"
+
 /*
 ** Forward References
 */
@@ -164,7 +166,7 @@
 
 "Run Administration Server as",
 
-DEFAULT_SYSUSER,
+DEFAULT_HTTPDUSER,
 
 askSysUserSetup,
 askSysUserNext
@@ -561,20 +563,12 @@
 
 DialogInput askApache(
 "The Administration Server runs on the Apache web server. Please provide the\n"
-"directory where the Apache binary (httpd or httpd.worker) may be found. The\n"
-"Administration Server needs an Apache compiled with the worker model.\n",
+"absolute path and filename of the Apache binary. The Administration \n"
+"Server needs an Apache compiled with the worker (multi-threaded) model.\n",
 
-"Apache Directory",
+"Apache",
 
-#ifdef LINUX
-"/usr/sbin/",
-#else
-#ifdef HPUX
-"/opt/hpws/apache/bin",
-#else
-"/usr/local/apache2/bin",
-#endif
-#endif
+HTTPD,
 askApacheSetup,
 askApacheNext
 );
@@ -582,7 +576,7 @@
 DialogAction
 askApacheSetup(Dialog *me)
 {
-   dialogSetup(me, "ApacheDir", ((AdminPreInstall *) me->manager()->parent())->getDefaultScript());
+   dialogSetup(me, "Apache", ((AdminPreInstall *) me->manager()->parent())->getDefaultScript());
    return DIALOG_SAME;
 }
 
@@ -590,20 +584,20 @@
 askApacheNext(Dialog *me)
 {
    const char *buf = me->input();
-   const char *ApacheDir;
+   const char *Apache;
    NSString errMsg;
    AdminPreInstall *installer = (AdminPreInstall *) me->manager()->parent();
 
    if (buf[0] == 0)
    {
-      ApacheDir = me->defaultAns();
+      Apache = me->defaultAns();
    }
    else
    {
-      ApacheDir = buf;
+      Apache = buf;
    }
 
-   errMsg = installer->verifyApacheDir(ApacheDir);
+   errMsg = installer->verifyApache(Apache);
 
    if (errMsg != (char *) NULL)
    {
@@ -612,8 +606,8 @@
       return DIALOG_SAME;
    }
 
-   me->manager()->getDefaultScript()->set("ApacheDir", ApacheDir);
-   me->manager()->getDefaultScript()->set("ApacheRoot", installer->getApacheRoot(ApacheDir));
+   me->manager()->getDefaultScript()->set("Apache", Apache);
+   me->manager()->getDefaultScript()->set("ApacheRoot", installer->getApacheRoot(Apache));
 
    return DIALOG_NEXT;
 }


Index: ux-dialog.h
===================================================================
RCS file: /cvs/dirsec/adminserver/admserv/newinst/src/ux-dialog.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ux-dialog.h	18 Aug 2005 19:06:43 -0000	1.4
+++ ux-dialog.h	9 May 2007 00:26:33 -0000	1.5
@@ -18,7 +18,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  *
  * END COPYRIGHT BLOCK **/
-#include "dialog.h"
+#include "setuputil/dialog.h"
 extern DialogYesNo askReconfig;
 extern DialogInput askAdminPort;
 extern DialogInput askAdminUser;


Index: ux-remove.cc
===================================================================
RCS file: /cvs/dirsec/adminserver/admserv/newinst/src/ux-remove.cc,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ux-remove.cc	12 May 2006 00:41:35 -0000	1.6
+++ ux-remove.cc	9 May 2007 00:26:33 -0000	1.7
@@ -42,9 +42,11 @@
 #include <signal.h>		/* kill() */
 }
 
-#include "global.h"
-#include "ux-util.h"
-#include "ldapu.h"
+#include "setuputil/global.h"
+#include "setuputil/ux-util.h"
+#include "setuputil/ldapu.h"
+
+#include "config.h"
 
 int main(int argc, char *argv[])
 {


Index: ux-update.cc
===================================================================
RCS file: /cvs/dirsec/adminserver/admserv/newinst/src/ux-update.cc,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- ux-update.cc	12 May 2006 00:41:35 -0000	1.22
+++ ux-update.cc	9 May 2007 00:26:33 -0000	1.23
@@ -45,14 +45,16 @@
 
 }
 
-#include "global.h"
-#include "code.h"
-#include "ux-util.h"
-#include "ldapu.h"
-#include "setupldap.h"
-#include "uninstall.h"
+#include "setuputil/global.h"
+#include "setuputil/code.h"
+#include "setuputil/ux-util.h"
+#include "setuputil/ldapu.h"
+#include "setuputil/setupldap.h"
+#include "setuputil/uninstall.h"
 #include "../common/include/acidef.h"
 
+#include "config.h"
+
 static int set_locate_admserv_aci(Ldap *ldap);
 static int repair_group_expansion_aci(Ldap *ldap);
 static void replaceTokensInFile(const char *sourcefile, const char *destfile, const char * const *ary);
@@ -65,14 +67,14 @@
 
 #define EPOCH_32BIT_END_TIME  "20380118031417" /* <correct end time> minus 1 day */
 
-const char *DEFAULT_SYSUSER = "root";
-const char *DEFAULT_TASKCONF = "admin-serv/ldif/tasks.ldif";
-const char *DEFAULT_GLOBALCONF = "admin-serv/ldif/global.ldif";
+const char *DEFAULT_SYSUSER = DEFAULT_HTTPDUSER;
+const char *DEFAULT_DATADIR = DATADIR;
+const char *DEFAULT_TASKCONF = "admintasks.ldif"; /* relative to DATADIR */
+const char *DEFAULT_GLOBALCONF = "adminglobal.ldif"; /* relative to DATADIR */
 
 const char *CHOWN_CMD = "chown -R %s %s >/dev/null 2>&1";
 const char *CHGRP_CMD = "chgrp -R %s %s >/dev/null 2>&1";
 const char *SHARED_CHGRP_CMD = "chgrp -R %s %s/shared >/dev/null 2>&1";
-const char *SSCONF_CHGRP_CMD = "chgrp -R %s %s/shared/config/ssusers.conf >/dev/null 2>&1";
 const char *SECALIAS_CHGRP_CMD = "chgrp -R %s %s/alias >/dev/null 2>&1";
 
 const char *DEFAULT_ADMIN_CONFIG_ACI = "(targetattr=*)(version 3.0; acl \"Enable delegated admin to access configuration\"; allow (read,search) groupdn=\"ldap:///%s\";)";
@@ -211,7 +213,7 @@
    return result;
 }
 
-static char *get_value(char * file, char * attr) {
+static char *get_value(const char * file, char * attr) {
    char cmd[1024];
    char buf[1024];
    FILE *fp;
@@ -240,24 +242,16 @@
 }
 
 static NSString
-findApacheRoot(const char *dir)
+findApacheRoot(const char *path)
 {
-   char path[1024];
+   char mypath[1024];
    struct stat st;
    char *v;
 
-   snprintf(path, sizeof(path), "%s/httpd.worker", dir);
-   if (stat(path, &st) != 0) {
-      snprintf(path, sizeof(path), "%s/httpd", dir);
-      if (stat(path, &st) != 0) {
-         return NULL;
-      }
-   }
-
    v = get_value(path, "HTTPD_ROOT");
    if (v) {
-	   sprintf(path, "%s/modules", v);
-	   if (stat(path, &st) != 0) {
+	   sprintf(mypath, "%s/modules", v);
+	   if (stat(mypath, &st) != 0) {
 		   return NULL;
 	   }
    }
@@ -265,7 +259,7 @@
    return v;
 }
 
-static char *get_version(char * file) {
+static char *get_version(const char * file) {
    char cmd[1024];
    char buf[1024];
    FILE *fp;
@@ -295,25 +289,20 @@
 static NSString
 findApacheVersion(const char *dir)
 {
-   char path[1024];
    struct stat st;
    char *v;
 
-   snprintf(path, sizeof(path), "%s/httpd.worker", dir);
-   if (stat(path, &st) != 0) {
-      snprintf(path, sizeof(path), "%s/httpd", dir);
-      if (stat(path, &st) != 0) {
-         return NULL;
-      }
+   if (stat(dir, &st) != 0) {
+     return NULL;
    }
 
-   v = get_version(path);
+   v = get_version(dir);
 
    return v;
 }
 
 void
-configTasks(const Ldap *ldap, const char *sroot, const char *sieDN)
+configTasks(const Ldap *ldap, const char *datadir, const char *sieDN)
 {
    char tmp[BIG_BUF];
    LdapErrorCode err;
@@ -321,7 +310,7 @@
    printf("Configuring Administration Tasks in Directory Server...\n");
    installLog->logMessage(INFO, "Admin", "Configuring Administration Tasks in Directory Server");
 
-   sprintf(tmp, "%s/%s", sroot, DEFAULT_TASKCONF);
+   sprintf(tmp, "%s/%s", datadir, DEFAULT_TASKCONF);
 
    err = setupReplaceLdifEntries(ldap, sieDN, tmp, sieDN);
 
@@ -333,7 +322,7 @@
 }
 
 void
-configGlobalParameters(const Ldap *ldap, const char *sroot, const char *subTreeDN)
+configGlobalParameters(const Ldap *ldap, const char *datadir, const char *subTreeDN)
 {
    char tmp[BIG_BUF];
    LdapErrorCode err;
@@ -341,7 +330,7 @@
    printf("Configuring Global Parameters in Directory Server...\n");
    installLog->logMessage(INFO, "Admin", "Configuring global parameters...");
 
-   sprintf(tmp, "%s/%s", sroot, DEFAULT_GLOBALCONF);
+   sprintf(tmp, "%s/%s", datadir, DEFAULT_GLOBALCONF);
 
    err = setupUpdateLdifEntries(ldap, subTreeDN, tmp, NULL);
 
@@ -353,65 +342,8 @@
 }
 
 
-/*
- * Cleanup prevoius installation after upgrading from 6.0x
- */
-int
-cleanup_after_upgrade(const char *sroot) 
-{
-   struct stat fi;
-   char buf[BIG_BUF];
-
-   // Move admin-serv/config/secmod.db to the alias directory;
-   // Starting with as 6.1 secmod.db is in the alias directory.
-   sprintf(buf, "%s/admin-serv/config/secmod.db", sroot);
-   if (stat(buf, &fi) == 0) {
-       char to[BIG_BUF];
-       sprintf(to, "%s/alias/secmod.db", sroot);
-       if (link(buf, to) == 0) { 
-           unlink(buf);
-       }
-   }
-
-   // Remove admin-serv/config/libnssckbi.so;
-   // Starting with as 6.1 secmod.db is in the alias directory.
-   sprintf(buf, "%s/admin-serv/config/libnssckbi.%s", sroot, SHLIB_EXT);
-   if (stat(buf, &fi) == 0) {
-       unlink(buf);
-   }
-
-   // Remove admin-serv/config/res directory. Not packaged starting with as61.
-   sprintf(buf, "%s/admin-serv/config/res", sroot);
-   if (stat(buf, &fi) == 0) {
-       char cmd[BIG_BUF];
-       sprintf(cmd, "rm -fr %s", buf);
-       system(cmd);
-   }
-
-   // Remove adminsdk 60
-   sprintf(buf, "%s/lib/libadminutil60.%s", sroot, SHLIB_EXT);
-   if (stat(buf, &fi) == 0) {
-       unlink(buf);
-   }
-   sprintf(buf, "%s/lib/libadmsslutil60.%s", sroot, SHLIB_EXT);
-   if (stat(buf, &fi) == 0) {
-       unlink(buf);
-   }
-
-   // Remove admserv jars from the previous installation
-   sprintf(buf, "%s/java/jars/admserv60.jar", sroot);
-   if (stat(buf, &fi) == 0) {
-       char cmd[BIG_BUF];
-       sprintf(cmd, "rm %s/java/jars/admserv60*", sroot);
-       system(cmd);
-   }
-
-   return 0;
-}
-
-
 void
-start_admserv(const char *sroot)
+start_admserv()
 {
    char pid[BIG_BUF];
    char startProgram[BIG_BUF];
@@ -419,17 +351,17 @@
    struct stat fi;
    int ret;
 
-   sprintf(pid, "%s/admin-serv/logs/pid", sroot);
+   sprintf(pid, "%s/%s", PIDDIR, PIDFILE);
 
    tmpnam(startLog);
 
    if (stat(pid, &fi) == 0)
    {
-      sprintf(startProgram, "%s/restart-admin > %s 2>&1", sroot, startLog);
+      sprintf(startProgram, "%s/restart-admin > %s 2>&1", CMDBINDIR, startLog);
    }
    else
    {
-      sprintf(startProgram, "%s/start-admin > %s 2>&1", sroot, startLog);
+      sprintf(startProgram, "%s/start-admin > %s 2>&1", CMDBINDIR, startLog);
    }
 
    ret = system(startProgram);
@@ -497,7 +429,7 @@
 */
 
 void
-admin_chown(const char *sroot, uid_t tuid, const char *tuser, gid_t tgid, const char *tgrp)
+admin_chown(const char *path, uid_t tuid, const char *tuser, gid_t tgid, const char *tgrp)
 {
    /*
     * Changing ownership is possible only if I am installing as
@@ -514,15 +446,14 @@
    /*
     * First, check to see who currently is the admin user
     */
-   sprintf(tmp, "%s/admin-serv", sroot);
-   stat(tmp, &fi);
+   stat(path, &fi);
 
    admin_uid = fi.st_uid;
    my_uid    = geteuid();
 
-   chown(sroot, tuid, tgid);
+   chown(path, tuid, tgid);
 
-   dir = opendir(sroot);
+   dir = opendir(path);
    while ((entry = readdir(dir)) != NULL)
    {
       if (strcmp(entry->d_name, ".") && strcmp(entry->d_name, "..") &&
@@ -533,9 +464,9 @@
             if ((my_uid == fi.st_uid || admin_uid == fi.st_uid) &&
                  tuid != fi.st_uid)
             {
-               sprintf(tmp, CHOWN_CMD, tuser, sroot);
+               sprintf(tmp, CHOWN_CMD, tuser, path);
                system(tmp);
-               sprintf(tmp, CHGRP_CMD, tgrp, sroot);
+               sprintf(tmp, CHGRP_CMD, tgrp, path);
                system(tmp);
             }
          }
@@ -562,7 +493,7 @@
 }    
 
 void
-create_admserv(char *hn, const char *sroot)
+create_admserv(char *hn)
 {
    char httpuser[SML_BUF], httppw[SML_BUF];
    char hosts[MED_BUF], addrs[MED_BUF];
@@ -573,8 +504,7 @@
    char SSgroup[SML_BUF];
    char ldapURL[MED_BUF];
    char apacheRoot[BIG_BUF];
-   char apacheDir[BIG_BUF];
-   char apacheBin[BIG_BUF];
+   char apache[BIG_BUF];
    char apacheVersion[BIG_BUF];
    struct stat st;
    NSString  hostip = InstUtil::getHostIpAddress(hn);
@@ -587,8 +517,6 @@
    NSString tmp;
    const char *adminBrand = "Fedora";
 
-   chdir(sroot);
-   
    if (NULL == adminInstallInfo) {
       fatal_error("Admin Info is not set or invalid.", "", "");
    }
@@ -606,30 +534,26 @@
    }
    strcpy(adminUser, s);
 
-   s = adminInstallInfo->get("ApacheDir");
+   s = adminInstallInfo->get("Apache");
    if (NULL == s) {
-      fatal_error("InstallInfo: Apache Directory \"ApacheDir\" is missing.", "", "");
+      fatal_error("InstallInfo: Apache path \"Apache\" is missing.", "", "");
    }
-   strcpy(apacheDir, s);
+   strcpy(apache, s);
 
    s = adminInstallInfo->get("ApacheRoot");
    if (!s) {
-	   NSString ar = findApacheRoot(apacheDir);
+	   NSString ar = findApacheRoot(apache);
 	   strcpy(apacheRoot, (const char *)ar);
    } else {
 	   strcpy(apacheRoot, s);
    }
 
-   snprintf(apacheBin, sizeof(apacheBin), "%s/httpd.worker", apacheDir);
-   if (stat(apacheBin, &st) != 0) {
-      snprintf(apacheBin, sizeof(apacheBin), "%s/httpd", apacheDir);
-      if (stat(apacheBin, &st) != 0) {
-         fatal_error("Can't find Apache in %s", apacheDir, NULL);
-      }
+   if (stat(apache, &st) != 0) {
+     fatal_error("Can't find Apache in %s", apache, NULL);
    }
 
    apacheVersion[0] = '\0';
-   tmp = findApacheVersion(apacheDir);
+   tmp = findApacheVersion(apache);
    if ((const char*)tmp) {
        strcpy(apacheVersion, (const char *)tmp);
    }
@@ -728,20 +652,19 @@
    }
    else
    {
-      installLog->logMessage(INFO, "Admin", "Writing configuration data to %s/admin-serv/config", sroot);
+      installLog->logMessage(INFO, "Admin", "Writing configuration data to %s", CONFIGDIR);
    }
 
-/* create alias subdirectory and cert.log file */
-   sprintf(dir, "%s%calias", sroot, PATH_DELIM);
+   /* create key/cert db dir */
    if ((mkdir(dir, 0750) == -1) && (errno != EEXIST))
    {
       fatal_error("Can't create directory %s (error: %s)", dir, system_errmsg());
    }
 
-   logUninstallInfo(sroot, "admin", "admin", dir);
+   logUninstallInfo(CONFIGDIR, "admin", "admin", dir);
 
    /* make sure the config directory is owned by the ssuser */
-   sprintf(tstr, "%s/admin-serv/config", sroot);
+   sprintf(tstr, "%s", CONFIGDIR);
    chown_file(SSuser, SSgroup, tstr);
 
    /*
@@ -749,7 +672,7 @@
     */
 /* MLM - this should actually do more httpconf type of stuff
  *       (maybe an admconf.c?) */
-   sprintf(tstr, "%s/admin-serv/config/admpw", sroot);
+   sprintf(tstr, "%s/admpw", CONFIGDIR);
    if (!(f = fopen(tstr, "w")))
    {
       fatal_error("Can't write to %s (error: %s)", tstr, system_errmsg());
@@ -760,59 +683,11 @@
    fclose(f);
    chmod(tstr, S_IRUSR | S_IWUSR);
    chown_file(SSuser, SSgroup, tstr);
-   logUninstallInfo(sroot, "admin", "admin", tstr);
-
-   /* create admin-serv/modules directory */
-   sprintf(dir, "%s%cadmin-serv%cmodules", sroot, PATH_DELIM, PATH_DELIM);
-   if ((mkdir(dir, 0750) == -1) && (errno != EEXIST))
-   {
-      fatal_error("Can't create directory %s (error: %s)", dir, system_errmsg());
-   }
-
-   logUninstallInfo(sroot, "admin", "admin", dir);
-
-#ifdef SHOW_CONFIG_FILES
-   if (installMode != Silent)
-      printf("Wrote %s\n", tstr);
-#endif
-
-   /*
-    * Write new LDAP local DB  default files
-    */
-   sprintf(tstr, "%s/%s", sroot, DEFAULT_LDAPSWITCH);
-   if (!(f = fopen(tstr, "w")))
-   {
-      fatal_error("Can't write to %s (error: %s)", tstr, system_errmsg());
-   }
-   if (ldapURL[0] == '\0')
-   {				/* No  external LDAP */
-      fatal_error("No LDAP server defined - exiting", NULL, NULL);
-   }
-   else
-   {				/* Use external LDAP */
-      fprintf(f, "directory default %s\n", ldapURL);
-   }
-   fclose(f);
-
-   logUninstallInfo(sroot, "admin", "admin", tstr);
-   chown_file(SSuser, SSgroup, tstr);
-
-   sprintf(tstr, "chmod 640 %s/%s", sroot, DEFAULT_LDAPSWITCH);
-   system(tstr);
+   logUninstallInfo(CONFIGDIR, "admin", "admin", tstr);
 
    hexp = make_shexp(hosts);
    aexp = make_shexp(addrs);
 
-   sprintf(tstr, "%s/%s", sroot, DEFAULT_SSUSERCONF);
-   if (!(f = fopen(tstr, "w")))
-      fatal_error("Can't write to %s (error: %s)", tstr,
-		  system_errmsg());
-   fprintf(f, "SuiteSpotUser\t%s\n", SSuser);
-   fprintf(f, "SuiteSpotGroup\t%s\n", SSgroup);
-   fclose(f);
-
-   logUninstallInfo(sroot, "admin", "admin", tstr);
-
    if (!geteuid())
    {
       /* Current pw ent, target pw ent */
@@ -837,7 +712,7 @@
 
       if (installMode == Interactive)
          printf("Changing ownership to admin user %s...\n", adminUser);
-      admin_chown(sroot, tuid, adminUser, tgid, tgp->gr_name);
+      admin_chown(CONFIGDIR, tuid, adminUser, tgid, tgp->gr_name);
 
 #ifdef HPUX
       /*
@@ -858,11 +733,9 @@
        * This is ok because running user is either root or part of the
        * SSgroup
        */
-      sprintf(tstr, SHARED_CHGRP_CMD, SSgroup, sroot);
-      system(tstr);
-      sprintf(tstr, SSCONF_CHGRP_CMD, SSgroup, sroot);
+      sprintf(tstr, SHARED_CHGRP_CMD, SSgroup, CONFIGDIR);
       system(tstr);
-      sprintf(tstr, SECALIAS_CHGRP_CMD, SSgroup, sroot);
+      sprintf(tstr, SECALIAS_CHGRP_CMD, SSgroup, CONFIGDIR);
       system(tstr);
    }
 
@@ -895,8 +768,10 @@
    LdapEntry *configEntry = new LdapEntry(&ldap);
 
    // Check if there's already an SIE for this Admin
-   sprintf(tstr, "%s/admin-serv/config/adm.conf", sroot);
-   NVPair admConf(tstr);
+   sprintf(tstr, "%s/adm.conf", CONFIGDIR);
+   NVPair admConf;
+   admConf.setFormat(2);
+   admConf.read(tstr);
 
    adminDomain = installInfo->get(DS_ADMIN_DOMAIN);
 
@@ -910,28 +785,7 @@
       }
    }
 
-   /*
-    * Generate pwd for the SIE
-    */
-
-/*
-   char password[9];
-
-   srand(getpid() + time(NULL));
-   for (int i = 0; i < 8 ; i++)
-   {
-      int charoff = rand() % 52;
-      if (charoff < 26)
-        password[i] = (char) charoff + 'A';
-      else
-        password[i] = (char) charoff - 26 + 'a';
-   }
-
-   password[8] = 0;
-
-*/
-
-   sprintf(tstr, "%s/%s/admin/admin.inf", sroot, SETUP_DIR);
+   sprintf(tstr, "%s/%s/admin/admin.inf", CONFIGDIR, SETUP_DIR);
    NVPair adminInf(tstr);
    NVPair *adminInfo = adminInf.getSection("admin");
 
@@ -947,7 +801,7 @@
    appEntry->addAttribute("nsProductVersion", adminInfo->get(PKG_VERSION));
    appEntry->addAttribute("nsBuildNumber", adminInfo->get(PKG_BUILDNUMBER));
    appEntry->addAttribute("nsRevisionNumber", adminInfo->get(PKG_REVISION));
-   appEntry->addAttribute("nsInstalledLocation", sroot);
+   appEntry->addAttribute("nsInstalledLocation", CONFIGDIR);
 
    adminInfo->stampTime();
    appEntry->addAttribute("installationTimeStamp", adminInfo->timeStamp());
@@ -996,10 +850,10 @@
    sieEntry->addAttribute("nsServerId", "admin-serv");
    sieEntry->addAttribute("userPassword", httppw);
    sieEntry->addAttribute("serverHostName", hn);
-   sieEntry->addAttribute("serverRoot", sroot);
+   sieEntry->addAttribute("serverRoot", CONFIGDIR);
    sieEntry->addAttribute("serverProductName", "Administration Server");
 
-   ldapError = createSIE(sieEntry, appEntry, hn, sroot, adminDomain, adminBrand);
+   ldapError = createSIE(sieEntry, appEntry, hn, CONFIGDIR, adminDomain, adminBrand);
 
    sieDN = sieEntry->entryDN();
    isieDN = appEntry->entryDN();
@@ -1099,72 +953,26 @@
     *  Write Tasks node
     */
 
-   configTasks(&ldap, sroot, sieDN);
+   configTasks(&ldap, DATADIR, sieDN);
 
    // Write global configuration paramters
-
-   sprintf(tstr, "%s/shared/config/ds.conf", sroot);
-   if (!(f = fopen(tstr,"w")))
-   {
-      printf("Warning - Can't write to %s (error: %s)", tstr, system_errmsg());
-   }
-   else
-   {
-      fprintf(f, "%s:%s\n", DS_ADMIN_DOMAIN, adminDomain.data());
-      logUninstallInfo(sroot, "admin", "admin", tstr);
-   }
-
    char *adminDomainDN;
    adminDomainDN = formAdminDomainDN(adminDomain);
-   configGlobalParameters(&ldap, sroot, adminDomainDN);
+   configGlobalParameters(&ldap, DATADIR, adminDomainDN);
    nsSetupFree (adminDomainDN);
 
    /*
     ***************************************************************
-    * Fix ACIs under o=netscapeRoot
-    ***************************************************************
-    */
-   /*ldapError = repair_group_expansion_aci(&ldap);
-   if (ldapError != OKAY)
-   {
-      sprintf(dir, "%d", ldapError.errorCode());
-      fatal_error("ERROR: cannot modify root ACIs (%s:%s)", dir, ldapError.msg()); 
-   }*/
-
-   /*ldapError = set_locate_admserv_aci(&ldap);
-   if (ldapError != OKAY)
-   {
-      sprintf(dir, "%d", ldapError.errorCode());
-      fatal_error("ERROR: cannot modify root ACIs (%s:%s)", dir, ldapError.msg()); 
-   }*/
-
-   /*
-    ***************************************************************
     * Write new adm.conf (new for Admin40)
     ***************************************************************
     */
-
-   LDAPURLDesc *ludpp = NULL;
-   ldap_url_parse((char *) installInfo->get(CONFIG_LDAP_URL), &ludpp);
-
-/* 
-
-   fprintf(f, "ldapHost: %s\n", ludpp->lud_host);
-   fprintf(f, "ldapPort: %d\n", ludpp->lud_port);
-   fprintf(f, "sie: %s\n", sieDN.data());
-   fprintf(f, "userdn: %s\n", ldap.rebindDN());
-   fprintf(f, "isie: %s\n", isieDN.data());
-   fprintf(f, "port: %d\n", port);
-   fclose(f);
-
-*/
-
-   admConf.set("ldapHost",  ludpp->lud_host);
-   admConf.set("ldapPort",  (unsigned long)ludpp->lud_port);
+   admConf.set("ldapurl", installInfo->get(CONFIG_LDAP_URL));
    admConf.set("sie", sieDN.data());
    admConf.set("userdn", ldap.rebindDN());
    admConf.set("isie", isieDN.data());
-   admConf.set("port",  (unsigned long)port);
+   admConf.set("sysuser", SSuser);
+   admConf.set("sysgroup", SSgroup);
+   admConf.set(DS_ADMIN_DOMAIN, adminDomain.data());
 
    if (ldapStart == NULL)
    {
@@ -1189,26 +997,26 @@
       admConf.set("ldapStart", ldapStart);
    }
 
-   sprintf(tstr, "%s/admin-serv/config/adm.conf", sroot);
+   sprintf(tstr, "%s/adm.conf", CONFIGDIR);
 
    admConf.setFormat(2);
    admConf.write(tstr);
    chmod(tstr, S_IRUSR | S_IWUSR);
    chown_file(SSuser, SSgroup, tstr);
-   logUninstallInfo(sroot, "admin", "admin", tstr);
+   logUninstallInfo(CONFIGDIR, "admin", "admin", tstr);
 
    // Mark to remove the following guys which are
    // created later on also
-   sprintf(tstr, "%s/admin-serv/config/local.conf", sroot);
-   logUninstallInfo(sroot, "admin", "admin", tstr);
-   sprintf(tstr, "%s/admin-serv/logs/access", sroot);
-   logUninstallInfo(sroot, "admin", "admin", tstr);
-   sprintf(tstr, "%s/admin-serv/logs/error", sroot);
-   logUninstallInfo(sroot, "admin", "admin", tstr);
-   sprintf(tstr, "%s/admin-serv/logs/admpw.log", sroot);
-   logUninstallInfo(sroot, "admin", "admin", tstr);
-   sprintf(tstr, "%s/admin-serv/logs/dsconfig.log", sroot);
-   logUninstallInfo(sroot, "admin", "admin", tstr);
+   sprintf(tstr, "%s/local.conf", CONFIGDIR);
+   logUninstallInfo(CONFIGDIR, "admin", "admin", tstr);
+   sprintf(tstr, "%s/access", LOGDIR);
+   logUninstallInfo(CONFIGDIR, "admin", "admin", tstr);
+   sprintf(tstr, "%s/error", LOGDIR);
+   logUninstallInfo(CONFIGDIR, "admin", "admin", tstr);
+   sprintf(tstr, "%s/admpw.log", LOGDIR);
+   logUninstallInfo(CONFIGDIR, "admin", "admin", tstr);
+   sprintf(tstr, "%s/dsconfig.log", LOGDIR);
+   logUninstallInfo(CONFIGDIR, "admin", "admin", tstr);
 
    /* PVO remember to set access permission here */
 
@@ -1221,118 +1029,104 @@
    char **restartarray = (char **)malloc(3*sizeof(char *)); /* 1 token, 1 replacement, NULL terminated */
 
    char src[BIG_BUF];
-   char instance[BIG_BUF];
 
-   snprintf(instance, sizeof(instance), "%s-%s", "admin-serv", hn);
-   ss = strchr(instance, '.');
-   if (ss) *ss = 0;
 
    httparray[0] = "%%%sroot%%%";
-   httparray[1] = (char *)sroot;
+   httparray[1] = (char *)CONFIGDIR;
    httparray[2] = "%%%module_dir%%%";
    httparray[3] = (char *)apacheRoot;
    httparray[4] = NULL;
 
    admservarray[0] = "%%%sroot%%%";
-   admservarray[1] = (char *)sroot;
+   admservarray[1] = (char *)CONFIGDIR;
    admservarray[2] = NULL;
 
    nssarray[0] = "%%%sroot%%%";
-   nssarray[1] = (char *)sroot;
+   nssarray[1] = (char *)CONFIGDIR;
    nssarray[2] = NULL;
 
    consolearray[0] = "%%%sroot%%%";
-   consolearray[1] = (char *)sroot;
+   consolearray[1] = (char *)CONFIGDIR;
    consolearray[2] = "%%%httpduser%%%";
    consolearray[3] = (char *)SSuser;
    consolearray[4] = "%%%httpdgroup%%%";
    consolearray[5] = (char *)SSgroup;
    consolearray[6] = "%%%httpport%%%";
    consolearray[7] = (char *)dir; /* sprint'd earlier */
-   consolearray[8] = "%%%instancename%%%";
-   consolearray[9] = (char *)instance;
-   consolearray[10] = NULL;
+   consolearray[8] = NULL;
 
    startarray[0] = "%%%sroot%%%";
-   startarray[1] = (char *)sroot;
+   startarray[1] = (char *)CONFIGDIR;
    startarray[2] = "%%%httpd%%%";
-   startarray[3] = (char *)apacheBin;
+   startarray[3] = (char *)apache;
    startarray[4] = NULL;
 
    stoparray[0] = "%%%sroot%%%";
-   stoparray[1] = (char *)sroot;
+   stoparray[1] = (char *)CONFIGDIR;
    stoparray[2] = NULL;
 
    restartarray[0] = "%%%sroot%%%";
-   restartarray[1] = (char *)sroot;
+   restartarray[1] = (char *)CONFIGDIR;
    restartarray[2] = NULL;
 
    if (0 == strncmp(apacheVersion, "2.2", 3)) {
-       snprintf(src, sizeof(tstr), "%s/shared/config/template/httpd-2.2.conf.tmpl", sroot);
+       snprintf(src, sizeof(tstr), "%s/template/httpd-2.2.conf.tmpl", CONFIGDIR);
    } else {
-       snprintf(src, sizeof(tstr), "%s/shared/config/template/httpd.conf.tmpl", sroot);
+       snprintf(src, sizeof(tstr), "%s/template/httpd.conf.tmpl", CONFIGDIR);
    }
-   snprintf(tstr, sizeof(tstr), "%s/admin-serv/config/httpd.conf", sroot);
+   snprintf(tstr, sizeof(tstr), "%s/httpd.conf", CONFIGDIR);
    replaceTokensInFile(src, tstr, httparray);
    chmod(tstr, S_IRUSR | S_IWUSR);
-   logUninstallInfo(sroot, "admin", "admin", tstr);
+   logUninstallInfo(CONFIGDIR, "admin", "admin", tstr);
 
-   snprintf(tstr, sizeof(tstr), "%s/admin-serv/config/admserv.conf", sroot);
-   snprintf(src, sizeof(tstr), "%s/shared/config/template/admserv.conf.tmpl", sroot);
+   snprintf(tstr, sizeof(tstr), "%s/admserv.conf", CONFIGDIR);
+   snprintf(src, sizeof(tstr), "%s/template/admserv.conf.tmpl", CONFIGDIR);
    replaceTokensInFile(src, tstr, admservarray);
    chmod(tstr, S_IRUSR | S_IWUSR);
-   logUninstallInfo(sroot, "admin", "admin", tstr);
+   logUninstallInfo(CONFIGDIR, "admin", "admin", tstr);
 
-   snprintf(tstr, sizeof(tstr), "%s/admin-serv/config/nss.conf", sroot);
-   snprintf(src, sizeof(tstr), "%s/shared/config/template/nss.conf.tmpl", sroot);
+   snprintf(tstr, sizeof(tstr), "%s/nss.conf", CONFIGDIR);
+   snprintf(src, sizeof(tstr), "%s/template/nss.conf.tmpl", CONFIGDIR);
    replaceTokensInFile(src, tstr, nssarray);
    chmod(tstr, S_IRUSR | S_IWUSR);
    chown_file(SSuser, SSgroup, tstr);
-   logUninstallInfo(sroot, "admin", "admin", tstr);
+   logUninstallInfo(CONFIGDIR, "admin", "admin", tstr);
 
-   snprintf(tstr, sizeof(tstr), "%s/admin-serv/config/console.conf", sroot);
+   snprintf(tstr, sizeof(tstr), "%s/console.conf", CONFIGDIR);
    /*
      all of the dynamic information goes into console.conf, so we should
      not overwrite that information during an upgrade */
    if (stat(tstr, &st)) {
-      snprintf(src, sizeof(tstr), "%s/shared/config/template/console.conf.tmpl", sroot);
+      snprintf(src, sizeof(tstr), "%s/template/console.conf.tmpl", CONFIGDIR);
       replaceTokensInFile(src, tstr, consolearray);
       chmod(tstr, S_IRUSR | S_IWUSR);
       chown_file(SSuser, SSgroup, tstr);
-      logUninstallInfo(sroot, "admin", "admin", tstr);
+      logUninstallInfo(CONFIGDIR, "admin", "admin", tstr);
    }
 
-   snprintf(tstr, sizeof(tstr), "%s/start-admin", sroot);
-   snprintf(src, sizeof(tstr), "%s/shared/config/template/start-admin.tmpl", sroot);
+   snprintf(tstr, sizeof(tstr), "%s/start-admin", CONFIGDIR);
+   snprintf(src, sizeof(tstr), "%s/template/start-admin.tmpl", CONFIGDIR);
    replaceTokensInFile(src, tstr, startarray);
    chmod(tstr, 0755);
-   logUninstallInfo(sroot, "admin", "admin", tstr);
+   logUninstallInfo(CONFIGDIR, "admin", "admin", tstr);
 
-   snprintf(tstr, sizeof(tstr), "%s/stop-admin", sroot);
-   snprintf(src, sizeof(tstr), "%s/shared/config/template/stop-admin.tmpl", sroot);
+   snprintf(tstr, sizeof(tstr), "%s/stop-admin", CONFIGDIR);
+   snprintf(src, sizeof(tstr), "%s/template/stop-admin.tmpl", CONFIGDIR);
    replaceTokensInFile(src, tstr, stoparray);
    chmod(tstr, 0755);
-   logUninstallInfo(sroot, "admin", "admin", tstr);
+   logUninstallInfo(CONFIGDIR, "admin", "admin", tstr);
 
-   snprintf(tstr, sizeof(tstr), "%s/restart-admin", sroot);
-   snprintf(src, sizeof(tstr), "%s/shared/config/template/restart-admin.tmpl", sroot);
+   snprintf(tstr, sizeof(tstr), "%s/restart-admin", CONFIGDIR);
+   snprintf(src, sizeof(tstr), "%s/template/restart-admin.tmpl", CONFIGDIR);
    replaceTokensInFile(src, tstr, restartarray);
    chmod(tstr, 0755);
-   logUninstallInfo(sroot, "admin", "admin", tstr);
+   logUninstallInfo(CONFIGDIR, "admin", "admin", tstr);
    
-   sprintf(tstr, "%s/java/jars", sroot);
-   chmod(tstr, 0755);
-
-   sprintf(tstr, "%s/bin/admin/admconfig", sroot);
-   chmod(tstr, 0755);
-
-   sprintf(tstr, "%s/uninstall", sroot);
-   chmod(tstr, 0750);
 
    {
       // Generating local.conf
       int error_code = 0;
-      snprintf(tstr, sizeof(tstr), "%s/admin-serv/config", sroot);
+      snprintf(tstr, sizeof(tstr), "%s", CONFIGDIR);
       PsetHndl pset = psetCreate("admin-serv", (char *)tstr,
                                  (char *)ldap.rebindDN(), httppw,
                                  &error_code);
@@ -1340,18 +1134,6 @@
 }
 
 
-int
-update_schema(const char *sroot)
-{
-  char schema_file[BIG_BUF];
-  
-  sprintf(schema_file, "%s/setup/admin/ns-common-schema.conf", sroot);
-  return setupInsertPluginSchemaEntries(installInfo->get(CONFIG_LDAP_URL),
-					installInfo->get(MC_ADMIN_ID),
-					installInfo->get(MC_ADMIN_PWD),
-					schema_file);
-}
-
 /*
  * 359259: Add ACIs under o=netscapeRoot to allow regular, non-admin users to
  * locate admin servers. This is required for downloads of jars referenced from
@@ -1560,7 +1342,6 @@
 main(int argc, char *argv[])
 {
    char hn[SML_BUF];
-   const char *sroot;
    struct stat fi;
    int opt;
 
@@ -1622,7 +1403,6 @@
 
    // Some additional checking in case
    if (installInfo->get(MACHINE_NAME) == NULL ||
-       installInfo->get(SERVER_ROOT) == NULL ||
        installInfo->get(CONFIG_LDAP_URL) == NULL ||
        installInfo->get(MC_ADMIN_ID) == NULL ||
        installInfo->get(MC_ADMIN_PWD) == NULL ||
@@ -1645,17 +1425,6 @@
 
    hn[0] = '\0';
 
-   if (stat(DEFAULT_ADMINCONF, &fi) == 0)
-   {
-      // PVO - already configured
-      // Probably should check DS instead
-   }
-
-   sroot = installInfo->get(SERVER_ROOT);
-   if (NULL == sroot) {
-      fatal_error("InstallInfo: Server Root \"ServerRoot\" is missing.", "", "");
-   }
-
    /*
     * Get the full hostname.
     */
@@ -1666,15 +1435,9 @@
    }
    strcpy(hn, machine_name);
 
-   cleanup_after_upgrade(sroot);
-
-   create_admserv(hn, sroot);
-
-#ifdef NEED_ADMIN_SERVER_IN_SERVERS_LIST
-   addToServerList(sroot);
-#endif
+   create_admserv(hn);
 
-   start_admserv(sroot);
+   start_admserv();
 
    installLog->logMessage(SUCCESS, "Admin", "Administration Server post-configuration");
 




More information about the Fedora-directory-commits mailing list