Commit 5a7300d3 authored by godog's avatar godog

mod_sso: fix to compile on both apache 2.2 and 2.4

parent 5c8d0c89
...@@ -72,17 +72,6 @@ static char *groups_charp_to_string(apr_pool_t *p, const char **groups) { ...@@ -72,17 +72,6 @@ static char *groups_charp_to_string(apr_pool_t *p, const char **groups) {
return groups_array_to_commasep_string(p, arr); return groups_array_to_commasep_string(p, arr);
} }
static char **groups_array_to_charpp(apr_pool_t *p, apr_array_header_t *groups) {
int i;
char **pp, **ptr;
pp = (char **)apr_palloc(p, sizeof(char *) * (groups->nelts + 1));
for (ptr = pp, i = 0; i < groups->nelts; i++) {
*ptr++ = APR_ARRAY_IDX(groups, i, char *);
}
*ptr = NULL;
return pp;
}
/** /**
* Create a modsso_config structure. * Create a modsso_config structure.
* *
...@@ -613,7 +602,7 @@ static int redirect_to_login_server(request_rec *r, ...@@ -613,7 +602,7 @@ static int redirect_to_login_server(request_rec *r,
return http_redirect(r, login_url); return http_redirect(r, login_url);
} }
#if 0 #if MODULE_MAGIC_NUMBER_MAJOR < 20100714
static char *pkey_to_string(const unsigned char *pkey, char *buf) { static char *pkey_to_string(const unsigned char *pkey, char *buf) {
static const char *hex = "0123456789ABCDEF"; static const char *hex = "0123456789ABCDEF";
char *o = buf; char *o = buf;
...@@ -886,6 +875,17 @@ static int mod_sso_check_user_id(request_rec *r) ...@@ -886,6 +875,17 @@ static int mod_sso_check_user_id(request_rec *r)
* Apache authorization check callback for mod_sso. * Apache authorization check callback for mod_sso.
*/ */
#if MODULE_MAGIC_NUMBER_MAJOR >= 20100714 #if MODULE_MAGIC_NUMBER_MAJOR >= 20100714
static char **groups_array_to_charpp(apr_pool_t *p, apr_array_header_t *groups) {
int i;
char **pp, **ptr;
pp = (char **)apr_palloc(p, sizeof(char *) * (groups->nelts + 1));
for (ptr = pp, i = 0; i < groups->nelts; i++) {
*ptr++ = APR_ARRAY_IDX(groups, i, char *);
}
*ptr = NULL;
return pp;
}
static apr_array_header_t *required_groups_array(request_rec *r, const void *parsed_require_args) { static apr_array_header_t *required_groups_array(request_rec *r, const void *parsed_require_args) {
const ap_expr_info_t *expr = parsed_require_args; const ap_expr_info_t *expr = parsed_require_args;
const char *err = NULL; const char *err = NULL;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment