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
ingo Voss
OpenLDAP
Commits
d0eae409
Commit
d0eae409
authored
Apr 13, 2021
by
Ondřej Kuzník
Browse files
Expose slapTool for use elsewhere
parent
d6d93463
Changes
5
Hide whitespace changes
Inline
Side-by-side
servers/slapd/slap.h
View file @
d0eae409
...
...
@@ -1612,6 +1612,22 @@ LDAP_SLAPD_V (int) slapMode;
#define SB_TLS_ON 1
#define SB_TLS_CRITICAL 2
enum
slaptool
{
SLAPADD
=
1
,
/* LDIF -> database tool */
SLAPCAT
,
/* database -> LDIF tool */
SLAPDN
,
/* DN check w/ syntax tool */
SLAPINDEX
,
/* database index tool */
SLAPMODIFY
,
/* database modify tool */
SLAPPASSWD
,
/* password generation tool */
SLAPSCHEMA
,
/* schema checking tool */
SLAPTEST
,
/* slapd.conf test tool */
SLAPAUTH
,
/* test authz-regexp and authc/authz stuff */
SLAPACL
,
/* test acl */
SLAPLAST
};
LDAP_SLAPD_V
(
enum
slaptool
)
slapTool
;
typedef
struct
slap_keepalive
{
int
sk_idle
;
int
sk_probes
;
...
...
servers/slapd/slapcommon.c
View file @
d0eae409
...
...
@@ -39,6 +39,7 @@
#include "ldif.h"
tool_vars
tool_globals
;
enum
slaptool
slapTool
;
#ifdef CSRIMALLOC
static
char
*
leakfilename
;
...
...
@@ -671,6 +672,7 @@ slap_tool_init(
* initialize stuff and figure out which backend we're dealing with
*/
slapTool
=
tool
;
rc
=
slap_init
(
mode
,
progname
);
if
(
rc
!=
0
)
{
fprintf
(
stderr
,
"%s: slap_init failed!
\n
"
,
progname
);
...
...
servers/slapd/slapcommon.h
View file @
d0eae409
...
...
@@ -20,20 +20,6 @@
#define SLAPD_TOOLS 1
#include "slap.h"
enum
slaptool
{
SLAPADD
=
1
,
/* LDIF -> database tool */
SLAPCAT
,
/* database -> LDIF tool */
SLAPDN
,
/* DN check w/ syntax tool */
SLAPINDEX
,
/* database index tool */
SLAPMODIFY
,
/* database modify tool */
SLAPPASSWD
,
/* password generation tool */
SLAPSCHEMA
,
/* schema checking tool */
SLAPTEST
,
/* slapd.conf test tool */
SLAPAUTH
,
/* test authz-regexp and authc/authz stuff */
SLAPACL
,
/* test acl */
SLAPLAST
};
typedef
struct
tool_vars
{
Backend
*
tv_be
;
int
tv_dbnum
;
...
...
servers/slapd/slappasswd.c
View file @
d0eae409
...
...
@@ -37,9 +37,11 @@
#include <lutil_sha1.h>
#include "ldap_defaults.h"
#include "slap.h"
#include "slap-config.h"
#include "slapcommon.h"
static
int
verbose
=
0
;
static
char
*
modulepath
=
NULL
;
static
char
*
moduleload
=
NULL
;
...
...
@@ -204,6 +206,7 @@ slappasswd( int argc, char *argv[] )
usage
(
progname
);
}
}
slapTool
=
SLAPPASSWD
;
if
(
argc
-
optind
!=
0
)
{
usage
(
progname
);
...
...
servers/slapd/slapschema.c
View file @
d0eae409
...
...
@@ -53,7 +53,7 @@ slapschema( int argc, char **argv )
int
requestBSF
=
0
;
int
doBSF
=
0
;
slap_tool_init
(
progname
,
SLAP
CAT
,
argc
,
argv
);
slap_tool_init
(
progname
,
SLAP
SCHEMA
,
argc
,
argv
);
requestBSF
=
(
sub_ndn
.
bv_len
||
filter
);
...
...
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