diff --git a/.esc.metadata b/.esc.metadata new file mode 100644 index 0000000..c33dee4 --- /dev/null +++ b/.esc.metadata @@ -0,0 +1,2 @@ +85f85f8b3d7443cc2abc87ebb8cb3631372252ae SOURCES/esc-1.1.0.tar.bz2 +115da701c784ea3fc89d2cb1bb0539011d246a1a SOURCES/esc.png diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fc3d01e --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +SOURCES/esc-1.1.0.tar.bz2 +SOURCES/esc.png diff --git a/SOURCES/esc b/SOURCES/esc new file mode 100755 index 0000000..cb0d44d --- /dev/null +++ b/SOURCES/esc @@ -0,0 +1,172 @@ +#!/bin/sh +# +# BEGIN COPYRIGHT BLOCK +# This Program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This Program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA. +# +# Copyright (C) 2005 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK + + +DO_FORCEMODE="false" +DO_SHOW_VERSION="false" +ESC_ARGS= + + +ESC_PROFILE_BASE=~/.redhat/esc +ESC_LOG_FILE=esc.log + +ESC_PATH=$LIBDIR/esc-1.1.0 +ESC_BIN_PATH=/usr/bin +ESC_EXEC=esc +ESCD_EXEC=escd + +ESC_BIN=$ESC_PATH/xulrunner/xulrunner-bin +ESCD_BIN=./$ESCD_EXEC + +LAST_PROG_PID=0 +SIGUSR1=10 + +FORCE_START_ESC= + +XPTI_DAT=xpti.dat +COMPREG_DAT=compreg.dat +LOCK_FILE=lock +PARENT_LOCK_FILE=.parentlock + +function isProgRunning { + + userID=$(whoami) + isProgRunning=$(pgrep -U $userID -f $1) + if [ $isProgRunning ]; + then + LAST_PROG_PID=$isProgRunning + return 0 + fi + LAST_PROG_PID=0 + return 1 +} + +function removeFile { + + rm -f $1 +} + +function cleanupProfile { + + removeFile $ESC_PROFILE_BASE/*default/$XPTI_DAT + removeFile $ESC_PROFILE_BASE/*default/$COMPREG_DAT + removeFile $ESC_PROFILE_BASE/*default/$LOCK_FILE + removeFile $ESC_PROFILE_BASE/*default/$PARENT_LOCK_FILE + +} + +function processArgs { + + for arg in $1 + do + + #echo "theArg: $arg" + if [ $arg == "forceStartESC" ] + then + #echo "Do force mode!" + FORCE_START_ESC="true" + fi + + if [ $arg == "keyInserted" ] + then + FORCE_START_ESC="true" + fi + + if [ $arg == "-version" ] + then + #echo "Do show version!" + DO_SHOW_VERSION="true" + fi + done +} + + +processArgs $* + +if [ ! -d $ESC_PROFILE_BASE ] +then + mkdir -p $ESC_PROFILE_BASE +fi + +cd $ESC_PATH + +#First check if we just want the version + +if [ $DO_SHOW_VERSION == "true" ] + then + #echo "try to run the version command!" + ESC_ARGS="-version" + ./$ESC_EXEC $ESC_ARGS + exit 0 +fi + +# Start up the daemon if it is not running + +isProgRunning $ESCD_BIN + +if [ $LAST_PROG_PID -gt 0 ] +then + false + #echo "escd already running." +else + #echo "escd not running start." + cleanupProfile + ./$ESCD_EXEC --key_Inserted=\"/usr/bin/esc\" --on_Signal=\"/usr/bin/esc\" + exit 0 +fi + +# Now check to see if we wer signaled from the daemon + +if [ $FORCE_START_ESC ] +then + #echo "force start esc." + + #Check to see if esc is already running + + isProgRunning $ESC_BIN + if [ $LAST_PROG_PID -gt 0 ] + then + #echo "attempting a force start but already running ... exit." + exit 0 + fi + #echo "force start esc not running start esc..." + ./$ESC_EXEC + exit 0 +fi + +isProgRunning $ESC_BIN + +if [ $LAST_PROG_PID -gt 0 ] +then + #echo "esc already running." + ./$ESC_EXEC + exit 0 +else + #echo "esc not already running start up and bring up window." + ./$ESC_EXEC & + sleep 4 + #echo "done sleeping bring up esc window." + ./$ESC_EXEC + exit 0 +fi + +exit 0 + + + diff --git a/SOURCES/esc-1.1.0-fix1.patch b/SOURCES/esc-1.1.0-fix1.patch new file mode 100644 index 0000000..c7b631c --- /dev/null +++ b/SOURCES/esc-1.1.0-fix1.patch @@ -0,0 +1,38 @@ +--- ./esc/src/app/xpcom/tray/Makefile.sdk.fix1 2009-04-17 13:39:58.000000000 -0700 ++++ ./esc/src/app/xpcom/tray/Makefile.sdk 2009-04-17 14:18:17.000000000 -0700 +@@ -23,20 +23,20 @@ + include $(CORE_DEPTH)/coreconf/rules.mk + + ifeq ($(OS_ARCH),Linux) +-CXXFLAGS += $(MOZ_GTK_CFLAGS) $(MOZ_GTK2_CFLAGS) $(NOTIFY_CXX_FLAGS) ++CXXFLAGS += $(MOZ_GTK_CFLAGS) $(MOZ_GTK2_CFLAGS) $(NOTIFY_CXX_FLAGS) -fPIC + endif + + + # Change this to point at your Gecko SDK directory. + ifndef GECKO_SDK_PATH +-GECKO_SDK_PATH =/usr/lib/xulrunner-sdk-1.9pre/sdk ++GECKO_SDK_PATH =/usr/lib/xulrunner-sdk-1.9/sdk + endif + GECKO_SDK_INCLUDE_PATH=$(GECKO_SDK_PATH)/include + ifndef GECKO_INCLUDE_PATH +-GECKO_INCLUDE_PATH=/usr/include/xulrunner-sdk-1.9pre ++GECKO_INCLUDE_PATH=/usr/include/xulrunner-sdk-1.9 + endif + ifndef GECKO_BIN_PATH +-GECKO_BIN_PATH=/usr/lib/xulrunner-1.9pre ++GECKO_BIN_PATH=/usr/lib/xulrunner-1.9 + endif + + ifeq ($(OS_ARCH),Darwin) +@@ -148,6 +148,10 @@ + + endif + ++ifeq ($(OS_ARCH),Linux) ++GECKO_LD_LIBS= -L$(GECKO_SDK_PATH)/lib $(GECKO_SDK_PATH)/lib/libxpcomglue_s.a ++endif ++ + + # GCC only define which allows us to not have to #include mozilla-config + # in every .cpp file. If your not using GCC remove this line and add diff --git a/SOURCES/esc-1.1.0-fix10.patch b/SOURCES/esc-1.1.0-fix10.patch new file mode 100644 index 0000000..f6eda05 --- /dev/null +++ b/SOURCES/esc-1.1.0-fix10.patch @@ -0,0 +1,29 @@ +diff -up ./esc/src/app/xpcom/rhCoolKey.cpp.fix10 ./esc/src/app/xpcom/rhCoolKey.cpp +--- ./esc/src/app/xpcom/rhCoolKey.cpp.fix10 2011-07-19 03:47:15.264254844 -0700 ++++ ./esc/src/app/xpcom/rhCoolKey.cpp 2011-07-19 03:47:30.224254842 -0700 +@@ -542,7 +542,7 @@ PRBool rhCoolKey::InitInstance() + static const GREVersionRange greVersion = + { + "1.9", PR_TRUE, +- "2", PR_TRUE ++ "9.9", PR_TRUE + }; + + nsresult rv = GRE_GetGREPathWithProperties(&greVersion, 1, nsnull, 0, xpcom_path, 4096); +diff -up ./esc/src/app/xul/esc/application.ini.fix10 ./esc/src/app/xul/esc/application.ini +--- ./esc/src/app/xul/esc/application.ini.fix10 2011-07-19 03:42:23.368254822 -0700 ++++ ./esc/src/app/xul/esc/application.ini 2011-07-19 03:42:40.531254827 -0700 +@@ -25,11 +25,11 @@ Vendor=RedHat + Name=ESC + ; + ; This field specifies your application's version. This field is optional. +-Version=1.1.0-13 ++Version=1.1.0-15 + ; + ; This field specifies your application's build ID (timestamp). This field is + ; required. +-BuildID=0000001013 ++BuildID=0000001015 + ; + ; This ID is just an example. Every XUL app ought to have it's own unique ID. + ; You can use the microsoft "guidgen" or "uuidgen" tools, or go on diff --git a/SOURCES/esc-1.1.0-fix11.patch b/SOURCES/esc-1.1.0-fix11.patch new file mode 100644 index 0000000..bd6110e --- /dev/null +++ b/SOURCES/esc-1.1.0-fix11.patch @@ -0,0 +1,93 @@ +diff -up ./esc/src/app/xpcom/Makefile.sdk.fix11 ./esc/src/app/xpcom/Makefile.sdk +--- ./esc/src/app/xpcom/Makefile.sdk.fix11 2011-09-16 11:28:43.413286053 -0700 ++++ ./esc/src/app/xpcom/Makefile.sdk 2011-09-16 11:28:43.529286053 -0700 +@@ -108,7 +108,7 @@ endif + ifeq ($(OS_ARCH),Linux) + CPPFLAGS += -fno-rtti \ + -fno-exceptions \ +- -fshort-wchar -fPIC ++ -fshort-wchar -fPIC -std=gnu++0x + GECKO_LD_LIBS=-L$(GECKO_SDK_PATH)/lib $(GECKO_SDK_PATH)/lib/libxpcomglue.a -lnssutil3 -lnss3 -lcrmf -lssl3 -lsmime3 -lplds4 -lplc4 -lnspr4 -lpthread -ldl + endif + +@@ -129,6 +129,10 @@ ifdef ESC_VERSION + GECKO_DEFINES += -DESC_VERSION=$(ESC_VERSION) + endif + ++ifdef GECKO_BIN_PATH ++GECKO_DEFINES += -DGECKO_BIN_PATH=$(GECKO_BIN_PATH) ++endif ++ + NSS_INCLUDE = /usr/include/nss3 + NSPR_INCLUDE = /usr/include/nspr4 + +diff -up ./esc/src/app/xpcom/rhCoolKey.cpp.fix11 ./esc/src/app/xpcom/rhCoolKey.cpp +--- ./esc/src/app/xpcom/rhCoolKey.cpp.fix11 2011-09-16 11:28:43.510286053 -0700 ++++ ./esc/src/app/xpcom/rhCoolKey.cpp 2011-09-16 11:28:43.530286053 -0700 +@@ -538,7 +538,7 @@ PRBool rhCoolKey::InitInstance() + + char xpcom_path[4096]; + xpcom_path[0] = 0; +- ++/* + static const GREVersionRange greVersion = + { + "1.9", PR_TRUE, +@@ -550,6 +550,13 @@ PRBool rhCoolKey::InitInstance() + return PR_FALSE; + } + ++*/ ++ ++ char *grePath = (char *) GETSTRING(GECKO_BIN_PATH); ++ ++ ++ snprintf(xpcom_path,4096,grePath); ++ + char *lib_name =(char *) XPCOM_LIB_NAME ; + + +diff -up ./esc/src/app/xpcom/tray/Makefile.sdk.fix11 ./esc/src/app/xpcom/tray/Makefile.sdk +--- ./esc/src/app/xpcom/tray/Makefile.sdk.fix11 2011-09-16 11:31:59.645286087 -0700 ++++ ./esc/src/app/xpcom/tray/Makefile.sdk 2011-09-16 11:32:10.859286088 -0700 +@@ -23,7 +23,7 @@ include $(CORE_DEPTH)/coreconf/config.mk + include $(CORE_DEPTH)/coreconf/rules.mk + + ifeq ($(OS_ARCH),Linux) +-CXXFLAGS += $(MOZ_GTK_CFLAGS) $(MOZ_GTK2_CFLAGS) $(NOTIFY_CXX_FLAGS) -fPIC ++CXXFLAGS += $(MOZ_GTK_CFLAGS) $(MOZ_GTK2_CFLAGS) $(NOTIFY_CXX_FLAGS) -fPIC -std=gnu++0x + endif + + +diff -up ./esc/src/app/xul/esc/application.ini.fix11 ./esc/src/app/xul/esc/application.ini +--- ./esc/src/app/xul/esc/application.ini.fix11 2011-09-16 11:28:43.511286053 -0700 ++++ ./esc/src/app/xul/esc/application.ini 2011-09-16 11:28:43.532286053 -0700 +@@ -25,11 +25,11 @@ Vendor=RedHat + Name=ESC + ; + ; This field specifies your application's version. This field is optional. +-Version=1.1.0-15 ++Version=1.1.0-16 + ; + ; This field specifies your application's build ID (timestamp). This field is + ; required. +-BuildID=0000001015 ++BuildID=0000001016 + ; + ; This ID is just an example. Every XUL app ought to have it's own unique ID. + ; You can use the microsoft "guidgen" or "uuidgen" tools, or go on +@@ -41,12 +41,12 @@ ID={6380471b-1924-4b48-b652-49f42951af86 + ; This field is required. It specifies the minimum Gecko version that this + ; application requires. Specifying 1.8 matches all releases with a version + ; prefixed by 1.8 (e.g., 1.8a4, 1.8b, 1.8.2). +-MinVersion=1.99 ++MinVersion=6.0.0 + ; + ; This field is optional. It specifies the maximum Gecko version that this + ; application requires. It should be specified if your application uses + ; unfrozen interfaces. Specifying 1.8 matches all releases with a version + ; prefixed by 1.8 (e.g., 1.8a4, 1.8b, 1.8.2). +-MaxVersion=2.99 ++MaxVersion=20.0.0 + + [Shell] diff --git a/SOURCES/esc-1.1.0-fix12.patch b/SOURCES/esc-1.1.0-fix12.patch new file mode 100644 index 0000000..d40be5f --- /dev/null +++ b/SOURCES/esc-1.1.0-fix12.patch @@ -0,0 +1,50 @@ +diff -up ./esc/coreconf/Linux3.1.mk.fix12 ./esc/coreconf/Linux3.1.mk +--- ./esc/coreconf/Linux3.1.mk.fix12 2011-11-28 13:55:27.623816205 -0800 ++++ ./esc/coreconf/Linux3.1.mk 2011-11-28 13:56:11.119536737 -0800 +@@ -0,0 +1,35 @@ ++# BEGIN COPYRIGHT BLOCK ++# This Program is free software; you can redistribute it and/or modify it under ++# the terms of the GNU General Public License as published by the Free Software ++# Foundation; version 2 of the License. ++# ++# This Program is distributed in the hope that it will be useful, but WITHOUT ++# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS ++# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License along with ++# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple ++# Place, Suite 330, Boston, MA 02111-1307 USA. ++# ++# Copyright (C) 2005 Red Hat, Inc. ++# All rights reserved. ++# END COPYRIGHT BLOCK ++ ++# ++# Config stuff for Linux 3.1 (ELF) ++# ++ ++include $(CORE_DEPTH)/coreconf/Linux.mk ++ ++OS_REL_CFLAGS += -DLINUX2_1 ++MKSHLIB = $(CC) -shared -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) ++ifdef BUILD_OPT ++ OPTIMIZER = -O2 ++endif ++ ++ifdef MAPFILE ++ MKSHLIB += -Wl,--version-script,$(MAPFILE) ++endif ++PROCESS_MAP_FILE = grep -v ';-' $(LIBRARY_NAME).def | \ ++ sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@ ++ +diff -up ./esc/src/app/xpcom/rhCoolKey.cpp.fix12 ./esc/src/app/xpcom/rhCoolKey.cpp +--- ./esc/src/app/xpcom/rhCoolKey.cpp.fix12 2011-11-28 19:29:53.894102752 -0800 ++++ ./esc/src/app/xpcom/rhCoolKey.cpp 2011-11-28 19:30:46.003028405 -0800 +@@ -41,7 +41,6 @@ + #include "prlink.h" + #include "prthread.h" + #include "nscore.h" +-#include "nsCopySupport.h" + #include + #include + #include diff --git a/SOURCES/esc-1.1.0-fix13.patch b/SOURCES/esc-1.1.0-fix13.patch new file mode 100644 index 0000000..94f9728 --- /dev/null +++ b/SOURCES/esc-1.1.0-fix13.patch @@ -0,0 +1,273 @@ +diff -up ./esc/coreconf/Linux3.2.mk.fix13 ./esc/coreconf/Linux3.2.mk +--- ./esc/coreconf/Linux3.2.mk.fix13 2012-02-20 18:08:55.637187190 -0800 ++++ ./esc/coreconf/Linux3.2.mk 2012-02-20 18:09:16.296139174 -0800 +@@ -0,0 +1,35 @@ ++# BEGIN COPYRIGHT BLOCK ++# This Program is free software; you can redistribute it and/or modify it under ++# the terms of the GNU General Public License as published by the Free Software ++# Foundation; version 2 of the License. ++# ++# This Program is distributed in the hope that it will be useful, but WITHOUT ++# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS ++# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License along with ++# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple ++# Place, Suite 330, Boston, MA 02111-1307 USA. ++# ++# Copyright (C) 2005 Red Hat, Inc. ++# All rights reserved. ++# END COPYRIGHT BLOCK ++ ++# ++# Config stuff for Linux 3.2 (ELF) ++# ++ ++include $(CORE_DEPTH)/coreconf/Linux.mk ++ ++OS_REL_CFLAGS += -DLINUX2_1 ++MKSHLIB = $(CC) -shared -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) ++ifdef BUILD_OPT ++ OPTIMIZER = -O2 ++endif ++ ++ifdef MAPFILE ++ MKSHLIB += -Wl,--version-script,$(MAPFILE) ++endif ++PROCESS_MAP_FILE = grep -v ';-' $(LIBRARY_NAME).def | \ ++ sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@ ++ +diff -up ./esc/src/app/xpcom/Makefile.sdk.fix13 ./esc/src/app/xpcom/Makefile.sdk +--- ./esc/src/app/xpcom/Makefile.sdk.fix13 2012-02-20 18:01:49.522177961 -0800 ++++ ./esc/src/app/xpcom/Makefile.sdk 2012-02-20 18:01:49.526177952 -0800 +@@ -35,7 +35,12 @@ ifndef GECKO_BIN_PATH + GECKO_BIN_PATH=/usr/lib/xulrunner-1.9pre + endif + XUL_FRAMEWORK_BIN_PATH=$(GECKO_BIN_PATH) +- ++ifndef GECKO_IDL_PATH ++GECKO_IDL_PATH=/usr/share/idl/xulrunner-2 ++endif ++ifndef PYTHON_BIN_PATH ++PYTHON_BIN=python ++endif + + ifeq ($(OS_ARCH),Darwin) + ifndef GECKO_SDK_PATH +@@ -190,13 +195,14 @@ endif + all:: export libs + + libs:: +- $(GECKO_BIN_PATH)/xpidl -v -I $(GECKO_SDK_PATH)/idl -I $(NSPR_INCLUDE) -m header rhIKeyNotify.idl + +- $(GECKO_BIN_PATH)/xpidl -v -I $(GECKO_SDK_PATH)/idl -I $(NSPR_INCLUDE) -m typelib rhIKeyNotify.idl ++ $(PYTHON_BIN) $(GECKO_SDK_PATH)/bin/header.py --cachedir /tmp -o rhIKeyNotify.h -I $(GECKO_IDL_PATH) -I $(NSPR_INCLUDE) rhIKeyNotify.idl ++ ++ $(PYTHON_BIN) $(GECKO_SDK_PATH)/bin/typelib.py --cachedir /tmp -o rhIKeyNotify.xpt -I $(GECKO_IDL_PATH) -I $(NSPR_INCLUDE) rhIKeyNotify.idl + +- $(GECKO_BIN_PATH)/xpidl -v -I $(GECKO_SDK_PATH)/idl -I $(NSPR_INCLUDE) -m header rhICoolKey.idl ++ $(PYTHON_BIN) $(GECKO_SDK_PATH)/bin/header.py --cachedir /tmp -o rhICoolKey.h -I $(GECKO_IDL_PATH) -I $(NSPR_INCLUDE) rhICoolKey.idl + +- $(GECKO_BIN_PATH)/xpidl -v -I $(GECKO_SDK_PATH)/idl -I $(NSPR_INCLUDE) -m typelib rhICoolKey.idl ++ $(PYTHON_BIN) $(GECKO_SDK_PATH)/bin/typelib.py --cachedir /tmp -o rhICoolKey.xpt -I $(GECKO_IDL_PATH) -I $(NSPR_INCLUDE) rhICoolKey.idl + + ifeq ($(OS_ARCH),Darwin) + $(CXX) $(CPPFLAGS) -c -o $(OBJECT) $(GECKO_CONFIG_INCLUDE) $(GECKO_DEFINES) $(GECKO_INCLUDES) $(COOL_INCLUDES) $(CXXFLAGS) $(FILES) +diff -up ./esc/src/app/xpcom/rhCoolKey.cpp.fix13 ./esc/src/app/xpcom/rhCoolKey.cpp +--- ./esc/src/app/xpcom/rhCoolKey.cpp.fix13 2012-02-20 18:01:49.524177956 -0800 ++++ ./esc/src/app/xpcom/rhCoolKey.cpp 2012-02-20 18:01:49.526177952 -0800 +@@ -98,6 +98,7 @@ static PRLogModuleInfo *coolKeyLog = PR_ + + rhCoolKey *single = NULL; + ++ + class CoolKeyShutdownObserver : public nsIObserver + { + public: +@@ -364,9 +365,9 @@ SECStatus rhCoolKey::badCertHandler(void + GetTStamp(tBuff,56),err,host,port) + ); + +- PRBool isTemporaryOverride = PR_FALSE; ++ bool isTemporaryOverride = PR_FALSE; + PRUint32 overrideBits = 0; +- PRBool overrideResult = PR_FALSE; ++ bool overrideResult = PR_FALSE; + + // Use the nsICertOverrideService to see if we have + // previously trusted this certificate. +@@ -554,14 +555,14 @@ PRBool rhCoolKey::InitInstance() + char *grePath = (char *) GETSTRING(GECKO_BIN_PATH); + + +- snprintf(xpcom_path,4096,grePath); ++ snprintf(xpcom_path,4096,"%s%s",grePath,"libxpcom.so"); + + char *lib_name =(char *) XPCOM_LIB_NAME ; + + + PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::xpcom_path %s \n",GetTStamp(tBuff,56),xpcom_path)); + +- XPCOMGlueStartup(xpcom_path); ++ XPCOMGlueStartup("/usr/lib/xulrunner-2/libxpcom.so"); + + nssComponent + = do_GetService(PSM_COMPONENT_CONTRACTID); +@@ -1309,7 +1310,7 @@ NS_IMETHODIMP rhCoolKey::GetCoolKeyStatu + /* boolean GetCoolKeyIsReallyCoolKey (in unsigned long aKeyType, in string aKeyID); */ + + +-NS_IMETHODIMP rhCoolKey::GetCoolKeyIsReallyCoolKey(PRUint32 aKeyType, const char *aKeyID, PRBool *_retval) ++NS_IMETHODIMP rhCoolKey::GetCoolKeyIsReallyCoolKey(PRUint32 aKeyType, const char *aKeyID, bool *_retval) + { + char tBuff[56]; + PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::GetCoolKeyIsReallyCoolKey thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); +@@ -1328,7 +1329,7 @@ NS_IMETHODIMP rhCoolKey::GetCoolKeyIsRea + } + + /* long GetCoolKeyGetAppletVer (in unsigned long aKeyType, in string aKeyID, in boolean aIsMajor); */ +-NS_IMETHODIMP rhCoolKey::GetCoolKeyGetAppletVer(PRUint32 aKeyType, const char *aKeyID, PRBool aIsMajor, PRInt32 *_retval) ++NS_IMETHODIMP rhCoolKey::GetCoolKeyGetAppletVer(PRUint32 aKeyType, const char *aKeyID, bool aIsMajor, PRInt32 *_retval) + { + char tBuff[56]; + PR_LOG(coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::GetCoolKeyAppletVer thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); +@@ -1344,7 +1345,7 @@ NS_IMETHODIMP rhCoolKey::GetCoolKeyGetAp + + /* boolean rhCoolKeyIsEnrolled (in unsigned long aKeyType, in string aKeyID); */ + +-NS_IMETHODIMP rhCoolKey::GetCoolKeyIsEnrolled(PRUint32 aKeyType, const char *aKeyID, PRBool *_retval) ++NS_IMETHODIMP rhCoolKey::GetCoolKeyIsEnrolled(PRUint32 aKeyType, const char *aKeyID, bool *_retval) + { + char tBuff[56]; + PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::RhCoolKeyIsEnrolled thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); +@@ -1586,7 +1587,7 @@ NS_IMETHODIMP rhCoolKey::GetCoolKeyIssue + } + + /* boolean SetCoolKeyConfigValue (in string aName, in string aValue); */ +-NS_IMETHODIMP rhCoolKey::SetCoolKeyConfigValue(const char *aName, const char *aValue, PRBool *_retval) ++NS_IMETHODIMP rhCoolKey::SetCoolKeyConfigValue(const char *aName, const char *aValue, bool *_retval) + { + char tBuff[56]; + PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::SetCoolKeyConfigValue thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); +@@ -1620,7 +1621,7 @@ NS_IMETHODIMP rhCoolKey::GetCoolKeyConfi + + /* boolean rhCoolKeyRequiresAuthentication (in unsigned long aKeyType, in string aKeyID); */ + +-NS_IMETHODIMP rhCoolKey::GetCoolKeyRequiresAuthentication(PRUint32 aKeyType, const char *aKeyID, PRBool *_retval) ++NS_IMETHODIMP rhCoolKey::GetCoolKeyRequiresAuthentication(PRUint32 aKeyType, const char *aKeyID, bool *_retval) + { + char tBuff[56]; + PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::RhCoolKeyRequiresAuthentication thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); +@@ -1640,7 +1641,7 @@ NS_IMETHODIMP rhCoolKey::GetCoolKeyRequi + + /* boolean rhGetCoolKeyIsAuthenticated (in unsigned long aKeyType, in string aKeyID); */ + +-NS_IMETHODIMP rhCoolKey::GetCoolKeyIsAuthenticated(PRUint32 aKeyType, const char *aKeyID, PRBool *_retval) ++NS_IMETHODIMP rhCoolKey::GetCoolKeyIsAuthenticated(PRUint32 aKeyType, const char *aKeyID, bool *_retval) + { + char tBuff[56]; + PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::RhGetCoolKeyIsAuthenticated thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); +@@ -1660,7 +1661,7 @@ NS_IMETHODIMP rhCoolKey::GetCoolKeyIsAut + + /* boolean rhAuthenticateCoolKey (in unsigned long aKeyType, in string aKeyID, in string aPIN); */ + +-NS_IMETHODIMP rhCoolKey::AuthenticateCoolKey(PRUint32 aKeyType, const char *aKeyID, const char *aPIN, PRBool *_retval) ++NS_IMETHODIMP rhCoolKey::AuthenticateCoolKey(PRUint32 aKeyType, const char *aKeyID, const char *aPIN, bool *_retval) + { + char tBuff[56]; + PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::RhAuthenticateCoolKey thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); +diff -up ./esc/src/app/xpcom/tray/Makefile.sdk.fix13 ./esc/src/app/xpcom/tray/Makefile.sdk +--- ./esc/src/app/xpcom/tray/Makefile.sdk.fix13 2012-02-20 18:01:49.522177961 -0800 ++++ ./esc/src/app/xpcom/tray/Makefile.sdk 2012-02-20 18:01:49.526177952 -0800 +@@ -39,6 +39,15 @@ ifndef GECKO_BIN_PATH + GECKO_BIN_PATH=/usr/lib/xulrunner-1.9 + endif + ++ifndef GECKO_IDL_PATH ++GECKO_IDL_PATH=/usr/share/idl/xulrunner-2 ++endif ++ ++ifndef PYTHON_BIN_PATH ++PYTHON_BIN=python ++endif ++ ++ + ifeq ($(OS_ARCH),Darwin) + ifndef GECKO_SDK_PATH + GECKO_SDK_PATH =/Users/jmagne/Desktop/gecko-sdk-mac-universal +@@ -220,13 +229,14 @@ all:: export libs + + libs:: + echo "PPC_BUILD $(PPC_BUILD)" +- $(GECKO_BIN_PATH)/xpidl -I $(GECKO_SDK_PATH)/idl -I $(NSPR_INCLUDE) -m header rhITray.idl + +- $(GECKO_BIN_PATH)/xpidl -I $(GECKO_SDK_PATH)/idl -I $(NSPR_INCLUDE) -m typelib rhITray.idl ++ $(PYTHON_BIN) $(GECKO_SDK_PATH)/bin/header.py --cachedir=/tmp -o rhITray.h -I $(GECKO_IDL_PATH) -I $(NSPR_INCLUDE) rhITray.idl ++ ++ $(PYTHON_BIN) $(GECKO_SDK_PATH)/bin/typelib.py --cachedir=/tmp -o rhITray.xpt -I $(GECKO_IDL_PATH) -I $(NSPR_INCLUDE) rhITray.idl + +- $(GECKO_BIN_PATH)/xpidl -I $(GECKO_SDK_PATH)/idl -I $(NSPR_INCLUDE) -m header rhITrayWindNotify.idl ++ $(PYTHON_BIN) $(GECKO_SDK_PATH)/bin/header.py --cachedir=/tmp -o rhITrayWindNotify.h -I $(GECKO_IDL_PATH) -I $(NSPR_INCLUDE) rhITrayWindNotify.idl + +- $(GECKO_BIN_PATH)/xpidl -I $(GECKO_SDK_PATH)/idl -I $(NSPR_INCLUDE) -m typelib rhITrayWindNotify.idl ++ $(PYTHON_BIN) $(GECKO_SDK_PATH)/bin/typelib.py --cachedir=/tmp -o rhITrayWindNotify.xpt -I $(GECKO_IDL_PATH) -I $(NSPR_INCLUDE) rhITrayWindNotify.idl + + ifeq ($(OS_ARCH),Darwin) + $(CXX) $(CPPFLAGS) -c -o $(OBJECT) $(GECKO_CONFIG_INCLUDE) $(GECKO_DEFINES) $(GECKO_INCLUDES) $(COOL_INCLUDES) $(CXXFLAGS) $(FILES) +diff -up ./esc/src/app/xpcom/tray/rhLinuxTray.cpp.fix13 ./esc/src/app/xpcom/tray/rhLinuxTray.cpp +--- ./esc/src/app/xpcom/tray/rhLinuxTray.cpp.fix13 2012-02-20 18:01:49.512177984 -0800 ++++ ./esc/src/app/xpcom/tray/rhLinuxTray.cpp 2012-02-20 18:01:49.526177952 -0800 +@@ -215,7 +215,7 @@ NS_IMETHODIMP rhTray::Show(nsIBaseWindow + return NS_OK; + } + +-NS_IMETHODIMP rhTray::IsInitializedAlready(PRBool *_retval) ++NS_IMETHODIMP rhTray::IsInitializedAlready(bool *_retval) + { + *_retval = 0; + +@@ -749,7 +749,7 @@ void rhTray::NotifyTrayWindListeners(PRU + std::list< nsCOMPtr >::const_iterator it; + for(it=gTrayWindNotifyListeners.begin(); it!=gTrayWindNotifyListeners.end(); ++it) { + +- PRBool claimed = 0; ++ bool claimed = 0; + + PR_LOG( trayLog, PR_LOG_DEBUG, ("%s NotifyTrayWindListeners about to notify \n",GetTStamp(tBuff,56))); + ((rhITrayWindNotify *) (*it))->RhTrayWindEventNotify(aEvent,aEventData, aKeyData, aData1, aData2, &claimed); +diff -up ./esc/src/app/xul/esc/application.ini.fix13 ./esc/src/app/xul/esc/application.ini +--- ./esc/src/app/xul/esc/application.ini.fix13 2012-02-20 18:01:49.523177958 -0800 ++++ ./esc/src/app/xul/esc/application.ini 2012-02-20 18:01:49.527177950 -0800 +@@ -25,7 +25,7 @@ Vendor=RedHat + Name=ESC + ; + ; This field specifies your application's version. This field is optional. +-Version=1.1.0-16 ++Version=1.1.0-15 + ; + ; This field specifies your application's build ID (timestamp). This field is + ; required. +diff -up ./esc/src/app/xul/esc/chrome/content/esc/ESC.js.fix13 ./esc/src/app/xul/esc/chrome/content/esc/ESC.js +--- ./esc/src/app/xul/esc/chrome/content/esc/ESC.js.fix13 2012-02-20 18:01:49.514177980 -0800 ++++ ./esc/src/app/xul/esc/chrome/content/esc/ESC.js 2012-02-20 18:01:49.527177950 -0800 +@@ -118,7 +118,7 @@ jsNotify.prototype = { + if(!iid.equals(Components.interfaces.rhIKeyNotify) && + !iid.equals(Components.interfaces.nsISupports)) + { +- MyAlert(getBundleString("errorJsNotifyInterface")); ++ //MyAlert(getBundleString("errorJsNotifyInterface")); + throw Components.results.NS_ERROR_NO_INTERFACE; + } + return this; +diff -up ./esc/src/app/xul/esc/chrome/content/esc/TRAY.js.fix13 ./esc/src/app/xul/esc/chrome/content/esc/TRAY.js +--- ./esc/src/app/xul/esc/chrome/content/esc/TRAY.js.fix13 2012-02-20 18:01:49.515177978 -0800 ++++ ./esc/src/app/xul/esc/chrome/content/esc/TRAY.js 2012-02-20 18:01:49.528177948 -0800 +@@ -49,7 +49,7 @@ jsWindNotify.prototype = { + if(!iid.equals(Components.interfaces.rhITrayWindNotify) && + !iid.equals(Components.interfaces.nsISupports)) + { +- MyAlert(getBundleString("errorJsNotifyInterface")); ++ //MyAlert(getBundleString("errorJsNotifyInterface")); + throw Components.results.NS_ERROR_NO_INTERFACE; + } + return this; diff --git a/SOURCES/esc-1.1.0-fix14.patch b/SOURCES/esc-1.1.0-fix14.patch new file mode 100644 index 0000000..f3c048d --- /dev/null +++ b/SOURCES/esc-1.1.0-fix14.patch @@ -0,0 +1,458 @@ +diff -up ./esc/coreconf/Linux3.3.mk.fix14 ./esc/coreconf/Linux3.3.mk +--- ./esc/coreconf/Linux3.3.mk.fix14 2012-05-10 15:09:37.298143842 -0700 ++++ ./esc/coreconf/Linux3.3.mk 2012-05-10 15:09:37.298143842 -0700 +@@ -0,0 +1,35 @@ ++# BEGIN COPYRIGHT BLOCK ++# This Program is free software; you can redistribute it and/or modify it under ++# the terms of the GNU General Public License as published by the Free Software ++# Foundation; version 2 of the License. ++# ++# This Program is distributed in the hope that it will be useful, but WITHOUT ++# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS ++# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License along with ++# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple ++# Place, Suite 330, Boston, MA 02111-1307 USA. ++# ++# Copyright (C) 2005 Red Hat, Inc. ++# All rights reserved. ++# END COPYRIGHT BLOCK ++ ++# ++# Config stuff for Linux 3.3 (ELF) ++# ++ ++include $(CORE_DEPTH)/coreconf/Linux.mk ++ ++OS_REL_CFLAGS += -DLINUX2_1 ++MKSHLIB = $(CC) -shared -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) ++ifdef BUILD_OPT ++ OPTIMIZER = -O2 ++endif ++ ++ifdef MAPFILE ++ MKSHLIB += -Wl,--version-script,$(MAPFILE) ++endif ++PROCESS_MAP_FILE = grep -v ';-' $(LIBRARY_NAME).def | \ ++ sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@ ++ +diff -up ./esc/coreconf/Linux3.4.mk.fix14 ./esc/coreconf/Linux3.4.mk +--- ./esc/coreconf/Linux3.4.mk.fix14 2012-05-10 15:09:37.298143842 -0700 ++++ ./esc/coreconf/Linux3.4.mk 2012-05-10 15:09:37.298143842 -0700 +@@ -0,0 +1,35 @@ ++# BEGIN COPYRIGHT BLOCK ++# This Program is free software; you can redistribute it and/or modify it under ++# the terms of the GNU General Public License as published by the Free Software ++# Foundation; version 2 of the License. ++# ++# This Program is distributed in the hope that it will be useful, but WITHOUT ++# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS ++# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License along with ++# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple ++# Place, Suite 330, Boston, MA 02111-1307 USA. ++# ++# Copyright (C) 2005 Red Hat, Inc. ++# All rights reserved. ++# END COPYRIGHT BLOCK ++ ++# ++# Config stuff for Linux 3.4 (ELF) ++# ++ ++include $(CORE_DEPTH)/coreconf/Linux.mk ++ ++OS_REL_CFLAGS += -DLINUX2_1 ++MKSHLIB = $(CC) -shared -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) ++ifdef BUILD_OPT ++ OPTIMIZER = -O2 ++endif ++ ++ifdef MAPFILE ++ MKSHLIB += -Wl,--version-script,$(MAPFILE) ++endif ++PROCESS_MAP_FILE = grep -v ';-' $(LIBRARY_NAME).def | \ ++ sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@ ++ +diff -up ./esc/coreconf/Linux3.5.mk.fix14 ./esc/coreconf/Linux3.5.mk +--- ./esc/coreconf/Linux3.5.mk.fix14 2012-05-10 15:09:37.299143830 -0700 ++++ ./esc/coreconf/Linux3.5.mk 2012-05-10 15:09:37.298143842 -0700 +@@ -0,0 +1,35 @@ ++# BEGIN COPYRIGHT BLOCK ++# This Program is free software; you can redistribute it and/or modify it under ++# the terms of the GNU General Public License as published by the Free Software ++# Foundation; version 2 of the License. ++# ++# This Program is distributed in the hope that it will be useful, but WITHOUT ++# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS ++# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License along with ++# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple ++# Place, Suite 330, Boston, MA 02111-1307 USA. ++# ++# Copyright (C) 2005 Red Hat, Inc. ++# All rights reserved. ++# END COPYRIGHT BLOCK ++ ++# ++# Config stuff for Linux 3.5 (ELF) ++# ++ ++include $(CORE_DEPTH)/coreconf/Linux.mk ++ ++OS_REL_CFLAGS += -DLINUX2_1 ++MKSHLIB = $(CC) -shared -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) ++ifdef BUILD_OPT ++ OPTIMIZER = -O2 ++endif ++ ++ifdef MAPFILE ++ MKSHLIB += -Wl,--version-script,$(MAPFILE) ++endif ++PROCESS_MAP_FILE = grep -v ';-' $(LIBRARY_NAME).def | \ ++ sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@ ++ +diff -up ./esc/src/app/xpcom/Makefile.sdk.fix14 ./esc/src/app/xpcom/Makefile.sdk +--- ./esc/src/app/xpcom/Makefile.sdk.fix14 2012-05-10 15:09:37.293143904 -0700 ++++ ./esc/src/app/xpcom/Makefile.sdk 2012-05-10 15:25:17.138394220 -0700 +@@ -106,15 +106,14 @@ endif + endif + + ifeq ($(OS_ARCH),Darwin) +-GECKO_LD_LIBS=-L$(GECKO_SDK_PATH)/lib -W1, $(GECKO_SDK_PATH)/lib/libxpcomglue.a -L$(XUL_FRAMEWORK_BIN_PATH) -lnss3 -lssl3 -lsoftokn3 -lplds4 -lplc4 -lnssutil3 ++GECKO_LD_LIBS=-L$(GECKO_SDK_PATH)/lib -W1, $(GECKO_SDK_PATH)/lib/libxpcomglue.a -L$(XUL_FRAMEWORK_BIN_PATH) -lnss3 -lssl3 -lsoftokn3 -lplds4 -lplc4 -lnssutil3 + endif + +- + ifeq ($(OS_ARCH),Linux) +-CPPFLAGS += -fno-rtti \ +- -fno-exceptions \ +- -fshort-wchar -fPIC -std=gnu++0x +-GECKO_LD_LIBS=-L$(GECKO_SDK_PATH)/lib $(GECKO_SDK_PATH)/lib/libxpcomglue.a -lnssutil3 -lnss3 -lcrmf -lssl3 -lsmime3 -lplds4 -lplc4 -lnspr4 -lpthread -ldl ++CPPFLAGS += -g -fno-rtti \ ++ -DXPCOM_GLUE_USE_NSPR -fno-exceptions \ ++ -fshort-wchar -fPIC -std=gnu++0x ++GECKO_LD_LIBS=-L$(GECKO_SDK_PATH)/lib -lnssutil3 -lnss3 -lcrmf -lssl3 -lsmime3 -lplds4 -lplc4 -lnspr4 -lpthread -ldl -L$(GECKO_SDK_PATH)/lib -lxpcomglue_s -lxpcom + endif + + ifeq ($(OS_ARCH),WINNT) +@@ -128,15 +127,15 @@ endif + # #include "mozilla-config.h" to each of your .cpp files. + #GECKO_CONFIG_INCLUDE = -include mozilla-config.h + +-GECKO_DEFINES = -DXPCOM_GLUE -DMOZILLA_CLIENT ++GECKO_DEFINES = -DXPCOM_GLUE -DMOZILLA_CLIENT + + ifdef ESC_VERSION + GECKO_DEFINES += -DESC_VERSION=$(ESC_VERSION) + endif + +-ifdef GECKO_BIN_PATH +-GECKO_DEFINES += -DGECKO_BIN_PATH=$(GECKO_BIN_PATH) +-endif ++#ifdef GECKO_BIN_PATH ++#GECKO_DEFINES += -DGECKO_BIN_PATH=$(GECKO_BIN_PATH) ++#endif + + NSS_INCLUDE = /usr/include/nss3 + NSPR_INCLUDE = /usr/include/nspr4 +@@ -162,7 +161,7 @@ COOL_LDFLAGS += -lsystemStubs -framewor + endif + + GECKO_LDFLAGS= -lnspr4 \ +- -lplds4 -lplc4 -ldl -lpthread -Wl -z \ ++ -lplds4 -lplc4 -ldl -lpthread -z \ + $(GECKO_LD_LIBS) + + ifeq ($(OS_ARCH),WINNT) +@@ -215,7 +214,7 @@ ifeq ($(OS_ARCH),Linux) + + $(CXX) $(CPPFLAGS) -shared -o $(TARGET) $(OBJECT) $(GECKO_DEFINES) $(GECKO_INCLUDES) $(GECKO_LDFLAGS) $(COOL_LDFLAGS) + chmod +x $(TARGET) +- strip $(TARGET) ++ #strip $(TARGET) + endif + + ifeq ($(OS_ARCH),WINNT) +diff -up ./esc/src/app/xpcom/rhCoolKey.cpp.fix14 ./esc/src/app/xpcom/rhCoolKey.cpp +--- ./esc/src/app/xpcom/rhCoolKey.cpp.fix14 2012-05-10 15:09:37.294143891 -0700 ++++ ./esc/src/app/xpcom/rhCoolKey.cpp 2012-05-10 15:09:37.300143818 -0700 +@@ -16,7 +16,6 @@ + * END COPYRIGHT BLOCK **/ + + #define FORCE_PR_LOG 1 +- + #include + #include "rhCoolKey.h" + #include "CoolKey.h" +@@ -34,7 +33,7 @@ + #include "nsIPrefBranch.h" + #include "nsIPrefService.h" + #include "nsCOMPtr.h" +-#include "nsIProxyObjectManager.h" ++#include "nsThreadUtils.h" + #include "nsIObserver.h" + #include "nsIObserverService.h" + #include "nsXPCOMGlue.h" +@@ -91,6 +90,7 @@ std::listrhCoolKey::gASCAv + std::list< nsCOMPtr > rhCoolKey::gNotifyListeners; + + PRLock* rhCoolKey::certCBLock=NULL; ++PRLock* rhCoolKey::eventLock= NULL; + + PRBool rhCoolKey::gAutoEnrollBlankTokens = PR_FALSE; + +@@ -162,6 +162,70 @@ ASCCalcBase64DecodedLength(const char *a + + return ((numValidChars / 4) * 3) - numEqualSigns; + } ++class CoolKeyResultTask : public nsRunnable ++{ ++public: ++ ~CoolKeyResultTask() { ++ ++ char tBuff[56]; ++ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s ~CoolKeyResultTask thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); ++ ++ if (mKeyID) { ++ free(mKeyID); ++ } ++ ++ if (mStrData) { ++ free(mStrData); ++ } ++ ++ } ++ ++ CoolKeyResultTask(unsigned long keyType, const char *keyID, unsigned long keyState, ++ unsigned long data, const char *strData, rhICoolKey *listener) ++ : mKeyType(keyType), mKeyState(keyState), ++ mData(data), mListener(listener) ++ { ++ ++ mStrData = NULL; ++ mKeyID = NULL; ++ ++ MOZ_ASSERT(!NS_IsMainThread()); ++ ++ if (keyID) { ++ mKeyID = strdup(keyID); ++ } ++ ++ if (strData) { ++ mStrData = strdup(strData); ++ } ++ ++ char tBuff[56]; ++ ++ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s CoolKeyResultTask::CoolKeyResultTask thread: %p keyID %s \n",GetTStamp(tBuff,56),PR_GetCurrentThread(),mKeyID)); ++ ++ } ++ ++ ++ NS_IMETHOD Run() { ++ MOZ_ASSERT(NS_IsMainThread()); ++ ++ char tBuff[56]; ++ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s CoolKeyResultTask::Run thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); ++ ++ if (mListener != NULL) { ++ mListener->RhNotifyKeyStateChange(mKeyType, mKeyID, mKeyState, ++ mData, mStrData); ++ } ++ } ++ ++private: ++ unsigned long mKeyType; ++ char *mKeyID; ++ unsigned long mKeyState; ++ unsigned long mData; ++ char *mStrData; ++ rhICoolKey *mListener; ++}; + + unsigned int + ASCCalcBase64EncodedLength(unsigned int aDataLength) +@@ -200,6 +264,14 @@ rhCoolKey::rhCoolKey() + exit(1); + } + ++ eventLock = PR_NewLock(); ++ ++ if(!eventLock) { ++ PR_LOG( coolKeyLog, PR_LOG_ERROR, ("%s Failed to create event lock exiting! \n", GetTStamp(tBuff,56))); ++ exit(1); ++ } ++ ++ + PRBool res = InitInstance(); + + if(res == PR_FALSE) +@@ -221,6 +293,10 @@ rhCoolKey::~rhCoolKey() + if(certCBLock) { + PR_DestroyLock(certCBLock); + } ++ ++ if(eventLock) { ++ PR_DestroyLock(eventLock); ++ } + } + + void rhCoolKey::ShutDownInstance() +@@ -255,8 +331,17 @@ HRESULT rhCoolKey::Dispatch( rhICoolKey + unsigned long keyType, const char *keyID, unsigned long keyState, + unsigned long data, const char *strData) + { +- return listener->RhNotifyKeyStateChange(keyType,keyID, keyState, +- data, strData); ++ ++ char tBuff[56]; ++ ++ PR_Lock(eventLock); ++ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::Dispatch: thead: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); ++ nsCOMPtr result = new CoolKeyResultTask(keyType, keyID,keyState, data, strData, listener); ++ ++ NS_DispatchToMainThread(result); ++ ++ PR_Unlock(eventLock); ++ return 1; + } + + HRESULT rhCoolKey::Reference( rhICoolKey *listener ) +@@ -536,34 +621,6 @@ PRBool rhCoolKey::InitInstance() + + PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::InitInstance %p \n",GetTStamp(tBuff,56),this)); + +- char xpcom_path[4096]; +- xpcom_path[0] = 0; +-/* +- static const GREVersionRange greVersion = +- { +- "1.9", PR_TRUE, +- "9.9", PR_TRUE +- }; +- +- nsresult rv = GRE_GetGREPathWithProperties(&greVersion, 1, nsnull, 0, xpcom_path, 4096); +- if (NS_FAILED(rv)) { +- return PR_FALSE; +- } +- +-*/ +- +- char *grePath = (char *) GETSTRING(GECKO_BIN_PATH); +- +- +- snprintf(xpcom_path,4096,"%s%s",grePath,"libxpcom.so"); +- +- char *lib_name =(char *) XPCOM_LIB_NAME ; +- +- +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::xpcom_path %s \n",GetTStamp(tBuff,56),xpcom_path)); +- +- XPCOMGlueStartup("/usr/lib/xulrunner-2/libxpcom.so"); +- + nssComponent + = do_GetService(PSM_COMPONENT_CONTRACTID); + +@@ -640,23 +697,8 @@ PRBool rhCoolKey::InitInstance() + + rhICoolKey* rhCoolKey::CreateProxyObject() + { +- char tBuff[56]; +- rhICoolKey *proxyObject = NULL; +- +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::CreateProxyObject: \n",GetTStamp(tBuff,56))); +- +- nsCOMPtr manager = +- do_GetService(NS_XPCOMPROXY_CONTRACTID); +- +- PR_ASSERT(manager); +- +- +- manager->GetProxyForObject(NULL, NS_GET_IID(rhICoolKey), this, NS_PROXY_SYNC | NS_PROXY_ALWAYS, (void**)&proxyObject); +- +- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::CreateProxyObject: original: %p proxy %p \n",GetTStamp(tBuff,56),this,proxyObject)); +- +- return proxyObject; +- ++ // Now we are using nsRunnable, no more proxy object manager. ++ return this; + } + + CoolKeyNode* rhCoolKey::GetCoolKeyInfo(unsigned long aKeyType, const char * aKeyID) +diff -up ./esc/src/app/xpcom/rhCoolKey.h.fix14 ./esc/src/app/xpcom/rhCoolKey.h +--- ./esc/src/app/xpcom/rhCoolKey.h.fix14 2012-05-10 15:09:37.274144142 -0700 ++++ ./esc/src/app/xpcom/rhCoolKey.h 2012-05-10 15:09:37.300143818 -0700 +@@ -120,6 +120,7 @@ protected: + static std::list< nsCOMPtr > gNotifyListeners; + + static PRLock* certCBLock; ++ static PRLock* eventLock; + + rhICoolKey* mProxy; + +diff -up ./esc/src/app/xul/esc/application.ini.fix14 ./esc/src/app/xul/esc/application.ini +--- ./esc/src/app/xul/esc/application.ini.fix14 2012-05-10 15:09:37.295143878 -0700 ++++ ./esc/src/app/xul/esc/application.ini 2012-05-10 15:09:37.300143818 -0700 +@@ -25,11 +25,11 @@ Vendor=RedHat + Name=ESC + ; + ; This field specifies your application's version. This field is optional. +-Version=1.1.0-15 ++Version=1.1.0-16 + ; + ; This field specifies your application's build ID (timestamp). This field is + ; required. +-BuildID=0000001016 ++BuildID=0000001017 + ; + ; This ID is just an example. Every XUL app ought to have it's own unique ID. + ; You can use the microsoft "guidgen" or "uuidgen" tools, or go on +diff -up ./esc/src/app/xul/esc/chrome/content/esc/password.xul.fix14 ./esc/src/app/xul/esc/chrome/content/esc/password.xul +--- ./esc/src/app/xul/esc/chrome/content/esc/password.xul.fix14 2012-05-10 15:09:37.251144429 -0700 ++++ ./esc/src/app/xul/esc/chrome/content/esc/password.xul 2012-05-10 15:09:37.301143805 -0700 +@@ -27,7 +27,6 @@ + + +