rpms/esc/devel esc-1.0.0-escd.patch, NONE, 1.1 esc-1.0.0-escd1.patch, NONE, 1.1 esc, 1.2, 1.3 esc.spec, 1.16, 1.17
fedora-cvs-commits at redhat.com
fedora-cvs-commits at redhat.com
Sat Sep 23 01:08:15 UTC 2006
Author: jmagne
Update of /cvs/dist/rpms/esc/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv8075/devel
Modified Files:
esc esc.spec
Added Files:
esc-1.0.0-escd.patch esc-1.0.0-escd1.patch
Log Message:
auto-import esc-1.0.0-13 on branch devel from esc-1.0.0-13.src.rpm
esc-1.0.0-escd.patch:
Makefile | 2
app/daemon/Makefile | 58 +++
app/daemon/escd.cpp | 384 +++++++++++++++++++++++++
app/daemon/escd.h | 77 +++++
app/daemon/manifest.mn | 43 ++
app/xpcom/Makefile.moz | 1
app/xpcom/rhCoolKey.cpp | 2
app/xpcom/tray/rhLinuxTray.cpp | 1
app/xul/esc/application.ini | 2
app/xul/esc/chrome/content/esc/GenericAuth.js | 24 +
app/xul/esc/chrome/content/esc/GenericAuth.xul | 1
11 files changed, 589 insertions(+), 6 deletions(-)
--- NEW FILE esc-1.0.0-escd.patch ---
--- ./esc/src/app/xpcom/rhCoolKey.cpp.fix14 2006-09-18 20:35:58.000000000 -0700
+++ ./esc/src/app/xpcom/rhCoolKey.cpp 2006-09-18 20:36:09.000000000 -0700
@@ -1339,7 +1339,7 @@
{
PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::GetCoolKeyVersion \n"));
- char *version = "1.0.0-12";
+ char *version = "1.0.0-13";
char *versionVal = (char *) nsMemory::Clone(version,sizeof(char) * strlen(version) + 1);
--- ./esc/src/app/xpcom/Makefile.moz.fix14 2006-09-19 09:51:30.000000000 -0700
+++ ./esc/src/app/xpcom/Makefile.moz 2006-09-18 20:29:30.000000000 -0700
@@ -103,6 +103,7 @@
install::
ifdef DESTDIR
$(NSINSTALL) $(DEPLOY_OBJDIR)/esc/* $(DESTDIR)
+ $(NSINSTALL) $(CORE_DIST)/bin/escd $(DESTDIR)
endif
all:: export libs
--- ./esc/src/app/xpcom/tray/rhLinuxTray.cpp.fix14 2006-09-18 20:39:23.000000000 -0700
+++ ./esc/src/app/xpcom/tray/rhLinuxTray.cpp 2006-09-18 20:39:56.000000000 -0700
@@ -269,7 +269,6 @@
mInitialized = 1;
- notify_icon_hide();
return S_OK;
}
--- ./esc/src/app/daemon/manifest.mn.fix14 2006-09-18 20:23:13.000000000 -0700
+++ ./esc/src/app/daemon/manifest.mn 2006-09-18 20:22:30.000000000 -0700
@@ -0,0 +1,43 @@
+# 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
+
+CORE_DEPTH = ../../..
+
+CORE_DIST= $(CORE_DEPTH)/dist/
+
+SYS_INC= /usr/include
+ifndef MOZ_OFFSET
+MOZ_OFFSET = mozilla-1.7.13
+endif
+
+DEFINES += -I$(SYS_INC)/nspr4 -I$(SYS_INC)/nss3 -I$(SYS_INC)/$(MOZ_OFFSET)/nspr -I$(SYS_INC)/$(MOZ_OFFSET)/nss
+
+CPPFLAGS += $(DEFINES) -g
+
+LDFLAGS += -lstdc++ -L$(CORE_DIST)/$(OBJDIR)/lib -lnss3 -lnspr4 -lssl3 -lckyapplet
+LDFLAGS += -lckymanager -lhttpchunked
+# MODULE public and private header directories are implicitly REQUIRED.
+
+CPPSRCS = \
+ escd.cpp \
+ $(NULL)
+
+# The MODULE is always implicitly required.
+# Listing it here in REQUIRES makes it appear twice in the cc command line.
+REQUIRES = ckymanager nss nspr NssHttpClient
+
+PROGRAM = escd
--- ./esc/src/app/daemon/Makefile.fix14 2006-09-18 20:23:08.000000000 -0700
+++ ./esc/src/app/daemon/Makefile 2006-09-18 20:21:21.000000000 -0700
@@ -0,0 +1,58 @@
+#! gmake
+#
+# ***** 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 *****
+
+
+#######################################################################
+# (1) Include initial platform-independent assignments (MANDATORY). #
+#######################################################################
+
+include manifest.mn
+
+#######################################################################
+# (2) Include "global" configuration information. (OPTIONAL) #
+#######################################################################
+
+include $(CORE_DEPTH)/coreconf/config.mk
+
+#######################################################################
+# (3) Include "component" configuration information. (OPTIONAL) #
+#######################################################################
+
+#######################################################################
+# (4) Include "local" platform-dependent assignments (OPTIONAL). #
+#######################################################################
+
+
+#######################################################################
+# (5) Execute "global" rules. (OPTIONAL) #
+#######################################################################
+
+include $(CORE_DEPTH)/coreconf/rules.mk
+
+#######################################################################
+# (6) Execute "component" rules. (OPTIONAL) #
+#######################################################################
+
+
+
+#######################################################################
+# (7) Execute "local" rules. (OPTIONAL). #
+#######################################################################
+
+
--- ./esc/src/app/daemon/escd.h.fix14 2006-09-18 20:23:00.000000000 -0700
+++ ./esc/src/app/daemon/escd.h 2006-09-18 20:20:46.000000000 -0700
@@ -0,0 +1,77 @@
+/** 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 **/
+
+#ifndef ESC_D_H
+#define ESC_D_H
+#include <string>
+#include <vector>
+#include <signal.h>
+#include "prlock.h"
+
+using namespace std;
+
+#include "CoolKey.h"
+
+#define KEY_INSERTED_CMD "--key_Inserted"
+#define ON_SIGNAL_CMD "--on_Signal"
+class ESC_D
+{
+public:
+
+ ESC_D();
+
+ HRESULT init(int argc, char **argv);
+
+ void cleanup();
+ static string keyInsertedCommand;
+ static string onSignalCommand;
+
+ static void signalHandler(int signal);
+
+ static ESC_D *single;
+
+ PRLock *mDataLock;
+
+ HRESULT launchCommand(string &command);
+
+ private:
+
+ void TokenizeArgument(const string& str,
+ vector<string>& tokens,
+ const string& delimiters = " ");
+
+
+
+ static HRESULT Dispatch( CoolKeyListener *listener,
+ unsigned long keyType, const char *keyID, unsigned long keyState,
+ unsigned long data, const char *strData
+ );
+
+ static HRESULT Reference(CoolKeyListener *listener );
+ static HRESULT Release(CoolKeyListener *listener );
+
+
+ static int commandAlreadyLaunched;
+
+};
+
+
+
+
+
+
+#endif
--- ./esc/src/app/daemon/escd.cpp.fix14 2006-09-18 20:22:52.000000000 -0700
+++ ./esc/src/app/daemon/escd.cpp 2006-09-18 20:19:42.000000000 -0700
@@ -0,0 +1,384 @@
+/** 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 **/
+
+#define FORCE_PR_LOG 1
+#include "escd.h"
+#include <stdio.h>
+#include <unistd.h>
+#include <prlog.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include "pk11func.h"
+
+#define SHELL "/bin/sh"
+#define CORRECT_NUM_ARGS 3
+
+#define SLEEP_INTERVAL 1000000
+
+static PRLogModuleInfo *escDLog = PR_NewLogModule("escDLog");
+
+string ESC_D::keyInsertedCommand("");
+string ESC_D::onSignalCommand("");
+int ESC_D::commandAlreadyLaunched = 0;
+
+string signalCommandArg = "forceStartESC";
+
+ESC_D *ESC_D::single = NULL;
+
+ESC_D::ESC_D()
+{
+ single = this;
+ mDataLock = NULL;
+}
+
+void ESC_D::cleanup()
+{
+ int already = 0;
+ PR_Lock(mDataLock);
+ already = commandAlreadyLaunched;
+ PR_Unlock(mDataLock);
+ if(already)
+ {
+ PR_LOG( escDLog, PR_LOG_ERROR, ("Daemon: Cannot shutdown! Command is already running. \n"));
+
+ return;
+
+ }
+
+ PR_LOG( escDLog, PR_LOG_ERROR, ("Daemon: Attempting to shut down. \n"));
+
+ CoolKeyShutdown();
+
+ if(single)
+ delete single;
+
+ exit(0);
+
+}
+
+HRESULT ESC_D::init(int argc, char **argv)
+{
+ HRESULT result = S_OK;
+
+ PR_LOG( escDLog, PR_LOG_DEBUG, ("Daemon: Nmber of args! %d \n",argc));
+
+
+ for(int i = 0; i < argc ; i++)
+ PR_LOG( escDLog, PR_LOG_DEBUG, ("Argv[%d]: %s \n",i,argv[i]));
+
+ if(argc != CORRECT_NUM_ARGS)
+ {
+ return E_FAIL;
+ }
+
+ mDataLock = PR_NewLock();
+ if (!mDataLock)
+ {
+ PR_LOG( escDLog, PR_LOG_ERROR, ("Cannot create mutex for ESCD! \n"));
+ return E_FAIL;
+ }
+
+ vector<string> arg1Tokens;
+ vector<string> arg2Tokens;
+
+ string argument1 = "";
+ string argument2 = "";
+
+ string delim = "=";
+
+ vector<string>::iterator n, v;
+
+ argument1 = argv[1];
+ argument2 = argv[2];
+
+ TokenizeArgument(argument1,arg1Tokens,delim);
+
+ TokenizeArgument(argument2,arg2Tokens,delim);
+
+ v = arg1Tokens.begin();
+
+ if( v != arg1Tokens.end())
+ {
+ n = v++;
+
+ string name = "";
+ string value = "";
+
+ if(n != arg1Tokens.end())
+ name = (*n);
+
+
+ if(v != arg1Tokens.end())
+ value = (*v);
+
+
+ if(name == KEY_INSERTED_CMD && value.size())
+ {
+ keyInsertedCommand = value;
+
+ PR_LOG( escDLog, PR_LOG_DEBUG, ("Daemon: keyInsertedCommand: %s. \n",keyInsertedCommand.c_str()));
+
+ }
+ }
+
+ vector<string>::iterator n1, v1;
+ v1 = arg2Tokens.begin();
+
+ PR_LOG(escDLog, PR_LOG_ALWAYS, ("Daemon: got v1 \n"));
+
+ if(n1 != arg2Tokens.end())
+ {
+ n1 = v1++;
+ PR_LOG(escDLog, PR_LOG_ALWAYS, ("Daemon: got n1... \n"));
+ string name1 = "";
+ string value1 = "";
+
+ if(n1 != arg2Tokens.end())
+ name1 = (*n1);
+
+ if(v1 != arg2Tokens.end())
+ value1 = (*v1);
+
+ if(name1 == ON_SIGNAL_CMD && value1.size())
+ {
+ onSignalCommand = value1;
+ PR_LOG( escDLog, PR_LOG_DEBUG, ("Daemon: onSignalCommand: %s. \n",onSignalCommand.c_str()));
+ }
+
+ }
+
+
+ CoolKeySetCallbacks(Dispatch,Reference, Release,NULL ,NULL);
+ CoolKeyRegisterListener((CoolKeyListener *) this);
+
+ struct sigaction sigESCD;
+ /* install the signal handler */
+
+ sigemptyset(&(sigESCD.sa_mask));
+ sigaddset(&(sigESCD.sa_mask),SIGUSR1);
+ sigaddset(&(sigESCD.sa_mask),SIGTERM);
+ pthread_sigmask(SIG_UNBLOCK,&(sigESCD.sa_mask),NULL);
+ sigESCD.sa_handler = ESC_D::signalHandler;
+ //sigESCD.sa_mask = 0;
+ sigESCD.sa_flags = 0;
+ sigESCD.sa_restorer = NULL;
+
+ sigaction(SIGUSR1,&sigESCD,NULL);
+ sigaction(SIGTERM,&sigESCD,NULL);
+
+ result = S_OK;
+
+ return result;
+}
+
+HRESULT ESC_D::Dispatch( CoolKeyListener *listener,
+ unsigned long keyType, const char *keyID, unsigned long keyState,
+ unsigned long data, const char *strData
+ )
+{
+ HRESULT result = 1;
+
+ if(keyState == eCKState_KeyInserted)
+ {
+
+ PR_LOG( escDLog, PR_LOG_ALWAYS, ("Daemon: Key Inserted: keyID: %s. \n",keyID));
+
+ string fullCommand="";
+ string space = " " ;
+ fullCommand = keyInsertedCommand + space + "keyInserted";
+
+ if(single)
+ single->launchCommand(fullCommand);
+
+ }
+
+ if(keyState == eCKState_KeyRemoved)
+ {
+ PR_LOG( escDLog, PR_LOG_ALWAYS, ("Daemon: Key Removed: keyID: %s. \n",keyID));
+
+ }
+
+ return result;
+}
+
+HRESULT ESC_D::Reference(CoolKeyListener *listener )
+{
+ return S_OK;
+}
+
+HRESULT ESC_D::Release( CoolKeyListener *listener )
+{
+ return S_OK;
+}
+
+void ESC_D::TokenizeArgument(const string& str,
+ vector<string>& tokens,
+ const string& delimiters )
+{
+ string::size_type lastPos = str.find_first_not_of(delimiters, 0);
+
+ string::size_type pos = str.find_first_of(delimiters, lastPos);
+
+ while (string::npos != pos || string::npos != lastPos)
+ {
+ // Found a token, add it to the vector.
+ tokens.push_back(str.substr(lastPos, pos - lastPos));
+ // Skip delimiters. Note the "not_of"
+ lastPos = str.find_first_not_of(delimiters, pos);
+ // Find next "non-delimiter"
+ pos = str.find_first_of(delimiters, lastPos);
+ }
+}
+
+HRESULT ESC_D::launchCommand(string &command)
+{
+ const char *shell = SHELL;
+
+ PR_LOG( escDLog, PR_LOG_ALWAYS, ("Daemon: About to launch command: %s. \n",command.c_str()));
+
+ int already = 0;
+
+ PR_Lock(mDataLock);
+
+
+ already = commandAlreadyLaunched;
+
+ PR_Unlock(mDataLock);
+
+ if(already)
+ {
+ PR_LOG( escDLog, PR_LOG_DEBUG, ("Daemon: About to launch command: Command already running.. \n")) ;
+ return E_FAIL;
+ }
+
+ if(!command.size())
+ {
+ return E_FAIL;
+ }
+
+ int status;
+ pid_t pid;
+
+ PR_Lock(mDataLock);
+
+ commandAlreadyLaunched = 1;
+
+ PR_Unlock(mDataLock);
+
+ pid = fork ();
+ if (pid == 0)
+ {
+ execl (shell, shell, "-c", command.c_str(), NULL);
+ _exit (EXIT_FAILURE);
+ }
+ else if (pid < 0)
+ status = -1;
+ else
+ {
+ if (waitpid (pid, &status, 0) != pid)
+ status = -1;
+ }
+
+ PR_Lock(mDataLock);
+
+
+ commandAlreadyLaunched = 0;
+ PR_LOG( escDLog, PR_LOG_DEBUG, ("Daemon: Child command has exited.. \n")) ;
+
+ PR_Unlock(mDataLock);
+
+ if(status == -1)
+ return E_FAIL;
+
+ return S_OK;
+
+}
+
+void ESC_D::signalHandler(int signal)
+{
+
+ string fullCommand="";
+ string space = " " ;
+
+ PR_LOG( escDLog, PR_LOG_DEBUG, ("Daemon: signalHandler: signal: %d.. \n",signal));
+
+ switch(signal)
+ {
+ case SIGUSR1:
+
+ fullCommand = onSignalCommand + space + signalCommandArg;
+ if(single)
+ {
+ single->launchCommand(fullCommand);
+ }
+
+ break;
+
+ case SIGTERM:
+
+ if(single)
+ single->cleanup();
+
+ break;
+ }
+}
+
+int main(int argc, char **argv)
+{
+
+ pid_t pid;
+
+ // Fork off the parent process
+ pid = fork();
+ if (pid < 0) {
+ exit(1);
+ }
+ if (pid > 0) {
+ exit(0);
+ }
+
+ PR_LOG(escDLog, PR_LOG_ALWAYS, ("Daemon: Initializing Daemon... \n"));
+
+ umask(0);
+
+ ESC_D daemon;
+
+ HRESULT result = daemon.init(argc,argv);
+
+ if(result == E_FAIL)
+ {
+ PR_LOG( escDLog, PR_LOG_ALWAYS, ("Daemon: Error initializing, exiting.. \n"));
+ exit(1);
+ }
+
+ int hresult = CoolKeyInit("./");
+
+ if(hresult == E_FAIL)
+ {
+ PR_LOG( escDLog, PR_LOG_ALWAYS, ("Daemon: Error initializing CoolKey, exiting.. \n"));
+ // exit(1);
+ }
+
+
+ while(1)
+ {
+ usleep(SLEEP_INTERVAL);
+ }
+}
--- ./esc/src/app/xul/esc/chrome/content/esc/GenericAuth.xul.fix14 2006-09-18 20:54:22.000000000 -0700
+++ ./esc/src/app/xul/esc/chrome/content/esc/GenericAuth.xul 2006-09-18 20:57:46.000000000 -0700
@@ -23,6 +23,7 @@
id="esc-auth-window"
title="&genericAuthTitle;"
onload="UiLoad();"
+ onunload="UiUnload();"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<stringbundle id="esc_strings" src="chrome://esc/locale/esc.properties"/>
--- ./esc/src/app/xul/esc/chrome/content/esc/GenericAuth.js.fix14 2006-09-18 20:54:40.000000000 -0700
+++ ./esc/src/app/xul/esc/chrome/content/esc/GenericAuth.js 2006-09-19 09:54:40.000000000 -0700
@@ -25,6 +25,9 @@
var gDescription = null;
var gStringBundle = null;
+var gFormSubmitted = 0;
+
+
loadStringBundle();
function ConfirmPassword(password_element)
@@ -122,9 +125,13 @@
return 1;
}
-function FormSubmit()
+function FormSubmit(noValidate)
{
- var result = Validate();
+ var result = true;
+
+ if(!noValidate)
+ Validate();
+
var thisParent = window.opener;
if(!thisParent)
@@ -185,6 +192,7 @@
}
}
+ gFormSubmitted = 1;
window.close();
}
@@ -630,6 +638,18 @@
}
}
+function UiUnload()
+{
+ if(gFormSubmitted)
+ {
+ return;
+ }
+
+ var noValidate = 1;
+
+ FormSubmit(noValidate);
+}
+
function GetRowsNodeFromGrid(theGrid)
{
if(!theGrid)
--- ./esc/src/app/xul/esc/application.ini.fix14 2006-09-18 20:35:10.000000000 -0700
+++ ./esc/src/app/xul/esc/application.ini 2006-09-18 20:35:21.000000000 -0700
@@ -29,7 +29,7 @@
;
; This field specifies your application's build ID (timestamp). This field is
; required.
-BuildID=00000000012
+BuildID=00000000013
;
; 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
--- ./esc/src/Makefile.fix14 2006-09-18 20:26:15.000000000 -0700
+++ ./esc/src/Makefile 2006-09-18 20:25:38.000000000 -0700
@@ -31,7 +31,7 @@
endif
ifeq ($(OS_ARCH), Linux)
-DIRS += xulrunner lib/notifytray app/xpcom/tray app/xpcom
+DIRS += xulrunner lib/notifytray app/daemon app/xpcom/tray app/xpcom
endif
esc-1.0.0-escd1.patch:
app/daemon/escd.cpp | 65 +++++++++++---
app/daemon/escd.h | 4
app/daemon/manifest.mn | 2
app/xpcom/tray/rhITray.idl | 2
app/xpcom/tray/rhLinuxTray.cpp | 84 ++++++++++++++++---
app/xpcom/tray/rhMacTray.cpp | 7 +
app/xpcom/tray/rhTray.cpp | 7 +
app/xul/esc/chrome/content/esc/AdvancedInfo.js | 4
app/xul/esc/chrome/content/esc/ESC.js | 106 +++++++++++++++++++++---
app/xul/esc/chrome/content/esc/TRAY.js | 29 ++++++
app/xul/esc/chrome/content/esc/advancedinfo.xul | 4
app/xul/esc/chrome/locale/en-US/esc.dtd | 1
app/xul/esc/chrome/locale/en-US/esc.properties | 15 ++-
lib/notifytray/notifyareaicon.c | 51 +++++++++++
lib/notifytray/notifytray.c | 15 +++
15 files changed, 353 insertions(+), 43 deletions(-)
--- NEW FILE esc-1.0.0-escd1.patch ---
--- ./esc/src/lib/notifytray/notifyareaicon.c.fix15 2006-09-22 15:45:35.000000000 -0700
+++ ./esc/src/lib/notifytray/notifyareaicon.c 2006-09-22 15:18:41.000000000 -0700
@@ -16,6 +16,7 @@
* END COPYRIGHT BLOCK **/
#include <string.h>
+#include <unistd.h>
#include <gdk/gdkx.h>
#include "notifyareaicon.h"
@@ -170,6 +171,44 @@
icon->manager_wnd = XGetSelectionOwner (xdisplay, icon->selection_atom);
+ if(icon->manager_wnd == None)
+ {
+
+ /* Let's loop through for up to 7 seconds until the
+ notification applet comes on line */
+
+ const int maxIters = 7;
+ const int sleepInterval = 1000000;
+
+ int i = 0;
+ for(i = 0; i < maxIters ; i++)
+ {
+
+ XUngrabServer (xdisplay);
+ XFlush (xdisplay);
+ g_print("XGetSelectionOwner failed try again iter: %d ... \n",i);
+
+ usleep(sleepInterval);
+
+
+ XGrabServer (xdisplay);
+ icon->manager_wnd = XGetSelectionOwner (xdisplay, icon->selection_atom);
+
+ if(icon->manager_wnd == None)
+ {
+ g_print("XGetSelectionOwner failed try again! \n");
+ }
+ else
+ {
+
+ g_print("XGetSelectionOwner succeeded ! \n");
+ break;
+ }
+
+ }
+
+ }
+
if (icon->manager_wnd != None)
XSelectInput (xdisplay,
icon->manager_wnd, StructureNotifyMask);
@@ -207,6 +246,16 @@
icon = (NotifyAreaIcon *) g_object_new(notify_area_icon_get_type ()
, NULL);
+
+ g_print ("result of g_object_new() %p",icon);
+
+
+ if(!icon)
+ {
+ g_print ("icon is null returning...");
+ return icon;
+ }
+
gtk_window_set_title (GTK_WINDOW (icon), name);
gtk_plug_construct (GTK_PLUG (icon), 0);
@@ -225,6 +274,8 @@
notify_area_icon_update_manager_wnd(icon);
+ g_print ("attempted to update_manager_wnd: %p",(void *)icon->manager_wnd);
+
root = gdk_window_lookup (gdk_x11_get_default_root_xwindow ());
icon->tooltips = gtk_tooltips_new ();
--- ./esc/src/lib/notifytray/notifytray.c.fix15 2006-09-22 15:45:56.000000000 -0700
+++ ./esc/src/lib/notifytray/notifytray.c 2006-09-20 15:16:27.000000000 -0700
@@ -118,11 +118,17 @@
notify_icon_create()
{
if (notify) {
+ g_print ("Notify icon already created!");
return;
}
notify = notify_area_icon_new("coolkey");
+ if(!notify)
+ {
+ g_print ("notify_area_icon_new() failed!");
+ }
+
if(!notify_box)
{
notify_box = gtk_event_box_new();
@@ -155,13 +161,22 @@
int notify_icon_created_ok()
{
if(!notify)
+ {
+ g_print ("notify_icon_created_ok returning 0 because notify is null.");
return 0;
+ }
+
if(notify->manager_wnd)
return 1;
else
+ {
+
+ g_print ("notify_icon_created_ok returning 0 because notify->manager_wnd is null.");
return 0;
+ }
+
}
int notify_icon_show()
--- ./esc/src/app/xpcom/tray/rhTray.cpp.fix15 2006-09-20 15:09:58.000000000 -0700
+++ ./esc/src/app/xpcom/tray/rhTray.cpp 2006-09-20 15:09:20.000000000 -0700
@@ -641,6 +641,13 @@
}
+/* void setmenuitemtext (in unsigned long aIndex, in string aText); */
+NS_IMETHODIMP rhTray::Setmenuitemtext(PRUint32 aIndex, const char *aText)
+{
+ return S_OK;
+}
+
+
//rhTrayWindNotify methods
rhITrayWindNotify* rhTray::GetTrayWindNotifyListener(rhITrayWindNotify *listener)
--- ./esc/src/app/xpcom/tray/rhITray.idl.fix15 2006-09-22 15:38:37.000000000 -0700
+++ ./esc/src/app/xpcom/tray/rhITray.idl 2006-09-20 15:05:06.000000000 -0700
@@ -24,6 +24,8 @@
void setwindnotifycallback(in rhITrayWindNotify jsNotify);
void unsetwindnotifycallback(in rhITrayWindNotify jsNotify);
+ void setmenuitemtext(in unsigned long aIndex, in string aText);
+
};
--- ./esc/src/app/xpcom/tray/rhLinuxTray.cpp.fix15 2006-09-20 15:06:14.000000000 -0700
+++ ./esc/src/app/xpcom/tray/rhLinuxTray.cpp 2006-09-21 20:29:09.000000000 -0700
@@ -420,18 +420,21 @@
if(event->button == 1)
{
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::IconCBProc Clicked!\n"));
+
+ NotifyTrayWindListeners(MENU_EVT,MENU_SHOW);
rhTray::ShowAllListeners();
return;
-
-
}
-
- if(mIconMenu)
+ if(event->button == 2 || event->button == 3)
{
- g_print("trying to create popup menu. \n");
- gtk_menu_popup(GTK_MENU(mIconMenu),
+
+ if(mIconMenu)
+ {
+ g_print("trying to create popup menu. \n");
+ gtk_menu_popup(GTK_MENU(mIconMenu),
NULL,
NULL,
NULL,
@@ -439,7 +442,8 @@
event->button,
event->time);
- }
+ }
+ }
}
@@ -585,6 +589,52 @@
}
+/* void setmenuitemtext (in unsigned long aIndex, in string aText); */
+NS_IMETHODIMP rhTray::Setmenuitemtext(PRUint32 aIndex, const char *aText)
+{
+
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Setmenuitemtext: index: %d text %s. \n",aIndex,aText));
+
+ if(!aText)
+ return S_OK;
+
+ if(!mIconMenu)
+ return S_OK;
+
+ if(aIndex < 0 || aIndex > 10)
+ return S_OK;
+
+ GList *iterate = NULL;
+
+ GList* children = gtk_container_get_children (GTK_CONTAINER (mIconMenu));
+
+ unsigned int i = 0;
+ for (iterate = children; iterate; iterate=iterate->next)
+ {
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Setmenuitemtext: index: %d \n",i));
+ if(aIndex == i)
+ {
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Setmenuitemtext: About to reset text of item %p. \n",(void *) iterate->data));
+ if(iterate->data)
+ {
+ GtkWidget *label = gtk_bin_get_child(GTK_BIN(iterate->data));
+
+ if(label)
+ {
+
+ gtk_label_set_text(GTK_LABEL(label),aText);
+ }
+ }
+
+ break;
+ }
+
+ i++;
+ }
+
+ return S_OK;
+}
+
//rhTrayWindNotify methods
rhITrayWindNotify* rhTray::GetTrayWindNotifyListener(rhITrayWindNotify *listener)
@@ -718,15 +768,27 @@
return S_OK;
}
-
void rhTrayWindowListener::ShowWindow()
{
if(mWnd)
{
- gtk_widget_show(mWnd);
+ GtkWidget *widget = NULL;
+
+ widget = GTK_WIDGET(mWnd);
-
- gtk_window_deiconify(GTK_WINDOW(mWnd));
+ if(widget->window)
+ {
+ if(GTK_WIDGET_VISIBLE(mWnd))
+ {
+ gdk_window_show(widget->window);
+ gdk_window_raise(widget->window);
+
+ }
+ else
+ {
+ gtk_widget_show(widget);
+ }
+ }
PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener:: ShowWindow \n"));
}
--- ./esc/src/app/xpcom/tray/rhMacTray.cpp.fix15 2006-09-20 15:09:37.000000000 -0700
+++ ./esc/src/app/xpcom/tray/rhMacTray.cpp 2006-09-20 15:10:19.000000000 -0700
@@ -503,6 +503,13 @@
}
+/* void setmenuitemtext (in unsigned long aIndex, in string aText); */
+NS_IMETHODIMP rhTray::Setmenuitemtext(PRUint32 aIndex, const char *aText)
+{
+ return S_OK;
+}
+
+
//rhTrayWindNotify methods
rhITrayWindNotify* rhTray::GetTrayWindNotifyListener(rhITrayWindNotify *listener)
--- ./esc/src/app/daemon/escd.h.fix15 2006-09-22 15:36:21.000000000 -0700
+++ ./esc/src/app/daemon/escd.h 2006-09-22 13:49:58.000000000 -0700
@@ -22,6 +22,8 @@
#include <signal.h>
#include "prlock.h"
+#include <X11/Xlib.h>
+
using namespace std;
#include "CoolKey.h"
@@ -42,6 +44,8 @@
static void signalHandler(int signal);
+ static int xIOErrorHandler(Display *display);
+
static ESC_D *single;
PRLock *mDataLock;
--- ./esc/src/app/daemon/manifest.mn.fix15 2006-09-22 15:36:51.000000000 -0700
+++ ./esc/src/app/daemon/manifest.mn 2006-09-22 10:41:03.000000000 -0700
@@ -28,7 +28,7 @@
CPPFLAGS += $(DEFINES) -g
-LDFLAGS += -lstdc++ -L$(CORE_DIST)/$(OBJDIR)/lib -lnss3 -lnspr4 -lssl3 -lckyapplet
+LDFLAGS += -lstdc++ -L$(CORE_DIST)/$(OBJDIR)/lib -lnss3 -lnspr4 -lssl3 -lckyapplet -lX11
LDFLAGS += -lckymanager -lhttpchunked
# MODULE public and private header directories are implicitly REQUIRED.
--- ./esc/src/app/daemon/escd.cpp.fix15 2006-09-19 11:35:19.000000000 -0700
+++ ./esc/src/app/daemon/escd.cpp 2006-09-22 15:02:43.000000000 -0700
@@ -25,13 +25,13 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/wait.h>
+
+
#include "pk11func.h"
#define SHELL "/bin/sh"
#define CORRECT_NUM_ARGS 3
-#define SLEEP_INTERVAL 1000000
-
static PRLogModuleInfo *escDLog = PR_NewLogModule("escDLog");
string ESC_D::keyInsertedCommand("");
@@ -56,16 +56,17 @@
PR_Unlock(mDataLock);
if(already)
{
- PR_LOG( escDLog, PR_LOG_ERROR, ("Daemon: Cannot shutdown! Command is already running. \n"));
-
- return;
-
+ PR_LOG( escDLog, PR_LOG_ERROR, ("Daemon: ! Command is already running. \n"));
}
PR_LOG( escDLog, PR_LOG_ERROR, ("Daemon: Attempting to shut down. \n"));
CoolKeyShutdown();
+ PR_LOG( escDLog, PR_LOG_ERROR, ("Daemon: Past CoolKeyShutdown \n"));
+
+ PR_DestroyLock(mDataLock);
+
if(single)
delete single;
@@ -164,25 +165,31 @@
}
-
CoolKeySetCallbacks(Dispatch,Reference, Release,NULL ,NULL);
CoolKeyRegisterListener((CoolKeyListener *) this);
struct sigaction sigESCD;
+
/* install the signal handler */
sigemptyset(&(sigESCD.sa_mask));
sigaddset(&(sigESCD.sa_mask),SIGUSR1);
sigaddset(&(sigESCD.sa_mask),SIGTERM);
+
+
pthread_sigmask(SIG_UNBLOCK,&(sigESCD.sa_mask),NULL);
sigESCD.sa_handler = ESC_D::signalHandler;
- //sigESCD.sa_mask = 0;
+
sigESCD.sa_flags = 0;
sigESCD.sa_restorer = NULL;
sigaction(SIGUSR1,&sigESCD,NULL);
sigaction(SIGTERM,&sigESCD,NULL);
+ // Install the XWindows IO Error Handler
+
+ XSetIOErrorHandler(ESC_D::xIOErrorHandler);
+
result = S_OK;
return result;
@@ -193,7 +200,7 @@
unsigned long data, const char *strData
)
{
- HRESULT result = 1;
+ HRESULT result = S_OK;
if(keyState == eCKState_KeyInserted)
{
@@ -311,6 +318,18 @@
}
+int ESC_D::xIOErrorHandler(Display *display)
+{
+
+ PR_LOG( escDLog, PR_LOG_ALWAYS, ("Daemon: XIOErrorHandler! We are finished.\n"));
+
+ if(single)
+ single->cleanup();
+
+ return 1;
+}
+
+
void ESC_D::signalHandler(int signal)
{
@@ -368,17 +387,33 @@
exit(1);
}
- int hresult = CoolKeyInit("./");
+ int hresult = CoolKeyInit("./");
if(hresult == E_FAIL)
{
- PR_LOG( escDLog, PR_LOG_ALWAYS, ("Daemon: Error initializing CoolKey, exiting.. \n"));
- // exit(1);
+ PR_LOG( escDLog, PR_LOG_ALWAYS, ("Daemon: Error initializing CoolKey System, this will result in problems recognizing Smart Cards! \n"));
}
-
- while(1)
+
+ //Now become an XWindows program so we can die on user logout
+
+ Display *display;
+ XEvent event;
+
+ display = XOpenDisplay(NULL);
+
+ if(!display)
{
- usleep(SLEEP_INTERVAL);
+ PR_LOG( escDLog, PR_LOG_ALWAYS, ("Daemon: Error Obtaining X Display! \n"));
}
+
+ PR_LOG( escDLog, PR_LOG_ALWAYS, ("Daemon: Attempted XOpenDisplay: %p \n",display));
+ while ("looping forever") XNextEvent(display,&event);
+
+ PR_LOG( escDLog, PR_LOG_ALWAYS, ("Daemon: main exiting.. \n") );
+
+ XCloseDisplay (display);
+
+ return 0;
+
}
--- ./esc/src/app/xul/esc/chrome/content/esc/advancedinfo.xul.fix15 2006-09-22 15:41:43.000000000 -0700
+++ ./esc/src/app/xul/esc/chrome/content/esc/advancedinfo.xul 2006-09-22 10:15:07.000000000 -0700
@@ -26,6 +26,7 @@
title="&escTitle;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+<stringbundle id="esc_strings" src="chrome://esc/locale/esc.properties"/>
<script src="AdvancedInfo.js"/>
<script src="ESC.js"/>
<script src="TRAY.js"/>
@@ -52,7 +53,8 @@
</groupbox>
<hbox >
<spacer flex = "1"/>
-<button id="closebtn" label="Close" oncommand="window.close();" />
+<button id="copytocp" label = "©ToClipboard;" oncommand="DoCopyAdvancedInfoToClipBoard();"/>
+<button id="closebtn" label="&closeNow;" oncommand="window.close();" />
</hbox>
--- ./esc/src/app/xul/esc/chrome/content/esc/TRAY.js.fix15 2006-09-20 15:53:06.000000000 -0700
+++ ./esc/src/app/xul/esc/chrome/content/esc/TRAY.js 2006-09-21 09:33:21.000000000 -0700
@@ -26,6 +26,7 @@
var gWindNotify = null;
+
loadStringBundle();
//
@@ -368,6 +369,33 @@
}
+function SetMenuItemsText()
+{
+
+ var manageKeys=getBundleString("menuManageKeys");
+
+ var exit= getBundleString("menuExit");
+
+ TrayChangeMenuItemText(0,manageKeys);
+ TrayChangeMenuItemText(1,exit);
+
+}
+
+function TrayChangeMenuItemText(aIndex, aText)
+{
+ if(gTray && gBaseWindow)
+ {
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")
+ gTray.setmenuitemtext(aIndex,aText);
+ gTray.showicon();
+ } catch(e) {
+alert("exception " + e);
+ return;
+ }
+
+ }
+}
//String bundling related functions
@@ -388,3 +416,4 @@
return str;
}
+
--- ./esc/src/app/xul/esc/chrome/content/esc/AdvancedInfo.js.fix15 2006-09-22 15:41:09.000000000 -0700
+++ ./esc/src/app/xul/esc/chrome/content/esc/AdvancedInfo.js 2006-09-21 22:17:34.000000000 -0700
@@ -15,10 +15,14 @@
* All rights reserved.
* END COPYRIGHT BLOCK **/
+
+var gDiagnosticsData= "";
+
function ShowAdvancedInfo()
{
var dump = window.arguments[0];
+ gDiagnosticsData=dump;
var frame = window.document.getElementById("advanced-info");
--- ./esc/src/app/xul/esc/chrome/content/esc/ESC.js.fix15 2006-09-20 15:52:47.000000000 -0700
+++ ./esc/src/app/xul/esc/chrome/content/esc/ESC.js 2006-09-22 10:14:17.000000000 -0700
@@ -32,7 +32,7 @@
var gHiddenPageDone = 0;
var gExternalUI = 0;
-var gDiagnosticsCopyString=null;
+var gDiagnosticsCopyString="";
loadStringBundle();
@@ -226,18 +226,27 @@
{
var callback = function (aResult) {
+ var issuer = "";
if(aResult == true)
{
+ issuer = GetCachedIssuer(keyID);
+ if(!issuer)
+ issuer = getBundleString("unknownIssuer");
+ TraySendNotificationMessage(getBundleString("keyInserted"),"\"" + issuer +"\"" + " " + getBundleString("keyInsertedComputer"),3,4000,GetESCNotifyIconPath(keyType,keyID));
UpdateRowWithPhoneHomeData(keyType,keyID);
}
else
{
+ issuer = getBundleString("unknownIssuer");
+ TraySendNotificationMessage(getBundleString("keyInserted"),"\"" + issuer +"\"" + " " + getBundleString("keyInsertedComputer"),3,4000,GetESCNotifyIconPath(keyType,keyID));
//launchCONFIG(keyType,keyID);
}
}
if(IsPhoneHomeCached(keyID))
{
+ issuer = GetCachedIssuer(keyID);
+ TraySendNotificationMessage(getBundleString("keyInserted"),"\"" + issuer +"\"" + " " + getBundleString("keyInsertedComputer"),3,4000,GetESCNotifyIconPath(keyType,keyID));
return true;
}
@@ -833,6 +842,18 @@
dump += "<b>" + getBundleString("issuer") + "</b>" + " " + issuer + "<br>";
var tpsURI = GetCachedTPSURL(keyID);
var tpsUI = GetCachedTPSUI(keyID);
+ var phoneHomeURI = GetCachedPhoneHomeURL(keyID);
+
+ if(!tpsURI)
+ tpsURI="";
+
+ if(!tpsUI)
+ tpsUI = "";
+
+ if(!phoneHomeURI)
+ phoneHomeURI = "";
+
+ dump += "<b>" + getBundleString("tpsPhoneHomeURL") + "</b>" + " " + phoneHomeURI + "<br>";
dump += "<b>" + getBundleString("tpsURI") + "</b>" + " " + tpsURI + "<br>";
dump += "<b>" + getBundleString("tpsUI") + "</b>" + " " + tpsUI + "<br>";
@@ -845,7 +866,7 @@
var lines = ReadESCLog();
- dump += "<hr><b><center>" + getBundleString("escLogEntries") + "</b></center>";
+ dump += "<hr><b><center>" + "***" + getBundleString("escLogEntries") + "***" + "</b></center>";
dump += "<p>";
@@ -866,6 +887,8 @@
dump += "</html>";
+ gDiagnosticsCopyString = dump;
+
var wnd = window.openDialog("chrome://esc/content/advancedinfo.xul","Info","chrome,centerscreen,width=600,height=500,modal=yes",dump);
}
@@ -1845,7 +1868,7 @@
gEnrollmentPage = 1;
UpdateCoolKeyAvailabilityForEnrollment();
UpdateButtonStates();
- showOrHideEscOnLaunch();
+ //showOrHideEscOnLaunch();
window.setTimeout("showOrHideTabsUI()",2);
}
@@ -1853,7 +1876,7 @@
{
UpdateBindingTableAvailability();
UpdateButtonStates();
- showOrHideEscOnLaunch();
+ //showOrHideEscOnLaunch();
}
function InitializeAdminBindingList()
@@ -1863,8 +1886,8 @@
UpdateAdminBindingListAvailability();
UpdateButtonStates();
- showOrHideEscOnLaunch();
- showOrHideTabsUI();
+ //showOrHideEscOnLaunch();
+ //showOrHideTabsUI();
}
//Window related functions
@@ -1877,7 +1900,8 @@
// We do want notify events though
var doPreserveNotify = true;
-
+
+ SetMenuItemsText();
TrayRemoveWindow(doPreserveNotify);
}
@@ -3177,9 +3201,13 @@
if(gHiddenPage)
{
var issuer = GetCachedIssuer(keyID);
- if(!issuer)
- issuer = getBundleString("unknownIssuer");
- TraySendNotificationMessage(getBundleString("keyInserted"),"\"" + issuer +"\"" + " " + getBundleString("keyInsertedComputer"),3,4000,GetESCNotifyIconPath(keyType,keyID));
+ if(!issuer )
+ {
+
+ issuer = getBundleString("unknownIssuer");
+
+ }
+ //TraySendNotificationMessage(getBundleString("keyInserted"),"\"" + issuer +"\"" + " " + getBundleString("keyInsertedComputer"),3,4000,GetESCNotifyIconPath(keyType,keyID));
}
}
@@ -4340,3 +4368,61 @@
}
}
+
+
+//Utility function to sleep for a short time
+
+function Sleep(milliSeconds)
+{
+ var then = new Date(new Date().getTime() + milliSeconds ); while (new Date() < then) {}
+}
+
+
+function DoCopyAdvancedInfoToClipBoard()
+{
+ CopyDataToClipboard(gDiagnosticsData);
+}
+
+
+function CopyDataToClipboard(aData)
+{
+
+ if (!aData)
+ return;
+
+ var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
+
+
+ var html = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
+
+
+ if (!str)
+ return false;
+
+ if(!html)
+ return false;
+
+ html.data = aData;
+
+ str.data = aData;
+
+ var trans = Components.classes["@mozilla.org/widget/transferable;1"]. createInstance(Components.interfaces.nsITransferable);
+
+ if (!trans)
+ return false;
+
+
+ trans.addDataFlavor("text/html");
+ trans.setTransferData("text/html",html,html.data.length * 2);
+ trans.setTransferData("text/unicode",str,str.data.length *2);
+ var clipid = Components.interfaces.nsIClipboard;
+
+ var clip = Components.classes["@mozilla.org/widget/clipboard;1"].getService(clipid);
+
+ if (!clip)
+ return false;
+
+ clip.setData(trans,null,clipid.kGlobalClipboard);
+ MyAlert(getBundleString("dataCopiedToClipboard") );
+
+}
--- ./esc/src/app/xul/esc/chrome/locale/en-US/esc.dtd.fix15 2006-09-22 15:43:52.000000000 -0700
+++ ./esc/src/app/xul/esc/chrome/locale/en-US/esc.dtd 2006-09-21 21:51:11.000000000 -0700
@@ -28,6 +28,7 @@
<!ENTITY progressHeader "Progress">
<!ENTITY unknownIssuer "Unknown Issuer">
<!ENTITY unknown "Unknown">
+<!ENTITY copyToClipboard "Copy To Clipboard">
<!ENTITY cancel "Cancel">
<!ENTITY doEnroll "Enroll">
<!ENTITY doCancel "Cancel">
--- ./esc/src/app/xul/esc/chrome/locale/en-US/esc.properties.fix15 2006-09-22 15:44:11.000000000 -0700
+++ ./esc/src/app/xul/esc/chrome/locale/en-US/esc.properties 2006-09-22 10:11:06.000000000 -0700
@@ -38,12 +38,14 @@
tokenInformation=CARD INFORMATION
advancedInformation=Diagnostics Information
keyID=Key ID:
-tpsURI=Server URL:
-tpsUI=External UI URL:
+tpsURI=Smart Card Server URL:
+tpsUI=Enrollment UI URL:
+tpsPhoneHomeURL=Phone Home URL:
status=Status:
issuer=Issuer:
escLogEntries=Log Entries
-noLogFileOrData=No Log File or Log File Has No Data.
+noLogFileOrData=No log file or log file has no data.
+dataCopiedToClipboard=Data copied to the clipboard.
certsOnToken=CERTIFICATES on KEY
certificateNickname=Certificate Nickname:
coolkeyComponentVersion=Smart Card Manager Version:
@@ -60,9 +62,12 @@
blinkingToken=Blinking..
keyInserted=Smart Card Inserted!
keyRemoved=Smart Card Removed!
-keyInsertedComputer=Security Smart Card Inserted into the computer.
-keyRemovedComputer=Security Smart Card Removed from the computer.
+keyInsertedComputer=smart card inserted.
+keyRemovedComputer=smart card removed.
diagnosticsMessage=The information below is diagnostic information that your system generates as you use your smart card. If you are having smart card problems, you may be asked by your support engineer to send this information for analysis.
+
+menuManageKeys=Manage Smart Cards
+menuExit=Exit Smart Card Manager
#ESC Error Messages from TPS
errorNone=Operation Completed Successfully.
serverError=Smart Card Server error.
Index: esc
===================================================================
RCS file: /cvs/dist/rpms/esc/devel/esc,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- esc 18 Aug 2006 15:47:05 -0000 1.2
+++ esc 23 Sep 2006 01:08:13 -0000 1.3
@@ -1,11 +1,87 @@
#!/bin/sh
-export NSPR_LOG_MODULES=tray:2,coolKeyLib:2,coolKey:2,coolKeyNSS:2,coolKeySmart:2,coolKeyHandler:2
-if [ ! -d ~/.redhat/esc ]
+ESC_PROFILE_BASE=~/.redhat/esc
+ESC_LOG_FILE=esc.log
+
+ESC_PATH=$LIBDIR/esc-1.0.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=$1
+
+XPTI_DAT=xpti.dat
+COMPREG_DAT=compreg.dat
+
+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 {
+
+ if [ -w $1 ]
+ then
+ rm -f $1
+ fi
+}
+
+
+export NSPR_LOG_MODULES=tray:2,coolKeyLib:2,coolKey:2,coolKeyNSS:2,coolKeySmart:2,coolKeyHandler:2,escDLog:5
+
+
+if [ ! -d $ESC_PROFILE_BASE ]
+then
+mkdir -p $ESC_PROFILE_BASE
+fi
+export NSPR_LOG_FILE=$ESC_PROFILE_BASE/$ESC_LOG_FILE
+
+cd $ESC_PATH
+
+isProgRunning $ESC_BIN
+
+if [ $LAST_PROG_PID -gt 0 ]
+then
+./$ESC_EXEC
+exit 0
+fi
+
+if [ $FORCE_START_ESC ]
+then
+./$ESC_EXEC
+exit 0
+fi
+
+
+
+isProgRunning $ESCD_BIN
+
+
+if [ $LAST_PROG_PID -gt 0 ]
then
-mkdir -p ~/.redhat/esc
+kill -$SIGUSR1 $LAST_PROG_PID
+else
+removeFile $ESC_PROFILE_BASE/*default/$XPTI_DAT
+removeFile $ESC_PROFILE_BASE/*default/$COMPREG_DAT
+./$ESCD_EXEC --key_Inserted=\"/usr/bin/esc\" --on_Signal=\"/usr/bin/esc\"
+
fi
-export NSPR_LOG_FILE=~/.redhat/esc/esc.log
-cd $LIBDIR/esc-1.0.0
-./esc
+exit 0
+
+
+
Index: esc.spec
===================================================================
RCS file: /cvs/dist/rpms/esc/devel/esc.spec,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- esc.spec 17 Sep 2006 01:15:21 -0000 1.16
+++ esc.spec 23 Sep 2006 01:08:13 -0000 1.17
@@ -1,6 +1,6 @@
Name: esc
Version: 1.0.0
-Release: 12%{?dist}
+Release: 13%{?dist}
Summary: Enterprise Security Client Smart Card Client
License: GPL
URL: http://directory.fedora.redhat.com/wiki/CoolKey
@@ -19,6 +19,8 @@
Patch11: esc-1.0.0.strings-1-fix.patch
Patch12: esc-1.0.0-ui-enhance-1.patch
Patch13: esc-1.0.0-pw-reset-fix.patch
+Patch14: esc-1.0.0-escd.patch
+Patch15: esc-1.0.0-escd1.patch
BuildRequires: doxygen fontconfig-devel freetype-devel >= 2.1
BuildRequires: glib2-devel libIDL-devel atk-devel gtk2-devel libjpeg-devel
@@ -76,6 +78,8 @@
%patch11 -p1 -b .fix11
%patch12 -p1 -b .fix12
%patch13 -p1 -b .fix13
+%patch14 -p1 -b .fix14
+%patch15 -p1 -b .fix15
#Unpack xulrunner where esc expects it to be.
@@ -151,6 +155,7 @@
%defattr(-,root,root,-)
%{escdir}/esc
+%{escdir}/escd
%{escbindir}/esc
%{escdir}/application.ini
@@ -183,6 +188,9 @@
fi
%changelog
+* Fri Sep 22 2006 Jack Magne <jmagne at redhat.com>- 1.0.0-13
+- Fix to include the new esc daemon.
+
* Sat Sep 16 2006 Jack Magne <jmagne at redhat.com>- 1.0.0-12
- Fix for Password Reset and minor UI revision.
More information about the fedora-cvs-commits
mailing list