ldap/servers
by Mark Reynolds
ldap/servers/plugins/replication/repl5.h | 1 +
ldap/servers/plugins/replication/repl5_init.c | 6 ++++++
ldap/servers/plugins/replication/repl5_replica.c | 3 ++-
3 files changed, 9 insertions(+), 1 deletion(-)
New commits:
commit 17d0158bf582511276dffccebc561d1511c95c45
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Wed Apr 3 16:34:52 2013 -0400
Ticket 47311 - segfault in db2ldif(trigger by a cleanallruv task)
Bug Description: If you run db2ldif while the server is stopped, and there is
an unfinshed cleanAllRUV task, when the task finishes it tries
to trim the changelog, but the changelog has been initialized
yet. This leads to a crash when trying to trigger the trimming.
Fix Description: Do not resume incomplete cleanAllRUV tasks when running db2ldif.
https://fedorahosted.org/389/ticket/47311
Reviewed by: richm(Thanks!)
diff --git a/ldap/servers/plugins/replication/repl5.h b/ldap/servers/plugins/replication/repl5.h
index 92e7ac4..c7639e3 100644
--- a/ldap/servers/plugins/replication/repl5.h
+++ b/ldap/servers/plugins/replication/repl5.h
@@ -709,6 +709,7 @@ void repl5_set_debug_timeout(const char *val);
/* temp hack XXX */
ReplicaId agmt_get_consumerRID(Repl_Agmt *ra);
+PRBool ldif_dump_is_running();
void windows_init_agreement_from_entry(Repl_Agmt *ra, Slapi_Entry *e);
int windows_handle_modify_agreement(Repl_Agmt *ra, const char *type, Slapi_Entry *e);
diff --git a/ldap/servers/plugins/replication/repl5_init.c b/ldap/servers/plugins/replication/repl5_init.c
index cc73f5d..8471f00 100644
--- a/ldap/servers/plugins/replication/repl5_init.c
+++ b/ldap/servers/plugins/replication/repl5_init.c
@@ -657,6 +657,12 @@ check_for_ldif_dump(Slapi_PBlock *pb)
static PRBool is_ldif_dump = PR_FALSE;
+PRBool
+ldif_dump_is_running()
+{
+ return is_ldif_dump;
+}
+
int
multimaster_start( Slapi_PBlock *pb )
{
diff --git a/ldap/servers/plugins/replication/repl5_replica.c b/ldap/servers/plugins/replication/repl5_replica.c
index 68dc8f7..5a19833 100644
--- a/ldap/servers/plugins/replication/repl5_replica.c
+++ b/ldap/servers/plugins/replication/repl5_replica.c
@@ -1832,7 +1832,8 @@ replica_check_for_tasks(Replica *r, Slapi_Entry *e)
{
char **clean_vals;
- if(e == NULL){
+ if(e == NULL || ldif_dump_is_running() == PR_TRUE){
+ /* If db2ldif is being run, do not check if there are incomplete tasks */
return;
}
/*
11 years
2 commits - ldap/servers
by Richard Allen Megginson
ldap/servers/slapd/back-ldbm/dblayer.c | 73 +++++++++++-------------
ldap/servers/slapd/back-ldbm/dbsize.c | 7 +-
ldap/servers/slapd/back-ldbm/ldif2ldbm.c | 12 +--
ldap/servers/slapd/back-ldbm/misc.c | 8 +-
ldap/servers/slapd/config.c | 10 +--
ldap/servers/slapd/dse.c | 12 +--
ldap/servers/slapd/getfilelist.c | 4 -
ldap/servers/slapd/test-plugins/testdbinterop.c | 6 -
ldap/servers/slapd/tools/pwenc.c | 10 +--
9 files changed, 70 insertions(+), 72 deletions(-)
New commits:
commit 7d26ba1f6edbf1b0959c37fb638bc757cba9dfa6
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Tue Apr 2 17:55:14 2013 -0600
Ticket #574 - problems with dbcachesize disk space calculation
https://fedorahosted.org/389/ticket/574
Reviewed by: mreynolds (Thanks!)
Branch: master
Fix Description: 50% overhead for dbcachesize is too much - use 10%.
Based on empirical observations on RHEL 6.4 64-bit bdb 4.7.
There seems to be no way to ask bdb "Given a dbcachesize, what will be the
total size of all of the region files?".
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/slapd/back-ldbm/dblayer.c b/ldap/servers/slapd/back-ldbm/dblayer.c
index c9fecbe..0edd861 100644
--- a/ldap/servers/slapd/back-ldbm/dblayer.c
+++ b/ldap/servers/slapd/back-ldbm/dblayer.c
@@ -1397,7 +1397,8 @@ no_diskspace(struct ldbminfo *li, int dbenv_flags)
struct statvfs dbhome_buf;
struct statvfs db_buf;
int using_region_files = !(dbenv_flags & ( DB_PRIVATE | DB_SYSTEM_MEM));
- PRUint64 expected_siz = li->li_dbcachesize + li->li_dbcachesize/2; /* dbcache + region files */
+ /* value of 10 == 10% == little more than the average overhead calculated for very large files on 64-bit system for bdb 4.7 */
+ PRUint64 expected_siz = li->li_dbcachesize + li->li_dbcachesize/10; /* dbcache + region files */
PRUint64 fsiz;
char *region_dir;
commit 968c51168a575c0e61e1749fb62568ead9a87e8f
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Tue Apr 2 17:50:08 2013 -0600
Ticket #47312 - replace PR_GetFileInfo with PR_GetFileInfo64
https://fedorahosted.org/389/ticket/47312
Reviewed by: mreynolds (Thanks!)
Branch: master
Fix Description: The directory server deals with very large files. We need
to use PR_GetFileInfo64 to make sure we can accurately calculate the sizes of
these files. Note that many places didn't use the info.size field, but were
changed anyway in order to be consistent and discourage the use of
PR_GetFileInfo.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/slapd/back-ldbm/dblayer.c b/ldap/servers/slapd/back-ldbm/dblayer.c
index c921526..c9fecbe 100644
--- a/ldap/servers/slapd/back-ldbm/dblayer.c
+++ b/ldap/servers/slapd/back-ldbm/dblayer.c
@@ -1086,7 +1086,7 @@ static int dblayer_grok_directory(char *directory, int flags)
char filename[MAXPATHLEN];
PRDir *dirhandle = NULL;
PRDirEntry *direntry = NULL;
- PRFileInfo info;
+ PRFileInfo64 info;
dirhandle = PR_OpenDir(directory);
if (NULL == dirhandle)
@@ -1109,7 +1109,7 @@ static int dblayer_grok_directory(char *directory, int flags)
* With multiple instances of the backend the are now other directories
* in the db home directory. This function wasn't ment to deal with
* other directories, so we skip them. */
- if (PR_GetFileInfo(filename, &info) == PR_SUCCESS &&
+ if (PR_GetFileInfo64(filename, &info) == PR_SUCCESS &&
info.type == PR_FILE_DIRECTORY) {
/* go into it (instance dir) */
int retval = dblayer_grok_directory(filename, flags);
@@ -1360,7 +1360,7 @@ dblayer_get_full_inst_dir(struct ldbminfo *li, ldbm_instance *inst,
static PRUint64
dblayer_get_region_size(const char *dir)
{
- PRFileInfo info;
+ PRFileInfo64 info;
PRDir *dirhandle = NULL;
PRDirEntry *direntry = NULL;
PRUint64 region_size = 0;
@@ -1377,7 +1377,7 @@ dblayer_get_region_size(const char *dir)
char filename[MAXPATHLEN];
PR_snprintf(filename, MAXPATHLEN, "%s/%s", dir, direntry->name);
- if (PR_GetFileInfo(filename, &info) != PR_FAILURE){
+ if (PR_GetFileInfo64(filename, &info) != PR_FAILURE){
region_size += info.size;
}
}
@@ -1923,7 +1923,7 @@ dblayer_get_id2entry_size(ldbm_instance *inst)
{
struct ldbminfo *li = NULL;
char *id2entry_file = NULL;
- PRFileInfo info;
+ PRFileInfo64 info;
int rc;
char inst_dir[MAXPATHLEN], *inst_dirp;
@@ -1934,7 +1934,7 @@ dblayer_get_id2entry_size(ldbm_instance *inst)
inst_dirp = dblayer_get_full_inst_dir(li, inst, inst_dir, MAXPATHLEN);
id2entry_file = slapi_ch_smprintf("%s/%s", inst_dirp,
ID2ENTRY LDBM_FILENAME_SUFFIX);
- rc = PR_GetFileInfo(id2entry_file, &info);
+ rc = PR_GetFileInfo64(id2entry_file, &info);
slapi_ch_free_string(&id2entry_file);
if (rc) {
return 0;
@@ -2407,7 +2407,7 @@ dblayer_get_aux_id2entry_ext(backend *be, DB **ppDB, DB_ENV **ppEnv,
int envflags = 0;
int dbflags = 0;
size_t cachesize;
- PRFileInfo prfinfo;
+ PRFileInfo64 prfinfo;
PRStatus prst;
char *id2entry_file = NULL;
char inst_dir[MAXPATHLEN];
@@ -2462,7 +2462,7 @@ dblayer_get_aux_id2entry_ext(backend *be, DB **ppDB, DB_ENV **ppEnv,
}
priv->dblayer_log_directory = slapi_ch_strdup(priv->dblayer_home_directory);
- prst = PR_GetFileInfo(inst_dirp, &prfinfo);
+ prst = PR_GetFileInfo64(inst_dirp, &prfinfo);
if (PR_FAILURE == prst || PR_FILE_DIRECTORY != prfinfo.type)
{
LDAPDebug(LDAP_DEBUG_ANY,
@@ -2470,7 +2470,7 @@ dblayer_get_aux_id2entry_ext(backend *be, DB **ppDB, DB_ENV **ppEnv,
goto done;
}
- prst = PR_GetFileInfo(priv->dblayer_home_directory, &prfinfo);
+ prst = PR_GetFileInfo64(priv->dblayer_home_directory, &prfinfo);
if (PR_SUCCESS == prst)
{
ldbm_delete_dirs(priv->dblayer_home_directory);
@@ -4913,7 +4913,7 @@ static int read_metadata(struct ldbminfo *li)
char *nextline;
char **dirp;
PRFileDesc *prfd;
- PRFileInfo prfinfo;
+ PRFileInfo64 prfinfo;
int return_value = 0;
PRInt32 byte_count = 0;
char attribute[512];
@@ -4931,7 +4931,7 @@ static int read_metadata(struct ldbminfo *li)
PR_snprintf(filename,sizeof(filename),"%s/guardian",priv->dblayer_home_directory);
memset(&prfinfo, '\0', sizeof(PRFileInfo));
- (void)PR_GetFileInfo(filename, &prfinfo);
+ (void)PR_GetFileInfo64(filename, &prfinfo);
prfd = PR_Open(filename,PR_RDONLY,priv->dblayer_file_mode);
if (NULL == prfd || 0 == prfinfo.size) {
@@ -5263,7 +5263,7 @@ dblayer_delete_database_ex(struct ldbminfo *li, char *instance, char *cldir)
Object *inst_obj;
PRDir *dirhandle = NULL;
PRDirEntry *direntry = NULL;
- PRFileInfo fileinfo;
+ PRFileInfo64 fileinfo;
char filename[MAXPATHLEN];
char *log_dir;
int ret;
@@ -5331,7 +5331,7 @@ dblayer_delete_database_ex(struct ldbminfo *li, char *instance, char *cldir)
/* Do not call PR_Delete on the instance directories if they exist.
* It would not work, but we still should not do it. */
- rval_tmp = PR_GetFileInfo(filename, &fileinfo);
+ rval_tmp = PR_GetFileInfo64(filename, &fileinfo);
if (rval_tmp == PR_SUCCESS && fileinfo.type != PR_FILE_DIRECTORY)
{
/* Skip deleting log files; that should be handled below.
@@ -5381,28 +5381,24 @@ int dblayer_delete_database(struct ldbminfo *li)
/*
* Return the size of the database (in kilobytes). XXXggood returning
* the size in units of kb is really a hack, and is done because we
- * don't have NSPR support for 64-bit file offsets.
+ * didn't have NSPR support for 64-bit file offsets originally (now we do)
* Caveats:
* - We can still return incorrect results if an individual file is
* larger than fit in a PRUint32.
- * - PR_GetFileInfo doesn't do any special processing for symlinks,
+ * - PR_GetFileInfo64 doesn't do any special processing for symlinks,
* nor does it inform us if the file is a symlink. Nice. So if
* a file in the db directory is a symlink, the size we return
* will probably be way too small.
*/
int dblayer_database_size(struct ldbminfo *li, unsigned int *size)
{
- dblayer_private *priv = NULL;
+ dblayer_private *priv = NULL;
int return_value = 0;
char filename[MAXPATHLEN];
PRDir *dirhandle = NULL;
- /*
- * XXXggood - NSPR will only give us an unsigned 32-bit quantity for
- * file sizes. This is bad. Files can be bigger than that these days.
- */
unsigned int cumulative_size = 0;
unsigned int remainder = 0;
- PRFileInfo info;
+ PRFileInfo64 info;
PR_ASSERT(NULL != li);
priv = (dblayer_private*)li->li_dblayer_private;
@@ -5418,7 +5414,7 @@ int dblayer_database_size(struct ldbminfo *li, unsigned int *size)
break;
}
PR_snprintf(filename,MAXPATHLEN, "%s/%s",priv->dblayer_home_directory,direntry->name);
- return_value = PR_GetFileInfo(filename, &info);
+ return_value = PR_GetFileInfo64(filename, &info);
if (PR_SUCCESS == return_value)
{
cumulative_size += (info.size / 1024);
@@ -5459,14 +5455,14 @@ static int count_dbfiles_in_dir(char *directory, int *count, int recurse)
if (NULL != dirhandle) {
PRDirEntry *direntry = NULL;
char *direntry_name;
- PRFileInfo info;
+ PRFileInfo64 info;
while (NULL != (direntry = PR_ReadDir(dirhandle, PR_SKIP_DOT | PR_SKIP_DOT_DOT))) {
if (NULL == direntry->name) {
break;
}
direntry_name = PR_smprintf("%s/%s", directory, direntry->name);
- if ((PR_GetFileInfo(direntry_name, &info) == PR_SUCCESS) &&
+ if ((PR_GetFileInfo64(direntry_name, &info) == PR_SUCCESS) &&
(PR_FILE_DIRECTORY == info.type) && recurse) {
/* Recurse into this directory but not any further. This is
* because each instance gets its own directory, but in those
@@ -5736,7 +5732,7 @@ dblayer_copy_directory(struct ldbminfo *li,
if (NULL == new_dest_dir) {
/* Need to create the new directory where the files will be
* copied to. */
- PRFileInfo info;
+ PRFileInfo64 info;
char *prefix = "";
char mysep = 0;
@@ -5757,7 +5753,7 @@ dblayer_copy_directory(struct ldbminfo *li,
new_dest_dir = slapi_ch_smprintf("%s/%s",
dest_dir, relative_instance_name);
/* } */
- if (PR_SUCCESS == PR_GetFileInfo(new_dest_dir, &info))
+ if (PR_SUCCESS == PR_GetFileInfo64(new_dest_dir, &info))
{
ldbm_delete_dirs(new_dest_dir);
}
@@ -6251,7 +6247,7 @@ int dblayer_delete_transaction_logs(const char * log_dir)
PRDirEntry *direntry = NULL;
int is_a_logfile = 0;
int pre=0;
- PRFileInfo info ;
+ PRFileInfo64 info ;
while (NULL != (direntry =
PR_ReadDir(dirhandle, PR_SKIP_DOT | PR_SKIP_DOT_DOT)))
@@ -6263,7 +6259,7 @@ int dblayer_delete_transaction_logs(const char * log_dir)
break;
}
PR_snprintf(filename1, MAXPATHLEN, "%s/%s", log_dir, direntry->name);
- pre = PR_GetFileInfo(filename1, &info);
+ pre = PR_GetFileInfo64(filename1, &info);
if (pre == PR_SUCCESS && PR_FILE_DIRECTORY == info.type) {
continue;
}
@@ -6315,7 +6311,7 @@ static int dblayer_copy_dirand_contents(char* src_dir, char* dst_dir, int mode,
char filename2[MAXPATHLEN];
PRDir *dirhandle = NULL;
PRDirEntry *direntry = NULL;
- PRFileInfo info;
+ PRFileInfo64 info;
dirhandle = PR_OpenDir(src_dir);
if (NULL != dirhandle)
@@ -6334,7 +6330,7 @@ static int dblayer_copy_dirand_contents(char* src_dir, char* dst_dir, int mode,
LDAPDebug(LDAP_DEBUG_ANY, "Moving file %s\n",
filename2, 0, 0);
/* Is this entry a directory? */
- tmp_rval = PR_GetFileInfo(filename1, &info);
+ tmp_rval = PR_GetFileInfo64(filename1, &info);
if (tmp_rval == PR_SUCCESS && PR_FILE_DIRECTORY == info.type)
{
PR_MkDir(filename2,NEWDIR_MODE);
@@ -6375,7 +6371,7 @@ static int dblayer_fri_trim(char *fri_dir_path, char* bename)
char filename[MAXPATHLEN];
PRDir *dirhandle = NULL;
PRDirEntry *direntry = NULL;
- PRFileInfo info;
+ PRFileInfo64 info;
dirhandle = PR_OpenDir(fri_dir_path);
if (NULL != dirhandle)
@@ -6391,7 +6387,7 @@ static int dblayer_fri_trim(char *fri_dir_path, char* bename)
PR_snprintf(filename, MAXPATHLEN, "%s/%s", fri_dir_path, direntry->name);
/* Is this entry a directory? */
- tmp_rval = PR_GetFileInfo(filename, &info);
+ tmp_rval = PR_GetFileInfo64(filename, &info);
if (tmp_rval == PR_SUCCESS && PR_FILE_DIRECTORY == info.type)
{
if(strcmp(direntry->name,bename)!=0)
@@ -6504,7 +6500,7 @@ int dblayer_restore(struct ldbminfo *li, char *src_dir, Slapi_Task *task, char *
char filename2[MAXPATHLEN];
PRDir *dirhandle = NULL;
PRDirEntry *direntry = NULL;
- PRFileInfo info;
+ PRFileInfo64 info;
ldbm_instance *inst = NULL;
int seen_logfiles = 0; /* Tells us if we restored any logfiles */
int is_a_logfile = 0;
@@ -6592,7 +6588,7 @@ int dblayer_restore(struct ldbminfo *li, char *src_dir, Slapi_Task *task, char *
src_dir, direntry->name);
if(!frirestore || strcmp(direntry->name,bename)==0)
{
- tmp_rval = PR_GetFileInfo(filename1, &info);
+ tmp_rval = PR_GetFileInfo64(filename1, &info);
if (tmp_rval == PR_SUCCESS && PR_FILE_DIRECTORY == info.type) {
/* Is it CHANGELOG_BACKUPDIR? */
if (0 == strcmp(CHANGELOG_BACKUPDIR, direntry->name)) {
@@ -6687,7 +6683,7 @@ int dblayer_restore(struct ldbminfo *li, char *src_dir, Slapi_Task *task, char *
/* Is this entry a directory? */
PR_snprintf(filename1, sizeof(filename1), "%s/%s",
real_src_dir, direntry->name);
- tmp_rval = PR_GetFileInfo(filename1, &info);
+ tmp_rval = PR_GetFileInfo64(filename1, &info);
if (tmp_rval == PR_SUCCESS && PR_FILE_DIRECTORY == info.type) {
/* This is an instance directory. It contains the *.db#
* files for the backend instance.
@@ -7045,10 +7041,10 @@ int dblayer_update_db_ext(ldbm_instance *inst, char *oldext, char *newext)
NULL != a;
a = (struct attrinfo *)avl_getnext())
{
- PRFileInfo info;
+ PRFileInfo64 info;
ofile = slapi_ch_smprintf("%s/%s%s", inst_dirp, a->ai_type, oldext);
- if (PR_GetFileInfo(ofile, &info) != PR_SUCCESS)
+ if (PR_GetFileInfo64(ofile, &info) != PR_SUCCESS)
{
slapi_ch_free_string(&ofile);
continue;
diff --git a/ldap/servers/slapd/back-ldbm/dbsize.c b/ldap/servers/slapd/back-ldbm/dbsize.c
index 43defe1..251ac03 100644
--- a/ldap/servers/slapd/back-ldbm/dbsize.c
+++ b/ldap/servers/slapd/back-ldbm/dbsize.c
@@ -47,16 +47,17 @@
#include "back-ldbm.h"
+/* TODO: make this a 64-bit return value */
int
ldbm_db_size( Slapi_PBlock *pb )
{
struct ldbminfo *li;
- unsigned int size;
+ unsigned int size; /* TODO: make this a 64-bit return value */
int rc;
slapi_pblock_get( pb, SLAPI_PLUGIN_PRIVATE, &li );
- rc = dblayer_database_size(li, &size);
- slapi_pblock_set( pb, SLAPI_DBSIZE, &size );
+ rc = dblayer_database_size(li, &size); /* TODO: make this a 64-bit return value */
+ slapi_pblock_set( pb, SLAPI_DBSIZE, &size ); /* TODO: make this a 64-bit return value */
return rc;
}
diff --git a/ldap/servers/slapd/back-ldbm/ldif2ldbm.c b/ldap/servers/slapd/back-ldbm/ldif2ldbm.c
index 8ef1d57..8818ba7 100644
--- a/ldap/servers/slapd/back-ldbm/ldif2ldbm.c
+++ b/ldap/servers/slapd/back-ldbm/ldif2ldbm.c
@@ -2620,7 +2620,7 @@ int ldbm_back_upgradedb(Slapi_PBlock *pb)
char inst_dir[MAXPATHLEN];
char *inst_dirp = NULL;
int cnt = 0;
- PRFileInfo info = {0};
+ PRFileInfo64 info = {0};
PRUint32 dbversion_flags = DBVERSION_ALL;
slapi_pblock_get(pb, SLAPI_SEQ_TYPE, &up_flags);
@@ -2750,7 +2750,7 @@ int ldbm_back_upgradedb(Slapi_PBlock *pb)
orig_dest_dir = dest_dir;
normalize_dir(dest_dir);
/* clean up the backup dir first, then create it */
- rval = PR_GetFileInfo(dest_dir, &info);
+ rval = PR_GetFileInfo64(dest_dir, &info);
if (PR_SUCCESS == rval)
{
if (PR_FILE_DIRECTORY == info.type) /* directory exists */
@@ -3071,7 +3071,7 @@ int upgradedb_delete_indices_4cmd(ldbm_instance *inst, int flags)
while (NULL != (direntry =
PR_ReadDir(dirhandle, PR_SKIP_DOT | PR_SKIP_DOT_DOT)))
{
- PRFileInfo info;
+ PRFileInfo64 info;
int len;
if (! direntry->name)
@@ -3086,7 +3086,7 @@ int upgradedb_delete_indices_4cmd(ldbm_instance *inst, int flags)
fullpathp = (char *)slapi_ch_malloc(len);
}
sprintf(fullpathp, "%s/%s", inst_dirp, direntry->name);
- rval = PR_GetFileInfo(fullpathp, &info);
+ rval = PR_GetFileInfo64(fullpathp, &info);
if (PR_SUCCESS == rval && PR_FILE_DIRECTORY != info.type)
{
PR_Delete(fullpathp);
@@ -3530,7 +3530,7 @@ int ldbm_back_upgradednformat(Slapi_PBlock *pb)
char *instance_name = NULL;
backend *be = NULL;
PRStatus prst = 0;
- PRFileInfo prfinfo = {0};
+ PRFileInfo64 prfinfo = {0};
PRDir *dirhandle = NULL;
PRDirEntry *direntry = NULL;
size_t id2entrylen = 0;
@@ -3579,7 +3579,7 @@ int ldbm_back_upgradednformat(Slapi_PBlock *pb)
slapi_pblock_get(pb, SLAPI_SEQ_VAL, &rawworkdbdir);
normalize_dir(rawworkdbdir); /* remove trailing spaces and slashes */
- prst = PR_GetFileInfo(rawworkdbdir, &prfinfo);
+ prst = PR_GetFileInfo64(rawworkdbdir, &prfinfo);
if (PR_FAILURE == prst || PR_FILE_DIRECTORY != prfinfo.type) {
slapi_log_error(SLAPI_LOG_FATAL, "Upgrade DN Format",
"Working DB instance dir %s is not a directory\n",
diff --git a/ldap/servers/slapd/back-ldbm/misc.c b/ldap/servers/slapd/back-ldbm/misc.c
index 56a8298..87262c5 100644
--- a/ldap/servers/slapd/back-ldbm/misc.c
+++ b/ldap/servers/slapd/back-ldbm/misc.c
@@ -296,7 +296,7 @@ ldbm_delete_dirs(char *path)
PRDirEntry *direntry = NULL;
char fullpath[MAXPATHLEN];
int rval = 0;
- PRFileInfo info;
+ PRFileInfo64 info;
dirhandle = PR_OpenDir(path);
if (! dirhandle)
@@ -312,7 +312,7 @@ ldbm_delete_dirs(char *path)
break;
PR_snprintf(fullpath, MAXPATHLEN, "%s/%s", path, direntry->name);
- rval = PR_GetFileInfo(fullpath, &info);
+ rval = PR_GetFileInfo64(fullpath, &info);
if (PR_SUCCESS == rval)
{
if (PR_FILE_DIRECTORY == info.type)
@@ -343,11 +343,11 @@ get_sep(char *path)
int
mkdir_p(char *dir, unsigned int mode)
{
- PRFileInfo info;
+ PRFileInfo64 info;
int rval;
char sep = get_sep(dir);
- rval = PR_GetFileInfo(dir, &info);
+ rval = PR_GetFileInfo64(dir, &info);
if (PR_SUCCESS == rval)
{
if (PR_FILE_DIRECTORY != info.type) /* not a directory */
diff --git a/ldap/servers/slapd/config.c b/ldap/servers/slapd/config.c
index 3edc24b..724b8d0 100644
--- a/ldap/servers/slapd/config.c
+++ b/ldap/servers/slapd/config.c
@@ -157,10 +157,10 @@ int
slapd_bootstrap_config(const char *configdir)
{
char configfile[MAXPATHLEN+1];
- PRFileInfo prfinfo;
- int rc = 0; /* Fail */
+ PRFileInfo64 prfinfo;
+ int rc = 0; /* Fail */
int done = 0;
- PRInt32 nr = 0;
+ PRInt32 nr = 0;
PRFileDesc *prfd = 0;
char *buf = 0;
char *lastp = 0;
@@ -182,7 +182,7 @@ slapd_bootstrap_config(const char *configdir)
rc = dse_check_file(configfile, tmpfile);
}
- if ( (rc = PR_GetFileInfo( configfile, &prfinfo )) != PR_SUCCESS )
+ if ( (rc = PR_GetFileInfo64( configfile, &prfinfo )) != PR_SUCCESS )
{
PRErrorCode prerr = PR_GetError();
slapi_log_error(SLAPI_LOG_FATAL, "config", "The given config file %s could not be accessed, " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n",
@@ -203,7 +203,7 @@ slapd_bootstrap_config(const char *configdir)
buf = slapi_ch_malloc( prfinfo.size + 1 );
if (( nr = slapi_read_buffer( prfd, buf, prfinfo.size )) < 0 )
{
- slapi_log_error(SLAPI_LOG_FATAL, "config", "Could only read %d of %d bytes from config file %s\n",
+ slapi_log_error(SLAPI_LOG_FATAL, "config", "Could only read %d of %ld bytes from config file %s\n",
nr, prfinfo.size, configfile);
rc = 0; /* Fail */
done= 1;
diff --git a/ldap/servers/slapd/dse.c b/ldap/servers/slapd/dse.c
index 7896fc9..ab7448c 100644
--- a/ldap/servers/slapd/dse.c
+++ b/ldap/servers/slapd/dse.c
@@ -660,9 +660,9 @@ int
dse_check_file(char *filename, char *backupname)
{
int rc= 0; /* Fail */
- PRFileInfo prfinfo;
+ PRFileInfo64 prfinfo;
- if (PR_GetFileInfo( filename, &prfinfo ) == PR_SUCCESS) {
+ if (PR_GetFileInfo64( filename, &prfinfo ) == PR_SUCCESS) {
if ( prfinfo.size > 0)
return (1);
else {
@@ -675,7 +675,7 @@ dse_check_file(char *filename, char *backupname)
else
return (0);
- if ( PR_GetFileInfo( filename, &prfinfo ) == PR_SUCCESS && prfinfo.size > 0 ) {
+ if ( PR_GetFileInfo64( filename, &prfinfo ) == PR_SUCCESS && prfinfo.size > 0 ) {
slapi_log_error(SLAPI_LOG_FATAL, "dse",
"The configuration file %s was restored from backup %s\n", filename, backupname);
return (1);
@@ -696,7 +696,7 @@ dse_read_one_file(struct dse *pdse, const char *filename, Slapi_PBlock *pb,
char *lastp = NULL;
int rc= 0; /* Fail */
PRInt32 nr = 0;
- PRFileInfo prfinfo;
+ PRFileInfo64 prfinfo;
PRFileDesc *prfd = 0;
int schema_flags = 0;
@@ -709,7 +709,7 @@ dse_read_one_file(struct dse *pdse, const char *filename, Slapi_PBlock *pb,
if (!rc)
rc = dse_check_file((char *)filename, pdse->dse_fileback);
- if ( (rc = PR_GetFileInfo( filename, &prfinfo )) != PR_SUCCESS )
+ if ( (rc = PR_GetFileInfo64( filename, &prfinfo )) != PR_SUCCESS )
{
slapi_log_error(SLAPI_LOG_FATAL, "dse",
"The configuration file %s could not be accessed, error %d\n",
@@ -733,7 +733,7 @@ dse_read_one_file(struct dse *pdse, const char *filename, Slapi_PBlock *pb,
if (( nr = slapi_read_buffer( prfd, buf, prfinfo.size )) < 0 )
{
slapi_log_error(SLAPI_LOG_FATAL, "dse",
- "Could only read %d of %d bytes from config file %s\n",
+ "Could only read %d of %ld bytes from config file %s\n",
nr, prfinfo.size, filename);
rc = 0; /* Fail */
done= 1;
diff --git a/ldap/servers/slapd/getfilelist.c b/ldap/servers/slapd/getfilelist.c
index c8dd8f9..64c3e51 100644
--- a/ldap/servers/slapd/getfilelist.c
+++ b/ldap/servers/slapd/getfilelist.c
@@ -93,10 +93,10 @@ free_string(caddr_t data)
static int
file_is_type_x(const char *dirname, const char *filename, PRFileType x)
{
- struct PRFileInfo inf;
+ struct PRFileInfo64 inf;
int status = 0;
char *fullpath = slapi_ch_smprintf("%s/%s", dirname, filename);
- if (PR_SUCCESS == PR_GetFileInfo(fullpath, &inf) &&
+ if (PR_SUCCESS == PR_GetFileInfo64(fullpath, &inf) &&
inf.type == x)
status = 1;
diff --git a/ldap/servers/slapd/test-plugins/testdbinterop.c b/ldap/servers/slapd/test-plugins/testdbinterop.c
index 0397654..5ff730f 100644
--- a/ldap/servers/slapd/test-plugins/testdbinterop.c
+++ b/ldap/servers/slapd/test-plugins/testdbinterop.c
@@ -155,7 +155,7 @@ db_put_dn(char *data_dn)
int ret;
char *db_path = DATABASE;
char *db_path_bak = DATABASE_BACK;
- PRFileInfo info;
+ PRFileInfo64 info;
PRFileDesc *prfd;
PRInt32 data_sz;
char *data_dnp = NULL;
@@ -165,10 +165,10 @@ db_put_dn(char *data_dn)
}
PR_Lock(db_lock);
/* if db_path is a directory, rename it */
- ret = PR_GetFileInfo(db_path, &info);
+ ret = PR_GetFileInfo64(db_path, &info);
if (PR_SUCCESS == ret) {
if (PR_FILE_DIRECTORY == info.type) { /* directory */
- ret = PR_GetFileInfo(db_path_bak, &info);
+ ret = PR_GetFileInfo64(db_path_bak, &info);
if (PR_SUCCESS == ret) {
if (PR_FILE_DIRECTORY != info.type) { /* not a directory */
PR_Delete(db_path_bak);
diff --git a/ldap/servers/slapd/tools/pwenc.c b/ldap/servers/slapd/tools/pwenc.c
index 221398c..29f3e1a 100644
--- a/ldap/servers/slapd/tools/pwenc.c
+++ b/ldap/servers/slapd/tools/pwenc.c
@@ -304,10 +304,10 @@ static int
slapd_config(const char *configdir, const char *givenconfigfile)
{
char configfile[MAXPATHLEN+1];
- PRFileInfo prfinfo;
- int rc = 0; /* Fail */
+ PRFileInfo64 prfinfo;
+ int rc = 0; /* Fail */
int done = 0;
- PRInt32 nr = 0;
+ PRInt32 nr = 0;
PRFileDesc *prfd = 0;
char *buf = 0;
char *lastp = 0;
@@ -318,7 +318,7 @@ slapd_config(const char *configdir, const char *givenconfigfile)
}
PR_snprintf(configfile, sizeof(configfile), "%s/%s", configdir, givenconfigfile);
- if ( (rc = PR_GetFileInfo( configfile, &prfinfo )) != PR_SUCCESS )
+ if ( (rc = PR_GetFileInfo64( configfile, &prfinfo )) != PR_SUCCESS )
{
fprintf(stderr,
"The given config file %s could not be accessed, error %d\n",
@@ -340,7 +340,7 @@ slapd_config(const char *configdir, const char *givenconfigfile)
if (( nr = slapi_read_buffer( prfd, buf, prfinfo.size )) < 0 )
{
fprintf(stderr,
- "Could only read %d of %d bytes from config file %s\n",
+ "Could only read %d of %ld bytes from config file %s\n",
nr, prfinfo.size, configfile);
exit( 1 );
}
11 years
ldap/servers
by Mark Reynolds
ldap/servers/plugins/replication/repl5_inc_protocol.c | 57 +++++++++++-------
1 file changed, 37 insertions(+), 20 deletions(-)
New commits:
commit 67233f5c6adb47fce4093f63bdf3dec30f336af6
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Tue Apr 2 11:12:52 2013 -0400
Ticket 631 - Replication: "Incremental update started" status message without consumer initialized
Bug Description: If you just setup repl agmts, without initializing, the status message makes it appear
that replication is running successfully when in fact it has not "really" started.
Then for the status attributes: nsds5replicaLastUpdateStart & nsds5replicaLastUpdateEnd,
these do not appear to report the expected results - as no updates have actually been sent.
Currently these just report when the protocol wakes up & stops, it has nothing to do with
sending updates.
Fix Description: If we determine that the remote replica is not initialized, or might need to be
initialized, then update the status accordingly. As for the start and end update
times, I changed it to record the actual start/end time from send_updates(). Previously
it just recorded when the protocol started up and stopped. This was not useful, and
often misunderstood.
https://fedorahosted.org/389/ticket/631
Reviewed by: richm & noriko(Thanks!!)
diff --git a/ldap/servers/plugins/replication/repl5_inc_protocol.c b/ldap/servers/plugins/replication/repl5_inc_protocol.c
index 222bb97..72d2d6c 100644
--- a/ldap/servers/plugins/replication/repl5_inc_protocol.c
+++ b/ldap/servers/plugins/replication/repl5_inc_protocol.c
@@ -618,26 +618,24 @@ set_pause_and_busy_time(Private_Repl_Protocol *prp, long *pausetime, long *busyw
static void
repl5_inc_run(Private_Repl_Protocol *prp)
{
- int current_state = STATE_START;
- int next_state = STATE_START;
repl5_inc_private *prp_priv = (repl5_inc_private *)prp->private;
- int done;
- int e1;
- RUV *ruv = NULL;
- CSN *cons_schema_csn;
Replica *replica = NULL;
- int wait_change_timer_set = 0;
- time_t last_start_time;
+ CSN *cons_schema_csn;
+ RUV *ruv = NULL;
PRUint32 num_changes_sent;
/* use a different backoff timer strategy for ACQUIRE_REPLICA_BUSY errors */
PRBool use_busy_backoff_timer = PR_FALSE;
- long pausetime = 0;
+ time_t next_fire_time;
+ time_t now;
long busywaittime = 0;
+ long pausetime = 0;
long loops = 0;
+ int wait_change_timer_set = 0;
+ int current_state = STATE_START;
+ int next_state = STATE_START;
int optype, ldaprc;
- time_t next_fire_time;
- time_t now;
-
+ int done;
+ int e1;
prp->stopped = 0;
prp->terminate = 0;
@@ -807,7 +805,7 @@ repl5_inc_run(Private_Repl_Protocol *prp)
int optype, ldaprc;
conn_get_error(prp->conn, &optype, &ldaprc);
agmt_set_last_update_status(prp->agmt, ldaprc,
- prp->last_acquire_response_code, NULL);
+ prp->last_acquire_response_code, "Unable to acquire replica");
}
object_release(prp->replica_object);
@@ -896,7 +894,7 @@ repl5_inc_run(Private_Repl_Protocol *prp)
}
if (rc != ACQUIRE_SUCCESS){
conn_get_error(prp->conn, &optype, &ldaprc);
- agmt_set_last_update_status(prp->agmt, ldaprc, prp->last_acquire_response_code, NULL);
+ agmt_set_last_update_status(prp->agmt, ldaprc, prp->last_acquire_response_code, "Unable to acquire replica");
}
/*
* We either need to step the backoff timer, or
@@ -943,10 +941,7 @@ repl5_inc_run(Private_Repl_Protocol *prp)
case STATE_SENDING_UPDATES:
dev_debug("repl5_inc_run(STATE_SENDING_UPDATES)");
- agmt_set_update_in_progress(prp->agmt, PR_TRUE);
num_changes_sent = 0;
- last_start_time = current_time();
- agmt_set_last_update_start(prp->agmt, last_start_time);
/*
* We've acquired the replica, and are ready to send any needed updates.
*/
@@ -1001,6 +996,7 @@ repl5_inc_run(Private_Repl_Protocol *prp)
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name,
"%s: Replica has no update vector. It has never been initialized.\n",
agmt_get_long_name(prp->agmt));
+ agmt_set_last_update_status(prp->agmt, 0, rc, "Replica is not initialized");
next_state = STATE_BACKOFF_START;
break;
case EXAMINE_RUV_GENERATION_MISMATCH:
@@ -1008,6 +1004,8 @@ repl5_inc_run(Private_Repl_Protocol *prp)
"%s: The remote replica has a different database generation ID than "
"the local database. You may have to reinitialize the remote replica, "
"or the local replica.\n", agmt_get_long_name(prp->agmt));
+ agmt_set_last_update_status(prp->agmt, 0, rc, "Replica has different database "
+ "generation ID, remote replica may need to be initialized");
next_state = STATE_BACKOFF_START;
break;
case EXAMINE_RUV_REPLICA_TOO_OLD:
@@ -1015,6 +1013,7 @@ repl5_inc_run(Private_Repl_Protocol *prp)
"%s: Replica update vector is too out of date to bring "
"into sync using the incremental protocol. The replica "
"must be reinitialized.\n", agmt_get_long_name(prp->agmt));
+ agmt_set_last_update_status(prp->agmt, 0, rc, "Replica needs to be reinitialized");
next_state = STATE_BACKOFF_START;
break;
case EXAMINE_RUV_OK:
@@ -1036,6 +1035,15 @@ repl5_inc_run(Private_Repl_Protocol *prp)
agmt_get_long_name(prp->agmt));
next_state = STATE_STOP_FATAL_ERROR;
} else {
+ /*
+ * Reset our update times and status
+ */
+ agmt_set_last_update_start(prp->agmt, current_time());
+ agmt_set_last_update_end(prp->agmt, 0);
+ agmt_set_update_in_progress(prp->agmt, PR_TRUE);
+ /*
+ * Send the updates
+ */
rc = send_updates(prp, ruv, &num_changes_sent);
if (rc == UPDATE_NO_MORE_UPDATES){
dev_debug("repl5_inc_run(STATE_SENDING_UPDATES) -> send_updates = UPDATE_NO_MORE_UPDATES -> STATE_WAIT_CHANGES");
@@ -1047,6 +1055,7 @@ repl5_inc_run(Private_Repl_Protocol *prp)
next_state = STATE_BACKOFF_START;
} else if (rc == UPDATE_TRANSIENT_ERROR){
dev_debug("repl5_inc_run(STATE_SENDING_UPDATES) -> send_updates = UPDATE_TRANSIENT_ERROR -> STATE_BACKOFF_START");
+ agmt_set_last_update_status(prp->agmt, 0, rc, "Incremental update transient error. Backing off, will retry update later.");
next_state = STATE_BACKOFF_START;
} else if (rc == UPDATE_FATAL_ERROR){
dev_debug("repl5_inc_run(STATE_SENDING_UPDATES) -> send_updates = UPDATE_FATAL_ERROR -> STATE_STOP_FATAL_ERROR");
@@ -1063,21 +1072,29 @@ repl5_inc_run(Private_Repl_Protocol *prp)
conn_disconnect (prp->conn);
} else if (rc == UPDATE_CONNECTION_LOST){
dev_debug("repl5_inc_run(STATE_SENDING_UPDATES) -> send_updates = UPDATE_CONNECTION_LOST -> STATE_BACKOFF_START");
+ agmt_set_last_update_status(prp->agmt, 0, rc, "Incremental update connection error. Backing off, will retry update later.");
next_state = STATE_BACKOFF_START;
} else if (rc == UPDATE_TIMEOUT){
dev_debug("repl5_inc_run(STATE_SENDING_UPDATES) -> send_updates = UPDATE_TIMEOUT -> STATE_BACKOFF_START");
+ agmt_set_last_update_status(prp->agmt, 0, rc, "Incremental update timeout error. Backing off, will retry update later.");
next_state = STATE_BACKOFF_START;
}
+ /* Set the updates times based off the result of send_updates() */
+ if(rc == UPDATE_NO_MORE_UPDATES){
+ /* update successful, set the end time */
+ agmt_set_last_update_end(prp->agmt, current_time());
+ } else {
+ /* Failed to send updates, reset the start time to zero */
+ agmt_set_last_update_start(prp->agmt, 0);
+ }
+ agmt_set_update_in_progress(prp->agmt, PR_FALSE);
}
- last_start_time = 0UL;
break;
}
if (NULL != ruv){
ruv_destroy(&ruv); ruv = NULL;
}
- agmt_set_last_update_end(prp->agmt, current_time());
- agmt_set_update_in_progress(prp->agmt, PR_FALSE);
agmt_update_done(prp->agmt, 0);
/* If timed out, close the connection after released the replica */
release_replica(prp);
11 years
ldap/servers
by Mark Reynolds
ldap/servers/plugins/posix-winsync/posix-group-func.c | 4 ++--
ldap/servers/plugins/posix-winsync/posix-group-func.h | 2 +-
ldap/servers/plugins/posix-winsync/posix-winsync.c | 18 ++++++------------
ldap/servers/slapd/pw.c | 2 +-
4 files changed, 10 insertions(+), 16 deletions(-)
New commits:
commit f9c92691277f7ebb468cc22e3bff74a2b6c14c5a
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Tue Apr 2 16:59:19 2013 -0400
Ticket 550 - posix winsync will not create memberuid values if group entry become posix group in the same sync interval
Description: Posix winsync plugin can create memberUid values according the uniquemember values.
prerequisite is that the group is already a posix group. Will add the posix attributes
(gid) and the group members on the AD on the same time, so it occurs in the same sync
interval and the memberUid values will not generated.
This was from the ticket reporter: cgrzemba.
This patch has been modified to work with 1.3.1
Also fixed a compiler warning in pw.c(different issue)
https://fedorahosted.org/389/ticket/550
Reviewed by: noriko & richm(Thanks!!)
diff --git a/ldap/servers/plugins/posix-winsync/posix-group-func.c b/ldap/servers/plugins/posix-winsync/posix-group-func.c
index 9d744ba..7e069be 100644
--- a/ldap/servers/plugins/posix-winsync/posix-group-func.c
+++ b/ldap/servers/plugins/posix-winsync/posix-group-func.c
@@ -628,7 +628,7 @@ propogateDeletionsUpward(Slapi_Entry *entry, const Slapi_DN *base_sdn, Slapi_Val
}
int
-modGroupMembership(Slapi_Entry *entry, Slapi_Mods *smods, int *do_modify)
+modGroupMembership(Slapi_Entry *entry, Slapi_Mods *smods, int *do_modify, int newposixgroup)
{
slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "modGroupMembership: ==>\n");
slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "modGroupMembership: Modding %s\n",
@@ -636,7 +636,7 @@ modGroupMembership(Slapi_Entry *entry, Slapi_Mods *smods, int *do_modify)
int posixGroup = hasObjectClass(entry, "posixGroup");
- if (!(posixGroup || hasObjectClass(entry, "ntGroup"))) {
+ if (!(posixGroup || hasObjectClass(entry, "ntGroup")) && !newposixgroup) {
slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME,
"modGroupMembership end: Not a posixGroup or ntGroup\n");
return 0;
diff --git a/ldap/servers/plugins/posix-winsync/posix-group-func.h b/ldap/servers/plugins/posix-winsync/posix-group-func.h
index 0f0ae37..85e5235 100644
--- a/ldap/servers/plugins/posix-winsync/posix-group-func.h
+++ b/ldap/servers/plugins/posix-winsync/posix-group-func.h
@@ -11,7 +11,7 @@ Slapi_PBlock * dnHasObjectClass( const char *baseDN, const char *objectClass, Sl
char * searchUid(const char *udn);
int dn_in_set(const char* uid, char **uids);
*/
-int modGroupMembership(Slapi_Entry *entry, Slapi_Mods *smods, int *do_modify);
+int modGroupMembership(Slapi_Entry *entry, Slapi_Mods *smods, int *do_modify, int newposixgroup);
int addGroupMembership(Slapi_Entry *entry, Slapi_Entry *ad_entry);
char * searchUid(const char *udn);
void memberUidLock();
diff --git a/ldap/servers/plugins/posix-winsync/posix-winsync.c b/ldap/servers/plugins/posix-winsync/posix-winsync.c
index 92a3a79..f40f5ff 100644
--- a/ldap/servers/plugins/posix-winsync/posix-winsync.c
+++ b/ldap/servers/plugins/posix-winsync/posix-winsync.c
@@ -958,11 +958,6 @@ posix_winsync_pre_ds_mod_group_cb(void *cbdata, const Slapi_Entry *rawentry, Sla
slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name,
"_pre_ds_mod_group_cb present %d modify %d before\n", is_present_local,
do_modify_local);
- if (posix_winsync_config_get_mapMemberUid() || posix_winsync_config_get_mapNestedGrouping()) {
- memberUidLock();
- modGroupMembership(ds_entry, smods, do_modify);
- memberUidUnlock();
- }
slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name,
"_pre_ds_mod_group_cb present %d modify %d\n", is_present_local,
@@ -985,19 +980,18 @@ posix_winsync_pre_ds_mod_group_cb(void *cbdata, const Slapi_Entry *rawentry, Sla
"_pre_ds_mod_group_cb add oc:posixGroup\n");
slapi_mods_add_mod_values(smods, LDAP_MOD_REPLACE, "objectClass",
valueset_get_valuearray(oc_vs));
- slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name,
- "_pre_ds_mod_group_cb step\n");
slapi_value_free(&oc_nv);
- slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name,
- "_pre_ds_mod_group_cb step\n");
slapi_valueset_free(oc_vs);
- slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name,
- "_pre_ds_mod_group_cb step\n");
}
slapi_value_free(&voc);
}
- slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "_pre_ds_mod_group_cb step\n");
+ if (posix_winsync_config_get_mapMemberUid() || posix_winsync_config_get_mapNestedGrouping()) {
+ memberUidLock();
+ modGroupMembership(ds_entry, smods, do_modify, do_modify_local);
+ memberUidUnlock();
+ }
+ slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "_pre_ds_mod_group_cb step\n");
if (slapi_is_loglevel_set(SLAPI_LOG_PLUGIN)) {
for (mod = slapi_mods_get_first_mod(smods); mod; mod = slapi_mods_get_next_mod(smods)) {
slapi_mod_dump(mod, 0);
diff --git a/ldap/servers/slapd/pw.c b/ldap/servers/slapd/pw.c
index ae94903..eb4ebd4 100644
--- a/ldap/servers/slapd/pw.c
+++ b/ldap/servers/slapd/pw.c
@@ -1535,7 +1535,7 @@ pw_get_admin_users(passwdPolicy *pwp)
const Slapi_DN *sdn = pwp->pw_admin;
char **uniquemember_vals = NULL;
char **member_vals = NULL;
- char *binddn = slapi_sdn_get_dn(sdn);
+ const char *binddn = slapi_sdn_get_dn(sdn);
int uniquemember_count = 0;
int member_count = 0;
int nentries = 0;
11 years
ldap/servers
by Richard Allen Megginson
ldap/servers/slapd/tools/ldclt/ldapfct.c | 34 +++++++++++-----------------
ldap/servers/slapd/tools/ldclt/threadMain.c | 18 ++++----------
ldap/servers/slapd/tools/ldclt/utils.c | 12 +++++++--
ldap/servers/slapd/tools/ldclt/utils.h | 1
4 files changed, 30 insertions(+), 35 deletions(-)
New commits:
commit 0472b98440698a2dd87b0eb17431c3eb99762e37
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Wed Mar 27 12:32:45 2013 -0600
Ticket #613 - ldclt: add timestamp, interval, nozeropad, other improvements
https://fedorahosted.org/389/ticket/613
Reviewed by: nhosoi (Thanks!)
Branch: master
Fix Description: Was not wrapping incremental value properly. Use better
modulo based algorithm and use a common function for this algorithm.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/slapd/tools/ldclt/ldapfct.c b/ldap/servers/slapd/tools/ldclt/ldapfct.c
index f83a456..1d0a0d4 100644
--- a/ldap/servers/slapd/tools/ldclt/ldapfct.c
+++ b/ldap/servers/slapd/tools/ldclt/ldapfct.c
@@ -1495,30 +1495,24 @@ buildRandomRdnOrFilter (
{
if (mctx.mode & COMMON_COUNTER) /*JLS 14-03-01*/
{ /*JLS 14-03-01*/
- int val; /*JLS 14-03-01*/
- val = incrementCommonCounter (tttctx); /*JLS 14-03-01*/
+ int val = incrementCommonCounter (tttctx); /*JLS 14-03-01*/
if (val == -1) /*JLS 14-03-01*/
return (-1); /*JLS 14-03-01*/
sprintf (tttctx->buf2, "%0*d", (mctx.mod2 & M2_NOZEROPAD) ? 0 : mctx.randomNbDigit, val);/*JLS 14-03-01*/
} /*JLS 14-03-01*/
- else /*JLS 14-03-01*/
- { /*JLS 14-03-01*/
- tttctx->lastVal += mctx.incr;
- if (tttctx->lastVal > mctx.randomHigh)
- {
- if (!(mctx.mode & NOLOOP))
- tttctx->lastVal = mctx.randomLow;
- else
- {
- /*
- * Well, there is no clean way to exit. Let's use the error
- * condition and hope all will be ok.
- */
- printf ("ldclt[%d]: %s: Hit top incremental value\n",
- mctx.pid, tttctx->thrdId);
- return (-1);
- }
- }
+ else if ((mctx.mode & NOLOOP) && ((tttctx->lastVal + mctx.incr) > mctx.randomHigh))
+ {
+ /*
+ * Well, there is no clean way to exit. Let's use the error
+ * condition and hope all will be ok.
+ */
+ printf ("ldclt[%d]: %s: Hit top incremental value %d > %d\n",
+ mctx.pid, tttctx->thrdId, (tttctx->lastVal + mctx.incr), mctx.randomHigh);
+ return (-1);
+ }
+ else
+ {
+ tttctx->lastVal = incr_and_wrap(tttctx->lastVal, mctx.randomLow, mctx.randomHigh, mctx.incr);
sprintf (tttctx->buf2, "%0*d", (mctx.mod2 & M2_NOZEROPAD) ? 0 : mctx.randomNbDigit, tttctx->lastVal);
} /*JLS 14-03-01*/
diff --git a/ldap/servers/slapd/tools/ldclt/threadMain.c b/ldap/servers/slapd/tools/ldclt/threadMain.c
index 3b53a62..7af76d4 100644
--- a/ldap/servers/slapd/tools/ldclt/threadMain.c
+++ b/ldap/servers/slapd/tools/ldclt/threadMain.c
@@ -343,19 +343,13 @@ incrementCommonCounter (
/*
* Compute next value
*/
- if ((mctx.mode & NOLOOP) && (mctx.lastVal >= mctx.randomHigh))
- val = -1;
+ if ((mctx.mode & NOLOOP) && ((mctx.lastVal + mctx.incr) > mctx.randomHigh))
+ {
+ val = -1; /* out of range - cannot continue since not looping */
+ }
else
{
- mctx.lastVal += mctx.incr;
- if (mctx.lastVal > mctx.randomHigh)
- {
- if (mctx.mode & NOLOOP)
- val = -1;
- else
- mctx.lastVal -= (mctx.randomHigh-mctx.incr) + mctx.randomLow;
- }
- val = mctx.lastVal;
+ val = mctx.lastVal = incr_and_wrap(mctx.lastVal, mctx.randomLow, mctx.randomHigh, mctx.incr);
}
/*
@@ -373,7 +367,7 @@ incrementCommonCounter (
* Maybe a message to print ?
*/
if (val < 0)
- printf ("ldclt[%d]: T%03d: Hit top incrementeal value\n", mctx.pid, tttctx->thrdNum);
+ printf ("ldclt[%d]: T%03d: Hit top incremental value\n", mctx.pid, tttctx->thrdNum);
return (val);
}
diff --git a/ldap/servers/slapd/tools/ldclt/utils.c b/ldap/servers/slapd/tools/ldclt/utils.c
index 3e3d60b..80a429c 100644
--- a/ldap/servers/slapd/tools/ldclt/utils.c
+++ b/ldap/servers/slapd/tools/ldclt/utils.c
@@ -324,9 +324,15 @@ rndstr (
buf[charNum] = '\0';
}
-
-
-
+/* increment val - if val > max, wrap value around to start over at min */
+/* the range is max - min + 1 = number of possible values */
+/* the new value is (((val + incr) - min) % range) + min */
+int
+incr_and_wrap(int val, int min, int max, int incr)
+{
+ int range = max - min + 1;
+ return (((val + incr) - min) % range) + min;
+}
diff --git a/ldap/servers/slapd/tools/ldclt/utils.h b/ldap/servers/slapd/tools/ldclt/utils.h
index 52b6e81..dfb8ef6 100644
--- a/ldap/servers/slapd/tools/ldclt/utils.h
+++ b/ldap/servers/slapd/tools/ldclt/utils.h
@@ -76,6 +76,7 @@ extern void rnd (char *buf, int low, int high, int ndigits);
extern int rndlim (int low, int high);
extern void rndstr (char *buf, int ndigits);
extern int utilsInit (void);
+extern int incr_and_wrap(int val, int min, int max, int incr);
/* End of file */
11 years
Changes to 'refs/tags/389-admin-1.1.33'
by Noriko Hosoi
Changes since 389-admin-1.1.11:
Endi S. Dewata (3):
Bug 573889 - Migration does not remove deprecated schema
Bug 644929 - FDS to 389 DS migration results in both Fedora and 389 entries
Bug 470576 - Migration could do addition checks before commiting actions
Mark Reynolds (3):
Ticket #286 - compilation fixes for 'format-security'
Ticket 401 - Console login fails with anonymous access disabled
Ticket 400 - BIND operation result not checked properly in admin server
Nathan Kinder (43):
Bug 648949 - Merge selinux policy into base OS
Regenerated autoconf files
Bug 638511 - dirsrv-admin crashes at startup with SELinux enabled
Bug 668950 - Add posix group support to Console
Bug 672468 - Don't use empty path elements in LD_LIBRARY_PATH
Bug 618897 - Wrong permissions when creating instance from Console
Bug 493424 - remove unneeded modules for admin server apache config
Bug 614690 - Don't use exec to call genrb
Bug 699815 - (cov#10859) Add missing braces in mod_admserv code
Bug 699815 - (cov#10858) getenv() called twice in viewlog cgi
Bug 699815 - (cov#10849,10851) Remove unused variables
Bug 699907 - (cov#10844) Uninitialized time struct
Bug 699907 - (cov#10843) Use of uninitialized variable in logging code
Bug 699907 - (cov#10840) Use of uninitialized buffer in security cgi
Bug 699907 - (cov#10836) Use of uninitialized var in http conn code
Bug 699907 - (cov#10833) Use of uninitialized vars in SNMP code
Bug 700532 - (cov#10832) Incorrect if condition in dsalib
Bug 700875 - (cov#10778) Cleanup ds_bring_up_server_install() in dsalib
Bug 700890 - (cov#10812) Check return value of open() properly in libadmin
Bug 700948 - (cov#10846) - Use of uninitialized variable in mod_admserv
Bug 700948 - (cov#10845) Use of uninitialized variable in mod_admserv
Bug 700948 - (cov#10839) Use of uninitialized variable in security cgi
Bug 700948 - (cov#10837) Use of uninitialized variable in monreplication
Bug 700948 - (cov#10835) Use of unitialized pointer in config cgi
Bug 700948 - (cov#10813) dynamic overrun possibility in ds_listdb cgi
Bug 700948 - (cov#10842) Use of unintialized variable in statusping
Bug 700948 - (cov#10842) Use of unintialized variable in statusping
Bug 702150 - (cov#10823) File descriptors leaked in help cgi
Bug 702150 - (cov#10822,10821) file descriptor leaks in config cgi
Bug 702150 - (cov#10820,10819) file descriptor leaks in readlog cgi
Bug 702150 - leak of config array in dsalib
Bug 702150 - (cov#10816) file descriptor leak in dsalib
Bug 702150 - (cov#10817) Leak of string in libdsa
Bug 702150 - Resouce leaks in htmladmin.c
Bug 702705 - (cov#10830) NULL pointer dereference in htmladmin
Bug 702705 - NULL pointer dereferences in viewlog cgi
Bug 702705 - (cov#10803) NULL pointer dereference in security cgi
Bug 702705 - (cov#10785) NULL pointer dereference in ds_snmpctrl
Bug 702705 - (cov#10784,10783) NULL pointer dereferences in dsalib
Bug 719056 - migrate-ds-admin.pl needs to update SELinux policy
Bug 724808 - startup CGIs write temp file to /
Bug 730079 - Update SELinux policy during upgrades
Ticket #329 - Port modules to httpd 2.4
Noriko Hosoi (20):
Bug 151705 - Need to update Console Cipher Preferences with new ciphers
start-ds-admin.in -- replaced "return 1" with "exit 1"
Bug 616260 - libds-admin-serv linking fails due to unresolved link-time dependencies
Bug 618858 - move start-ds-admin env file into main admin server
Bug 387981 - plain files can be chosen on the Restore Directory dialog
Bug 604881 - admin server log files have incorrect permissions/ownerships
Bug 604881 - admin server log files have incorrect permissions/ownerships
Bug 245278 - Changing to a password with a single quote does not work
Bug 211296 - Clean up all HTML pages (Admin Express, Repl Monitor, etc)
Bug 158926 - Unable to install CA certificate when using
Bug 476925 - Admin Server: Do not allow 8-bit passwords for the admin user
Bug 476925 - Admin Server: Do not allow 8-bit passwords for
Trac Ticket #307 - htmladmin keeps segfaulting
If htmladmin fails to connect to the server, the cgi could crash.
Ticket #293 - remove-ds-admin.pl does not remove everything
Ticket #476 - 389 ds do not start on F18 due to missing modules
bump version to 1.1.31
Ticket #567 - Restart of Admin server from console fails on segfault
bump version to 1.1.32
bump version to 1.1.33
Rich Megginson (52):
bump version to 1.1.12.a1
initial support for openldap
add selinux policy for dsgw
skip LD_PRELOAD if using openldap
add more log information if nss init fails
add even more nss debugging
Bug 618454 - mod_admserv should only clear NSS caches and shutdown if NSS is initialized
bump version to 1.1.12.a2
fix building with mozldap
bump version to 1.1.12.a3
fix autotool build issues with properties files
setup-ds-admin.pl -u exits with ServerAdminID and as_uid related error
Bug 656441 - Missing library path entry causes LD_PRELOAD error
bump version to 1.1.13
bump version to 1.1.14.a1
Bug 664671 - Admin server segfault when full SSL access (http+ldap+console) required
bump version to 1.1.14
bump version to 1.1.15
bump version to 1.1.16
Bug 703990 - Support upgrade from Red Hat Directory Server
bump version to 1.1.17
add support for different skins
skip rebranding current brand
bump version to 1.1.18
look for separate openldap ldif library
bump version to 1.1.19
Bug 710372 - Not able to open the Manage Certificate from DS-console
better NSS error handling - reduce memory leaks
fix typo in NSS_Shutdown warning message
added tests for the security cgi
Bug 713000 - Migration stops if old admin server cannot be stopped
Bug 718079 - Perl errors when running migrate-ds-admin.pl
Bug 718285 - AdminServer should use "service" command instead of start/stop/restart scripts
bump version to 1.1.20
bump version to 1.1.21
handle binary upgrade
add man pages for ds_removal and ds_unregister
bump version to 1.1.22
fix binary paths
bump version to 1.1.23
bump version to 1.1.24
Bug 695741 - Providing native systemd file for upcoming F16 Feature Systemd
Bug 740959 - 389-console put CA certificates into wrong database
bump version to 1.1.25
Bug 767823 - selinux: need to allow admin server to connect to ldap port
bump version to 1.1.26
Ticket #161 - Review and address latest Coverity issues
Ticket #281 - TLS not working with latest openldap
bump version to 1.1.27
bump version to 1.1.28
bump version to 1.1.29
bump version to 1.1.30
noriko (1):
Ticket #47298 - remove-ds-admin.pl does not stop the admin server
---
Makefile.am | 109
Makefile.in | 1767 -
VERSION.sh | 4
aclocal.m4 | 7258 ----
admserv/cfgstuff/httpd-2.2.conf.in | 13
admserv/cfgstuff/httpd-2.4.conf.in | 742
admserv/cfgstuff/httpd.conf.in | 2
admserv/cfgstuff/initconfig.in | 5
admserv/cfgstuff/start-ds-admin.in | 83
admserv/cgi-ds/ds_listdb.c | 26
admserv/cgi-ds/ds_snmpctrl.c | 5
admserv/cgi-src40/ReadLog.c | 18
admserv/cgi-src40/admlib.mk | 119
admserv/cgi-src40/admpw.c | 70
admserv/cgi-src40/cgicommon.h | 1
admserv/cgi-src40/cgicommon.properties | 3
admserv/cgi-src40/config.c | 34
admserv/cgi-src40/dllglue.c | 42
admserv/cgi-src40/ds_create.in | 6
admserv/cgi-src40/dsconfig.c | 9
admserv/cgi-src40/head.html | 1
admserv/cgi-src40/help.c | 15
admserv/cgi-src40/htmladmin.c | 809
admserv/cgi-src40/htmladmin.properties | 42
admserv/cgi-src40/monreplication.c | 6
admserv/cgi-src40/repl-monitor-cgi.pl.in | 37
admserv/cgi-src40/restartsrv.c | 8
admserv/cgi-src40/sec-activate.c | 21
admserv/cgi-src40/security.c | 196
admserv/cgi-src40/statpingserv.c | 81
admserv/cgi-src40/stopsrv.c | 9
admserv/cgi-src40/ugdsconfig.c | 38
admserv/cgi-src40/viewdata.c | 156
admserv/cgi-src40/viewdata.properties | 2
admserv/cgi-src40/viewlog.c | 74
admserv/cgi-src40/viewlog.properties | 6
admserv/genrb_wrapper.sh | 2
admserv/html/admserv.html.in | 11
admserv/html/htmladmin.html.in | 13
admserv/html/monreplication.html | 20
admserv/html/viewdata.html | 6
admserv/html/viewlog.html | 14
admserv/makeUpgradeTar.sh | 30
admserv/newinst/src/25changefedorato389.pl | 250
admserv/newinst/src/25rebrand.pl.in | 413
admserv/newinst/src/30updateglobalpref.pl.in | 9
admserv/newinst/src/AdminMigration.pm.in | 79
admserv/newinst/src/AdminServer.pm.in | 168
admserv/newinst/src/AdminUtil.pm.in | 78
admserv/newinst/src/ConfigDSDialogs.pm | 30
admserv/newinst/src/dirserver.map.in | 1
admserv/newinst/src/remove-ds-admin.pl.in | 8
admserv/newinst/src/setup-ds-admin.res.in | 3
admserv/schema/ldif/02globalpreferences.ldif.tmpl | 49
admserv/schema/ldif/10dsdata.ldif.tmpl | 39
compile | 240
config.guess | 529
config.h.in | 33
config.sub | 379
configure |38468 +++++++++-------------
configure.ac | 111
depcomp | 343
include/base/file.h | 3
include/base/util.h | 3
include/libadmin/libadmin.h | 92
include/libdsa/dsalib.h | 15
install-sh | 538
lib/base/file.cpp | 22
lib/base/nscputil.cpp | 46
lib/libadmin/dllglue.c | 77
lib/libadmin/httpcon.c | 2
lib/libadmin/referer.c | 4
lib/libadmin/template.c | 29
lib/libadmin/util.c | 1014
lib/libdsa/dsalib_conf.c | 37
lib/libdsa/dsalib_confs.c | 79
lib/libdsa/dsalib_location.c | 46
lib/libdsa/dsalib_tailf.c | 1
lib/libdsa/dsalib_updown.c | 78
lib/libdsa/dsalib_util.c | 48
ltmain.sh |14878 +++++---
m4/httpd.m4 | 1
m4/mozldap.m4 | 116
m4/openldap.m4 | 138
m4/selinux.m4 | 3
man/man8/ds_removal.8 | 54
man/man8/ds_unregister.8 | 48
man/man8/restart-ds-admin.8 | 10
man/man8/start-ds-admin.8 | 10
man/man8/stop-ds-admin.8 | 10
missing | 234
mod_admserv/mod_admserv.c | 234
mod_admserv/mod_admserv.h | 15
mod_restartd/mod_restartd-2.2.c | 22
selinux/dirsrv-admin.fc.in | 5
selinux/dirsrv-admin.te | 2
tests/ds_create/testget.1 | 2
tests/htmladmin/testget.2 | 2
tests/htmladmin/testget.3 | 2
tests/htmladmin/testget.4 | 2
tests/htmladmin/testget.5 | 2
tests/htmladmin/testget.6 | 2
tests/htmladmin/testget.7 | 2
tests/htmladmin/testget.8 | 2
tests/security/testpost.1 | 1
tests/security/testpost.10 | 1
tests/security/testpost.11 | 1
tests/security/testpost.12 | 1
tests/security/testpost.13 | 1
tests/security/testpost.14 | 1
tests/security/testpost.15 | 1
tests/security/testpost.16 | 1
tests/security/testpost.17 | 1
tests/security/testpost.18 | 1
tests/security/testpost.19 | 1
tests/security/testpost.2 | 1
tests/security/testpost.20 | 1
tests/security/testpost.21 | 1
tests/security/testpost.3 | 1
tests/security/testpost.4 | 1
tests/security/testpost.5 | 1
tests/security/testpost.6 | 1
tests/security/testpost.7 | 1
tests/security/testpost.8 | 1
tests/security/testpost.9 | 1
tests/setup.sh | 250
tests/ugdsconfig/testget.10 | 2
tests/viewdata/testget.2 | 2
tests/viewdata/testget.3 | 2
tests/viewdata/testget.4 | 2
tests/viewlog/testget.3 | 2
tests/viewlog/testget.4 | 2
wrappers/systemd.service.in | 24
133 files changed, 33733 insertions(+), 37647 deletions(-)
---
11 years
VERSION.sh
by Noriko Hosoi
VERSION.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 78e36deb272021c324cdbfa7707fc1f205831074
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Mon Apr 1 11:52:51 2013 -0700
bump version to 1.1.33
diff --git a/VERSION.sh b/VERSION.sh
index 4f9a114..7c86cdf 100644
--- a/VERSION.sh
+++ b/VERSION.sh
@@ -11,7 +11,7 @@ vendorurl=http://port389.org
# PACKAGE_VERSION is constructed from these
VERSION_MAJOR=1
VERSION_MINOR=1
-VERSION_MAINT=32
+VERSION_MAINT=33
# if this is a PRERELEASE, set VERSION_PREREL
# otherwise, comment it out
# be sure to include the dot prefix in the prerel
11 years