X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fback-shell%2Fmodify.c;h=5df09628c1ff2b1da875b47e4ef36ca9053bc9bb;hb=f9d41ba98a8af4a4789edb9aeb033d70d4abc49c;hp=1f0d1208bfa104bd99ad44dfe089f66c5ef0f3b1;hpb=4af9eb971559e3a1f0432615e93ec870dc753ddb;p=openldap diff --git a/servers/slapd/back-shell/modify.c b/servers/slapd/back-shell/modify.c index 1f0d1208bf..5df09628c1 100644 --- a/servers/slapd/back-shell/modify.c +++ b/servers/slapd/back-shell/modify.c @@ -2,7 +2,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 1998-2009 The OpenLDAP Foundation. + * Copyright 1998-2012 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,6 +37,7 @@ #include "slap.h" #include "shell.h" +#include "ldif.h" int shell_back_modify( @@ -87,8 +88,6 @@ shell_back_modify( for ( ; ml != NULL; ml = ml->sml_next ) { mod = &ml->sml_mod; - /* FIXME: should use LDIF routines to deal with binary data */ - switch ( mod->sm_op ) { case LDAP_MOD_ADD: fprintf( wfp, "add: %s\n", mod->sm_desc->ad_cname.bv_val ); @@ -105,8 +104,14 @@ shell_back_modify( if( mod->sm_values != NULL ) { for ( i = 0; mod->sm_values[i].bv_val != NULL; i++ ) { - fprintf( wfp, "%s: %s\n", mod->sm_desc->ad_cname.bv_val, - mod->sm_values[i].bv_val /* binary! */ ); + char *out = ldif_put( LDIF_PUT_VALUE, + mod->sm_desc->ad_cname.bv_val, + mod->sm_values[i].bv_val, + mod->sm_values[i].bv_len ); + if ( out ) { + fprintf( wfp, "%s", out ); + ber_memfree( out ); + } } }