-/* ok, shared_oper handles the stacking, shared_flags handles adding
- * things.. so all we need to do when we start and end a shared block, is
- * clean up anything thats been left over.
- */
-static int
-conf_cleanup_shared(struct TopConf *tc)
-{
- rb_dlink_node *ptr, *next_ptr;
-
- RB_DLINK_FOREACH_SAFE(ptr, next_ptr, yy_shared_list.head)
- {
- free_remote_conf(ptr->data);
- rb_dlinkDestroy(ptr, &yy_shared_list);
- }
-
- if(yy_shared != NULL)
- {
- free_remote_conf(yy_shared);
- yy_shared = NULL;
- }
-
- return 0;
-}
-
-static void
-conf_set_shared_oper(void *data)
-{
- conf_parm_t *args = data;
- const char *username;
- char *p;
-
- if(yy_shared != NULL)
- free_remote_conf(yy_shared);
-
- yy_shared = make_remote_conf();
-
- if(args->next != NULL)
- {
- if(CF_TYPE(args->type) != CF_QSTRING)
- {
- conf_report_error("Ignoring shared::oper -- server is not a qstring");
- return;
- }
-
- yy_shared->server = rb_strdup(args->v.string);
- args = args->next;
- }
- else
- yy_shared->server = rb_strdup("*");
-
- if(CF_TYPE(args->type) != CF_QSTRING)
- {
- conf_report_error("Ignoring shared::oper -- oper is not a qstring");
- return;
- }
-
- if((p = strchr(args->v.string, '@')) == NULL)
- {
- conf_report_error("Ignoring shard::oper -- oper is not a user@host");
- return;
- }
-
- username = args->v.string;
- *p++ = '\0';
-
- if(EmptyString(p))
- yy_shared->host = rb_strdup("*");
- else
- yy_shared->host = rb_strdup(p);
-
- if(EmptyString(username))
- yy_shared->username = rb_strdup("*");
- else
- yy_shared->username = rb_strdup(username);
-
- rb_dlinkAddAlloc(yy_shared, &yy_shared_list);
- yy_shared = NULL;
-}
-
-static void
-conf_set_shared_flags(void *data)
-{
- conf_parm_t *args = data;
- int flags = 0;
- rb_dlink_node *ptr, *next_ptr;
-
- if(yy_shared != NULL)
- free_remote_conf(yy_shared);
-
- set_modes_from_table(&flags, "flag", shared_table, args);
-
- RB_DLINK_FOREACH_SAFE(ptr, next_ptr, yy_shared_list.head)
- {
- yy_shared = ptr->data;
-
- yy_shared->flags = flags;
- rb_dlinkDestroy(ptr, &yy_shared_list);
- rb_dlinkAddTail(yy_shared, &yy_shared->node, &shared_conf_list);
- }
-
- yy_shared = NULL;
-}
-