/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1998-2003 The OpenLDAP Foundation.
+ * Copyright 1998-2011 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
int bsize, len;
char *buf, *bp;
char line[BUFSIZ];
+ char ebuf[128];
/* read in the result and send it along */
buf = (char *) ch_malloc( BUFSIZ );
if ( errno == EINTR ) continue;
Debug( LDAP_DEBUG_ANY, "shell: fgets failed: %s (%d)\n",
- strerror(errno), errno, 0 );
+ AC_STRERROR_R(errno, ebuf, sizeof ebuf), errno, 0 );
break;
}
}
len = strlen( line );
- while ( bp + len - buf > bsize ) {
+ while ( bp + len + 1 - buf > bsize ) {
size_t offset = bp - buf;
bsize += BUFSIZ;
buf = (char *) ch_realloc( buf, bsize );
buf, 0, 0 );
} else {
rs->sr_attrs = op->oq_search.rs_attrs;
+ rs->sr_flags = REP_ENTRY_MODIFIABLE;
send_search_entry( op, rs );
entry_free( rs->sr_entry );
+ rs->sr_attrs = NULL;
}
bp = buf;