Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
May
April
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
List overview
Download
389-commits
October 2012
----- 2025 -----
May 2025
April 2025
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
389-commits@lists.fedoraproject.org
3 participants
215 discussions
Start a n
N
ew thread
Branch '389-ds-base-1.2.11' - ldap/servers
by Mark Reynolds
15 Oct '12
15 Oct '12
ldap/servers/slapd/back-ldbm/dblayer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 7890e21bbbcc33587df9cbf1953021a706ca5f80 Author: Mark Reynolds <mreynolds(a)redhat.com> Date: Mon Oct 15 10:31:48 2012 -0400 Ticket 488 - Doc: DS error log messages with typo Bug Description: There was a typo in dblayer_get_home_dir() Fix Description: Fixed typo.
https://fedorahosted.org/389/ticket/488
Reviewed by: Noriko(Thanks!) (cherry picked from commit 4d522d34e3a019f6d0af125c33b50cfcd1557f3a) diff --git a/ldap/servers/slapd/back-ldbm/dblayer.c b/ldap/servers/slapd/back-ldbm/dblayer.c index 5452d6b..02cb3fd 100644 --- a/ldap/servers/slapd/back-ldbm/dblayer.c +++ b/ldap/servers/slapd/back-ldbm/dblayer.c @@ -414,7 +414,7 @@ dblayer_get_home_dir(struct ldbminfo *li, int *dbhome) if (NULL == home_dir) { LDAPDebug(LDAP_DEBUG_ANY,"Db home directory is not set. " - "Possibly %s (optinally %s) is missing in the config file.\n", + "Possibly %s (optionally %s) is missing in the config file.\n", CONFIG_DIRECTORY, CONFIG_DB_HOME_DIRECTORY, 0); } return home_dir;
1
0
0
0
ldap/servers
by Mark Reynolds
15 Oct '12
15 Oct '12
ldap/servers/slapd/back-ldbm/dblayer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 4d522d34e3a019f6d0af125c33b50cfcd1557f3a Author: Mark Reynolds <mreynolds(a)redhat.com> Date: Mon Oct 15 10:31:48 2012 -0400 Ticket 488 - Doc: DS error log messages with typo Bug Description: There was a typo in dblayer_get_home_dir() Fix Description: Fixed typo.
https://fedorahosted.org/389/ticket/488
Reviewed by: Noriko(Thanks!) diff --git a/ldap/servers/slapd/back-ldbm/dblayer.c b/ldap/servers/slapd/back-ldbm/dblayer.c index 3a400bc..ed7d770 100644 --- a/ldap/servers/slapd/back-ldbm/dblayer.c +++ b/ldap/servers/slapd/back-ldbm/dblayer.c @@ -414,7 +414,7 @@ dblayer_get_home_dir(struct ldbminfo *li, int *dbhome) if (NULL == home_dir) { LDAPDebug(LDAP_DEBUG_ANY,"Db home directory is not set. " - "Possibly %s (optinally %s) is missing in the config file.\n", + "Possibly %s (optionally %s) is missing in the config file.\n", CONFIG_DIRECTORY, CONFIG_DB_HOME_DIRECTORY, 0); } return home_dir;
1
0
0
0
ldap/admin ldap/servers
by Noriko Hosoi
11 Oct '12
11 Oct '12
ldap/admin/src/scripts/template-bak2db.in | 13 ++--- ldap/admin/src/scripts/template-db2bak.in | 14 ++--- ldap/admin/src/scripts/template-db2ldif.in | 2 ldap/admin/src/scripts/template-ldif2db.in | 35 ++++++++++++-- ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c | 12 ++-- ldap/servers/slapd/main.c | 67 ++++++++++++++++++--------- 6 files changed, 94 insertions(+), 49 deletions(-) New commits: commit da07b507859ae994b4a1828f6815b99e0d301645 Author: Noriko Hosoi <nhosoi(a)totoro.usersys.redhat.com> Date: Thu Oct 11 14:36:05 2012 -0700 Trac Ticket #451 - Allow db2ldif to be quiet
https://fedorahosted.org/389/ticket/451
Description: Export utility db2ldif and import utility ldif2db are always verbose. This patch is adding an option '-q' to suppress the outputs. This patch modifies db2bak and bak2db which already supports '-q', as well. The scripts used to interpret '-q'. If it was not set, a verbose debug option '-d 524288' was passed to ns-slapd. Instead, this patch directly passes '-q' to ns-slapd and let it handle it in the C code. diff --git a/ldap/admin/src/scripts/template-bak2db.in b/ldap/admin/src/scripts/template-bak2db.in index b081839..013a9f1 100755 --- a/ldap/admin/src/scripts/template-bak2db.in +++ b/ldap/admin/src/scripts/template-bak2db.in @@ -44,13 +44,6 @@ do d) dlevel=$OPTARG;; esac done -if [ $quiet -eq 0 ] -then - if [ $dlevel -ne 524288 ] - then - dlevel=`expr $dlevel + 524288` - fi -fi if [ 1 = `expr $archivedir : "\/"` ] then @@ -61,4 +54,8 @@ else fi cd {{SERVERBIN-DIR}} -./ns-slapd archive2db -D {{CONFIG-DIR}} -a $archivedir $benameopt -d $dlevel +if [ $quiet -eq 0 ]; then + ./ns-slapd archive2db -D {{CONFIG-DIR}} -a $archivedir $benameopt -d $dlevel +else + ./ns-slapd archive2db -D {{CONFIG-DIR}} -a $archivedir $benameopt -d $dlevel -q +fi diff --git a/ldap/admin/src/scripts/template-db2bak.in b/ldap/admin/src/scripts/template-db2bak.in index d89f6ee..85aac0f 100755 --- a/ldap/admin/src/scripts/template-db2bak.in +++ b/ldap/admin/src/scripts/template-db2bak.in @@ -46,14 +46,10 @@ then esac done fi -# If not quiet, set LDAP_DEBUG_BACKLDBM to debug level -if [ $quiet -eq 0 ] -then - if [ $dlevel -ne 524288 ] - then - dlevel=`expr $dlevel + 524288` - fi -fi echo "Back up directory: $bak_dir" -./ns-slapd db2archive -D {{CONFIG-DIR}} -a $bak_dir -d $dlevel +if [ $quiet -eq 0 ]; then + ./ns-slapd db2archive -D {{CONFIG-DIR}} -a $bak_dir -d $dlevel +else + ./ns-slapd db2archive -D {{CONFIG-DIR}} -a $bak_dir -d $dlevel -q +fi diff --git a/ldap/admin/src/scripts/template-db2ldif.in b/ldap/admin/src/scripts/template-db2ldif.in index 2989b77..d3a12be 100755 --- a/ldap/admin/src/scripts/template-db2ldif.in +++ b/ldap/admin/src/scripts/template-db2ldif.in @@ -69,7 +69,7 @@ if [ "$#" -lt 2 ]; then echo "Usage: db2ldif {-n backend_instance}* | {-s includesuffix}*" echo " [{-x excludesuffix}*] [-a outputfile]" - echo " [-N] [-r] [-C] [-u] [-U] [-m] [-M] [-1]" + echo " [-N] [-r] [-C] [-u] [-U] [-m] [-M] [-1] [-q]" echo "Note: either \"-n backend_instance\" or \"-s includesuffix\" is required." exit 1 fi diff --git a/ldap/admin/src/scripts/template-ldif2db.in b/ldap/admin/src/scripts/template-ldif2db.in index 8f92acf..ceb0157 100755 --- a/ldap/admin/src/scripts/template-ldif2db.in +++ b/ldap/admin/src/scripts/template-ldif2db.in @@ -19,15 +19,40 @@ export LD_LIBRARY_PATH SHLIB_PATH=$LD_LIBRARY_PATH export SHLIB_PATH +usage() +{ + echo "Usage: ldif2db -n backend_instance | {-s includesuffix}* [{-x excludesuffix}*]" + echo " {-i ldiffile}* [-O] [-q]" + echo "Note: either \"-n backend_instance\" or \"-s includesuffix\" and \"-i ldiffile\" are required." +} + +handleopts() +{ + while [ "$1" != "" ] + do + if [ "$1" = "-q" ]; then + return 1 + elif [ "$1" = "-h" ]; then + usage + exit 1 + fi + shift + done + return 0 +} + cd {{SERVERBIN-DIR}} if [ $# -lt 4 ] then - echo "Usage: ldif2db -n backend_instance | {-s includesuffix}* [{-x excludesuffix}*]" - echo " {-i ldiffile}* [-O]" - echo "Note: either \"-n backend_instance\" or \"-s includesuffix\" and \"-i ldiffile\" are required." - exit 1 + usage + exit 1 fi -echo importing data ... +handleopts $@ +quiet=$? + +if [ $quiet -eq 0 ]; then + echo importing data ... +fi ./ns-slapd ldif2db -D {{CONFIG-DIR}} "$@" 2>&1 exit $? diff --git a/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c b/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c index e50b930..82806db 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c @@ -259,7 +259,7 @@ entryrdn_index_entry(backend *be, rc = LDAP_INVALID_DN_SYNTAX; goto bail; } else if (rc > 0) { - slapi_log_error(SLAPI_LOG_BACKLDBM, ENTRYRDN_TAG, + slapi_log_error(SLAPI_LOG_TRACE, ENTRYRDN_TAG, "entryrdn_index_entry: %s does not belong to " "the db\n", slapi_sdn_get_dn(sdn)); rc = DB_NOTFOUND; @@ -393,7 +393,7 @@ entryrdn_index_read_ext(backend *be, rc = LDAP_INVALID_DN_SYNTAX; goto bail; } else if (rc > 0) { - slapi_log_error(SLAPI_LOG_BACKLDBM, ENTRYRDN_TAG, + slapi_log_error(SLAPI_LOG_TRACE, ENTRYRDN_TAG, "entryrdn_index_read: %s does not belong to the db\n", slapi_sdn_get_dn(sdn)); rc = DB_NOTFOUND; @@ -551,7 +551,7 @@ entryrdn_rename_subtree(backend *be, rc = LDAP_INVALID_DN_SYNTAX; goto bail; } else if (rc > 0) { - slapi_log_error(SLAPI_LOG_BACKLDBM, ENTRYRDN_TAG, + slapi_log_error(SLAPI_LOG_TRACE, ENTRYRDN_TAG, "entryrdn_rename_subtree: %s does not belong to " "the db\n", slapi_sdn_get_dn(oldsdn)); rc = DB_NOTFOUND; @@ -1020,7 +1020,7 @@ entryrdn_get_subordinates(backend *be, "\"%s\" to Slapi_RDN\n", slapi_sdn_get_dn(sdn)); rc = LDAP_INVALID_DN_SYNTAX; } else if (rc > 0) { - slapi_log_error(SLAPI_LOG_BACKLDBM, ENTRYRDN_TAG, + slapi_log_error(SLAPI_LOG_TRACE, ENTRYRDN_TAG, "entryrdn_get_subordinates: %s does not belong to " "the db\n", slapi_sdn_get_dn(sdn)); rc = DB_NOTFOUND; @@ -2516,7 +2516,7 @@ _entryrdn_insert_key(backend *be, } /* if (TMPID == tmpid) */ rc = 0; } /* if (DB_KEYEXIST == rc) */ - slapi_log_error(SLAPI_LOG_BACKLDBM, ENTRYRDN_TAG, + slapi_log_error(SLAPI_LOG_TRACE, ENTRYRDN_TAG, "_entryrdn_insert_key: Suffix %s added: %d\n", nrdn, rc); goto bail; /* succeeded or failed, it's done */ @@ -2589,7 +2589,7 @@ _entryrdn_insert_key(backend *be, adddata.flags = DB_DBT_USERMEM; rc = _entryrdn_put_data(cursor, &key, &adddata, RDN_INDEX_SELF, db_txn); - slapi_log_error(SLAPI_LOG_BACKLDBM, ENTRYRDN_TAG, + slapi_log_error(SLAPI_LOG_TRACE, ENTRYRDN_TAG, "_entryrdn_insert_key: Suffix %s added: %d\n", slapi_rdn_get_rdn(tmpsrdn), rc); #ifdef FIX_TXN_DEADLOCKS diff --git a/ldap/servers/slapd/main.c b/ldap/servers/slapd/main.c index cf4e2e3..f438fce 100644 --- a/ldap/servers/slapd/main.c +++ b/ldap/servers/slapd/main.c @@ -414,20 +414,20 @@ usage( char *name, char *extraname ) case SLAPD_EXEMODE_DB2LDIF: usagestr = "usage: %s %s%s-D configdir [-n backend-instance-name] [-d debuglevel] " "[-N] [-a outputfile] [-r] [-C] [{-s includesuffix}*] " - "[{-x excludesuffix}*] [-u] [-U] [-m] [-M] [-E]\n" + "[{-x excludesuffix}*] [-u] [-U] [-m] [-M] [-E] [-q]\n" "Note: either \"-n backend_instance_name\" or \"-s includesuffix\" is required.\n"; break; case SLAPD_EXEMODE_LDIF2DB: usagestr = "usage: %s %s%s-D configdir [-d debuglevel] " "[-n backend_instance_name] [-O] [-g uniqueid_type] [--namespaceid uniqueID]" - "[{-s includesuffix}*] [{-x excludesuffix}*] [-E] {-i ldif-file}*\n" + "[{-s includesuffix}*] [{-x excludesuffix}*] [-E] [-q] {-i ldif-file}*\n" "Note: either \"-n backend_instance_name\" or \"-s includesuffix\" is required.\n"; break; case SLAPD_EXEMODE_DB2ARCHIVE: - usagestr = "usage: %s %s%s-D configdir [-d debuglevel] -a archivedir\n"; + usagestr = "usage: %s %s%s-D configdir [-q] [-d debuglevel] -a archivedir\n"; break; case SLAPD_EXEMODE_ARCHIVE2DB: - usagestr = "usage: %s %s%s-D configdir [-d debuglevel] -a archivedir\n"; + usagestr = "usage: %s %s%s-D configdir [-q] [-d debuglevel] -a archivedir\n"; break; case SLAPD_EXEMODE_DB2INDEX: usagestr = "usage: %s %s%s-D configdir -n backend-instance-name " @@ -490,6 +490,7 @@ static char *ldif2db_namespaceid = NULL; int importexport_encrypt = 0; static int upgradedb_flags = 0; static int upgradednformat_dryrun = 0; +static int is_quiet = 0; /* taken from idsktune */ #if defined(__sun) @@ -740,7 +741,7 @@ main( int argc, char **argv) /* display debugging level if it is anything other than the default */ if ( 0 != ( slapd_ldap_debug & ~LDAP_DEBUG_ANY )) { - slapd_debug_level_log( slapd_ldap_debug ); + slapd_debug_level_log( slapd_ldap_debug ); } #ifndef LDAP_DONT_USE_SMARTHEAP @@ -1354,7 +1355,7 @@ process_command_line(int argc, char **argv, char *myname, * */ - char *opts_db2ldif = "vd:D:ENa:rs:x:CSut:n:UmMo1"; + char *opts_db2ldif = "vd:D:ENa:rs:x:CSut:n:UmMo1q"; struct opt_ext long_options_db2ldif[] = { {"version",ArgNone,'v'}, {"debug",ArgRequired,'d'}, @@ -1373,9 +1374,10 @@ process_command_line(int argc, char **argv, char *myname, {"oneOutputFile",ArgNone,'o'}, {"multipleOutputFile",ArgNone,'M'}, {"noVersionNum",ArgNone,'1'}, + {"quiet",ArgNone,'q'}, {0,0,0}}; - char *opts_ldif2db = "vd:i:g:G:n:s:x:NOCc:St:D:E"; + char *opts_ldif2db = "vd:i:g:G:n:s:x:NOCc:St:D:Eq"; struct opt_ext long_options_ldif2db[] = { {"version",ArgNone,'v'}, {"debug",ArgRequired,'d'}, @@ -1392,9 +1394,10 @@ process_command_line(int argc, char **argv, char *myname, {"nostate",ArgNone,'Z'}, {"configDir",ArgRequired,'D'}, {"encrypt",ArgOptional,'E'}, + {"quiet",ArgNone,'q'}, {0,0,0}}; - char *opts_archive2db = "vd:i:a:n:SD:"; + char *opts_archive2db = "vd:i:a:n:SD:q"; struct opt_ext long_options_archive2db[] = { {"version",ArgNone,'v'}, {"debug",ArgRequired,'d'}, @@ -1403,10 +1406,11 @@ process_command_line(int argc, char **argv, char *myname, {"backEndInstName",ArgRequired,'n'}, {"allowMultipleProcesses",ArgNone,'S'}, {"configDir",ArgRequired,'D'}, + {"quiet",ArgNone,'q'}, {0,0,0}}; - char *opts_db2archive = "vd:i:a:SD:"; + char *opts_db2archive = "vd:i:a:SD:q"; struct opt_ext long_options_db2archive[] = { {"version",ArgNone,'v'}, {"debug",ArgRequired,'d'}, @@ -1414,6 +1418,7 @@ process_command_line(int argc, char **argv, char *myname, {"archive",ArgRequired,'a'}, {"allowMultipleProcesses",ArgNone,'S'}, {"configDir",ArgRequired,'D'}, + {"quiet",ArgNone,'q'}, {0,0,0}}; char *opts_db2index = "vd:a:t:T:SD:n:s:x:"; @@ -1913,6 +1918,9 @@ process_command_line(int argc, char **argv, char *myname, ldif_printkey |= EXPORT_NOVERSION; break; + case 'q': /* quiet option for db2ldif, ldif2db, db2bak, bak2db */ + is_quiet = 1; + break; default: usage( myname, *extraname ); exit( 1 ); @@ -2224,7 +2232,12 @@ slapd_exemode_ldif2db() plugin->plg_name, 0, 0); return 1; } - + if (!is_quiet) { + slapd_ldap_debug |= LDAP_DEBUG_BACKLDBM; + } + if (!(slapd_ldap_debug & LDAP_DEBUG_BACKLDBM)) { + g_set_detached(1); + } memset( &pb, '\0', sizeof(pb) ); pb.pb_backend = NULL; pb.pb_plugin = plugin; @@ -2352,6 +2365,12 @@ slapd_exemode_db2ldif(int argc, char** argv) return 1; } + if (!is_quiet) { + slapd_ldap_debug |= LDAP_DEBUG_BACKLDBM; + } + if (!(slapd_ldap_debug & LDAP_DEBUG_BACKLDBM)) { + g_set_detached(1); + } memset( &pb, '\0', sizeof(pb) ); pb.pb_backend = NULL; pb.pb_plugin = plugin; @@ -2411,13 +2430,15 @@ slapd_exemode_db2ldif(int argc, char** argv) } } - fprintf(stderr, "ldiffile: %s\n", my_ldiffile); + if (!is_quiet) { + fprintf(stderr, "ldiffile: %s\n", my_ldiffile); + } /* just send the filename to the backend and let * the backend open it (so they can do special * stuff for 64-bit fs) */ pb.pb_ldif_file = my_ldiffile; - pb.pb_ldif_printkey = ldif_printkey; + pb.pb_ldif_printkey = ldif_printkey; } return_value = (plugin->plg_db2ldif)( &pb ); @@ -2583,10 +2604,10 @@ slapd_exemode_db2archive() /* Make sure we aren't going to run slapd in * a mode that is going to conflict with other - * slapd processes that are currently running - */ - if ( add_new_slapd_process(slapd_exemode, db2ldif_dump_replica, - skip_db_protect_check) == -1 ) { + * slapd processes that are currently running + */ + if ( add_new_slapd_process(slapd_exemode, db2ldif_dump_replica, + skip_db_protect_check) == -1 ) { LDAPDebug( LDAP_DEBUG_ANY, "Shutting down due to possible conflicts with other slapd processes\n", 0, 0, 0 ); @@ -2596,6 +2617,9 @@ slapd_exemode_db2archive() LDAPDebug(LDAP_DEBUG_ANY, "Initialization Failed 0 %d\n",return_value,0,0); return 1; } + if (!is_quiet) { + slapd_ldap_debug |= LDAP_DEBUG_BACKLDBM; + } if (!(slapd_ldap_debug & LDAP_DEBUG_BACKLDBM)) { g_set_detached(1); } @@ -2636,10 +2660,10 @@ slapd_exemode_archive2db() /* Make sure we aren't going to run slapd in * a mode that is going to conflict with other - * slapd processes that are currently running - */ - if ( add_new_slapd_process(slapd_exemode, db2ldif_dump_replica, - skip_db_protect_check) == -1 ) { + * slapd processes that are currently running + */ + if ( add_new_slapd_process(slapd_exemode, db2ldif_dump_replica, + skip_db_protect_check) == -1 ) { LDAPDebug( LDAP_DEBUG_ANY, "Shutting down due to possible conflicts with other slapd processes\n", 0, 0, 0 ); @@ -2650,6 +2674,9 @@ slapd_exemode_archive2db() return 1; } + if (!is_quiet) { + slapd_ldap_debug |= LDAP_DEBUG_BACKLDBM; + } if (!(slapd_ldap_debug & LDAP_DEBUG_BACKLDBM)) { g_set_detached(1); }
1
0
0
0
ldap/servers
by Richard Allen Megginson
11 Oct '12
11 Oct '12
ldap/servers/plugins/replication/repl_extop.c | 59 ++++++++++++++------------ 1 file changed, 32 insertions(+), 27 deletions(-) New commits: commit bf54018e8ee4b355c66621ad3bfe5e59d4820170 Author: Rich Megginson <rmeggins(a)redhat.com> Date: Thu Oct 11 11:57:24 2012 -0600 Ticket #491 - multimaster_extop_cleanruv returns wrong error codes
https://fedorahosted.org/389/ticket/491
Reviewed by: nhosoi (Thanks!) Branch: master Fix Description: multimaster_extop_cleanruv must return with a code of SLAPI_PLUGIN_EXTENDED_SENT_RESULT to tell the server that the result has been sent - otherwise, in 1.2.10, the server will attempt to send the result again. In 1.2.11 the result code has been changed to ignore a subsequent attempt to send a result for the same operation, but the function should still return the correct codes. I also cleaned up the error codes and memory management a bit. Platforms tested: RHEL6 x86_64, Fedora 16 Flag Day: no Doc impact: no diff --git a/ldap/servers/plugins/replication/repl_extop.c b/ldap/servers/plugins/replication/repl_extop.c index c94ef8f..5aac699 100644 --- a/ldap/servers/plugins/replication/repl_extop.c +++ b/ldap/servers/plugins/replication/repl_extop.c @@ -1446,19 +1446,20 @@ free_and_return: int multimaster_extop_abort_cleanruv(Slapi_PBlock *pb) { - multimaster_mtnode_extension *mtnode_ext; + multimaster_mtnode_extension *mtnode_ext = NULL; + int release_it = 0; PRThread *thread = NULL; cleanruv_data *data; Replica *r; ReplicaId rid; - CSN *maxcsn; - struct berval *extop_payload; + CSN *maxcsn = NULL; + struct berval *extop_payload = NULL; char *extop_oid; char *repl_root; char *payload = NULL; char *certify_all; char *iter; - int rc = 0; + int rc = LDAP_SUCCESS; slapi_pblock_get(pb, SLAPI_EXT_OP_REQ_OID, &extop_oid); slapi_pblock_get(pb, SLAPI_EXT_OP_REQ_VALUE, &extop_payload); @@ -1496,6 +1497,7 @@ multimaster_extop_abort_cleanruv(Slapi_PBlock *pb) } if (mtnode_ext->replica){ object_acquire (mtnode_ext->replica); + release_it = 1; } else { slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "Abort cleanAllRUV task: replica is missing from (%s), " "aborting operation\n",repl_root); @@ -1519,6 +1521,7 @@ multimaster_extop_abort_cleanruv(Slapi_PBlock *pb) goto out; } data->repl_obj = mtnode_ext->replica; /* released in replica_abort_task_thread() */ + release_it = 0; /* thread owns it now */ data->replica = r; data->task = NULL; data->payload = slapi_ch_bvdup(extop_payload); @@ -1540,17 +1543,20 @@ multimaster_extop_abort_cleanruv(Slapi_PBlock *pb) (void *)data, PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, SLAPD_DEFAULT_THREAD_STACKSIZE); if (thread == NULL) { - if(mtnode_ext->replica){ - object_release(mtnode_ext->replica); - } slapi_log_error( SLAPI_LOG_REPL, repl_plugin_name, "Abort cleanAllRUV task: unable to create abort " "thread. Aborting task.\n"); + release_it = 1; /* have to release mtnode_ext->replica now */ slapi_ch_free_string(&data->repl_root); slapi_ch_free_string(&data->certify); + ber_bvfree(data->payload); + slapi_ch_free((void **)&data); rc = LDAP_OPERATIONS_ERROR; } out: + if (release_it && mtnode_ext && mtnode_ext->replica) { + object_release(mtnode_ext->replica); + } slapi_ch_free_string(&payload); return rc; @@ -1570,7 +1576,7 @@ out: int multimaster_extop_cleanruv(Slapi_PBlock *pb) { - multimaster_mtnode_extension *mtnode_ext; + multimaster_mtnode_extension *mtnode_ext = NULL; PRThread *thread = NULL; Replica *r = NULL; cleanruv_data *data = NULL; @@ -1585,7 +1591,7 @@ multimaster_extop_cleanruv(Slapi_PBlock *pb) char *iter; int release_it = 0; int rid = 0; - int rc = 0; + int rc = LDAP_OPERATIONS_ERROR; slapi_pblock_get(pb, SLAPI_EXT_OP_REQ_OID, &extop_oid); slapi_pblock_get(pb, SLAPI_EXT_OP_REQ_VALUE, &extop_payload); @@ -1593,7 +1599,6 @@ multimaster_extop_cleanruv(Slapi_PBlock *pb) if (NULL == extop_oid || strcmp(extop_oid, REPL_CLEANRUV_OID) != 0 || NULL == extop_payload || NULL == extop_payload->bv_val){ /* something is wrong, error out */ - rc = -1; goto free_and_return; } /* @@ -1601,7 +1606,6 @@ multimaster_extop_cleanruv(Slapi_PBlock *pb) */ if(decode_cleanruv_payload(extop_payload, &payload)){ slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "cleanAllRUV_task: failed to decode payload. Aborting ext op\n"); - rc = -1; goto free_and_return; } rid = atoi(ldap_utf8strtok_r(payload, ":", &iter)); @@ -1614,7 +1618,7 @@ multimaster_extop_cleanruv(Slapi_PBlock *pb) */ if(is_cleaned_rid(rid)){ csn_free(&maxcsn); - rc = 1; + rc = LDAP_SUCCESS; goto free_and_return; } @@ -1624,25 +1628,21 @@ multimaster_extop_cleanruv(Slapi_PBlock *pb) if((mtnode_ext = replica_config_get_mtnode_by_dn(repl_root)) == NULL){ slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "cleanAllRUV_task: failed to get replication node " "from (%s), aborting operation\n", repl_root); - rc = -1; goto free_and_return; } if (mtnode_ext->replica){ object_acquire (mtnode_ext->replica); release_it = 1; - } - if (mtnode_ext->replica == NULL){ + } else { slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "cleanAllRUV_task: replica is missing from (%s), " "aborting operation\n",repl_root); - rc = LDAP_OPERATIONS_ERROR; goto free_and_return; } r = (Replica*)object_get_data (mtnode_ext->replica); if(r == NULL){ slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "cleanAllRUV_task: replica is NULL, aborting task\n"); - rc = -1; goto free_and_return; } @@ -1657,7 +1657,6 @@ multimaster_extop_cleanruv(Slapi_PBlock *pb) if (data == NULL) { slapi_log_error( SLAPI_LOG_FATAL, repl_plugin_name, "cleanAllRUV_task: failed to allocate " "cleanruv_Data\n"); - rc = -1; goto free_and_return; } data->repl_obj = mtnode_ext->replica; @@ -1671,9 +1670,15 @@ multimaster_extop_cleanruv(Slapi_PBlock *pb) (void *)data, PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, SLAPD_DEFAULT_THREAD_STACKSIZE); if (thread == NULL) { - rc = -1; slapi_log_error( SLAPI_LOG_FATAL, repl_plugin_name, "cleanAllRUV_task: unable to create cleanAllRUV " "monitoring thread. Aborting task.\n"); + ber_bvfree(data->payload); + data->payload = NULL; + slapi_ch_free((void **)&data); + } else { + release_it = 0; /* thread will release data->repl_obj == mtnode_ext->replica */ + maxcsn = NULL; /* thread owns it now */ + rc = LDAP_SUCCESS; } } else { /* this is a read-only consumer */ /* @@ -1713,24 +1718,20 @@ multimaster_extop_cleanruv(Slapi_PBlock *pb) /* free everything */ object_release(ruv_obj); - csn_free(&maxcsn); - if (mtnode_ext->replica && release_it) - object_release (mtnode_ext->replica); /* * This read-only replica has no easy way to tell when it's safe to release the rid. * So we won't release it, not until a server restart. */ slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "cleanAllRUV_task: You must restart the server if you want to reuse rid(%d).\n", rid); slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "cleanAllRUV_task: Successfully cleaned rid(%d).\n", rid); + rc = LDAP_SUCCESS; } free_and_return: - if(rc && release_it){ - if (mtnode_ext->replica) - object_release (mtnode_ext->replica); + if(release_it && mtnode_ext && mtnode_ext->replica) { + object_release (mtnode_ext->replica); } - if(rc) - csn_free(&maxcsn); + csn_free(&maxcsn); slapi_ch_free_string(&payload); /* @@ -1754,6 +1755,10 @@ free_and_return: { ber_bvfree(resp_bval); } + /* tell extendop code that we have already sent the result */ + rc = SLAPI_PLUGIN_EXTENDED_SENT_RESULT; + } else { + rc = LDAP_OPERATIONS_ERROR; } return rc;
1
0
0
0
Branch '389-ds-base-1.2.11' - ldap/servers
by Richard Allen Megginson
11 Oct '12
11 Oct '12
ldap/servers/plugins/replication/repl_extop.c | 59 ++++++++++++++------------ 1 file changed, 32 insertions(+), 27 deletions(-) New commits: commit 6125990c403d600a048e8d6420236f6acb58e179 Author: Rich Megginson <rmeggins(a)redhat.com> Date: Thu Oct 11 11:57:24 2012 -0600 Ticket #491 - multimaster_extop_cleanruv returns wrong error codes
https://fedorahosted.org/389/ticket/491
Reviewed by: nhosoi (Thanks!) Branch: 389-ds-base-1.2.11 Fix Description: multimaster_extop_cleanruv must return with a code of SLAPI_PLUGIN_EXTENDED_SENT_RESULT to tell the server that the result has been sent - otherwise, in 1.2.10, the server will attempt to send the result again. In 1.2.11 the result code has been changed to ignore a subsequent attempt to send a result for the same operation, but the function should still return the correct codes. I also cleaned up the error codes and memory management a bit. Platforms tested: RHEL6 x86_64, Fedora 16 Flag Day: no Doc impact: no (cherry picked from commit bf54018e8ee4b355c66621ad3bfe5e59d4820170) diff --git a/ldap/servers/plugins/replication/repl_extop.c b/ldap/servers/plugins/replication/repl_extop.c index 1b72dfb..3a6f422 100644 --- a/ldap/servers/plugins/replication/repl_extop.c +++ b/ldap/servers/plugins/replication/repl_extop.c @@ -1445,19 +1445,20 @@ free_and_return: int multimaster_extop_abort_cleanruv(Slapi_PBlock *pb) { - multimaster_mtnode_extension *mtnode_ext; + multimaster_mtnode_extension *mtnode_ext = NULL; + int release_it = 0; PRThread *thread = NULL; cleanruv_data *data; Replica *r; ReplicaId rid; - CSN *maxcsn; - struct berval *extop_payload; + CSN *maxcsn = NULL; + struct berval *extop_payload = NULL; char *extop_oid; char *repl_root; char *payload = NULL; char *certify_all; char *iter; - int rc = 0; + int rc = LDAP_SUCCESS; slapi_pblock_get(pb, SLAPI_EXT_OP_REQ_OID, &extop_oid); slapi_pblock_get(pb, SLAPI_EXT_OP_REQ_VALUE, &extop_payload); @@ -1495,6 +1496,7 @@ multimaster_extop_abort_cleanruv(Slapi_PBlock *pb) } if (mtnode_ext->replica){ object_acquire (mtnode_ext->replica); + release_it = 1; } else { slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "Abort cleanAllRUV task: replica is missing from (%s), " "aborting operation\n",repl_root); @@ -1518,6 +1520,7 @@ multimaster_extop_abort_cleanruv(Slapi_PBlock *pb) goto out; } data->repl_obj = mtnode_ext->replica; /* released in replica_abort_task_thread() */ + release_it = 0; /* thread owns it now */ data->replica = r; data->task = NULL; data->payload = slapi_ch_bvdup(extop_payload); @@ -1539,17 +1542,20 @@ multimaster_extop_abort_cleanruv(Slapi_PBlock *pb) (void *)data, PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, SLAPD_DEFAULT_THREAD_STACKSIZE); if (thread == NULL) { - if(mtnode_ext->replica){ - object_release(mtnode_ext->replica); - } slapi_log_error( SLAPI_LOG_REPL, repl_plugin_name, "Abort cleanAllRUV task: unable to create abort " "thread. Aborting task.\n"); + release_it = 1; /* have to release mtnode_ext->replica now */ slapi_ch_free_string(&data->repl_root); slapi_ch_free_string(&data->certify); + ber_bvfree(data->payload); + slapi_ch_free((void **)&data); rc = LDAP_OPERATIONS_ERROR; } out: + if (release_it && mtnode_ext && mtnode_ext->replica) { + object_release(mtnode_ext->replica); + } slapi_ch_free_string(&payload); return rc; @@ -1569,7 +1575,7 @@ out: int multimaster_extop_cleanruv(Slapi_PBlock *pb) { - multimaster_mtnode_extension *mtnode_ext; + multimaster_mtnode_extension *mtnode_ext = NULL; PRThread *thread = NULL; Replica *r = NULL; cleanruv_data *data = NULL; @@ -1584,7 +1590,7 @@ multimaster_extop_cleanruv(Slapi_PBlock *pb) char *iter; int release_it = 0; int rid = 0; - int rc = 0; + int rc = LDAP_OPERATIONS_ERROR; slapi_pblock_get(pb, SLAPI_EXT_OP_REQ_OID, &extop_oid); slapi_pblock_get(pb, SLAPI_EXT_OP_REQ_VALUE, &extop_payload); @@ -1592,7 +1598,6 @@ multimaster_extop_cleanruv(Slapi_PBlock *pb) if (NULL == extop_oid || strcmp(extop_oid, REPL_CLEANRUV_OID) != 0 || NULL == extop_payload || NULL == extop_payload->bv_val){ /* something is wrong, error out */ - rc = -1; goto free_and_return; } /* @@ -1600,7 +1605,6 @@ multimaster_extop_cleanruv(Slapi_PBlock *pb) */ if(decode_cleanruv_payload(extop_payload, &payload)){ slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "cleanAllRUV_task: failed to decode payload. Aborting ext op\n"); - rc = -1; goto free_and_return; } rid = atoi(ldap_utf8strtok_r(payload, ":", &iter)); @@ -1613,7 +1617,7 @@ multimaster_extop_cleanruv(Slapi_PBlock *pb) */ if(is_cleaned_rid(rid)){ csn_free(&maxcsn); - rc = 1; + rc = LDAP_SUCCESS; goto free_and_return; } @@ -1623,25 +1627,21 @@ multimaster_extop_cleanruv(Slapi_PBlock *pb) if((mtnode_ext = replica_config_get_mtnode_by_dn(repl_root)) == NULL){ slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "cleanAllRUV_task: failed to get replication node " "from (%s), aborting operation\n", repl_root); - rc = -1; goto free_and_return; } if (mtnode_ext->replica){ object_acquire (mtnode_ext->replica); release_it = 1; - } - if (mtnode_ext->replica == NULL){ + } else { slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "cleanAllRUV_task: replica is missing from (%s), " "aborting operation\n",repl_root); - rc = LDAP_OPERATIONS_ERROR; goto free_and_return; } r = (Replica*)object_get_data (mtnode_ext->replica); if(r == NULL){ slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "cleanAllRUV_task: replica is NULL, aborting task\n"); - rc = -1; goto free_and_return; } @@ -1656,7 +1656,6 @@ multimaster_extop_cleanruv(Slapi_PBlock *pb) if (data == NULL) { slapi_log_error( SLAPI_LOG_FATAL, repl_plugin_name, "cleanAllRUV_task: failed to allocate " "cleanruv_Data\n"); - rc = -1; goto free_and_return; } data->repl_obj = mtnode_ext->replica; @@ -1670,9 +1669,15 @@ multimaster_extop_cleanruv(Slapi_PBlock *pb) (void *)data, PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, SLAPD_DEFAULT_THREAD_STACKSIZE); if (thread == NULL) { - rc = -1; slapi_log_error( SLAPI_LOG_FATAL, repl_plugin_name, "cleanAllRUV_task: unable to create cleanAllRUV " "monitoring thread. Aborting task.\n"); + ber_bvfree(data->payload); + data->payload = NULL; + slapi_ch_free((void **)&data); + } else { + release_it = 0; /* thread will release data->repl_obj == mtnode_ext->replica */ + maxcsn = NULL; /* thread owns it now */ + rc = LDAP_SUCCESS; } } else { /* this is a read-only consumer */ /* @@ -1712,24 +1717,20 @@ multimaster_extop_cleanruv(Slapi_PBlock *pb) /* free everything */ object_release(ruv_obj); - csn_free(&maxcsn); - if (mtnode_ext->replica && release_it) - object_release (mtnode_ext->replica); /* * This read-only replica has no easy way to tell when it's safe to release the rid. * So we won't release it, not until a server restart. */ slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "cleanAllRUV_task: You must restart the server if you want to reuse rid(%d).\n", rid); slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "cleanAllRUV_task: Successfully cleaned rid(%d).\n", rid); + rc = LDAP_SUCCESS; } free_and_return: - if(rc && release_it){ - if (mtnode_ext->replica) - object_release (mtnode_ext->replica); + if(release_it && mtnode_ext && mtnode_ext->replica) { + object_release (mtnode_ext->replica); } - if(rc) - csn_free(&maxcsn); + csn_free(&maxcsn); slapi_ch_free_string(&payload); /* @@ -1753,6 +1754,10 @@ free_and_return: { ber_bvfree(resp_bval); } + /* tell extendop code that we have already sent the result */ + rc = SLAPI_PLUGIN_EXTENDED_SENT_RESULT; + } else { + rc = LDAP_OPERATIONS_ERROR; } return rc;
1
0
0
0
Changes to 'refs/tags/389-ds-base.1.2.10.2-18'
by Noriko Hosoi
10 Oct '12
10 Oct '12
Changes since the dawn of time:
1
0
0
0
Branch 'refs/tags/389-ds-base.1.2.10.2-11' - 0 commits -
by Noriko Hosoi
10 Oct '12
10 Oct '12
Rebased ref, commits from common ancestor:
1
0
0
0
Branch 'refs/tags/389-ds-base.1.2.10.2-10' - 0 commits -
by Noriko Hosoi
10 Oct '12
10 Oct '12
Rebased ref, commits from common ancestor:
1
0
0
0
Branch 'refs/tags/389-ds-base.1.2.10.2-12' - 0 commits -
by Noriko Hosoi
10 Oct '12
10 Oct '12
Rebased ref, commits from common ancestor:
1
0
0
0
Branch 'refs/tags/389-ds-base-1.2.10.2-13' - 0 commits -
by Noriko Hosoi
10 Oct '12
10 Oct '12
Rebased ref, commits from common ancestor:
1
0
0
0
← Newer
1
2
3
4
5
6
...
22
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Results per page:
10
25
50
100
200