Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/admin/src
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv15347
Modified Files:
create_instance.c
Log Message:
Resolves: #214840
Summary: modify sasl_path to accept the string set in the inf file
Changes:
If sasl_path is set in [slapd] section in the inf file, it's put in dse.ldif
like this:
dn: cn=config
[...]
nsslapd-saslpath: /usr/local/lib
If the inf file does not have the line, the default path
<prefix>/usr/lib/<brand_ds>/sasl2 is put in dse.ldif on non-Linux platform.
Index: create_instance.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/create_instance.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- create_instance.c 6 Nov 2006 19:33:41 -0000 1.33
+++ create_instance.c 9 Nov 2006 18:24:52 -0000 1.34
@@ -305,18 +305,20 @@
conf->disable_schema_checking = NULL;
conf->install_ldif_file = NULL;
- conf->sysconfdir = NULL;
+ conf->bak_dir = NULL;
+ conf->config_dir = NULL;
conf->datadir = NULL;
+ conf->db_dir = NULL;
conf->docdir = NULL;
conf->inst_dir = NULL;
- conf->config_dir = NULL;
- conf->schema_dir = NULL;
+ conf->ldif_dir = NULL;
conf->lock_dir = NULL;
conf->log_dir = NULL;
+ conf->plugin_dir = NULL;
conf->run_dir = NULL;
- conf->db_dir = NULL;
- conf->bak_dir = NULL;
- conf->ldif_dir = NULL;
+ conf->sasl_path = NULL;
+ conf->schema_dir = NULL;
+ conf->sysconfdir = NULL;
conf->tmp_dir = NULL;
}
@@ -2342,7 +2344,6 @@
t = CREATE_DB2BAK();
if(t) return t;
-#if defined(UPGRADEDB)
t = gen_script(cs_path, "db2index.bat",
"@echo off\n"
"setlocal\n"
@@ -2375,7 +2376,6 @@
"exit /b %%rc%%\n",
server, cs_path, server, cs_path, server, cs_path);
if(t) return t;
-#endif
t = gen_script(cs_path, "vlvindex.bat",
"@echo off\n"
@@ -2431,7 +2431,6 @@
server, cs_path, server, cs_path);
if(t) return t;
-#if defined(UPGRADEDB)
t = gen_script(cs_path, "upgradedb.bat",
"@echo off\n"
"setlocal\n"
@@ -2455,7 +2454,6 @@
"exit /b %%rc%%\n",
server, cs_path, server, cs_path);
if(t) return t;
-#endif
t = CREATE_BAK2DB();
if(t) return t;
@@ -2701,9 +2699,9 @@
fprintf(f, "nsslapd-tmpdir: %s\n", cf->tmp_dir);
fprintf(f, "nsslapd-certdir: %s\n", cf->cert_dir);
/* We use the system SASL by default on Linux, so we don't need to set sasl path */
-#if !defined( LINUX )
- fprintf(f, "nsslapd-saslpath: %s\n", cf->sasl_path);
-#endif
+ if (NULL != cf->sasl_path) {
+ fprintf(f, "nsslapd-saslpath: %s\n", cf->sasl_path);
+ }
fprintf(f, "nsslapd-accesslog-logging-enabled: on\n");
fprintf(f, "nsslapd-accesslog-maxlogsperdir: 10\n");
fprintf(f, "nsslapd-accesslog-mode: 600\n");
@@ -3412,13 +3410,11 @@
fprintf(f, "cn: restore\n");
fprintf(f, "\n");
-#if defined(UPGRADEDB)
fprintf(f, "dn: cn=upgradedb,cn=tasks,cn=config\n");
fprintf(f, "objectclass: top\n");
fprintf(f, "objectclass: extensibleObject\n");
fprintf(f, "cn: upgradedb\n");
fprintf(f, "\n");
-#endif
/* END of tasks */
@@ -4347,7 +4343,20 @@
cf->sroot = PR_smprintf("%s%cusr%clib%c%s",
prefix, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, cf->brand_ds);
- cf->sasl_path = PR_smprintf("%s%csasl2", cf->sroot, FILE_PATHSEP);
+ temp = ds_a_get_cgi_var("sasl_path", NULL, NULL);
+ if (NULL != temp) {
+ /* if sasl_path is given, we set it in the conf file regardless of
+ * the platform. */
+ cf->sasl_path = PL_strdup(temp);
+ }
+#if !defined( LINUX )
+ /* if not linux, we package sasl2 with DS,
+ and always set it in the conf file. */
+ else
+ {
+ cf->sasl_path = PR_smprintf("%s%csasl2", cf->sroot,
FILE_PATHSEP);
+ }
+#endif
cf->plugin_dir = PR_smprintf("%s%cplugins", cf->sroot,
FILE_PATHSEP);
if (!(cf->servname = ds_a_get_cgi_var("servname", "Server
Name",