From 85f77d8944779bfac7f65271a7f5c5986700b648 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sun, 13 Aug 2017 01:10:01 +0200 Subject: [PATCH] server: Rename functions related to user lists. The common user_list prefix of the two public functions declared in user_list.h indicates that these functions are defined in user_list.c. --- command.c | 2 +- server.c | 2 +- user_list.c | 8 ++++---- user_list.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/command.c b/command.c index 74e13635..aea48146 100644 --- a/command.c +++ b/command.c @@ -818,7 +818,7 @@ static int parse_auth_request(char *buf, int len, const struct user **u, } } PARA_DEBUG_LOG("received auth request for user %s\n", username); - *u = lookup_user(username); + *u = user_list_lookup(username); ret = 1; out: free_argv(features); diff --git a/server.c b/server.c index 593d92c5..20019ef6 100644 --- a/server.c +++ b/server.c @@ -283,7 +283,7 @@ success: daemon_set_flag(DF_LOG_TIMING); daemon_set_priority(OPT_UINT32_VAL(PRIORITY)); if (user_list_file) - init_user_list(user_list_file); + user_list_init(user_list_file); ret = 1; free_cf: free(cf); diff --git a/user_list.c b/user_list.c index cf53c0fa..c9d265e5 100644 --- a/user_list.c +++ b/user_list.c @@ -21,7 +21,7 @@ static struct list_head user_list; * Populates a linked list of all users in \a user_list_file. Returns on * success, calls exit() on errors. */ -static void populate_user_list(char *user_list_file) +static void populate(char *user_list_file) { int ret = -E_USERLIST; FILE *file_ptr = fopen(user_list_file, "r"); @@ -101,7 +101,7 @@ err: * If this function is called for the second time, the contents of the * previous call are discarded, i.e. the user list is reloaded. */ -void init_user_list(char *user_list_file) +void user_list_init(char *user_list_file) { struct user *u, *tmp; static int initialized; @@ -116,7 +116,7 @@ void init_user_list(char *user_list_file) } else INIT_LIST_HEAD(&user_list); initialized = 1; - populate_user_list(user_list_file); + populate(user_list_file); } /** @@ -127,7 +127,7 @@ void init_user_list(char *user_list_file) * \return A pointer to the corresponding user struct if the user was found, \p * NULL otherwise. */ -const struct user *lookup_user(const char *name) +const struct user *user_list_lookup(const char *name) { const struct user *u; list_for_each_entry(u, &user_list, node) { diff --git a/user_list.h b/user_list.h index e4fbd466..3ef62170 100644 --- a/user_list.h +++ b/user_list.h @@ -32,5 +32,5 @@ struct user { unsigned int perms; }; -void init_user_list(char *user_list_file); -const struct user *lookup_user(const char *name); +void user_list_init(char *user_list_file); +const struct user *user_list_lookup(const char *name); -- 2.39.5