8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 16:43:03 +01:00

Fixed CORE-2601: fine tuning of the installation directories does not work in configure

This commit is contained in:
alexpeshkoff 2009-09-11 10:49:46 +00:00
parent cea4984cf5
commit 60a115efc2
73 changed files with 512 additions and 935 deletions

View File

@ -49,7 +49,7 @@ TryAddUser() {
if [ -z "$testStr" ]
then
useradd -d $FBRootDir -s /bin/false \
useradd -d @FB_CONFDIR@ -s /bin/false \
-c "Firebird Database Owner" -g firebird firebird
fi

View File

@ -35,10 +35,7 @@ origDir=`pwd`
if [ "$1" = "install-embedded" ]
then
# remove server files not needed for embedded usage
cd $FBRootDir/bin
rm -f fb_inet_server
rm -f fb_smp_server
cd $FBRootDir
rm -f @FB_SBINDIR@/fb_inet_server @FB_SBINDIR@/fb_smp_server
exit 0
fi
@ -52,12 +49,12 @@ if [ $RunUser = firebird ]; then
fi
# Create the fbmgr shell script.
if [ -x $FBBin/fbmgr.bin ]; then
cat > $FBBin/fbmgr <<EOF
if [ -x @FB_SBINDIR@/fbmgr.bin ]; then
cat > @FB_SBINDIR@/fbmgr <<EOF
#!/bin/sh
FIREBIRD=$FBRootDir
FIREBIRD=@FB_CONFDIR@
export FIREBIRD
exec \$FIREBIRD/bin/fbmgr.bin \$@
exec @FB_SBINDIR@/fbmgr.bin \$@
EOF
fi
@ -82,7 +79,5 @@ resetInetdServer
# start the db server so we can change the password
startService @FIREBIRD_ARCH_TYPE@
cd $FBRootDir
# Change sysdba password
changeDBAPassword

View File

@ -36,7 +36,7 @@
checkIfServerRunning
cd $FBRootDir
cd @FB_SECDBDIR@
if [ -f $SecurityDatabase ]
then
@ -44,7 +44,7 @@
echo "Saved a copy of $SecurityDatabase in /tmp"
fi
for i in fb_guard firebird.log SYSDBA.password
for i in @FB_GUARDDIR@/fb_guard @FB_LOGDIR@/firebird.log @FB_CONFDIR@/SYSDBA.password
do
if [ -f $i ]
then

View File

@ -45,8 +45,6 @@ BuildVersion=@FIREBIRD_VERSION@.@FB_BUILD_NUM@
PackageVersion=@FIREBIRD_PACKAGE_VERSION@
CpuType=@CPU_TYPE@
FBRootDir=@prefix@
Version="$BuildVersion-$PackageVersion.$CpuType"
@ -65,7 +63,7 @@ AskQuestion "Press Enter to start uninstall or ^C to abort"
# Here we are uninstalling from a install tar.gz file
scriptsDir=$FBRootDir/misc/scripts
scriptsDir=@FB_MISCDIR@/scripts
if [ -e $scriptsDir ]

View File

@ -32,8 +32,7 @@
#
#
cd $FBRootDir
cd ..
cd /
removeInstalledFiles # Remove installed files
removeUninstallFiles # Remove the 'uninstall' utility files

View File

@ -24,7 +24,7 @@
#
FB_FW=/Library/Frameworks/Firebird.framework/
FB_RES=$FBRootDir/Versions/A/Resources
FB_RES=@prefix@/Versions/A/Resources
cat <<EOF
There are now two ways to support multiple connections

View File

@ -61,7 +61,5 @@
updateInetdServiceEntry
resetInetdServer
cd $FBRootDir
# Change sysdba password
changeDBAPassword

View File

@ -36,7 +36,7 @@
checkIfServerRunning
cd $FBRootDir
cd @FB_SECDBDIR@
if [ -f $SecurityDatabase ]
then
@ -44,7 +44,7 @@
echo "Saved a copy of $SecurityDatabase in /tmp"
fi
for i in fb_guard firebird.log SYSDBA.password
for i in @FB_GUARDDIR@/fb_guard @FB_LOGDIR@/firebird.log @FB_CONFDIR@/SYSDBA.password
do
if [ -f $i ]
then

View File

@ -32,8 +32,7 @@
#
#
cd $FBRootDir
cd ..
cd /
removeInstalledFiles # Remove installed files
removeUninstallFiles # Remove the 'uninstall' utility files

View File

@ -45,8 +45,6 @@ BuildVersion=@FIREBIRD_VERSION@.@FB_BUILD_NUM@
PackageVersion=@FIREBIRD_PACKAGE_VERSION@
CpuType=@CPU_TYPE@
FBRootDir=@prefix@
Version="$BuildVersion-$PackageVersion.$CpuType"
@ -65,7 +63,7 @@ AskQuestion "Press Enter to start uninstall or ^C to abort"
# Here we are uninstalling from a install tar.gz file
scriptsDir=$FBRootDir/misc/scripts
scriptsDir=@FB_MISCDIR@/scripts
if [ -e $scriptsDir ]

View File

@ -77,9 +77,6 @@ printStatus() {
FBRootDir=@prefix@
FBBin=$FBRootDir/bin
quitIfRealFile @libdir@/libgds.sl
quitIfRealFile @libdir@/libgds.sl.0

View File

@ -129,9 +129,6 @@ checkAccessToFile() {
#= Main Post ===============================================================
FBRootDir=@prefix@
FBBin=$FBRootDir/bin
if [ $# -ne 2 ]
then
echo "Usage is createAliasDB.sh <name> <newDB>"
@ -141,7 +138,7 @@ checkAccessToFile() {
aliasName=$1
newDB=$2
AliasFile=$FBRootDir/aliases.conf
AliasFile=@FB_CONFDIR@/aliases.conf
checkNameStartsWithSlash $newDB
@ -151,8 +148,7 @@ checkAccessToFile() {
if [ ! -f $newDB ]
then
#source $FBRootDir/SYSDBA.password
$FBBin/isql <<EOF
@FB_BINDIR@/isql <<EOF
create database 'localhost:$aliasName';
quit;
EOF

View File

@ -36,7 +36,7 @@ TryAddUser() {
if [ -z "$testStr" ]
then
useradd $AdditionalParameter -d $FBRootDir -s /bin/false \
useradd $AdditionalParameter -d @FB_CONFDIR@ -s /bin/false \
-c "Firebird Database Owner" -g firebird firebird
fi

View File

@ -159,7 +159,7 @@ writeNewPassword() {
if [ $NewPasswd != "masterkey" ]
then
$FBBin/gsec -user sysdba -password masterkey <<EOF
@FB_BINDIR@/gsec -user sysdba -password masterkey <<EOF
modify sysdba -pw $NewPasswd
EOF
fi
@ -446,13 +446,9 @@ removeLineFromFile() {
origDir=`pwd`
FBRootDir=@prefix@
FBBin=$FBRootDir/bin
# RunUser=root
RunUser=firebird
DBAPasswordFile=$FBRootDir/SYSDBA.password
export FBRootDir
export FBBin
DBAPasswordFile=@FB_CONFDIR@/SYSDBA.password
export RunUser
export DBAPasswordFile
@ -508,15 +504,12 @@ removeLineFromFile() {
chown -R root:root $FBRootDir
chmod -R u-w,g-w,a-w $FBRootDir
# Prepare bin
cd $FBBin
# Create the fbmgr shell script.
cat > fbmgr <<EOF
cat > @FB_SBINDIR@/fbmgr <<EOF
#!/bin/sh
FIREBIRD=$FBRootDir
FIREBIRD=@FB_CONFDIR@
export FIREBIRD
exec \$FIREBIRD/bin/fbmgr.bin \$@
exec @FB_SBINDIR@/fbmgr.bin \$@
EOF

View File

@ -194,8 +194,6 @@
#== Main Pre =================================================================
FBRootDir=@prefix@
FBBin=$FBRootDir/bin
ArchiveDateTag=`date +"%Y%m%d_%H%M"`
ArchiveMainFile="${FBRootDir}_${ArchiveDateTag}.tar"

View File

@ -33,24 +33,21 @@ stopServerIfRunning() {
FBRootDir=@prefix@
FBBin=$FBRootDir/bin
SecurityDatabase=security.fdb
SecurityDatabase=security2.fdb
stopServerIfRunning
cd $FBRootDir
if [ -f $SecurityDatabase ]
if [ -f @FB_SECDBDIR@/$SecurityDatabase ]
then
cp $SecurityDatabase /tmp
cp @FB_SECDBDIR@/$SecurityDatabase /tmp
echo "Saved a copy of SecurityDatabase ($SecurityDatabase) in /tmp"
chown root:root /tmp/$SecurityDatabase
chmod 0600 /tmp/$SecurityDatabase
fi
for i in isc_init1* isc_event1* isc_lock1* isc_guard* firebird.log SYSDBA.password
for i in @FB_GUARDDIR@/fbguard @FB_LOGDIR@/firebird.log @FB_CONFDIR@/SYSDBA.password @FB_SBINDIR@/fbmgr
do
if [ -f $i ]
then
@ -58,9 +55,6 @@ stopServerIfRunning() {
fi
done
rm -f $FBBin/fbmgr
# testStr=`grep firebird /etc/passwd`
# if [ ! -z "$testStr" ]
# then

View File

@ -69,12 +69,11 @@ removeInstalledFiles() {
removeUninstallFiles() {
# remove the uninstall scripts files.
#echo $FBRootDir/misc/scripts
rm -rf $FBRootDir/misc/scripts
rm -f $FBRootDir/misc/manifest.txt
rm -f $FBRootDir/bin/uninstall.sh
rm -f $FBRootDir/lib/libfbembed.sl
rm -f $FBRootDir/lib/libfbclient.sl
rm -rf @FB_MISCDIR@/scripts
rm -f @FB_MISCDIR@/manifest.txt
rm -f @FB_SBINDIR@/fbUninstall.sh
rm -f @FB_LIBDIR@/libfbembed.sl
rm -f @FB_LIBDIR@/libfbclient.sl
}
@ -87,14 +86,11 @@ removeUninstallFiles() {
removeEmptyDirs() {
rm -fr $FBRootDir
#rm -fr $FBRootDir
}
FBRootDir=/usr/local/firebird
FBBin=$FBRootDir/bin
removeInstalledFiles # Remove installed files
removeUninstallFiles # Remove the 'uninstall' utility files
removeEmptyDirs # Remove empty directories

View File

@ -31,14 +31,8 @@ include $(ROOT)/gen/make.rules
include $(ROOT)/gen/make.shared.variables
FirebirdInstallPrefix=@prefix@
@SET_MAKE@
FIREBIRD=$(FirebirdInstallPrefix)
export -n FIREBIRD
.PHONY: install dist packages tarfile rpmfile
.PHONY: buildTarDir buildImageDir buildRoot buildDebugInfo
@ -51,13 +45,6 @@ BuildRoot=$(GEN_ROOT)
InstallRoot=.
FirebirdBuildPrefix=$(GEN_ROOT)
#export FirebirdBuildPrefix
#export FirebirdInstallPrefix
#export PackageVersion
BuildVersion=$(FirebirdVersion).$(BuildNum)
Version=$(BuildVersion)-$(PackageVersion)
@ -144,20 +131,16 @@ buildDebugInfo: buildRoot
mkdir -p $(GEN_ROOT)/$(DebugDir)/`dirname $$x`/.debug; \
echo Generating external debug info for $$x; \
cp $${FIL} $${D_FIL}; \
if objcopy --add-gnu-debuglink $${D_FIL} $${FIL}; > /dev/null 2> /dev/null; then \
echo Succeeded using objcopy from binutils; \
else \
echo Failed to set debug link for $${x}; \
fi; \
objcopy --add-gnu-debuglink=$${D_FIL} $${FIL}; \
echo Stripping unneeded symbols from $${x}; \
objcopy --strip-debug --strip-unneeded $${FIL}; \
fi; \
done
# Work around GDB 6.0 bug
mkdir -p $(GEN_ROOT)/$(DebugDir)@libdir@/.debug
for x in `ls $(GEN_ROOT)/$(DebugDir)@prefix@/lib/.debug`; do \
ln -f -s @prefix@/lib/.debug/`basename $$x` $(GEN_ROOT)/$(DebugDir)@libdir@/.debug; \
done
# mkdir -p $(GEN_ROOT)/$(DebugDir)@libdir@/.debug
# for x in `ls $(GEN_ROOT)/$(DebugDir)@prefix@/lib/.debug`; do \
# ln -f -s @prefix@/lib/.debug/`basename $$x` $(GEN_ROOT)/$(DebugDir)@libdir@/.debug; \
# done
# Use this line if you don't want to use separate debug info
#buildImageDir: buildRoot

View File

@ -1,257 +0,0 @@
#!/bin/sh
#
# 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 Mark O'Donohue
# for the Firebird Open Source RDBMS project.
#
# Copyright (c) Mark O'Donohue <mark.odonohue@ludwig.edu.au>
# and all contributors signed below.
#
# All Rights Reserved.
# Contributor(s): ______________________________________.
# Alex Peshkoff
#
# Script to copy install files from the build/transport area
# This script builds an image of the installed system into
# the gen/buildroot directory.
# Making an assumption that this program is being run in the gen directory
BuildRootDir=..
BuiltFBDir=./firebird # Where the just build fb exists.
TargetDir=buildroot # Where we want to build the install image
RealRootDir=@prefix@ # Where it will be installed on new machine
FBRootDir=${RealRootDir#/} # strip off leading /
DestDir=$TargetDir/$FBRootDir
#------------------------------------------------------------------------
# addLibs
# Add required libraries in the beginning of script.
# Place it to target directory.
addLibs() {
libSdir=$1
libScript=$2
libTdir=$3
libTarget=$libTdir/$libScript
rm -f $libTarget
touch $libTarget
for i in posixLibrary.sh classicLibrary.sh linuxLibrary.sh
do
echo "# $i" >>$libTarget
cat $libSdir/$i >>$libTarget
echo "" >>$libTarget # avoid missing linefeed
done
cat $libSdir/$libScript >>$libTarget
}
#------------------------------------------------------------------------
# copyIfExists
# Copy file if it exists
#
copyIfExists() {
OldFile=$1
NewFile=$2
if [ -f $OldFile ]
then
cp $OldFile $NewFile
fi
}
#------------------------------------------------------------------------
# copyFiles
# This function copies all the files for a classic distribution into a
# directory heirachy mirroring the installation.
copyFiles() {
# The guts of the tranfer of files and other directories
if [ -d $TargetDir ]
then
rm -fr $TargetDir
fi
mkdir -p $DestDir
mkdir $DestDir/bin
mkdir $DestDir/examples
mkdir $DestDir/help
mkdir $DestDir/include
mkdir $DestDir/intl
mkdir $DestDir/lib
mkdir $DestDir/plugins
mkdir $DestDir/doc
mkdir $DestDir/doc/sql.extensions
mkdir $DestDir/UDF
mkdir $DestDir/misc
mkdir $DestDir/misc/upgrade
for i in ib_udf metadata security; do
mkdir $DestDir/misc/upgrade/$i
done
# mkdir $TargetDir/etc
# mkdir $TargetDir/etc/init.d
# mkdir $TargetDir/var
# mkdir $TargetDir/var/adm
# mkdir $TargetDir/var/adm/fillup-templates
# mkdir -p $TargetDir/usr/sbin
mkdir -p $TargetDir@libdir@
mkdir -p $TargetDir/usr/include
cp -f $BuiltFBDir/bin/fb_inet_server $DestDir/bin/fb_inet_server
cp -f $BuiltFBDir/bin/fb_smp_server $DestDir/bin/fb_smp_server
cp -f $BuiltFBDir/bin/fbguard $DestDir/bin/fbguard
cp $BuiltFBDir/bin/gbak $DestDir/bin/gbak
cp $BuiltFBDir/bin/gdef $DestDir/bin/gdef
copyIfExists $BuiltFBDir/bin/fb_lock_print $DestDir/bin/fb_lock_print
cp $BuiltFBDir/bin/gfix $DestDir/bin/gfix
cp $BuiltFBDir/bin/gpre $DestDir/bin/gpre
cp $BuiltFBDir/bin/gsec $DestDir/bin/gsec
cp $BuiltFBDir/bin/nbackup $DestDir/bin/nbackup
copyIfExists $BuiltFBDir/bin/gsplit $DestDir/bin/gsplit
cp $BuiltFBDir/bin/gstat $DestDir/bin/gstat
copyIfExists $BuiltFBDir/bin/fbsvcmgr $DestDir/bin/fbsvcmgr
copyIfExists $BuiltFBDir/bin/fbtracemgr $DestDir/bin/fbtracemgr
cp $BuiltFBDir/bin/isql $DestDir/bin/isql
cp $BuiltFBDir/bin/qli $DestDir/bin/qli
# Append libraries to scripts
addLibs $BuildRootDir/gen/firebird/bin changeRunUser.sh $DestDir/bin
addLibs $BuildRootDir/gen/firebird/bin restoreRootRunUser.sh $DestDir/bin
addLibs $BuildRootDir/gen/firebird/bin changeDBAPassword.sh $DestDir/bin
addLibs $BuildRootDir/gen/firebird/bin changeMultiConnectMode.sh $DestDir/bin
addLibs $BuiltFBDir/bin changeGdsLibraryCompatibleLink.sh $DestDir/bin
addLibs $BuildRootDir/gen/firebird/bin tarMainInstall.sh $BuildRootDir/gen/install/scripts
addLibs $BuildRootDir/gen/firebird/bin tarinstall.sh $BuildRootDir/gen/install/scripts
addLibs $BuildRootDir/gen/firebird/bin preinstall.sh $BuildRootDir/gen/install/scripts
addLibs $BuildRootDir/gen/firebird/bin postinstall.sh $BuildRootDir/gen/install/scripts
addLibs $BuildRootDir/gen/firebird/bin preuninstall.sh $BuildRootDir/gen/install/scripts
addLibs $BuildRootDir/gen/firebird/bin postuninstall.sh $BuildRootDir/gen/install/scripts
addLibs $BuildRootDir/gen/firebird/bin taruninstall.sh $BuildRootDir/gen/install/scripts
addLibs $BuildRootDir/gen/firebird/bin tarMainUninstall.sh $BuildRootDir/gen/install/scripts
# this scripts don't need libraries
cp $BuiltFBDir/bin/createAliasDB.sh $DestDir/bin
cp $BuiltFBDir/bin/fb_config $DestDir/bin
# Copy examples only if we have them
exampleFiles=`find $BuiltFBDir/examples/README -type f -print`
if [ -z "$exampleFiles" ]
then
echo "Example files have not been built!"
else
(cd $BuiltFBDir/examples; tar cf - .) | (cd $DestDir/examples; tar xf -)
fi
copyIfExists $BuiltFBDir/help/help.gbak $DestDir/help
cp $BuiltFBDir/help/help.fdb $DestDir/help
#cp -r $BuildSrcDir/doc $DestDir
#cp -r $BuiltFBDir/doc $DestDir
cp $BuiltFBDir/firebird.msg $DestDir/firebird.msg
cp $BuiltFBDir/$SecurityDatabase $DestDir/$SecurityDatabase
# cp $BuiltFBDir/include/gds.f $DestDir/include
cp $BuiltFBDir/include/*.h $DestDir/include
cp -df $BuiltFBDir/lib/libfbembed.so* $DestDir/lib
cp -df $BuiltFBDir/lib/libfbclient.so* $DestDir/lib
# cp -f $BuiltFBDir/lib/gds.a @libdir@/libgds.a
cp -f $BuiltFBDir/lib/libib_util.so $DestDir/lib/libib_util.so
cp -df $BuiltFBDir/lib/libicu*.so* $DestDir/lib/
cp -df $BuiltFBDir/plugins/* $DestDir/plugins/
cp $BuiltFBDir/intl/libfbintl.so $DestDir/intl/fbintl
cp $BuiltFBDir/UDF/ib_udf.so $DestDir/UDF/
cp $BuiltFBDir/UDF/fbudf.so $DestDir/UDF/
# Note that the following items copy files from outside the build tree.
# Copy the sql-declarations into the UDF-directory
cp $BuildRootDir/src/extlib/ib_udf.sql $DestDir/UDF/
cp $BuildRootDir/src/extlib/ib_udf2.sql $DestDir/UDF/
cp $BuildRootDir/src/extlib/fbudf/fbudf.sql $DestDir/UDF/
# Copy various documentation
cp $BuildRootDir/doc/*.pdf $DestDir/doc
cp $BuildRootDir/doc/README.* $DestDir/doc
cp $BuildRootDir/doc/sql.extensions/README* $DestDir/doc/sql.extensions
cp $BuildRootDir/doc/WhatsNew $DestDir/WhatsNew
cp $BuildRootDir/doc/README.user $DestDir/README
# Copy various upgrade stuff
cp $BuildRootDir/src/misc/intl.sql $DestDir/misc/
cp $BuildRootDir/src/misc/upgrade/v2/ib_udf* $DestDir/misc/upgrade/ib_udf/
cp $BuildRootDir/src/misc/upgrade/v2/security_database* $DestDir/misc/upgrade/security/
cp $BuildRootDir/src/misc/upgrade/v2.1/metadata_charset* $DestDir/misc/upgrade/metadata/
# Misc. config files
cp $BuildRootDir/gen/install/misc/firebird.xinetd $DestDir/misc/
cp $BuildRootDir/gen/install/misc/firebird.conf $DestDir/
cp $BuildRootDir/gen/install/misc/aliases.conf $DestDir/
cp $BuildRootDir/gen/install/misc/fbintl.conf $DestDir/intl/
cp $BuildRootDir/gen/install/misc/firebird.init.d.* $DestDir/misc/
cp $BuildRootDir/gen/install/misc/rc.config.firebird $DestDir/misc
# Create links from @libdir@ to install area.
origDir=`pwd`
cd $DestDir/lib
for i in libfb*.so*; do ln -s /$FBRootDir/lib/$i $origDir/$TargetDir@libdir@/$i; done
cd $origDir
#ln -s ../../$FBRootDir/lib/libgds.a $TargetDir@libdir@/libgds.a
ln -s ../../$FBRootDir/lib/libib_util.so $TargetDir@libdir@/libib_util.so
# link include files to /usr/include
for i in iberror.h ibase.h ib_util.h
do
ln -s ../../$FBRootDir/include/$i $TargetDir/usr/include/$i
done
# (cd $DestDir; touch firebird.log;)
# chmod u=rw,go= firebird.log)
# (cd $DestDir; chmod uga+rw examples/*.gdb)
# chown -R root:root $TargetDir
}
#=== MAIN ====================================================================
SecurityDatabase=security2.fdb
copyFiles

View File

@ -15,13 +15,16 @@
#. /etc/rc.d/init.d/functions
FIREBIRD=@prefix@
FIREBIRD=@FB_CONFDIR@
FBRunUser=firebird
pidfile=/var/run/firebird/`basename $0`.pid
FB_OPTS="-pidfile $pidfile -daemon -forever"
export FIREBIRD
GUARDIAN=$FIREBIRD/bin/fbguard
if [ ! -x $GUARDIAN ]; then
GUARDIAN=@FB_SBINDIR@/fbguard
fi
# See how we were called.
case "$1" in

View File

@ -8,7 +8,7 @@
# Change INSTANCE and FIREBIRD below (all instance names should be unique)
# Edit the copied firebird.conf to change at least RemoteServicePort
INSTANCE=default
FIREBIRD=@prefix@
FIREBIRD=@FB_CONFDIR@
# No changes needed below for multiple instances
FBRunUser=firebird
@ -19,6 +19,9 @@ LD_LIBRARY_PATH=$FIREBIRD/lib
export FIREBIRD LD_LIBRARY_PATH
GUARDIAN=$FIREBIRD/bin/fbguard
if [ ! -x $GUARDIAN ]; then
GUARDIAN=@FB_SBINDIR@/fbguard
fi
# See how we were called.
case "$1" in

View File

@ -16,7 +16,7 @@
# Edit the copied firebird.conf to change at least RemoteServicePort
# Optionally run rc-update to autostart the new service
INSTANCE=default
FIREBIRD=@prefix@
FIREBIRD=@FB_CONFDIR@
FBRunUser=firebird
pidfile=/var/run/firebird/$INSTANCE.pid
@ -27,6 +27,9 @@ FB_OPTS="-pidfile $pidfile -daemon -forever"
export FIREBIRD LD_LIBRARY_PATH
GUARDIAN=$FIREBIRD/bin/fbguard
if [ ! -x $GUARDIAN ]; then
GUARDIAN=@FB_SBINDIR@/fbguard
fi
start(){
ebegin "Starting $FULLNAME"

View File

@ -27,7 +27,7 @@
# Edit the copied firebird.conf to change at least RemoteServicePort
# Optionally run chkconfig to autostart the new service
INSTANCE=default
FIREBIRD=@prefix@
FIREBIRD=@FB_CONFDIR@
# No changes needed below for multiple instances
name=$(basename `readlink -f $0`)
@ -39,6 +39,10 @@ LD_LIBRARY_PATH=$FIREBIRD/lib
export FIREBIRD LD_LIBRARY_PATH
GUARDIAN=$FIREBIRD/bin/fbguard
if [ ! -x $GUARDIAN ]; then
GUARDIAN=@FB_SBINDIR@/fbguard
fi
# initialize as "success"
RETVAL=0

View File

@ -12,7 +12,7 @@
# Edit the copied firebird.conf to change at least RemoteServicePort
# Optionally run rc-update to autostart the new service
INSTANCE=default
FIREBIRD=@prefix@
FIREBIRD=@FB_CONFDIR@
# No changes needed below for multiple instances
FBRunUser=firebird
@ -23,6 +23,9 @@ LD_LIBRARY_PATH=$FIREBIRD/lib
export FIREBIRD LD_LIBRARY_PATH
GUARDIAN=$FIREBIRD/bin/fbguard
if [ ! -x $GUARDIAN ]; then
GUARDIAN=@FB_SBINDIR@/fbguard
fi
case "$1" in
'start') echo -n "Starting $FULLNAME: "

View File

@ -40,15 +40,20 @@ link=${base#*[SK][0-9][0-9]}
test $link = $base && START_FIREBIRD="yes"
test "$START_FIREBIRD" = yes || exit 0
FIREBIRD=@prefix@
FIREBIRD=@FB_CONFDIR@
FBRunUser=firebird
pidfile=/var/run/firebird/firebird.pid
export FIREBIRD
# Check the files are there and are executable.
[ -x $FIREBIRD/bin/fbguard ] || exit 5
[ -x $FIREBIRD/bin/fbserver ] || [ -x $FIREBIRD/bin/fb_smp_server ] || exit 5
FBSBIN=$FIREBIRD/bin
if [ ! -x $FBSBIN/fbguard ]; then
FBSBIN=@FB_SBINDIR@
fi
[ -x $FBSBIN/fbguard ] || exit 5
[ -x $FBSBIN/fbserver ] || [ -x $FBSBIN/fb_smp_server ] || exit 5
# Shell functions sourced from /etc/rc.status:
# rc_check check and set local and overall rc status
@ -87,7 +92,7 @@ case "$1" in
# NOTE: startproc return 0, even if service is
# already running to match LSB spec.
startproc -u $FBRunUser $FIREBIRD/bin/fbguard -pidfile $pidfile -forever
startproc -u $FBRunUser $FBSBIN/fbguard -pidfile $pidfile -forever
# Remember status and be verbose
rc_status -v
@ -143,7 +148,7 @@ case "$1" in
# 3 - service not running
# NOTE: checkproc returns LSB compliant status values.
checkproc $FIREBIRD/bin/fbguard
checkproc $FBSBIN/fbguard
rc_status -v
;;

View File

@ -16,5 +16,5 @@ service gds_db
# using default firewall configuration (SF#1065511)
# log_on_success += USERID
# log_on_failure += USERID
server = @prefix@/bin/fb_inet_server
server = @FB_SBINDIR@/fb_inet_server
}

View File

@ -64,7 +64,7 @@ TryAddUser() {
if [ -z "$testStr" ]
then
useradd $AdditionalParameter -d $FBRootDir -s /bin/false \
useradd $AdditionalParameter -d @FB_CONFDIR@ -s /bin/false \
-c "Firebird Database Owner" -g firebird firebird
fi
@ -301,7 +301,7 @@ EOF
if [ "$initScript" ]
then
# Install the firebird init.d script
cp $FBRootDir/misc/$srcScript $initScript
cp @FB_MISCDIR@/$srcScript $initScript
chown root:root $initScript
chmod ug=rx,o=r $initScript
@ -332,16 +332,16 @@ EOF
then
if [ -x /bin/fillup ]
then
/bin/fillup -q -d = /etc/rc.config $FBRootDir/misc/rc.config.firebird
/bin/fillup -q -d = /etc/rc.config @FB_MISCDIR@/rc.config.firebird
fi
elif [ -d /etc/sysconfig ]
then
cp $FBRootDir/misc/rc.config.firebird /etc/sysconfig/firebird
cp @FB_MISCDIR@/rc.config.firebird /etc/sysconfig/firebird
fi
else
echo "Couldn't autodetect linux type. You must select"
echo "the most appropriate startup script in $FBRootDir/misc/"
echo "the most appropriate startup script in @FB_MISCDIR@"
echo "and manually register it in your OS."
fi

View File

@ -29,11 +29,6 @@
# Detect which linux distro we are installing on
detectDistro
# Make sure the links are in place
if [ -z "$FirebirdInstallPrefix" ]; then
FirebirdInstallPrefix=@prefix@
fi
origDir=`pwd`
# Update /etc/services
@ -46,12 +41,12 @@ if [ $RunUser = firebird ]; then
fi
# Create the fbmgr shell script.
if [ -x $FBBin/fbmgr.bin ]; then
cat > $FBBin/fbmgr <<EOF
if [ -x @FB_SBINDIR@/fbmgr.bin ]; then
cat > @FB_SBINDIR@/fbmgr <<EOF
#!/bin/sh
FIREBIRD=$FBRootDir
FIREBIRD=@FB_CONFDIR@
export FIREBIRD
exec \$FIREBIRD/bin/fbmgr.bin \$@
exec @FB_SBINDIR@/fbmgr.bin \$@
EOF
fi
@ -76,7 +71,5 @@ resetInetdServer
# start the db server so we can change the password
startService @FIREBIRD_ARCH_TYPE@
cd $FBRootDir
# Change sysdba password
changeDBAPassword

View File

@ -26,19 +26,17 @@
checkIfServerRunning
cd $FBRootDir
if [ -f $SecurityDatabase ]; then
cp $SecurityDatabase /tmp
if [ -f @FB_SECDBDIR@/$SecurityDatabase ]; then
cp @FB_SECDBDIR@/$SecurityDatabase /tmp
echo "Saved a copy of SecurityDatabase ($SecurityDatabase) in /tmp"
chown root:root /tmp/$SecurityDatabase
chmod 0600 /tmp/$SecurityDatabase
fi
for i in fb_guard firebird.log SYSDBA.password; do
for i in @FB_GUARDDIR@/fb_guard @FB_LOGDIR@/firebird.log @FB_CONFDIR@/SYSDBA.password; do
if [ -f $i ]; then
rm -f $i
fi
done
rm -f $FBBin/fbmgr
rm -f @FB_SBINDIR@/fbmgr

View File

@ -36,8 +36,6 @@ BuildVersion=@FIREBIRD_VERSION@.@FB_BUILD_NUM@
PackageVersion=@FIREBIRD_PACKAGE_VERSION@
CpuType=@CPU_TYPE@
FBRootDir=@prefix@
Version="$BuildVersion-$PackageVersion.$CpuType"
@ -56,7 +54,7 @@ AskQuestion "Press Enter to start uninstall or ^C to abort"
# Here we are uninstalling from a install tar.gz file
scriptsDir=$FBRootDir/misc/scripts
scriptsDir=@FB_MISCDIR@/scripts
if [ -e $scriptsDir ]

View File

@ -1,239 +0,0 @@
#!/bin/sh
#
# 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 Mark O'Donohue
# for the Firebird Open Source RDBMS project.
#
# Copyright (c) Mark O'Donohue <mark.odonohue@ludwig.edu.au>
# and all contributors signed below.
#
# All Rights Reserved.
# Contributor(s): ______________________________________.
# Alex Peshkoff
#
# This library is part of the FirebirdSQL project
# Script to copy install files from the build/transport area
# This script builds an image of the installed system into
# the gen/buildroot directory.
# Making an assumption that this program is being run in the gen directory
BuildRootDir=..
BuiltFBDir=./firebird # Where the just build fb exists.
TargetDir=buildroot # Where we want to build the install image
RealRootDir=@prefix@ # Where it will be installed on new machine
FBRootDir=${RealRootDir#/} # strip off leading /
DestDir=$TargetDir/$FBRootDir
SecurityDatabase=security2.fdb
#------------------------------------------------------------------------
# addLibs
# Add required libraries in the beginning of script.
# Place it to target directory.
addLibs() {
libSdir=$1
libScript=$2
libTdir=$3
libTarget=$libTdir/$libScript
rm -f $libTarget
touch $libTarget
for i in posixLibrary.sh superLibrary.sh linuxLibrary.sh
do
echo "# $i" >>$libTarget
cat $libSdir/$i >>$libTarget
echo "" >>$libTarget # avoid missing linefeed
done
cat $libSdir/$libScript >>$libTarget
}
#------------------------------------------------------------------------
# copyIfExists
# Copy file if it exists
#
copyIfExists() {
OldFile=$1
NewFile=$2
if [ -f $OldFile ]
then
cp $OldFile $NewFile
fi
}
#------------------------------------------------------------------------
# copyFiles
# This function copies all the files for a super distribution into a
# directory heirachy mirroring the installation.
copyFiles() {
# The guts of the tranfer of files and other directories
if [ -d $TargetDir ]
then
rm -fr $TargetDir
fi
mkdir -p $DestDir
mkdir $DestDir/bin
mkdir $DestDir/examples
mkdir $DestDir/help
mkdir $DestDir/include
mkdir $DestDir/intl
mkdir $DestDir/lib
mkdir $DestDir/plugins
mkdir $DestDir/doc
mkdir $DestDir/doc/sql.extensions
mkdir $DestDir/UDF
mkdir $DestDir/misc
mkdir $DestDir/misc/upgrade
for i in ib_udf metadata security; do
mkdir $DestDir/misc/upgrade/$i
done
mkdir -p $TargetDir@libdir@
mkdir -p $TargetDir/usr/include
# mkdir $TargetDir/var
# mkdir $TargetDir/var/adm
# mkdir $TargetDir/var/adm/fillup-templates
# mkdir -p $TargetDir/usr/sbin
cp -f $BuiltFBDir/bin/fbserver $DestDir/bin/fbserver
cp -f $BuiltFBDir/bin/fbguard $DestDir/bin/fbguard
cp -f $BuiltFBDir/bin/fbmgr.bin $DestDir/bin/fbmgr.bin
cp $BuiltFBDir/bin/gbak $DestDir/bin/gbak
copyIfExists $BuiltFBDir/bin/gdef $DestDir/bin/gdef
copyIfExists $BuiltFBDir/bin/fb_lock_print $DestDir/bin/fb_lock_print
copyIfExists $BuiltFBDir/bin/gds_pipe $DestDir/bin/gds_pipe
cp $BuiltFBDir/bin/gfix $DestDir/bin/gfix
cp $BuiltFBDir/bin/gpre $DestDir/bin/gpre
cp $BuiltFBDir/bin/gsec $DestDir/bin/gsec
copyIfExists $BuiltFBDir/bin/gsplit $DestDir/bin/gsplit
cp $BuiltFBDir/bin/gstat $DestDir/bin/gstat
copyIfExists $BuiltFBDir/bin/fbsvcmgr $DestDir/bin/fbsvcmgr
copyIfExists $BuiltFBDir/bin/fbtracemgr $DestDir/bin/fbtracemgr
copyIfExists $BuiltFBDir/bin/security.gbak $DestDir/bin/security.gbak
cp $BuiltFBDir/bin/isql $DestDir/bin/isql
cp $BuiltFBDir/bin/nbackup $DestDir/bin/nbackup
copyIfExists $BuiltFBDir/bin/qli $DestDir/bin/qli
# Append libraries to scripts
addLibs $BuildRootDir/gen/firebird/bin changeRunUser.sh $DestDir/bin
addLibs $BuildRootDir/gen/firebird/bin restoreRootRunUser.sh $DestDir/bin
addLibs $BuildRootDir/gen/firebird/bin changeDBAPassword.sh $DestDir/bin
addLibs $BuildRootDir/gen/firebird/bin tarMainInstall.sh $BuildRootDir/gen/install/scripts
addLibs $BuildRootDir/gen/firebird/bin tarinstall.sh $BuildRootDir/gen/install/scripts
addLibs $BuildRootDir/gen/firebird/bin preinstall.sh $BuildRootDir/gen/install/scripts
addLibs $BuildRootDir/gen/firebird/bin postinstall.sh $BuildRootDir/gen/install/scripts
addLibs $BuildRootDir/gen/firebird/bin preuninstall.sh $BuildRootDir/gen/install/scripts
addLibs $BuildRootDir/gen/firebird/bin postuninstall.sh $BuildRootDir/gen/install/scripts
addLibs $BuildRootDir/gen/firebird/bin taruninstall.sh $BuildRootDir/gen/install/scripts
addLibs $BuildRootDir/gen/firebird/bin tarMainUninstall.sh $BuildRootDir/gen/install/scripts
# these scripts don't need libraries
cp $BuildRootDir/gen/firebird/bin/createAliasDB.sh $DestDir/bin
cp $BuildRootDir/gen/firebird/bin/fb_config $DestDir/bin
# Copy examples only if we have them
exampleFiles=`find $BuiltFBDir/examples/README -type f -print`
if [ -z "$exampleFiles" ]
then
echo "Example files have not been built!"
else
(cd $BuiltFBDir/examples; tar cf - .) | (cd $DestDir/examples; tar xf -)
fi
copyIfExists $BuiltFBDir/help/help.gbak $DestDir/help
cp $BuiltFBDir/help/help.fdb $DestDir/help
cp $BuiltFBDir/*.msg $DestDir
cp $BuiltFBDir/$SecurityDatabase $DestDir/$SecurityDatabase
cp $BuiltFBDir/include/*.h $DestDir/include
cp -df $BuiltFBDir/lib/libfbclient.so* $DestDir/lib
cp -f $BuiltFBDir/lib/libib_util.so $DestDir/lib/libib_util.so
cp -df $BuiltFBDir/lib/libicu*.so* $DestDir/lib/
cp -df $BuiltFBDir/plugins/* $DestDir/plugins/
cp $BuiltFBDir/intl/libfbintl.so $DestDir/intl/fbintl
cp $BuiltFBDir/UDF/ib_udf.so $DestDir/UDF/
cp $BuiltFBDir/UDF/fbudf.so $DestDir/UDF/
# Note that the following items copy files from outside the build tree.
# Copy the sql-declarations into the UDF-directory
cp $BuildRootDir/src/extlib/ib_udf.sql $DestDir/UDF/
cp $BuildRootDir/src/extlib/ib_udf2.sql $DestDir/UDF/
cp $BuildRootDir/src/extlib/fbudf/fbudf.sql $DestDir/UDF/
# Copy various documentation
cp $BuildRootDir/doc/*.pdf $DestDir/doc
cp $BuildRootDir/doc/README.* $DestDir/doc
cp $BuildRootDir/doc/sql.extensions/README* $DestDir/doc/sql.extensions
cp $BuildRootDir/doc/WhatsNew $DestDir/WhatsNew
cp $BuildRootDir/doc/README.user $DestDir/README
# Copy various upgrade stuff
cp $BuildRootDir/src/misc/intl.sql $DestDir/misc/
cp $BuildRootDir/src/misc/upgrade/v2/ib_udf* $DestDir/misc/upgrade/ib_udf/
cp $BuildRootDir/src/misc/upgrade/v2/security_database* $DestDir/misc/upgrade/security/
cp $BuildRootDir/src/misc/upgrade/v2.1/metadata_charset* $DestDir/misc/upgrade/metadata/
# Miscellaneous config and startup files
cp $BuildRootDir/gen/install/misc/firebird.conf $DestDir/firebird.conf
cp $BuildRootDir/gen/install/misc/fbintl.conf $DestDir/intl/fbintl.conf
cp $BuildRootDir/gen/install/misc/firebird.init.d.* $DestDir/misc
cp $BuildRootDir/gen/install/misc/rc.config.firebird $DestDir/misc
cp $BuildRootDir/gen/install/misc/aliases.conf $DestDir/
originalDir=`pwd`
# Create links from @libdir@ to install area.
cd $TargetDir@libdir@
for i in ../../$FBRootDir/lib/libfb*.so*
do
ln -s $i .
done
ln -s ../../$FBRootDir/lib/libib_util.so .
cd $originalDir
# link include files to /usr/include
cd $TargetDir/usr/include
for i in ../../$FBRootDir/include/*.h
do
ln -s $i .
done
cd $originalDir
}
#=== MAIN ====================================================================
copyFiles

View File

@ -1,11 +1 @@
@prefix@
@libdir@/libfbclient.so.@FIREBIRD_VERSION@
@libdir@/libfbclient.so.2
@libdir@/libfbclient.so
@libdir@/libib_util.so
/usr/include/ibase.h
/usr/include/iberror.h
/usr/include/ib_util.h
/usr/include/perf.h
/

View File

@ -5,8 +5,8 @@
#
# Example Database:
#
employee.fdb = @prefix@/examples/empbuild/employee.fdb
employee = @prefix@/examples/empbuild/employee.fdb
employee.fdb = @FB_SAMPLEDBDIR@/employee.fdb
employee = @FB_SAMPLEDBDIR@/employee.fdb
#
# Live Databases:

View File

@ -68,9 +68,6 @@ printStatus() {
#= Main ====================================================================
FBRootDir=@prefix@
FBBin=$FBRootDir/bin
cat <<EOF
For classic server there are two optional backward compatible client libraries.
These are libfbclient.so and libfbembed.so.

View File

@ -23,9 +23,6 @@
#= Main ====================================================================
FBRootDir=@prefix@
FBBin=$FBRootDir/bin
cat <<EOF
For classic server there are two ways to support multiple connections:
multiprocess (traditional for FB classic server) and multithread (new for FB 2.5).

View File

@ -34,7 +34,7 @@ checkIfServerRunning
# Get confirmation
echo ""
echo "Change Firebird install for $FBRootDir to uid=$RunUser gid=$RunGroup"
echo "Change Firebird install for @FB_CONFDIR@ to uid=$RunUser gid=$RunGroup"
echo "(User or group options can be changed by editing this script)"
echo ""
AskQuestion "Press return to continue - or ^C to abort"
@ -52,7 +52,7 @@ updateInetdServiceEntry
changeInitRunUser $RunUser
# Update ownership and SUID bits for programs.
echo "Updating $FBRootDir"
echo "Updating permissions"
fixFilePermissions
# Get inetd to reread new init files, start service.

View File

@ -55,9 +55,9 @@ MakeFileFirebirdWritable() {
# Change the permissions specific for CS
fixArcSpecificPermissions() {
# Fix the rest
cd $FBRootDir
chmod a=r help/help.fdb
# Fix QLI help
cd @FB_HELPDIR@
chmod a=r help.fdb
}
@ -79,7 +79,7 @@ changeXinetdServiceUser() {
# This just adds/replaces the service entry line
updateInetdEntry() {
newLine="@FB_SERVICE_NAME@ stream tcp nowait.30000 $RunUser $FBBin/fb_inet_server fb_inet_server # Firebird Database Remote Server"
newLine="@FB_SERVICE_NAME@ stream tcp nowait.30000 $RunUser @FB_SBINDIR@/fb_inet_server fb_inet_server # Firebird Database Remote Server"
replaceLineInFile /etc/inetd.conf "$newLine" "^@FB_SERVICE_NAME@"
}
@ -88,7 +88,7 @@ updateInetdEntry() {
# Update xinetd service entry
updateXinetdEntry() {
cp $FBRootDir/misc/firebird.xinetd /etc/xinetd.d/firebird
cp @FB_MISCDIR@/firebird.xinetd /etc/xinetd.d/firebird
changeXinetdServiceUser
}

View File

@ -112,10 +112,6 @@ checkAccessToFile() {
#= Main Post ===============================================================
FBRootDir=@prefix@
FBBin=$FBRootDir/bin
if [ $# -ne 2 ]
then
echo "Usage is createAliasDB.sh <name> <newDB>"
@ -125,8 +121,7 @@ checkAccessToFile() {
aliasName=$1
newDB=$2
AliasFile=$FBRootDir/aliases.conf
AliasFile=@FB_CONFDIR@/aliases.conf
checkNameStartsWithSlash $newDB
appendAliasEntry $aliasName $newDB
@ -135,8 +130,8 @@ checkAccessToFile() {
if [ ! -f $newDB ]
then
#source $FBRootDir/SYSDBA.password
$FBBin/isql <<EOF
#source @FB_CONFDIR@/SYSDBA.password
@FB_BINDIR@/isql <<EOF
create database 'localhost:$aliasName';
quit;
EOF

View File

@ -23,10 +23,9 @@
# stored configuration values
fb_root=@prefix@
fb_bindir=$fb_root/bin
fb_libdir=$fb_root/lib
fb_incdir=$fb_root/include
fb_bindir=@FB_BINDIR@
fb_libdir=@FB_LIBDIR@
fb_incdir=@FB_INCDIR@
fb_cflags="-I$fb_incdir"
fb_libs="-L$fb_libdir -lfbclient"

View File

@ -29,14 +29,11 @@
Answer=""
OrigPasswd=""
TmpFile=""
FBRootDir=@prefix@
export FBRootDir
FBBin=$FBRootDir/bin
export FBBin
SecurityDatabase=security2.fdb
UninstallScript=FirebirdUninstall.sh
ArchiveDateTag=`date +"%Y%m%d_%H%M"`
export ArchiveDateTag
ArchiveMainFile="${FBRootDir}_${ArchiveDateTag}"
ArchiveMainFile="@FB_CONFDIR@_${ArchiveDateTag}"
export ArchiveMainFile
@ -267,7 +264,7 @@ askForOrigDBAPassword() {
do
AskQuestion "Please enter current password for SYSDBA user: "
OrigPasswd=$Answer
if ! runSilent "$FBBin/gsec -user sysdba -password $OrigPasswd -di"
if ! runSilent "@FB_BINDIR@/gsec -user sysdba -password $OrigPasswd -di"
then
OrigPasswd=""
fi
@ -296,7 +293,7 @@ askUserForNewDBAPassword() {
NewPasswd=$Answer
if [ ! -z "$NewPasswd" ]
then
if ! runSilent "$FBBin/gsec -user sysdba -password $OrigPasswd -modify sysdba -pw $NewPasswd"
if ! runSilent "@FB_BINDIR@/gsec -user sysdba -password $OrigPasswd -modify sysdba -pw $NewPasswd"
then
NewPasswd=""
fi
@ -363,11 +360,11 @@ removeLineFromFile() {
#------------------------------------------------------------------------
# Write new password to the @prefix@/SYSDBA.password file
# Write new password to the @FB_CONFDIR@/SYSDBA.password file
writeNewPassword() {
NewPasswd=$1
DBAPasswordFile=$FBRootDir/SYSDBA.password
DBAPasswordFile=@FB_CONFDIR@/SYSDBA.password
cat <<EOT >$DBAPasswordFile
# Firebird generated password for user SYSDBA is:
@ -388,7 +385,7 @@ EOT
cat <<EOT >>$DBAPasswordFile
# Your password can be changed to a more suitable one using the
# @prefix@/bin/gsec utility.
# @FB_BINDIR@/gsec utility.
EOT
chmod u=r,go= $DBAPasswordFile
@ -399,7 +396,7 @@ EOT
if [ $NewPasswd != "masterkey" ]
then
runSilent "$FBBin/gsec -user sysdba -password masterkey -modify sysdba -pw $NewPasswd"
runSilent "@FB_BINDIR@/gsec -user sysdba -password masterkey -modify sysdba -pw $NewPasswd"
fi
}
@ -429,14 +426,12 @@ buildUninstallFile() {
return
fi
cp manifest.txt $FBRootDir/misc
cp manifest.txt @FB_MISCDIR@
cp -r scripts $FBRootDir/misc/
[ -f scripts/tarMainUninstall.sh ] && cp scripts/tarMainUninstall.sh $FBRootDir/bin/uninstall.sh
[ -f scripts/tarmainUninstall.sh ] && cp scripts/tarmainUninstall.sh $FBRootDir/bin/uninstall.sh
[ -f $FBRootDir/bin/uninstall.sh ] && chmod u=rx,go= $FBRootDir/bin/uninstall.sh
cd $FBRootDir
cp -r scripts @FB_MISCDIR@
[ -f scripts/tarMainUninstall.sh ] && cp scripts/tarMainUninstall.sh @FB_SBINDIR@/$UninstallScript
[ -f scripts/tarmainUninstall.sh ] && cp scripts/tarmainUninstall.sh @FB_SBINDIR@/$UninstallScript
[ -f @FB_SBINDIR@/$UninstallScript ] && chmod u=rx,go= @FB_SBINDIR@/$UninstallScript
}
@ -480,14 +475,13 @@ createLinksForBackCompatibility() {
# to ensure it loads the fb equivalent. Eventually these should be
# optional and in a seperate rpm install. MOD 7-Nov-2002.
cd $FBRootDir
if [ "$1" ]
then
# Use library name from parameter
newLibrary=$FBRootDir/lib/$1
newLibrary=@FB_LIBDIR@/$1
else
# Use DefaultLibrary, set by appropriate install library
newLibrary=$FBRootDir/lib/$DefaultLibrary.so
newLibrary=@FB_LIBDIR@/$DefaultLibrary.so
fi
safeLink $newLibrary @libdir@/libgds.so
@ -506,23 +500,6 @@ removeLinksForBackCompatibility() {
}
#------------------------------------------------------------------------
# Set correct permissions for $FbRoot/doc tree
fixDocPermissions() {
cd $FBRootDir
for i in `find doc -print`; do
chown root:root $i
if [ -d $i ]; then
chmod 0755 $i
else
chmod 0644 $i
fi
done
}
#------------------------------------------------------------------------
# Run process and check status
@ -573,16 +550,25 @@ archivePriorInstallSystemFiles() {
cd /
DestFile=${FBRootDir#/} # strip off leading /
if [ -e "$DestFile" ]
if [ -f ${oldPWD}/manifest.txt ]; then
manifest=`cat ${oldPWD}/manifest.txt`
for i in $manifest; do
if [ -f $i ]; then
i=${i#/} # strip off leading /
archiveFileList="$archiveFileList $i"
fi
done
fi
DestFile=@FB_CONFDIR@
if [ -e "$DestFile" ]
then
echo ""
echo ""
echo ""
echo "--- Warning ----------------------------------------------"
echo " The installation target directory: $FBRootDir"
echo " Already contains a prior installation of InterBase/Firebird."
echo " This and files found in /usr/include and @libdir@ will be"
echo " The installation target directory $DestFile already exists."
echo " This and other related files found will be"
echo " archived in the file : ${tarArc}"
echo ""
@ -601,9 +587,10 @@ archivePriorInstallSystemFiles() {
for i in ibase.h ib_util.h
do
DestFile=usr/include/$i
if [ -e $DestFile ]
then
archiveFileList="$archiveFileList $DestFile"
if [ -e $DestFile ]; then
if [ ! "`echo $archiveFileList | grep $DestFile`" ]; then
archiveFileList="$archiveFileList $DestFile"
fi
fi
done
@ -611,30 +598,21 @@ archivePriorInstallSystemFiles() {
do
for DestFile in usr/lib/$i
do
if [ -e $DestFile ]
then
archiveFileList="$archiveFileList $DestFile"
if [ -e $DestFile ]; then
if [ ! "`echo $archiveFileList | grep $DestFile`" ]; then
archiveFileList="$archiveFileList $DestFile"
fi
fi
done
done
# for i in `cat manifest.txt`
# do
# if [ ! -d /$i ] # Ignore directories
# then
# if [ -e /$i ]
# then
# archiveFileList="$archiveFileList $i"
# fi
# fi
# done
for i in usr/sbin/rcfirebird etc/init.d/firebird etc/rc.d/init.d/firebird
do
DestFile=./$i
if [ -e /$DestFile ]
then
archiveFileList="$archiveFileList $DestFile"
if [ -e $DestFile ]; then
if [ ! "`echo $archiveFileList | grep $DestFile`" ]; then
archiveFileList="$archiveFileList $DestFile"
fi
fi
done
@ -661,9 +639,9 @@ archivePriorInstallSystemFiles() {
#
removeInstalledFiles() {
manifestFile=$FBRootDir/misc/manifest.txt
manifestFile=@FB_MISCDIR@/manifest.txt
if [ ! -f $manifestFile ]
if [ ! -f "$manifestFile" ]
then
return
fi
@ -692,11 +670,9 @@ removeInstalledFiles() {
removeUninstallFiles() {
# remove the uninstall scripts files.
#echo $FBRootDir/misc/scripts
rm -rf $FBRootDir/misc/scripts
rm -f $FBRootDir/misc/manifest.txt
rm -f $FBRootDir/bin/uninstall.sh
rm -rf @FB_MISCDIR@/scripts
rm -f @FB_MISCDIR@/manifest.txt
rm -f @FB_SBINDIR@/$UninstallScript
}
@ -710,23 +686,24 @@ removeUninstallFiles() {
removeEmptyDirs() {
dirContentChanged='yes'
while [ ! -z $dirContentChanged ]
do
while [ "$dirContentChanged" ]; do
dirContentChanged=''
for i in `find $FBRootDir -type d -print`; do
ls $i/* >/dev/null 2>&1
if [ $? -ne 0 ]; then
rmdir $i
dirContentChanged=$i
fi
done
if [ ! -d $FBRootDir ] # end loop if the FBRootDir was deleted.
then
dirContentChanged=''
fi
for rootDir in @FB_BINDIR@ @FB_SBINDIR@ @FB_LIBDIR@ @FB_INCDIR@ @FB_DOCDIR@ @FB_UDFDIR@ @FB_SAMPLEDIR@ @FB_SAMPLEDBDIR@ \
@FB_HELPDIR@ @FB_INTLDIR@ @FB_MISCDIR@ @FB_SECDBDIR@ @FB_MSGDIR@ @FB_LOGDIR@ @FB_GUARDDIR@ @FB_PLUGDIR@ \
@FB_CONFDIR@; do
done
if [ -d $rootDir ]; then
for i in `find $rootDir -type d -print`; do
ls $i/* >/dev/null 2>&1
if [ $? -ne 0 ]; then
rmdir $i && dirContentChanged=$i
fi
done
fi
done
done
}
@ -738,74 +715,30 @@ removeEmptyDirs() {
# more work.
fixFilePermissions() {
cd $FBRootDir
# For security reasons initially force all root:root non-writable
chown -R root:root $FBRootDir
chmod -R uga-w $FBRootDir
# Set up configuration files - make them root-writable
cd $FBRootDir
chmod u+w *.conf
# Prepare bin
cd $FBBin
# Everyone may execute clients
chmod a=rx *
# Shell scripts changing security attributes are for root only
chmod u=rx,go= *.sh
# Lock files
cd $FBRootDir
for i in fb_guard
cd @FB_GUARDDIR@
for FileName in fb_guard
do
FileName=$i
touch $FileName
MakeFileFirebirdWritable $FileName
done
# Log file
cd @FB_LOGDIR@
touch firebird.log
MakeFileFirebirdWritable firebird.log
# Security database
cd @FB_SECDBDIR@
MakeFileFirebirdWritable $SecurityDatabase
# set up libraries & plugins - everyone may use them
cd $FBRootDir
chmod a=rx lib/lib* plugins/lib*
# set up include files - everyone may use them
cd $FBRootDir/include
chmod a=r *
# fix up examples' permissions
cd $FBRootDir/examples
# set a default of read all files in examples
for i in `find . -name '*' -type f -print`
do
chmod a=r $i
done
# set a default of read&search all dirs in examples
for i in `find . -name '*' -type d -print`
do
chmod a=rx $i
done
# make examples DB(s) writable
for i in `find . -name '*.fdb' -print`
for i in `find @FB_SAMPLEDBDIR@ -name '*.fdb' -print`
do
MakeFileFirebirdWritable $i
done
# fix up doc permissions
cd $FBRootDir
fixDocPermissions
# Architecture (CS/SS) specific permissions
cd $FBRootDir
fixArcSpecificPermissions
cd $FBRootDir
}

View File

@ -34,7 +34,7 @@ checkIfServerRunning
# Get confirmation
echo ""
echo "Change Firebird install for $FBRootDir to uid=$RunUser gid=$RunGroup"
echo "Change Firebird install for @FB_CONFDIR@ to uid=$RunUser gid=$RunGroup"
echo "(User or group options can be changed by editing this script)"
echo ""
AskQuestion "Press return to continue - or ^C to abort"
@ -52,7 +52,7 @@ updateInetdServiceEntry
changeInitRunUser $RunUser
# Update ownership and SUID bits for programs.
echo "Updating $FBRootDir"
echo "Updating permissions"
fixFilePermissions
# Get inetd to reread new init files, start service.

View File

@ -46,7 +46,7 @@ GFIX_Sources = $(addprefix alice/, $(GFIX_Files)) $(GFIX_Other_Sources)
GFIX_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(GFIX_Sources))))
AllObjects = $(GFIX_Objects) $(CLUMPLETS_Objects) $(FBCOMMON_Objects) \
$(FBCLASSES_ClientObjects) $(FBCLASSES_MsgObjects)
$(FBCLASSES_ClientObjects) $(FBCLASSES_MsgObjects)
Dependencies = $(AllObjects:.o=.d)

View File

@ -77,7 +77,7 @@ GSTAT_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(GSTAT_Sources)
FBSVCMGR_Files= fbsvcmgr.cpp
FBSVCMGR_Other_Sources = common/classes/fb_string.cpp common/classes/alloc.cpp \
common/fb_exception.cpp common/utils.cpp common/classes/locks.cpp
common/fb_exception.cpp common/utils.cpp common/classes/locks.cpp jrd/path_utils.cpp
FBSVCMGR_Sources = $(addprefix utilities/, $(FBSVCMGR_Files)) $(FBSVCMGR_Other_Sources)
FBSVCMGR_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(FBSVCMGR_Sources)))) \
@ -87,7 +87,7 @@ $(FBCLASSES_MsgObjects) $(CLUMPLETS_Objects) $(FBCOMMON_ClientObjects)
FBTRACEMGR_Files= fbtracemgr/traceMgrMain.cpp
FBTRACEMGR_Other_Sources = common/classes/fb_string.cpp common/classes/alloc.cpp \
common/fb_exception.cpp common/utils.cpp common/classes/locks.cpp common/UtilSvc.cpp \
jrd/trace/TraceCmdLine.cpp
jrd/trace/TraceCmdLine.cpp jrd/path_utils.cpp
FBTRACEMGR_Sources = $(addprefix utilities/, $(FBTRACEMGR_Files)) $(FBTRACEMGR_Other_Sources)
FBTRACEMGR_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(FBTRACEMGR_Sources)))) \
@ -97,7 +97,7 @@ FBTRACEMGR_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(FBTRACEMG
FBGUARD_Other_Sources = jrd/isc.cpp jrd/divorce.cpp jrd/path_utils.cpp
FBGUARD_Files = guard.cpp util.cpp
FBGUARD_Sources = $(addprefix utilities/guard/, $(FBGUARD_Files)) $(FBGUARD_Other_Sources)
FBGUARD_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(FBGUARD_Sources))))
FBGUARD_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(FBGUARD_Sources)))) $(FBCLASSES_ClientObjects)
IBGUARD_A_Files = cntl_guard.cpp iscguard.cpp

View File

@ -43,12 +43,12 @@ GFIX_Files = alice_meta.epp \
alice.cpp exe.cpp tdr.cpp aliceMain.cpp
GFIX_Other_Sources += jrd/isc.cpp jrd/ThreadData.cpp jrd/path_utils.cpp \
common/UtilSvc.cpp
common/UtilSvc.cpp
GFIX_Sources = $(addprefix alice/, $(GFIX_Files)) $(GFIX_Other_Sources)
GFIX_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(GFIX_Sources))))
AllObjects = $(GFIX_Objects) $(CLUMPLETS_Objects)
AllObjects = $(GFIX_Objects) $(CLUMPLETS_Objects) $(FBCOMMON_Objects) $(FBCLASSES_Objects)
Dependencies = $(AllObjects:.o=.d)
@ -58,7 +58,7 @@ Dependencies = $(AllObjects:.o=.d)
gfix : $(LIBFBEMBED_SO) $(GFIX)
$(GFIX): $(GFIX_Objects) $(CLUMPLETS_Objects) $(FBCOMMON_Objects) $(FBCLASSES_Objects)
$(GFIX): $(AllObjects)
$(EXE_LINK) $(LINK_OPTS) $^ -o $@ $(FBEMBED_LINK) $(LINK_LIBS)

View File

@ -90,7 +90,7 @@ GSTAT_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(GSTAT_Sources)
FBSVCMGR_Files= fbsvcmgr.cpp
FBSVCMGR_Other_Sources = common/classes/fb_string.cpp common/classes/alloc.cpp \
common/fb_exception.cpp common/utils.cpp common/classes/locks.cpp
common/fb_exception.cpp common/utils.cpp common/classes/locks.cpp jrd/path_utils.cpp
FBSVCMGR_Sources = $(addprefix utilities/, $(FBSVCMGR_Files)) $(FBSVCMGR_Other_Sources)
FBSVCMGR_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(FBSVCMGR_Sources)))) \
@ -100,7 +100,7 @@ $(FBCLASSES_MsgObjects) $(CLUMPLETS_Objects) $(FBCOMMON_ClientObjects)
FBTRACEMGR_Files= fbtracemgr/traceMgrMain.cpp
FBTRACEMGR_Other_Sources = common/classes/fb_string.cpp common/classes/alloc.cpp \
common/fb_exception.cpp common/utils.cpp common/classes/locks.cpp common/UtilSvc.cpp \
jrd/trace/TraceCmdLine.cpp
jrd/trace/TraceCmdLine.cpp jrd/path_utils.cpp
FBTRACEMGR_Sources = $(addprefix utilities/, $(FBTRACEMGR_Files)) $(FBTRACEMGR_Other_Sources)
FBTRACEMGR_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(FBTRACEMGR_Sources)))) \
@ -110,7 +110,7 @@ FBTRACEMGR_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(FBTRACEMG
FBGUARD_Other_Sources = jrd/isc.cpp jrd/divorce.cpp jrd/path_utils.cpp
FBGUARD_Files = guard.cpp util.cpp
FBGUARD_Sources = $(addprefix utilities/guard/, $(FBGUARD_Files)) $(FBGUARD_Other_Sources)
FBGUARD_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(FBGUARD_Sources))))
FBGUARD_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(FBGUARD_Sources)))) $(FBCLASSES_ClientObjects)
IBMGR_Files = ibmgr.cpp srvrmgr.cpp

View File

@ -18,7 +18,7 @@
# Wed Jan 28 2009 Alex Peshkov - moved common part of prefix.darwin* to separate file
# Options
FirebirdInstallPrefix=
#FirebirdInstallPrefix=
LIB_BUNDLE_OPTIONS:=$(LD_FLAGS) -bundle -flat_namespace -undefined suppress
LIB_LINK_OPTIONS:=$(LD_FLAGS) -dynamiclib -flat_namespace
LIB_LINK_SONAME:=-current_version @FIREBIRD_VERSION@ -compatibility_version @FIREBIRD_VERSION@ -seg1addr 0x30000000

View File

@ -84,6 +84,7 @@ GLOB_OPTIONS=@CFLAGS@
#GLOB_OPTIONS+= -pg
CFLAGS:= $(CFLAGS) $(GLOB_OPTIONS)
CXXFLAGS:= $(CXXFLAGS) $(GLOB_OPTIONS)
#____________________________________________________________________________
@ -91,7 +92,6 @@ IsProdTypeBuild = @PROD_BUILD_FLG@
# If this is defined then we are building a production
# release with debug and optimization
FirebirdInstallPrefix = @prefix@
CpuType=@CPU_TYPE@
PLATFORM=@PLATFORM@
@ -255,7 +255,7 @@ LINK_IBUTIL_SYMBOLS = $(LIB_LINK_MAPFILE)$(ROOT)/builds/posix/ib_util.vers
LIB_PLATFORM_RPATH = -Wl,-rpath,$(1)
ifeq ($(strip @BINRELOC_CFLAGS@),)
LIB_LINK_RPATH = $(call LIB_PLATFORM_RPATH,$(FirebirdInstallPrefix)/$(1))
LIB_LINK_RPATH = $(call LIB_PLATFORM_RPATH,$(if $(subst intl,,$(1)),@FB_LIBDIR@,@FB_INTLDIR@))
else
LIB_LINK_RPATH = $(call LIB_PLATFORM_RPATH,'$$$$ORIGIN/../$(1)')
endif

View File

@ -49,7 +49,7 @@ export LIBPATH
# AIX ld option to set run-time library path is -Wl-blibpath:path1:path2
# Additional -blibpath options are not additive! All paths must be provided as a colon separated list.
LIB_PATH_OPTS= -Wl,-blibpath:$(FirebirdInstallPrefix)/lib:$(FirebirdInstallPrefix)/intl:/usr/local/lib:/usr/lib:/lib:$(GCC_RUNTIME)
LIB_PATH_OPTS= -Wl,-blibpath:@FB_LIBDIR@:@FB_INTLDIR@:/usr/local/lib:/usr/lib:/lib:$(GCC_RUNTIME)
ifeq ($(STD_ICU),true)
ICU_LIBS= -L/usr/local/lib -licuuc -licudata -licui18n

View File

@ -55,7 +55,7 @@
# AIX ld option to set run-time library path is -blibpath:path1:path2
# Additional -blibpath options are not additive! All paths must be provided as a colon separated list.
LIB_PATH_OPTS= -blibpath:$(FirebirdInstallPrefix)/lib:$(FirebirdInstallPrefix)/intl:/usr/local/lib:/usr/lib:/lib
LIB_PATH_OPTS= -blibpath:@FB_LIBDIR@:@FB_INTLDIR@:/usr/local/lib:/usr/lib:/lib
ifeq ($(STD_ICU),true)
ICU_LIBS= -L/usr/local/lib -licuuc -licudata -licui18n

View File

@ -2,9 +2,11 @@ dnl ############################# INITIALISATION ###############################
AC_PREREQ(2.56)
AC_INIT(src)
AC_CONFIG_AUX_DIR(builds/make.new/config)
AC_CACHE_VAL(ac_cv_prog_make_set, [AC_PROG_MAKE_SET])
AC_PREFIX_DEFAULT(/usr/local/firebird)
m4_ifdef([AC_CONFIG_MACRO_DIR],
[],
[m4_define([AC_CONFIG_MACRO_DIR], [])])
@ -18,6 +20,18 @@ define([XE_APPEND],[[$2]="$[$2] [$1]"])
dnl XE_PREPEND(value, varname)
define([XE_PREPEND],[[$2]="[$1] $[$2]"])
dnl XE_CONF_DIR(param, help, variable, default)
define([XE_CONF_DIR],[
AC_ARG_WITH([$1],
[AS_HELP_STRING([--with-$1], [$2])],
[[$3]=$withval
AC_DEFINE_UNQUOTED([$3], "$[$3]", [$2])],
[[$3]=[$4]
AC_DEFINE_UNQUOTED([$3], [""], [$2])]
)
AC_SUBST([$3])
])
sinclude(acx_pthread.m4)
sinclude(binreloc.m4)
@ -470,6 +484,26 @@ AC_SUBST(FB_SERVICE_NAME)
AC_SUBST(FB_SERVICE_PORT)
AC_SUBST(FB_IPC_NAME)
dnl Use non-standard directory placement control
dnl Sorry - GNU standard is not Ok for us
XE_CONF_DIR(fbbin, [executables DIR (PREFIX/bin)], FB_BINDIR, $prefix/bin)
XE_CONF_DIR(fbsbin, [system admin executables DIR (PREFIX/bin)], FB_SBINDIR, $prefix/bin)
XE_CONF_DIR(fbconf, [config files DIR (PREFIX)], FB_CONFDIR, $prefix)
XE_CONF_DIR(fblib, [object code libraries DIR (PREFIX/lib)], FB_LIBDIR, $prefix/lib)
XE_CONF_DIR(fbinclude, [C/C++ header files DIR (PREFIXinclude)], FB_INCDIR, $prefix/include)
XE_CONF_DIR(fbdoc, [documentation root DIR (PREFIX/doc)], FB_DOCDIR, $prefix/doc)
XE_CONF_DIR(fbudf, [UDF DIR (PREFIX/)], FB_UDFDIR, $prefix/UDF)
XE_CONF_DIR(fbsample, [examples DIR (PREFIX/examples)], FB_SAMPLEDIR, $prefix/examples)
XE_CONF_DIR(fbsample-db, [examples database DIR (PREFIX/examples/empbuild)], FB_SAMPLEDBDIR, $prefix/examples/empbuild)
XE_CONF_DIR(fbhelp, [QLI help DIR (PREFIX/help)], FB_HELPDIR, $prefix/help)
XE_CONF_DIR(fbintl, [international DIR (PREFIX/intl)], FB_INTLDIR, $prefix/intl)
XE_CONF_DIR(fbmisc, [misc DIR (PREFIX/misc)], FB_MISCDIR, $prefix/misc)
XE_CONF_DIR(fbsecure-db, [security database DIR (PREFIX)], FB_SECDBDIR, $prefix)
XE_CONF_DIR(fbmsg, [message files DIR (PREFIX)], FB_MSGDIR, $prefix)
XE_CONF_DIR(fblog, [log files DIR (PREFIX)], FB_LOGDIR, $prefix)
XE_CONF_DIR(fbglock, [guardian lock DIR (PREFIX)], FB_GUARDDIR, $prefix)
XE_CONF_DIR(fbplugins, [plugins DIR (PREFIX)], FB_PLUGDIR, $prefix/plugins)
dnl gpre built-in language support (C/C++ are mandatory)
GPRE_LANGUAGE_MODULES=""
AC_ARG_WITH(gpre-ada,
@ -1149,7 +1183,7 @@ case "$PLATFORM" in
mkdir -p gen/RPM/BUILD])
INSTALL_SRC_DIR=builds/install/arch-specific/linux/${FIREBIRD_ARCH_TYPE}
AC_CONFIG_FILES([gen/install/makeInstallImage.sh:${INSTALL_SRC_DIR}/makeInstallImage.sh.in
AC_CONFIG_FILES([gen/install/makeInstallImage.sh:builds/install/arch-specific/linux/misc/makeInstallImage.sh.in
gen/install/scripts/rpmheader.txt:${INSTALL_SRC_DIR}/rpmheader.txt.in
gen/install/scripts/rpmfiles.txt:${INSTALL_SRC_DIR}/rpmfiles.txt.in
gen/firebird/bin/tarMainInstall.sh:builds/install/arch-specific/linux/misc/tarMainInstall.sh.in

View File

@ -390,9 +390,7 @@ int fb_msg_format(void* handle,
else if (n == -2)
{
s += "message file ";
TEXT temp[MAXPATHLEN];
gds__prefix_msg(temp, MSG_FILE);
s += temp;
s += fb_utils::getPrefix(fb_utils::FB_DIR_MSG, MSG_FILE).ToString();
s += " not found";
}
else

View File

@ -105,7 +105,8 @@ const ConfigImpl::ConfigEntry ConfigImpl::entries[] =
{TYPE_STRING, "RemoteBindAddress", (ConfigValue) 0},
{TYPE_STRING, "ExternalFileAccess", (ConfigValue) "None"}, // location(s) of external files for tables
{TYPE_STRING, "DatabaseAccess", (ConfigValue) "Full"}, // location(s) of databases
{TYPE_STRING, "UdfAccess", (ConfigValue) "Restrict UDF"}, // location(s) of UDFs
#define UDF_DEFAULT_CONFIG_VALUE "Restrict UDF"
{TYPE_STRING, "UdfAccess", (ConfigValue) UDF_DEFAULT_CONFIG_VALUE}, // location(s) of UDFs
{TYPE_STRING, "TempDirectories", (ConfigValue) 0},
#ifdef DEV_BUILD
{TYPE_BOOLEAN, "BugcheckAbort", (ConfigValue) true}, // whether to abort() engine when internal error is found
@ -439,7 +440,33 @@ const char *Config::getDatabaseAccess()
const char *Config::getUdfAccess()
{
return (const char*) sysConfig().values[KEY_UDF_ACCESS];
static Firebird::GlobalPtr<Firebird::Mutex> udfMutex;
static Firebird::GlobalPtr<Firebird::string> udfValue;
static const char* volatile value = 0;
if (value)
{
return value;
}
Firebird::MutexLockGuard guard(udfMutex);
if (value)
{
return value;
}
const char* v = (const char*) sysConfig().values[KEY_UDF_ACCESS];
if (! strcmp(v, UDF_DEFAULT_CONFIG_VALUE) && FB_UDFDIR[0])
{
udfValue->printf("Restrict %s", FB_UDFDIR);
value = udfValue->c_str();
}
else
{
value = v;
}
return value;
}
const char *Config::getTempDirectories()
@ -511,3 +538,4 @@ int Config::getMaxUserTraceLogSize()
{
return (int) sysConfig().values[KEY_MAX_TRACELOG_SIZE];
}

View File

@ -270,14 +270,4 @@ public:
static int getMaxUserTraceLogSize();
};
namespace Firebird {
// Add appropriate file prefix.
inline void Prefix(PathName& result, const PathName& file)
{
PathUtils::concatPath(result, Config::getRootDirectory(), file);
}
} //namespace Firebird
#endif // COMMON_CONFIG_H

View File

@ -44,6 +44,7 @@
#include "../common/classes/locks.h"
#include "../common/classes/init.h"
#include "../jrd/constants.h"
#include "../jrd/os/path_utils.h"
#ifdef WIN_NT
#include <direct.h>
@ -918,4 +919,110 @@ void exactNumericToStr(SINT64 value, int scale, Firebird::string& target, bool a
target.assign(buffer + iter, len);
}
Firebird::PathName getPrefix(FB_DIR prefType, const char* name)
{
/**************************************
*
* i s c F b P r e f i x
*
**************************************
*
* Functional description
* Build full file name in specified directory
*
**************************************/
Firebird::PathName s;
char tmp[MAXPATHLEN];
#ifndef BOOT_BUILD
const char* configDir[] = {
FB_BINDIR, FB_SBINDIR, FB_CONFDIR, FB_LIBDIR, FB_INCDIR, FB_DOCDIR, FB_UDFDIR, FB_SAMPLEDIR,
FB_SAMPLEDBDIR, FB_HELPDIR, FB_INTLDIR, FB_MISCDIR, FB_SECDBDIR, FB_MSGDIR, FB_LOGDIR,
FB_GUARDDIR, FB_PLUGDIR
};
fb_assert(FB_NELEM(configDir) == FB_DIR_LAST);
fb_assert(prefType < FB_DIR_LAST);
if (prefType != FB_DIR_CONF && prefType != FB_DIR_MSG && configDir[prefType][0])
{
// Value is set explicitly and is not environment overridable
PathUtils::concatPath(s, configDir[prefType], name);
return s;
}
#endif
switch(prefType)
{
case FB_DIR_BIN:
case FB_DIR_SBIN:
s = "bin";
break;
case FB_DIR_CONF:
case FB_DIR_LOG:
case FB_DIR_GUARD:
case FB_DIR_SECDB:
s = "";
break;
case FB_DIR_LIB:
s = "lib";
break;
case FB_DIR_PLUGINS:
s = "plugins";
break;
case FB_DIR_INC:
s = "include";
break;
case FB_DIR_DOC:
s = "doc";
break;
case FB_DIR_UDF:
s = "UDF";
break;
case FB_DIR_SAMPLE:
s = "examples";
break;
case FB_DIR_SAMPLEDB:
s = "examples/empbuild";
break;
case FB_DIR_HELP:
s = "help";
break;
case FB_DIR_INTL:
s = "intl";
break;
case FB_DIR_MISC:
s = "misc";
break;
case FB_DIR_MSG:
gds__prefix_msg(tmp, name);
return tmp;
default:
fb_assert(false);
break;
}
if (s.hasData() && name[0])
{
s += '/';
}
s += name;
gds__prefix(tmp, s.c_str());
return tmp;
}
} // namespace fb_utils

View File

@ -128,6 +128,15 @@ namespace fb_utils
void exactNumericToStr(SINT64 value, int scale, Firebird::string& target, bool append = false);
enum FB_DIR {
FB_DIR_BIN = 0, FB_DIR_SBIN, FB_DIR_CONF, FB_DIR_LIB, FB_DIR_INC, FB_DIR_DOC, FB_DIR_UDF,
FB_DIR_SAMPLE, FB_DIR_SAMPLEDB, FB_DIR_HELP, FB_DIR_INTL, FB_DIR_MISC, FB_DIR_SECDB,
FB_DIR_MSG, FB_DIR_LOG, FB_DIR_GUARD, FB_DIR_PLUGINS,
FB_DIR_LAST};
// Add appropriate file prefix.
Firebird::PathName getPrefix(FB_DIR prefType, const char* name);
} // namespace fb_utils
#endif // INCLUDE_UTILS_PROTO_H

View File

@ -160,7 +160,7 @@ static adl* array_decl_list;
#if (defined AIX || defined AIX_PPC)
const char* const INCLUDE_ISC_FTN = " INCLUDE '%s\' \n\n";
const char* const INCLUDE_FTN_FILE = "include/gds.f";
const char* const INCLUDE_FTN_FILE = "gds.f";
const char* const DOUBLE_DCL = "DOUBLE PRECISION";
const char* const I2CONST_1 = "%VAL(";
const char* const I2CONST_2 = ")";
@ -177,7 +177,7 @@ const char* const INLINE_COMMENT = "!";
const char* const COMMA = ",";
#elif defined(__sun)
const char* const INCLUDE_ISC_FTN = " INCLUDE '%s\' \n\n";
const char* const INCLUDE_FTN_FILE = "include/gds.f";
const char* const INCLUDE_FTN_FILE = "gds.f";
const char* const DOUBLE_DCL = "DOUBLE PRECISION";
const char* const I2CONST_1 = "";
const char* const I2CONST_2 = "";
@ -194,7 +194,7 @@ const char* const INLINE_COMMENT = "\n* ";
const char* const COMMA = ",";
#elif defined(LINUX)
const char* const INCLUDE_ISC_FTN = " INCLUDE '/usr/firebird/include/gds.f\' \n\n";
const char* const INCLUDE_FTN_FILE = "include/gds.f";
const char* const INCLUDE_FTN_FILE = "gds.f";
const char* const DOUBLE_DCL = "DOUBLE PRECISION";
const char* const I2CONST_1 = "";
const char* const I2CONST_2 = "";
@ -211,7 +211,7 @@ const char* const INLINE_COMMENT = "\n* ";
const char* const COMMA = ",";
#elif defined(WIN_NT)
const char* const INCLUDE_ISC_FTN = " INCLUDE \'%s\' \n\n";
const char* const INCLUDE_FTN_FILE = "include/gds.f";
const char* const INCLUDE_FTN_FILE = "gds.f";
const char* const DOUBLE_DCL = "DOUBLE PRECISION";
const char* const I2CONST_1 = "";
const char* const I2CONST_2 = "";
@ -228,7 +228,7 @@ const char* const INLINE_COMMENT = "\n* ";
const char* const COMMA = ",";
#elif (defined FREEBSD || defined NETBSD)
const char* const INCLUDE_ISC_FTN = " INCLUDE '/usr/firebird/include/gds.f\' \n\n";
const char* const INCLUDE_FTN_FILE = "include/gds.f";
const char* const INCLUDE_FTN_FILE = "gds.f";
const char* const DOUBLE_DCL = "DOUBLE PRECISION";
const char* const I2CONST_1 = "";
const char* const I2CONST_2 = "";
@ -262,7 +262,7 @@ const char* const INLINE_COMMENT = "\n* ";
const char* const COMMA = ",";
#elif defined(HPUX)
const char* const INCLUDE_ISC_FTN = " INCLUDE '%s\' \n\n";
const char* const INCLUDE_FTN_FILE = "include/gds.f";
const char* const INCLUDE_FTN_FILE = "gds.f";
const char* const DOUBLE_DCL = "DOUBLE PRECISION";
const char* const I2CONST_1 = "ISC_INT2(";
const char* const I2CONST_2 = ")";
@ -1363,10 +1363,10 @@ static void gen_database()
static void gen_database_data() //(const act* action)
{
TEXT include_buffer[MAXPATHLEN];
Firebird::PathName include_buffer;
gds__prefix(include_buffer, INCLUDE_FTN_FILE);
sprintf(output_buffer, INCLUDE_ISC_FTN, include_buffer);
include_buffer = fb_utils::getPrefix(fb_utils::FB_DIR_INC, INCLUDE_FTN_FILE);
sprintf(output_buffer, INCLUDE_ISC_FTN, include_buffer.c_str());
FTN_print_buffer(output_buffer);

View File

@ -48,7 +48,7 @@ typedef unsigned short SHORT;
/* Name of module that implements text-type (n) */
#ifndef INTL_MODULE
#define INTL_MODULE "lib/IBLD_%03d"
#define INTL_MODULE "IBLD_%03d"
#endif
#ifndef INTL_INIT_ENTRY
@ -84,14 +84,14 @@ int main(int argc, char** argv)
#ifdef LIKE_JRD
{
char module[200];
char path[MAXPATHLEN];
Firebird::PathName path;
char entry[200];
const int t_type = atoi(vector[i]);
sprintf(module, INTL_MODULE, t_type);
gds__prefix(path, module);
path = fb_utils::getPrefix(fb_utils::FB_DIR_LIB, module);
sprintf(entry, INTL_INIT_ENTRY, t_type);
printf("path=%s entry=%s\n", path, entry);
func = (FPTR_INT) ISC_lookup_entrypoint(path, entry, NULL);
printf("path=%s entry=%s\n", path.c_str(), entry);
func = (FPTR_INT) ISC_lookup_entrypoint(path.c_str(), entry, NULL);
}
#else
if (strcmp(vector[i], "ask") == 0) {

View File

@ -421,8 +421,7 @@ bool IntlManager::initialize()
ObjectsArray<string> conflicts;
string builtinConfig;
Firebird::PathName intlPath;
PathUtils::concatPath(intlPath, Config::getRootDirectory(), "intl");
Firebird::PathName intlPath = fb_utils::getPrefix(fb_utils::FB_DIR_INTL, "");
ScanDir dir(intlPath.c_str(), "*.conf");

View File

@ -25,6 +25,7 @@
#include "../common/config/config_file.h"
#include "../jrd/os/path_utils.h"
#include "../jrd/gds_proto.h"
#include "../common/utils_proto.h"
using namespace Firebird;
@ -45,8 +46,7 @@ static void replace_dir_sep(PathName& s)
bool ResolveDatabaseAlias(const PathName& alias, PathName& database)
{
PathName alias_filename;
Firebird::Prefix(alias_filename, ALIAS_FILE);
PathName alias_filename = fb_utils::getPrefix(fb_utils::FB_DIR_CONF, ALIAS_FILE);
ConfigFile aliasConfig(false, true);
aliasConfig.setConfigFilePath(alias_filename);

View File

@ -64,7 +64,10 @@
#include "../common/utils_proto.h"
#include "../common/classes/FpeControl.h"
#ifndef WIN_NT
#ifdef WIN_NT
#define LIBNAME "ib_util"
#else
#define LIBNAME "libib_util"
#include <dlfcn.h> // dladdr
#endif
@ -80,21 +83,44 @@ namespace
IbUtilStartup(MemoryPool& p) : libUtilPath(p)
{
#if defined(WIN_NT)
libUtilPath.assign("ib_util");
libUtilPath.assign(LIBNAME);
#elif defined(DARWIN)
libUtilPath = "/Library/Frameworks/Firebird.framework/Versions/A/Libraries/libib_util";
libUtilPath = "/Library/Frameworks/Firebird.framework/Versions/A/Libraries/" LIBNAME;
#else
const PathName id(Config::getInstallDirectory());
PathUtils::concatPath(libUtilPath, id, "lib/libib_util");
PathUtils::concatPath(libUtilPath, id, "lib/" LIBNAME);
#endif // WIN_NT
ModuleLoader::doctorModuleExtention(libUtilPath);
}
PathName libUtilPath;
};
InitInstance<IbUtilStartup> ibUtilStartup;
bool volatile initDone = false;
bool tryLibrary(PathName libName, string& message)
{
ModuleLoader::doctorModuleExtention(libName);
ModuleLoader::Module* module = ModuleLoader::loadModule(libName);
if (!module)
{
message.printf("%s library has not been found", libName.c_str());
return false;
}
void (*ibUtilUnit)(void* (*)(long));
if (!module->findSymbol("ib_util_init", ibUtilUnit))
{
message.printf("ib_util_init not found in %s", libName.c_str());
delete module;
return false;
}
ibUtilUnit(IbUtil::alloc);
initDone = true;
return true;
}
}
#endif
@ -102,19 +128,31 @@ namespace
void IbUtil::initialize()
{
#ifndef BOOT_BUILD
ModuleLoader::Module* module = ModuleLoader::loadModule(ibUtilStartup().libUtilPath);
if (initDone)
return;
if (module)
{
void (*ibUtilUnit)(void* (*)(long));
string message[4]; // To suppress logs when correct library is found
if (module->findSymbol("ib_util_init", ibUtilUnit))
ibUtilUnit(alloc);
else
gds__log("ib_util_init not found in %s", ibUtilStartup().libUtilPath.c_str());
}
else
gds__log("%s library has not been found", ibUtilStartup().libUtilPath.c_str());
// using install directory
if (tryLibrary(ibUtilStartup().libUtilPath, message[0]))
return;
// using firebird root (takes into an account environment settings)
if (tryLibrary(fb_utils::getPrefix(fb_utils::FB_DIR_CONF, "lib/" LIBNAME), message[1]))
return;
// using libraries directory
if (tryLibrary(fb_utils::getPrefix(fb_utils::FB_DIR_LIB, LIBNAME), message[2]))
return;
// using default paths
if (tryLibrary(LIBNAME, message[3]))
return;
// all failed - log error
gds__log("ib_util init failed, UDFs can't be used - looks like firebird misconfigured\n"
"\t%s\n\t%s\n\t%s\n\t%s", message[0].c_str(), message[1].c_str(),
message[2].c_str(), message[3].c_str());
#endif // !BOOT_BUILD
}
@ -276,6 +314,13 @@ void FUN_evaluate(thread_db* tdbb, UserFunction* function, jrd_nod* node, impure
* Evaluate a function.
*
**************************************/
#ifndef BOOT_BUILD
// We may be in danger of AV in UDF if ib_util init failed
if (!initDone)
{
ERR_post(Arg::Gds(isc_random) << "ib_util init failed - UDF usage disabled");
}
#endif
UDF_ARG args[MAX_UDF_ARGUMENTS + 1];
HalfStaticArray<UCHAR, 800> temp;

View File

@ -664,11 +664,10 @@ void API_ROUTINE gds_alloc_report(ULONG flags, const char* filter_filename, int
*
**************************************/
// Skidder: Calls to this function must be replaced with MemoryPool::print_contents
char report_name[MAXPATHLEN];
gds__prefix(report_name, "fbsrvreport.txt");
Firebird::PathName report_name = fb_utils::getPrefix(fb_utils::FB_DIR_LOG, "fbsrvreport.txt");
// Our new facilities don't expose flags for reporting.
const bool used_only = !(flags & ALLOC_verbose);
getDefaultMemoryPool()->print_contents(report_name, used_only, filter_filename);
getDefaultMemoryPool()->print_contents(report_name.c_str(), used_only, filter_filename);
}
@ -1032,7 +1031,6 @@ void API_ROUTINE gds__trace_raw(const char* text, unsigned int length)
*
* Functional description
* Write trace event to a log file
* This function tries to be async-signal safe
*
**************************************/
if (!length)
@ -1047,11 +1045,10 @@ void API_ROUTINE gds__trace_raw(const char* text, unsigned int length)
{
if (CleanupTraceHandles::trace_file_handle == INVALID_HANDLE_VALUE)
{
TEXT name[MAXPATHLEN];
gds__prefix(name, LOGFILE);
Firebird::PathName name = fb_utils::getPrefix(fb_utils::FB_DIR_LOG, LOGFILE);
// We do not care to close this file.
// It will be closed automatically when our process terminates.
CleanupTraceHandles::trace_file_handle = CreateFile(name, GENERIC_WRITE,
CleanupTraceHandles::trace_file_handle = CreateFile(name.c_str(), GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (CleanupTraceHandles::trace_file_handle == INVALID_HANDLE_VALUE)
@ -1072,11 +1069,8 @@ void API_ROUTINE gds__trace_raw(const char* text, unsigned int length)
}
ReleaseMutex(CleanupTraceHandles::trace_mutex_handle);
#else
TEXT name[MAXPATHLEN];
// Note: signal-safe code
gds__prefix(name, LOGFILE);
int file = open(name, O_CREAT | O_APPEND | O_WRONLY, 0660);
Firebird::PathName name = fb_utils::getPrefix(fb_utils::FB_DIR_LOG, LOGFILE);
int file = open(name.c_str(), O_CREAT | O_APPEND | O_WRONLY, 0660);
if (file == -1)
return;
@ -1179,7 +1173,6 @@ void API_ROUTINE gds__log(const TEXT* text, ...)
**************************************/
va_list ptr;
time_t now;
TEXT name[MAXPATHLEN];
#ifdef HAVE_GETTIMEOFDAY
struct timeval tv;
@ -1189,12 +1182,12 @@ void API_ROUTINE gds__log(const TEXT* text, ...)
now = time((time_t *)0);
#endif
gds__prefix(name, LOGFILE);
Firebird::PathName name = fb_utils::getPrefix(fb_utils::FB_DIR_LOG, LOGFILE);
#ifdef WIN_NT
WaitForSingleObject(CleanupTraceHandles::trace_mutex_handle, INFINITE);
#endif
FILE* file = fopen(name, "a");
FILE* file = fopen(name.c_str(), "a");
if (file != NULL)
{
#ifndef WIN_NT
@ -1215,7 +1208,8 @@ void API_ROUTINE gds__log(const TEXT* text, ...)
fseek(file, 0, SEEK_END);
#endif
fprintf(file, "\n%s%s\t%.25s\t", ISC_get_host(name, MAXPATHLEN), gdslogid, ctime(&now));
TEXT buffer[MAXPATHLEN];
fprintf(file, "\n%s%s\t%.25s\t", ISC_get_host(buffer, MAXPATHLEN), gdslogid, ctime(&now));
va_start(ptr, text);
vfprintf(file, text, ptr);
va_end(ptr);
@ -1244,7 +1238,6 @@ void API_ROUTINE gds__print_pool(MemoryPool* pool, const TEXT* text, ...)
**************************************/
va_list ptr;
time_t now;
TEXT name[MAXPATHLEN];
#ifdef HAVE_GETTIMEOFDAY
struct timeval tv;
@ -1254,16 +1247,17 @@ void API_ROUTINE gds__print_pool(MemoryPool* pool, const TEXT* text, ...)
now = time((time_t *)0);
#endif
gds__prefix(name, LOGFILE);
Firebird::PathName name = fb_utils::getPrefix(fb_utils::FB_DIR_LOG, LOGFILE);
const int oldmask = umask(0111);
#ifdef WIN_NT
WaitForSingleObject(CleanupTraceHandles::trace_mutex_handle, INFINITE);
#endif
FILE* file = fopen(name, "a");
FILE* file = fopen(name.c_str(), "a");
if (file != NULL)
{
fprintf(file, "\n%s%s\t%.25s\t", ISC_get_host(name, MAXPATHLEN), gdslogid, ctime(&now));
TEXT buffer[MAXPATHLEN];
fprintf(file, "\n%s%s\t%.25s\t", ISC_get_host(buffer, MAXPATHLEN), gdslogid, ctime(&now));
va_start(ptr, text);
vfprintf(file, text, ptr);
va_end(ptr);
@ -3637,13 +3631,13 @@ public:
{
prefix = Config::getRootDirectory();
if (prefix.isEmpty() && !GetProgramFilesDir(prefix))
prefix = FB_PREFIX;
prefix = FB_CONFDIR[0] ? FB_CONFDIR : FB_PREFIX;
}
catch (Firebird::fatal_exception&)
{
// CVC: Presumably here we failed because the config file can't be located.
if (!GetProgramFilesDir(prefix))
prefix = FB_PREFIX;
prefix = FB_CONFDIR[0] ? FB_CONFDIR : FB_PREFIX;
}
prefix.copyTo(fb_prefix_val, sizeof(fb_prefix_val));
fb_prefix = fb_prefix_val;
@ -3722,7 +3716,7 @@ public:
Firebird::PathName msgPrefix;
if (!fb_utils::readenv(FB_MSG_ENV, msgPrefix))
{
msgPrefix = prefix;
msgPrefix = FB_MSGDIR[0] ? FB_MSGDIR : prefix;
}
msgPrefix.copyTo(fb_prefix_msg_val, sizeof(fb_prefix_msg_val));
fb_prefix_msg = fb_prefix_msg_val;

View File

@ -3970,11 +3970,11 @@ void JRD_print_procedure_info(thread_db* tdbb, const char* mesg)
******************************************************/
TEXT fname[MAXPATHLEN];
gds__prefix(fname, "proc_info.log");
FILE* fptr = fopen(fname, "a+");
Firebird::string fname = fb_utils::getPrefix(fb_utils::FB_DIR_LOG, "proc_info.log");
FILE* fptr = fopen(fname.c_str(), "a+");
if (!fptr)
{
gds__log("Failed to open %s\n", fname);
gds__log("Failed to open %s\n", fname.c_str());
return;
}

View File

@ -28,6 +28,7 @@
#define JRD_PWD_H
#include "../jrd/ibase.h"
#include "../common/utils_proto.h"
#include "../jrd/sha.h"
#include "gen/iberror.h"
#ifdef HAVE_STDLIB_H
@ -56,7 +57,8 @@ public:
static void getPath(TEXT* path_buffer)
{
static const char* USER_INFO_NAME = "security2.fdb";
gds__prefix(path_buffer, USER_INFO_NAME);
Firebird::PathName name = fb_utils::getPrefix(fb_utils::FB_DIR_SECDB, USER_INFO_NAME);
name.copyTo(path_buffer, MAXPATHLEN);
}
static void initialize();

View File

@ -66,6 +66,17 @@ static string getRootPathFromExePath()
void ConfigRoot::osConfigRoot()
{
// Try to use value set at configure time
if (FB_CONFDIR[0])
{
root_dir = FB_CONFDIR;
if (root_dir[root_dir.length() - 1] != PathUtils::dir_sep)
{
root_dir += PathUtils::dir_sep;
}
return;
}
#ifdef SUPERSERVER
// Try getting the root path from the executable
root_dir = getRootPathFromExePath();

View File

@ -2062,9 +2062,8 @@ void Service::readFbLog()
{
bool svc_started = false;
TEXT name[MAXPATHLEN];
gds__prefix(name, LOGFILE);
FILE* file = fopen(name, "r");
Firebird::PathName name = fb_utils::getPrefix(fb_utils::FB_DIR_LOG, LOGFILE);
FILE* file = fopen(name.c_str(), "r");
try
{

View File

@ -138,9 +138,8 @@ void TraceManager::load_modules()
init_modules = true;
char plugdir[MAXPATHLEN];
gds__prefix(plugdir, "plugins");
ScanDir plugins(plugdir, "*.*");
PathName plugdir = fb_utils::getPrefix(fb_utils::FB_DIR_PLUGINS, "");
ScanDir plugins(plugdir.c_str(), "*.*");
while (plugins.next())
{

View File

@ -35,6 +35,8 @@
#include "../qli/help_proto.h"
#include "../qli/lex_proto.h"
#include "../jrd/gds_proto.h"
#include "../common/utils_proto.h"
#include "../common/classes/fb_string.h"
using MsgFormat::SafeArg;
@ -43,11 +45,7 @@ const char* INDENT = " ";
const int COLUMN_WIDTH = 20;
const int RIGHT_MARGIN = 70;
#ifdef UNIX
const char* const TARGET = "help/help.fdb";
#elif defined(WIN_NT)
const char* const TARGET = "help\\help.fdb";
#endif
const char* const TARGET = "help.fdb";
DATABASE HELP_DB = STATIC "help.fdb" RUNTIME target;
@ -89,11 +87,11 @@ void HELP_help( qli_syntax* node)
* Give the poor sucker help.
*
**************************************/
TEXT target[MAXPATHLEN];
if (!HELP_DB)
{
gds__prefix(target, TARGET);
Firebird::PathName name = fb_utils::getPrefix(fb_utils::FB_DIR_HELP, TARGET);
TEXT target[MAXPATHLEN];
name.copyTo(target, sizeof target);
READY
ON_ERROR
ERRQ_database_error(NULL, gds_status);

View File

@ -458,9 +458,8 @@ int FB_EXPORTED server_main( int argc, char** argv)
// In Debug mode - this will report all server-side memory leaks due to remote access
//gds_alloc_report(0, __FILE__, __LINE__);
char name[MAXPATHLEN];
gds__prefix(name, "memdebug.log");
FILE* file = fopen(name, "w+t");
Firebird::PathName name = fb_utils::getPrefix(fb_utils::FB_DIR_LOG, "memdebug.log");
FILE* file = fopen(name.c_str(), "w+t");
if (file)
{
fprintf(file, "Global memory pool allocated objects\n");

View File

@ -318,9 +318,8 @@ int WINAPI WinMain(HINSTANCE hThisInst, HINSTANCE /*hPrevInst*/, LPSTR lpszArgs,
// due to remote access
//gds_alloc_report(0, __FILE__, __LINE__);
char name[MAXPATHLEN];
gds__prefix(name, "memdebug.log");
FILE* file = fopen(name, "w+t");
Firebird::PathName name = fb_utils::getPrefix(fb_utils::FB_DIR_LOG, "memdebug.log");
FILE* file = fopen(name.c_str(), "w+t");
if (file)
{
fprintf(file, "Global memory pool allocated objects\n");

View File

@ -61,8 +61,8 @@ const USHORT ONETIME = 2;
const USHORT IGNORE = 3;
const USHORT NORMAL_EXIT= 0;
const char* const SUPER_SERVER_BINARY = "bin/fbserver";
const char* const SUPER_CLASSIC_BINARY = "bin/fb_smp_server";
const char* const SUPER_SERVER_BINARY = "fbserver";
const char* const SUPER_CLASSIC_BINARY = "fb_smp_server";
const char* const INTERBASE_USER = "interbase";
const char* const FIREBIRD_USER = "firebird";

View File

@ -60,6 +60,7 @@
#include "../utilities/guard/util_proto.h"
#include "../jrd/gds_proto.h"
#include "../jrd/isc_proto.h"
#include "../common/utils_proto.h"
pid_t UTIL_start_process(const char* process, const char* process2, char** argv, const char* prog_name)
@ -83,28 +84,26 @@ pid_t UTIL_start_process(const char* process, const char* process2, char** argv,
* expanded process name. (MAXPATHLEN recommended)
*
**************************************/
TEXT string[MAXPATHLEN];
fb_assert(process != NULL);
fb_assert(argv != NULL);
// prepend Firebird home directory to the program name
// choose correct (super/superclassic) image - to be removed in 3.0
gds__prefix(string, process);
if (access(string, X_OK) < 0) {
gds__prefix(string, process2);
Firebird::PathName string = fb_utils::getPrefix(fb_utils::FB_DIR_SBIN, process);
if (access(string.c_str(), X_OK) < 0) {
string = fb_utils::getPrefix(fb_utils::FB_DIR_SBIN, process2);
}
if (prog_name) {
gds__log("%s: guardian starting %s\n", prog_name, string);
gds__log("%s: guardian starting %s\n", prog_name, string.c_str());
}
// add place in argv for visibility to "ps"
strcpy(argv[0], string);
strcpy(argv[0], string.c_str());
#if (defined SOLARIS)
pid_t pid = fork1();
if (!pid)
{
if (execv(string, argv) == -1) {
if (execv(string.c_str(), argv) == -1) {
//ib_fprintf(ib_stderr, "Could not create child process %s with args %s\n", string, argv);
}
exit(FINI_ERROR);
@ -115,7 +114,7 @@ pid_t UTIL_start_process(const char* process, const char* process2, char** argv,
pid_t pid = vfork();
if (!pid)
{
execv(string, argv);
execv(string.c_str(), argv);
_exit(FINI_ERROR);
}
#endif
@ -250,16 +249,14 @@ int UTIL_ex_lock(const TEXT* file)
*
**************************************/
TEXT expanded_filename[MAXPATHLEN];
// get the file name and prepend the complete path etc
gds__prefix(expanded_filename, file);
Firebird::PathName expanded_filename = fb_utils::getPrefix(fb_utils::FB_DIR_GUARD, file);
// file fd for the opened and locked file
int fd_file = open(expanded_filename, O_RDWR | O_CREAT, 0666);
int fd_file = open(expanded_filename.c_str(), O_RDWR | O_CREAT, 0666);
if (fd_file == -1)
{
fprintf(stderr, "Could not open %s for write\n", expanded_filename);
fprintf(stderr, "Could not open %s for write\n", expanded_filename.c_str());
return (-1);
}

View File

@ -32,7 +32,7 @@
static const char* const FIREBIRD_USER_NAME = "firebird";
static const char* const INTERBASE_USER_NAME = "interbase";
static const char* const INTERBASE_USER_SHORT = "interbas";
static const char* const SERVER_GUARDIAN = "bin/fbguard";
static const char* const SERVER_GUARDIAN = "fbguard";
const USHORT MSG_FAC = 18;
const int MSG_LEN = 128;

View File

@ -44,6 +44,7 @@
#include "../common/stuff.h"
#include "../utilities/ibmgr/ibmgr.h"
#include "../utilities/ibmgr/srvrmgr_proto.h"
#include "../common/utils_proto.h"
const int SPB_BUFLEN = 128; // service params buffer length
//#define SEND_BUFLEN 32 // length of send and resp
@ -481,8 +482,7 @@ static bool start_server( ibmgr_data_t* data)
// We failed to attach to service, thus server might not be running
// You know what? We'll try to start it.
TEXT path[MAXPATHLEN];
gds__prefix(path, SERVER_GUARDIAN);
Firebird::PathName path = fb_utils::getPrefix(fb_utils::FB_DIR_SBIN, SERVER_GUARDIAN);
// CVC: Newer compilers won't accept assigning literal strings to non-const
// char pointers, so this code prevents changing argv's type to const TEXT* argv[4]
@ -493,7 +493,7 @@ static bool start_server( ibmgr_data_t* data)
static char option_p[] = "-p";
TEXT *argv[5];
argv[0] = path;
argv[0] = path.begin();
switch (data->suboperation)
{
case SOP_START_ONCE:
@ -525,8 +525,8 @@ static bool start_server( ibmgr_data_t* data)
if (!(pid = fork1()))
{
if (execv(path, argv) == -1) {
printf("Could not create child process %s with args %s \n", path, argv[1]);
if (execv(path.c_str(), argv) == -1) {
printf("Could not create child process %s with args %s \n", path.c_str(), argv[1]);
}
_exit(FINI_ERROR);
}
@ -535,7 +535,7 @@ static bool start_server( ibmgr_data_t* data)
if (!(pid = vfork()))
{
execv(path, argv);
execv(path.c_str(), argv);
_exit(FINI_ERROR);
}
#endif