Commit 8b353df0 authored by Ondřej Kuzník's avatar Ondřej Kuzník
Browse files

ITS#9517 Add module args support to slappaswd and relevant docs

parent d0eae409
...@@ -1063,8 +1063,9 @@ per ...@@ -1063,8 +1063,9 @@ per
Normally the config engine generates the "{x}" index in the RDN Normally the config engine generates the "{x}" index in the RDN
automatically, so it can be omitted when initially loading these entries. automatically, so it can be omitted when initially loading these entries.
.TP .TP
.B olcModuleLoad: <filename> .B olcModuleLoad: <filename> [<arguments>...]
Specify the name of a dynamically loadable module to load. The filename Specify the name of a dynamically loadable module to load and any
additional arguments if supported by the module. The filename
may be an absolute path name or a simple filename. Non-absolute names may be an absolute path name or a simple filename. Non-absolute names
are searched for in the directories specified by the are searched for in the directories specified by the
.B olcModulePath .B olcModulePath
......
...@@ -747,8 +747,9 @@ help analyze the logs. ...@@ -747,8 +747,9 @@ help analyze the logs.
Specify the maximum depth of nested filters in search requests. Specify the maximum depth of nested filters in search requests.
The default is 1000. The default is 1000.
.TP .TP
.B moduleload <filename> .B moduleload <filename> [<arguments>...]
Specify the name of a dynamically loadable module to load. The filename Specify the name of a dynamically loadable module to load and any
additional arguments if supported by the module. The filename
may be an absolute path name or a simple filename. Non-absolute names may be an absolute path name or a simple filename. Non-absolute names
are searched for in the directories specified by the are searched for in the directories specified by the
.B modulepath .B modulepath
......
...@@ -75,6 +75,14 @@ The relevant option/value is: ...@@ -75,6 +75,14 @@ The relevant option/value is:
.BR module\-load = argon2 .BR module\-load = argon2
.LP .LP
.RE .RE
Or if non-default parameters are required:
.RS
.LP
.B \-o
.BR module\-load =" argon2
.RB [ <param> ...]"
.LP
.RE
Depending on Depending on
.BR argon2 's .BR argon2 's
location, you may also need: location, you may also need:
......
...@@ -165,7 +165,7 @@ Possible generic options/values are: ...@@ -165,7 +165,7 @@ Possible generic options/values are:
.LP .LP
.nf .nf
module\-path=<pathspec> (see `\fBmodulepath\fP' in slapd.conf(5)) module\-path=<pathspec> (see `\fBmodulepath\fP' in slapd.conf(5))
module\-load=<filename> (see `\fBmoduleload\fP' in slapd.conf(5)) module\-load="<filename> [<arguments>...]" (see `\fBmoduleload\fP' in slapd.conf(5))
.in .in
You can load a dynamically loadable password hash module by You can load a dynamically loadable password hash module by
......
...@@ -44,6 +44,8 @@ ...@@ -44,6 +44,8 @@
static char *modulepath = NULL; static char *modulepath = NULL;
static char *moduleload = NULL; static char *moduleload = NULL;
static int moduleargc = 0;
static char **moduleargv = NULL;
static void static void
usage(const char *s) usage(const char *s)
...@@ -82,7 +84,17 @@ parse_slappasswdopt( void ) ...@@ -82,7 +84,17 @@ parse_slappasswdopt( void )
modulepath = p; modulepath = p;
} else if ( strncasecmp( optarg, "module-load", len ) == 0 ) { } else if ( strncasecmp( optarg, "module-load", len ) == 0 ) {
moduleload = p; ConfigArgs c = { .line = p };
if ( config_fp_parse_line( &c ) ) {
return -1;
}
moduleload = c.argv[0];
moduleargc = c.argc - 1;
if ( moduleargc ) {
moduleargv = c.argv+1;
}
} else { } else {
return -1; return -1;
...@@ -223,7 +235,7 @@ slappasswd( int argc, char *argv[] ) ...@@ -223,7 +235,7 @@ slappasswd( int argc, char *argv[] )
goto destroy; goto destroy;
} }
if ( moduleload && module_load(moduleload, 0, NULL) ) { if ( moduleload && module_load(moduleload, moduleargc, moduleargv) ) {
rc = EXIT_FAILURE; rc = EXIT_FAILURE;
goto destroy; goto destroy;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment