| 1 |
/*
|
| 2 |
+----------------------------------------------------------------------+
|
| 3 |
| mod_authnz_ibmdb2: structures, defines, globals |
|
| 4 |
+----------------------------------------------------------------------+
|
| 5 |
| Copyright (c) 2006-2008 Helmut K. C. Tessarek |
|
| 6 |
+----------------------------------------------------------------------+
|
| 7 |
| Licensed under the Apache License, Version 2.0 (the "License"); you |
|
| 8 |
| may not use this file except in compliance with the License. You may |
|
| 9 |
| obtain a copy of the License at |
|
| 10 |
| http://www.apache.org/licenses/LICENSE-2.0 |
|
| 11 |
| |
|
| 12 |
| Unless required by applicable law or agreed to in writing, software |
|
| 13 |
| distributed under the License is distributed on an "AS IS" BASIS, |
|
| 14 |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
|
| 15 |
| implied. See the License for the specific language governing |
|
| 16 |
| permissions and limitations under the License. |
|
| 17 |
+----------------------------------------------------------------------+
|
| 18 |
| Author: Helmut K. C. Tessarek |
|
| 19 |
+----------------------------------------------------------------------+
|
| 20 |
| Website: http://mod-auth-ibmdb2.sourceforge.net |
|
| 21 |
+----------------------------------------------------------------------+
|
| 22 |
*/
|
| 23 |
|
| 24 |
/* $Id: mod_authnz_ibmdb2.h,v 1.9 2008/01/06 23:44:04 tessus Exp $ */
|
| 25 |
|
| 26 |
#ifndef MOD_AUTHNZ_IBMDB2_H
|
| 27 |
#define MOD_AUTHNZ_IBMDB2_H
|
| 28 |
|
| 29 |
#ifndef FALSE // FALSE
|
| 30 |
#define FALSE 0
|
| 31 |
#endif
|
| 32 |
#ifndef TRUE // TRUE
|
| 33 |
#define TRUE (!FALSE)
|
| 34 |
#endif
|
| 35 |
|
| 36 |
#define MAX_IBMDB2_UID_LENGTH 18
|
| 37 |
#define MAX_IBMDB2_PWD_LENGTH 30
|
| 38 |
#define MAX_UID_LENGTH 32
|
| 39 |
#define MAX_PWD_LENGTH 64
|
| 40 |
#define MAX_GRP_LENGTH 128
|
| 41 |
|
| 42 |
#define LOG_DBG( msg ) ap_log_rerror( APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, r, "%s", msg )
|
| 43 |
#define LOG_DBGS( msg ) ap_log_error( APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, s, "%s", msg )
|
| 44 |
#define LOG_ERROR( msg ) ap_log_rerror( APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r, "%s", msg )
|
| 45 |
#define MAXERRLEN SQL_MAX_MESSAGE_LENGTH + SQL_SQLSTATE_SIZE + 255
|
| 46 |
|
| 47 |
|
| 48 |
// structure to hold the configuration details for the request
|
| 49 |
typedef struct {
|
| 50 |
char *ibmdb2user; // user ID to connect to db server
|
| 51 |
char *ibmdb2passwd; // password to connect to db server
|
| 52 |
char *ibmdb2DB; // Database name
|
| 53 |
char *ibmdb2pwtable; // user password table
|
| 54 |
char *ibmdb2grptable; // user group table
|
| 55 |
char *ibmdb2NameField; // field in password/grp table with username
|
| 56 |
char *ibmdb2PasswordField; // field in password table with password
|
| 57 |
char *ibmdb2GroupField; // field in group table with group name
|
| 58 |
int ibmdb2Crypted; // are passwords encrypted?
|
| 59 |
int ibmdb2KeepAlive; // keep connection persistent?
|
| 60 |
int ibmdb2Authoritative; // are we authoritative?
|
| 61 |
int ibmdb2NoPasswd; // do we ignore password?
|
| 62 |
char *ibmdb2UserCondition; // Condition to add to the user where-clause in select query
|
| 63 |
char *ibmdb2GroupCondition; // Condition to add to the group where-clause in select query
|
| 64 |
char *ibmdb2UserProc; // stored procedure for user auth
|
| 65 |
char *ibmdb2GroupProc; // stored procedure for group auth
|
| 66 |
int ibmdb2caching; // are user credentials cached?
|
| 67 |
int ibmdb2grpcaching; // is group information cached?
|
| 68 |
char *ibmdb2cachefile; // path to cache file
|
| 69 |
char *ibmdb2cachelifetime; // cache lifetime in seconds
|
| 70 |
} authn_ibmdb2_config_t;
|
| 71 |
|
| 72 |
// structure to hold the sqlca variables
|
| 73 |
typedef struct
|
| 74 |
{
|
| 75 |
char msg[SQL_MAX_MESSAGE_LENGTH + 1];
|
| 76 |
char state[SQL_SQLSTATE_SIZE + 1];
|
| 77 |
int code;
|
| 78 |
} sqlerr_t;
|
| 79 |
|
| 80 |
|
| 81 |
static SQLHANDLE henv; // environment handle
|
| 82 |
static SQLHANDLE hdbc; // db connection handle
|
| 83 |
|
| 84 |
#endif
|
| 85 |
|
| 86 |
/*
|
| 87 |
* Local variables:
|
| 88 |
* tab-width: 4
|
| 89 |
* c-basic-offset: 4
|
| 90 |
* End:
|
| 91 |
* vim600: noet sw=4 ts=4 fdm=marker
|
| 92 |
* vim<600: noet sw=4 ts=4
|
| 93 |
*/
|