8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-30 19:23:03 +01:00
firebird-mirror/src/jrd/jrd_pwd.h

87 lines
2.0 KiB
C
Raw Normal View History

/*
* PROGRAM: JRD Access Method
2003-02-19 07:14:39 +01:00
* MODULE: jrd_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.29 Sean Leyne - Removed obsolete "Netware" port
* 2003.02.02 Dmitry Yemanov: Implemented cached security database connection
*/
#ifndef JRD_PWD_H
#define JRD_PWD_H
#include "../jrd/ibase.h"
2003-10-05 12:27:08 +02:00
#include "../jrd/smp_impl.h"
#include "../jrd/thd.h"
const int MAX_PASSWORD_ENC_LENGTH = 12;
static const char* PASSWORD_SALT = "9z";
class SecurityDatabase
{
2003-12-31 06:36:12 +01:00
struct user_record {
SLONG gid;
SLONG uid;
SSHORT flag;
SCHAR password[34];
2003-12-31 06:36:12 +01:00
};
public:
static void getPath(TEXT*);
static void initialize();
static void shutdown();
2003-12-31 06:36:12 +01:00
static void verifyUser(TEXT*, const TEXT*, const TEXT*, const TEXT*,
int*, int*, int*);
private:
static const UCHAR PWD_REQUEST[256];
static const UCHAR TPB[4];
2003-10-05 12:27:08 +02:00
V4Mutex mutex;
2003-04-16 12:18:51 +02:00
ISC_STATUS_ARRAY status;
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();
2003-10-03 14:28:54 +02:00
static SecurityDatabase instance;
2003-10-05 12:27:08 +02:00
SecurityDatabase() {}
};
#ifdef VMS
static const char* USER_INFO_NAME = "[sysmgr]security.fdb";
#else
static const char* USER_INFO_NAME = "security.fdb";
#endif
#endif /* JRD_PWD_H */