aboutsummaryrefslogtreecommitdiff
path: root/src/pies.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pies.c')
-rw-r--r--src/pies.c61
1 files changed, 46 insertions, 15 deletions
diff --git a/src/pies.c b/src/pies.c
index 696e9f0..9f5f174 100644
--- a/src/pies.c
+++ b/src/pies.c
@@ -18,6 +18,7 @@
#include <locale.h>
#include <configmake.h>
#include "meta1lex.h"
+#include "identity.h"
int preprocess_only; /* Preprocess config, do nothing more */
int lint_mode; /* Test configuration syntax and exit */
@@ -1541,9 +1542,15 @@ struct grecs_keyword control_keywords[] = {
&control.url, 0, _cb_url},
{"acl",
N_("name: string"),
- N_("Set ACL."),
+ N_("Set connection ACL."),
grecs_type_section, GRECS_DFLT,
- &control.acl, 0,
+ &control.conn_acl, 0,
+ acl_section_parser, NULL, acl_keywords},
+ {"identity-acl",
+ N_("name: string"),
+ N_("Set identity ACL."),
+ grecs_type_section, GRECS_DFLT,
+ &control.id_acl, 0,
acl_section_parser, NULL, acl_keywords},
{"idle-timeout",
"n",
@@ -1760,6 +1767,8 @@ struct grecs_keyword pies_keywords[] = {
&mailer_command_line, 0,
NULL
},
+ { "identity-provider", "name: string", "Configure identity provider",
+ grecs_type_section, GRECS_INAC | GRECS_HIDDEN },
{NULL}
};
@@ -1775,6 +1784,39 @@ config_init ()
obstack_grow (&pp_stk, DEFAULT_PREPROCESSOR,
sizeof (DEFAULT_PREPROCESSOR) - 1);
}
+ pies_identity_mechanism_register (&system_identity_mechanism);
+#ifdef WITH_PAM
+ pies_identity_mechanism_register (&pam_identity_mechanism);
+#endif
+}
+
+static void
+config_error ()
+{
+ if (!init_process)
+ exit (EX_CONFIG);
+}
+
+void
+config_parse (char const *name)
+{
+ struct grecs_node *node;
+ struct grecs_node *tree = grecs_parse (name);
+ if (!tree)
+ config_error ();
+
+ for (node = tree; node; node = node->next)
+ {
+ node = grecs_find_node (node, "identity-provider");
+ if (!node)
+ break;
+ pies_config_provider (node);
+ }
+
+ if (grecs_tree_process (tree, pies_keywords))
+ config_error ();
+
+ grecs_tree_free (tree);
}
void
@@ -1786,6 +1828,7 @@ config_help ()
"For more information, use `info pies configuration'.");
grecs_print_docstring (docstring, 0, stdout);
grecs_print_statement_array (pies_keywords, 1, 0, stdout);
+ pies_config_identity_mechanisms_help ();
}
static enum config_syntax current_syntax = CONF_PIES;
@@ -2241,13 +2284,6 @@ set_state_file_names (const char *base)
qotdfile = mkfilename (statedir, base, ".qotd");
}
-static void
-config_error ()
-{
- if (!init_process)
- exit (EX_CONFIG);
-}
-
int
main (int argc, char **argv)
{
@@ -2367,13 +2403,8 @@ main (int argc, char **argv)
switch (file->syntax)
{
case CONF_PIES:
- {
- struct grecs_node *tree = grecs_parse (file->name);
- if (!tree || grecs_tree_process (tree, pies_keywords))
- config_error ();
- grecs_tree_free (tree);
+ config_parse (file->name);
break;
- }
case CONF_INETD:
if (inetd_parse_conf (file->name))

Return to:

Send suggestions and report system problems to the System administrator.