]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9517 Add module args support to slappaswd and relevant docs
authorOndřej Kuzník <ondra@mistotebe.net>
Fri, 9 Apr 2021 09:38:42 +0000 (10:38 +0100)
committerOndřej Kuzník <ondra@mistotebe.net>
Wed, 14 Apr 2021 17:17:59 +0000 (18:17 +0100)
doc/man/man5/slapd-config.5
doc/man/man5/slapd.conf.5
doc/man/man5/slappw-argon2.5
doc/man/man8/slappasswd.8
servers/slapd/slappasswd.c

index 1b28dc405d81d5ba80e2c8d0e595de99114cd8ed..a559b0c1cd0e649ad6dad9f19a865cf7f7412844 100644 (file)
@@ -1063,8 +1063,9 @@ per
 Normally the config engine generates the "{x}" index in the RDN
 automatically, so it can be omitted when initially loading these entries.
 .TP
-.B olcModuleLoad: <filename>
-Specify the name of a dynamically loadable module to load. The filename
+.B olcModuleLoad: <filename> [<arguments>...]
+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
 are searched for in the directories specified by the
 .B olcModulePath
index 11190261bd862b276e857886e20d488772b28b65..b6e9250026ad249c954ab0b26adebf2a92e409f3 100644 (file)
@@ -747,8 +747,9 @@ help analyze the logs.
 Specify the maximum depth of nested filters in search requests.
 The default is 1000.
 .TP
-.B moduleload <filename>
-Specify the name of a dynamically loadable module to load. The filename
+.B moduleload <filename> [<arguments>...]
+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
 are searched for in the directories specified by the
 .B modulepath
index 8ec53b2acea9a443207dbf5e35931d3c7f4683f5..f5907b673ac30d3bbc4ee42e3f7d6cef414bf487 100644 (file)
@@ -75,6 +75,14 @@ The relevant option/value is:
 .BR module\-load = argon2
 .LP
 .RE
+Or if non-default parameters are required:
+.RS
+.LP
+.B \-o
+.BR module\-load =" argon2
+.RB [ <param> ...]"
+.LP
+.RE
 Depending on
 .BR argon2 's
 location, you may also need:
index 3d2165d36db48ae9eed36be544ef86585a388f1c..50cacd8fe89cbb5eafcaffb6c4a020fd2da6e275 100644 (file)
@@ -165,7 +165,7 @@ Possible generic options/values are:
 .LP
 .nf
               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
 You can load a dynamically loadable password hash module by
index 2028db4fa11135623a5dcfd0d3fc8d0687d2f00c..99105ba5822e9b8e35943e82810f13baf262a73b 100644 (file)
@@ -44,6 +44,8 @@
 
 static char    *modulepath = NULL;
 static char    *moduleload = NULL;
+static int     moduleargc = 0;
+static char    **moduleargv = NULL;
 
 static void
 usage(const char *s)
@@ -82,7 +84,17 @@ parse_slappasswdopt( void )
                modulepath = p;
 
        } 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 {
                return -1;
@@ -223,7 +235,7 @@ slappasswd( int argc, char *argv[] )
                goto destroy;
        }
 
-       if ( moduleload && module_load(moduleload, 0, NULL) ) {
+       if ( moduleload && module_load(moduleload, moduleargc, moduleargv) ) {
                rc = EXIT_FAILURE;
                goto destroy;
        }