5 #include <sys/socket.h>
11 int ldap_syslog_level;
17 fprintf( stderr, "usage: %s [-b] <attrtype>\n", name );
29 if (argc < 2 || argc > 3 ) {
33 if ( strcmp( argv[1], "-b" ) != 0 ) {
40 if ( strcmp( argv[1], "-b" ) == 0 ) {
46 /* if the -b flag was used, read single binary value from stdin */
51 if (( val = (char *) malloc( BUFSIZ )) == NULL ) {
57 while ( (nread = read( 0, buf, BUFSIZ )) != 0 ) {
58 if ( nread + cur > max ) {
60 if (( val = (char *) realloc( val, max )) ==
66 memcpy( val + cur, buf, nread );
70 if (( out = ldif_type_and_value( type, val, cur )) == NULL ) {
71 perror( "ldif_type_and_value" );
81 /* not binary: one value per line... */
82 while ( gets( buf ) != NULL ) {
83 if (( out = ldif_type_and_value( type, buf, strlen( buf ) ))
85 perror( "ldif_type_and_value" );