int match;
int ret;
int checkvals;
- int lineno;
+ int lineno, nextline;
int lmax;
int rc = EXIT_SUCCESS;
int manage = 0;
checkvals = (slapMode & SLAP_TOOL_QUICK) ? 0 : 1;
lmax = 0;
- lineno = 0;
+ nextline = 0;
if( !dryrun && be->be_entry_open( be, 1 ) != 0 ) {
fprintf( stderr, "%s: could not open database.\n",
maxcsn.bv_len = 0;
}
- while( ldif_read_record( ldiffp, &lineno, &buf, &lmax ) ) {
+ /* nextline is the line number of the end of the current entry */
+ for( lineno=1; ldif_read_record( ldiffp, &nextline, &buf, &lmax );
+ lineno=nextline+1 ) {
+
+ if ( lineno < jumpline )
+ continue;
+
Entry *e = str2entry2( buf, checkvals );
/*
case SLAPADD:
options = " [-c]\n\t[-g] [-n databasenumber | -b suffix]\n"
- "\t[-l ldiffile] [-q] [-u] [-s] [-w]\n";
+ "\t[-l ldiffile] [-j linenumber] [-q] [-u] [-s] [-w]\n";
break;
case SLAPAUTH:
switch( tool ) {
case SLAPADD:
- options = "b:cd:f:F:gl:n:o:qstuvw";
+ options = "b:cd:f:F:gj:l:n:o:qstuvw";
break;
case SLAPCAT:
use_glue = 0;
break;
+ case 'j': /* jump to linenumber */
+ if ( lutil_atoi( &jumpline, optarg ) ) {
+ usage( tool, progname );
+ }
+ break;
+
case 'l': /* LDIF file */
ldiffile = strdup( optarg );
break;
int tv_continuemode;
int tv_nosubordinates;
int tv_dryrun;
+ int tv_jumpline;
Filter *tv_filter;
struct berval tv_sub_ndn;
struct LDIFFP *tv_ldiffp;
#define be tool_globals.tv_be
#define verbose tool_globals.tv_verbose
+#define jumpline tool_globals.tv_jumpline
#define update_ctxcsn tool_globals.tv_update_ctxcsn
#define continuemode tool_globals.tv_continuemode
#define nosubordinates tool_globals.tv_nosubordinates