8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-31 00:03:02 +01:00
firebird-mirror/src/jrd/pwd.h

82 lines
1.9 KiB
C
Raw Normal View History

2001-05-23 15:26:42 +02:00
/*
* PROGRAM: JRD Access Method
* MODULE: pwd.h
* DESCRIPTION: User information database name
*
* The contents of this file are subject to the Interbase Public
* License Version 1.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy
* of the License at http://www.Inprise.com/IPL.html
*
* Software distributed under the License is distributed on an
* "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
* or implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code was created by Inprise Corporation
* and its predecessors. Portions created by Inprise Corporation are
* Copyright (C) Inprise Corporation.
*
* All Rights Reserved.
* Contributor(s): ______________________________________.
2002-10-30 07:40:58 +01:00
*
* 2002.10.29 Sean Leyne - Removed obsolete "Netware" port
* 2003.02.02 Dmitry Yemanov: Implemented cached security database connection
2001-05-23 15:26:42 +02:00
*/
#ifndef _JRD_PWD_H_
#define _JRD_PWD_H_
#include "../jrd/ibase.h"
2001-05-23 15:26:42 +02:00
#define MAX_PASSWORD_ENC_LENGTH 12
#define PASSWORD_SALT "9z"
2001-05-23 15:26:42 +02:00
class SecurityDatabase
{
typedef struct {
SLONG gid;
SLONG uid;
SSHORT flag;
SCHAR password[34];
} user_record;
2001-05-23 15:26:42 +02:00
public:
2001-05-23 15:26:42 +02:00
static void getPath(TEXT*);
static void initialize();
static void shutdown();
static void verifyUser(TEXT*, TEXT*, TEXT*, TEXT*, int*, int*, int*);
2002-07-06 07:32:02 +02:00
private:
2001-05-23 15:26:42 +02:00
static const UCHAR PWD_REQUEST[256];
static const UCHAR TPB[4];
2001-05-23 15:26:42 +02:00
STATUS status[ISC_STATUS_LENGTH];
2001-07-12 07:46:06 +02:00
isc_db_handle lookup_db;
isc_req_handle lookup_req;
static const bool is_cached;
int counter;
void fini();
void init();
bool lookup_user(TEXT*, int*, int*, TEXT*);
bool prepare();
2001-05-23 15:26:42 +02:00
static SecurityDatabase& instance();
SecurityDatabase() : lookup_db(0), lookup_req(0), counter(0) {}
};
#ifdef VMS
2003-02-05 16:46:15 +01:00
#define USER_INFO_NAME "[sysmgr]security.fdb"
2001-05-23 15:26:42 +02:00
#else
2003-02-05 16:46:15 +01:00
#define USER_INFO_NAME "security.fdb"
#endif
2001-05-23 15:26:42 +02:00
#endif /* _JRD_PWD_H_ */