mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-28 02:29:34 -05:00
Allow arbitrary exop data to be base64 encoded
Argument matches LDIF, ie <oid|oid:data|oid::b64data>
This commit is contained in:
parent
57233907ad
commit
cc475f4bbe
1 changed files with 20 additions and 5 deletions
|
|
@ -42,7 +42,7 @@ void
|
|||
usage( void )
|
||||
{
|
||||
fprintf( stderr, _("Issue LDAP extended operations\n\n"));
|
||||
fprintf( stderr, _("usage: %s [options] [oid[:data]]\n"), prog);
|
||||
fprintf( stderr, _("usage: %s [options] <oid|oid:data|oid::b64data>\n"), prog);
|
||||
tool_common_usage();
|
||||
exit( EXIT_FAILURE );
|
||||
}
|
||||
|
|
@ -190,17 +190,32 @@ main( int argc, char *argv[] )
|
|||
}
|
||||
|
||||
p = strchr( argv[ 0 ], ':' );
|
||||
if ( p == argv[ 0 ] ) {
|
||||
usage();
|
||||
}
|
||||
|
||||
if ( p != NULL )
|
||||
*p++ = '\0';
|
||||
|
||||
if ( tool_is_oid( argv[ 0 ] ) ) {
|
||||
struct berval reqdata;
|
||||
struct berval reqdata;
|
||||
struct berval type;
|
||||
struct berval value;
|
||||
int freeval;
|
||||
|
||||
if ( p ) {
|
||||
reqdata.bv_val = p;
|
||||
reqdata.bv_len = strlen( reqdata.bv_val );
|
||||
if ( p != NULL ) {
|
||||
p[ -1 ] = ':';
|
||||
ldif_parse_line2( argv[ 0 ], &type, &value, &freeval );
|
||||
p[ -1 ] = '\0';
|
||||
|
||||
if ( freeval ) {
|
||||
reqdata = value;
|
||||
} else {
|
||||
ber_dupbv( &reqdata, &value );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
tool_server_controls( ld, NULL, 0 );
|
||||
|
||||
rc = ldap_extended_operation( ld, argv[ 0 ], p ? &reqdata : NULL, NULL, NULL, &id );
|
||||
|
|
|
|||
Loading…
Reference in a new issue