From 40d75df606751646e8d90c0ba7ae8da1430e9f12 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Thu, 30 Mar 2006 18:00:04 +0000 Subject: [PATCH] Additional TXN changes (a work in progress) --- clients/tools/ldapmodify.c | 14 ++++++++++---- libraries/libldap/error.c | 4 ++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/clients/tools/ldapmodify.c b/clients/tools/ldapmodify.c index fac525ba81..69443df038 100644 --- a/clients/tools/ldapmodify.c +++ b/clients/tools/ldapmodify.c @@ -1027,7 +1027,8 @@ domodify( if ( rc != LDAP_SUCCESS ) { /* print error message about failed update including DN */ fprintf( stderr, _("%s: update failed: %s\n"), prog, dn ); - tool_perror( newentry ? "ldap_add" : "ldap_modify", rc, NULL, NULL, NULL, NULL ); + tool_perror( newentry ? "ldap_add" : "ldap_modify", + rc, NULL, NULL, NULL, NULL ); goto done; } else if ( verbose ) { printf( _("modify complete\n") ); @@ -1098,10 +1099,10 @@ dorename( pctrls, NULL, &msgid ); if ( rc != LDAP_SUCCESS ) { fprintf( stderr, _("%s: rename failed: %s\n"), prog, dn ); - tool_perror( "ldap_modrdn", rc, NULL, NULL, NULL, NULL ); + tool_perror( "ldap_rename", rc, NULL, NULL, NULL, NULL ); goto done; } else { - printf( _("modrdn completed\n") ); + printf( _("rename completed\n") ); } rc = process_response( ld, msgid, LDAP_RES_RENAME, dn ); @@ -1125,7 +1126,7 @@ res2str( int res ) { case LDAP_RES_MODIFY: return "ldap_modify"; case LDAP_RES_MODRDN: - return "ldap_modrdn"; + return "ldap_rename"; default: assert( 0 ); } @@ -1170,6 +1171,11 @@ static int process_response( rc = ldap_parse_result( ld, res, &err, &matched, &text, &refs, &ctrls, 1 ); if ( rc == LDAP_SUCCESS ) rc = err; +#ifdef LDAP_X_TXN + if ( rc == LDAP_X_TXN_SPECIFY_OKAY ) { + rc = LDAP_SUCCESS; + } else +#endif if ( rc != LDAP_SUCCESS ) { tool_perror( res2str( op ), rc, NULL, matched, text, refs ); } else if ( msgtype != op ) { diff --git a/libraries/libldap/error.c b/libraries/libldap/error.c index c80465ecbd..ac28ccc880 100644 --- a/libraries/libldap/error.c +++ b/libraries/libldap/error.c @@ -106,6 +106,10 @@ static struct ldaperror ldap_builtin_errlist[] = { {LDAP_CUP_UNSUPPORTED_SCHEME, N_("LCUP Unsupported Scheme")}, {LDAP_CUP_RELOAD_REQUIRED, N_("LCUP Reload Required")}, +#ifdef LDAP_X_TXN + {LDAP_X_TXN_SPECIFY_OKAY, N_("TXN specify okay")}, + {LDAP_X_TXN_ID_INVALID, N_("TXN ID is invalid")}, +#endif /* API ResultCodes */ {LDAP_SERVER_DOWN, N_("Can't contact LDAP server")}, -- 2.39.5