|
From: <ale...@us...> - 2011-01-14 17:31:50
|
Revision: 52121
http://firebird.svn.sourceforge.net/firebird/?rev=52121&view=rev
Author: alexpeshkoff
Date: 2011-01-14 17:31:40 +0000 (Fri, 14 Jan 2011)
Log Message:
-----------
New plugin manager. Use it for all types of plugins.
Modified Paths:
--------------
firebird/trunk/builds/install/misc/aliases.conf.in
firebird/trunk/builds/install/misc/firebird.conf.in
firebird/trunk/builds/posix/Makefile.in
firebird/trunk/builds/posix/firebird.vers
firebird/trunk/builds/posix/make.defaults
firebird/trunk/builds/posix/make.shared.variables
firebird/trunk/builds/posix/prefix.linux
firebird/trunk/builds/posix/prefix.linux_amd64
firebird/trunk/builds/posix/udr_engine.vers
firebird/trunk/configure.in
firebird/trunk/src/auth/AuthDbg.cpp
firebird/trunk/src/auth/AuthDbg.h
firebird/trunk/src/auth/AuthInterface.h
firebird/trunk/src/auth/SecurityDatabase/LegacyClient.cpp
firebird/trunk/src/auth/SecurityDatabase/LegacyClient.h
firebird/trunk/src/auth/SecurityDatabase/LegacyManagement.epp
firebird/trunk/src/auth/SecurityDatabase/LegacyManagement.h
firebird/trunk/src/auth/SecurityDatabase/jrd_pwd.h
firebird/trunk/src/auth/SecurityDatabase/pwd.cpp
firebird/trunk/src/auth/trusted/AuthSspi.cpp
firebird/trunk/src/auth/trusted/AuthSspi.h
firebird/trunk/src/common/Auth.cpp
firebird/trunk/src/common/Auth.h
firebird/trunk/src/common/IntlUtil.cpp
firebird/trunk/src/common/StatusHolder.h
firebird/trunk/src/common/ThreadStart.cpp
firebird/trunk/src/common/classes/ImplementHelper.h
firebird/trunk/src/common/classes/init.h
firebird/trunk/src/common/config/config.cpp
firebird/trunk/src/common/config/config.h
firebird/trunk/src/common/config/config_file.cpp
firebird/trunk/src/common/config/config_file.h
firebird/trunk/src/common/fb_exception.cpp
firebird/trunk/src/common/thd.cpp
firebird/trunk/src/common/unicode_util.cpp
firebird/trunk/src/dsql/dsql.cpp
firebird/trunk/src/dsql/dsql.h
firebird/trunk/src/include/FirebirdExternalApi.h
firebird/trunk/src/include/FirebirdPluginApi.h
firebird/trunk/src/include/ProviderInterface.h
firebird/trunk/src/include/consts_pub.h
firebird/trunk/src/jrd/Attachment.cpp
firebird/trunk/src/jrd/Attachment.h
firebird/trunk/src/jrd/ExtEngineManager.cpp
firebird/trunk/src/jrd/JrdStatement.cpp
firebird/trunk/src/jrd/JrdStatement.h
firebird/trunk/src/jrd/SysFunction.cpp
firebird/trunk/src/jrd/blb.cpp
firebird/trunk/src/jrd/blb.h
firebird/trunk/src/jrd/event.cpp
firebird/trunk/src/jrd/event.h
firebird/trunk/src/jrd/event_proto.h
firebird/trunk/src/jrd/extds/InternalDS.cpp
firebird/trunk/src/jrd/jrd.cpp
firebird/trunk/src/jrd/jrd_proto.h
firebird/trunk/src/jrd/ntrace.h
firebird/trunk/src/jrd/svc.cpp
firebird/trunk/src/jrd/tra.cpp
firebird/trunk/src/jrd/tra.h
firebird/trunk/src/jrd/trace/TraceJrdHelpers.h
firebird/trunk/src/jrd/trace/TraceManager.cpp
firebird/trunk/src/jrd/trace/TraceManager.h
firebird/trunk/src/jrd/trace/TraceObjects.cpp
firebird/trunk/src/jrd/trace/TraceObjects.h
firebird/trunk/src/plugins/udr_engine/UdrEngine.cpp
firebird/trunk/src/remote/client/interface.cpp
firebird/trunk/src/remote/remot_proto.h
firebird/trunk/src/remote/remote.h
firebird/trunk/src/remote/server/os/posix/inet_server.cpp
firebird/trunk/src/remote/server/server.cpp
firebird/trunk/src/utilities/gsec/security.cpp
firebird/trunk/src/utilities/ntrace/PluginLogWriter.h
firebird/trunk/src/utilities/ntrace/TraceConfiguration.cpp
firebird/trunk/src/utilities/ntrace/TracePluginImpl.cpp
firebird/trunk/src/utilities/ntrace/TracePluginImpl.h
firebird/trunk/src/utilities/ntrace/traceplugin.cpp
firebird/trunk/src/yvalve/gds.cpp
firebird/trunk/src/yvalve/why.cpp
Added Paths:
-----------
firebird/trunk/builds/install/misc/plugins.conf
firebird/trunk/builds/posix/fbplugin.vers
firebird/trunk/src/include/Interface.h
firebird/trunk/src/remote/client/interface.h
firebird/trunk/src/yvalve/MasterImplementation.cpp
firebird/trunk/src/yvalve/PluginManager.cpp
firebird/trunk/src/yvalve/PluginManager.h
Removed Paths:
-------------
firebird/trunk/builds/posix/fbtrace.vers
firebird/trunk/builds/posix/udr_engine.hpux.vers
firebird/trunk/src/common/classes/Interface.h
firebird/trunk/src/jrd/PluginManager.cpp
firebird/trunk/src/jrd/PluginManager.h
Modified: firebird/trunk/builds/install/misc/aliases.conf.in
===================================================================
--- firebird/trunk/builds/install/misc/aliases.conf.in 2011-01-14 17:01:40 UTC (rev 52120)
+++ firebird/trunk/builds/install/misc/aliases.conf.in 2011-01-14 17:31:40 UTC (rev 52121)
@@ -5,8 +5,11 @@
#
# Example Database:
#
-employee.fdb = @FB_SAMPLEDBDIR@/employee.fdb
-employee = @FB_SAMPLEDBDIR@/employee.fdb
+#employee.fdb = @FB_SAMPLEDBDIR@/employee.fdb
+#employee = @FB_SAMPLEDBDIR@/employee.fdb
+# TODO: When added appropriate feature to config - use $(SAMPLEDBDIR) instead
+employee.fdb = $(root)/examples/empbuild/employee.fdb
+employee = $(root)/examples/empbuild/employee.fdb
#
# Live Databases:
Modified: firebird/trunk/builds/install/misc/firebird.conf.in
===================================================================
--- firebird/trunk/builds/install/misc/firebird.conf.in 2011-01-14 17:01:40 UTC (rev 52120)
+++ firebird/trunk/builds/install/misc/firebird.conf.in 2011-01-14 17:31:40 UTC (rev 52121)
@@ -349,6 +349,44 @@
# ----------------------------
#
+# This group of parameters determines what plugins will be used by firebird.
+# Format of string is the list of plugins, separated by space, ',' or ';'.
+# Plugins will be tried in an order, specified here.
+# In many cases correct order is important!
+#
+# Type: string
+
+# AuthServer and AuthClient determine what uthentication methods will be used
+# by network server and client redirector. For non-windows systems default
+# for both is Legacy_Auth.
+#
+#AuthServer = Legacy_Auth, Win_Sspi
+#AuthClient = Legacy_Auth, Win_Sspi
+
+# UserManager sets plugin used to work with security database. If more than
+# one plugin is given, first plugin from the list is used.
+#
+#UserManager = Legacy_Auth
+
+# TracePlugin is used by firebird trace facility to send trace data to the user
+# or log file in audit case.
+#
+#TracePlugin = fbtrace
+
+
+# ----------------------------
+#
+# This parameter determines what providers will be used by firebird.
+# Format is the same as for the list of plugins (see a few lines before).
+# This is not strange because internally provider is just a kind of plugin.
+#
+# Type: string
+#
+#Providers = Remote,Engine12,Loopback
+
+
+# ----------------------------
+#
# Determines the number of seconds that the lock manager will wait after a
# conflict has been encountered before purging locks from dead processes
# and doing extra deadlock scan cycle. Engine detects deadlocks instantly
Added: firebird/trunk/builds/install/misc/plugins.conf
===================================================================
--- firebird/trunk/builds/install/misc/plugins.conf (rev 0)
+++ firebird/trunk/builds/install/misc/plugins.conf 2011-01-14 17:31:40 UTC (rev 52121)
@@ -0,0 +1,8 @@
+Plugin = UDR {
+ Module = $(root)/plugins/udr_engine
+ Config = UDR_config
+}
+
+Config = UDR_config {
+ path = $(root)/plugins/udr
+}
Property changes on: firebird/trunk/builds/install/misc/plugins.conf
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ native
Modified: firebird/trunk/builds/posix/Makefile.in
===================================================================
--- firebird/trunk/builds/posix/Makefile.in 2011-01-14 17:01:40 UTC (rev 52120)
+++ firebird/trunk/builds/posix/Makefile.in 2011-01-14 17:31:40 UTC (rev 52121)
@@ -107,7 +107,7 @@
# main build target for both debug abd release builds
#
-.PHONY: boot yvalve engine fbintl gpre utilities plugins rest codes
+.PHONY: boot yvalve engine fbintl gpre utilities plugins rest codes examples
master_process:
$(MAKE) updateBuildNum
@@ -130,6 +130,7 @@
$(MAKE) codes
endif
$(MAKE) plugins
+ $(MAKE) examples
$(MAKE) rest
#___________________________________________________________________________
@@ -197,12 +198,11 @@
#___________________________________________________________________________
# full gpre
# when switching to it we also build databases needed later
-# and libib_util needed to start engine smart
#
-.PHONY: databases udfsupport
+.PHONY: databases
-gpre: $(GPRE) databases udfsupport
+gpre: $(GPRE) databases
$(GPRE): $(GPRE_Objects) $(COMMON_LIB)
$(EXE_LINK) $(LINK_OPTS) $^ -o $@ $(FIREBIRD_LIBRARY_LINK) $(LINK_LIBS)
@@ -250,7 +250,7 @@
$(TOUCH) $@
-.PHONY: udfs ibutil ibudf fbudf
+.PHONY: udfs ibutil ibudf fbudf udfsupport
udfsupport:
$(MAKE) ibutil
@@ -279,13 +279,13 @@
#___________________________________________________________________________
-# most of utilities, including network server
+# most of utilities, including network server and UDFs
# qli is not here cause it needs special database (help.fdb), therefore needs gbak
#
.PHONY: firebird_server fb_lock_print fbguard fbsvcmgr fbtracemgr gbak gfix gsec gsplit gstat isql nbackup
-utilities: firebird_server fb_lock_print fbguard fbsvcmgr fbtracemgr gbak gfix gsec gsplit gstat isql nbackup
+utilities: firebird_server fb_lock_print fbguard fbsvcmgr fbtracemgr gbak gfix gsec gsplit gstat isql nbackup udfsupport
firebird_server: $(FB_DAEMON)
@@ -306,6 +306,8 @@
$(FBSVCMGR): $(FBSVCMGR_Objects) $(COMMON_LIB)
$(EXE_LINK) $(LINK_OPTS) $^ -o $@ $(FIREBIRD_LIBRARY_LINK) $(LINK_LIBS)
+#$(FBSVCMGR): $(FBSVCMGR_Objects) $(YValve_Objects) $(Remote_Client_Objects) $(COMMON_LIB)
+# $(EXE_LINK) $(LINK_OPTS) $^ -o $@ $(LINK_LIBS)
fbtracemgr: $(FBTRACEMGR)
@@ -352,12 +354,19 @@
# plugins - some of them are required to build examples, use separate entry for them
#
-.PHONY: udr legacy_user_management trace
-UDR_PLUGIN = $(PLUGINS)/$(LIB_PREFIX)udr_engine.$(SHRLIB_EXT)
-LEGACY_USER_MANAGER = $(PLUGINS)/$(LIB_PREFIX)user_management.$(SHRLIB_EXT)
+.PHONY: udr legacy_user_management trace auth_debug
+makePluginName= $(PLUGINS)/$(LIB_PREFIX)$(1).$(SHRLIB_EXT)
+UDR_PLUGIN = $(call makePluginName,udr_engine)
+LEGACY_USER_MANAGER = $(call makePluginName,Legacy_Auth)
+AUTH_DEBUGGER = $(call makePluginName,Auth_Debug)
-plugins: udr legacy_user_management trace
+BUILD_DEBUG:=
+ifeq ($(TARGET),Debug)
+ BUILD_DEBUG:=auth_debug
+endif
+plugins: udr legacy_user_management trace $(BUILD_DEBUG)
+
udr: $(UDR_PLUGIN) $(PLUGINS)/udr_engine.conf
$(PLUGINS)/udr_engine.conf: $(ROOT)/src/plugins/udr_engine/udr_engine.conf
@@ -376,7 +385,12 @@
$(FBTRACE): $(FBTRACE_UTIL_Objects) $(COMMON_LIB)
$(LINK_TRACE) -o $@ $^ $(FIREBIRD_LIBRARY_LINK) $(LINK_TRACE_LIBS)
+auth_debug: $(AUTH_DEBUGGER)
+$(AUTH_DEBUGGER): $(AUTH_DEBUGGER_Objects) $(COMMON_LIB)
+ $(LINK_PLUGIN) $(call LIB_LINK_SONAME,$(notdir $@).0) -o $@ $^ $(LINK_PLUG_LIBS) $(FIREBIRD_LIBRARY_LINK)
+
+
#___________________________________________________________________________
# codes - developers change them sometimes
#
@@ -401,9 +415,9 @@
# all the rest we need to build
#
-.PHONY: qli examples message_file
+.PHONY: qli message_file
-rest: qli examples message_file include_generic
+rest: qli message_file
qli: $(QLI)
@@ -524,10 +538,11 @@
# -$(MAKE) -C $(ROOT)/extern/icu/source clean
clean_objects:
- $(RM) `find $(ROOT)/extern/ -type f -name '*.lo' -print`
$(RM) `find $(TMP_ROOT)/ -type f -name '*.o' -print`
+ $(RM) `find $(TMP_ROOT)/ -type f -name '*.a' -print`
clean_extern_objects:
+ $(RM) `find $(ROOT)/extern/ -type f -name '*.lo' -print`
$(RM) `find $(ROOT)/extern/ -type f -name '*.o' -print`
# Clear out dependancies files created by the gcc compiler
Copied: firebird/trunk/builds/posix/fbplugin.vers (from rev 52016, firebird/trunk/builds/posix/fbtrace.vers)
===================================================================
--- firebird/trunk/builds/posix/fbplugin.vers (rev 0)
+++ firebird/trunk/builds/posix/fbplugin.vers 2011-01-14 17:31:40 UTC (rev 52121)
@@ -0,0 +1,28 @@
+#
+# Version script to hide private symbols from Firebird libraries
+# GNU and Solaris linkers should understand it
+#
+# The contents of this file are subject to the Initial
+# Developer's 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.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_idpl.
+#
+# Software distributed under the License is distributed AS IS,
+# 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 Nickolay Samofatov
+# for the Firebird Open Source RDBMS project.
+#
+# Copyright (c) 2004 Nickolay Samofatov <nic...@br...>
+# and all contributors signed below.
+#
+# All Rights Reserved.
+# Contributor(s): ______________________________________.
+# Adriano dos Santos Fernandes
+# Alex Peshkov
+#
+
+firebird_plugin
Property changes on: firebird/trunk/builds/posix/fbplugin.vers
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ native
Deleted: firebird/trunk/builds/posix/fbtrace.vers
===================================================================
--- firebird/trunk/builds/posix/fbtrace.vers 2011-01-14 17:01:40 UTC (rev 52120)
+++ firebird/trunk/builds/posix/fbtrace.vers 2011-01-14 17:31:40 UTC (rev 52121)
@@ -1,28 +0,0 @@
-#
-# Version script to hide private symbols from Firebird libraries
-# GNU and Solaris linkers should understand it
-#
-# The contents of this file are subject to the Initial
-# Developer's 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.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_idpl.
-#
-# Software distributed under the License is distributed AS IS,
-# 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 Nickolay Samofatov
-# for the Firebird Open Source RDBMS project.
-#
-# Copyright (c) 2004 Nickolay Samofatov <nic...@br...>
-# and all contributors signed below.
-#
-# All Rights Reserved.
-# Contributor(s): ______________________________________.
-# Adriano dos Santos Fernandes
-# Alex Peshkov
-#
-
-trace_create
Modified: firebird/trunk/builds/posix/firebird.vers
===================================================================
--- firebird/trunk/builds/posix/firebird.vers 2011-01-14 17:01:40 UTC (rev 52120)
+++ firebird/trunk/builds/posix/firebird.vers 2011-01-14 17:31:40 UTC (rev 52121)
@@ -338,15 +338,10 @@
fb_shutdown_callback
fb_ping
-# Plugins support
+# Master firebird object access
-fb_register_plugin
-fb_query_plugin
+fb_get_master_interface
-# COM emulation
-
-fb_get_status_instance
-
# Other misc functions
isc_ftof
Modified: firebird/trunk/builds/posix/make.defaults
===================================================================
--- firebird/trunk/builds/posix/make.defaults 2011-01-14 17:01:40 UTC (rev 52120)
+++ firebird/trunk/builds/posix/make.defaults 2011-01-14 17:31:40 UTC (rev 52121)
@@ -218,9 +218,9 @@
# The firebird engine library name
-EngineFileName=libengine${OdsVersion}
+EngineFileName=libEngine${OdsVersion}
EngineSoName=$(EngineFileName).${SHRLIB_EXT}
-ENGINE_SONAME = $(LIB)/$(EngineSoName)
+ENGINE_SONAME = $(PLUGINS)/$(EngineSoName)
# intl will load dynamically, and having the whole soname set with version
# confuses the dynamic load process. So we only have the .$(SHRLIB_EXT) file
@@ -249,22 +249,21 @@
endif
FIREBIRD_VERS = firebird.vers
-FBTRACE_VERS = fbtrace.vers
FBINTL_VERS = fbintl.vers
IB_UTIL_VERS = ib_util.vers
UDR_ENGINE_VERS = udr_engine.vers
EMPTY_VERS = empty.vers
+PLUGIN_VERS = fbplugin.vers
-ALLVERS = $(FIREBIRD_VERS) $(FBTRACE_VERS) $(FBINTL_VERS) $(IB_UTIL_VERS)
-ALLVERS += $(UDR_ENGINE_VERS) $(EMPTY_VERS)
+ALLVERS = $(FIREBIRD_VERS) $(FBINTL_VERS) $(IB_UTIL_VERS)
+ALLVERS += $(UDR_ENGINE_VERS) $(EMPTY_VERS) $(PLUGIN_VERS)
LINK_FIREBIRD_SYMBOLS = $(LIB_LINK_MAPFILE)$(FIREBIRD_VERS)
-LINK_TRACE_SYMBOLS = $(LIB_LINK_MAPFILE)$(FBTRACE_VERS)
LINK_FBINTL_SYMBOLS = $(LIB_LINK_MAPFILE)$(FBINTL_VERS)
LINK_IBUTIL_SYMBOLS = $(LIB_LINK_MAPFILE)$(IB_UTIL_VERS)
LINK_UDRENG_SYMBOLS = $(LIB_LINK_MAPFILE)$(UDR_ENGINE_VERS)
LINK_EMPTY_SYMBOLS = $(LIB_LINK_MAPFILE)$(EMPTY_VERS)
-LINK_PLUGIN_SYMBOLS = $(LINK_EMPTY_SYMBOLS)
+LINK_PLUGIN_SYMBOLS = $(LIB_LINK_MAPFILE)$(PLUGIN_VERS)
LINK_EXEC_EXPORT=-rdynamic
LIB_PLATFORM_RPATH = -Wl,-rpath,$(1)
@@ -301,7 +300,7 @@
$(call LIB_LINK_SONAME,libintl.$(SHRLIB_EXT).1) $(call LIB_LINK_RPATH,lib)
LINK_INTL_LIBS = -L$(LIB) $(ICU_LIBS) $(SO_LINK_LIBS) $(FIREBIRD_LIBRARY_LINK)
-LINK_TRACE = $(LIB_LINK) $(LINK_TRACE_SYMBOLS) $(LIB_LINK_OPTIONS) $(UNDEF_FLAGS)\
+LINK_TRACE = $(LIB_LINK) $(LINK_PLUGIN_SYMBOLS) $(LIB_LINK_OPTIONS) $(UNDEF_FLAGS)\
$(call LIB_LINK_SONAME,$(LIB_PREFIX)fbtrace.$(SHRLIB_EXT).0) $(call LIB_LINK_RPATH,lib)
LINK_TRACE_LIBS = -L$(LIB) $(SO_LINK_LIBS) $(ICU_LIBS)
Modified: firebird/trunk/builds/posix/make.shared.variables
===================================================================
--- firebird/trunk/builds/posix/make.shared.variables 2011-01-14 17:01:40 UTC (rev 52120)
+++ firebird/trunk/builds/posix/make.shared.variables 2011-01-14 17:31:40 UTC (rev 52121)
@@ -165,6 +165,12 @@
AllObjects += $(LEGACY_USERS_MANAGE_Objects)
+# Multihop authentication debugger
+AUTH_DEBUGGER_Objects:= $(call makeObjects,auth,AuthDbg.cpp)
+
+AllObjects += $(AUTH_DEBUGGER_Objects)
+
+
# UDR engine
UDRENG_Objects:= $(call dirObjects,plugins/udr_engine)
Modified: firebird/trunk/builds/posix/prefix.linux
===================================================================
--- firebird/trunk/builds/posix/prefix.linux 2011-01-14 17:01:40 UTC (rev 52120)
+++ firebird/trunk/builds/posix/prefix.linux 2011-01-14 17:31:40 UTC (rev 52121)
@@ -20,7 +20,7 @@
COMMON_FLAGS=-ggdb -DFB_SEND_FLAGS=MSG_NOSIGNAL -DLINUX -pipe -MMD -fPIC -fmessage-length=0
OPTIMIZE_FLAGS=-O3 -march=i586 -mtune=i686 -fno-omit-frame-pointer
-WARN_FLAGS=-Wall -Wno-switch -Wno-parentheses -Wno-unknown-pragmas -Wno-unused-variable -Wno-non-virtual-dtor
+WARN_FLAGS=-Wall -Wno-switch -Wno-parentheses -Wno-unknown-pragmas -Wno-unused-variable
PROD_FLAGS=$(COMMON_FLAGS) $(OPTIMIZE_FLAGS)
#DEV_FLAGS=-DUSE_VALGRIND -p $(COMMON_FLAGS) $(WARN_FLAGS)
Modified: firebird/trunk/builds/posix/prefix.linux_amd64
===================================================================
--- firebird/trunk/builds/posix/prefix.linux_amd64 2011-01-14 17:01:40 UTC (rev 52120)
+++ firebird/trunk/builds/posix/prefix.linux_amd64 2011-01-14 17:31:40 UTC (rev 52121)
@@ -20,7 +20,7 @@
COMMON_FLAGS=-ggdb -DFB_SEND_FLAGS=MSG_NOSIGNAL -DLINUX -DAMD64 -pipe -MMD -fPIC -fmessage-length=0
OPTIMIZE_FLAGS=-O3 -fno-omit-frame-pointer
-WARN_FLAGS=-Wall -Wno-switch -Wno-parentheses -Wno-unknown-pragmas -Wno-unused-variable -Wno-invalid-offsetof -Wno-non-virtual-dtor
+WARN_FLAGS=-Wall -Wno-switch -Wno-parentheses -Wno-unknown-pragmas -Wno-unused-variable -Wno-invalid-offsetof
CXXFLAGS:= $(CXXFLAGS) -fno-rtti
PROD_FLAGS=$(COMMON_FLAGS) $(OPTIMIZE_FLAGS)
Deleted: firebird/trunk/builds/posix/udr_engine.hpux.vers
===================================================================
--- firebird/trunk/builds/posix/udr_engine.hpux.vers 2011-01-14 17:01:40 UTC (rev 52120)
+++ firebird/trunk/builds/posix/udr_engine.hpux.vers 2011-01-14 17:31:40 UTC (rev 52121)
@@ -1,33 +0,0 @@
-#
-# Version script to hide private symbols from Firebird libraries
-# GNU and Solaris linkers should understand it
-#
-# The contents of this file are subject to the Initial
-# Developer's 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.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_idpl.
-#
-# Software distributed under the License is distributed AS IS,
-# 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 Nickolay Samofatov
-# for the Firebird Open Source RDBMS project.
-#
-# Copyright (c) 2004 Nickolay Samofatov <nic...@br...>
-# and all contributors signed below.
-#
-# All Rights Reserved.
-# Contributor(s): ______________________________________.
-# Adriano dos Santos Fernandes
-#
-#
-
-
-+e firebirdPlugin
-+e fbUdrRegFunction
-+e fbUdrRegProcedure
-+e fbUdrRegTrigger
-+e fbUdrGetFunction
Modified: firebird/trunk/builds/posix/udr_engine.vers
===================================================================
--- firebird/trunk/builds/posix/udr_engine.vers 2011-01-14 17:01:40 UTC (rev 52120)
+++ firebird/trunk/builds/posix/udr_engine.vers 2011-01-14 17:31:40 UTC (rev 52121)
@@ -25,7 +25,7 @@
#
#
-firebirdPlugin
+firebird_plugin
fbUdrRegFunction
fbUdrRegProcedure
fbUdrRegTrigger
Modified: firebird/trunk/configure.in
===================================================================
--- firebird/trunk/configure.in 2011-01-14 17:01:40 UTC (rev 52120)
+++ firebird/trunk/configure.in 2011-01-14 17:31:40 UTC (rev 52121)
@@ -1055,6 +1055,11 @@
done
src/misc/writeBuildNum.sh createMakeVersion gen/Make.Version
+
+dnl # sql files for UDF declarations
+ for sql_file in src/extlib/ib_udf.sql src/extlib/fbudf/fbudf.sql src/extlib/ib_udf2.sql; do
+ cp \$sql_file gen/\$fb_tgt/firebird/UDF
+ done
done
for src_dir in `ls -R -1 examples | grep : | tr -d : | tr "\n" " "`; do
@@ -1080,6 +1085,8 @@
gen/Release/firebird/fbtrace.conf:src/utilities/ntrace/fbtrace.conf
gen/Debug/firebird/intl/fbintl.conf:builds/install/misc/fbintl.conf
gen/Release/firebird/intl/fbintl.conf:builds/install/misc/fbintl.conf
+gen/Debug/firebird/plugins.conf:builds/install/misc/plugins.conf
+gen/Release/firebird/plugins.conf:builds/install/misc/plugins.conf
gen/Release/firebird/bin/fb_config:builds/install/misc/fb_config.in
gen/Release/firebird/bin/posixLibrary.sh:builds/install/misc/posixLibrary.sh.in
gen/Release/firebird/bin/classicLibrary.sh:builds/install/misc/classicLibrary.sh.in
Modified: firebird/trunk/src/auth/AuthDbg.cpp
===================================================================
--- firebird/trunk/src/auth/AuthDbg.cpp 2011-01-14 17:01:40 UTC (rev 52120)
+++ firebird/trunk/src/auth/AuthDbg.cpp 2011-01-14 17:31:40 UTC (rev 52121)
@@ -28,104 +28,160 @@
#include "firebird.h"
#include "../auth/AuthDbg.h"
#include "../jrd/ibase.h"
-#include "../common/classes/ImplementHelper.h"
#ifdef AUTH_DEBUG
-namespace {
- char name[] = "DEBUG_AUTH";
- Firebird::PluginHelper<Auth::DebugServer, Firebird::Plugin::AuthServer, name> debugServer;
- Firebird::PluginHelper<Auth::DebugClient, Firebird::Plugin::AuthClient, name> debugClient;
-}
+//#define AUTH_VERBOSE
-namespace Auth {
+// register plugin
+static Firebird::SimpleFactory<Auth::DebugClient> clientFactory;
+static Firebird::SimpleFactory<Auth::DebugServer> serverFactory;
-ServerInstance* DebugServer::instance()
+extern "C" void FB_PLUGIN_ENTRY_POINT(Firebird::IMaster* master)
{
- return Firebird::interfaceAlloc<DebugServerInstance>();
-}
+ const char* name = "Auth_Debug";
-ClientInstance* DebugClient::instance()
-{
- return Firebird::interfaceAlloc<DebugClientInstance>();
+ Firebird::IPlugin* iPlugin = master->getPluginInterface();
+
+ clientFactory.addRef();
+ iPlugin->registerPlugin(Firebird::PluginType::AuthClient, name, &clientFactory);
+ serverFactory.addRef();
+ iPlugin->registerPlugin(Firebird::PluginType::AuthServer, name, &serverFactory);
+
+ iPlugin->release();
}
-DebugServerInstance::DebugServerInstance()
- : str(*getDefaultMemoryPool())
+
+namespace Auth {
+
+DebugServer::DebugServer(Firebird::IFactoryParameter*)
+ : str(getPool())
{ }
-Result DebugServerInstance::startAuthentication(bool isService, const char* dbName,
- const unsigned char* dpb, unsigned int dpbSize,
- WriterInterface* writerInterface)
+Result FB_CARG DebugServer::startAuthentication(Firebird::Status* status, bool isService, const char* dbName,
+ const unsigned char* dpb, unsigned int dpbSize,
+ WriterInterface* writerInterface)
{
- str.erase();
- Firebird::ClumpletReader rdr(isService ?
- Firebird::ClumpletReader::spbList :
- Firebird::ClumpletReader::dpbList, dpb, dpbSize);
+ try
+ {
+ str.erase();
+ Firebird::ClumpletReader rdr(isService ?
+ Firebird::ClumpletReader::spbList :
+ Firebird::ClumpletReader::dpbList, dpb, dpbSize);
- if (rdr.find(isService ? isc_spb_trusted_auth : isc_dpb_trusted_auth))
+ if (rdr.find(isService ? isc_spb_trusted_auth : isc_dpb_trusted_auth))
+ {
+ str.assign(rdr.getBytes(), rdr.getClumpLength());
+ }
+
+ str += '_';
+ return AUTH_MORE_DATA;
+ }
+ catch (const Firebird::Exception& ex)
{
- str.assign(rdr.getBytes(), rdr.getClumpLength());
+ ex.stuffException(status);
+ return AUTH_FAILED;
}
-
- str += '_';
- return AUTH_MORE_DATA;
}
-Result DebugServerInstance::contAuthentication(WriterInterface* writerInterface,
- const unsigned char* data, unsigned int size)
+Result FB_CARG DebugServer::contAuthentication(Firebird::Status* status, WriterInterface* writerInterface,
+ const unsigned char* data, unsigned int size)
{
- //fprintf(stderr, "DebugServerInstance::contAuthentication: %.*s\n", size, data);
- writerInterface->add(Firebird::string((const char*) data, size).c_str(), "DEBUG", "");
- return AUTH_SUCCESS;
+ try
+ {
+#ifdef AUTH_VERBOSE
+ fprintf(stderr, "DebugServerInstance::contAuthentication: %.*s\n", size, data);
+#endif
+ writerInterface->add(Firebird::string((const char*) data, size).c_str(), "DEBUG", "");
+ return AUTH_SUCCESS;
+ }
+ catch (const Firebird::Exception& ex)
+ {
+ ex.stuffException(status);
+ return AUTH_FAILED;
+ }
}
-void DebugServerInstance::getData(const unsigned char** data, unsigned short* dataSize)
+void FB_CARG DebugServer::getData(const unsigned char** data, unsigned short* dataSize)
{
*data = reinterpret_cast<const unsigned char*>(str.c_str());
*dataSize = str.length();
- //fprintf(stderr, "DebugServerInstance::getData: %.*s\n", *dataSize, *data);
+#ifdef AUTH_VERBOSE
+ fprintf(stderr, "DebugServerInstance::getData: %.*s\n", *dataSize, *data);
+#endif
}
-void DebugServerInstance::release()
+int FB_CARG DebugServer::release()
{
- Firebird::interfaceFree(this);
+ if (--refCounter == 0)
+ {
+ delete this;
+ return 0;
+ }
+
+ return 1;
}
-DebugClientInstance::DebugClientInstance()
- : str(*getDefaultMemoryPool())
+DebugClient::DebugClient(Firebird::IFactoryParameter*)
+ : str(getPool())
{ }
-Result DebugClientInstance::startAuthentication(bool isService, const char*, DpbInterface* dpb)
+Result FB_CARG DebugClient::startAuthentication(Firebird::Status* status, bool isService, const char*, DpbInterface* dpb)
{
- str = "HAND";
- if (dpb)
+ try
{
- dpb->add((isService ? isc_spb_trusted_auth : isc_dpb_trusted_auth),
- str.c_str(), str.length());
- return AUTH_SUCCESS;
+ str = "HAND";
+ if (dpb)
+ {
+ dpb->add((isService ? isc_spb_trusted_auth : isc_dpb_trusted_auth),
+ str.c_str(), str.length());
+ return AUTH_SUCCESS;
+ }
+ return AUTH_MORE_DATA;
}
- return AUTH_MORE_DATA;
+ catch (const Firebird::Exception& ex)
+ {
+ ex.stuffException(status);
+ return AUTH_FAILED;
+ }
}
-Result DebugClientInstance::contAuthentication(const unsigned char* data, unsigned int size)
+Result FB_CARG DebugClient::contAuthentication(Firebird::Status* status, const unsigned char* data, unsigned int size)
{
- //fprintf(stderr, "DebugClientInstance::contAuthentication: %.*s\n", size, data);
- str.assign(data, size);
- str += "SHAKE";
- return AUTH_CONTINUE;
+ try
+ {
+#ifdef AUTH_VERBOSE
+ fprintf(stderr, "DebugClientInstance::contAuthentication: %.*s\n", size, data);
+#endif
+ str.assign(data, size);
+ str += "SHAKE";
+ return AUTH_CONTINUE;
+ }
+ catch (const Firebird::Exception& ex)
+ {
+ ex.stuffException(status);
+ return AUTH_FAILED;
+ }
}
-void DebugClientInstance::getData(const unsigned char** data, unsigned short* dataSize)
+void FB_CARG DebugClient::getData(const unsigned char** data, unsigned short* dataSize)
{
*data = reinterpret_cast<const unsigned char*>(str.c_str());
*dataSize = str.length();
- //fprintf(stderr, "DebugClientInstance::getData: %.*s\n", *dataSize, *data);
+#ifdef AUTH_VERBOSE
+ fprintf(stderr, "DebugClientInstance::getData: %.*s\n", *dataSize, *data);
+#endif
}
-void DebugClientInstance::release()
+int FB_CARG DebugClient::release()
{
- Firebird::interfaceFree(this);
+ if (--refCounter == 0)
+ {
+ delete this;
+ return 0;
+ }
+
+ return 1;
}
} // namespace Auth
Modified: firebird/trunk/src/auth/AuthDbg.h
===================================================================
--- firebird/trunk/src/auth/AuthDbg.h 2011-01-14 17:01:40 UTC (rev 52120)
+++ firebird/trunk/src/auth/AuthDbg.h 2011-01-14 17:31:40 UTC (rev 52121)
@@ -30,11 +30,12 @@
#ifndef FB_AUTHDBG_H
#define FB_AUTHDBG_H
-//#define AUTH_DEBUG
+#define AUTH_DEBUG
#ifdef AUTH_DEBUG
#include "../auth/AuthInterface.h"
+#include "../common/classes/ImplementHelper.h"
#include "../common/classes/ClumpletWriter.h"
#include "../common/classes/init.h"
#include "../common/classes/array.h"
@@ -45,44 +46,32 @@
// The idea of debug plugin is to send some data from server to client,
// modify them on client and return result (which becomes login name) to the server
-class DebugServer : public ServerPlugin
+class DebugServer : public Firebird::StdPlugin<Server, FB_AUTH_SERVER_VERSION>
{
public:
- ServerInstance* instance();
-};
+ DebugServer(Firebird::IFactoryParameter*);
-class DebugClient : public ClientPlugin
-{
-public:
- ClientInstance* instance();
-};
-
-class DebugServerInstance : public ServerInstance
-{
-public:
- DebugServerInstance();
-
- Result startAuthentication(bool isService, const char* dbName,
+ Result startAuthentication(Firebird::Status* status, bool isService, const char* dbName,
const unsigned char* dpb, unsigned int dpbSize,
WriterInterface* writerInterface);
- Result contAuthentication(WriterInterface* writerInterface,
+ Result contAuthentication(Firebird::Status* status, WriterInterface* writerInterface,
const unsigned char* data, unsigned int size);
void getData(const unsigned char** data, unsigned short* dataSize);
- void release();
+ int release();
private:
Firebird::string str;
};
-class DebugClientInstance : public ClientInstance
+class DebugClient : public Firebird::StdPlugin<Client, FB_AUTH_CLIENT_VERSION>
{
public:
- DebugClientInstance();
+ DebugClient(Firebird::IFactoryParameter*);
- Result startAuthentication(bool isService, const char* dbName, DpbInterface* dpb);
- Result contAuthentication(const unsigned char* data, unsigned int size);
+ Result startAuthentication(Firebird::Status* status, bool isService, const char* dbName, DpbInterface* dpb);
+ Result contAuthentication(Firebird::Status* status, const unsigned char* data, unsigned int size);
void getData(const unsigned char** data, unsigned short* dataSize);
- void release();
+ int release();
private:
Firebird::string str;
Modified: firebird/trunk/src/auth/AuthInterface.h
===================================================================
--- firebird/trunk/src/auth/AuthInterface.h 2011-01-14 17:01:40 UTC (rev 52120)
+++ firebird/trunk/src/auth/AuthInterface.h 2011-01-14 17:31:40 UTC (rev 52121)
@@ -29,7 +29,7 @@
#ifndef FB_AUTH_INTERFACE
#define FB_AUTH_INTERFACE
-#include "../common/classes/Interface.h"
+#include "FirebirdPluginApi.h"
// This is temporal measure - see later
struct internal_user_data;
@@ -43,61 +43,54 @@
enum Result {AUTH_SUCCESS, AUTH_CONTINUE, AUTH_FAILED, AUTH_MORE_DATA};
-class WriterInterface
+class WriterInterface : public Firebird::Interface
{
public:
- virtual void reset() = 0;
- virtual void add(const char* user, const char* method, const char* details) = 0;
+ virtual void FB_CARG reset() = 0;
+ virtual void FB_CARG add(const char* user, const char* method, const char* details) = 0;
};
+#define FB_AUTH_WRITER_VERSION (FB_INTERFACE_VERSION + 2)
-class DpbInterface
+class DpbInterface : public Firebird::Interface
{
public:
- virtual int find(UCHAR tag) = 0;
- virtual void add(UCHAR tag, const void* bytes, unsigned int count) = 0;
- virtual void drop() = 0;
+ virtual int FB_CARG find(UCHAR tag) = 0;
+ virtual void FB_CARG add(UCHAR tag, const void* bytes, unsigned int count) = 0;
+ virtual void FB_CARG drop() = 0;
};
+#define FB_AUTH_DBP_VERSION (FB_INTERFACE_VERSION + 3)
-class ServerInstance : public Firebird::Interface
+class Server : public Firebird::Plugin
{
public:
- virtual Result startAuthentication(Firebird::Status* status, bool isService, const char* dbName,
+ virtual Result FB_CARG startAuthentication(Firebird::Status* status, bool isService, const char* dbName,
const unsigned char* dpb, unsigned int dpbSize,
WriterInterface* writerInterface) = 0;
- virtual Result contAuthentication(Firebird::Status* status, WriterInterface* writerInterface,
+ virtual Result FB_CARG contAuthentication(Firebird::Status* status, WriterInterface* writerInterface,
const unsigned char* data, unsigned int size) = 0;
- virtual void getData(const unsigned char** data, unsigned short* dataSize) = 0;
+ virtual void FB_CARG getData(const unsigned char** data, unsigned short* dataSize) = 0;
};
+#define FB_AUTH_SERVER_VERSION (FB_PLUGIN_VERSION + 3)
-class ServerPlugin : public Firebird::Plugin
+class Client : public Firebird::Plugin
{
public:
- virtual ServerInstance* instance() = 0;
+ virtual Result FB_CARG startAuthentication(Firebird::Status* status, bool isService, const char* dbName, DpbInterface* dpb) = 0;
+ virtual Result FB_CARG contAuthentication(Firebird::Status* status, const unsigned char* data, unsigned int size) = 0;
+ virtual void FB_CARG getData(const unsigned char** data, unsigned short* dataSize) = 0;
};
+#define FB_AUTH_CLIENT_VERSION (FB_PLUGIN_VERSION + 3)
-class ClientInstance : public Firebird::Interface
+class Management : public Firebird::Plugin
{
public:
- virtual Result startAuthentication(Firebird::Status* status, bool isService, const char* dbName, DpbInterface* dpb) = 0;
- virtual Result contAuthentication(Firebird::Status* status, const unsigned char* data, unsigned int size) = 0;
- virtual void getData(const unsigned char** data, unsigned short* dataSize) = 0;
-};
-
-class ClientPlugin : public Firebird::Plugin
-{
-public:
- virtual ClientInstance* instance() = 0;
-};
-
-class ManagementPlugin : public Firebird::Plugin
-{
-public:
// work in progress - we must avoid both internal_user_data and callback function
- virtual int execLine(ISC_STATUS* isc_status, const char *realUser,
+ virtual int FB_CARG execLine(ISC_STATUS* isc_status, const char *realUser,
FB_API_HANDLE db, FB_API_HANDLE trans,
internal_user_data* io_user_data,
FPTR_SECURITY_CALLBACK display_func, void* callback_arg) = 0;
};
+#define FB_AUTH_MANAGE_VERSION (FB_PLUGIN_VERSION + 1)
} // namespace Auth
Modified: firebird/trunk/src/auth/SecurityDatabase/LegacyClient.cpp
===================================================================
--- firebird/trunk/src/auth/SecurityDatabase/LegacyClient.cpp 2011-01-14 17:01:40 UTC (rev 52120)
+++ firebird/trunk/src/auth/SecurityDatabase/LegacyClient.cpp 2011-01-14 17:31:40 UTC (rev 52121)
@@ -29,41 +29,45 @@
#include "../jrd/ibase.h"
#include "../auth/SecurityDatabase/LegacyClient.h"
#include "../common/classes/ImplementHelper.h"
+#include "../common/classes/init.h"
-namespace {
-#ifndef WIN_NT
- char name[] = "LEGACY_AUTH";
- Firebird::PluginHelper<Auth::SecurityDatabaseClient, Firebird::Plugin::AuthClient, 200, name> client;
-#endif
-}
-
namespace Auth {
-ClientInstance* SecurityDatabaseClient::instance()
+Result SecurityDatabaseClient::startAuthentication(Firebird::Status*, bool, const char*, DpbInterface* dpb)
{
- return Firebird::interfaceAlloc<SecurityDatabaseClientInstance>();
-}
-
-Result SecurityDatabaseClientInstance::startAuthentication(Firebird::Status*, bool, const char*, DpbInterface* dpb)
-{
return dpb->find(isc_dpb_user_name) &&
(dpb->find(isc_dpb_password) || dpb->find(isc_dpb_password_enc)) ?
AUTH_SUCCESS : AUTH_CONTINUE;
}
-Result SecurityDatabaseClientInstance::contAuthentication(Firebird::Status*, const unsigned char*, unsigned int)
+Result SecurityDatabaseClient::contAuthentication(Firebird::Status*, const unsigned char*, unsigned int)
{
return AUTH_FAILED;
}
-void SecurityDatabaseClientInstance::getData(const unsigned char**, unsigned short* dataSize)
+void SecurityDatabaseClient::getData(const unsigned char**, unsigned short* dataSize)
{
*dataSize = 0;
}
-void SecurityDatabaseClientInstance::release()
+int SecurityDatabaseClient::release()
{
- interfaceFree(this);
+ if (--refCounter == 0)
+ {
+ delete this;
+ return 0;
+ }
+ return 1;
}
+namespace {
+ Firebird::Static<Firebird::SimpleFactory<SecurityDatabaseClient> > factory;
+}
+
+void registerLegacyClient(Firebird::IPlugin* iPlugin)
+{
+ factory->addRef();
+ iPlugin->registerPlugin(Firebird::PluginType::AuthClient, "Legacy_Auth", &factory);
+}
+
} // namespace Auth
Modified: firebird/trunk/src/auth/SecurityDatabase/LegacyClient.h
===================================================================
--- firebird/trunk/src/auth/SecurityDatabase/LegacyClient.h 2011-01-14 17:01:40 UTC (rev 52120)
+++ firebird/trunk/src/auth/SecurityDatabase/LegacyClient.h 2011-01-14 17:31:40 UTC (rev 52121)
@@ -28,27 +28,28 @@
#define AUTH_LEGACY_CLIENT_H
#include "../auth/AuthInterface.h"
+#include "../common/classes/ImplementHelper.h"
namespace Auth {
// Required to stop analyzing rest of plugins before first roundtrip to server
// if legacy login is present in DPB
-class SecurityDatabaseClient : public ClientPlugin
+class SecurityDatabaseClient : public Firebird::StdPlugin<Client, FB_AUTH_CLIENT_VERSION>
{
public:
- ClientInstance* instance();
-};
+ explicit SecurityDatabaseClient(Firebird::IFactoryParameter*)
+ {
+ }
-class SecurityDatabaseClientInstance : public ClientInstance
-{
-public:
Result startAuthentication(Firebird::Status* status, bool isService, const char* dbName, DpbInterface* dpb);
Result contAuthentication(Firebird::Status* status, const unsigned char* data, unsigned int size);
void getData(const unsigned char** data, unsigned short* dataSize);
- void release();
+ int release();
};
+void registerLegacyClient(Firebird::IPlugin* iPlugin);
+
} // namespace Auth
#endif // AUTH_LEGACY_CLIENT_H
Modified: firebird/trunk/src/auth/SecurityDatabase/LegacyManagement.epp
===================================================================
--- firebird/trunk/src/auth/SecurityDatabase/LegacyManagement.epp 2011-01-14 17:01:40 UTC (rev 52120)
+++ firebird/trunk/src/auth/SecurityDatabase/LegacyManagement.epp 2011-01-14 17:31:40 UTC (rev 52121)
@@ -39,20 +39,15 @@
#include "../common/classes/UserBlob.h"
#include "../auth/SecurityDatabase/LegacyManagement.h"
#include "../common/classes/ImplementHelper.h"
+#include "FirebirdPluginApi.h"
// Here we use version-independent symbolic link (or copy) of actual database
DATABASE DB = STATIC FILENAME "security.fdb";
-namespace {
+static Firebird::GlobalPtr<Firebird::Mutex> execLineMutex; // protects various gpre generated structures
-Firebird::GlobalPtr<Firebird::Mutex> execLineMutex; // protects various gpre generated structures
-
-// register plugin
-char name[] = "LEGACY_AUTH";
-Firebird::PluginHelper<Auth::SecurityDatabaseManagement, Firebird::Plugin::UserManagement, 0, name> manage;
-
-bool grantRevokeAdmin(ISC_STATUS* isc_status, FB_API_HANDLE DB, FB_API_HANDLE trans,
- const internal_user_data* io_user_data)
+static bool grantRevokeAdmin(ISC_STATUS* isc_status, FB_API_HANDLE DB, FB_API_HANDLE trans,
+ const internal_user_data* io_user_data)
{
if (!io_user_data->admin_entered)
{
@@ -93,7 +88,7 @@
}
/*
-bool storePasswd(ISC_STATUS* isc_status, FB_API_HANDLE DB, FB_API_HANDLE trans,
+static bool storePasswd(ISC_STATUS* isc_status, FB_API_HANDLE DB, FB_API_HANDLE trans,
ISC_QUAD& blobId, const Firebird::string& passwd)
{
UserBlob blob(isc_status);
@@ -113,13 +108,8 @@
}
*/
-} // anonymous namespace
-
-namespace Auth {
-
// work in progress - we must avoid both internal_user_data and callback function
-
-int SecurityDatabaseManagement::execLine(ISC_STATUS* isc_status,
+int Auth::SecurityDatabaseManagement::execLine(ISC_STATUS* isc_status,
const char* realUser,
FB_API_HANDLE DB,
FB_API_HANDLE trans,
@@ -550,4 +540,26 @@
return ret;
}
-} // namespace Auth
+int Auth::SecurityDatabaseManagement::release()
+{
+ if (--refCounter == 0)
+ {
+ delete this;
+ return 0;
+ }
+
+ return 1;
+}
+
+// register plugin
+static Firebird::Static<Firebird::SimpleFactory<Auth::SecurityDatabaseManagement> > factory;
+
+extern "C" void FB_PLUGIN_ENTRY_POINT(Firebird::IMaster* master)
+{
+ Firebird::IPlugin* iPlugin = master->getPluginInterface();
+
+ factory->addRef();
+ iPlugin->registerPlugin(Firebird::PluginType::AuthUserManagement, "Legacy_Auth", &factory);
+
+ iPlugin->release();
+}
Modified: firebird/trunk/src/auth/SecurityDatabase/LegacyManagement.h
===================================================================
--- firebird/trunk/src/auth/SecurityDatabase/LegacyManagement.h 2011-01-14 17:01:40 UTC (rev 52120)
+++ firebird/trunk/src/auth/SecurityDatabase/LegacyManagement.h 2011-01-14 17:31:40 UTC (rev 52121)
@@ -27,19 +27,26 @@
#ifndef AUTH_LEGACY_MANAGEMENT_H
#define AUTH_LEGACY_MANAGEMENT_H
+#include "../common/classes/ImplementHelper.h"
#include "../auth/AuthInterface.h"
namespace Auth {
-class SecurityDatabaseManagement : public ManagementPlugin
+class SecurityDatabaseManagement : public Firebird::StdPlugin<Management, FB_AUTH_MANAGE_VERSION>
{
public:
+ explicit SecurityDatabaseManagement(Firebird::IFactoryParameter*)
+ {
+ }
+
// work in progress - we must avoid both internal_user_data and callback function
int execLine(ISC_STATUS* isc_status, const char* realUser,
FB_API_HANDLE db, FB_API_HANDLE trans,
internal_user_data* io_user_data,
FPTR_SECURITY_CALLBACK display_func, void* callback_arg);
+
+ int release();
};
} // namespace Auth
Modified: firebird/trunk/src/auth/SecurityDatabase/jrd_pwd.h
===================================================================
--- firebird/trunk/src/auth/SecurityDatabase/jrd_pwd.h 2011-01-14 17:01:40 UTC (rev 52120)
+++ firebird/trunk/src/auth/SecurityDatabase/jrd_pwd.h 2011-01-14 17:31:40 UTC (rev 52121)
@@ -32,6 +32,7 @@
#include "../common/sha.h"
#include "gen/iberror.h"
#include "../common/classes/ClumpletWriter.h"
+#include "../common/classes/ImplementHelper.h"
#include "../auth/AuthInterface.h"
@@ -108,24 +109,30 @@
}
};
-class SecurityDatabaseServer : public ServerPlugin
+class SecurityDatabaseServerFactory : public Firebird::StdIface<Firebird::PluginsFactory, FB_PLUGINS_FACTORY_VERSION>
{
public:
- ServerInstance* instance();
+ Firebird::Plugin* FB_CARG createPlugin(const char* name, const char* configFile);
};
-class SecurityDatabaseServerInstance : public ServerInstance
+class SecurityDatabaseServer : public Firebird::StdPlugin<Server, FB_AUTH_SERVER_VERSION>
{
public:
+ explicit SecurityDatabaseServer(Firebird::IFactoryParameter*)
+ {
+ }
+
Result startAuthentication(Firebird::Status* status, bool isService, const char* dbName,
const unsigned char* dpb, unsigned int dpbSize,
WriterInterface* writerInterface);
Result contAuthentication(Firebird::Status* status, WriterInterface* writerInterface,
const unsigned char* data, unsigned int size);
void getData(const unsigned char** data, unsigned short* dataSize);
- void release();
+ int release();
};
+void registerLegacyServer(Firebird::IPlugin* iPlugin);
+
} // namespace Auth
#endif // JRD_PWD_H
Modified: firebird/trunk/src/auth/SecurityDatabase/pwd.cpp
===================================================================
--- firebird/trunk/src/auth/SecurityDatabase/pwd.cpp 2011-01-14 17:01:40 UTC (rev 52120)
+++ firebird/trunk/src/auth/SecurityDatabase/pwd.cpp 2011-01-14 17:31:40 UTC (rev 52121)
@@ -47,10 +47,6 @@
namespace {
-// register plugin
-char name[] = "LEGACY_AUTH";
-PluginHelper<Auth::SecurityDatabaseServer, Firebird::Plugin::AuthServer, 200, name> server;
-
// temporal implementation of timer
GlobalPtr<Mutex> timerMutex;
@@ -454,12 +450,7 @@
instance.fini();
}
-ServerInstance* SecurityDatabaseServer::instance()
-{
- return Firebird::interfaceAlloc<SecurityDatabaseServerInstance>();
-}
-
-Result SecurityDatabaseServerInstance::startAuthentication(Firebird::Status* status,
+Result SecurityDatabaseServer::startAuthentication(Firebird::Status* status,
bool isService, const char*,
const unsigned char* dpb, unsigned int dpbSize,
WriterInterface* writerInterface)
@@ -476,22 +467,38 @@
}
}
-Result SecurityDatabaseServerInstance::contAuthentication(Firebird::Status*,
+Result SecurityDatabaseServer::contAuthentication(Firebird::Status*,
WriterInterface* /*writerInterface*/,
const unsigned char* /*data*/, unsigned int /*size*/)
{
return AUTH_FAILED;
}
-void SecurityDatabaseServerInstance::getData(const unsigned char** data, unsigned short* dataSize)
+void SecurityDatabaseServer::getData(const unsigned char** data, unsigned short* dataSize)
{
*data = NULL;
*dataSize = 0;
}
-void SecurityDatabaseServerInstance::release()
+int SecurityDatabaseServer::release()
{
- interfaceFree(this);
+ if (--refCounter == 0)
+ {
+ delete this;
+ return 0;
+ }
+
+ return 1;
}
+namespace {
+ Firebird::Static<Firebird::SimpleFactory<SecurityDatabaseServer> > factory;
+}
+
+void registerLegacyServer(Firebird::IPlugin* iPlugin)
+{
+ factory->addRef();
+ iPlugin->registerPlugin(Firebird::PluginType::AuthServer, "Legacy_Auth", &factory);
+}
+
} // namespace Auth
Modified: firebird/trunk/src/auth/trusted/AuthSspi.cpp
===================================================================
--- firebird/trunk/src/auth/trusted/AuthSspi.cpp 2011-01-14 17:01:40 UTC (rev 52120)
+++ firebird/trunk/src/auth/trusted/AuthSspi.cpp 2011-01-14 17:31:40 UTC (rev 52121)
@@ -35,14 +35,13 @@
using namespace Firebird;
-namespace {
- char name[] = "WIN_SSPI";
- PluginHelper<Auth::WinSspiServer, Plugin::AuthServer, 100, name> server;
- PluginHelper<Auth::WinSspiClient, Plugin::AuthClient, 100, name> client;
-}
-
namespace
{
+ Firebird::SimpleFactory<Auth::WinSspiClient> clientFactory;
+ Firebird::SimpleFactory<Auth::WinSspiServer> serverFactory;
+
+ const char* plugName = "Win_Sspi";
+
void makeDesc(SecBufferDesc& d, SecBuffer& b, size_t len, void* p)
{
b.BufferType = SECBUFFER_TOKEN;
@@ -333,30 +332,19 @@
}
-ServerInstance* WinSspiServer::instance()
-{
- return interfaceAlloc<WinSspiServerInstance>();
-}
-
-ClientInstance* WinSspiClient::instance()
-{
- return interfaceAlloc<WinSspiClientInstance>();
-}
-
-
-WinSspiServerInstance::WinSspiServerInstance()
- : sspiData(*getDefaultMemoryPool())
+WinSspiServer::WinSspiServer(Firebird::IFactoryParameter*)
+ : sspiData(getPool())
{ }
-WinSspiClientInstance::WinSspiClientInstance()
- : sspiData(*getDefaultMemoryPool())
+WinSspiClient::WinSspiClient(Firebird::IFactoryParameter*)
+ : sspiData(getPool())
{ }
-Result WinSspiServerInstance::startAuthentication(Firebird::Status* status,
- bool isService,
- const char* /*dbName*/,
- const unsigned char* dpb, unsigned int dpbSize,
- WriterInterface* /*writerInterface*/)
+Result WinSspiServer::startAuthentication(Firebird::Status* status,
+ bool isService,
+ const char* /*dbName*/,
+ const unsigned char* dpb, unsigned int dpbSize,
+ WriterInterface* /*writerInterface*/)
{
const UCHAR tag = isService ? isc_spb_trusted_auth : isc_dpb_trusted_auth;
ClumpletReader rdr((isService ? ClumpletReader::spbList : ClumpletReader::dpbList),
@@ -375,9 +363,9 @@
return AUTH_MORE_DATA;
}
-Result WinSspiServerInstance::contAuthentication(Firebird::Status* status,
- WriterInterface* writerInterface,
- const unsigned char* data, unsigned int size)
+Result WinSspiServer::contAuthentication(Firebird::Status* status,
+ WriterInterface* writerInterface,
+ const unsigned char* data, unsigned int size)
{
sspiData.clear();
sspiData.add(data, size);
@@ -403,21 +391,27 @@
return AUTH_MORE_DATA;
}
-void WinSspiServerInstance::getData(const unsigned char** data, unsigned short* dataSize)
+void WinSspiServer::getData(const unsigned char** data, unsigned short* dataSize)
{
*data = sspiData.begin();
*dataSize = sspiData.getCount();
}
-void WinSspiServerInstance::release()
+void WinSspiServer::release()
{
- interfaceFree(this);
+ if (--refCounter == 0)
+ {
+ delete this;
+ return 0;
+ }
+
+ return 1;
}
-Result WinSspiClientInstance::startAuthentication(Firebird::Status* status,
- bool isService,
- const char* /*dbName*/,
- DpbInterface* dpb)
+Result WinSspiClient::startAuthentication(Firebird::Status* status,
+ bool isService,
+ const char* /*dbName*/,
+ DpbInterface* dpb)
{
sspi.request(sspiData);
@@ -443,8 +437,8 @@
return sspi.isActive() ? AUTH_SUCCESS : AUTH_CONTINUE;
}
-Result WinSspiClientInstance::contAuthentication(Firebird::Status* status,
- const unsigned char* data, unsigned int size)
+Result WinSspiClient::contAuthentication(Firebird::Status* status,
+ const unsigned char* data, unsigned int size)
{
sspiData.clear();
sspiData.add(data, size);
@@ -456,17 +450,35 @@
return sspi.isActive() ? AUTH_MORE_DATA : AUTH_CONTINUE;
}
-void WinSspiClientInstance::getData(const unsigned char** data, unsigned short* dataSize)
+void WinSspiClient::getData(const unsigned char** data, unsigned short* dataSize)
{
*data = sspiData.begin();
*dataSize = sspiData.getCount();
}
-void WinSspiClientInstance::release()
+int WinSspiClient::release()
{
- interfaceFree(this);
+ if (--refCounter == 0)
+ {
+ delete this;
+ return 0;
+ }
+
+ return 1;
}
+void registerTrustedClient(Firebird::IPlugin* iPlugin)
+{
+ clientFactory.addRef();
+ iPlugin->registerPlugin(Firebird::PluginType::AuthClient, plugName, &clientFactory);
+}
+
+void registerTrustedServer(Firebird::IPlugin* iPlugin)
+{
+ serverFactory.addRef();
+ iPlugin->registerPlugin(Firebird::PluginType::AuthServer, plugName, &serverFactory);
+}
+
} // namespace Auth
#endif // TRUSTED_AUTH
Modified: firebird/trunk/src/auth/trusted/AuthSspi.h
===================================================================
--- firebird/trunk/src/auth/trusted/AuthSspi.h 2011-01-14 17:01:40 UTC (rev 52120)
+++ firebird/trunk/src/auth/trusted/AuthSspi.h 2011-01-14 17:31:40 UTC (rev 52121)
@@ -34,6 +34,7 @@
#include <../common/classes/fb_string.h>
#include <../common/classes/array.h>
+#include "../common/classes/ImplementHelper.h"
#include <../jrd/ibase.h>
#include "../auth/AuthInterface.h"
@@ -95,37 +96,25 @@
bool getLogin(Firebird::string& login, bool& wh);
};
-class WinSspiServer : public ServerPlugin
+class WinSspiServer : public Firebird::StdPlugin<Server, FB_AUTH_SERVER_VERSION>
{
public:
- ServerInstance* instance();
-};
-
-class WinSspiClient : public ClientPlugin
-{
-public:
- ClientInstance* instance();
-};
-
-class WinSspiServerInstance : public ServerInstance
-{
-public:
Result startAuthentication(Firebird::Status* status, bool isService, const char* dbName,
const unsigned char* dpb, unsigned int dpbSize,
WriterInterface* writerInterface);
Result contAuthentication(Firebird::Status* status, WriterInterface* writerInterface,
const unsigned char* data, unsigned int size);
void getData(const unsigned char** data, unsigned short* dataSize);
- void release();
+ int release();
- WinSspiServerInstance();
+ WinSspiServer(Firebird::IFactoryParameter*);
private:
AuthSspi::DataHolder sspiData;
AuthSspi sspi;
};
-class WinSspiClientInstance : public ClientInstance
+class WinSspiClient : public Firebird::StdPlugin<Client, FB_AUTH_CLIENT_VERSION>
{
public:
Result startAuthentication(Firebird::Status* status, bool isService,
@@ -133,15 +122,18 @@
Result contAuthentication(Firebird::Status* status,
const unsigned char* data, unsigned int size);
void getData(const unsigned char** data, unsigned short* dataSize);
- void release();
+ int release();
- WinSspiClientInstance();
+ WinSspiClient(Firebird::IFactoryParameter*);
private:
AuthSspi::DataHolder sspiData;
AuthSspi sspi;
};
+void registerTrustedClient(Firebird::IPlugin* iPlugin);
+void registerTrustedServer(Firebird::IPlugin* iPlugin);
+
} // namespace Auth
#endif // TRUSTED_AUTH
Modified: firebird/trunk/src/common/Auth.cpp
===================================================================
--- firebird/trunk/src/common/Auth.cpp 2011-01-14 17:01:40 UTC (rev 52120)
+++ firebird/trunk/src/common/Auth.cpp 2011-01-14 17:31:40 UTC (rev 52121)
@@ -32,9 +32,8 @@
namespace Auth {
-WriterImplementation::WriterImplementation(Firebird::MemoryPool& pool, bool svcFlag)
- : Firebird::PermanentStorage(pool), body(getPool()),
- sequence(0), tag(svcFlag ? isc_spb_auth_block : isc_dpb_auth_block)
+WriterImplementation::WriterImplementation(bool svcFlag)
+ : body(getPool()), sequence(0), tag(svcFlag ? isc_spb_auth_block : isc_dpb_auth_block)
{ }
void WriterImplementation::store(Firebird::ClumpletWriter& to)
@@ -75,11 +74,10 @@
}
-bool legacy(Firebird::Plugin* plugin)
+bool legacy(const char* nm)
{
const char* legacyTrusted = "WIN_SSPI";
const unsigned short legLength = strlen(legacyTrusted);
- const char* nm = plugin->name();
return strlen(nm) == legLength && memcmp(legacyTrusted, nm, legLength) == 0;
}
Modified: firebird/trunk/src/common/Auth.h
===================================================================
--- firebird/trunk/src/common/Auth.h 2011-01-14 17:01:40 UTC (rev 52120)
+++ firebird/trunk/src/common/Auth.h 2011-01-14 17:31:40 UTC (rev 52121)
@@ -35,20 +35,21 @@
#include "../common/classes/init.h"
#include "../common/classes/array.h"
#include "../common/classes/fb_string.h"
+#include "../common/classes/ImplementHelper.h"
namespace Auth {
-bool legacy(Firebird::Plugin* plugin);
+bool legacy(const char* nm);
-class WriterImplementation : public WriterInterface, public Firebird::PermanentStorage
+class WriterImplementation : public Firebird::StackIface<WriterInterface, FB_AUTH_WRITER_VERSION>
{
public:
- WriterImplementation(Firebird::MemoryPool&, bool svcFlag);
+ WriterImplementation(bool svcFlag);
- void store(Firebird::ClumpletWriter& to);
+ void FB_CARG store(Firebird::ClumpletWriter& to);
- void reset();
- void add(const char* name, const char* method, const char* details);
+ void FB_CARG reset();
+ void FB_CARG add(const char* name, const char* method, const char* details);
private:
Firebird::AuthWriter body;
@@ -56,41 +57,41 @@
unsigned char tag;
};
-class DpbImplementation : public DpbInterface
+class DpbImplementation : public Firebird::StackIface<DpbInterface, FB_AUTH_DBP_VERSION>
{
public:
DpbImplementation(Firebird::ClumpletWriter& base);
- int find(UCHAR tag);
- void add(UCHAR tag, const void* bytes, unsigned int count);
- void drop();
+ int FB_CARG find(UCHAR tag);
+ void FB_CARG add(UCHAR tag, const void* bytes, unsigned int count);
+ void FB_CARG drop();
private:
Firebird::ClumpletWriter* body;
};
-#define AUTH_DEBUG
+//#define AUTH_DEBUG
#ifdef AUTH_DEBUG
// The idea of debug plugin is to send some data from server to client,
// modify them on client and return result (which becomes login name) to the server
-class DebugServer : public ServerPlugin
+class DebugServer : Firebird::StdIface<public Firebird::PluginsFactory, FB_PLUGINS_FACTORY_VERSION>
{
public:
- ServerInstance* instance();
- void release();
+ Firebird::Interface* FB_CARG createPlugin(const char* name, const char* configFile);
+ int FB_CARG release();
};
-class DebugClient : public ClientPlugin
+class DebugClient : public Firebird::StdIface<Firebird::PluginsFactory, FB_PLUGINS_FACTORY_VERSION>
{
public:
- ClientInstance* instance();
- void release();
+ Firebird::Interface* FB_CARG createPlugin(const char* name, const char* configFile);
+ int FB_CARG release();
};
-class DebugServerInstance : public ServerInstance
+class DebugServerInstance : public Firebird::StdPlugin<ServerInstance, FB_AUTH_SERVER_VERSION>
{
public:
DebugServerInstance();
@@ -101,13 +102,13 @@
Result contAuthentication(WriterInterface* writerInterface,
const unsigned char* data, unsigned int size);
void getData(const unsigned char** data, unsigned short* dataSize);
- void release();
+ int FB_CARG release();
private:
Firebird::string str;
};
-class DebugClientInstance : public ClientInstance
+class DebugClientInstance : public Firebird::StdPlugin<ClientInstance, FB_AUTH_CLIENT_VERSION>
{
public:
DebugClientInstance();
@@ -115,7 +116,7 @@
Result startAuthentication(bool isService, const char* dbName, DpbInterface* dpb);
Result contAuthentication(const unsigned char* data, unsigned int size);
void getData(const unsigned char** data, unsigned short* dataSize);
- void release();
+ int FB_CARG release();
private:
Firebird::string str;
Modified: firebird/trunk/src/common/IntlUtil.cpp
===================================================================
--- firebird/trunk/src/common/IntlUtil.cpp 2011-01-14 17:01:40 UTC (rev 52120)
+++ firebird/trunk/src/common/IntlUtil.cpp 2011-01-14 17:31:40 UTC (rev 52121)
@@ -461,6 +461,7 @@
catch (...)
{
delete charSet;
+ gds__log("initUnicodeCollation failed - unexpected exception caught");
return false;
}
@@ -497,7 +498,10 @@
UnicodeUtil::Utf16Collation::create(tt, attributes, map16, configInfo);
if (!collation)
+ {
+ gds__log("initUnicodeCollation failed - UnicodeUtil::Utf16Collation::create failed");
return false;
+ }
tt->texttype_impl = new TextTypeImpl(cs, collation);
Modified: firebird/trunk/src/common/StatusHolder.h
===================================================================
--- firebird/trunk/src/common/StatusHolder.h 2011-01-14 17:01:40 UTC (rev 52120)
+++ firebird/trunk/src/common/StatusHolder.h 2011-01-14 17:31:40 UTC (rev 52121)
@@ -31,6 +31,7 @@
#include "ProviderInterface.h"
#include "../common/utils_proto.h"
+#include "../common/classes/ImplementHelper.h"
namespace Firebird {
@@ -42,7 +43,7 @@
set(fb_utils::statusLength(value), value);
}
- virtual void set(size_t length, const ISC_STATUS* value)
+ virtual void set(unsigned int length, const ISC_STATUS* value)
{
fb_utils::copyStatus(vector, FB_NELEM(vector), value, length);
}
@@ -72,14 +73,8 @@
ISC_STATUS vector[40]; // FixMe - may be a kind of dynamic storage will be better?
};
-class LocalStatus : public BaseStatus
+class LocalStatus : public StackIface<BaseStatus, FB_STATUS_VERSION>
{
-public:
- virtual void release()
- {
- // do nothing - we are supposed to be on stack or a part of other object
- fb_assert(false);
- }
};
class StatusH...
[truncated message content] |