Skip to content

Commit 342cea5

Browse files
committed
Add mod_auth_gssapi.h
Move all includes into it and also include config.h which was missing causing some ifdefed code not to be compiled. Also address includes conflict between httpd.h and config.h and the PACKAGE_* variables.
1 parent 197cf29 commit 342cea5

File tree

3 files changed

+35
-21
lines changed

3 files changed

+35
-21
lines changed

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ AC_CONFIG_SRCDIR([src/mod_auth_gssapi.c])
44
AM_INIT_AUTOMAKE([-Wall foreign subdir-objects tar-pax])
55
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
66
AC_CONFIG_MACRO_DIR([m4])
7-
AC_CONFIG_HEADERS([config.h])
7+
AC_CONFIG_HEADERS([src/config.h])
88

99
# Checks for programs.
1010
AC_PROG_CC

src/mod_auth_gssapi.c

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,30 +22,12 @@
2222
DEALINGS IN THE SOFTWARE.
2323
*/
2424

25-
#include <stdbool.h>
26-
#include <stdint.h>
27-
#include <gssapi/gssapi.h>
28-
#include <gssapi/gssapi_ext.h>
29-
30-
#include <httpd.h>
31-
#include <http_core.h>
32-
#include <http_connection.h>
33-
#include <http_log.h>
34-
#include <http_request.h>
35-
#include <apr_strings.h>
36-
#include <apr_base64.h>
25+
#include "mod_auth_gssapi.h"
3726

3827
module AP_MODULE_DECLARE_DATA auth_gssapi_module;
3928

4029
APR_DECLARE_OPTIONAL_FN(int, ssl_is_https, (conn_rec *));
4130

42-
struct mag_config {
43-
bool ssl_only;
44-
bool map_to_local;
45-
bool gss_conn_ctx;
46-
gss_key_value_set_desc cred_store;
47-
};
48-
4931
static char *mag_status(request_rec *req, int type, uint32_t err)
5032
{
5133
uint32_t maj_ret, min_ret;
@@ -243,7 +225,7 @@ static int mag_auth(request_rec *req)
243225
}
244226

245227
#ifdef HAVE_GSS_STORE_CRED_INTO
246-
if (cfg->cred_store && delegated_cred != GSS_C_NO_CREDENTIAL) {
228+
if (cfg->cred_store.count != 0 && delegated_cred != GSS_C_NO_CREDENTIAL) {
247229
gss_key_value_set_desc store = {0, NULL};
248230
/* FIXME: run substitutions */
249231

src/mod_auth_gssapi.h

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/* Copyright (C) 2014 mod_auth_gssapi authors - See COPYING for (C) terms */
2+
3+
#include <stdbool.h>
4+
#include <stdint.h>
5+
#include <gssapi/gssapi.h>
6+
#include <gssapi/gssapi_ext.h>
7+
8+
#include <httpd.h>
9+
#include <http_core.h>
10+
#include <http_connection.h>
11+
#include <http_log.h>
12+
#include <http_request.h>
13+
#include <apr_strings.h>
14+
#include <apr_base64.h>
15+
16+
/* apache's httpd.h drags in empty PACKAGE_* variables.
17+
* undefine them to avoid annoying compile warnings as they
18+
* are re-defined in config.h */
19+
#undef PACKAGE_BUGREPORT
20+
#undef PACKAGE_NAME
21+
#undef PACKAGE_STRING
22+
#undef PACKAGE_TARNAME
23+
#undef PACKAGE_VERSION
24+
#include "config.h"
25+
26+
struct mag_config {
27+
bool ssl_only;
28+
bool map_to_local;
29+
bool gss_conn_ctx;
30+
gss_key_value_set_desc cred_store;
31+
};
32+

0 commit comments

Comments
 (0)