}
vss_shutdown();
shm_detach(mmd);
+ user_list_deplete();
lls_free_parse_result(server_lpr, CMD_PTR);
if (server_lpr != cmdline_lpr)
lls_free_parse_result(cmdline_lpr, CMD_PTR);
goto again;
}
+/**
+ * Remove all entries from the user list.
+ *
+ * This is called on shutdown and when the user list is reloaded because the
+ * server received SIGHUP.
+ */
+void user_list_deplete(void)
+{
+ struct user *u, *tmpu;
+
+ list_for_each_entry_safe(u, tmpu, &user_list, node) {
+ list_del(&u->node);
+ free(u->name);
+ free_public_key(u->pubkey);
+ free(u);
+ }
+}
+
/**
* Initialize the list of users allowed to connect to para_server.
*
{
int ret = -E_USERLIST;
FILE *file_ptr = fopen(user_list_file, "r");
- struct user *u, *tmpu;
+ struct user *u;
if (!file_ptr)
goto err;
- list_for_each_entry_safe(u, tmpu, &user_list, node) {
- list_del(&u->node);
- free(u->name);
- free_public_key(u->pubkey);
- free(u);
- }
+ user_list_deplete();
for (;;) {
int num;
char line[255];
};
void user_list_init(char *user_list_file);
+void user_list_deplete(void);
const struct user *user_list_lookup(const char *name);