- - Lauri
>From 0939f06887d7684a971406ea44f0d3113cb52aef Mon Sep 17 00:00:00 2001 From: Lauri Kasanen <[email protected]> Date: Mon, 21 May 2012 19:47:45 +0300 Subject: [PATCH 03/13] auth: Symbol visibility treatment. -1kb
Signed-off-by: Lauri Kasanen <[email protected]> --- plugins/auth/auth.c | 4 +--- plugins/auth/auth.h | 4 ++++ plugins/auth/base64.c | 2 ++ plugins/auth/base64.h | 9 +++++++++ plugins/auth/conf.c | 4 ++-- plugins/auth/conf.h | 4 ++++ plugins/auth/sha1.h | 4 ++++ 7 files changed, 26 insertions(+), 5 deletions(-) diff --git a/plugins/auth/auth.c b/plugins/auth/auth.c index 5bae229..c1c537d 100644 --- a/plugins/auth/auth.c +++ b/plugins/auth/auth.c @@ -36,9 +36,7 @@ MONKEY_PLUGIN("auth", /* shortname */ VERSION, /* version */ MK_PLUGIN_STAGE_30); /* hooks */ -struct mk_config *conf; - -int mk_auth_validate_user(struct users_file *users, +static int mk_auth_validate_user(struct users_file *users, const char *credentials, unsigned int len) { int sep; diff --git a/plugins/auth/auth.h b/plugins/auth/auth.h index 415b5ea..2fb53f2 100644 --- a/plugins/auth/auth.h +++ b/plugins/auth/auth.h @@ -49,6 +49,8 @@ * */ +#pragma GCC visibility push(hidden) + /* List of virtual hosts to handle locations */ struct mk_list vhosts_list; @@ -106,4 +108,6 @@ mk_pointer auth_header_basic; #define SHA1_DIGEST_LEN 20 +#pragma GCC visibility pop + #endif diff --git a/plugins/auth/base64.c b/plugins/auth/base64.c index bc6bf30..f3d3c79 100644 --- a/plugins/auth/base64.c +++ b/plugins/auth/base64.c @@ -9,6 +9,8 @@ #include <stdlib.h> #include <string.h> +#include "base64.h" + static const unsigned char base64_table[65] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; diff --git a/plugins/auth/base64.h b/plugins/auth/base64.h index 1ad79ab..cfff526 100644 --- a/plugins/auth/base64.h +++ b/plugins/auth/base64.h @@ -1,4 +1,13 @@ +#ifndef AUTH_BASE64_H +#define AUTH_BASE64_H + +#pragma GCC visibility push(hidden) + unsigned char * base64_encode(const unsigned char *src, size_t len, size_t *out_len); unsigned char *base64_decode(const unsigned char *src, size_t len, size_t *out_len); + +#pragma GCC visibility pop + +#endif diff --git a/plugins/auth/conf.c b/plugins/auth/conf.c index 078c895..2aef40f 100644 --- a/plugins/auth/conf.c +++ b/plugins/auth/conf.c @@ -21,9 +21,9 @@ #include <string.h> #include "MKPlugin.h" -#include "sha1.h" #include "base64.h" #include "auth.h" +#include "conf.h" /* * Register a users file into the main list, if the users @@ -31,7 +31,7 @@ * otherwise add the node to the list and return the node * created. */ -struct users_file *mk_auth_conf_add_users(char *users_path) +static struct users_file *mk_auth_conf_add_users(char *users_path) { struct file_info finfo; struct mk_list *head; diff --git a/plugins/auth/conf.h b/plugins/auth/conf.h index 79c6f94..47dcfc2 100644 --- a/plugins/auth/conf.h +++ b/plugins/auth/conf.h @@ -22,6 +22,10 @@ #ifndef MK_AUTH_CONF_H #define MK_AUTH_CONF_H +#pragma GCC visibility push(hidden) + int mk_auth_conf_init_users_list(); +#pragma GCC visibility pop + #endif diff --git a/plugins/auth/sha1.h b/plugins/auth/sha1.h index 4a75ab3..dd6beaa 100644 --- a/plugins/auth/sha1.h +++ b/plugins/auth/sha1.h @@ -6,6 +6,8 @@ * none of the original Mozilla code remains. */ +#pragma GCC visibility push(hidden) + typedef struct { unsigned long long size; unsigned int H[5]; @@ -20,3 +22,5 @@ void blk_SHA1_Final(unsigned char hashout[20], blk_SHA_CTX *ctx); #define SHA1_Init blk_SHA1_Init #define SHA1_Update blk_SHA1_Update #define SHA1_Final blk_SHA1_Final + +#pragma GCC visibility pop -- 1.7.2.1
_______________________________________________ Monkey mailing list [email protected] http://lists.monkey-project.com/listinfo/monkey
