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
Nadezhda Ivanova
OpenLDAP
Commits
a6fd7fa9
Commit
a6fd7fa9
authored
Aug 28, 2007
by
Pierangelo Masarati
Browse files
add -S to slapadd to set desired SID in generated entryCSN/contextCSN
parent
5ed5bc58
Changes
4
Hide whitespace changes
Inline
Side-by-side
doc/man/man8/slapadd.8
View file @
a6fd7fa9
...
...
@@ -18,6 +18,7 @@ slapadd \- Add entries to a SLAPD database
.B [\-o name[=value]
.B [\-q]
.B [\-s]
.B [\-S SID]
.B [\-u]
.B [\-v]
.B [\-w]
...
...
@@ -119,6 +120,10 @@ databases containing special objects, such as fractional objects on a
partial replica. Loading normal objects which do not conform to
schema may result in unexpected and ill behavior.
.TP
.B \-S " SID"
Server ID to use in generated entryCSN. Also used for contextCSN
if `\-w' is set as well. Defaults to 0.
.TP
.B \-u
enable dry-run (don't write to backend) mode.
.TP
...
...
servers/slapd/slapadd.c
View file @
a6fd7fa9
...
...
@@ -67,6 +67,9 @@ slapadd( int argc, char **argv )
int
rc
=
EXIT_SUCCESS
;
int
manage
=
0
;
/* default "000" */
csnsid
=
0
;
slap_tool_init
(
progname
,
SLAPADD
,
argc
,
argv
);
memset
(
&
opbuf
,
0
,
sizeof
(
opbuf
)
);
...
...
@@ -220,7 +223,7 @@ slapadd( int argc, char **argv )
nvals
[
1
].
bv_len
=
0
;
nvals
[
1
].
bv_val
=
NULL
;
csn
.
bv_len
=
lutil_csnstr
(
csnbuf
,
sizeof
(
csnbuf
),
0
,
0
);
csn
.
bv_len
=
lutil_csnstr
(
csnbuf
,
sizeof
(
csnbuf
),
csnsid
,
0
);
csn
.
bv_val
=
csnbuf
;
timestamp
.
bv_val
=
timebuf
;
...
...
servers/slapd/slapcommon.c
View file @
a6fd7fa9
...
...
@@ -241,7 +241,7 @@ slap_tool_init(
switch
(
tool
)
{
case
SLAPADD
:
options
=
"b:cd:f:F:gj:l:n:o:qstuvw"
;
options
=
"b:cd:f:F:gj:l:n:o:qs
S:
tuvw"
;
break
;
case
SLAPCAT
:
...
...
@@ -384,6 +384,14 @@ slap_tool_init(
realm
=
optarg
;
break
;
case
'S'
:
if
(
lutil_atoul
(
&
csnsid
,
optarg
)
||
csnsid
>
SLAP_SYNC_SID_MAX
)
{
usage
(
tool
,
progname
);
}
break
;
case
's'
:
/* dump subtree */
if
(
tool
==
SLAPADD
)
mode
|=
SLAP_TOOL_NO_SCHEMA_CHECK
;
...
...
servers/slapd/slapcommon.h
View file @
a6fd7fa9
...
...
@@ -60,6 +60,7 @@ typedef struct tool_vars {
slap_ssf_t
tv_tls_ssf
;
slap_ssf_t
tv_sasl_ssf
;
unsigned
tv_dn_mode
;
unsigned
int
tv_csnsid
;
}
tool_vars
;
extern
tool_vars
tool_globals
;
...
...
@@ -91,6 +92,7 @@ extern tool_vars tool_globals;
#define tls_ssf tool_globals.tv_tls_ssf
#define sasl_ssf tool_globals.tv_sasl_ssf
#define dn_mode tool_globals.tv_dn_mode
#define csnsid tool_globals.tv_csnsid
#define SLAP_TOOL_LDAPDN_PRETTY SLAP_LDAPDN_PRETTY
#define SLAP_TOOL_LDAPDN_NORMAL (SLAP_LDAPDN_PRETTY << 1)
...
...
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