Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Дилян Палаузов
OpenLDAP
Commits
c5241b49
Commit
c5241b49
authored
Aug 26, 2021
by
Howard Chu
Browse files
ITS#9651 ldapmodify: add -i option for interval between ops
parent
405e6b31
Changes
2
Hide whitespace changes
Inline
Side-by-side
clients/tools/ldapmodify.c
View file @
c5241b49
...
...
@@ -94,6 +94,8 @@ static int process_response(
int
res
,
const
struct
berval
*
dn
);
static
long
interval
;
static
struct
timeval
interval_tv
;
static
int
txn
=
0
;
static
int
txnabort
=
0
;
struct
berval
*
txn_id
=
NULL
;
...
...
@@ -113,6 +115,7 @@ usage( void )
fprintf
(
stderr
,
_
(
" -E [!]ext=extparam modify extensions"
" (! indicate s criticality)
\n
"
));
fprintf
(
stderr
,
_
(
" -f file read operations from `file'
\n
"
));
fprintf
(
stderr
,
_
(
" -i time wait `time' microseconds between operations
\n
"
));
fprintf
(
stderr
,
_
(
" -M enable Manage DSA IT control (-MM to make critical)
\n
"
));
fprintf
(
stderr
,
_
(
" -P version protocol version (default: 3)
\n
"
));
fprintf
(
stderr
,
...
...
@@ -125,7 +128,7 @@ usage( void )
const
char
options
[]
=
"aE:rS:"
"cd:D:e:f:h:H:IMnNO:o:p:P:QR:U:vVw:WxX:y:Y:Z"
;
"cd:D:e:f:h:H:
i:
IMnNO:o:p:P:QR:U:vVw:WxX:y:Y:Z"
;
int
handle_private_option
(
int
i
)
...
...
@@ -187,6 +190,19 @@ handle_private_option( int i )
ldapadd
=
1
;
break
;
case
'i'
:
/* interval */
{
char
*
next
;
interval
=
strtol
(
optarg
,
&
next
,
10
);
if
(
!
next
||
*
next
)
{
fprintf
(
stderr
,
"%s: unable to parse interval
\"
%s
\"\n
"
,
prog
,
optarg
);
exit
(
EXIT_FAILURE
);
}
interval_tv
.
tv_usec
=
interval
%
1000000
;
interval_tv
.
tv_sec
=
interval
/
1000000
;
}
break
;
case
'r'
:
/* replace (obsolete) */
break
;
...
...
@@ -296,6 +312,10 @@ main( int argc, char **argv )
memcpy
(
rejbuf
,
rbuf
,
len
+
1
);
}
if
(
interval
)
{
select
(
0
,
NULL
,
NULL
,
NULL
,
&
interval_tv
);
}
rc
=
process_ldif_rec
(
rbuf
,
lineno
);
lineno
=
nextline
+
1
;
...
...
doc/man/man1/ldapmodify.1
View file @
c5241b49
...
...
@@ -21,6 +21,8 @@ ldapmodify, ldapadd \- LDAP modify entry and LDAP add entry tools
[\c
.BI \-f \ file\fR]
[\c
.BI \-i \ time\fR]
[\c
.BI \-S \ file\fR]
[\c
.BR \-M [ M ]]
...
...
@@ -77,6 +79,8 @@ ldapmodify, ldapadd \- LDAP modify entry and LDAP add entry tools
[\c
.BI \-f \ file\fR]
[\c
.BI \-i \ time\fR]
[\c
.BI \-S \ file\fR]
[\c
.BR \-M [ M ]]
...
...
@@ -171,6 +175,9 @@ reporting an error.
Read the entry modification information from \fIfile\fP instead of from
standard input.
.TP
.BI \-i \ time
Wait \fItime\fP microseconds before issuing an operation.
.TP
.BI \-S \ file
Add or change records which were skipped due to an error are written to \fIfile\fP
and the error message returned by the server is added as a comment. Most useful in
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment