[Fedora-directory-commits] adminserver Makefile,1.16,1.17
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/adminserver
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv16896/adminserver
Modified Files:
Makefile
Log Message:
It's a little bit tricky. The base package is a dependency of both the main admin server package and the directory server package. However, it works if you just create a zero length .zip file for the base archive - you get a warning when running setup, but everything installs correctly. While it's not perfect (it will be addressed for the next major release) it will at least allow those developers who do not want to use java at all to build and install.
You must use "make NOJAVA=1 ..." to build and package admin server without java.
Index: Makefile
===================================================================
RCS file: /cvs/dirsec/adminserver/Makefile,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- Makefile 3 Nov 2005 23:20:38 -0000 1.16
+++ Makefile 18 Jan 2006 18:24:14 -0000 1.17
@@ -30,6 +30,14 @@
include nsconfig.mk
include components.mk
+PACKAGEDEPS = start_time
+
+ifndef NOJAVA
+PACKAGEDEPS += ldapjdk nmcjdk jsssdk jsslib
+endif
+
+PACKAGEDEPS += pkgBase pkgAdmin pkgMcc end_time
+
all: buildAndPkgAdmin
buildAndPkgAdmin: buildOxygen pkgOxygen
@@ -38,16 +46,18 @@
@echo
@echo The following are build targets that you can choose from:
@echo
- @echo " gmake buildAndPkgAdmin (the default if no targets are given)"
- @echo " gmake buildAdmin"
- @echo " gmake buildOxygen"
- @echo " gmake buildConsole"
- @echo " gmake pkgAdmin"
- @echo " gmake pkgOxygen"
- @echo " gmake pkgConsole"
- @echo " gmake pkgL10NOxygen"
- @echo " gmake docConsole"
- @echo " gmake acceptAdmin"
+ @echo " $(MAKE) buildAndPkgAdmin (the default if no targets are given)"
+ @echo " $(MAKE) buildAdmin"
+ @echo " $(MAKE) buildOxygen"
+ @echo " $(MAKE) buildConsole"
+ @echo " $(MAKE) pkgAdmin"
+ @echo " $(MAKE) pkgOxygen"
+ @echo " $(MAKE) pkgConsole"
+ @echo " $(MAKE) pkgL10NOxygen"
+ @echo " $(MAKE) docConsole"
+ @echo " $(MAKE) acceptAdmin"
+ @echo ""
+ @echo Use $(MAKE) NOJAVA=1 to skip building/packaging any Java (console or command line) code
pumpkin:
$(PERL) pumpkin.pl $(PUMPKIN_AGE) pumpkin.dat
@@ -211,7 +221,7 @@
@echo
@echo ============== Finished ============================
-pkgOxygen:start_time ldapjdk nmcjdk jsssdk jsslib pkgBase pkgAdmin pkgMcc end_time
+pkgOxygen: $(PACKAGEDEPS)
@echo
@echo
@echo
17 years, 2 months
[Fedora-directory-commits] adminserver/admserv/cfgstuff httpd.conf, 1.7, 1.8
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/adminserver/admserv/cfgstuff
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12838
Modified Files:
httpd.conf
Log Message:
bug 175170
mod_nss needs to be loaded before mod_admserv so it can complete
NSS_Initialize before mod_admserv needs to use NSS and SSL. This
also means mod_nss will be unloaded after mod_admserv, which means
it can clear the caches and do the NSS_Shutdown after mod_admserv
is unloaded.
Index: httpd.conf
===================================================================
RCS file: /cvs/dirsec/adminserver/admserv/cfgstuff/httpd.conf,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- httpd.conf 7 Dec 2005 20:46:06 -0000 1.7
+++ httpd.conf 18 Jan 2006 16:58:37 -0000 1.8
@@ -148,8 +148,8 @@
LoadModule mem_cache_module %%%module_dir%%%/modules/mod_mem_cache.so
LoadModule cgi_module %%%module_dir%%%/modules/mod_cgi.so
LoadModule restartd_module %%%sroot%%%/bin/admin/lib/libmodrestartd.so
-LoadModule admserv_module %%%sroot%%%/bin/admin/lib/libmodadmserv.so
LoadModule nss_module %%%sroot%%%/bin/admin/lib/libmodnss.so
+LoadModule admserv_module %%%sroot%%%/bin/admin/lib/libmodadmserv.so
### Section 2: 'Main' server configuration
#
17 years, 2 months
[Fedora-directory-commits] mod_admserv mod_admserv.c,1.18,1.19
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/mod_admserv
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv13185
Modified Files:
mod_admserv.c
Log Message:
Bug(s) fixed: 175170
Bug Description: Directory Server Admin Server Dies after Secure Bind to Directory Server
Reviewed by: Rob C. (Thanks!)
Files: mod_admserv.c
Branch: HEAD
Fix Description: This fix makes the assumption that mod_nss will always be used. It is possible to use mod_admserv without mod_nss - this would mean that the admin server accepts http, but uses ldaps to communicate with the DS. However, I don't forsee that happening, so in order to simplify things, this fix makes mod_nss resposible for initializing NSS and shutting it down properly.
Another problem was the memory and resource leaks. pset's have to be disposed of after use. This appears to have been a problem in the old NES libAdmservPlugin as well since most of the code was just copied/pasted. There were also a couple of other memory leaks.
NOTE: This is only part of the total fix, which will involve changes to mod_nss, ldap sdk, and admin server components.
Platforms tested: FC4
Flag Day: no
Doc impact: no
Index: mod_admserv.c
===================================================================
RCS file: /cvs/dirsec/mod_admserv/mod_admserv.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- mod_admserv.c 18 Nov 2005 21:18:42 -0000 1.18
+++ mod_admserv.c 18 Jan 2006 02:26:25 -0000 1.19
@@ -16,7 +16,11 @@
/*
* mod_admserv.c: Provides communication link between Console and Directory.
*
+ * Authors (in alphabetical order)
* Rob Crittenden
+ * Miodrag Kekic
+ * Rich Megginson
+ * Adam Prishtina
*
*/
@@ -736,76 +740,19 @@
return TRUE;
}
-static int onlyOnceSwitch = 0;
-
-#if defined(WINNT)
-static char const prefixMask[] = "\\alias\\%s-";
-static char const secmodName[] = "\\alias\\secmod.db";
-#else
-static char const prefixMask[] = "/alias/%s-";
-static char const secmodName[] = "/alias/secmod.db";
-#endif
-
static int
-sslinit(AdmldapInfo info, char const * svrroot, int forceInit)
+sslinit()
{
- int rc = PR_FALSE;
-
- if (onlyOnceSwitch) {
- rc = PR_TRUE;
+ if (!NSS_IsInitialized()) {
+ ap_log_error(APLOG_MARK, APLOG_CRIT, 0 /* status */, NULL,
+ "sslinit: mod_nss has not been started and initialized: cannot start server");
+ exit(1);
} else {
- char * x;
- /*
- * Usually one would find that the path to the cert and key db
- * is alias/admin-serv-hostname- but one can not assume that
- * to be the case. Thus we must disassemble the SIEDN to find
- * the instance's actual name.
- */
- x = admldapGetSIEDN(info);
- if (x) {
- if (x[0]) {
- int i;
- for (i=1; x[i] && !(x[i] == '=' && x[i-1] != '\\'); ++i); /* scan past attr name */
- if (x[i] == '=') {
- char * sie;
- for (++i; x[i] && x[i] == ' '; ++i); /* drop value's leading spaces */
- sie = &x[i];
- for ( ; x[i] && !(x[i] == ',' && x[i-1] != '\\'); ++i); /* till end of value */
- if (x[i] == ',') {
- char * scratch;
- for (x[i--] = 0; x[i] == ' '; --i) x[i] = 0; /* drop value's trailing spaces */
- scratch = (char *) malloc(sizeof(prefixMask) + strlen(sie));
- if (scratch) {
- sprintf(scratch, prefixMask, sie);
- if (SECSuccess == NSS_Initialize(serverroot, scratch, scratch, secmodName, 0)) {
- if (SSL_OptionSetDefault(SSL_ENABLE_SSL2, PR_FALSE)
- || SSL_OptionSetDefault(SSL_ENABLE_SSL3, PR_TRUE)) {
- ap_log_error(APLOG_MARK, APLOG_ERR, 0 /* status */, NULL,
- "Failed to enable SSL3 and disable SSL2");
- } else {
- if (SSLPLCY_Install() == PR_SUCCESS) {
- onlyOnceSwitch = 1;
- rc = PR_TRUE;
- } else {
- ap_log_error(APLOG_MARK, APLOG_ERR, 0 /* status */, NULL,
- "SSLPLCY_Install() failed.");
- }
- }
- } else {
- ap_log_error(APLOG_MARK, APLOG_CRIT, 0 /* status */, NULL,
- "Failed to do NSS_Initialize using path %s and prefix %s",
- serverroot, scratch);
- }
- free((void *) scratch);
- }
- }
- }
- }
- free((void *) x);
- }
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0 /* status */, NULL,
+ "sslinit: mod_nss has been started and initialized");
}
- return rc;
+ return 1;
}
static int
@@ -838,7 +785,7 @@
}
if (admldapGetSecurity(info)) {
- sslinit(info, serverroot, PR_FALSE);
+ sslinit();
if (admldapBuildInfoSSL(info, &error)) {
} else {
char *host = admldapGetHost(info);
@@ -1109,6 +1056,9 @@
int errorcode;
char* serverid = psetGetAttrSingleValue(tmp, SERVER_ID_ATTRIBUTE, &errorcode);
+ psetDelete(tmp);
+ tmp = NULL;
+
if (!serverid) {
ap_log_error(APLOG_MARK, APLOG_WARNING, 0, NULL,
"sync_task_sie_data: Unable to find serverid for dn=\"%s\" (error code = %d)",
@@ -1117,6 +1067,7 @@
}
task_register_server(serverid, serverlist[i]);
+ PL_strfree(serverid);
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, NULL,
"sync_task_sie_data: registered server [%s] dn [%s]",
serverid, serverlist[i]);
@@ -1127,6 +1078,7 @@
serverlist[i], errorCode);
}
}
+ deleteAttrNameList(serverlist);
} else {
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, NULL,
"sync_task_sie_data: no servers found");
@@ -1146,6 +1098,7 @@
productID, productDN);
ii++;
}
+ deleteAttributeList(installlist);
}
destroyAdmldap(ldapInfo);
@@ -1342,9 +1295,11 @@
}
if (admldapGetSecurity(ldapInfo)) {
- sslinit(ldapInfo, serverroot, PR_FALSE);
+ sslinit();
}
+ destroyAdmldap(ldapInfo);
+
binddn = apr_table_get(r->notes, RQ_NOTES_USERDN);
bindpw = apr_table_get(r->notes, RQ_NOTES_USERPW);
@@ -1363,15 +1318,15 @@
}
errorCode = psetSetSingleValueAttr(pset, (char*)"userpassword", pwd);
+ psetDelete(pset);
+ pset = NULL;
if (errorCode) {
- psetDelete(pset);
ap_log_rerror(APLOG_MARK, APLOG_CRIT, 0, r,
"PSET Set Failed for attribute userpassword, err=%d",
errorCode);
return 0;
}
- psetDelete(pset);
return 1;
}
@@ -1977,16 +1932,18 @@
}
if (admldapGetSecurity(info)) {
- sslinit(info, serverroot, PR_FALSE);
+ sslinit();
if (admldapBuildInfoSSL(info, &error)) {
} else {
ap_log_error(APLOG_MARK, APLOG_CRIT, 0, base_server,
"host_ip_init(): unable to create secure AdmldapInfo (error code = %d)",
error);
+ destroyAdmldap(info);
return DONE;
}
}
+ destroyAdmldap(info);
#ifdef CHANGE_EUID
/* make sure pset creates the cache file owned by the server uid, not root */
if (geteuid() == 0) {
@@ -2021,12 +1978,15 @@
ap_log_error(APLOG_MARK, APLOG_CRIT, 0, base_server,
"host_ip_init(): PSET failure: Could not retrieve access hosts attribute (pset error = %s)",
psetErrorString(error, NULL));
+ psetDelete(pset);
return DONE;
}
accessHosts = apr_pstrdup(module_pool, val);
val = psetGetAttrSingleValue(pset, NS_ADMIN_ACCESS_ADDRESSES, &error);
+ psetDelete(pset);
+ pset = NULL;
if(val) {
} else {
ap_log_error(APLOG_MARK, APLOG_CRIT, 0, base_server,
@@ -2121,6 +2081,17 @@
}
/*
+ * NSS caches SSL client session information - this cache must be cleared, otherwise
+ * NSS_Shutdown will give an error. mod_nss also does this (along with the NSS_Shutdown)
+ * It is ok to call SSL_ClearSessionCache multiple times.
+ */
+static
+apr_status_t mod_admserv_unload(void *data)
+{
+ SSL_ClearSessionCache();
+}
+
+/*
* This is where we do the rest of our initialization, that depends
* on configuration settings
*/
@@ -2141,6 +2112,12 @@
auth_users = HashTableCreate();
auth_tasks = HashTableCreate();
+ /*
+ * Let us cleanup on restarts and exists
+ */
+ apr_pool_cleanup_register(p, base_server,
+ mod_admserv_unload,
+ apr_pool_cleanup_null);
/* if nsroot was not set in the config, get from the environment */
srv_cfg = our_sconfig(base_server);
@@ -2482,17 +2459,6 @@
apr_table_set(r->notes, RQ_NOTES_USERDN, userdn);
apr_table_set(r->notes, AUTHENTICATION_LDAP_URL, ldapURL = formLdapURL(data, r->pool));
apr_table_set(r->notes, RQ_NOTES_USERPW, pw);
-#if 0
- pblock_nvinsert("userdn", userdn, rq->vars);
- pblock_nvinsert("auth-type", "basic", rq->vars);
- pblock_nvinsert("auth-password", pw, rq->vars);
- if (uid) pblock_nvinsert("auth-user", uid, rq->vars);
- pblock_nvinsert(AUTHENTICATION_LDAP_URL, ldapURL = formLdapURL(data, r->p), rq->vars);
- if (pw_expiring >= 0) {
- sprintf(pw_expiring_str, "%d", pw_expiring);
- pblock_nvinsert("auth-password-expire", pw_expiring_str, rq->vars);
- }
-#endif
create_auth_users_cache_entry(user, userdn, pw, ldapURL);
@@ -2562,15 +2528,7 @@
/* That failed too. The last resort is to fall back to the standard
* Apache basic-auth using admpw.
- */
-
-#if 0
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, r,
- "dn is %s", dn);
- apr_table_set(r->notes, RQ_NOTES_USERDN, dn);
- apr_table_set(r->notes, RQ_NOTES_USERPW, sent_pw);
-#endif
-
+ */
return DECLINED;
}
@@ -2644,7 +2602,7 @@
* be set in admserv.conf (or httpd.conf)
*/
if (!string) {
-#define ADMSERV_VERSION_STRING "Fedora-Administrator/7.0"
+#define ADMSERV_VERSION_STRING "Fedora-Administrator/1.0"
string = ADMSERV_VERSION_STRING;
}
apr_table_setn(r->headers_out, "Admin-Server", string);
@@ -2700,13 +2658,15 @@
{
/* Do basic auth after our own auth */
static const char * const aszPost[] = { "mod_auth.c", NULL };
+ /* Make sure mod_nss has been configured before us */
+ static const char * const aszPre[] = { "mod_nss.c", NULL };
/* handler for /admin-serv/authenticate requests */
ap_hook_handler(userauth, NULL, NULL, APR_HOOK_MIDDLE);
/* handler for /admin-serv/commands */
ap_hook_handler(admserv_command_handler, NULL, NULL, APR_HOOK_MIDDLE);
- ap_hook_pre_config(mod_admserv_pre_config, NULL, NULL, APR_HOOK_MIDDLE);
- ap_hook_post_config(mod_admserv_post_config, NULL, NULL, APR_HOOK_MIDDLE);
+ ap_hook_pre_config(mod_admserv_pre_config, aszPre, NULL, APR_HOOK_MIDDLE);
+ ap_hook_post_config(mod_admserv_post_config, aszPre, NULL, APR_HOOK_MIDDLE);
/* called at read_request phase to block clients from disallowed hosts */
ap_hook_post_read_request(admserv_host_ip_check, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_check_user_id(admserv_check_user_id, NULL, aszPost, APR_HOOK_MIDDLE);
17 years, 2 months
[Fedora-directory-commits] ldapserver/ldap/servers/slapd/back-ldbm start.c, 1.4, 1.5
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv19083
Modified Files:
start.c
Log Message:
[173871] added more precise error message for the dbcache allocation failure.
Index: start.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/start.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- start.c 19 Apr 2005 22:07:38 -0000 1.4
+++ start.c 17 Jan 2006 01:01:02 -0000 1.5
@@ -103,7 +103,7 @@
Object *inst_obj;
ldbm_instance *inst;
/* autosizing dbCache and entryCache */
- if (li->li_cache_autosize) {
+ if (li->li_cache_autosize > 0) {
zone_pages = (li->li_cache_autosize * pages) / 100;
/* now split it according to user prefs */
db_pages = (li->li_cache_autosize_split * zone_pages) / 100;
@@ -135,7 +135,7 @@
}
}
/* autosizing importCache */
- if (li->li_import_cache_autosize) {
+ if (li->li_import_cache_autosize > 0) {
/* For some reason, -1 means 50 ... */
if (li->li_import_cache_autosize == -1) {
li->li_import_cache_autosize = 50;
@@ -181,7 +181,18 @@
LDAPDebug( LDAP_DEBUG_ANY, "start: Failed to start databases, err=%d %s\n",
retval, (msg = dblayer_strerror( retval )) ? msg : "", 0 );
if (LDBM_OS_ERR_IS_DISKFULL(retval)) return return_on_disk_full(li);
- else return SLAPI_FAIL_GENERAL;
+ else {
+ if ((li->li_cache_autosize > 0) && (li->li_cache_autosize <= 100)) {
+ LDAPDebug( LDAP_DEBUG_ANY, "Failed to allocate %d byte dbcache. "
+ "Please reduce the value of %s and restart the server.\n",
+ li->li_dbcachesize, CONFIG_CACHE_AUTOSIZE, 0);
+ } else {
+ LDAPDebug( LDAP_DEBUG_ANY, "Failed to allocate %d byte dbcache. "
+ "Please reduce %s and Restart the server.\n",
+ li->li_dbcachesize, CONFIG_CACHE_AUTOSIZE, 0);
+ }
+ return SLAPI_FAIL_GENERAL;
+ }
}
/* write DBVERSION file if one does not exist */
17 years, 2 months
[Fedora-directory-commits] ldapserver/ldap/servers/plugins/replication replutil.c, 1.6, 1.7
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/replication
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv5781
Modified Files:
replutil.c
Log Message:
[176293] repl_chain_on_update() logs a message for every modify operation
Checking in Ulf's proposal; should not get connid from pid if the op is internal. (plus the value is just for debug print which is disabled now)
Index: replutil.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/replutil.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- replutil.c 19 Apr 2005 22:07:33 -0000 1.6
+++ replutil.c 16 Jan 2006 19:06:03 -0000 1.7
@@ -827,9 +827,19 @@
PRBool local_online = PR_FALSE; /* true if the local db is online */
PRBool chain_online = PR_FALSE; /* true if the chain db is online */
int ii;
- int opid, connid;
+ int opid;
+#ifdef DEBUG_CHAIN_ON_UPDATE
+ int connid;
+#endif
+ slapi_pblock_get(pb, SLAPI_OPERATION, &op);
+#ifdef DEBUG_CHAIN_ON_UPDATE
+ if (operation_is_flag_set(op, OP_FLAG_INTERNAL)) {
+ connid=-1; /* -1: internal op in a log msg */
+ } else {
+ slapi_pblock_get(pb, SLAPI_CONN_ID, &connid);
+ }
+#endif
- slapi_pblock_get(pb, SLAPI_CONN_ID, &connid);
slapi_pblock_get(pb, SLAPI_OPERATION_ID, &opid);
/* first, we have to decide which backend is the local backend
* and which is the chaining one
@@ -854,13 +864,13 @@
local_online = PR_TRUE;
}
}
-/*
+#ifdef DEBUG_CHAIN_ON_UPDATE
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update: conn=%d op=%d be "
- "%s is the %s backend and is %s\n",
- connid, opid,
- mtn_be_names[ii], (chaining_backend == ii) ? "chaining" : "local",
- (mtn_be_states[ii] == SLAPI_BE_STATE_ON) ? "online" : "offline");
-*/
+ "%s is the %s backend and is %s\n",
+ connid, opid,
+ mtn_be_names[ii], (chaining_backend == ii) ? "chaining" : "local",
+ (mtn_be_states[ii] == SLAPI_BE_STATE_ON) ? "online" : "offline");
+#endif
}
/* if no chaining backends are defined, just use the local one */
@@ -868,8 +878,6 @@
return local_backend;
}
- slapi_pblock_get(pb, SLAPI_OPERATION, &op);
-
/* All internal operations go to the local backend */
if (operation_is_flag_set(op, OP_FLAG_INTERNAL)) {
return local_backend;
@@ -884,11 +892,11 @@
(op_type == SLAPI_OPERATION_BIND) ||
(op_type == SLAPI_OPERATION_UNBIND) ||
(op_type == SLAPI_OPERATION_COMPARE))) {
-/*
+#ifdef DEBUG_CHAIN_ON_UPDATE
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update: conn=%d op=%d op is "
"%d: using local backend\n",
connid, opid, op_type);
-*/
+#endif
return local_backend;
}
@@ -903,10 +911,10 @@
*/
slapi_pblock_get(pb, SLAPI_REQUESTOR_DN, &requestor_dn);
if (slapi_dn_isroot(requestor_dn)) {
-/*
+#ifdef DEBUG_CHAIN_ON_UPDATE
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update: conn=%d op=%d requestor "
"is root: using local backend\n", connid, opid);
-*/
+#endif
return local_backend;
}
@@ -915,10 +923,10 @@
*/
slapi_pblock_get(pb, SLAPI_IS_REPLICATED_OPERATION, &repl_op);
if (repl_op) {
-/*
+#ifdef DEBUG_CHAIN_ON_UPDATE
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update: conn=%d op=%d op is "
"replicated: using local backend\n", connid, opid);
-*/
+#endif
return local_backend;
}
@@ -926,10 +934,10 @@
* or any normal non replicated client operation while local is disabled (import) :
* use the chaining backend
*/
-/*
+#ifdef DEBUG_CHAIN_ON_UPDATE
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update: conn=%d op=%d using "
"chaining backend\n", connid, opid);
-*/
+#endif
return chaining_backend;
}
17 years, 2 months
[Fedora-directory-commits] directoryconsole/src/com/netscape/admin/dirserv/propedit ChooseObjectClassDialog.java, 1.1.1.1, 1.2
by Doctor Conrad
Author: nkinder
Update of /cvs/dirsec/directoryconsole/src/com/netscape/admin/dirserv/propedit
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv19117/src/com/netscape/admin/dirserv/propedit
Modified Files:
ChooseObjectClassDialog.java
Log Message:
177696 - Changed usage of enum keyword as a variable name for Java 1.5 compatibility
Index: ChooseObjectClassDialog.java
===================================================================
RCS file: /cvs/dirsec/directoryconsole/src/com/netscape/admin/dirserv/propedit/ChooseObjectClassDialog.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- ChooseObjectClassDialog.java 18 Jul 2005 00:56:13 -0000 1.1.1.1
+++ ChooseObjectClassDialog.java 13 Jan 2006 22:53:19 -0000 1.2
@@ -45,9 +45,9 @@
// Extract the list of classes from the schema
Vector v = new Vector();
- Enumeration enum = schema.getObjectClassNames();
- while (enum.hasMoreElements()) {
- String objectclass = (String)enum.nextElement();
+ Enumeration enumObjclasses = schema.getObjectClassNames();
+ while (enumObjclasses.hasMoreElements()) {
+ String objectclass = (String)enumObjclasses.nextElement();
/* Check that the objectclass is not a forbidden objectclass */
boolean isForbidden = false;
for (int i=0; i<DSSchemaHelper.FORBIDDEN_OBJECTCLASSES.length; i++) {
17 years, 2 months
[Fedora-directory-commits] directoryconsole/src/com/netscape/admin/dirserv/panel DefaultIndexManagementPanel.java, 1.1.1.1, 1.2 IndexManagementPanel.java, 1.1.1.1, 1.2 ObjectClassDialog.java, 1.1.1.1, 1.2 PluginPanel.java, 1.1.1.1, 1.2 SchemaObjectClassesPanel.java, 1.1.1.1, 1.2
by Doctor Conrad
Author: nkinder
Update of /cvs/dirsec/directoryconsole/src/com/netscape/admin/dirserv/panel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv19117/src/com/netscape/admin/dirserv/panel
Modified Files:
DefaultIndexManagementPanel.java IndexManagementPanel.java
ObjectClassDialog.java PluginPanel.java
SchemaObjectClassesPanel.java
Log Message:
177696 - Changed usage of enum keyword as a variable name for Java 1.5 compatibility
Index: DefaultIndexManagementPanel.java
===================================================================
RCS file: /cvs/dirsec/directoryconsole/src/com/netscape/admin/dirserv/panel/DefaultIndexManagementPanel.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- DefaultIndexManagementPanel.java 18 Jul 2005 00:55:57 -0000 1.1.1.1
+++ DefaultIndexManagementPanel.java 13 Jan 2006 22:53:13 -0000 1.2
@@ -902,9 +902,9 @@
LDAPAttribute findAttr =
res.getAttribute( "objectclass");
if( (findAttr != null ) && (findAttr.size() > 0) ) {
- Enumeration enum = findAttr.getStringValues();
- while (!mybool && (enum.hasMoreElements())) {
- String v = (String) enum.nextElement();
+ Enumeration enumVals = findAttr.getStringValues();
+ while (!mybool && (enumVals.hasMoreElements())) {
+ String v = (String) enumVals.nextElement();
Debug.println( "****** IndexManagementPanel.isPluginEntry() value :" + v);
mybool = ((v != null) && (v.compareToIgnoreCase("nsSlapdPlugin") == 0 )) ;
}
Index: IndexManagementPanel.java
===================================================================
RCS file: /cvs/dirsec/directoryconsole/src/com/netscape/admin/dirserv/panel/IndexManagementPanel.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- IndexManagementPanel.java 18 Jul 2005 00:55:58 -0000 1.1.1.1
+++ IndexManagementPanel.java 13 Jan 2006 22:53:13 -0000 1.2
@@ -1074,9 +1074,9 @@
LDAPAttribute findAttr =
res.getAttribute( "objectclass");
if( (findAttr != null ) && (findAttr.size() > 0) ) {
- Enumeration enum = findAttr.getStringValues();
- while (!mybool && (enum.hasMoreElements())) {
- String v = (String) enum.nextElement();
+ Enumeration enumVals = findAttr.getStringValues();
+ while (!mybool && (enumVals.hasMoreElements())) {
+ String v = (String) enumVals.nextElement();
Debug.println( "****** IndexManagementPanel.isPluginEntry() value :" + v);
mybool = ((v != null) && (v.compareToIgnoreCase("nsSlapdPlugin") == 0 )) ;
}
Index: ObjectClassDialog.java
===================================================================
RCS file: /cvs/dirsec/directoryconsole/src/com/netscape/admin/dirserv/panel/ObjectClassDialog.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- ObjectClassDialog.java 18 Jul 2005 00:56:02 -0000 1.1.1.1
+++ ObjectClassDialog.java 13 Jan 2006 22:53:13 -0000 1.2
@@ -128,9 +128,9 @@
private void updateAvailAttrList() {
if (_availModel.size() != 0)
_availModel.removeAllElements();
- Enumeration enum = _schema.getAttributeNames();
- while (enum.hasMoreElements()) {
- String attr = (String)enum.nextElement();
+ Enumeration enumAttrs = _schema.getAttributeNames();
+ while (enumAttrs.hasMoreElements()) {
+ String attr = (String)enumAttrs.nextElement();
if (!attr.equals("dncomp") && !attr.equals("entrydn")&&
!attr.equals("entryid") && !attr.equals("parentid")) {
SchemaUtility.InsertElement(_availModel, attr);
Index: PluginPanel.java
===================================================================
RCS file: /cvs/dirsec/directoryconsole/src/com/netscape/admin/dirserv/panel/PluginPanel.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- PluginPanel.java 18 Jul 2005 00:56:03 -0000 1.1.1.1
+++ PluginPanel.java 13 Jan 2006 22:53:13 -0000 1.2
@@ -1072,10 +1072,10 @@
}
}
- Enumeration enum = _dsEntryFields.keys();
+ Enumeration enumAttrs = _dsEntryFields.keys();
- while (enum.hasMoreElements()) {
- String attributeName = (String)enum.nextElement();
+ while (enumAttrs.hasMoreElements()) {
+ String attributeName = (String)enumAttrs.nextElement();
((DSEntryTextStrict)_dsEntryFields.get(attributeName)).show();
}
}
@@ -1116,10 +1116,10 @@
if (_dsEnableState.isModified())
return true;
- Enumeration enum = _dsEntryFields.keys();
+ Enumeration enumAttrs = _dsEntryFields.keys();
- while (enum.hasMoreElements()) {
- String attributeName = (String)enum.nextElement();
+ while (enumAttrs.hasMoreElements()) {
+ String attributeName = (String)enumAttrs.nextElement();
if (((DSEntryTextStrict)_dsEntryFields.get(attributeName)).isModified())
return true;
}
Index: SchemaObjectClassesPanel.java
===================================================================
RCS file: /cvs/dirsec/directoryconsole/src/com/netscape/admin/dirserv/panel/SchemaObjectClassesPanel.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- SchemaObjectClassesPanel.java 18 Jul 2005 00:56:04 -0000 1.1.1.1
+++ SchemaObjectClassesPanel.java 13 Jan 2006 22:53:13 -0000 1.2
@@ -202,9 +202,9 @@
return;
}
_ocModel.removeAllElements();
- Enumeration enum = schema.getObjectClassNames();
- while (enum.hasMoreElements()) {
- SchemaUtility.InsertElement(_ocModel, enum.nextElement());
+ Enumeration enumObjclasses = schema.getObjectClassNames();
+ while (enumObjclasses.hasMoreElements()) {
+ SchemaUtility.InsertElement(_ocModel, enumObjclasses.nextElement());
}
}
17 years, 2 months
[Fedora-directory-commits] ldapserver/ldap/servers/slapd/back-ldbm dblayer.c, 1.9, 1.10
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12951
Modified Files:
dblayer.c
Log Message:
Previous checkin cleaned up too much; restoring commit_good_database.
Index: dblayer.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/dblayer.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- dblayer.c 10 Jan 2006 23:53:08 -0000 1.9
+++ dblayer.c 13 Jan 2006 19:31:11 -0000 1.10
@@ -2411,6 +2411,7 @@
}
}
#endif
+ commit_good_database(priv);
return return_value;
}
17 years, 2 months
[Fedora-directory-commits] setuputil/installer/unix product.cc, 1.2, 1.3
by Doctor Conrad
Author: nkinder
Update of /cvs/dirsec/setuputil/installer/unix
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv25561
Modified Files:
product.cc
Log Message:
174749 - Uninstall should not follow symlinks
Index: product.cc
===================================================================
RCS file: /cvs/dirsec/setuputil/installer/unix/product.cc,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- product.cc 13 Dec 2005 20:58:22 -0000 1.2
+++ product.cc 12 Jan 2006 17:26:46 -0000 1.3
@@ -27,6 +27,9 @@
**
** HISTORY:
** $Log$
+** Revision 1.3 2006/01/12 17:26:46 nkinder
+** 174749 - Uninstall should not follow symlinks
+**
** Revision 1.2 2005/12/13 20:58:22 nhosoi
** [175418] Admin Server ns-update crashes if necessary attribute-value is not given
** 1) Although Admin Server's PostInstall program ns-update expects it, PostInstall
@@ -369,6 +372,11 @@
DIR *dirp;
struct dirent *dir;
int ret = 0;
+ struct stat fi;
+
+ // Just return if directory is a symlink
+ if (lstat(input, &fi) == 0 && S_ISLNK(fi.st_mode))
+ return ret;
//Open the directory to read its contents
dirp = opendir(input);
17 years, 2 months
[Fedora-directory-commits] ldapserver/ldap/servers/slapd/back-ldbm archive.c, 1.7, 1.8
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv22527/back-ldbm
Modified Files:
archive.c
Log Message:
[174774] Backup does not clear the backup directory prior to performing backup; Restore tries to restore all the fles from the backupdir
1) if the specified backup directory exists, rename it to <dir>.bak
2) support relative dir for the backup/restore dir, e.g., "bak2db bak/mybak"
Index: archive.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/archive.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- archive.c 25 Apr 2005 16:24:23 -0000 1.7
+++ archive.c 12 Jan 2006 00:29:04 -0000 1.8
@@ -42,8 +42,10 @@
int ldbm_back_archive2ldbm( Slapi_PBlock *pb )
{
struct ldbminfo *li;
+ char *instancedir = NULL;
+ char *orig_dir = NULL;
char *directory = NULL;
- char *backendname = NULL;
+ char *backendname = NULL;
int return_value = -1;
int task_flags = 0;
int run_from_cmdline = 0;
@@ -51,12 +53,20 @@
int is_old_to_new = 0;
slapi_pblock_get( pb, SLAPI_PLUGIN_PRIVATE, &li );
- slapi_pblock_get( pb, SLAPI_SEQ_VAL, &directory );
- slapi_pblock_get( pb, SLAPI_BACKEND_INSTANCE_NAME, &backendname);
+ slapi_pblock_get( pb, SLAPI_SEQ_VAL, &orig_dir );
+ slapi_pblock_get( pb, SLAPI_BACKEND_INSTANCE_NAME, &backendname);
slapi_pblock_get( pb, SLAPI_BACKEND_TASK, &task );
slapi_pblock_get( pb, SLAPI_TASK_FLAGS, &task_flags );
li->li_flags = run_from_cmdline = (task_flags & TASK_RUNNING_FROM_COMMANDLINE);
+ if ( !orig_dir || !*orig_dir ) {
+ LDAPDebug( LDAP_DEBUG_ANY, "archive2db: no archive name\n",
+ 0, 0, 0 );
+ return( -1 );
+ }
+ instancedir = config_get_instancedir();
+ directory = rel2abspath_ext(orig_dir, instancedir);
+
/* check the current idl format vs backup DB version */
if (idl_get_idl_new())
{
@@ -99,7 +109,7 @@
"to restore old formated backup onto the new server, "
"please use command line utility \"bak2db\" .\n");
}
- return -1;
+ goto out;
}
/* server is up -- mark all backends busy */
for (inst_obj = objset_first_obj(li->li_instance_set); inst_obj;
@@ -131,7 +141,7 @@
}
object_release(inst_obj2);
object_release(inst_obj);
- return -1;
+ goto out;
}
}
@@ -237,26 +247,97 @@
}
}
}
-
+out:
+ slapi_ch_free_string(&directory);
return return_value;
}
int ldbm_back_ldbm2archive( Slapi_PBlock *pb )
{
struct ldbminfo *li;
+ char *orig_dir = NULL;
char *directory = NULL;
+ char *dir_bak = NULL;
+ char *instancedir = NULL;
int return_value = -1;
int task_flags = 0;
int run_from_cmdline = 0;
Slapi_Task *task;
+ struct stat sbuf;
slapi_pblock_get( pb, SLAPI_PLUGIN_PRIVATE, &li );
- slapi_pblock_get( pb, SLAPI_SEQ_VAL, &directory );
+ slapi_pblock_get( pb, SLAPI_SEQ_VAL, &orig_dir );
slapi_pblock_get( pb, SLAPI_TASK_FLAGS, &task_flags );
li->li_flags = run_from_cmdline = (task_flags & TASK_RUNNING_FROM_COMMANDLINE);
slapi_pblock_get( pb, SLAPI_BACKEND_TASK, &task );
+ if ( !orig_dir || !*orig_dir ) {
+ LDAPDebug( LDAP_DEBUG_ANY, "db2archive: no archive name\n",
+ 0, 0, 0 );
+ return( -1 );
+ }
+ instancedir = config_get_instancedir();
+ directory = rel2abspath_ext(orig_dir, instancedir);
+ if (stat(directory, &sbuf) == 0) {
+ int baklen = strlen(directory) + 5; /* ".bak\0" */
+ dir_bak = slapi_ch_malloc(baklen);
+ PR_snprintf(dir_bak, baklen, "%s.bak", directory);
+ LDAPDebug(LDAP_DEBUG_ANY, "db2archive: %s exists. Renaming to %s\n",
+ directory, dir_bak, 0);
+ if (task) {
+ slapi_task_log_notice(task, "%s exists. Renaming to %s\n",
+ directory, dir_bak);
+ }
+ if (stat(dir_bak, &sbuf) == 0) {
+ return_value = ldbm_delete_dirs(dir_bak);
+ if (0 != return_value) {
+ LDAPDebug(LDAP_DEBUG_ANY,
+ "db2archive: %s exists and failed to delete it.\n",
+ dir_bak, 0, 0);
+ if (task) {
+ slapi_task_log_notice(task,
+ "%s exists and failed to delete it.\n", dir_bak);
+ }
+ return_value = -1;
+ goto out;
+ }
+ }
+ return_value = PR_Rename(directory, dir_bak);
+ if (return_value != PR_SUCCESS) {
+ PRErrorCode prerr = PR_GetError();
+ LDAPDebug(LDAP_DEBUG_ANY,
+ "db2archive: Failed to rename \"%s\" to \"%s\".",
+ directory, dir_bak, 0);
+ LDAPDebug(LDAP_DEBUG_ANY,
+ SLAPI_COMPONENT_NAME_NSPR " error %d (%s)",
+ prerr, slapd_pr_strerror(prerr), 0);
+ if (task) {
+ slapi_task_log_notice(task,
+ "Failed to rename \"%s\" to \"%s\".",
+ directory, dir_bak, 0);
+ slapi_task_log_notice(task,
+ SLAPI_COMPONENT_NAME_NSPR " error %d (%s)",
+ prerr, slapd_pr_strerror(prerr), 0);
+ }
+ return_value = -1;
+ goto out;
+ }
+ }
+ if (0 != MKDIR(directory,SLAPD_DEFAULT_DIR_MODE) && EEXIST != errno) {
+ char *msg = dblayer_strerror(errno);
+
+ LDAPDebug(LDAP_DEBUG_ANY,
+ "db2archive: mkdir(%s) failed; errno %i (%s)\n",
+ directory, errno, msg ? msg : "unknown");
+ if (task) {
+ slapi_task_log_notice(task,
+ "mkdir(%s) failed; errno %i (%s)",
+ directory, errno, msg ? msg : "unknown");
+ }
+ goto err;
+ }
+
/* No ldbm be's exist until we process the config information. */
if (run_from_cmdline) {
mapping_tree_init();
@@ -297,43 +378,36 @@
}
object_release(inst_obj2);
object_release(inst_obj);
- return -1;
+ goto err;
}
}
}
- if ( !directory || !*directory ) {
- LDAPDebug( LDAP_DEBUG_ANY, "db2archive: no archive name\n",
- 0, 0, 0 );
- return( -1 );
- }
- if (0 != MKDIR(directory,SLAPD_DEFAULT_DIR_MODE) && EEXIST != errno) {
- char *msg = dblayer_strerror(errno);
-
- LDAPDebug(LDAP_DEBUG_ANY,
- "db2archive: mkdir(%s) failed; errno %i (%s)\n",
- directory, errno, msg ? msg : "unknown");
- if (task) {
- slapi_task_log_notice(task,
- "mkdir(%s) failed; errno %i (%s)",
- directory, errno, msg ? msg : "unknown");
- }
- }
-
/* start the database code up, do not attempt to perform recovery */
if (run_from_cmdline &&
- 0 != dblayer_start(li,DBLAYER_ARCHIVE_MODE|DBLAYER_NO_DBTHREADS_MODE)) {
+ 0 != (return_value = dblayer_start(li,DBLAYER_ARCHIVE_MODE|DBLAYER_NO_DBTHREADS_MODE))) {
LDAPDebug(LDAP_DEBUG_ANY, "db2archive: Failed to init database\n",
0, 0, 0);
if (task) {
slapi_task_log_notice(task, "Failed to init database");
}
- return( -1 );
+ goto rel_err;
+ }
+
+ if (slapd_comp_path(directory, li->li_directory) == 0) {
+ LDAPDebug(LDAP_DEBUG_ANY,
+ "db2archive: Cannot archive to the db directory.\n", 0, 0, 0);
+ if (task) {
+ slapi_task_log_notice(task, "Cannot archive to the db directory.\n");
+ }
+ return_value = -1;
+ goto rel_err;
}
/* tell it to archive */
return_value = dblayer_backup(li, directory, task);
+rel_err:
/* close the database down again */
if (run_from_cmdline &&
0 != dblayer_close(li,DBLAYER_ARCHIVE_MODE|DBLAYER_NO_DBTHREADS_MODE)) {
@@ -359,6 +433,19 @@
instance_set_not_busy(inst);
}
}
-
+err:
+ if (return_value != 0) {
+ LDAPDebug(LDAP_DEBUG_ANY, "db2archive: Rename %s back to %s\n",
+ dir_bak, directory, 0);
+ if (task) {
+ slapi_task_log_notice(task, "Rename %s back to %s\n",
+ dir_bak, directory);
+ }
+ ldbm_delete_dirs(directory);
+ PR_Rename(dir_bak, directory);
+ }
+out:
+ slapi_ch_free_string(&dir_bak);
+ slapi_ch_free_string(&directory);
return return_value;
}
17 years, 2 months