13 int ldap_syslog_level;
19 fprintf( stderr, "usage: %s [-b] <attrtype>\n", name );
31 if (argc < 2 || argc > 3 ) {
35 if ( strcmp( argv[1], "-b" ) != 0 ) {
42 if ( strcmp( argv[1], "-b" ) == 0 ) {
48 /* if the -b flag was used, read single binary value from stdin */
53 if (( val = (char *) malloc( BUFSIZ )) == NULL ) {
59 while ( (nread = read( 0, buf, BUFSIZ )) != 0 ) {
60 if ( nread + cur > max ) {
62 if (( val = (char *) realloc( val, max )) ==
68 memcpy( val + cur, buf, nread );
72 if (( out = ldif_type_and_value( type, val, cur )) == NULL ) {
73 perror( "ldif_type_and_value" );
83 /* not binary: one value per line... */
84 while ( fgets( buf, sizeof(buf), stdin ) != NULL ) {
85 if( buf[len=strlen(buf)] == '\n') buf[len] = '\0';
87 if (( out = ldif_type_and_value( type, buf, strlen( buf ) ))
89 perror( "ldif_type_and_value" );